From 380a67506dc1a74aac7eff952474b5d62c70e33f Mon Sep 17 00:00:00 2001 From: root Date: Fri, 3 Aug 2012 14:15:43 +0400 Subject: [PATCH] enable disabled autodep patch --- rpm-5.4.9/ABOUT-NLS | 1282 + rpm-5.4.9/CHANGES | 7118 ++ rpm-5.4.9/COPYING.LIB | 510 + rpm-5.4.9/CREDITS | 41 + rpm-5.4.9/Doxyfile.in | 1489 + rpm-5.4.9/Doxyheader | 44 + rpm-5.4.9/INSTALL | 462 + rpm-5.4.9/INSTALL.developer | 148 + rpm-5.4.9/Makefile.am | 290 + rpm-5.4.9/Makefile.in | 1667 + rpm-5.4.9/NEWS | 207 + rpm-5.4.9/README | 22 + rpm-5.4.9/TODO | 162 + rpm-5.4.9/acinclude.m4 | 832 + rpm-5.4.9/aclocal.m4 | 1045 + rpm-5.4.9/autodeps/aix.prov | 78 + rpm-5.4.9/autodeps/aix.req | 171 + rpm-5.4.9/autodeps/aix4.prov | 189 + rpm-5.4.9/autodeps/aix4.req | 99 + rpm-5.4.9/autodeps/amigaos.prov | 3 + rpm-5.4.9/autodeps/amigaos.req | 3 + rpm-5.4.9/autodeps/darwin.prov | 21 + rpm-5.4.9/autodeps/darwin.req | 26 + rpm-5.4.9/autodeps/freebsd.prov | 9 + rpm-5.4.9/autodeps/freebsd.req | 22 + rpm-5.4.9/autodeps/freebsdelf.prov | 9 + rpm-5.4.9/autodeps/freebsdelf.req | 46 + rpm-5.4.9/autodeps/hpux.prov | 175 + rpm-5.4.9/autodeps/hpux.req | 126 + rpm-5.4.9/autodeps/irix6.prov | 201 + rpm-5.4.9/autodeps/irix6.req | 164 + rpm-5.4.9/autodeps/linux.prov | 70 + rpm-5.4.9/autodeps/linux.req | 143 + rpm-5.4.9/autodeps/mint.prov | 5 + rpm-5.4.9/autodeps/mint.req | 5 + rpm-5.4.9/autodeps/none | 3 + rpm-5.4.9/autodeps/openbsd.prov | 9 + rpm-5.4.9/autodeps/openbsd.req | 22 + rpm-5.4.9/autodeps/osf.prov | 188 + rpm-5.4.9/autodeps/osf.req | 142 + rpm-5.4.9/autodeps/solaris.prov | 14 + rpm-5.4.9/autodeps/solaris.req | 16 + rpm-5.4.9/autogen.sh | 80 + rpm-5.4.9/build.c | 369 + rpm-5.4.9/build.h | 19 + rpm-5.4.9/build/Makefile.am | 126 + rpm-5.4.9/build/Makefile.in | 1197 + rpm-5.4.9/build/TODO | 40 + rpm-5.4.9/build/auto/Makefile.am | 22 + rpm-5.4.9/build/auto/Makefile.in | 738 + rpm-5.4.9/build/auto/desc | 97 + rpm-5.4.9/build/auto/desc.in | 97 + rpm-5.4.9/build/auto/types | 289 + rpm-5.4.9/build/auto/types.in | 289 + rpm-5.4.9/build/build.c | 442 + rpm-5.4.9/build/buildio.h | 79 + rpm-5.4.9/build/expression.c | 773 + rpm-5.4.9/build/files.c | 3187 + rpm-5.4.9/build/librpmbuild.vers | 61 + rpm-5.4.9/build/misc.c | 20 + rpm-5.4.9/build/names.c | 228 + rpm-5.4.9/build/pack.c | 1351 + rpm-5.4.9/build/parseBuildInstallClean.c | 91 + rpm-5.4.9/build/parseChangelog.c | 303 + rpm-5.4.9/build/parseDescription.c | 150 + rpm-5.4.9/build/parseFiles.c | 129 + rpm-5.4.9/build/parsePreamble.c | 1234 + rpm-5.4.9/build/parsePrep.c | 955 + rpm-5.4.9/build/parseReqs.c | 204 + rpm-5.4.9/build/parseScript.c | 466 + rpm-5.4.9/build/parseSpec.c | 771 + rpm-5.4.9/build/poptBT.c | 224 + rpm-5.4.9/build/reqprov.c | 218 + rpm-5.4.9/build/rpmbuild.h | 598 + rpm-5.4.9/build/rpmspec.h | 403 + rpm-5.4.9/build/spec.c | 1025 + rpm-5.4.9/config.guess | 1522 + rpm-5.4.9/config.h.in | 1513 + rpm-5.4.9/config.rpath | 672 + rpm-5.4.9/config.sub | 1766 + rpm-5.4.9/configure | 81309 ++++++++++++++++ rpm-5.4.9/configure.ac | 2500 + rpm-5.4.9/cpuinfo.yaml | 124 + rpm-5.4.9/debug.h | 180 + rpm-5.4.9/depcomp | 708 + rpm-5.4.9/doc/Makefile.am | 24 + rpm-5.4.9/doc/Makefile.in | 1066 + rpm-5.4.9/doc/fr/Makefile.am | 21 + rpm-5.4.9/doc/fr/Makefile.in | 820 + rpm-5.4.9/doc/fr/rpm.8 | 462 + rpm-5.4.9/doc/gendiff.1 | 45 + rpm-5.4.9/doc/ja/Makefile.am | 21 + rpm-5.4.9/doc/ja/Makefile.in | 820 + rpm-5.4.9/doc/ja/rpm.8 | 1232 + rpm-5.4.9/doc/ja/rpm2cpio.8 | 45 + rpm-5.4.9/doc/ja/rpmbuild.8 | 315 + rpm-5.4.9/doc/ja/rpmcache.8 | 153 + rpm-5.4.9/doc/ja/rpmgraph.8 | 74 + rpm-5.4.9/doc/ko/Makefile.am | 21 + rpm-5.4.9/doc/ko/Makefile.in | 820 + rpm-5.4.9/doc/ko/rpm.8 | 356 + rpm-5.4.9/doc/ko/rpm2cpio.8 | 31 + rpm-5.4.9/doc/manual/Makefile.am | 21 + rpm-5.4.9/doc/manual/Makefile.in | 732 + rpm-5.4.9/doc/manual/autosignature | 88 + rpm-5.4.9/doc/manual/builddependencies | 178 + rpm-5.4.9/doc/manual/buildroot | 122 + rpm-5.4.9/doc/manual/conditionalbuilds | 104 + rpm-5.4.9/doc/manual/dependencies | 370 + rpm-5.4.9/doc/manual/filetriggers | 88 + rpm-5.4.9/doc/manual/format | 273 + rpm-5.4.9/doc/manual/hregions | 89 + rpm-5.4.9/doc/manual/macros | 277 + rpm-5.4.9/doc/manual/multiplebuilds | 47 + rpm-5.4.9/doc/manual/newrpmdb.howto | 119 + rpm-5.4.9/doc/manual/queryformat | 173 + rpm-5.4.9/doc/manual/relocatable | 57 + rpm-5.4.9/doc/manual/rollbacks | 49 + rpm-5.4.9/doc/manual/signatures | 83 + rpm-5.4.9/doc/manual/spec | 226 + rpm-5.4.9/doc/manual/triggers | 165 + rpm-5.4.9/doc/manual/tsort | 159 + rpm-5.4.9/doc/pl/Makefile.am | 21 + rpm-5.4.9/doc/pl/Makefile.in | 865 + rpm-5.4.9/doc/pl/gendiff.1 | 47 + rpm-5.4.9/doc/pl/rpm.8 | 914 + rpm-5.4.9/doc/pl/rpm2cpio.8 | 25 + rpm-5.4.9/doc/pl/rpmbuild.8 | 245 + rpm-5.4.9/doc/pl/rpmcache.8 | 112 + rpm-5.4.9/doc/pl/rpmdeps.8 | 24 + rpm-5.4.9/doc/pl/rpmgraph.8 | 42 + rpm-5.4.9/doc/rpm.8 | 951 + rpm-5.4.9/doc/rpm2cpio.8 | 21 + rpm-5.4.9/doc/rpmbuild.8 | 252 + rpm-5.4.9/doc/rpmcache.8 | 117 + rpm-5.4.9/doc/rpmconstant.8 | 14 + rpm-5.4.9/doc/rpmdeps.8 | 24 + rpm-5.4.9/doc/rpmmtree.8 | 359 + rpm-5.4.9/doc/ru/Makefile.am | 21 + rpm-5.4.9/doc/ru/Makefile.in | 820 + rpm-5.4.9/doc/ru/rpm.8 | 967 + rpm-5.4.9/doc/ru/rpm2cpio.8 | 26 + rpm-5.4.9/doc/sk/Makefile.am | 21 + rpm-5.4.9/doc/sk/Makefile.in | 820 + rpm-5.4.9/doc/sk/rpm.8 | 636 + rpm-5.4.9/install-sh | 527 + rpm-5.4.9/js/.cvsignore | 13 + rpm-5.4.9/js/Makefile | 2207 + rpm-5.4.9/js/Makefile.am | 347 + rpm-5.4.9/js/Makefile.in | 2207 + rpm-5.4.9/js/gsr.c | 260 + rpm-5.4.9/js/legacy-sol.cudf | 30 + rpm-5.4.9/js/legacy.cudf | 117 + rpm-5.4.9/js/ngsr.c | 281 + rpm-5.4.9/js/rpm-js.h | 47 + rpm-5.4.9/js/rpmaug-js.c | 617 + rpm-5.4.9/js/rpmaug-js.h | 27 + rpm-5.4.9/js/rpmbc-js.c | 244 + rpm-5.4.9/js/rpmbc-js.h | 26 + rpm-5.4.9/js/rpmbf-js.c | 448 + rpm-5.4.9/js/rpmbf-js.h | 26 + rpm-5.4.9/js/rpmcudf-js.c | 376 + rpm-5.4.9/js/rpmcudf-js.h | 26 + rpm-5.4.9/js/rpmdb-js.c | 1819 + rpm-5.4.9/js/rpmdb-js.h | 49 + rpm-5.4.9/js/rpmdbc-js.c | 703 + rpm-5.4.9/js/rpmdbc-js.h | 27 + rpm-5.4.9/js/rpmdbe-js.c | 2521 + rpm-5.4.9/js/rpmdbe-js.h | 27 + rpm-5.4.9/js/rpmdc-js.c | 421 + rpm-5.4.9/js/rpmdc-js.h | 26 + rpm-5.4.9/js/rpmdig-js.c | 240 + rpm-5.4.9/js/rpmdig-js.h | 26 + rpm-5.4.9/js/rpmdir-js.c | 311 + rpm-5.4.9/js/rpmdir-js.h | 26 + rpm-5.4.9/js/rpmds-js.c | 492 + rpm-5.4.9/js/rpmds-js.h | 26 + rpm-5.4.9/js/rpmfc-js.c | 242 + rpm-5.4.9/js/rpmfc-js.h | 26 + rpm-5.4.9/js/rpmfi-js.c | 451 + rpm-5.4.9/js/rpmfi-js.h | 26 + rpm-5.4.9/js/rpmfts-js.c | 618 + rpm-5.4.9/js/rpmfts-js.h | 26 + rpm-5.4.9/js/rpmgi-js.c | 246 + rpm-5.4.9/js/rpmgi-js.h | 26 + rpm-5.4.9/js/rpmhdr-js.c | 534 + rpm-5.4.9/js/rpmhdr-js.h | 27 + rpm-5.4.9/js/rpmio-js.c | 772 + rpm-5.4.9/js/rpmio-js.h | 26 + rpm-5.4.9/js/rpmiob-js.c | 240 + rpm-5.4.9/js/rpmiob-js.h | 26 + rpm-5.4.9/js/rpmjs-debug.h | 94 + rpm-5.4.9/js/rpmjsfile.c | 2970 + rpm-5.4.9/js/rpmjsfile.h | 65 + rpm-5.4.9/js/rpmjsfile.msg | 90 + rpm-5.4.9/js/rpmmc-js.c | 364 + rpm-5.4.9/js/rpmmc-js.h | 26 + rpm-5.4.9/js/rpmmg-js.c | 304 + rpm-5.4.9/js/rpmmg-js.h | 26 + rpm-5.4.9/js/rpmmi-js.c | 440 + rpm-5.4.9/js/rpmmi-js.h | 26 + rpm-5.4.9/js/rpmmpf-js.c | 544 + rpm-5.4.9/js/rpmmpf-js.h | 26 + rpm-5.4.9/js/rpmmpw-js.c | 2508 + rpm-5.4.9/js/rpmmpw-js.h | 26 + rpm-5.4.9/js/rpmps-js.c | 298 + rpm-5.4.9/js/rpmps-js.h | 26 + rpm-5.4.9/js/rpmseq-js.c | 709 + rpm-5.4.9/js/rpmseq-js.h | 26 + rpm-5.4.9/js/rpmsm-js.c | 307 + rpm-5.4.9/js/rpmsm-js.h | 26 + rpm-5.4.9/js/rpmsp-js.c | 285 + rpm-5.4.9/js/rpmsp-js.h | 26 + rpm-5.4.9/js/rpmst-js.c | 349 + rpm-5.4.9/js/rpmst-js.h | 26 + rpm-5.4.9/js/rpmsw-js.c | 242 + rpm-5.4.9/js/rpmsw-js.h | 26 + rpm-5.4.9/js/rpmsx-js.c | 438 + rpm-5.4.9/js/rpmsx-js.h | 26 + rpm-5.4.9/js/rpmsys-js.c | 772 + rpm-5.4.9/js/rpmsys-js.h | 26 + rpm-5.4.9/js/rpmte-js.c | 441 + rpm-5.4.9/js/rpmte-js.h | 26 + rpm-5.4.9/js/rpmts-js.c | 777 + rpm-5.4.9/js/rpmts-js.h | 27 + rpm-5.4.9/js/rpmtxn-js.c | 472 + rpm-5.4.9/js/rpmtxn-js.h | 27 + rpm-5.4.9/js/rpmxar-js.c | 292 + rpm-5.4.9/js/rpmxar-js.h | 26 + rpm-5.4.9/js/syck-js.c | 469 + rpm-5.4.9/js/syck-js.h | 23 + rpm-5.4.9/js/tscripts/.cvsignore | 1 + rpm-5.4.9/js/tscripts/Aug.js | 58 + rpm-5.4.9/js/tscripts/Bc.js | 11 + rpm-5.4.9/js/tscripts/Bf.js | 55 + rpm-5.4.9/js/tscripts/Cudf.js | 59 + rpm-5.4.9/js/tscripts/Db.js | 1019 + rpm-5.4.9/js/tscripts/Dbc.js | 47 + rpm-5.4.9/js/tscripts/Dbe.js | 266 + rpm-5.4.9/js/tscripts/Dc.js | 1050 + rpm-5.4.9/js/tscripts/Dig.js | 11 + rpm-5.4.9/js/tscripts/Dir.js | 39 + rpm-5.4.9/js/tscripts/Ds.js | 84 + rpm-5.4.9/js/tscripts/Fc.js | 11 + rpm-5.4.9/js/tscripts/Fi.js | 89 + rpm-5.4.9/js/tscripts/File.js | 47 + rpm-5.4.9/js/tscripts/Fts.js | 197 + rpm-5.4.9/js/tscripts/Gi.js | 11 + rpm-5.4.9/js/tscripts/Hdr.js | 127 + rpm-5.4.9/js/tscripts/Io.js | 103 + rpm-5.4.9/js/tscripts/Iob.js | 11 + rpm-5.4.9/js/tscripts/Mc.js | 67 + rpm-5.4.9/js/tscripts/Mg.js | 42 + rpm-5.4.9/js/tscripts/Mi.js | 189 + rpm-5.4.9/js/tscripts/Mpf.js | 11 + rpm-5.4.9/js/tscripts/Mpw.js | 2017 + rpm-5.4.9/js/tscripts/Ps.js | 60 + rpm-5.4.9/js/tscripts/Seq.js | 323 + rpm-5.4.9/js/tscripts/Sm.js | 65 + rpm-5.4.9/js/tscripts/Sp.js | 25 + rpm-5.4.9/js/tscripts/St.js | 91 + rpm-5.4.9/js/tscripts/Sw.js | 11 + rpm-5.4.9/js/tscripts/Sx.js | 65 + rpm-5.4.9/js/tscripts/Syck.js | 11 + rpm-5.4.9/js/tscripts/Sys.js | 97 + rpm-5.4.9/js/tscripts/Te.js | 221 + rpm-5.4.9/js/tscripts/Ts.js | 60 + rpm-5.4.9/js/tscripts/Txn.js | 11 + rpm-5.4.9/js/tscripts/Uuid.js | 20 + rpm-5.4.9/js/tscripts/Xar.js | 31 + rpm-5.4.9/js/uuid-js.c | 334 + rpm-5.4.9/js/uuid-js.h | 23 + rpm-5.4.9/lib/Makefile.am | 191 + rpm-5.4.9/lib/Makefile.in | 1305 + rpm-5.4.9/lib/auto/Makefile.am | 21 + rpm-5.4.9/lib/auto/Makefile.in | 738 + rpm-5.4.9/lib/auto/desc | 114 + rpm-5.4.9/lib/auto/desc.in | 114 + rpm-5.4.9/lib/auto/types | 629 + rpm-5.4.9/lib/auto/types.in | 629 + rpm-5.4.9/lib/depends.c | 2061 + rpm-5.4.9/lib/filetriggers.c | 400 + rpm-5.4.9/lib/filetriggers.h | 30 + rpm-5.4.9/lib/formats.c | 305 + rpm-5.4.9/lib/fs.c | 411 + rpm-5.4.9/lib/fs.h | 59 + rpm-5.4.9/lib/fsm.c | 2418 + rpm-5.4.9/lib/fsm.h | 118 + rpm-5.4.9/lib/librpm.vers | 410 + rpm-5.4.9/lib/manifest.c | 201 + rpm-5.4.9/lib/manifest.h | 39 + rpm-5.4.9/lib/misc.c | 84 + rpm-5.4.9/lib/misc.h | 58 + rpm-5.4.9/lib/order.c | 2311 + rpm-5.4.9/lib/poptALL.c | 850 + rpm-5.4.9/lib/poptI.c | 393 + rpm-5.4.9/lib/poptQV.c | 526 + rpm-5.4.9/lib/psm.c | 3155 + rpm-5.4.9/lib/psm.h | 230 + rpm-5.4.9/lib/query.c | 972 + rpm-5.4.9/lib/rpm46compat.h | 309 + rpm-5.4.9/lib/rpm4compat.h | 419 + rpm-5.4.9/lib/rpmal.c | 490 + rpm-5.4.9/lib/rpmal.h | 177 + rpm-5.4.9/lib/rpmchecksig.c | 1373 + rpm-5.4.9/lib/rpmcli.h | 757 + rpm-5.4.9/lib/rpmds.c | 4334 + rpm-5.4.9/lib/rpmds.h | 828 + rpm-5.4.9/lib/rpmfc.c | 2017 + rpm-5.4.9/lib/rpmfc.h | 246 + rpm-5.4.9/lib/rpmfi.c | 2231 + rpm-5.4.9/lib/rpmfi.h | 878 + rpm-5.4.9/lib/rpmgi.c | 872 + rpm-5.4.9/lib/rpmgi.h | 238 + rpm-5.4.9/lib/rpminstall.c | 913 + rpm-5.4.9/lib/rpmlib.h | 42 + rpm-5.4.9/lib/rpmlock.c | 182 + rpm-5.4.9/lib/rpmlock.h | 22 + rpm-5.4.9/lib/rpmluaext.c | 294 + rpm-5.4.9/lib/rpmluaext.h | 25 + rpm-5.4.9/lib/rpmps.c | 426 + rpm-5.4.9/lib/rpmps.h | 324 + rpm-5.4.9/lib/rpmrc.c | 1308 + rpm-5.4.9/lib/rpmrc.h | 66 + rpm-5.4.9/lib/rpmrollback.c | 731 + rpm-5.4.9/lib/rpmrollback.h | 135 + rpm-5.4.9/lib/rpmte.c | 1095 + rpm-5.4.9/lib/rpmte.h | 877 + rpm-5.4.9/lib/rpmts.c | 1543 + rpm-5.4.9/lib/rpmts.h | 1157 + rpm-5.4.9/lib/rpmversion.c | 26 + rpm-5.4.9/lib/rpmversion.h | 154 + rpm-5.4.9/lib/rpmversion.h.in | 154 + rpm-5.4.9/lib/tevr.c | 237 + rpm-5.4.9/lib/tgi.c | 325 + rpm-5.4.9/lib/transaction.c | 2303 + rpm-5.4.9/lib/tsbt.c | 172 + rpm-5.4.9/lib/verify.c | 696 + rpm-5.4.9/ltmain.sh | 9675 ++ rpm-5.4.9/lua/.cvsignore | 12 + rpm-5.4.9/lua/.splintrc | 92 + rpm-5.4.9/lua/COPYRIGHT | 34 + rpm-5.4.9/lua/HISTORY | 183 + rpm-5.4.9/lua/Makefile | 1915 + rpm-5.4.9/lua/Makefile.am | 328 + rpm-5.4.9/lua/Makefile.in | 1915 + rpm-5.4.9/lua/README | 37 + rpm-5.4.9/lua/bin2c.c | 75 + rpm-5.4.9/lua/chkconfig/chkconfig.c | 715 + rpm-5.4.9/lua/chkconfig/leveldb.c | 741 + rpm-5.4.9/lua/chkconfig/leveldb.h | 55 + rpm-5.4.9/lua/lapi.c | 1087 + rpm-5.4.9/lua/lapi.h | 16 + rpm-5.4.9/lua/lauxlib.c | 652 + rpm-5.4.9/lua/lauxlib.h | 174 + rpm-5.4.9/lua/lbaselib.c | 653 + rpm-5.4.9/lua/lcode.c | 839 + rpm-5.4.9/lua/lcode.h | 76 + rpm-5.4.9/lua/ldblib.c | 397 + rpm-5.4.9/lua/ldebug.c | 638 + rpm-5.4.9/lua/ldebug.h | 33 + rpm-5.4.9/lua/ldo.c | 518 + rpm-5.4.9/lua/ldo.h | 57 + rpm-5.4.9/lua/ldump.c | 164 + rpm-5.4.9/lua/lfunc.c | 174 + rpm-5.4.9/lua/lfunc.h | 34 + rpm-5.4.9/lua/lgc.c | 711 + rpm-5.4.9/lua/lgc.h | 110 + rpm-5.4.9/lua/linit.c | 38 + rpm-5.4.9/lua/liolib.c | 553 + rpm-5.4.9/lua/llex.c | 461 + rpm-5.4.9/lua/llex.h | 81 + rpm-5.4.9/lua/llimits.h | 128 + rpm-5.4.9/lua/lmathlib.c | 263 + rpm-5.4.9/lua/lmem.c | 86 + rpm-5.4.9/lua/lmem.h | 49 + rpm-5.4.9/lua/loadlib.c | 666 + rpm-5.4.9/lua/lobject.c | 214 + rpm-5.4.9/lua/lobject.h | 381 + rpm-5.4.9/lua/local/.cvsignore | 2 + rpm-5.4.9/lua/local/lcrypto.c | 725 + rpm-5.4.9/lua/local/lcrypto.h | 51 + rpm-5.4.9/lua/local/llocal.c | 10 + rpm-5.4.9/lua/local/llocal.h | 7 + rpm-5.4.9/lua/local/llocal.lua | 331 + rpm-5.4.9/lua/local/lom.lua | 80 + rpm-5.4.9/lua/local/lposix.c | 1264 + rpm-5.4.9/lua/local/lposix.h | 7 + rpm-5.4.9/lua/local/lrexlib.h | 9 + rpm-5.4.9/lua/local/lrexlib.txt | 669 + rpm-5.4.9/lua/local/lrexlib_algo.h | 666 + rpm-5.4.9/lua/local/lrexlib_common.c | 244 + rpm-5.4.9/lua/local/lrexlib_common.h | 86 + rpm-5.4.9/lua/local/lrexlib_lpcre.c | 443 + rpm-5.4.9/lua/local/lrexlib_lpcre_f.c | 196 + rpm-5.4.9/lua/local/lrexlib_lposix.c | 301 + rpm-5.4.9/lua/local/lshadow.c | 151 + rpm-5.4.9/lua/local/lshadow.h | 7 + rpm-5.4.9/lua/local/lsyck.c | 256 + rpm-5.4.9/lua/local/lsyck.h | 7 + rpm-5.4.9/lua/local/luuid.c | 156 + rpm-5.4.9/lua/local/luuid.h | 7 + rpm-5.4.9/lua/local/lwrs.c | 148 + rpm-5.4.9/lua/local/lwrs.h | 7 + rpm-5.4.9/lua/local/lxplib.c | 565 + rpm-5.4.9/lua/local/lxplib.h | 48 + rpm-5.4.9/lua/lopcodes.c | 102 + rpm-5.4.9/lua/lopcodes.h | 268 + rpm-5.4.9/lua/loslib.c | 243 + rpm-5.4.9/lua/lparser.c | 1339 + rpm-5.4.9/lua/lparser.h | 82 + rpm-5.4.9/lua/lstate.c | 214 + rpm-5.4.9/lua/lstate.h | 169 + rpm-5.4.9/lua/lstring.c | 111 + rpm-5.4.9/lua/lstring.h | 31 + rpm-5.4.9/lua/lstrlib.c | 869 + rpm-5.4.9/lua/ltable.c | 588 + rpm-5.4.9/lua/ltable.h | 40 + rpm-5.4.9/lua/ltablib.c | 287 + rpm-5.4.9/lua/ltests.c | 932 + rpm-5.4.9/lua/ltm.c | 75 + rpm-5.4.9/lua/ltm.h | 54 + rpm-5.4.9/lua/lua.c | 392 + rpm-5.4.9/lua/lua.h | 388 + rpm-5.4.9/lua/luac.c | 200 + rpm-5.4.9/lua/luaconf.h | 774 + rpm-5.4.9/lua/lualib.h | 53 + rpm-5.4.9/lua/lundump.c | 227 + rpm-5.4.9/lua/lundump.h | 36 + rpm-5.4.9/lua/lvm.c | 763 + rpm-5.4.9/lua/lvm.h | 36 + rpm-5.4.9/lua/lzio.c | 82 + rpm-5.4.9/lua/lzio.h | 67 + rpm-5.4.9/lua/print.c | 227 + rpm-5.4.9/lua/shadow/chkname.h | 21 + rpm-5.4.9/lua/shadow/commonio.c | 946 + rpm-5.4.9/lua/shadow/commonio.h | 116 + rpm-5.4.9/lua/shadow/copydir.c | 455 + rpm-5.4.9/lua/shadow/defines.h | 285 + rpm-5.4.9/lua/shadow/faillog.h | 61 + rpm-5.4.9/lua/shadow/fputsx.c | 86 + rpm-5.4.9/lua/shadow/getdef.c | 420 + rpm-5.4.9/lua/shadow/getdef.h | 21 + rpm-5.4.9/lua/shadow/groupadd.c | 651 + rpm-5.4.9/lua/shadow/groupio.c | 205 + rpm-5.4.9/lua/shadow/groupio.h | 19 + rpm-5.4.9/lua/shadow/gshadow.c | 472 + rpm-5.4.9/lua/shadow/gshadow_.h | 77 + rpm-5.4.9/lua/shadow/list.c | 246 + rpm-5.4.9/lua/shadow/nscd.h | 18 + rpm-5.4.9/lua/shadow/prototypes.h | 190 + rpm-5.4.9/lua/shadow/pwauth.h | 64 + rpm-5.4.9/lua/shadow/pwio.c | 195 + rpm-5.4.9/lua/shadow/pwio.h | 19 + rpm-5.4.9/lua/shadow/sgetgrent.c | 144 + rpm-5.4.9/lua/shadow/sgetpwent.c | 123 + rpm-5.4.9/lua/shadow/sgroupio.c | 207 + rpm-5.4.9/lua/shadow/sgroupio.h | 20 + rpm-5.4.9/lua/shadow/shadow_config.h | 260 + rpm-5.4.9/lua/shadow/shadowio.c | 166 + rpm-5.4.9/lua/shadow/shadowio.h | 20 + rpm-5.4.9/lua/shadow/strtoday.c | 1855 + rpm-5.4.9/lua/shadow/useradd.c | 2014 + rpm-5.4.9/lua/socket/auxiliar.c | 149 + rpm-5.4.9/lua/socket/auxiliar.h | 48 + rpm-5.4.9/lua/socket/buffer.c | 268 + rpm-5.4.9/lua/socket/buffer.h | 47 + rpm-5.4.9/lua/socket/except.c | 99 + rpm-5.4.9/lua/socket/except.h | 35 + rpm-5.4.9/lua/socket/ftp.lua | 281 + rpm-5.4.9/lua/socket/http.lua | 350 + rpm-5.4.9/lua/socket/inet.c | 281 + rpm-5.4.9/lua/socket/inet.h | 42 + rpm-5.4.9/lua/socket/io.c | 32 + rpm-5.4.9/lua/socket/io.h | 67 + rpm-5.4.9/lua/socket/ltn12.lua | 292 + rpm-5.4.9/lua/socket/luasocket.c | 118 + rpm-5.4.9/lua/socket/luasocket.h | 32 + rpm-5.4.9/lua/socket/mime.c | 711 + rpm-5.4.9/lua/socket/mime.h | 31 + rpm-5.4.9/lua/socket/mime.lua | 87 + rpm-5.4.9/lua/socket/options.c | 149 + rpm-5.4.9/lua/socket/options.h | 39 + rpm-5.4.9/lua/socket/select.c | 200 + rpm-5.4.9/lua/socket/select.h | 17 + rpm-5.4.9/lua/socket/smtp.lua | 251 + rpm-5.4.9/lua/socket/socket.h | 76 + rpm-5.4.9/lua/socket/socket.lua | 133 + rpm-5.4.9/lua/socket/tcp.c | 339 + rpm-5.4.9/lua/socket/tcp.h | 36 + rpm-5.4.9/lua/socket/timeout.c | 207 + rpm-5.4.9/lua/socket/timeout.h | 30 + rpm-5.4.9/lua/socket/tp.lua | 123 + rpm-5.4.9/lua/socket/udp.c | 336 + rpm-5.4.9/lua/socket/udp.h | 33 + rpm-5.4.9/lua/socket/unix.c | 356 + rpm-5.4.9/lua/socket/unix.h | 28 + rpm-5.4.9/lua/socket/url.lua | 297 + rpm-5.4.9/lua/socket/usocket.c | 370 + rpm-5.4.9/lua/socket/usocket.h | 40 + rpm-5.4.9/lua/socket/wsocket.c | 401 + rpm-5.4.9/lua/socket/wsocket.h | 21 + rpm-5.4.9/m4/gettext.m4 | 383 + rpm-5.4.9/m4/iconv.m4 | 214 + rpm-5.4.9/m4/intlmacosx.m4 | 51 + rpm-5.4.9/m4/lib-ld.m4 | 110 + rpm-5.4.9/m4/lib-link.m4 | 774 + rpm-5.4.9/m4/lib-prefix.m4 | 224 + rpm-5.4.9/m4/libtool.m4 | 7994 ++ rpm-5.4.9/m4/ltoptions.m4 | 384 + rpm-5.4.9/m4/ltsugar.m4 | 123 + rpm-5.4.9/m4/ltversion.m4 | 23 + rpm-5.4.9/m4/lt~obsolete.m4 | 98 + rpm-5.4.9/m4/nls.m4 | 32 + rpm-5.4.9/m4/po.m4 | 449 + rpm-5.4.9/m4/progtest.m4 | 92 + rpm-5.4.9/macros/.cvsignore | 18 + rpm-5.4.9/macros/cmake | 28 + rpm-5.4.9/macros/cmake.in | 28 + rpm-5.4.9/macros/fedora | 291 + rpm-5.4.9/macros/fedora.in | 291 + rpm-5.4.9/macros/gstreamer | 12 + rpm-5.4.9/macros/gstreamer.in | 12 + rpm-5.4.9/macros/java | 20 + rpm-5.4.9/macros/java.in | 20 + rpm-5.4.9/macros/kernel | 12 + rpm-5.4.9/macros/kernel.in | 12 + rpm-5.4.9/macros/libtool | 10 + rpm-5.4.9/macros/libtool.in | 10 + rpm-5.4.9/macros/macros | 1055 + rpm-5.4.9/macros/macros.in | 1055 + rpm-5.4.9/macros/macros.rpmbuild | 660 + rpm-5.4.9/macros/macros.rpmbuild.in | 660 + rpm-5.4.9/macros/mandriva | 499 + rpm-5.4.9/macros/mandriva.in | 499 + rpm-5.4.9/macros/mandriva.in.orig | 499 + rpm-5.4.9/macros/mono | 10 + rpm-5.4.9/macros/mono.in | 10 + rpm-5.4.9/macros/perl | 45 + rpm-5.4.9/macros/perl.in | 45 + rpm-5.4.9/macros/php | 16 + rpm-5.4.9/macros/php.in | 16 + rpm-5.4.9/macros/pkgconfig | 11 + rpm-5.4.9/macros/pkgconfig.in | 11 + rpm-5.4.9/macros/python | 48 + rpm-5.4.9/macros/python.in | 48 + rpm-5.4.9/macros/ruby | 40 + rpm-5.4.9/macros/ruby.in | 40 + rpm-5.4.9/macros/selinux | 41 + rpm-5.4.9/macros/selinux.in | 41 + rpm-5.4.9/macros/suse | 378 + rpm-5.4.9/macros/suse.in | 378 + rpm-5.4.9/macros/tcl | 9 + rpm-5.4.9/macros/tcl.in | 9 + rpm-5.4.9/misc/Makefile.am | 90 + rpm-5.4.9/misc/Makefile.in | 949 + rpm-5.4.9/misc/alloca.c | 504 + rpm-5.4.9/misc/asprintf.c | 91 + rpm-5.4.9/misc/basename.c | 13 + rpm-5.4.9/misc/err.c | 112 + rpm-5.4.9/misc/err.h | 83 + rpm-5.4.9/misc/error.c | 252 + rpm-5.4.9/misc/error.h | 77 + rpm-5.4.9/misc/fakefork.c | 8 + rpm-5.4.9/misc/getcwd.c | 52 + rpm-5.4.9/misc/getdelim.c | 133 + rpm-5.4.9/misc/getline.c | 29 + rpm-5.4.9/misc/getmntent.c | 66 + rpm-5.4.9/misc/getwd.c | 29 + rpm-5.4.9/misc/librpmmisc.c | 78 + rpm-5.4.9/misc/librpmmisc.vers | 407 + rpm-5.4.9/misc/memcmp.c | 373 + rpm-5.4.9/misc/mkdtemp.c | 349 + rpm-5.4.9/misc/mktime.c | 408 + rpm-5.4.9/misc/myrealloc.c | 8 + rpm-5.4.9/misc/putenv.c | 113 + rpm-5.4.9/misc/realpath.c | 147 + rpm-5.4.9/misc/setenv.c | 317 + rpm-5.4.9/misc/setproctitle.c | 193 + rpm-5.4.9/misc/stpcpy.c | 51 + rpm-5.4.9/misc/stpncpy.c | 101 + rpm-5.4.9/misc/strcspn.c | 52 + rpm-5.4.9/misc/strdup.c | 43 + rpm-5.4.9/misc/strerror.c | 21 + rpm-5.4.9/misc/strftime.c | 1054 + rpm-5.4.9/misc/strstr.c | 116 + rpm-5.4.9/misc/strtol.c | 296 + rpm-5.4.9/misc/strtoul.c | 23 + rpm-5.4.9/misc/tempname.h | 38 + rpm-5.4.9/missing | 331 + rpm-5.4.9/mkinstalldirs | 162 + rpm-5.4.9/perl/.cvsignore | 23 + rpm-5.4.9/perl/MANIFEST | 33 + rpm-5.4.9/perl/META.yml | 10 + rpm-5.4.9/perl/Makefile | 783 + rpm-5.4.9/perl/Makefile.PL | 78 + rpm-5.4.9/perl/Makefile.PL.in | 78 + rpm-5.4.9/perl/Makefile.am | 66 + rpm-5.4.9/perl/Makefile.in | 783 + rpm-5.4.9/perl/README | 35 + rpm-5.4.9/perl/RPM.pm | 197 + rpm-5.4.9/perl/RPM.xs | 241 + rpm-5.4.9/perl/RPM/Constant.pm | 67 + rpm-5.4.9/perl/RPM/Dependencies.pm | 113 + rpm-5.4.9/perl/RPM/Files.pm | 125 + rpm-5.4.9/perl/RPM/Header.pm | 229 + rpm-5.4.9/perl/RPM/PackageIterator.pm | 82 + rpm-5.4.9/perl/RPM/Problems.pm | 64 + rpm-5.4.9/perl/RPM/Sign.pm | 195 + rpm-5.4.9/perl/RPM/Spec.pm | 99 + rpm-5.4.9/perl/RPM/Transaction.pm | 169 + rpm-5.4.9/perl/RPM_Constant.xs | 51 + rpm-5.4.9/perl/RPM_Dependencies.xs | 289 + rpm-5.4.9/perl/RPM_Files.xs | 246 + rpm-5.4.9/perl/RPM_Header.xs | 474 + rpm-5.4.9/perl/RPM_PackageIterator.xs | 97 + rpm-5.4.9/perl/RPM_Problems.xs | 70 + rpm-5.4.9/perl/RPM_Spec.xs | 256 + rpm-5.4.9/perl/RPM_Transaction.xs | 569 + rpm-5.4.9/perl/foo.i386.rpm | Bin 0 -> 47815 bytes rpm-5.4.9/perl/hdlist-test.hdr | Bin 0 -> 18528 bytes rpm-5.4.9/perl/rpmxs.c | 221 + rpm-5.4.9/perl/rpmxs.h | 27 + rpm-5.4.9/perl/t/00.pod.coverage.t | 18 + rpm-5.4.9/perl/t/00.pod.t | 14 + rpm-5.4.9/perl/t/01.rpm.t | 27 + rpm-5.4.9/perl/t/02.rpmconstant.t | 12 + rpm-5.4.9/perl/t/03.header.t | 65 + rpm-5.4.9/perl/t/04.transaction.t | 57 + rpm-5.4.9/perl/t/05.packageiterator.t | 48 + rpm-5.4.9/perl/t/06.problems.t | 5 + rpm-5.4.9/perl/t/07.files.t | 12 + rpm-5.4.9/perl/t/08.dependencies.t | 45 + rpm-5.4.9/perl/t/09.spec.t | 21 + rpm-5.4.9/perl/t/10.sign.t | 39 + rpm-5.4.9/perl/t/gnupg/passphrase | 6 + rpm-5.4.9/perl/t/gnupg/pubring.gpg | Bin 0 -> 1233 bytes rpm-5.4.9/perl/t/gnupg/random_seed | Bin 0 -> 600 bytes rpm-5.4.9/perl/t/gnupg/secring.gpg | Bin 0 -> 1371 bytes rpm-5.4.9/perl/t/gnupg/test-key.gpg | 26 + rpm-5.4.9/perl/t/gnupg/trustdb.gpg | Bin 0 -> 1320 bytes rpm-5.4.9/perl/test-rpm-1.0-1.noarch.rpm | Bin 0 -> 2143 bytes rpm-5.4.9/perl/test-rpm-1.0-1.src.rpm | Bin 0 -> 1866 bytes rpm-5.4.9/perl/test-rpm.spec | 32 + rpm-5.4.9/perl/typemap | 94 + rpm-5.4.9/po/LINGUAS | 27 + rpm-5.4.9/po/Makefile.in.in | 444 + rpm-5.4.9/po/Makevars | 41 + rpm-5.4.9/po/POTFILES.in | 156 + rpm-5.4.9/po/Rules-quot | 47 + rpm-5.4.9/po/boldquot.sed | 10 + rpm-5.4.9/po/cs.gmo | Bin 0 -> 32828 bytes rpm-5.4.9/po/cs.po | 8281 ++ rpm-5.4.9/po/da.gmo | Bin 0 -> 125190 bytes rpm-5.4.9/po/da.po | 7252 ++ rpm-5.4.9/po/de.gmo | Bin 0 -> 62372 bytes rpm-5.4.9/po/de.po | 7823 ++ rpm-5.4.9/po/en@boldquot.header | 25 + rpm-5.4.9/po/en@quot.header | 22 + rpm-5.4.9/po/eo.gmo | Bin 0 -> 127356 bytes rpm-5.4.9/po/eo.po | 7156 ++ rpm-5.4.9/po/es.gmo | Bin 0 -> 65504 bytes rpm-5.4.9/po/es.po | 7711 ++ rpm-5.4.9/po/fi.gmo | Bin 0 -> 143902 bytes rpm-5.4.9/po/fi.po | 7302 ++ rpm-5.4.9/po/fr.gmo | Bin 0 -> 50213 bytes rpm-5.4.9/po/fr.po | 8858 ++ rpm-5.4.9/po/id.gmo | Bin 0 -> 103286 bytes rpm-5.4.9/po/id.po | 7954 ++ rpm-5.4.9/po/insert-header.sin | 23 + rpm-5.4.9/po/is.gmo | Bin 0 -> 8477 bytes rpm-5.4.9/po/is.po | 7570 ++ rpm-5.4.9/po/it.gmo | Bin 0 -> 10340 bytes rpm-5.4.9/po/it.po | 7967 ++ rpm-5.4.9/po/ja.gmo | Bin 0 -> 67621 bytes rpm-5.4.9/po/ja.po | 8305 ++ rpm-5.4.9/po/ko.gmo | Bin 0 -> 41574 bytes rpm-5.4.9/po/ko.po | 8486 ++ rpm-5.4.9/po/nb.gmo | Bin 0 -> 23427 bytes rpm-5.4.9/po/nb.po | 7995 ++ rpm-5.4.9/po/nl.gmo | Bin 0 -> 105155 bytes rpm-5.4.9/po/nl.po | 7406 ++ rpm-5.4.9/po/pa.gmo | Bin 0 -> 3255 bytes rpm-5.4.9/po/pa.po | 7061 ++ rpm-5.4.9/po/pl.gmo | Bin 0 -> 138445 bytes rpm-5.4.9/po/pl.po | 7185 ++ rpm-5.4.9/po/pt.gmo | Bin 0 -> 62652 bytes rpm-5.4.9/po/pt.po | 7785 ++ rpm-5.4.9/po/pt_BR.gmo | Bin 0 -> 5284 bytes rpm-5.4.9/po/pt_BR.po | 9044 ++ rpm-5.4.9/po/quot.sed | 6 + rpm-5.4.9/po/remove-potcdate.sin | 19 + rpm-5.4.9/po/rpm.pot | 7016 ++ rpm-5.4.9/po/ru.gmo | Bin 0 -> 49796 bytes rpm-5.4.9/po/ru.po | 7935 ++ rpm-5.4.9/po/sk.gmo | Bin 0 -> 23093 bytes rpm-5.4.9/po/sk.po | 7342 ++ rpm-5.4.9/po/sl.gmo | Bin 0 -> 15654 bytes rpm-5.4.9/po/sl.po | 9395 ++ rpm-5.4.9/po/sr.gmo | Bin 0 -> 10819 bytes rpm-5.4.9/po/sr.po | 7305 ++ rpm-5.4.9/po/stamp-po | 1 + rpm-5.4.9/po/sv.gmo | Bin 0 -> 133824 bytes rpm-5.4.9/po/sv.po | 7168 ++ rpm-5.4.9/po/tr.gmo | Bin 0 -> 46934 bytes rpm-5.4.9/po/tr.po | 8592 ++ rpm-5.4.9/po/uk.gmo | Bin 0 -> 60799 bytes rpm-5.4.9/po/uk.po | 8067 ++ rpm-5.4.9/po/vi.gmo | Bin 0 -> 156145 bytes rpm-5.4.9/po/vi.po | 7267 ++ rpm-5.4.9/po/zh_TW.gmo | Bin 0 -> 133078 bytes rpm-5.4.9/po/zh_TW.po | 7117 ++ rpm-5.4.9/pubkeys/JBJ-GPG-KEY | 24 + rpm-5.4.9/python/.cvsignore | 10 + rpm-5.4.9/python/.splintrc | 94 + rpm-5.4.9/python/ChangeLog | 5 + rpm-5.4.9/python/Makefile | 1132 + rpm-5.4.9/python/Makefile.am | 68 + rpm-5.4.9/python/Makefile.in | 1132 + rpm-5.4.9/python/header-py.c | 1057 + rpm-5.4.9/python/header-py.h | 114 + rpm-5.4.9/python/mpw/.cvsignore | 3 + rpm-5.4.9/python/mpw/Makefile.am | 5 + rpm-5.4.9/python/mpw/test/.cvsignore | 3 + rpm-5.4.9/python/mpw/test/Makefile.am | 14 + rpm-5.4.9/python/mpw/test/test_all.py | 59 + rpm-5.4.9/python/mpw/test/test_methods.py | 322 + rpm-5.4.9/python/mpw/test/unittest.py | 759 + rpm-5.4.9/python/pow.py | 8 + rpm-5.4.9/python/rng.py | 23 + rpm-5.4.9/python/rpm/.cvsignore | 1 + rpm-5.4.9/python/rpm/__init__.py | 9 + rpm-5.4.9/python/rpmal-py.c | 198 + rpm-5.4.9/python/rpmal-py.h | 42 + rpm-5.4.9/python/rpmbc-py.h | 27 + rpm-5.4.9/python/rpmdb-py.c | 328 + rpm-5.4.9/python/rpmdb-py.h | 60 + rpm-5.4.9/python/rpmdebug-py.c | 85 + rpm-5.4.9/python/rpmds-py.c | 871 + rpm-5.4.9/python/rpmds-py.h | 68 + rpm-5.4.9/python/rpmfd-py.c | 349 + rpm-5.4.9/python/rpmfd-py.h | 41 + rpm-5.4.9/python/rpmfi-py.c | 637 + rpm-5.4.9/python/rpmfi-py.h | 57 + rpm-5.4.9/python/rpmfts-py.c | 587 + rpm-5.4.9/python/rpmfts-py.h | 42 + rpm-5.4.9/python/rpmkeyring-py.c | 228 + rpm-5.4.9/python/rpmkeyring-py.h | 45 + rpm-5.4.9/python/rpmmacro-py.c | 178 + rpm-5.4.9/python/rpmmacro-py.h | 49 + rpm-5.4.9/python/rpmmi-py.c | 285 + rpm-5.4.9/python/rpmmi-py.h | 44 + rpm-5.4.9/python/rpmmodule.c | 611 + rpm-5.4.9/python/rpmmpw-py.h | 54 + rpm-5.4.9/python/rpmps-py.c | 419 + rpm-5.4.9/python/rpmps-py.h | 51 + rpm-5.4.9/python/rpmrng-py.h | 30 + rpm-5.4.9/python/rpmtd-py.c | 285 + rpm-5.4.9/python/rpmtd-py.h | 40 + rpm-5.4.9/python/rpmte-py.c | 508 + rpm-5.4.9/python/rpmte-py.h | 42 + rpm-5.4.9/python/rpmts-py.c | 1713 + rpm-5.4.9/python/rpmts-py.h | 54 + rpm-5.4.9/python/spec-py.c | 227 + rpm-5.4.9/python/spec-py.h | 44 + rpm-5.4.9/python/sub.py | 53 + rpm-5.4.9/python/system.h | 30 + rpm-5.4.9/python/test/dsMerge.py | 39 + rpm-5.4.9/python/test/dscmp | 25 + rpm-5.4.9/python/test/psTest.py | 51 + rpm-5.4.9/python/test/resources/.cvsignore | 1 + .../python/test/resources/missingreq.spec | 13 + rpm-5.4.9/python/test/resources/provider.spec | 31 + rpm-5.4.9/python/test/resources/requirer.spec | 31 + rpm-5.4.9/python/test/resources/reqver.spec | 13 + rpm-5.4.9/python/test/resources/simple.spec | 15 + rpm-5.4.9/python/test/test_rpm.py | 47 + rpm-5.4.9/python/test/testhdr | 44 + rpm-5.4.9/python/test/testit | 22 + rpm-5.4.9/python/test/testmi | 20 + rpm-5.4.9/python/test/testrollback.py | 14 + rpm-5.4.9/rpm.magic | 21 + rpm-5.4.9/rpm.spec.in | 666 + rpm-5.4.9/rpmconstant/Makefile.am | 75 + rpm-5.4.9/rpmconstant/Makefile.in | 1039 + rpm-5.4.9/rpmconstant/constant.c | 106 + rpm-5.4.9/rpmconstant/librpmconstant.vers | 7 + rpm-5.4.9/rpmconstant/rpmconstant.c | 194 + rpm-5.4.9/rpmconstant/rpmconstant.h | 206 + rpm-5.4.9/rpmconstant/rpmconstant_internal.c | 60 + rpm-5.4.9/rpmconstant/rpmconstanttbl.c | 1398 + rpm-5.4.9/rpmconstant/rpmh2tbl | 235 + rpm-5.4.9/rpmdb/DB_CONFIG.in | 40 + rpm-5.4.9/rpmdb/Makefile.am | 285 + rpm-5.4.9/rpmdb/Makefile.in | 1554 + rpm-5.4.9/rpmdb/auto/Makefile.am | 23 + rpm-5.4.9/rpmdb/auto/Makefile.in | 739 + rpm-5.4.9/rpmdb/auto/desc | 109 + rpm-5.4.9/rpmdb/auto/desc.in | 109 + rpm-5.4.9/rpmdb/auto/types | 425 + rpm-5.4.9/rpmdb/auto/types.in | 425 + rpm-5.4.9/rpmdb/bdb.sql | 70 + rpm-5.4.9/rpmdb/db3.c | 2748 + rpm-5.4.9/rpmdb/db_emu.h | 123 + rpm-5.4.9/rpmdb/dbconfig.c | 676 + rpm-5.4.9/rpmdb/fprint.c | 399 + rpm-5.4.9/rpmdb/fprint.h | 164 + rpm-5.4.9/rpmdb/hdrNVR.c | 354 + rpm-5.4.9/rpmdb/hdrfmt.c | 6800 ++ rpm-5.4.9/rpmdb/header.c | 2322 + rpm-5.4.9/rpmdb/header_internal.c | 69 + rpm-5.4.9/rpmdb/header_internal.h | 145 + rpm-5.4.9/rpmdb/legacy.c | 290 + rpm-5.4.9/rpmdb/legacy.h | 38 + rpm-5.4.9/rpmdb/librpmdb.vers | 263 + rpm-5.4.9/rpmdb/logio.awk | 1111 + rpm-5.4.9/rpmdb/logio.c | 514 + rpm-5.4.9/rpmdb/logio.h | 100 + rpm-5.4.9/rpmdb/logio.src | 148 + rpm-5.4.9/rpmdb/logio_auto.c | 2897 + rpm-5.4.9/rpmdb/logio_auto.h | 199 + rpm-5.4.9/rpmdb/logio_autop.c | 897 + rpm-5.4.9/rpmdb/logio_rec.c | 1397 + rpm-5.4.9/rpmdb/logio_recover_template | 58 + rpm-5.4.9/rpmdb/logio_template | 4656 + rpm-5.4.9/rpmdb/merge.c | 360 + rpm-5.4.9/rpmdb/package.c | 417 + rpm-5.4.9/rpmdb/pkgio.c | 1681 + rpm-5.4.9/rpmdb/pkgio.h | 99 + rpm-5.4.9/rpmdb/poptDB.c | 62 + rpm-5.4.9/rpmdb/rpmdb.c | 3019 + rpm-5.4.9/rpmdb/rpmdb.h | 1479 + rpm-5.4.9/rpmdb/rpmdpkg.c | 74 + rpm-5.4.9/rpmdb/rpmdpkg.h | 53 + rpm-5.4.9/rpmdb/rpmevr.c | 467 + rpm-5.4.9/rpmdb/rpmevr.h | 217 + rpm-5.4.9/rpmdb/rpmlio.c | 444 + rpm-5.4.9/rpmdb/rpmlio.h | 68 + rpm-5.4.9/rpmdb/rpmmdb.c | 62 + rpm-5.4.9/rpmdb/rpmmdb.h | 86 + rpm-5.4.9/rpmdb/rpmns.c | 607 + rpm-5.4.9/rpmdb/rpmns.h | 145 + rpm-5.4.9/rpmdb/rpmrepo.c | 1905 + rpm-5.4.9/rpmdb/rpmrepo.h | 305 + rpm-5.4.9/rpmdb/rpmtag.h | 1247 + rpm-5.4.9/rpmdb/rpmtd.c | 522 + rpm-5.4.9/rpmdb/rpmtd.h | 380 + rpm-5.4.9/rpmdb/rpmtxn.c | 139 + rpm-5.4.9/rpmdb/rpmtxn.h | 57 + rpm-5.4.9/rpmdb/rpmtypes.h | 99 + rpm-5.4.9/rpmdb/rpmwf.c | 361 + rpm-5.4.9/rpmdb/rpmwf.h | 130 + rpm-5.4.9/rpmdb/signature.c | 985 + rpm-5.4.9/rpmdb/signature.h | 84 + rpm-5.4.9/rpmdb/sqlite.c | 2002 + rpm-5.4.9/rpmdb/tagname.c | 515 + rpm-5.4.9/rpmdb/tagtbl.c | 241 + rpm-5.4.9/rpmdb/tjfn.c | 278 + rpm-5.4.9/rpmio/Makefile.am | 493 + rpm-5.4.9/rpmio/Makefile.in | 2211 + rpm-5.4.9/rpmio/TODO | 46 + rpm-5.4.9/rpmio/ar.c | 325 + rpm-5.4.9/rpmio/ar.h | 70 + rpm-5.4.9/rpmio/argv.c | 332 + rpm-5.4.9/rpmio/argv.h | 243 + rpm-5.4.9/rpmio/arirang.c | 737 + rpm-5.4.9/rpmio/arirang.h | 56 + rpm-5.4.9/rpmio/auto/Makefile.am | 21 + rpm-5.4.9/rpmio/auto/Makefile.in | 738 + rpm-5.4.9/rpmio/auto/desc | 184 + rpm-5.4.9/rpmio/auto/desc.in | 184 + rpm-5.4.9/rpmio/auto/types | 1848 + rpm-5.4.9/rpmio/auto/types.in | 1848 + rpm-5.4.9/rpmio/blake.c | 792 + rpm-5.4.9/rpmio/blake.h | 61 + rpm-5.4.9/rpmio/bmw.c | 730 + rpm-5.4.9/rpmio/bmw.h | 75 + rpm-5.4.9/rpmio/bsdiff.c | 496 + rpm-5.4.9/rpmio/bson.c | 1340 + rpm-5.4.9/rpmio/bson.h | 1005 + rpm-5.4.9/rpmio/bspatch.c | 239 + rpm-5.4.9/rpmio/bzdio.c | 497 + rpm-5.4.9/rpmio/chi.c | 966 + rpm-5.4.9/rpmio/chi.h | 88 + rpm-5.4.9/rpmio/cpio.c | 314 + rpm-5.4.9/rpmio/cpio.h | 80 + rpm-5.4.9/rpmio/crc.c | 463 + rpm-5.4.9/rpmio/crc.h | 95 + rpm-5.4.9/rpmio/cubehash.c | 226 + rpm-5.4.9/rpmio/cubehash.h | 64 + rpm-5.4.9/rpmio/digest.c | 1015 + rpm-5.4.9/rpmio/dumpasn1.c | 2378 + rpm-5.4.9/rpmio/echo.c | 877 + rpm-5.4.9/rpmio/echo.h | 66 + rpm-5.4.9/rpmio/edon-r.c | 679 + rpm-5.4.9/rpmio/edon-r.h | 47 + rpm-5.4.9/rpmio/envvar.h | 75 + rpm-5.4.9/rpmio/fnmatch.c | 384 + rpm-5.4.9/rpmio/fnmatch.h | 75 + rpm-5.4.9/rpmio/fnmatch_loop.c | 1244 + rpm-5.4.9/rpmio/fts.c | 1349 + rpm-5.4.9/rpmio/fts.h | 221 + rpm-5.4.9/rpmio/fugue.c | 564 + rpm-5.4.9/rpmio/fugue.h | 68 + rpm-5.4.9/rpmio/gengpg.h | 32 + rpm-5.4.9/rpmio/gengpg.sh | 84 + rpm-5.4.9/rpmio/getdate.c | 2922 + rpm-5.4.9/rpmio/getdate.y | 1070 + rpm-5.4.9/rpmio/glob.c | 1268 + rpm-5.4.9/rpmio/glob.h | 224 + rpm-5.4.9/rpmio/groestl.c | 394 + rpm-5.4.9/rpmio/groestl.h | 62 + rpm-5.4.9/rpmio/gzdio.c | 467 + rpm-5.4.9/rpmio/hamsi.c | 3439 + rpm-5.4.9/rpmio/hamsi.h | 57 + rpm-5.4.9/rpmio/iosm.c | 2821 + rpm-5.4.9/rpmio/iosm.h | 476 + rpm-5.4.9/rpmio/jh.c | 1041 + rpm-5.4.9/rpmio/jh.h | 74 + rpm-5.4.9/rpmio/keccak.c | 4081 + rpm-5.4.9/rpmio/keccak.h | 77 + rpm-5.4.9/rpmio/lane.c | 3085 + rpm-5.4.9/rpmio/lane.h | 58 + rpm-5.4.9/rpmio/librpmio.vers | 999 + rpm-5.4.9/rpmio/lookup3.c | 975 + rpm-5.4.9/rpmio/lsyck.c | 295 + rpm-5.4.9/rpmio/luffa.c | 1666 + rpm-5.4.9/rpmio/luffa.h | 60 + rpm-5.4.9/rpmio/macro.c | 3463 + rpm-5.4.9/rpmio/md2.c | 240 + rpm-5.4.9/rpmio/md2.h | 100 + rpm-5.4.9/rpmio/md6.c | 1343 + rpm-5.4.9/rpmio/md6.h | 451 + rpm-5.4.9/rpmio/mire.c | 599 + rpm-5.4.9/rpmio/mire.h | 331 + rpm-5.4.9/rpmio/mongo.c | 2563 + rpm-5.4.9/rpmio/mongo.h | 755 + rpm-5.4.9/rpmio/mount.c | 28 + rpm-5.4.9/rpmio/poptIO.c | 1041 + rpm-5.4.9/rpmio/poptIO.h | 102 + rpm-5.4.9/rpmio/rpmacl.c | 139 + rpm-5.4.9/rpmio/rpmacl.h | 25 + rpm-5.4.9/rpmio/rpmasn.c | 110 + rpm-5.4.9/rpmio/rpmasn.h | 99 + rpm-5.4.9/rpmio/rpmaug.c | 834 + rpm-5.4.9/rpmio/rpmaug.h | 243 + rpm-5.4.9/rpmio/rpmbag.c | 95 + rpm-5.4.9/rpmio/rpmbag.h | 105 + rpm-5.4.9/rpmio/rpmbc.c | 1052 + rpm-5.4.9/rpmio/rpmbc.h | 77 + rpm-5.4.9/rpmio/rpmbf.c | 225 + rpm-5.4.9/rpmio/rpmbf.h | 203 + rpm-5.4.9/rpmio/rpmborg.c | 275 + rpm-5.4.9/rpmio/rpmbz.h | 290 + rpm-5.4.9/rpmio/rpmcb.h | 26 + rpm-5.4.9/rpmio/rpmcdsa.c | 587 + rpm-5.4.9/rpmio/rpmcdsa.h | 79 + rpm-5.4.9/rpmio/rpmcpio.c | 690 + rpm-5.4.9/rpmio/rpmcpio.h | 113 + rpm-5.4.9/rpmio/rpmcudf.c | 693 + rpm-5.4.9/rpmio/rpmcudf.h | 189 + rpm-5.4.9/rpmio/rpmcurl.c | 387 + rpm-5.4.9/rpmio/rpmcvs.c | 56 + rpm-5.4.9/rpmio/rpmcvs.h | 84 + rpm-5.4.9/rpmio/rpmdav.c | 2326 + rpm-5.4.9/rpmio/rpmdav.h | 209 + rpm-5.4.9/rpmio/rpmdir.c | 525 + rpm-5.4.9/rpmio/rpmdir.h | 229 + rpm-5.4.9/rpmio/rpmdpkg.c | 444 + rpm-5.4.9/rpmio/rpmficl.c | 164 + rpm-5.4.9/rpmio/rpmficl.h | 109 + rpm-5.4.9/rpmio/rpmgc.c | 723 + rpm-5.4.9/rpmio/rpmgc.h | 67 + rpm-5.4.9/rpmio/rpmgenbasedir.c | 133 + rpm-5.4.9/rpmio/rpmgenpkglist.c | 88 + rpm-5.4.9/rpmio/rpmgensrclist.c | 80 + rpm-5.4.9/rpmio/rpmgit.c | 820 + rpm-5.4.9/rpmio/rpmgit.h | 155 + rpm-5.4.9/rpmio/rpmgpg.c | 229 + rpm-5.4.9/rpmio/rpmhash.c | 292 + rpm-5.4.9/rpmio/rpmhash.h | 155 + rpm-5.4.9/rpmio/rpmhkp.c | 1161 + rpm-5.4.9/rpmio/rpmhkp.h | 142 + rpm-5.4.9/rpmio/rpmhook.c | 288 + rpm-5.4.9/rpmio/rpmhook.h | 51 + rpm-5.4.9/rpmio/rpmio-stub.c | 95 + rpm-5.4.9/rpmio/rpmio-stub.h | 76 + rpm-5.4.9/rpmio/rpmio.c | 3357 + rpm-5.4.9/rpmio/rpmio.h | 861 + rpm-5.4.9/rpmio/rpmio_internal.h | 668 + rpm-5.4.9/rpmio/rpmiob.c | 194 + rpm-5.4.9/rpmio/rpmiotypes.h | 655 + rpm-5.4.9/rpmio/rpmjs.c | 426 + rpm-5.4.9/rpmio/rpmjs.h | 151 + rpm-5.4.9/rpmio/rpmjsio.c | 2960 + rpm-5.4.9/rpmio/rpmjsio.h | 56 + rpm-5.4.9/rpmio/rpmjsio.msg | 90 + rpm-5.4.9/rpmio/rpmkeyring.c | 195 + rpm-5.4.9/rpmio/rpmkeyring.h | 121 + rpm-5.4.9/rpmio/rpmku.c | 249 + rpm-5.4.9/rpmio/rpmku.h | 51 + rpm-5.4.9/rpmio/rpmlog.c | 296 + rpm-5.4.9/rpmio/rpmlog.h | 348 + rpm-5.4.9/rpmio/rpmltc.c | 923 + rpm-5.4.9/rpmio/rpmltc.h | 54 + rpm-5.4.9/rpmio/rpmlua.c | 1282 + rpm-5.4.9/rpmio/rpmlua.h | 179 + rpm-5.4.9/rpmio/rpmmacro.h | 314 + rpm-5.4.9/rpmio/rpmmalloc.c | 331 + rpm-5.4.9/rpmio/rpmmg.c | 168 + rpm-5.4.9/rpmio/rpmmg.h | 109 + rpm-5.4.9/rpmio/rpmnix.c | 3921 + rpm-5.4.9/rpmio/rpmnix.h | 499 + rpm-5.4.9/rpmio/rpmnss.c | 1314 + rpm-5.4.9/rpmio/rpmnss.h | 69 + rpm-5.4.9/rpmio/rpmodbc.c | 1277 + rpm-5.4.9/rpmio/rpmodbc.h | 218 + rpm-5.4.9/rpmio/rpmpbzip2.c | 1983 + rpm-5.4.9/rpmio/rpmperl.c | 178 + rpm-5.4.9/rpmio/rpmperl.h | 95 + rpm-5.4.9/rpmio/rpmpgp.c | 1636 + rpm-5.4.9/rpmio/rpmpgp.h | 1917 + rpm-5.4.9/rpmio/rpmpigz.c | 3404 + rpm-5.4.9/rpmio/rpmpython.c | 195 + rpm-5.4.9/rpmio/rpmpython.h | 107 + rpm-5.4.9/rpmio/rpmrpc.c | 2422 + rpm-5.4.9/rpmio/rpmruby.c | 145 + rpm-5.4.9/rpmio/rpmruby.h | 151 + rpm-5.4.9/rpmio/rpmsm.c | 478 + rpm-5.4.9/rpmio/rpmsm.h | 127 + rpm-5.4.9/rpmio/rpmsp.c | 166 + rpm-5.4.9/rpmio/rpmsp.h | 91 + rpm-5.4.9/rpmio/rpmsq.c | 813 + rpm-5.4.9/rpmio/rpmsq.h | 167 + rpm-5.4.9/rpmio/rpmsql.c | 5539 ++ rpm-5.4.9/rpmio/rpmsql.h | 611 + rpm-5.4.9/rpmio/rpmsquirrel.c | 178 + rpm-5.4.9/rpmio/rpmsquirrel.h | 108 + rpm-5.4.9/rpmio/rpmssl.c | 739 + rpm-5.4.9/rpmio/rpmssl.h | 75 + rpm-5.4.9/rpmio/rpmsvn.c | 95 + rpm-5.4.9/rpmio/rpmsvn.h | 101 + rpm-5.4.9/rpmio/rpmsw.c | 314 + rpm-5.4.9/rpmio/rpmsw.h | 157 + rpm-5.4.9/rpmio/rpmsx.c | 291 + rpm-5.4.9/rpmio/rpmsx.h | 150 + rpm-5.4.9/rpmio/rpmsyck.c | 158 + rpm-5.4.9/rpmio/rpmsyck.h | 90 + rpm-5.4.9/rpmio/rpmtar.c | 1403 + rpm-5.4.9/rpmio/rpmtar.h | 171 + rpm-5.4.9/rpmio/rpmtcl.c | 196 + rpm-5.4.9/rpmio/rpmtcl.h | 109 + rpm-5.4.9/rpmio/rpmtpm.c | 168 + rpm-5.4.9/rpmio/rpmtpm.h | 110 + rpm-5.4.9/rpmio/rpmurl.h | 246 + rpm-5.4.9/rpmio/rpmuuid.c | 113 + rpm-5.4.9/rpmio/rpmuuid.h | 28 + rpm-5.4.9/rpmio/rpmxar.c | 423 + rpm-5.4.9/rpmio/rpmxar.h | 148 + rpm-5.4.9/rpmio/rpmz.c | 2012 + rpm-5.4.9/rpmio/rpmz.h | 318 + rpm-5.4.9/rpmio/rpmzlog.c | 228 + rpm-5.4.9/rpmio/rpmzlog.h | 88 + rpm-5.4.9/rpmio/rpmzq.c | 1005 + rpm-5.4.9/rpmio/rpmzq.h | 546 + rpm-5.4.9/rpmio/salsa10.c | 261 + rpm-5.4.9/rpmio/salsa10.h | 97 + rpm-5.4.9/rpmio/salsa20.c | 261 + rpm-5.4.9/rpmio/salsa20.h | 97 + rpm-5.4.9/rpmio/set.c | 1500 + rpm-5.4.9/rpmio/set.h | 102 + rpm-5.4.9/rpmio/shabal.c | 764 + rpm-5.4.9/rpmio/shabal.h | 71 + rpm-5.4.9/rpmio/shavite3.c | 1173 + rpm-5.4.9/rpmio/shavite3.h | 68 + rpm-5.4.9/rpmio/simd.c | 751 + rpm-5.4.9/rpmio/simd.h | 55 + rpm-5.4.9/rpmio/skein.c | 1635 + rpm-5.4.9/rpmio/skein.h | 439 + rpm-5.4.9/rpmio/strcasecmp.c | 48 + rpm-5.4.9/rpmio/strtolocale.c | 79 + rpm-5.4.9/rpmio/tar.c | 520 + rpm-5.4.9/rpmio/tar.h | 87 + rpm-5.4.9/rpmio/tasn.c | 47 + rpm-5.4.9/rpmio/tdir.c | 135 + rpm-5.4.9/rpmio/testit.sh | 16 + rpm-5.4.9/rpmio/tfts.c | 354 + rpm-5.4.9/rpmio/tget.c | 361 + rpm-5.4.9/rpmio/tgit.c | 937 + rpm-5.4.9/rpmio/tglob.c | 88 + rpm-5.4.9/rpmio/thkp.c | 171 + rpm-5.4.9/rpmio/thtml.c | 904 + rpm-5.4.9/rpmio/tib3.c | 708 + rpm-5.4.9/rpmio/tib3.h | 89 + rpm-5.4.9/rpmio/tiger.c | 855 + rpm-5.4.9/rpmio/tiger.h | 97 + rpm-5.4.9/rpmio/tinv.c | 516 + rpm-5.4.9/rpmio/tkey.c | 212 + rpm-5.4.9/rpmio/tmagic.c | 81 + rpm-5.4.9/rpmio/tmire.c | 79 + rpm-5.4.9/rpmio/todbc.c | 296 + rpm-5.4.9/rpmio/tperl.c | 67 + rpm-5.4.9/rpmio/tput.c | 158 + rpm-5.4.9/rpmio/tpw.c | 39 + rpm-5.4.9/rpmio/tpython.c | 54 + rpm-5.4.9/rpmio/trpmio.c | 55 + rpm-5.4.9/rpmio/tsexp.c | 1776 + rpm-5.4.9/rpmio/tsvn.c | 31 + rpm-5.4.9/rpmio/tsw.c | 25 + rpm-5.4.9/rpmio/ttcl.c | 54 + rpm-5.4.9/rpmio/ttpm.c | 3056 + rpm-5.4.9/rpmio/ugid.c | 205 + rpm-5.4.9/rpmio/ugid.h | 36 + rpm-5.4.9/rpmio/url.c | 674 + rpm-5.4.9/rpmio/xzdio.c | 489 + rpm-5.4.9/rpmio/yarn.c | 578 + rpm-5.4.9/rpmio/yarn.h | 184 + rpm-5.4.9/rpmpopt.in | 459 + rpm-5.4.9/rpmqv.c | 1135 + rpm-5.4.9/ruby/.cvsignore | 10 + rpm-5.4.9/ruby/Makefile | 1124 + rpm-5.4.9/ruby/Makefile.am | 84 + rpm-5.4.9/ruby/Makefile.in | 1124 + rpm-5.4.9/ruby/package-rb.c | 51 + rpm-5.4.9/ruby/package-rb.h | 55 + rpm-5.4.9/ruby/rpm-rb.c | 59 + rpm-5.4.9/ruby/rpm-rb.h | 50 + rpm-5.4.9/ruby/rpmds-rb.c | 279 + rpm-5.4.9/ruby/rpmds-rb.h | 26 + rpm-5.4.9/ruby/rpmexceptions.rb | 20 + rpm-5.4.9/ruby/rpmfi-rb.c | 388 + rpm-5.4.9/ruby/rpmfi-rb.h | 33 + rpm-5.4.9/ruby/rpmhdr-rb.c | 266 + rpm-5.4.9/ruby/rpmhdr-rb.h | 26 + rpm-5.4.9/ruby/rpmmc-rb.c | 356 + rpm-5.4.9/ruby/rpmmc-rb.h | 63 + rpm-5.4.9/ruby/rpmmi-rb.c | 171 + rpm-5.4.9/ruby/rpmmi-rb.h | 26 + rpm-5.4.9/ruby/rpmps-rb.c | 186 + rpm-5.4.9/ruby/rpmps-rb.h | 29 + rpm-5.4.9/ruby/rpmte-rb.c | 157 + rpm-5.4.9/ruby/rpmte-rb.h | 29 + rpm-5.4.9/ruby/rpmts-rb.c | 360 + rpm-5.4.9/ruby/rpmts-rb.h | 32 + rpm-5.4.9/ruby/spec-rb.c | 226 + rpm-5.4.9/ruby/spec-rb.h | 59 + rpm-5.4.9/ruby/system.h | 41 + rpm-5.4.9/ruby/test/Rakefile | 9 + rpm-5.4.9/ruby/test/core | Bin 0 -> 1007616 bytes rpm-5.4.9/ruby/test/fixtures/Foo-1.0 | 0 rpm-5.4.9/ruby/test/fixtures/barsource1 | 0 rpm-5.4.9/ruby/test/fixtures/foosource1 | 0 rpm-5.4.9/ruby/test/fixtures/foosource1.tar | Bin 0 -> 10240 bytes rpm-5.4.9/ruby/test/fixtures/macros | 3 + rpm-5.4.9/ruby/test/fixtures/mock.spec | 39 + rpm-5.4.9/ruby/test/unit/test_rpmmc.rb | 73 + rpm-5.4.9/ruby/test/unit/test_spec.rb | 111 + rpm-5.4.9/ruby/trb.c | 205 + rpm-5.4.9/ruby/tscripts/Ds.rb | 33 + rpm-5.4.9/ruby/tscripts/Fi.rb | 65 + rpm-5.4.9/ruby/tscripts/Hdr.rb | 116 + rpm-5.4.9/ruby/tscripts/Mc.rb | 64 + rpm-5.4.9/ruby/tscripts/Mi.rb | 31 + rpm-5.4.9/ruby/tscripts/Ps.rb | 59 + rpm-5.4.9/ruby/tscripts/Te.rb | 17 + rpm-5.4.9/ruby/tscripts/Ts.rb | 25 + rpm-5.4.9/scripts/Makefile.am | 111 + rpm-5.4.9/scripts/Makefile.in | 1121 + rpm-5.4.9/scripts/Specfile.pm | 193 + rpm-5.4.9/scripts/URPM-Makefile.PL.in | 131 + rpm-5.4.9/scripts/URPM-Makefile.am | 89 + rpm-5.4.9/scripts/api-sanity-autotest.pl | 20018 ++++ rpm-5.4.9/scripts/api-sanity-checker.pl | 20124 ++++ rpm-5.4.9/scripts/brp-compress | 56 + rpm-5.4.9/scripts/brp-implant-ident-static | 35 + rpm-5.4.9/scripts/brp-java-gcjcompile | 41 + rpm-5.4.9/scripts/brp-java-repack-jars | 97 + rpm-5.4.9/scripts/brp-nobuildrootpath | 21 + rpm-5.4.9/scripts/brp-python-bytecompile | 26 + rpm-5.4.9/scripts/brp-sparc64-linux | 41 + rpm-5.4.9/scripts/brp-strip | 21 + rpm-5.4.9/scripts/brp-strip-comment-note | 28 + rpm-5.4.9/scripts/brp-strip-shared | 26 + rpm-5.4.9/scripts/brp-strip-static-archive | 21 + rpm-5.4.9/scripts/check-files | 24 + rpm-5.4.9/scripts/check-java-closure.sh | 28 + rpm-5.4.9/scripts/check-multiarch-files | 91 + rpm-5.4.9/scripts/cpanflute | 173 + rpm-5.4.9/scripts/cpanflute2 | 160 + rpm-5.4.9/scripts/cross-build | 17 + rpm-5.4.9/scripts/dbconvert.sh | 170 + rpm-5.4.9/scripts/deb_Packages | 35 + rpm-5.4.9/scripts/deb_Sources | 41 + rpm-5.4.9/scripts/deb_control | 20 + rpm-5.4.9/scripts/deb_md5sums | 7 + rpm-5.4.9/scripts/deb_postinst | 6 + rpm-5.4.9/scripts/deb_postrm | 6 + rpm-5.4.9/scripts/deb_preinst | 6 + rpm-5.4.9/scripts/deb_prerm | 6 + rpm-5.4.9/scripts/executabledeps.sh | 19 + rpm-5.4.9/scripts/find-debuginfo.sh | 352 + rpm-5.4.9/scripts/find-lang.sh | 221 + rpm-5.4.9/scripts/find-php-provides | 21 + rpm-5.4.9/scripts/find-php-requires | 31 + rpm-5.4.9/scripts/find-prov.pl | 223 + rpm-5.4.9/scripts/find-provides.ksyms | 9 + rpm-5.4.9/scripts/find-provides.perl | 4 + rpm-5.4.9/scripts/find-provides.php | 19 + rpm-5.4.9/scripts/find-req.pl | 211 + rpm-5.4.9/scripts/find-requires.ksyms | 48 + rpm-5.4.9/scripts/find-requires.perl | 4 + rpm-5.4.9/scripts/find-requires.php | 46 + rpm-5.4.9/scripts/freshen.sh | 82 + rpm-5.4.9/scripts/gem_helper.rb | 173 + rpm-5.4.9/scripts/gendiff | 44 + rpm-5.4.9/scripts/getpo.sh | 40 + rpm-5.4.9/scripts/gstreamer.sh | 71 + rpm-5.4.9/scripts/http.req | 165 + rpm-5.4.9/scripts/java.prov.sh | 56 + rpm-5.4.9/scripts/java.req.sh | 67 + rpm-5.4.9/scripts/javadeps.sh | 117 + rpm-5.4.9/scripts/kmod-deps.sh | 61 + rpm-5.4.9/scripts/kmodtool | 258 + rpm-5.4.9/scripts/libtooldeps.sh | 42 + rpm-5.4.9/scripts/makeshlibs | 6 + rpm-5.4.9/scripts/mgo | 53 + rpm-5.4.9/scripts/mkmultiarch | 91 + rpm-5.4.9/scripts/mono-find-provides | 42 + rpm-5.4.9/scripts/mono-find-requires | 86 + rpm-5.4.9/scripts/multiarch-dispatch | 31 + rpm-5.4.9/scripts/multiarch-dispatch.h | 172 + rpm-5.4.9/scripts/multiarch-platform | 14 + rpm-5.4.9/scripts/nix_meta | 11 + rpm-5.4.9/scripts/osgideps.pl | 203 + rpm-5.4.9/scripts/perl.prov | 199 + rpm-5.4.9/scripts/perl.req | 259 + rpm-5.4.9/scripts/perldeps.pl | 392 + rpm-5.4.9/scripts/php.prov | 17 + rpm-5.4.9/scripts/php.req | 78 + rpm-5.4.9/scripts/pkgconfigdeps.sh | 61 + rpm-5.4.9/scripts/pom2spec | 568 + rpm-5.4.9/scripts/pythondeps.sh | 22 + rpm-5.4.9/scripts/pythoneggs.py | 213 + rpm-5.4.9/scripts/rpm.daily | 3 + rpm-5.4.9/scripts/rpm.log | 5 + rpm-5.4.9/scripts/rpm.pc.in | 18 + rpm-5.4.9/scripts/rpm.xinetd | 16 + rpm-5.4.9/scripts/rpm2cpio | 51 + rpm-5.4.9/scripts/rpmdb_loadcvt | 69 + rpm-5.4.9/scripts/rpmdiff | 903 + rpm-5.4.9/scripts/rpmdiff.cgi | 590 + rpm-5.4.9/scripts/rpmsort | 76 + rpm-5.4.9/scripts/rt-reloc-wrapper.sh | 12 + rpm-5.4.9/scripts/ruby-config | 57 + rpm-5.4.9/scripts/rubygems.rb | 115 + rpm-5.4.9/scripts/sql.prov | 115 + rpm-5.4.9/scripts/sql.req | 108 + rpm-5.4.9/scripts/symclash.py | 117 + rpm-5.4.9/scripts/symclash.sh | 7 + rpm-5.4.9/scripts/symset-table | 40 + rpm-5.4.9/scripts/tcl.req | 101 + rpm-5.4.9/scripts/tgpg | 36 + rpm-5.4.9/scripts/trpm | 333 + rpm-5.4.9/scripts/u_pkg.sh | 84 + rpm-5.4.9/scripts/vcheck | 2776 + rpm-5.4.9/scripts/vpkg-provides.sh | 398 + rpm-5.4.9/scripts/vpkg-provides2.sh | 120 + rpm-5.4.9/scripts/wdj_l10n_sqlite | 14 + rpm-5.4.9/scripts/wdj_srpm | 3 + rpm-5.4.9/scripts/wdj_srpm_mongo | 25 + rpm-5.4.9/scripts/wnh_filelists_mongo | 17 + rpm-5.4.9/scripts/wnh_filelists_yaml | 16 + rpm-5.4.9/scripts/wnh_other_mongo | 21 + rpm-5.4.9/scripts/wnh_other_yaml | 19 + rpm-5.4.9/scripts/wnh_primary_mongo | 58 + rpm-5.4.9/scripts/wnh_primary_yaml | 58 + rpm-5.4.9/scripts/xiu_stdenv | 12 + rpm-5.4.9/scripts/yum_filelists_sqlite | 11 + rpm-5.4.9/scripts/yum_filelists_xml | 10 + rpm-5.4.9/scripts/yum_other_sqlite | 16 + rpm-5.4.9/scripts/yum_other_xml | 12 + rpm-5.4.9/scripts/yum_primary_sqlite | 55 + rpm-5.4.9/scripts/yum_primary_xml | 82 + rpm-5.4.9/syck/.cvsignore | 20 + rpm-5.4.9/syck/CHANGELOG | 194 + rpm-5.4.9/syck/COPYING | 54 + rpm-5.4.9/syck/Makefile.am | 7 + rpm-5.4.9/syck/Makefile.in | 768 + rpm-5.4.9/syck/README | 105 + rpm-5.4.9/syck/README.BYTECODE | 484 + rpm-5.4.9/syck/README.EXT | 444 + rpm-5.4.9/syck/RELEASE | 123 + rpm-5.4.9/syck/TODO | 25 + rpm-5.4.9/syck/aclocal.m4 | 9603 ++ rpm-5.4.9/syck/autogen.sh | 51 + rpm-5.4.9/syck/autom4te.cache/output.0 | 14670 +++ rpm-5.4.9/syck/autom4te.cache/output.1 | 14666 +++ rpm-5.4.9/syck/autom4te.cache/requests | 293 + rpm-5.4.9/syck/autom4te.cache/traces.0 | 2460 + rpm-5.4.9/syck/autom4te.cache/traces.1 | 573 + rpm-5.4.9/syck/bootstrap | 7 + rpm-5.4.9/syck/config.h.in | 88 + rpm-5.4.9/syck/config/.cvsignore | 7 + rpm-5.4.9/syck/config/README | 14 + rpm-5.4.9/syck/config/config.guess | 1522 + rpm-5.4.9/syck/config/config.sub | 1766 + rpm-5.4.9/syck/config/depcomp | 708 + rpm-5.4.9/syck/config/install-sh | 527 + rpm-5.4.9/syck/config/ltmain.sh | 9675 ++ rpm-5.4.9/syck/config/missing | 331 + rpm-5.4.9/syck/config/ylwrap | 226 + rpm-5.4.9/syck/configure | 14666 +++ rpm-5.4.9/syck/configure.ac | 36 + rpm-5.4.9/syck/debug.h | 13 + rpm-5.4.9/syck/ext/cocoa/Info.plist | 30 + rpm-5.4.9/syck/ext/cocoa/README | 7 + .../syck/ext/cocoa/YAML.xcode/project.pbxproj | 513 + rpm-5.4.9/syck/ext/cocoa/YAML_Prefix.pch | 8 + .../Base64 AltiVec algorithm info.rtf | 243 + .../src/Base64 NSData code/Documentation.html | 0 .../Base64 NSData code/GSNSDataExtensions.h | 58 + .../Base64 NSData code/GSNSDataExtensions.m | 619 + .../GSNSDataExtensions/CompositePage.html | 95 + .../GSNSDataExtensions.html | 30 + .../GSNSDataExtensions/Methods/Methods.html | 77 + .../GSNSDataExtensions/index.html | 11 + .../GSNSDataExtensions/toc.html | 19 + rpm-5.4.9/syck/ext/cocoa/src/SyckInput.m | 244 + rpm-5.4.9/syck/ext/cocoa/src/YAML.h | 26 + rpm-5.4.9/syck/ext/cocoa/src/YAMLCategories.h | 51 + rpm-5.4.9/syck/ext/cocoa/src/YAMLCategories.m | 431 + .../syck/ext/cocoa/src/YAMLCocoaCategories.h | 39 + .../syck/ext/cocoa/src/YAMLCocoaCategories.m | 282 + rpm-5.4.9/syck/ext/cocoa/src/YamlController.h | 11 + rpm-5.4.9/syck/ext/cocoa/src/main.c | 3 + rpm-5.4.9/syck/ext/lua/Makefile | 29 + rpm-5.4.9/syck/ext/lua/lsyck.c | 258 + rpm-5.4.9/syck/ext/lua/lunit.lua | 698 + rpm-5.4.9/syck/ext/lua/test.lua | 81 + rpm-5.4.9/syck/ext/lua/yaml.lua | 37 + rpm-5.4.9/syck/ext/php/Makefile.in | 8 + rpm-5.4.9/syck/ext/php/config.m4 | 52 + rpm-5.4.9/syck/ext/php/make_module.sh | 6 + rpm-5.4.9/syck/ext/php/php_syck.h | 82 + rpm-5.4.9/syck/ext/php/phpext.c | 310 + rpm-5.4.9/syck/ext/php/syck.ini | 2 + rpm-5.4.9/syck/ext/php/syck.php | 73 + rpm-5.4.9/syck/ext/php/tests/001.phpt | 24 + .../syck/ext/python/XmlYaml/README_yaml2xml | 84 + .../ext/python/XmlYaml/convertyaml_map.py | 178 + .../ext/python/XmlYaml/convertyaml_seq.py | 177 + rpm-5.4.9/syck/ext/python/XmlYaml/people.xml | 46 + rpm-5.4.9/syck/ext/python/pyext.c | 503 + rpm-5.4.9/syck/ext/python/setup.py | 13 + rpm-5.4.9/syck/ext/python/tests/basic.py | 583 + rpm-5.4.9/syck/ext/python/tests/ypath_test.py | 21 + .../syck/ext/python/tests/ypath_test.yml | 221 + rpm-5.4.9/syck/ext/python/yaml2xml.py | 238 + rpm-5.4.9/syck/ext/python/ydump.py | 386 + rpm-5.4.9/syck/ext/python/ypath.py | 515 + rpm-5.4.9/syck/ext/ruby/CHANGELOG | 303 + rpm-5.4.9/syck/ext/ruby/README | 400 + rpm-5.4.9/syck/ext/ruby/ext/syck/MANIFEST | 1 + rpm-5.4.9/syck/ext/ruby/ext/syck/extconf.rb | 9 + rpm-5.4.9/syck/ext/ruby/ext/syck/rubyext.c | 2388 + rpm-5.4.9/syck/ext/ruby/install.rb | 1022 + rpm-5.4.9/syck/ext/ruby/lib/okay.rb | 161 + rpm-5.4.9/syck/ext/ruby/lib/okay/news.rb | 69 + rpm-5.4.9/syck/ext/ruby/lib/okay/rpc.rb | 434 + rpm-5.4.9/syck/ext/ruby/lib/yaml.rb | 437 + .../syck/ext/ruby/lib/yaml/baseemitter.rb | 247 + rpm-5.4.9/syck/ext/ruby/lib/yaml/basenode.rb | 216 + rpm-5.4.9/syck/ext/ruby/lib/yaml/compat.rb | 26 + rpm-5.4.9/syck/ext/ruby/lib/yaml/constants.rb | 45 + rpm-5.4.9/syck/ext/ruby/lib/yaml/dbm.rb | 111 + rpm-5.4.9/syck/ext/ruby/lib/yaml/emitter.rb | 107 + rpm-5.4.9/syck/ext/ruby/lib/yaml/encoding.rb | 33 + rpm-5.4.9/syck/ext/ruby/lib/yaml/error.rb | 34 + rpm-5.4.9/syck/ext/ruby/lib/yaml/rubytypes.rb | 407 + rpm-5.4.9/syck/ext/ruby/lib/yaml/store.rb | 29 + rpm-5.4.9/syck/ext/ruby/lib/yaml/stream.rb | 40 + rpm-5.4.9/syck/ext/ruby/lib/yaml/stringio.rb | 83 + rpm-5.4.9/syck/ext/ruby/lib/yaml/syck.rb | 19 + rpm-5.4.9/syck/ext/ruby/lib/yaml/tag.rb | 89 + rpm-5.4.9/syck/ext/ruby/lib/yaml/types.rb | 195 + rpm-5.4.9/syck/ext/ruby/lib/yaml/yamlnode.rb | 54 + rpm-5.4.9/syck/ext/ruby/lib/yaml/ypath.rb | 52 + .../syck/ext/ruby/samples/okayNews-modules.rb | 27 + .../syck/ext/ruby/samples/okayNews-sample.rb | 336 + .../ext/ruby/samples/okayNews-validate.rb | 341 + .../syck/ext/ruby/samples/okayRpc-client.rb | 51 + .../syck/ext/ruby/samples/okayRpc-server.rb | 85 + .../ext/ruby/samples/yaml-sortHashKeys.rb | 128 + rpm-5.4.9/syck/ext/ruby/tests/basic.rb | 1656 + .../syck/ext/ruby/yts/YtsAnchorAlias.yml | 51 + rpm-5.4.9/syck/ext/ruby/yts/YtsBasicTests.yml | 282 + .../syck/ext/ruby/yts/YtsBlockMapping.yml | 78 + .../syck/ext/ruby/yts/YtsBlockSequence.yml | 0 .../ext/ruby/yts/YtsDocumentSeparator.yml | 102 + rpm-5.4.9/syck/ext/ruby/yts/YtsErrorTests.yml | 23 + .../syck/ext/ruby/yts/YtsFlowCollections.yml | 73 + .../syck/ext/ruby/yts/YtsFoldedScalars.yml | 233 + rpm-5.4.9/syck/ext/ruby/yts/YtsMapInSeq.yml | 0 .../syck/ext/ruby/yts/YtsNullsAndEmpties.yml | 118 + rpm-5.4.9/syck/ext/ruby/yts/YtsRubyTests.yml | 182 + .../ext/ruby/yts/YtsSpecificationExamples.yml | 2724 + .../syck/ext/ruby/yts/YtsTypeTransfers.yml | 265 + rpm-5.4.9/syck/ext/ruby/yts/YtsYpath.yml | 221 + rpm-5.4.9/syck/ext/ruby/yts/cookbook.rb | 159 + rpm-5.4.9/syck/ext/ruby/yts/index.yml | 10 + rpm-5.4.9/syck/ext/ruby/yts/yts.rb | 193 + rpm-5.4.9/syck/ext/yamlbyte/Makefile | 3 + rpm-5.4.9/syck/ext/yamlbyte/yamlbyte.h | 170 + rpm-5.4.9/syck/ext/yamlbyte/ybext.c | 222 + rpm-5.4.9/syck/lib/.cvsignore | 9 + rpm-5.4.9/syck/lib/.splintrc | 84 + rpm-5.4.9/syck/lib/Makefile.am | 80 + rpm-5.4.9/syck/lib/Makefile.in | 600 + rpm-5.4.9/syck/lib/bytecode.c | 1178 + rpm-5.4.9/syck/lib/bytecode.re | 524 + rpm-5.4.9/syck/lib/emitter.c | 1287 + rpm-5.4.9/syck/lib/gram.y | 484 + rpm-5.4.9/syck/lib/handler.c | 181 + rpm-5.4.9/syck/lib/implicit.c | 2997 + rpm-5.4.9/syck/lib/implicit.re | 206 + rpm-5.4.9/syck/lib/node.c | 417 + rpm-5.4.9/syck/lib/syck.c | 529 + rpm-5.4.9/syck/lib/syck.h | 635 + rpm-5.4.9/syck/lib/syck_st.c | 537 + rpm-5.4.9/syck/lib/syck_st.h | 84 + rpm-5.4.9/syck/lib/token.c | 2752 + rpm-5.4.9/syck/lib/token.re | 1158 + rpm-5.4.9/syck/lib/yaml2byte.c | 274 + rpm-5.4.9/syck/lib/yamlbyte.h | 182 + rpm-5.4.9/syck/system.h | 78 + rpm-5.4.9/syck/tests/.cvsignore | 8 + rpm-5.4.9/syck/tests/Basic.c | 143 + rpm-5.4.9/syck/tests/CuTest.c | 292 + rpm-5.4.9/syck/tests/CuTest.h | 86 + rpm-5.4.9/syck/tests/Emit.c | 86 + rpm-5.4.9/syck/tests/Makefile.am | 14 + rpm-5.4.9/syck/tests/Makefile.in | 631 + rpm-5.4.9/syck/tests/Parse.c | 206 + rpm-5.4.9/syck/tests/YTS.c | 2579 + rpm-5.4.9/syck/tests/YTS.c.erb | 325 + rpm-5.4.9/syck/tests/YTS.c.rb | 44 + rpm-5.4.9/system.h | 756 + rpm-5.4.9/tests/Makefile.am | 1072 + rpm-5.4.9/tests/Makefile.in | 2056 + rpm-5.4.9/tests/arbitrarytag-1.0-1.src.rpm | Bin 0 -> 5008 bytes rpm-5.4.9/tests/cudf-test-1-0.src.rpm | Bin 0 -> 3798 bytes rpm-5.4.9/tests/devtool-sanity-1.0-1.src.rpm | Bin 0 -> 6783 bytes rpm-5.4.9/tests/dir2symlink-1-1.src.rpm | Bin 0 -> 4983 bytes rpm-5.4.9/tests/edos-test-1-0.src.rpm | Bin 0 -> 2664 bytes rpm-5.4.9/tests/genpgp.sh | 72 + rpm-5.4.9/tests/genssl.h | 0 rpm-5.4.9/tests/genssl.sh | 161 + rpm-5.4.9/tests/gpsee/gffi.js | 23 + rpm-5.4.9/tests/macros.in | 165 + rpm-5.4.9/tests/mongo/Makefile.am | 160 + rpm-5.4.9/tests/mongo/Makefile.in | 1096 + rpm-5.4.9/tests/mongo/all_types.c | 203 + rpm-5.4.9/tests/mongo/auth.c | 32 + rpm-5.4.9/tests/mongo/benchmark.c | 453 + rpm-5.4.9/tests/mongo/bson.c | 262 + rpm-5.4.9/tests/mongo/bson_subobject.c | 52 + rpm-5.4.9/tests/mongo/count_delete.c | 67 + rpm-5.4.9/tests/mongo/cursors.c | 203 + rpm-5.4.9/tests/mongo/endian_swap.c | 35 + rpm-5.4.9/tests/mongo/errors.c | 83 + rpm-5.4.9/tests/mongo/examples.c | 73 + rpm-5.4.9/tests/mongo/functions.c | 108 + rpm-5.4.9/tests/mongo/helpers.c | 56 + rpm-5.4.9/tests/mongo/json.c | 171 + rpm-5.4.9/tests/mongo/oid.c | 37 + rpm-5.4.9/tests/mongo/pair.c | 43 + rpm-5.4.9/tests/mongo/resize.c | 38 + rpm-5.4.9/tests/mongo/simple.c | 161 + rpm-5.4.9/tests/mongo/sizes.c | 26 + rpm-5.4.9/tests/mongo/test.h | 19 + rpm-5.4.9/tests/mongo/tutorial.js | 88 + rpm-5.4.9/tests/mongo/update.c | 111 + rpm-5.4.9/tests/mongo/validate.c | 127 + rpm-5.4.9/tests/probes-test-1-0.src.rpm | Bin 0 -> 11746 bytes rpm-5.4.9/tests/ref/.alldigests | 4200 + rpm-5.4.9/tests/ref/DB_CONFIG | 141 + rpm-5.4.9/tests/ref/edos.manifest | 7 + rpm-5.4.9/tests/ref/edos.qa.1 | 7 + rpm-5.4.9/tests/ref/edos.qa.2 | 7 + rpm-5.4.9/tests/ref/filelists.xml | 648 + rpm-5.4.9/tests/ref/hkp | 56 + rpm-5.4.9/tests/ref/manifest | 78 + rpm-5.4.9/tests/ref/other.xml | 429 + rpm-5.4.9/tests/ref/popt.Kv | 8 + rpm-5.4.9/tests/ref/popt.Kv-beecrypt | 8 + rpm-5.4.9/tests/ref/popt.Kv-nss | 8 + rpm-5.4.9/tests/ref/popt.Kv-ssl | 8 + rpm-5.4.9/tests/ref/popt.xml | 1376 + rpm-5.4.9/tests/ref/popt.yaml | 1222 + rpm-5.4.9/tests/ref/primary.xml | 4375 + rpm-5.4.9/tests/ref/querytags | 224 + rpm-5.4.9/tests/ref/repomd.xml | 21 + rpm-5.4.9/tests/ref/rpmdb.sql | 57 + rpm-5.4.9/tests/ref/showrc | 814 + rpm-5.4.9/tests/ref/sqldb-basic.out | 158 + rpm-5.4.9/tests/ref/sqldb-basic.sql | 69 + rpm-5.4.9/tests/ref/version | 2 + .../simplestRPMv3-1.0-2.aix5.3.noarch.rpm | Bin 0 -> 1548 bytes rpm-5.4.9/tests/spew | 144 + rpm-5.4.9/tests/spew.conf | 256 + rpm-5.4.9/tests/tecdsa.c | 1896 + rpm-5.4.9/tests/thkp.c | 193 + rpm-5.4.9/tests/tkey.c | 360 + rpm-5.4.9/tests/tpgp.c | 187 + rpm-5.4.9/tests/triggers-D-1.0-1.src.rpm | Bin 0 -> 4604 bytes rpm-5.4.9/tests/triggers-DP-1.0-1.src.rpm | Bin 0 -> 4634 bytes rpm-5.4.9/tests/triggers-F-1.0-1.src.rpm | Bin 0 -> 4606 bytes rpm-5.4.9/tests/triggers-FP-1.0-1.src.rpm | Bin 0 -> 4638 bytes rpm-5.4.9/tests/triggers-N-1.0-1.src.rpm | Bin 0 -> 4603 bytes rpm-5.4.9/tests/triggers-NA-1.0-1.src.rpm | Bin 0 -> 4650 bytes rpm-5.4.9/tests/triggers-P-1.0-1.src.rpm | Bin 0 -> 4599 bytes rpm-5.4.9/tests/trsa.c | 6425 ++ rpm-5.4.9/tests/tssl.c | 79 + rpm-5.4.9/tools/Makefile.am | 392 + rpm-5.4.9/tools/Makefile.in | 2010 + rpm-5.4.9/tools/augtool.c | 394 + rpm-5.4.9/tools/bsdiff.1 | 63 + rpm-5.4.9/tools/bspatch.1 | 59 + rpm-5.4.9/tools/chroot.c | 147 + rpm-5.4.9/tools/cp.c | 1105 + rpm-5.4.9/tools/cudftool.c | 93 + rpm-5.4.9/tools/dbconvert.c | 463 + rpm-5.4.9/tools/dbsql.c | 104 + rpm-5.4.9/tools/debugedit.c | 1693 + rpm-5.4.9/tools/dotgraph.cc | 162 + rpm-5.4.9/tools/dotgraph.hh | 12 + rpm-5.4.9/tools/hashtab.c | 523 + rpm-5.4.9/tools/hashtab.h | 143 + rpm-5.4.9/tools/log2xml.cc | 186 + rpm-5.4.9/tools/nix-build.c | 15 + rpm-5.4.9/tools/nix-channel.c | 16 + rpm-5.4.9/tools/nix-collect-garbage.c | 16 + rpm-5.4.9/tools/nix-copy-closure.c | 16 + rpm-5.4.9/tools/nix-env.cc | 1480 + rpm-5.4.9/tools/nix-hash.cc | 67 + rpm-5.4.9/tools/nix-install-package.c | 16 + rpm-5.4.9/tools/nix-instantiate.cc | 160 + rpm-5.4.9/tools/nix-prefetch-url.c | 16 + rpm-5.4.9/tools/nix-pull.c | 16 + rpm-5.4.9/tools/nix-push.c | 16 + rpm-5.4.9/tools/nix-store.cc | 752 + rpm-5.4.9/tools/nix-worker.cc | 773 + rpm-5.4.9/tools/profiles.cc | 135 + rpm-5.4.9/tools/roto.c | 4611 + rpm-5.4.9/tools/rpm2cpio.c | 150 + rpm-5.4.9/tools/rpmcache.c | 665 + rpm-5.4.9/tools/rpmcmp.c | 94 + rpm-5.4.9/tools/rpmdeps.c | 453 + rpm-5.4.9/tools/rpmdigest.c | 1025 + rpm-5.4.9/tools/rpmfind.c | 3009 + rpm-5.4.9/tools/rpmgrep.1 | 439 + rpm-5.4.9/tools/rpmgrep.c | 1615 + rpm-5.4.9/tools/rpmkey.c | 1304 + rpm-5.4.9/tools/rpmmtree.c | 3830 + rpm-5.4.9/tools/rpmrepo.c | 209 + rpm-5.4.9/tools/rpmspecdump.c | 332 + rpm-5.4.9/tools/rpmwget.c | 1557 + rpm-5.4.9/tools/sandbox.c | 354 + rpm-5.4.9/tools/semodule.c | 211 + rpm-5.4.9/tools/spooktool.c | 419 + rpm-5.4.9/tools/sqlite3.c | 104 + rpm-5.4.9/tools/txar.c | 78 + rpm-5.4.9/tools/xiu-echo.c | 16 + rpm-5.4.9/tools/xiu-hash.c | 405 + rpm-5.4.9/tools/xiu-instantiate.c | 217 + rpm-5.4.9/tools/xiu-store.c | 357 + rpm.spec | 3 +- 1577 files changed, 991277 insertions(+), 1 deletion(-) create mode 100644 rpm-5.4.9/ABOUT-NLS create mode 100644 rpm-5.4.9/CHANGES create mode 100644 rpm-5.4.9/COPYING.LIB create mode 100644 rpm-5.4.9/CREDITS create mode 100644 rpm-5.4.9/Doxyfile.in create mode 100644 rpm-5.4.9/Doxyheader create mode 100644 rpm-5.4.9/INSTALL create mode 100644 rpm-5.4.9/INSTALL.developer create mode 100644 rpm-5.4.9/Makefile.am create mode 100644 rpm-5.4.9/Makefile.in create mode 100644 rpm-5.4.9/NEWS create mode 100644 rpm-5.4.9/README create mode 100644 rpm-5.4.9/TODO create mode 100644 rpm-5.4.9/acinclude.m4 create mode 100644 rpm-5.4.9/aclocal.m4 create mode 100644 rpm-5.4.9/autodeps/aix.prov create mode 100755 rpm-5.4.9/autodeps/aix.req create mode 100644 rpm-5.4.9/autodeps/aix4.prov create mode 100644 rpm-5.4.9/autodeps/aix4.req create mode 100644 rpm-5.4.9/autodeps/amigaos.prov create mode 100644 rpm-5.4.9/autodeps/amigaos.req create mode 100644 rpm-5.4.9/autodeps/darwin.prov create mode 100644 rpm-5.4.9/autodeps/darwin.req create mode 100644 rpm-5.4.9/autodeps/freebsd.prov create mode 100644 rpm-5.4.9/autodeps/freebsd.req create mode 100644 rpm-5.4.9/autodeps/freebsdelf.prov create mode 100644 rpm-5.4.9/autodeps/freebsdelf.req create mode 100644 rpm-5.4.9/autodeps/hpux.prov create mode 100644 rpm-5.4.9/autodeps/hpux.req create mode 100644 rpm-5.4.9/autodeps/irix6.prov create mode 100644 rpm-5.4.9/autodeps/irix6.req create mode 100644 rpm-5.4.9/autodeps/linux.prov create mode 100644 rpm-5.4.9/autodeps/linux.req create mode 100644 rpm-5.4.9/autodeps/mint.prov create mode 100644 rpm-5.4.9/autodeps/mint.req create mode 100644 rpm-5.4.9/autodeps/none create mode 100644 rpm-5.4.9/autodeps/openbsd.prov create mode 100644 rpm-5.4.9/autodeps/openbsd.req create mode 100644 rpm-5.4.9/autodeps/osf.prov create mode 100644 rpm-5.4.9/autodeps/osf.req create mode 100644 rpm-5.4.9/autodeps/solaris.prov create mode 100644 rpm-5.4.9/autodeps/solaris.req create mode 100755 rpm-5.4.9/autogen.sh create mode 100644 rpm-5.4.9/build.c create mode 100644 rpm-5.4.9/build.h create mode 100644 rpm-5.4.9/build/Makefile.am create mode 100644 rpm-5.4.9/build/Makefile.in create mode 100644 rpm-5.4.9/build/TODO create mode 100644 rpm-5.4.9/build/auto/Makefile.am create mode 100644 rpm-5.4.9/build/auto/Makefile.in create mode 100644 rpm-5.4.9/build/auto/desc create mode 100644 rpm-5.4.9/build/auto/desc.in create mode 100644 rpm-5.4.9/build/auto/types create mode 100644 rpm-5.4.9/build/auto/types.in create mode 100644 rpm-5.4.9/build/build.c create mode 100644 rpm-5.4.9/build/buildio.h create mode 100644 rpm-5.4.9/build/expression.c create mode 100644 rpm-5.4.9/build/files.c create mode 100644 rpm-5.4.9/build/librpmbuild.vers create mode 100644 rpm-5.4.9/build/misc.c create mode 100644 rpm-5.4.9/build/names.c create mode 100644 rpm-5.4.9/build/pack.c create mode 100644 rpm-5.4.9/build/parseBuildInstallClean.c create mode 100644 rpm-5.4.9/build/parseChangelog.c create mode 100644 rpm-5.4.9/build/parseDescription.c create mode 100644 rpm-5.4.9/build/parseFiles.c create mode 100644 rpm-5.4.9/build/parsePreamble.c create mode 100644 rpm-5.4.9/build/parsePrep.c create mode 100644 rpm-5.4.9/build/parseReqs.c create mode 100644 rpm-5.4.9/build/parseScript.c create mode 100644 rpm-5.4.9/build/parseSpec.c create mode 100644 rpm-5.4.9/build/poptBT.c create mode 100644 rpm-5.4.9/build/reqprov.c create mode 100644 rpm-5.4.9/build/rpmbuild.h create mode 100644 rpm-5.4.9/build/rpmspec.h create mode 100644 rpm-5.4.9/build/spec.c create mode 100755 rpm-5.4.9/config.guess create mode 100644 rpm-5.4.9/config.h.in create mode 100755 rpm-5.4.9/config.rpath create mode 100755 rpm-5.4.9/config.sub create mode 100755 rpm-5.4.9/configure create mode 100644 rpm-5.4.9/configure.ac create mode 100644 rpm-5.4.9/cpuinfo.yaml create mode 100644 rpm-5.4.9/debug.h create mode 100755 rpm-5.4.9/depcomp create mode 100644 rpm-5.4.9/doc/Makefile.am create mode 100644 rpm-5.4.9/doc/Makefile.in create mode 100644 rpm-5.4.9/doc/fr/Makefile.am create mode 100644 rpm-5.4.9/doc/fr/Makefile.in create mode 100644 rpm-5.4.9/doc/fr/rpm.8 create mode 100644 rpm-5.4.9/doc/gendiff.1 create mode 100644 rpm-5.4.9/doc/ja/Makefile.am create mode 100644 rpm-5.4.9/doc/ja/Makefile.in create mode 100644 rpm-5.4.9/doc/ja/rpm.8 create mode 100644 rpm-5.4.9/doc/ja/rpm2cpio.8 create mode 100644 rpm-5.4.9/doc/ja/rpmbuild.8 create mode 100644 rpm-5.4.9/doc/ja/rpmcache.8 create mode 100644 rpm-5.4.9/doc/ja/rpmgraph.8 create mode 100644 rpm-5.4.9/doc/ko/Makefile.am create mode 100644 rpm-5.4.9/doc/ko/Makefile.in create mode 100644 rpm-5.4.9/doc/ko/rpm.8 create mode 100644 rpm-5.4.9/doc/ko/rpm2cpio.8 create mode 100644 rpm-5.4.9/doc/manual/Makefile.am create mode 100644 rpm-5.4.9/doc/manual/Makefile.in create mode 100644 rpm-5.4.9/doc/manual/autosignature create mode 100644 rpm-5.4.9/doc/manual/builddependencies create mode 100644 rpm-5.4.9/doc/manual/buildroot create mode 100644 rpm-5.4.9/doc/manual/conditionalbuilds create mode 100644 rpm-5.4.9/doc/manual/dependencies create mode 100644 rpm-5.4.9/doc/manual/filetriggers create mode 100644 rpm-5.4.9/doc/manual/format create mode 100644 rpm-5.4.9/doc/manual/hregions create mode 100644 rpm-5.4.9/doc/manual/macros create mode 100644 rpm-5.4.9/doc/manual/multiplebuilds create mode 100644 rpm-5.4.9/doc/manual/newrpmdb.howto create mode 100644 rpm-5.4.9/doc/manual/queryformat create mode 100644 rpm-5.4.9/doc/manual/relocatable create mode 100644 rpm-5.4.9/doc/manual/rollbacks create mode 100644 rpm-5.4.9/doc/manual/signatures create mode 100644 rpm-5.4.9/doc/manual/spec create mode 100644 rpm-5.4.9/doc/manual/triggers create mode 100644 rpm-5.4.9/doc/manual/tsort create mode 100644 rpm-5.4.9/doc/pl/Makefile.am create mode 100644 rpm-5.4.9/doc/pl/Makefile.in create mode 100644 rpm-5.4.9/doc/pl/gendiff.1 create mode 100644 rpm-5.4.9/doc/pl/rpm.8 create mode 100644 rpm-5.4.9/doc/pl/rpm2cpio.8 create mode 100644 rpm-5.4.9/doc/pl/rpmbuild.8 create mode 100644 rpm-5.4.9/doc/pl/rpmcache.8 create mode 100644 rpm-5.4.9/doc/pl/rpmdeps.8 create mode 100644 rpm-5.4.9/doc/pl/rpmgraph.8 create mode 100644 rpm-5.4.9/doc/rpm.8 create mode 100644 rpm-5.4.9/doc/rpm2cpio.8 create mode 100644 rpm-5.4.9/doc/rpmbuild.8 create mode 100644 rpm-5.4.9/doc/rpmcache.8 create mode 100644 rpm-5.4.9/doc/rpmconstant.8 create mode 100644 rpm-5.4.9/doc/rpmdeps.8 create mode 100644 rpm-5.4.9/doc/rpmmtree.8 create mode 100644 rpm-5.4.9/doc/ru/Makefile.am create mode 100644 rpm-5.4.9/doc/ru/Makefile.in create mode 100644 rpm-5.4.9/doc/ru/rpm.8 create mode 100644 rpm-5.4.9/doc/ru/rpm2cpio.8 create mode 100644 rpm-5.4.9/doc/sk/Makefile.am create mode 100644 rpm-5.4.9/doc/sk/Makefile.in create mode 100644 rpm-5.4.9/doc/sk/rpm.8 create mode 100755 rpm-5.4.9/install-sh create mode 100644 rpm-5.4.9/js/.cvsignore create mode 100644 rpm-5.4.9/js/Makefile create mode 100644 rpm-5.4.9/js/Makefile.am create mode 100644 rpm-5.4.9/js/Makefile.in create mode 100644 rpm-5.4.9/js/gsr.c create mode 100644 rpm-5.4.9/js/legacy-sol.cudf create mode 100644 rpm-5.4.9/js/legacy.cudf create mode 100644 rpm-5.4.9/js/ngsr.c create mode 100644 rpm-5.4.9/js/rpm-js.h create mode 100644 rpm-5.4.9/js/rpmaug-js.c create mode 100644 rpm-5.4.9/js/rpmaug-js.h create mode 100644 rpm-5.4.9/js/rpmbc-js.c create mode 100644 rpm-5.4.9/js/rpmbc-js.h create mode 100644 rpm-5.4.9/js/rpmbf-js.c create mode 100644 rpm-5.4.9/js/rpmbf-js.h create mode 100644 rpm-5.4.9/js/rpmcudf-js.c create mode 100644 rpm-5.4.9/js/rpmcudf-js.h create mode 100644 rpm-5.4.9/js/rpmdb-js.c create mode 100644 rpm-5.4.9/js/rpmdb-js.h create mode 100644 rpm-5.4.9/js/rpmdbc-js.c create mode 100644 rpm-5.4.9/js/rpmdbc-js.h create mode 100644 rpm-5.4.9/js/rpmdbe-js.c create mode 100644 rpm-5.4.9/js/rpmdbe-js.h create mode 100644 rpm-5.4.9/js/rpmdc-js.c create mode 100644 rpm-5.4.9/js/rpmdc-js.h create mode 100644 rpm-5.4.9/js/rpmdig-js.c create mode 100644 rpm-5.4.9/js/rpmdig-js.h create mode 100644 rpm-5.4.9/js/rpmdir-js.c create mode 100644 rpm-5.4.9/js/rpmdir-js.h create mode 100644 rpm-5.4.9/js/rpmds-js.c create mode 100644 rpm-5.4.9/js/rpmds-js.h create mode 100644 rpm-5.4.9/js/rpmfc-js.c create mode 100644 rpm-5.4.9/js/rpmfc-js.h create mode 100644 rpm-5.4.9/js/rpmfi-js.c create mode 100644 rpm-5.4.9/js/rpmfi-js.h create mode 100644 rpm-5.4.9/js/rpmfts-js.c create mode 100644 rpm-5.4.9/js/rpmfts-js.h create mode 100644 rpm-5.4.9/js/rpmgi-js.c create mode 100644 rpm-5.4.9/js/rpmgi-js.h create mode 100644 rpm-5.4.9/js/rpmhdr-js.c create mode 100644 rpm-5.4.9/js/rpmhdr-js.h create mode 100644 rpm-5.4.9/js/rpmio-js.c create mode 100644 rpm-5.4.9/js/rpmio-js.h create mode 100644 rpm-5.4.9/js/rpmiob-js.c create mode 100644 rpm-5.4.9/js/rpmiob-js.h create mode 100644 rpm-5.4.9/js/rpmjs-debug.h create mode 100644 rpm-5.4.9/js/rpmjsfile.c create mode 100644 rpm-5.4.9/js/rpmjsfile.h create mode 100644 rpm-5.4.9/js/rpmjsfile.msg create mode 100644 rpm-5.4.9/js/rpmmc-js.c create mode 100644 rpm-5.4.9/js/rpmmc-js.h create mode 100644 rpm-5.4.9/js/rpmmg-js.c create mode 100644 rpm-5.4.9/js/rpmmg-js.h create mode 100644 rpm-5.4.9/js/rpmmi-js.c create mode 100644 rpm-5.4.9/js/rpmmi-js.h create mode 100644 rpm-5.4.9/js/rpmmpf-js.c create mode 100644 rpm-5.4.9/js/rpmmpf-js.h create mode 100644 rpm-5.4.9/js/rpmmpw-js.c create mode 100644 rpm-5.4.9/js/rpmmpw-js.h create mode 100644 rpm-5.4.9/js/rpmps-js.c create mode 100644 rpm-5.4.9/js/rpmps-js.h create mode 100644 rpm-5.4.9/js/rpmseq-js.c create mode 100644 rpm-5.4.9/js/rpmseq-js.h create mode 100644 rpm-5.4.9/js/rpmsm-js.c create mode 100644 rpm-5.4.9/js/rpmsm-js.h create mode 100644 rpm-5.4.9/js/rpmsp-js.c create mode 100644 rpm-5.4.9/js/rpmsp-js.h create mode 100644 rpm-5.4.9/js/rpmst-js.c create mode 100644 rpm-5.4.9/js/rpmst-js.h create mode 100644 rpm-5.4.9/js/rpmsw-js.c create mode 100644 rpm-5.4.9/js/rpmsw-js.h create mode 100644 rpm-5.4.9/js/rpmsx-js.c create mode 100644 rpm-5.4.9/js/rpmsx-js.h create mode 100644 rpm-5.4.9/js/rpmsys-js.c create mode 100644 rpm-5.4.9/js/rpmsys-js.h create mode 100644 rpm-5.4.9/js/rpmte-js.c create mode 100644 rpm-5.4.9/js/rpmte-js.h create mode 100644 rpm-5.4.9/js/rpmts-js.c create mode 100644 rpm-5.4.9/js/rpmts-js.h create mode 100644 rpm-5.4.9/js/rpmtxn-js.c create mode 100644 rpm-5.4.9/js/rpmtxn-js.h create mode 100644 rpm-5.4.9/js/rpmxar-js.c create mode 100644 rpm-5.4.9/js/rpmxar-js.h create mode 100644 rpm-5.4.9/js/syck-js.c create mode 100644 rpm-5.4.9/js/syck-js.h create mode 100644 rpm-5.4.9/js/tscripts/.cvsignore create mode 100644 rpm-5.4.9/js/tscripts/Aug.js create mode 100644 rpm-5.4.9/js/tscripts/Bc.js create mode 100644 rpm-5.4.9/js/tscripts/Bf.js create mode 100644 rpm-5.4.9/js/tscripts/Cudf.js create mode 100644 rpm-5.4.9/js/tscripts/Db.js create mode 100644 rpm-5.4.9/js/tscripts/Dbc.js create mode 100644 rpm-5.4.9/js/tscripts/Dbe.js create mode 100644 rpm-5.4.9/js/tscripts/Dc.js create mode 100644 rpm-5.4.9/js/tscripts/Dig.js create mode 100644 rpm-5.4.9/js/tscripts/Dir.js create mode 100644 rpm-5.4.9/js/tscripts/Ds.js create mode 100644 rpm-5.4.9/js/tscripts/Fc.js create mode 100644 rpm-5.4.9/js/tscripts/Fi.js create mode 100644 rpm-5.4.9/js/tscripts/File.js create mode 100644 rpm-5.4.9/js/tscripts/Fts.js create mode 100644 rpm-5.4.9/js/tscripts/Gi.js create mode 100644 rpm-5.4.9/js/tscripts/Hdr.js create mode 100644 rpm-5.4.9/js/tscripts/Io.js create mode 100644 rpm-5.4.9/js/tscripts/Iob.js create mode 100644 rpm-5.4.9/js/tscripts/Mc.js create mode 100644 rpm-5.4.9/js/tscripts/Mg.js create mode 100644 rpm-5.4.9/js/tscripts/Mi.js create mode 100644 rpm-5.4.9/js/tscripts/Mpf.js create mode 100644 rpm-5.4.9/js/tscripts/Mpw.js create mode 100644 rpm-5.4.9/js/tscripts/Ps.js create mode 100644 rpm-5.4.9/js/tscripts/Seq.js create mode 100644 rpm-5.4.9/js/tscripts/Sm.js create mode 100644 rpm-5.4.9/js/tscripts/Sp.js create mode 100644 rpm-5.4.9/js/tscripts/St.js create mode 100644 rpm-5.4.9/js/tscripts/Sw.js create mode 100644 rpm-5.4.9/js/tscripts/Sx.js create mode 100644 rpm-5.4.9/js/tscripts/Syck.js create mode 100644 rpm-5.4.9/js/tscripts/Sys.js create mode 100644 rpm-5.4.9/js/tscripts/Te.js create mode 100644 rpm-5.4.9/js/tscripts/Ts.js create mode 100644 rpm-5.4.9/js/tscripts/Txn.js create mode 100644 rpm-5.4.9/js/tscripts/Uuid.js create mode 100644 rpm-5.4.9/js/tscripts/Xar.js create mode 100644 rpm-5.4.9/js/uuid-js.c create mode 100644 rpm-5.4.9/js/uuid-js.h create mode 100644 rpm-5.4.9/lib/Makefile.am create mode 100644 rpm-5.4.9/lib/Makefile.in create mode 100644 rpm-5.4.9/lib/auto/Makefile.am create mode 100644 rpm-5.4.9/lib/auto/Makefile.in create mode 100644 rpm-5.4.9/lib/auto/desc create mode 100644 rpm-5.4.9/lib/auto/desc.in create mode 100644 rpm-5.4.9/lib/auto/types create mode 100644 rpm-5.4.9/lib/auto/types.in create mode 100644 rpm-5.4.9/lib/depends.c create mode 100644 rpm-5.4.9/lib/filetriggers.c create mode 100644 rpm-5.4.9/lib/filetriggers.h create mode 100644 rpm-5.4.9/lib/formats.c create mode 100644 rpm-5.4.9/lib/fs.c create mode 100644 rpm-5.4.9/lib/fs.h create mode 100644 rpm-5.4.9/lib/fsm.c create mode 100644 rpm-5.4.9/lib/fsm.h create mode 100644 rpm-5.4.9/lib/librpm.vers create mode 100644 rpm-5.4.9/lib/manifest.c create mode 100644 rpm-5.4.9/lib/manifest.h create mode 100644 rpm-5.4.9/lib/misc.c create mode 100644 rpm-5.4.9/lib/misc.h create mode 100644 rpm-5.4.9/lib/order.c create mode 100644 rpm-5.4.9/lib/poptALL.c create mode 100644 rpm-5.4.9/lib/poptI.c create mode 100644 rpm-5.4.9/lib/poptQV.c create mode 100644 rpm-5.4.9/lib/psm.c create mode 100644 rpm-5.4.9/lib/psm.h create mode 100644 rpm-5.4.9/lib/query.c create mode 100644 rpm-5.4.9/lib/rpm46compat.h create mode 100644 rpm-5.4.9/lib/rpm4compat.h create mode 100644 rpm-5.4.9/lib/rpmal.c create mode 100644 rpm-5.4.9/lib/rpmal.h create mode 100644 rpm-5.4.9/lib/rpmchecksig.c create mode 100644 rpm-5.4.9/lib/rpmcli.h create mode 100644 rpm-5.4.9/lib/rpmds.c create mode 100644 rpm-5.4.9/lib/rpmds.h create mode 100644 rpm-5.4.9/lib/rpmfc.c create mode 100644 rpm-5.4.9/lib/rpmfc.h create mode 100644 rpm-5.4.9/lib/rpmfi.c create mode 100644 rpm-5.4.9/lib/rpmfi.h create mode 100644 rpm-5.4.9/lib/rpmgi.c create mode 100644 rpm-5.4.9/lib/rpmgi.h create mode 100644 rpm-5.4.9/lib/rpminstall.c create mode 100644 rpm-5.4.9/lib/rpmlib.h create mode 100644 rpm-5.4.9/lib/rpmlock.c create mode 100644 rpm-5.4.9/lib/rpmlock.h create mode 100644 rpm-5.4.9/lib/rpmluaext.c create mode 100644 rpm-5.4.9/lib/rpmluaext.h create mode 100644 rpm-5.4.9/lib/rpmps.c create mode 100644 rpm-5.4.9/lib/rpmps.h create mode 100644 rpm-5.4.9/lib/rpmrc.c create mode 100644 rpm-5.4.9/lib/rpmrc.h create mode 100644 rpm-5.4.9/lib/rpmrollback.c create mode 100644 rpm-5.4.9/lib/rpmrollback.h create mode 100644 rpm-5.4.9/lib/rpmte.c create mode 100644 rpm-5.4.9/lib/rpmte.h create mode 100644 rpm-5.4.9/lib/rpmts.c create mode 100644 rpm-5.4.9/lib/rpmts.h create mode 100644 rpm-5.4.9/lib/rpmversion.c create mode 100644 rpm-5.4.9/lib/rpmversion.h create mode 100644 rpm-5.4.9/lib/rpmversion.h.in create mode 100644 rpm-5.4.9/lib/tevr.c create mode 100644 rpm-5.4.9/lib/tgi.c create mode 100644 rpm-5.4.9/lib/transaction.c create mode 100644 rpm-5.4.9/lib/tsbt.c create mode 100644 rpm-5.4.9/lib/verify.c create mode 100644 rpm-5.4.9/ltmain.sh create mode 100644 rpm-5.4.9/lua/.cvsignore create mode 100644 rpm-5.4.9/lua/.splintrc create mode 100644 rpm-5.4.9/lua/COPYRIGHT create mode 100644 rpm-5.4.9/lua/HISTORY create mode 100644 rpm-5.4.9/lua/Makefile create mode 100644 rpm-5.4.9/lua/Makefile.am create mode 100644 rpm-5.4.9/lua/Makefile.in create mode 100644 rpm-5.4.9/lua/README create mode 100644 rpm-5.4.9/lua/bin2c.c create mode 100644 rpm-5.4.9/lua/chkconfig/chkconfig.c create mode 100644 rpm-5.4.9/lua/chkconfig/leveldb.c create mode 100644 rpm-5.4.9/lua/chkconfig/leveldb.h create mode 100644 rpm-5.4.9/lua/lapi.c create mode 100644 rpm-5.4.9/lua/lapi.h create mode 100644 rpm-5.4.9/lua/lauxlib.c create mode 100644 rpm-5.4.9/lua/lauxlib.h create mode 100644 rpm-5.4.9/lua/lbaselib.c create mode 100644 rpm-5.4.9/lua/lcode.c create mode 100644 rpm-5.4.9/lua/lcode.h create mode 100644 rpm-5.4.9/lua/ldblib.c create mode 100644 rpm-5.4.9/lua/ldebug.c create mode 100644 rpm-5.4.9/lua/ldebug.h create mode 100644 rpm-5.4.9/lua/ldo.c create mode 100644 rpm-5.4.9/lua/ldo.h create mode 100644 rpm-5.4.9/lua/ldump.c create mode 100644 rpm-5.4.9/lua/lfunc.c create mode 100644 rpm-5.4.9/lua/lfunc.h create mode 100644 rpm-5.4.9/lua/lgc.c create mode 100644 rpm-5.4.9/lua/lgc.h create mode 100644 rpm-5.4.9/lua/linit.c create mode 100644 rpm-5.4.9/lua/liolib.c create mode 100644 rpm-5.4.9/lua/llex.c create mode 100644 rpm-5.4.9/lua/llex.h create mode 100644 rpm-5.4.9/lua/llimits.h create mode 100644 rpm-5.4.9/lua/lmathlib.c create mode 100644 rpm-5.4.9/lua/lmem.c create mode 100644 rpm-5.4.9/lua/lmem.h create mode 100644 rpm-5.4.9/lua/loadlib.c create mode 100644 rpm-5.4.9/lua/lobject.c create mode 100644 rpm-5.4.9/lua/lobject.h create mode 100644 rpm-5.4.9/lua/local/.cvsignore create mode 100644 rpm-5.4.9/lua/local/lcrypto.c create mode 100644 rpm-5.4.9/lua/local/lcrypto.h create mode 100644 rpm-5.4.9/lua/local/llocal.c create mode 100644 rpm-5.4.9/lua/local/llocal.h create mode 100644 rpm-5.4.9/lua/local/llocal.lua create mode 100644 rpm-5.4.9/lua/local/lom.lua create mode 100644 rpm-5.4.9/lua/local/lposix.c create mode 100644 rpm-5.4.9/lua/local/lposix.h create mode 100644 rpm-5.4.9/lua/local/lrexlib.h create mode 100644 rpm-5.4.9/lua/local/lrexlib.txt create mode 100644 rpm-5.4.9/lua/local/lrexlib_algo.h create mode 100644 rpm-5.4.9/lua/local/lrexlib_common.c create mode 100644 rpm-5.4.9/lua/local/lrexlib_common.h create mode 100644 rpm-5.4.9/lua/local/lrexlib_lpcre.c create mode 100644 rpm-5.4.9/lua/local/lrexlib_lpcre_f.c create mode 100644 rpm-5.4.9/lua/local/lrexlib_lposix.c create mode 100644 rpm-5.4.9/lua/local/lshadow.c create mode 100644 rpm-5.4.9/lua/local/lshadow.h create mode 100644 rpm-5.4.9/lua/local/lsyck.c create mode 100644 rpm-5.4.9/lua/local/lsyck.h create mode 100644 rpm-5.4.9/lua/local/luuid.c create mode 100644 rpm-5.4.9/lua/local/luuid.h create mode 100644 rpm-5.4.9/lua/local/lwrs.c create mode 100644 rpm-5.4.9/lua/local/lwrs.h create mode 100644 rpm-5.4.9/lua/local/lxplib.c create mode 100644 rpm-5.4.9/lua/local/lxplib.h create mode 100644 rpm-5.4.9/lua/lopcodes.c create mode 100644 rpm-5.4.9/lua/lopcodes.h create mode 100644 rpm-5.4.9/lua/loslib.c create mode 100644 rpm-5.4.9/lua/lparser.c create mode 100644 rpm-5.4.9/lua/lparser.h create mode 100644 rpm-5.4.9/lua/lstate.c create mode 100644 rpm-5.4.9/lua/lstate.h create mode 100644 rpm-5.4.9/lua/lstring.c create mode 100644 rpm-5.4.9/lua/lstring.h create mode 100644 rpm-5.4.9/lua/lstrlib.c create mode 100644 rpm-5.4.9/lua/ltable.c create mode 100644 rpm-5.4.9/lua/ltable.h create mode 100644 rpm-5.4.9/lua/ltablib.c create mode 100644 rpm-5.4.9/lua/ltests.c create mode 100644 rpm-5.4.9/lua/ltm.c create mode 100644 rpm-5.4.9/lua/ltm.h create mode 100644 rpm-5.4.9/lua/lua.c create mode 100644 rpm-5.4.9/lua/lua.h create mode 100644 rpm-5.4.9/lua/luac.c create mode 100644 rpm-5.4.9/lua/luaconf.h create mode 100644 rpm-5.4.9/lua/lualib.h create mode 100644 rpm-5.4.9/lua/lundump.c create mode 100644 rpm-5.4.9/lua/lundump.h create mode 100644 rpm-5.4.9/lua/lvm.c create mode 100644 rpm-5.4.9/lua/lvm.h create mode 100644 rpm-5.4.9/lua/lzio.c create mode 100644 rpm-5.4.9/lua/lzio.h create mode 100644 rpm-5.4.9/lua/print.c create mode 100644 rpm-5.4.9/lua/shadow/chkname.h create mode 100644 rpm-5.4.9/lua/shadow/commonio.c create mode 100644 rpm-5.4.9/lua/shadow/commonio.h create mode 100644 rpm-5.4.9/lua/shadow/copydir.c create mode 100644 rpm-5.4.9/lua/shadow/defines.h create mode 100644 rpm-5.4.9/lua/shadow/faillog.h create mode 100644 rpm-5.4.9/lua/shadow/fputsx.c create mode 100644 rpm-5.4.9/lua/shadow/getdef.c create mode 100644 rpm-5.4.9/lua/shadow/getdef.h create mode 100644 rpm-5.4.9/lua/shadow/groupadd.c create mode 100644 rpm-5.4.9/lua/shadow/groupio.c create mode 100644 rpm-5.4.9/lua/shadow/groupio.h create mode 100644 rpm-5.4.9/lua/shadow/gshadow.c create mode 100644 rpm-5.4.9/lua/shadow/gshadow_.h create mode 100644 rpm-5.4.9/lua/shadow/list.c create mode 100644 rpm-5.4.9/lua/shadow/nscd.h create mode 100644 rpm-5.4.9/lua/shadow/prototypes.h create mode 100644 rpm-5.4.9/lua/shadow/pwauth.h create mode 100644 rpm-5.4.9/lua/shadow/pwio.c create mode 100644 rpm-5.4.9/lua/shadow/pwio.h create mode 100644 rpm-5.4.9/lua/shadow/sgetgrent.c create mode 100644 rpm-5.4.9/lua/shadow/sgetpwent.c create mode 100644 rpm-5.4.9/lua/shadow/sgroupio.c create mode 100644 rpm-5.4.9/lua/shadow/sgroupio.h create mode 100644 rpm-5.4.9/lua/shadow/shadow_config.h create mode 100644 rpm-5.4.9/lua/shadow/shadowio.c create mode 100644 rpm-5.4.9/lua/shadow/shadowio.h create mode 100644 rpm-5.4.9/lua/shadow/strtoday.c create mode 100644 rpm-5.4.9/lua/shadow/useradd.c create mode 100644 rpm-5.4.9/lua/socket/auxiliar.c create mode 100644 rpm-5.4.9/lua/socket/auxiliar.h create mode 100644 rpm-5.4.9/lua/socket/buffer.c create mode 100644 rpm-5.4.9/lua/socket/buffer.h create mode 100644 rpm-5.4.9/lua/socket/except.c create mode 100644 rpm-5.4.9/lua/socket/except.h create mode 100644 rpm-5.4.9/lua/socket/ftp.lua create mode 100644 rpm-5.4.9/lua/socket/http.lua create mode 100644 rpm-5.4.9/lua/socket/inet.c create mode 100644 rpm-5.4.9/lua/socket/inet.h create mode 100644 rpm-5.4.9/lua/socket/io.c create mode 100644 rpm-5.4.9/lua/socket/io.h create mode 100644 rpm-5.4.9/lua/socket/ltn12.lua create mode 100644 rpm-5.4.9/lua/socket/luasocket.c create mode 100644 rpm-5.4.9/lua/socket/luasocket.h create mode 100644 rpm-5.4.9/lua/socket/mime.c create mode 100644 rpm-5.4.9/lua/socket/mime.h create mode 100644 rpm-5.4.9/lua/socket/mime.lua create mode 100644 rpm-5.4.9/lua/socket/options.c create mode 100644 rpm-5.4.9/lua/socket/options.h create mode 100644 rpm-5.4.9/lua/socket/select.c create mode 100644 rpm-5.4.9/lua/socket/select.h create mode 100644 rpm-5.4.9/lua/socket/smtp.lua create mode 100644 rpm-5.4.9/lua/socket/socket.h create mode 100644 rpm-5.4.9/lua/socket/socket.lua create mode 100644 rpm-5.4.9/lua/socket/tcp.c create mode 100644 rpm-5.4.9/lua/socket/tcp.h create mode 100644 rpm-5.4.9/lua/socket/timeout.c create mode 100644 rpm-5.4.9/lua/socket/timeout.h create mode 100644 rpm-5.4.9/lua/socket/tp.lua create mode 100644 rpm-5.4.9/lua/socket/udp.c create mode 100644 rpm-5.4.9/lua/socket/udp.h create mode 100644 rpm-5.4.9/lua/socket/unix.c create mode 100644 rpm-5.4.9/lua/socket/unix.h create mode 100644 rpm-5.4.9/lua/socket/url.lua create mode 100644 rpm-5.4.9/lua/socket/usocket.c create mode 100644 rpm-5.4.9/lua/socket/usocket.h create mode 100644 rpm-5.4.9/lua/socket/wsocket.c create mode 100644 rpm-5.4.9/lua/socket/wsocket.h create mode 100644 rpm-5.4.9/m4/gettext.m4 create mode 100644 rpm-5.4.9/m4/iconv.m4 create mode 100644 rpm-5.4.9/m4/intlmacosx.m4 create mode 100644 rpm-5.4.9/m4/lib-ld.m4 create mode 100644 rpm-5.4.9/m4/lib-link.m4 create mode 100644 rpm-5.4.9/m4/lib-prefix.m4 create mode 100644 rpm-5.4.9/m4/libtool.m4 create mode 100644 rpm-5.4.9/m4/ltoptions.m4 create mode 100644 rpm-5.4.9/m4/ltsugar.m4 create mode 100644 rpm-5.4.9/m4/ltversion.m4 create mode 100644 rpm-5.4.9/m4/lt~obsolete.m4 create mode 100644 rpm-5.4.9/m4/nls.m4 create mode 100644 rpm-5.4.9/m4/po.m4 create mode 100644 rpm-5.4.9/m4/progtest.m4 create mode 100644 rpm-5.4.9/macros/.cvsignore create mode 100644 rpm-5.4.9/macros/cmake create mode 100644 rpm-5.4.9/macros/cmake.in create mode 100644 rpm-5.4.9/macros/fedora create mode 100644 rpm-5.4.9/macros/fedora.in create mode 100644 rpm-5.4.9/macros/gstreamer create mode 100644 rpm-5.4.9/macros/gstreamer.in create mode 100644 rpm-5.4.9/macros/java create mode 100644 rpm-5.4.9/macros/java.in create mode 100644 rpm-5.4.9/macros/kernel create mode 100644 rpm-5.4.9/macros/kernel.in create mode 100644 rpm-5.4.9/macros/libtool create mode 100644 rpm-5.4.9/macros/libtool.in create mode 100644 rpm-5.4.9/macros/macros create mode 100644 rpm-5.4.9/macros/macros.in create mode 100644 rpm-5.4.9/macros/macros.rpmbuild create mode 100644 rpm-5.4.9/macros/macros.rpmbuild.in create mode 100644 rpm-5.4.9/macros/mandriva create mode 100644 rpm-5.4.9/macros/mandriva.in create mode 100644 rpm-5.4.9/macros/mandriva.in.orig create mode 100644 rpm-5.4.9/macros/mono create mode 100644 rpm-5.4.9/macros/mono.in create mode 100644 rpm-5.4.9/macros/perl create mode 100644 rpm-5.4.9/macros/perl.in create mode 100644 rpm-5.4.9/macros/php create mode 100644 rpm-5.4.9/macros/php.in create mode 100644 rpm-5.4.9/macros/pkgconfig create mode 100644 rpm-5.4.9/macros/pkgconfig.in create mode 100644 rpm-5.4.9/macros/python create mode 100644 rpm-5.4.9/macros/python.in create mode 100644 rpm-5.4.9/macros/ruby create mode 100644 rpm-5.4.9/macros/ruby.in create mode 100644 rpm-5.4.9/macros/selinux create mode 100644 rpm-5.4.9/macros/selinux.in create mode 100644 rpm-5.4.9/macros/suse create mode 100644 rpm-5.4.9/macros/suse.in create mode 100644 rpm-5.4.9/macros/tcl create mode 100644 rpm-5.4.9/macros/tcl.in create mode 100644 rpm-5.4.9/misc/Makefile.am create mode 100644 rpm-5.4.9/misc/Makefile.in create mode 100644 rpm-5.4.9/misc/alloca.c create mode 100644 rpm-5.4.9/misc/asprintf.c create mode 100644 rpm-5.4.9/misc/basename.c create mode 100644 rpm-5.4.9/misc/err.c create mode 100644 rpm-5.4.9/misc/err.h create mode 100644 rpm-5.4.9/misc/error.c create mode 100644 rpm-5.4.9/misc/error.h create mode 100644 rpm-5.4.9/misc/fakefork.c create mode 100644 rpm-5.4.9/misc/getcwd.c create mode 100644 rpm-5.4.9/misc/getdelim.c create mode 100644 rpm-5.4.9/misc/getline.c create mode 100644 rpm-5.4.9/misc/getmntent.c create mode 100644 rpm-5.4.9/misc/getwd.c create mode 100644 rpm-5.4.9/misc/librpmmisc.c create mode 100644 rpm-5.4.9/misc/librpmmisc.vers create mode 100644 rpm-5.4.9/misc/memcmp.c create mode 100644 rpm-5.4.9/misc/mkdtemp.c create mode 100644 rpm-5.4.9/misc/mktime.c create mode 100644 rpm-5.4.9/misc/myrealloc.c create mode 100644 rpm-5.4.9/misc/putenv.c create mode 100644 rpm-5.4.9/misc/realpath.c create mode 100644 rpm-5.4.9/misc/setenv.c create mode 100644 rpm-5.4.9/misc/setproctitle.c create mode 100644 rpm-5.4.9/misc/stpcpy.c create mode 100644 rpm-5.4.9/misc/stpncpy.c create mode 100644 rpm-5.4.9/misc/strcspn.c create mode 100644 rpm-5.4.9/misc/strdup.c create mode 100644 rpm-5.4.9/misc/strerror.c create mode 100644 rpm-5.4.9/misc/strftime.c create mode 100644 rpm-5.4.9/misc/strstr.c create mode 100644 rpm-5.4.9/misc/strtol.c create mode 100644 rpm-5.4.9/misc/strtoul.c create mode 100644 rpm-5.4.9/misc/tempname.h create mode 100755 rpm-5.4.9/missing create mode 100755 rpm-5.4.9/mkinstalldirs create mode 100644 rpm-5.4.9/perl/.cvsignore create mode 100644 rpm-5.4.9/perl/MANIFEST create mode 100644 rpm-5.4.9/perl/META.yml create mode 100644 rpm-5.4.9/perl/Makefile create mode 100644 rpm-5.4.9/perl/Makefile.PL create mode 100644 rpm-5.4.9/perl/Makefile.PL.in create mode 100644 rpm-5.4.9/perl/Makefile.am create mode 100644 rpm-5.4.9/perl/Makefile.in create mode 100644 rpm-5.4.9/perl/README create mode 100644 rpm-5.4.9/perl/RPM.pm create mode 100644 rpm-5.4.9/perl/RPM.xs create mode 100644 rpm-5.4.9/perl/RPM/Constant.pm create mode 100644 rpm-5.4.9/perl/RPM/Dependencies.pm create mode 100644 rpm-5.4.9/perl/RPM/Files.pm create mode 100644 rpm-5.4.9/perl/RPM/Header.pm create mode 100644 rpm-5.4.9/perl/RPM/PackageIterator.pm create mode 100644 rpm-5.4.9/perl/RPM/Problems.pm create mode 100644 rpm-5.4.9/perl/RPM/Sign.pm create mode 100644 rpm-5.4.9/perl/RPM/Spec.pm create mode 100644 rpm-5.4.9/perl/RPM/Transaction.pm create mode 100644 rpm-5.4.9/perl/RPM_Constant.xs create mode 100644 rpm-5.4.9/perl/RPM_Dependencies.xs create mode 100644 rpm-5.4.9/perl/RPM_Files.xs create mode 100644 rpm-5.4.9/perl/RPM_Header.xs create mode 100644 rpm-5.4.9/perl/RPM_PackageIterator.xs create mode 100644 rpm-5.4.9/perl/RPM_Problems.xs create mode 100644 rpm-5.4.9/perl/RPM_Spec.xs create mode 100644 rpm-5.4.9/perl/RPM_Transaction.xs create mode 100644 rpm-5.4.9/perl/foo.i386.rpm create mode 100644 rpm-5.4.9/perl/hdlist-test.hdr create mode 100644 rpm-5.4.9/perl/rpmxs.c create mode 100644 rpm-5.4.9/perl/rpmxs.h create mode 100644 rpm-5.4.9/perl/t/00.pod.coverage.t create mode 100644 rpm-5.4.9/perl/t/00.pod.t create mode 100644 rpm-5.4.9/perl/t/01.rpm.t create mode 100644 rpm-5.4.9/perl/t/02.rpmconstant.t create mode 100644 rpm-5.4.9/perl/t/03.header.t create mode 100644 rpm-5.4.9/perl/t/04.transaction.t create mode 100644 rpm-5.4.9/perl/t/05.packageiterator.t create mode 100644 rpm-5.4.9/perl/t/06.problems.t create mode 100644 rpm-5.4.9/perl/t/07.files.t create mode 100644 rpm-5.4.9/perl/t/08.dependencies.t create mode 100644 rpm-5.4.9/perl/t/09.spec.t create mode 100644 rpm-5.4.9/perl/t/10.sign.t create mode 100644 rpm-5.4.9/perl/t/gnupg/passphrase create mode 100644 rpm-5.4.9/perl/t/gnupg/pubring.gpg create mode 100644 rpm-5.4.9/perl/t/gnupg/random_seed create mode 100644 rpm-5.4.9/perl/t/gnupg/secring.gpg create mode 100644 rpm-5.4.9/perl/t/gnupg/test-key.gpg create mode 100644 rpm-5.4.9/perl/t/gnupg/trustdb.gpg create mode 100644 rpm-5.4.9/perl/test-rpm-1.0-1.noarch.rpm create mode 100644 rpm-5.4.9/perl/test-rpm-1.0-1.src.rpm create mode 100644 rpm-5.4.9/perl/test-rpm.spec create mode 100644 rpm-5.4.9/perl/typemap create mode 100644 rpm-5.4.9/po/LINGUAS create mode 100644 rpm-5.4.9/po/Makefile.in.in create mode 100644 rpm-5.4.9/po/Makevars create mode 100644 rpm-5.4.9/po/POTFILES.in create mode 100644 rpm-5.4.9/po/Rules-quot create mode 100644 rpm-5.4.9/po/boldquot.sed create mode 100644 rpm-5.4.9/po/cs.gmo create mode 100644 rpm-5.4.9/po/cs.po create mode 100644 rpm-5.4.9/po/da.gmo create mode 100644 rpm-5.4.9/po/da.po create mode 100644 rpm-5.4.9/po/de.gmo create mode 100644 rpm-5.4.9/po/de.po create mode 100644 rpm-5.4.9/po/en@boldquot.header create mode 100644 rpm-5.4.9/po/en@quot.header create mode 100644 rpm-5.4.9/po/eo.gmo create mode 100644 rpm-5.4.9/po/eo.po create mode 100644 rpm-5.4.9/po/es.gmo create mode 100644 rpm-5.4.9/po/es.po create mode 100644 rpm-5.4.9/po/fi.gmo create mode 100644 rpm-5.4.9/po/fi.po create mode 100644 rpm-5.4.9/po/fr.gmo create mode 100644 rpm-5.4.9/po/fr.po create mode 100644 rpm-5.4.9/po/id.gmo create mode 100644 rpm-5.4.9/po/id.po create mode 100644 rpm-5.4.9/po/insert-header.sin create mode 100644 rpm-5.4.9/po/is.gmo create mode 100644 rpm-5.4.9/po/is.po create mode 100644 rpm-5.4.9/po/it.gmo create mode 100644 rpm-5.4.9/po/it.po create mode 100644 rpm-5.4.9/po/ja.gmo create mode 100644 rpm-5.4.9/po/ja.po create mode 100644 rpm-5.4.9/po/ko.gmo create mode 100644 rpm-5.4.9/po/ko.po create mode 100644 rpm-5.4.9/po/nb.gmo create mode 100644 rpm-5.4.9/po/nb.po create mode 100644 rpm-5.4.9/po/nl.gmo create mode 100644 rpm-5.4.9/po/nl.po create mode 100644 rpm-5.4.9/po/pa.gmo create mode 100644 rpm-5.4.9/po/pa.po create mode 100644 rpm-5.4.9/po/pl.gmo create mode 100644 rpm-5.4.9/po/pl.po create mode 100644 rpm-5.4.9/po/pt.gmo create mode 100644 rpm-5.4.9/po/pt.po create mode 100644 rpm-5.4.9/po/pt_BR.gmo create mode 100644 rpm-5.4.9/po/pt_BR.po create mode 100644 rpm-5.4.9/po/quot.sed create mode 100644 rpm-5.4.9/po/remove-potcdate.sin create mode 100644 rpm-5.4.9/po/rpm.pot create mode 100644 rpm-5.4.9/po/ru.gmo create mode 100644 rpm-5.4.9/po/ru.po create mode 100644 rpm-5.4.9/po/sk.gmo create mode 100644 rpm-5.4.9/po/sk.po create mode 100644 rpm-5.4.9/po/sl.gmo create mode 100644 rpm-5.4.9/po/sl.po create mode 100644 rpm-5.4.9/po/sr.gmo create mode 100644 rpm-5.4.9/po/sr.po create mode 100644 rpm-5.4.9/po/stamp-po create mode 100644 rpm-5.4.9/po/sv.gmo create mode 100644 rpm-5.4.9/po/sv.po create mode 100644 rpm-5.4.9/po/tr.gmo create mode 100644 rpm-5.4.9/po/tr.po create mode 100644 rpm-5.4.9/po/uk.gmo create mode 100644 rpm-5.4.9/po/uk.po create mode 100644 rpm-5.4.9/po/vi.gmo create mode 100644 rpm-5.4.9/po/vi.po create mode 100644 rpm-5.4.9/po/zh_TW.gmo create mode 100644 rpm-5.4.9/po/zh_TW.po create mode 100644 rpm-5.4.9/pubkeys/JBJ-GPG-KEY create mode 100644 rpm-5.4.9/python/.cvsignore create mode 100644 rpm-5.4.9/python/.splintrc create mode 100644 rpm-5.4.9/python/ChangeLog create mode 100644 rpm-5.4.9/python/Makefile create mode 100644 rpm-5.4.9/python/Makefile.am create mode 100644 rpm-5.4.9/python/Makefile.in create mode 100644 rpm-5.4.9/python/header-py.c create mode 100644 rpm-5.4.9/python/header-py.h create mode 100644 rpm-5.4.9/python/mpw/.cvsignore create mode 100644 rpm-5.4.9/python/mpw/Makefile.am create mode 100644 rpm-5.4.9/python/mpw/test/.cvsignore create mode 100644 rpm-5.4.9/python/mpw/test/Makefile.am create mode 100644 rpm-5.4.9/python/mpw/test/test_all.py create mode 100644 rpm-5.4.9/python/mpw/test/test_methods.py create mode 100644 rpm-5.4.9/python/mpw/test/unittest.py create mode 100644 rpm-5.4.9/python/pow.py create mode 100644 rpm-5.4.9/python/rng.py create mode 100644 rpm-5.4.9/python/rpm/.cvsignore create mode 100644 rpm-5.4.9/python/rpm/__init__.py create mode 100644 rpm-5.4.9/python/rpmal-py.c create mode 100644 rpm-5.4.9/python/rpmal-py.h create mode 100644 rpm-5.4.9/python/rpmbc-py.h create mode 100644 rpm-5.4.9/python/rpmdb-py.c create mode 100644 rpm-5.4.9/python/rpmdb-py.h create mode 100644 rpm-5.4.9/python/rpmdebug-py.c create mode 100644 rpm-5.4.9/python/rpmds-py.c create mode 100644 rpm-5.4.9/python/rpmds-py.h create mode 100644 rpm-5.4.9/python/rpmfd-py.c create mode 100644 rpm-5.4.9/python/rpmfd-py.h create mode 100644 rpm-5.4.9/python/rpmfi-py.c create mode 100644 rpm-5.4.9/python/rpmfi-py.h create mode 100644 rpm-5.4.9/python/rpmfts-py.c create mode 100644 rpm-5.4.9/python/rpmfts-py.h create mode 100644 rpm-5.4.9/python/rpmkeyring-py.c create mode 100644 rpm-5.4.9/python/rpmkeyring-py.h create mode 100644 rpm-5.4.9/python/rpmmacro-py.c create mode 100644 rpm-5.4.9/python/rpmmacro-py.h create mode 100644 rpm-5.4.9/python/rpmmi-py.c create mode 100644 rpm-5.4.9/python/rpmmi-py.h create mode 100644 rpm-5.4.9/python/rpmmodule.c create mode 100644 rpm-5.4.9/python/rpmmpw-py.h create mode 100644 rpm-5.4.9/python/rpmps-py.c create mode 100644 rpm-5.4.9/python/rpmps-py.h create mode 100644 rpm-5.4.9/python/rpmrng-py.h create mode 100644 rpm-5.4.9/python/rpmtd-py.c create mode 100644 rpm-5.4.9/python/rpmtd-py.h create mode 100644 rpm-5.4.9/python/rpmte-py.c create mode 100644 rpm-5.4.9/python/rpmte-py.h create mode 100644 rpm-5.4.9/python/rpmts-py.c create mode 100644 rpm-5.4.9/python/rpmts-py.h create mode 100644 rpm-5.4.9/python/spec-py.c create mode 100644 rpm-5.4.9/python/spec-py.h create mode 100644 rpm-5.4.9/python/sub.py create mode 100644 rpm-5.4.9/python/system.h create mode 100644 rpm-5.4.9/python/test/dsMerge.py create mode 100755 rpm-5.4.9/python/test/dscmp create mode 100644 rpm-5.4.9/python/test/psTest.py create mode 100644 rpm-5.4.9/python/test/resources/.cvsignore create mode 100644 rpm-5.4.9/python/test/resources/missingreq.spec create mode 100644 rpm-5.4.9/python/test/resources/provider.spec create mode 100644 rpm-5.4.9/python/test/resources/requirer.spec create mode 100644 rpm-5.4.9/python/test/resources/reqver.spec create mode 100644 rpm-5.4.9/python/test/resources/simple.spec create mode 100644 rpm-5.4.9/python/test/test_rpm.py create mode 100755 rpm-5.4.9/python/test/testhdr create mode 100755 rpm-5.4.9/python/test/testit create mode 100755 rpm-5.4.9/python/test/testmi create mode 100644 rpm-5.4.9/python/test/testrollback.py create mode 100644 rpm-5.4.9/rpm.magic create mode 100644 rpm-5.4.9/rpm.spec.in create mode 100644 rpm-5.4.9/rpmconstant/Makefile.am create mode 100644 rpm-5.4.9/rpmconstant/Makefile.in create mode 100644 rpm-5.4.9/rpmconstant/constant.c create mode 100644 rpm-5.4.9/rpmconstant/librpmconstant.vers create mode 100644 rpm-5.4.9/rpmconstant/rpmconstant.c create mode 100644 rpm-5.4.9/rpmconstant/rpmconstant.h create mode 100644 rpm-5.4.9/rpmconstant/rpmconstant_internal.c create mode 100644 rpm-5.4.9/rpmconstant/rpmconstanttbl.c create mode 100644 rpm-5.4.9/rpmconstant/rpmh2tbl create mode 100644 rpm-5.4.9/rpmdb/DB_CONFIG.in create mode 100644 rpm-5.4.9/rpmdb/Makefile.am create mode 100644 rpm-5.4.9/rpmdb/Makefile.in create mode 100644 rpm-5.4.9/rpmdb/auto/Makefile.am create mode 100644 rpm-5.4.9/rpmdb/auto/Makefile.in create mode 100644 rpm-5.4.9/rpmdb/auto/desc create mode 100644 rpm-5.4.9/rpmdb/auto/desc.in create mode 100644 rpm-5.4.9/rpmdb/auto/types create mode 100644 rpm-5.4.9/rpmdb/auto/types.in create mode 100644 rpm-5.4.9/rpmdb/bdb.sql create mode 100644 rpm-5.4.9/rpmdb/db3.c create mode 100644 rpm-5.4.9/rpmdb/db_emu.h create mode 100644 rpm-5.4.9/rpmdb/dbconfig.c create mode 100644 rpm-5.4.9/rpmdb/fprint.c create mode 100644 rpm-5.4.9/rpmdb/fprint.h create mode 100644 rpm-5.4.9/rpmdb/hdrNVR.c create mode 100644 rpm-5.4.9/rpmdb/hdrfmt.c create mode 100644 rpm-5.4.9/rpmdb/header.c create mode 100644 rpm-5.4.9/rpmdb/header_internal.c create mode 100644 rpm-5.4.9/rpmdb/header_internal.h create mode 100644 rpm-5.4.9/rpmdb/legacy.c create mode 100644 rpm-5.4.9/rpmdb/legacy.h create mode 100644 rpm-5.4.9/rpmdb/librpmdb.vers create mode 100644 rpm-5.4.9/rpmdb/logio.awk create mode 100644 rpm-5.4.9/rpmdb/logio.c create mode 100644 rpm-5.4.9/rpmdb/logio.h create mode 100644 rpm-5.4.9/rpmdb/logio.src create mode 100644 rpm-5.4.9/rpmdb/logio_auto.c create mode 100644 rpm-5.4.9/rpmdb/logio_auto.h create mode 100644 rpm-5.4.9/rpmdb/logio_autop.c create mode 100644 rpm-5.4.9/rpmdb/logio_rec.c create mode 100644 rpm-5.4.9/rpmdb/logio_recover_template create mode 100644 rpm-5.4.9/rpmdb/logio_template create mode 100644 rpm-5.4.9/rpmdb/merge.c create mode 100644 rpm-5.4.9/rpmdb/package.c create mode 100644 rpm-5.4.9/rpmdb/pkgio.c create mode 100644 rpm-5.4.9/rpmdb/pkgio.h create mode 100644 rpm-5.4.9/rpmdb/poptDB.c create mode 100644 rpm-5.4.9/rpmdb/rpmdb.c create mode 100644 rpm-5.4.9/rpmdb/rpmdb.h create mode 100644 rpm-5.4.9/rpmdb/rpmdpkg.c create mode 100644 rpm-5.4.9/rpmdb/rpmdpkg.h create mode 100644 rpm-5.4.9/rpmdb/rpmevr.c create mode 100644 rpm-5.4.9/rpmdb/rpmevr.h create mode 100644 rpm-5.4.9/rpmdb/rpmlio.c create mode 100644 rpm-5.4.9/rpmdb/rpmlio.h create mode 100644 rpm-5.4.9/rpmdb/rpmmdb.c create mode 100644 rpm-5.4.9/rpmdb/rpmmdb.h create mode 100644 rpm-5.4.9/rpmdb/rpmns.c create mode 100644 rpm-5.4.9/rpmdb/rpmns.h create mode 100644 rpm-5.4.9/rpmdb/rpmrepo.c create mode 100644 rpm-5.4.9/rpmdb/rpmrepo.h create mode 100644 rpm-5.4.9/rpmdb/rpmtag.h create mode 100644 rpm-5.4.9/rpmdb/rpmtd.c create mode 100644 rpm-5.4.9/rpmdb/rpmtd.h create mode 100644 rpm-5.4.9/rpmdb/rpmtxn.c create mode 100644 rpm-5.4.9/rpmdb/rpmtxn.h create mode 100644 rpm-5.4.9/rpmdb/rpmtypes.h create mode 100644 rpm-5.4.9/rpmdb/rpmwf.c create mode 100644 rpm-5.4.9/rpmdb/rpmwf.h create mode 100644 rpm-5.4.9/rpmdb/signature.c create mode 100644 rpm-5.4.9/rpmdb/signature.h create mode 100644 rpm-5.4.9/rpmdb/sqlite.c create mode 100644 rpm-5.4.9/rpmdb/tagname.c create mode 100644 rpm-5.4.9/rpmdb/tagtbl.c create mode 100644 rpm-5.4.9/rpmdb/tjfn.c create mode 100644 rpm-5.4.9/rpmio/Makefile.am create mode 100644 rpm-5.4.9/rpmio/Makefile.in create mode 100644 rpm-5.4.9/rpmio/TODO create mode 100644 rpm-5.4.9/rpmio/ar.c create mode 100644 rpm-5.4.9/rpmio/ar.h create mode 100644 rpm-5.4.9/rpmio/argv.c create mode 100644 rpm-5.4.9/rpmio/argv.h create mode 100644 rpm-5.4.9/rpmio/arirang.c create mode 100644 rpm-5.4.9/rpmio/arirang.h create mode 100644 rpm-5.4.9/rpmio/auto/Makefile.am create mode 100644 rpm-5.4.9/rpmio/auto/Makefile.in create mode 100644 rpm-5.4.9/rpmio/auto/desc create mode 100644 rpm-5.4.9/rpmio/auto/desc.in create mode 100644 rpm-5.4.9/rpmio/auto/types create mode 100644 rpm-5.4.9/rpmio/auto/types.in create mode 100644 rpm-5.4.9/rpmio/blake.c create mode 100644 rpm-5.4.9/rpmio/blake.h create mode 100644 rpm-5.4.9/rpmio/bmw.c create mode 100644 rpm-5.4.9/rpmio/bmw.h create mode 100644 rpm-5.4.9/rpmio/bsdiff.c create mode 100644 rpm-5.4.9/rpmio/bson.c create mode 100644 rpm-5.4.9/rpmio/bson.h create mode 100644 rpm-5.4.9/rpmio/bspatch.c create mode 100644 rpm-5.4.9/rpmio/bzdio.c create mode 100644 rpm-5.4.9/rpmio/chi.c create mode 100644 rpm-5.4.9/rpmio/chi.h create mode 100644 rpm-5.4.9/rpmio/cpio.c create mode 100644 rpm-5.4.9/rpmio/cpio.h create mode 100644 rpm-5.4.9/rpmio/crc.c create mode 100644 rpm-5.4.9/rpmio/crc.h create mode 100644 rpm-5.4.9/rpmio/cubehash.c create mode 100644 rpm-5.4.9/rpmio/cubehash.h create mode 100644 rpm-5.4.9/rpmio/digest.c create mode 100644 rpm-5.4.9/rpmio/dumpasn1.c create mode 100644 rpm-5.4.9/rpmio/echo.c create mode 100644 rpm-5.4.9/rpmio/echo.h create mode 100644 rpm-5.4.9/rpmio/edon-r.c create mode 100644 rpm-5.4.9/rpmio/edon-r.h create mode 100644 rpm-5.4.9/rpmio/envvar.h create mode 100644 rpm-5.4.9/rpmio/fnmatch.c create mode 100644 rpm-5.4.9/rpmio/fnmatch.h create mode 100644 rpm-5.4.9/rpmio/fnmatch_loop.c create mode 100644 rpm-5.4.9/rpmio/fts.c create mode 100644 rpm-5.4.9/rpmio/fts.h create mode 100644 rpm-5.4.9/rpmio/fugue.c create mode 100644 rpm-5.4.9/rpmio/fugue.h create mode 100644 rpm-5.4.9/rpmio/gengpg.h create mode 100644 rpm-5.4.9/rpmio/gengpg.sh create mode 100644 rpm-5.4.9/rpmio/getdate.c create mode 100644 rpm-5.4.9/rpmio/getdate.y create mode 100644 rpm-5.4.9/rpmio/glob.c create mode 100644 rpm-5.4.9/rpmio/glob.h create mode 100644 rpm-5.4.9/rpmio/groestl.c create mode 100644 rpm-5.4.9/rpmio/groestl.h create mode 100644 rpm-5.4.9/rpmio/gzdio.c create mode 100644 rpm-5.4.9/rpmio/hamsi.c create mode 100644 rpm-5.4.9/rpmio/hamsi.h create mode 100644 rpm-5.4.9/rpmio/iosm.c create mode 100644 rpm-5.4.9/rpmio/iosm.h create mode 100644 rpm-5.4.9/rpmio/jh.c create mode 100644 rpm-5.4.9/rpmio/jh.h create mode 100644 rpm-5.4.9/rpmio/keccak.c create mode 100644 rpm-5.4.9/rpmio/keccak.h create mode 100644 rpm-5.4.9/rpmio/lane.c create mode 100644 rpm-5.4.9/rpmio/lane.h create mode 100644 rpm-5.4.9/rpmio/librpmio.vers create mode 100644 rpm-5.4.9/rpmio/lookup3.c create mode 100644 rpm-5.4.9/rpmio/lsyck.c create mode 100644 rpm-5.4.9/rpmio/luffa.c create mode 100644 rpm-5.4.9/rpmio/luffa.h create mode 100644 rpm-5.4.9/rpmio/macro.c create mode 100644 rpm-5.4.9/rpmio/md2.c create mode 100644 rpm-5.4.9/rpmio/md2.h create mode 100644 rpm-5.4.9/rpmio/md6.c create mode 100644 rpm-5.4.9/rpmio/md6.h create mode 100644 rpm-5.4.9/rpmio/mire.c create mode 100644 rpm-5.4.9/rpmio/mire.h create mode 100644 rpm-5.4.9/rpmio/mongo.c create mode 100644 rpm-5.4.9/rpmio/mongo.h create mode 100644 rpm-5.4.9/rpmio/mount.c create mode 100644 rpm-5.4.9/rpmio/poptIO.c create mode 100644 rpm-5.4.9/rpmio/poptIO.h create mode 100644 rpm-5.4.9/rpmio/rpmacl.c create mode 100644 rpm-5.4.9/rpmio/rpmacl.h create mode 100644 rpm-5.4.9/rpmio/rpmasn.c create mode 100644 rpm-5.4.9/rpmio/rpmasn.h create mode 100644 rpm-5.4.9/rpmio/rpmaug.c create mode 100644 rpm-5.4.9/rpmio/rpmaug.h create mode 100644 rpm-5.4.9/rpmio/rpmbag.c create mode 100644 rpm-5.4.9/rpmio/rpmbag.h create mode 100644 rpm-5.4.9/rpmio/rpmbc.c create mode 100644 rpm-5.4.9/rpmio/rpmbc.h create mode 100644 rpm-5.4.9/rpmio/rpmbf.c create mode 100644 rpm-5.4.9/rpmio/rpmbf.h create mode 100644 rpm-5.4.9/rpmio/rpmborg.c create mode 100644 rpm-5.4.9/rpmio/rpmbz.h create mode 100644 rpm-5.4.9/rpmio/rpmcb.h create mode 100644 rpm-5.4.9/rpmio/rpmcdsa.c create mode 100644 rpm-5.4.9/rpmio/rpmcdsa.h create mode 100644 rpm-5.4.9/rpmio/rpmcpio.c create mode 100644 rpm-5.4.9/rpmio/rpmcpio.h create mode 100644 rpm-5.4.9/rpmio/rpmcudf.c create mode 100644 rpm-5.4.9/rpmio/rpmcudf.h create mode 100644 rpm-5.4.9/rpmio/rpmcurl.c create mode 100644 rpm-5.4.9/rpmio/rpmcvs.c create mode 100644 rpm-5.4.9/rpmio/rpmcvs.h create mode 100644 rpm-5.4.9/rpmio/rpmdav.c create mode 100644 rpm-5.4.9/rpmio/rpmdav.h create mode 100644 rpm-5.4.9/rpmio/rpmdir.c create mode 100644 rpm-5.4.9/rpmio/rpmdir.h create mode 100644 rpm-5.4.9/rpmio/rpmdpkg.c create mode 100644 rpm-5.4.9/rpmio/rpmficl.c create mode 100644 rpm-5.4.9/rpmio/rpmficl.h create mode 100644 rpm-5.4.9/rpmio/rpmgc.c create mode 100644 rpm-5.4.9/rpmio/rpmgc.h create mode 100644 rpm-5.4.9/rpmio/rpmgenbasedir.c create mode 100644 rpm-5.4.9/rpmio/rpmgenpkglist.c create mode 100644 rpm-5.4.9/rpmio/rpmgensrclist.c create mode 100644 rpm-5.4.9/rpmio/rpmgit.c create mode 100644 rpm-5.4.9/rpmio/rpmgit.h create mode 100644 rpm-5.4.9/rpmio/rpmgpg.c create mode 100644 rpm-5.4.9/rpmio/rpmhash.c create mode 100644 rpm-5.4.9/rpmio/rpmhash.h create mode 100644 rpm-5.4.9/rpmio/rpmhkp.c create mode 100644 rpm-5.4.9/rpmio/rpmhkp.h create mode 100644 rpm-5.4.9/rpmio/rpmhook.c create mode 100644 rpm-5.4.9/rpmio/rpmhook.h create mode 100644 rpm-5.4.9/rpmio/rpmio-stub.c create mode 100644 rpm-5.4.9/rpmio/rpmio-stub.h create mode 100644 rpm-5.4.9/rpmio/rpmio.c create mode 100644 rpm-5.4.9/rpmio/rpmio.h create mode 100644 rpm-5.4.9/rpmio/rpmio_internal.h create mode 100644 rpm-5.4.9/rpmio/rpmiob.c create mode 100644 rpm-5.4.9/rpmio/rpmiotypes.h create mode 100644 rpm-5.4.9/rpmio/rpmjs.c create mode 100644 rpm-5.4.9/rpmio/rpmjs.h create mode 100644 rpm-5.4.9/rpmio/rpmjsio.c create mode 100644 rpm-5.4.9/rpmio/rpmjsio.h create mode 100644 rpm-5.4.9/rpmio/rpmjsio.msg create mode 100644 rpm-5.4.9/rpmio/rpmkeyring.c create mode 100644 rpm-5.4.9/rpmio/rpmkeyring.h create mode 100644 rpm-5.4.9/rpmio/rpmku.c create mode 100644 rpm-5.4.9/rpmio/rpmku.h create mode 100644 rpm-5.4.9/rpmio/rpmlog.c create mode 100644 rpm-5.4.9/rpmio/rpmlog.h create mode 100644 rpm-5.4.9/rpmio/rpmltc.c create mode 100644 rpm-5.4.9/rpmio/rpmltc.h create mode 100644 rpm-5.4.9/rpmio/rpmlua.c create mode 100644 rpm-5.4.9/rpmio/rpmlua.h create mode 100644 rpm-5.4.9/rpmio/rpmmacro.h create mode 100644 rpm-5.4.9/rpmio/rpmmalloc.c create mode 100644 rpm-5.4.9/rpmio/rpmmg.c create mode 100644 rpm-5.4.9/rpmio/rpmmg.h create mode 100644 rpm-5.4.9/rpmio/rpmnix.c create mode 100644 rpm-5.4.9/rpmio/rpmnix.h create mode 100644 rpm-5.4.9/rpmio/rpmnss.c create mode 100644 rpm-5.4.9/rpmio/rpmnss.h create mode 100644 rpm-5.4.9/rpmio/rpmodbc.c create mode 100644 rpm-5.4.9/rpmio/rpmodbc.h create mode 100644 rpm-5.4.9/rpmio/rpmpbzip2.c create mode 100644 rpm-5.4.9/rpmio/rpmperl.c create mode 100644 rpm-5.4.9/rpmio/rpmperl.h create mode 100644 rpm-5.4.9/rpmio/rpmpgp.c create mode 100644 rpm-5.4.9/rpmio/rpmpgp.h create mode 100644 rpm-5.4.9/rpmio/rpmpigz.c create mode 100644 rpm-5.4.9/rpmio/rpmpython.c create mode 100644 rpm-5.4.9/rpmio/rpmpython.h create mode 100644 rpm-5.4.9/rpmio/rpmrpc.c create mode 100644 rpm-5.4.9/rpmio/rpmruby.c create mode 100644 rpm-5.4.9/rpmio/rpmruby.h create mode 100644 rpm-5.4.9/rpmio/rpmsm.c create mode 100644 rpm-5.4.9/rpmio/rpmsm.h create mode 100644 rpm-5.4.9/rpmio/rpmsp.c create mode 100644 rpm-5.4.9/rpmio/rpmsp.h create mode 100644 rpm-5.4.9/rpmio/rpmsq.c create mode 100644 rpm-5.4.9/rpmio/rpmsq.h create mode 100644 rpm-5.4.9/rpmio/rpmsql.c create mode 100644 rpm-5.4.9/rpmio/rpmsql.h create mode 100644 rpm-5.4.9/rpmio/rpmsquirrel.c create mode 100644 rpm-5.4.9/rpmio/rpmsquirrel.h create mode 100644 rpm-5.4.9/rpmio/rpmssl.c create mode 100644 rpm-5.4.9/rpmio/rpmssl.h create mode 100644 rpm-5.4.9/rpmio/rpmsvn.c create mode 100644 rpm-5.4.9/rpmio/rpmsvn.h create mode 100644 rpm-5.4.9/rpmio/rpmsw.c create mode 100644 rpm-5.4.9/rpmio/rpmsw.h create mode 100644 rpm-5.4.9/rpmio/rpmsx.c create mode 100644 rpm-5.4.9/rpmio/rpmsx.h create mode 100644 rpm-5.4.9/rpmio/rpmsyck.c create mode 100644 rpm-5.4.9/rpmio/rpmsyck.h create mode 100644 rpm-5.4.9/rpmio/rpmtar.c create mode 100644 rpm-5.4.9/rpmio/rpmtar.h create mode 100644 rpm-5.4.9/rpmio/rpmtcl.c create mode 100644 rpm-5.4.9/rpmio/rpmtcl.h create mode 100644 rpm-5.4.9/rpmio/rpmtpm.c create mode 100644 rpm-5.4.9/rpmio/rpmtpm.h create mode 100644 rpm-5.4.9/rpmio/rpmurl.h create mode 100644 rpm-5.4.9/rpmio/rpmuuid.c create mode 100644 rpm-5.4.9/rpmio/rpmuuid.h create mode 100644 rpm-5.4.9/rpmio/rpmxar.c create mode 100644 rpm-5.4.9/rpmio/rpmxar.h create mode 100644 rpm-5.4.9/rpmio/rpmz.c create mode 100644 rpm-5.4.9/rpmio/rpmz.h create mode 100644 rpm-5.4.9/rpmio/rpmzlog.c create mode 100644 rpm-5.4.9/rpmio/rpmzlog.h create mode 100644 rpm-5.4.9/rpmio/rpmzq.c create mode 100644 rpm-5.4.9/rpmio/rpmzq.h create mode 100644 rpm-5.4.9/rpmio/salsa10.c create mode 100644 rpm-5.4.9/rpmio/salsa10.h create mode 100644 rpm-5.4.9/rpmio/salsa20.c create mode 100644 rpm-5.4.9/rpmio/salsa20.h create mode 100644 rpm-5.4.9/rpmio/set.c create mode 100644 rpm-5.4.9/rpmio/set.h create mode 100644 rpm-5.4.9/rpmio/shabal.c create mode 100644 rpm-5.4.9/rpmio/shabal.h create mode 100644 rpm-5.4.9/rpmio/shavite3.c create mode 100644 rpm-5.4.9/rpmio/shavite3.h create mode 100644 rpm-5.4.9/rpmio/simd.c create mode 100644 rpm-5.4.9/rpmio/simd.h create mode 100644 rpm-5.4.9/rpmio/skein.c create mode 100644 rpm-5.4.9/rpmio/skein.h create mode 100644 rpm-5.4.9/rpmio/strcasecmp.c create mode 100644 rpm-5.4.9/rpmio/strtolocale.c create mode 100644 rpm-5.4.9/rpmio/tar.c create mode 100644 rpm-5.4.9/rpmio/tar.h create mode 100644 rpm-5.4.9/rpmio/tasn.c create mode 100644 rpm-5.4.9/rpmio/tdir.c create mode 100755 rpm-5.4.9/rpmio/testit.sh create mode 100644 rpm-5.4.9/rpmio/tfts.c create mode 100644 rpm-5.4.9/rpmio/tget.c create mode 100644 rpm-5.4.9/rpmio/tgit.c create mode 100644 rpm-5.4.9/rpmio/tglob.c create mode 100644 rpm-5.4.9/rpmio/thkp.c create mode 100644 rpm-5.4.9/rpmio/thtml.c create mode 100644 rpm-5.4.9/rpmio/tib3.c create mode 100755 rpm-5.4.9/rpmio/tib3.h create mode 100644 rpm-5.4.9/rpmio/tiger.c create mode 100644 rpm-5.4.9/rpmio/tiger.h create mode 100644 rpm-5.4.9/rpmio/tinv.c create mode 100644 rpm-5.4.9/rpmio/tkey.c create mode 100644 rpm-5.4.9/rpmio/tmagic.c create mode 100644 rpm-5.4.9/rpmio/tmire.c create mode 100644 rpm-5.4.9/rpmio/todbc.c create mode 100644 rpm-5.4.9/rpmio/tperl.c create mode 100644 rpm-5.4.9/rpmio/tput.c create mode 100644 rpm-5.4.9/rpmio/tpw.c create mode 100644 rpm-5.4.9/rpmio/tpython.c create mode 100644 rpm-5.4.9/rpmio/trpmio.c create mode 100644 rpm-5.4.9/rpmio/tsexp.c create mode 100644 rpm-5.4.9/rpmio/tsvn.c create mode 100644 rpm-5.4.9/rpmio/tsw.c create mode 100644 rpm-5.4.9/rpmio/ttcl.c create mode 100644 rpm-5.4.9/rpmio/ttpm.c create mode 100644 rpm-5.4.9/rpmio/ugid.c create mode 100644 rpm-5.4.9/rpmio/ugid.h create mode 100644 rpm-5.4.9/rpmio/url.c create mode 100644 rpm-5.4.9/rpmio/xzdio.c create mode 100644 rpm-5.4.9/rpmio/yarn.c create mode 100644 rpm-5.4.9/rpmio/yarn.h create mode 100644 rpm-5.4.9/rpmpopt.in create mode 100644 rpm-5.4.9/rpmqv.c create mode 100644 rpm-5.4.9/ruby/.cvsignore create mode 100644 rpm-5.4.9/ruby/Makefile create mode 100644 rpm-5.4.9/ruby/Makefile.am create mode 100644 rpm-5.4.9/ruby/Makefile.in create mode 100644 rpm-5.4.9/ruby/package-rb.c create mode 100644 rpm-5.4.9/ruby/package-rb.h create mode 100644 rpm-5.4.9/ruby/rpm-rb.c create mode 100644 rpm-5.4.9/ruby/rpm-rb.h create mode 100644 rpm-5.4.9/ruby/rpmds-rb.c create mode 100644 rpm-5.4.9/ruby/rpmds-rb.h create mode 100644 rpm-5.4.9/ruby/rpmexceptions.rb create mode 100644 rpm-5.4.9/ruby/rpmfi-rb.c create mode 100644 rpm-5.4.9/ruby/rpmfi-rb.h create mode 100644 rpm-5.4.9/ruby/rpmhdr-rb.c create mode 100644 rpm-5.4.9/ruby/rpmhdr-rb.h create mode 100644 rpm-5.4.9/ruby/rpmmc-rb.c create mode 100644 rpm-5.4.9/ruby/rpmmc-rb.h create mode 100644 rpm-5.4.9/ruby/rpmmi-rb.c create mode 100644 rpm-5.4.9/ruby/rpmmi-rb.h create mode 100644 rpm-5.4.9/ruby/rpmps-rb.c create mode 100644 rpm-5.4.9/ruby/rpmps-rb.h create mode 100644 rpm-5.4.9/ruby/rpmte-rb.c create mode 100644 rpm-5.4.9/ruby/rpmte-rb.h create mode 100644 rpm-5.4.9/ruby/rpmts-rb.c create mode 100644 rpm-5.4.9/ruby/rpmts-rb.h create mode 100644 rpm-5.4.9/ruby/spec-rb.c create mode 100644 rpm-5.4.9/ruby/spec-rb.h create mode 100644 rpm-5.4.9/ruby/system.h create mode 100644 rpm-5.4.9/ruby/test/Rakefile create mode 100644 rpm-5.4.9/ruby/test/core create mode 100644 rpm-5.4.9/ruby/test/fixtures/Foo-1.0 create mode 100644 rpm-5.4.9/ruby/test/fixtures/barsource1 create mode 100644 rpm-5.4.9/ruby/test/fixtures/foosource1 create mode 100644 rpm-5.4.9/ruby/test/fixtures/foosource1.tar create mode 100644 rpm-5.4.9/ruby/test/fixtures/macros create mode 100644 rpm-5.4.9/ruby/test/fixtures/mock.spec create mode 100644 rpm-5.4.9/ruby/test/unit/test_rpmmc.rb create mode 100644 rpm-5.4.9/ruby/test/unit/test_spec.rb create mode 100644 rpm-5.4.9/ruby/trb.c create mode 100644 rpm-5.4.9/ruby/tscripts/Ds.rb create mode 100644 rpm-5.4.9/ruby/tscripts/Fi.rb create mode 100644 rpm-5.4.9/ruby/tscripts/Hdr.rb create mode 100644 rpm-5.4.9/ruby/tscripts/Mc.rb create mode 100644 rpm-5.4.9/ruby/tscripts/Mi.rb create mode 100644 rpm-5.4.9/ruby/tscripts/Ps.rb create mode 100644 rpm-5.4.9/ruby/tscripts/Te.rb create mode 100644 rpm-5.4.9/ruby/tscripts/Ts.rb create mode 100644 rpm-5.4.9/scripts/Makefile.am create mode 100644 rpm-5.4.9/scripts/Makefile.in create mode 100644 rpm-5.4.9/scripts/Specfile.pm create mode 100644 rpm-5.4.9/scripts/URPM-Makefile.PL.in create mode 100644 rpm-5.4.9/scripts/URPM-Makefile.am create mode 100755 rpm-5.4.9/scripts/api-sanity-autotest.pl create mode 100755 rpm-5.4.9/scripts/api-sanity-checker.pl create mode 100755 rpm-5.4.9/scripts/brp-compress create mode 100755 rpm-5.4.9/scripts/brp-implant-ident-static create mode 100644 rpm-5.4.9/scripts/brp-java-gcjcompile create mode 100755 rpm-5.4.9/scripts/brp-java-repack-jars create mode 100755 rpm-5.4.9/scripts/brp-nobuildrootpath create mode 100644 rpm-5.4.9/scripts/brp-python-bytecompile create mode 100644 rpm-5.4.9/scripts/brp-sparc64-linux create mode 100755 rpm-5.4.9/scripts/brp-strip create mode 100755 rpm-5.4.9/scripts/brp-strip-comment-note create mode 100644 rpm-5.4.9/scripts/brp-strip-shared create mode 100755 rpm-5.4.9/scripts/brp-strip-static-archive create mode 100755 rpm-5.4.9/scripts/check-files create mode 100644 rpm-5.4.9/scripts/check-java-closure.sh create mode 100755 rpm-5.4.9/scripts/check-multiarch-files create mode 100755 rpm-5.4.9/scripts/cpanflute create mode 100755 rpm-5.4.9/scripts/cpanflute2 create mode 100644 rpm-5.4.9/scripts/cross-build create mode 100755 rpm-5.4.9/scripts/dbconvert.sh create mode 100644 rpm-5.4.9/scripts/deb_Packages create mode 100644 rpm-5.4.9/scripts/deb_Sources create mode 100644 rpm-5.4.9/scripts/deb_control create mode 100644 rpm-5.4.9/scripts/deb_md5sums create mode 100644 rpm-5.4.9/scripts/deb_postinst create mode 100644 rpm-5.4.9/scripts/deb_postrm create mode 100644 rpm-5.4.9/scripts/deb_preinst create mode 100644 rpm-5.4.9/scripts/deb_prerm create mode 100644 rpm-5.4.9/scripts/executabledeps.sh create mode 100644 rpm-5.4.9/scripts/find-debuginfo.sh create mode 100755 rpm-5.4.9/scripts/find-lang.sh create mode 100644 rpm-5.4.9/scripts/find-php-provides create mode 100644 rpm-5.4.9/scripts/find-php-requires create mode 100755 rpm-5.4.9/scripts/find-prov.pl create mode 100755 rpm-5.4.9/scripts/find-provides.ksyms create mode 100755 rpm-5.4.9/scripts/find-provides.perl create mode 100755 rpm-5.4.9/scripts/find-provides.php create mode 100755 rpm-5.4.9/scripts/find-req.pl create mode 100755 rpm-5.4.9/scripts/find-requires.ksyms create mode 100755 rpm-5.4.9/scripts/find-requires.perl create mode 100755 rpm-5.4.9/scripts/find-requires.php create mode 100755 rpm-5.4.9/scripts/freshen.sh create mode 100755 rpm-5.4.9/scripts/gem_helper.rb create mode 100644 rpm-5.4.9/scripts/gendiff create mode 100755 rpm-5.4.9/scripts/getpo.sh create mode 100755 rpm-5.4.9/scripts/gstreamer.sh create mode 100755 rpm-5.4.9/scripts/http.req create mode 100644 rpm-5.4.9/scripts/java.prov.sh create mode 100644 rpm-5.4.9/scripts/java.req.sh create mode 100755 rpm-5.4.9/scripts/javadeps.sh create mode 100755 rpm-5.4.9/scripts/kmod-deps.sh create mode 100755 rpm-5.4.9/scripts/kmodtool create mode 100755 rpm-5.4.9/scripts/libtooldeps.sh create mode 100755 rpm-5.4.9/scripts/makeshlibs create mode 100755 rpm-5.4.9/scripts/mgo create mode 100755 rpm-5.4.9/scripts/mkmultiarch create mode 100644 rpm-5.4.9/scripts/mono-find-provides create mode 100644 rpm-5.4.9/scripts/mono-find-requires create mode 100755 rpm-5.4.9/scripts/multiarch-dispatch create mode 100644 rpm-5.4.9/scripts/multiarch-dispatch.h create mode 100755 rpm-5.4.9/scripts/multiarch-platform create mode 100644 rpm-5.4.9/scripts/nix_meta create mode 100644 rpm-5.4.9/scripts/osgideps.pl create mode 100755 rpm-5.4.9/scripts/perl.prov create mode 100755 rpm-5.4.9/scripts/perl.req create mode 100644 rpm-5.4.9/scripts/perldeps.pl create mode 100644 rpm-5.4.9/scripts/php.prov create mode 100644 rpm-5.4.9/scripts/php.req create mode 100755 rpm-5.4.9/scripts/pkgconfigdeps.sh create mode 100644 rpm-5.4.9/scripts/pom2spec create mode 100755 rpm-5.4.9/scripts/pythondeps.sh create mode 100755 rpm-5.4.9/scripts/pythoneggs.py create mode 100755 rpm-5.4.9/scripts/rpm.daily create mode 100644 rpm-5.4.9/scripts/rpm.log create mode 100644 rpm-5.4.9/scripts/rpm.pc.in create mode 100644 rpm-5.4.9/scripts/rpm.xinetd create mode 100755 rpm-5.4.9/scripts/rpm2cpio create mode 100755 rpm-5.4.9/scripts/rpmdb_loadcvt create mode 100644 rpm-5.4.9/scripts/rpmdiff create mode 100644 rpm-5.4.9/scripts/rpmdiff.cgi create mode 100755 rpm-5.4.9/scripts/rpmsort create mode 100644 rpm-5.4.9/scripts/rt-reloc-wrapper.sh create mode 100755 rpm-5.4.9/scripts/ruby-config create mode 100755 rpm-5.4.9/scripts/rubygems.rb create mode 100755 rpm-5.4.9/scripts/sql.prov create mode 100755 rpm-5.4.9/scripts/sql.req create mode 100644 rpm-5.4.9/scripts/symclash.py create mode 100644 rpm-5.4.9/scripts/symclash.sh create mode 100755 rpm-5.4.9/scripts/symset-table create mode 100644 rpm-5.4.9/scripts/tcl.req create mode 100755 rpm-5.4.9/scripts/tgpg create mode 100755 rpm-5.4.9/scripts/trpm create mode 100755 rpm-5.4.9/scripts/u_pkg.sh create mode 100755 rpm-5.4.9/scripts/vcheck create mode 100755 rpm-5.4.9/scripts/vpkg-provides.sh create mode 100755 rpm-5.4.9/scripts/vpkg-provides2.sh create mode 100644 rpm-5.4.9/scripts/wdj_l10n_sqlite create mode 100644 rpm-5.4.9/scripts/wdj_srpm create mode 100644 rpm-5.4.9/scripts/wdj_srpm_mongo create mode 100644 rpm-5.4.9/scripts/wnh_filelists_mongo create mode 100644 rpm-5.4.9/scripts/wnh_filelists_yaml create mode 100644 rpm-5.4.9/scripts/wnh_other_mongo create mode 100644 rpm-5.4.9/scripts/wnh_other_yaml create mode 100644 rpm-5.4.9/scripts/wnh_primary_mongo create mode 100644 rpm-5.4.9/scripts/wnh_primary_yaml create mode 100644 rpm-5.4.9/scripts/xiu_stdenv create mode 100644 rpm-5.4.9/scripts/yum_filelists_sqlite create mode 100644 rpm-5.4.9/scripts/yum_filelists_xml create mode 100644 rpm-5.4.9/scripts/yum_other_sqlite create mode 100644 rpm-5.4.9/scripts/yum_other_xml create mode 100644 rpm-5.4.9/scripts/yum_primary_sqlite create mode 100644 rpm-5.4.9/scripts/yum_primary_xml create mode 100644 rpm-5.4.9/syck/.cvsignore create mode 100644 rpm-5.4.9/syck/CHANGELOG create mode 100644 rpm-5.4.9/syck/COPYING create mode 100644 rpm-5.4.9/syck/Makefile.am create mode 100644 rpm-5.4.9/syck/Makefile.in create mode 100644 rpm-5.4.9/syck/README create mode 100644 rpm-5.4.9/syck/README.BYTECODE create mode 100644 rpm-5.4.9/syck/README.EXT create mode 100644 rpm-5.4.9/syck/RELEASE create mode 100644 rpm-5.4.9/syck/TODO create mode 100644 rpm-5.4.9/syck/aclocal.m4 create mode 100755 rpm-5.4.9/syck/autogen.sh create mode 100644 rpm-5.4.9/syck/autom4te.cache/output.0 create mode 100644 rpm-5.4.9/syck/autom4te.cache/output.1 create mode 100644 rpm-5.4.9/syck/autom4te.cache/requests create mode 100644 rpm-5.4.9/syck/autom4te.cache/traces.0 create mode 100644 rpm-5.4.9/syck/autom4te.cache/traces.1 create mode 100644 rpm-5.4.9/syck/bootstrap create mode 100644 rpm-5.4.9/syck/config.h.in create mode 100644 rpm-5.4.9/syck/config/.cvsignore create mode 100644 rpm-5.4.9/syck/config/README create mode 100755 rpm-5.4.9/syck/config/config.guess create mode 100755 rpm-5.4.9/syck/config/config.sub create mode 100755 rpm-5.4.9/syck/config/depcomp create mode 100755 rpm-5.4.9/syck/config/install-sh create mode 100644 rpm-5.4.9/syck/config/ltmain.sh create mode 100755 rpm-5.4.9/syck/config/missing create mode 100755 rpm-5.4.9/syck/config/ylwrap create mode 100755 rpm-5.4.9/syck/configure create mode 100644 rpm-5.4.9/syck/configure.ac create mode 100644 rpm-5.4.9/syck/debug.h create mode 100644 rpm-5.4.9/syck/ext/cocoa/Info.plist create mode 100644 rpm-5.4.9/syck/ext/cocoa/README create mode 100644 rpm-5.4.9/syck/ext/cocoa/YAML.xcode/project.pbxproj create mode 100644 rpm-5.4.9/syck/ext/cocoa/YAML_Prefix.pch create mode 100644 rpm-5.4.9/syck/ext/cocoa/src/Base64 NSData code/Base64 AltiVec algorithm info.rtf create mode 100644 rpm-5.4.9/syck/ext/cocoa/src/Base64 NSData code/Documentation.html create mode 100644 rpm-5.4.9/syck/ext/cocoa/src/Base64 NSData code/GSNSDataExtensions.h create mode 100644 rpm-5.4.9/syck/ext/cocoa/src/Base64 NSData code/GSNSDataExtensions.m create mode 100644 rpm-5.4.9/syck/ext/cocoa/src/Base64 NSData code/GSNSDataExtensions/CompositePage.html create mode 100644 rpm-5.4.9/syck/ext/cocoa/src/Base64 NSData code/GSNSDataExtensions/GSNSDataExtensions.html create mode 100644 rpm-5.4.9/syck/ext/cocoa/src/Base64 NSData code/GSNSDataExtensions/Methods/Methods.html create mode 100644 rpm-5.4.9/syck/ext/cocoa/src/Base64 NSData code/GSNSDataExtensions/index.html create mode 100644 rpm-5.4.9/syck/ext/cocoa/src/Base64 NSData code/GSNSDataExtensions/toc.html create mode 100644 rpm-5.4.9/syck/ext/cocoa/src/SyckInput.m create mode 100644 rpm-5.4.9/syck/ext/cocoa/src/YAML.h create mode 100644 rpm-5.4.9/syck/ext/cocoa/src/YAMLCategories.h create mode 100644 rpm-5.4.9/syck/ext/cocoa/src/YAMLCategories.m create mode 100644 rpm-5.4.9/syck/ext/cocoa/src/YAMLCocoaCategories.h create mode 100644 rpm-5.4.9/syck/ext/cocoa/src/YAMLCocoaCategories.m create mode 100644 rpm-5.4.9/syck/ext/cocoa/src/YamlController.h create mode 100644 rpm-5.4.9/syck/ext/cocoa/src/main.c create mode 100644 rpm-5.4.9/syck/ext/lua/Makefile create mode 100644 rpm-5.4.9/syck/ext/lua/lsyck.c create mode 100644 rpm-5.4.9/syck/ext/lua/lunit.lua create mode 100644 rpm-5.4.9/syck/ext/lua/test.lua create mode 100644 rpm-5.4.9/syck/ext/lua/yaml.lua create mode 100644 rpm-5.4.9/syck/ext/php/Makefile.in create mode 100644 rpm-5.4.9/syck/ext/php/config.m4 create mode 100755 rpm-5.4.9/syck/ext/php/make_module.sh create mode 100644 rpm-5.4.9/syck/ext/php/php_syck.h create mode 100644 rpm-5.4.9/syck/ext/php/phpext.c create mode 100644 rpm-5.4.9/syck/ext/php/syck.ini create mode 100644 rpm-5.4.9/syck/ext/php/syck.php create mode 100644 rpm-5.4.9/syck/ext/php/tests/001.phpt create mode 100644 rpm-5.4.9/syck/ext/python/XmlYaml/README_yaml2xml create mode 100755 rpm-5.4.9/syck/ext/python/XmlYaml/convertyaml_map.py create mode 100755 rpm-5.4.9/syck/ext/python/XmlYaml/convertyaml_seq.py create mode 100644 rpm-5.4.9/syck/ext/python/XmlYaml/people.xml create mode 100644 rpm-5.4.9/syck/ext/python/pyext.c create mode 100644 rpm-5.4.9/syck/ext/python/setup.py create mode 100644 rpm-5.4.9/syck/ext/python/tests/basic.py create mode 100644 rpm-5.4.9/syck/ext/python/tests/ypath_test.py create mode 100644 rpm-5.4.9/syck/ext/python/tests/ypath_test.yml create mode 100644 rpm-5.4.9/syck/ext/python/yaml2xml.py create mode 100644 rpm-5.4.9/syck/ext/python/ydump.py create mode 100644 rpm-5.4.9/syck/ext/python/ypath.py create mode 100644 rpm-5.4.9/syck/ext/ruby/CHANGELOG create mode 100644 rpm-5.4.9/syck/ext/ruby/README create mode 100644 rpm-5.4.9/syck/ext/ruby/ext/syck/MANIFEST create mode 100644 rpm-5.4.9/syck/ext/ruby/ext/syck/extconf.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/ext/syck/rubyext.c create mode 100644 rpm-5.4.9/syck/ext/ruby/install.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/okay.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/okay/news.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/okay/rpc.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/yaml.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/yaml/baseemitter.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/yaml/basenode.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/yaml/compat.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/yaml/constants.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/yaml/dbm.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/yaml/emitter.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/yaml/encoding.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/yaml/error.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/yaml/rubytypes.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/yaml/store.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/yaml/stream.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/yaml/stringio.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/yaml/syck.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/yaml/tag.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/yaml/types.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/yaml/yamlnode.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/lib/yaml/ypath.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/samples/okayNews-modules.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/samples/okayNews-sample.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/samples/okayNews-validate.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/samples/okayRpc-client.rb create mode 100755 rpm-5.4.9/syck/ext/ruby/samples/okayRpc-server.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/samples/yaml-sortHashKeys.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/tests/basic.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/yts/YtsAnchorAlias.yml create mode 100644 rpm-5.4.9/syck/ext/ruby/yts/YtsBasicTests.yml create mode 100644 rpm-5.4.9/syck/ext/ruby/yts/YtsBlockMapping.yml create mode 100644 rpm-5.4.9/syck/ext/ruby/yts/YtsBlockSequence.yml create mode 100644 rpm-5.4.9/syck/ext/ruby/yts/YtsDocumentSeparator.yml create mode 100644 rpm-5.4.9/syck/ext/ruby/yts/YtsErrorTests.yml create mode 100644 rpm-5.4.9/syck/ext/ruby/yts/YtsFlowCollections.yml create mode 100644 rpm-5.4.9/syck/ext/ruby/yts/YtsFoldedScalars.yml create mode 100644 rpm-5.4.9/syck/ext/ruby/yts/YtsMapInSeq.yml create mode 100644 rpm-5.4.9/syck/ext/ruby/yts/YtsNullsAndEmpties.yml create mode 100644 rpm-5.4.9/syck/ext/ruby/yts/YtsRubyTests.yml create mode 100644 rpm-5.4.9/syck/ext/ruby/yts/YtsSpecificationExamples.yml create mode 100644 rpm-5.4.9/syck/ext/ruby/yts/YtsTypeTransfers.yml create mode 100644 rpm-5.4.9/syck/ext/ruby/yts/YtsYpath.yml create mode 100644 rpm-5.4.9/syck/ext/ruby/yts/cookbook.rb create mode 100644 rpm-5.4.9/syck/ext/ruby/yts/index.yml create mode 100644 rpm-5.4.9/syck/ext/ruby/yts/yts.rb create mode 100644 rpm-5.4.9/syck/ext/yamlbyte/Makefile create mode 100644 rpm-5.4.9/syck/ext/yamlbyte/yamlbyte.h create mode 100644 rpm-5.4.9/syck/ext/yamlbyte/ybext.c create mode 100644 rpm-5.4.9/syck/lib/.cvsignore create mode 100644 rpm-5.4.9/syck/lib/.splintrc create mode 100644 rpm-5.4.9/syck/lib/Makefile.am create mode 100644 rpm-5.4.9/syck/lib/Makefile.in create mode 100644 rpm-5.4.9/syck/lib/bytecode.c create mode 100644 rpm-5.4.9/syck/lib/bytecode.re create mode 100644 rpm-5.4.9/syck/lib/emitter.c create mode 100644 rpm-5.4.9/syck/lib/gram.y create mode 100644 rpm-5.4.9/syck/lib/handler.c create mode 100644 rpm-5.4.9/syck/lib/implicit.c create mode 100644 rpm-5.4.9/syck/lib/implicit.re create mode 100644 rpm-5.4.9/syck/lib/node.c create mode 100644 rpm-5.4.9/syck/lib/syck.c create mode 100644 rpm-5.4.9/syck/lib/syck.h create mode 100644 rpm-5.4.9/syck/lib/syck_st.c create mode 100644 rpm-5.4.9/syck/lib/syck_st.h create mode 100644 rpm-5.4.9/syck/lib/token.c create mode 100644 rpm-5.4.9/syck/lib/token.re create mode 100644 rpm-5.4.9/syck/lib/yaml2byte.c create mode 100644 rpm-5.4.9/syck/lib/yamlbyte.h create mode 100644 rpm-5.4.9/syck/system.h create mode 100644 rpm-5.4.9/syck/tests/.cvsignore create mode 100644 rpm-5.4.9/syck/tests/Basic.c create mode 100644 rpm-5.4.9/syck/tests/CuTest.c create mode 100644 rpm-5.4.9/syck/tests/CuTest.h create mode 100644 rpm-5.4.9/syck/tests/Emit.c create mode 100644 rpm-5.4.9/syck/tests/Makefile.am create mode 100644 rpm-5.4.9/syck/tests/Makefile.in create mode 100644 rpm-5.4.9/syck/tests/Parse.c create mode 100644 rpm-5.4.9/syck/tests/YTS.c create mode 100644 rpm-5.4.9/syck/tests/YTS.c.erb create mode 100644 rpm-5.4.9/syck/tests/YTS.c.rb create mode 100644 rpm-5.4.9/system.h create mode 100644 rpm-5.4.9/tests/Makefile.am create mode 100644 rpm-5.4.9/tests/Makefile.in create mode 100644 rpm-5.4.9/tests/arbitrarytag-1.0-1.src.rpm create mode 100644 rpm-5.4.9/tests/cudf-test-1-0.src.rpm create mode 100644 rpm-5.4.9/tests/devtool-sanity-1.0-1.src.rpm create mode 100644 rpm-5.4.9/tests/dir2symlink-1-1.src.rpm create mode 100644 rpm-5.4.9/tests/edos-test-1-0.src.rpm create mode 100644 rpm-5.4.9/tests/genpgp.sh create mode 100644 rpm-5.4.9/tests/genssl.h create mode 100644 rpm-5.4.9/tests/genssl.sh create mode 100644 rpm-5.4.9/tests/gpsee/gffi.js create mode 100644 rpm-5.4.9/tests/macros.in create mode 100644 rpm-5.4.9/tests/mongo/Makefile.am create mode 100644 rpm-5.4.9/tests/mongo/Makefile.in create mode 100644 rpm-5.4.9/tests/mongo/all_types.c create mode 100644 rpm-5.4.9/tests/mongo/auth.c create mode 100644 rpm-5.4.9/tests/mongo/benchmark.c create mode 100644 rpm-5.4.9/tests/mongo/bson.c create mode 100644 rpm-5.4.9/tests/mongo/bson_subobject.c create mode 100644 rpm-5.4.9/tests/mongo/count_delete.c create mode 100644 rpm-5.4.9/tests/mongo/cursors.c create mode 100644 rpm-5.4.9/tests/mongo/endian_swap.c create mode 100644 rpm-5.4.9/tests/mongo/errors.c create mode 100644 rpm-5.4.9/tests/mongo/examples.c create mode 100644 rpm-5.4.9/tests/mongo/functions.c create mode 100644 rpm-5.4.9/tests/mongo/helpers.c create mode 100644 rpm-5.4.9/tests/mongo/json.c create mode 100644 rpm-5.4.9/tests/mongo/oid.c create mode 100644 rpm-5.4.9/tests/mongo/pair.c create mode 100644 rpm-5.4.9/tests/mongo/resize.c create mode 100644 rpm-5.4.9/tests/mongo/simple.c create mode 100644 rpm-5.4.9/tests/mongo/sizes.c create mode 100644 rpm-5.4.9/tests/mongo/test.h create mode 100644 rpm-5.4.9/tests/mongo/tutorial.js create mode 100644 rpm-5.4.9/tests/mongo/update.c create mode 100644 rpm-5.4.9/tests/mongo/validate.c create mode 100644 rpm-5.4.9/tests/probes-test-1-0.src.rpm create mode 100644 rpm-5.4.9/tests/ref/.alldigests create mode 100644 rpm-5.4.9/tests/ref/DB_CONFIG create mode 100644 rpm-5.4.9/tests/ref/edos.manifest create mode 100644 rpm-5.4.9/tests/ref/edos.qa.1 create mode 100644 rpm-5.4.9/tests/ref/edos.qa.2 create mode 100644 rpm-5.4.9/tests/ref/filelists.xml create mode 100644 rpm-5.4.9/tests/ref/hkp create mode 100644 rpm-5.4.9/tests/ref/manifest create mode 100644 rpm-5.4.9/tests/ref/other.xml create mode 100644 rpm-5.4.9/tests/ref/popt.Kv create mode 100644 rpm-5.4.9/tests/ref/popt.Kv-beecrypt create mode 100644 rpm-5.4.9/tests/ref/popt.Kv-nss create mode 100644 rpm-5.4.9/tests/ref/popt.Kv-ssl create mode 100644 rpm-5.4.9/tests/ref/popt.xml create mode 100644 rpm-5.4.9/tests/ref/popt.yaml create mode 100644 rpm-5.4.9/tests/ref/primary.xml create mode 100644 rpm-5.4.9/tests/ref/querytags create mode 100644 rpm-5.4.9/tests/ref/repomd.xml create mode 100644 rpm-5.4.9/tests/ref/rpmdb.sql create mode 100644 rpm-5.4.9/tests/ref/showrc create mode 100644 rpm-5.4.9/tests/ref/sqldb-basic.out create mode 100644 rpm-5.4.9/tests/ref/sqldb-basic.sql create mode 100644 rpm-5.4.9/tests/ref/version create mode 100644 rpm-5.4.9/tests/simplestRPMv3-1.0-2.aix5.3.noarch.rpm create mode 100755 rpm-5.4.9/tests/spew create mode 100644 rpm-5.4.9/tests/spew.conf create mode 100644 rpm-5.4.9/tests/tecdsa.c create mode 100644 rpm-5.4.9/tests/thkp.c create mode 100644 rpm-5.4.9/tests/tkey.c create mode 100644 rpm-5.4.9/tests/tpgp.c create mode 100644 rpm-5.4.9/tests/triggers-D-1.0-1.src.rpm create mode 100644 rpm-5.4.9/tests/triggers-DP-1.0-1.src.rpm create mode 100644 rpm-5.4.9/tests/triggers-F-1.0-1.src.rpm create mode 100644 rpm-5.4.9/tests/triggers-FP-1.0-1.src.rpm create mode 100644 rpm-5.4.9/tests/triggers-N-1.0-1.src.rpm create mode 100644 rpm-5.4.9/tests/triggers-NA-1.0-1.src.rpm create mode 100644 rpm-5.4.9/tests/triggers-P-1.0-1.src.rpm create mode 100644 rpm-5.4.9/tests/trsa.c create mode 100644 rpm-5.4.9/tests/tssl.c create mode 100644 rpm-5.4.9/tools/Makefile.am create mode 100644 rpm-5.4.9/tools/Makefile.in create mode 100644 rpm-5.4.9/tools/augtool.c create mode 100644 rpm-5.4.9/tools/bsdiff.1 create mode 100644 rpm-5.4.9/tools/bspatch.1 create mode 100644 rpm-5.4.9/tools/chroot.c create mode 100644 rpm-5.4.9/tools/cp.c create mode 100644 rpm-5.4.9/tools/cudftool.c create mode 100644 rpm-5.4.9/tools/dbconvert.c create mode 100644 rpm-5.4.9/tools/dbsql.c create mode 100644 rpm-5.4.9/tools/debugedit.c create mode 100644 rpm-5.4.9/tools/dotgraph.cc create mode 100644 rpm-5.4.9/tools/dotgraph.hh create mode 100644 rpm-5.4.9/tools/hashtab.c create mode 100644 rpm-5.4.9/tools/hashtab.h create mode 100644 rpm-5.4.9/tools/log2xml.cc create mode 100644 rpm-5.4.9/tools/nix-build.c create mode 100644 rpm-5.4.9/tools/nix-channel.c create mode 100644 rpm-5.4.9/tools/nix-collect-garbage.c create mode 100644 rpm-5.4.9/tools/nix-copy-closure.c create mode 100644 rpm-5.4.9/tools/nix-env.cc create mode 100644 rpm-5.4.9/tools/nix-hash.cc create mode 100644 rpm-5.4.9/tools/nix-install-package.c create mode 100644 rpm-5.4.9/tools/nix-instantiate.cc create mode 100644 rpm-5.4.9/tools/nix-prefetch-url.c create mode 100644 rpm-5.4.9/tools/nix-pull.c create mode 100644 rpm-5.4.9/tools/nix-push.c create mode 100644 rpm-5.4.9/tools/nix-store.cc create mode 100644 rpm-5.4.9/tools/nix-worker.cc create mode 100644 rpm-5.4.9/tools/profiles.cc create mode 100644 rpm-5.4.9/tools/roto.c create mode 100644 rpm-5.4.9/tools/rpm2cpio.c create mode 100644 rpm-5.4.9/tools/rpmcache.c create mode 100644 rpm-5.4.9/tools/rpmcmp.c create mode 100644 rpm-5.4.9/tools/rpmdeps.c create mode 100644 rpm-5.4.9/tools/rpmdigest.c create mode 100644 rpm-5.4.9/tools/rpmfind.c create mode 100644 rpm-5.4.9/tools/rpmgrep.1 create mode 100644 rpm-5.4.9/tools/rpmgrep.c create mode 100644 rpm-5.4.9/tools/rpmkey.c create mode 100644 rpm-5.4.9/tools/rpmmtree.c create mode 100644 rpm-5.4.9/tools/rpmrepo.c create mode 100644 rpm-5.4.9/tools/rpmspecdump.c create mode 100644 rpm-5.4.9/tools/rpmwget.c create mode 100644 rpm-5.4.9/tools/sandbox.c create mode 100644 rpm-5.4.9/tools/semodule.c create mode 100644 rpm-5.4.9/tools/spooktool.c create mode 100644 rpm-5.4.9/tools/sqlite3.c create mode 100644 rpm-5.4.9/tools/txar.c create mode 100644 rpm-5.4.9/tools/xiu-echo.c create mode 100644 rpm-5.4.9/tools/xiu-hash.c create mode 100644 rpm-5.4.9/tools/xiu-instantiate.c create mode 100644 rpm-5.4.9/tools/xiu-store.c diff --git a/rpm-5.4.9/ABOUT-NLS b/rpm-5.4.9/ABOUT-NLS new file mode 100644 index 0000000..b1de1b6 --- /dev/null +++ b/rpm-5.4.9/ABOUT-NLS @@ -0,0 +1,1282 @@ +1 Notes on the Free Translation Project +*************************************** + +Free software is going international! The Free Translation Project is +a way to get maintainers of free software, translators, and users all +together, so that free software will gradually become able to speak many +languages. A few packages already provide translations for their +messages. + + If you found this `ABOUT-NLS' file inside a distribution, you may +assume that the distributed package does use GNU `gettext' internally, +itself available at your nearest GNU archive site. But you do _not_ +need to install GNU `gettext' prior to configuring, installing or using +this package with messages translated. + + Installers will find here some useful hints. These notes also +explain how users should proceed for getting the programs to use the +available translations. They tell how people wanting to contribute and +work on translations can contact the appropriate team. + +1.1 INSTALL Matters +=================== + +Some packages are "localizable" when properly installed; the programs +they contain can be made to speak your own native language. Most such +packages use GNU `gettext'. Other packages have their own ways to +internationalization, predating GNU `gettext'. + + By default, this package will be installed to allow translation of +messages. It will automatically detect whether the system already +provides the GNU `gettext' functions. Installers may use special +options at configuration time for changing the default behaviour. The +command: + + ./configure --disable-nls + +will _totally_ disable translation of messages. + + When you already have GNU `gettext' installed on your system and run +configure without an option for your new package, `configure' will +probably detect the previously built and installed `libintl' library +and will decide to use it. If not, you may have to to use the +`--with-libintl-prefix' option to tell `configure' where to look for it. + + Internationalized packages usually have many `po/LL.po' files, where +LL gives an ISO 639 two-letter code identifying the language. Unless +translations have been forbidden at `configure' time by using the +`--disable-nls' switch, all available translations are installed +together with the package. However, the environment variable `LINGUAS' +may be set, prior to configuration, to limit the installed set. +`LINGUAS' should then contain a space separated list of two-letter +codes, stating which languages are allowed. + +1.2 Using This Package +====================== + +As a user, if your language has been installed for this package, you +only have to set the `LANG' environment variable to the appropriate +`LL_CC' combination. If you happen to have the `LC_ALL' or some other +`LC_xxx' environment variables set, you should unset them before +setting `LANG', otherwise the setting of `LANG' will not have the +desired effect. Here `LL' is an ISO 639 two-letter language code, and +`CC' is an ISO 3166 two-letter country code. For example, let's +suppose that you speak German and live in Germany. At the shell +prompt, merely execute `setenv LANG de_DE' (in `csh'), +`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). +This can be done from your `.login' or `.profile' file, once and for +all. + + You might think that the country code specification is redundant. +But in fact, some languages have dialects in different countries. For +example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The +country code serves to distinguish the dialects. + + The locale naming convention of `LL_CC', with `LL' denoting the +language and `CC' denoting the country, is the one use on systems based +on GNU libc. On other systems, some variations of this scheme are +used, such as `LL' or `LL_CC.ENCODING'. You can get the list of +locales supported by your system for your language by running the +command `locale -a | grep '^LL''. + + Not all programs have translations for all languages. By default, an +English message is shown in place of a nonexistent translation. If you +understand other languages, you can set up a priority list of languages. +This is done through a different environment variable, called +`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' +for the purpose of message handling, but you still need to have `LANG' +set to the primary language; this is required by other parts of the +system libraries. For example, some Swedish users who would rather +read translations in German than English for when Swedish is not +available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. + + Special advice for Norwegian users: The language code for Norwegian +bokma*l changed from `no' to `nb' recently (in 2003). During the +transition period, while some message catalogs for this language are +installed under `nb' and some older ones under `no', it's recommended +for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and +older translations are used. + + In the `LANGUAGE' environment variable, but not in the `LANG' +environment variable, `LL_CC' combinations can be abbreviated as `LL' +to denote the language's main dialect. For example, `de' is equivalent +to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' +(Portuguese as spoken in Portugal) in this context. + +1.3 Translating Teams +===================== + +For the Free Translation Project to be a success, we need interested +people who like their own language and write it well, and who are also +able to synergize with other translators speaking the same language. +Each translation team has its own mailing list. The up-to-date list of +teams can be found at the Free Translation Project's homepage, +`http://translationproject.org/', in the "Teams" area. + + If you'd like to volunteer to _work_ at translating messages, you +should become a member of the translating team for your own language. +The subscribing address is _not_ the same as the list itself, it has +`-request' appended. For example, speakers of Swedish can send a +message to `sv-request@li.org', having this message body: + + subscribe + + Keep in mind that team members are expected to participate +_actively_ in translations, or at solving translational difficulties, +rather than merely lurking around. If your team does not exist yet and +you want to start one, or if you are unsure about what to do or how to +get started, please write to `coordinator@translationproject.org' to +reach the coordinator for all translator teams. + + The English team is special. It works at improving and uniformizing +the terminology in use. Proven linguistic skills are praised more than +programming skills, here. + +1.4 Available Packages +====================== + +Languages are not equally supported in all packages. The following +matrix shows the current state of internationalization, as of June +2010. The matrix shows, in regard of each package, for which languages +PO files have been submitted to translation coordination, with a +translation percentage of at least 50%. + + Ready PO files af am an ar as ast az be be@latin bg bn_IN bs ca + +--------------------------------------------------+ + a2ps | [] [] | + aegis | | + ant-phone | | + anubis | | + aspell | [] [] | + bash | | + bfd | | + bibshelf | [] | + binutils | | + bison | | + bison-runtime | [] | + bluez-pin | [] [] | + bombono-dvd | | + buzztard | | + cflow | | + clisp | | + coreutils | [] [] | + cpio | | + cppi | | + cpplib | [] | + cryptsetup | | + dfarc | | + dialog | [] [] | + dico | | + diffutils | [] | + dink | | + doodle | | + e2fsprogs | [] | + enscript | [] | + exif | | + fetchmail | [] | + findutils | [] | + flex | [] | + freedink | | + gas | | + gawk | [] [] | + gcal | [] | + gcc | | + gettext-examples | [] [] [] [] | + gettext-runtime | [] [] | + gettext-tools | [] [] | + gip | [] | + gjay | | + gliv | [] | + glunarclock | [] [] | + gnubiff | | + gnucash | [] | + gnuedu | | + gnulib | | + gnunet | | + gnunet-gtk | | + gnutls | | + gold | | + gpe-aerial | | + gpe-beam | | + gpe-bluetooth | | + gpe-calendar | | + gpe-clock | [] | + gpe-conf | | + gpe-contacts | | + gpe-edit | | + gpe-filemanager | | + gpe-go | | + gpe-login | | + gpe-ownerinfo | [] | + gpe-package | | + gpe-sketchbook | | + gpe-su | [] | + gpe-taskmanager | [] | + gpe-timesheet | [] | + gpe-today | [] | + gpe-todo | | + gphoto2 | | + gprof | [] | + gpsdrive | | + gramadoir | | + grep | | + grub | [] [] | + gsasl | | + gss | | + gst-plugins-bad | [] | + gst-plugins-base | [] | + gst-plugins-good | [] | + gst-plugins-ugly | [] | + gstreamer | [] [] [] | + gtick | | + gtkam | [] | + gtkorphan | [] | + gtkspell | [] [] [] | + gutenprint | | + hello | [] | + help2man | | + hylafax | | + idutils | | + indent | [] [] | + iso_15924 | | + iso_3166 | [] [] [] [] [] [] [] | + iso_3166_2 | | + iso_4217 | | + iso_639 | [] [] [] [] | + iso_639_3 | | + jwhois | | + kbd | | + keytouch | [] | + keytouch-editor | | + keytouch-keyboa... | [] | + klavaro | [] | + latrine | | + ld | [] | + leafpad | [] [] | + libc | [] [] | + libexif | () | + libextractor | | + libgnutls | | + libgpewidget | | + libgpg-error | | + libgphoto2 | | + libgphoto2_port | | + libgsasl | | + libiconv | [] | + libidn | | + lifelines | | + liferea | [] [] | + lilypond | | + linkdr | [] | + lordsawar | | + lprng | | + lynx | [] | + m4 | | + mailfromd | | + mailutils | | + make | | + man-db | | + man-db-manpages | | + minicom | | + mkisofs | | + myserver | | + nano | [] [] | + opcodes | | + parted | | + pies | | + popt | | + psmisc | | + pspp | [] | + pwdutils | | + radius | [] | + recode | [] [] | + rosegarden | | + rpm | | + rush | | + sarg | | + screem | | + scrollkeeper | [] [] [] | + sed | [] [] | + sharutils | [] [] | + shishi | | + skencil | | + solfege | | + solfege-manual | | + soundtracker | | + sp | | + sysstat | | + tar | [] | + texinfo | | + tin | | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | [] | + vice | | + vmm | | + vorbis-tools | | + wastesedge | | + wdiff | | + wget | [] [] | + wyslij-po | | + xchat | [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] | + +--------------------------------------------------+ + af am an ar as ast az be be@latin bg bn_IN bs ca + 6 0 1 2 3 19 1 10 3 28 3 1 38 + + crh cs da de el en en_GB en_ZA eo es et eu fa + +-------------------------------------------------+ + a2ps | [] [] [] [] [] [] [] | + aegis | [] [] [] | + ant-phone | [] () | + anubis | [] [] | + aspell | [] [] [] [] [] | + bash | [] [] [] | + bfd | [] | + bibshelf | [] [] [] | + binutils | [] | + bison | [] [] | + bison-runtime | [] [] [] [] | + bluez-pin | [] [] [] [] [] [] | + bombono-dvd | [] | + buzztard | [] [] [] | + cflow | [] [] | + clisp | [] [] [] [] | + coreutils | [] [] [] [] | + cpio | | + cppi | | + cpplib | [] [] [] | + cryptsetup | [] | + dfarc | [] [] [] | + dialog | [] [] [] [] [] | + dico | | + diffutils | [] [] [] [] [] [] | + dink | [] [] [] | + doodle | [] | + e2fsprogs | [] [] [] | + enscript | [] [] [] | + exif | () [] [] | + fetchmail | [] [] () [] [] [] | + findutils | [] [] [] | + flex | [] [] | + freedink | [] [] [] | + gas | [] | + gawk | [] [] [] | + gcal | [] | + gcc | [] [] | + gettext-examples | [] [] [] [] | + gettext-runtime | [] [] [] [] | + gettext-tools | [] [] [] | + gip | [] [] [] [] | + gjay | [] | + gliv | [] [] [] | + glunarclock | [] [] | + gnubiff | () | + gnucash | [] () () () () | + gnuedu | [] [] | + gnulib | [] [] | + gnunet | | + gnunet-gtk | [] | + gnutls | [] [] | + gold | [] | + gpe-aerial | [] [] [] [] | + gpe-beam | [] [] [] [] | + gpe-bluetooth | [] [] | + gpe-calendar | [] | + gpe-clock | [] [] [] [] | + gpe-conf | [] [] [] | + gpe-contacts | [] [] [] | + gpe-edit | [] [] | + gpe-filemanager | [] [] [] | + gpe-go | [] [] [] [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] [] [] | + gpe-package | [] [] [] | + gpe-sketchbook | [] [] [] [] | + gpe-su | [] [] [] [] | + gpe-taskmanager | [] [] [] [] | + gpe-timesheet | [] [] [] [] | + gpe-today | [] [] [] [] | + gpe-todo | [] [] [] | + gphoto2 | [] [] () [] [] [] | + gprof | [] [] [] | + gpsdrive | [] [] [] | + gramadoir | [] [] [] | + grep | [] | + grub | [] [] | + gsasl | [] | + gss | | + gst-plugins-bad | [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] | + gtick | [] () [] | + gtkam | [] [] () [] [] | + gtkorphan | [] [] [] [] | + gtkspell | [] [] [] [] [] [] [] | + gutenprint | [] [] [] | + hello | [] [] [] [] | + help2man | [] | + hylafax | [] [] | + idutils | [] [] | + indent | [] [] [] [] [] [] [] | + iso_15924 | [] () [] [] | + iso_3166 | [] [] [] [] () [] [] [] () | + iso_3166_2 | () | + iso_4217 | [] [] [] () [] [] | + iso_639 | [] [] [] [] () [] [] | + iso_639_3 | [] | + jwhois | [] | + kbd | [] [] [] [] [] | + keytouch | [] [] | + keytouch-editor | [] [] | + keytouch-keyboa... | [] | + klavaro | [] [] [] [] | + latrine | [] () | + ld | [] [] | + leafpad | [] [] [] [] [] [] | + libc | [] [] [] [] | + libexif | [] [] () | + libextractor | | + libgnutls | [] | + libgpewidget | [] [] | + libgpg-error | [] [] | + libgphoto2 | [] () | + libgphoto2_port | [] () [] | + libgsasl | | + libiconv | [] [] [] [] [] | + libidn | [] [] [] | + lifelines | [] () | + liferea | [] [] [] [] [] | + lilypond | [] [] [] | + linkdr | [] [] [] | + lordsawar | [] | + lprng | | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailfromd | | + mailutils | [] | + make | [] [] [] | + man-db | | + man-db-manpages | | + minicom | [] [] [] [] | + mkisofs | | + myserver | | + nano | [] [] [] | + opcodes | [] [] | + parted | [] [] | + pies | | + popt | [] [] [] [] [] | + psmisc | [] [] [] | + pspp | [] | + pwdutils | [] | + radius | [] | + recode | [] [] [] [] [] [] | + rosegarden | () () () | + rpm | [] [] [] | + rush | | + sarg | | + screem | | + scrollkeeper | [] [] [] [] [] | + sed | [] [] [] [] [] [] | + sharutils | [] [] [] [] | + shishi | | + skencil | [] () [] | + solfege | [] [] [] | + solfege-manual | [] [] | + soundtracker | [] [] [] | + sp | [] | + sysstat | [] [] [] | + tar | [] [] [] [] | + texinfo | [] [] [] | + tin | [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | [] [] [] [] | + vice | () () | + vmm | [] | + vorbis-tools | [] [] | + wastesedge | [] | + wdiff | [] [] | + wget | [] [] [] | + wyslij-po | | + xchat | [] [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] [] [] | + +-------------------------------------------------+ + crh cs da de el en en_GB en_ZA eo es et eu fa + 5 64 105 117 18 1 8 0 28 89 18 19 0 + + fi fr ga gl gu he hi hr hu hy id is it ja ka kn + +----------------------------------------------------+ + a2ps | [] [] [] [] | + aegis | [] [] | + ant-phone | [] [] | + anubis | [] [] [] [] | + aspell | [] [] [] [] | + bash | [] [] [] [] | + bfd | [] [] [] | + bibshelf | [] [] [] [] [] | + binutils | [] [] [] | + bison | [] [] [] [] | + bison-runtime | [] [] [] [] [] [] | + bluez-pin | [] [] [] [] [] [] [] [] | + bombono-dvd | [] | + buzztard | [] | + cflow | [] [] [] | + clisp | [] | + coreutils | [] [] [] [] [] | + cpio | [] [] [] [] | + cppi | [] [] | + cpplib | [] [] [] | + cryptsetup | [] [] [] | + dfarc | [] [] [] | + dialog | [] [] [] [] [] [] [] | + dico | | + diffutils | [] [] [] [] [] [] [] [] [] | + dink | [] | + doodle | [] [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] | + exif | [] [] [] [] [] [] | + fetchmail | [] [] [] [] | + findutils | [] [] [] [] [] [] | + flex | [] [] [] | + freedink | [] [] [] | + gas | [] [] | + gawk | [] [] [] [] () [] | + gcal | [] | + gcc | [] | + gettext-examples | [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] | + gettext-tools | [] [] [] [] | + gip | [] [] [] [] [] [] | + gjay | [] | + gliv | [] () | + glunarclock | [] [] [] [] | + gnubiff | () [] () | + gnucash | () () () () () [] | + gnuedu | [] [] | + gnulib | [] [] [] [] [] [] | + gnunet | | + gnunet-gtk | [] | + gnutls | [] [] | + gold | [] [] | + gpe-aerial | [] [] [] | + gpe-beam | [] [] [] [] | + gpe-bluetooth | [] [] [] [] | + gpe-calendar | [] [] | + gpe-clock | [] [] [] [] [] | + gpe-conf | [] [] [] [] | + gpe-contacts | [] [] [] [] | + gpe-edit | [] [] [] | + gpe-filemanager | [] [] [] [] | + gpe-go | [] [] [] [] [] | + gpe-login | [] [] [] | + gpe-ownerinfo | [] [] [] [] [] | + gpe-package | [] [] [] | + gpe-sketchbook | [] [] [] [] | + gpe-su | [] [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] | + gpe-timesheet | [] [] [] [] [] | + gpe-today | [] [] [] [] [] [] [] | + gpe-todo | [] [] [] | + gphoto2 | [] [] [] [] [] [] | + gprof | [] [] [] [] | + gpsdrive | [] [] [] | + gramadoir | [] [] [] | + grep | [] [] | + grub | [] [] [] [] | + gsasl | [] [] [] [] [] | + gss | [] [] [] [] [] | + gst-plugins-bad | [] [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] | + gtick | [] [] [] [] [] | + gtkam | [] [] [] [] [] | + gtkorphan | [] [] [] | + gtkspell | [] [] [] [] [] [] [] [] [] | + gutenprint | [] [] [] [] | + hello | [] [] [] | + help2man | [] [] | + hylafax | [] | + idutils | [] [] [] [] [] [] | + indent | [] [] [] [] [] [] [] [] | + iso_15924 | [] () [] [] | + iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] | + iso_3166_2 | () [] [] [] | + iso_4217 | [] () [] [] [] [] | + iso_639 | [] () [] [] [] [] [] [] [] | + iso_639_3 | () [] [] | + jwhois | [] [] [] [] [] | + kbd | [] [] | + keytouch | [] [] [] [] [] [] | + keytouch-editor | [] [] [] [] [] | + keytouch-keyboa... | [] [] [] [] [] | + klavaro | [] [] | + latrine | [] [] [] | + ld | [] [] [] [] | + leafpad | [] [] [] [] [] [] [] () | + libc | [] [] [] [] [] | + libexif | [] | + libextractor | | + libgnutls | [] [] | + libgpewidget | [] [] [] [] | + libgpg-error | [] [] | + libgphoto2 | [] [] [] | + libgphoto2_port | [] [] [] | + libgsasl | [] [] [] [] [] | + libiconv | [] [] [] [] [] [] | + libidn | [] [] [] [] | + lifelines | () | + liferea | [] [] [] [] | + lilypond | [] [] | + linkdr | [] [] [] [] [] | + lordsawar | | + lprng | [] | + lynx | [] [] [] [] [] | + m4 | [] [] [] [] [] [] | + mailfromd | | + mailutils | [] [] | + make | [] [] [] [] [] [] [] [] [] | + man-db | [] [] | + man-db-manpages | [] | + minicom | [] [] [] [] [] | + mkisofs | [] [] [] [] | + myserver | | + nano | [] [] [] [] [] [] | + opcodes | [] [] [] [] | + parted | [] [] [] [] | + pies | | + popt | [] [] [] [] [] [] [] [] [] | + psmisc | [] [] [] | + pspp | | + pwdutils | [] [] | + radius | [] [] | + recode | [] [] [] [] [] [] [] [] | + rosegarden | () () () () () | + rpm | [] [] | + rush | | + sarg | [] | + screem | [] [] | + scrollkeeper | [] [] [] [] | + sed | [] [] [] [] [] [] [] [] | + sharutils | [] [] [] [] [] [] [] | + shishi | [] | + skencil | [] | + solfege | [] [] [] [] | + solfege-manual | [] [] | + soundtracker | [] [] | + sp | [] () | + sysstat | [] [] [] [] [] | + tar | [] [] [] [] [] [] [] | + texinfo | [] [] [] [] | + tin | [] | + unicode-han-tra... | | + unicode-transla... | [] [] | + util-linux-ng | [] [] [] [] [] [] | + vice | () () () | + vmm | [] | + vorbis-tools | [] | + wastesedge | () () | + wdiff | [] | + wget | [] [] [] [] [] [] [] [] | + wyslij-po | [] [] [] | + xchat | [] [] [] [] [] [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] [] | + +----------------------------------------------------+ + fi fr ga gl gu he hi hr hu hy id is it ja ka kn + 105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4 + + ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne + +-----------------------------------------------+ + a2ps | [] | + aegis | | + ant-phone | | + anubis | [] [] | + aspell | [] | + bash | | + bfd | | + bibshelf | [] [] | + binutils | | + bison | [] | + bison-runtime | [] [] [] [] [] | + bluez-pin | [] [] [] [] [] | + bombono-dvd | | + buzztard | | + cflow | | + clisp | | + coreutils | [] | + cpio | | + cppi | | + cpplib | | + cryptsetup | | + dfarc | [] | + dialog | [] [] [] [] [] | + dico | | + diffutils | [] [] | + dink | | + doodle | | + e2fsprogs | | + enscript | | + exif | [] | + fetchmail | | + findutils | | + flex | | + freedink | [] | + gas | | + gawk | | + gcal | | + gcc | | + gettext-examples | [] [] [] [] | + gettext-runtime | [] | + gettext-tools | [] | + gip | [] [] | + gjay | | + gliv | | + glunarclock | [] | + gnubiff | | + gnucash | () () () () | + gnuedu | | + gnulib | | + gnunet | | + gnunet-gtk | | + gnutls | [] | + gold | | + gpe-aerial | [] | + gpe-beam | [] | + gpe-bluetooth | [] [] | + gpe-calendar | [] | + gpe-clock | [] [] [] [] [] | + gpe-conf | [] [] | + gpe-contacts | [] [] | + gpe-edit | [] | + gpe-filemanager | [] [] | + gpe-go | [] [] [] | + gpe-login | [] | + gpe-ownerinfo | [] [] | + gpe-package | [] [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] [] | + gpe-timesheet | [] [] | + gpe-today | [] [] [] [] | + gpe-todo | [] [] | + gphoto2 | | + gprof | [] | + gpsdrive | | + gramadoir | | + grep | | + grub | | + gsasl | | + gss | | + gst-plugins-bad | [] [] [] [] | + gst-plugins-base | [] [] | + gst-plugins-good | [] [] | + gst-plugins-ugly | [] [] [] [] [] | + gstreamer | | + gtick | | + gtkam | [] | + gtkorphan | [] [] | + gtkspell | [] [] [] [] [] [] [] | + gutenprint | | + hello | [] [] [] | + help2man | | + hylafax | | + idutils | | + indent | | + iso_15924 | [] [] | + iso_3166 | [] [] () [] [] [] [] [] | + iso_3166_2 | | + iso_4217 | [] [] | + iso_639 | [] [] | + iso_639_3 | [] | + jwhois | [] | + kbd | | + keytouch | [] | + keytouch-editor | [] | + keytouch-keyboa... | [] | + klavaro | [] | + latrine | [] | + ld | | + leafpad | [] [] [] | + libc | [] | + libexif | | + libextractor | | + libgnutls | [] | + libgpewidget | [] [] | + libgpg-error | | + libgphoto2 | | + libgphoto2_port | | + libgsasl | | + libiconv | | + libidn | | + lifelines | | + liferea | | + lilypond | | + linkdr | | + lordsawar | | + lprng | | + lynx | | + m4 | | + mailfromd | | + mailutils | | + make | [] | + man-db | | + man-db-manpages | | + minicom | [] | + mkisofs | | + myserver | | + nano | [] [] | + opcodes | | + parted | | + pies | | + popt | [] [] [] | + psmisc | | + pspp | | + pwdutils | | + radius | | + recode | | + rosegarden | | + rpm | | + rush | | + sarg | | + screem | | + scrollkeeper | [] [] | + sed | | + sharutils | | + shishi | | + skencil | | + solfege | [] | + solfege-manual | | + soundtracker | | + sp | | + sysstat | [] | + tar | [] | + texinfo | [] | + tin | | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | | + vice | | + vmm | | + vorbis-tools | | + wastesedge | | + wdiff | | + wget | [] | + wyslij-po | | + xchat | [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] | + +-----------------------------------------------+ + ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne + 20 5 10 1 13 48 4 2 2 4 24 10 20 3 1 + + nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr + +---------------------------------------------------+ + a2ps | [] [] [] [] [] [] [] [] | + aegis | [] [] [] | + ant-phone | [] [] | + anubis | [] [] [] | + aspell | [] [] [] [] [] | + bash | [] [] | + bfd | [] | + bibshelf | [] [] | + binutils | [] [] | + bison | [] [] [] | + bison-runtime | [] [] [] [] [] [] [] | + bluez-pin | [] [] [] [] [] [] [] [] | + bombono-dvd | [] () | + buzztard | [] [] | + cflow | [] | + clisp | [] [] | + coreutils | [] [] [] [] [] [] | + cpio | [] [] [] | + cppi | [] | + cpplib | [] | + cryptsetup | [] | + dfarc | [] | + dialog | [] [] [] [] | + dico | [] | + diffutils | [] [] [] [] [] [] | + dink | () | + doodle | [] [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] [] | + exif | [] [] [] () [] | + fetchmail | [] [] [] [] | + findutils | [] [] [] [] [] | + flex | [] [] [] [] [] | + freedink | [] [] | + gas | | + gawk | [] [] [] [] | + gcal | | + gcc | [] | + gettext-examples | [] [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] [] [] [] | + gettext-tools | [] [] [] [] [] [] | + gip | [] [] [] [] [] | + gjay | | + gliv | [] [] [] [] [] [] | + glunarclock | [] [] [] [] [] | + gnubiff | [] () | + gnucash | [] () () () | + gnuedu | [] | + gnulib | [] [] [] [] | + gnunet | | + gnunet-gtk | | + gnutls | [] [] | + gold | | + gpe-aerial | [] [] [] [] [] [] [] | + gpe-beam | [] [] [] [] [] [] [] | + gpe-bluetooth | [] [] | + gpe-calendar | [] [] [] [] | + gpe-clock | [] [] [] [] [] [] [] [] | + gpe-conf | [] [] [] [] [] [] [] | + gpe-contacts | [] [] [] [] [] | + gpe-edit | [] [] [] | + gpe-filemanager | [] [] [] | + gpe-go | [] [] [] [] [] [] [] [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] [] [] [] [] [] [] | + gpe-package | [] [] | + gpe-sketchbook | [] [] [] [] [] [] [] | + gpe-su | [] [] [] [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] [] [] [] | + gpe-timesheet | [] [] [] [] [] [] [] [] | + gpe-today | [] [] [] [] [] [] [] [] | + gpe-todo | [] [] [] [] [] | + gphoto2 | [] [] [] [] [] [] [] [] | + gprof | [] [] [] | + gpsdrive | [] [] | + gramadoir | [] [] | + grep | [] [] [] [] | + grub | [] [] [] | + gsasl | [] [] [] [] | + gss | [] [] [] | + gst-plugins-bad | [] [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] | + gtick | [] [] [] | + gtkam | [] [] [] [] [] [] | + gtkorphan | [] | + gtkspell | [] [] [] [] [] [] [] [] [] [] | + gutenprint | [] [] | + hello | [] [] [] [] | + help2man | [] [] | + hylafax | [] | + idutils | [] [] [] [] [] | + indent | [] [] [] [] [] [] [] | + iso_15924 | [] [] [] [] | + iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] | + iso_3166_2 | [] [] [] | + iso_4217 | [] [] [] [] [] [] [] [] | + iso_639 | [] [] [] [] [] [] [] [] [] | + iso_639_3 | [] [] | + jwhois | [] [] [] [] | + kbd | [] [] [] | + keytouch | [] [] [] | + keytouch-editor | [] [] [] | + keytouch-keyboa... | [] [] [] | + klavaro | [] [] | + latrine | [] [] | + ld | | + leafpad | [] [] [] [] [] [] [] [] [] | + libc | [] [] [] [] | + libexif | [] [] () [] | + libextractor | | + libgnutls | [] [] | + libgpewidget | [] [] [] | + libgpg-error | [] [] | + libgphoto2 | [] [] | + libgphoto2_port | [] [] [] [] [] | + libgsasl | [] [] [] [] [] | + libiconv | [] [] [] [] [] | + libidn | [] [] | + lifelines | [] [] | + liferea | [] [] [] [] [] () () [] | + lilypond | [] | + linkdr | [] [] [] | + lordsawar | | + lprng | [] | + lynx | [] [] [] | + m4 | [] [] [] [] [] | + mailfromd | [] | + mailutils | [] | + make | [] [] [] [] | + man-db | [] [] [] | + man-db-manpages | [] [] [] | + minicom | [] [] [] [] | + mkisofs | [] [] [] | + myserver | | + nano | [] [] [] [] | + opcodes | [] [] | + parted | [] [] [] [] | + pies | [] | + popt | [] [] [] [] | + psmisc | [] [] [] | + pspp | [] [] | + pwdutils | [] | + radius | [] [] [] | + recode | [] [] [] [] [] [] [] [] | + rosegarden | () () | + rpm | [] [] [] | + rush | [] [] | + sarg | | + screem | | + scrollkeeper | [] [] [] [] [] [] [] [] | + sed | [] [] [] [] [] [] [] [] [] | + sharutils | [] [] [] [] | + shishi | [] | + skencil | [] [] | + solfege | [] [] [] [] | + solfege-manual | [] [] [] | + soundtracker | [] | + sp | | + sysstat | [] [] [] [] | + tar | [] [] [] [] | + texinfo | [] [] [] [] | + tin | [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | [] [] [] [] [] | + vice | [] | + vmm | [] | + vorbis-tools | [] [] | + wastesedge | [] | + wdiff | [] [] | + wget | [] [] [] [] [] [] [] | + wyslij-po | [] [] [] | + xchat | [] [] [] [] [] [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] | + +---------------------------------------------------+ + nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr + 135 10 4 7 105 1 29 62 47 91 3 54 46 9 37 + + sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW + +---------------------------------------------------+ + a2ps | [] [] [] [] [] | 27 + aegis | [] | 9 + ant-phone | [] [] [] [] | 9 + anubis | [] [] [] [] | 15 + aspell | [] [] [] | 20 + bash | [] [] [] | 12 + bfd | [] | 6 + bibshelf | [] [] [] | 16 + binutils | [] [] | 8 + bison | [] [] | 12 + bison-runtime | [] [] [] [] [] [] | 29 + bluez-pin | [] [] [] [] [] [] [] [] | 37 + bombono-dvd | [] | 4 + buzztard | [] | 7 + cflow | [] [] [] | 9 + clisp | | 10 + coreutils | [] [] [] [] | 22 + cpio | [] [] [] [] [] [] | 13 + cppi | [] [] | 5 + cpplib | [] [] [] [] [] [] | 14 + cryptsetup | [] [] | 7 + dfarc | [] | 9 + dialog | [] [] [] [] [] [] [] | 30 + dico | [] | 2 + diffutils | [] [] [] [] [] [] | 30 + dink | | 4 + doodle | [] [] | 7 + e2fsprogs | [] [] [] | 11 + enscript | [] [] [] [] | 17 + exif | [] [] [] | 16 + fetchmail | [] [] [] | 17 + findutils | [] [] [] [] [] | 20 + flex | [] [] [] [] | 15 + freedink | [] | 10 + gas | [] | 4 + gawk | [] [] [] [] | 18 + gcal | [] [] | 5 + gcc | [] [] [] | 7 + gettext-examples | [] [] [] [] [] [] [] | 34 + gettext-runtime | [] [] [] [] [] [] [] | 29 + gettext-tools | [] [] [] [] [] [] | 22 + gip | [] [] [] [] | 22 + gjay | [] | 3 + gliv | [] [] [] | 14 + glunarclock | [] [] [] [] [] | 19 + gnubiff | [] [] | 4 + gnucash | () [] () [] () | 10 + gnuedu | [] [] | 7 + gnulib | [] [] [] [] | 16 + gnunet | [] | 1 + gnunet-gtk | [] [] [] | 5 + gnutls | [] [] [] | 10 + gold | [] | 4 + gpe-aerial | [] [] [] | 18 + gpe-beam | [] [] [] | 19 + gpe-bluetooth | [] [] [] | 13 + gpe-calendar | [] [] [] [] | 12 + gpe-clock | [] [] [] [] [] | 28 + gpe-conf | [] [] [] [] | 20 + gpe-contacts | [] [] [] | 17 + gpe-edit | [] [] [] | 12 + gpe-filemanager | [] [] [] [] | 16 + gpe-go | [] [] [] [] [] | 25 + gpe-login | [] [] [] | 11 + gpe-ownerinfo | [] [] [] [] [] | 25 + gpe-package | [] [] [] | 13 + gpe-sketchbook | [] [] [] | 20 + gpe-su | [] [] [] [] [] | 30 + gpe-taskmanager | [] [] [] [] [] | 29 + gpe-timesheet | [] [] [] [] [] | 25 + gpe-today | [] [] [] [] [] [] | 30 + gpe-todo | [] [] [] [] | 17 + gphoto2 | [] [] [] [] [] | 24 + gprof | [] [] [] | 15 + gpsdrive | [] [] [] | 11 + gramadoir | [] [] [] | 11 + grep | [] [] [] | 10 + grub | [] [] [] | 14 + gsasl | [] [] [] [] | 14 + gss | [] [] [] | 11 + gst-plugins-bad | [] [] [] [] | 26 + gst-plugins-base | [] [] [] [] [] | 24 + gst-plugins-good | [] [] [] [] | 24 + gst-plugins-ugly | [] [] [] [] [] | 29 + gstreamer | [] [] [] [] | 22 + gtick | [] [] [] | 13 + gtkam | [] [] [] | 20 + gtkorphan | [] [] [] | 14 + gtkspell | [] [] [] [] [] [] [] [] [] | 45 + gutenprint | [] | 10 + hello | [] [] [] [] [] [] | 21 + help2man | [] [] | 7 + hylafax | [] | 5 + idutils | [] [] [] [] | 17 + indent | [] [] [] [] [] [] | 30 + iso_15924 | () [] () [] [] | 16 + iso_3166 | [] [] () [] [] () [] [] [] () | 53 + iso_3166_2 | () [] () [] | 9 + iso_4217 | [] () [] [] () [] [] | 26 + iso_639 | [] [] [] () [] () [] [] [] [] | 38 + iso_639_3 | [] () | 8 + jwhois | [] [] [] [] [] | 16 + kbd | [] [] [] [] [] | 15 + keytouch | [] [] [] | 16 + keytouch-editor | [] [] [] | 14 + keytouch-keyboa... | [] [] [] | 14 + klavaro | [] | 11 + latrine | [] [] [] | 10 + ld | [] [] [] [] | 11 + leafpad | [] [] [] [] [] [] | 33 + libc | [] [] [] [] [] | 21 + libexif | [] () | 7 + libextractor | [] | 1 + libgnutls | [] [] [] | 9 + libgpewidget | [] [] [] | 14 + libgpg-error | [] [] [] | 9 + libgphoto2 | [] [] | 8 + libgphoto2_port | [] [] [] [] | 14 + libgsasl | [] [] [] | 13 + libiconv | [] [] [] [] | 21 + libidn | () [] [] | 11 + lifelines | [] | 4 + liferea | [] [] [] | 21 + lilypond | [] | 7 + linkdr | [] [] [] [] [] | 17 + lordsawar | | 1 + lprng | [] | 3 + lynx | [] [] [] [] | 17 + m4 | [] [] [] [] | 19 + mailfromd | [] [] | 3 + mailutils | [] | 5 + make | [] [] [] [] | 21 + man-db | [] [] [] | 8 + man-db-manpages | | 4 + minicom | [] [] | 16 + mkisofs | [] [] | 9 + myserver | | 0 + nano | [] [] [] [] | 21 + opcodes | [] [] [] | 11 + parted | [] [] [] [] [] | 15 + pies | [] [] | 3 + popt | [] [] [] [] [] [] | 27 + psmisc | [] [] | 11 + pspp | | 4 + pwdutils | [] [] | 6 + radius | [] [] | 9 + recode | [] [] [] [] | 28 + rosegarden | () | 0 + rpm | [] [] [] | 11 + rush | [] [] | 4 + sarg | | 1 + screem | [] | 3 + scrollkeeper | [] [] [] [] [] | 27 + sed | [] [] [] [] [] | 30 + sharutils | [] [] [] [] [] | 22 + shishi | [] | 3 + skencil | [] [] | 7 + solfege | [] [] [] [] | 16 + solfege-manual | [] | 8 + soundtracker | [] [] [] | 9 + sp | [] | 3 + sysstat | [] [] | 15 + tar | [] [] [] [] [] [] | 23 + texinfo | [] [] [] [] [] | 17 + tin | | 4 + unicode-han-tra... | | 0 + unicode-transla... | | 2 + util-linux-ng | [] [] [] [] | 20 + vice | () () | 1 + vmm | [] | 4 + vorbis-tools | [] | 6 + wastesedge | | 2 + wdiff | [] [] | 7 + wget | [] [] [] [] [] | 26 + wyslij-po | [] [] | 8 + xchat | [] [] [] [] [] [] | 36 + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63 + xkeyboard-config | [] [] [] | 22 + +---------------------------------------------------+ + 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW + 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618 + + Some counters in the preceding matrix are higher than the number of +visible blocks let us expect. This is because a few extra PO files are +used for implementing regional variants of languages, or language +dialects. + + For a PO file in the matrix above to be effective, the package to +which it applies should also have been internationalized and +distributed as such by its maintainer. There might be an observable +lag between the mere existence a PO file and its wide availability in a +distribution. + + If June 2010 seems to be old, you may fetch a more recent copy of +this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date +matrix with full percentage details can be found at +`http://translationproject.org/extra/matrix.html'. + +1.5 Using `gettext' in new packages +=================================== + +If you are writing a freely available program and want to +internationalize it you are welcome to use GNU `gettext' in your +package. Of course you have to respect the GNU Library General Public +License which covers the use of the GNU `gettext' library. This means +in particular that even non-free programs can use `libintl' as a shared +library, whereas only free software can use `libintl' as a static +library or use modified versions of `libintl'. + + Once the sources are changed appropriately and the setup can handle +the use of `gettext' the only thing missing are the translations. The +Free Translation Project is also available for packages which are not +developed inside the GNU project. Therefore the information given above +applies also for every other Free Software Project. Contact +`coordinator@translationproject.org' to make the `.pot' files available +to the translation teams. + diff --git a/rpm-5.4.9/CHANGES b/rpm-5.4.9/CHANGES new file mode 100644 index 0000000..2d7f686 --- /dev/null +++ b/rpm-5.4.9/CHANGES @@ -0,0 +1,7118 @@ +5.4.8 -> 5.4.9: + - mdawkins: applied mdv patch rpm-5.4.4-find-debuginfo-add-missing-partial-strip.patch + - mdawkins: applied mdv patch rpm-5.4.4-compress-debug-sections.patch + - mdawkins: applied mdv patch rpm-5.4.4-use-dwarf4-debug-format.patch + - mdawkins: applied mdv patch rpm-5.4.4-create-gdb-index-from-find-debuginfo-if-possible.patch + - mdawkins: applied mdv patch rpm-5.4.4-fix-scripts-breaking-when-RPM_BUILD_ROOT-contains-spaces.patch + - mdawkins: applied mdv patch rpm-5.4.5-enable-internal-dependency-generator.patch + - mdawkins: applied mdv patch rpm-5.4.4-fix-_sys_macros_dir-path.patch + - mdawkins: applied mdv patch rpm-5.4.4-merge-rpm-mandriva-setup-build-macros.patch + - mdawkins: applied mdv patch rpm-5.4.4-merge-common-rpm-mandriva-setup-macros.patch + - mdawkins: applied mdv patch rpm-5.4.4-merge-manbo-macros.patch + - mdawkins: applied mdv patch rpm-5.4.4-use-xz-payload.patch + - macros mandriva.in: + - mdawkins: applied mdv patch rpm-5.4.4-find_lang-handle-man-pages-already-compressed.patch + - mdawkins: applied mdv patch rpm-5.4.4-find_lang-support-multiple-names.patch + - mdawkins: applied mdv patch rpm-5.4.4-find_lang-with-html.patch + - mdawkins: applied mdv patch rpm-5.4.4-merge-find-lang.sh-changes-from-rpm.org.patch + - find_lang: + - mdawkins: applied mdv patch rpm-5.4.4-fix-rpm-qf-on-non-packaged-files.patch + - mdawkins: applied mdv patch rpm-5.4.4-debugedit-add-dwarf4-support.patch + - mdawkins: applied mdv patch rpm-5.4.4-debugedit-bail-out-of-debuginfo-if-stabs-format-encountered.patch + - mdawkins: applied mdv patch rpm-5.4.4-debugedit-remove-unused-variable.patch + - mdawkins: applied mdv patch rpm-5.4.4-debugedit-fix-incorrect-error-messages-regarding_-b-and_-d.patch + - mdawkins: applied mdv patch rpm-5.4.4-debugedit-recompute-build-id-only-on-dwarf-change.patch + - mdawkins: applied mdv patch rpm-5.4.4-debugedit-whitespace-fixups.patch + - debugedit: swipe latest frpm @rpm.org and the ELF cabal. + - mdawkins: applied mdv patch rpm-5.4.4-find-debuginfo-drop-useless-sort.patch + - mdawkins: added python typelib G-IR support to pythonegg.py (gmoro mdv) + - mdawkins: applied mdv patch rpm-5.4.5-fix-pythonegg-deps-for-egg-metadata-in-directories.patch + - mdawkins: dropped vendor if defs for no-owner-group-on-srpm-install + - mdawkins: added js file extention detection for typelib G-IR + - devzero2000: drop @rpm.org brp-python-hardlink + - jbj: yocto: stub-in a de-featured approximation to desired build options. + - jbj: autofu: fix: comment out brp-python-hardlink "stuff". + - jbj: autofu: make peace with automake-1.12. + - jbj: autofu: make peace with autoconf-2.69. + - jbj: l10n: stub-in a proof-of-concept sqlite3 database. + - jbj: l10n: stub in --wnh:l10n.sqlite qf template. + - jbj: fhs: add some additional paths for current devel. + - jbj: hkp: use pool.sks-keyservers.net for pubkeys. + - jbj: rpmts: hide bit test/set/clr methods behind some macros. + - jbj: crypto: unhook --nosignatures/--nodigests from a rpmts. + - jbj: python: fix: scrub out _RPMVSF_FOO setup in __init__.py. + - jbj: crypto: eliminate _RPMVSF_{NOHEADER,NOPAYLOAD}. + - jbj: crypto: refactor/eliminate _RPMVSF_{NOSIGNATURES,NODIGESTS}. + - devzero2000: add @rpm.org brp-python-hardlink in a more + portable way + - mdawkins: doxygen-1.7.4 bug + - mdawkins: fontconfig dependencies + - mdawkins: haskell dependencies + - mdawkins: typelib G-IR + - jbj: fix: finish wireing up Alt set:versions. a bit more todo++. + - jbj: rpmfc: fix: OS X (and *BSD) are sighandler_t challenged. + - jbj: fix: don't hash RPMTAG_FILERDEVS because of %dev usage. + - jbj: change I18NSTRING -> STRING data type. + - mdawkins: start rpm-5.4.9 development. + +5.4.7 -> 5.4.8: + - jbj: mark RPM_I18NSTRING_TYPE for elimination. todo++. + - jbj: set: stub-in a 1st attempt to do Alt version-set comparisons. + - jbj: set: make the version-set into an "rpmset" object. + - jbj: set: swipe the dependency set encoding from Alt. + - jbj: tests: dink with perl module load path to load from within tree. + - jbj: tests: dink with python module load path to load from within tree. + - jbj: tests: extend the unixodbc test case. + - jbj: tests: add a test case for --with-unixodbc. + - jbj: pcre: upgrade to pcre-8.30 and re-add --with-pcre=internal. + - jbj: perl-URPM: configure/build perl-URPM from checkout. + - jbj: gpsee: do pull+update separately: fetch is version specific. + - jbj: devtool: fix: translate dash to underscore for release tag envvar. + - jbj: devtool: add perl-URPM internal. + - jbj: tests: enable additional tests. + - jbj: mongo: upgrade the tests from the mongo-c-driver. todo++. + - jbj: mongo: upgrade to latest mongo-c-driver. + - jbj: rpmjs: permit --with-gpsee=internal. todo++. + - devzero2000: add more Fedorable gpg keys to thkp.c test program + - jbj: rpmgit: permit --with-libgit2=internal. todo++. + - jbj: macros: add %__rmdir (and autofu detection) to the pile. + - jbj: start rpm-5.4.8 development. + +5.4.6 -> 5.4.7: + - jbj: OWL needs chatter/lsattr in chroot's. + - devzero2000: include rpm.org fix for rhbz#782970 + don't process spec %include in false branch of %if clauses + - jbj: stub-in autofu for svn/git objects. + - jbj: ispras: upgrade to abi-sanity.checker.pl to 1.12.9. + - jbj: macosx: permit (custom built) libtomcrypt in buildbot's. + - jbj: devtool: stanza for Fedorable 16. + - jbj: autofu: fix: F16 can't find db.h because of ${includdir} expansion. + - jbj: tests: revert RPMRC_NOSIG to keep the buildbot waterfall green. + - jbj: tests: fix: use "keys.n3npq.net" as default keyserver. + - jbj: stub-out per-mode disabling of signature/digest using %{_vsflags_foo} + - jbj: rpmgi: handle RPMRC_NOSIG while iterating. + - jbj: pkgio: return RPMRC_NOSIG if no signature is present. + - jbj: add RPMRC_NOSIG error return. + - jbj: start rpm-5.4.7 development. + +5.4.5 -> 5.4.6: + - jbj: remove %{load:...} shims for macro refactoring. + - jbj: distcheck: fix: libsql.la reverted (lp#936610). + - jbj: ispras: fix: add missing modules (lp#911266). + - jbj: python: fix: headerFini instead of headerFreeIterator (Per Oyvind). + - jbj: micro++ -> 5.4.6 and add timestamp. + - jbj: start rpm-5.4.6 development. + +5.4.4 -> 5.4.5: + - jbj: micro++ -> 5.4.5 and add timestamp. + - jbj: i18n: add eo.po (Translation Project). + - jbj: i18n: update PO files (Translation Project). + - jbj: hkp: revert to "keys.n3npq.net" for CI tests. + - jbj: rpmdb: wire-up heap_regionsize. + - jbj: rpmdb: fix: db-5.3.15 DB_CONFIG can't handle multichar whitespace. + - jbj: format: hash RPMTAG_FILE{INODES,DEVICES,RDEVS} in headers. + - jbj: autofu: make peace with automake-1.11.2. + - jbj: hkp: default to standard SKS pool for now, todo++. + - jbj: rpmdb: upgrade to db-5.3.15, todo++. + - jbj: start rpm-5.4.5 development. + +5.4.3 -> 5.4.4: + - devzero2000: call with safety some python API that + can segfault if called with a NULL pointer. + Based of the original patch of David Malcom + http://lists.rpm.org/pipermail/rpm-maint/2011-December/003139.html + - proyvind: add support for filtering of files to find-debuginfo.sh. + - proyvind: fix find-debuginfo.sh mime-type matching. + - jbj: debuginfo: use current dir instead of $RPM_BUILD_DIR. + - proyvind: fix different epoch being ignored when comparing two packages + with same NVRA. + - proyvind: add %ruby_sitedir and %ruby_vendor macros. + - devzero2000: get rid of bashisms in dbconvert.sh and gstreamer.sh + - jbj: start rpm-5.4.4 development. + +5.4.2 -> 5.4.3: + - jbj: release rpm-5.4.3. + - jbj: rsa: avoid memory leak on quick-check error returns. + - jbj: gpsee: snapshot RPM+JS resurrection work-in-progress for release. + - jbj: leg: stub-in a fictional architecture to restructure the + ARM namespace based on "attributes". + - jbj: arm: add the next 6 armv7* permutations to demonstrate the futility + of "Have it your own way!" architectural naming in the ARM family. + - jbj: reduce the scriptlet envar's for "real world" usage cases. + - devzero2000: call umask before mkstemp. + The mkstemp() function generates a unique temporary file name from the supplied template, + opens a file of that name using the O_EXCL flag (guaranteeing the current process to be the only user) + and returns a file descriptor. + + The POSIX specification does not say anything about file modes, so the application should make sure its umask + is set appropriately before calling mkstemp + ( ref. https://buildsecurityin.us-cert.gov/bsi/articles/knowledge/coding/781-BSI.html) + - jbj: js: port and compile against mosjs185 API. more todo++. + - jbj: arm: add arm-peculier cpuinfo fields. + - jbj: ruby: disable "make check" until -lpcreposix gets linked correctly. + - jbj: ruby: avoid undefined @WITH_RUBY_VENDORARCHDIR@. + - jbj: crypto: rescusitate --with-libtomcrypt. + - jbj: rpmdb: stub-in DB_HEAP and heapsize configurable. + - jbj: rpmdb: macros for new db-utils. + - jbj: lua: port to lua-5.2.0-beta external. + - jbj: hdrfmt: fix: remove a memory leak. + - jbj: rpmgi: fix: load rpmdb tag value filters more carefully. + - devzero2000: add lzip support + - devzero2000: add lrzip support + (blueprint https://blueprints.launchpad.net/rpm/+spec/rpm5-use-lrzip-as-new-compression-program) + - devzero2000: merge commit 31d807ffa8cdf91addf7c39fdf9abf6c61d77944 + from @rpm.org master branch + - jbj: rpmdb: stub-in db-5.2.28 support. + - jbj: rpmdb: set -I/usr/include/dbXY, remove . + - jbj: rpmtxn: fix: use DB_INIT_TXN (0x800 changes in db-5.2.28). + - jbj: rpmdb: fix: don't set PARTIAL on primary DBT through cursor->cpget. + - jbj: tests: rescusitate api-sanity auto/* markup for 1.12.5. + - jbj: tests: upgrade to abi-compliance-checker 1.93.7 (modules? docs?). + - jbj: tests: upgrade to api-sanity-autotest-1.12.5 (docs?). + - jbj: python: disable broken "make check". + - jbj: neon: upgrade to neon-0.29.6 internal. + - jbj: start 5.4.3 development. + +5.4.1 -> 5.4.2: + - jbj: i18n: update PO files (Translation Project). + - jbj: fix: ensure that integer CDATA is initialized to "" when missing. + - jbj: fix: subdir is needed to find loader maps. + - jbj: include Pascal's pom2spec java -> *.rpm wrapper from + https://gitorious.org/pbleser/pbleser/blobs/raw/master/pom2spec) + - proyvind: add sparc64v2 arch to %sparcx. + - proyvind: try sanitize %sparc vs %sparcx inconsistencies, make %sparc + all 32 bit sparc archs only, with %sparcx being all 32 bit archs AND + 64 bit archs. + - proyvind: add armv7l to %arm (from Paulo Andrade ). + - proyvind: fix rpm not comparing distepoch if missing from one package + when doing comparision. + - proyvind: fix rpm treating packages of same NVRA, but different distepoch + as equal, preventing upgrades between them. + - proyvind: dbconvert: fix segfault when no root is specified. + - devzero2000: merge afb patch portability of endian + - proyvind: check-multiarch-files: remove unnecessary import of MDK::Common, + causing undesired dependency from perl dependency generator. + - devzero2000: add a simple usage command to devtool + - devzero2000: merge the popt autofu vendor-script linker script check for openindiana native + ld, using modern and not deprecated autoconf construct. Even if the check is not perfect + but it is based on a resultant ld warning, on openindiana the result should work + with gcc and native ld also for rpm. + - proyvind: fix broken %optflags for i686-linux macros. + - proyvind: mandriva: fix implicit %clean not being run when %changelog is + present. + - proyvind: don't pick up python version from python egg, rely on path + only in stead to avoid incorrect version dependencies if any other + egg metadata for other versions is found. + - mdawkins: updated changelog in rpm.spec.in + - mdawkins: tagged 5.4.2 release in configure.ac + +5.4.0 -> 5.4.1: + - devzero2000: In fpLookupSubdir, data returned by hash should be of type + "struct rpmffi_s **" instead of "struct rpmffi_s *" to avoid + segfault. Patch by Qing He. + - devzero2000: added gcc-c++ in devtool.conf for fedora (required by beecrypt) + - devzero2000: added fedora per platform macro from redhat-rpm-config + - devzero2000: added suse to the per vendor change configure.ac enabler + - devzero2000: added suse.in macros file from rpm-4.9.0-122 + (http://tinyurl.com/3vo287b) + - devzero2000: resurrect openwall (owl) vendor detection + (http://cvsweb.openwall.com/cgi/cvsweb.cgi/~checkout~/Owl/packages/rpm/rpm-4.2-owl-vendor-setup.diff?rev=1.3;content-type=text%2Fplain) + They are using rpm 4.2 with, apparently, the missing CVE-2010-2059 patch. This is strange enough + i think http://www.openwall.com/lists/oss-security/2010/06/02/2. + - devzero2000: Sort file list for debuginfo extraction. + (inspired by Robert Schiele http://lists.rpm.org/pipermail/rpm-list/2011-May/000894.html) + - proyvind: update doxygen input filename paths. + - proyvind: fix assertion error when trying to install packages without + required permissions. + - devzero2000: document --whatneeds and --needswhat + (ref. https://bugzilla.redhat.com/show_bug.cgi?id=142651) + - proyvind: fix an extremely subtle, corner-case memleak in parsePreamble.c + - jbj: dreamplug: build options. + - jbj: openmamba: explicit neon linkage isn't right solution, revert/todo++. + - jbj: monga: build options. + - jbj: openmamba: --with-neon=internal needs libs to be added explicitly + to linkage. + - mdawkins: applied vendor Openmamba patches + - mdawkins: i18n update cs.po da.po de.po es.po fi.po fr.po id.po is.po it.po ja.po + ko.po nb.po nl.po pa.po pl.po pt.po pt_BR.po ru.po sk.po sl.po sr.po sv.po tr.po + uk.po vi.po zh_TW.po + - devzero2000: permit in configure phase to + --enable-rpmvercmp-digits-beat-alpha for reverting to the old rpmvercmp + behavior where digits beat alpha as used by Mandriva, Fedora, Suse + and other (ref https://blueprints.launchpad.net/rpm/+spec/rpm-split-vendor-config-in-autofu) + - jbj: mongo: adjust --json spewage to accomodate mongo syntax. + - devzero2000: get rid of rindex everywhere: use SUSv3 strrchr instead + - jbj: mongo: templating diddle-ups, use new Date(...) in other.mongo. + - jbj: mongo: wire-up a per-spewage macro expansion, more todo++. + - jbj: mongo: fix: iconv_open("UTF-8", "UTF-8//IGNORE") zero tolerance + transform for encoding randomness, particularly in ancient %changelog's. + - jbj: mongo: fix: JSON has no escaped single quote or vertical tab. + - devzero2000: add more gpg keys to thkp.c test program + - jbj: move multiarch* to mandriva.in. + - jbj: put "devel(libfoo)" deps under RPM_VENDOR_MANDRIVA. + - proyvind: merge multiarch-utils from mandriva. + - proyvind: macros: sync with updated python macros from mandriva. + - proyvind: rpmfc: add internel dep generator helper for kernel modules. + - provyind: kmod-deps.sh: add dependency extractor from mandriva. + - proyvind: rpmds: implement devel(libfoo) symlink dependencies from + Mandriva, but with proper ELF SONAME checking. + - jbj: mongo: stub-in a /usr/lib/rpm/bin mongo shell wrapper. + - jbj: spewage: fix: rework sql/json markup to use the EVRD parser. + - jbj: build: fix: resurrect %description -l XY yet again. + - jbj: build: fix: attempt arbitrary '%foo' tag iff '%' is seen. + - jbj: mongo: establish primary/filelists/other/srpm collection names. + - jbj: mongo: drag-in the test suite. grdfs/replica_sets todo++. + - jbj: mongo: and re-export the mongo-c-driver through librpmio.vers. + - jbj: mongo: pull in the gridfs methods from the mongo-c-driver too. + - jbj: mongo: update mongo-c-driver code, gridfs stil todo++ + - jbj: mongo: stub-in a configurable mongodb:// %_mongodb URI. + - jbj: autofu: fix: remove --with-js remnants. + - jbj: autofu: drop --with-js=internal now that JS 1.8.5 is available. + - mdawkins: i18n update cs.po da.po de.po es.po fi.po fr.po id.po + is.po it.po ja.po ko.po nb.po nl.po pa.po pl.po pt.po pt_BR.po + ru.po sk.po sl.po sr.po sv.po tr.po uk.po vi.po zh_TW.po + - proyvind: rpmjs: port to SpiderMonkey 1.8.5 API. + - proyvind: mandriva: filter overlapping depencies. + - proyvind: rubygems.rb: add/provide ruby(abi) dependencies for non-gems. + - proyvind: rpmfc: add classifiers for gstreamer plugins & dep generator. + - proyvind: use pythoneggs.py for python deps generated by internal generator. + - proyvind: rpmfc: enable ruby file classifier & internal dep generator. + - devzero2000: misread the review, repost as the original patch + - devzero2000: change the order for the _initddir macro assignment + - proyvind: mandriva: add systemd macros (mdvbz#62741, from Andrey Borzenkov). + - proyvind: dbconvert: fix conversion to older hash database format + resulting in "missing" package from rpmdb. + - devzero2000: add %_initddir macro for Mandriva + (ref http://lists.mandriva.com/maintainers/2011-03/msg00252.php) + - jbj: fix: reduce false positives checking for duplicate keys(mdvbz#62822). + - jbj: uuid: permit --qf '%{RPMTAG:uuid}' UUIDv1/UUIDv5 output display. + - jbj: uuid: rework for single exit return. + - devzero2000: permit in configure phase to enable the + --enable-rpm-lua-extensions-based-on-rpmlib used by OpenPKG today + and, for rpm.vercmp, by rpm.org (ref https://blueprints.launchpad.net/rpm/+spec/rpm-split-vendor-config-in-autofu) + - jbj: add a --nofsync popt alias (caveat: experimental & risky). + - jbj: checksig: check explictly for per-item failures after iterating. + - proyvind: always run %clean so it won't be required in .spec file. + - jbj: install: check explictly for per-item failures after iterating. + - jbj: rpmgi: save per-item failures separately from iteration returns. + - jbj: display the exit code when -vv is used. + - devzero2000: document the actual semantic of rpm5 %exclude + - proyvind: rubygems.rb: change dependency 'ruby >= ruby_version' to + 'ruby(abi) = ruby_version' + - devzero2000: flip a toy test from the %exclude and check unpackaged file issue + - proyvind: check whether provides are duplicate of package first (without + distepoch), also ensures that package is always at end of %provideversion. + - jbj: add "| cpio -dim" to the rpm2cpio.8 examples. + - mdawkins: i18n update sl.po sv.po + - jbj: i18n: update fi.po files (Translation Project). + - jbj: valgrind: fix: typo in macros building w/o . + - devzero2000: permit in configure phase to disable (via --disable-dirname-and-symlink-deps) + the optional-dirname-and-symlink-deps used by Mandriva and Ark today + (ref https://blueprints.launchpad.net/rpm/+spec/rpm-split-vendor-config-in-autofu) + - proyvind: use expanded %{___NVRA} for 'rpm --last'. + - jbj: valgrind: fix: typ in macros building w/o . + - proyvind: set mi->mi_count in rpmmiCount() when db cursor exists rather + than always doing it in rpmmiNext() + - jbj: rpmrc: fix: add missing nref++ on rpmdsFromPRCO() return segfault. + - proyvind: set mi->mi_count when rpmmiNext() initializes db cursor so that + rpmmiCount() won't break (mdvbz#62267) + - proyvind: fix rpmmiCount() not resetting db cursor after use, breaking + iterator (mdvbz#62279) + - devzero2000: update INSTALL.developer with some jbj consideration + on how to use multiple rpm version. + - proyvind: python: export rpmEVRparse() & rpmEVRcompare() in evrSplit() & + evrCompare(). + - proyvind: fix return code for ignored signals breaking ie. rpmbuild with + gnome-terminal (mdvbz#62262) + - proyvind: add tools/dbconvert for rpmdb conversion to/from hash/btree & + little/big endian (to handle upgrade/downgrade to/from older rpm versions) + - jbj: remove fsync(2) after file install, its intolerably slow. + - jbj: simplify the lookup3.c valgrind logic. + - proyvind: rpmdb: set and create default log directory so that it doesn't + get changed ie. when installing to a fresh chroot and no DB_CONFIG + exists, with transaction logs ending up in a path that changes later. + - proyvind: perl: fix typo breaking RPM::Transaction->problems(). + - devzero2000: Fix null requirement produced by mono-find-requires + by Silvan Calarco + - proyvind: fix noarch sub-packages not having it's corresponding platform + tag (mdvbz#61746). + - proyvind: lookup3: fix runtime valgrind check and make it local. + - proyvind: lookup3: fix valgrind #ifdef and perform runtime check for + valgrind in stead. + - jbj: omp: use a thread team solely for file digests to avoid overhead. + - jbj: rpmns: use binary search for name space lookup. + - jbj: rpmns: optimize out strlen() calls on depsolver fast path. + - jbj: drd: disable digest/libelf races for now. todo++. + - jbj: drd: disable path/tag data races for now. todo++. + - jbj: ugid: use the re-entrant user/group lookups. + - jbj: valgrind: empty macros for *everything* to see the namespace. + - jbj: mongo: stub-in mongo:// and mongodb:// URI's. + - jbj: verify: overlap header-only signature/digest with file digests. + - jbj: prelink: thread-safe helper instantiation for valgrind drd. + - jbj: consistent calloc-like behavior for memory pool items. + - jbj: omp: include everywhere. + - jbj: drd: attempt mempool annotations for valgrind drd. + - jbj: omp: avoid thread overhead for a single digest. + - jbj: rpmal: add a memory pool. + - jbj: rpmal: rip-out the dir/file bsearch-able store. + - jbj: rpmal: stub-in the rpmfiFNBF() replacement. + +5.3.7 -> 5.4.0: + - jbj: remove markReplacedFiles. + - jbj: build: rescusictate the ISPRAS markup. + - jbj: rpmlib: rescusictate the ISPRAS markup. + - jbj: rpmdb: rescusictate the ISPRAS markup. + - jbj: rpmio: add a queue link pointer to all rpm objects. + - jbj: i18n: update po files (Translation Project). + - jbj: rpmio: rescusitate the ISPRAS markup. + - jbj: ISPRAS: upgrade to abi-compliance-checker-1.21.9. + - jbj: ISPRAS: upgrade to api-sanity-autotest-1.11. + - jbj: rpmdb: disable Depcache, --install and "make test" todo++. + - jbj: distcheck: tests: move target from "check" to "test". + - jbj: distcheck: no globs, only explict lists, for EXTRA_DIST. + - jbj: distcheck: make internal neon "opt-in", avoid GSS-API wrestling. + - jbj: verify: fix: NULL fnpyKey caused doubled parentdir/linkto check. + - jbj: rpmal: add common exit point to control flow. + - jbj: rpmdb: use Depchache store by default again. + - jbj: db3: fix: avoid non-root EPERM with temp Depcache close. + - jbj: db3: adjust event debugging, add DB->cursor() open flags. + - jbj: rpmdb: rename the dependency cache pseudo-tag. + - jbj: verify: re-add digest/signature checks. + - jbj: permit building --without-libtasn1. + - jbj: check-in arbirtrarytag*.src.rpm for "make dist". + - jbj: rpm.spec: adjust to reality (popt needs to be in tarball, todo++). + +5.3.6 -> 5.3.7: + - jbj: fix: %config handling broken while refactoring a loop. + - jbj: rpmmi: lazily instantiate the basenames header set. + - jbj: re-add the lazy creator avoiding self LOOP's in ordering pkgs + during installs using parentdir relations. + - proyvind: rpmts: don't default rootDir to "" if set to NULL, as it + confusing rpm checks on NULL & "/" only, without "", making ie. + %posttrans scriptlets fail where NULL is used (mdvbz#61696). + - jbj: fix memory leak on user lookup error. + - proyvind: rubygems: only add runtime dependencies (Rémy Clouard). + - proyvind: export rpmbf.h & rpmgi.h to public API. + - proyvind: rpm4compat: add RPMTAG_FILENAMES & RPMDBI_LABEL. + - proyvind: rpmconstant: update constants. + - proyvind: rpmconstant: fix rpmh2tbl to error out for constants not found. + +5.3.5 -> 5.3.6: + - jbj: i18n: update po files (Translation Project). + - proyvind: perl: start on adding back some missing functionality from RPM4: + RPM::Sign, RPM::Transaction::importpubkey, RPM::Transaction::checkrpm. + - proyvind: add a first prototype scripts/dbconvert.sh for handling rpmdb + conversion during upgrades. + - jbj: rpmdb: double the defaults for locking tunables. + - jbj: rpmdb: fix: don't bother excluding RPM_CHAR_TYPE sanity check. + - jbj: rpmdb: fix: don't bother converting to RPM_UINT8_TYPE. + - jbj: stub-in a disabler for "FILE ACID". + - jbj: put the rpm -qf 1-liner under #ifdef RPM_VENDOR_MANDRIVA for now. + - proyvind: fix issue with 'rpm -qf' on unowned file not being + reported. (launchpad #669130) + - proyvind: fix assert failure with Fadvise() on non-existing files. + - proyvind: mandriva: fix 'Conflicts: dependencies without release + misfire'. (mdvbz#55810) + - proyvind: make sure to expand %buildroot from main package. + - jbj: devtool: don't distribute internal pcre. + - proyvind: filetriggers: don't bother w unneeded chroot. + +5.3.4 -> 5.3.5: + - proyvind: ditch %gem_unpack macro and make %setup automatically handle + ruby gem extraction in stead. + - jbj: sqlite: fix: permit building without sqlite, instead. + - jbj: beecrypt: fix: polluted builds due to my brain fart. revert. + - jbj: popt: permit builds with --with-popt=internal all over again. todo++. + - jbj: tests: fix: eliminate the need to jump start "make check" + by copy macros from within tree to /usr/lib/rpm. + - jbj: tests: lose all the *.spec build peculier macros just added. + - proyvind: add gem_helper.rb and it's corresponding macros %gem_unpack, + %gem_build & gem_install for simplifying & streamlining ruby gem + packaging. + - proyvind: add cmake macros from fedora/mandriva. + - proyvind: add tcl macros from mandriva. + - proyvind: add ruby macros from mandriva. + - proyvind: add macros from mandriva that's fairly generic enough to + possibly be of use to others, in mandriva/macros. + - devzero2000: add an --setfscontext popt alias (lp#660406) + - jbj: spewage: use RPMTAG_SHA1HEADER as the primary retrieval key. + - jbj: rpmpopt: fix: permit popt aliases to be used w "make check". + - jbj: pgp: add a 2nd parameter to pgpDigNew to generate a keypair. + - jbj: rpmbc: refactor rpmbcExport{Pubkey,Signature} out of rpmbuild code. + - jbj: mongo: add --json to spew document structured metadata in JSON. + - jbj: mongo: add --qf templates for primary/filelists/other imports. + - jbj: spewage: add :jsonescape header format extension. + - jbj: db: specify only db-5.1.19 external for building, remove the cruft. + - jbj: tests: resurrect the "check-ACID" target using external db51_utils. + - jbj: db: build against external db-5.1.19 using --with-db/--with-dbsql. + - jbj: rpmlio: disable for now, needs --with-db=internal. + - jbj: db_tool: disable for now, needs --with-db=internal. + - jbj: db: target db-5.1.19 using --with-db=external. + - proyvind: rpm46compat: mostly(?) fix rpmtd iterator + - jbj: add Fadvise wrapper for posix_dadvise(2). + - jbj: fix: eliminate dueling --noorder options. + - jbj: solvedb's never need a chroot prefix. + +5.3.3 -> 5.3.4: + - jbj: release 5.3.4. + - jbj: i18n: update po files (Translation Project). + - jbj: rpmrepo: finish refactoring tools/rpmrepo.c. + - jbj: move package.c from lib -> rpmdb. + - jbj: rpmrepo: move from rpmio -> rpmdb to finish tools/rpmrepo.c gutting. + - devzero2000 : added --withoutcheck popt alias (#lp:634104) (#mdvbz:35423) + - jbj: i18n: update po files (Translation Project). + - jbj: mongo: handle endianness at runtime, remove MONGO_BIG_ENDIAN. + - jbj: mongo: replace internal md5 digest with rpmDigestInit(). + - jbj: mongo: refactor to export from -lrpmio (with no AutoFu!). + - jbj: mongo: refactor to export the mongo-c-driver API in -lrpmdb. + - jbj: mongo: bundle up the mongo-c-driver in rpmdb/rpmmdb.c. + - jbj: mongo: stub-in AutoFu sufficient to get WITH_MONGO defined. + - jbj: mongo: stub-in a rpmmdb object to carry the Mongo DB C driver. + - jbj: mongo: stub-in a mongo spewage alias as --wdj:srpm.mongo. + - jbj: gpsee: replace WITH_JS everwhere with WITH_GPSEE. GPSEE->JS always. + - jbj: rpmjs: resecusitate sufficiently to use with jx/ngsr.c. more todo++. + - eveith: Fix ruby include paths + - rpm.org: git-v1:339f31face44d877c3a6e2fc780e740e7e236eae. + - jbj: rpmrepo: refactor the methods that don't need/use a header. + - jbj: rpmrepo: handle all CLI argv processing in rpmrepoNew(). + - afb: tests: set up local magic path for internal file. + - jbj: rpmrepo: move CLI tables and global __rpmrepo structure. + - afb: tests: target POSIX make instead of GNU make. + - jbj: rpmrepo: move the data structures into the rpmrepo object. + - jbj: rpmrepo: stub-in a rpmrepo wrapper to bury the CLI tool in a library. + - jbj: tests: resurrect rpmrepo test cases in check-rpmrepo target. + - jbj: rpmrepo: fix: don't segfault processing RPMv3 headers w/o digest. + - jbj: rpmrepo: rescusitate .olddata cleanup iff using sqlite from db-5.0.26. + - jbj: rpmbin: install /usr/lib/rpm/bin/{sqlite3,dbsql} (both for now). + - jbj: tests: rescusitate: --with-file=external --with-dbsql=internal churn. + - jbj: permit --with-dbsql=internal as sqlite replacement. + - jbj: permit building --without-sqlite again. + +5.3.2 -> 5.3.3: + - jbj: beecrypt: finish up --with-beecrypt=internal wiring into -lrpmmisc. + - jbj: neon: finish up --with-neon=internal wiring into -lrpmmisc. + - jbj: misc: add ne_* symbols to loader map for --with-neon=internal. + - jbj: grep: leave rpmgrep internal, autopoint gets heartburn. + - jbj: pcre: upgrade to pcre-8.10. + - jbj: db: upgrade to db-5.0.26. + - jbj: solve: commit to a test framework based on EDOS and Poky. + - jbj: solve: use RPMTAG_PACKAGEORIGIN paths when available. + - jbj: neon: fix: permit building w neon-0.25.x. + - jbj: ssl: fix: permit building w/o ECDSA. + - jbj: ruby: fix: retrofit RSTRING_PTR/RSTRING_LEN into ruby-1.8.5. + - jbj: solve: loop over solve db's in a bag. + - jbj: solve: stub-in toy add/del methods. + - jbj: solve: permit multiple solvedb's in a rpmbag. + - jbj: solve: generalize %_dbpath to permit multiple rpmdb's. + - jbj: solve: flip --aid "opt-in" behavior to --noaid "opt-out". + - jbj: solve: fix: don't free the package file name when depsolving. + - jbj: stub in bag/svn/cvs/git objects. + - jbj: tpm: stub in client startup code and ttpm executable. + - jbj: tpm: rework the AutoFu through *.pc to set CFLAGS. + - jbj: tpm: glue in an rpmtpm object wrapper. + - jbj: tpm: stub in the AutoFu to detect libtpm. + - jbj: fix: debugedit produce empty list file on MIPS. + - jbj: asn1: wire up ctor's and dtor's internally. + - jbj: asn1: stub in a wrapper object for libtasn1 (and PKIX and ASN.1). + - jbj: cdsa: wire up RSA/DSA generate/sign/verify methods. + +5.3.1 -> 5.3.2: + - jbj: pgp: fix: algo parameters to signature/pubkey with msbits(). + - jbj: pgp: use the pubkey from header when installing. + - jbj: pgp: retrieve pubkey from package header (if present). + - jbj: pgp: add pgpArmorUnwrap to parse a pubkey from a buffer. + - jbj: change to last (from first) pubkey in header argv array. + - jbj: i18n: update po files (Translation Project). + - jbj: fix: handle the V4 signature plaintext correctly. + - jbj: add the DSA pubkey/signature to all packages produced by rpmbuild. + - jbj: bc: disable DSA signhash16 checks for now. + - jbj: bc: convert DSA digest from binary, no hex needed. + - jbj: pgp: stub-in a pubkey octet pointer/length. + - jbj: pgp: fix: expiry subpkts are relative, not absolute. + - jbj: auto-sign all built packages with a non-repudiable DSA keypair. + - jbj: ltc: implement RSA/DSA/ECDSA methods (RSA still has issues). + - jbj: crypto: add --usecrypto options for libtomcrypt/cdsa. + - jbj: crypto: stub in wrappers for libtomcrypt & Apple CDSA. + - jbj: autofu: detect libtomcrypt (needs custom-crafted tomcrypt.pc). + - jbj: pgp: add ECDSA generate/sign/verify tests using gcrypt/openssl. + - jbj: pgp: buff the chrome. + - jbj: nss: add a strerror to decode errors to something meaningful. + - jbj: nss: generate "real" PQG params for DSA. + - jbj: nss: add RSA/DSA sign/generate methods. + - jbj: ssl: resurrect RSA verification. RSA breaks my brain every time. + - jbj: ssl: add RSA/DSA sign/generate methods. + - jbj: tests: stub-in generate/sign/verify test cases for RSA/DSA. + - jbj: bc: use rpmpricrt() for signing, 3x-4x faster. + - jbj: bc: resurrect RSA verification. RSA breaks my brain every time. + - jbj: tests: per-crypto implementation tests for hkp:// retrieval. + - jbj: bc: add RSA/DSA sign/generate methods. + - jbj: ssl: plug a memory leak. + - jbj: nss: use common sec_key/pub_key/sig structures. + - jbj: pgp: add method to set Elgamal hash. + - jbj: pgp: add methods for per-implementation cipher/digest/pubkey checks. + - jbj: pgp: add methods for per-implementation pubkey algo dispatch. + - jbj: gc: poplate sign/generate methods. + - jbj: pgp: add methods for ElGamal signatures. + - jbj: hmac: fix: permit HMAC's to be clone'd (salt size was incorrect). + - jbj: ssl: populate set/verify/sign/generate methods for ECDSA. + - jbj: ecdsa: stub-in sign/generate methods for {ECDSA,RSA,DSA}. + +5.3.0 -> 5.3.1: + - jbj: hkp: only verify the signhash, not the signature, with V3 signatures. + - jbj: hkp: fix: avoid encoding issues in user id: truncate to 256b. + - jbj: hkp: fix: validate rpmdb pubkeys too. + - jbj: hkp: lazily setup/teardown the global awol/crl Bloom filters. + - jbj: hkp: use rpmhkp methods for pubkey imports. + - jbj: hkp: use rpmhkp methods for package signatures.. + - jbj: hkp: use rpmhkp methods for clear-signed run-time dependency probes. + - jbj: hkp: use rpmhkpLoadSignature. + - jbj: hkp: expose rpmhkpLoadSignature. + - jbj: pgp: expose the pgpPkt_s internals. + - jbj: hkp: test for RPMRC_OK when validating. + - jbj: hkp: richer return codes from rpmhkpValidate. + - jbj: hkp: expose more methods, add industrial strength debugging spewage. + - jbj: hkp: eliminate pgpPrtPkts to load pubkey material. + - jbj: hkp: refactor pubkey material from rpmts -> rpmhkp. + - jbj: hkp: fix: unbreak package signatures (but creepy logic todo++). + - jbj: hkp: pull the trailing "...=0x" out of _hkp_keyserver_query. + - jbj: hkp: retrofit macro madness disablers for hkp:// lookups. + - jbj: hkp: permit string lookups. + - jbj: iob: increase max. buffer from 256Kb to 1Mb for pubkeys. + - jbj: hkp: add a rpmhkp object to manage hkp:// pubkey lookup/validate. + - jbj: digest: fix: don't count the trailing NUL for ascii digests. + - jbj: gc: truncate DSA digests to 160bits. + - jbj: bc: truncate DSA digests to 160bits. + - jbj: bc: fix: eliminate static buffer overflow. + - jbj: ssl: ensure RSA/DSA parameters are set. + - jbj: hkp: expose pubky/signature parameter setters. + - jbj: hkp: pick up RHEL6 pubkeys for testing. + - jbj: hkp: permit 32-bit as well as 64-bit fingerprint quieries. + - jbj: hkp: add a NULL sentinel to pgpGrabPkts packaet array. + - jbk: hkp: add PGPSIGTYPE_KEY_BINDING handling. never seen one *shrug*. + - jbj: hkp: expose pgpGrabPkts in loader maps. + - jbj: hkp: permit fingerprints on public subkeys. + - jbj: gcrypt: fix: convert hash as signed for RSA, unsigned for DSA. + - jbj: add a negative pubkey lookup Bloom filter. + - jbj: fix: save chroot value across embedded scriptlet execution. + from Przemyslaw Iskra . + - jbj: update "version used" details in INSTALL. + - jbj: permit --with-neon=internal. + +5.2b1 -> 5.3.0 + - jbj: perl: repair "make test" by changing the tests. + - jbj: lua: fix: attempt to create %{pkgbindir} if it doesn't exists. + - jbj: i18n: update po files (Translation Project). + - jbj: rpmdb: fix: replace assert failures with RPMRC_FAIL returns. + - jbj: dbi: rework the error message to supply copious debug details. + - jbj: dbi: fix: --import as non-root assert failure. + - jbj: DB_CONFIG: fix: add mutex_set_max 8000. better scaling needed, todo++. + - jbj: beecrypt: permit --with-beecrypt=internal (w manual checkout/autogen) + - jbj: resurrect "make dist". + - jbj: i18n: update po files (Translation Project). + - jbj: tests: "make check" for RHEL6 beta passes. + - jbj: tests: fix: invoke check-files from in-tree w "make check". + - jbj: rpmfps: don't bother w file fingerprints for *.src.rpm installs. + - jbj: rpmbf: sanity checks on rpmbfParam(n,e) arguments. + - jbj: rpmvt: add header virtual table (no arrays/blobs yet). + - jbj: rpmvt: add rpmtags virtual table. + - jbj: rpmvt: permit column data types. + - jbj: rpmvt: resurrect Nixdb against db.sqlite ValidPaths(path). + - jbj: rpmvt: stub-in a loadable libsqldb.so module. + - jbj: rpmvt: stub-in a loadable libsql.so module. + - jbj: rpmvt: stub-in a loadable libsqlio.so module. + - jbj: rpmsql: rewire rpmvt/rpmvc objects so sqlite/mutexes interoperate. + - jbj: rpmsql: stub-in virtual table/cursor framework. + - jbj: tests: update check-sql tests. + - jbj: build: permit %post -p " OPTS ARGS" syntax. + - jbj: rpmsql: use rpmio for input. + - jbj: rpmsql: use rpm's multiline (i.e. esacped \n) fgets(3) instead. + - jbj: rpmsql: use rpmio for log/trace as well, manage output fd's the same. + - jbj: rpmsql: stub-in the other "%post -p " embedding. + - jbj: rpmsql: try to read ~/.sqliterc sanely. + - jbj: rpmsql: use rpmio for output, more refactoring. + - jbj: rpmsql: another rafactoring pass adding doxygen/splint markup. + - jbj: rpmsql: fix: always reload db ptr after lazy _rpmsqlOpenDB() calls. + - jbj: rpmsql: stub-in statistical aggregate functions. + - jbj: rpmsql: stub-in math.h functions. + - jbj: rpmsql: stub-in a set of string "slice-n-dice" functions. + - jbj: rpmsql: set the prompt(s) from basename(argv[0]). + - jbj: rpmsql: eliminate the shellstatic function, concatenatente instead. + - jbj: tests: stub-in a "make check-sql" target. + - jbj: rpmsql: stub-in an "expand" function tied to macro expansion. + - jbj: rpmsql: resurrect building --without-sqlite. + - jbj: sqlite: stub-in a framework for creating functions. + - jbj: sqlite: add a "sqlite3" executable linked against external -lsqlite. + - jbj: sqlite: INTERACTIVE chrome buffing to add helpful prompt nags. + - jbj: sqlite: haul out the construction scaffholding trash. + - jbj: sqlite: return the output as the macro expansion value. + - jbj: dbsql: incremental step toward the desired rpmsql object API. + - jbj: rpmsql: add rc checking for sqlite3_foo() calls (a la rpmrepo.c). + - jbj: dbsql: disembowel tools/dbsql.c and push the offal into rpmsql.c. + - jbj: dbsql: send spewage to stdout or append to an iob, as needed. + - jbj: dbsql: move popt tables into -lrpmo for use by rpmsql ctor. + - jbj: dbsql: refatoring to get an rpmsql object passed on callbacks. + - jbj: dbsql: use popt for CLI processing. + - jbj: swipe sql/sqlite/src/shell.c -> tools/dbsql.c, prep for popt surgery. + - jbj: sqlite: stub-in an sqlite3 embedding. + - jbj: dbtool: include db_log_verify too. + - jbj: rpmdb: handle the db_sql -> db_sql_codegen renaming in 5.0.21. + - jbj: rpmdb: remove db-3.x.y, add db-5.0.21, changes. + - jbj: nix: stub-in rpmnix{Env,Hash,Instantiate,Store,Worker} noop methods. + - jbj: nix: refactor xiu-hash/xiu-instantiate/xiu-store popt tables. + - jbj: nix: use the refactored popt tables in -lrpmio. + - jbj: nix: stub-in the '%{nix foo ...:}' macro expansion embedding. + - jbj: nix: handle both "nix-foo" and "nix foo" invocations in rpmnix ctor. + - jbj: nix: refactor popt tables into -lrpmio. + - jbj: nix: avoid deadlock, live with a leak, for rpmnix object. todo++. + - jbj: ispras: stub in macro configuration attaching automated ISPRAS tests. + - jbj: fix: don't display usage with "rpm -v", it clutters --eval output. + - jbj: rpmdav: fix: rename url -> u using --without-neon. (John Thomson). + - jbj: nix: add --xiu:stdenv query format template. + - jbj: nix: add --nix:meta query format template. + - proyvind: add rubygem(...) extractors from mandriva. + - jbj: qf: add --wdj:srpm query format template. + - jbj: add api-sanity-autotest.pl (GPL->LGPLv2 expected on next release). + - jbj: _RequestPass: convert assert to returning "" if no password. + - jbj: mireRegexec: return -1 error instead of segfault when mis-used. + - jbj: argv: use stricter RPMstr_t/RPMint_t types instead of void *. + - devzero2000: add an rpm-arg-max-doc.spec toy test spec in tests + - proyvind: python: make sure that we always use our own rpm build and + macros. + - proyvind: filetriggers: don't pass filename as argument to scripts, + (all) filenames are passed through stdin already. + - rpm.org: swipe Tarjan's loopy scissors for hacking. + - jbj: rpmts: add pluggable check/order/run method vectors. + - jbj: hkp: add keys.rpm5.org as the default pubkey server. + - jbj: fix: split NV iff V starts with digit string in lookupPackage(). + - jbj: fix: remove the inheirited %description before adding explicitly. + - jbj: use a Bloom filter so that build sanity checks scale. + - jbj: fix rpmInstallSourcePackage() refcnts and memory leaks. + - jbj: fix: don't segfault on --rebuild. the better fix is to eliminate + rpmInstallSourcePackage() entirely, todo++. + - jbj: rpmio: teach rpmGetPath() to append explicit pesky trailing '/'. + - jbj: hrmib: fix: add lazy Mkdir to instantiate in chroot's. + - jbj: begin to finalize upgrade fingerprint handling. + - jbj: satsify Requires: / internally & always, SuSE doesn't package "/". + - jbj: change rpmlib(PayloadIsLzma) version from 4.4.6 -> 4.4.2 a la SuSE. + - jbj: rpmts: refactor rpmtsRun() into smaller routines a la rpm.org. + - bero: rpm4compat.h: Adjust to changes in the rest of rpm5 + - jbj: rpmdb: refactor dbiSync as internal per-table, eliminate rpmdbSync. + - jbj: rpmbf: fix: return -1 error on NULL pointers. + - jbj: gpsee: finish refactoring gsr -> rpmjs.c. + - jbj: gpsee: more refactoring gsr -> rpmjs.c. + - jbj: poptIO: add _rpmio_posix_context_flags before adding arg everywhere. + - jbj: gpsee: bury the JS interpreter popt table in -lrpmio. + - jbj: reserve (1<<31) in all embedded interpreters to mark global. + - jbj: gpsee: remove the --without-gpsee JS interpreter. + - jbj: gpsee: use gpsee_{create,destroy}Interpreter() throughout RPM. + - jbj: gpsee: convert the rest of the modules to use GPSEE module loading. + - jbj: gpsee: convert the first 12 modules to use GPSEE module loading. + - jbj: gpsee: install ~12 of the simpler and more standalone modules. + - jbj: gpsee: add GPSEE_MODULE_WRAP to all JS modules. + - jbj: gpsee: proof-of-concept for rpmbf module loading. + - jbj: js: fix: external JS still needs to build in internal js subdir. + - jbj: js: switch to linking external TraceMonkey (from GPSEE). + - jbj: js: switch to linking external GPSEE (with added panic routine). + - jbj: js: stub in sufficient AutoFu to build --with-gpsee=internal. + - jbj: js: prepare to use GPSEE as embedded JS interpreter. + - jbj: js: switch print method to use JS_FN (Fast Native) w/o a stack frame. + - jbj: js: allow --with-js=/usr/lib:/usr/include/js w external TraceMonkey. + - jbj: rpmdb: sync DB_CONFIG.in with what "make check" is using. + - jbj: js: guesstimate a set of modules that might be portable/functional. + - jbj: fts: fully initialize FTSENT (for JS use). + - jbj: js: don't bother doing rpmts check/order/run if no elements. + - jbj: rpmdb: fix: ensure that rpmdb pool allocations are set to zero. + - jbj: tests: add a check-sign target w DSA/RSA coverage. + - jbj: sign: fix: add a killref to plug a header memory leak. + - jbj: tests: add a check-ACID target w db_tool coverage tests. + - jbj: rpmdb: fix: reduce the scope of db->db_h caching optimization + (multiple headerLoad's are avoided) so that non-existent secondary + indices can be lazily rebuilt as needed. + - afb: JS: use libjs 1.7.0 on FreeBSD. + - jbj: tests: configure an rpmdb using DB_CONFIG with reasonable tuning. + - jbj: add --with-db-sql. + - jbj: permit building with db-4.7.25. + - jbj: rpmfi: add a getter for _fnbf; + - jbj: xar: rescuscitate --with-xar=external (using xar-1.5.2). + - jbj: bash: rescuscitate --with-bash=internal. + - jbj: tests: add genpgp.sh/tpgp test(s) for DSA/RSA clearsigned plaintext. + - jbj: lua: install executables and library. + - jbj: perl: change --macros to point to ../macros/macros now. + - jbj: verify: fix: no parent txn running %verifyscript/%sanitycheck. + - jbj: rpmfi: fix: memory leak running %pretrans. + - jbj: rpmdb: fix: add proper rc for RPMTAG_FILEPATHS w no files. + - jbj: augtool: add error checking. + - jbj: augeas: fix: aug_match no longer returns matches with argv sentinel. + - jbj: js: fix: sort out module <-> library targets. + - jbj: js: fix: make dependencies prevented "make distcheck". + - jbj: ruby: rescusitate. + - jbj: i18n: update po files (Translation Project). + - jbj: i18n: update POTFILES.in. + - jbj: js: fix: give print() a "" return value instead of JSVAL_VOID. + - jbj: cli: fix: --eval could access before beginning of array. + - jbj: ficl: resurrect as --with-ficl=internal. external is wonky w no *.la. + - jbj: perl: rescuscitate embedding (w /etc/ld.so.conf.d/perl.conf assist). + - jbj: js: build jscpucfg/jskwgen helpers w/o libtool assistance. + - jbj: lua: build bin2c helper w/o libtool assistance. + - jbj: rc: rescusictate. + - jbj: macros: add a few more rpm-peculier execuctables. + - jbj: mtree: avoid mtime.tv_usecs differences for now. + - jbj: pubkeys: fix: all headers, including pubkeys, need PACKAGECOLOR. + - jbj: pubkeys: fix: rpmdbAdd() needs to be transactionally protected. + - jbj: cudf: fiddle up some methods for cudftool-equiv in JS. + - jbj: cudf: move rpmcudp/rpmcudv typedef's and structures into rpmcudf.h. + - jbj: cudf: add JS methods and some silly unit tests. + - jbj: cudf: build & install cudftool iff --with-cudf AutoFu. + - jbj: cudf: move cudftool innards to -lrpmio. silly methods atm, todo++. + - jbj: cudf: stub-in cudftool with -lcudf AutoFu. + - jbj: change sonames to 5.3. + - jbj: rpmbf: estimate optimal {m,k} parameters given {n,e}. + - jbj: mire: fix: use strncmp, rpmdb string keys are not NUL terminated. + - rpm.org: port addFingerprints. + - rpm.org: port a copy of fpLookupSubdir. + - jbj: rpmdb: Stub-in RPMDBI_REPACKAGES/RPMDBI_REPOSITORY stores. + - jbj: rpmdb: Eliminate RPMDBI_LABEL. Use RPMTAG_NVRA instead. + - jbj: rpmmi: Prepare for multiple primary stores w mi_index -> mi_primary. + - jbj: dbi: Prepare for multiple primary stores w dbi_index -> dbi_primary. + - jbj: dbi: Eliminate verify_on_close/noload/byteswapped coprolites. + - jbj: rpmdb: Permit patterns on (little used) secondary indices. + - jbj: rpmdb: Stub-in an event_notify callback. + - jbj: rpmdb: Wire up DB_RECOVER progress feedback callback. + - jbj: rpmlio: Register logio dispatch handler with db_recover. + - jbj: rpmdb: Switch to inplace rpmtsRebuildDB(), eliminate rpmdbRebuild(). + - jbj: rpmmi: Eliminate rpmmiSetHdrChk(), get ts out of the rpmdb layer. + - jbj: rpmdb: Eliminate signature/digest checks on rpmdb header blobs. + - jbj: rpmdb: swab integer secondary keys when retrieving through rpmmi. + - jbj: js: add rpmmi unit tests for common accesses including patterns. + - jbj: js: fix: add a newref for headers retrieved using rpmmi. + - jbj: rpmdb: use network order for all integer secondary keys. + - jbj: rpmdb: fold rpmdbMireApply into dbiMireKeys. + - jbj: rpmmi: optimize NVRA range queries using a *RE stem. + - jbj: rpmdb: inline rpmdbOpenAll for inplace --rebuilddb. sadly + DB->associate(..., DB_CREATE) is not free threaded w -fopenmp. oh well. + - jbj: rpmts: take checkpoints beroe and after --rebuilddb. + - jbj: rpmdb: do in-place rebuilddb, opt-in for now. + - jbj: rpmdb: lazily create non-existent secondary indices. + - jbj: rpmdb: consolidate primary key swabbing to network order. + - jbj: rpmdb: re-open dbenv w DB_RUNRECOVER rather than remove/verify. + - jbj: rpmdb: handle optional .A just like optional -V and -R patterns. + - jbj: rpmdb: use RPMTAG_NVRA patterns for RPMDBI_LABEL rpmmi iterators. + - jbj: rpmdb: permit anchored patterns on RPMDBI_LABEL retrieves. strings + are escaped and anchored. Still only RPMTAG_NAME, RPMTAG_NVRA next. + - jbj: perform checkpoint after every successful transaction. + - jbj: rpmtxn: expose rpmtxnCheckpoint. + - rpm.org: Only report disk space/inode issues for affected packages. + - jbj: rpmdb: mark code to renumber primary keys when needed. + - jbj: rpmmi: fix: return native endian, but store big endian, primary keys. + - jbj: DB_CONFIG: create /var/lib/rpm/tmp subdir. + - jbj: DB_CONFIG: move log files to /var/liog/rpm/log subdir. + - jbj: DB_CONFIG: configure set_lk_max_{locks,lockers,objects} to 4000. + - jbj: bspatch: use bzip2 through -lrpmio. + - jbj: rpmbz: expose sufficient methods to uncouple bspatch from bzip2. + - bero: Fix configure script for autoconf 2.65 without breaking 2.63 + - jbj: bsdiff: use bzip2 through -lrpmio. + - jbj: rpmbz: expose sufficient methods to uncouple bsdiff from bzip2. + - jbj: add bsdiff/bspatch from bsdiff-4.3. + - jbj: rpmlio: add "opt-in" enablers for syscall/scriptlet logging. + - jbj: rpmlio: add --rpmliodebug spewage valve. + - jbj: rpmlio: add syscall/scriplet logging to -lrpmdb API for rework. + - jbj: revert the change for autoconf-2.65, breaks w autoconf-2.63. + - devzero2000: complete changing db2offset data type to uint32_t everywhere + - bero: Fix generation of configure script with autoconf 2.65 + - jbj: rpmdb: don't recurse within dbiFindByLabel. + - jbj: rpmdb: use PCRE patterns on Name index for package queries. + - devzero2000: don't permit using b0rken configure option + - jbj: rpmdb: fix: ensure Seqno h# counter is initialized to 1 when created. + - proyvind: add %distepoch back to provideversion, leave legacy + compatibility for adopters to care about. + - devzero2000: fix hardwired docdir in rpmfc + - proyvind: fix assert fail with Mandriva filetriggers in case of + installing src.rpm with no triggers queue. (from David Smid/Unity Linux) + - jbj: rpmmi: rework iterator instance filtering as a Bloom filter. + - jbj: rpmdb: eliminate signature/digest checks on rpmdb Header blobs. + - jbj: rpmbf: permit non-string Bloom filters, s/char/void/ in prototypes. + - jbj: rpmdb: eliminate rpmdbFlags hysteria. + - jbj: rpmdb: use Seqno to assign Packages primary keys. + - jbj: rpmdb: save Packages primary key in network order always. + - jbj: rpmdb: eliminate --verifydb (except for rpmtsVerifyDB error stub). + - jbj: rpmdb: eliminate --initdb (except for rpmtsInitDB error stub). + - jbj: rpmdb: assign the primary key to installed headers persistently. + - jbj: rpmdb: use a Bloom filter not a bitmap to determine if header + signature/digest was checked. Header instances no longer need to + be small integers. + - jbj: rpmdb: begin phasing out RPMDBI_LABEL with patterns on keys. + - jbj: rpmdb: fix: resurrect queries with duplicate packages. happy yum ... + - jbj: rpmdb: remap rpmdbCount -> dbiCount, eliminate dbiIndexSet usage. + - jbj: rpmdb: fix: rpmmiCount() -> dbiCCount() with early dbcOpen(). + - jbj: rpmmi: eliminate mi->mi_filenum & rpmmiFilenum(), join keysi + are history. + - jbj: rpmmi: add mi->mi_count preparing to bulldoze struct _dbiIndexItem. + - jbj: rpmdb: eliminate --initdb and --verifydb, lazy creation and db_verify + are preferred. + - jbj: rpmdb: eliminate dead code associated with database indices. + - jbj: rpmdb: add assertions before always using secondary indices. + - jbj: rpmdb: change from a CDB to ACID database behahvior. + - jbj: rpmdb: eliminate the custom Basenames retrieval code. + - jbj: rpmdb: eliminate the Basenames index. + - jbj: rpmdb: abandon RPMTAG_BASENAMES lookup, use RPMTAG_FILEPATHS instead. + - jbj: rpmts: stub-in a grandparent transaction. + - jbj: poptDB: wire up --rpmtxndebug, collect other rpmdb debugging options. + - jbj: rpmte: stub-in a parent transaction. + - jbj: rpmtxn: add a parent transaction argument. + - jbj: rpmtxn: add abstract typedef and drill throughout the API. + - jbj: rpmtxn: expose the existing rpmtxn API for refactoring work. + - jbj/glen: strip possible chroot prefix from db opened paths in + Open(2) wrapper. LP#347749 + - jbj: dbi: tear out the rpmdb->db_rebuilding construction scaffholding. + DB->associate() cascaded callbacks to generate bulk secondary index key + stores are now functional with --rebuilddb. + - jbj: add uniqification filtering for argv/uint32_t/uint64_t secondary keys. + DB_DUPSORT can likely be free;y applied as a schema qualifier. + - jbj: dbi: add currently existing secondary key filtering and transforms + through the DB->associate() callback. + - jbj: dbi: Backout the PRCO EVR/F tables, the PRCO assertion tables won't need no + steenkin' joins. + - jbj: dbi: add tables for PRCO dependency assertions based on YAML spewage. + rude & crude but "works". + - jbj: rpmtag: make sure that he->tag contains the assigned tag numbers. + - jbj: rpmtag: assign numbers to the YAML PRCO tags to index assertions. + - jbj: rpmbf: pass string length where needed. + - jbj: dbi: commit to DB->associate() secondary indices as default + (w exceptions, todo++). + - jbj: dbi: commit to DB_DUP/DB_DUPSORT as default (w exceptions, todo++). + - jbj: dbi: commit to dbi->dbi_jlen == 4 as default (w exceptions, todo++). + - jbj: dbi: commit to DB_BTREE as default (w exceptions, todo++). + - jbj: dbi: permit tag tables to be secondary indices with dupes. + - devzero2000: add security CFLAGS for GCC if supported + - jbj: dbi: configure new indices with 4b join keys and duplicates. + - jbj: dbi: generate additional indices. + - jbj: dbi: add db->associate_foreign. + - devzero2000: add rpm-genenerate-loop-test-harness.sh + - devzero2000: add INSTALL.developer + - jbj: order: fix: check current package for files/dirs before other packages. + - jbj: order: fix: avoid self-looping for man-pages (and pkgs w no requires) + - jbj: rpmdb: use DB_CONFIG. + - jbj: rpmdb: install DB_CONFIG if not already present. + - jbj: rpmdb: revert the DBENV->set_data_dir() attempt when re-opening. Not + the right fix, and spews an error on 4.8.24 with lazy opens in chroot. + - jbj: rpmdb: stub-in DB_CONFIG.in (no parameters and uninstalled for now). + - jbj: upgrade to db-4.8.24. + - jbj: spook: install spooktool next to semodule. + - jbj: spook: embed the "spook" DSL just like augeas (nee "augtool"). + - jbj: augeas: change the DSL embedding syntax from "augtool" to "augeas". + - jbj: haul out some trash. + - jbj: augtool: morph the rpmioC command table to popt. + - jbj: spooktool: morph the rpmioC command table to popt. + - jbj: add spooktool (i.e. semodule with an augtool-like interpreter). + - jbj: rpmsm: ensure pool memory is initialized correctly. + - jbj: rpmaug: use the rpmio parser. + - jbj: rpmio: expose the toy parser and command table used by augtool. + - jbj: retrofit getline for augtool to build more portably. + - jbj: retrofit asprintf for augtool to build more portably. + - jbj: AutoFu for -lreadline to be included in spooktool(8). + - jbj: rpmsm: stub-in a state machine for handling policy operations lazily. + - jbj: rpmsm: add RPMSM_FLAGS_CONNECT for Tresys dain bramaged patches. + - jbj: rpmsm: use an iob to return spewage. + - jbj: rpmsm: permit *RE's with -l,--list command. hmmm, semodule todo++. + - jbj: rpmsm: return "N-V" as moudular policy identifier string. + - jbj: rpmsm: drill a string result pointer into semodule methods. + - jbj: add semodule helper. + - jbj: rpmsm: add rpmsmRun() method for semodule. + - jbj: rpmsp: open and load a policydb from a file. + - jbj: js: stub-in Sm/Sp classes for rpmsm/rpmsp objects. + - jbj: stub-in a wrapper for -lsepol methods. + - jbj: use RPM_CHECK_LIB() to detect -lsepol. + - jbj: rpmsm: add creator/destructor methods to populate the wrapper. + - jbj: stub-in a wrapper for -lsemanage methods. + - jbj: use RPM_CHECK_LIB() to detect -lsemanage. + - jbj: use RPM_CHECK_LIB() to detect -lselinux. + - jbj: retrofit TIMFOO_TO_TIMEBAR macros for the truly deprived. + - jbj: retrofit *BSD st_[acm]timespec names if possible. + - jbj: use HAVE_STRUCT_STAT_ST_BIRTHTIME, retrofit st_ctime for the deprived. + - jbj: use the AutoFu. + - jbj: system: add AutoFu for S_ISTXT <-> S_ISVTX *shrug*. + - jbj: use the new rpmio wrappers. + - jbj: rpmio: add Lchmod/Chflags/Lchflags/Fchflags wrappers. + - jbj: permit HMAC's to be substituted for digests in *.rpm. + - jbj: reserve a bit to mark file HMAC's. + - jbj: rpmdigest: add --fips140 to verify Fedorable HMAC's. + - jbj: rpmio: add fdInitHmac()/rpmHmacInit() methods for HMAC generation. + - jbj: rpmio: stub-in the data elements needed for keyed hashes. + - jbj: rpmio: fix: unbreak --alldigests. + - jbj: rpmio: factor digest insturmentation out of loops for --stats. + - jbj: attach buildids to file provides in header metadata. + - jbj: fix: ensure new ordering queue additions follow older using a + generation counter. + - jbj: macros: split rpmbuild macros into /usr/lib/rpm/macros.rpmbuild. + - jbj: macros: automagic dependency extractors are now per-interpreter. + - jbj: macros: refactor perl/php/python peculier config into separate file. + - jbj: macros: expand %{load:...} immediiately/recursively when loading. + - jbj: macros: gather "default" config into macros/ dir for refactoring. + - proyvind: rpmevr: make rpmEVRparse() work with missing values. + - proyvind: rpm46compat: Implement RPM 4.6 API wrapper providing ~seamless + API compatibility for the function wrappers provided. :) + - proyvind: python: start on implementing proper regression tests. + - proyvind: js: fix internal build on Linux. + - proyvind: filetriggers: fix missing file suffix for scripts. (from unity linux). + - proyvind: rpm4compat: add wrappers for renamed rpmdb*->rpmmi* functions. + - proyvind: python: add te.D() to return element distepoch. + - jbj: blake: validate 224/256 reference blake against 8bit 0x00. + - proyvind: python: handle None values in labelCompare() again. + - proyvind: python: handle DISTEPOCH in labelCompare(). + - jbj: rpmdigest: add ECHO 224/256/384/512. + - jbj: rpmdigest: add FUGUE 224/256/384/512. + - jbj: rpmdigest: add SHAVITE3 224/256/384/512. + - jbj: rpmdigest: add LANE 224/256/384/512. + - jbj: rpmdigest: add HAMSI 224/256/384/512. + - jbj: rpmdigest: add GROESTL 224/256/384/512. + - jbj: rpmdigest: add JH 224/256/384/512. + - jbj: rpmdigest: add CHI 224/256/384/512. + - jbj: rpmdigest: add LUFFA 224/256/384/512. + - jbj: rpmdigest: add ARIRANG 224/256/384/512 (all test vectors fail, todo++). + - jbj: rpmdigest: add SIMD 224/256/384/512 (ShortMsgKAT_384.txt is nonsense). + - jbj: rpmdigest: add TIB3 224/256/384/512. + - jbj: rpmdigest: add Blake 224/256/384/512 (224/256 fail test vectors, todo++). + - jbj: rpmdigest: add Shabal 224/256/384/512. + - jbj: rpmdigest: add BlueMidnightWish 224/256/384/512. + - jbj: keccak: optimizations for 32/64 bit merged. + - jbj: md6: set rounds/parallel passes parameters from ctx->flags. + - jbj: cubehash: set rounds/blockbytes parameters from ctx->flags. + - jbj: cubehash: optimize with -msse2. + - jbj: rpmdigest: use md6sum, not NIST, for MD6 test vectors. + - jbj: rpmdigest: re-assign digest algo numbers, handle 224/256/384/512/1024 + parameters within the digest algo name. + - jbj: rpmdigest: add md6 224/256/384/512 (tests failing atm, todo++). + - jbj: rpmdigest: add cubehash 224/256/384/512. + - jbj: rpmdigest: add keccak 224/256/384/512. + - jbj: rpmdigest: add edon-r 224/256/384/512. + - rpm.org: don't segfault with empty --qf '[]lala' iterator. + - jbj: rpmdigest: add skein 256/512/1024. + - jbj: rpmio: eliminate md4, use beecrypt-4.2.0 instead. + - jbj: rpmsx: wrap getfilecon/lgetfilecon. + - jbj: rpmsx: add persistent/lazy matchpathcon_{init,free}. + - jbj: rpmsx: refactor the existing SELinux implementation. + - jbj: python: fix: missing changelog in repo-md can segfault (David Smid). + - jbj: rpmdav: oops, WebDAV is different code path, revert some changes. + - jbj: rpmdav: compute st_nlink correctly for plain HTTP dirs. + - jbj: rpmavx: fix: alloc an extra byte for pesky trailing '/'. + - jbj: rpmdav: fix: refill/restart if forward parse runs out of data. + - jbj: rpmhtml: fix: ... and don't forget to reinitialize all fields. + - jbj: yarn: convert rpmhtml to usage mutex with refcounts. + - rse: fix building under RPM_VENDOR_OPENPKG/switch-from-susr-to-musr-on-srpm-install + - jbj: rpmio: fix: compute url length in rpmGenPath() w/o using pointers. + - jbj: yarn: convert rpmavx to usage mutex with refcounts. + - jbj: rename avContext to rpmavx. + - jbj: rpmio: functional dir stream positioning. + - jbj: rpmpgp: elimate msg argument, use __FUNCTION__ everywhere instead. + - jbj: rpmio: eliminate sha224 and ripemd*, use beecrypt-4.2.0 instead. + - jbj: rpmio: refactor dir stream handling from HTTP/DAV transport. + - jbj: rpmio: add DIR stream positioning wrappers. + - jbj: rpmio: add rpmdir.[ch] to refactor DIR handling routines. + - jbj: rpmbf: add union/intersect of filters. + - jbj: rpmfc: reduce the amount of debugging noise with lots of files. + - jbj: rpmbf: use lookup3.c hash pairs with k linear combinations. + - jbj: rpmbf: stub-in a Bloom filter. + - jbj: selinux: fix: disabler bit toggle sense was inverted. + - jbj: js: add getters/setters to handle defvar() variables. + - jbj: js: add methods and unit tests for the Aug class. + - jbj: augtool: finish proof-of-concept embedding. stdout capture todo++. + - devzero2000: macros.in: add _datarootdir e _lispdir for GNU standard + - jbj: augtool: capture stdout in aut->iob, return through rpmaugRun(). + - jbj: debugedit: handle DWARF-3 changes (#505774). + - jbj: augtool: use rpmaug globals where useful. + - jbj: rpmaug: add rpmaugPoptTable and global parameters. + - jbj: rpmaug: add global augtool interpreter. + - jbj: argv: add a separator character argument to argvJoin. + - jbj: augeas: add "no brainer" rpmaug wrappings onto augeas methods. + - jbj: rpmbuild: fix: ensure dependency EVR strings have only 0 or 1 dashes. + - jbj: augeas: add aug_init() and aug_close() calls to the rpmaug wrapper. + - jbj: js: stub-in a Aug class. + - jbj: augeas: stub-in rpmaug object with ctors/dtors. + - jbj: augeas: add AutoFu to find augeas libraries. + - jbj: js: stub-in requires/loadModule global methods. + - jbj: js: save the rpmjs interpreter pointer in rt private data. + - jbj: add the Fedorable tag(s) for file digests. + - jbj: reserve ~1K in RPMSIGTAG_PADDING for now. + - jbj: squirrel: capture stdout in an iob. + - jbj: squirrel: add --with-squirrel for embedding squirrel. + - jbj: rpmgi: remove duplicated code. + - jbj: header: add getter/setter for header parent. + - jbj: add RPMSIGTAG_PADDING to force metadata header alignment in file. + - jbj: save %pre/%post scriptlet's exit code and duration. + - jbj: add header to rpmdb after, not before, %post is run. + - jbj: replace freeSpec/freePackage with defines, eliminate symbols in ABI. + - rse: upgrade build environment to GNU automake 1.11 and GNU m4 1.4.13 + - jbj: performance tweaks. + - jbj: change default dep whiteout to ensure filessystem before setup. + - jbj: prepare to save install scriptlet states/metrics. + - jbj: build: add build scriptlet status/duration to SRPM headers. + - jbj: build: use rpmsqExecve to run build scriptlets. + - jbj: build: tear down _pkgPool/_specPool before exiting. + - jbj: rpmsw: add an output FILE * argument. + - jbj: build: put a stopwatch on build scriptlets. + - jbj: rpmio: wrap posix_fallocate(3) / fallocate(2) (for rpmdb creation). + - jbj: eliminate useless rebuilddb legacy "sanity check" hysteria. + - jbj: display rebuilddb progress using ps(1) and top(1). + - jbj: mark rebuilddb legacy hysteria for destruction. + - jbj: add RPMTAG_SHA1HEADER to rpmdb pubkeys. + - jbj: remove first (of 3) rpm-5.2.0 release process be-bugging flaws. + - jbj: fix: resuscitate --nodigest/--nosignature w --rebuilddb. + - jbj: pick-up some orphan check-ins. + - jbj: header: remove (unused) headerUsageCount. + - jbj: header: fix: re-initialize headers from pool more carefully. + - jbj: rpmps: fix: remove the hack-o-round, handle rpmps like other pools. + - jbj: yarn: convert dbiIndex to usage mutex with refcounts. + - jbj: yarn: convert Package to usage mutex with refcounts. + - jbj: yarn: convert Spec to usage mutex with refcounts. + - jbj: yarn: convert DIGEST_CTX to usage mutex with refcounts. + - jbj: eliminate (unused) DB_DBT_MALLOC flag while loading rpmdb headers. + - jbj: bump sonames to libfoo-5.2. + - jbj: rpmmi: rename the other methods for the match iterator object. + - proyvind: make it possible to set macro files to load predefines from by + defining PREMACROFILES at build time. + - jbj: rpmmi: rename the typedef and rpmmi{Init,Next,Free} methods. + - jbj: rpmmi: split out a pool destructor (prior to using). + - jbj: mire: handle items from _mirePool like all other pools. + - bero: adjust find-debuginfo.sh to new location of debugedit + - jbj: rpmds: dereference/flush global items earlier, before pool teardown. + - jbj: rpmds: use _rpmdsPool, not heap, for rpmdsThis/rpmdsSingle as well. + - jbj: rpmds: fix: rpmdsThis/rpmdsSingle assume ds->i = 0 + (i.e. actively iterating). + - jbj: inline rpmlog() to avoid arglist overhead when -O2 is used. + - jbj: add --with-valgrind homeopathy to measure existing RPM + insturmentation effects on performance. + - jbj: don't reset to -O0 with --enable-build-debug and GCC. + - proyvind: rpmsyck: clean up, use rpmioPool and add destructor. + - proyvind: rpmhash: add htGetKeys() for retrieving the keys of the hash table. + - jbj: bash: wire-up internal bash build with RPM AutoFu. + - jbj: rc: toss the n00b embedding into the -lrpmmisc kitchen sink. + - jbj: grep: fix: don't segfault if no usage mutex or pool attached. + - proyvind: remove %distepoch from %provideversion as it will break + compatibility with rpm <= 4.5. + - proyvind: rpm4compat: add a wrapper function for headerFormat(). + - rse: align semantics of Lua function rpm.hostname() with the C API function buildHost() + +============================================================================= + +5.2a4 -> 5.2b1: + [...] + - proyvind: cpuinfo: move out cpuinfo feature dependencies to YAML. + - proyvind: rpmsyck: first shot at YAML parser in pure C. + - proyvind: get rid of parallel %___NVRDA macro, just merge it with %___NVRA in stead. + - jbj: add RPMSENSE_RPMLIB to new tracking dependencies. at least its + consistent even if useless. + - jbj: fix: rpmdsMerge() shouldn't leave a result that seems to have + active iteration in progress. There are side effects from macro + expanding {N,EVR} that aren't correct. + - proyvind: cpuinfo: change name of '%_prefer_buildarchs' macro to '%_prefer_target_cpu'. + - proyvind: cpuinfo: change delimiter for %_prefer_buildarchs from ':' to ' '. + - jbj: js: add AutoFu to build --with-js=internal. + - jbj: ruby: fix: global interpreter with contained object refcnts needs + early cleanup in rpmcliFini(), not in rpmioClean(). + - proyvind: cpuinfo: allow to enable from configure again since it's usable + now. (although still room for improvements...) + - jbj: ruby: stub-in the minimal necessary AutoFu to attempt ruby bindings. + - jbj: add AutoFu to detect fallocate(2) and posix_fallocate(3). + - jbj: js: add rpmMCExpand() for per-context macro expansion. + - jbj: yarn: convert rpmdbMatchIterator to usage mutex with refcounts. + - jbj: js: fix: global interpreter with contained object refcnts needs + early cleanup in rpmcliFini(), not in rpmioClean(). + - jbj: rpmio: re-enable the memory leak warning with included explanation. + - jbj: js: stub-in a rpmts class. + - jbj: js: start js module for RPM objects. + - jbj: js: wire up the File class. + - jbj: js: replace NSPR with rpmio in the File class. + - jbj: js: stub in the File class before ripping NSPR (SpiderMonkey). + - jbj: js: add toy uuid.{generate,describe} object and methods. + - jbj: js: add version/options/load methods (SpiderMonkey). + - jbj: js: add an "environment" object (SpiderMonkey). + - jbj: js: add a "arguments" array (SpiderMonkey). + - jbj: js: add a print method (swiped from SpiderMonkey js shell). + - rse: RPM_VENDOR_OPENPKG: stick with local RPM sanity checking for reasonable warning messages + - jbj: js: simplify the embedding to the JSAPI examples, not the js shell. + - jbj: ficl: capture stdout from ficl vm. + - jbj: ficl: wire-up %post -p . + - jbj: ficl: wire-up %{ficl:...}. capturing stdout todo++ ... + - jbj: ficl: add a FICL interpreter wrapper. + - jbj: js: wire-up %post -p . much more todo++. + - jbj: js: wire-up %{js:...}. much more todo++. + - jbj: js: stub-in a javascript interpreter wrapper. + - jbj: tcl: load and use $argv and $argc. + - jbj: tcl: fix: don't append multiple newlines. + - jbj: perl: load and use @ARGV. Note that shell $1 ends up in perl $ARGV[0] + - jbj: ruby: load and use ARGV. Note that shell $1 ends up in ruby ARGV[0]. + - jbj: python: load and use sys.argv. + - jbj: ruby: finish converting to WITH_RUBYEMBED. + - jbj: use poptParseArgvString, not argvSplit, for shell arg escaping. + - jbj: rework the embedded interpreter API's preparing to handle args. + - jbj: permit args in PHP like %{python a b c:...} syntax. + - jbj: map NULL interp to lazily instantiated globally persistent instance. + - rse: RPM_CHECK_LIB: correctly handle library names like "libpython2.6" and "libdb-4.7" + - rse: place XZ code under WITH_XZ (RPM_CHECK_LIB based) instead of HAVE_LZMA_H (standard Autoconf header check) + - rse: place BZip2 code under WITH_BZIP2 (RPM_CHECK_LIB based) instead of HAVE_BZLIB_H (standard Autoconf header check) + - rse: RPM_CHECK_LIB: support --with-=system to enable a library but control detection via flags only + - rse: let Lua's lregex_lposix to build against PCRE POSIX out of the box + - jbj: inject $1/$2 into embedded tcl/perl/python/ruby interpreter contexts. + - jbj: perl: add use RPM; so that perl bindings are available. + +5.2a3 -> 5.2a4: + - rse: fix building without BZip2 + - rse: fix release tarball rolling after recent addition of local copies of XZ, PCRE and Syck + - rse: forward port all build infrastructure fixes from RPM 5.1 + - rse: eliminate compile-time warnings introduced with recent embedded language support + - afb: rename --with-ruby to --with-rubyembed, to match Perl/Python. + - jbj: perl: attach stdout to macro expansion buffer with IO::String. + - rse: use new POPT 1.15 from devtool environment + - jbj: tcl: attach rpmtclIO to macro expansion buffer with Tcl_StackChannel. + - jbj: ruby: attach $stdout to macro expansion buffer using StringIO. + - jbj: python: attach sys.stdout to macro expansion buffer using cStringIO. + - jbj: tpython: permit interactive shells. + - jbj: fix: permit rpmiobSlurp() to be used on stdin. + - jbj: lua: revert -E /path/to/file.lua wrapping. + - jbj: popt: remove retrofits for popt < 1.14. use popt internal if needed. + - jbj: ruby: wire-up %post -p . arg1/arg2, persistent interp, todo++. + - jbj: ruby: wire-up %{ruby:...}. the string result is bogus, todo++. + - jbj: ruby: add --with-ruby for embedding ruby. + - jbj: yarn: convert rpmluav to usage mutex with refcounts + - jbj: yarn: convert rpmlua to usage mutex with refcounts + - jbj: python: wire-up %post -p . arg1/arg2, persistent interp, todo++. + - jbj: python: wire-up %{python:...}. the string result is bogus, todo++. + - jbj: python: add --with-pythonembed for embedding python. + - jbj: perl: wire-up %post -p . arg1/arg2, persistent interp, todo++. + - jbj: perl: wire-up %{perl:...} with a string result. + - jbj: perl: add --with-perlembed for embedding perl. + - jbj: tcl: wire-up %post -p . arg1/arg2, persistent interp, todo++. + - jbj: tcl: wire-up %{tcl:...} with a string result. + - jbj: tcl: add --with-tcl for embedding tcl. + - jbj: mire: teardown for platpat on exit needs to be done in order. + - jbj: rpmwget: move to tools. + - jbj: wire-up RPMTAG_FILEDIGESTALGO. wotta waste to pretend "compatible" ... + - jbj: yaml: add build scriptlet tags for --yaml/--xml display. + - jbj: yaml: permit --without-syck, add some mac os x AutoFu/gcc fiddle-ups. + - jbj: yaml: add lsyck lua module to parse YAML. + - jbj: yaml: mix syck into the misc melange ... + - jbj: misc: get rid of splitFoo prototypes, bury the last use in rpmfi.c. + - jbj: PCRE in -lrpmmisc, LUA in -lrpmio linking -lrpmmisc, instead. + - jbj: fix: --noscripts/--nofdigests/--nocontexts need to use popt callback. + - jbj: rpmiob: fix: return iob to _rpmiobPool instead. + - jbj: yarn: convert mire to usage mutex with refcounts + (unifying array <-> element mutexes by copying use/pool + pointers throughout the array). + - jbj: rpmku: rework rpmiob handling to avoid extra malloc's. + - jbj: rpmiob: fix: add a newref in rpmiobNew. + - jbj: yarn: convert rpmiob to usage mutex with refcounts. + - rse: add RPM Lua function rpm.hostname() + - jbj: fix: handle ./../foo paths correctly (#491388). + - jbj: rpmlib: rescusitate splint annotations. + - jbj: rpmdb: rescusitate splint annotations. + - jbj: rpmtsOrder: fully enable parentdir deps when ordering. + - jbj: EVRtuple: fix: dig out the one time mire allocation leak. + - jbj: use rpmioFreePoolItem for rpmds, eliminate rpmdsFree. + - jbj: finish up using rpmioFreePoolItem() for rpmts and Header objects. + - devzero2000: continuing for refcount rewrite : add define of fooFree to rpmioFreePoolItem + - devzero2000: begin change programming style for refcount : rpmtsFree and headerFree + - jbj: rpmio: rescusitate splint annotations. + - jbj: getdate: ignore internalState changes. + - jbj: poptIO: add --htdebug. + - jbj: yarn: convert rpmfc to usage mutex with refcounts. + - jbj: yarn: convert hashTable to usage mutex with refcounts. + - jbj: yarn: convert rpmmg to usage mutex with refcounts. + - jbj: yarn: convert rpmwf refcount to usage mutex. + - jbj: rpmdb: don't bother with the silly structure assignment initialize. + - jbj: yarn: wire up rpmdsFini, mark rpmdsFree for destruction. + - jbj: yarn: wire up rpmtsFini, mark rpmtsFree for destruction. + - jbj: yarn: for now, don't assert fail, just print FIXME. + - jbj: yarn: wire up headerScrub, eliminate header{Link,Unlink}. + - devzero2000: fix: add autofu AC_CPP_FUNC portability macro in the acinclude.m4 + - devzero2000: add autofu AC_CPP_FUNC portability macro + - jbj: yarn: wire up rpmteFini, eliminate rpmteFree. + - jbj: yarn: wire up rpmsxFini, eliminate rpmsxFree. + - jbj: yarn: wire up rpmfiFini, eliminate rpmfiFree. + - jbj: yarn: wire up rpmgiFini, eliminate rpmgiFree. + - jbj: rpmtsi: use __FUNCTION__ rather than adding a 2nd arg everywhere. + - jbj: pgpDig: fix: rpmioFreePoolItem() can return non-NULL, clear ts->dig. + - jbj: rpmio: add --pgpdebug for pgpDig debugging. + - jbj: yarn: wire up rpmtsiFini, eliminate rpmtsiFree. + - jbj: yarn: wire up rpmpsmFini, eliminate rpmpsmFree. + - jbj: yarn: wire up rpmxarFini, eliminate rpmxarFree. + - jbj: yarn: wire up pgpDigFini, eliminate pgpDigFree. + - jbj: yarn: wire up urlFini, eliminate XurlFree. + - jbj: yarn: wire up fdFini, eliminate XfdFree. + - jbj: url: fix: u->use clobbers the lock from the pool. + - jbj: rpmds: fix: rpmdsDup needs to go through rpmdsGetPool() too. + - jbj: yarn: move rpmioItem to + - jbj: yarn: use void * use, not yarnLock use, to hide the details. + - jbj: yarn: wrap use/pool into a per-object "struct rpmioItem_s _item". + - jbj: yarn: stub in (*init)() and (*fini)() pool item methods. + - jbj: yarn: add a (*dbg)() formatter to make fdLink() generic. + - jbj: yarn: stub-in rpmmi pool handling under NOTYET. + - jbj: QNX: avoid conflicting db defines for __mutex_lock/__mutex_unlock. + - jbj: yarn: convert rpmdb refcount to usage mutex. + - jbj: yarn: convert psm refcount to usage mutex. + - jbj: yarn: convert rpmxar refcount to usage mutex. + - jbj: yarn: convert pgpDig refcount to usage mutex (avoid recurse deadlock). + - jbj: yarn: convert rpmts refcount to usage mutex (avoid recurse deadlock). + - jbj: rpmps: fix: avoid reusing items from pool for now. + - proyvind: libcpuinfo may now return 64bit feature only if PER_LINUX_32BIT + personality isn't set, so don't check un.machine anymore. + - jbj: yarn: convert rpmtsi refcount to usage mutex. + - jbj: yarn: convert rpmsx refcount to usage mutex. + - jbj: yarn: convert rpmps refcount to usage mutex. + - jbj: rpmds: fix: avoid pooling rpmdsThis/rpmdsSingle for now ... + - jbj: headerReload: fix: don't free the header blob. + - jbj: yarn: convert rpmte to a usage mutex (no refcounts). + - jbj: yarn: convert rpmgi refcount to usage mutex. + - jbj: yarn: use the pool changes where possible. + - jbj: yarn: add generic Link/Unlink refcount diddlers. + - jbj: yarn: add debugging, reuse counter, and zlog to rpmioPool. + - jbj: yarn: trick up a __FILE__:__LINE__ from caller when failing too. + - jbj: yarn: use EINVAL, not -1, for --without-pthreads portability. + - jbj: yarn: glibc pthreads (at least) returns errno's, strrerror decodes. + - jbj: yarn: fix: assert fail instead of exit on error. + - jbj: yarn: use the pool allocator. + - jbj: yarn: add a pool allocator. + - devzero2000: add mkdtemp portability function to -lrpmmisc + - proyvind: do lazy mkdir of %_builddir, %_rpmdir & %_srcrpmdir when doing + --install for src.rpms as well. + - jbj: yarn: convert Header refcount to usage mutex. + - jbj: zlog: rework trace log with a refcount mutex instead. + - proyvind: do lazy mkdir of %_topdir, %_builddir, %_rpmdir & %_srcrpmdir + when doing '--rebuild' so that it should mostly work easily for user. + - proyvind: make it possible to set preferred build architectures when using + libcpuinfo with ie. '%_prefer_buildarchs x86_64:i686:i586'. + - proyvind: get the list of compatible archs printed with '--showrc' from + mire platform patterns. + - proyvind: use cpuinfo() probe for detecting platform rather than + libcpuinfo directly. + - jbj: delete ancient header+payload RSA signatures too using GPG (#488953). + - jbj: rpmio: install rpmzlog.h and yarn.h, carry with rpmio.h. + - jbj: rpmio: don't include glob.h. + - devzero2000: fix --orphandirs port alias ; add --danglinglink popt alias + - proyvind: add support for cpuinfo() probe through libcpuinfo. + - proyvind: perl: make sure to link against all required libraries to fix + build with --no-undefined. + - proyvind: only provide PayLoadIsLzma and PayLoadIsXz features when enabled. + - proyvind: xzdio: kill backwards compatibility with ancient lzma utils. + - proyvind: fix order of archs added throuh libcpuinfo so that + rpmPlatformScore() will return correct value. + +5.2a2 -> 5.2a3: + - rse: use Pthreads under --with-pthreads controlled WITH_PTHREADS and not existance-derived HAVE_PTHREADS_H + - jbj: update po files (Translation Project). + - jbj: yarn: lobotomize yarn.c conditioned on HAVE_PTHREAD_H. + - jbj: rpmz: toss the pbzip2 carcass into the compression cassoulet ... + - rse: upgrade devtool environment to: GNU m4 1.4.12, Perl 5.10.0, OpenSSL 0.9.8j, NEON 0.28.4, SQLite 3.6.11, File 5.00 + - rse: finally switch devtool from LZMA to XZ, too. + - rse: remove ugly --with-lzma to --with-xz hack (really not needed) + - rse: cleanup a few recently introduced compile-time warnings + - jbj: rpmz: add attribution and debugging to rpmzq. + - jbj: rpmz: carve out job queue and buffer pool management from pigz. + - jbj: rpmz: carve out an opaque trace logging subsystem from pigz. + - glen: markLinkedFailed if rpm file reopen failed during transaction to avoid losing old pkg info from db + - jbj: bzdio: finish abstraction between FD_t <-> rpmbz methods. + - jbj: bzdio: stub-in an abstraction between FD_t <-> rpmbz methods. + - jbj: bzdio: hmm, revert the pop/replace patch, there's more todo++ ... + - jbj: bzdio: pop/replace ufdio with bzdio (including a fdno). + - jbj: bzdio: take out the rubbish. + - jbj: bzdio: stage the multi-block BZIP2 payload code for debugging. + - jbj: bzdio: populate rpmbz with all but bz->fp, rearrange code to taste. + - jbj: bzdio: use the rpmbz container to carry around BZFILE *bzfile. + - jbj: bzdio: add annotation for bzip2, add (unused) rpmbz container. + - jbj: rpmz: add a modified version of rpmpigz (before merging with rpmz). + - jbj: rpmz: add Fchown/Fchmod, attempt to preserve owner/perms/timestamp. + - jbj: rpmz: swipe xz AutoFu to detect timestamps. + - jbj: rpmz: swipe xz AutoFu to detect physmem/ncpus. + - jbj: yarn: add to rpmio. + - jbj: rpmz: stub in argv[0] processing to set operation mode. + - jbj: rpmz: stub in RPMZ envvar option processing. + - jbj: fix: eliminate a argvSplit() memory leak. + - jbj: rpmz: gather args from multiple manifests (ala rpmwget). + - jbj: rpmz: stub in --files manifest handling (ignore --files0 for now). + - jbj: rpmz: stub in signal handling. + - jbj: rpmz: handle gzip/bzip2/xz/lzma compression in 1 executable. + - proyvind: create %mipsel and also add more generations to the mips macros. + - jbj: fix: avoid the assertion failure w LZMA lzdio by upgrading to XZ. + - proyvind: add initial support for detecting automatically detecting + architecture through libcpuinfo. + - jbj: stub-in /usr/lib/rpm/helpers/makeshlibs proof-of-concept. + - proyvind: add %mips & %mipsx macros for mips archictecture. + - jbj: add rpmdsNSType() to -lrpm loader map. + - jbj: rpmtsOrder: enable parentdir/linkto ordering relations. + - jbj: rpmrepo: initialize Packages/Sources markup. + - jbj: rpmrepo: initialize ".yaml" markup, add pre/post oneshot vectors. + - jbj: rpmrepo: compile in deb_{Packages,Sources} queryformats. + - jbj: rpmrepo: compile in wnh_{primary,filelists,other}_yaml queryformats. + - jbj: stub in deb:{Packages,Sources} queryformt templates. + - jbj: install/use deb:control queryformat. todo++ + - jbj: install/use deb:{md5sums,preinst,postinst,prerm,postrm} queryformats. + - jbj: install/use wnh:{primary,filelists,other}.yaml queryformats. + - jbj: attempt --yum:other.yaml markup definition (gud enuf for now). + - jbj: finish up yum:{primary,filelists}.yaml header extension tags. + - jbj: rpmrepo: compile in queryformat strings. + - jbj: add doublequotes around queryformats for #include use in rpmrepo.c. + - jbj: blueprint/use yum:{primary,filelists,other}.sqlite queryformats. + - jbj: blueprint/use yum:{primary,filelists,other}.xml queryformats. + - jbj: install yum:{primary,filelists,other}.xml queryformats. + - jbj: use poptReadFile with retrofit for popt < 1.15. + - jbj: rude & crude backing store for --queryformat templates. + - proyvind: xzdio: accept compression level 0 - 9 (new '0' = former '1' etc.). + - proyvind: don't wipe out $DOCDIR when using %doc as it will wipe out any + files that would happen to be installed during %install. + - jbj: add POPT_ARGFLAG_TOGGLE sufficient to test (invisible w popt < 1.15). + - jbj: enable the PLD dependency filtering. + - jbj: PLD: rpm-pld-autodep: add run-time disablers, attempt miRE's instead. + - jbj: PLD: rpm-noexpand: Don't expand macros in %changelog. + - jbj: PLD: rpm-pld-autodep: merge and simplify. entirely dysfunctional ... + - jbj: PLD: rpm-notsc: Don't use rdtsc timing. + - jbj: PLD: rpm-popt-aliases: Add --downgrade/--norepackage aliases. + - jbj: PLD: rpm-epoch0: Always add Epoch: 0 to packages. + - jbj: handle "config(N) = E:V-R" within rpmns.c (but treat as a string). + - rpm.org: Don't try to create "" directories. + - rpm.org: Don't bother calculating string sizes manually. + - rpm.org: memory used by lua gets freed (just remove comment). + - rpm.org: repeated read config -> free config needs globalLuaState == NULL. + - rpm.org: Fix buffer overflow on oversized filelist entries(susebz#397006). + - jbj: rpmdigest: avoid segfault on named pipes and other uglix fauna. + - jbj: pcre: finalize --with-pcre=internal building. + - jbj: pcre: punish PLD with internal bloat until the trivial AutoFu exists. + - jbj: rpmbuild: use anchored patterns for data validation. + - jbj: move rpmgrep and man page from rpmio/ to tools/ and install. + - jbj: EVRtuple: eliminate the old EVR parser. + - jbj: rpmbuild: enumerate all the lexical patterns in parsePreamble(). + - jbj: rpmbuild: enable pattern validation for simple package identifiers. + - jbj: rpmbuild: add tag data validation pattern checks. + - jbj: EVRtuple: handle EVR_t opaquely in python labelCompare(). + - jbj: EVRtuple: postpone committing to single "missing" value for now. + - jbj: EVRtuple: attempt rpmEVRparse() during parseRCPOT(). + no error returns from rpmEVRparse() to trigger the message yet, todo++. + - jbj: EVRtuple: teach --whatneeds/--needswhat to use EVR_t opaquely. + - jbj: EVRtuple: add rpmEVR{new,free} creator and destructors. + - jbj: EVRtuple: mark the old EVRD parser for destruction. + - jbj: EVRtuple: use the new EVRD pattern parser, reverse the assert check. + - jbj: EVRtuple: precedence permutation for rpmdsCompare(). + - jbj: EVRtuple: precedence permutation for rpmVersionCompare(). + - jbj: EVRtuple: blueprint new <-> old parsers with an assert. + - jbj: EVRtuple: parse EVRD using RPMMIRE_REGEX & evr_tuple_match. + - jbj: EVRtuple: wire up evr_tuple_match RE pattern match. + - jbj: EVRtuple: wire up evr_tuple_order precedence permutation. + - jbj: EVRtuple: use array for tuple storage. + - rse: EVRtuple: macro configuration parameterization. + - proyvind: rpmio: include lzma.h header so that LZMA_VERSION actually gets + defined and can be compared (fixes xzdio breakage). + - proyvind: xzdio: add a couple of missing print messages. + - proyvind: add %__xz macro. + - proyvind: rpmdb/tjfn: fix build breakage. + - proyvind: lib/tgi: fix build breakage. + - proyvind: rpmio/rpmz: merge with recent xz code to work with recent liblzma API + changes. + - proyvind: rpmio/lookup3: fix build breakage. + - proyvind: rpmio/tpw: fix linking against librpm. + - proyvind: rpmio/rpmtar: fix build breakage. + - proyvind: rpmio/rpmcpio: fix build breakage. + - proyvind: rpmio/tmacro: fix build breakage. + - proyvind: perl: clean out rest of warnings. + - proyvind: check return value for functions declared with attribute + warn_unused_result. (some inspired by rpm.org) + - proyvind: debugedit: perform some cleanups and pull in some from rpm.org + as well while at it. + - proyvind: move comparision of DISTEPOCH under NOTYET & + RPM_VENDOR_MANDRIVA for now. + - proyvind: only do DISTEPOCH comparision if RELEASE is equal. + - proyvind: set DISTEPOCH to "" if not present in rpmVersionCompare(). + - proyvind: perl: "fix" segfault with RPM::PackageIterator. + - proyvind: perl: add destructor function for RPM::PackageIterator. + - proyvind: add new DistEpoch tag. + - jbj: merge "support-wildcards-in-EVR-comparison" patch (OpenPKG). + - jbj: invert the sense of a <-> b comparison, change sign of Mandriva override. + - jbj: bury MDV file triggers under RPM_VENDOR_MANDRIVA. + - jbj: use poptSaneFile() when available (popt-1.15). + - jbj: use poptReadConfigFiles() when available (popt-1.15). + - provyind: python: build with -fno-strict-aliasing. + - proyvind: tevr: fix build issues. + - proyvind: add RPMTAG_DISTTAG to optionalTags so that it may be used as + %{disttag}. + - rpm.org: add %{_default_patch_flags} macro for patch options + - proyvind: add -Werror=format-security to gcc warning flags. + - proyvind: xzdio: rename from lzdio. + - proyvind: lzdio: set memlimit for decoding to 100MiB. + - proyvind: add support for xz for all tools shipped with rpm. + - proyvind: lzdio: add support for xz format. (removes liblzma 4.999.3 support) + - jbj: rpmgc: display errors with gcry_strerror(). + - jbj: rpmnss: eliminate pubkey type wrapping methods. + - jbj: stub in pgpImpl{Set,Verify}ECDSA methods. + - jbj: rpmnss: fix: correct RSA/SHA512 cut-n-paste error. + - jbj: rpmssl: don't bother with (unused) NID_foo. + - jbj: use digest names in debugging messages. + - jbj: name digests according to RFC 4880 section 9.4. + - jbj: rename s/hdrmd5ctx/hdrctx/ used by RSA to avoid legacy confusions. + - jbj: fix: RSA V4 signed *.rpm plaintext hash was not generated correctly. + - jbj: ensure that digest agrees with signature hash algorithm. + - jbj: digest: add getters for digest name/algo/ANS1oid. + - jbj: rpmssl: functional RSA verify --usecrypto ssl for signature(...) probe. + - jbj: rpmgc: functional RSA verify --usecrypto gc for signature(...) probe. + - jbj: rpmgc: bulldoze the RSA compost. still not working yet ... + - jbj: rpmpgp: add ASN1 goop for SHA-224, add to bc/gc/nss/ssl. + - jbj: bury file actions into iosm, replace XFA_SKIPPING with a + iosmFileActionSkipped() call. + - rpm.org: Add "deptype" format extension. + - rpm.org: Fix segfault on packages without separate scriptlet program tags + (rhbz#475214). + - jbj: don't attempt install if rpmgiNext() returns RPMRC_FAIL. + - jbj: transFlags: regroup bits together in poptI table. + - jbj: transFlags: use POPT_SET_BIT consistently, no callbacks needed. + - jbj: transFlags: add --nopretrans/--noposttrans disablers. + - jbj: lua: disable embedded socket/crypto/xmlrpc modules. external instead. + - jbj: sketch in %remove file flag, surely gonna change before finished. + - jbj: transFlags: eliminate --nomd5, use --nofdigests instead. + - jbj: sketch in arbitrary per-package Transflags: tag. + - jbj: transFlags: add RPMTRANS_FLAGS_NORPMDB and --norpmdb disablers. + - jbj: transFlags: eliminate (never implemented) RPMTRANS_KEEP_OBSOLETES. + - jbj: python: remove compile warnings from rpmWriteHeaders() addition. + - afb: rpmrepo: fix installed size bug (wrong value being written) + - pixel: handle posttrans p with no body. + - proyvind: python: add writeHeaderListToFD() & writeHeaderListToFile(). + (improved version of TurboLinux patch) + - proyvind: rpm4compat: disable warnings about unused variables. + - proyvind: Mandriva: Always treat file conflicts during install (rpm -i) + as errors. (dont-filter-install-file-conflicts) + - proyvind: perl: clean out some mess. + - proyvind: perl: don't add rpath to module. + - proyvind: lua: fix linking against internal lua. + - jbj: perl: add a sentinel to rpmdsSingle() rather than exporting rpmdsDup(). + - jbj: fix: better choice for paths to add (#473814 comment #4). + - proyvind: perl: add api doc for RPM::Spec->icon() & RPM::Spec->icon_url(). + - jbj: fix: include build dirname to find multiple *.pc (#473814). + - proyvind: perl: always do initSourceHeader() (fixes RPM::Spec->srcheader() + & RPM::SPEC->check()). + - jbj: lua: inline a copy of getdate.c + - jbj: lua: change paths to extend lua with external modules on linux. + - jbj: WR: lua: display "rpm:lua:foo" progname w chkconfig/useradd/groupadd + errors. + - jbj: WR: fix: sqlite assertion failure while sequentially retrieving keys. + - bero: Ark: create --with-vendor=ark, borrow some Mandriva patches, add + use-gnu-tar-compression-detection patch for vendor ark + - jbj: eliminate --with-vendor arguments that are not in use. + - jbj: eliminate rpmal debugging code. + - jbj: lua: disable mkdtemp(3) bindings, no solaris portability atm. + - jbj: lua: bind mkdtemp(3) in lposix.c + - jbj: macros: add %{mkdtemp:...} primitive (consistent leading whitespace too). + - jbj: devtool: provision a fedora host sufficiently to build from cvs. + - jbj: add cudf-tests example packaging. + - jbj: include tests/*.src.rpm, exclude tests/ref/CVS/*, with "make dist". + - proyvind: lua: explicitly link against libexpat as assumption on implicit + linking cannot be guaranteed. + - proyvind: add --with-extra-path-macros configure option that adds + additional macro file paths without overriding existing defaults. + - proyvind: add --with-vendor configure option to define RPM_VENDOR_*. + - proyvind: Mandriva: make loglevel for dependency loop detection + overridable, debug-level by default. (loop-detection-optional-loglevel) + - jbj: fix: __OpenBSD__ insque(3) needs rpmsq rock initialized. + - jbj: add #ifdef's needed to compile on __OpenBSD__. + - proyvind: Mandriva: make directory & symlink dependencies optional with + %{_check_symlink_deps} & %{_check_dirname_deps}. (optional-dirname-and-symlink-deps) + - proyvind: Mandriva: prefer file extension for detecting file compression. + (extension-based-compression-detection) + - proyvind: Mandriva: disable buildrequires checking for building src.rpms. + (no-deps-on-building-srpms) + - proyvind: Mandriva: disable preservation of file ownership for source rpms. + (no-owner-group-on-srpm-install) + - rpm.org: Add posix.mkstemp() to Lua posix lib. + - jbj: fix: apply _dependency_whiteout to erased relations too. + - jbj: lua: display rudimentary info about lua with --showrc. + - jbj: lua: preload "crypto" in rpmlua.c. + - jbj: lua: lom.lua has requires("lxp"), so preload "lxp" in rpmlua.c. + - jbj: WRlua: preserve forward linkage by avoiding vmefail/get_date. + - jbj: lua: add virgin luasocket-2.0.2 lua bindings (unused atm). + - jbj: lua: add license, and compile lxplib. + - jbj: lua: add lom.lua wrapper for lxplib. + - jbj: lua: diddle bin2c.c to permit multiple *.lua args. + - jbj: lua: add virgin lxplib lua bindings (unused atm). + - jbj: lua: add license, hotwire CRYPTO_OPENSSL, and compile lcrypto. + - jbj: lua: add virgin lcrypto lua bindings (unused atm). + - jbj: lua: ensure that internal lua has all the right files. + - jbj: add a relation to to force install-before-erase. + - jbj: display dependency loops as an error for now. + - rpm.org: add %{_default_patch_fuzz} macro for patch --fuzz + - afb: make buildroot path configurable, but keep old defaults + - rpm.org: add %{_buildrootdir} macro for use with %{buildroot} + +5.2a1 -> 5.2a2: + - jbj: permit --whatconflicts/--whatobsoletes to be displayed with --help. + - jbj: add flag to keep trailing slash in dirnames dependency set. + - jbj: fix a memory leak by calling mireClean(). + - jbj: save rpmdb trigger patterns in psm.c, eliminating 2nd retrieve. + - jbj: use generic retrieval code for --group and --triggerdby too. + - jbj: attempt generic retrieval code using --whatconflicts/--whatobsoletes. + - jbj: add --whatconflicts/--whatobsoletes, hidden for now. + - jbj: generate Obsoletename index in rpmdb. + - jbj: use rpmdsMatch to detect rpmdb trigger firing. + - jbj: add rpmdsMatch to match dependency against set. + - jbj: refactor the sumNN wrappers out of digest.c too. + - jbj: include crc routines in a standalone file. + - jbj: fix: unmatched file/dir path triggers were firing. + - jbj: fire file trigger patterns symmetrically. + - jbj: fire trigger patterns against filepaths. still asymmetric, todo++. + - proyvind: perl: add icon() & icon_url() to RPM::Spec. + - bero: Python 2.6 support in configure.ac + +5.1.0 -> 5.2a1: + - jbj: update osgideps.pl (#466111). + - jbj: generate Filepaths index in rpmdb. + - jbj: fix: he->tag was returning RPMTAG_BASENAMES, not RPMTAG_FILEPATHS. + - proyvind: install rpmbuild.h & rpmspec.h on system again (needed by urpmi). + - jbj: avoid mtab info leakage problems (#457940). + - proyvind: perl: add back installsrpm() function from old RPM4 bindings. + - proyvind: python: in case of RPMRC_NOTFOUND, return Py_None without + rpmlog printing error. + - proyvind: rpm4compat: add a fdSize() wrapper which uses Fstat(). + - proyvind: rpm4compat: add urltype & prototype for urlPath() since it's + used by rpmfiBuildFNames. (Why does only C++ complaint about this???) + - proyvind: rpm4compat: add rpm_machtable_e since it's been moved out of + the api. + - proyvind: rpm4compat: explicitly cast to HE_t (C++ compatibility). + - proyvind: rpm4compat: define all _RPM*_INTERNALs before inclusion of any + rpm headers at all to ensure that these actually has any effect. + - jbj: print last problem added w platform affinity failure. + - jbj: lazily create ts problem set. + - jbj: selinux: resurrect lsetfilecon using libselinux API. + - jbj: use macro, not /bin/bash, in scriptlet_requires. + - jbj: don't run empty transactions, avoiding obscure error msg. + - jbj: permit a negative index as alias for the last problem added to set. + - jbj: warn if package is not added because of platform affinity patterns. + - proyvind: lzdio: fix build with recent api changes. + - jbj: fix: initialize next element of rpmlog store correctly. + - rpm.org: python: cleanup & exit callback immediately on error. + - jbj: add FNM_EXTMATCH to default flags w RPMMIRE_GLOB. + - jbj: update {nl,id,pl}.po (Translation Project). + - jbj: rpmio: permit adler32/crc32/crc64 in spite of --without-zlib. + - jbj: rpmio: eliminate HAVE_ZLIB_H tests, use WITH_ZLIB tests instead. + - rse: rpmio: allow newer fnmatch to build on non-Linux platforms, too. + - jbj: rpmio: upgrade fnmatch to version that implements FNM_EXTMATCH. + - jbj: rpmpsm: simplify runTriggers() by adding rpmTriggersLoop(). + - jbj: rpmpsm: extract trigger tags once, simplify code, consistent naming. + - jbj: rpmpsm: extract NVRA and INSTALLPREFIXES lazily & persistently. + - jbj: speed up dirname triggers from glob patterns. almost spiffy ... + - jbj: rpmdb: add rpmdbMireApply to retrieve primary keys from index. + - jbj: fire dirname triggers from glob patterns (pig slow, fixing todo++). + - jbj: rpmfi: add storage and getters for exclude/include patterns. + - jbj: rpmds: add storage and getters for exclude/include patterns. + - jbj: rpmpsm: retrieve triggers lazily. + - jbj: use parent dirnames index if triggername ends with '/'. + - jbj: fire triggers on package file paths. + - jbj: use rpmio Readlink everywhere consistently. + - rpm.org: fix error messages in processScriptFiles(). + - jbj: fire triggers on parent directory paths. + - jbj: use rpmds iterator and getters for trigger->N parse side effects. + - jbj: hdrfmt: triggerconds header extension display was incorrect. + - jbj: expose rpmdsType() in rpmds ABI. + - jbj: add rpmdsType() to name dependency sets status quo ante. + - jbj: common approach to ensure triggers fire only once. + - jbj: fire triggers from Provides: dependency set. + - jbj: rpmio: add argiCmp and argiSort. + - jbj: loop over 1 element NEVRA dependency set when firing triggers. + - jbj: permit rpmdsNew() to create RPMTAG_NAME rpmds, simplify ds->Type. + - jbj: permit multiple triggers to fire from packages. + - jbj: don't install symclash.* to avoid picking up a dependency on python. + - jbj: fix: check added file names against installed conflicts. + - jbj: update nl.po (Translation Project). + - rpm.org: permit hardlinks only with regular files. + - jbj: fix: tagType() with multiple aliases returned the wrong type. + - rpm.org: don't allow multiple definition of PatchX or SourceX + - proyvind: install headers required by other installed headers. (FIXME!) + - proyvind: unbreak rpm4compat.h wrt c++ function overrides. + - proyvind: fix pointer type mismatch with 64 bit in glob.c. + - proyvind: fix a couple of compile warnings in python bindings. + - proyvind: remove references in autotools to removed files. + - rse: upgrade build environment to GNU libtool 2.2.6 + - jbj: lua: fix: don't unlink a non-existent scriptlet file. + - jbj: display error msg for lusers attempting "rpm -qp /bin" (#461362). + - jbj: WR: remove version from config paths. + - jbj: lua: fix: don't close dup'd stdout running lua scripts. + - jbj: macosx: avoid multiple definitions of _program_name. + - rse: upgrade embedded Lua from version 5.1.3 to 5.1.4 + - jbj: WR: remove --with-path-versioned in devtool targets. + - jbj: WR: remove $(VERION) from macros paths in devtool targets. + - jbj: WR: add devtool windriver-{host,target} configuration targets. + - jbj: WR: fix: cleanup patch integration thinkos. + - jbj: WR: mark wrs-rpm-enable-macro-validation.patch (but leave disabled). + - jbj: WR: fix: add rt-reloc-wrapper.sh to EXTRAS_DIST. + - jbj: rescusitate w make distcheck. + - jbj: update po files. + - jbj: adopt AM_PATH_PYTHON AutoFu variables. AM_PATH_PYTHON will be used eventually. + - rse: simplify conditional code and remove compile-time warnings in rpmio/rpm{nss,gc,ssl}.c + - jbj: python: simplify Makefile.am + - jbj: display sysinfo path with --showrc. + - jbj: remove internal zlib. + - jbj: WR: eliminate most compiler warnings. + - jbj: WR: eliminate duplicated AutoFu boilerplate, use system.h instead. + - jbj: WR: eliminate getdate.[ch], use same from rpmio instead. + - jbj: WR: eliminate dueling AutoFu defines from shadow_config.h, use RPM's + config.h (through system.h) instead. + - jbj: WR: eliminate xmalloc.c, use system.h defines instead. + - jbj: WR: rename config.h to shadow_config.h, include "system.h" instead. + - at: rpmdb.c: enable/disable rpmsq signal handlers with respect to rpmdbRock + - jbj: WR: run-time discovered configuration goopiness, take 1. + - jbj: WR: rely on PATH to find pkg-config. + - jbj: WR: don't spew error messages with internal lua shadow module. + - jbj: WR: add shadow/chkconfig internal lua modules. + - jbj: WR: Color/arch affinity while upgrading on multilib platforms. + - jbj: WR: Permit configurable arch strings. + - jbj: WR: Use %{_host_vendor} and %{_host_os} for platform. + - jbj: WR: fakeroot maps devices to files. avoid /dev/* in checkfiles. + - jbj: lua: don't exit chroot if already within running script. + - at: gzdio: fixed and re-enabled rsyncable_gzwrite() + - jbj: rpmku: create opaque keyutils keyring. + - jbj: keyutils: permit configurable keyring. + - rse: fix building under --with-lzma by providing the necessary 64-bit defines for inclusion of + - jbj: QNX: use strtouq() instead of strtoul() in rpmmtree. + - jbj: QNX: retrofit asprintf.h (from XAR) for the deprived. rpmmtree uses + (rewrite to eliminate asprintf is an alternative). + - jbj: QNX: supply missing typedef's for uint32_t. + - jbj: add alternative %{sparcx} macro shorthand (bz #455972). + - jbj: rpmio: add new link/unlink methods to loader map. + - jbj: python: add rpm.Keyring/rpm.Pubkey subtype methods for rpmkeyring. + - jbj: python: convert rpmtd-py to rpm style includes. + - jbj: filetriggers: rewite w splint annotations. much more todo++ here. + - jbj: keyring: (re-)port keyring.[ch] w refcounts. + - rpm.org: (re-)steal rpmkeyring.[ch] with added refcounts. + - jbj: python: add rpm.td subtype methods for rpmtd. + - jbj: rpmtd: expose symbols needed by python rpm.td. + - jbj: rpmtd: rework rpmtdFormats lookup. more todo++. + - jbj: rpmtd: initial port. + - rpm.org: steal rpmtd.[ch] modules for porting. + - rpm.org: steal rpmkeyring/rpmtd modules for porting work. + - jbj: fix: use the uint64_t callback args, not the legacy compat copies. + - rpm.org: Adjust for rpmps interface change. + - rpm.org: Adjust callback for amount+total type change. + - rse: upgrade "devtool" build environment to GNU shtool 2.0.8 + - bero: Fix hang when using rpmdsSingle and rpm4compat.h from C++ + - proyvind: clean out all build warnings for perl & python bindings. + - jbj: gzdio: quadruple check with external -lz. still no fix => disabled. + - jbj: gzdio: integrate the cpio tracking patch (needs to be done elsewhere) + - jbj: gzdio: disable rsync flushing until a fix can be attempted. + - jbj: gzdio: remove c99'ism. + - proyvind: disable filetriggers for src.rpms. + - jbj: band-aid test for tag->tagno != NULL for now. better needs doing. + - jbj: fix: --changelog segfault from rpmpopt.in typo. + - rse: fallback to xmalloc+strncpy if strndup is not available in filetriggers code + - proyvind: adapt filetriggers to use miRE in stead of regex(3). + - proyvind: merge pixel's filetriggers support. + - rse: configure: do not complain with "python: file not found" on platforms without python(1) in PATH + - rpm.org: use "Mono/.Net assembly" for mono magic. + - jbj: rpmdav: OPTIONS on every new dir needs thought. per-session for now. + - jbj: rpmdav: on 302, append the trailing '/' and retry. wotta pita. + - jbj: rpmdav: grab Location: and ETag: if available. + - jbj: rpmhtml: convert %2A et al in href's while parsing. + - jbj: rpmwget: wire up --output-file/--append-output options. + - jbj: rpmdav: add html parser to extract plain http href's. + - at: gzdio: return partial "best effort" bytes written with gzfoo errors. + - at: gzdio: do gzflush only after RSYNC_WIN boundaries. + - at: gzdio: push gzFile into a private container. + - jbj: rpmio: mark "server awol" disconnected state for graceful error + handling. + - jbj: rpmrepo: avoid double'd error message. + - jbj: rpmrepo: terminate immediately, rather than "best-effort" continue, + on I/O error. + - jbj: rpmrepo: terminate on short read, don't bother with extra EOF read. + - jbj: rpmwget: turn on --limit-rate. overdamped afaict, todo++ ... + - jbj: rpmwget: move most of the calculations into the notify callback. + - jbj: rpmurl: add send/recv/total accumulators. + - jbj: add --whatneeds/--needswhat popt aliases. + - jbj: make gzdio.c standalone. + - rpm.org: Make verifyAttrs and virtualFileAttributes static. + - rpm.org: Teach Fflush about lzdio. + - jbj: add _flush to FDIO_t, make bzdio.c standalone. + - jbj: rpmio: start deconstructing the ancient URL callback. + - jbj: rpmwget: ... display connection state in wgetNotify. + - jbj: rpmdav: pass the neon callback thru (*u->notify) to ... + - jbj: rpmurl: devise a passthru connection progress callback. + - jbj: rpmwget: preliminaries for -o/-a output file logging. + - jbj: rpmwget: wire up --quota. + - jbj: rpmsw: change bytes accumulator to unsigned long long. + - jbj: rpmwget: wire up --limit-rate. more to do ... + - jbj: rpmwget: wire up --progress; only "bar|none" args implemented. + - jbj: rpmwget: add rate/eta calculation to progress bar and logging. + - jbj: rpmdav: prepare to tie wget logging into davNotify transitions. + - at: rpmfi: new function: size_t rpmfiFNMaxLen(rpmfi). + - at: rpmbuild: check for unpackaged subdirectories. + - jbj: fix: resurrect cpuinfo() probe, hack-o-rounds for both /proc & libio. + - jbj: rpmio: remove fdSize, rewrite rpmioSlurp to use Fstat(2) instead. + - jbj: rpmdav: display connection state transitions while debugging. + - jbj: rpmdav: add davDisconnect() to clean active requests before caching. + - jbj: rpmwget: add a progress bar. no I/O rates or ETA yet. + - jbj: install: retry callback reopen URI once to handle timeouts. + - jbj: pkgio: use Fstat(2) for size check. more to do still ... + - jbj: psm: fix: avoid lazy Stat(2) on active URI request. + - jbj: rpmrpc: add Fstat(2) to map URI info into header statbuf early. + - at: rpmbuild: check if the same files are packaged into a few sub-packages. + - jbj: rpmwget: add --foodebug options, more wget-style spewage. + - jbj: rpmdav: capture connection state transitions w wget-style spewage. + - jbj: rpmdav: add global rpmioHttpConnectTimeoutSecs (unused) for now. + - jbj: rpmdav: run OPTIONS once, repeat for every directory, through a URI. + - jbj: rpmdav: add global rpmioHttp{Accept,ReadTimeoutSecs,UserAgent} for now. + - jbj: rpmwget: wire up --spider to Stat(2) running HEAD. + - rpm.org: single point to control how callbacks are made. + - rpm.org: Don't leak memory on python expandMacro(). + - jbj: rpmgpg: stub in gpg options using popt. + - rpm.org: get/set transaction keyring methods. + - jbj: rpmio: add rpmkeyring API. + - rpm.org: swipe the abstract keyring API. + - jbj: rpmio: add Content-Disposition: handling (for rpmwget eventually). + - jbj: rpmwget: rework logic to avoid Stat(2) running HEAD. + - jbj: rpmio: set st_blksize = 2048 iff html with Stat(http://) + - jbj: rpmio: add Content-Type/Last-Modified to FD_t. + - jbj: rpmwget: wire up -i,--input-file URI manifests. + - jbj: rpmwget: handle lower/UPPER ofn transforms, stub in retry logic. + - jbj: rpmwget: stub in a minimal (but functional) URI copy. + - jbj: rpmwget: refactor options into a static structure. + - jbj: fix: specspo lookup broke because of 2nd tagName call side-effect. + - jbj: rpmwget: parse all wget options. + - jbj: rpmio: stub in rpmwget options using popt. + - jbj: rpmio: stub in rpmcurl options using popt. + - jbj: rpmio: delete rpmrepo/rpmmtree, they live in tools/ now. + - jbj: rpmz: fix some typos. + - jbj: rpmdigest: parse/verify 0install manifest format. + - jbj: rpmdigest: resurrect rpmdigest -c manifest before attempting + 0install manifest verification. + - jbj: rpmdigest: add sha256 (and other) digests to 0install manifests. + - jbj: rpmdigest: achieve "sha1new" 0install manifest spewage for trees. + - jbj: rpmdigest: generalize to do multi-rooted Fts(3) traversal. + - jbj: rpmdigest: pull in mtreeCwalk() for 0install dir args tree spewage. + - jbj: rpmdigest: achieve 0install manifest spewage for file args. + - jbj: rpmdigest: refactor to prepare for 0install manifest spewage. + - jbj: rpmrepo: put a --stats stopwatch on the mmap digest cost as well. + - jbj: rpmrepo: add repoFclose(), accumulate I/O stats into a ts. + - jbj: rpmrepo: enable --stats display using transaction set. + - jbj: add RPMTAG_NEEDSWHAT header extension. + - jbj: don't revisit headers that RPMTAG_WHATNEEDS has already processed. + - jbj: add RPMTAG_WHATNEEDS header extension. + - jbj: move rpmns.[ch] to -lrpmdb for use with header format extensions. + - jbj: pass rpmdb to header format extenensions with header. + - jbj: move rpmevr.[ch] to -lrpmdb for use with header format extensions. + - jbj: fix: "%description -n foo-bar" needs an additional comparison. + - jbj: add non-{GIF,XPM} formats opaquely using arbitrary Icon: tagno. + - jbj: fix: allocate Icon: buffer after iconsize is initialized. + - jbj: permit configurable POSIX behavior for parameterized macros + (Marcin Kowalczyk). + - jbj: add getter/setter methods to pass a rpmdb using a header argument. + - jbj: tests: wire up plain HTTP manifest query. + - jbj: http: ignore 501 from OPTIONS attempt to non-DAV server. + - jbj: two copies of rpmrepo.c/rpmmtree.c is too many. + - jbj: tests: add probes-test package to exercise dependency probes. + - jbj: fix: skip %exclude/%ghost files to get more accurate RPMTAG_SIZE. + - rse: fix portability by providing own RPM_LIST_XXX macros in rpmmtree.c + - jbj: fix: RPMTAG_SIZE is incorrect with %exclude and %ghost directives + (Alexey Tourbin). + - jbj: fix: Install-Size: spewage in Kb, not bytes. everone gotta be different. + - jbj: permit *.deb syntax as arbitrary tags. + - jbj: add *.deb format dependency tag header extensions. + - jbj: fix: return 1 rather than assertion failing on Suggests: header ext + query of package with no Requires:. + - rse: unbreak building without LZMAUtils library + - jbj: add --deb:foo aliases for *.deb spewage. + - jbj: rework :strsub find-and-replace to use mire patterns. + - jbj: mire: add REG_NEWLINE to default regex compilation. + - jbj: add :strsub format extension find-and-replace using posix RE's. + - jbj: fix: reattach RPMMIRE_DEFAULT as posix regex, not strcmp, pattern. + - jbj: lzdio: start using -llzma instead. + - jbj: tests: add coverage for %pretrans et al scriptlets. + - rse: upgrade the embedded lrexlib Lua library from version 2.2.0 to 2.3.0 + - rse: apply upstream vendor patches from 2008-05-08 for Lua 5.1.3 + - jbj: tests: verify upgrades using the edos-test packages. + - jbj: parser: inherit group/summary/description if not specified in subpkg. + - jbj: parser: permit identically named sub-pkgs with different versions. + - jbj: parser: trim comments where it makes sense to do so. + - jbj: tests: add check-install target to attempt --relocate install. + - jbj: tests: enhance the devtool-sanity package with scripts and a file. + - jbj: tests: verify -Kv output using popt. + - jbj: tests: verify setup using --version/--querytags/--showrc. + - jbj: display noisy getconf()/uname() info with -vv --showrc instead. + - jbj: shorten debugging messages, --queryformat strings passed to + headerSprintf are getting huge. + - jbj: fix: NUL terminate dst on EXPR->ARRAY parser state transition + (see --yum:primary.yaml spew for reproducer) + - jbj: restore deploop diagnostic message (Kacper Kornet kornet@camk.edu.pl). + - jbj: install rpmmtree.8, update POTFILES.in & Doxyfiles.in. + - jbj: add %_build_iconsize macro to permit configuration. + - jbj: trash-and-restore macro config for multiple CLI arg builds. + - rpm.org: use same code for creating the digest object on iteration and method call, + - jbj: rpmrepo: correct requiressqlentry tag name typo. + - jbj: fix: handle '%{arch}\' with \ at end-of-string correctly. + - jbj: tests: verify ref/* data using rpmdigest/rpmmtree. + - jbj: move rpmdigest/rpmmtree/rpmrepo back to tools/ for installation. + - jbj: tests: verify rpmrepo XML spewage using popt-1.14. + - jbj: tests: verify XML/YAML markup queries using popt-1.14. + - jbj: tests: download popt-1.14 packages for use in tests. + - jbj: yaml: fix: single element string arrays had extra "- ". + - jbj: yaml: remove the hotwired hack for SRPM dirnames indentation. + - jbj: add expanded build scripts for --specsrpm --queryformat spewage. + - jbj: update Russian PO file (from Translation Project). + - jbj: rpmdb: fix: limit RUNRECOVERY attempts, not every lazy open. + - jbj: make sure the open path is set when using [bgl]zdOpen vector too. + - jbj: lzdio: rework the layering to be more similar to gzdio/bzdio. + - jbj: rpmrepo: fix: --lzma segfault, lzdFdopen was not saving path. + - jbj: permit upgrade erasure of old -debuginfo iff all other packages + built from same *.src.rpm are not present. Note that this patch + assumes that -debuginfo will be added after all other packages + built from same *.src.rpm. + - jbj: add automagic erasures of -debuginfo packages (#447708). + - jbj: enable -lgcrypt through ./devtool system. + - jbj: hdrfmt: achieve coverage over new header format extensions. + - jbj: rpmrepo: add baseurl to the repo markup. + - jbj: rpmrepo: populate sqlite schema with PACKAGESIZE and PACKAGEDIGEST. + - jbj: simple parameterized namespace URI for Pkgid/Hdrid UUID generation. + - jbj: rpmrepo: compute digests for both compressed & uncompressed + repository markup components. + - jbj: legacy: eliminate (unused) domd5(). use dodigest instead. + - jbj: update sv.po from the Translation Project. + - jbj: add SOURCERPM name at end-of-parse for --specfile queries and errmsg. + - jbj: upgrade to DB 4.7.25: + Change to 4.6 -> 4.7 in configure.ac & tools/Makefile.am + Rename to rep_auto.c in tools/Makefile.am + - jbj: autogen.sh: change the USAGE strings to simplify maintenance. tool + versions only need to be edited in one place. + - jbj: autogen.sh: fix arg stripping for 1.* libtoolize. + - rse: enhance RPM_CHECK_LIB to query pkg-config(1) --libs-only-L to get -L options, too. + - rse: be smart and allow one to still build RPM from CVS with old GNU libtool 1.5.x + - rse: explicitly let one to force one of BeeCrypt/GCrypt/NSS/OpenSSL as the crypto implementation + - rse: implicitly choose one of BeeCrypt/GCrypt/NSS/OpenSSL as the crypto implementation + - rse: add an Autoconf --with-usecrypto={beecrypt,gcrypt,nss,openssl} build-time option + - rse: allow one to build against the GCrypt based crypto implementation out-of-the-box + - rse: more robust argument checking for CLI option --usecrypto + - rse: add support for "lib-config" and "lib.pc" in RPM_CHECK_LIB + - jbj: debuginfo: refactor 2 existing upgrade policy rules before + adding a new contextually sensitive rule for -debuginfo packages. + - jbj: debuginfo: add general rpmdbCount() to get number of items for + any tag index, not just RPMTAG_NAME as was in rpmdbCountPackages(). + - jbj: add --with-openssl to devtool system target to enable the ssl + digital signature implementation in rpmio/rpmssl.c at runtime. + - jbj: rpmte: add rpmteSourcerpm() (for use as a -debuginfo buildset key). + - jbj: fix: skip the :extractor/|transformer mark checking :xml/:yaml. + - jbj: splint: annotate argvAppend differently. + - jbj: hdrfmt: return failure if PACKAGE{ORIGIN,DIGEST} do not exist. + - afb: standalone: file "magic" was installed in wrong directory + - afb: fix VPATH builds finding rpmversion.h (in perl, with MakeMaker) + - afb: fix VPATH builds finding rpmversion.h (in python) + - afb: internal liblzma was not properly in autoconf/automake + - afb: fix VPATH builds of lua finding "system.h" from popt (not rpm) + - afb: fix VPATH builds finding rpmversion.h (in tools) + - jbj: fix: rpm-python h['filenames'] needs tagName(0x54aafb71) to + return "Filenames" in order to find the filepathsTag extension. + - jbj: add enabler options to chase down headerLoad() hot-spots. + - jbj: add a missing newline to a debug message. + - jbj: revert rpmtsOpenDB on --checksig path, rely on the lazy open + in rpmtsFindPubkey instead. + - jbj: fix: rpm -qp returns NOKEY because rpmdb is not yet open. Do a lazy + open in rpmtsFindPubkey. + - jbj: add :rpn formatter to do simple arithemetic on input. + - jbj: python: fix: insure that ts.setProbFilter() return is initialized. + - jbj: fix: insure no access before buffer if fgets(3) returns NUL. + - jbj: tevr: add missing level of ht indirection, free input strings. + - jbj: fix: --triggers segfault, don't depend on he->p.ptr = NULL after + headerGet() failed return. + - jbj: try ":foo" == extractor, "|foo" == transformer, format extensions. + - jbj: permit :stat(foo) extraction from RPMTAG_PACKAGESTAT. + - jbj: add RPMTAG_PACKAGESTAT, and store persistently in a rpmdb Header. + - jbj: rpmrepo: achieve {primary,filelists,other}.xml spew parity w createrepo. + - jbj: rpmrepo: compute origin *.rpm file digest while reading. + - jbj: preserve stat(2) & digest through headerReload(). + - jbj: get rid of copy-n-paste typos, add "l" type markers to rpmtag.h. + - jbj: add RPMTAG_PACKAGEDIGEST extension as RPM_STRING_TYPE. + - jbj: add digest of origin *.rpm to Header internal store. + - jbj: add RPMTAG_PACKAGESIZE extension as RPM_UINT64_TYPE. + - jbj: rework RPMTAG_PACKAGETIME extension as RPM_UINT64_TYPE. + - jbj: rework header{Get,Set}Time as header{Get,Stat}Statbuf methods. + - jbj: add stat(2) of origin *.rpm to Header internal store. + - jbj: permit file digests through (e.g.) :stat(sha512) format extension. + - jbj: add :uuid(vN) format. UUIDv5 URI design & tag type coercion todo++. + - jbj: rpmuuid: add i18n to error messages. + - jbj: fix: blessed NUL termination for Readlink return. + - jbj: retrofit v5 UUID's for hdrid/pkgid digests as tag extensions. + - jbj: retrofit v1 UUID's for time stamps as tag extensions. + - jbj: replace "diskstat" tag with :stat format extension instead. + - jbj: add :digest(foo) format. :fdigest(algo) for rpmrepo spew soon ... + - jbj: generalize :utf8 to :iconv(UTF-8) iconv(3) conversions. + - jbj: permit :foo(A,B,C) parameters to be passed to extension formats. + - jbj: permit :base64 encoding to be applied to all tag data types. + - jbj: apply multiple tag extension formats in L->R serial order. + - jbj: use loops instead of inline for sigtags (adapted from rpm.org). + - jbj: fix: is_selinux_enbled() > 0 is the correct test. + - rpm.org: Avoid entirely unnecessary static temp string buffer. + - rpm.org: Mask signals while moving rebuilt rpmdb into place. + - rpm.org: Restore rpmdb selinux contexts to default after rebuild (#442149). + - jbj: tests: coverage results at http://wraptastic.org/pub/jbj/rpm-lcov. + - jbj: tests: add devtool-sanity (and other) tests. + - jbj: rpmio: add additional tests. + - jbj: add lcov targets throughout. + - jbj: add (empty) SUBDIRS = # tests throughout. + - jbj: add (empty) check-local: targets throughout. + - jbj: rpmio: add lco/gcov coverage targets with rpm "make check". + - jbj: rpmrepo: add :bncdata extension format for display. + - jbj: pass dataEnd to regionSwab() when unloading. + - jbj: disable the headerLoad speedup's until headerUnload changes are done. + - jbj: swab integer tag data in headerGet, not headerLoad (measured 6.9% rpm-V speedup ymmv). + - jbj: compute tag store w subtract (measured 26.3% rpm -qa speedup ymmv). + - jbj: initialize ts->PRCO lazily (measured 20.4% rpm -qa speedup ymmv). + - glen: print error when makeTempPath fails due missing temp dir + - jbj: add _fdopen to FDIO_t, expose fdbg(), make lzdio.c standalone. + - jbj: expose XfdLink/XfdFree/XfdNew, nuke the FDIO_t vectors. + - jbj: eliminate unused FDIO_t vectors. XfdLink/XfdFree/XfdNew need nuking. + - jbj: create lzdio.c to carry lzma comprssion, possibly w dlopen(). + - jbj: merge OpenSUSE lzma.diff patch. + - jbj: preliminary support for internal -lzma (non-functional atm). + - jbj: add lzma checkout to devtool system target. + - jbj: disable loop unraveling error msgs for now. better needs to be done. + - jbj: permit firefox debugging by creating an empty dir (#444310). + - afb/rse: add initial "devtool standalone" and Autoconf support for building against LZMA Utils + - jbj: add --enable-build-gcov for CFLAGS -fprofile-arcs -ftest-coverage. + - jbj: header: free tag data on error retrurn with damaged data. + - rpm.org: rpmsw: insure that time has passed while calibrating (#435309). + - jbj: header: fix: avoid double free with damaged data (#442761). + - jbj: rpmte: revert to individual tags instead of RPMTAG_NVRA. + - jbj: rpmte: fix: snip ".arch" from "-release", same NEVRA check broke. + - afb: fix VPATH builds finding rpmversion.h (in build) + - afb: fix parallel build of rpmdigest (automake quirk) + - afb: disable intl/iconv for popt 1.14 under Mac OS X + - nkukard: support building under Linux/uClibc in addition to Linux/GLIBC + - jbj: update {nl,pl,sl,sv,vi}.po from Translation Project. + - rse: replace obsolete AC_AIX and AC_MINIX checks with newer AC_USE_SYSTEM_EXTENSIONS to get rid of Autoconf warnings + - proyvind: improve %_smp_mflags so that it will correctly detect number of cpus on macos, while defaulting to 1 cpu if unable to detect + - proyvind: move some macros that's identical for each platform macros to standard macros + - rse: upgrade build environment to GNU autoconf 2.62 + - rse: use latest POPT 1.14 for building with "devtool standalone" + - rse: prepared build-tree for RPM 5.2 development after branching + +============================================================================= + +5.1.7 -> 5.1.8: + - jbj: adjust loader maps for lua. + - rse: fix building under all combinations (none/internal/external) of Lua and PCRE + - rse: upgrade devtool.conf and INSTALL to the latest tools from HEAD + - jbj: EVRtuple: eliminate the old EVR parser. + - jbj: yarn: convert rpmluav to usage mutex with refcounts + - jbj: yarn: convert rpmlua to usage mutex with refcounts + - jbj: popt: remove retrofits for popt < 1.14. use popt internal if needed. + - jbj: mire: teardown for platpat on exit needs to be done in order. + - jbj: rpmwget: move to tools. + - jbj: rpmio: more random line noise reduction, diff'ing against HEAD. + - jbj: rpmio: backport HTTP transport from HEAD. + - jbj: rpmio: add additional data elements for HTTP transport. + - jbj: rpmiob: yet another place to use rpmiobSlurp instead. + - jbj: backport rpmspecdump from HEAD. + - jbj: lib: more random line noise reduction, diff'ing against HEAD. + - jbj: delete ancient header+payload RSA signatures too using GPG (#488953). + - jbj: rpmrepo: compile in queryformat strings. + - jbj: install/use deb:{md5sums,preinst,postinst,prerm,postrm} queryformats. + - jbj: install/use yum:{primary,filelists,other}.sqlite queryformats. + - jbj: install/use yum:{primary,filelists,other}.xml queryformats. + - jbj: install/use wnh:{primary,filelists,other}.yaml queryformats. + - jbj: use poptReadFile with retrofit for popt < 1.15. + - devzero2000: fix --orphandirs port alias ; add --danglinglink popt alias + - jbj: fix: eliminate a argvSplit() memory leak. + - jbj: stub-in /usr/lib/rpm/helpers/makeshlibs proof-of-concept. + - jbj: rude & crude backing store for --queryformat templates. + - jbj: PLD: rpm-popt-aliases: Add --downgrade/--norepackage aliases. + - jbj: PLD: rpm-notsc: Don't use rdtsc timing. + - jbj: enable the PLD dependency filtering. + - jbj: PLD: rpm-pld-autodep: add run-time disablers, attempt miRE's instead. + - jbj: PLD: rpm-pld-autodep: merge and simplify. entirely dysfunctional ... + - jbj: lib: start reducing random line noise, diff'ing against HEAD. + - jbj: add prototypes to remove compiler warnings. + - jbj: bury file actions into iosm, replace XFA_SKIPPING with a + iosmFileActionSkipped() call. + - jbj: rpmdb: random line noise reduction, diff'ing against HEAD. + - jbj: wire-up RPMTAG_FILEDIGESTALGO. wotta waste to pretend "compatible" ... + - jbj: yaml: add build scriptlet tags for --yaml/--xml display. + - jbj: eliminate rpmal debugging code. + - jbj: PLD: rpm-epoch0: Always add Epoch: 0 to packages. + - jbj: handle "config(N) = E:V-R" within rpmns.c (but treat as a string). + - jbj: yaml: backport the YAML analogue tag extensions to repo-md XML. + - jbj: yaml: permit --without-syck, add some mac os x AutoFu/gcc fiddle-ups. + - jbj: yaml: add lsyck lua module to parse YAML. + - jbj: finish backport and enable SUPPORT_DEBUGINFO_UPGRADE_MODEL. + - jbj: misc: get rid of splitFoo prototypes, bury the last use in rpmfi.c. + - jbj: PCRE in -lrpmmisc, LUA in -lrpmio linking -lrpmmisc, instead. + - jbj: update file manifests with backported files. + - jbj: perl: fix: no need to include stringbuf.h any more. + - jbj: fix: --noscripts/--nofdigests/--nocontexts need to use popt callback. + - jbj: rpmiob: fix: return iob to _rpmiobPool instead. + - rse: add RPM Lua function rpm.hostname() + - jbj: yarn: convert mire to usage mutex with refcounts + (unifying array <-> element mutexes by copying use/pool + pointers throughout the array). + - jbj: rpmku: rework rpmiob handling to avoid extra malloc's. + - jbj: rpmiob: fix: add a newref in rpmiobNew. + - jbj: rpmiob: backport the rpmiob interface into rpmku too. + - jbj: rpmiob: backport the remainder of rpmiob, eliminate StringBuf. + - jbj: backport HAVE_PTHREADS_H -> WITH_PTHREADS AutoFu logic. + - jbj: more hack-o-rounds for LUA <-> PCRE, add --disable-static for now. + - jbj: backport rpmiotypes.h/rpmiob.c, use rpmiobSlurp instead. + - jbj: fix: handle ./../foo paths correctly (#491388). + - jbj: rpmlib: rescusitate splint annotations. + - jbj: rpmdb: rescusitate splint annotations. + - jbj: rpmtsOrder: fully enable parentdir deps when ordering. + - jbj: rpmtsOrder: enable parentdir/linkto ordering relations. + - jbj: initialize ts->PRCO lazily (measured 20.4% rpm -qa speedup ymmv). + - jbj: EVRtuple: fix: dig out the one time mire allocation leak. + - jbj: use rpmioFreePoolItem for rpmds, eliminate rpmdsFree. + - jbj: finish up using rpmioFreePoolItem() for rpmts and Header objects. + - devzero2000: continuing for refcount rewrite : add define of fooFree to rpmioFreePoolItem + - devzero2000: begin change programming style for refcount : rpmtsFree and h +eaderFree + - jbj: rpmio: rescusitate splint annotations. + - jbj: getdate: ignore internalState changes. + - jbj: zlog: use struct rpmioItem_s use/pool container. + - jbj: poptIO: add --htdebug. + - jbj: yarn: convert rpmfc to usage mutex with refcounts. + - jbj: yarn: convert hashTable to usage mutex with refcounts. + - jbj: yarn: convert rpmmg to usage mutex with refcounts. + - jbj: yarn: convert rpmwf refcount to usage mutex. + - jbj: rpmdb: don't bother with the silly structure assignment initialize. + - jbj: yarn: wire up rpmdsFini, mark rpmdsFree for destruction. + - jbj: yarn: wire up rpmtsFini, mark rpmtsFree for destruction. + - jbj: yarn: for now, don't assert fail, just print FIXME. + - jbj: yarn: wire up headerScrub, eliminate header{Link,Unlink}. + - jbj: make misc identical to HEAD (hmm @WITH_PCRE_LDFLAGS@ is AWOL) + - devzero2000: add mkdtemp portability function to -lrpmmisc + - jbj: yarn: wire up rpmteFini, eliminate rpmteFree. + - jbj: yarn: wire up rpmsxFini, eliminate rpmsxFree. + - jbj: yarn: wire up rpmfiFini, eliminate rpmfiFree. + - jbj: yarn: wire up rpmgiFini, eliminate rpmgiFree. + - jbj: rpmtsi: use __FUNCTION__ rather than adding a 2nd arg everywhere. + - jbj: pgpDig: fix: rpmioFreePoolItem() can return non-NULL, clear ts->dig. + - jbj: rpmio: add --pgpdebug for pgpDig debugging. + - jbj: yarn: wire up rpmtsiFini, eliminate rpmtsiFree. + - jbj: yarn: wire up rpmpsmFini, eliminate rpmpsmFree. + - jbj: yarn: wire up rpmxarFini, eliminate rpmxarFree. + - jbj: yarn: wire up pgpDigFini, eliminate pgpDigFree. + - jbj: yarn: wire up urlFini, eliminate XurlFree. + - jbj: yarn: wire up fdFini, eliminate XfdFree. + - jbj: url: fix: u->use clobbers the lock from the pool. + - jbj: rpmds: fix: rpmdsDup needs to go through rpmdsGetPool() too. + - jbj: yarn: use void * use, not yarnLock use, to hide the details. + - jbj: yarn: wrap use/pool into a per-object "struct rpmioItem_s _item". + - jbj: yarn: stub in (*init)() and (*fini)() pool item methods. + - jbj: yarn: add a (*dbg)() formatter to make fdLink() generic. + - jbj: yarn: stub-in rpmmi pool handling under NOTYET. + - jbj: QNX: avoid conflicting db defines for __mutex_lock/__mutex_unlock. + - jbj: yarn: convert rpmdb refcount to usage mutex. + - jbj: yarn: convert psm refcount to usage mutex. + - jbj: yarn: convert rpmxar refcount to usage mutex. + - jbj: yarn: convert pgpDig refcount to usage mutex (avoid recurse deadlock). + - jbj: yarn: convert rpmts refcount to usage mutex (avoid recurse deadlock). + - jbj: rpmps: fix: avoid reusing items from pool for now. + - jbj: yarn: convert rpmtsi refcount to usage mutex. + - jbj: yarn: convert rpmsx refcount to usage mutex. + - jbj: yarn: convert rpmps refcount to usage mutex. + - jbj: rpmds: fix: avoid pooling rpmdsThis/rpmdsSingle for now ... + - jbj: headerReload: fix: don't free the header blob. + - jbj: yarn: convert rpmte to a usage mutex (no refcounts). + - jbj: yarn: convert rpmgi refcount to usage mutex. + - jbj: yarn: use the pool changes where possible. + - jbj: yarn: add generic Link/Unlink refcount diddlers. + - jbj: yarn: add debugging, reuse counter, and zlog to rpmioPool. + - jbj: yarn: trick up a __FILE__:__LINE__ from caller when failing too. + - jbj: yarn: use EINVAL, not -1, for --without-pthreads portability. + - jbj: yarn: glibc pthreads (at least) returns errno's, strrerror decodes. + - jbj: yarn: fix: assert fail instead of exit on error. + - jbj: yarn: use the pool allocator. + - jbj: yarn: add a pool allocator. + - jbj: yarn: convert rpmfi refcounts to usage mutexes. + - jbj: yarn: convert rpmds refcounts to usage mutexes. + - jbj: yarn: convert Header refcounts to usage mutexes. + - jbj: yarn: convert urlInfo refcounts to usage mutexes. + - jbj: yarn: convert FD_t refcounts to usage mutexes. + - jbj: zlog: backport from HEAD. + - jbj: yarn: backport from HEAD (likely --with-pthreads needed todo++). + - jbj: bzdio: handle multiblock compressed payloads transparently. + - jbj: xzdio: backport the remaining xzdio contexxtual changes. worksforme. + - jbj: xzdio: backport XZ changes from HEAD. + - jbj: rename lzdio.c -> xzdio.c. + +5.1.6 -> 5.1.7: + - jbj: update po files (Translation Project). + - jbj: eleminate duplicate rpmVersionCompare() routines. + - afb: backport macosx ldflags fixes. + - glen: markLinkedFailed if rpm file reopen failed during transaction to avoid losing old pkg info from db + - jbj: add rpmdsNSType() to -lrpm loader map. + - jbj: update po files (Translation Project). + - jbj: update PO and doxygen manifests. + - jbj: include rpmgrep.1 with "make dist". + - rpm.org: Don't try to create "" directories. + - rpm.org: Don't bother calculating string sizes manually. + - rpm.org: memory used by lua gets freed (just remove comment). + - rpm.org: repeated read config -> free config needs globalLuaState == NULL. + - rpm.org: Fix buffer overflow on oversized filelist entries(susebz#397006). + - jbj: pcre: finalize --with-pcre=internal building. + - jbj: pcre: punish PLD with internal bloat until the trivial AutoFu exists. + - jbj: rpmdigest: avoid segfault on named pipes and other uglix fauna. + - jbj: rpmbuild: use anchored patterns for data validation. + - jbj: run "make check" to self consistency. worksforme. + - jbj: add --whatneeds/--needswhat popt aliases. + - jbj: backport the test harness for signature(). worksforme. + - jbj: rpmbuild: enumerate all the lexical patterns in parsePreamble(). + - jbj: rpmbuild: enable pattern validation for simple package identifiers. + - jbj: rpmbuild: add tag data validation pattern checks. + - jbj: EVRtuple: handle EVR_t opaquely in python labelCompare(). + - jbj: EVRtuple: postpone committing to single "missing" value for now. + - jbj: EVRtuple: attempt rpmEVRparse() during parseRCPOT(). + no error returns from rpmEVRparse() to trigger the message yet, todo++. + - jbj: EVRtuple: teach --whatneeds/--needswhat to use EVR_t opaquely. + - jbj: EVRtuple: add rpmEVR{new,free} creator and destructors. + - jbj: EVRtuple: mark the old EVRD parser for destruction. + - jbj: EVRtuple: use the new EVRD pattern parser, reverse the assert check. + - jbj: EVRtuple: precedence permutation for rpmdsCompare(). + - jbj: EVRtuple: precedence permutation for rpmVersionCompare(). + - jbj: EVRtuple: blueprint new <-> old parsers with an assert. + - jbj: EVRtuple: parse EVRD using RPMMIRE_REGEX & evr_tuple_match. + - jbj: EVRtuple: wire up evr_tuple_match RE pattern match. + - jbj: EVRtuple: wire up evr_tuple_order precedence permutation. + - jbj: EVRtuple: use array for tuple storage. + - rse: EVRtuple: macro configuration parameterization. + - jbj: add FNM_EXTMATCH to default flags w RPMMIRE_GLOB. + - jbj: rpmsw: change bytes accumulator to unsigned long long. + - proyvind: add new DistEpoch tag. + - jbj: add getter/setter methods to pass a rpmdb using a header argument. + - jbj: transFlags: regroup bits together in poptI table. + - jbj: transFlags: use POPT_SET_BIT consistently, no callbacks needed. + - jbj: transFlags: add --nopretrans/--noposttrans disablers. + - jbj: transFlags: eliminate --nomd5, use --nofdigests instead. + - jbj: transFlags: add RPMTRANS_FLAGS_NORPMDB and --norpmdb disablers. + - jbj: transFlags: eliminate (never implemented) RPMTRANS_KEEP_OBSOLETES. + - jbj: use poptSaneFile() when available (popt-1.15). + - jbj: use poptReadConfigFiles() when available (popt-1.15). + - jbj: rename s/hdrmd5ctx/hdrctx/ used by RSA to avoid legacy confusions. + - jbj: backport misc. changes from HEAD. + - jbj: backport OpenPKG no-hard-coded-ugid. + - jbj: rpmku: create opaque keyutils keyring. + - jbj: keyutils: permit configurable keyring. + - jbj: rpmgc: display errors with gcry_strerror(). + - jbj: rpmnss: eliminate pubkey type wrapping methods. + - jbj: rpmnss: fix: correct RSA/SHA512 cut-n-paste error. + - jbj: rpmssl: don't bother with (unused) NID_foo. + - jbj: name digests according to RFC 4880 section 9.4. + - jbj: digest: add getters for digest name/algo/ANS1oid. + - jbj: rpmssl: functional RSA verify --usecrypto ssl for signature(...) probe. + - jbj: rpmgc: functional RSA verify --usecrypto gc for signature(...) probe. + - jbj: rpmgc: bulldoze the RSA compost. still not working yet ... + - jbj: rpmpgp: add ASN1 goop for SHA-224, add to bc/gc/nss/ssl. + - jbj: rpmdigest: parse/verify 0install manifest format. + - jbj: rpmdigest: resurrect rpmdigest -c manifest before attempting + 0install manifest verification. + - jbj: rpmdigest: add sha256 (and other) digests to 0install manifests. + - jbj: rpmdigest: achieve "sha1new" 0install manifest spewage for trees. + - jbj: rpmdigest: generalize to do multi-rooted Fts(3) traversal. + - jbj: rpmdigest: pull in mtreeCwalk() for 0install dir args tree spewage. + - jbj: rpmdigest: achieve 0install manifest spewage for file args. + - jbj: rpmdigest: refactor to prepare for 0install manifest spewage. + - jbj: rpmrepo: avoid double'd error message. + - jbj: rpmrepo: terminate immediately, rather than "best-effort" continue, + on I/O error. + - jbj: rpmrepo: terminate on short read, don't bother with extra EOF read. + - jbj: move rpmns.[ch] to -lrpmdb for use with header format extensions. + - jbj: move rpmevr.[ch] to -lrpmdb for use with header format extensions. + - jbj: move rpmgrep and man page from rpmio/ to tools/ and install. + - jbj: rpmfi: add storage and getters for exclude/include patterns. + - jbj: perl: add a sentinel to rpmdsSingle() rather than exporting rpmdsDup(). + - jbj: update po files (Translation Project). + - jbj: fix: don't display lua info if compiled --without-lua. + - jbj: rpmds: add storage and getters for exclude/include patterns. + - jbj: rpmds: expose rpmdsType() in rpmds ABI. + - jbj: rpmds: add rpmdsType() to name dependency sets status quo ante. + - afb: rpmrepo: fix installed size bug (wrong value being written) + - jbj: fix: better choice for paths to add (#473814 comment #4). + - jbj: fix: include build dirname to find multiple *.pc (#473814). + - jbj: lua: inline a copy of getdate.c + - jbj: WR: lua: display "rpm:lua:foo" progname w chkconfig/useradd/groupadd + errors. + - jbj: WR: fix: sqlite assertion failure while sequentially retrieving keys. + - jbj: update INSTALL to indicate that external zlib is preferred now. + - at: fix: initialize msbits of erased package keys to zeroes on 64b hosts. + - jbj: lua: bind mkdtemp(3) in lposix.c + - jbj: macros: add %{mkdtemp:...} primitive (consistent leading whitespace too). + - jbj: include tests/*.src.rpm, exclude tests/ref/CVS/*, with "make dist". + - jbj: fix: __OpenBSD__ insque(3) needs rpmsq rock initialized. + - jbj: add #ifdef's needed to compile on __OpenBSD__. + - jbj: fix: permit " number %d" to be translated. + - jbj: fix: apply _dependency_whiteout to erased relations too. + - jbj: lua: display rudimentary info about lua with --showrc. + - jbj: WRlua: preserve forward linkage by avoiding vmefail/get_date. + - jbj: add a relation to to force install-before-erase. + - jbj: display dependency loops as an error for now. + +5.1.5 -> 5.1.6: + - jbj: verify trigger tests have same result as HEAD. + - jbj: backport rpmds functionality needed for file/dir triggers from HEAD. + - jbj: backport file/directory triggers from HEAD. + - jbj: add rpmdsMatch to match dependency against set. + - jbj: rpmdb: add rpmdbMireApply to retrieve primary keys from index. + - jbj: rpmio: add argiCmp and argiSort. + - jbj: add --whatconflicts/--whatobsoletes. + - jbj: fix: adding Fstat() broke perl builds. + - jbj: generate Obsoletename index in rpmdb. + - jbj: generate Filepaths index in rpmdb. + - bero: Python 2.6 support in configure.ac + - jbj: refactor the sumNN wrappers out of digest.c too. + - jbj: include crc routines in a standalone file. + - jbj: use a switch on errno to make leakage pathology filtering easier. + - jbj: use Stat(2) for --rpmiodebug tracing. + - jbj: fix: resurrect cpuinfo() probe, hack-o-rounds for both /proc & libio. + - jbj: rpmio: rewrite rpmioSlurp to use Fstat(2) instead. + - jbj: rpmrpc: add Fstat(2). + - jbj: fix: he->tag was returning RPMTAG_BASENAMES, not RPMTAG_FILEPATHS. + +5.1.4 -> 5.1.5: + - jbj: update sk.po (Translation Project). + - jbj: avoid mtab info leakage problems (#457940). + - jbj: selinux: resurrect lsetfilecon using libselinux API. + - jbj: use macro, not /bin/bash, in scriptlet_requires. + - jbj: don't run empty transactions, avoiding obscure error msg. + - jbj: permit a negative index as alias for the last problem added to set. + - jbj: warn if package is not added because of platform affinity patterns. + - proyvind: lzdio: fix build with recent api changes. + - jbj: fix: initialize next element of rpmlog store correctly. + - jbj: update {nl,id,pl}.po (Translation Project). + - rse: rpmio: allow newer fnmatch to build on non-Linux platforms, too. + - jbj: rpmio: upgrade fnmatch to version that implements FNM_EXTMATCH. + - jbj: hdrfmt: triggerconds header extension display was incorrect. + - jbj: don't install symclash.* to avoid picking up a dependency on python. + - jbj: fix: check added file names against installed conflicts. + - jbj: update nl.po (Translation Project). + - rpm.org: permit hardlinks only with regular files. + - jbj: fix: tagType() with multiple aliases returned the wrong type. + - jbj: sqlite: fix: insure that tagType() returns result from stable sort. + - rse: upgrade build environment to GNU libtool 2.2.6 + - jbj: lua: fix: don't unlink a non-existent scriptlet file. + - jbj: display error msg for lusers attempting "rpm -qp /bin" (#461362). + - jbj: WR: remove version from config paths. + - jbj: lua: fix: don't close dup'd stdout running lua scripts. + - jbj: macosx: avoid multiple definitions of _program_name. + - jbj: merge po files. + - jbj: don't expand removed python/rpm/Makefile.in. + - rse: upgrade embedded Lua from version 5.1.3 to 5.1.4 + - jbj: WR: remove --with-path-versioned in devtool targets. + - jbj: WR: remove $(VERION) from macros paths in devtool targets. + - jbj: WR: fix: cleanup patch integration thinkos. + - jbj: WR: mark wrs-rpm-enable-macro-validation.patch (but leave disabled). + - jbj: WR: fix: add rt-reloc-wrapper.sh to EXTRAS_DIST. + - jbj: rescusitate w make distcheck. + - jbj: update po files. + - jbj: don't attempt openssl memleak cleanup w/o openssl. + - jbj: WR: add devtool windriver-{host,target} configuration targets. + - jbj: adopt AM_PATH_PYTHON AutoFu variables. AM_PATH_PYTHON will be used eventually. + - jbj: python: simplify Makefile.am + - afb: check that crc32_combine/adler32_combine really exist, for murky old + zlib. + - afb: remove undefined references too + - jbj: WR: run-time discovered configuration goopiness, take 1. + - jbj: display cpuinfo path with --showrc. + - jbj: display sysinfo path with --showrc. + - jbj: remove internal zlib. + - jbj: WR: add %windriver target to devtool.conf. + - jbj: WR: eliminate most compiler warnings. + - jbj: WR: eliminate duplicated AutoFu boilerplate, use system.h instead. + - jbj: WR: eliminate getdate.[ch], use same from rpmio instead. + - jbj: WR: eliminate dueling AutoFu defines from shadow_config.h, use RPM's + config.h (through system.h) instead. + - jbj: WR: eliminate xmalloc.c, use system.h defines instead. + - jbj: WR: rename config.h to shadow_config.h, include "system.h" instead. + - jbj: WR: rely on PATH to find pkg-config. + - jbj: WR: don't spew error messages with internal lua shadow module. + - jbj: WR: add shadow/chkconfig internal lua modules. + - jbj: WR: Color/arch affinity while upgrading on multilib platforms. + - jbj: WR: Permit configurable arch strings. + - jbj: WR: Use %{_host_vendor} and %{_host_os} for platform. + - jbj: WR: fakeroot maps devices to files. avoid /dev/* in checkfiles. + - jbj: db_tool: remove gcc whinings. + - at: gzdio: fixed and re-enabled rsyncable_gzwrite() + - rse: fix building under --with-lzma by providing the necessary 64-bit defines for inclusion of + - jbj: gzdio: quadruple check with external -lz. still no fix => disabled. + - jbj: gzdio: integrate the cpio tracking patch (needs to be done elsewhere) + - jbj: gzdio: disable rsync flushing until a fix can be attempted. + - jbj: gzdio: remove c99'ism. + - jbj: QNX: use strtouq() instead of strtoul() in rpmmtree. + - jbj: QNX: retrofit asprintf.h (from XAR) for the deprived. rpmmtree uses + (rewrite to eliminate asprintf is an alternative). + - jbj: QNX: supply missing typedef's for uint32_t. + - at: gzdio: return partial "best effort" bytes written with gzfoo errors. + - at: gzdio: do gzflush only after RSYNC_WIN boundaries. + - at: gzdio: push gzFile into a private container. + - jbj: make gzdio.c standalone. + - rpm.org: Teach Fflush about lzdio. + - jbj: add _flush to FDIO_t, make bzdio.c standalone. + - jbj: move glob/fnmatch into -lrpmio from -lrpmmisc. + - jbj: lua: don't exit chroot if already within running script. + - jbj: rescusitate "make check". + - jbj: permit building with older libtool-1.5.26 (back port from HEAD). + - bero: Fix hang when using rpmdsSingle and rpm4compat.h from C++ + - rse: configure: do not complain with "python: file not found" on platforms without python(1) in PATH + +5.1.3 -> 5.1.4: + - jbj: http: ignore 501 from OPTIONS attempt to non-DAV server. + - jbj: fix: "%description -n foo-bar" needs an additional comparison. + - jbj: add non-{GIF,XPM} formats opaquely using arbitrary Icon: tagno. + - jbj: fix: allocate Icon: buffer after iconsize is initialized. + - jbj: permit configurable POSIX behavior for parameterized macros + (Marcin Kowalczyk). + - jbj: fix: skip %exclude/%ghost files to get more accurate RPMTAG_SIZE. + - jbj: fix: RPMTAG_SIZE is incorrect with %exclude and %ghost directives + (Alexey Tourbin). + - rse: fix portability by providing own RPM_LIST_XXX macros in rpmmtree.c + +5.1.2 -> 5.1.3: + - rse: enhance RPM_CHECK_LIB to query pkg-config(1) --libs-only-L to get -L options, too. + - rse: add support for "lib-config" and "lib.pc" in RPM_CHECK_LIB + - rse: unbreak building without LZMAUtils library + - jbj: fix: reattach RPMMIRE_DEFAULT as posix regex, not strcmp, pattern. + - jbj: lzdio: start using -llzma instead. + - jbj: tests: add coverage for %pretrans et al scriptlets. + - rse: upgrade the embedded lrexlib Lua library from version 2.2.0 to 2.3.0 + - rse: apply upstream vendor patches from 2008-05-08 for Lua 5.1.3 + - jbj: tests: verify upgrades using the edos-test packages. + - jbj: parser: inherit group/summary/description if not specified in subpkg. + - jbj: parser: permit identically named sub-pkgs with different versions. + - jbj: parser: trim comments where it makes sense to do so. + - jbj: tests: add check-install target to attempt --relocate install. + - jbj: tests: enhance the devtool-sanity package with scripts and a file. + - jbj: tests: verify -Kv output using popt. + - jbj: tests: verify setup using --version/--querytags/--showrc. + - jbj: display noisy getconf()/uname() info with -vv --showrc instead. + - jbj: shorten debugging messages, --queryformat strings passed to + headerSprintf are getting huge. + - jbj: fix: NUL terminate dst on EXPR->ARRAY parser state transition + (see --yum:primary.yaml spew for reproducer). + - jbj: restore deploop diagnostic message (Kacper Kornet kornet@camk.edu.pl). + - jbj: fix: is_selinux_enbled() > 0 is the correct test. + - rpm.org: Mask signals while moving rebuilt rpmdb into place. + - rpm.org: Restore rpmdb selinux contexts to default after rebuild (#442149) + - jbj: debuginfo: refactor 2 existing upgrade policy rules before + adding a new contextually sensitive rule for -debuginfo packages. + - jbj: debuginfo: add general rpmdbCount() to get number of items for + any tag index, not just RPMTAG_NAME as was in rpmdbCountPackages(). + - jbj: add %_build_iconsize macro to permit configuration. + - jbj: trash-and-restore macro config for multiple CLI arg builds. + - jbj: rpmrepo: correct requiressqlentry tag name typo. + - jbj: fix: handle '%{arch}\' with \ at end-of-string correctly. + - jbj: tests: verify ref/* data using rpmdigest/rpmmtree. + - jbj: move rpmdigest/rpmmtree/rpmrepo back to tools/ for installation. + - jbj: tests: verify rpmrepo XML spewage using popt-1.14. + - jbj: tests: verify XML/YAML markup queries using popt-1.14. + - jbj: tests: download popt-1.14 packages for use in tests. + - jbj: yaml: fix: single element string arrays had extra "- ". + - jbj: yaml: remove the hotwired hack for SRPM dirnames indentation. + - jbj: add expanded build scripts for --specsrpm --queryformat spewage. + - jbj: backport --queryformat pipeline syntax from HEAD. + - jbj: update Russian PO file (from Translation Project). + - jbj: upgrade to db-4.7.25. + - jbj: rpmdb: fix: limit RUNRECOVERY attempts, not every lazy open. + - jbj: backport assorted rpmio changes from HEAD to stay in sync. + - jbj: make sure the open path is set when using [bgl]zdOpen vector too. + - jbj: lzdio: rework the layering to be more similar to gzdio/bzdio. + - jbj: rpmrepo: fix: --lzma segfault, lzdFdopen was not saving path. + - jbj: rpmrepo: add baseurl to the repo markup. + - jbj: rpmrepo: populate sqlite schema with PACKAGESIZE and PACKAGEDIGEST. + - jbj: simple parameterized namespace URI for Pkgid/Hdrid UUID generation. + - jbj: rpmrepo: compute digests for both compressed & uncompressed + repository markup components. + - jbj: update sv.po from the Translation Project. + - jbj: add SOURCERPM name at end-of-parse for --specfile queries and errmsg. + - jbj: splint: annotate argvAppend differently. + - jbj: add _fdopen to FDIO_t, expose fdbg(), make lzdio.c standalone. + - jbj: expose XfdLink/XfdFree/XfdNew, nuke the FDIO_t vectors. + - jbj: eliminate unused FDIO_t vectors. XfdLink/XfdFree/XfdNew need nuking. + - jbj: create lzdio.c to carry lzma comprssion, possibly w dlopen(). + - jbj: add --enable-build-gcov for CFLAGS -fprofile-arcs -ftest-coverage. + +5.1.1 -> 5.1.2: + - rse: upgraded build environment to GNU libtool 2.2.4 + - afb: standalone: file "magic" was installed in wrong directory + - jbj: add toplevel lcov-foo Makefile targets. Current coverage at + http://wraptastic.org/pub/jbj/rpm-5.1.DEVEL-lcov + - jbj: add --enable-build-gcov for CFLAGS -fprofile-arcs -ftest-coverage. + - jbj: hot-wire a top level "make check". noisy sanity check atm, todo++. + - jbj: backport top level tests/* for "make check". No tests in Makefile + SUBDIRS targets yet ... + - jbj: rpmrepo: add doxygen markup throughout, adjust splint annotations. + - jbj: update i18n from Translation Project. + - jbj: update po/POTFILES.in + - jbj: rpmuuid: add i18n to error messages. + - jbj: fix: rpm-python h['filenames'] needs tagName(0x54aafb71) to + return "Filenames" in order to find the filepathsTag extension. + - jbj: add a missing newline to a debug message. + - jbj: revert rpmtsOpenDB on --checksig path, rely on the lazy open + in rpmtsFindPubkey instead. + - jbj: fix: rpm -qp returns NOKEY because rpmdb is not yet open. Do a lazy + open in rpmtsFindPubkey. + - jbj: python: fix: insure that ts.setProbFilter() return is initialized. + - jbj: fix: --triggers segfault, don't depend on he->p.ptr = NULL after + headerGet() failed return. + - jbj: add RPMTAG_PACKAGESTAT, and store persistently in a rpmdb Header. + - jbj: disable loop unraveling error msgs for now. better needs to be done. + - jbj: rpmrepo: achieve {primary,filelists,other}.xml spew parity w createrepo. + - jbj: rpmrepo: compute origin *.rpm file digest while reading. + - jbj: preserve stat(2) & digest through headerReload(). + - jbj: get rid of copy-n-paste typos, add "l" type markers to rpmtag.h. + - jbj: add RPMTAG_PACKAGEDIGEST extension as RPM_STRING_TYPE. + - jbj: add digest of origin *.rpm to Header internal store. + - jbj: add RPMTAG_PACKAGESIZE extension as RPM_UINT64_TYPE. + - jbj: rework RPMTAG_PACKAGETIME extension as RPM_UINT64_TYPE. + - jbj: rework header{Get,Set}Time as header{Get,Stat}Statbuf methods. + - jbj: add stat(2) of origin *.rpm to Header internal store. + - jbj: permit file digests through (e.g.) :stat format extension. + - jbj: add :uuid format. UUIDv5 URI design & tag type coercion todo++. + - jbj: fix: blessed NUL termination for Readlink return. + - jbj: retrofit v5 UUID's for hdrid/pkgid digests as tag extensions. + - jbj: retrofit v1 UUID's for time stamps as tag extensions. + - jbj: replace "diskstat" tag with :stat format extension instead. + - jbj: add :digest format. + - jbj: generalize :utf8 to :iconv iconv(3) conversions. + - jbj: permit :base64 encoding to be applied to all tag data types. + - jbj: fix: use rpmlog instead of rpmError for messages. + - glen: print error when makeTempPath fails due missing temp dir + +5.1.0 -> 5.1.1: + - jbj: permit firefox debugging by creating an empty dir (#444310). + - jbj: header: free tag data on error retrurn with damaged data. + - rpm.org: rpmsw: insure that time has passed while calibrating (#435309). + - jbj: header: fix: avoid double free with damaged data (#442761). + - afb: fix VPATH builds finding rpmversion.h (in build) + - afb: fix parallel build of rpmdigest (automake quirk) + - jbj: rpmte: revert to individual tags instead of RPMTAG_NVRA. + - afb: macosx: fix thinko in previous xar linking workaround + +5.1b2 -> 5.1.0: + - jbj: rpmte: fix: snip ".arch" from "-release", same NEVRA check broke. + - nkukard: support building under Linux/uClibc in addition to Linux/GLIBC + - jbj: update id.po from Translation Project. + - rse: merge OpenPKG-specific "extension-based-compression-detection" change + - afb: disable intl/iconv for popt 1.14 under Mac OS X + - jbj: update {nl,pl,sl,sv,vi}.po from Translation Project. + +5.1b1 -> 5.1b2: + - rse: use latest POPT 1.14 for building with "devtool standalone" + - rse: replace obsolete AC_AIX and AC_MINIX checks with newer AC_USE_SYSTEM_EXTENSIONS to get rid of Autoconf warnings + - rse: upgrade build environment to GNU autoconf 2.62 + +---- 5.2 FORK POINT ---- + +5.0.0 -> 5.1b1: + - jbj: update PO files from Translation Project for rpm-5.1 inclusion. + - jbj: permit installing 3.0.x SRPMS. + - jbj: rpmio: fix: add rpmluaFiles to loader map. + - jbj: fix: avoid assertion failure with entry->info.offset == 0. + - jbj: merge "support-rpmlua-option" patch from OpenPKG. + - jbj: merge "support-rpmpopt-option" patch from OpenPKG. + - jbj: merge "security-sanity-check-rpmpopt-and-rpmmacros" patch from OpenPKG. + - jbj: merge "no-extra-terminating-newline-on-eval" patch from OpenPKG. + - jbj: merge "explicit-source-fetch-cli-option" patch from OpenPKG. + - jbj: merge "download-source-files-from-original-location" patch from OpenPKG. + - jbj: merge "support-external-download-command" patch from OpenPKG. + - jbj: merge "support-srcdefattr" patch from OpenPKG. + - jbj: fix: RPMTAG_NVRA w .src/.pubkey in error msg is bogus. + - jbj: permit noarch sub-packages. Pattern match guaranteee next ... + - rpm.org: Enhance error message on failed ts lock acquire (rhbz#427064). + - jbj: fix the rpm.org memory leak. + - rpm.org: Don't use static buffers to communicate between funcs, avoid buffer overflows. + - rpm.org: Use more meaningful variable names than res2 and res3. + - rpm.org: Make signature verification result not depend on rpm verbosity level, ick. + - rse: upgraded build environment to use GNU libtool 2.2.2 + - rse: replace %as format specifier with malloc(3) plus %s under non-GLIBC sscanf(3) + - rse: various code cleanups related to pre-processor macros and C types + - rse: step back to the LZMA SDK 4.32 (which is identical to LZMA SDK 4.57), but with the rpm5.org cleanups still applied + - rse: resolve type conflict between Zlib and Lzma after upgrade to latest LZMA SDK 4.40 + - jbj: rpmdigest: s/--all/--alldigests/ w rpmio "make check". + - jbj: fix: segfault from clobbering RPMMIRE_STRCMP mode w platform string. + - proyvind: update to latest lzma sdk (4.40) + - rpm.org: Avoid entirely unnecessary static buffer + string copy. + - jbj: fix: reverse arrows on erasure dependency graph. + - rse: provide the necessary pre-processor macros to allow misc/err.h to compile with Sun Studio 12 under Solaris 10 + - jbj: rpmrepo: be kind to the sqlite3 deprived. + - jbj: rpmrepo: cleanly separate SQL representation from execution. + - jbj: rpmrepo: populate other.sqlite with live data. + - jbj: rpmrepo: populate filelists.sqlite with live data (w schema hackery). + - jbj: rpmrepo: populate primary.sqlite with live data. + - jbj: add :sqlescape for use in SQL statements generated by --qf. + - jbj: rework --yum:primary.sqlite to include quoting. + - jbj: add header extensions similar to xml for sql. + - jbj: rename the primary.xml et al header extensions, adding "xml". + - jbj: add :utf8 format conversion, use with :cdata format too. + - jbj: rpmrepo: unsnarl the data from the methods. + - jbj: rpmrepo: populate repomd.xml. + - jbj: rpmrepo: populate other.xml, add --yum:other.xml alias. + - jbj: rpmrepo: populate filelists.xml, add --yum:filelists.xml alias. + - jbj: rpmrepo: populate primary.xml. + - jbj: rpmdb: fix: initialize mireRegexec() pattern match buffers. + - jbj: set the values for the blanks while reading a package. + - jbj: add get/set methods to fill in remaining blanks in XML mark up. + - jbj: add :cdata format to permit strings to be included in XML CDATA. + - jbj: add --yum:primary popt alias to spew a primary.xml approximation. + - jbj: add header extensions for primary.xml markup. + - jbj: rpmfi: add 2 getter(s) and an additional (stubbed) iterator method. + - jbj: rpmmtree: functional multi-rooted specifications and verification. + - rse: fix macro option/argument parsing (again), this time by using POPT_CONTEXT_POSIXMEHARDER + - afb: fix endianness detection when compiling Mac OS X Universal Binaries. + - jbj: install rpmmtree in bindir, its at least as functional as mtree(8). + - jbj: add rpmmtree (from mtree(8) in OpenBSD). + - jbj; revert the unhelpful & pugly __attribute__((__unused__)) UNUSED() macro. + - jbj: add -Wno-missing-field-initializers -Wno-unused-parameter to stop spew. + - jbj: QNX: retrofit u_int32_t typedef where needed. + - jbj: add random arch name feelgood fluffiness (#432496). + - jbj: prepare for Fedorable dependency loops (#437041). + - rse: upgraded from GNU libtool 1.5.x to 2.2 + - jbj: rpmtar: use (if built) rpmtar feeble tests in "make check". + - jbj: rpmtar: splint annotations. + - jbj: rpmtar: nuke ttar.c/tdeb.c prototypes for rpmtar. + - jbj: rpmtar: abuse --format {ar,cpio,tar,ustar} as a selector for now. + - jbj: rpmtar: lash in -z/-j/-y/-Z compression options using popt. + - jbj: rpmtar: add stoopid file suffix detector for gzip/bzip2/lzma detect. + - jbj: rpmtar: abandon rpmtar -cvf for now, noop tar_mode_c(). + - jbj: rpmtar: move getdate.y lib -> rpmio for rpmtar linkage. + - jbj: mark write padding for possible refactoring to common code. + - jbj: ar: verify archive magic. + - jbj: ar: arSetup is only needed when creating archives. read EOF is wonky. + - jbj: verify that cpio/tar payloads can be created and installed. + - jbj: psm: fix: adding ar payloads broke install payload detection. + - jbj: use _IOSMRC macro to ensure read/write rc are handled consistently. + - jbj: make sure cpio/tar/ar are as similar as possible. + - jbj: keep tar.c parallel to ar.c coding conventions. cpio.c next. + - jbj: clean up most rpmio gcc -W warnings. + - jbj: clean up iosm/fsm gcc -W warnings. + - jbj: enable gcc -W warnings, fix most of the no-brainers. + - jbj: iosm: init file contexts during setup, not with missing dirs. + - jbj: iosm: add iosm->{nofdigests,nofcontexts} to avoid rpmts access. + - jbj: iosm: increase rdbuf/wrbuf size to 128K. + - jbj: iosm: better fix: use fi->isSource. use IOSM_MAP_{UID,GID} not yet... + - jbj: poptIO: move --usecrypto from poptALL. + - jbj: poptIO: fix: leave macro handling in poptALL.c for now. + - jbj: iosm: fix: don't call headerIsEntry(). + - jbj: fix: --eval was expanding twice (dueling poptIO <-> poptALL tables.) + - afb: avoid using the freed (realloced) value of msg for logging callback. + - afb: configure the path to the magic file, avoids external file assert(). + - afb: silence automake warnings about using variables with special meaning. + - proyvind: add rpm 4 API compatibility wrapper (currently adds support for at least urpmi, apt-get, ruby-rpm, rpmstats, rpmtools, & deltarpm) + - jbj: pass low-level stateless operations from fsmStage -> iosmStage. + - jbj: chain poptcliAllPoptTable -> rpmioAllPoptTable, start removing dupes. + - jbj: fsm: simplify fsm.c => rpmte.h dependency. + - jbj: perl: fix: include rpmio.h before rpmlib.h (for rpmRC returns). + - jbj: start creating I/O State Machine(IOSM) in rpmio/iosm.c. + - jbj: verify.c: use rpmProblemGetAltNEVR() to make rpmProblem opaque. + - jbj: fsm: use rpmfi iterators in several loops. + - jbj: rpmfi: add rpmfiSetHeader() so verify.c doesn't need _RPMFI_INTERNAL. + - jbj: rpmdav: refactor davOpendir et al on top of avOpendir. + - jbj: handle (GNU-style) ar(1) long member names. + - jbj: permit ar(1) payloads (file names are truncated atm). + - jbj: rpmmg: fix: avoid false failure using . + - jbj: macro: use popt rather than getopt(3), get rid of POSIXLY_CORRECT. + - jbj: rpmio: splint fiddles. + - rpm.org: Rip ancient, unused setperms + unsetgid make targets. + - rpm.org: Add %{sources} and %{patches} macros to build. + - rpm.org: Remove some ancient dead code. + - jbj: fix: eliminate librpmdb->librpm from dosetenv, use setenv(3) instead. + - jbj: fix: rpmtsCheck non-zero return doesn't print failed build deps. + - jbj: handle mireRegexec return change internal to rpm code. + - jbj: mire: change mireRegexec() return: >=0 match, -1 nomatch, else error. + - jbj: rpmgrep: start untwisting PCRE from rpmgrep (broken w/o PCRE atm). + - jbj: rpmgrep: add --stats benchmark insturmentatian (patterns soonishly). + - jbj: rpmdigest: add --stats benchmark insturmentation. + - jbj: rpmio: add common --stats option. + - proyvind: add some extra functionality to gendiff (ancient Mandriva patch by Chmouel Boudjnah) + - pixel: do check free size when bavail is 0 + - jbj: add variadic checks, remove warnings. + - jbj: refactor rpmcliErase to use same code as rpmtsInstall. + - jbj: fix: rpmtsCheck non-zero return prevents --erase. + - jbj: fix: avoid {pre,post}trans scrareMem assert failure. + - jbj: rpmio: add self-consistent rpmdigest --all verify test. + - jbj: rpmdigest: do algo name -> number with optionsTable instead. + - jbj: rpmio: add rpmdigest checks, fix some obvious deficiencies. + - rpm.org: make find-lang --with-gnome picks up omf files (rhbz#251400) + - jbj: rpmdigest: add digest verification from manifests a la coreutils. + - jbj: rpmio: increase no. of digests from 4 => 32 for rpmdigest --all. + - jbj: rpmio: ops, actually add rpmdigest.c. + - jbj: refactor digest algorithm popt tables into poptIO.[ch]. + - jbj: move rpmdigest tools/ -> rpmio/ for "make check" purposes. + - jbj: use Realpath(3) so that RPMTAG_PACKAGEORIGIN has absolute path. + - jbj: rpmio: add Realpath(3). + - jbj: fix: header ext for PACKAGEORIGIN needs xstrdup. + - jbj: use header ext to permit %{PACKAGEORIGIN} for -qp to show *.rpm path. + - jbj: mire: make mireClean mode specific. PCRE additions aren't initialized + - jbj: doxygen: make a pass removing many warnings ... + - jbj: rpmio: tglob added to EXTRA_PROGRAMS. + - jbj: add rpmgrep.c and poptIO.c to PO and doxygen file lists. + - jbj: sync translations (Translation Project). + - jbj: add "make updatepo" to simplify PO file maintenance. + - rpm.org: Improve header i18n locale matching. + - jbj: url: parse ?query#fragment from URI's. + - jbj: mire: add mireLoadPatterns() routine. + - jbj: mire: add mireAppend() routine. + - jbj: mire: add mireApply() and mireFreeAll() routines. + - jbj: rpmgrep: attempt LZMA decompress with ".lzma" suffix. + - jbj: rpmgrep: apply multiple --include/--exclude patterns to paths. + - jbj: rpmgrep: permit multiple --file, --exclude, and --include options. + - jbj: rpmgrep: collapse option booleans into a grepFlags bit set. + - jbj: rpmgrep: fix last 2 "make check" failures. + - jbj: rpmgrep: install in bindir with man page. + - rpm-maint: fix: limit exit codes to 254 to keep xargs happy. + - jbj: mire: add vallen argument to mireRegexec(). + - jbj: borrow pcregrep.c from pcre-7.6, rename as rpmgrep.c. + - jbj: rpmio: use tmire.c, not -DSTANDALONE, so librpmio doesnt rebuild. + - jbj: rpmio: add tmire to noinst_PROGRAMS. + - jbj: rpmio: add --regex/--pcre/--fnmatch/--strcmp tmire match options + - jbj: mire: add RPMMIRE_PCRE for the pcre(3) inclined. + - jbj: tweak up tmire with rpmioAllPoptTable. + - jbj: rpmio: add global __debug to use common rpmioAllPopt --debug option. + - jbj: use poptIO with rpmio noinst_PROGRAMS. + - jbj: rpmio: clone poptIO.[ch] from poptALL.c for rpmio noinst_PROGRAMS. + - jbj: rpmcli: remove duplicate nolibio entry in poptALL.c + - jbj: permit %{___NVRA} to parameterize the displayed NVRA while installing. + - jbj: create %___NVRA to split external <-> internal package names. + - rpm.org: Mass convert (back) to rpmTag as it's usable everywhere now + - rpm.org: Use rpmSigTag enum for signature tags everywhere, more or less.. + - jbj: import a modified copy of testHTML.c from libxml2. + - rpm.org: make gendiff sort the file list, so comparing the results is easier. + - jbj: rpmio: test programs link only -lrpmio -lrpmmisc. + - jbj: map tdir/tglob/tfts errors into exit codes. + - jbj: dav{Stat,LStat,Opendir) return ENOENT with malformed URI (including + no pesky trailing /). + - jbj: rpmdav: fix: supply davOpendir->davHEAD a statbuf to avoid tdir/tfts + segfaults on plain http. (only . and .. in directory). + - jbj: tweak up tglob debugging spew, add a Glob(3) stopwatch. + - jbj: tweak up tget debugging spew, trick in a Stat(2) on path, + add Stat(2)/Fread(3) stopwatches, display same as "ls -island" output. + - proyvind: python: add back RPMSENSE_FIND_REQUIRES, needed by rpmlint + - jbj: use hashFunctionString on URI path for st->st_ino/dp->d_ino values. + - jbj: rpmhash: expose hash{Equality,Function}String routines. + - jbj: tweak up tdir debugging spew, add a Opendir(3) stopwatch, + append pesky /. + - jbj: tweak up tfts debugging spew, add a Fts(3) stopwatch, append pesky /. + - jbj: rpmsw: add rpmswPrint to display stopwtch results. + - jbj: rpmdav: fix: check the pesky trailing '/' on collections correctly. + - jbj: rpmdav: add _dav_noption OPTIONS disabler, cache 1st result from URI. + - proyvind: trim multiple slashes from buildroot for check-files script (from Nanar/Olivier Thauvin) + - proyvind: make rpmdb cpp compliant (from spturtle/Christiaan Welvaart) + - jbj: "+bing": glob'd directory roots need trailing '/' for DAV URI's. + - jbj: "+bing": fix: check for glob'd directory roots before traversing. + - jbj: rpmio: rescuscitate tglob.c. + - jbj: rpmio: rescuscitate tdir.c. + - jbj: rpmio: fix: cvtfmode access beyond end-of-string with "r" fmode. + - jbj: rpmio: rescuscitate tget.c. + - jbj: fix: (again) rpmtsCheck() needs to return 1 when problems exist. + - jbj: install rpmcache in bindir, not pkglibdir. + - jbj: fix: Fopen: heh, I swear I had a rpmExpand() on fmode somewhen ... + - jbj: rpm.spec: nuke the xar.1 man page. + - jbj: rpmrpc: split stat(2) prints so valgrind can detect uninitialized. + - jbj: rpmcache: fix: don't check fo ".i386" suffix if name is too short. + - jbj: rpmcache: use file:///, not clunkier file://localhost/, url. + - jbj: rpmcache: add --cache opt-in, rather than --nocache opt-out, for now. + - proyvind: add sparcv9v2 (Niagara 2) architecture + - proyvind: add arch macros for alpha and sparc + - afb: workaround for "uuid_t" type conflict, between and "uuid.h" + - jbj: fix: python: re-add rpm.archscore() for smart depsolving usage. + - jbj: test for POPT earlier to avoid popt being blamed for neon configure failures. + - jbj: add --with-uuid=external, --with-pcre=external to devtool "system". + - rse: ensure that RPM Lua function util.rsplit("", ...) returns an empty table + - jbj: "+bing" -- handle no *.rpm package found condition correctly. + - jbj: "+bing" -- limit Fts(3) recursion to target directory traversal only. + - jbj: "+bing" -- define "%NEVRA bing" on-the-fly for use by glob patterns. + - jbj: "+bing" -- permit colon separated glob directory patterns. + - jbj: macro.c: include rpmuuid.h to remove warning. + - jbj: macro.c: add %{!?load:...} syntax, display error if %{load:...} fails. + - jbj: updated sv.po (Translation Project). + - jbj: fix: permit #%patchN comments by forcing single line expansion. + - jbj: document newer macro builtins (%{@foo:...}, %{uuid:...}, and %{lua:...} todo). + - jbj: fix: poldek in PLD needs replacement for headerGetRawEntry(). + - jbj: add rpmcliWalkFirst() to search (possibly multiple) dirs. + - rse: add _rpmgi_pattern_{glob,regex} macros for "+N" arg-to-path rewrite. + - jbj: functional "+N-V-R.A" path-to-repository expansions with -i/-U. + - jbj: mire.c: add STANDALONE test exerciser. + - jbj: use struct timeval timestamp for INSTALL{TID,TIME} and ORIGIN{TID,TIME}. + Note: TID.usec field is always 0 atm. + - rse: add new RPM macro "%{uuid:[[, , ]]}" for generating UUIDs of version 1, 3, 4 or 5 + - rse: add new C API function rpmuuidMake() for generating UUIDs of version 1, 3, 4 or 5 + - rse: provide both ORIGINTIME (based on INSTALLTIME) and ORIGINTID (based on INSTALLTID) + - jbj: pedantic identification of Foo (not foo) syscalls in --fsmdebug spew. + - jbj: fix: --rollback PSM_INIT changes added fstates before initialize. + - rse: ensure macro option parsing is done correctly also under GLIBC by not allowing option/argument permutations + - jbj: retrieve old originTime earlier to include identical package replace. + - jbj: fix: functional "-N-V-R.A" erasures-within-upgrade transactions. + - jbj: fix: retrieve originTime from old, not new, header. + - jbj: permit "-N-V-R.A" erasure args within install/upgrade transactions. + - jbj: propagate the time a package was first installed through upgrades (available via tag "ORIGINTIME"). + - jbj: replace sr.po from translation project. + - jbj: fix: rpmtsCheck() needs to return 1 when problems exist. + - rse: (again) replace u_int32_t with uint32_t to be consistent across the code base + - jbj: use RPM_OS_NTOQNX as manifest constant. + - jbj: updated nl.po (Translation Project). + - rpm.org: Missing space in russian translation (mdvbz#36974). + - rpm.org: Quote find-debuginfo builddir to avoid whitespace issues. + - jbj: generalize to verify(*) => -Va and verify(/path) => -Vf /path. + - jbj: fix: no output performing verify(...) probe. + - jbj: fix: insure valid exit code for verify(...) probe. + - jbj: add verify(N) = E:V-R runtime dependency probe. more to do ... + - jbj: stub in RPMTAG_FILESTAT and RPMTAG_STAT extensions, w-i-p. + - jbj: re-add PayloadFilesHavePrefix/CompressedFileNames w --lsb. + - rse: provide %{shrink:} macro for removing leading+trailing and removing intermediate whitespaces + - rse: allow sub-shell and Lua independent speedy lookup of environment variables via %{getenv:} in macros + - jbj: QNX needs defines for fts.c. + - rse: upgrade from Lua 5.1.2 to Lua 5.1.3 (external and internal) + - jbj: include everywhere. + - jbj: rpmsq.h doesn't need pthread condvar/mutex any more. + - jbj: QNX does not have insque/remque. + - jbj: QNX does not have d_off. + - rse: add RPM Lua function rpm.debug() to complement rpm.verbose() + - mej: catch EOF returned as RPMRC_NOTFOUND correctly. + - rse: add support for QNX by adjusting to its 3-parameter based makedev(2) + - jbj: resurrect rpm.spec.in. + - jbj: fix: permit %{lua:...} to recurse. + - rse: allow to compile without and its nl_langinfo(3) + - rse: provide RPM Lua function posix.glob() + - rse: make older C compiler happy by not declaring a variable in the middle of a block in rpmconstant/constant.c + - rse: let RPM Lua init procedure load all init scripts configured with new Autoconf option --with-path-rpmlua + - rse: fix Autoconf procedure by running python(1) based checks only under --with-python + - rse: provide RPM Lua function rpm.realpath() to complement RPM macro %{realpath:} + - rse: unconditionally provide RPM Lua functions posix.{setenv,unsetenv} + - jbj: proof-of-concept rpmbuild --lsb implementation. ptooey! + - jbj: unbreak rpm-python, preserve existing symbol in released versions. + - jbj: fix several typos noticed by the translation project. + - jbj: add --noautoreq/--noautoprov options to rpmbuild. + - proyvind: Rename rpmcliImportPubkey() -> rpmtsImportPubkey() (from and for a hint of rpm.org API compatibility;) + - proyvind: expose more functions in rpmps API (as rpm.org, initially based on us ;p) + - jbj: fix: plug memory leak with digest algos array. + - jbj: fix: --relocate no longer needs to copy dirIndexes data. + - proyvind: make perl install directory overriddable from configure as an argument (--with-perl=vendor/site) + - proyvind: fix install location of man pages for perl bindings + - proyvind: fix install location of pkgconfig & python bindings (lib64 fix) + - jbj: don't follow symlinks using chown/chgrp from --setugids pipe. + - jbj: sync *.po with the translation project (sr@latin.po needs work). + - rse: add a RPM Lua function rpm.sleep() as a trivial frontend to sleep(3) + - rse: fix PGP clearsign signature verification by correctly skipping RFC2440 "dash-escapes" + - rse: fix line-continuation handling in macro definition parsing + - rse: implement RPM Lua function util.textwrap() for auto-wrapping junks of larger text messages + - rse: upgrade RPM Lua functions util.rmatch(), util.rsubst() and util.rsplit() to new lrexlib 2.2 + - rse: upgrade the RPM Lua extension lrexlib from ancient version 1.1x to latest version 2.2 + - jbj: permit opt-in network access using %_rpmgio macro. + - jbj: fix: deny rpmioSlurp network access (like all other Fopen call's). + - rse: add RPM Lua function rpm.slurp() for slurping in the whole content of a file or an URL + - rse: add OSSP uuid support to RPM Lua via functions uuid.generate() and uuid.describe() + - rpm.org: Assorted int -> size_t corrections for string lengths. + - rpm.org: More assorted int -> size_t uses. + +============================================================================= + +5.0.3 -> 5.0.4: + - jbj: QNX: retrofit u_int32_t typedef where needed. + - jbj: add random arch name feelgood fluffiness (#432496). + - jbj: prepare for Fedorable dependency loops (#437041). + - proyvind: add more compatibility adaptions to rpm4 compatibility wrapper (making deltarpm & ruby-rpm work) + - proyvind: add rpmfiBuildFNames() to rpm4 compatibility wrapper (needed by rpmstats) + +5.0.2 -> 5.0.3: + - proyvind: add rpm 4 API compatibility wrapper (urpmi & apt-get succesfully ported with this so far \o/) + - afb: python: backport fix for rpm.archscore() and add rpm.platformscore(). + - jbj: fix: eliminate librpmdb->librpm from dosetenv, use setenv(3) instead. + - jbj: fix: rpmtsCheck non-zero return doesn't print failed build deps. + - proyvind: add some extra functionality to gendiff (ancient Mandriva patch by Chmouel Boudjnah) + - pixel: do check free size when bavail is 0 + - jbj: refactor rpmcliErase to use same code as rpmtsInstall. + - jbj: fix: rpmtsCheck non-zero return prevents --erase. + - jbj: fix: avoid {pre,post}trans scrareMem assert failure. + - rpm.org: make find-lang --with-gnome picks up omf files (rhbz#251400) + - proyvind: python: add back RPMSENSE_FIND_REQUIRES, needed by rpmlint + - proyvind: trim multiple slashes from buildroot for check-files script (from Nanar/Olivier Thauvin) + - proyvind: make rpmdb cpp compliant (from spturtle/Christiaan Welvaart) + - jbj: fix: (again) rpmtsCheck() needs to return 1 when problems exist. + - rse: add support for QNX by adjusting to its 3-parameter based makedev(2) + - proyvind: add sparcv9v2 (Niagara 2) architecture + - proyvind: add arch macros for alpha and sparc + +5.0.1 -> 5.0.2: + - jbj: fix: python: re-add rpm.archscore() for smart depsolving usage. + - jbj: backport %{shrink:...} and %{getenv:...} builtin macros. + - jbj: updated sv.po (Translation Project). + - jbj: fix: permit #%patchN comments by forcing single line expansion. + - jbj: document newer macro builtins (%{@foo:...}, %{uuid:...}, and %{lua:...} todo). + - jbj: fix: poldek in PLD needs replacement for headerGetRawEntry(). + - rse: ensure macro option parsing is done correctly also under GLIBC by not allowing option/argument permutations + - jbj: pedantic identification of Foo (not foo) syscalls in --fsmdebug spew. + - jbj: fix: --rollback PSM_INIT changes added fstates before initialize. + - rse: allow to compile without and its nl_langinfo(3) + +5.0.0 -> 5.0.1: + - jbj: replace sr.po from translation project. + - rse: fix Autoconf procedure by running python(1) based checks only under --with-python + - jbj: fix: rpmtsCheck() needs to return 1 when problems exist. + - jbj: use RPM_OS_NTOQNX as manifest constant. + - jbj: updated nl.po (Translation Project). + - jbj: resurrect rpm.spec.in. + - jbj: automake for xar internal. + - jbj: re-add PayloadFilesHavePrefix/CompressedFileNames w --lsb. + - jbj: QNX needs defines for fts.c. + - jbj: include everywhere. + - jbj: rpmsq.h doesn't need pthread condvar/mutex any more. + - jbj: QNX does not have insque/remque. + - jbj: QNX does not have d_off. + - jbj: proof-of-concept rpmbuild --lsb implementation. + - mej: catch EOF returned as RPMRC_NOTFOUND correctly. + - jbj: fix: permit %{lua:...} to recurse. + - jbj: unbreak rpm-python, preserve existing symbol in released versions. + - jbj: fix several typos noticed by the translation project. + - proyvind: Rename rpmcliImportPubkey() -> rpmtsImportPubkey() (from and for a hint of rpm.org API compatibility;) + - proyvind: expose more functions in rpmps API (as rpm.org, initially based on us ;p) + - jbj: fix: plug memory leak with digest algos array. + - jbj: fix: --relocate no longer needs to copy dirIndexes data. + - proyvind: make perl install directory overriddable from configure as an argument (--with-perl=vendor/site) + - proyvind: fix install location of man pages for perl bindings + - proyvind: fix install location of pkgconfig & python bindings (lib64 fix) + - proyvind: fix install location of rpm.pc (lib64 fix) + - jbj: don't follow symlinks using chown/chgrp from --setugids pipe. + - jbj: sync *.po with the translation project (sr@latin.po needs work). + - rse: fix PGP clearsign signature verification by correctly skipping RFC2440 "dash-escapes" + - rse: fix line-continuation handling in macro definition parsing + - jbj: permit opt-in network access using %_rpmgio macro. + - jbj: fix: deny rpmioSlurp network access (like all other Fopen call's). + - rpm.org: Assorted int -> size_t corrections for string lengths. + - rpm.org: More assorted int -> size_t uses. + +---- 5.1 FORK POINT ---- + +5.0b4 -> 5.0.0: + - rse: final polishing of NEWS document + - rse: align "rpm [--verbose] --version" output with the syntax used in mostly all GNU tools nowadays + - mgh: allow --ignoresize when doing an erase + - rse: fix database configuration for recently added indices "Nvra" and "Sourcepkgid" + - jbj: differentiate %warn and %error (now stops) behavior (from openpkg). + - jbj: merge %{realpath:...}. won't hurt a thing (from openpkg). + - jbj: set macro_BUFSIZ as 16K independent of BUFSIZ (from openpkg). + - rse: add RPM Lua function util.rsplit() for flexibly splitting strings into tokens based on regex + - rse: add rpmlogGetCallback() function to allow one to restore the complete rpmlog() callback information + - rse: add rpmluaGetGlobalState() function to allow foreign code to further extend the RPM Lua environment + - rse: add RPM Lua function rpm.verbose() to be able to check CLI option --verbose + - rse: add often required RPM Lua convenience function util.slurp() + - rse: add PCRE to "devtool standalone" procedure + - rse: make RPM configuration in "devtool standalone" procedure more flexible + +5.0b3 -> 5.0b4: + - jbj: fix: calculate clearsign'd text digests correctly. + - jbj: fix: display RPMRC_NOKEY failures explicitly. + - jbj: rip --predefine entirely, add comment re macro added both global/CLI. + - jbj: link tpgp against rpmnsProbeSignature() instead. + - jbj: add (hidden) --usecrypto option. + - jbj: add a (unused) flags arg to rpmnsProbeSignature. + - jbj: change rpmnsProbeSignature to return rpmRC (note: success is 0 now). + - jbj: add --rpmnsdebug to see rpmnsProbeSignature() spew. + - jbj: permit URI's in signature(...) arguments. + - jbj: fix: argvSplit was doing ltrim and skipping spans of seperators. + - rse: improve RPM Lua function util.rsubst(): perform repeated substitutions and honor prolog/epilog parts + - jbj: re-add all the debugging spew under --rpmnsdebug for now. + - jbj: functional signature(...) name space probe. + - jbj: add rpmnsProbeSignature() & "signature(/text:/sig) = /pub:id" probe. + - jbj: pgpReadPkts: truncate binary encoded pgp pktlen to actual length. + - jbj: pgpReadPkts: identify binary encoded pgp pkts correctly. + - jbj: fix: remove unused assertion. + - jbj: fix: undo deliberate damage from rpm's RHL8 security audit. ptooey! + - rse: allow assertion of a particular GnuPG signing key via "gnupg() = " in dependencies + - rse: fix invocaction of GnuPG's gpg(1) command for gnupg() dependency assertions + - afb: hide the rpmlib Version/Timestamp/Vendor markers spew unless verbose. + - rse: fix %{@foo} macro stack expansion including also the value at the stack bottom + - rse: remove the confusing additional --predefine behaviour when --define is used as the first CLI option + - jbj: simplify expandFIFO(). + - jbj: use "\n", not ",", as the default for %@foo expansion. + - jbj: fixup %{@foo:, } per rse comments. + - jbj: convert %{@foo:|} to "foo|bar|quux" tuple. %@foo assumes CSV comma. + - rse: implement "rpm --undefine " as the counterpart to "rpm --define ' '" + - afb: added %__objext,%__libext,%__shlibext,%__exeext for file extensions. + - rse: make size of line buffer for .spec file parsing run-time configurable via macro _spec_line_buffer_size + - rse: improve %patch macro implementation: less expansion redundancy and macro namespace collision avoidance + - rse: fix %{uncompress:.lzo} by passing the required "-dc" options to LZOP's lzop(1) + - rse: fix %{uncompress:.lzma} by passing the required "-dc" options to LZMA Utils' lzma(1) + - rse: support arbitrary hash algorithm via the originally intended syntax "digest([:]/path) = hex" + - rse: compare MD5 hex value on "digest(/path) = hex" dependency case-insensitive to be less restrictive in syntax + - rse: merge scripts/lua-dump.lua directly into lua/local/llocal.lua to make it always easily available + - rse: add local Lua functions util.rmatch() and util.rsubst() for regex matching/substitution + - rse: improve rex.new Lua object by using PCRE if possible and fallback to POSIX regex only + - rse: fix loading of "local" Lua extension: it has to come after the other extensions as uses them + - rse: add error handling to the Lua script loading code generated by bin2c + - rse: add an RPM Lua function rpm.load() for loading external RPM macro definition file + - rse: provide RPM Lua function rpm.undefine() based on the C function rpmUndefineMacro + - rse: provide rpmUndefineMacro API function to complement the existing rpmDefineMacro API function + - rse: add scripts/lua-dump.lua, a recursive dumper for Lua data structures + - rse: fix parsing of the table key in RPM Lua function rpm.macros() + - rse: add an RPM Lua function rpm.source() for loading and executing external Lua script file + - rse: output "Fetching(SourceX): " to clearly indicate that something is fetched remotely + - rse: try to download missing source files from remote location only if %{_Rxxxx} is really defined + - jbj: permit rpm -q --qf '%{track}\n' --specsrpm foo.spec queries. + - jbj: fix: supply additional indentation for forced array[1] with --yaml. + +5.0b2 -> 5.0b3: + - afb: make find-lang.sh work with sed that doesn't have \+ in regexps. + - afb: make sure to dereference symlinks for the python library paths. + - jbj: fix: permit -bt on specfiles w/o %track, remove an assertion. + - rse: fix paths to stringbuf.[ch] + - pixel: fix http://qa.mandriva.com/show_bug.cgi?id=27417. + - jbj: expedient fix for http://qa.mandriva.com/show_bug.cgi?id=31680. + - jbj: functional rpmbuild -bt foo.spec (if %track is present in foo.spec). + - jbj: fix: insure that %{name} is expanded correctly in srpm paths. + - jbj: using tagValue() rather than tagGenerate() permits changing the tagno + to & from arbitrary transparent. likely more needs doing. + - jbj: reimplement %track as an arbitrary section. + - jbj: generalize tagStore to keep track of arbitrary tag name/content. + - jbj: move stringbuf lib -> rpmio for use by tagStore. + - jbj: preliminaries for %foo arbitrary section parsing (not added yet). + - jbj: start using rpmParseState typedef rather than int. + - jbj: fix: explicitly add mkdir -p to spec_install_pre. + - jbj: explicitly compare against PART_NONE, avoid RPMRC_FOO collisions. + - jbj: fold in patch-as-plain-macro changes. + - jbj: fix some minor memory leaks. + - jbj: XAR magic is detected when reading packages, --xar is superfluous. + - jbj: eliminate development construction scaffholding. + +5.0b1 -> 5.0b2: + - rse: DJBX33A hash with unrolling is more better (no need to measure). + - afb: made it compile on Cygwin too. + - jbj: add Foo:Bar:Baz indices for now. + - jbj: permit arbitrary tags to be indexed by "Name", not Tag_0x12345678. + - jbj: permit tag aliases in rpmdb index names (Filedigests <-> Filemd5s). + - jbj: remember (and use) the configured dbi names, not tagName() returns. + - jbj: fix: configure rpmdb indices using Filedigests, not older Filemd5s. + - jbj: insure that he->tag is set for use by format extensions. + - rse: do not segfault on invalid usages like "rpm -qa '!name=foo'" + - jbj: fix: explicit rpmtsOpenDB on -Kvv code paths. + - jbj: more bleeping newlines. + - jbj: put newlines back into the format now that rpmpkg msgs don't supply. + - rpm.org: Add getter methods for rpmlogRec items (message + level). + - jbj: another attempt to identify the RPM_I18NSTRING_TYPE flaw. + - jbj: attempt to measure performance improvement using binary tag search. + - jbj: trade an I18NSTRING assert failure for a memory leak for the moment. + - jbj: push rpm2cpio w-i-p into cvs, try to measure linear <-> bsearch win. + - rpm.org: Logging enhancements (not the best fix, much more needs doing). + - rpm.org: Make rpmLogRec opaque. + - rpm.org: Fix misleading indentation. + - rpm.org: Add python method for for retrieving (without setting) ts vsflags. + - jbj: re-enable preferring rpmnss (if WITH_NSS is defined). + - jbj: fix: --rebuilddb needs an explicit open for Pubkeys lookup. + - rpm.org: Register the new SCRIPT_ERROR callback value to python. + - jbj: leave behind the heavy duty debugging goop for the next --qf buggery. + - jbj: fix: consume the escaped character after copy, wotta pita. + - jbj: simplify *Format routines, he->p is now reliably populated and const. + - jbj: rewrite shescapeFormat to count # escapes needed, not sloppy realloc. + - jbj: add debugging hack to test a hypothesis re rpm-5.0beta1 segfault. + - jbj: Leopard claims to have functional stat64. Let's find out ... + +5.0a4 -> 5.0b1: + - rpm.org: Yet More RPMRC_OK returns from functions. + - rpm.org: use RPMRC_OK, not 0, returns in many functions. + - rpm.org: @return, not @returns, in doxygen markup. + - rpm.org: Don't do tilde expansion if HOME not set. + - rpm.org: Add RPMCALLBACK_SCRIPT_ERROR callback type (not the best fix). + - jbj: relax the current header sanity checks, permit 1Gb headers. + - jbj: refactor some final \n out of msgs into rpmlog format instead. + - jbj: add global pgpDigVSFlags, nuke unused pgpDig{Get,Set}VSFlags. + - jbj: punt on minor issues for beta1. + - jbj: rpm2cpio: fail http/https transport attempts with error. + - jbj: install /usr/bin/rpm2cpio executable. + - jbj: install /usr/lib/rpm/rpm2cpio shell script. + - jbj: install /usr/lib/rpm/vcheck. + - jbj: RPMTAG_TRACK tag is being added to srpms. + - jbj: fix: display canonical "Headeri18ntable" tag name correctly. + - jbj: pop RPMTAG_TRACK work-in-progress into CVS. push "segfault on HEAD". + - jbj: stub in Requires: sanitycheck(N) probe. needs to run the script, duh. + - jbj: drill sanitycheck exec into psmStage() like %verifyscript. + - jbj: --rebuilddb has too many NOKEY's using rpmnss. use rpmbc in beta1. + - jbj: fix: rpmbuild --sign needed to test for password entry. + - jbj: display the rpmlib Version/Timestamp/Vendor markers lest I forget. + - jbj: macro expand all scriptlet bodies before execution. W00t! + - jbj: populate RPMTAG_BUILDMACROS. implementation took 6+ years ... + - jbj: add %sanitycheck scriptlet to packages. more wiring needed todo++. + - jbj: add %track section/scriptlet. Hmmm, not in *.rpm content yet, todo++. + - jbj: add RPMTAG_CLASS as one more spec file tag. arbitrary tag next ... + - jbj: rpmssl.c w DSA is gud enuf to go into beta1 (but disabled/unused). + - rse: provide --with-name=NAME Autoconf option to allow packagers to "brand" RPM + - rse: apply all remaining OpenPKG patches -- fully disabled by default under defined(RPM_VENDOR_OPENPKG) + - jbj: flesh out rpmssl implementation. DSA seems OK, no clue RSA yet. + - jbj: flesh out rpmgc implementation. stil buggy ... + - jbj: stub in rpmgc/rpmssl for gcrypt & openssl signature verification. + - rse: add XAR support to "devtool standalone" + - jbj: fix: s/RPM_/RPMLIB_/ in rpmversion.h.in. That should "stick" now. + - rpm.org: credit for the original NSS hacks. + - jbj: no-brainer AutoFu for WITH_NSS enabling, add rpmnss.[ch] to rpmio. + - jbj: tkey indicates functional DSA verification with rpmnss.c. + - jbj: fix: debug the stoopids in rpmnss.c. + - jbj: eliminate dueling typdef byte, beecrypt "owns" the typedef. + - jbj: make sure that yum can upgrade zlib-devel. Trash the DEAD code. + - jbj: resurrect rpmMergeHeadersFromFD goop. Yah, mon, DEAD code ... + - jbj: re-add symbols needed for rpm-python import to loader map. + - jbj: stub in WITH_NSS define to try rpmnss. Yep, borked, but now tested. + - jbj: complete rpmnss.[ch] implementation (untested). + - jbj: stub in the rpmnss.[ch] implementation. + - jbj: pluggable RSA/DSA signature verification framework. + - rpm.org: Rename _rpmdbMatchIterator -> rpmdbMatchIterator_s. + - jbj: split out implementation specific storage from pgpDig. + - jbj: create rpmbc.c and rpmbc.h to hide beecrypt signature internals. + - jbj: hide additional beecrypt RSA/DSA signature verification. + - jbj: add toy methods to hide beecrypt RSA/DSA signature verification. + - rpm.org: Split digest-stuff out of rpmio_internal to separate header. + - rpm.org: Eliminate copy-paste fd digest stealing, stuff into rpmio_internal. + - rpm.org: Add doxygen grouping to rpmte methods. + - rpm.org: Add doxygen grouping to rpmds methods. + - rpm.org: Lose the useless rpmrc python stuff, group macro handling to rpmmacro-py. + - rpm.org: rpmpgp doxygen tagging. + - rpm.org: Add bunch of missing rpmts doxygen groupings. + - rpm.org: Move file state defs to rpmfi where they logically belong. + - rpm.org: Move file type enums to rpmfi where it logically belongs. + - rpm.org: Move RPMFILE_* file attributes to rpmfi.h. + - rpm.org: Move file action enums to rpmfi where they logically belong. + - rpm.org: Move rpmprobFilterFlag enums to rpmps where they logically belong + - rpm.org: Move rpmtransFlags enums to rpmts.h where it logically belongs. + - jbj: hijack rse's versioning name space, add to *.rpm packages too. + - jbj: fix: rpmbuild -ba dir/foo.spec was broken. + - jbj: arbitrary tags w RPM_STRING_ARRAY_TYPE default type, append assumed. + - jbj: eliminate tagName "(unknown)" failure, return "Tag_0x12345678" + - jbj: re-enable binary, not linear, tag lookups. + - jbj: strip leading "RPMTAG_" prefix, in tagValue lookup. + - jbj: test arbitrary bit, not tag lookup failure, for --yaml/--xml display. + - afb: pass level on, to %{__lzma}. + - jbj: revert binary search, todo++. + - jbj: using tagValue instead permits queries of arbitrary tags. + - jbj: do binary, not linear, search for tag name/type/value. + - jbj: lazy arbitrary tag array initialization in rpmTags methods instead. + - jbj: eliminate hard-wired static nameBuf for tag strings. + +5.0a3 -> 5.0a4: + - rse: provide RPM version in API via macros RPM_{VERSION,TIMESTAMP,VENDOR} and functions rpm_{version,timestamp,vendor} + - jbj: pkgio: hdlist readers need RPMRC_NOTFOUND EOF indicator. + - jbj: pkgio: drill in sufficient debugging to sort per/python I/O issues. + - jbj: re-add symbols for perl "make test". hmm, headerRead failure todo++. + - jbj: parse arbitrary tags permitted by _arbitrary_tags white list. + - jbj: fix: renumber rpmParseState_e to avoid rpmRC error returns. + - rpm.org: remove unnecessary includes. + - jbj: stub in arbitrary tag methods. + - jbj: fix: ditto, for *.src.rpm as well. + - jbj: fix: RPMTAG_BUILDTIME is type RPM_UINT32_TYPE, not RPM_STRING_TYPE. + - jbj: fix: getBuildTime returns uint32_t *, not uint32_t. + - jbj: rpmbuild: more memory leak plugging. + - jbj: rpmbuild: plug some memory leaks. + - jbj: fix: return 0, not -1, with unsigned changes as error. + - jbj: add HEADERGET_NOEXTENSION disabler, kill off headerGetEntry. + - jbj: 1 down, 2 to go, to get rid of headerGetEntry. + - jbj: limit headerGetEntry usage to -lrpmdb only. + - jbj: Eliminate header.h and hdrinline.h. + - jbj: insure that HE_t in headerGet/headerNext is initialized sanely. + - jbj: python: lose rpmMergeHeaderFoo methods. + - jbj: eliminate headerFreeData, w00t!, just free all tag data. + - jbj: finalize headerInit/headerNext/headerFini, add to the ABI. + - jbj: include only where needed, doco remaining destruction. + - jbj: finalize headerMod, add to the ABI, remove HME_t goop. + - jbj: finalize headerDel, add to the ABI, remove HRE_t goop. + - jbj: finalize headerPut, add to the ABI, remove HAE_t goop. + - jbj: finalize headerGet, add to the ABI, remove HGE_t goop. + - jbj: re-add headerSprintf to the ABI, removing wrappers/methods. + - jbj: move headerSprintf goop out of header.c into hdrfmt.c. + - jbj: python: hmmm, add header extensions to dictionary correctly. + - jbj: terminate on headerTagTable sentinel, don't use rpmTagTableSize. + - jbj: use NULL default, not rpmTagTable, arg to headerSprintf everywhere. + - jbj: hdrfmt.c: relocate (and extend) rpmDisplayQueryTags. + - jbj: add tag{Clean,Name,Value,Type} methods to librpmdb. + - jbj: lose header.h in favor of rpmtag.h several places. + - jbj: make "struct headerTagTableEntry_s" opaque. + - jbj: rpmte.h: mark the diagnostic routines with _RPMTE_INTERNAL. + +5.0a2 -> 5.0a3: + - jbj: remove signature header padding issue from the TODO. + - jbj: fix: --querytags as uint32, not int32, display array return type. + - jbj: add level of chaining indirection => opaque headerSprintfExtension_s. + - jbj: casts to remove compiler signedness warnings. + - jbj: display 1st 8 bytes of content for XAR archive members. + - jbj: remove newlines in pkgio messages. + - jbj: fix: padding between signature <-> metadata headers wrong, grr. + - jbj: rpmxar.c: rearrange the messy markup and defines. + - jbj: remove messy HAVE_XAR_H from installed rpmxar.h include. + - jbj: retrofit 3 needed typedef's when compiling w/o HAVE_XAR_H. + - jbj: rescusitate txar, pass private buffer through rpmxarPush. + - jbj: re-add rpm2cpio.c. + - jbj: spiffy error msgs for the XAR challenged users. + - jbj: splint fiddles for rpmxar and rpmTag. + - jbj: bury timedRead in pkgio.c, eliminate everywhere else. + - jbj: eliminate (unused) hPTR_t. + - jbj: hmm, a memory leak, add doco to the TODO file. + - jbj: eliminate hTAG_t, use "rpmTag *" instead. + - jbj: drill rpmTag everywhere needed in header methods. + - jbj: unsnarl header.h from everything else. + - jbj: eliminate hRET_t, use rpmTagData instead. + - jbj: fix: files.c: pass union ptr, not 1st element, address. + - jbj: eliminate hTYP_t and hCNT_t typedefs everywhere. + - jbj: fix: python: pass pgpDig, not rpmts, as 1st arg to headerCheck. + - jbj: fix: python: include pkgio.h for rpmpkgRead prototype. + - jbj: fix: package.c: pass pointer to msg, not NULL, calling rpmpkgRead. + - jbj: eliminate rpm peculier int typedefs, use stdint types instead. + - jbj: convert all remaining uses of int_XY to stdint types. + - jbj: revert HEADER_XARALLOCATED gloopiness. + - jbj: functional (and leak free) -Kvv of both *.rpm and *.xar. + - jbj: revert xar handling to rpmio model, buffer handling in rpmxar. + - jbj: fix: add RPMRC_FAIL where needed using -Kvv. + - jbj: functional (and leak free) queries of both *.rpm and *.xar. + - jbj: transparently recognize XAR magic when reading. + - jbj: eliminate rpmpkgClean, rpmxar memory free on Fclose instead. + - jbj: use refcounted rpmxar attached to FD_t to handle xar state. + - jbj: switch to using rpmxar instead of rpmwf most everywhere. + - jbj: stub in rpmio/rpmxar.c xar payload extraction. + - jbj: create rpmWriteHeader with error msg returns. + - jbj: use rpmReadHeader with error msg returns. + - jbj: eliminate HDRread/HDRwrite vectors. + - jbj: revert "rebase rpmParseState_e +256", more than rebasing needs doing. + - jbj: convert+remove headerRead() from the API, use rpmpkgRead instead. + - jbj: rebase rpmParseState_e +256 to permit rpmRC to be returned too. + - jbj: remove headerWrite() from the public API, use rpmpkgWrite instead. + - jbj: convert last headerWrite to use rpmpkgWrite instead. + - jbj: conver 2 (of 9 remaining) headerRead's to use rpmpkgRead instead. + - jbj: add newlines to error message spew from pkgio. + - jbj: fix: read from the input, not the output, fd. + - jbj: bury rpmReadHeader underneath rpmpkgRead("Header", ...). + - jbj: use the fd attached pgpDig everywhere necessary. + - jbj: attach pgpDig to the fd being used to verify signatures. + - jbj: splint fiddles for refcounted storage. + - jbj: add refcounts to rpmwf and pgpDig, they're gonna be snarly. + - jbj: eliminate the headerCheck recursion check. not seen w rpm code paths. + - jbj: pass dig, not ts, through pkgio.c header routines. + - jbj: eliminate 2 of 3 remaining uses of headerWrite. + - jbj: fix: initialize _nolead to 0, not 1. + - jbj: add "struct utimbuf" and "struct utsname" to eliminate perl wanings. + - jbj: adjust includes throughout. + - jbj: move popt.h from rpmlib.h to rpmcli.h, most routines don't need. + - jbj: don't include rpmcb.h from rpmlib.h, explcit includes instead. + - jbj: update Doxyfile. + - jbj: rename rpmmessages.h -> rpmcb.h consistent with callback content. + - jbj: doScript: use pid_t, not int. + - jbj: eliminate rpmerr.h, use rpmlog.h instead. + - jbj: eliminate rpmMessage and RPMMESS_FOO constants, use rpmlog instead. + +5.0a1 -> 5.0a2: + - jbj: fix: don't add RPMTAG_ARCH to pubkeys, pubkeys cannot be erased. + - afb: make devtool %standalone include the required %{_rpmhome}/magic. + - jbj: fix: handle absolute paths to spec files again. + - jbj: fix: don't attempt header sanity checks on pubkeys. + - jbj: fix: don't loop on failed lookup by instance. + - jbj: Eliminate SUPPORT_RPMV3_PROVIDE_SELF Provies: N = E:V-R retrofit. + - jbj: Eliminate SUPPORT_RPMV3_BASENAMES_HACKS file path conversions. + - jbj: Eliminate SUPPORT_RPMV3_VERIFY_{RSA,DSA} header+payload signatures. + - jbj: Eliminate SUPPORT_RPMV3_SIGN_{RSA,DSA} header+payload signatures. + - jbj: Eliminate SUPPORT_PGP_SIGNING signing with pgp/pgp5 code. + - jbj: Eliminate SUPPORT_RPMV3_BORKEN busted md5 digest tag code. + - jbj: revert the noisy tag data type validation. explicit typing for 5.0. + - jbj: add HEADERFLAG_SIGNATURE, revert he->signature access markers. + - afb: upgrade internal rsyncable zlib, from 1.2.2.4 to 1.2.3 + - jbj: fix: segfault with corrupted rpm reported at http://qa.mandriva.com/show_bug.cgi?id=33735 + - jbj: handle --root/--dbpath variants, with/without URL, using --rebuilddb. + - jbj: rpmdb: casts for integral conversions. + - jbj: lib: identify and repair several minor flaws caught by splint. + - jbj: rpmio: casts for integral conversions. + - jbj: rpmio: casts for character <-> integral conversions. + - jbj: first pass through header.c converting to uint32_t everywhere. + - jbj: get rid of splint spew before chasing header.c integers. + - jbj: use splint to check integral types, eliminate the easy stuff. + - jbj: splint fiddles for rpmdb. + - jbj: don't cache unsatisfied Suggests:. + - jbj: fix the last memory leak with -Kvv, recheck install/query paths. + - jbj: functional -Kvv *.xar header-only DSA verify. + - jbj: disable tagTypeValidate on --addsig and --delsig paths. + - jbj: remap rpmlog levels to status quo ante. + - jbj: functional -Kvv *.xar header SHA1 and header+payload MD5 verify. + - jbj: eliminate all but 1 of the memory leaks with -Kvv *.xar. + - jbj: add he->signature tagTypeValidate disabler, sigtags no workie. + - jbj: add (tenative) patch to handle cached chroot paths. + - jbj: change %system to --with-xar=internal, adding xar_* to loader map. + - jbj: hmmm, markReplacedFiles() breaks here, todo++. noone will notice. + - jbj: eliminate headerGetEntryMinMemory(), use headerGet{Entry,Extension}. + - jbj: invent pubkey/pubkey arch/os convention to avoid missing value pain. + - jbj: use RPM_I18NSTRING_TYPE where needed for pubkey imports. + - rse: relocate usage to "system.h", too. + - rse: relocate usage to "system.h" and add corresponding Autoconf check + - rse: fix type mismatches between function prototype and function definitions related to uint64_t + - rse: replace still existing u_int32_t with uint32_t to get building under Solaris + - rse: remove warnings in rpmdb/dbconfig.c when building an SQLite-only RPM + - rse: fix building against external Berkeley-DB under Solaris (where -lrt is required) + - rse: fix distribution tarball by adding the missing misc/librpmmisc.vers + - jbj: hmmm, tagno's 261 and 269 are fishy, skip tagTypeValidate for now. + - jbj: add tagTypeValidate sanity check before flipping to implicit typing. + - jbj: fix: "RPMTAG_FILESTATES has RPM_CHAR_TYPE=1 instead of 2". + - jbj: eliminate headerGetLangs, query RPMTAG_HEADERI18NTABLE instead. + - jbj: eliminate headerGetRawEntry(), noone can possibly need. + - jbj: eliminate headerDump, query with --xml or --yaml instead. + - jbj: hmmm RPMTAG_FILESTATES has RPM_CHAR_TYPE=1 instead of 2. todo++; + - jbj: eliminate RPM_CHAR_TYPE, use RPM_UINT8_TYPE instead. + - jbj: eliminate RPM_NULL_TYPE, use 0 instead. + +4.5 -> 5.0a1: + - rse: start providing a high-level NEWS document for RPM 5 + - rse: first cut for properly integrate XAR support into the build environment + - rse: allow RPM to be built without XAR support again + - jbj: functional header-only signature verify of *.xar. + - jbj: add --rpmwfdebug. + - jbj: clean up rpmpkg memory leaks. + - jbj: functional queries of *.xar packages, on to payload. + - jbj: lash up rpmwf implicit iteration for Lead/Signature/Header reads. + - jbj: add rpmwf getter/setter to FD_t for now. + - jbj: add --xar to read *.xar for now, magic later. + - jbj: txar.c: use rpmwfFoo from -lrpmdb. + - jbj: hotwire -lxar linkage for the moment. + - jbj: add proof-of-concept rpmwf "wrapper format" to rpmdb. + - jbj: move rpmReadHeader from lib/package.c to rpmdb/pkgio.c. + - jbj: remove HGE_t casts everywhere. + - jbj: hmmm, rpm-perl seems to have issues on BIGENDIAN non-int32 retrieves. + - jbj: use HE_t instead of individual args. dunno HGE_t et al desired ... + - jbj: eek, rpm-perl not being built here. + - rpm.org: Change strntoul to using size_t for sizes. + - rpm.org: Remove refs to "file/src". + - rpm.org: Clarify rpm manpage wrt rpmbuild binary vs package (rhbz#233232). + - rpm.org: Clarify rpmtsCheck() documentation (rhbz#159638). + - rpm.org: Remove bunch of unnecessary rpmio_internal includes. + - jbj: include rpmtag.h, not rpmlib.h, if only tag names are needed. + - jbj: change int_32 to evrFlags and uint32_t in rpmfc.c and rpmds.c. + - rpm.org: Remove two unnecessary legacy.h includes. + - rpm.org: Remove bunch of unnecessary misc.h includes, document others. + - rpm.org: Remove useless "var" parameter from setup helpers. + - rpm.org: Remove dead & unused RPMTAG_ARCHIVESIZE addition code ... + - rpm.org: Remove rpmSetMachine() from API. + - jbj: hmmm, headerGetExtension should not leak memory on failure. hack it. + - jbj: more memory leak canoodling. + - jbj: plug a couple of memory leaks. + - jbj: rearrange the steaming piles of ick into an aesthetic constellation. + - jbj: squeaky clean SSL memory cleanup. Ick. + - rpm.org: start hiding rpmsq internals. + - jbj: fix: "trade a double free for a modest memory leak for the moment." + - jbj: add headerModifyExtension everywhere. + - jbj: add header{Init,Next,Free}Extension almost everywhere. + - jbj: add headerRemoveExtension everywhere. + - jbj: finish converting to headerAddExtension() everywhere. + - jbj: change names of header tag integer types: s/INT32/UINT32/ etc. + - jbj: finish bulldozing headerAddEntry throughout rpmbuild. + - jbj: start bulldozing headerAddEntry throughout rpmbuild. + - jbj: use HAE_t for signature tags, change int_32 to uint32_t where needed. + - rpm.org: rpmhash.c: use size_t for keySize. + - rpm.org: remove unnecessary rpmShowProgress() prototype. + - jbj: add all-mode --macrosused option, debug rpmGetMacroEntries(). + - jbj: access all tag data integers as "unsigned", using types. + - rpm.org: fix segfault in %{lua: ...}'s rpm_print, no newline. + - jbj: add lua/python getMacros bindings (mostly from ). + - jbj: add a getter to retrieve macros with used and/or pattern filtering. + - jbj: macro macro table/element internals opaque. + - jbj: fix --rebuilddb --root /path. + - rse: fix linking of RPM against PCRE's POSIX API under --with-pcre + - jbj: upgrade to F8 & fix rpm-python. i18n tags w hdr_subscript are b0rked. + - jbj: update loader maps for python lazy loads. rpm-python fixing to do. + - jbj: insturment headerNextIterator() statistics. + - jbj: trade a double free for a modest memory leak for the moment. + - jbj: fix: install modes broken by forgetting to add '\0'. + - jbj: mostly unbork HEAD. --install modes still non-functional. + - jbj: don't modify strings exposed by method wrappers (#349091). + - jbj: drill headerAddExtension everywhere. + - jbj: header.c: insturment headerGet{Entry,Extension} switch, debug goop. + - jbj: rpmchecksig.c: wrap headerAddEntry. headerAddOrAppend next ... + - jbj: rpmfc.c: wrap headerAddEntry. + - jbj: psm.c: wrap headerAddEntry. + - jbj: hmm, still segfaults, more to do. + - jbj: change headerGetEntry prototype, use headerGetExtension instead. + - jbj: fix: hae needs he->p.ptr, not he->p, as 4th arg. + - jbj: start rearranging header.h prior to moving typedefs to rpmtag.h. + - jbj: rewrite several toy routines to use HE_t instead. + - jbj: replace hRET_t with rpmTagType, avoiding "hRET_t *" issues for now. + - jbj: hmmm, b0rken --fileclass et al extensions in lib/format.c, todo++. + - jbj: mark private extension handling for destruction, enabled for now. + - jbj: permit headerSprintf tbls/exts args tp be NULL using sane default. + - jbj: start using headerGetExtension under headerSprintf. + - jbj: prime the tag data cache earlier. + - jbj: enable Plan B tag data caching. + - jbj: grr, Plan B: cache w sprintfTag, not sprintfToken. + - jbj: use tag data cache. + - jbj: add tag data cache. + - jbj: eliminate rpmec data type. + - jbj: merge rpmec into HE_t. + - jbj: not yet for binary search retrieve using tagValue. + - jbj: unbork --yaml. + - rpm.org: rpmpsi iterator. + - jbj: mark myTagName() and myTagValue() linear lookup for destruction. + - jbj: create rpmdb/rpmtag.h, split from lib/rpmlib.h. + - jbj: make the --info field colons align correctly, more (#323221). + - jbj: fix :time and :date formats, pad --info spewage. + - jbj: eliminate padding & formatPrefix, strings is strings now. + - jbj: bury hex dump in intFormat defaults, refactor common code. + - jbj: hmmm, --yaml is b0rken atm, todo++; + - jbj: add assert's to control tag container values. + - jbj: teach formatValue() to create an element tag container. + - jbj: change the common integer format from int_32 to int_64 everywhere. + - jbj: teach intFormat() to handle strings. + - jbj: add he->ix, eliminate the less egregious he->freeData overload hack. + - jbj: remove useless HE_t indirection with (*he->p).ptr, he->p.ptr instead. + - jbj: fix several indirection problems. + - jbj: eliminate data arg in (*headerTagFormatFunction). + - jbj: start simplifying the world's most complicated sprintf. + - jbj: fix: trigger conditions not displayed correctly. + - jbj: trade-in element overload hack for another, less egregious, hack. + - jbj: eliminate element arg in (*headerTagFormatFunction). + - jbj: eliminate type arg in (*headerTagFormatFunction), use he->t instead. + - jbj: drill HE_t through (*headerTagFormatFunction). + - jbj: debugedit segfault (#336951,#337011) see #337051 too. + - jbj: commit to hge(h, he, ...) extraction in API. ABI not yet. + - jbj: remove the pointless ;-) indirection in *(HE_t) for type/count. + - jbj: drill rpmTagData everywhere. + - jbj: start regularizing hae/hme calls. + - jbj: drill rpmTagCount everywhere. + - jbj: change hPTR_t to hRET_t in ABI, revert to const void * in API. + - jbj: drill hPTR_t through prototypes. hRET_t * refactor next. + - jbj: drill rpmTagCount through rpmdb/* files. + - jbj: preliminaries to encapsulate headerSprintf goop. + - rpm.org: Fix broken doxygen comment. + - rpm.org: Don't unnecessarily include stdio.h + - jbj: extract verifyscript when available. more to do ... + - jbj: fix: %verifyscript broken by scaremem elimination. + - jbj: another missed level of indirection. leave the bandaid, won't hurt. + - jbj: bandaid for a --import hge recursion problem. real fix soon. + - jbj: fix: missed a level of indirection. + - bero: Initialize arch and os in rpmtsAddInstallElement, fixing crash when + installing a src.rpm + - jbj: fix: typo broke i32p indices when sizeof(void *) != sizeof(int_32). + - jbj: add RPM_INT64_TYPE rpmdb indices (untested). + - jbj: ah, there's the rpmdb basenames memory leak (but leave disabled). + - jbj: mark (and disable) rpmv3 Provides: N = E:V-R retrofit. + - jbj: mark (and disable) rpmv3 basenames hacks (likely fixing rpmdb leak). + - jbj: ditto for python/* too. + - jbj: for now, revert to headerGetEntry where needed, avoid recursions. + - jbj: drill HE_t down through the header extension tags. + - jbj: drill rpmTagType everywhere. + - jbj: move rpmTag typedef and HGE_t et al protos to header.h. + - jbj: lose the rpmfi hge/hae/hme/hre/hfd vectors. + - jbj: yet more hge fixups. + - jbj: reqprov.c: use headerGetExtension everywhere. + - jbj: parsePreamble.c: use headerGetExtension everywhere. + - jbj: pack.c: use headerGetExtension everywhere. + - jbj: files.c: fix: append to pkg->fileList. + - jbj: files.c: use headerGetExtension everywhere. + - jbj: transaction.c: eliminate hge warning. + - jbj: rpmds.c: eliminate hge warning. + - jbj: psm.c: eliminate a warning, simplify hge usage. + - jbj: package.c: use headerGetExtension everywhere (fix double free). + - jbj: fix: grr, headerGetEntry return code is backwards. + - jbj: clean up some warnings. + - jbj: change HGE_t prototype to see what remains to be fixed. + - jbj: rpmsignature.c: use headerGetExtension everywhere. + - jbj: rpmrollback.c: use headerGetExtension everywhere. + - jbj: use (*hge), not headerGetExtension, everywhere. + - jbj: psm.c: use headerGetExtension everywhere. + - jbj: rpminstall.c: use headerGetExtension everywhere. + - jbj: rpmfc.c: use headerGetExtension everywhere. + - jbj: rpmte.c: use headerGetExtension everywhere. + - jbj: depends.c: use headerGetExtension everywhere. + - jbj: rpmts.c: use headerGetExtension everywhere. + - jbj: nuke fi->keep_header. + - jbj: rpmfi.c: use headerGetExtension everywhere. Ptooey! pita ... + - jbj: scareMem = 0 everywhere FINALLY! Yippie! + - jbj: rpmds.c: use headerGetExtension everywhere. + - jbj: eliminate rpmtsSetSig(), use pgpSetSig() instead. + - jbj: fix: trade a double free for a ~100b/header memleak. + - jbj: fprint.c: use headerGetExtension everywhere. + - jbj: hdrNVR.c: use headerGetExtension everywhere. + - jbj: pkgio.c: use headerGetExtension everywhere. + - jbj: signature.c: use headerGetExtension everywhere. + - jbj: rpmdb.c: use headerGetExtension everywhere. + - rse: fix va_copy fallback macros. + - jbj: rpmdb.c: retrofit HE_s. + - jbj: rpmte.c: use headerGetExtension. + - jbj: add HE_s typedef to get rid of alloca baggage. + - bero: Make rpm2cpio work for packages with payloads other than gzip + - jbj: change to hRET_t for existing headerGetExtension uses. + - bero: Add %optional flag on files (packages a file if it is there, + but doesn't error out if it isn't there) + - bero: Support multiple %files files per package (%files -f f1,f2,...) + - bero: Detect Ark Linux as RPMCANONVENDOR + - rpm.org: have selinux disabled imply RPMTRANS_FLAG_NOCONTEXTS. + - jbj: plug --rebuilddb memory leaks. headerGetExtension() est arrive! + - jbj: fix: set FD_CLOEXEC in Open() and fdDup(). + - jbj: eliminate rpmMessage, rpmlog instead. + - jbj: finish eliminating rpmError, rpmlog instead. + - jbj: switch rpmdbRemove to use headerGetExtension. + - jbj: switch rpmdbAdd to use headerGetExtension. ~1Mb leaks w --rebuilddb. + - jbj: fix: headerGetExtension failed to return p.str correctly. + - jbj: start eliminating rpmError. + - jbj: fail empty and non-printable manifests. + - jbj: headerGetExtension: handle lookup failure cases too. + - jbj: headerGetExtension: include \0 when dup'ing string. + - jbj: start converting rpmdb.c to use headerGetExtension instead. + - jbj: expose hRET_t through headerGetExtension prototypes. + - jbj: unbork/simplify hRET_t indirections, too much acid in the Kool-Aid. + - jbj: rpmdeps: unhide various CLI options. + - jbj: rpmdeps: invoke rpm, not /bin/rpm. + - bero: fix: RPMRC_FAIL, not non-existent RPMRC_BAD, return. + - jbj: teach headerGetExtension() to allocate all returned data. + - jbj: attempt using a pedantically correct union for header data. + - jbj: mark --initdb and --verifydb code paths for destruction. + - jbj: start making miRE abstract and refcounted. + - jbj: convert rel to abs linkto depedency iff directory is known. + - rpm.org: correct typo in comment. + - rse: remove all compile-time warnings caused by recent changes + - jbj: fix: add, not delete, the just read signature data. + - jbj: update sv.po (Translation Project). + - jbj: insure rpmlib -> rpmdb forward linkage only. + - jbj: eliminate (*hdrchk) vector everywhere, use headerCheck() instead. + - jbj: add metadata header stubs to pkgio.c. + - jbj: move rpmtsFindPubkey() and rpmtsOp() to rpmdb for forward linkage. + - jbj: add _RPMTS_PRINT to keep rpmrollback.c happy. + - jbj: rearrange package.c internals to new locations. + - jbj: start eliminating rpmtsSetSig by inlining. + - jbj: eliminate rpmtsSigFoo() getters. + - jbj: finish refactoring vsflags out of rpmts. + - rpm.org: rename fileTypes_e and whatis() (for name spacing). + - jbj: move (largely unused) fileTypes into rpmfi.h. + - jbj: remove whatis() from rpmlib, use S_ISFOO() instead. + - jbj: ensure that PLD setup & FHS packages install correctly. + - jbj: wrapper for open(2). + - rpm.org: ensure that yum's broken transaction checks "work" (#259961). + - jbj: handle more white space in paths. + - jbj: make the rpm hacker's entrance exam buggery harder (#281391). + - jbj: don't punish monkeys who insist on "My Widdle .spec" naming. + - jbj: permit -ta spec file extraction from zip/lzo/lzma compressed balls. + - jbj: add %{?__tar_wildcards} to pass Fedora automated regression tests. + - jbj: use %{__tar} with -ta builds to assist morons who cannot set PATH. + - jbj: add %{mkstemp: ... } macro primitive. + - rse: fix po/POTFILES.in and tools/Makefile.am to reflect recent changes (fixes "make dist", too) + - rpm.org: cleanup main() definitions in tests and tools + - rse: include and/or for htonl(3) + - jbj: uncouple signature verification from transaction sets. + - jbj: add (*findPubkey) (_ts, _dig) callback in pgpDig. + - jbj: fix: headerUnload() size implies HEADER_MAGIC_NO, no hackery needed. + - jbj: sum per-dig digest/signature stats into ts stats in rpmtsCleanDig. + - jbj: initialize pgpVSFlags with pgpNewDig(vsflags). + - jbj: add pgpVSFlags for pgpDig control disablers. ugh. + - jbj: re-add rpmtsCleanDig() to preserve opaque rpmts. + - jbj: add pgpStatsAccumulator, not fully wired yet. + - jbj: refactor signature components from ts into dig container. + - jbj: add size_t *lenp to headerUnload(). + - jbj: consistent naming in rpmdb/pkgio.c + - jbj: eliminate rpmNewSignature() and rpmFreeSignature(). + - jbj: bury rpmReadSignature/rpmWriteSignature. + - jbj: rip rpmtsCleanDig() inlining the code. + - jbj: refactor headerVerifyInfo(). + - jbj: pour the amber over the corpse of the rpmlead. Ptooey! R.I.P. + - jbj: stub in rpmpkgFoo() i/o methods. + - jbj: refactor rpmlead I/O routines into rpmdb/pkgio.c. + - jbj: protect rpmdb contents from cluelesser morons. + - jbj: add sourcepkgid index and permit queries of the (non-existent) tag. + - rpm.org: permit mire RE's against binary data. Useless ... (#277161). + - rpm.org: mire RE against missing data now mis-matches rather than matches. + - jbj: remove ancient %verifyscript tag != 1079 retrofit. + - rpm.org: fix whitespace-in-files issues in find-debuginfo.sh. + - rpm.org: new debuginfo script. + - jbj: update known arch's. + - jbj: use rpmGetPath() to simplify generating filenames, nuke alloca. + - jbj: pubkey headers were misidentified as source, not binary, headers. + - rpm.org: report open error on signing explicitly (#155079). + - rpm.org: fix for debugedit -l. + - afb: handle Mac OS X 10.3.9 statvfs deviance. + - rse: make devtool %standalone fully modular for allowing its modules to be reused in other devtool targets + - jbj: assume that mount(2) et al are linux-peculier for the moment. + - jbj: add rpmio Mount/Umount/Umount2 stubs. + - jbj: permit keyutils caching disable, don't re-add if already cached. + - jbj: use keyutils for pubkey cache. + - jbj: update id.po (Translation Project). + - jbj: teach --querytags to chain through headerCompoundFormats. + - rse: apply upstream vendor Lua 5.1.2 patches 1-7 + - rse: add support for building against NEON >= 0.27.0 + - jbj: use keyutils to get password out of rpm's address space. + - jbj: start ripping availablePackages. + - jbj: rpmtsDbmode() and rpmtsSetDbmode() added for rpmts-py.c opaqueness. + - jbj: start marking availablePackages for destruction. + - jbj: make a pass checking rpmts opaqueness. + - jbj: rpmtsGoal() and rpmtsSetGoal() added. + - jbj: add rpmgiGetFlags() for opaque rpmgi queries. + - jbj: permit --ftswalk on sign/verify paths. not yet install ... + - jbj: use ftsOpts from CLI where rpmgi is used. + - jbj: insure srpm file dispositions are FA_CREATE. + - jbj: enable Header performance metrics, tied to --stats. + - jbj: add Header performance metrics, disabled for now. + - jbj: eliminate headerNVR, use headerNEVRA instead. + - jbj: eliminate the rpmrbFoo, use rpmcliInstallFoo instead. + - jbj: load/unload header macros for %{_sourcedir} et al expansions. + - jbj: don't open rpmdb O_RDWR iff srpm to permit non-root installs. + - jbj: prepare for open as a macro in bleeding edge glibc-2.6.90+. + - jbj: permit mixed binary/source installation transactions. + - jbj: re-add rpmcache/rpmcmp/rpmdigest tools. + - jbj: more rpmInstall refactoring. + - jbj: use rpmgi for --addsign/--checksig arg iteration. + - jbj: repair a minor rpmInstall and major matchpathcon_init() memleaks. + - jbj: unbreak --install/--upgrade/--freshen, memleaks checked. + - jbj: use rpmgi for --install/--upgrade/--freshen. non-functional atm. + - jbj: add getter/setter for header magic to hide _newmagic construction. + - jbj: functional sign/verify on --nolead --newmagic packages. + - jbj: no-operation code paths for --nolead --nosigh packages. + - jbj: functional sign/verify on --nolead packages. + - jbj: add rpmkey, a keyctl(1) clone. + - jbj: disable RPMv3 RSA/DSA signing. + - jbj: mark RPMv3 code for optional compilation. + - jbj: snarf /usr and /var values from auto fu to predefine macro values. + - jbj: disable rpmbuild --sign for now. + - afb: extract provides from .jnilib's (Fink). + - afb: always include system.h first (Leopard fix? Fink). + - afb: include "byte" typedef from beecrypt. + - afb: preserve passed CFLAGS for zlib. + - afb: support python 2.3 on Mac OS X. + - jbj: trash a butt load of passphrase goop. + - jbj: disable PGP signing to untwist program flow from signature ident. + - jbj: unbreak signatures. + - jbj: start using syscall wrappers everywhere. + - jbj: pass mode_t, not ptr, to matchpathcon. + - jbj: mark header+payload signature/digest code for destruction. + - rse: use Autoconf newer $(MKDIR_P) instead of older $(mkinstalldirs) in Makefile.am + - rse: use __MKDIR_P instead of MKDIR_P for RPM's own specially determined "mkdir -p" to not conflict with Automake MKDIR_P + - rse: various cleanups and fixes to the test programs + - jbj: oops, "RPMTAG_FILENAMES" still needed. + - jbj: extension tags in hdrfmt.c now can be passed NULL. Start the fixing. + - jbj: rpmtfs-py.c needs _free from rpmio.h, not rpmlib.h + - jbj: add RPMTAG_{FILE,ORIG}PATHS to not revisit old expectations. + - jbj: _FINALLY_ get rpmfiBuildFNames() out of rpm libraries. w00t! + - jbj: add headerGetExtension(RPMTAG_FILENAMES), and rpmdb/hdrfmt.c orphan. + - jbj: use headerGetExtension(RPMTAG_NVRA) most everywhere. + - jbj: use headerGetExtension() for mire matching. memleaks next. + - jbj: compute extension cache index correctly with chained tables. + - rse: upgrade lua/local/lrexlib.c from version 1.x (nov00-06oct03) to latest version 1.19 (may04-18dec04) + - jbj: teach headerGetExtension() to lookup extensions. + - jbj: chain through new headerCompundFormats. + - jbj: refactor most header extensions from -lrpm to -lrpmdb. heh, no filenames, very sick and sad. + - jbj: add headerGetExtension(), mapped to gud old stuff for now. + - jbj: skeletal configgery for standalone index tables. + - jbj: another header-extension-less hack-a-round. + - jbj: hack up a NVRA retrival w/o extensions, sigh. + - jbj: add RPMTAG_NVRA header extension. + - jbj: python ds.Uname getter for uname(...) dependencies. + - jbj: use rpmmg magic wrapper. + - jbj: add rpmmg magic wrapper. + - jbj: unsnarl __FUNCTION__ from system.h AutoFu. + - rse: make sure RPM is also linked against libm if external Lua is used (as liblua required libm) + - rse: support building against PCRE for its regcomp(3) emulation API pcreposix(3) -- used by RPM internally + - rse: support building against PCRE for its native API pcre(3) -- used by the Lua "rex" extension library + - jbj: query w/o lead/sigh w newmagic (using --nolead --nosigh --newmagic). + - jbj: query of packages w/o lead/sigh (using --nolead --nosigh). + - jbj: query of packages w/o lead (using --nolead). + - jbj: --newmagic enabler to add new signature/metadata magic to headers. + - jbj: nobrainer --nolead & --nosigh disablers. + - jbj: get rid of convertdb1. + - jbj: HEADER_MAGIC_YES always: remove the enum and arguments everywhere. + - jbj: HEADER_MAGIC_YES always: eliminate HEADER_MAGIC_NO usages. + - rse: provide support for GNU binutils ld(1)'s --as-needed via Autoconf option --enable-build-maxextlibdep + - jbj: rip CentOS3/x86_64 gcc-3.2.3-49.x86_64 hack-a-round. Fix gcc! + - jbj: upgrade to db-4.6.18. + - rse: drop MARK64 hack as it isn't RPM's business to decide for lib64 -- for this there is Autoconf option --libdir + - rse: with --with-db-tools-integrated one can now build (and install) a db_tool which integrates all db_xxx BDB tools + - jbj: add RPMTAG_DBINSTANCE header extension. + - jbj: rip deep ia64 emulated triarch multilib hacks. worth millions to vendor, not me. + - jbj: rip Depends index and dependency result caching. + - rse: ported to DragonFly BSD (1.8.1) + - rse: add the necessary Autoconf glue for using the ancient (and nowadays resurrected by POSIX) insque(3) + - rse: ported to IBM AIX (5.3) + - rse: ported to Mac OS X (10.4), aka Darwin (8.10) + - rse: re-implement --force option (on installation) with a simple POPT alias instead of twisted and spreaded code + - rse: for libraries prefer "pkg-config foo" before "foo-config" as pkg-config(1) provides more precise CPPFLAGS/CFLAGS + - rse: unbreak rpm(1) short-hand option "--force" on package installation + - rse: use implicit internal library dependencies by default, but allow disabling via --disable-build-intlibdep + - rse: use implicit external library dependencies by default, but allow disabling via --disable-build-extlibdep + - rse: remove GNU libtool *.la files during installation only if --disable-build-lafiles is used + - rse: on --rebuilddb remove (currently) unused database files to avoid mixed formats on backend upgrades and switches + - jbj: adjust signal polling for python exit purposes . + - rse: provide a first cut for an librpmconstant.vers ld(1) version script + - jbj: reapply 2.127 with more careful rpmExpand() fix. + - jbj: scale _macro_BUFSIZE as 2 * BUFSIZ (16384) everywhere but rpmExpand() + - jbj: use _macro_BUFSIZ, not compiled in BUFSIZ, to size expansion targets. + - jbj: enable %{dirname:...} macro primitive. + - nanardon: add the librpmconstant library which provides RPM API constants (usually to language bindings) + - jbj: rescuscitate rpm-perl, include explicitly. + - jbj: perl.prov fiddles (#249135). + - jbj: rescuscitate rpm-python, include explicitly. + - jbj: adopt rpm.org signal handling . + - jbj: fix a --import memory leak. + - rse: unbreak big-endian handling in memory and cryptography functions by Autoconf providing WORDS_BIGENDIAN and fixing usage + - rse: cleanup and fix the code to compile under *non*-GCC compilers (e.g. Sun Studio and Intel C/C++) + - rse: fix building under --with-dmalloc with DMalloc 5.5.2 where "x{malloc,calloc,realloc,free}" are also overridden + - rse: provide convenience --enable-build-debug Autoconf option for building RPM with debugging instrumentation + - rse: fix memory leak and segfault in lib/psm.c related to dirname(3) usage + - rse: fix distribution tarball by including the python/ subdir content as Autoconf unconditionally operates on it + - jbj: improved brp-nobuildrootpath script (vallimar). + - jbj: consistent usage is the start of determining the best fix. + - rse: use %{_rpmdir}/repackage as the default for %{_repackage_dir} instead of a hard-coded /var/spool/repackage + - rse: remove one more hard-coded reference to /etc/rpm/sysinfo with a macro and SYSCONFIGDIR based approach + - rse: add (partially untested) platform support for AIX, IRIX and Tru64 based on OpenPKG patchset. + - rse: provide an RPM_OS_XXX define for allowing us to compiler independent check for a platform in the C code + - rse: move remaining _D_EXACT_NAMLEN fiddling from public rpmio/fts.h to private rpmio/fts.c + - rse: allow building without POSIX pthreads (explicitly through --without-pthreads or if platform doesn't support it) + - rse: provide "install-sh" script in %{_rpmhome} as a companion to "mkinstalldirs" + - rse: fix %{__mkdir_p} macro fallback value by installing missing "mkinstalldirs" into %{_rpmhome} + - rse: consistently use %{__mkdir_p} macro instead of its pre-defined value @MKDIR_P@ to allow overriding + - mgh: Update configure.ac to use target instead of host values for configuration + - rse: fix build environment to correctly support building RPM from outside its source tree + - rse: remove RH-specific "_vsflags_up2date" macro, use "_vsflags" in Python bindings instead + - rse: make --with-path-rpmpopt a colon-separated path to allow "rpmpopt" files be similar to "macros" files + - rse: allow the path to the RPM package sources be overridden via Autoconf option --with-path-sources + - rse: allow the path to the RPM database directory be overridden via Autoconf option --with-path-database + - jbj: refactor rpmio.h include out of header files. + - jbj: patch macro seems sufficiently functional, delete the old "stuff". + - jbj: add stub vectors for rpmio I/O API. + - jbj: add (preliminary) WR configuration. + - rse: support building against external stock Lua 5.1.2, too + - rse: upgraded the local Lua copy from version 5.0.2 to 5.1.2 + - jbj: remove network transport from all rpm libraries. + - jbj: don't close stdout by mistake (OpenSuSE). + - jbj: run checkfiles even if failure is imminent (OpenSuSE). + - jbj: rip compiled in %patch, breaking remote patch fetching. + - jbj: fixup %patchNN rewrite. + - jbj: add osgi automagic dependency extractors . + - jbj: debugedit warning removal . + - jbj: free 5 bits in FCOLOR_e for future use. + - jbj: add arbitrary tag strings to header metadata. + - mgh: transform %patchNN to %patch -P NN + - jbj: add mono automagic dependency extractors. + - jbj: insure that RPMFILE_EXISTS is set for %config files. + - jbj: revert the _GetPass() hack-a-round. + - jbj: set a default 0022 umask value always (#83006). + - rse: remove the already obsolete rpm.c + - rse/jbj: eliminated all major compile-time warnings + - rse: cleanup API by changing argument 2 of rpmDigestFinal() from "void **" to "void *" + - rse: make directory checking for %docdir more strict to avoid false positives + - jbj: perform fsync(2) before closing installed file. + - jbj: default RPMCANONCOLOR to 3 everywhere but ia64 and mips*. + - rse: remove now unused LIBDIR (--with-path-lib) from Autoconf and rename --with-path-usrlib to --with-path-lib + - jbj: hardwire _GetPass() to avoid --addsign (*Getpass) segfault for now. + - jbj: eliminate rpmrc.in file itself. + - jbj: revert routines that were re-added for ABI compat after rpm-4.4.7. + - jbj: eliminate the voo-doo asm arch identification. + - jbj: eliminate recursive parser helpers. + - jbj: expunge every occurence of Rcfiles. + - jbj: eliminate rcfile reading everywhere. + - jbj: eliminate last known internal usage of rpmrc files. + - jbj: generate per-platform macros for major CPU-linux platforms. + - mgh: Stop the python module from using rpmrc files + - mgh: Change python configuration to allow for --with-python 2.x, 2.4 or 2.5. (no value will scan as it previously did) + - jbj: parameterize upgrade/obsoletes tag. Panu's Big Mistake imho. + - jbj: reset errno to 0 in rpmgiOpen to eliminate false ENOENT failure. + - rse: do not build and install NLS data under po/ at all in case of --disable-nls + - jbj: add new-fangled debugedit patch (#246404). + - mgh: When the rpmfc_magic_path is not set or can't be expanded, act as if there is no magic file + - mgh: add lib32 as a valid directory in rpmfc + - mgh: change uses of @USRLIBRPM@ to %{_usrlibrpm} (needed for runtime relocation) + - mgh: ensure the rpm python module is linked the same as the rest of RPM + - rse: prune the 23MB large db/docs/ third-party subtree to no longer ship it in RPM distribution tarballs. + - rse: allow installation paths to be overridden via "configure" options --with-path-xxx. + - rse: re-generate lib/getdate.c with newer GNU bison 2.3 + - rse: detect if a script cannot be run because fork(2) failed. + - rse: use the "ustar" format defined by POSIX 1003.1-1988 to roll the distribution tarball. + - mgh: resolve namespace conflict with "__stdchrnul" in fnmatch.c + - mgh: change db3 configure wrapper to process one argument at a time + - rse: add SQLite RPM DB support for "tmpdir= excl cachesize= pagesize= temporary private perms=" + - mgh: allow rpm to be built w/o neon + - rse: remove unused rpmio/sexp/ sub-library + - rse: add "errno" information to be more informative in error message when lstat(2) on verification fails. + - rse: correctly restore SIGILL signal handler in machine detection code. + - pmatilaj: nuke antique Red Hat Linux "reference" "baddeps" list (in lib/depends.c) + - rse: allow one to explicitly select the RPM DB API with --with-dbapi={db,sqlite} + - rse: provide automatically Autoconf chosen RPM DB API selection and configuration + - rse: allow one to build an SQLite-only RPM with "--without-db --with-sqlite=external" + - rse: allow Berkeley-DB/SQLite-specific RPM DB per-tag parameters according to dynamically selected DB API + - rse: introduce --with-bugreport= and require this before unsupported Autoconf operations + - rse: simplify internal Berkeley-DB handling in rpmdb/ and allow (unsupported) --with-db=external + - pmatilaj: remove hardcoded "libtermcap" vs. Bash kludge in lib/psm.c + - rse: implement --without-file, i.e., building RPM without File/magic support + - rse: use regular LIBS for linking against SELinux library + - rse: no longer re-build db_xxx utilities in rpmdb/ -- use already built db3/ versions instead + - rse: no longer any librpm* libraries against external third-party libraries (rely on pkg-config) + - rse: link all internal third-party libraries into librpmmisc exclusively + - rse: install a pkg-config(1) specification "rpm.pc" for correctly linking against the RPM C API + - rse: consistently move libraries from Automake _LDFLAGS to _LIBADD variables + - rse: move misc/*.c from rpmio/stubs.c into misc/librpmmisc.c and build regular librpmmisc.la + - rse: support building without ZLib via --without-zlib + - rse: in rpmio for LZMA use %{__lzma} macro instead of hard-coded /usr/bin/lzma when possible + - rse: use explicit enable/disable of Perl and Python APIs + - rse: cleanup elf(3) API related Autoconf glue + - rse: use --enable-maintainer-mode to enable Automake rebuilds for maintainers only + - rse: cleanup Automake specifications replace old-style INCLUDES with AM_CPPFLAGS + - rse: allow one to control/override the /usr/lib64 use via Autoconf option --enable-build-lib64 + - rse: rename Autoconf --enable-ld-version-script to --enable-build-versionscript for consistency reasons + - rse: make PIC/PIE/warnings build flags controllable via Autoconf --enable-build-{pic,pie,warnings} + - rse: cleanup Autoconf glue for static linking by resurrecting functionality under --enable-build-static + - rse: replace too weak Autoconf glue for C99 va_copy(3) with a more sophisticated solution + - jbj: add patch macro, renamed to Xpatch until fully wired. + - jbj: remove support for patch-2.1. + - rse: allow actually used tar(1) and patch(1) tools to be set via %__tar and %__patch + - rse: add support for patch(1)'s "-d" option to internal macro %patch + - mgh: allow -bb --short-circuit + - rse: allow leading whitespaces on %setup and %patch lines in *.spec files + - rse: resolve portability issue related to double definition of mergesort(3) + - rse: fix building under UnixWare (blind port) + - rse: fix building under FreeBSD 7-CURRENT + - rse: fix building under NetBSD 3.1 + - rse: partially cleaned up the "configure.ac" scripts. + - rse: improve Autoconf glue to flexibly build against third-party libraries (RPM_CHECK_LIB) + - jbj: collect CentOS5 redhat-rpm-config changes for reference composting. + - rse: calculate timezone directly, don't rely on timezone variable. + - rse: remove the hysterical bzip2 interface. + - rse: add the missing Autoconf glue code for using mmap(2) in the code + - rse: (temporarily) remove partial Lua/libsyck support from build environment + - jbj: refactor fi->replaced to persistent rpmte storage. + - jbj: bump library and API versions to 5.0. + - rse: provide portability fallbacks for sighold(3), sigrelse(3) and sigpause(3) + - rse: allow RPM to build again even if iconv(3) is not available + - rse: provide --with-db-{largefile,rpc,mutex} options for flexibly building DB + - rse: portability: replace hard-coded -ldl (Linux) for Lua with Autoconf checks + - rse: added devtool/devtool.conf build environment helper + - rse: pruned tree from third-party libraries (except for zlib, db and lua) + - goeran: updated "sv" translation. + - rse: cleaned up the "autogen.sh" scripts. + - jbj: skip packages/headers with unverifiable signatures. + - start rpm-5.0 development. + +4.4.9 -> 4.5: + - jbj: fix ptr alignment problem seen on pld/sparc64. + - jbj: re-add /usr/bin/rpmbuild for now, poptBT option wiring needs fixing. + - jbj: pass -F fnum to patch (#243720). + - jbj: refactor _free() from rpmlib.h -> rpmio.h. + - jbj: add _rpmhome macro, revector helper paths through _rpmhome. + - jbj: hack a version into magic install path. better needs to be done. + - jbj: start consistent versionlibdir usage in all Makefile.am files. + - jbj: fail packages with invalid signature version . + - jbj: fix reference count on python rpmmi object . + - jbj: populate /usr/lib/rpm/@VERSION@/ instead of foo-@VERSION@ files. + - jbj: move gendiff into the scripts directory. + - jbj: don't include perl/CVS with "make dist". + - jbj: remove rpmbuild and rpmb helper for now. + - update README to point to new rpm5.org home. + - upgrade to file-4.21 (CVE-2007-2026, CVE-2007-2799). + - build against rpm5.org cvs, + - fix: swap PART_INSTALL and PART_CLEAN automagic cleanup. + - keys: add Getpass stub vector. + - solaris: add clearenv stub. + - fix: avoid accessing freed memory. + - start rpm-4.5 development. + +============================================================================= + +4.4.8 -> 4.4.9: + - start rpm-4.4.9 devel. + - replace rpm2cpio with a shell script (#229422). + - debugedit: canonicalize_path was broken (#232222). + - permit clean scriptlet element overrides. + - add RPMTAG_REPOTAG. + - non-linux: avoid all mutexes if waitpid is used for reaping. + - use pipe(2) for SIGCHLD receipt signalling. + - python: teach labelCompare that missing epoch is same as 0 (#227860). + - add source rpm file attributes, eliminate RPMBUILD_ISFOO. + - populate sourceHeader with build restrictions early instead. + - add --specsrpm to permit querying parsed source rpm header. + - populate sourceHeader with source/patch tags for query (#227513). + - make sure srpm header is initialized exactly once while refactoring. + - add Keywords: and BuildPlatforms: syntax. + - perform an RPMTAG_ICON tracheotomy. + - perl: extract dependencies from *.pm iff on /usr/lib* (#234691). + - refactor header subroutines out of -lrpmlib into -lrpmdb. + - add RPMTAG_PACKAGECOLOR at install time, retrofit on --rebuilddb. + - add Packagecolor index to handle multilib scriptlet instance counts. + - convert indices with ordering properties from DB_HASH to DB_BTREE. + - add findfplistexclude.diff patch from (#140055). + - add taggedfileindex.diff patch from (#103204). + - rework above 2 patches to be runtime, not compile time, configgerable. + - open existing rpmdb indices with either DB_BTREE or DB_HASH. + - don't add RPMTAG_RHNPLATFORM to packages and headers. + - stop adding ancient rpmlib(...) tracking dependencies to headers. + - python: eliminate rhnLoad/rhnUnload methods. + - fix: change dbi_type from DB_UNKNOWN iff DB_CREATE is set. + - add %%{load:/path/to/macros} to read macros from a file during parse. + - fix: initialize file verify flags for %doc (#235353). + - solaris: add #ifdef _sun so librpmio needn't export glob/globfree. + - fix: --verify displays mis-leading dependency checks (#223642). + - debugedit: canonicalize_path was broken again (#232222). + - popt: convert gnome UTF-8 to current encoding with --help (#178413). + - popt: fix compilation on x86_64 from previous patch. + - rollback: add explicit upgrade pkgid chain marker. + - rollback: convert assertion to a test. + - rollback: create rpmrollback.c, refactoring out of rpminstall.c. + - multilib: _prefer_color macro to choose elf32/elf64 files (#235757). + - rollback: add (*rbCheck), (*rbOrder), (*rbRun) vectors. + - strip rpmvercmp down to bare metallic C code. + - treat all printable non-digits except '.' as alpha comparisons. + - rpmds: add data elements and methods to handle Name.Arch compounds. + - rpmds: add opaque EVR parsing vector and container. + - rpmds: use the parsing vector and container. + - rpmds: expose methods to parse and compare EVR ala rpm. + - rpmds: add methods to compare EVR ala dpkg. + - fix: rpmEVRparser was not terminating epoch correctly. + - fix: rpmdsSearch() end-of-loop test incorrect at end-of-array. + - fix: use dgettext, not gettext, everywhere. + - fix: install preferred color packages first (#214737, #220348). + - rpmns: create rpmns.c/rpmns.h. + - fix: there are no leading zeros in the digit string "0". + - rpmns: refactor .arch suffix table from rpmts.c -> rpmns.c. + - rpmns: support for Requires: name.arch (#235755). + - rpmns: parse namespace(...) probe markers. + - rpmns: macro expand all dependency names. + - rpmns: add user/group lookup probes. + - rpmns: add mounted/diskspace lookup probes. + - rollback: rewrite and simplify. + - yaml: expose embedded syck parser in rpmio. + - fix: don't segfault on header without RPMTAG_NAME (#239557). + - upgrade to file-4.20 internal. + - rollback: re-add blink's and installtid's to repackaged headers. + - rpmns: add digest probe. + - rpmevr: remove lib/rpmvercmp.c, use rpmEVRcmp() instead. + - rpmns: add gnupg probe. + - argv: add argvFgets() to build argv array from stdin lines. + - argv: permit argvSplit() default whitespace separators. + - argv: use xmalloc, not alloca, in argvSplit(). + - rpmevr: refactor logical operator parsing, hide implementation. + - rpmevr: add RPMSENSE_NOTEQUAL and wire up the condition tests. + - rpmns: negative existence tests as Requires: !foo, take 1. + - rpmal: avoid rpmns allocates while iterating added provides. + - rpmns: finalize '!' as a dependency assertion negation operator. + - rpmns: add macro()/envvar() probes as existence tests. + - rollback: add REMOVETID subdir to insure unbroken upgrade chain. + - rpmns: add running() probe with scwewy unexpected non-root behavior. + - rpmns: classify negated probes correctly. + - rpmns: add envvar() comparisons. + - solaris: rpmds.c rearrangements to build against solaris gelf API. + - rollback: add link terminator to all upgrade chains. + - rollback: assertion checks for all header additions. + - fix: don't clobber dependency flags, or the comparison bits instead. + - fix: convert python->rpmlib missing values before rpmEVRcompare(). + - release 4.4.9. + +4.4.7 -> 4.4.8: + - start rpm-4.4.8 development. + - remove files that are ancient and historical. + - start simplifying rpm.spec.in. + - move rpmfc.[ch] from -lrpmbuild to -lrpmlib. + - solaris: various non-gcc fixes. + - fix: detecting repackaged assumed sizeof(void *) == sizeof(int_32). + - run old->triggerpostun case when erasing (#210626). + - fix: invert platform initialize order. + - fix: flush query format buffer before listing files (#212833). + - don't add rpmlib(FileDigestParameterized) dependency if MD5. + - resize rpmExpand() buffer instead of using BUFSIZ. + - remove extraneous :depflags white space in non-versioned dependencies. + - add parameters from db-4.5.20. + - permit multiple identically named packages with --install (#171970). + - query: don't attempt manifest open on non-existent files (#215712). + - ignore Fopen and fopen(3) extensions if not glibc-2.3.3 or later. + - attempt mmap'd Fopen's for hdlist queries. + - add %_query_hdlist_path for rpm -qH. + - fix: refactor depflags options, re-add to query/verify modes. + - fix: illegal accesses seen when expanding into a 1 byte buffer. + - re-add symbols removed in rpm-4.4.7 for now. + - add symclash.sh/symclash.py. + - fix: classification by suffix broken by cut-n-paste. + - fix: assume "." if getcwd returns NULL when building. + - don't fail if/when unsetting non-existent envvars in scriptlets. + - add ~/etc/.rpmmacros to rpmrc macrofiles: configgery. + - add /usr/src/examples and %{_examplesdir} to docdirs. + - add php classification (phpdeps.sh is still missing). + - FreeBSD portability fiddles. + - don't read .rpmnew/.rpmorig/.rpmsave or *~ macro files. + - change "python(abi)" criteria to be more precise/robust. + - rollback: force rollback and transaction id's to be identical. + - rollback: change exclude scoping to accomodate multi-pkg transactions. + - rollback: check NEVRA before hdrid/pkgid links, simpler debug. + - rollback: no rollbacks attempted unless repackaging. + - rollback: add ia->no_rollback_links to handle check/order failures. + - rollback: simplify rpmtsDoARBGoal for check/order failures only. + - display arch in file conflicts. + - make peace with autoconf-2.60 and automake-1.10. + - handle spaces in file path arguments correctly (#217258); + - permit variable length file digests in rpmdb. + - check all header strings to resize buffer CVE-2006-5466 (#212833). + - plug some minor memory leaks. + - add php(...) extractors from PLD. + - add robustness to posix shared mutexes. + - discard stale read locks when opening an rpmdb environment. + - popt: add POP_ARGFLAG_RANDOM using random(3) for a random value. + - add --{r,w}segfault options to randomly interrupt rpm execution. + - add rpmdbVerifyAllDBI() to separate open from verification. + - do db->verify detect and dbenv->remove repair w stale write locks. + - add multiversion and other config arcana from db-4.5.20. + - display errors as "db4" not "db3", only the cognoscenti need dbi_api. + - make peace with gettext-0.16. + - make peace with python-2.5. + - python: toy methods for rpmsqCaught and rpmdbCheckSignals. + - use rpmPRCO container transaction element dependency sets. + - multiple fixes from . + - fix: http error path was missing a reference on a url (#220392). + - solaris: permit using native libelf. + - solaris: first stab at probe dependencies through /usr/bin/crle. + - generalize sysinfo to read multiple tag files from directory. + - create (and check) per-transaction Requires:/Conflicts: dependencies. + - permit macros for scriptlet interpreters and dependencies. + - rpmgi: add (*walkPathFilter) for rpmcache use. + - permit "/X\ Y" in %_topdir use in scripts (#220449). + - fix: rpmInstallSourcePackage() still needs scareMem=1. + - rpmgi: add (*stash) for rpmcache use. + - move more memory cleanup to rpmcliFini(). + - automagic unpacking of *.lzo sources/patches using lzop. + - include the PLD .lzdio patch to support lzma payload compression. + - automagic unpacking of *.lzma sources/patches using lzma. + - skip EACCESS returns from stat(2) on mount points (#220991). + - permit files with glob characters in *.rpm packages (#142771,#147383). + - gendiff: permit $DIFF override, add -p to default diff. (#146981). + - rpmio: use HEAD for servers that don't support PROPFIND (#206066). + - rpmio: add RPMURL_SERVER_* server capability flags. + - fix: report "not installed" for pkg.bogusarch (#124016). + - don't treat '?' as a glob character in http URI's (#143885). + - rewrite macroized interpreter test to avoid %verifyscript segfault. + - display the verifyscript interpreter with --scripts. + - load/unload NEVRAO macros while creating binary sub-packages. + - move rmphash.[ch] into librpmio. + - fix: add error message on non-existent sources/patches. + - resuscitate build against external -lmagic. + - add lookup3.c hash (http://www.burtleburtle.net/bob/c/lookup3.c). + - popt: mark POPT_AUTO{HELP,ALIAS} strings for translation (#102254). + - treat duplicate *.rpm added consistently as warning (#180996). + - permit relative paths for --dbpath (#21703). + - strip trailing '/' to permit --root -D'_rpmdb_dbpath /path' (#90033). + - add SHA-224, RIPEMD-{256,320} digests. + - change hashFunctionType to accommodate crc-32, adler-32, and jlu-32. + - add SALSA-{10,20} with CBC chaining to create 512 bit digest. + - build and install rpmdb_hotbackup. + - vet db-4.5.10 symbols being re-exported through -lrpmdb. + - add rpmPlatform to rescusitate platform scoring. + - popt: free option defaults with --help (#119782). + - refactor miRE pattern matching into librpmio. + - fix: don't set MARK64 if libdir already ends in 64 (#205939). + - convert '-' to '_' within --define macro names (#124995). + - fix: fts_close double free traversing an active tree (#222089). + - use ".ufdio" as rpmio default, remove ".ufdio" markers. + - add rpmPlatformScore to check for upgrade pkg platform affinity. + - refactor the W_OK check out of rpmMkdirPath. + - push/pop expanded %buildroot before/after per-subpkg macro define(s). + - fix: query foo.bogusarch for #124016 needs to be done differently. + - fix: don't unlink non-temp file in FSM_UNDO (#223931). + - compile with -fpie instead of -fPIC -DPIC, link with -pie. + - fix: check for failing dependency scripts (#226751). + - lua: expand %{_usrlibrpm} to locate lua configuration files. + - change RPMCONFIGDIR to USRLIBRPM everywhere. + - fix: inherit _target_cpu macro rather than setting to "unknown". + - format unkown tag names as "Tag_0x01234567" w --xml/--yaml (#227333). + - yaml: display Dirnames: in SRPM's correctly. + - handle \r\n as well as \n line termination with armored pubkeys. + - use _target_vendor instead of _vendor. + - add _build_platform and _host_platform macros. + - restore -fPIC -DPIC for libraries, -fpie -pie for executables only. + - assign mips n32 elf32 as color 4. + - emit Requires: pkgconfig automagically for pkgs that contain *.pc. + - don't create .rpmnew for symlinks. + - check digest/readlink iff db and fs file type is same (#194246). + - hupdate de.po. + - permit build against neon-0.24.7 API. + - release 4.4.8. + +4.4.6 -> 4.4.7: + - start 4.4.7 development. + - use zlib's unrolled crc-32 and adler32, add crc-64, checksums. + - fix: build error msg had reversed args. + - add md2, md4, and tiger192 digests. + - teach --scripts about pre- and post-transaction scriptlets. + - add /usr/bin/rpmdigest. + - IPv4/6 and EPSV support by Arkadiusz Miskiewicz . + - permit autofetch for virgin sources. + - add AI_IDN flag to getaddrinfo(). + - fix: lazy mkdir for local _sourcedir. + - add _patchdir macro similar to _sourcedir. + - permit autofetch for patches. + - fetch all (even unused) sources/patches at %prep start. + - bolt in syck, add to librpmio. + - absorb lsyck.c (and libsyck.la) into internal lua. + - use RPMTAG_FILELINKTOS to detect dangling symlinks at run time. + - fix: free dirnames/linktos dependency sets. + - consolidate per-mode options into single structure. + - make dbiTags per-rpmdb rather than global. + - permit rpmgi to iterate over indices. + - teach rpmtsSolve() about dirnames/linktos dependencies. + - add rpmdbBlockDBI() to disable index access. + - automagically extract scriptlet executable dependencies. + - fix: don't close stdin exec'ing pgp/gpg, harmless warning (#197602). + - permit waitpid to be used instead of reaping SIGCHLD (#163151). + - add tracking dependency for parameterized file digests. + - fix: hide dbiFoo() internals from C++'s inability to promote void *. + - fix: default _D_EXACT_NAMLEN(d) to strlen((d)->d_name) on non-linux. + - debugedit: permit -debuginfo extraction for executables with -O0. + - remove SELinux context verification (#193488). + - perl.req: avoid extracting bogus deps in q{} sections (#198033). + - add macro for the path to the magic file used for classification. + - handle DT_GNU_HASH dependencies. + - avoid __typeof__ and __alignof__ usage portably. + - fix: explicitly terminate readlink(2) return. + - ppc: bogus unhandled relocations in debugedit.c (#199473). + - automatically fix and retry dbenv->open() on DB_VERSION_MISMATCH. + - fix: insure that %config files are removed on erasure. + - solaris: portability fiddles. + - avoid multiple lstat(2) calls installing %config files. + - avoid digest checks on sparse files handling %config dispositions. + - fix: missing epoch == 0 for --freshen (#143301). + - avoid access(2) quirks querying symlinks, lstat(2) instead (#60288). + - fix: don't open temporary db files before chroot entry (#103852). + - spew --usage to stderr, not stdout (#164021). + - populate internal copy of struct statvfs with all (linux) fields. + - add --target option for all rpm modes (#127729). + - use global rpmcliTargets for build/query modes. + - don't verify existence of sources/patches when --specfile querying. + - set all rpmrc/macro goop from --target (if present). + - incorporate latest gcc flags into per-arch rpmrc defaults. + - kill off rpmMachineScore() functionality. + - kill off rpmGet{Arch,Os}Info() and rpmGetMachine(). + - use rpmcliInit() in main(), trash the duplicated code. + - remove rpm{Get,Set}Var from the rpmlib API. + - preserve --rcfile/--target options when re-reading goop. + - don't process rpmrc files unless --rcfile is explicitly given. + - eliminate unused check-prereqs script (#203182). + - eliminate ancient convertrpmrc.sh conversion script. + - eliminate unused get_magic.pl, magic.{prov,req}, use libmagic instead. + - eliminate "traditional behavior" freshen.sh. + - add default value for buildroot macro. + - permit macros to be marked as readonly (i.e. cannot be redefined). + - ignore BuildRoot: and %clean from spec files. + - make rpmvercmp a vector, add a (*EVRcmp) vector to rpmds. + - open all rpmdb indices before entering chroot (#94250, #173285). + - lua: establish CWD == "/" for running of scripts. + - add rpm2lsb boilerplate, dumps both package headers in YAML. + - fix: last 8 bytes of RSA modulus is keyid for V3 pubkeys (#205080). + - updated sv.po translations. + - permit file:// URL's in binary packages. + - rpmio: add Chown/Lchown/Chmod/Mkfifo/Mknod/Utime/Symlink/Chroot stubs. + - use rpmio Chdir et al stubs everywhere. + - fix: permit chdir in lua scripts. + - maintain net-snmp HR-MIB info in /var/cache/hrmib. + - update to db-4.5.20 internal. + - merge install/erase interface flags. + - eliminate RPMTRANS_FLAG_REVERSE. + - split rpmtsCheck() and rpmtsOrder() flags from transFlags -> depFlags. + - add --noparentdirs and --nolinktos rpmtsCheck() disablers. + - add --noupgrade/--norequires/--noconflicts/--noobsoletes disablers. + - rpm-4.4.7 release. + +4.4.5 -> 4.4.6: + - start 4.4.6 development. + - perl: fix exuberant cut-n-paste. + - macosx: remove compile nits. + - dirty hacks to handle neon-0.26.0. + - make rpmps internals opaque. + - make rpmdb internals opaque. + - fix: hGetNEVRA segfault if missing arch tag (i.e. pubkeys). + - updated RU man pages (#185260). + - fix: tag sort is stable iff identical prefixes, nuke RPMTAG_D alias. + - add :yaml query format extension. + - fix: segfault brain fart with query format extension. + - start making rpmRelocation opaque. + - push rpmHeaderGetEntry() into rpm-python bindings. + - trick up --yaml output to avoid parsing problems from data. + - force utf-8 encoding for yaml/xml spewed strings. + - fix autogen.sh and configure.ac breakage. + - permit --without-lua. + - assign expected {scalar,array} return types to header tags. + - permit sha1/sha256/sha384/sha512 file digests as well as md5. + - fix: obscure segfault erasing multiply installed packages. + - fix: set file contexts on non-packaged dirs iff selinux enabled. + - add RIPEMD-160 and RIPEMD-128 digest support. + - drop almost all dependency whiteout from default rpm configgery. + - eliminate skipDirs fingerprint band-aid. + - eliminate support for _noDirTokens, refactoring as appropriate. + - eliminate SOURCEPACKAGE tag, use non-existence of SOURCERPM instead. + - add macros to parameterize rpmds probe dependency defaults. + - tsort for erased packages (#89500). + - refactoring to integrate erasure ordering. + - create RPMTAG_DIRNAMES dependency set, attach to transaction element. + - lash up for checking synthesized dependencies on parent directories. + - attempt (and abandon) parent directories as ordering relation. + - dports: add Variant:, Xmajor:, and Xminor: tags. + - permit separate configgery for source/binary file digests. + - release rpm-4.4.6. + +4.4.4 -> 4.4.5: + - nolibio: reopen FD_t to insure attached FILE * reading manifests. + - rollback: insure that rpmtsRollback excluded tid is correct. + - rollback: don't bother erasing rollback repackages, just don't create. + - fix: solaris d->d_reclen is unreliable in certain cases (#128593). + - fix: perldeps and prov.pl not to emit perl(main) (#177960) + - build against FC5t2+. + - irix: avoid NULL environ segfault with non-gcc sgi compiler (#178133). + - ppc: detect certain cpu's as "ppc", not "ppciseries" (#128604). + - rollback: make default configuration opt-out rather than opt-in. + - build against sqlite-3.3.3. + - build against neon-0.25.5. + - rollback: revert opt-out config, not ready for prime time yet. + - debuginfo: follow symlinks when copying source files (#149113). + - lua: don't link -lreadline and -lhistory (#147013). + - add tweaks to permit building in subdir, more to do yet (#81196). + - fix: don't process package manifest if HTML is found (#75774). + - fix: teach GNUconfigure about configure.[ac][in] (#170961). + - fix: insure that netsharedpath basename contains no '/' (#52725). + - popt: handle POPT_ARGFLAG_OPTIONAL correctly (#71147). + - python: doco strings for te.{Depth,Breadth}. + - upgrade to db-4.4.20. + - handle trailing delimiters in rpmvercmp more carefully (#178798). + - remove sqlite from the rpm-4_4 branch. + - encapsulate mounted file system handling in fs.[ch]. + - sum package file sizes into uint_64 accumulator for fssizes. + - fix: skip mount points with ESTALE return from stat(2). + - handle files up to 4Gb in packages. + - don't install on rdonly file systems (#119185). + - pass disk space errors using 64 bits. + - solaris: avoid diff -d in check-files (#130394). + - fix: payload reposition not needed for skipped symlinks in archive. + - remove hoary /usr/lib/{rpmpopt,rpmrc} legacy symlinks. + - x86_64: remove gcc warning cruft. + - detect missing re-install elements in a rollback transaction and exit. + - release rpm-4.4.5. + +4.4.3 -> 4.4.4: + - start rpm-4.4.4 development. + - re-enable libtool/pkgconfig/python/java automagic requires extractors. + - re-enable pubkey server configuration. + - perl: diddle Makefile.PL to build/link within rpm source tree. + - perl: add build dependency on perl(ExtUtils::MakeMaker) >= 6.17. + - don't build rpmgetconf by default. + - don't enable the fcntl transaction lock by default. + - popt R++. + - complete forking perl-RPM2/* to perl/* module name "RPM". + - upgrade to db-4.4.16 internal. + - rollback: move score board into transaction elements and eliminate. + - rollback: adjust installed package counts when rollback downgrading. + - rollback: don't force erase rpmdb headers, rollback downgrade will do. + - remove (broken) test programs trb.c and tgi.c. + - add fsm vectors for cpio peculier routines. + - make the fcntl transaction lock sensitive to --root (#151255). + - add --noconfig and --nodoc to query/verify modes. + - perl: install in vendor dir. + - support for tar payloads (hardlinks still need work). + - fix: remove faux error msg when fcntl transaction lock is disabled. + - functional tar payload creation in *.rpm packages. + - functional tar payload extraction from *.rpm packages. + - automated cpio/tar payload detection installing *.rpm packages. + - fix: mireSkip returned false positive match for non-existent tags. + - display dependency loops with rpm -qvT. + - popt: assume utf-8 encoding for untranslated strings (#172155). + - release rpm-4.4.4. + +4.4.2 -> 4.4.3: + - start 4.4.3 devel. + - put a --stats stopwatch on rpmReadPackageFile() I/O. + - ignore %excluded files for size + - add debugging labels for pre/post trans scriptlet execution. + - sqlite: path to find internal sqlite3.h + - debuginfo: canonicalize paths (#165434). + - debuginfo: pass --remove-comment switch (#165418). + - java: add automagic req/prov extractors and closure helper (#164953). + - statically link rpmi and rpm again again again. + - update uk.po (#142740). + - fix: check-prereqs typo (#147196). + - remove all uses of RPMSENSE_PREREQ. + - fix: revert to older/slower perldeps avoid getOutputFrom() error. + - zlib: uniqify several more symbols. + - add symbol versions everywhere, proof-of-concept. + - don't re-export zlib-in-rpmio and bdb-in-rpmdb symbols. + - remove gcc warning from popt and rpmio compilation. + - rpmdb.c: remove need to include rpmio_internal.h. + - add --dupes popt alias. + - identify headers from whence they came. + - fix: don't fire triggers on test (#25756). + - rpmluaFree: substitute globalLuaState for NULL arg. + - add path to *.rpm package into rpmdb/repackaged headers. + - track many-to-many relation between installed and erased packages. + - eliminate rpmtsGetKeys() and ancient ts.getKeys() python method. + - upgrade to db-4.3.29. + - add --target to rpm queries. + - rollback: add --rbexclude tid option. + - rollback: merge latest hackery for composting. + - upgrade same NEVR with --force if not literally identical (#134388). + - add cpuinfo(foo) dependency name space to map /proc/cpuinfo provides. + - add rpmlib(foo) dependency name space to map rpmlib provides. + - eliminate rpmCheckRpmlibProvides(), use rpmdsSearch() instead. + - eliminate rpmGetRpmlibProvides(), use rpmdsRpmlib() instead. + - eliminate rpmShowRpmlibProvides(), print rpmdsRpmlib() instead. + - add system configurable provides read from /etc/rpm/sysinfo. + - display sysinfo/cpuinfo provides with --showrc iff --verboose. + - fix: boundary case segfault in rpmdsSearch. + - python: bindings for rpmds{Search,Cpuinfo,Rpmlib,Sysinfo}. + - use generic /usr/src/rpm path for building instead. + - don't check /usr/local routinely when configuring (#116709). + - permit Requires: hints. + - convert changelogs to utf8 on input and output (#140050). + - clean up build environment, better than macro overloading (#132907). + - add getconf(1) provides as a dependency name space set. + - upgrade to db-4.4.11 internal. + - add /etc/ld.so.cache provides as a dependency name space set. + - fix: remove context markers from :depflags format modifier. + - permit Requires:/Conflicts: macro expand probes during rpmtsCheck(). + - Suggests: and Enhances: spec syntax, synonym(s) for Requires(hint):. + - add suggests/enhances header extensions with --query. + - add --suggests and --enhances popt aliases for header extensions. + - implement %triggerprein scriptlets. + - fix: unlink __db* files if dbenv->open returns EINVAL. + - fix: attempt solvedb open only once. + - python: change ts.check callback, pass rpmds, not TagN, N, EVR, Flags. + - python: set pkgorigin in hdr by extracting from yum (h,path) pkgkey. + - fix: handle file:///var/lib/rpm in %_dbpath correctly for queries. + - update to file-4.16 internal. + - add access(2) run-time probe dependencies. + - eliminate --nogpg and --nopgp, use --nosignature instead. + - python: add python peculier build macros (#120635). + - popt: support for lone dashes (#129944). + - permit Build{Suggests,Enhances}: and BuildRequires(hint): (#114338). + - divvy up locale specific man pages between sub-pkgs (#146842). + - perl: handle the 'v' in "use v5.6.0" (#140597). + - add run-time perl(...) provides name space dependency set. + - add -lresolv and build on CentOS3. + - fix: wipe setuid/setgid bits on updated files (#125517). + - python: add optional transaction id goal to ts.IDTX{load,glob}. + - use bsearch to speed up tagname() and tagvalue(). + - display tag value and type with rpmquery -v --querytags. + - remove tag{Name,Value,Type} from the ABI, rpmTags vectors instead. + - add Requires: %%{rpm_license_check} to rpm packaging. + - add Requires: getconf(GNU_LIBPTHREAD_VERSION) = NPTL to rpm packaging. + - resurrect a rpm-perl subpackage from perl-RPM2-0.66. + - autogenerate libtool *.la dependencies (#159221). + - autogenerate pkgconfig *.pc dependencies (#159235). + - add brp-nobuildrootpath to scrub $RPM_BUILD_ROOT from *.la and *.pc. + - fix: rescusitate doxygen doco, don't bother tools/dump.c. + - generate executable(foo) run-time shell requirements, opt-in for now. + - fix: python/rpmte-py.c te.Key() return needs Py_INCREF(Key). + - fix: stablize tagValue() sort, prefer longest name. + - eliminate RPMTAG_{SERIAL,COPYRIGHT} names (for sort stability ;-). + - don't display "(none)\n" in --queryformat '[...]' (i.e. --conflicts). + - add dependency result int array to dependency sets. + - lazy malloc for dependency set color/refs/result on 1st setter call. + - set boolean result in rpmdsSearch (if malloc'd). + - fix: set transaction autorollback goal from popt on --install. + - truncate changelogs to no. of entries or date (default: 1y) (#147362). + - rpmdb: expose dbiTagsInit, rpmdbNew, rpmdbOpenDatabase symbols. + - rpmrc: eliminate RPMVAR_PROVIDES, use /etc/rpm/sysinfo instead. + - add uname(foo) dependency name space to map uname(2) provides. + - link all rpm executables statically. + - refactor rpmfcELF() to rpmdsELF() to extract ELF dependencies. + - add soname(/path/to/libfoo.so) run-time dependency probe. + - fix: strip ${RPM_BUILD_ROOT} in libtooldeps.sh --provides. + - fix: simpler python peculier macros, multilib aware (#120635). + - ornament the rpmds API with diagnostic helpers. + - rpmdeps: add --{cpuinfo,rpmlib,sysinfo,getconf,elf,ldconfiguname } options. + - display -Va dependency failures as Requires: or Conflicts: (#172878). + - fix: ignore %ghost vs. %ghost file conflicts (#155256). + - autogenerate java *.(jar|class) dependencies (#117382). + - fix: add flink (pkgid,hdrid,nevra) to repackaged packages correctly. + - fix: if install element fails, don't erase any linked element. + - fix: repackaged payloads can be missing files, continue unpacking. + - hpux: use _GLOB_INCLUDED as well as _GLOB_H (#113340). + - hpux: test for (__hpux) everywhere that hpux was tested (#101717). + - rollback: use explicit no. of args comparing header flink/blink data. + - rollback: plug IDTXglob header memory leak. + - rollback: use earlier of arbgoal and rbtid times. + - don't generate libtool/pkgconfig/java/python Requires: by default. + - establish/expose default macro configuration for --rollback. + - update de.po. + - rpm-4.4.3 release. + +4.4.1 -> 4.4.2: + - start 4.4.2 devel. + - sqlite3: revert cClose scoping, data is freed in cClose unlike db4. + - build against sqlite3-3.1.2. + - sqlite3: update encode/decode from sqlite-2.8.16. + - add --xml popt alias for query modes. + - remove _rpmdb now that python2.[34] are commonly available. + - remove remnant -I/opt/local hacks, --prefix=/usr is recommended. + - rework configure.ac et al to lose internal library baggage flexibly. + - updated sv.po . + - permit gpg to be used for RSA signatures. + - permit RSA key sizes larger than 1024 bits. + - permit RSA/{sha1,sha256,sha384,sha512} signature verification. + - updated de.po (#162756). + - added CVSId: tag and SVNId: alias (#162807). + - added brp-java-gcjcompile build helper. + - fix: java compiled with -O0 confuses debugedit (#161722). + - fix: % at end-of-line overflow (#161091). + - *_terminate_build macros set per-pkg, not per-invocation (#161081). + - use perldeps.pl, phase out perl.{req,prov} (#161921). + - fix: make sqlite3 rpmdb endian-neutral (#159425). + - fix: permit sqlite3 rpmdb with chroot (#159424). + - fix: find-debuginfo.sh not handling set[ug]id ELF files (#100963). + - fix: find-debuginfo.sh kernel voo-doo tweaks (#159346). + - fix: initialize variables used in debug msg (#160458). + - permit zlib in rpm to be built with make -j (#159404). + - avoid '?' for zero length file mmap failure doing md5 (#159405). + - permit scriptlet includes from builddir for spec files w/o %setup. + - upgrade to zlib-1.2.2.4 internal. + - macosx: avoid minigzip build failures. + - upgrade to file-4.14 internal. + - fix: magic_file() closes stdin when given directory path. + - use perldeps.pl, phase out perl.{req,prov} (again). + - document __vsflags (#147489). + - release rpm-4.4.2. + +4.4 -> 4.4.1: + - force *.py->*.pyo byte code compilation with brp-python-bytecompile. + - automagically detect and emit "python(abi) = 2.4" dependencies. + - popt 1.10.1 to preserve newer. + - use package color as Obsoletes: color. + - upgrade to db-4.3.27. + - revert MAGIC_COMPRESS, real fix is in libmagic (#143782). + - upgrade to file-4.12 internal. + - mac os x patches (#131943,#131944,#132924,#132926). + - mac os x patches (#133611, #133612, #134637). + - build against external/internal neon. + - add https://svn.uhulinux.hu/packages/dev/zlib/patches/02-rsync.patch + - changes to build on Mac OS X using darwinports neon/beecrypt. + - blueprint rpm-4_4 and HEAD to minimize diff spew. + - add missing #if defined(ENABLE_NLS) (#146184). + - python: force dbMatch() h# key to be 32 bit integer (#146477). + - add sqlite internal (build still expects external sqlite3-3.0.8). + - sqlite: revert to original narrow scoping of cOpen/cClose. + - fix: length of gpg V4 hash seed was incorrect (#146896). + - add support for V4 rfc-2440 signatures. + - sqlite3: run-time endian test rather than chasing (#146752). + - discover and use getmntinfo if present. + - perform callbacks as always (#147537). + - permit build scriptlet interpreters to be individually overridden. + - zlib: uniqify certain symbols to prevent name space pollution. + - macosx: include so that python sees the u_char typedef. + - macosx: change to --prefix=/usr rather than /opt/local. + - use waitpid rather than SIGCHLD reaper. + - rip out DB_PRIVATE revert if not NPTL, it's not the right thing to do. + - don't classify files in /dev (#146623). + - don't build with sqlite3 if is missing. + +4.3.3 -> 4.4: + - pentium3/pentium4 arch support (pluto@PLD). + - cpuid() cleanups for PIC/non-PIC and gcc 3.4 (pluto@PLD). + - rpmGlob() is now locale independent (wiget@PLD). + - conditional build support/unification (jajcus,malekith,qboosh,wiget@PLD). + - fix: readelf.c breakage on some non x86 arches (qboosh@PLD). + - find-lang.sh: implemented --with-kde (finds KDE help files); + - add --all-name option (finds every lang file); drop defattr() + from *.lang files (arekm,mkochano,pascalek,wiget@PLD). + - add type to tag array. + - add Disttag: syntax to spec file parser and header content. + - define Suggests:/Enhances: and Priority: tag values. + - prevent RPMSENSE_PREREQ from being set or tested. + - python: add rpm.ps() object to carry problem set info. + - python: permit rpm.ds() analogue to hdr.dsFromHeader() creator. + - python: permit rpm.fi() analogue to hdr.fiFromHeader() creator. + - silently add default %defattr(-,root,root) for all packages. + - fix: don't set handler if SIG_IGN is already set (#134474). + - disable expensive header+payload verifies in default config. + - adjust digest/signature stats to count #pkgs and bytes. + - obsolete Serial:, Copyright:, and RHNPlatform: syntax in spec files. + - permit Obsoletes: /path/to/file. + - permit Conflicts: /path/to/file. + - free rpmrc when looping on --target arches (#127730). + - fix: handle non-unique dirnames in rpmalAdd(). + - integrate rpmgi "generic iterator" with query/verify. + - bump popt version to 1.10. + - attempt dependency tree breadth, take 1. + - use external libneon for http/https transport. + - add --delsign to purge packages of digital signatures. + - neon used by default for http/https transport. + - upgrade to db-4.3.21 final internal. + - remove noNeon runtime switch, http through neon only. + - remove http put to be able to build against upstream neon. + - bump soname into libfoo-4.4.so everywhere. + - sparcv8: optflags changed to -mtune=ultrasparc (#140420). + - add BuildRequires: neon-devel. + - fix: chunked davRead returns 0 is EOF. + - python: bleeping keywords broke labelCompare. + - add support for automagic pubkey retrieval using HKP. + - detect and return errors from neon through Ferror. + - use package color as Obsoletes: color. + +4.3.2 -> 4.3.3: + - bump micro version. + - make peace with libtool-1.5.10 and automake-1.9.3. + - python: add python 2.4 support. + - selinux: use rpm_execcon, not execv, to run scriptlets (#136848). + - fix: segfault on --verifydb (#138589). + - sparcv8: optflags changed to -mtune=ultrasparc (#140420). + - port to internal file-4.10 libmagic rather than libfmagic. + - move global /var/lock/rpm/transaction to dbpath. + - permit fcntl path to be configured through rpmlock_path macro. + +4.3.1 -> 4.3.2: + - use /etc/selinux/targeted/contexts/files/file_contexts for now. + - disable file contexts into package metadata during build. + - fix: "/path/foo.../bar" was losing a dot (#123844). + - lua embedded in rpmio. + - use lua to identify desired selinux file context regexes. + - add 'requires' and 'conflicts' tag aliases. + - python: return ds, not tuple, for ds iteration. + - python: permit integer keys to ts.dbMatch(). + - xml: use markup for empty tags. + - xml: instead of 0 markup. + - fix: disable fingerprint generation on kernel paths. + - add ppc8[25]60 arches. + - fix: evaluate rather than default file_contexts path. (#127501). + - avoid "can't happen" recursion while retrieving pubkeys. + - add ppc32dy4 arch. + - make peace with automake 1.9.1. + - fix: defattr for rpm-libs (#130461). + - print dependency loops as warning iff --anaconda is specified. + - fix: mark uninstalled elf32 files in rpmdb to disable -Va checks. + - ia64: add autorelocate_dcolor to macros.in. + - disable static linking until libc*.a provides symbols. + - fix: revert Obsoletes: "fix" (#134497). + - fix: work around for dangling symlinks not globbed (#134362). + - display caught signals to diagnose #134474 (gonna be SIGPIPE). + - display N-V-R.A in dependency failure messages. + - selinux: set "rpm_script_t" always, not just for /bin/sh. + - honor inherited SIG_IGN when establishing rpmdb signal exit (#134474). + - don't add time stamp to compressed man pages (#132526). + - python: remove ".A" from creaky ts.check() tuple return (#135008). + - python: fix RPMPROB_BADRELOCATE segfault return in ts.check (#137116). + - revert selinux patch until fc3 release. + - reprise file conflicts yet again, flip/flop/flip/flop ... + - fix: buffer overrun displaying ko_KR (#135389). + +4.3 -> 4.3.1: + - fix: don't add leading space to %* argv expansion (#119059). + - scareMem = 0 everywhere, document deprecation phase out. + - fix: add u+w to FIXPERMS. + - add buildtime to rpmds, methods to retrieve. + - python: hide labelCompare() underneath ds.cmp(a,b). + - fix: segfault on --recontext if file_contexts unreadable (#117374). + - fix: /etc/security/selinux/file_contexts is default path. + - fix: no transaction lock if --test was specified (#119783). + - perl: skip new-fangled head[34] while generating deps (#118243). + - perl: use __perl for perl variable macros (#115156). + - make peace with libtool-1.5.6. + - fix: follow current is_selinux_enabled() return (#121004). + ? fix: exit fail when erasing multiple identical packages (#120519). + - add aurora/sparc patches (#124469). + - use poll(2) if available, avoid borked aurora/sparc select (#124574). + +4.2.3 -> 4.3: + - upgrade to zlib-1.2.beta7. + - fix: short option help missing string terminator. + - permit secondary tag match patterns with RPMQV_ALL. + - fix: cut-n-paste error setting nopromote for Conflicts: (#81965). + - don't use error string after gzclose (Dmitry V. Levin). + - only internal Berkeley db from now on. + - revive "make dist". + - fix: added index size wrong iff _transaction_color != 0/3 (#103865). + - fix: escape '+' in regex patterns through RPMMIRE_DEFAULT (#103851). + - RPMMIRE_DEFAULT is overkill, use RPMMIRE_STRCMP instead (#103851). + - don't use mktemp if mkstemp is available (#103850). + - python: return None for NEVRAO, [] for everything else. + - python: throw exception on bad arg to labelCompare (#113661). + - re-add --enable-posixmutexes to build. + - fix: set fcontext from pkg when file_contexts doesn't exist (#114040). + - fix: set fcontext for "mkdir -p" directories not in packages. + - fix: setfiles (aka rpmsx.c) dinna handle patterns correctly. + - establish rpm_script_t before scriptlet exec. + - python: add patch to rpm-4_3 to initialize RE contexts. + - fix: only first "mkdir -p" directory had context set. + - stable sort for policy specifications, patterns before paths. + - set "rpm_script_t" exec type for scriptlets iff /bin/sh, else default. + - force FD_CLOEXEC on 1st 100 inherited fdno's. + - serialize rpmtsRun() using fcntl on /var/lock/rpm/transaction. + - permit globs in macrofiles: directive (#117217). + - fix: segfault generating transaction serialization lock path. + - use /etc/security/selinux/file_contexts instead. + - selinux: ignore ENOTSUP return from lsetfilecon. + - add sparcv8 and enable elf32/elf64 Zon sparc64 (#117302). + - fix: --querybynumber looped. + - fix: ENOTSUP filter from lsetfilecon borkage. + - fix: increase file context regex parse buffer to BUFSIZ. + - fix: handle elf64 note sections correctly. + - fix: grrr, skip notes on non-i386 entirely. + - endian neutral rpmdb join keys (finally). + - fix: dev package build on s390x hack around. + +4.2.2 -> 4.2.3: + - bump rpm and popt versions to insure "newer". + - change default behavior to resolve file conflicts as LIFO. + - add --fileconflicts to recover rpm traditional behavior. + - prefer elf64 over elf32 files, everywhere and always (#126853). + - ia64: auto-relocate entire, not partial, directory contents (#126905). + - ia64: auto-relocate glibc.ix86 interpreter path (#100563). + - shared libraries in separate rpm-libs package. + - fix: defattr for rpm-libs (#130461). + - fix: static glibc/libgcc helpers always installed (#127522). + - ia64: make sure that autorelocated file dependencies are satisfied. + - ia64: relocate all scriptlet interpreters. + - ia64: don't bother trying to preload autorelocated modules. + - fix: filesystem package needs mail/lock w/o getgrnam. + - fix: do getpwnam/getgrnam to load correct modules before chroot. + +4.2.1 -> 4.2.2: + - unify signal handling in librpmio, use condvar to deliver signal. + - make peace with libtool-1.5, autoconf-2.59, automake-1.8. + - build with db-4.2.52 internal. + - refresh bsddb. + - detect (and remove) dbenv files while upgrading to db-4.2.52. + - ensure that librpmdb links against just built, not system, librpmio. + - fix: dangling pointer brain fart (#107835). + - fix: ds.Single() method needs malloc'd elements (#109919). + - convert ja and ko man pages to utf8 (#106050). + - man page corrections (#106415). + - perl.req typo (#106672). + - fix: wrong package count for trigger scriptlet 1st arg (#100509). + - fix: don't break header SHA1 if non-existent user/group (#97727). + - remove fuids/fgids from rpmfi, easier to lookup fuser/fgroup instead. + - merge sensible parts of openpkg rpm.patch.bugfix (#104780). + - mark _javadocdir as documentation (#102898). + - flush pipe before exit 1 in check-files (#103867). + - perl.req: avoid regex misfire on '^use' in "= <<" assign (#109934). + - find-debuginfo.sh: permit stripping unwritable by non-root (#112429). + - missing build dependency (#111104). + - spelling corrections (#112728). + - use -fPIC -DPIC on all platforms, not just mandatory (#112713). + - popt: pad to display length, not strlen, for i18n popt args (#106240). + - python: include Python.h before glibc features.h. + - python: return [], not None, accessing header tags (#112794). + - python: avoid invoking python to acquire ill-specified parameters. + - add ia32e arch. + - fix: sq->reaped needs sighold(SIGCHLD)/sigrelease(SIGCHLD) (#117620). + +4.2 -> 4.2.1: + - fix: nested %if handling, optind initialization posix vs. glibc. + - add version check for package with provides and obsoletes. + - hack out O_DIRECT support in db4 for now. + - build with external beecrypt-3.0.0. + - x86_64 -> athlon, ppc64[ip]series -> ppc64 arch compatibility. + - treat missing epoch's exactly the same as Epoch: 0. + - pass structure pointer, not args, through headerSprintf call chain. + - add ":xml" header format modifier. + - --queryformat '[%%{*:xml}\n]' to dump header content in XML. + - add ".arch" suffix to erase colored packages with identical NEVR. + - update ja man pages (#92261). + - backport rpmsw stopwatch, insturment rpmts operations. + ? toy method to enable --stats through bindings. + - fdCLose typo (#97257). + - brp-python-bytecompile to automagically bytecode compile python. + ? update for fr.po (#97829). + - don't attempt to remove dbenv on --rebuilddb. + - autorelocate ix86 package file paths on ia64. + - resurrect manifests, RPMRC_NOTFOUND returned by readLead(). + - python: missed tuple refcount in IDTXload/IDTXglob. + - fix: IDTXglob should return REMOVETID sorted headers (#89857). + - resolve elf32/elf64 file conflicts to prefer elf64. + - apply debugedit patch necessary to produce kernel -debuginfo files. + ? ia64: autorelocate only colored, not every, file when installing. + ? repair find-debuginfo.sh to avoid recursing in /usr/lib/debug. + ? fix: ia64: don't attempt autorelocate on .src.rpm's. + ? fix: debuginfo: -not -path /usr/lib/debug needed -prune too. + ? fix: packages w/o file colors segfault. + ? add amd64 as alias for x86_64 (#99553). + ? fix: add -n to brp-compress to avoid needless file conflicts. + ? fix: ia32 on ia64 segfaults because of automagic file relocations. + ? speed up convertdb1 (#103206). + ? revert i18n table change to preserve help array size. + ? add config directories for ppc64pseries/ppc64iseries. + ? filter GLIBC_PRIVATE dependencies. + - fix: check added provides against installed conflicts (#110317). + - changes for python 2.3 + - changes for libtool-1.5 + - changes for automake-1.7.8 + - changes for db-4.2.42. + - splint fiddles. + +4.1 -> 4.2: + - set cachesize without a dbenv, the default is far too small. + - db: don't return EACCES on db->close w/o environment. + - unify cachesize configuration, with (or without) a dbenv. + - comments regarding unsupported (yet) db-4.1.17 functionality. + - update to db-4.1.24 final. + - eliminate myftw, use Fts(3) instead. + - dump libelf, gulp elfutils, for now. + - python: permit headers to be hashed. + - use %%{_lib} for libraries. + - include file-3.39 (with homebrewed) libfmagic, for now. + - add debug sub-package patch. + - re-add elfutils/libdwarf (for dwarf.h), eliminate tools/dwarf2.h. + - resurrect genhdlist "greased lightning" pathway for now. + - elfutils: avoid gcc-3.2 ICE on x86_64 for now. + - add /usr/lib/rpm/rpmdeps. + - add /usr/lib/rpm/magic. + - fix: /dev/initctl has not MD5 segfault (#76718). + - rpm.8: gpg uses GNUPGHOME, not GPGPATH (#76691). + - add error message on glob failure (#76012). + - add _javadir/_javadocdir/_javaclasspath macros. + - fix: bash must have functional libtermcap.so.2. + - update to elfutils-0.56. + - have debug sub-subpackage use external, not internal, elfutils. + - apply patches 1-6 to db-4.1.24. + - resurrect availablePackages one more time. + - fix: option conflict error message (#77373). + - add AC_SYS_LARGFILE throughout. + - statically link rpmdeps against (internal) libfmagic. + - use rpmdeps rather than find-{requires,provides}. + - bundle libfmagic into librpmbuild for now. + - apply patches 7 and 8 to db-4.1.24. + - upgrade to elfutils-0.59. + - add -g to all platforms optflags. + - build with external elfutils (preferred), if available. + - upgrade to elfutils-0.63. + - link rpm libraries together, use shared helpers with external -lelf. + - move libfmagic to librpmio. + - use libtool-1.4.3, autoconf-2.56. + - add explicit -L/lib64 -L/usr/lib64 for libtool mode=relink on x86_64. + - use usrlib_LTLIBRARIES to install directly in /usr/lib64 instead. + - late rpmts reference causes premature free (#78862). + - internal automagic dependency generation (disabled for now). + - don't generate dependencies unless execute bit is set. + - enable internal automagic dependency generation as default. + - fix: add rpmlib(VersionedDependencies) if versioned Provides: found. + - fix: add %%ifnarch noarch to debug_package macro. + - debug_packages "works", but non-noarch w/o %setup has empty payload. + - make dependency generation "opt-in" in order to build in distro. + - fix: make sure each library has DT_NEEDED for all unresolved syms. + - generate Elf provides even if file is not executable. + - disable fcntl(2) lock on Packages until glibc+nptl is fixed. + - make cdb locks "private" for pthreads compatibility w/o NPTL. + - add --enable-posixmutexes to use NPTL. + - make dependency generation "opt-out" everywhere. + - rebuild against glibc with fcntl fixed in libpthread. + - re-enable CDB locking, removing "private" from %%__dbi_cdb macro. + - popt aliases for -U et al to achieve dynamic link with nptl. + - add --file{class,provide,require} popt aliases and header extensions. + - statically link against /usr/lib/nptl/libpthread.a, if present. + - remove popt aliases for -U et al. + - add -I/usr/include/nptl, Conflicts: kernel < 2.4.20. + - dynamically link /bin/rpm, link against good old -lpthread. + - test pthread_{mutex,cond}attr_setpshared(), add DB_ENV_PRIVATE if not. + - error on exclusive Packages fcntl lock if DB_ENV_PRIVATE is set. + - copy compressFilelist to convertdb1.c, remove internal legacy.h. + - add --enable-posixmutexes when configuring on linux. + - add rpmdb_{deadlock,dump,load,svc,stat,verify} utilities. + - include srpm pkgid in binary headers (#71460). + - add %check scriptlet to run after %install (#64137). + - simplify specfile query linkage loop. + - drill rpmts into parseSpec(), carrying Spec along. + - fix: remove rpmfi scareMem so that headers can be reloaded on ia64. + - fix: set DB_PRIVATE, not DB_ENV_PRIVATE, if unshared posix mutexes. + - remove useless kernel/glibc dependencies (#79872). + - add matching "config(N) = EVR" dependencies iff %%config is found. + - add %%pubkey attribute to read armored pubkey files into header. + - permit both relative/absolute paths, display 'P' when verifying. + - resurrect automagic perl(foo) dependency generation. + - add BETA-GPG-KEY (but not in headers using %%pubkey yet). + - disable perl module magic rule. + - ignore ENOENT return from db->close (#80514,#79314). + - fix builddir relative inclusion, add %%pubkeys to rpm header. + - fix: package relocations were broken (#75057). + - error if querying with iterator on different sized arrays. + - add rpmfi methods to access color, class, and dependencies. + - don't segfault with packages produced by rpm-2.93 (#80618). + - python: eliminate hash.[ch] and upgrade.[ch], methods too. + - fix :armor query extension, tgpg mktmp handling (#80684). + - use rpmfiFClass() underneath --fileclass. + - use rpmfiFDepends() underneath --fileprovide and --filerequire. + - python: add fi.FColor() and fi.FClass() methods. + - calculate dependency color and refernces. + - python: add ds.Color() and ds.Refs() methods. + - fix: typo in assertion. + - add rpmts/rpmte/rpmfi/rpmds element colors. + - ignore items not in our rainbow (i.e. colors are functional). + - fix: dependency helpers now rate limited at 10ms, not 1s. + - add per-arch canonical color, only x86_64 enabled for now. + - file: avoid ogg/vorbis file classification problems. + - portabilitly: solaris fixes. + - for DSO's, provide the file basename if DT_SONAME not found. + - add perldeps.pl, start to replace perl.{prov,req}. + - file: read elf64 notes correctly. + - python: put rpmmodule.so where python expects to find. + - add brp-strip-static-archive build root policy helper. + - add -lelf to rpm LDFLAGS, not LDADD, since there is no libelf.la now. + - fix: obscure corner case(s) with rpmvercmp (#50977). + - file: *really* read elf64 notes correctly. + - python: restore thread context on errorCB (#80744). + - teach rpmquery to return "owning" package(s) in spite of alternatives. + - duplicate package checks with arch/os checks if colored. + - file conflict checks with colors. + - fix: debugedit.c problem. + - permit anaconda to choose "presentation order". + - fix: more debugedit.c problems. + - fix: clean relocation path for --prefix=/. + - python: permit stdout/stderr to be remapped to install.log. + - pay attention to package color when upgrading identical packages. + - fix: trap SIGPIPE, close database(s). + - configurable default query output format. + - popt: diddle doxygen/splint annotations, corrected doco. + - file: fix ogg/vorbis file classification problems. + - skip fingerprints in /usr/share/doc and /usr/src/debug. + - add file(1) as /usr/lib/rpm/rpmfile. + - enable transaction coloring for s390x/ppc64. + - file: check size read from elf header (#85297). + - fix: memory leak (85522). + - build with internal elfutils if not installed. + +4.0.4 -> 4.1: + - loosely wire beecrypt library into rpm. + - drop rpmio/base64.[ch] in favor of beecrypt. + - drop lib/md5*.[ch] files in favor of beecrypt. + - legacy: drop brokenMD5 support (rpm-2.3.3 to rpm-2.3.8 on sparc). + - eliminate DYING code. + - bind beecrypt md5/sha1 underneath rpmio. + - create RFC-2440 OpenPGP API in rpmio. + - proof-of-concept GPG/DSA verification for legacy signatures. + - upgrade to beecrypt-2.2.0pre. + - proof-of-concept PGP/RSA verification for legacy signatures. + - ratchet up to lclint "strict" level. + - upgrade to db-4.0.7. + - use only header methods, routines are now static. + - beecrypt is at least as good as pgp/gpg on verify, pulling the plug. + - add :base64 and :armor format extensions, dump binary tags in hex. + - proof-of-concept pubkey retrieval from RPM-{PGP,GPG}-KEY. + - stupid macros to configure public key file paths. + - all symbols but hdrVec are now forward references in linkage. + - generate an rpm header on the fly for imported pubkeys. + - wire transactions through rpmcli signature modes. + - wire transactions through rpmcli query/verify modes. + - wire transactions through rpmcli install/erase modes. + - legacy signatures always checked (where possible) on package read. + - wire transactions through rpmcli build modes. + - lazy rpmdb open/close through transaction methods (mostly anyways). + - no-brainer refcounts for rpmdb object. + - check added header against transaction set, replace if newer. + - transaction sets created in cli main. + - no-brainer refcounts for ts object. + - memory indices for dependency check are typedef'd and abstract'd. + - no-brainer refcounts for fi object, debug the mess. + - dump the header early in transaction, recreate fi before installing. + - start hiding availablePackage data/methods in rpmal.c/rpmal.h. + - add some dinky availablePackage methods. + - transaction.c: cleanly uncouple availablePackage from TFI_t. + - add header refcount annotations throughout. + - depends.c: availablePackage is (almost) opaque. + - invent some toy transactionElement iterators. + - create rpmDepSet constructors/destructors. + - create toy rpmDepSet iterators. + - rpmRangesOverlap renamed to dsCompare, add dsNotify method as well. + - depends.c: rpmDepSet is (almost) opaque, move to rpmds.[ch]. + - rpmds: create dsProblem(), dsiGetDNEVR() retrieved DNEVR, not N. + - depends.h: hack around teIterator() et al from include for now. + - rpmds: move trigger dependencies into a rpmDepSet as well. + - rpmal: availablePackage is totally opaque, alKey with index replaces. + - linear search on added package provides is dumb. + - discarding entire signature header when using --addsign is dumb. + - rip out rpmDependencyConflict, replace with rpmProblem instead. + - no-brainer refcounts for rpmProblemSet object. + - header tag sets are per-transactionElement, not per-availablePackage. + - no-brainer refcounts for rpmDepSet and rpmFNSet objects. + - strip header tags for erased as well as installed transactionElements. + - common structure elements for unification of TFI_t and rpmFNSet. + - factor per-transactionElement data out of TFI_t through pointer ref. + - unify rpmFNSet into TFI_t. + - eliminate header reference in rpmtransAddPackage, use TFI_t data. + - commit to using rpmDepSet and TFI_t, not header. + - lclint rpmio fiddles. + - split file info tag sets into rpmfi.c. + - create toy TFI_t iterators. + - tweak overlapped file fingerprint retrieval for speed. + - transaction.c: use wrappers/iterators to access TFI_t. + - annotations to make a transactionElement opaque. + - use array of pointers rather than contiguous array for ts->order. + - methods to complete making transactionElement opaque. + - use TR_REMOVED relations as well as TR_ADDED for ordering. + - drop requirement that removed packages immediately follow added. + - hybrid chainsaw/presentation ordering algorithm. + - convert file md5sum's to binary on the fly, reducing memory footprint. + - header handling moved to librpmdb to avoid linkage loops. + - fix a couple dinky memory leaks. + - build with an internal zlib for now. + - protect brp-compress against /bin/ls output ambiguity (#56656,#56336). + - 3 madvise calls and a 16Mb mmapped buffer == ~5% install speedup. Wow. + - use db-4.0.14 final internally. + - 1st crack at making zlib rsync friendly. + - lclint-3.0.0.19 fiddles. + - simple automake wrapper for zlib. + - splint fiddles. + - make peace with gcc-3.1, remove compiler cruft. + - make peace with automake et al in 8.0, ugh. + - add payload uncompressed size to signature to avoid rewriting header. + - drill header sha1 into signature parallel to header+payload md5. + - mandatory "most effective" signature check on query/verify/install. + - don't bother adding empty filemd's to index. + - add Pubkey index, using signer id as binary key. + - display pubkeys in hex when debugging db access. + - retrieve pubkey(s) from rpmdb, not from detached signature file. + - add header DSA signature. + - add header RSA signature (untested, disabled for now). +` - don't bother with signing check if 16 bits of hash don't match. + - only V3 signatures for now. + - wire --nodigest/--nosignature options to checksig/query/verify modes. + - splint annotations, signature cleanup. + - drill ts/fi through verify mode, add methods to keep fi abstract. + - use mmap when calculating file digests on verify, ~20% faster. + - permit --dbpath and --root with signature (i.e. --import) modes. + - beecrypt: add types.h, eliminate need for config.gnu.h. + - rescusitate --rebuild. + - use rpmdb-redhat to suggest dependency resolution(s). + - merge conflicts into problems, handle as transaction set variable. + - use build time to choose one of multiple alternative suggestions. + - add --nosuggests to disable suggested resolutions. + - attempt to make peace with automake-1.6.1, autoconf-2.53. + - rip out two layers of dbN gook, internal Berkeley db is here to stay. + - eliminate db1 support. + - enable CDB by default. + - use DBT_DB_MALLOC to eliminate re-malloc'ing header blobs. + - rework most of rpmdb.c prepatory to implementing duplicates. + - fix: 2 memory leaks in headerSprintf. + - fix: db mire's access out-of-bounds memory. + - plug install mode leaks. + - opaque (well mostly) rpmTransactionSet using methods. + - Grand Renaming of rpm data types. + - fix: synthesize unpacking progress callbacks for packages w/o files. + - python: add rpmds/rpmfi/rpmts methods. + - python: re-enable rpm-python sub-package. + - fix: resurrect "()(64bit)" markings using objdump. + - python: add rpmal/rpmte/rpmfd methods. + - perl: drop cpanflute and cpanflute2, will be in Chip's CPAN package. + - python: eliminate legacy db methods, add ts.dbMatch method. + - fix: use getgrnam, not getpwnam, to convert gid -> group. + - fix: avoid sign extension, use only 16 bits, when verifying rdev. + - python: separate {add,del}Macro methods, prepare for macro dictionary. + - i18n: copy current production PO files to top-of-stack. + - python: include rpmdb module, renamed from bsddb3. + - use /etc/rpm/platform (if it exists), rather than uname(2), for arch. + - python: portability fiddles (#54350). + - check inodes (but not blocks) on FAT file systems (#64256). + - add /usr/lib/rpm/redhat/* per-vendor configuration. + - remove build mode compatibility aliases, documented and gone. + - document digital signature verification in rpm.8. + - fix: separate existence and number checks for problems found (#66552). + - beecrypt: merge changes from beecrypt-2.3.0. + - beecrypt: merge doxygen markup with rpmapi doco. + - beecrypt: revert cpu/arch compile option mixup (#66752). + - ix86: make sure that rpm can verify prelinked shared libraries. + - don't install /usr/lib/rpm/redhat per-vendor configuration anymore. + - add translated man pages from PLD. + - resurrect libelf with Elf64, prelink verify should work everywhere. + - fix: reading macro files can corrupt memory if BUFSIZ is teensy. + - fix: assertion failure iff incomplete package install (#66837). + - python: link internal libelf (if used) directly into rpmmodule.so. + - use rpmdb-redhat for suggestions if/when configured (#67430). + - disambiguate failures to import (with error messages, duh). + - fix: multiple relocations (#67596). + - add --build/--program-prefix, delete libtoolize, from %configure. + - find-lang.sh: make sure that mo pattern matches leading '/' (#67368). + - disambiguate added/installed dependency failures (#50388). + - rescusitate remote ftp globs (#67678). + - open rpmdb early RDONLY, reopen later RDWR, avoid signed srpm noise. + - turn off annoying gpg secmem warning. + - warn only once for each NOKEY/UNTRUSTED key id. + - factor common options into table, add rpmcliInit() and rpmcliFini(). + - add preliminary rpmgraph(8) and rpmcache(8) executables to rpm-devel. + - use rpmfi in showQueryPackage(), eliminating headerGetEntry(). + - fix: forgot lazy open of database on --freshen path (#67907). + - proof-of-concept rpmcache functionality. + - fix: do lazy open of database in rpmtsInitDB() (#67994). + - update rpmcache.8. + - fix: permit deletions of added packages (#67108). + - placeholders for manifest constants for SuSE patch packages. + - fix: repair 2ndary match criteria with rpmdb iterators. + - update for sv.po. + - display signature details using rpm -qi. + - skip signing packages already signed with same key (#62118). + - install rpmal.h and rpmhash.h, implicit rpmps.hinclude, for now. + - revert headerFree/headerLink/headerUnlink debugging. + - popt: mingw32 portability configure check (#67911). + - teach gendiff about unreadable files (#42666). + - python: sanity check fixes on rpmts/rpmte methods. + - have rpmdb-redhat autoconfigure rpm to use %%_solve_dbpath. + - popt: parse file into string of options (#56860). + - version added to *.la dependency libraries (#69063). + - expose digests in rpmio API, but hide internal beecrypt API (#68999). + - add methods to make signature handling opaque wrto rpmts. + - verify signatures/digests retrieved through rpmdbNextIterator(). + - imbue %ghost with missingok attribute with --verify (#68933). + - fix: segfault if given a text file as 2nd arg to -Uvh (#69508). + - python: add ts.hdrCheck(), ts.rebuildDB() methods. + - python: iterating on an ts object returns transaction elements now. + - add yellowdog as vendor. + - python: remove the old initdb/rebuilddb methods, use ts.fooDB(). + - python: 1st crack at backport to 1.5.2. + - popt: fix --usage (#62234). + - fix: --repackage repaired (#67217). + - fix: rpm2cpio disables signature checks (i.e. same behavior). + - popt: display sub-table options only once on --usage. + - wire --nosignatures et al as common options, rework CLI options. + - python: don't segfault in ts.GetKeys() on erased packages. + - update trpm. + - factor all mode-specific options into mode-specific tables. + - treat an unspecified epoch as Epoch: 0 everywhere. + - detect athlon/duron with CMOV (PLD). + - prevent stale locks in __db files by closing databases on signals. + - make --querytags a common option, fix errant regex (#70135). + - db3: increase mpool and cachesize, compile w/o --enable-debug. + - configurable (default off) build failure if missing %%doc files (PLD). + - configurable (default off) build failure iff unpackaged files (PLD). + - change from default off to default on. + - python: methods to disable all new features for benchmarking. + - preserve rpmdb file attributes across --rebuilddb (#70367). + - fix: identify athlon with 3DNOWEXT as "athlon", not "i786" (#70539). + - fix: repair --root with --verify (#70527). + - fix: signed pubkeys were imported incorrectly (#68291). + - include tgpg script to verify signatures using only gpg. + - check header blobs on export (i.e. rpmdbAdd()). + - enable iterator header blob checks for install/erase modes. + - python: _vsflags_up2date macro to configure verify signature flags. + - resurrect --rollback. + - renumber the callback types to be an orthogonal bit mask. + - provide repackage progress callbacks, compression is slow. + - fix: don't repackage %%ghost files. + - add --predefine to define macros before reading macro configuration. + - python: bare bones rollback bindings. + - python: enable threads on callbacks and longish rpmlib calls. + - python: expose RPMTAG_SOURCEPACKAGE to identify source headers. + - python: eliminate rpm.headerFromPackage() tuple return, deprecated. + - python: add ts.hdrFromFdno(fdno) method. + - fix: check for lead magic, better error message on failure (#69751). + - python: the death of rpmdb-py.[ch], use ts.fooDB() methods instead. + - python: the death of rpm.headerFromPackage(), use ts.hdrFromFdno(). + - python: permit direct ts.dbMatch() python iterations. + - python: the death of rpm.checksig(), use ts.hdrFromFdno() instead. + - add bitmask for precise control of signature/digest verification. + - python: bindings to import pubkeys and display openpgp packets. + - fix: src.rpm installs need fd pos at payload. + - python: add return codes for rollbacks and fooDB methods. + - avoid generating fingerprints for locale/zoneinfo sub-directories. + - python: add (optional) ts.check() callback. + - python: include instance in IDTXload, filename in IDTXglob, return + - python: argument to ts.addErase (if integer) deletes that instance. + - python: rpmmi methods to return this instance, and number of members. + - supply transitive closure for CLI packages from rpmdb-redhat database. + - fix: rebuilddb stat'ed target, not source, for rename sanity. + - create /var/lib/rpm if non-existent in, say, a chroot. + - erased packages are now repackaged into /var/spool/repackage. + - fix: rebuilddb stat'ed target, not source, for rename sanity, take 2. + - python: explicit method to set transFlags. + - python: stuff package name into a string for repackage callbacks. + - rollback: re-create empty transaction set for multiple rollbacks. + - fix: %%basename typo (Dmitry V. Levin). + - fix: queryformat segfaults (Dmitry V. Levin). + - add --with-efence to configure, check install/upgrade with efence. + - beecrypt: short hex string conversion overflows target buffer. + - mark "successors only" packages in transaction. + - reap scriptlets with SIGCHLD handler. + - rename PSM_t to rpmpsm, add methods and refcounts to manage. + - remove %%configure/%%makeinstall from arch-os/macros, default is OK. + - don't export MALLOC_CHECK_ to scriptlets. + - squeaky clean memory leak checking. + - always malloc rpmfi structure, refcounts are correct in rpmtsRun(). + - skip redundant /sbin/ldconfig scripts on upgrade (if possible). + - python: stupid typo broke ts.check(). + - fix: add epoch to "already installed" check. + - check for interrupt during iteration. + - python: add ts.setProbFilter() method, remove ts.run() argument. + - fix: region trailer offset sanity check wrong (#71996). + - fix: don't stop if db1 database is currently in /var/lib/rpm (#72224). + - add a macro to create a sub-package with debugging symbols. + - merge signature returns into rpmRC. + - python: exceptions on NOKEY/NOTTRUSTED. + - python: don't remap NOKEY/UNTRUSTED to OK. + - beecrypt: change local absolute symbols to defines for prelinking. + - update ru.po. + - fix: handle NOKEY/NOTTRUSTED returns as if OK, always return header. + - portability: carry libelf in src rpm, include signal.h. + - fix: segfault with --checksig, plug memory leak (#72455). + - rpm-4.1 release candidate. + - requirement on libelf >= 0.8.2 to work around incompatible soname (#72792). + - fix: common sanity check on headers, prevent segfault (#72590). + - limit number of NOKEY/UNTRUSTED keys that will be warned once. + - libadd -lelf to rpmdb (#73024). + - portability: non-linux is easier, more to do (#72893). + - fix: SIGCHLD reaper race (#73134). + - fix: don't exit with open cursor, there be a stale lock. + - fix: check for signal induced exit more often (#73193). + - reinterpret the _unsafe_rollbacks macro as earliest rollback. + - fix: always do rpmalMakeIndex. + - fix: resurrect --triggers (#73330). + - python: typo in NOKEY exception string. + - fix: parse pgp packets more carefully. + - fix: parse header data more carefully. + - fix: register SIGCHLD handler before forking (#73134). + - better diagnostics on failed header parsing. + - lclint clean. + - rpm-4.1 release. + - fix: make sure that psm->child pid is set before SIGCHLD is handled. + - fix: use size_t consistently, avoid segfault on ia64. + - use %%{_lib} for libraries. + - fix: permit build with --disable-nls (#76258). + +4.0.3 -> 4.0.4: + - solaris: translate i86pc to i386 (#57182). + - fix: %GNUconfigure breaks with single quotes (#57264). + - fix: typo in find-requires. + - tru64 compiler message cleanup. + - add buildarch lines for hppa (#57728). + - sparc: make dbenv per-rpmdb, not per-dbi. + - handle lazy db open's in chroot with absolute path, not prefix strip. + - Depends should use CDB if configured. + - autodetect python 1.5/2.2. + - make rpm-perl package self-hosting (#57748). + - permit gpg/pgp/pgp5 execs to be reconfigured. + - fix: signing multiple times dinna work, discard immutable region. + - remove poptmodule.so for separate packaging. + - permit subset installs for %lang colored hardlink file sets. + - missing key(s) on keyring when verifying a signature is now an error. + - remove dependency whiteout. + - calculate rpm-4.1 ordering/orientation metrics in rpmdepOrder(). + - sync popt and rpmio with rpm-4.1, rpmio has OpenPGP API. + - sync rpmdb and build with rpm-4.1, lots of splint annotations. + - add :armor and :base64 query format qualifiers for binary signatures. + - fix: query format qualifiers needed header.c merge. + - fix: query format qualifiers needed header.c merge. + - ppc64 arch added (#58634,#58636). + - turn on auto-generated perl requirements (#58519, #58536, #58537). + - fix: %exclude functional (again). + - trap SIGILL for ppc64 inline asm voodoo fix from cross-dressed ppc32. + - fix: fancy hash fiddles if not a tty. + - fix: handle /.../ correctly in rpmCleanPath(). + - transaction rollback code in rpmRollback(). + - Red Hat 6.2 portability cruft. + - legacy: configurable whiteout for known Red Hat dependency loops. + - perl.req: don't mis-generate dependencies like perl(::path/to/foo.pl). + - permit args to be hidden within %__find_{requires,provides}. + - a couple more perl.{prov,req} fiddles. + - macro for %files, always include %defattr(), redhat config only. + - fix: drop header region when writing repackaged legacy header. + - bail on %files macro. + - transaction rollbacks are functional. + - generate index for pkgid (aka Sigmd5) tag, query/verify by pkgid. + - generate index for hdrid (aka Sha1header) tag, query/verify by hdrid. + - generate index for fileid (aka Filemd5s) tag, query/verify by fileid. + - query/verify by install transaction id. + - rpm-4.0.4 release candidate. + - add cpanflute2, another perl.req fiddle. + - reapply Berkeley DB patch #4491. + - make --addsign and --resign behave exactly the same. + - *really* dump signature header immutable region. + - speedup large queries by ~50%. + - revert to presentation ordering Yet Again (#62158). + - non-glibc: on upgrade, mergesort is much faster than quicksort. + - fix: queries that evaluated to "" incorrectly returned NULL. + - fix: packages produced by rpm-4.0 dinna merge signature tags. + - fix: rpmdb iterator memory leak in python bindings. + - fix: include for 6.2 python modules. + - remove vestiges of mipseb arch (#62408). + +4.0.2 -> 4.0.3: + - update per-interpreter dependency scripts, add sql/tcl (#20295). + - fix: rpmvercmp("1.a", "1.") returned -1, not +1 (#21392). + - add cpuid asm voodoo to detect athlon processors. + - add %exclude support (i.e. "everything but") to %files. + (Michael (Micksa) Slade" ) + - add --with/--without popt glue for conditional builds(Tomasz Kloczko). + - python: strip header regions during unload. + - add -g to optflags in per-platform config. + - permit confgure/compile with db3-3.2.9. + - permit manifest files as args to query/verify/install modes. + - fix: parameterized macro segfault (Jakub Bogusz ) + - fix: i18n tags in rpm-2.5.x had wrong offset/length (#33478). + - fix: AIX has sizeof(uint_16) != sizeof(mode_t) verify cast needed. + - fix: zero length hard links unpacked incorrectly (#34211). + - fix: --relocate missing trailing slash (#28874,#25876). + - fix: --excludedoc shouldn't create empty doc dir (#14531). + - fix: %_netsharedpath needs to look at basenames (#26561). + - fix: --excludepath was broken (#24434). + - fix: s390 (and ppc?) could return CPIOERR_BAD_HEADER (#28645). + - fix: Fwrite's are optimized out by aggressive compiler(irix) (#34711). + - portability: vsnprintf/snprintf wrappers for those without (#34657). + - more info provided by rpmdepOrder() debugging messages. + - merge (compatible) changes from top-of-stack into rpmlib.h. + - cpio mappings carry dirname/basename, not absolute path. + - fix: check waitpid return code. + - remove support for v1 src rpm's. + - re-position callbacks with ts/fi in cpio payload layer. + - state machines for packages (psm.c) and payloads (fsm.c) + - add --repackage option to put erased bits back into a package. + - fix: (ppc) copy va_list in loop (#36845). + - cpanflute perl dependency needs explicit epoch (#37034). + - regenerate rpm.8 man page from docbook glop (in max-rpm). + - lib/depends.c: diddle debugging messages. + - fix: readlink return value clobbered by header write. + - fix: ineeded count wrong for overlapped, created files. + - globalize _free(3) wrapper in rpmlib.h, consistent usage throughout. + - internalize locale insensitive ctype(3) in rpmio.h. + - boring lclint annotations and fiddles. + - transaction iterator(s) need to run in reverse order on pure erasures. + - erasures not yet strict, warn & chug on unlink(2)/rmdir(2) failure. + - more boring lclint annotations and fiddles. + - yet more boring lclint annotations and fiddles. + - still more boring lclint annotations and fiddles. + - enough lclint annotations and fiddles already. + - fix: specfile queries with BuildArch: (#27589). + - fix: debugging message displays header keys (#38454). + - use internal db-3.2.9 sources to build by default. + - don't build db1 support by default. + - create rpmdb.la so that linkage against rpm's db-3.2.9 is possible. + - rpm database has rpm.rpm g+w permissions to share db3 mutexes. + - expose more db3 macro configuration tokens. + - move fprint.[ch] and hash.[ch] to rpmdb directory. + - detect and fiddle incompatible mixtures of db3 env/open flags. + - add DBI_WRITECURSOR to map to db3 flags with CDB database model. + - add rpmdbSetIteratorRewrite to warn of pending lazy (re-)writes. + - harden rpmdb iterators from damaged header instance segfaults. + - add cron/logrotate scripts to save installed package filenames. + - upgrade to db-3.3.4. + - fix: filter duplicate package removals (#35828). + - add armv3l arch. + - fix: i18n strings need 1 on sucess return code (#41313). + - fix: skip %ghost files when building packages (#38218). + - headerFree() returns NULL, _free is C++ safe. + - remove all header region assertion failures, return NULL instead. + - perform db->verify when closing db files. + - eliminate db-1.85 and db-2.x configuration. + - fix: popt arg sanity checks broken, optarg != optArg. + - fix: popt range checks on floats/doubles broken. + - popt: return POPT_ERROR_ERRNO on config open/read/close failure. + - fix: popt exec doesn't add '--', --target et al no longer need '='. + - fix: popt consume-next-arg "!#:+" w/o side effect (#41956). + - fix: for busted db1, attempt chain reconnection to following record. + - return multiple suggested packages + (Pawel Kolodziej ). + - fix: return suggested packages when using Depends cache. + - merge sparc64/ia64 fiddles back into linux.{req,prov}. + - automagically generate perl module dependencies always. + - fix: lclint fiddles broke uCache initialization (#43139). + - always use db cursors. + - permit duplicates for btree indices. + - document build modes in rpmbuild.8, rpmbuild is born. + - default to dbenv with mpool, --rebuilddb with nofsync is much faster. + - fix: QUERY_FOR_LIST file count clobbered. + - create top level rpmcli API, factor top level modes into popt tables. + - popt: add POPT_BIT_SET/POPT_BIT_CLR to API. + - autogen.sh checks for latest libtool-1.4 and automake-1.4-p2. + - rpm --verify reports failure(s) if corresponding tag is not in header. + - rpm --verify honors %config(missingok), add -v for legacy behavior. + - remove dead code frpm popt table reorg. + - more CLI typedefs/prototypes moved from rpmlib.h to rpmcli.h. + - rpm --verify skips files in non-installed states. + - rpm --verify skips content checks for %ghost files. + - rpm --verify displays config/doc/gnost/license/readme atrrs for files. + - rpm --verify checks immutable header region digest if available. + - rpmbuild adds header region digest (SHA1 as string). + - use rpmTag* typedefs in new hge/hae/hme/hre header vectors. + - remove rpmrc Provides: Yet Again, use virtual packages. + - dump cursor debugging wrappers. + - rpm --verify can disable rpmFileAttr checks. + - add rpmdbSetIteratorRE() for regex matching in database iterators. + - permit rpm -qa to take RE args applied to name tag. + - permit dbiFindMatches() to use version/release patterns. + - eliminate all uses of rpmdbSetIterator{Version,Release}. + - fix: db1 end-of-file not detected in legacy compatible way. + - fix: remove (harmless) chown error message from %post. + - add --target/--host to %configure, add example cross-build/config.site + scripts to /usr/lib/rpm (#44581). + - rpmdb iterator selectors permit default/strcmp/regex/glob matching. + - rpmdb iterator selectors permit negative matches. + - alpha: don't add "()(64bit)" dependency markers. + - ia64/sparc: .{req,prov} identical to linux.{req,prov}. + - add "rpmlib(ScriptletInterpreterArgs)" to track + %post -p "/sbin/ldconfig -n /usr/lib" + incompatibilities. + - popt: add POPT_ARGFLAG_SHOW_DEFAULT to display initial values(#32558). + - popt: add POPT_CONTEXT_ARG_OPTS for all opts to return 1 (#30912). + - fix: fsm reads/writes now return error on partial I/O. + - fix: Ferror returned spurious error for gzdio/bzdio. + - check for API/ABI creep, diddle up some compatibility. + - preliminary abstraction to support per-header methods. + - finalize per-header methods, accessing headerFoo through vector. + - make package ordering loop messages debug, not warning. + - remove {ia64,sparc}-linux.{prov,req}, changes merged into linux.*. + - fix: partial sets of hardlinked files permitted in payload. + - fix: mark rpmdb files with %config to prevent erasure on downgrade. + - work around a (possible) compiler problem on ia64. + - fix: rpm -qlv link count for directories dinna include '..'. + - fix: rpm -qlv size for directories should be zero. + - add --noghost to filter non-payload files from rpm -qlv output. + - add %{_gnu} macro to append "-gnu" to %{_target_platform} to + support --target/--host flavored %configure. Legacy behavior + available by undefining %{_gnu}. + - propagate %{_gnu} to per-platform configuration. + - fix: parameterized macros with massive mumber of options need + "optind = 1" "Dmitry V. Levin" . + - add athlon per-platform configuration. + - remove executable bit to disable autogenerated perl requires until + perl provides can be vetted. + - disable per-platform %%configure use of %%_gnu until libtool package + stabilizes. + - fix: permit partially enumerated hardlink file sets during build. + - fix: resurrect rpm signature modes. + - fix: sanity checks on #tags (<65K) and offset (<16Mb) in header. + - fix: add -r to useradd to prevent /etc/skel glop (#46215). + - fix: disambiguate typedef and struct name(s) for kpackage. + - update intl dirs to gettext-0.10.38. + - fix: sanity check for header size added in headerCopyLoad() (#46469). + - fix: redundant entries in file manifests handled correctly (#46914). + - map uid/gid from metadata into payload headers. + - add removetid to header during --repackage. + - expose rpmShowProgress() and rpmVerifyDigest() in rpmcli.h. + - portability: avoid st_mtime, gendiff uses basename, etc (#47497). + - glibc-2.0.x has not __va_copy(). + - popthelp.c: don't use stpcpy to avoid portability grief (#47500). + - permit alias/exec description/arg text to be set from popt config. + - python: rhnLoad/rhnUnload to check header digest. + - package version now configureable, default v3. + - rename rpm libraries to have version with libtool -release. + - fix: -i CLI context broken Yet Again. + - unlink all __db.nnn files before 1st db open. + - python bindings should not segfault when fed bad data. + - fix: adjust arg count for --POPTdesc/--POPTargs deletion. + - add linux per-platform macro %_smp_mflags . + - document more popt aliases for --help usage. + - remove --tarbuild from man page(s), use -t[abpcils] instead (#48666). + - fix: scope multi-mode options like --nodeps correctly (#48825). + - isolate cdb access configuration (experimental, use at your own risk). + - fix: hard fail on locked dbopen if CDB locking not in use. + - fix: dbconfig with mp_mmapsize=16Mb/mp_size=1Mb for + "everything ENOSPC" failure check. + - fix: don't total hard linked file size multiple times (#46286). + - add %dev(type,major,minor) directive to permit non-root dev build. + - fix: _smp_flags macro broken. + - python: bind rhnUnload differently. + - fix: rescusitate --querytags. + - fix: short aliases broken (#49213). + - python: "seal" immutable region for legacy headers in rhnUnload() . + - python: add poptmodule.so bindings. + - fix: %dev(...) needs to map rdev and mtime from metadata. + - resurrect --specedit for i18n. + - fix: 4 memory leaks eliminated. + - fix: yet another segfault from bad metadata prevented. + - add sha1 test vectors, verify on ix86/alpha/sparc. + - add (but disable for now) rpm-perl subpackage from Perl-RPM. + - python: parameterize with PYVER to handle 1.5 and/or 2.1 builds. + - add build dependency on zlib-devel (#49575). + - enable rpm-perl subpackage. + - add pmac/ppciseries/ppcpseries varieties to ppc arch family. + - include tdigest.c tkey.c and trpmio.c to "make dist". + - re-enable dependency resolution source from package NVR. + - rename pmac to ppcmac. + - ia64: revert -O0 compilation. + - upgrade to db-3.3.11 final. + - fix: don't segfault when presented with rpm-2.4.10 packaging (#49688). + - fix: --noscripts is another multimode option. + - add tmpdir to configure db3 tmpdir into chroot tree. + - permit lazy db opens within chroot. + - fix: diddle dbenv path to accomodate backing store reopen in chroot. + - add support for mips (#49283). + - add __as, _build_arch, and __cxx macros (#36662, #36663, #49280). + - detailed build package error messages. + - fix: i18n tags not terminated correctly with NUL (#50304). + - add explicit casts to work around a s390 compiler problem. + - fix: autoconf glob tests (#50845). + - portability: some compilers squawk at return ((void) foo()) (#50419). + - remove fdFileno() from librpmio, use inline version instead (#50420). + - fix: linux find-requires needs quotes around [:blank:]. + - remove /var/lib/rpm/__db* cache files if %__dbi_cdb is not configured. + - python: add hiesenbug patch. + - add legacy (compile only) wrappers for fdFileno et al. + - add -D_REENTRANT (note rpmlib is still not thread safe). + - fix: segfault on headerFree given malicious data. + - fix: don't verify hash page nelem. + - better error messages for verification failures. + - include directory /usr/lib/rpm in rpm package. + - always use dl size in regionSwab() return. + - ppc: revert ppcmac to ppc. + - ppc: autoconf test for va_copy. + - python: add exception to detect bad data in hdrUnload. + - change dir creation message from warning to debug for now. + - verify perms (but not mode) on %ghost files. + - headers without RPMTAG_NAME are skipped when retrieved. + - within a region, entries sort by address; added drips sort by tag. + - fix: error message on failed package installs resurrected. + - python: memory leaks in headerLoad/headerunload bindings. + - python: retrofit sha1 digest using RPMTAG_SHA1RHN. + - python: change rhnUnload bindings. + - python: teach rhnLoad about RPMTAG_SHA1RHN as well. + - fix: Provides: /path did not work with added packages (#52183). + - fix: progress bar scaling did not include source rpm count. + - fix: hash page nelem failure to verify. + - fix: initialize "verify" transaction stepName with -vv (#53582). + - fix: ftp remote globs broken (#46892). + - popt: clarify X consortium license in popt.3 man page. + - close/discard Depends index after rpmdepCheck() use. + - lclint-3.0.0.15 fiddles. + - fix: harmless typo in db3 chroot hack. + - fix: big-endian's with sizeof(time_t) != sizeof(int_32) mtime broken. + - fix: add Korean message catalogs (#54473). + - add RPHNPLATFORM and PLATFORM tags. + +4.0 -> 4.0.[12] + - fix: avoid calling getpass twice as side effect of xstrdup macro + (katzj@linuxpower.org) (#17672). + - order packages using tsort, clipping Requires:'s in dependency loops. + - handle possible db3 dependency on -lpthread more gracefully. + - bump popt version to 1.6.1. + - fix: more (possible) xstrdup side effects. + - fix: rpm2cpio error check wrong on non-libio platforms. + - fix: runTriggers was not adding countCorrection. + - add rpmGetRpmlibProvides() to retrieve rpmlib(...) provides + "Pawel A. Gajda" . + - syntax to specify source of Requires: (PreReq: now legacy). + - rip out rpm{get,put}text, use getpo.sh and specspo instead. + - fine-grained Requires, remove install PreReq's from Requires db. + - fix: duplicate headerFree() on instalBinaryPackage() error return. + - fix: work around for (mis-compilation?!) segfaults on signature paths. + - fix: segfault on exit of "rpm -qp --qf '%{#fsnames}' pkg" (#20595). + - hpux w/o -D_OPEN_SOURCE has not h_errno. + - verify MD5 sums of payload files when unpacking archive. + - hide libio lossage in prototype, not API. + - add support for SHA1 as well as MD5 message digests. + - don't verify src rpm MD5 sums (yet). + - md5 sums are little endian (no swap) so big endian needs the swap. + - add doxygen and lclint annotations most everywhere. + - consistent return for all signature verification. + - use enums for almost all rpmlib #define's. + - API: change rpmProblem typedef to pass by reference, not value. + - unify rpmError and rpmMessge interfaces through rpmlog. + - collect and display rpm build error messages at end of build. + - don't trim leading ./ in rpmCleanPath() (#14961). + - detect (still need to test) rdonly linux file systems. + - check available inodes as well as blocks on mounted file systems. + - pass rpmTransactionSet, not elements, to installBinaryPackage et al. + - add cscope/ctags (Rodrigo Barbosa). + - remove getMacroBody() from rpmio API. + - add support for unzip + - add brp-strip-shared script . + - better item/task progress bars . + - load headers as single contiguous region. + - add region marker as RPM_BIN_TYPE in packages and database. + - fix: don't headerCopy() relocatable packages if not relocating. + - merge signatures into header after reading from package. + - RPM_BIN_TYPE malloc'ed when retrieved through headerGetEntry(). + - add headerFreeData() to free any data malloc'ed during retrieval. + - preserve exact image of original header when installing/upgrading. + - add missing headerFree for legacy signature header. + - fix: removed packages leaked DIRINDEXES tag data. + - reload tags added during install when loading header from rpmdb. + - avoid brp-compress hang with both compressed/uncompressed man pages. + - improved find-{requires,provides} for aix4/hpux/irix6/osf. + Tim Mooney + - portability: remove use of GNU make subst in lib/Makefile (Joe Orton). + - python: bind package removal (#21274). + - autoconfigure building python bindings. + - autoconfigure generating rpm API doco. + - fix: don't fdFree in rpmVerifyScript, rpmtransFree does already. + - use package version 3 if --nodirtokens is specified. + - add package names to problem sets early, don't save removed header. + - make sure that replaced tags in region are counted in headerSizeof(). + - support for dmalloc debugging. + - filter region tags in headerNextIterator, exit throut headerReload. + - add rpmtransGetKeys() to retrieve transaction keys in tsort'ed order. + - python bindings for rpmtransGetKeys(). + - fix: include alignment in count when swabbing header region. + - handle added dirtoken tags (mostly) correctly with header regions. + - add FHS doc/man/info dirs, diddle autoconf goo. + - fix: headerUnload handles headers w/o regions correctly on rebuilddb. + - resurrect rpmrc Provides: as well as implicit dependency on packge + info. + - change dependency loop message to RPMMESS_WARNING to use stderr, not + stdout. + - fix: (transaction.c) assume file state normal if tag is missing. + - fix: failed signature read headerFree segfault. + - fix: revert ALPHA_LOSSAGE, breaks 6.2/i386. + - fix: synthesized callbacks for removed packages have not a pkgkey. + - identify install scriptlet failures with the name of the scriptlet. + - handle install chroot's identically throughout the install process. + - add rpmlib(HeaderLoadSortsTags) for tracking header regions + "just in case". + - create _tmppath on the fly if not present. + - remove /etc/rpm/macros.db1 configuration file if db3 rebuilt. + - remove overly verbose dbiOpen() error messages, no longer needed. + - whiteout mozilla loop for 7.1. + - immutable headers, once installed by rpm3, need to lose immutablity. + - fix: removed headers from db need a headerCopy(). + - send query/verify output through rpmlog(). + - resurrect rpmErrorSetCallback() and rpmErrorString(). + - use malloc'ed buffer for large queries. + - fix: avoid FAT and other brain-dead file systems that have not inodes. + - fix: hack around alpha mis-compilation signature problems. + - rpmmodule.c(handleDbResult): return empty list when nothing matches. + - (non-linux): move stubs.c to rpmio (#21132). + - (python): bind initdb (#20988). + - (popt): fix float/double handling (#19701). + - (popt): non-linux needs (#22732). + - (popt): add POPT_ARGFLAG_OPTIONAL for long options with optional arg. + - (popt): diddle auto-help to include type of arg expected. + - use popt autohelp for rpm helper binaries. + - fix: avoid locale issues with strcasecmp/strncasecmp (#23199). + - remove almost all explicit uses of stderr in rpmlib using rpmError(). + - fix: pass scriptlet args, as in %post -p "/sbin/ldconfig -n /lib". + (Rodrigo Barbosa). + - fix: 3 packages from Red Hat 5.2 had bogus %verifyscript tag. + - tsorted packages processed in successor count order. + - fix: resurrect --excludepath (#19666). + - fix: digests on input FD_t dinna work. + - fix: remove rebuilddb debugging leakage. + - successors from tsort are processed in presentation order. + - fix: find-requires.perl needed update (#23450). + - fix: don't hang on build error. + - fix: remove "error: " prefix from signature verification message. + - hack: permit installer to determine package ordering using 1000003 tag. + - fix: extra newline in many error messages (#23947). + - fix: rpm -Va with db1 needs per-iterator, not per-index, offset. + - add install/remove transaction id tags. + - tsort prefers presentation order. + - 1st crack at Mandrake specific per-platform macros. + - fix: insure that %lang scopes over hard links correctly. + - fix: rpmCleanPath was nibbling at .. in macrofiles incorrectly. + - fix: check waitpid return code. + - fix: make a copy of retrieved header before loading. + - fix: diddle exit code for attempted installs of non-packages (#26850). + - python binding diddles to reduce installer memory footprint by + delayed loading of file info. + - fix: remove fixed size buffer on output path (#26987,#26332). + - resurrect rpmErrorCode in the API for Perl-RPM. + - fix: permit packages to differ by 0 or 32 bytes (#26373). + - fix: permit HEADER_IMMUTABLE tag queries. + - split db configuration into separate file. + - portability changes from Joe Orton et al. + - (alpha): rip out ALPHA_LOSSAGE now that gcc-2.96-76 has fix (#28509). + - (popt): use sprintf rather than snprintf for portability. + - (sparc) disable MD5 sum checks during install. + - (db1) plug largish memory leak in simulated interface for falloc.c. + - remove mozilla dependency white out, no longer needed. + - fix: adjust for libio breakage in Red Hat 5.x with glibc-2.0.7-29.4. + - map i686-like (i.e. w/o CMOV) platforms to better alternatives. + +3.0.6 -> 4.0 + - use DIRNAMES/BASENAMES/DIRINDICES not FILENAMES in packages and db. + - API: change dbi to pass by reference, not value. + - cram all of db1, db_185, and db2 interfaces into rpmlib. + - convert db1 -> db2 on-disk format using --rebuilddb. + - add db3 to the pile, isolate all with incremental link and vectors. + - prefer db3 as default. + - permit db3 configuration using macros. + - create dbi from template rather than passed args. + - use hashed access for package headers. + - db3: save join keys in endian neutral binary format. + - treat legacy falloc.c as "special" db[01] index for package headers. + - API: pass *SearchIndex() length of key (0 will use strlen(key)). + - API: remove rpmdb{First,Next}RecNum routines. + - add explcit "Provides: name = [epoch:]version-release" to headers. + - fix: cpio.c: pre-, not post-, decrement the link count. + (from Fabrice Bellet ) + - make db indices as lightweight as possible, with per-dbi config. + - db1.c will never be needed, eliminate. + - API: merge rebuilddb.c into rpmdb.c. + - API: replace rpmdbUpdateRecord with rpmdbSetIteratorModified. + - API: replace rpmdbFindByLabel with RPMDBI_LABEL iteration. + - API: replace rpmdbGetRecord with iterators. + - API: replace findMatches with iterators. + - Filter DB_INCOMPLETE on db->sync, it's usually harmless. + - Add per-transaction cache of resolved dependencies (aka Depends). + - Do lazy dbi{Open,Close} throughout. + - Attempt fine grained dbi cursors throughout. + - fix: free iterator *after* loop, not during. + - fix: Depends needed keylen in dbiPut, rpmdbFreeIterator after use. + - Rename db0.c to db1.c, resurrect db2.c (from db3.c). + - simplify --last popt alias, date like -qi (bjerrick@easystreet.com). + - fix: alloca'd memory used outside of scope (alpha segfault). + - fix: define/eval options assumed sizeof(int) == sizeof(void *). + - fix: sparc64 per-platform directory shouldn't be sparc64linux. + - fix: (segfault) verify needs rpmdb while query does not. + - add calculated nlink field to -qlv output (like ls -al). + - detects and builds properly against the new fopencookie API in + glibc 2.2. + - change popt exec alias in oreder to exec rpm children. + - split rpm into 5 pieces along major mode fault lines with popt glue. + - turn on new, more complete version of %%configure. + - add %%makeinstall analogue of new %%configure for autoconf packages. + - mark packaging with version 4 to reflect filename/provide changes. + - change next version from 3.1 to 4.0 to reflect package format change. + - change %configure, add %makeinstall macros to handle FHS changes. + - add optflags for i486 and i586. + - fix: segfault with legacy packages missing RPMTAG_FILEINODES. + - require db3 in default configuration. + - create rpmio directory for librpmio. + - make librpmio standalone. + - fix: avoid clobbering db cursor in removeBinaryPackage. + - expose cursors in dbi interfaces, remove internal cursors. + - remove incremental link. + - portability: sparc-sun-solaris2.5.1. + - fix: don't count removed files if removed packages is empty set. + - fix: permit '\0' as special case key (e.g. "/" in Basenames). + - require --rebuilddb to convert db1 -> db3, better messages. + - fix: open all db indices before performing chroot. + - fix: typo in brp-compress caused i18n man pages not to compress. + - API: uncouple fadio from rest of rpmio. + - API: externalize legacy fdOpen interface for rpmfind et al. + - put version on rpmpopt filename to avoid legacy filename collision. + - change optflags for i386. + - multilib patch, take 1. + - add pre-transaction syscall's to handle /etc/init.d change. + - don't bother saving '/' as fingerprint subdir. + - prefix payload paths with "./", otherwise "/" can't be represented. + - fix: compressFilelist broke when fed '/'. + - fix: typo in --last popt alias (#12690). + - fix: clean file paths before performing -qf (#12493). + - remove build mode help from rpm.c, use rpmb instead. + - fix: set multilibno on sparc per-platform config. + - fix: legacy requires './' payload prefix to be omitted for rpm itself. + - fix: remove verbose database +++/--- messages to conform to doco. + - add S_ISLNK pre-transaction syscall test. + - fix: initialize pretransaction argv (segfault). + - fix: check rpmlib features w/o database (and check earlier as well). + - rip out pre-transaction syscalls, more design is needed. + - remove (dead) dependency checks on implicitly provided package names. + - remove (dead) rpmdb API code in python bindings. + - fix: make set of replaced file headers unique. + - fix: don't attempt dbiOpen with anything but requested dbN. + - create rpmbuild/rpmquery/rpmverify/rpmsign symlinks. + - fix: look for any/all dbapi when rebuilding. + - link rpm2cpio dynamically since cpio is linked dynamically. + - fix: uniqify dependency problems when printing (#14034). + - fix: segfault on erase if filestates is missing in header (#14679). + - fix: popt POST callbacks typo. + - fix: -Va broken, make db cursors per-iterator, not per-dbi. + - fix: segfault when globbing on "" (#15593). + - fix: rebuild db1 -> db3 ate 1st header (#16263). + - translate rpm.8 man page (Peter Ivanyi ). + +3.0.6 -> 3.0.7 + +3.0.5 -> 3.0.6 + - python bindings to query and verify signatures. + - add callbacks on package erasure. + - fix: preserve cpio errno when using Fclose with libio. + - fix: initialize sigs everywhere in python header object. + - popt: support for float/double args. + - fix: honor --test when doing --freshen. + - add alpha* architectures. + +3.0.4 -> 3.0.5 + - configure.in fiddles for BSD systems (Patrick Schoo). + - solaris2.6: avoid bsearch with empty dir list (Ric Klaren - klaren@cs.utwente.nl) + - include RPM-GPG-KEY in file manifest. + - Add ia64 and sparc64 changes. + - rpm.spec: add per-platform sub-directories. + - FreeBSD fixes (bero@redhat.com). + - handle version 4 packaging as input. + - builds against bzip2 1.0 + - fix: resurrect symlink unique'ifying property of finger prints. + - fix: broken glob test with empty build directory (Geoff Keating). + - fix: create per-platform directories correctly. + - update brp-* scripts from rpm-4.0, enable in per-platform config. + - alpha: add -mieee to default optflags. + - add RPMTAG_OPTFLAGS, configured optflags when package was built. + - add RPMTAG_DISTURL for rpmfind-like tools (content unknown yet). + - teach brp-compress about /usr/info and /usr/share/info as well. + - update macros.in from rpm-4.0 (w/o dbi configuration). + - fix: don't expand macros in false branch of %if (kasal@suse.cz). + - fix: macro expansion problem and clean up (#11484) (kasal@suse.cz). + - uname on i370 has s390 as arch (#11456). + - python: initdb binding (Dan Burcaw ). + - internalize --freshen (Gordon Messmer ). + - support for separate source/binary compression policy. + - support for bzip payloads. + - fix: payload compression tag not nul terminated. + - identify package when install scriptlet fails (#12448). + - remove (unused) RPMTAG_CAPABILITY. + - remove (legacy) use of RPMTAG_{OBSOLETES,PROVIDES} internally. + - remove (legacy) support for version 1 packaging. + - remove (legacy) support for converting gdbm databases. + - eliminate unused headerGz{Read,Write}. + - support for rpmlib(...) internal feature dependencies. + - display rpmlib provides when invoked with --showrc. + - fix: compare versions if doing --freshen. + - disable rpmlib(VersionedDependencies) by defining _noVersionedDependencies. + +3.0.3 -> 3.0.4 + - use compressed filenames on install side. + - start unifying FD types, CFD_t now gone. + - check for memory leaks (almost all leaks are plugged). + - fix: resurrect multiple target platform builds. + - freshen.sh: detect when all packages are up to date (Ian Macdonald). + - fix: typo in error message (#6858). + - add/update dependency scripts (Ken Estes). + - use directory tokens internally to reduce memory usage. + - permit --whatprovides to lookup file dependencies. + - fail to package if absolute symlink points within build root. + - initial version of check-prereqs. + - expose enough of legacy fdio interface to compile rpmfind/rpm2html. + - fix: Fopen should use 0666 as default (umask will be applied later). + - fix: default for rd_timeoutsecs is 1 sec (avoid ufdio assertion). + - fix: new FILENAMES tags require package index, not pointer in lookups. + - rename new FILENAMES tags to BASENAMES/DIRNAMES/DIRINDEXES. + - fix: don't look at password when searching urlCache. + - add contentLength sanity check on rpmdb headerWrite. + - fix: fprint abort on stat("/", ...) in empty chroots. + - perform glob on remote ftp query args. + - fix: ftpAbort must close the data channel to read abort status. + - perform glob on remote ftp install args. + - fix: reload macros from cmd line when re-reading config files. + - fix: compressFileList was over-generating dirNames. + - fix: alAddPackage sorted dirNames too soon, destroying dirMapping. + - expose enough of legacy fdio interface to compile gnorpm. + - fix: missing strdup when overriding buildroot from command line + argument (#1026,#5006). + - diddle some names to keep my C++ brethern happy (i.e. kpackage port). + - fix: add ufdSeek. + - build popt (with libpopt.so*) as a sub-package of rpm. + - split python bindings into a separate sub-package of rpm. + - add ja translation and man pages (Kanda Mitsuru kanda@nn.iij4u.or.jp). + - fix: fp.subDir was incorrectly set to NULL in sparse chroot's. + - fix: manageFile needs to and with O_WRONLY(=1), not O_RDONLY(=0). + - fix: resurrect failed glob error message during build. + - add several BuildRoot FTW policies. + - add manpage for gendiff (pbrown@redhat.com). + - updated sv.po (goeran@uddeborg.pp.se) (#8349). + - configurable PATH for install %pre/%post et al scriptlets. + - use only %_install_langs, not LINGUAS/LANG when deciding to install. + - configurable compression type/level for package payloads. + - default value for %_install_langs is all. + - fix: resurrect relative path's in fprint lookup queries. + - extract spec files from bzip'ped tarballs too on tar builds. + - add %_rebuilddbpath macro to permit rebuilding db in new location. + - updated perl scripts (Ken Estes). + - fix: on --rebuilddb, make sure new/old paths are not the same (#8752). + - fix: on --erase, segfault caused by "" prefix. + - explicitly expand file lists in writeRPM for rpmputtext. + - {Free,Open}BSD find-{provides,requires} (suzukis@file.phys.tohoku.ac.jp). + - new rpm-build package to isolate rpm dependencies on perl/bash2. + - always remove duplicate identical package entries on --rebuilddb. + - add scripts for autogenerating CPAN dependencies. + - add sl.po from Primoz Peterlin . + - updated sv.po from . + - macro expansion (and absolute path) in %files -f arg (#9508,#9091). + - permit cli setting of build root policies. + - fix: filter excluded paths before adding install prefixes (#8709). + - add i18n lookaside to PO catalogue(s) for i18n strings. + - try for /etc/rpm/macros.specspo so that specspo autoconfigures rpm. + - per-platform configuration factored into /usr/lib/rpm subdir. + - sparc-sun-solaris2.6 portability check. + - simpler hpux.prov script (Tim Mooney). + - portability: skip bzip2 if not available. + - portability: skip gzseek if not available (zlib-1.0.4). + - portability: skip personality if not available (linux). + - portability: always include arpa/inet.h (HP-UX). + - portability: don't use id -u (Brandon Allbery). + - portability: don't chown/chgrp -h w/o lchown. + - portability: splats in rpm.spec to find /usr/{share,lib}/locale/* . + - fix: better filter in linux.req to avoid ARM specific objdump output. + - fix: use glibc 2.1 glob/fnmatch everywhere. + - fix: noLibio = 0 on Red Hat 4.x and 5.x. + - fix: typo in autodeps/linux.req. + - configure noarch compatibility in rpmrc for ia64. + +3.0.2 -> 3.0.3 + - add --eval to find result of macro expansion. + - add configure scaffolding to support rpm-4.0 packages. + - include shared libs in rpm-devel (no versioning yet). + - add epoch (as [0-9]*:version-release) to install dependency parse. + - move install/erase major modes into rpmlib. + - move checksig/resign major modes into rpmlib. + - add python bindings to rpm-devel (linux only). + - make query (rpm -qvl) behave like (POSIX?) ls for older files (#4050). + - fix: %if parsing skipped 3 chars too many. + - permit multiline macro expansions with comments and %if. + - add pl translation and man pages (PLD team - from Tomasz Kloczko). + - fix: incomplete cleanup if --rebuilddb fails (#4115). + - add versions to provides. + - fix: sanity test on specfile fails when encountering i18n chars. + - print all dependencies for each package at end of build. + - the death of RPMSENSE_SERIAL, use [epoch:]version[-release] instead. + - add _mandir/_infodir macro expansions to docdirs (Tomasz Kloczko). + - add post install configurable dependency checking. + - fix: segfault on --rebuild (#4185). + - macro fixes (Benedict Lofstedt, #4220): + expand %# just like %{#} (and with same value as shell analogues). + macro defaults for *, 0, and # if no args specified. + getopt on non-linux requires optind to be saved/restored. + - fix: don't remove file until last occurence in transaction (#4291). + - resuscitate net shared paths (#4330). + - fix: macro table cannot contain NULL pointers (#4263). + - fix: last char in rpmrc w/o terminating newline lost (#4361). + - prepare for handling \r in macro exapnsions. + - fix: n>1 occurrences of %config(noreplace) should not FA_CREATE (#4355). + - fix: use pgp5 rather than pgp-2.6.3 if both are in %_pgpbin (#4564). + - match "de" when locale is specified as "de_DE.ISO-8859-1@Munich". + - add versions to obsoletes. + - add %_install_langs to configure languages to be installed. + - add LC_ALL/LC_MESSAGES to query locale search. + - fix: segfault with "--sign" w/o supplying files (#4651). + - add headerWrite return code and check for errors. + - update python bindings from anaconda. + - add versions to prereq. + - add syntax sensitive implict prereq on rpm-3.0.3. + - fix: don't successfully match with strncasecmp("sparc", "sparc64", 5) + - add sparcv9 architecture. + - add --freshen to usage message (#4823). + - suggested changes to docs from Ken Estes (#4451). + - link libbz2.a statically to avoid rpm->bzip2 dependence for now. + - Tru64: avoid find-requires variable size limit (Tim Mooney). + - Solaris: use getpassphrase rather than getpass if available. + - pgp and pgp5 have compatible RSA signature (#4780). + - fix: avoid db problems with self-obsoleting packages on install. + - glibc2: always enable dynamic mtrace if available. + - fix: versioned provides devolved to existence test with conflicts. + - fix: with unspecified epochs, skip dependency epoch compare. + - python: shared module linked correctly. + - do versioned provides/conflicts resolution correctly. + - rpmpopt: display versioned provides/obsoletes. + - revert to shared libbz2.so now that bzip2 is in base install. + - fix: command line install had header memory leak. + - check for NULL on all memory allocations. + - free rpmrc mallocs on exit. + - glibc2: permit run time leak detection. + - fix: removed files fingerprint memory leak. + - fix: resurrect allfiles flag from rpm-2.5.x. + - fix: version compares compatible with epoch-less requires/conflicts. + - fix: rpm-2.5.1 had file list w/o leading / fix. + - portatbility fiddles (solaris). + - create binary rpm directory (e.g. .../%{_target_cpu}) on the fly. + - updated pl/rpm.8 (PLD team). + - new find req/prov scripts for non-linux platforms (Tim Mooney). + - fix: non-GNU globs burp on repeated '/' in patterns. + - dumb cpp's want white space around lclint annotations (Tim Mooney). + - aix: aix.req broken by cut-and-paste (Tim Mooney). + +3.0.1 -> 3.0.2 + - eliminate armv4 entries from rpmrc (Andrew E. Mileski). + - permit multiple "Provides: " lines in rpmrc (#2999). + - add BuildConflicts: and BuildRequires: in spec file and src rpm. + - fix: bigendian's with longlong file sizes (e.g. IRIX) dinna work. + - move printDep* routines into rpmlib for gnorpm et al. + - updated ru translation (Sergey Kubushin). + - add vpkg-provides.sh (Tim Mooney). + - don't clobber LDFLAGS in top-level Makefile (Tim Mooney). + - fix: build root from cmd line did not set macro %buildroot (#1026). + - fix: resurrect "rpm -Va --nofiles" (verify dependencies only) (#3111). + - rpm-devel should require popt (#3125). + - don't spin while waiting for delayed requires/provides input (#3289). + - common parse for all dependency token syntax. + - eliminate find-requirements on libNoVersion (Red Hat linux only). + - add new-fangled requires on "libc.so.6(GLIBC_2.1)" (sparc-linux only). + - MiNT port (Guido Flohr ). + - fix: --rebuilddb with --root dinna remove directory (Michael Andres). + - fix: false fingerprint stat cache hit -- "the tetex problem" (#2727). + - fix: bsearch needs macro table sorted after undefine. (#3713). + - fix: --checksig segfault with odd pgp output (e.g. w/o ~/.pgp) (#3720) + - avoid numeric overflow in version comparison (Thayne Harbaugh). + - move url.c and ftp.c to rpmlib right next to query. + - 12 more dead strtoks. + - changelog stamp broken w/ big endian 64 bit time_t (Stephane Erania). + - tru64: use /bin/sh not /usr/bin/ksh in find-requires. + - 32Mb (~16x largest known) sanity check on header size. + +3.0 -> 3.0.1 + - fix: %verifyscript resurrected (Shing-Gene Yung). + - fix: % before non-alphabetic non-macro special now passed unscathed. + - fix: noarch header gets initialized differently. + - fix: $2 to triggerpostun scripts was wrong + - fix: --querybypkg in man page should be --filesbypkg + - fix: optflags not implicitly set to canonical arch value. + - fix: prefer pgp2.6.3 over pgp5 if both are installed. + - make sure that rpm-the-package auto-requires glibc. + - add rpmputtext/rpmgettext to rpm package. + - fix: non-apache servers need "GET ... HTTP/1.0" by the book. + - fix: %doc wrongly inherits lang from last entry in %files. + - resurrect toplevel tar target. + - spec file removal separate from source removal (Shing-Gene Yung). + - add rpm prefix to MD5 routines to avoid name conflict on solaris. + - fix: resurrect -Vp, -Vf and -Vg functionality. + - colesce query and verify modes. + - better cpio error message if package contains missing hard links. + - fix: shared file not skipped when removed. + - fix: conversion script left off leading underscores. + - another strtok bites the dust. + - fix: prevent return code wrap during packagage checking/resigning. + - permit multiple %lang(xx) markers on elements in %files. + - permit %lang(xx,yy,zz) constructs -- 2 more dead strtoks. + - fix: --prefix should work properly during package installs. + - add librpmbuild.a to the file list. + +2.94 -> 2.95 + - fix: last update transaction set segfault bug in installer. + - improved checks for statfs (Tim Mooney). + - remove inconsistent use of __P((...)) throughout. + - non-static inline functions caused IRIX cc pain. + - CPIOERR_CHECK_ERRNO masking caused AIX cc warnings. + - solaris 2.6+ needs statvfs. + - check build prerequisites before building from specfile. + - convert per-system configuration in /etc/rpmrc to macros. + +2.93 -> 2.94 + - fix: segfault while parsing target string. + - fix: os was not initialized with "--target i586". + - fix: --prefix resurrected. + - non-linux, non-gcc portability fixes (Tim Mooney). + - default to static libs only (remove implied support for shared libs). + +2.92 -> 2.93 + - eliminate old rpmrc configuration syntax. + - pgp5 support (Carlo Wood ) + - fix: segfault from double close on ftpGetFileDesc->ftpAbort path. + - fix: don't add header if signature generation failed (Carlo Wood). + - more DU 4.0D fiddles (Shing-Gene Yung). + - fix: segfault from unknown uid/gid -- use builder's uid/gid instead. + - autoReq/autoProv now per-package. + - fix: avoid segfault using --prefix until ewt fixes. + - add --define "%foo %bar" option. + - dump macros to same fd as --showrc uses. + - add %GNUconfigure for full-blown package regeneration. + - fix: RPM_ARCH/RPM_OS had wrong values. + - fix: create ppc directories correctly. + - (re-)enable fixowner/fixgroup macros. + - fix: specfile BuildRoot was masking rpmrc macro. + - expand twiddles in macrofiles list. + - add explicit macrofiles path to rpmrc. + - add per-target macrofiles to search path. + - take globalMacroContext out of macro api. + - fix: flush all macros between builds. + - add name/version/release macros during src.rpm install. + - attempt mkdir sourcedir/specdir during src.rpm install. + +2.91 -> 2.92 + - update with libtool-2.4f. + - DU 4.0D fiddles (Shing-Gene Yung) + - change support@redhat.com to rpm-list@redhat.com. + - fix: with --target=i686, pass macro %_arch=i386. + - fix: rpm --target=arch ... resurrected. + - fix: rpm -q --specfile --specedit now works even with BuildArch:. + - fix: nested strtok's is a no-no. + - added disk space checking + +2.90 -> 2.91 + - fix: memory leaks in rpmRunTransactions plugged. + - fix: build of packages w/o BuildRoot segfault. + - permit substitution of I18N strings from PO meta-catalogues. + - add callbacks for installer updates while doing URL xfers. + - resurrect http queries/verifies. + - create rpmbzio.c to avoid implicit dependence on libbz2 for installer. + - spec files can provide /filename now + - added rpmdbOpenForTraversal() + - proxy http (Alex deVries). + - add BuildPrereq: in spec file and src rpm. + - added rpmtransSetScriptFd() + - fixed config file problems during chroot upgrades + - fixed %attr brokenness for directories + - augment linux provides/requires for glibc 2.1 backward compatibility. + - fixed --noscript, --notriggers, --excludedocs, and a bunch + of other install/remove flags + - fixed noreplace handling + - complain about old packages being installed + +2.5.x -> 2.90 + - added --excludepath + - identify missing keys by type (Toshio Kuratomi). + - package install/removal much smarter about symlinks + - redid install/remove API to allow transaction semantics + - support for GPG (Toshio Kuratomi ) + - file lookup finally sane wrt symbolic links :-) + - fileindex format changed -- rebuilddb is necessary for rpm 2.90!! + - --rebuilddb doesn't open old index files + - permit http:// and file:// url's as well as ftp://. + - change --rcfile to permit colon separated file list. + - compile in defaults from rpmrc/macros. + - finish hiding rpmdb index record data ("matches"). + - implement abstract fd type almost everywhere. + - update and rename Czech (Pavel Makovec ) + - augment --showrc with -v, only display set variables without -v. + - add macrofiles variable, permit second entry to initMacros(). + - add config.h defines for paths to find-requires et. al. + - add readRPM to libbuild, headerGetLangs to librpm. + - permit rpm to be built in a sub-directory (--srcdir=DIR). + - configure using automake. + - arch/os (and platform) should be case insensitive everywhere forever. + - attempt to deal rationally with os as "Linux" or "linux". + - add generalized expression handler (Tom Dyas) + - use /usr/lib/rpm/mkinstalldirs if mkdir -p fails. + - more portable dirent handling (Hermann Lauer). + - add Slovak translation (Stanislav Meduna ) + - gettextify rpmMessage/rpmError/fprintf messages. + - update po files; add cz to catalogs. + - cpio_gzip: dup the fd before doing gzdopen (Thanks Erik!) + - add --noLang to skip non-default languages. + - writeRPM can now copy cpio archive from fd. + - preliminary macro environment as side effect of rpmrc parse. + - macro handling in rpmlib -- rework include: tag with macro expansion. + - first attempt at librpmbuild API. + - fixed lib/rpmrc.c to accept include: tags (AdV) + - fixed the CHANGES file to reflect that this is 2.9, not 3.0 (AdV) + - aggregate system includes into system.h. + - rearrange functions to minimize exported routines in librpmbuild API. + - generalize cpio I/O to eliminate pipe to exec'd gzip on install. + - add {init,add,expand}Macro args everywhere (new macro.c compatibility) + - add new fully recursive macro.c + - there must be a { between two % in a query format (unless %% is used) + +2.5.6 -> 2.5.7: + - permit 0x1b in specfile sanity check. + - increase timeout in tread from 5 to 30 secs for slow links. + - rename file before unlinking to avoid EBUSY failures. + - headerGetEntry now returns count=0 if tag not found (Chris Blizzard). + - resurrect osf1 as canonical os name (Time Mooney). + - sub-packages should inheirit Prefixes tag (Ian Mortimer). + - make '-' character illegal (again) in version/release. + - use portable #!/bin/sh (Tim Mooney). + - don't erase failing build script (Tim Mooney). + - use portable mkinstalldirs (Tim Mooney). + - irix6 autodeps were dup'd (Shing-Gene Yung ). + - getservbyname needed ntohs(). + - propagate "const char *" into rpmlib prototypes. + - use "original db-1.85" if available (Raw Hide glibc 2.1). + - make sure files to sign exist before asking for the pass phrase + +2.5.5 -> 2.5.6: + - ultrapenguin 1.1.9 sparc64 changes. + - attempt ftp ABOR on query/verify url's. + - cache open ftp control descriptor with password. + - verify needed same realpath semantics as query. + - plug fd leak in urlGetFile(). + - translate cpio errors using cpioStrerror. + - display "..?....." rather than "..5....." for unreadable files. + - run time (rather than compile time) host endian check. + - caldera patches (ray@Caldera.DE) + - added ARM patches. + - fix incorrect directory permissions using %attr/%defattr. + - permit "rpm -q --specfile ... file.spec" queries. + - strncasecmp on spec file separators (KDE has %Description). + - remove redundant md5 computation on uninstall. + - permit --rmsource --force even if sources/patches are missing. + - don't compute md5sum on non-file %config objects. (from Jos Vos) + - check arch only on RPMBUILD_{PREP,BUILD,INSTALL,PACKAGEBINARY}. + - configure.in: set default value for RPM. (Tim Mooney) + - add new Epoch: keyword just like Serial:. + - update Russian translation w man pages. + - solaris: don't attempt static link. (Tim Mooney) + - fix: timeCheck in rpm.c should be unsigned long. (Tim Mooney) + - osf: prov searches only shared libraries. (Tim Mooney) + - solaris: set PATH in prov/req scripts. (Tim Mooney) + - fix: ignore modes on symlinks. (Tim Mooney) + - sub-packages inherit RPMTAG_EPOCH (just like RPMTAG_VERSION/RELEASE). + - fix off-by-1 alloca that prevented relocating /. + - there must be a { between two % in a query format (unless %% is + used). + +2.5.4 -> 2.5.5: + - permit rpm to be built in a sub-directory (--srcdir=DIR). + - return CPIO_BAD_HEADER instead of exiting. (Scott M. Stone) + - untranslate "(none)" for auto relocating script wrappers. + - non-linux arch/os identification (Eugene Kanter). + - portable mode_t/pid_t typedefs. + - fix check for trailing / in Prefix: + - remove 2 character language name assumption. + - add /usr/lib/rpm/find-lang.sh (W. L. Estes ) + - miscellaneous portability cruft (Eugene Kanter). + - Makefile: don't use ln -sf. + - getOutputFrom(): fix race between last read on pipe and child death + (exacerbated in 2.5.4). + - rpm.spec: create /usr/src/redhat/* in %install. + +2.5.3 -> 2.5.4: + - expand args using popt on pre-rpmReadConfigFiles arg pass. + - skip arch checks if only packaging source rpm. + - add license field to rpmpopt -qi alias. + - provides/obsoletes requires tokens that begin with alnum or _. + - non-zero exit status for verify failures. + - hpux does setreuid differently (Hermann Lauer). + - check for setreuid portably (Eugene Kanter). + - add Serbian translation (Zoltan Csala ). + - arch/os tables were not being initialized for noarch builds. + - quote users/groups/filenames in --setugids. + - add Russian translation w man pages (Serguei Koubouchine ) + - fix virtual file attribute bug that skipped all files in binary rpm. + - eliminate infinite loop with missing tmpdir (Trent Jarvi). + - os_canon for CYGWIN32_NT/95. + - rationalize autoconf detection of gzip/bzip2. + - restore backward compatible rpmrc/rpmpopt symlinks. + - update pt_BR translations (Arnaldo Carvalho de Melo). + - permit --{buildroot,timecheck,test,sign} with -tX (Toshio Kuratomi). + - fix database rebuilds with triggers (Steve Sanberg). + - diagnostic message if unreadable/short source or patch file. + - eliminate redundant close in provide/require processing. + - solaris portability patch resurrection (Steve Sanberg). + - permit autogen.sh to work on non "prefix=/usr" hosts. + - add %license/%readme virtual file attributes. + - align "Build Host:" with other fields. + +2.5.2 -> 2.5.3: + - copy changelog tags to sub-packages just before packaging. + - added EPOCH handling to supplement serial numbers + - add RPMTAG_EPOCH and RPMTAG_CAPABILITY init to 0. + - fix infinite recursion on non-ERANGE return from getcwd() during + install (Matt Wilson). + - rm .depend for multiple builds in same tree (Will Partain) + - addFile: fix special case of "/" in %files. + - better query semantics with symlinks (Tim Mooney) + - build.c: fix incorrect check for successful open + - allow %define with leading whitespace + - use /usr/lib/rpm for rpmpopt, rpmrc, find-requires, find-provides + - added popt 'exec' functionality + - made --rebuilddb a bit more robust by checking data types + - added --freshen via popt exec stuff + - fixed spelling of expected + - updated de.po (Karl Eichwalder) + - do a better job of checking for a spec file in tarballs + (Pavel Roskin) + - fixed --triggers alias (Michael Andres) + - added :hex query format + - fixed --querytags to display virtual tags +????? - added --triggers and --triggered by to man page, help, and usage +????? - added support for epochs + +2.5.1 -> 2.5.2: + - added -bs to build just a source package + - included irix.req and irix.prov (Tim Mooney) + - copy CHANGELOG* and URL tags to all subpackages + - follow symlinks when packaging sources + - handle %files -f with no %setup (no build directory) + - fixed ugly i18n header bug + - deal with lang paths sanely when entries are missing languages + - fix bug packing /usr/doc when last file was %dir + - added --last alias + - fix :depflags query format + - Group: i18n (like Summary:) + - make --justdb install files in normal state + - %{fssizes} segv'd for packages with empty file lists + - updated HP-UX, OSF1, Irix 6.x dependency scripts (Tim Mooney) + - added arm and MachTen arch/os info + - added --filesbypkg query format + - updated README to have proper URLs + - updated rpm.spec for proper paths and cleanliness + - dependency resolution could hang when Provides: line is used in + rpmrc (Tim Mooney) + - updated mips rpmrc entries (Alex deVries) + - version/release conditional triggers weren't ignoring the trigger + package name at the front of the TRIGGERVERSION + - added --notriggers for -i and -e + - made --triggers a synonym for --triggerscripts + - ftp installs were trying to use /var/tmp/tmp + - allow whitespace in source/patch lines + +2.5 -> 2.5.1: + - fail if sources are not regular files + - wasn't catching readLine() errors + - fixed (hopefully) temp file creation problems + - make %doc obey --test + - unlink before writing .rpms + - librpm.c: added headerGzRead()/headerGzWrite() + - set bzip2path via lib-rpmrc/configure (Toshio Kuratomi) + - added finish translation (Raimo Koski) + - prefer db_185.h to db.h (Christopher Seawood) + - included updated hpux.req (Ralph Goers) + - added aix.req (Ralph Goers) + - updated hpux.prov, osf.req, osf.prov (Tim Mooney) + - set file states for --justdb packages to "not installed" + - handle missing file states properly in -e code + - install time wasn missing for --justdb packages + - missing parameter in an rpmError() caused segfault + +2.4.109 -> 2.5: + - fixed return code bug in build code + - do macro expansion before %if processing + - dep ordering returns w/ an error as soon as a prereq loop is found + - autoreqprov flag was being ignored during builds + - add autoreq: and autoprov: + - missed a few unlink() when scripts failed + - freePrefixes wasn't initialized in runScript() + - fix typo in %triggerpostun generation + - include icons in source packages + - headerGetEntry() should return count of 1 when returning + strings plucked from i18n strings + - do not remove comments in scripts + - save/restore existing arch when done with buildarch + - copy the I18N table to the source header so i18n stuff works + - fixed multiple memory leaks in install code + - fixed bug in part recognition + - shared files weren't being handled properly in net shared paths + +2.4.108 -> 2.4.109: + - remove icons with --rmsource + - do dependecy generation on -bl + - check files on all packages on -bl + - integrate Jeff Johnson's memleak patches + - added OSF1 autodep scripts + +2.4.107 -> 2.4.108: + - make --clean work with no %setup + - fixed FSSIZES problem introduced in 2.4.107 + - fixed search for find-requires.sh + - improved solaris autodeps scripts + - automated (somewhat) the -static flag + +2.4.106 -> 2.4.107: + - --nomd5 wasn't handled properly + - updated configure.in find-req and find-prov checks (Tim Mooney) + - make --rmsource actually work + - run postun triggers + +2.4.105 -> 2.4.106: + - build: only check for non-printables in first 128 chars + - added %triggerpostun + - linux.req generates deps for shared libs + - added a CC=@CC@ to popt/Makefile.in + - handle signed return types from poptGetNextOpt() properly + +2.4.104 -> 2.4.105: + - added langpatt: to rpmrc, and mark files with matches + - added some C++ cruft to rpmlib.h + - added find-requires and find-provides for hpux (Tim Mooney) + - respect LINGUAS when install package files + - added trigger support to build code + - got rid of annoying mwftw() type warning + - fixed many command line options which got broke by changes + for non-gcc compilers + - added trigger support in install code + - added doc/triggers + - strntoul() in lib/cpio.c was returning a pointer to freed + memory + - headerAppend() was doing a bad memcpy() + +2.4.103 -> 2.4.104: + - fixed popt/Makefile.in to use CPP from configure + - use tmppath from rpmrc to for ftp'd files (rather then /var/tmp) + - autoconf files and .depend files weren't created properly during + make archive + +2.4.102 -> 2.4.103: + - need to create popt/configure during make archive + - added comments about modifictation to base popt and rpmrc files + - allow spaces in group names + - fix bug in memory allocation of special doc stuff + - Jeff Johnson's mode/dev fixes + - clean up buildroot + - be more paranoid about making temp files + - added patches from Tim Mooney which let RPM build with non-gcc + compilers and non-GNU versions of make + +2.4.101 -> 2.4.102: + - fixed spelling of "instchangelog" in lib-rpmrc.in + - fixed memory leak in headerSprintf() extension cache + - fixed memory allocation for header formatting extension cache + - added support for INSTPREFIX virtual tag for backwards compatibility + - cpio error codes were poorly defined, causing bad error messages + - generates INSTPREFIXES tag properly, and sets RPM_INSTALL_PREFIX + and RPM_INSTALL_PREFIXn environment variables + - fixed memory leak in install code which occured when net shared paths + were used + - don't pass net shared path to rpmInstallPackage() -- it looks + directly in the rpmrc entries + - don't remove files in netsharedpath, even for files whose states + are not net shared + - changed --setugids to use separate chown and chgrp programs, for + better portability + - popt moved to autoconf + - Makefiles changed to allow building in a different directory then + the source code resides in + - finally fixed the Build Host spacing in rpmpopt + +2.4.100 -> 2.4.101: + - handle files with spaces (put double quotes around them) + - new rpmrc setting, buildshell, can be used to set shell + used for build scripts (default is /bin/sh) + - fix bug where macros were being improperly set for + Patch: and Source: lines + - may use "instchangelog" in rpmrc to limit the maxmium number of + changelog entries that are stored in the database for each package + (-1 means store all of them) + - default instchangelog is set to 5 + - headerRemoveEntry() didn't free the item's data -- this led to + a slight memory leak when installing packages + - implemented generic file relocations at install time + (use --relocate =, i.e. --relocate /usr=/foo) + - added --badreloc flag to force RPM to relocate files which packages + haven't advertised as relocatable + - fix return code on failed uncompresses in %prep + - preliminary handling of bzip2 compressed files + - differentiates between big and little endian mips + - added support for "prefixes:" tag + +2.4.99 -> 2.4.100: + - fixed handling of --rebuild and --recompile + - fixed rpmlibbuild.a typo in Makefile + - fixed handling of '\' in spec files (a specific case of a more + general bug) + - change use of "export" to work with non-bash shells + - compress the archives. oops. + - fixed bug when there is no %setup + - added -L$(topdir)/popt to Makefile.inc + +2.4.12 -> 2.4.99: + - added many more i18n strings + - merged in large rewrite of build code, which includes the following + changes: + - new option --rmsource + - all scripts can now take -p + - more strict about %package placement and use of main package + preamble + - %attr(mode, user, group [, dirmode]) + - %defattr() + - %defverify() + - Root: is depricated. Use BuildRoot: instead + - "nosrc" sources arn't deleted when sources are removed + - New tag DocDir: to set alternate doc dir (default is + /usr/doc) + - %doc should work as expected with buildroot, prefix, DocDir: + - all file processing is done before any packaging + - should work with modern patch programs (later than 2.1) + - %patch -z same as %patch -b + - %define only defines a macro if it starts a line + - script prog entries are now arrays (ie with arguments) + - standard macros: tag names, buildarch, buildos, buildarch_lc, + buildos_lc, PATCHn, SOURCEn, PATCHURLn, SOURCEURLn, sourcedir, + builddir, optflags + - deprecate require_distribution, require_icon, require_vendor + - add RPMTAG_FILEDEVICES and RPMTAG_FILEINODES to header + - export variables in scripts + - fixed tag:field bug + - %lang() in %files + - %description -l + - Summary(): + - fixed read_line() termination usage + - Makefile changes to shorten compiler lines + +2.4.11 -> 2.4.12: + - intialize reserved portion of lead when writing packages + - fixed error messages displayed when opening the database + fails during package installation and removal + - query format of the form '[A%{}]' would drop the static string + - fixed fix in 2.4.9 for empty packages which broke -qip on ftp URL's + - fixed arch/os numbers in lead + - added Turkish message catalog + - -e was running scripts even w/ --test was specified + +2.4.10 -> 2.4.11: + - HAVE_SYS_SOCKET_H was mistakingly MACHINE_SYS_SOCKET_H in + config.h.in + - \%description was trying to do %d expansion in query formats + - made %% work in query formats + - fixed bug in handling characters before array + - let mips build noarch packages + - --setperms would set wrong permissions in some cases (it was + following symlinks) + +2.4.9 -> 2.4.10: + - obsolete entries could cause segv's during upgrades + - sources now installed with uid/gid of process rather then + the ids used when the src rpm was created + - don't give an error if missingok files don't exist during remove + - touched ftp code to make it coexist w/ Red Hat install better + - use rand/srand rather then random/srandom + - don't build misc directory unless it's necessary + - empty package files should be treated the same as files + with bad magic, not as read errors + - fix bug where Prefix directory is included in file list + - sinix readdir() work-around + +2.4.8 -> 2.4.9: + - fix for verification on systems where a single group id + maps to mulitiple group names (Benedict Lofstedt) + - added 'make tar' rule for building a distribution tarball + (Horacio Rodriguez Montero) + - fixed serial number handling in dependencies and install + code + - make mips compatible with noarch + - fixed bug w/ printing string arrays in conditionals + - handle modern patch programs (> 2.1) + - handle packages w/ duplicate dependency names + - --noscripts didn't get handled properly for removed packages + - fixed handling of packages where %prereq creates users/groups + +2.4.7 -> 2.4.8: + - added noarch build compatibilities for ppc, m68k + - fixed some minor typos (Florian La Roche) + - added Obsoletes: tag, an upgrade removes packages which + have been obsoleted + - updated rpmdepUpgradePackage() to deal with obsoletes tag + - convertdb needed to read rpmrc + - fixed ugly bug in package ordering + - archivesize tag was incorrect for packages with hard links + - moved popt into a separate library + - directory created with %doc is now name-version (dropped + the release) + - added buildarch/buildos macros + - added %ghost file option + - updated linux.req to only find requirements for exectuable files + +2.4.6 -> 2.4.7: + - had some wrong month lengths in changelog date parsing + - updated fine-requires (Linux version) to add lines for shell + scripts (Donnie Barnes) + - didn't package / properly + - pre/post script processing had some erroneous free() calls + - fixed typos for HP archs in lib/rpmrc.c + - uname() results should go through *_canon tables before anything + else happens + - set -x in debug shells, not -xs + +2.4.5 -> 2.4.6: + - added os_canon entries for BSD/OS and NextStep + - replaced include of with includes of + - fixed md5sum of source packages w/ a buildroot is used + - fixed bugs installing version 1 packages + - remove hyphens from uname() result (specifically for HP-UX) + - hacks to recognize architecture under parisc + - RPM_INSTALL_PREFIX wasn't being set properly (this should be + fixed now) + - replaced temporary file creation to be race-condition safe + - prerequisites may not specify versions + +2.4.4 -> 2.4.5: + - call getpwnam()/endpwent() once before a chroot(), forcing name + service shared libs to be loaded from outside of the root path + - added vesrion stamp to lib/misc.o (and librpm.a by extension) + - fixed config.sub, config.guess to recognize i686 + - ARCHIVESIZE tag didn't get filled in properly, breaking progress + meters + +2.4.3 -> 2.4.4: + - restore working directory after installing a package w/ a chroot + - dump the package stack when a dependency loop is encountered + - when a user/group lookup fails, end*ent() and retry + - fixed broken --scripts argument (it was --s2) + - only display the packager and url in -qi output if they have defined + values + - print "(not installed)" as the install time for -p queries rather + then "not a number" + - almost completely rewrote rcfile parsing; I'm sure this will + break things eventually but it's much more flexible now + - added buildarch/buildos compatibility tables, listed values + in --showrc + - added cpio archive building code; GNU cpio is no longer used! + packages created w/ rpm 2.4.4 and later cannot be installed with + rpm 2.4 - rpm 2.4.3 however (version of RPM before 2.4 will + work fine, however). An "error -2 reading header" happens when + this is attempted + - removed cpiobin from rpmrc + - added rpmrc "provides" tag to allow easy fulfillment of + automatically generated dependencies + - look for random() in libm if it can't be found be default + - fixed problems in Solaris's autodeps stuff (Eric Mumpower) + - --setperms should work properly on directories now + - --justdb on install, upgrade, and erasure causes a database + update w/o the filesystem being touched + - fixed version comparison of a package w/ a serial tag against + a package w/o one + - added BuildArchitectures: tag to spec file to enable builds + for alternate/multiple architectures + - look for random() in -lucb + - changed the licensing terms for librpm to allow redistribution + under the LGPL + - applied man page changes from Alex deVries + - configure.in builds up LIBS by appending (Benedict Lofstedt) + - rpm2cpio reported wrong zlib error string + - removed \n from (none) generated by query format code + - queries of fssizes w/o fsnames didn't work (Till Bubeck) + - added --noorder option to skip package reordering (Elliot Lee) + +2.4.2 -> 2.4.3: + - implemented install time prerequisites + - repaired %{#TAG} query format + - implemented ternary operator as query expression + - fixed --scripts to only print information on scripts which + are present + - check symlink() return for < 0, not != 0 (Bob Tanner) + - uses chroot() for installs --root option + - archive expansion doesn't create new devices or symlinks when + the proper files already exist + - added -p to %post (etc) to specify the program which a script + is run through + - if -p is used w/ an empty script, the specified program is + executed directly + - the -p argument (or /bin/sh) is automaticall added as a prereq + +2.4.1 -> 2.4.2: + - completely rewrote queryformat code + - added fsnames, fssizes virtual query tags + - added rpmdbFindByHeader() and rpmdbFindByTag() public functions + - added rpmfilename tag to rpmrc to define the filename format to + use for binary packages (note the rpmdir is prepended to it) + - used pclose() instead of fclose() in -t code + - updated man pages + - changed "struct rpmdb" to "struct rpmdb_s" for C++ + - netsharedpath entries shouldn't match partial directory names + anymore (a nersharedpath of /usr/lib shouldn't affect /usr/libexec) + - don't backup config files on netsharedpaths (take 2) + - added "day" query format which is like date, but doesn't print + any time + - added --changelog alias to query a packages changelog entry + - added mntctl() support for AIX (I think, I can't test this) + - fflags query type displays 's' for specfiles, 'm' for missingok + files, and 'n' for noreplace files + - implemented %config(missingok) flag in install + - added --allfiles flag for -i and -U, which forces all files (even + missingok files) to be installed + - implemented %config(noreplace) for the install, but it hasn't + been tested in any way + - added i18n support to headers + - added ppc/rs6000 differntiation for AIX + - all IP* from uname() is changed to just IP + - IP is considered the same as mips (not sgi) + - added IRIX64 OS, it's compatible w/ IRIX + +2.4 -> 2.4.1: + - take advantage of lchown() if it's available + - fixed configure script to assume chown() doesn't follow symlinks + if lchown() isn't available and configure is not being run as root + - more header file changes for AIX + - added :shescape query format type for strings, which prints strings + which will survive a single level of shell expansion + - fixed --setperms and --setugids to handle empty packages and + packages with odd filenames + - include before + - include "miscfn.h" first in every file which needs it + - created noarch architecture which everything is compatible with + - fixed group verification (Benedict Lofstedt) + - don't backup config files on netsharedpaths + - added info on --build{arch|os} to --help and usage messages + +2.3.11 -> 2.4: + - changed RPMNLSDIR directories to and @datadir@ to better + conform with autoconf + - set RPM_INSTALL_PREFIX environment variable when running + verify scripts + - beginnings of SCO support (though I suspect it will take one + or two more iterations to get it right) + - switched to CVS and updated some Makefile rules + - look for gethostbyname() instead of gethostname() in -nsl + (this could break some things) + - added check for strcasecmp() in -lucb on systems which don't + have strcasecmp() in libc + - don't build -static on hpux10 + - don't try and NLS empty strings + - changed index() call to strchr() in macro code + - include in build/spec.c for various platforms + - added update-po rule to po/Makefile.in + - updated de.po (thanks to Karl Eichwalder) + - rpmFindByFile() removes trailing and duplicate /'s + - made many string in rpm program (though not yet in the various + libraries) translatable + - eight character user names could break -qlv + - requirements which begin with a leading / require files (in + the database!) instead of packages + - clean up conflictsindex during --rebuilddb + - get path to gzip from /usr/lib/rpmrc rather then just hoping it's + in the path + - use dbpath for error messages with include database path in + their text + - don't set owner/group if binaries installed by "make install" + - include on SCO + - don't use cpio when installing packages + - fixed bug which affected dependencies on the Alpha + - made '=' work for long arguments (the switch to popt broke this) + - handle solaris systems better + - complain if critical rpmrc variables (cpiobin, gzipbin, etc) aren't + set anywhere + - allow --dbpath for --rebuilddb + - added check for systems whose chown() follows symlinks. If configure + is run as root, this should get it right, otherwise it assumes + chown() does not follow symlinks. You can use --enable-broken-chown + to force configure to think chown does indeed follow symlinks. + - if chown() follows symlinks, we don't chown() symlinks during cpio + unpacking and we don't verify the owner or group of symlinks + - added packager and url to default -qi output + - look for and use it if it's there (for AIX) + +2.3.10 -> 2.3.11: + - fixed newlines in --scripts output + - fix handling of source files with bad owners/groups + +2.3.9 -> 2.3.10: + - --allmatches handling in -e broke some cases + - new predefined macros: %SOURCEn %PATCHn %SOURCEURLn %PATCHURLn + - fix anomoly with %files -f and %doc + - ignore config bit when it's set on directories (which allows + users to replace directories with symlinks) + - don't set config bit on directories + - strip trailing slashes from files (during build) + - %tags are now case sensitive (macros too) + +2.3.8 -> 2.3.9: + - reworked %setup to allow multiple -a and -b options, which + should noticeably ease the task of unapcking multiple tar files + - md5 sum's were calculated incorrectly on big endian machines + from 2.3.2 through 2.3.8 -- this was fixed and some hacks were + done to keep verification working + - updated README + - added --allmatches to allow erasing multiple versions/releases + of a package + - changed ftp URL's to use \r\n, not just \n (this should let RPM + work w/ some picky (but rfc compliant) ftp servers + - fix problem where parts at end of spec file were dropped + - added %config(noreplace missingok) (build-side) + - simple spec file macros + - should now process entire file list before failing + +2.3.7 -> 2.3.8: + - added -t? options to build packages from tarballs which contain + .spec files instead of from the .spec files directly + - fixed error in man page where ftp URLs are discussed + - don't strlen(NULL) in headerAddEntry() + - minor portability changes + - stopped building oldrpmdb.c as part of rpmlib + - added Makefile rule for building rpmconvert (which is almost + never needed) -- this isolated gdbm dependence to this target + - fixed checking of popt stack overflow + - --requires shouldn't imply -q + - fixed error message issued when a groupname does not exist + - fixed but in changelog processing which made it hang on '*' in a + changelog entry + - generate S_ISSOCK and S_ISLNK macros on systems w/o them + - "rpm --erase" wasn't returning proper error codes w/ package + removal failed + +2.3.6 -> 2.3.7: + - fixed nasty memory link in -Va + - configure checks for -lnsl explicitly rather then linking it + to -lsocket (for NCR SysVR4) + - configure checks for dirent.h + - modified glob.c to include config.h and use HAVE_DIRENT_H + - cleanup of LIBS/LIBPATH mess a bit more + +2.3.5 -> 2.3.6: + - -Vf uses realpath() now + - -Vp lets you use --ftpproxy, --ftpport + - changed popt format, breaking all popt alises :-( + - added ability to alias character arguments to popt + - moved --requires, --info to /usr/lib/rpmpopt + - RPM is more forgiving of blank user names (dumb) + - popt searches for aliases in the correct order now + - cleanup query code to handle missing uid lists better + - cleanup up configure.in a tad + +2.3.4 -> 2.3.5: + - %{#TAG} in query format prints the array length + - cleanup up protoypes in rpmlib.h + - let -Vp work on URLs + - don't set umask(0) anymore -- that confused programs which + link against rpmlib quite badly + - moved print out in "rpm -v -i" to occur after any warnings + to pretty up the output a bit + - added default optflags for powerpc + - run shell for post/pre scripts in debug mode with -sx for + some silly shells + - installing source packages with --root checked for the + sources/specs directory to exist outside of the root -- fixed + - modified toplevel Makefile to run dependency generation only + against referenced sources + - array size mismatches in --qf should send error to stderr + - tried to make the locale stuff a bit more portable (again) + - reworked the owner/group setting on installs to be more generic + (in preperation for getting rid of cpio) + - made verify verify owner and groups by name rather then by id -- if + the symbolic names aren't available use the uids + - cleaned up relocateFilelist() and related code thanks to + new header introduced in 2.3.3 -- this could break relocatable + packages but they seem okay + - fixed a bug which could cause relocatable packages to not get + relocated -- I think this bit some people during hard drive + installs of all things (Jason Salopek pestered me consistently + enough to keep this on the front burner for me) + - removed FILEUIDS and FILEGIDS from the header in the database -- + we never used it and it jsut wasted room + - convert uid/gid lists in v1 headers to symbolic names + +2.3.3 -> 2.3.4: + - %changelog processing + - fixed broken requires/conflicts parsing for spec file + - vastly improved --rebuilddb's robustness + - fixed misplaced free() (only affected inconsistent databases) + - added conflicts documentation to docs/dependencies + - using multiple query formats has them all concatenated + - removed stdin based query and verify selectors + - installs rpmpopt in libdir + - moved --provides and --scripts to rpmpopt + - added --setperms, --setugids + - incorporated newer de.po from Karsten Weiss + - --resign/--addsign was broken in 2.3.3 from popt conversion + +2.3.2 -> 2.3.3: + - Ripped out header internals and redid them. Any compatibility + problems this causes are *bugs* as it should be completley + transparent. If this works the devil better buy some Prestone (TM). + - Use "cp -pr" instead of "cp -ar" for %doc expansion + - use instead of (non standard) in some places + - look for non-POSIX (broken) chmod + - include local copies of glob/fnmatch + - removed getopt() check from configure.in + - fixed bug in ftp code which prevented proper logins to some sites + - switched to popt from getopt, which allows command line aliasing + - read initial aliases from /usr/lib/rpmpopt then /etc/popt and + $HOME/.popt + - cleanup up rdev verification (only verifies device files, checks + device related mode bits as well) + - fixed allocation of temporary paths (Eugene Kanter noticed this) + - made tools/dumpdb read the rpmrc so it can find the database + - added --nomd5 for -V and -K + - don't assume mkdir -p will succeed if the dir exists + - use RPMNLS* defines to avoid header file conflicts + - bunch of minor cleanups to avoid warnings on other OS's + +2.3.1 -> 2.3.2: + - fixed bug in new rpmVersionCompare() which made it worse then + useless (thanks to Norbert Kiesel) + - fixed silly message + +2.3 -> 2.3.1: + - changed --help routing to have intelligent line wrapping + to make i18n efforts easier + - NLSDIR should be used for nls catalogs, not a hardcoded path + - NLSDIR should be in share, not lib + - renamed sweedish catalog from se to sv + - added german catalog + - treat RPM_CHAR_TYPE as RPM_INT8_TYPE for queries + - made rpmEnsureOlder() internal to lib/install.c + - added rpmVersionCompare() to compare version/release/serial numbers + for packages -- returns like strcmp() + - stdout/stderr were getting closed after running a verify script + - relocting packages didn't work w/ the packages contained the + directory which was it's prefix + +2.2.11 -> 2.3: + - replaced putenv/setenv which calls which malloc() buffer -- these + are memory leaks, but the functions are only used between a fork() + and exec() so it doesn't matter + - created directroies are stamped with mtime from the file list + +2.2.10 -> 2.2.11: + - fixed some include file problems for FreeBSD + - fixed find-provides script for Linux (silly typo) + - -qvl didn't print out sticky bit + - linux.prov won't print provides info for symlinks which point + to libraries w/ proper sonames + +2.2.9 -> 2.2.10: + - changed how installArchive() handles running out of gzread() + bytes while the child is still alive + - changed tag for Alpha's to "alpha" from "axp" + - made ./configure look for --quiet support in cpio + - netsharedPath's were having mkdir()'s done on them and had + bad interactions with rooted directories + - made -qp accept '-' to query the package on stdin + - dependency checking was broken when no database was being used + - don't *ever* let cpio make directories -- we do a better job + (esp because we don't kill symlinks!) + - plugged memory leaks in upgrade (again thanks to mpr) -- install, + erase, upgrade, query, and verify all seem to be leakproof + - use select() rather than busy waiting in cpio_gzip() + - use half as much temp space during package assembly + - fail if spec file check fails + - changed canonical name for 68k to m68k (sorry) + - integrated FreeBSD changes from Jared Mauch + - integrated Irix changes from Hermann Lauer + - i18n support can be disabled w/ configure by --disable-nls + (thanks to Remy Card) + - integrated more AmigaOS patches, played with configure some + more to allow cross compiling (Kristof Depraetere) + - cleanups to rpm2cpio (closing the gz stream) (Elliot Lee) + - made find-provides return filename for libs w/ no soname + +2.2.8 -> 2.2.9: + - fixed typo in default rpmrc + - made getBooleanVar() a bit better + - added triggers to package builds + - tagged spec file in source package file list + - added %verifyscript (controlled by --noscript, -v flags) + - changed pkgReadHeader() mechanism to be more generic + - added find-provides for Solaris, made find-provides setup + more generic (w/ configure.in picking the right one) + - fix -Q + - The Great Renaming + - use external OS specific script to generate requires lines + (should work with ld.so 1.8.x) (find-requries) + +2.2.7 -> 2.2.8: + - added --ftpproxy, --ftpport (and wrote about them in rpm.8) + - added --nodeps to man page + - added --showrc to man page + - added conflict checking (use conflicts tag, which looks + just like the requires tag) + - fixed RPM's return code when package removal fails + - cleaned up lib/install.c a bit for readability + - plugged a bunch of memory leaks thanks to mpr -- install, + uninstall, verify, and query all seem clean now + - added support for trees shared over a network via netsharedpath + in rpmrc + - don't exit when there is an unknown option in an rpmrc, just + give an error and continue + - tried once again to get things working properly with 2.1's + write behavior + - added -E option for %patch + - added UltraSPARC support to lib-rpmrc + - moved default topdir and optflags settings to lib-rpmrc from + /etc/rpmrc + - removed /etc/rpmrc from standard distribution + - use separate chgrp/chown commands in %setup macro + - kill(2) arguments were backwards in lib/install.c + - fileFile logging needed stdio to handle NULL args to %s + - default docdir (for %doc macro) set in lib-rpmrc rather then + hardcoded + - removed some of the \n from args to error() [though many are + still left] + - uninstall should fail if the preuninstall script fails + - --root works with --initdb now + +2.2.6 -> 2.2.7: + - applied lots of portability patches + - builds on Solaris machines now! + - will build w/o i18n support if GNU gettext isn't installed + - added inet_aton, setenv functions for libmisc + - added Sun4c, Sun4m architectures + - use vfork() if fork() doesn't exist (for AmigaOS) + - look for GNU cpio, complain if it doesn't exist at build time + - put path for GNU cpio in /usr/lib/librpmrc + - install rpm.shared if rpm wasn't built (for Solaris) + - readHeader() in librpm.a should work on sockets (which may + return partial reads) + - package file query (-q -p) accepts ftp:// style URL's + - if gzread returns 0 bytes (at EOF), don't call write w/ 0 byte + argument as it's behviour isn't portable + - fixed -Vp behavior (doesn't seg fault w/ packages have dependencies) + +2.2.5 -> 2.2.6: + - added --rebuilddb to rebuild database, updated man page + - fix fd leak in md5sum + - fixed group cache bug + +2.2.4 -> 2.2.5: + - if rename() for moving .spec file from SOURCES to SPECS fails, + try copying it instead + - -h and -v work for source package >= V2 + - -h output is much smoother now + - new AutoReqProv: tag in spec file can disable automatic + require/provide generation + - fixed md5sum problem on big endian machines in a way that's + mostly backwards compatible; this hack will be removed someday + - added :fflags tag + - fixed a couple of minor memory leaks in lib/install.c + - --test for building + +2.2.3 -> 2.2.4: + - only remove docdir if %doc occurs + - allow -R to %patch + - moved to use GNU autoconf, though it probably isn't perfect yet + (thanks Kristof Depraetere) + - spec file sanity: no - chars in version or release, + must be a regular file :-) + - version specifications for requirements can use "-" + - default lib path, tmp path, topdir, and /usr/lib/rpmrc get set + by configure script relative to --prefix + +2.2.2 -> 2.2.3: + - fixed script file md5 checking when files are in a root + - implemented proper strdup/free logic for dependency conflict + lists + - strip leading directories from ldd output + - fix non-null-terminated readlink() result + - fixed sscanf() in ftp code to use proper types + +2.2.1 -> 2.2.2: + - added functionality to rpmlib to suggest resolutions for + dependency problems + - fix stupid allocation problem in exclude/exclusive stuff + - fix nasty bug where pointers in to the header were getting + stale after some realloc()s in addEntry() + - ignore OS tag for v2 packages -- it was wrong anyway + - match shared libs on ".so" rather than ".so." + - skip blanks from objdump for auto-provide + - if objdump gets us _end, provide the file name + - do not ldd non-regular files + - do not pass leading "/" to ldd + - fix ExcludeOs: and ExclusiveOs: + - -V verifies dependencies, can be controlled with --nodeps + and --nofiles + - added information on --nodeps to usage messages + - implement --timecheck and rpmrc timecheck: + - implement -bl + - catch duplicate files in file lists + - some random sanity checking on the file list + +2.2 -> 2.2.1: + - made rpmRemovePackage() print message in verbose mode + - added support for ftp://user:pass@machine.org/ URL's + during installation - the password will be prompted for + if only the user is given, and anonymous ftp will be used + it both user and password are omitted (as before) + - Remove Exclusive: Exclude: + Replace with: ExclusiveArch: ExclusiveOs: + ExcludeArch: ExcludeOs: + - fixed dependency cheking for packages that are installed + at the same time + - fixed version number dependency checking + - fixed problem installing v1 source packages (thanks to + Nikita Borisov) + - fixed minor spelling/spacing problems (Nikita Borisov) + - assume all v1 packages were made for Linux so OS check works + - began to implement proxyftp, though it doesn't work yet + - fixed spacing when reporting dependency conflicts + - fixed bug where a long name (uname()) was mapping to itself + +2.1.2 -> 2.2: + - don't fail, and do report, if -K can't find a PGP key + - handle file names with quotes and spaces when passed to ldd + (still can't have spaces in %files) + - do not allow Buildprefix: in sub packages + - removed require_group from rpmrc -- groups are always required + - removed arch_sensitive from rpmrc -- always on + - removed docdir from rpmrc -- always /usr/doc + - fixed nasty bug in installing packages with large filelists + - made -R work + - --provides and --requries don't print anything if no information + is present (rather then (none) ) + - -qi prints Summary now + - changed Buildprefix: -> Buildroot: (spec file, rpmrc) + --buildprefix -> --buildroot (command line) + RPM_BUILD_PREFIX -> RPM_BUILD_ROOT + (%prep, %build, %install, %clean) + sorry :-) + - allow Prefix: for sub-packages + - allow packager: in rpmrc + - --arch and --os are now --buildarch and --buildos + - magic arch/os handling through arch_canon and os_canon + see /usr/lib/rpmrc (in short: uname short_name num) + - removed build_arch: from rpmrc + Replacing it is buildarchtranslate: and buildostranslate: + to allow building with arch/os other than what uname() returns. + Can still be overriden with --buildarch and --buildos + - rpmrc keywords are now case-insensitive + - check os at install time + - check return code from gzread() during installs + - implemented os_compat + - added arch_compat and os_compat information to --showrc (the + changes needed to do this removed any lingering questions about + the efficiency of the compat lookups for large tables or tables + with loops -- it should all work fine) + - made -u (--uninstall) exit with an error and not do anything + - added --ignoreos + - fixed error message given when a file is missing + - fixed hashing when multiple packages are being modified + - changed man page for readability (thanks to Joseph L. Hartmann, Jr) + +2.1.1 -> 2.1.2: + - fixed error message for unrelocatable packages + - automatic shared lib provides now work with buildprefix + - fixed dependency checking during upgrades to work if the + package wasn't previously installed + - clean up temp file after signature check + - dependencies weren't looking through packages that were + being installed at the same time quite right + +2.1 -> 2.1.1: + - fixed -qi query format + +2.0.11 -> 2.1: + - added --requires, --whatrequires, --provides and + --whatprovides queries + - using a string array tag in a queryformat results in every + item in the string being printed out with spaces in between + (though this behaviour will probably go away shortly) + - all packages are ftp'd before any are installed (required to + do proper dependency checking) + - if only source packages are being installed, the database is + never opened + - automatic shared library require/provides tags generated + - added --nodeps flag for install and uninstall + - added dependency checking for installs and uninstalls + - misc fixes to compile with glibc + - use PGPPATH if set (and no pgp_path: in rpmrc) + - remove pgp_pubring, pgp_secring stuff + - new extensible signature + - signature section supports multiple signatures + - --addsign to add a signature to a package + - PGP key no longer limited to 1024 bits + - always do at least an MD5 "signature" + as a result, -K will always tell you something + - signatures now include a simple "header+archive size" check + just calling readSignature() checks this + - --nopgp (with -K) to skip PGP check, just do MD5 + - allow '#' comments in preamble and %files section + - fixed -qsv to print both the states and the file information + - added --dump option to query to print all file attributes + - installs with --root use the /etc/passwd and /etc/group from + the target directory + - added --initdb to aid in database initialization + - --queryformat can print items of type INT8 + - "sourceless" packages with nosource: and nopatch: + - [] now allows interation through query formats + - '-' flag for query tags removed + - :date and :perms supported as query format specifiers + - new rpmrc entries "arch" and "os" to override + - --arch and --os on the command line to override + - arch and os are now strings in the package header + - added arch_compat handling in /etc/rpmrc + - added build_arch to /etc/rpmrc + - support arch as string + - added --ignorearch option + - Prefix: in spec file to specify default installation prefix + - rpmrc and command line may be used to override the path + used for the rpm database + - relocatable packages get installed properly + - added support for --prefix and RPM_INSTALL_PREFIX environemtn + variable + - added dependency checking for version numbers + - added correct dependency checking for upgrades + - added :depflags query format flag + - changes --provides, --requires, and --scripts queries to use + queryFormats + +2.0.10 -> 2.0.11: + - fixed chmod(symlink) bug (since 2.0.9) + +2.0.9 -> 2.0.10: + - fixed the fix to rpm -q bug + to query by number you now need --querybynumber + - made arch_sensitive on by default + - handle # comments in preamble + - don't barf if we can't canonicalize the hostname during builds + - fixed --verify with --root + +2.0.8 -> 2.0.9: + - %files -f + - prelim Require/Provide handling + - prelim strict checking of spec file + - removed some bash-isms + - fixed globbing/root bug + - fixed rpm -q bug + - fixed ftw() related bug where symlinks were being + followed in %files rather than just being noted!! + - pass "upgrade" arg to pre/post scripts when upgrading + - use PATH to find cpio when installing + - fixed rpm.magic, added sun4, mips, 68k, sgi, sunos, solaris + - added %attr(mode owner group) feature to file list + - fixed dumb %verify() parse bug + +2.0.7 -> 2.0.8: + - explicitly turn off ASCII armor when running PGP + - fixed --noscripts logic, which was on by default and + off if you specified it! + - uses a temp file to pass filenames to cpio in case when + their are more then 500 filenames in a package + - added --rcfile + - fixed problem with $HOME/.rcfile not being read + - undocumented --search, --where, --keep-temps which + will probably won't be implemented in RPM 2.x anyway + +2.0.6 -> 2.0.7: + - builds now set umask 022 for all scripts + - queries relative paths correctly (thanks to Johnie Stafford) + - fixed error codes for failed installs + - don't add NULL entry to group index for packages that don't + have group information, add it to the "Unknown" group instead + - added --scripts query option + - added --noscripts for installing and uninstall without using + the pre/post scripts + - "rpm -qd" and "rpm -qc" work properly now (they didn't imply + -l before) + +2.0.5 -> 2.0.6: + - internal changes to error messages + +2.0.4 -> 2.0.5: + - added support for generic querying + - added --querytags option + - updated man page for above two + - short-circuit got added before 2.0.5, but I don't know when + - query and installs should now return 0 on success and nonzero + otherwise (rpm -i should return the number of packages that + failed actually) + - made rpm -qa fail if extra arguments are passed to it + +2.0.3 -> 2.0.4: + - added support for PowerPC, and OSF mklinux ports + - added --resign + - added --recompile + - added verbose error messages from Tyson Sawyer + - rpmconvert won't overwrite an existing database + - won't core dump querying old format source packages + - freed minor memory leak + - more descriptive error messages during build + - added support for not installing documentation + +2.0.2 -> 2.0.3: + - added support for 686, 786, 886, 986 + +2.0.1 -> 2.0.2: + - fixed ftp.c to return an error code when select timeouts + - added basic NLS support, along with a Sweedish message catalog + (thanks to Michael Nyquist) + +2.0 -> 2.0.1: + - hashing and percentages no longer SIGFPE on 0 byte packages + - when an ftp fails, install.c no longer tries to install the package + - uses /var/tmp rather then /usr/tmp during for ftp space + - added debugging messages to ftp.c + - fixed some mistakes in the PGP section of the man page + - added mdfile prototype to rpmlib.h - the Python module wants this + - fixed struct oldrpmlead to align properly on the alpha + +2.0 - everything done :-) + +2.0b -> 2.0c: + - an incredible number of changes - I won't bother trying to + list them + +2.0a -> 2.0b: + - moved build stuff to main rpm command, though --rebuild is still + not supported + - install should work, although replaced files are not marked as + replaced + - %doc macro fixed + - --percent, --hash work for installs + - converted databases and packages get the file list in the correct + order now + - none of this is well tested + - rpms are output to proper dirs (which are always arch sensitive) + - basic rpmrc functions are implemented, full parsing is present + - changed error messages for missing files to include full path + - fixed detection of Alpha's + +1.4.6 -> 2.0a: + - completely rewritten in C + - verification missing + - build functionality not in main rpm, in rpmbuild instead + (this will be corrected) + - an awful lot is still missing - this is an ALPHA release + +1.4.5 -> 1.4.6: + - fixed rpmq problem with packages w/o groups (old RPM's would do this) + - fixed uninstalling with --root + +1.4.4 -> 1.4.5: + - added support for mips processors + - added support for osf1 and irix os's + +1.4.3 -> 1.4.4: + - fixed bug in arch detection code which caused i386 failure + +1.4.2 -> 1.4.3: + - added tokens for SPARC, MIPS, PowerPC, and 680x0 architectures + - fixed sparc arch, added arch sanity check + +1.4.1 -> 1.4.2: + - added --root to man page, usage, and help messages + - added a " " to the "Creating directory" debug message in install.pl + - make --rebuild fail on binary packages + - don't output prep/build/install sections if there aren't any + +1.4 -> 1.4.1: + - fixed man page + - updated corruption messages to not mention --rebuild + - added RPM_PACKAGE_VERSION and RPM_PACKAGE_RELEASE variables + at build time + - no longer allows installing binary packages across architectures + - fixed handling of symlinks marked as config files + +1.3.2 -> 1.4: + - make -v the default when using -b and --rebuild + - added %postbuild as an alias for %clean + - added gendiff + - added groups file installed in /usr/lib/rhs/rpm + - made usage message different and more concise then the --help message + - added --version option + - updated man page + - changed C build tree for concurrent building on multiple architectures + +1.3.1 -> 1.3.2: + - add -b option to %patch + - fixed install/chroot temp file deleting + +1.3 -> 1.3.1: + - fixed bug when doing md5 of erased config file during rpm -u + - fixed spec file searching + +1.2 -> 1.3: + - added --search and --where options + - multiarchitecture support + - added --rebuild option + - started C rewrite - rpmq (query options only) + +1.1 -> 1.2: + - preuninstalls weren't getting handled properly + - Alpha architecture is now recognized and builds are allowed + - the database open is checked for success before continuing + - rpm -b? checks the SPEC files for package names given as args diff --git a/rpm-5.4.9/COPYING.LIB b/rpm-5.4.9/COPYING.LIB new file mode 100644 index 0000000..2d2d780 --- /dev/null +++ b/rpm-5.4.9/COPYING.LIB @@ -0,0 +1,510 @@ + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, 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 Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + 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 Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + + When we speak of free software, we are referring to freedom of use, +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 and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +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 other code 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. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes a de-facto standard. To achieve this, non-free programs must +be allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + 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, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser 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 combine 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) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) 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. + + d) 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. + + e) 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 materials to be 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 with +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 Lesser 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 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 St, 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/rpm-5.4.9/CREDITS b/rpm-5.4.9/CREDITS new file mode 100644 index 0000000..ec5fa4a --- /dev/null +++ b/rpm-5.4.9/CREDITS @@ -0,0 +1,41 @@ +Work on RPM was done primarily by: + + Erik Troan + Marc Ewing + +Significant code, ideas, or porting help have been contributed by: + + Stuart Anderson + Ed Bailey + Donnie Barnes + Nikita Borisov + Till Bubeck + Kit Cosper + Kristof Depraetere + Alex deVries + Karl Eichwalder + Ralf S. Engelschall + Fred Fish + David Fox + Joseph L. Hartmann, Jr + Mark Hatle + Jeff Johnson + Michael K. Johnson + Eugene Kanter + Toshio Kuratomi + Hermann Lauer + Elliot Lee + Benedict Lofstedt + Jared Mauch + Nigel Metheringham + Horacio Rodriguez Montero + Tim Mooney + Eric Mumpower + Michael Nyquisk + Steve Sanbeg + Tyson Sawyer + Christopher Seawood + Johnie Stafford + Gary Thomas + Bob Tanner + Karsten Weiss diff --git a/rpm-5.4.9/Doxyfile.in b/rpm-5.4.9/Doxyfile.in new file mode 100644 index 0000000..18c567c --- /dev/null +++ b/rpm-5.4.9/Doxyfile.in @@ -0,0 +1,1489 @@ +# Doxyfile 1.4.6 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = @PACKAGE@ + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = @VERSION@ + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = @WITH_APIDOCS_TARGET@ + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, +# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, +# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, +# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, +# Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# This tag can be used to specify the encoding used in the generated output. +# The encoding is not always determined by the language that is chosen, +# but also whether or not the output is meant for Windows or non-Windows users. +# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES +# forces the Windows encoding (this is the default for the Windows binary), +# whereas setting the tag to NO uses a Unix-style encoding (the default for +# all platforms other than Windows). + +USE_WINDOWS_ENCODING = NO + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = @top_srcdir@/ + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = @top_srcdir@/ + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like the Qt-style comments (thus requiring an +# explicit @brief command for a brief description. + +JAVADOC_AUTOBRIEF = YES + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for Java. +# For instance, namespaces will be presented as packages, qualified scopes +# will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to +# include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = YES + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from the +# version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = @top_srcdir@/Doxyheader \ + @top_srcdir@/build.c \ + @top_srcdir@/build.h \ + @top_srcdir@/config.h \ + @top_srcdir@/debug.h \ + @top_srcdir@/macros \ + @top_srcdir@/rpmqv.c \ + @top_srcdir@/rpmpopt \ + @top_srcdir@/system.h \ + @top_srcdir@/build/build.c \ + @top_srcdir@/build/buildio.h \ + @top_srcdir@/build/expression.c \ + @top_srcdir@/build/files.c \ + @top_srcdir@/build/misc.c \ + @top_srcdir@/build/names.c \ + @top_srcdir@/build/pack.c \ + @top_srcdir@/build/parseBuildInstallClean.c \ + @top_srcdir@/build/parseChangelog.c \ + @top_srcdir@/build/parseDescription.c \ + @top_srcdir@/build/parseFiles.c \ + @top_srcdir@/build/parsePreamble.c \ + @top_srcdir@/build/parsePrep.c \ + @top_srcdir@/build/parseReqs.c \ + @top_srcdir@/build/parseScript.c \ + @top_srcdir@/build/parseSpec.c \ + @top_srcdir@/build/poptBT.c \ + @top_srcdir@/build/reqprov.c \ + @top_srcdir@/build/rpmbuild.h \ + @top_srcdir@/build/rpmspec.h \ + @top_srcdir@/build/spec.c \ + @top_srcdir@/doc/manual/Introduction \ + @top_srcdir@/doc/manual/builddependencies \ + @top_srcdir@/doc/manual/buildroot \ + @top_srcdir@/doc/manual/codingstyle \ + @top_srcdir@/doc/manual/conditionalbuilds \ + @top_srcdir@/doc/manual/dependencies \ + @top_srcdir@/doc/manual/format \ + @top_srcdir@/doc/manual/hregions \ + @top_srcdir@/doc/manual/macros \ + @top_srcdir@/doc/manual/multiplebuilds \ + @top_srcdir@/doc/manual/queryformat \ + @top_srcdir@/doc/manual/signatures \ + @top_srcdir@/doc/manual/relocatable \ + @top_srcdir@/doc/manual/spec \ + @top_srcdir@/doc/manual/triggers \ + @top_srcdir@/doc/manual/tsort \ + @top_srcdir@/file/src/tar.h \ + @top_srcdir@/lib/depends.c \ + @top_srcdir@/lib/formats.c \ + @top_srcdir@/lib/fs.c \ + @top_srcdir@/lib/fs.h \ + @top_srcdir@/lib/fsm.c \ + @top_srcdir@/lib/fsm.h \ + @top_srcdir@/lib/manifest.c \ + @top_srcdir@/lib/manifest.h \ + @top_srcdir@/lib/misc.c \ + @top_srcdir@/lib/misc.h \ + @top_srcdir@/lib/poptALL.c \ + @top_srcdir@/lib/poptI.c \ + @top_srcdir@/lib/poptQV.c \ + @top_srcdir@/lib/psm.c \ + @top_srcdir@/lib/psm.h \ + @top_srcdir@/lib/query.c \ + @top_srcdir@/lib/rpmal.c \ + @top_srcdir@/lib/rpmal.h \ + @top_srcdir@/lib/rpmchecksig.c \ + @top_srcdir@/lib/rpmcli.h \ + @top_srcdir@/lib/rpmds.c \ + @top_srcdir@/lib/rpmds.h \ + @top_srcdir@/lib/rpmfc.c \ + @top_srcdir@/lib/rpmfc.h \ + @top_srcdir@/lib/rpmfi.c \ + @top_srcdir@/lib/rpmfi.h \ + @top_srcdir@/lib/rpmgi.c \ + @top_srcdir@/lib/rpmgi.h \ + @top_srcdir@/lib/rpminstall.c \ + @top_srcdir@/lib/rpmlib.h \ + @top_srcdir@/lib/rpmps.c \ + @top_srcdir@/lib/rpmps.h \ + @top_srcdir@/lib/rpmrc.c \ + @top_srcdir@/lib/rpmrollback.c \ + @top_srcdir@/lib/rpmte.c \ + @top_srcdir@/lib/rpmte.h \ + @top_srcdir@/lib/rpmts.c \ + @top_srcdir@/lib/rpmts.h \ + @top_srcdir@/lib/rpmversion.c \ + @top_srcdir@/lib/rpmversion.h \ + @top_srcdir@/lib/transaction.c \ + @top_srcdir@/lib/verify.c \ + @top_srcdir@/rpmdb/db3.c \ + @top_srcdir@/rpmdb/dbconfig.c \ + @top_srcdir@/rpmdb/db_emu.h \ + @top_srcdir@/rpmdb/fprint.c \ + @top_srcdir@/rpmdb/fprint.h \ + @top_srcdir@/rpmdb/hdrfmt.c \ + @top_srcdir@/rpmdb/hdrNVR.c \ + @top_srcdir@/rpmdb/header.c \ + @top_srcdir@/rpmdb/header_internal.c \ + @top_srcdir@/rpmdb/header_internal.h \ + @top_srcdir@/rpmdb/legacy.c \ + @top_srcdir@/rpmdb/legacy.h \ + @top_srcdir@/rpmdb/merge.c \ + @top_srcdir@/rpmdb/package.c \ + @top_srcdir@/rpmdb/pkgio.c \ + @top_srcdir@/rpmdb/pkgio.h \ + @top_srcdir@/rpmdb/poptDB.c \ + @top_srcdir@/rpmdb/rpmdb.c \ + @top_srcdir@/rpmdb/rpmdb.h \ + @top_srcdir@/rpmdb/rpmdpkg.c \ + @top_srcdir@/rpmdb/rpmdpkg.h \ + @top_srcdir@/rpmdb/rpmevr.c \ + @top_srcdir@/rpmdb/rpmevr.h \ + @top_srcdir@/rpmdb/rpmns.c \ + @top_srcdir@/rpmdb/rpmns.h \ + @top_srcdir@/rpmdb/rpmrepo.c \ + @top_srcdir@/rpmdb/rpmrepo.h \ + @top_srcdir@/rpmdb/rpmtag.h \ + @top_srcdir@/rpmdb/rpmtypes.h \ + @top_srcdir@/rpmdb/signature.c \ + @top_srcdir@/rpmdb/signature.h \ + @top_srcdir@/rpmdb/sqlite.c \ + @top_srcdir@/rpmdb/tagname.c \ + @top_srcdir@/rpmdb/tagtbl.c \ + @top_srcdir@/rpmio/ar.c \ + @top_srcdir@/rpmio/ar.h \ + @top_srcdir@/rpmio/argv.c \ + @top_srcdir@/rpmio/argv.h \ + @top_srcdir@/rpmio/bzdio.c \ + @top_srcdir@/rpmio/cpio.c \ + @top_srcdir@/rpmio/cpio.h \ + @top_srcdir@/rpmio/crc.c \ + @top_srcdir@/rpmio/crc.h \ + @top_srcdir@/rpmio/digest.c \ + @top_srcdir@/rpmio/fnmatch.c \ + @top_srcdir@/rpmio/fnmatch.h \ + @top_srcdir@/rpmio/fts.c \ + @top_srcdir@/rpmio/fts.h \ + @top_srcdir@/rpmio/glob.c \ + @top_srcdir@/rpmio/glob.h \ + @top_srcdir@/rpmio/gzdio.c \ + @top_srcdir@/rpmio/iosm.c \ + @top_srcdir@/rpmio/iosm.h \ + @top_srcdir@/rpmio/lookup3.c \ + @top_srcdir@/rpmio/xzdio.c \ + @top_srcdir@/rpmio/macro.c \ + @top_srcdir@/rpmio/mire.c \ + @top_srcdir@/rpmio/mire.h \ + @top_srcdir@/rpmio/mount.c \ + @top_srcdir@/rpmio/poptIO.c \ + @top_srcdir@/rpmio/rpmbc.c \ + @top_srcdir@/rpmio/rpmbc.h \ + @top_srcdir@/rpmio/rpmcb.h \ + @top_srcdir@/rpmio/rpmdav.c \ + @top_srcdir@/rpmio/rpmdav.h \ + @top_srcdir@/rpmio/rpmgc.c \ + @top_srcdir@/rpmio/rpmgc.h \ + @top_srcdir@/rpmio/rpmhash.c \ + @top_srcdir@/rpmio/rpmhash.h \ + @top_srcdir@/rpmio/rpmhook.c \ + @top_srcdir@/rpmio/rpmhook.h \ + @top_srcdir@/rpmio/rpmio.c \ + @top_srcdir@/rpmio/rpmio.h \ + @top_srcdir@/rpmio/rpmio_internal.h \ + @top_srcdir@/rpmio/rpmiob.c \ + @top_srcdir@/rpmio/rpmiotypes.h \ + @top_srcdir@/rpmio/rpmjs.c \ + @top_srcdir@/rpmio/rpmjs.h \ + @top_srcdir@/rpmio/rpmku.c \ + @top_srcdir@/rpmio/rpmku.h \ + @top_srcdir@/rpmio/rpmlog.c \ + @top_srcdir@/rpmio/rpmlog.h \ + @top_srcdir@/rpmio/rpmlua.c \ + @top_srcdir@/rpmio/rpmlua.h \ + @top_srcdir@/rpmio/rpmmacro.h \ + @top_srcdir@/rpmio/rpmmalloc.c \ + @top_srcdir@/rpmio/rpmmg.c \ + @top_srcdir@/rpmio/rpmmg.h \ + @top_srcdir@/rpmio/rpmnss.c \ + @top_srcdir@/rpmio/rpmnss.h \ + @top_srcdir@/rpmio/rpmperl.c \ + @top_srcdir@/rpmio/rpmperl.h \ + @top_srcdir@/rpmio/rpmpgp.c \ + @top_srcdir@/rpmio/rpmpgp.h \ + @top_srcdir@/rpmio/rpmpython.c \ + @top_srcdir@/rpmio/rpmpython.h \ + @top_srcdir@/rpmio/rpmrpc.c \ + @top_srcdir@/rpmio/rpmruby.c \ + @top_srcdir@/rpmio/rpmruby.h \ + @top_srcdir@/rpmio/rpmsq.c \ + @top_srcdir@/rpmio/rpmsq.h \ + @top_srcdir@/rpmio/rpmsql.c \ + @top_srcdir@/rpmio/rpmsql.h \ + @top_srcdir@/rpmio/rpmsquirrel.c \ + @top_srcdir@/rpmio/rpmsquirrel.h \ + @top_srcdir@/rpmio/rpmssl.c \ + @top_srcdir@/rpmio/rpmssl.h \ + @top_srcdir@/rpmio/rpmsx.c \ + @top_srcdir@/rpmio/rpmsx.h \ + @top_srcdir@/rpmio/rpmsw.c \ + @top_srcdir@/rpmio/rpmsw.h \ + @top_srcdir@/rpmio/rpmtcl.c \ + @top_srcdir@/rpmio/rpmtcl.h \ + @top_srcdir@/rpmio/rpmurl.h \ + @top_srcdir@/rpmio/rpmuuid.c \ + @top_srcdir@/rpmio/rpmuuid.h \ + @top_srcdir@/rpmio/rpmxar.c \ + @top_srcdir@/rpmio/rpmxar.h \ + @top_srcdir@/rpmio/strcasecmp.c \ + @top_srcdir@/rpmio/strtolocale.c \ + @top_srcdir@/rpmio/tar.c \ + @top_srcdir@/rpmio/tar.h \ + @top_srcdir@/rpmio/ugid.c \ + @top_srcdir@/rpmio/ugid.h \ + @top_srcdir@/rpmio/url.c \ + @top_srcdir@/python/header-py.c \ + @top_srcdir@/python/header-py.h \ + @top_srcdir@/python/spec-py.c \ + @top_srcdir@/python/spec-py.h \ + @top_srcdir@/python/rpmal-py.c \ + @top_srcdir@/python/rpmal-py.h \ + @top_srcdir@/python/rpmdb-py.c \ + @top_srcdir@/python/rpmdb-py.h \ + @top_srcdir@/python/rpmds-py.c \ + @top_srcdir@/python/rpmds-py.h \ + @top_srcdir@/python/rpmfd-py.c \ + @top_srcdir@/python/rpmfd-py.h \ + @top_srcdir@/python/rpmfi-py.c \ + @top_srcdir@/python/rpmfi-py.h \ + @top_srcdir@/python/rpmfts-py.c \ + @top_srcdir@/python/rpmfts-py.h \ + @top_srcdir@/python/rpmmi-py.c \ + @top_srcdir@/python/rpmmi-py.h \ + @top_srcdir@/python/rpmmodule.c \ + @top_srcdir@/python/rpmps-py.c \ + @top_srcdir@/python/rpmps-py.h \ + @top_srcdir@/python/rpmte-py.c \ + @top_srcdir@/python/rpmte-py.h \ + @top_srcdir@/python/rpmts-py.c \ + @top_srcdir@/python/rpmts-py.h \ + @top_srcdir@/tools/rpm2cpio.c \ + @top_srcdir@/tools/rpmcache.c \ + @top_srcdir@/tools/rpmcmp.c \ + @top_srcdir@/tools/rpmdeps.c \ + @top_srcdir@/tools/rpmdigest.c \ + @top_srcdir@/tools/rpmgrep.c \ + @top_srcdir@/tools/rpmmtree.c \ + @top_srcdir@/tools/rpmrepo.c \ + @top_srcdir@/ruby + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py + +FILE_PATTERNS = *.c \ + *.h + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = @top_srcdir@/doc/manual + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = letter + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = YES + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = \ + "__BEGIN_DECLS=" \ + "__END_DECLS=" \ + "Py_TPFLAGS_HAVE_ITER=1" + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = +# @top_srcdir@/popt/Doxytags + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = Doxytags + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_WIDTH = 1024 + +# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_HEIGHT = 1024 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that a graph may be further truncated if the graph's +# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH +# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), +# the graph is not depth-constrained. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, which results in a white background. +# Warning: Depending on the platform used, enabling this option may lead to +# badly anti-aliased labels on the edges of a graph (i.e. they become hard to +# read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO diff --git a/rpm-5.4.9/Doxyheader b/rpm-5.4.9/Doxyheader new file mode 100644 index 0000000..9d46971 --- /dev/null +++ b/rpm-5.4.9/Doxyheader @@ -0,0 +1,44 @@ +/** \defgroup rpmts RPM Transaction Set API (RPMTS) + */ +/** \defgroup rpmte RPM Transaction Element API (RPMTE) + */ +/** \defgroup rpmds RPM Dependency Set API (RPMDS) + */ +/** \defgroup rpmio Internally shared I/O code (RPMIO) + */ +/** \defgroup python PYTHON API. + */ +/** \defgroup py_c PYTHON-C Language Bindings. + */ +/** \defgroup rpmcli RPMCLI. + */ +/** \defgroup rpmbuild RPMBUILD. + */ +/** \defgroup rpmrc RPMRC. + */ +/** \defgroup rpmfi RPMFI File Info API. + */ +/** \defgroup rpmgi RPMGI Generalized Iterator API. + */ +/** \defgroup lead LEAD. + */ +/** \defgroup signature SIGNATURE. + */ +/** \defgroup header HEADER. + */ +/** \defgroup payload PAYLOAD. + */ +/** \defgroup rpmdb RPMDB Database API. + */ +/** \defgroup dbi RPMDBI DataBase Index Element API. + */ +/** \defgroup db3 Berkeley DB API. + */ +/** \defgroup rpmlua RPMLUA Embedded Lua. + */ +/** \defgroup rpmrpc RPMRPC. + */ +/** \defgroup rpmpgp RPMPGP. + */ +/** \defgroup rb_c Ruby Bindings + */ diff --git a/rpm-5.4.9/INSTALL b/rpm-5.4.9/INSTALL new file mode 100644 index 0000000..4458c63 --- /dev/null +++ b/rpm-5.4.9/INSTALL @@ -0,0 +1,462 @@ + +REQUIREMENTS +============ + +Development-Time +---------------- + +--------------- --------- --------------- ------------------------------------- +Component Component Version Version Component +Name Type Minimum Used URL +--------------- --------- ------- ------- ------------------------------------- +CVS mandatory 1.12 1.12.13 http://www.nongnu.org/cvs/ +Perl mandatory 5.8.0 5.10.1 http://www.perl.com/ +GNU m4 [0] mandatory 1.4.0 1.4.13 http://www.gnu.org/software/m4/ +GNU autoconf mandatory 2.59b 2.63 http://www.gnu.org/software/autoconf/ +GNU automake mandatory 1.8 1.11.1 http://www.gnu.org/software/automake/ +GNU libtool mandatory 1.5 2.2.6a http://www.gnu.org/software/libtool/ +GNU gettext mandatory 0.16 0.17 http://www.gnu.org/software/gettext/ +GNU make mandatory - - http://www.gnu.org/software/make/ +GNU bash optional - - http://www.gnu.org/software/bash/ +--------------- --------- ------- ------- ------------------------------------- + +Build-Time +---------- + +--------------- --------- --------------- ------------------------------------- +Component Component Version Version Component +Name Type Minimum Used URL +--------------- --------- ------- ------- ------------------------------------- +ISO C Compiler mandatory - - e.g. http://gcc.gnu.org/ +POSIX make mandatory - - e.g. http://www.gnu.org/software/make/ +Perl mandatory 5.8.0 5.10.1 http://www.perl.com/ +POPT mandatory 1.15 1.16 http://rpm5.org/files/popt/ +BeeCrypt mandatory 4.2.0 4.2.1 http://beecrypt.sourceforge.net/ +Libtasn.1 mandatory - 2.7 http://www.gnu.org/software/libtasn1/ +Neon mandatory 0.27.0 0.29.4 http://www.webdav.org/neon/ +PCRE mandatory 7.0 8.10 http://www.pcre.org/ +Mozilla NSS optional 3.11 3.12.8 http://www.mozilla.org/projects/security/pki/nss/ +OpenSSL optional 0.9.8 1.0.0a http://www.openssl.org/ +Berkeley-DB [1] optional 5.1.19 5.1.19 http://www.oracle.com/database/berkeley-db.html +SQLite [1] optional 3.3 3.7.0.1 http://www.sqlite.org/ +Lua [2] optional 5.1 5.1.4 http://www.lua.org/ +ZLib optional 1.2 1.2.3 http://www.zlib.net/ +Bzip2 optional 1.0 1.0.5 http://www.bzip.org/ +XZ Utils [3] optional 4.999.9 4.999.9 http://tukaani.org/xz/ +File/magic [4] optional 4.00 5.03 ftp://ftp.astron.com/pub/file/ +GNU gettext optional 0.18 0.18 http://www.gnu.org/software/gettext/ +GNU iconv optional 1.11 1.11 http://www.gnu.org/software/libiconv/ +OSSP uuid optional 1.6.0 1.6.2 http://www.ossp.org/pkg/lib/uuid/ +XAR [5] optional 1.5.2 1.5.2 http://code.google.com/p/xar/ +DMalloc optional 5 5.5.2 http://dmalloc.com/ +Electric Fence optional 2.1 2.1.13 http://perens.com/FreeSoftware/ElectricFence/ +Linux KeyUtils optional 1.2 1.2 http://people.redhat.com/~dhowells/keyutils/ +System libelf optional - - e.g. http://www.mr511.de/software/english.html +CPUInfo optional r143 r143 https://launchpad.net/cpuinfo +--------------- --------- ------- ------- ------------------------------------- + +[0] m4: NOTICE: Do not use GNU m4 1.4.10, it breaks GNU autoconf. + +[1] db/sqlite: Berkeley-DB used by RPM. + Building RPM against anything _EXCEPT_ db-5.1.19 + external Berkeley-DB is not officially supported + (but any version of Berkeley-DB since db-4.5.20 will "work"). + +[2] lua: Modified Lua copy bundled with RPM. + Building RPM against stock external Lua not recommended + as it reduces its RPM-specific functionality. + +[3] xz: XZ Utils copy is bundled with RPM because there is no + "official" XZ release and too many variants in the wild. + +[4] file: File/magic copy can bundled with RPM to control for magic + strings used in *.rpm tag content. + Building RPM against stock external File/magic supported, too. + NOTICE: File 4.24 is unportable because uses asprintf(3) + without fallbacks. + +[5] xar: Modified XAR copy bundled with RPM. + Building RPM against stock external XAR currently still not recommended. + The 1.5 and 1.5.1 releases of XAR needs some patching, before they work. + +Run-Time +-------- + +--------------- --------- --------------- ------------------------------------- +Component Component Version Version Component +Name Type Minimum Used URL +--------------- --------- ------- ------- ------------------------------------- +GNU zip optional - - http://www.gzip.org/ +Bzip2 optional - - http://www.bzip.org/ +XZ optional 4.999.9 4.999.9 http://tukaani.org/xz/ +GNU tar optional - - http://www.gnu.org/software/tar/ +GNU cpio optional - - http://www.gnu.org/software/cpio/ +UnZip optional - - http://www.info-zip.org/UnZip.html +GnuPG optional - - http://www.gnupg.org/ +--------------- --------- ------- ------- ------------------------------------- + +PROCEDURE +========= + +Development-Time +---------------- + +$ ./devtool jbj|standalone + +Build-Time +---------- + +$ ./configure --prefix= [...] +$ make +$ make install [DESTDIR=...] + +Run-Time +-------- + +$ /bin/rpm --initdb +$ /bin/rpm --rebuild foo.src.rpm +$ /bin/rpm -Uvh /path/to/binary/package/foo.*.rpm +$ /bin/rpm -qa +$ /bin/rpm -e foo + +Application Build-Time +---------------------- + +CPPFLAGS = `pkg-config rpm --cflags-only-I` +CFLAGS = `pkg-config rpm --cflags-only-other` +LDFLAGS = `pkg-config rpm --libs-only-other` +LIBS = `pkg-config rpm --libs-only-l` + +BUILDING RPM ON A CLUSTER OF SERVERS +==================================== + +Assume you have... + +- a cluster of time-synchronized Unix servers + (usually of different Unix flavors to make sense in this context), +- each server allowing you to login under your personal account and + access your central home directory (usually via NFS) and +- each server providing you the full set of development tools, + +...then you can build RPM in parallel on an arbitrary number of servers +in this cluster by using the following procedure: + +1. Build Environment Preparation: + + On a single arbitrary server of the cluster prepare the RPM source + tree at least once. + + server1$ cd ~/work + server1$ cvs -d rpm-cvs@rpm5.org:/v/rpm/cvs co rpm + server1$ cd rpm + server1$ . devtool.bashrc + + server1$ devtool checkout + server1$ devtool autogen + +2. Platform Preparation: + + on every(!) server of the cluster prepare its platform-specific + environment (includes building local copies of all third-party + libraries). + + serverN$ cd ~/work/rpm + serverN$ . devtool.bashrc + + serverN$ devtool setup-platform + serverN$ devtool standalone prepare + serverN$ devtool standalone configure + +3. Development: + + now you can develop RPM on any number of servers of the cluster in + parallel. + + serverN$ cd ~/work/rpm + serverN$ . devtool.bashrc + + serverN$ cd {build,lib,rpmdb,rpmio,misc,...} + serverN$ vi *.c + serverN$ devtool make + +4. Test-Drive: + + on an arbitrary server of the cluster you can test-drive RPM via: + + serverN$ cd ~/work/rpm + serverN$ . devtool.bashrc + + serverN$ devtool make install + serverN$ /tmp/rpm/bin/rpm [...] + +LIBRARY ISSUES +============== + +RPM is a rather comphrehensive tool with both internal dependencies and +optional external dependencies. The current internal structure is (in +partly dependency order from top to bottom): + + RPM Executables: rpm + (stage 0) rpmbuild + + RPM Libraries: librpmconstant + (stage 1) librpmbuild + librpm + librpmdb + librpmio + librpmmisc + + Third-Party Libraries: libpopt (mandatory) + (stage 2) libbeecrypt (mandatory) + libdb (mandatory) + libpcre (mandatory) + libsqlite3 (optional) + liblua (optional) + libz (optional) + libbz2 (optional) + liblzma (optional) + libintl (optional) + libiconv (optional) + libxar (optional) + libdmalloc (optional) + libefence (optional) + libkeyutils (optional) + libelf (optional) + libneon (optional) + + Third-Party Libraries: libxml2 (required by libxar) + (stage 3) libz (required by libxar) + libexpat (required by libneon) + libssl (required by libneon) + libcrypto (required by libssl) + + System Libraries: libc (required by all) + (stage 4) libm (required by some) + [...] + +The most important aspects to notice are: librpmbuild requires mainly +librpm, librpm in turn requires both librpmdb and librpmio, and all +librpm* require librpmmisc. Additionally; librpmmisc is a container for +the internal local copies of third-party libraries, and librpmconstant +provides RPM API constants (usually to language bindings). Finally, +notice that the set of third-party libraries at stage 2 can be dynamically +chosen at build-time and are not a fixed set. + +Unfortunately, there are many link-time approaches to handle these +internal and external dependencies. The currently implemented approach +is a portable compromise balancing the following particular issues: + +- Dynamic/Static Libraries: + librpmXXX can be built and installed statically (librpmXXX.a) or + dynamically (librpmXXX.so). This is handled by GNU libtool and + controlled by Autoconf options --{enable,disable}-{shared,static}. + +- Installed/Uninstalled Libraries: + libfoo can be in an installed (after "make install") or uninstalled + (just after "make") state. Both are supported by GNU libtool but in + totally different ways. GNU libtool especially treats the linking of a + library against an uninstalled one specially by _copying_ all objects + of the dependency library into the to be be built library. + +- Regular/Convenience Libraries: + GNU libtool knows a special "convenience" library. These are + uninstalled libfoo.la's which are linked into another (still + uninstalled) libbar.la. + +- Library Type Combinations: + GNU libtool knows how to handle all situations caused by _combinding_ + the different types of libraries: installed/uninstalled, + static/dynamic and regular/convinience. And in RPM nearly _ALL_ of + those combinations actually occur under various Autoconf options. + Although the processing abstracted, the resulting libraries have + different characteristics and affects how RPM-based applications are + able to link about the RPM libraries. + +- External Dependencies: + librpmXXX and librpmYYY usually depend on the _same_ third-party + library libfoo. Although GNU libtool handles this seamlessly, one can + easily end up with multiple copies of a code in the same RPM-based + application. + +- Non-Fixed Third-Party Libraries: + RPM supports to be built against a non-fixed set of third-party + libraries, ranging from _none_ at all to half a dozen ones. + Especially, the cases of "none" and "some" have to taken into account. + +- Transitive Dependencies: + libfoo usually has dependencies to other third-party libraries and + those dependencies can be even just optional. For instance libneon + can optionally depend on OpenSSL's libssl and libcrypto and the W3C + libxml. + +- Internal Modified Local Copies: + because of optional but RPM-specific modifications, some third-party + libraries are even provided as internal copies in the RPM source + tree. Those libraries have to be handled specially as they are built + together with RPM. This means that for instance one cannot test-link + against them during configure-time. + +- Dependency Encoding: + there are multiple ways an inter-library dependency can be encoded: + directly in an ELF librpmXXX.so as DT_NEEDED (not available + everywhere), indirectly via "dependency_libs" in librpmXXX.la, via + "Libs:" in rpm.pc, or either via a _FULL INCLUDED COPY_ of all objects + or not at all in case of librpmXXX.a, etc. + +Before complaining that the currently implemented library approach +of RPM is not "standard", doesn't "just work" as expected for your +particular situation, etc please first make sure you understood that +it is balanced compromise in order to portably take care of all of +the above issues at once. So, if you want to change the current +implementation please at least make sure that the above issues are still +taken care of and especially test it under _different_ Unix flavors. + +DEBUGGING +========= + +Memory Allocation Debugging with DMalloc +---------------------------------------- + +1. Install DMalloc into /path/to/dmalloc + +2. Build RPM with at least: + + $ ./configure [...] + --prefix=/tmp/rpm \ + --with-dmalloc=/path/to/dmalloc + [...] + $ make + $ make install + +3. Enable dmalloc debugging with: + + $ . .dmalloc.bashrc + $ dmalloc -l dmalloc.log + $ dmalloc debug3 + +4. Run RPM: + + $ /tmp/rpm/bin/rpm [...] + +5. Inspect the results: + (notice that some used functions like gethostbyname(3) or dirname(3) + from the vendor libc inherently leak memory because of their API + style and because libc isn't DMalloc instrumented you will often see + some memory leaks reported without any source location -- just be not + confused) + + $ vi dmalloc.log + +OS DEPENDENCIES +=============== + +Under Red Hat Linux all libraries (in fact all files distributed with +the OS) are under RPM control and this section is not an issue. + +RPM will need to be informed of all the dependencies which were +satisfied before RPM was installed. Typically this only refers to +libraries that are installed by the OS, but may include other +libraries and packages which are availible at the time RPM is +installed and will not under RPM control. Another common example of +libraries which may need dependency provisions are precompiled +libraries which are installed by the OS package manager during system +build time. The list of dependencies you will wish to load into RPM +will depend on exactly how you bootstrap RPM onto your system and what +parts of the sytem you put into packages as well as on the specific OS +you are using. + +The script vpkg-provides.sh can be used to generate a package which +will satisfy the dependencies on your system. To run it you will need +to create a specfile header for this empty package and run the progam +with: + + --spec_header '/path/to/os-base-header.spec + +and if you wish to ensure that some directories are not traversed you +can use the option: + + --ignore_dirs 'egrep|pattern|of|paths|to|ignore + +By default the generated rpm will include a %verifyscript to verify +checksum of all files traversed has not changed. This additional +check can be surpressed with: + + --noverify + +The result of running the script will be a specfile which will create +a package continging all the dependencies found on the system. There +will be one provides line for each depednecy. The package will contain +none of the actual OS library files as it is assumed they are already +on your system and managed by other means. Here is a example +(truncated) of the provides lines used by one user of Digital Unix. (I +have put several provides on the same line for brevity) + +provides: /bin/sh /usr/bin/ksh /usr/bin/csh +provides: libc.so.osf.1 libm.so.osf.1 libcurses.so.xpg4 libdb.so.osf.1 +provides: libX11.so libXaw.so.6.0 libXext.so libXm.so.motif1.2 libXmu.so +provides: libdnet_stub.so.osf.1 libsecurity.so.osf.1 libpthread.so.osf.1 +provides: libexc.so.osf.1 libmach.so.osf.1 libdps.so libdpstk.so + + +rpmfilename: +----------- + +If you plan on packaging for more then one OS you may want to edit +/etc/rpm/macros or /usr/lib/rpm/macros and change the line which has +rpmfilename to something which includes both the %{_target_os} and +%{_target_cpu}. This will cause the name of the generated rpm files +to the operating system name as well as the architecture which the rpm +runs under. The line to change looks like: + +%_rpmfilename %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm + +you may wish to include both the %{_target_os} and %{_target_cpu} in +the final base name, so that it's easier to distinguish between what +package is appropriate for a particular arch-os-version combo. We +suggest: + +%_rpmfilename %%{_target_platform/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{_target_platform}.rpm + +There is no %{_target_os_version} tag, so if you need to also +distinguish between RPMs for certain versions of the OS, you can +hard-code the version in the macros on the build machine, so that +.rpm files are generated with the version as part of the filename. + +For example when one user builds RPMs for Digital Unix 4.0b and 4.0d, +optimization is important and he will build one set of RPMs for the +EV4 processor and another set for the EV56 processor. He specifies +both the OS version (if it's important, as it is for a few packages) +and the processor version by default by setting a special rpmfilename: +on the particular build machine. + +The "rpmfilename: "tag on one machine (Digital Unix 4.0d, EV56 PWS 433) +looks like: + +rpmfilename: %{_target_os}/4.0d/%{_target_cpu}/%{name}-%{version}-%{release}.%{_target_os}-%{_target_cpu}ev56.rpm + +For package `foo-1.1', at build time that would translate into: + + osf1/4.0d/alpha/foo-1.1-1.osf1-alphaev56.rpm + +The hyphen between the %{_target_cpu} and ev56 is left out for compatibility +with GNU Config.guess and because `alphaev56' looks more "normal" to +people with an alpha than alpha-ev56 for someone on an Intel Pentium +Pro would want `i586pro' over `i586-pro', but it does make parsing +this filename by other programs a bit more difficult. + + +GPG +------------ + +To use the signing features of rpm, you will need to configure certain +rpm macros. + +Here's what I use for gpg: + + /etc/rpm/macros for per-system (or ~/.rpmmacros for per-user) configuration + %_signature gpg + %_gpg_name Jeff Johnson (ARS N3NPQ) + %_gpg_path /home/jbj/.gnupg + +(Note: Both pgp/pgp5 can be used with RPM just noone has tried in >8 years.) + diff --git a/rpm-5.4.9/INSTALL.developer b/rpm-5.4.9/INSTALL.developer new file mode 100644 index 0000000..3ba751d --- /dev/null +++ b/rpm-5.4.9/INSTALL.developer @@ -0,0 +1,148 @@ +These are brief notes for those are @rpm5.org developers or for who want +to try the latest RPM5 version under development. + +They were originally written by the Maintainer via private comunication, +but I thought might be useful to a wider audience. + +Any error or omission are of course only my fault. + +Elia + + ********************************** + +Here's a quick and terse howto check-out and build RPM from CVS. + +Because of the number of configure parameters and the fact +that RPM uses external <-> internal copies of several +sources, the mechanism is a bit more complex than +just doing a cvs checkout and running ./autogen.sh + +0) Get the configgery in place (feel free to change to taste). + The transport is ssh with all the usual rulles. I tend + to add this "stuff" in ~/.bashrc + + export MALLOC_CHECK_=3 + # http://udrepper.livejournal.com/11429.html + export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) + + # http://mah.everybody.org/docs/ssh + SSHAGENT="/usr/bin/ssh-agent" + + if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then + eval `$SSHAGENT -s` + trap "kill $SSH_AGENT_PID" 0 + fi + + and someplace I'm setting CVS_RSH=ssh. + +1) Get the sources. + I tend to use these cvs options in ~/.cvsrc (because I can never remeber): + $ cat ~/.cvsrc + cvs -q -z3 + diff -puw + rdiff -u + update -Pd + + A checkout of cvs HEAD then looks like this (I work in a "wdj" sandbox) + cvs -d :ext:rpm-cvs@rpm5.org:/v/rpm/cvs get -d wdj rpm + + Branch names look like "rpm-5_2", so the equivalent check out for rpm-5.2.x code is + cvs -d :ext:rpm-cvs@rpm5.org:/v/rpm/cvs get -d wdj52 -r rpm-5_2 rpm + + You can see all the tags any time you wish by doing + cd wdj # <-- top of checkout + cvs status -v INSTALL + +2) Use devtool to check out internal sources and configure: + + Examine devtool.conf (and feel free to add stanzas as you want). + + I build RPM using a maximally configured set of options like + ./devtool jbj + which checks out 4-5 other trees, and sets about running ./configure + + The other approach commonly used with devtool is the "standalone" + target. Ralf & Anders usually use that. I would likely be using "standalone" + too, just my RPM habits are peculier to me as a developer, there's lots that + is right with the "standalone" devtool target stanza. + +3) Type "make". + + On a clear day with a stiff wind, the make will succeed ;-) + + More seriously, most build breakage can be fixed by adjusting + AutoFu options passed to configure. + + Hint: Because of the complexity of RPM's configuration, there's + a few configuration dependencies that would be (imho) too painful + to track through Makefile's precisely. Specifically, watch out + for the misc/* "kitchen sink". The -lrpmmisc library is not always + rebuilt when the AutoFu changes. So one sometimes has to do + make -C misc clean + before new configuration takes effect. The 3rd time the issue + bites you the fix will be obvious ;-) + + Another hint: RPM has loader maps to control for symbols exposed + in libraries. If you find yourself wondering why a symbol that + you *know* is present cannot be found, well, examine the libfoo.vers + loader map. Alternatively, just disable loader maps using AutoFu. + + + ********************************** + +HOWTO use multiple version of rpm + +I tend to have multiple versions of both rpm and distro +packaging lying around always, and need to flip between +versions/distros at a dead-run. + +So I work in tree's like /X, /Y, /Z. + +I have private configuration as (say) /X/macros: +================================================ +%_topdir /X +%_ntopdir %{_topdir}/%{name} +%_builddir %{_ntopdir} +%_sourcedir %{_ntopdir} +%_specdir %{_ntopdir} +%_rpmdir %{_ntopdir} +%_srcrpmdir %{_ntopdir} +%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm + +%_tmppath %{_topdir}/tmp +================================================ + +I have a wrapper in ~/bin/xxxrpm to reconfigure: +================================================ +#!/bin/sh + +macros="/usr/lib/rpm/macros:/usr/lib/rpm/%{_target}/macros:/etc/rpm/macros.specspo:/etc/rpm/macros.sqlite:/etc/rpm/macros.cdb:/etc/rpm/macros:/etc/rpm/%{_target}/macros:~/.rpmmacros:/X/macros" + +case $1 in +-b*) rpm=/usr/bin/rpmbuild;; +*) rpm=/usr/bin/rpm;; +esac + +exec $vg $rpm --macros ${macros} $* +================================================ + +When I need to use a different version of rpm, or +add valgrind/time/strace/whatever, I edit the ~/bin/xxxrpm wrapper. +Similarly if/when I need to adjust to different macros to +be loaded, I edit the macros path. + +In each tree, packages are installed/built into /X/%{name}. + +So my packaging workflow goes something like: + + xxxrpm -i foo*.src.rpm + cd /X/foo + xxxrpm -ba foo.spec + rpm -Uvh *.i386.rpm + cd .. + rm -rf foo + +I find having everything in one directory far more +convenient than having to chdir all over the place +just to build a package. + diff --git a/rpm-5.4.9/Makefile.am b/rpm-5.4.9/Makefile.am new file mode 100644 index 0000000..2e3481c --- /dev/null +++ b/rpm-5.4.9/Makefile.am @@ -0,0 +1,290 @@ +# Top level Makefile for rpm + +AUTOMAKE_OPTIONS = 1.4 foreign +ACLOCAL_AMFLAGS = -I m4 + +LINT = splint +MCCABE = pmccabe + +EXTRA_DIST = CHANGES CREDITS Doxyheader INSTALL INSTALL.developer cpuinfo.yaml \ + autodeps autogen.sh \ + syck js \ + lua \ + ruby \ + macros \ + perl \ + pubkeys/JBJ-GPG-KEY \ + rpm.magic rpmqv.c \ + python \ + tests/arbitrarytag-1.0-1.src.rpm \ + tests/cudf-test-1-0.src.rpm \ + tests/devtool-sanity-1.0-1.src.rpm \ + tests/dir2symlink-1-1.src.rpm \ + tests/edos-test-1-0.src.rpm \ + tests/probes-test-1-0.src.rpm \ + tests/simplestRPMv3-1.0-2.aix5.3.noarch.rpm \ + tests/triggers-D-1.0-1.src.rpm \ + tests/triggers-DP-1.0-1.src.rpm \ + tests/triggers-F-1.0-1.src.rpm \ + tests/triggers-FP-1.0-1.src.rpm \ + tests/triggers-N-1.0-1.src.rpm \ + tests/triggers-NA-1.0-1.src.rpm \ + tests/triggers-P-1.0-1.src.rpm + +SUBDIRS = +if USE_NLS +SUBDIRS += \ + po +endif +SUBDIRS += \ + @WITH_DB_SUBDIR@ \ + @WITH_ZLIB_SUBDIR@ \ + @WITH_PCRE_SUBDIR@ \ + @WITH_POPT_SUBDIR@ \ + @WITH_LUA_SUBDIR@ \ + @WITH_BEECRYPT_SUBDIR@ \ + @WITH_NEON_SUBDIR@ \ + @WITH_SPIDERMONKEY_SUBDIR@ \ + @WITH_GPSEE_SUBDIR@ \ + @WITH_LIBGIT2_SUBDIR@ \ + @WITH_FILE_SUBDIR@ \ + @WITH_BASH_SUBDIR@ \ + @WITH_RC_SUBDIR@ \ + @WITH_SYCK_SUBDIR@ \ + @WITH_XAR_SUBDIR@ \ + @WITH_XZ_SUBDIR@ \ + misc \ + rpmio \ + rpmdb \ + lib \ + build \ + rpmconstant \ + @WITH_JS_SUBDIR@ \ + @WITH_RUBY_SUBDIR@ \ + @WITH_PYTHON_SUBDIR@ \ + @WITH_PERL_SUBDIR@ \ + @WITH_PERL_URPM_SUBDIR@ \ + tools \ + scripts \ + doc \ + . \ + tests + +AM_CPPFLAGS = \ + -I$(srcdir) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/build \ + -I$(top_srcdir)/lib \ + -I$(top_builddir)/lib \ + -I$(top_srcdir)/rpmdb \ + -I$(top_srcdir)/rpmio \ + -I$(top_srcdir)/misc \ + @WITH_DB_CPPFLAGS@ \ + @WITH_ZLIB_CPPFLAGS@ \ + @WITH_LUA_CPPFLAGS@ \ + @WITH_FILE_CPPFLAGS@ \ + @WITH_PCRE_CPPFLAGS@ \ + @WITH_POPT_CPPFLAGS@ \ + @WITH_XAR_CPPFLAGS@ \ + @WITH_XZ_CPPFLAGS@ + +AM_CFLAGS = $(OPENMP_CFLAGS) + +myLDADD = \ + $(top_builddir)/build/librpmbuild.la \ + $(top_builddir)/lib/librpm.la \ + $(top_builddir)/rpmdb/librpmdb.la \ + $(top_builddir)/rpmio/librpmio.la \ + $(top_builddir)/misc/librpmmisc.la \ + @LTLIBINTL@ + +bin_PROGRAMS = rpm rpmbuild + +install-exec-hook: +if WITH_PATH_VERSIONED + -for p in $(bin_PROGRAMS); do \ + mv $(DESTDIR)$(bindir)/$${p}$(EXEEXT) \ + $(DESTDIR)$(bindir)/$${p}-$(VERSION)$(EXEEXT); \ + done +endif + +pkgdatadir = @USRLIBRPM@ +pkgdata_DATA = rpmpopt macros/macros macros/macros.rpmbuild cpuinfo.yaml + +pkgbindir = $(pkgdatadir)/bin +pkgbin_SCRIPTS = install-sh mkinstalldirs + +pkgcfgdir = $(pkgdatadir)/macros.d +pkgcfg_DATA = \ + macros/cmake macros/gstreamer macros/java macros/kernel macros/libtool \ + macros/mandriva macros/mono macros/perl macros/pkgconfig macros/php \ + macros/python macros/ruby macros/selinux macros/tcl + +noinst_HEADERS = build.h debug.h system.h + +rpm_SOURCES = $(top_srcdir)/build.c +rpm_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS) +rpm_LDADD = rpm.o $(myLDADD) +rpm.o: $(top_srcdir)/rpmqv.c + $(COMPILE) -DIAM_RPMBT -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV -o $@ -c $(top_srcdir)/rpmqv.c + +rpmbuild_SOURCES = $(top_srcdir)/build.c +rpmbuild_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS) +rpmbuild_LDADD = rpmbuild.o $(myLDADD) +rpmbuild.o: $(top_srcdir)/rpmqv.c + $(COMPILE) -DIAM_RPMBT -o $@ -c $(top_srcdir)/rpmqv.c + +.PHONY: splint +splint: + splint \ + -load build/rpmbuild.lcd \ + -load lib/rpmlib.lcd \ + -load rpmdb/rpmdb.lcd \ + -load rpmio/rpmio.lcd \ + -load popt/popt.lcd \ + $(DEFS) $(INCLUDES) rpmqv.c $(rpmbuild_SOURCES) + +.PHONY: lint +lint: + $(LINT) -Dlint $(DEFS) $(INCLUDES) rpmqv.c $(rpmbuild_SOURCES) \ + `make -s sources -C build` \ + `make -s sources -C lib` \ + `make -s sources -C rpmdb` \ + `make -s sources -C rpmio` \ + `make -s sources -C file/src` + +.PHONY: mccabe +mccabe: + @$(MCCABE) rpmqv.c $(rpmbuild_SOURCES) \ + `make -s sources -C build` \ + `make -s sources -C lib` \ + `make -s sources -C rpmdb` \ + `make -s sources -C rpmio` | sort -nr | head -n 30 + +.PHONY: updatepo +updatepo: + rsync -Lrtvz translationproject.org::tp/latest/rpm/ po + +CVSTAG = r$(subst .,-,$(VERSION)) + +pkgsrcdir = @PKGSRCDIR@ + +DBPATH = @DBPATH@ + +install-data-local: + @$(MKDIR_P) $(DESTDIR)$(DBPATH) + @$(MKDIR_P) $(DESTDIR)$(varprefix)/spool/repackage + @for dir in BUILD RPMS SOURCES SPECS SRPMS; do\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/$$dir;\ + done + @case "@host_cpu@" in \ + *86) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i386 ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i486 ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i586 ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i686 ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/athlon ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/pentium3 ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/pentium4 ;;\ + armv3l) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv3l ;;\ + armv4b) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4b ;;\ + armv4l) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv3l ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4l ;;\ + armv5teb) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4b ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5teb ;;\ + armv5tel) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv3l ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4l ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tel ;;\ + alpha*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/alpha ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/alphaev6 ;;\ + sparc*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv8 ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9 ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc64 ;;\ + ia64*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ia64 ;;\ + s390*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/s390 ;;\ + mipsel*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/mipsel ;;\ + mips*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/mips ;;\ + powerpc*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppciseries ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppcpseries ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64 ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64iseries ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64pseries ;;\ + *) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/@host_cpu@ ;;\ + esac + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/noarch + +check-local: + +.PHONY: tar +tar: + rm -rf /tmp/rpm-$(VERSION) + $(MAKE) DESTDIR=/tmp/rpm-$(VERSION) install + cd /tmp/rpm-$(VERSION) ; tar cvf /tmp/rpm-$(VERSION).tar . + +.PHONY: noconfig +noconfig: + find . -name "Makefile" -exec rm {} \; + rm -f *gz *rpm config.* + +.PHONY: archive +archive: + @cvs -d `cat CVS/Root` diff 2>&1 > /dev/null || { \ + echo " " ; \ + echo "==> Please resolve differences between the repository and" ; \ + echo "==> your rpm check out before tagging." ; \ + echo " " ; \ + cvs -n up ; \ + echo " " ; \ + exit 1 ; \ + } + @cvs -d `cat CVS/Root` -Q tag -F $(CVSTAG) . + @make dist + @echo " " + @echo "The final archive is ./rpm-$(VERSION).tar.gz." + +.PHONY: nextsrpm +nextsrpm: all archive + @sudo ./rpm -ta rpm-$(VERSION).tar.gz + +.PHONY: doxygen +doxygen @WITH_APIDOCS_TARGET@: Doxyfile rpmpopt macros/macros + rm -rf $@ + mkdir -p $@ + - [ X"@__DOXYGEN@" != Xno ] && @__DOXYGEN@ + +.PHONY: lcov-reset # run lcov from scratch, always +lcov-reset: + make lcov-run + make lcov-report + +# run lcov from scratch if the dir is not there +lcov: + make lcov-reset + +.PHONY: lcov-run # reset run coverage tests +lcov-run: + @-rm -rf lcov + find . -name "*.gcda" -exec rm {} \; + make check + +.PHONY: lcov-report # generate report based on current coverage data +lcov-report: + mkdir lcov + -lcov -d rpmio -d rpmdb -d lib -d build -d tools -d . --capture --output-file lcov/lcov.info + lcov -l lcov/lcov.info | grep -v "`cd $(top_srcdir) && pwd`" | cut -d: -f1 > lcov/remove + lcov -r lcov/lcov.info `cat lcov/remove` > lcov/lcov.cleaned.info + rm lcov/remove + mv lcov/lcov.cleaned.info lcov/lcov.info + genhtml -t "$(PACKAGE_STRING)" -o lcov lcov/lcov.info + +.PHONY: lcov-upload +lcov-upload: lcov + mkdir -p /var/ftp/pub/jbj/rpm-$(VERSION)-lcov + tar -C lcov -cf - . | (cd /var/ftp/pub/jbj/rpm-$(VERSION)-lcov; tar xf -) +# rsync -rvz -e ssh --delete lcov/* ??? + +cscope: + cscope -b -R + +cref: ctags cscope diff --git a/rpm-5.4.9/Makefile.in b/rpm-5.4.9/Makefile.in new file mode 100644 index 0000000..dbf8580 --- /dev/null +++ b/rpm-5.4.9/Makefile.in @@ -0,0 +1,1667 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ + +# Top level Makefile for rpm + + + + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +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@ +target_triplet = @target@ +@USE_NLS_TRUE@am__append_1 = \ +@USE_NLS_TRUE@ po + +bin_PROGRAMS = rpm$(EXEEXT) rpmbuild$(EXEEXT) +subdir = . +DIST_COMMON = README $(am__configure_deps) $(noinst_HEADERS) \ + $(srcdir)/Doxyfile.in $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/rpm.spec.in $(srcdir)/rpmpopt.in \ + $(top_srcdir)/configure $(top_srcdir)/macros/cmake.in \ + $(top_srcdir)/macros/fedora.in \ + $(top_srcdir)/macros/gstreamer.in $(top_srcdir)/macros/java.in \ + $(top_srcdir)/macros/kernel.in $(top_srcdir)/macros/libtool.in \ + $(top_srcdir)/macros/macros.in \ + $(top_srcdir)/macros/macros.rpmbuild.in \ + $(top_srcdir)/macros/mandriva.in $(top_srcdir)/macros/mono.in \ + $(top_srcdir)/macros/perl.in $(top_srcdir)/macros/php.in \ + $(top_srcdir)/macros/pkgconfig.in \ + $(top_srcdir)/macros/python.in $(top_srcdir)/macros/ruby.in \ + $(top_srcdir)/macros/selinux.in $(top_srcdir)/macros/suse.in \ + $(top_srcdir)/macros/tcl.in ABOUT-NLS COPYING.LIB INSTALL NEWS \ + TODO config.guess config.rpath config.sub depcomp install-sh \ + ltmain.sh missing mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = Doxyfile rpmpopt rpm.spec macros/macros \ + macros/macros.rpmbuild macros/cmake macros/gstreamer \ + macros/java macros/kernel macros/libtool macros/mandriva \ + macros/suse macros/fedora macros/mono macros/perl \ + macros/pkgconfig macros/php macros/python macros/ruby \ + macros/selinux macros/tcl +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgbindir)" \ + "$(DESTDIR)$(pkgcfgdir)" "$(DESTDIR)$(pkgdatadir)" +PROGRAMS = $(bin_PROGRAMS) +am_rpm_OBJECTS = build.$(OBJEXT) +rpm_OBJECTS = $(am_rpm_OBJECTS) +am__DEPENDENCIES_1 = $(top_builddir)/build/librpmbuild.la \ + $(top_builddir)/lib/librpm.la \ + $(top_builddir)/rpmdb/librpmdb.la \ + $(top_builddir)/rpmio/librpmio.la \ + $(top_builddir)/misc/librpmmisc.la +rpm_DEPENDENCIES = rpm.o $(am__DEPENDENCIES_1) +rpm_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(rpm_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_rpmbuild_OBJECTS = build.$(OBJEXT) +rpmbuild_OBJECTS = $(am_rpmbuild_OBJECTS) +rpmbuild_DEPENDENCIES = rpmbuild.o $(am__DEPENDENCIES_1) +rpmbuild_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(rpmbuild_LDFLAGS) \ + $(LDFLAGS) -o $@ +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; }; \ + } +SCRIPTS = $(pkgbin_SCRIPTS) +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(rpm_SOURCES) $(rpmbuild_SOURCES) +DIST_SOURCES = $(rpm_SOURCES) $(rpmbuild_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DATA = $(pkgcfg_DATA) $(pkgdata_DATA) +HEADERS = $(noinst_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = po @WITH_DB_SUBDIR@ @WITH_ZLIB_SUBDIR@ \ + @WITH_PCRE_SUBDIR@ @WITH_POPT_SUBDIR@ @WITH_LUA_SUBDIR@ \ + @WITH_BEECRYPT_SUBDIR@ @WITH_NEON_SUBDIR@ \ + @WITH_SPIDERMONKEY_SUBDIR@ @WITH_GPSEE_SUBDIR@ \ + @WITH_LIBGIT2_SUBDIR@ @WITH_FILE_SUBDIR@ @WITH_BASH_SUBDIR@ \ + @WITH_RC_SUBDIR@ @WITH_SYCK_SUBDIR@ @WITH_XAR_SUBDIR@ \ + @WITH_XZ_SUBDIR@ misc rpmio rpmdb lib build rpmconstant \ + @WITH_JS_SUBDIR@ @WITH_RUBY_SUBDIR@ @WITH_PYTHON_SUBDIR@ \ + @WITH_PERL_SUBDIR@ @WITH_PERL_URPM_SUBDIR@ tools scripts doc . \ + tests +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__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" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +pkgdatadir = @USRLIBRPM@ +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDROOTDIR_MACRO = @BUILDROOTDIR_MACRO@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBAPI = @DBAPI@ +DBLIBOBJS = @DBLIBOBJS@ +DBLIBSRCS = @DBLIBSRCS@ +DBPATH = @DBPATH@ +DBPATH_MACRO = @DBPATH_MACRO@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTRO_MACROS = @DISTRO_MACROS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIXPERMS = @FIXPERMS@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GPSEE_MODULES_PATH = @GPSEE_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_STATIC = @LDFLAGS_STATIC@ +LD_VERSION_SCRIPT_FLAG = @LD_VERSION_SCRIPT_FLAG@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOLIZE = @LIBTOOLIZE@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MACROFILES = @MACROFILES@ +MAGIC_MACRO = @MAGIC_MACRO@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR = @MKDIR@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NCPUS_COMMAND = @NCPUS_COMMAND@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENMP_CFLAGS = @OPENMP_CFLAGS@ +OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_INSTALLDIRS = @PERL_INSTALLDIRS@ +PERL_URPM_INSTALLDIRS = @PERL_URPM_INSTALLDIRS@ +PKGSRCDIR = @PKGSRCDIR@ +PKGSRCDIR_MACRO = @PKGSRCDIR_MACRO@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +ROOT_GROUP = @ROOT_GROUP@ +RPMCANONARCH = @RPMCANONARCH@ +RPMCANONCOLOR = @RPMCANONCOLOR@ +RPMCANONGNU = @RPMCANONGNU@ +RPMCANONOS = @RPMCANONOS@ +RPMCANONVENDOR = @RPMCANONVENDOR@ +RPMGID = @RPMGID@ +RPMGROUP = @RPMGROUP@ +RPMLUAFILES = @RPMLUAFILES@ +RPMPOPTFILES = @RPMPOPTFILES@ +RPMUID = @RPMUID@ +RPMUSER = @RPMUSER@ +RPM_TIMESTAMP = @RPM_TIMESTAMP@ +RPM_VENDOR = @RPM_VENDOR@ +RPM_VERSION = @RPM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFIGDIR = @SYSCONFIGDIR@ +USE_NLS = @USE_NLS@ +USRLIBRPM = @USRLIBRPM@ +VERSION = @VERSION@ +WITH_ACL = @WITH_ACL@ +WITH_APIDOCS = @WITH_APIDOCS@ +WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ +WITH_APR = @WITH_APR@ +WITH_ATERM = @WITH_ATERM@ +WITH_ATTR = @WITH_ATTR@ +WITH_AUGEAS = @WITH_AUGEAS@ +WITH_AUGEAS_AUGTOOL = @WITH_AUGEAS_AUGTOOL@ +WITH_BASH = @WITH_BASH@ +WITH_BASH_CPPFLAGS = @WITH_BASH_CPPFLAGS@ +WITH_BASH_LDFLAGS = @WITH_BASH_LDFLAGS@ +WITH_BASH_LIBS = @WITH_BASH_LIBS@ +WITH_BASH_SUBDIR = @WITH_BASH_SUBDIR@ +WITH_BEECRYPT = @WITH_BEECRYPT@ +WITH_BEECRYPT_CPPFLAGS = @WITH_BEECRYPT_CPPFLAGS@ +WITH_BEECRYPT_LDFLAGS = @WITH_BEECRYPT_LDFLAGS@ +WITH_BEECRYPT_LIBS = @WITH_BEECRYPT_LIBS@ +WITH_BEECRYPT_SUBDIR = @WITH_BEECRYPT_SUBDIR@ +WITH_BZIP2 = @WITH_BZIP2@ +WITH_CPUINFO = @WITH_CPUINFO@ +WITH_CUDF = @WITH_CUDF@ +WITH_CUDF_CUDFTOOL = @WITH_CUDF_CUDFTOOL@ +WITH_DB = @WITH_DB@ +WITH_DBSQL = @WITH_DBSQL@ +WITH_DBSQL_CPPFLAGS = @WITH_DBSQL_CPPFLAGS@ +WITH_DBSQL_LDFLAGS = @WITH_DBSQL_LDFLAGS@ +WITH_DBSQL_LIBS = @WITH_DBSQL_LIBS@ +WITH_DBSQL_SUBDIR = @WITH_DBSQL_SUBDIR@ +WITH_DB_CPPFLAGS = @WITH_DB_CPPFLAGS@ +WITH_DB_LDFLAGS = @WITH_DB_LDFLAGS@ +WITH_DB_LIBS = @WITH_DB_LIBS@ +WITH_DB_SUBDIR = @WITH_DB_SUBDIR@ +WITH_DMALLOC = @WITH_DMALLOC@ +WITH_EFENCE = @WITH_EFENCE@ +WITH_EXPAT = @WITH_EXPAT@ +WITH_FICL = @WITH_FICL@ +WITH_FICL_CPPFLAGS = @WITH_FICL_CPPFLAGS@ +WITH_FICL_LDFLAGS = @WITH_FICL_LDFLAGS@ +WITH_FICL_LIBS = @WITH_FICL_LIBS@ +WITH_FICL_SUBDIR = @WITH_FICL_SUBDIR@ +WITH_FILE = @WITH_FILE@ +WITH_FILE_CPPFLAGS = @WITH_FILE_CPPFLAGS@ +WITH_FILE_LDFLAGS = @WITH_FILE_LDFLAGS@ +WITH_FILE_LIBS = @WITH_FILE_LIBS@ +WITH_FILE_SUBDIR = @WITH_FILE_SUBDIR@ +WITH_GCRYPT = @WITH_GCRYPT@ +WITH_GNUTLS = @WITH_GNUTLS@ +WITH_GPSEE = @WITH_GPSEE@ +WITH_GPSEE_CPPFLAGS = @WITH_GPSEE_CPPFLAGS@ +WITH_GPSEE_LDFLAGS = @WITH_GPSEE_LDFLAGS@ +WITH_GPSEE_LIBS = @WITH_GPSEE_LIBS@ +WITH_GPSEE_SUBDIR = @WITH_GPSEE_SUBDIR@ +WITH_JS_SUBDIR = @WITH_JS_SUBDIR@ +WITH_KEYUTILS = @WITH_KEYUTILS@ +WITH_KEYUTILS_RPMKEY = @WITH_KEYUTILS_RPMKEY@ +WITH_LIBELF_DEBUGEDIT = @WITH_LIBELF_DEBUGEDIT@ +WITH_LIBGIT2 = @WITH_LIBGIT2@ +WITH_LIBGIT2_CPPFLAGS = @WITH_LIBGIT2_CPPFLAGS@ +WITH_LIBGIT2_LDFLAGS = @WITH_LIBGIT2_LDFLAGS@ +WITH_LIBGIT2_LIBS = @WITH_LIBGIT2_LIBS@ +WITH_LIBGIT2_SUBDIR = @WITH_LIBGIT2_SUBDIR@ +WITH_LIBTASN1 = @WITH_LIBTASN1@ +WITH_LUA = @WITH_LUA@ +WITH_LUA_CPPFLAGS = @WITH_LUA_CPPFLAGS@ +WITH_LUA_LDFLAGS = @WITH_LUA_LDFLAGS@ +WITH_LUA_LIBS = @WITH_LUA_LIBS@ +WITH_LUA_SUBDIR = @WITH_LUA_SUBDIR@ +WITH_LUA_SUBDIR_DEF = @WITH_LUA_SUBDIR_DEF@ +WITH_LUA_SUBDIR_LIB = @WITH_LUA_SUBDIR_LIB@ +WITH_MOZJS185 = @WITH_MOZJS185@ +WITH_MOZJS185_CPPFLAGS = @WITH_MOZJS185_CPPFLAGS@ +WITH_MOZJS185_LDFLAGS = @WITH_MOZJS185_LDFLAGS@ +WITH_MOZJS185_LIBS = @WITH_MOZJS185_LIBS@ +WITH_MOZJS185_SUBDIR = @WITH_MOZJS185_SUBDIR@ +WITH_NEON = @WITH_NEON@ +WITH_NEON_CPPFLAGS = @WITH_NEON_CPPFLAGS@ +WITH_NEON_LDFLAGS = @WITH_NEON_LDFLAGS@ +WITH_NEON_LIBS = @WITH_NEON_LIBS@ +WITH_NEON_SUBDIR = @WITH_NEON_SUBDIR@ +WITH_NIX = @WITH_NIX@ +WITH_NSS = @WITH_NSS@ +WITH_OPENSSL = @WITH_OPENSSL@ +WITH_PAKCHOIS = @WITH_PAKCHOIS@ +WITH_PATH_VERSIONED = @WITH_PATH_VERSIONED@ +WITH_PATH_VERSIONED_SUFFIX = @WITH_PATH_VERSIONED_SUFFIX@ +WITH_PCRE = @WITH_PCRE@ +WITH_PCRE_CPPFLAGS = @WITH_PCRE_CPPFLAGS@ +WITH_PCRE_LDFLAGS = @WITH_PCRE_LDFLAGS@ +WITH_PCRE_LIBS = @WITH_PCRE_LIBS@ +WITH_PCRE_SUBDIR = @WITH_PCRE_SUBDIR@ +WITH_PERLEMBED = @WITH_PERLEMBED@ +WITH_PERL_LIBS = @WITH_PERL_LIBS@ +WITH_PERL_SUBDIR = @WITH_PERL_SUBDIR@ +WITH_PERL_SUBPACKAGE = @WITH_PERL_SUBPACKAGE@ +WITH_PERL_URPM_LIBS = @WITH_PERL_URPM_LIBS@ +WITH_PERL_URPM_SUBDIR = @WITH_PERL_URPM_SUBDIR@ +WITH_PERL_URPM_SUBPACKAGE = @WITH_PERL_URPM_SUBPACKAGE@ +WITH_POPT = @WITH_POPT@ +WITH_POPT_CPPFLAGS = @WITH_POPT_CPPFLAGS@ +WITH_POPT_LDFLAGS = @WITH_POPT_LDFLAGS@ +WITH_POPT_LIBS = @WITH_POPT_LIBS@ +WITH_POPT_SUBDIR = @WITH_POPT_SUBDIR@ +WITH_PYTHONEMBED = @WITH_PYTHONEMBED@ +WITH_PYTHON_INCDIR = @WITH_PYTHON_INCDIR@ +WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ +WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ +WITH_RC = @WITH_RC@ +WITH_RC_CPPFLAGS = @WITH_RC_CPPFLAGS@ +WITH_RC_LDFLAGS = @WITH_RC_LDFLAGS@ +WITH_RC_LIBS = @WITH_RC_LIBS@ +WITH_RC_SUBDIR = @WITH_RC_SUBDIR@ +WITH_READLINE = @WITH_READLINE@ +WITH_RUBY = @WITH_RUBY@ +WITH_RUBY_CPPFLAGS = @WITH_RUBY_CPPFLAGS@ +WITH_RUBY_SUBDIR = @WITH_RUBY_SUBDIR@ +WITH_RUBY_VENDORARCHDIR = @WITH_RUBY_VENDORARCHDIR@ +WITH_SELINUX = @WITH_SELINUX@ +WITH_SEMANAGE = @WITH_SEMANAGE@ +WITH_SEMANAGE_SEMODULE = @WITH_SEMANAGE_SEMODULE@ +WITH_SEPOL = @WITH_SEPOL@ +WITH_SPIDERMONKEY_SUBDIR = @WITH_SPIDERMONKEY_SUBDIR@ +WITH_SQLITE = @WITH_SQLITE@ +WITH_SQLITE_CPPFLAGS = @WITH_SQLITE_CPPFLAGS@ +WITH_SQLITE_LDFLAGS = @WITH_SQLITE_LDFLAGS@ +WITH_SQLITE_LIBS = @WITH_SQLITE_LIBS@ +WITH_SQLITE_SUBDIR = @WITH_SQLITE_SUBDIR@ +WITH_SQUIRREL = @WITH_SQUIRREL@ +WITH_SUBVERSION = @WITH_SUBVERSION@ +WITH_SYCK = @WITH_SYCK@ +WITH_SYCK_CPPFLAGS = @WITH_SYCK_CPPFLAGS@ +WITH_SYCK_LDFLAGS = @WITH_SYCK_LDFLAGS@ +WITH_SYCK_LIBS = @WITH_SYCK_LIBS@ +WITH_SYCK_SUBDIR = @WITH_SYCK_SUBDIR@ +WITH_TCL = @WITH_TCL@ +WITH_TCL_SUBDIR = @WITH_TCL_SUBDIR@ +WITH_TOMCRYPT = @WITH_TOMCRYPT@ +WITH_TPM = @WITH_TPM@ +WITH_UNIXODBC = @WITH_UNIXODBC@ +WITH_UUID = @WITH_UUID@ +WITH_XAR = @WITH_XAR@ +WITH_XAR_CPPFLAGS = @WITH_XAR_CPPFLAGS@ +WITH_XAR_LDFLAGS = @WITH_XAR_LDFLAGS@ +WITH_XAR_LIBS = @WITH_XAR_LIBS@ +WITH_XAR_SUBDIR = @WITH_XAR_SUBDIR@ +WITH_XZ = @WITH_XZ@ +WITH_XZ_CPPFLAGS = @WITH_XZ_CPPFLAGS@ +WITH_XZ_LDFLAGS = @WITH_XZ_LDFLAGS@ +WITH_XZ_LIBS = @WITH_XZ_LIBS@ +WITH_XZ_SUBDIR = @WITH_XZ_SUBDIR@ +WITH_ZLIB = @WITH_ZLIB@ +WITH_ZLIB_CPPFLAGS = @WITH_ZLIB_CPPFLAGS@ +WITH_ZLIB_LDFLAGS = @WITH_ZLIB_LDFLAGS@ +WITH_ZLIB_LIBS = @WITH_ZLIB_LIBS@ +WITH_ZLIB_SUBDIR = @WITH_ZLIB_SUBDIR@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__BASH = @__BASH@ +__BZIP2 = @__BZIP2@ +__CAT = @__CAT@ +__CHATTR = @__CHATTR@ +__CHGRP = @__CHGRP@ +__CHGRP_RHF = @__CHGRP_RHF@ +__CHMOD = @__CHMOD@ +__CHOWN = @__CHOWN@ +__CHOWN_RHF = @__CHOWN_RHF@ +__CMAKE = @__CMAKE@ +__CPIO = @__CPIO@ +__CURL = @__CURL@ +__CVS = @__CVS@ +__DBSQL = @__DBSQL@ +__DB_ARCHIVE = @__DB_ARCHIVE@ +__DB_CHECKPOINT = @__DB_CHECKPOINT@ +__DB_DEADLOCK = @__DB_DEADLOCK@ +__DB_DUMP = @__DB_DUMP@ +__DB_HOTBACKUP = @__DB_HOTBACKUP@ +__DB_LOAD = @__DB_LOAD@ +__DB_LOG_VERIFY = @__DB_LOG_VERIFY@ +__DB_PRINTLOG = @__DB_PRINTLOG@ +__DB_RECOVER = @__DB_RECOVER@ +__DB_REPLICATE = @__DB_REPLICATE@ +__DB_SQL_CODEGEN = @__DB_SQL_CODEGEN@ +__DB_STAT = @__DB_STAT@ +__DB_TUNER = @__DB_TUNER@ +__DB_UPGRADE = @__DB_UPGRADE@ +__DB_VERIFY = @__DB_VERIFY@ +__DIFF = @__DIFF@ +__DITTO = @__DITTO@ +__DOXYGEN = @__DOXYGEN@ +__FILE = @__FILE@ +__GIT = @__GIT@ +__GPG = @__GPG@ +__GSR = @__GSR@ +__GST_INSPECT = @__GST_INSPECT@ +__GZIP = @__GZIP@ +__HG = @__HG@ +__ID = @__ID@ +__ID_U = @__ID_U@ +__INSTALL = @__INSTALL@ +__INSTALL_INFO = @__INSTALL_INFO@ +__LD = @__LD@ +__LDCONFIG = @__LDCONFIG@ +__LN = @__LN@ +__LRZIP = @__LRZIP@ +__LSATTR = @__LSATTR@ +__LZIP = @__LZIP@ +__LZMA = @__LZMA@ +__LZOP = @__LZOP@ +__MAKE = @__MAKE@ +__MKDIR = @__MKDIR@ +__MKDIR_P = @__MKDIR_P@ +__MODINFO = @__MODINFO@ +__MONGO = @__MONGO@ +__MV = @__MV@ +__NM = @__NM@ +__OBJCOPY = @__OBJCOPY@ +__OBJDUMP = @__OBJDUMP@ +__PATCH = @__PATCH@ +__PAX = @__PAX@ +__PERL = @__PERL@ +__PGP = @__PGP@ +__PHP = @__PHP@ +__PYTHON = @__PYTHON@ +__RM = @__RM@ +__RMDIR = @__RMDIR@ +__RSH = @__RSH@ +__RUBY = @__RUBY@ +__SED = @__SED@ +__SH = @__SH@ +__SQLITE3 = @__SQLITE3@ +__SSH = @__SSH@ +__STRIP = @__STRIP@ +__SVN = @__SVN@ +__TAR = @__TAR@ +__TCLSH = @__TCLSH@ +__UNZIP = @__UNZIP@ +__XZ = @__XZ@ +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_CXX = @ac_ct_CXX@ +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@ +autorelocate_dcolor = @autorelocate_dcolor@ +autorelocate_path = @autorelocate_path@ +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@ +exeext = @exeext@ +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@ +libext = @libext@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +objext = @objext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +shlibext = @shlibext@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +testdir = @testdir@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrprefix = @usrprefix@ +varprefix = @varprefix@ +AUTOMAKE_OPTIONS = 1.4 foreign +ACLOCAL_AMFLAGS = -I m4 +LINT = splint +MCCABE = pmccabe +EXTRA_DIST = CHANGES CREDITS Doxyheader INSTALL INSTALL.developer cpuinfo.yaml \ + autodeps autogen.sh \ + syck js \ + lua \ + ruby \ + macros \ + perl \ + pubkeys/JBJ-GPG-KEY \ + rpm.magic rpmqv.c \ + python \ + tests/arbitrarytag-1.0-1.src.rpm \ + tests/cudf-test-1-0.src.rpm \ + tests/devtool-sanity-1.0-1.src.rpm \ + tests/dir2symlink-1-1.src.rpm \ + tests/edos-test-1-0.src.rpm \ + tests/probes-test-1-0.src.rpm \ + tests/simplestRPMv3-1.0-2.aix5.3.noarch.rpm \ + tests/triggers-D-1.0-1.src.rpm \ + tests/triggers-DP-1.0-1.src.rpm \ + tests/triggers-F-1.0-1.src.rpm \ + tests/triggers-FP-1.0-1.src.rpm \ + tests/triggers-N-1.0-1.src.rpm \ + tests/triggers-NA-1.0-1.src.rpm \ + tests/triggers-P-1.0-1.src.rpm + +SUBDIRS = $(am__append_1) @WITH_DB_SUBDIR@ @WITH_ZLIB_SUBDIR@ \ + @WITH_PCRE_SUBDIR@ @WITH_POPT_SUBDIR@ @WITH_LUA_SUBDIR@ \ + @WITH_BEECRYPT_SUBDIR@ @WITH_NEON_SUBDIR@ \ + @WITH_SPIDERMONKEY_SUBDIR@ @WITH_GPSEE_SUBDIR@ \ + @WITH_LIBGIT2_SUBDIR@ @WITH_FILE_SUBDIR@ @WITH_BASH_SUBDIR@ \ + @WITH_RC_SUBDIR@ @WITH_SYCK_SUBDIR@ @WITH_XAR_SUBDIR@ \ + @WITH_XZ_SUBDIR@ misc rpmio rpmdb lib build rpmconstant \ + @WITH_JS_SUBDIR@ @WITH_RUBY_SUBDIR@ @WITH_PYTHON_SUBDIR@ \ + @WITH_PERL_SUBDIR@ @WITH_PERL_URPM_SUBDIR@ tools scripts doc . \ + tests +AM_CPPFLAGS = \ + -I$(srcdir) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/build \ + -I$(top_srcdir)/lib \ + -I$(top_builddir)/lib \ + -I$(top_srcdir)/rpmdb \ + -I$(top_srcdir)/rpmio \ + -I$(top_srcdir)/misc \ + @WITH_DB_CPPFLAGS@ \ + @WITH_ZLIB_CPPFLAGS@ \ + @WITH_LUA_CPPFLAGS@ \ + @WITH_FILE_CPPFLAGS@ \ + @WITH_PCRE_CPPFLAGS@ \ + @WITH_POPT_CPPFLAGS@ \ + @WITH_XAR_CPPFLAGS@ \ + @WITH_XZ_CPPFLAGS@ + +AM_CFLAGS = $(OPENMP_CFLAGS) +myLDADD = \ + $(top_builddir)/build/librpmbuild.la \ + $(top_builddir)/lib/librpm.la \ + $(top_builddir)/rpmdb/librpmdb.la \ + $(top_builddir)/rpmio/librpmio.la \ + $(top_builddir)/misc/librpmmisc.la \ + @LTLIBINTL@ + +pkgdata_DATA = rpmpopt macros/macros macros/macros.rpmbuild cpuinfo.yaml +pkgbindir = $(pkgdatadir)/bin +pkgbin_SCRIPTS = install-sh mkinstalldirs +pkgcfgdir = $(pkgdatadir)/macros.d +pkgcfg_DATA = \ + macros/cmake macros/gstreamer macros/java macros/kernel macros/libtool \ + macros/mandriva macros/mono macros/perl macros/pkgconfig macros/php \ + macros/python macros/ruby macros/selinux macros/tcl + +noinst_HEADERS = build.h debug.h system.h +rpm_SOURCES = $(top_srcdir)/build.c +rpm_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS) +rpm_LDADD = rpm.o $(myLDADD) +rpmbuild_SOURCES = $(top_srcdir)/build.c +rpmbuild_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS) +rpmbuild_LDADD = rpmbuild.o $(myLDADD) +CVSTAG = r$(subst .,-,$(VERSION)) +pkgsrcdir = @PKGSRCDIR@ +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +rpmpopt: $(top_builddir)/config.status $(srcdir)/rpmpopt.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +rpm.spec: $(top_builddir)/config.status $(srcdir)/rpm.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +macros/macros: $(top_builddir)/config.status $(top_srcdir)/macros/macros.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +macros/macros.rpmbuild: $(top_builddir)/config.status $(top_srcdir)/macros/macros.rpmbuild.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +macros/cmake: $(top_builddir)/config.status $(top_srcdir)/macros/cmake.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +macros/gstreamer: $(top_builddir)/config.status $(top_srcdir)/macros/gstreamer.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +macros/java: $(top_builddir)/config.status $(top_srcdir)/macros/java.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +macros/kernel: $(top_builddir)/config.status $(top_srcdir)/macros/kernel.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +macros/libtool: $(top_builddir)/config.status $(top_srcdir)/macros/libtool.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +macros/mandriva: $(top_builddir)/config.status $(top_srcdir)/macros/mandriva.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +macros/suse: $(top_builddir)/config.status $(top_srcdir)/macros/suse.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +macros/fedora: $(top_builddir)/config.status $(top_srcdir)/macros/fedora.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +macros/mono: $(top_builddir)/config.status $(top_srcdir)/macros/mono.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +macros/perl: $(top_builddir)/config.status $(top_srcdir)/macros/perl.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +macros/pkgconfig: $(top_builddir)/config.status $(top_srcdir)/macros/pkgconfig.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +macros/php: $(top_builddir)/config.status $(top_srcdir)/macros/php.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +macros/python: $(top_builddir)/config.status $(top_srcdir)/macros/python.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +macros/ruby: $(top_builddir)/config.status $(top_srcdir)/macros/ruby.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +macros/selinux: $(top_builddir)/config.status $(top_srcdir)/macros/selinux.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +macros/tcl: $(top_builddir)/config.status $(top_srcdir)/macros/tcl.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 +rpm$(EXEEXT): $(rpm_OBJECTS) $(rpm_DEPENDENCIES) $(EXTRA_rpm_DEPENDENCIES) + @rm -f rpm$(EXEEXT) + $(rpm_LINK) $(rpm_OBJECTS) $(rpm_LDADD) $(LIBS) +rpmbuild$(EXEEXT): $(rpmbuild_OBJECTS) $(rpmbuild_DEPENDENCIES) $(EXTRA_rpmbuild_DEPENDENCIES) + @rm -f rpmbuild$(EXEEXT) + $(rpmbuild_LINK) $(rpmbuild_OBJECTS) $(rpmbuild_LDADD) $(LIBS) +install-pkgbinSCRIPTS: $(pkgbin_SCRIPTS) + @$(NORMAL_INSTALL) + @list='$(pkgbin_SCRIPTS)'; test -n "$(pkgbindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgbindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgbindir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | 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; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$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_SCRIPT) $$files '$(DESTDIR)$(pkgbindir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgbindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-pkgbinSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(pkgbin_SCRIPTS)'; test -n "$(pkgbindir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(pkgbindir)'; $(am__uninstall_files_from_dir) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/build.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +build.o: $(top_srcdir)/build.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT build.o -MD -MP -MF $(DEPDIR)/build.Tpo -c -o build.o `test -f '$(top_srcdir)/build.c' || echo '$(srcdir)/'`$(top_srcdir)/build.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/build.Tpo $(DEPDIR)/build.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/build.c' object='build.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o build.o `test -f '$(top_srcdir)/build.c' || echo '$(srcdir)/'`$(top_srcdir)/build.c + +build.obj: $(top_srcdir)/build.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT build.obj -MD -MP -MF $(DEPDIR)/build.Tpo -c -o build.obj `if test -f '$(top_srcdir)/build.c'; then $(CYGPATH_W) '$(top_srcdir)/build.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/build.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/build.Tpo $(DEPDIR)/build.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/build.c' object='build.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o build.obj `if test -f '$(top_srcdir)/build.c'; then $(CYGPATH_W) '$(top_srcdir)/build.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/build.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-pkgcfgDATA: $(pkgcfg_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgcfg_DATA)'; test -n "$(pkgcfgdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgcfgdir)'"; \ + $(MKDIR_P) '$(DESTDIR)$(pkgcfgdir)' || 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)$(pkgcfgdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgcfgdir)" || exit $$?; \ + done + +uninstall-pkgcfgDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgcfg_DATA)'; test -n "$(pkgcfgdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgcfgdir)'; $(am__uninstall_files_from_dir) +install-pkgdataDATA: $(pkgdata_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \ + $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)' || 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)$(pkgdatadir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ + done + +uninstall-pkgdataDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgdatadir)'; $(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. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(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" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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 +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(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 + -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) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(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*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + 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 \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @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-local +check: check-recursive +all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA) $(HEADERS) config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgbindir)" "$(DESTDIR)$(pkgcfgdir)" "$(DESTDIR)$(pkgdatadir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf ./$(DEPDIR) + -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-data-local install-pkgbinSCRIPTS \ + install-pkgcfgDATA install-pkgdataDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf ./$(DEPDIR) + -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-pkgbinSCRIPTS \ + uninstall-pkgcfgDATA uninstall-pkgdataDATA + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check-am \ + ctags-recursive install-am install-exec-am install-strip \ + tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am check-local clean \ + clean-binPROGRAMS clean-generic clean-libtool ctags \ + ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-lzip \ + dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ + distclean distclean-compile distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-binPROGRAMS install-data \ + install-data-am install-data-local install-dvi install-dvi-am \ + install-exec install-exec-am install-exec-hook install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pkgbinSCRIPTS \ + install-pkgcfgDATA install-pkgdataDATA install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-pkgbinSCRIPTS \ + uninstall-pkgcfgDATA uninstall-pkgdataDATA + + +install-exec-hook: +@WITH_PATH_VERSIONED_TRUE@ -for p in $(bin_PROGRAMS); do \ +@WITH_PATH_VERSIONED_TRUE@ mv $(DESTDIR)$(bindir)/$${p}$(EXEEXT) \ +@WITH_PATH_VERSIONED_TRUE@ $(DESTDIR)$(bindir)/$${p}-$(VERSION)$(EXEEXT); \ +@WITH_PATH_VERSIONED_TRUE@ done +rpm.o: $(top_srcdir)/rpmqv.c + $(COMPILE) -DIAM_RPMBT -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV -o $@ -c $(top_srcdir)/rpmqv.c +rpmbuild.o: $(top_srcdir)/rpmqv.c + $(COMPILE) -DIAM_RPMBT -o $@ -c $(top_srcdir)/rpmqv.c + +.PHONY: splint +splint: + splint \ + -load build/rpmbuild.lcd \ + -load lib/rpmlib.lcd \ + -load rpmdb/rpmdb.lcd \ + -load rpmio/rpmio.lcd \ + -load popt/popt.lcd \ + $(DEFS) $(INCLUDES) rpmqv.c $(rpmbuild_SOURCES) + +.PHONY: lint +lint: + $(LINT) -Dlint $(DEFS) $(INCLUDES) rpmqv.c $(rpmbuild_SOURCES) \ + `make -s sources -C build` \ + `make -s sources -C lib` \ + `make -s sources -C rpmdb` \ + `make -s sources -C rpmio` \ + `make -s sources -C file/src` + +.PHONY: mccabe +mccabe: + @$(MCCABE) rpmqv.c $(rpmbuild_SOURCES) \ + `make -s sources -C build` \ + `make -s sources -C lib` \ + `make -s sources -C rpmdb` \ + `make -s sources -C rpmio` | sort -nr | head -n 30 + +.PHONY: updatepo +updatepo: + rsync -Lrtvz translationproject.org::tp/latest/rpm/ po + +install-data-local: + @$(MKDIR_P) $(DESTDIR)$(DBPATH) + @$(MKDIR_P) $(DESTDIR)$(varprefix)/spool/repackage + @for dir in BUILD RPMS SOURCES SPECS SRPMS; do\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/$$dir;\ + done + @case "@host_cpu@" in \ + *86) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i386 ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i486 ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i586 ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i686 ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/athlon ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/pentium3 ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/pentium4 ;;\ + armv3l) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv3l ;;\ + armv4b) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4b ;;\ + armv4l) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv3l ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4l ;;\ + armv5teb) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4b ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5teb ;;\ + armv5tel) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv3l ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4l ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tel ;;\ + alpha*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/alpha ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/alphaev6 ;;\ + sparc*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv8 ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9 ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc64 ;;\ + ia64*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ia64 ;;\ + s390*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/s390 ;;\ + mipsel*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/mipsel ;;\ + mips*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/mips ;;\ + powerpc*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppciseries ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppcpseries ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64 ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64iseries ;\ + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64pseries ;;\ + *) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/@host_cpu@ ;;\ + esac + $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/noarch + +check-local: + +.PHONY: tar +tar: + rm -rf /tmp/rpm-$(VERSION) + $(MAKE) DESTDIR=/tmp/rpm-$(VERSION) install + cd /tmp/rpm-$(VERSION) ; tar cvf /tmp/rpm-$(VERSION).tar . + +.PHONY: noconfig +noconfig: + find . -name "Makefile" -exec rm {} \; + rm -f *gz *rpm config.* + +.PHONY: archive +archive: + @cvs -d `cat CVS/Root` diff 2>&1 > /dev/null || { \ + echo " " ; \ + echo "==> Please resolve differences between the repository and" ; \ + echo "==> your rpm check out before tagging." ; \ + echo " " ; \ + cvs -n up ; \ + echo " " ; \ + exit 1 ; \ + } + @cvs -d `cat CVS/Root` -Q tag -F $(CVSTAG) . + @make dist + @echo " " + @echo "The final archive is ./rpm-$(VERSION).tar.gz." + +.PHONY: nextsrpm +nextsrpm: all archive + @sudo ./rpm -ta rpm-$(VERSION).tar.gz + +.PHONY: doxygen +doxygen @WITH_APIDOCS_TARGET@: Doxyfile rpmpopt macros/macros + rm -rf $@ + mkdir -p $@ + - [ X"@__DOXYGEN@" != Xno ] && @__DOXYGEN@ + +.PHONY: lcov-reset # run lcov from scratch, always +lcov-reset: + make lcov-run + make lcov-report + +# run lcov from scratch if the dir is not there +lcov: + make lcov-reset + +.PHONY: lcov-run # reset run coverage tests +lcov-run: + @-rm -rf lcov + find . -name "*.gcda" -exec rm {} \; + make check + +.PHONY: lcov-report # generate report based on current coverage data +lcov-report: + mkdir lcov + -lcov -d rpmio -d rpmdb -d lib -d build -d tools -d . --capture --output-file lcov/lcov.info + lcov -l lcov/lcov.info | grep -v "`cd $(top_srcdir) && pwd`" | cut -d: -f1 > lcov/remove + lcov -r lcov/lcov.info `cat lcov/remove` > lcov/lcov.cleaned.info + rm lcov/remove + mv lcov/lcov.cleaned.info lcov/lcov.info + genhtml -t "$(PACKAGE_STRING)" -o lcov lcov/lcov.info + +.PHONY: lcov-upload +lcov-upload: lcov + mkdir -p /var/ftp/pub/jbj/rpm-$(VERSION)-lcov + tar -C lcov -cf - . | (cd /var/ftp/pub/jbj/rpm-$(VERSION)-lcov; tar xf -) +# rsync -rvz -e ssh --delete lcov/* ??? + +cscope: + cscope -b -R + +cref: ctags cscope + +# 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/rpm-5.4.9/NEWS b/rpm-5.4.9/NEWS new file mode 100644 index 0000000..9e433ee --- /dev/null +++ b/rpm-5.4.9/NEWS @@ -0,0 +1,207 @@ + + NEWS + ==== + + This is a list of the major changes between RPM 4 and RPM 5. + For more details please see the CHANGES file. + + New in RPM 5.3 + -------------- + + o New Features: + + - All packages produced by rpmbuild now have a DSA pubkey/signature + + New in RPM 5.1 + -------------- + + o Major Bufixes: + - .spec: fix PGP clearsign signature() verification by correctly skipping RFC2440 "dash-escapes" + - macro: permit %{lua:...} to recurse. + - macro: fix line-continuation handling in macro definition parsing + - macro: fix macro option/argument parsing (again), this time by using POPT_CONTEXT_POSIXMEHARDER + + o New Features: + - "rpmrepo" + - "rpmdigest" + - "rpmgrep" + - "rpmmtree" + - ":sqlescape" for use in SQL statements generated by --qf. + - ":utf8" for use with ":cdata" format + - ":cdata" to permit strings to be included in XML CDATA. + - .spec: verify(N) = E:V-R, verify(*) and verify(/path) runtime dependency probes + - CLI new RPM CLI options --noautoreq/--noautoprov + - CLI: "+N-V-R.A" path-to-repository expansions with -i/-U + - CLI: "-N-V-R.A" erasure args within install/upgrade transactions + - CLI: proof-of-concept "rpmbuild --lsb" implementation + - build: new Autoconf option --with-path-rpmlua and RPM CLI option --rpmlua for configuring RPM Lua init script path + - macro: OSSP uuid support via RPM Lua functions uuid.generate() and uuid.describe() + - macro: new "%{uuid:[[, , ]]}" for generating UUIDs of version 1, 3, 4 or 5 + - macro: new %{getenv:} to lookup environment variables + - macro: new %{shrink:} macro for removing leading+trailing and removing intermediate whitespaces + - macro: new RPM Lua function posix.glob() + - macro: new RPM Lua function rpm.realpath() to complement RPM macro %{realpath:} + - macro: new RPM Lua function rpm.sleep() + - macro: new RPM Lua function rpm.slurp() for slurping in the whole content of a file or an URL + - macro: new RPM Lua function util.textwrap() for auto-wrapping junks of larger text messages + - macro: unconditionally provide RPM Lua functions posix.{setenv,unsetenv} + - rpmdb: new tags ORIGIN{TID,TIME} which record the first INSTALL{TID,TIME} of a package + - rpmlib: function rpmuuidMake() for generating UUIDs of version 1, 3, 4 or 5 + - rpmlib: permit opt-in network access using %_rpmgio macro. + - rpmlib: support for CPIO, TAR and AR payloads + - API: RPM 4 compatibility layer + - macro: permit %{___NVRA} to parameterize the displayed NVRA while installing. + + o Upgrades: + - macro: upgraded from Lua 5.1.2 to 5.1.3 + - macro: upgraded RPM Lua extension lrexlib from ancient version 1.1x to version 2.2 + - build: upgraded build environment to use GNU libtool 2.2.2 + + o Incompatibilities: + - rpmdb: use "struct timeval" timestamp for INSTALL{TID,TIME} and ORIGIN{TID,TIME} + + o Portability: + - build: QNX platform support + + New in RPM 5.0 + -------------- + + o Project Environment: + The official RPM code base was relocated from rpm.org to rpm5.org + and a completely new project environment was established around it, + including anonymous repository browsing access, new mailing lists, + etc. + + o Source Tree: + The RPM source tree was cleaned up by pruning many old and obsolete + files, removing dangling symbolic links, relocating sub-directories + and fixing timestamps and other versioning meta-data which got + broken over 10 years of RPM development. + + o Build Environment: + The Automake/Autoconf/Libtool-based build environment of RPM was + completely revamped. Especially the Autoconf parts were finally + cleaned up from the ground up, including basing the use of all + third-party libraries on a new sophisticated Autoconf macro + "RPM_CHECK_LIB". As a result most third-party libraries now can be + linked externally, too. + + o Development Environment: + For being able to build RPM under arbitrary Unix platforms despite + the fact that RPM needs a larger number of third-party libraries, + the "devtool" environment and its "standalone" script is provided. + This allows RPM developers to build RPM from scratch under arbitrary + Unix platforms in a rather self-contained environment. + + o Greatly Improved Portability: + RPM 5 was ported to all major Unix platforms as of 2007, including + BSD, Linux and Solaris flavors. It was successfully built (with the + above "devtool" "standalone") on at least the following particular + Unix platforms (including Mac OS X "Darwin" and Windows "Cygwin"): + ix86-freebsd6.2-gcc4.2.0 + ix86-freebsd6.2-gcc4.3.0s20070713 + ix86-freebsd6.2-gcc3.4 + amd64-freebsd6.2-gcc4.1.2 + ix86-freebsd7.0-gcc4.1.2 + ia64-freebsd6.2-gcc4.1.2 + ix86-fedora7-gcc4.2.0 + ix86-fedora7-sunstudio12 + ix86-fedora7-icc10.0 + ix86-debian3.1-gcc4.1.2 + ix86-debian4.0-gcc4.2.0 + ix86-rhel4-gcc4.1.2 + ix86-solaris9-gcc4.1.2 + sparc64-solaris8-gcc4.1.2 + sparc64-solaris9-gcc4.1.2 + sparc64-solaris10-gcc4.1.2 + amd64-solaris10-gcc4.1.2 + ppc-macosx10.4-gcc4.0.1 + ix86-macosx10.4-gcc4.0.1 + ppc-aix5.3-gcc3.3.2 + ix86-cygwin_nt5.1-gcc3.4.4 + + o Mac OS X Cross Development: + RPM 5 can now be built for all recent versions of Mac OS X, with + detection of Python.framework and with Universal Binary support + (both PowerPC and Intel architectures in a single binary file). The + Mac OS X version will install in /usr/local and /var/local. It will + work with the following versions of the OS and/or SDK, using the + above devtool and with the target name quoted below: + Mac OS X 10.x "macosx" - build native version + Mac OS X 10.3 "panther" - PowerPC (MacOSX10.3.9.sdk) + Mac OS X 10.4 "tiger" - PowerPC and Intel (MacOSX10.4u.sdk) + Mac OS X 10.5 "leopard" - PowerPC and Intel (MacOSX10.5.sdk) + + o Source Code Cleanups: + The RPM source base was completely cleaned up. As a result RPM now + builds fully warnings-free under all major Unix platforms with GCC. + Additionally, RPM now can be built without problems with the Sun + Studio and Intel C/C++ compilers, too. + + o Third-Party Library Upgrades: + RPM now is able to build against the latest versions of all + third-party libraries. Additionally, the internal copies of + third-party libraries were also upgraded to the latest versions, + including Berkeley-DB 4.6.21, Lua 5.1.2, XAR 1.5.2, etc. + + o RPM Database: + The RPM database (RPMDB) now out-of-the-box supports both + Berkeley-DB and SQLite. The SQLite support was greatly improved, but + nevertheless inherently still lacks some features of the Berkeley-DB + RPMDB. Nevertheless, one can build RPM with an SQLite-only + RPMDB, too. But this is not officially supported. It is just an + experimental developer feature. + + o Compression: + The RPM packages support both Bzip2 and LZMA payloads, in addition + to the default Gzip compression format. Support for LZMA_Alone with + rpmio was added, with the lzma syntax upgraded to newer LZMA Utils. + + o "rpmrc" and Platform Detections: + Support for the old "rpmrc" (which was used mainly for architecture + mappings, etc) was completely removed. Everything is now configured + through RPM "macros" only. Additionally, the internal C-based + platform detections were completely removed, too. + + o XAR Format Support: + Initial support for the XML Archive (XAR) file format was added + to RPM. The initial implementation establishes a wrapper archive + format for mapping the 4 sections used in *.rpm package file (Lead, + Signature, Header and Payload) to files with the same name in a XAR + archive wrapper. A wrapper archive to carry package sections is + already used by Apple Leopard *.pkg (using XAR) and Debian *.deb + packages (using AR), rpm-5.0 now has a well defined representation + of *.rpm packages in a wrapper archive format. Establishing a direct + mapping between rpm tags and XAR attributes/properties in XML in + order to fully use the extensibility of an XAR archive will be + attempted for RPM 5.1. + + o Removed RPMv3 Package Format Support: + The support for the old RPMv3 (LSB) package format was removed to + cleanup and simplify the code base. RPM 5 now supports RPMv4 package + format only. + + o Additional Specification Features: + A larger set of additional features or provided for use in package + specifications (.spec): new tag "Class" for quality assurance + based classification, new section "%track" for vcheck(1) based + upstream vendor source version tracking, new section "%sanitycheck" + for sanity checking the run-time of a package by performing + run-time tests, etc. Additionally, RPM can be configured via + macro %{_arbitrary_tags_arbitrary_tags} to support so-called + "arbitrary tags" -- this allows one to attach custom information + with an RPM package. Finally, the macro processor now supports the + "%{@:}" syntax for expanding all values from the + macro stack of a macro by concatenating the values with + . + + o Additional Command Line Interface (CLI) Features: + The CLI supports additional options, including "-bt" for executing + the new "%track" section (the step logically coming before "-bp"), + "--undefine ''" for reversing the effect of "--define + ' '", etc. + + o Application Programming Interface (API) Changes: + There were various RPM C API changes. See CHANGES file for more + details. + diff --git a/rpm-5.4.9/README b/rpm-5.4.9/README new file mode 100644 index 0000000..d944d05 --- /dev/null +++ b/rpm-5.4.9/README @@ -0,0 +1,22 @@ +This is RPM, the RPM Package Manager. + +The latest releases are always available at: + + http://rpm5.org/files/rpm/ + +Additional RPM documentation (papers, slides, HOWTOs) as well as +mailing lists for users and developers can be found at: + + http://rpm5.org/ + +The RPM Package Manager was originally written in 1997 by: + + Erik Troan + Marc Ewing + +See the CREDITS file for a list of folks who have helped out +tremendously. + +RPM may be distributed under the terms of the LGPL 2.1 license (see the +file COPYING.LIB for details). + diff --git a/rpm-5.4.9/TODO b/rpm-5.4.9/TODO new file mode 100644 index 0000000..de1a58f --- /dev/null +++ b/rpm-5.4.9/TODO @@ -0,0 +1,162 @@ + + TODO + ==== + + KNOWN PENDING ISSUES + -------------------- + + This is the list of known pending issues which still *HAVE* to be + resolved during release engineering. Please do not just list any + *CANDO* items. + + - jbj: make a complete pass through rpm.org check-ins and make sure they + have exactly zero "features" that are not already in rpm-5.0. With + full attribution of course ... + - jbj: finish Requires: sanitycheck(N) = E:V-R runtime probe. + - jbj: finish BuildRequires: vcheck(N) = E:V-R runtime probe. + - jbj: write up added featlets/bugtures in %docdir notes. + - jbj: handle SourceN: foo-V-R.src.rpm unpacking. + - jbj: fix (or at least document) the /sbin/ldconfig optimization flaw. + - jbj: finish --trust with --import (or punt to 5.1). + - jbj: add build script templates for install scriptlets (or punt to 5.1). + - jbj: change RPM_I18NSTRING_TYPE wiring to use arbitrary tag. + - jbj: markReplacedFiles() subtly rewrites header back into rpmdb + with altered RPMTAG_FILESTATES data. get/del/add sequence + is needed instead. + - jbj: VSFlags (and --nodigest/--nosignature) is now global rather than + persistently per-transaction. That means its no longer possible to + have two transactions, one which verifies signatures while the other + does not. Per-transaction VSFlags never made much sense imho, but + some may care. Establishing a end-user, not a per-application or + per-transaction, package integrity/security policy is the only + rational end-point. + - jbj: there's a buildroot compatibility issue that needs to be addressed + in (at least) doco. The problem is common to rpm-4_5 and HEAD. + Issue at + http://qa.mandriva.com/show_bug.cgi?id=34705 + - jbj: Heh, --import has *always* used the wrong data type for + Summary/Description/Group. The header that carries the pubkey + lacks RPMTAG_ARCH/RPMTAG_OS as well. Re-importing all pubkeys is + one solution, but perhaps a "just works" slam-dunk hack is needed + during --rebuildb, or with header extensions. When this issue is + resolved, then rpm can/should use implicit, rather than explicit, data + types for tag data. + - jbj: add libTomCrypt signature verification. + - jbj: add per-implementation crypto hashes. + - jbj: add per-implementation symmetric ciphers. + - jbj: permit per-file encryption with password caching through keyutils. + - jbj: generalize the Leopard XAR format to ar (as in *.deb), tar, and cpio. + - afb: add read-only support for 070707 cpio so we can piggy-back on pkg + - jbj: eliminate the oddball *.src.rpm paths, nuke rpmInstallSourcePackage. + - jbj: VPATH-like generalization to fold-in splitted-source-directory patch. + - jbj: add per file RPMTAG_ENTROPY a la Shannon to start making the choice + of compression scheme computible. + - jbj: explicitly compute sums of header and package sizes to help + distro maintainers understand their cdrom/dvd and memory footprint + needs. + - jbj: split rpmtsRun() into 2 pieces, moving the file resolution + computation into its own method. + - jbj: redesign the bleeping callback, which is good for nothing but pushing + script kiddie progress bars across the screen. + - jbj: arbitrary "%foo -p /bar" scriptlets as pair'ed RPMTAG_{FOO,FOOPROG}. + - jbj: arbitrary triggers, like scriptlets, but with a condition check too. + - jbj: the hash *ahem* algorithm at rpmdb/fprint.c:186 fpHashFunction() is + pathetic. FYI, the fingerprint hash is in the top 10 pigs when + profiling rpm installs, so better has immediate performance benefits. + rpmio/lookup3.c is possibly better. The other important usage case + is restructuring the multi-level add package "provides" lookup in + lib/rpmal.c (but that likely needs to be thrown into a Berkeley DB + table to minimize memory footprint). + - jbj: using qsort to insure that nearly sorted lists of join keys in + an rpmdb remain sorted is stoopid: quicksort on nearly sorted lists + is slower than alternative implementations like mergesort. + - jbj: eliminate internal --initdb (useless) and --verifydb (peculier + to Berkeley DB and adequately/equivalently achievable with db_verify). + - jbj: NSS has many memory leaks that are not free'd by NSS_Shutdown(). + - jbj: this leak needs fixing somewhen: +==3436== 12 bytes in 1 blocks are definitely lost in loss record 3 of 9 +==3436== at 0x4805525: malloc (vg_replace_malloc.c:149) +==3436== by 0x4934365: argvSplit (argv.c:207) +==3436== by 0x48F89F9: tagLoadATags (tagname.c:31) +==3436== by 0x48F969E: _tagValue (tagname.c:361) +==3436== by 0x48F9805: tagValue (tagname.c:403) +==3436== by 0x48878F9: rpmdsSysinfo (rpmds.c:1600) +==3436== by 0x48A5BDE: rpmtsCreate (rpmts.c:1302) +==3436== by 0x3EFA: main (rpmqv.c:540) + - jbj: eliminate %patch-as-macro-in-C implementation. + - jbj: convert unused syntax (like Disttag:/Repotag:/Cvsid:) to arbitrary tags + - jbj: convert %prep/%build/%install/%check/%clean to arbitrary srpm tags. + - jbj: use devtool.sh as a model for an arbitrary state machine that + runs arbitrary scripts in deterministic order, checking error codes. + Rewrite rpmbuild.c accordingly. + - jbj: hmmm, arbitrary Foo: (except for Class:) ends up in binary *.rpm's, + while %foo (like %track) ends up in *.src.rpm's. I'll pretend that's + a feature until a means to more precisely specify arbitrary tag + copying into binary/source rpm's is devised. + - jbj: rpm --help using popt-1.13 with non-utf8 needs some work. + POPT_fprintf using iconv(3) is the common element so far. + - jbj: MacPorts is going to universal binaries (the Mac OS X equivalent + of multilib) with a "fat" arch in *.rpm packages. Better can be done, + including insturmenting running lipo(1) automagically during install. + - jbj: build/build.c doScript() was a crack-soaked proof-of-concept build + system script invoker with macro templates that I threw together on + a Saturday afternoon in November, 1999. Noone has ever bothered to + rewrite the goop sadly, far better could and should be done. + - jbj: users continually expect the ability to create "noarch" subpkgs even + though rpm has only a single build (and arch is a constant for that build). + Permitting noarch subpkgs is no more complicated than applying an + explict sanity check that, indeed, the subpkg contents are "noarch". + - jbj: both --yaml and --xml are in need of QA regression tests. + 2 of 1300 packages fail to YAML load correctly. One of the + failure cases was irregular white space in %description, + the other case involved RPM_I18NSTRING_TYPE. + - jbj: XOR operator needed, such that Requires: LSB ^ !LSB has valid + truth table + - jbj: RFE: capture arbitrary 'defines' from the ENV, and the invocation + command line, each to end up in binary *.rpm's to show more of build + time options + - jbj: rewrite pgpReadPkts to return array of clearsign'd segments instead. + - jbj: teach argvSplit about escaped seperator characters. + - jasonc: spec file parser: one cannot represent a "odd" file path in a + Provides such as: + Provides: /path/with spaces/and,commas/foo.bar + currently because both spaces and commas can be used to indicate + multiple provides entries (Mac OS X is great at finding these types of + "problems") + - rse: XAR 1.5.2 doesn't build under Solaris 10 as and the + BSD4.4 fts(3) API is completely missing there. + - jbj: "make dist" no workie with XAR internal. layering in automake is + preferred way forward. + - jbj: /usr/lib64 is reported not expanded into rpm.pc pkgconfig fle and + ___init.py___. + - jbj: distributing per-platform configuration needs to be done. At a minimum, + the cpu-os.macros.tar.gz file needs distributing with the rpm tarball. + - jbj: verify whether RPMv3 installs (or not). + - jbj: use txar to convert RPMv3 -> rpmv4 (headerReload needs adding). + - jbj: configure --parentdirs/--noparentdirs win persistent run-time macro + and stop discussing in public. + - jbj: permit building w/o changelogs. instead use a header extension to + pull changelogs from a URL, with a default of + file:///usr/share/doc/N-V/Changelog + Use YAML for extra credit. + - jbj: verify(...) probe likely needs to supply _SOME_ information for + failure cases, at least with -vv. + - jbj: verify(...) with prelinking likely needs more "stuff" in QVA_t: +D: rpmdb: read h# 512 Header V3 DSA signature: OK, key ID 1ac70ce6 +prelink: Couldn't write file to standard output: Broken pipe + - jbj: handle +bing -bang =boom args within rpmgi.c. + + + + + RPM 5.2 ROADMAP ISSUES + ---------------------- + - jbj: drill in "+foo" ports-like find the real store by prefixing + secret sauce path. Its wired into --install/--upggrade only to + minimize risk. a small refactoring moves same to rpmgi ... + where it becomes available for --query, so rpm -qT --aid +bash + has a prayer of constructing the minimal transaction to install bash. + - jbj: ever better would be to add "=bash" token to construct (and + loop check) the minimal transaction to install bash using headers + from rpmdb. -- added as a aide to memory per IRC thread + diff --git a/rpm-5.4.9/acinclude.m4 b/rpm-5.4.9/acinclude.m4 new file mode 100644 index 0000000..7bf0eb3 --- /dev/null +++ b/rpm-5.4.9/acinclude.m4 @@ -0,0 +1,832 @@ +dnl ## +dnl ## acinclude.m4 -- manually provided local Autoconf macros +dnl ## + +dnl ## +dnl ## NAME: +dnl ## AC_MSG_TITLE -- Display a configuration title +dnl ## +dnl ## USAGE: +dnl ## AC_MSG_TITLE(, ) +dnl ## + +AC_DEFUN([AC_MSG_TITLE],[ + _AS_ECHO([Configuring $1, Version $2]) +]) + +dnl ## +dnl ## NAME: +dnl ## AC_MSG_HEADER -- Display a configuration header +dnl ## +dnl ## USAGE: +dnl ## AC_MSG_HEADER() +dnl ## + +AC_DEFUN([AC_MSG_HEADER],[ + _AS_ECHO([]) + _AS_ECHO([=== $1 ===]) +]) + +dnl ## +dnl ## NAME: +dnl ## AC_MSG_VERBOSE -- Display a message under --verbose +dnl ## +dnl ## USAGE: +dnl ## AC_MSG_VERBOSE() +dnl ## + +AC_DEFUN([AC_MSG_VERBOSE], [ + if test ".$verbose" = .yes; then + _AS_ECHO([$1]) + fi +]) + +dnl ## +dnl ## NAME: +dnl ## RPM_CHECK_LIB -- Check for third-party libraries +dnl ## +dnl ## COPYRIGHT +dnl ## Copyright (c) 2007 Ralf S. Engelschall +dnl ## +dnl ## DESCRIPTION: +dnl ## This is a rather complex Autoconf macro for sophisticated +dnl ## checking the availability of third-party libraries and +dnl ## extending the build environment for correctly building +dnl ## against it. +dnl ## +dnl ## It especially supports the following particular features: +dnl ## - is aware of old-style [lib]-config style scripts +dnl ## - is aware of new-style pkg-config(1) [lib].pc configuration files +dnl ## - searches under standard sub-directories "include", "lib", etc. +dnl ## - searches under arbitrary sub-areas of a tree like ".libs", etc. +dnl ## - searches in standard system locations (implicitly) +dnl ## - supports searching for function in multiple libraries +dnl ## - supports searching for multiple headers +dnl ## - supports multiple search locations (fallbacks!) +dnl ## +dnl ## USAGE: +dnl ## - configure.in: +dnl ## RPM_CHECK_LIB( +dnl ## , -- [$1] e.g. GNU bzip2 +dnl ## , -- [$2] e.g. bzip2 +dnl ## , -- [$3] e.g. bz2 +dnl ## , -- [$4] e.g. BZ2_bzlibVersion +dnl ## , -- [$5] e.g. bzlib.h +dnl ## [, -- [$6] e.g. yes,external:internal:none +dnl ## [, -- [$7] e.g. lib/bzip2:include:src +dnl ## [, -- [$8] e.g. AC_DEFINE(USE_BZIP2, 1, [...]) +dnl ## -- [$9] e.g. AC_MSG_ERROR([...]) +dnl ## ]]]) +dnl ## +dnl ## - Makefile.in: +dnl ## top_srcdir = @top_srcdir@ +dnl ## srcdir = @srcdir@ +dnl ## WITH_ = @WITH_@ +dnl ## WITH__SUBDIR = @WITH__SUBDIR@ +dnl ## CPPFLAGS = @CPPFLAGS@ +dnl ## CFLAGS = @CFLAGS@ +dnl ## LDFLAGS = @LDFLAGS@ +dnl ## LIBS = @LIBS@ +dnl ## +dnl ## - CLI: +dnl ## $ ./configure \ +dnl ## --with-[=] +dnl ## [...] +dnl ## +dnl ## SYNTAX: +dnl ## ::= | +dnl ## ::= "," +dnl ## ::= "yes" | "no" +dnl ## ::= ":" +dnl ## | +dnl ## | "system" +dnl ## | "external" +dnl ## | "internal" +dnl ## | "none" +dnl ## ::= [...] /* valid arg for test(1) option "-d" */ +dnl ## +dnl ## + +dnl # public API macro +AC_DEFUN([RPM_CHECK_LIB], [ + dnl ## + dnl ## PROLOG + dnl ## + + dnl # parse into default enable mode and default locations + m4_define([__rcl_default_enable], [m4_substr([$6], 0, m4_index([$6], [,]))]) + m4_define([__rcl_default_locations], [m4_substr([$6], m4_eval(m4_index([$6], [,]) + 1))]) + + dnl # provide defaults + if test ".${with_$2+set}" != .set; then + dnl # initialize to default enable mode + with_$2="__rcl_default_enable" + AC_MSG_VERBOSE([++ assuming --with-$2=$with_$2]) + fi + if test ".${with_$2}" = .yes; then + dnl # map simple "--with-foo=yes" to an enabled default location path + with_$2="__rcl_default_locations" + AC_MSG_VERBOSE([++ mapping --with-$2=yes to --with-$2="$with_$2"]) + fi + + dnl ## + dnl ## HANDLING + dnl ## + + __rcl_result_hint="" + __rcl_location_$2="" + __rcl_location_last="" + m4_if([$7],,, [ + WITH_[]m4_translit([$2],[a-z],[A-Z])[]_SUBDIR="" + WITH_[]m4_translit([$2],[a-z],[A-Z])[]_CPPFLAGS="" + WITH_[]m4_translit([$2],[a-z],[A-Z])[]_LDFLAGS="" + WITH_[]m4_translit([$2],[a-z],[A-Z])[]_LIBS="" + ]) + AC_ARG_WITH($2, + AS_HELP_STRING([--with-$2=ARG], [build with $1 library (__rcl_default_enable) (location path: "__rcl_default_locations")]), [dnl + if test ".${with_$2}" != .no; then + dnl # iterate over location path specification for searching purposes + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_$2}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + AC_MSG_VERBOSE([++ searching location: ${__rcl_location}]) + if test ".${__rcl_location}" = .none; then + dnl # no operation in loop, ignore failure later, too. + AC_MSG_VERBOSE([-- no operation]) + m4_if([$7],,, [ elif test ".${__rcl_location}" = .internal; then + dnl # optional support for feature + m4_define([__rcl_subdir], + [m4_if(m4_index([$7], [:]), -1, [$7], + m4_substr([$7], 0, m4_index([$7], [:])))]) + if test -d ${srcdir}/__rcl_subdir; then + AC_MSG_VERBOSE([-- activating local sub-directory: __rcl_subdir]) + if test -f ${srcdir}/__rcl_subdir/configure; then + AC_CONFIG_SUBDIRS(__rcl_subdir) + fi + dnl # NOTICE: an internal copy of the third-party library is a tricky thing + dnl # because for the following two major reasons we cannot just extend + dnl # CPPFLAGS, LDFLAGS and LIBS in this case: + dnl # 1. at _this_ "configure" time at least the library file (libfoo.a) + dnl # is still not existing, so extending LIBS with "-lfoo" would cause + dnl # following Autoconf checks to fail. + dnl # 2. even deferring the extension of LIBS doesn't work, because although + dnl # this works around the problem under (1), it will fail if more than + dnl # one internal third-party library exists: LIBS would contains "-lfoo + dnl # -lbar" and if build "foo", "bar" usually still isn't built (or vice + dnl # versa). Hence, the linking of programs (tools, tests, etc) in "foo" + dnl # would fail. + dnl # 3. information in at least LDFLAGS and LIBS is usually passed-through + dnl # to applications via xxx-config(1) scripts or pkg-config(1) + dnl # specifications. As the path to the internal copy is usually just a + dnl # temporary path, this will break there, too. + dnl # So, internal copies of third-party libraries inherently have to be + dnl # handled explicitly by the build environment and for this we can only + dnl # provide the necessary information in dedicated per-library variables. + WITH_]m4_translit([$2],[a-z],[A-Z])[_SUBDIR="__rcl_subdir" + __rcl_location_$2=internal + AC_MSG_VERBOSE([++ post-adjustments for --with-$2 (${__rcl_location_$2})]) + __rcl_dirs_inc=`echo '$7' | sed -e 's/^[[^:]]*://' -e 's/:[[^:]]*[$]//'` + __rcl_dirs_lib=`echo '$7' | sed -e 's/^[[^:]]*:[[^:]]*://'` + __rcl_srcdir="\[$](top_srcdir)/\[$](WITH_[]m4_translit([$2],[a-z],[A-Z])[]_SUBDIR)" + __rcl_builddir="\[$](top_builddir)/\[$](WITH_[]m4_translit([$2],[a-z],[A-Z])[]_SUBDIR)" + __rcl_firstlib="m4_if(m4_index([$3], [ ]), -1, [$3], m4_substr([$3], 0, m4_index([$3], [ ])))" + if test ".${__rcl_dirs_inc}" != ".$7"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + AC_MSG_VERBOSE([-- extending WITH_[]m4_translit([$2],[a-z],[A-Z])[]_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}]) + WITH_[]m4_translit([$2],[a-z],[A-Z])[]_CPPFLAGS="${WITH_[]m4_translit([$2],[a-z],[A-Z])[]_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + AC_MSG_VERBOSE([-- extending WITH_[]m4_translit([$2],[a-z],[A-Z])[]_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}]) + WITH_[]m4_translit([$2],[a-z],[A-Z])[]_CPPFLAGS="${WITH_[]m4_translit([$2],[a-z],[A-Z])[]_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + AC_MSG_VERBOSE([-- extending WITH_[]m4_translit([$2],[a-z],[A-Z])[]_CPPFLAGS: -I${__rcl_srcdir}]) + WITH_[]m4_translit([$2],[a-z],[A-Z])[]_CPPFLAGS="${WITH_[]m4_translit([$2],[a-z],[A-Z])[]_CPPFLAGS} -I${__rcl_srcdir}" + AC_MSG_VERBOSE([-- extending WITH_[]m4_translit([$2],[a-z],[A-Z])[]_CPPFLAGS: -I${__rcl_builddir}]) + WITH_[]m4_translit([$2],[a-z],[A-Z])[]_CPPFLAGS="${WITH_[]m4_translit([$2],[a-z],[A-Z])[]_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".$7"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + AC_MSG_VERBOSE([-- extending WITH_[]m4_translit([$2],[a-z],[A-Z])[]_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}]) + WITH_[]m4_translit([$2],[a-z],[A-Z])[]_LDFLAGS="${WITH_[]m4_translit([$2],[a-z],[A-Z])[]_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + AC_MSG_VERBOSE([-- extending WITH_[]m4_translit([$2],[a-z],[A-Z])[]_LDFLAGS: -L${__rcl_builddir}]) + WITH_[]m4_translit([$2],[a-z],[A-Z])[]_LDFLAGS="${WITH_[]m4_translit([$2],[a-z],[A-Z])[]_LDFLAGS} -L${__rcl_builddir}" + AC_MSG_VERBOSE([-- extending WITH_[]m4_translit([$2],[a-z],[A-Z])[]_LIBS: -l${__rcl_firstlib}]) + WITH_[]m4_translit([$2],[a-z],[A-Z])[]_LIBS="${WITH_[]m4_translit([$2],[a-z],[A-Z])[]_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory __rcl_subdir" + break + else + AC_MSG_VERBOSE([-- skipping not existing local sub-directory: __rcl_subdir]) + fi + ]) + elif test ".${__rcl_location}" = .external; then + dnl # detection of library in arbitrary external location + if (pkg-config --exists $2 || pkg-config --exists lib$2) 2>/dev/null; then + dnl # via pkg-config(1) script in PATH + m4_define([__rcl_query_pkgconfig], [ + __rcl_flags="" + for __rcl_query in $][2; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `($][1 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`($][1 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + AC_MSG_VERBOSE(-- extending $][3: ${__rcl_flags}) + $][3="${$][3} ${__rcl_flags}" + fi + ]) + if (pkg-config --exists $2) 2>/dev/null; then + __rcl_query_pkgconfig([pkg-config $2], [--cflags-only-other], [CFLAGS]) + __rcl_query_pkgconfig([pkg-config $2], [--cflags-only-I], [CPPFLAGS]) + __rcl_query_pkgconfig([pkg-config $2], [--libs-only-L --libs-only-other], [LDFLAGS]) + __rcl_query_pkgconfig([pkg-config $2], [--libs-only-l], [LIBS]) + __rcl_result_hint="external: via pkg-config $2" + else + __rcl_query_pkgconfig([pkg-config lib$2], [--cflags-only-other], [CFLAGS]) + __rcl_query_pkgconfig([pkg-config lib$2], [--cflags-only-I], [CPPFLAGS]) + __rcl_query_pkgconfig([pkg-config lib$2], [--libs-only-L --libs-only-other], [LDFLAGS]) + __rcl_query_pkgconfig([pkg-config lib$2], [--libs-only-l], [LIBS]) + __rcl_result_hint="external: via pkg-config lib$2" + fi + break + elif test ".`($2-config --version; lib$2-config --version) 2>/dev/null`" != .; then + dnl # via config script in PATH + m4_define([__rcl_query_config], [ + __rcl_flags="`($][1 $][2) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + AC_MSG_VERBOSE(-- extending $][3: ${__rcl_flags}) + $][3="${$][3} ${__rcl_flags}" + fi + ]) + if test ".`($2-config --version) 2>/dev/null`" != .; then + __rcl_query_config([$2-config], [--cppflags], [CPPFLAGS]) + __rcl_query_config([$2-config], [--cflags], [CFLAGS]) + __rcl_query_config([$2-config], [--ldflags], [LDFLAGS]) + __rcl_query_config([$2-config], [--libs], [LIBS]) + __rcl_result_hint="external: via $2-config" + else + __rcl_query_config([lib$2-config], [--cppflags], [CPPFLAGS]) + __rcl_query_config([lib$2-config], [--cflags], [CFLAGS]) + __rcl_query_config([lib$2-config], [--ldflags], [LDFLAGS]) + __rcl_query_config([lib$2-config], [--libs], [LIBS]) + __rcl_result_hint="external: via lib$2-config" + fi + break + elif test ".${__rcl_found}" = .no; then + dnl # via implicit flags attribution of previous checks or + dnl # in standard system locations (usually /usr/include and /usr/lib) + __rcl_found_hdr=no + __rcl_found_lib=no + AC_PREPROC_IFELSE([AC_LANG_SOURCE([@%:@include <$5>])], [ __rcl_found_hdr=yes ]) + m4_foreach_w([__rcl_lib], [$3], [ + __rcl_safe_LIBS="${LIBS}" + LIBS="-l[]m4_defn([__rcl_lib]) ${LIBS}" + AC_LINK_IFELSE([AC_LANG_CALL([], [$4])], [ __rcl_found_lib=yes ]) + LIBS="${__rcl_safe_LIBS}" + ]) + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + dnl # detection of library in external locations controlled + dnl # by explicit build flags or in standard system locations + dnl # (usually /usr/include and /usr/lib) + __rcl_found_hdr=no + __rcl_found_lib=no + AC_PREPROC_IFELSE([AC_LANG_SOURCE([@%:@include <$5>])], [ __rcl_found_hdr=yes ]) + m4_foreach_w([__rcl_lib], [$3], [ + __rcl_safe_LIBS="${LIBS}" + LIBS="-l[]m4_defn([__rcl_lib]) ${LIBS}" + AC_LINK_IFELSE([AC_LANG_CALL([], [$4])], [ __rcl_found_lib=yes ]) + LIBS="${__rcl_safe_LIBS}" + ]) + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + dnl # detection of library in particular external location + __rcl_found=no + dnl # via config script + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/$2-config" && test ! -f "${__rcl_dir}/$2-config.in"; then + if test ".`(${__rcl_dir}/$2-config --version) 2>/dev/null`" != .; then + __rcl_query_config([${__rcl_dir}/$2-config], [--cppflags], [CPPFLAGS]) + __rcl_query_config([${__rcl_dir}/$2-config], [--cflags], [CFLAGS]) + __rcl_query_config([${__rcl_dir}/$2-config], [--ldflags], [LDFLAGS]) + __rcl_query_config([${__rcl_dir}/$2-config], [--libs], [LIBS]) + __rcl_result_hint="external: via ${__rcl_dir}/$2-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/lib$2-config" && test ! -f "${__rcl_dir}/lib$2-config.in"; then + if test ".`(${__rcl_dir}/lib$2-config --version) 2>/dev/null`" != .; then + __rcl_query_config([${__rcl_dir}/lib$2-config], [--cppflags], [CPPFLAGS]) + __rcl_query_config([${__rcl_dir}/lib$2-config], [--cflags], [CFLAGS]) + __rcl_query_config([${__rcl_dir}/lib$2-config], [--ldflags], [LDFLAGS]) + __rcl_query_config([${__rcl_dir}/lib$2-config], [--libs], [LIBS]) + __rcl_result_hint="external: via ${__rcl_dir}/lib$2-config" + __rcl_found=yes + break + fi + fi + done + dnl # via pkg-config(1) script + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists $2) 2>/dev/null; then + __rcl_query_pkgconfig([${__rcl_dir}/pkg-config $2], [--cflags-only-other], [CFLAGS]) + __rcl_query_pkgconfig([${__rcl_dir}/pkg-config $2], [--cflags-only-I], [CPPFLAGS]) + __rcl_query_pkgconfig([${__rcl_dir}/pkg-config $2], [--libs-only-L --libs-only-other], [LDFLAGS]) + __rcl_query_pkgconfig([${__rcl_dir}/pkg-config $2], [--libs-only-l], [LIBS]) + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config $2" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists lib$2) 2>/dev/null; then + __rcl_query_pkgconfig([${__rcl_dir}/pkg-config lib$2], [--cflags-only-other], [CFLAGS]) + __rcl_query_pkgconfig([${__rcl_dir}/pkg-config lib$2], [--cflags-only-I], [CPPFLAGS]) + __rcl_query_pkgconfig([${__rcl_dir}/pkg-config lib$2], [--libs-only-L --libs-only-other], [LDFLAGS]) + __rcl_query_pkgconfig([${__rcl_dir}/pkg-config lib$2], [--libs-only-l], [LIBS]) + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config lib$2" + __rcl_found=yes + break + fi + fi + done + fi + dnl # in standard sub-areas + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/$2 ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/$5"; then + if test ".${__rcl_dir}" != "./usr/include"; then + AC_MSG_VERBOSE([-- extending CPPFLAGS: -I${__rcl_dir}]) + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/$2 ${__rcl_location}/lib ${__rcl_location}; do + m4_foreach_w([__rcl_lib], [$3], [ + if test -f "${__rcl_dir}/lib[]m4_defn([__rcl_lib]).la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + AC_MSG_VERBOSE([-- extending LDFLAGS: -L${__rcl_dir}]) + AC_MSG_VERBOSE([-- extending LDFLAGS: -L${__rcl_dir}/.libs]) + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/lib[]m4_defn([__rcl_lib]).a" || \ + test -f "${__rcl_dir}/lib[]m4_defn([__rcl_lib]).so" || \ + test -f "${__rcl_dir}/lib[]m4_defn([__rcl_lib]).sl" || \ + test -f "${__rcl_dir}/lib[]m4_defn([__rcl_lib]).dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + AC_MSG_VERBOSE([-- extending LDFLAGS: -L${__rcl_dir}]) + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + ]) + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + dnl # in any sub-area + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "$5" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[[^/]]*[$];;' -e 's;\(.\)/[$];\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + AC_MSG_VERBOSE([-- extending CPPFLAGS: -I${__rcl_dir}]) + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + m4_foreach_w([__rcl_lib], [$3], [ + for __rcl_file in _ `find ${__rcl_location} -name "lib[]m4_defn([__rcl_lib]).*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[[^/]]*[$];;' -e 's;\(.\)/[$];\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + AC_MSG_VERBOSE([-- extending LDFLAGS: -L${__rcl_dir}]) + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + ]) + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + AC_MSG_ERROR([Unknown location specification $__rcl_location]) + fi + done + IFS="${__rcl_IFS}" + + dnl # check for actual availability of library + m4_if([$7],,, [ if test ".${__rcl_location_last}" = .internal; then + dnl # special case: still not existing "internal" library + dnl # cannot be checked (and usually has not to be checked anyway) + with_$2=yes + if test ".${__rcl_location_$2}" != .internal; then + AC_MSG_ERROR([unable to find internal $1 library]) + fi + else ]) + dnl # regular case: use standard Autoconf facilities + dnl # and try to make sure both header and library is found + __rcl_found=yes + dnl # check for C header (in set of optionally multiple possibilities) + AC_CHECK_HEADERS([$5], [], [ __rcl_found=no ]) + dnl # check for C library (in set of optionally multiple possibilities) + __rcl_found_lib=no + m4_foreach_w([__rcl_lib], [$3], [ + AC_CHECK_LIB(m4_defn([__rcl_lib]), [$4]) + dnl # manually check for success (do not use third argument to AC_CHECK_LIB + dnl # here as this would no longer set the LIBS variable (the default action) + test ".${m4_translit(ac_cv_lib_[]m4_defn([__rcl_lib])_$4,[.-,],[___])}" = .yes && __rcl_found_lib=yes + ]) + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + dnl # determine final results + with_$2=${__rcl_found} + m4_if([$7],,, [ fi ]) + if test ".${with_$2}" = .yes && test ".${__rcl_result_hint}" = .; then + dnl # was not found explicitly via searching above, but + dnl # implicitly in standard location or via extended + dnl # flags from previous searches + __rcl_result_hint="external: implicitly" + fi + fi + ]) + + dnl ## + dnl ## EPILOG + dnl ## + + dnl # provide results + if test ".${with_$2}" = .yes; then + AC_DEFINE([WITH_]m4_translit([$2],[a-z],[A-Z]), 1, [Define as 1 if building with $1 library]) + fi + [WITH_]m4_translit([$2],[a-z],[A-Z])="${with_$2}" + AC_SUBST([WITH_]m4_translit([$2],[a-z],[A-Z])) + m4_if([$7],,, [ + AC_SUBST([WITH_]m4_translit([$2],[a-z],[A-Z])[_SUBDIR]) + AC_SUBST([WITH_]m4_translit([$2],[a-z],[A-Z])[_CPPFLAGS]) + AC_SUBST([WITH_]m4_translit([$2],[a-z],[A-Z])[_LDFLAGS]) + AC_SUBST([WITH_]m4_translit([$2],[a-z],[A-Z])[_LIBS]) + ]) + + dnl # report results + AC_MSG_CHECKING(whether to build with $1 library) + __rcl_msg="${with_$2}" + if test ".${with_$2}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + AC_MSG_RESULT([${__rcl_msg}]) + + dnl # perform actions + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_$2}" = .yes; then + AC_DEFINE([WITH_]m4_translit([$2],[a-z],[A-Z]), 1, [Define as 1 if building with $1 library]) + dnl # support optional + AC_MSG_VERBOSE([++ executing success action]) + m4_if([$8],, :, [$8]) + else + dnl # support optional + AC_MSG_VERBOSE([++ executing failure action]) + m4_if([$9],, [ + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + AC_MSG_ERROR([unable to find usable $1 library]) + fi + ], [$9]) + fi + ${as_unset} RPM_CHECK_LIB_LOCATION +]) + +dnl ## +dnl ## NAME: +dnl ## AC_CHECK_VA_COPY -- Check for C99 va_copy +dnl ## +dnl ## COPYRIGHT +dnl ## Copyright (c) 2006 Ralf S. Engelschall +dnl ## +dnl ## DESCRIPTION: +dnl ## This macro checks for C99 va_copy() implementation and +dnl ## provides fallback implementation if neccessary. Notice: this +dnl ## check is rather complex because first because we really have +dnl ## to try various possible implementations in sequence and +dnl ## second, we cannot define a macro in config.h with parameters +dnl ## directly. +dnl ## +dnl ## USAGE: +dnl ## configure.in: +dnl ## AC_CHECK_VA_COPY +dnl ## foo.c: +dnl ## #include "config.h" +dnl ## [...] +dnl ## va_copy(d,s) +dnl ## + +dnl # test program for va_copy() implementation +changequote(<<,>>) +m4_define(__va_copy_test, <<[ +#include +#include +#include +#define DO_VA_COPY(d, s) $1 +void test(char *str, ...) +{ + va_list ap, ap2; + int i; + va_start(ap, str); + DO_VA_COPY(ap2, ap); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + DO_VA_COPY(ap, ap2); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + va_end(ap); +} +int main(int argc, char *argv[]) +{ + test("test", 1, 2, 3, 4, 5, 6, 7, 8, 9); + exit(0); +} +]>>) +changequote([,]) + +dnl # test driver for va_copy() implementation +m4_define(__va_copy_check, [ + AH_VERBATIM($1, +[/* Predefined possible va_copy() implementation (id: $1) */ +#define __VA_COPY_USE_$1(d, s) $2]) + if test ".$ac_cv_va_copy" = .; then + AC_RUN_IFELSE([AC_LANG_SOURCE(AC_LANG_SOURCE([[__va_copy_test($2)]]))],[ac_cv_va_copy="$1"],[],[]) + fi +]) + +dnl # Autoconf check for va_copy() implementation checking +AC_DEFUN([AC_CHECK_VA_COPY],[ + dnl # provide Autoconf display check message + AC_MSG_CHECKING(for va_copy() function) + dnl # check for various implementations in priorized sequence + AC_CACHE_VAL(ac_cv_va_copy, [ + ac_cv_va_copy="" + dnl # 1. check for standardized C99 macro + __va_copy_check(C99, [va_copy((d), (s))]) + dnl # 2. check for alternative/deprecated GCC macro + __va_copy_check(GCM, [VA_COPY((d), (s))]) + dnl # 3. check for internal GCC macro (high-level define) + __va_copy_check(GCH, [__va_copy((d), (s))]) + dnl # 4. check for internal GCC macro (built-in function) + __va_copy_check(GCB, [__builtin_va_copy((d), (s))]) + dnl # 5. check for assignment approach (assuming va_list is a struct) + __va_copy_check(ASS, [do { (d) = (s); } while (0)]) + dnl # 6. check for assignment approach (assuming va_list is a pointer) + __va_copy_check(ASP, [do { *(d) = *(s); } while (0)]) + dnl # 7. check for memory copying approach (assuming va_list is a struct) + __va_copy_check(CPS, [memcpy((void *)&(d), (void *)&(s), sizeof((s)))]) + dnl # 8. check for memory copying approach (assuming va_list is a pointer) + __va_copy_check(CPP, [memcpy((void *)(d), (void *)(s), sizeof(*(s)))]) + if test ".$ac_cv_va_copy" = .; then + AC_MSG_ERROR([no working implementation found]) + fi + ]) + dnl # optionally activate the fallback implementation + if test ".$ac_cv_va_copy" = ".C99"; then + AC_DEFINE(HAVE_VA_COPY, 1, [Define if va_copy() macro exists (and no fallback implementation is required)]) + fi + dnl # declare which fallback implementation to actually use + AC_DEFINE_UNQUOTED([__VA_COPY_USE], [__VA_COPY_USE_$ac_cv_va_copy], + [Define to id of used va_copy() implementation]) + dnl # provide activation hook for fallback implementation + AH_VERBATIM([__VA_COPY_ACTIVATION], +[/* Optional va_copy() implementation activation */ +#ifndef HAVE_VA_COPY +#define va_copy(d, s) __VA_COPY_USE(d, s) +#endif +]) + dnl # provide Autoconf display result message + if test ".$ac_cv_va_copy" = ".C99"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no (using fallback implementation)]) + fi +]) + +dnl ## +dnl ## NAME: +dnl ## AC_CHECK_STATFS -- Check for "struct statfs" and friends +dnl ## + +AC_DEFUN([AC_CHECK_STATFS], [ + dnl # 1. search for struct statfs + AC_MSG_CHECKING(for struct statfs) + found_struct_statfs=no + if test ".$found_struct_statfs" = .no; then + dnl # Solaris 2.6+ wants to use "statvfs" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#include + ]], [[ + struct statvfs sfs; + ]]) + ], [ + AC_MSG_RESULT(in ) + AC_DEFINE(STATFS_IN_SYS_STATVFS, 1, [statfs in (for Solaris 2.6+ systems)]) + found_struct_statfs=yes + ], []) + fi + if test ".$found_struct_statfs" = .no; then + dnl # Linux: first try including + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#include + ]], [[ + struct statfs sfs; + ]]) + ],[ + AC_MSG_RESULT(in ) + AC_DEFINE(STATFS_IN_SYS_VFS, 1, [statfs in (for Linux systems)]) + found_struct_statfs=yes + ], []) + fi + if test ".$found_struct_statfs" = .no; then + dnl # ...next try including + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_PARAM_H +#include +#endif +#include + ]], [[ + struct statfs sfs; + ]]) + ],[ + AC_MSG_RESULT(in ) + AC_DEFINE(STATFS_IN_SYS_MOUNT, 1, [statfs in (for Digital Unix 4.0D systems)]) + found_struct_statfs=yes + ], []) + fi + if test ".$found_struct_statfs" = Xno; then + dnl ...still no joy. Try + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#include + ]], [[ + struct statfs sfs; + ]]) + ], [ + AC_MSG_RESULT(in ) + AC_DEFINE(STATFS_IN_SYS_STATFS, 1, [statfs in (for IRIX 6.4 systems)]) + found_struct_statfs=yes + ], []) + fi + if test ".$found_struct_statfs" = .no; then + dnl # ...no luck. Warn the user of impending doom. + AC_MSG_RESULT([not found]) + AC_MSG_WARN([struct statfs not found]) + fi + + dnl # 2. search for f_bavail member of struct statfs + if test ".$found_struct_statfs" = .yes; then + AC_MSG_CHECKING(for f_bavail member in struct statfs) + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if STATFS_IN_SYS_STATVFS +#include + typedef struct statvfs STATFS_t; +#else + typedef struct statfs STATFS_t; +#if STATFS_IN_SYS_VFS +#include +#elif STATFS_IN_SYS_MOUNT +#include +#elif STATFS_IN_SYS_STATFS +#include +#endif +#endif + ]], [[ + STATFS_t sfs; + sfs.f_bavail = 0; + ]]) + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(STATFS_HAS_F_BAVAIL, 1, [Define if struct statfs has the f_bavail member]) + ],[ + AC_MSG_RESULT(no) + ]) + fi + + dnl # 3. check to see if we have the 4-argument variant of statfs(2) + if test ".$found_struct_statfs" = .yes; then + AC_MSG_CHECKING([if statfs(2) requires 4 arguments]) + AC_RUN_IFELSE([ + AC_LANG_SOURCE([[ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef STATFS_IN_SYS_VFS +#include +#elif STATFS_IN_SYS_MOUNT +#include +#elif STATFS_IN_SYS_STATFS +#include +#endif + main() { + struct statfs sfs; + exit (statfs(".", &sfs, sizeof(sfs), 0)); + } + ]]) + ], [ + AC_MSG_RESULT(yes) + AC_DEFINE(STAT_STATFS4, 1, [Define if statfs() takes 4 arguments]) + ], [ + AC_MSG_RESULT(no) + ], [ + AC_MSG_RESULT(no) + ]) + fi +]) +dnl ## +dnl ## NAME: +dnl ## AC_CPP_FUNC +dnl ## +dnl ## Checks to see if ISO C99 CPP variable __func__ works. +dnl ## If not, perhaps __FUNCTION__ works instead. +dnl ## If not, we'll just define __func__ to "". +dnl ## +dnl ## Needed for the test support code; this was found at +dnl ## http://lists.gnu.org/archive/html/bug-autoconf/2002-07/msg00028.html +dnl +AC_DEFUN([AC_CPP_FUNC], +[AC_REQUIRE([AC_PROG_CC_STDC])dnl +AC_CACHE_CHECK([for an ANSI C99-conforming __func__], ac_cv_cpp_func, +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], +[[char *foo = __func__;]])], + [ac_cv_cpp_func=yes], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], +[[char *foo = __FUNCTION__;]])], + [ac_cv_cpp_func=__FUNCTION__], + [ac_cv_cpp_func=no])])]) +if test $ac_cv_cpp_func = __FUNCTION__; then + AC_DEFINE(__func__,__FUNCTION__, + [Define to __FUNCTION__ or "" if `__func__' does not conform to +ANSI C.]) +elif test $ac_cv_cpp_func = no; then + AC_DEFINE(__func__,"", + [Define to __FUNCTION__ or "" if `__func__' does not conform to +ANSI C.]) +fi +])# AC_CPP_FUNC + diff --git a/rpm-5.4.9/aclocal.m4 b/rpm-5.4.9/aclocal.m4 new file mode 100644 index 0000000..d1de729 --- /dev/null +++ b/rpm-5.4.9/aclocal.m4 @@ -0,0 +1,1045 @@ +# generated automatically by aclocal 1.11.4 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 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_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, +[m4_warning([this file was generated for autoconf 2.68. +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'.])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software +# Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# 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.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.4], [], + [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.11.4])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, 2003, 2005, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# 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], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])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, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, +# 2010, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# 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", "GCJ", or "OBJC". +# 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 + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +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 8's {/usr,}/bin/sh. + touch 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, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +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, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 5 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 16 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# 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.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +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], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_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([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. 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)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# 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, 2003, 2005, 2008, 2011 Free Software Foundation, +# Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# 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}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# 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])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, +# 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless `enable' is passed literally. +# For symmetry, `disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], +[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# 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 supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, +# Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software +# Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# _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) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# 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, 1997, 2000, 2001, 2003, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + 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 + + 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)]) + +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# 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, 2008, 2010 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_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}']) +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +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/intlmacosx.m4]) +m4_include([m4/lib-ld.m4]) +m4_include([m4/lib-link.m4]) +m4_include([m4/lib-prefix.m4]) +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) +m4_include([m4/nls.m4]) +m4_include([m4/po.m4]) +m4_include([m4/progtest.m4]) +m4_include([acinclude.m4]) diff --git a/rpm-5.4.9/autodeps/aix.prov b/rpm-5.4.9/autodeps/aix.prov new file mode 100644 index 0000000..4331fae --- /dev/null +++ b/rpm-5.4.9/autodeps/aix.prov @@ -0,0 +1,78 @@ +#! /usr/bin/ksh + +# Original Author: Ralph Goers(rgoer@Candle.Com) +# Borrowed heavily from Tim Mooney's HP version. +# This file is distributed under the terms of the GNU General Public License +# +# find-requires is part of RPM, the RPM Package Manager. find-requires +# reads a list of full pathnames (in a package) on stdin, and outputs all +# shared libraries the package requires to run correctly. +# + +find_prov_ia64() +{ + # On AIX for IA64, use the file command to find shared modules + # + # Example file output: + # + #$file /usr/lib/ia64l32/libc.so + #/usr/lib/ia64l32/libc.so: ELF 32-bit LSB version 1 AIX shared obj IA-64 + # + # + # + + # Search for shared objects - the file command on AIX for IA64 reports + # shared objects + sed -e "s/['\"]/\\\&/g" -e "s/$/\//g" | LANG=C xargs file | grep -e ":.*shared obj" | cut -d: -f1 | sed "s/\/$//g" | xargs -i basename {} | sort -u +} + +find_prov_power() +{ + # + # Example dump output: + # + #$dump -H /usr/bin/dump + # + #/usr/bin/dump: + # + # ***Loader Section*** + # Loader Header Information + #VERSION# #SYMtableENT #RELOCent LENidSTR + #0x00000001 0x00000021 0x0000006c 0x0000002f + # + ##IMPfilID OFFidSTR LENstrTBL OFFstrTBL + #0x00000002 0x00000848 0x00000049 0x00000877 + # + # + # ***Import File Strings*** + #INDEX PATH BASE MEMBER + #0 /usr/lib:/lib:/usr/lpp/xlC/lib + #1 libc.a shr.o + + # + # + + # Search executables, archives, and symlinks to those types for shared + # objects + sed -e "s/['\"]/\\\&/g" -e "s/$/\//g" | LANG=C xargs file | grep -e ":.*executable" -e ":.*archive" | cut -d: -f1 | sed "s/\/$//g" | + + # Use the verbose version of dump to find the sharable objects + while read f + do + LANG=C /usr/bin/dump -ov $f/ 2>/dev/null | egrep "^Flags.*SHROBJ|:$" | + awk 'match($1,":$") { member=$1 } + !match($1,":$") {print member} ' + done | sed -e 's/:$//' -e 's/\/\[/\(/g' -e 's/\]/)/g' | xargs -i basename {} | + sort -u +} + +PATH=/usr/bin + +machinetype=`uname -m` +if [[ $machinetype = "ia64" ]] +then + find_prov_ia64 +else + find_prov_power +fi + diff --git a/rpm-5.4.9/autodeps/aix.req b/rpm-5.4.9/autodeps/aix.req new file mode 100755 index 0000000..12c0038 --- /dev/null +++ b/rpm-5.4.9/autodeps/aix.req @@ -0,0 +1,171 @@ +#! /usr/bin/ksh + +# Original Author: Ralph Goers(rgoer@Candle.Com) +# Borrowed heavily from Tim Mooney's HP version. +# This file is distributed under the terms of the GNU General Public License +# +# find-requires is part of RPM, the RPM Package Manager. find-requires +# reads a list of full pathnames (in a package) on stdin, and outputs all +# shared libraries the package requires to run correctly. +# + +find_req_power () +{ + # On AIX Power, use `dump -H' to find the library dependencies + # for an executable + # + # Example dump output: + # + #$dump -H /usr/bin/dump + # + #/usr/bin/dump: + # + # ***Loader Section*** + # Loader Header Information + #VERSION# #SYMtableENT #RELOCent LENidSTR + #0x00000001 0x00000021 0x0000006c 0x0000002f + # + ##IMPfilID OFFidSTR LENstrTBL OFFstrTBL + #0x00000002 0x00000848 0x00000049 0x00000877 + # + # + # ***Import File Strings*** + #INDEX PATH BASE MEMBER + #0 /usr/lib:/lib:/usr/lpp/xlC/lib + #1 libc.a shr.o + + # + # + + while read f + do + # Find the required symbols in executables and the required shells in + # scripts + LANG=C /usr/bin/file $f | /usr/bin/grep -q -e ":.*shell script" + + if [ $? -ne 0 ] # Use dump to examine executables + then + LANG=C /usr/bin/dump -H $f 2>/dev/null | awk ' + + # + # Since this entire awk script is enclosed in single quotes, + # you need to be careful to not use single quotes, even in awk + # comments, if you modify this script. + # + + BEGIN { + in_shlib_list = 0; + in_file_strings = 0; + FS = " "; + RS = "\n"; + } + + in_shlib_list == 1 && /^$/ { + in_shlib_list = 0; + in_file_strings = 0; + } + + in_shlib_list == 1 { + pos = index($2, "/") + numfields = split($0, fields, " ") + + if (pos == 0) { + namevar = 2 + } + else { + namevar = 3 + } + if (namevar < numfields) { + printf("%s(%s)\n", fields[namevar], fields[namevar+1]) + } + else { + if ((fields[namevar] != ".") && (fields[namevar] != "..")) { + print fields[namevar] + } + } + } + + in_file_strings == 1 && $1 == "0" { + in_shlib_list = 1 + } + + /\*Import File Strings\*/ { + in_file_strings = 1 + } + ' # end of awk + else # shell scripts + if [ -x $f ]; then + /usr/bin/head -1 $f | /usr/bin/sed -e 's/^\#\![ ]*//' | /usr/bin/cut -d" " -f1 + fi + fi + done | sort -u +} + +find_req_ia64 () +{ + # On AIX IA64, use `dump -Lv' to find the library dependencies + # for an executable + # + # Example dump output: + # + #$dump -Lv /usr/bin/dump + # + # + #/usr/bin/dump: + # + # **** DYNAMIC SECTION INFORMATION **** + #[INDEX] Tag Value + # + #.dynamic: + #[1] NEEDED libC.so.1 + #[2] NEEDED libelf.so + #[3] NEEDED /usr/lib/ia64l32/libc.so.1 + #[4] INIT 0x1001d6c0 + #[5] FINI 0x1001d700 + #[6] HASH 0x1000011c + #[7] STRTAB 0x10000914 + #[8] SYMTAB 0x10000364 + #[9] STRSZ 0x3dd + #[10] SYMENT 0x10 + #[11] PLTGOT 0x20018994 + #[12] PLT_RESERVE 0x20018a00 + #[13] PLTSZ 0x1c0 + #[14] PLTREL REL + #[15] JMPREL 0x100024bc + #[16] REL 0x10000cf4 + #[17] RELSZ 0x17c8 + #[18] RELENT 0x8 + # + # + + while read f + do + # Find the required symbols in executables and the required shells in + # scripts + LANG=C /usr/bin/file $f | /usr/bin/grep -q -e ":.*shell script" + + if [ $? -ne 0 ] # Use dump to examine executables + then + LANG=C /usr/bin/dump -Lv $f 2>/dev/null | \ + awk '$2=="NEEDED" {print $3}' | xargs -i basename {} + + else # Extract the exec module from shell scripts + if [ -x $f ]; then + head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1 + fi + fi + done | sort -u +} + +machinetype=`uname -m` +if [[ $machinetype = "ia64" ]] +then + /usr/bin/sed "s/['\"]/\\\&/g" | LANG=C /usr/bin/xargs /usr/bin/file | \ + /usr/bin/grep -e ":.*executable" -e ":.*archive" -e ":.*shell script" | /usr/bin/cut -d: -f1 | + find_req_ia64 +else + /usr/bin/sed "s/['\"]/\\\&/g" | LANG=C /usr/bin/xargs /usr/bin/file | \ + /usr/bin/grep -e ":.*executable" -e ":.*archive" -e ":.*shell script" | /usr/bin/cut -d: -f1 | + find_req_power +fi + diff --git a/rpm-5.4.9/autodeps/aix4.prov b/rpm-5.4.9/autodeps/aix4.prov new file mode 100644 index 0000000..b21945c --- /dev/null +++ b/rpm-5.4.9/autodeps/aix4.prov @@ -0,0 +1,189 @@ +#! /usr/bin/ksh + +# Current Maintainer: Tim Mooney +# +# Original Author: Ralph Goers(rgoer@Candle.Com) +# Borrowed heavily from H10 version created by Tim Mooney. +# This file is distributed under the terms of the GNU Public License +# +# find-provides is part of RPM, the RPM Package Manager. find-provides +# reads a list of full pathnames (in a package) on stdin, and outputs all +# shared libraries provided by (contained in) the package. +# +# On AIX, use `dump -o' to find what the library provides, if anything. +# +# +# Ralph's comments: +# +# Executables are skipped because, by convention, shared libraries +# which are not dynamically loaded are packaged as archives. Also, +# it is impossible to tell the difference between an executable +# program and a dynamically loaded shared library. +# +# Because archives can contain any number of things, including +# apparently, multiple shared libraries, dependencies in archives +# will be specified as file[member]. Any member in an archive which +# has a loader section will be listed as provided. +# +# Tim's (subsequent) comments: +# +# Based on discussions on the rpm-list in mid-March of 2000, I've modified +# the copy of find-provides that Ralph provided me to use `dump -o' instead +# of `dump -H', and I've followed Brandon S. Allbery's suggestions and modified +# the awk script to look for a modtype of `RE', which is what constitutes a +# shared member of a library. Just like everything else on AIX, libraries are +# weird. :-| +# +# I've followed Ralph's convention of generating provides in the form of +# `filebasename(member-object)' *if* there is a member object, or just +# `filebasename' if there isn't (such as in the case of certain perl modules, +# locally built shared libraries, etc.). +# +# Example dump output: +# +#$dump -o /usr/lpp/X11/lib/R6/libX11.a +# +#/usr/lpp/X11/lib/R6/libX11.a[shr4.o]: +# +# ***Object Module Header*** +## Sections Symbol Ptr # Symbols Opt Hdr Len Flags +# 4 0x00126c28 14557 72 0x3002 +#Timestamp = 920377624 +#Magic = 0x1df +# +# ***Optional Header*** +#Tsize Dsize Bsize Tstart Dstart +#0x000bcc20 0x00024bd4 0x00000e0c 0x00000000 0x00000000 +# +#SNloader SNentry SNtext SNtoc SNdata +#0x0004 0x0000 0x0001 0x0002 0x0002 +# +#TXTalign DATAalign TOC vstamp entry +#0x0005 0x0003 0x00023d74 0x0001 0xffffffff +# +#maxSTACK maxDATA SNbss magic modtype +#0x00000000 0x00000000 0x0003 0x010b RE +# +#/usr/lpp/X11/lib/R6/libX11.a[shr4net.o]: +# +# ***Object Module Header*** +## Sections Symbol Ptr # Symbols Opt Hdr Len Flags +# 7 0x000006fb 22 72 0x3002 +#Timestamp = 774732998 +#Magic = 0x1df +# +# ***Optional Header*** +#Tsize Dsize Bsize Tstart Dstart +#0x00000084 0x00000088 0x00000000 0x00000200 0x00000000 +# +#SNloader SNentry SNtext SNtoc SNdata +#0x0007 0x0000 0x0002 0x0004 0x0004 +# +#TXTalign DATAalign TOC vstamp entry +#0x0002 0x0003 0x00000080 0x0001 0xffffffff +# +#maxSTACK maxDATA SNbss magic modtype +#0x00000000 0x00000000 0x0005 0x010b RE + +PATH=/usr/bin:/usr/ccs/bin +export PATH + +# +# TVM: Marc Stephenson (marc@austin.ibm.com) points out we run things +# like `file', et. al. and expect the output to be what we see in the +# C/POSIX locale. Make sure it is so. +# +LANG=C +export LANG + +# +# TVM: Because AIX libraries don't have the equivalent of a SONAME, if you do +# +# ln -s /usr/lib/libc.a /tmp/libmy_libc_link.a +# +# and then link your program with `-L/tmp -lmy_libc_link', that's the name +# that will be recorded as the BASE in the Import File Strings area. +# This means we need to include "symbolic link" in the list of files to check +# out. +# +filelist=`sed "s/['\"]/\\\&/g" | xargs file \ + | egrep 'archive|executable|symbolic link' | cut -d: -f1` + +for f in $filelist +do + # + # Uncomment the next line for some additional debugging info: + #echo "Checking $f" + dump -o $f 2>/dev/null | awk ' + + # TVM: be careful to not use any single quotes, even in comments, + # since this entire awk script is enclosed in single quotes. + + BEGIN { + FS = " "; + RS = "\n"; + # our flag to indicate we found a filename[membername] or + # filename. + found_file_or_member = 0 + # our flag to indicate we found the modtype tag. If so, + # we want to look for RE on the next line. + found_modtype = 0 + # + # number of times gsub substituted, used twice below + nsub = 0 + } + + # Uncomment the next line for some debugging info. + # { print NR , ":", $0 } + + found_modtype == 1 && found_file_or_member == 1 { + + if ( $0 ~ / RE/ ) { + # we have seen a filename, we have seen a modtype line, and now + # we know that the modtype is RE. Print out the member name. + # + # Note that member names generally look like foo[bar.o], and + # since the RPM standard has become to use parens, we will + # translate the [ and ] into ( and ) in the output stream. + # awk on AIX 4 has sub() and gsub(), so we can use them to do + # it. If this script is adapted for use on some other platform + # make sure that awk on that platform has sub/gsub. If not, + # you will need to postprocess the output stream (probably before + # the sort -u) with tr or sed. + nsub = gsub(/\[/, "(", member) + if ( nsub > 1 ) { + print "substituted too many times for [:", member | "cat 1>&2" + } + nsub = gsub(/\]/, ")", member) + if ( nsub > 1 ) { + print "substituted too many times for ]:", member | "cat 1>&2" + } + print member + } + # In any case, reset our flags to zero, to indicate we are done + # with this member, so we are ready to handle additional members + # if needed. + found_file_or_member = 0 + found_modtype = 0 + } + + found_file_or_member == 1 && /magic *modtype/ { + # we have seen a filename, and now we have seen the modtype + # line. Set the found_modtype flag. The next line of input + # will be caught by the rule above, and we will print out + # the member if the modtype is RE. + found_modtype = 1 + } + + /:$/ { + numfields = split($0,fields, "/") + # chop off the trailing colon + fieldlen = length(fields[numfields])-1 + member= substr(fields[numfields], 1, fieldlen) + # Set the flat to indicate we found a file or a file(member). + found_file_or_member = 1 + } + ' # end of awk +done | sort -u +#comment out the previous line and uncomment the next line when debugging +#done diff --git a/rpm-5.4.9/autodeps/aix4.req b/rpm-5.4.9/autodeps/aix4.req new file mode 100644 index 0000000..04a0e73 --- /dev/null +++ b/rpm-5.4.9/autodeps/aix4.req @@ -0,0 +1,99 @@ +#! /usr/bin/ksh +# +# Current Maintainer: Tim Mooney +# Original Author: Ralph Goers(rgoer@Candle.Com) +# +# This file is distributed under the terms of the GNU Public License +# +# find-requires is part of RPM, the RPM Package Manager. find-requires +# reads a list of full pathnames (in a package) on stdin, and outputs all +# shared libraries the package requires to run correctly. +# +# On AIX, use `dump -H' to find the library dependencies for an executable +# +# Example dump output: +# +#$dump -H /usr/bin/dump +# +#/usr/bin/dump: +# +# ***Loader Section*** +# Loader Header Information +#VERSION# #SYMtableENT #RELOCent LENidSTR +#0x00000001 0x00000021 0x0000006c 0x0000002f +# +##IMPfilID OFFidSTR LENstrTBL OFFstrTBL +#0x00000002 0x00000848 0x00000049 0x00000877 +# +# +# ***Import File Strings*** +#INDEX PATH BASE MEMBER +#0 /usr/lib:/lib:/usr/lpp/xlC/lib +#1 libc.a shr.o +# +# + +PATH=/usr/bin:/usr/ccs/bin +export PATH + +# +# TVM: Marc Stephenson (marc@austin.ibm.com) points out we run things +# like `file', et. al. and expect the output to be what we see in the +# C/POSIX locale. Make sure it is so. +# +LANG=C +export LANG + +filelist=`sed "s/['\"]/\\\&/g" | xargs file \ + | egrep '^.*:.*(executable |archive )' | cut -d: -f1` + +for f in $filelist +do + dump -H $f 2>/dev/null | awk ' + + # + # Since this entire awk script is enclosed in single quotes, + # you need to be careful to not use single quotes, even in awk + # comments, if you modify this script. + # + + BEGIN { + in_shlib_list = 0; + in_file_strings = 0; + FS = " "; + RS = "\n"; + } + + in_shlib_list == 1 && /^$/ { + in_shlib_list = 0; + in_file_strings = 0; + } + + in_shlib_list == 1 { + pos = index($2, "/") + numfields = split($0, fields, " ") + + if (pos == 0) { + namevar = 2 + } + else { + namevar = 3 + } + if (namevar < numfields) { + printf("%s(%s)\n", fields[namevar], fields[namevar+1]) + } + else { + print fields[namevar] + } + } + + in_file_strings == 1 && $1 == "0" { + in_shlib_list = 1 + } + + /\*Import File Strings\*/ { + in_file_strings = 1 + } + + ' # end of awk +done | sort -u diff --git a/rpm-5.4.9/autodeps/amigaos.prov b/rpm-5.4.9/autodeps/amigaos.prov new file mode 100644 index 0000000..87ad08f --- /dev/null +++ b/rpm-5.4.9/autodeps/amigaos.prov @@ -0,0 +1,3 @@ +#!/bin/sh + +cat > /dev/null diff --git a/rpm-5.4.9/autodeps/amigaos.req b/rpm-5.4.9/autodeps/amigaos.req new file mode 100644 index 0000000..87ad08f --- /dev/null +++ b/rpm-5.4.9/autodeps/amigaos.req @@ -0,0 +1,3 @@ +#!/bin/sh + +cat > /dev/null diff --git a/rpm-5.4.9/autodeps/darwin.prov b/rpm-5.4.9/autodeps/darwin.prov new file mode 100644 index 0000000..640750b --- /dev/null +++ b/rpm-5.4.9/autodeps/darwin.prov @@ -0,0 +1,21 @@ +#!/bin/bash +# ---------------------------------------------------------- +# find-provides for Darwin/MacOSX +# ---------------------------------------------------------- +# This script reads filenames from STDIN and outputs any relevant provides +# information that needs to be included in the package. + +filelist=$(sed -n -e '/\.dylib/p' -e '/\.so/p' -e '/\.bundle/p' -e '/\.jnilib/p' | sort | uniq | xargs file -L 2>/dev/null | grep "Mach-O.*" | cut -d: -f1) + +for f in $filelist; do + libname=$(basename $f | sed -e 's;\..*;;') + soname=$(otool -l $f | grep $libname | awk '/ name/ {print $2}') + + if [ "$soname" != "" ]; then + if [ ! -L $f ]; then + basename $soname + fi + else + echo ${f##*/} + fi +done | sort -u diff --git a/rpm-5.4.9/autodeps/darwin.req b/rpm-5.4.9/autodeps/darwin.req new file mode 100644 index 0000000..9bb08b7 --- /dev/null +++ b/rpm-5.4.9/autodeps/darwin.req @@ -0,0 +1,26 @@ +#!/bin/sh +# ---------------------------------------------------------------- +# find-requires for Darwin/MacOSX +# ---------------------------------------------------------------- +ulimit -c 0 + +filelist=`sed "s/['\"]/\\\&/g"` +exelist=`echo $filelist | xargs file | fgrep Mach-O | cut -d: -f1 ` +scriptlist=`echo $filelist | xargs file | egrep ":.* (commands|script) " | cut -d: -f1 ` + +for f in $exelist; do + if [ -x $f ]; then + otool -L $f \ + | awk '/^\t/ { print }' \ + | sed -n -e '/ (compatibility version .* current version .*)/p' \ + | sed -e 's/ (compatibility version .* current version .*)//' + fi +done | sort -u | sed "s/['\"]/\\\&/g" | xargs -n 1 basename | sort -u + +for f in $scriptlist; do + if [ -x $f ]; then + head -1 $f | sed -e 's/^\#\![ ]*//' \ + | sed -n -e '/^\/bin/!p' | sed -n -e '/^\/usr\/bin/!p' | uniq \ + | cut -d" " -f1 + fi +done diff --git a/rpm-5.4.9/autodeps/freebsd.prov b/rpm-5.4.9/autodeps/freebsd.prov new file mode 100644 index 0000000..cf00d4f --- /dev/null +++ b/rpm-5.4.9/autodeps/freebsd.prov @@ -0,0 +1,9 @@ +#!/bin/sh +# ---------------------------------------------------------- +# find-provides for FreeBSD-2.2.x +# ---------------------------------------------------------- +filelist=$(grep "\\.so" | grep -v "^/lib/ld.so" | xargs file -L 2>/dev/null | grep "FreeBSD.*shared" | cut -d: -f1) + +for f in $filelist; do + echo ${f##*/} +done | sort -u diff --git a/rpm-5.4.9/autodeps/freebsd.req b/rpm-5.4.9/autodeps/freebsd.req new file mode 100644 index 0000000..c42d93c --- /dev/null +++ b/rpm-5.4.9/autodeps/freebsd.req @@ -0,0 +1,22 @@ +#!/bin/sh +# ---------------------------------------------------------------- +# find-requires for FreeBSD-2.2.x +# how do we know what is required by a.out shared libraries? +# ---------------------------------------------------------------- +ulimit -c 0 + +filelist=`sed "s/['\"]/\\\&/g"` +exelist=`echo $filelist | xargs file | fgrep executable | cut -d: -f1 ` +scriptlist=`echo $filelist | xargs file | egrep ":.* (commands|script) " | cut -d: -f1 ` + +for f in $exelist; do + if [ -x $f ]; then + ldd $f | /usr/bin/awk '/=>/&&!/not found/ { print $3 }' + fi +done | sort -u | sed "s/['\"]/\\\&/g" | xargs -n 1 basename | sort -u + +for f in $scriptlist; do + if [ -x $f ]; then + head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1 + fi +done | sort -u diff --git a/rpm-5.4.9/autodeps/freebsdelf.prov b/rpm-5.4.9/autodeps/freebsdelf.prov new file mode 100644 index 0000000..df7d829 --- /dev/null +++ b/rpm-5.4.9/autodeps/freebsdelf.prov @@ -0,0 +1,9 @@ +#!/bin/sh +# ---------------------------------------------------------- +# find-provides for FreeBSD >= 3.3 +# ---------------------------------------------------------- +filelist=$(grep "\\.so" | grep -v "^/lib/ld.so" | xargs file -L 2>/dev/null | grep "ELF.*shared" | cut -d: -f1) + +for f in $filelist; do + echo ${f##*/} +done | sort -u diff --git a/rpm-5.4.9/autodeps/freebsdelf.req b/rpm-5.4.9/autodeps/freebsdelf.req new file mode 100644 index 0000000..056d9d9 --- /dev/null +++ b/rpm-5.4.9/autodeps/freebsdelf.req @@ -0,0 +1,46 @@ +#!/bin/sh + +# note this works for both a.out and ELF executables +# it also auto-generates requirment lines for shell scripts + +ulimit -c 0 + +filelist=`sed "s/['\"]/\\\&/g"` +exelist=`if test "x$filelist" != x; then echo $filelist | xargs file | grep ":.*executable" | cut -d: -f1; fi` +scriptlist=`if test "x$filelist" != x; then echo $filelist | xargs file | egrep ":.* (commands|script) " | cut -d: -f1; fi` +liblist=`if test "x$filelist" != x; then echo $filelist | xargs file | grep ":.*shared object" | cut -d : -f1; fi` + +LDDLIST=`for f in $exelist; do + if [ -x $f ]; then + ldd $f | awk '/=>/ { print $1 }' + fi +done | sort -u | sed "s/['\"]/\\\&/g"` +if test "x$LDDLIST" != x; then + echo $LDDLIST | xargs -n 1 basename | grep -v 'libNoVersion.so' | sort -u +fi + +LDDLIST=`for f in $liblist; do + ldd $f | awk '/=>/ { print $1 }' +done | sort -u | sed "s/['\"]/\\\&/g"` +if test "x$LDDLIST" != x; then + echo $LDDLIST | xargs -n 1 basename | grep -v 'libNoVersion.so' | sort -u +fi + +for f in $scriptlist; do + if [ -x $f ]; then + head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1 + fi +done | sort -u + +for f in $liblist $exelist ; do + objdump -p $f | awk ' + BEGIN { START=0; LIBNAME=""; } + /Version References:/ { START=1; } + /required from/ && (START==1) { + sub(/:/, "", $3); + LIBNAME=$3; + } + (START==1) && (LIBNAME!="") && ($4~/^GLIBC_*/) { print LIBNAME "(" $4 ")"; } + /^$/ { START=0; } + ' +done | sort -u diff --git a/rpm-5.4.9/autodeps/hpux.prov b/rpm-5.4.9/autodeps/hpux.prov new file mode 100644 index 0000000..9fd4ce6 --- /dev/null +++ b/rpm-5.4.9/autodeps/hpux.prov @@ -0,0 +1,175 @@ +#! /usr/bin/ksh + +# Original Author: Tim Mooney +# $Id: hpux.prov,v 1.8 2001/09/15 13:49:11 jbj Exp $ +# +# This file is distributed under the terms of the GNU Public License +# +# find-provides is part of RPM, the Red Hat Package Manager. find-provides +# reads a list of full pathnames (in a package) on stdin, and outputs all +# shared libraries provided by (contained in) the package. +# +# +# On HP-UX, use `chatr' to find what libraries a package provides +# +# Example chatr output: +# +#$chatr /usr/lib/libc.sl +# +#/usr/lib/libc.sl: +# shared library +# shared library dynamic path search: +# SHLIB_PATH disabled second +# embedded path disabled first Not Defined +# internal name: +# libc.1 +# shared library list: +# dynamic /usr/lib/libdld.1 +# static branch prediction disabled +# kernel assisted branch predictionenabled +# lazy swap allocationdisabled +# text segment lockingdisabled +# data segment lockingdisabled +# data page size: 4K +# instruction page size: 4K +# + +# +# Implementation notes: some of the system libraries are built without an +# `internal name' (HP-UX's equivalent to a SONAME), so I need to track what +# chatr outputs as its first line. We'll use the basename of that line in +# the event of no internal name. +# + +PATH=/usr/bin:/usr/sbin:/usr/ccs/bin +export PATH + +# +# TVM: Marc Stephenson (marc@austin.ibm.com) points out we run things +# like `file', et. al. and expect the output to be what we see in the +# C/POSIX locale. Make sure it is so. +# +LANG=C +export LANG + +# +# TVM: use `while read ...' instead of `for f in ...', because there may +# be too many files to stuff into one shell variable. +# +IFS="" +while read f +do + # It's possible that I should be testing to make sure that the file + # we're trying isn't a symlink, and skipping it if it is, because of + # the possible odd situation where we could have a link to a library + # with no internal name. This would need more investigation, though. + chatr $f 2>/dev/null \ + | awk ' + + BEGIN { + FS = " "; + RS = "\n"; + + # This flag signfies that we have seen the internal name: + # marker. Once we see that, we set the flag to 1. The next + # line we read should contain the library internal name, the + # SOM equivalent of an soname. At that point we set the flag + # found_internal_name to 1 and exit + # the main body of the awk script, going through the END + in_internal_name = 0; + + # + # We have seen the internal name: section (yet)? + # + found_internal_name = 0; + + # + # assume it is a shared library, until record 2 proves us wrong. + # + isa_shared_library = 1; + } + + # Uncomment the next line for some debugging info. + #{ print NR , ":", $0 } + + # + # save the first line in case there is no internal name built + # into this object. + # + NR == 1 { + my_name = $0 + opened_something = 1; + } + + # + # Check the second line (record). Clear the flag if it is not a + # shared library. + # + NR == 2 && $0 !~ /^[ ]+shared library[ ]*$/ { + # It is not a shared library. Bow out early + isa_shared_library = 0; + exit + } + + in_internal_name == 1 { + + # We found the library internal name. If it does not contain + # a path, print it. At least a couple of the system libraries + # have a full path as the internal name (this is probably a bug). + + if ( $0 ~ /\// ) { + numfields = split($0, internal_name, "/") + print internal_name[numfields] + } else { + print $1 + } + + # + # Set a flag for the EXIT section, to indicate that we found + # an internal name + # + found_internal_name = 1; + in_internal_name = 0 + exit + } + + # + # we have hit the internal name section. Set the flag. The next + # line should be what we are looking for. + # + /^ +internal name: *$/ { + in_internal_name = 1 + } + + END { + # Uncomment the next line for debugging info + #{ print "END: NR: ", NR } + if ( (isa_shared_library == 0) || (NR < 2) ) { + # both of these indicate error conditions, for which we + # should not generate any output. + exit; + } else { + if (found_internal_name == 1) { + exit; + } else { + # + # chop the : off the end of the line + # + colon = index(my_name, ":") + colon = colon - 1 + temp = substr(my_name, 1, colon) + # + # get the basename + # + numfields = split(temp, basename, "/") + # Uncomment the next line for debugging info + #print "In END:", numfields, ":", temp + print basename[numfields] + exit + } + } + } + ' # end of awk +done | sort -u +#comment out the previous line and uncomment the next line when debugging +#done diff --git a/rpm-5.4.9/autodeps/hpux.req b/rpm-5.4.9/autodeps/hpux.req new file mode 100644 index 0000000..dd8984f --- /dev/null +++ b/rpm-5.4.9/autodeps/hpux.req @@ -0,0 +1,126 @@ +#! /usr/bin/ksh + +# Original Author: Tim Mooney +# $Id: hpux.req,v 1.7 2001/09/15 13:49:11 jbj Exp $ +# +# This file is distributed under the terms of the GNU Public License +# +# find-requires is part of RPM, the Red Hat Package Manager. find-requires +# reads a list of full pathnames (in a package) on stdin, and outputs all +# shared libraries the package requires to run correctly. +# +# On HP-UX, use `chatr' to find the library dependencies for an executable +# +# Example chatr output: +# +#$chatr /usr/bin/chatr +#/usr/bin/chatr: +# shared executable +# shared library dynamic path search: +# SHLIB_PATH disabled second +# embedded path disabled first Not Defined +# internal name: +# chatr +# shared library list: +# dynamic /usr/lib/libc.1 +# shared library binding: +# deferred +# static branch prediction disabled +# kernel assisted branch predictionenabled +# lazy swap allocationdisabled +# text segment lockingdisabled +# data segment lockingdisabled +# data page size: 4K +# instruction page size: 4K + +PATH=/usr/bin:/usr/sbin:/sbin:/usr/ccs/bin +export PATH + +# +# TVM: Marc Stephenson (marc@austin.ibm.com) points out we run things +# like `file', et. al. and expect the output to be what we see in the +# C/POSIX locale. Make sure it is so. +# +LANG=C +export LANG + +IFS="" +while read f +do + # uncomment the next line if debugging + # echo "### processing $f" + + # + # Only run the file command once per file: + # + file_output=`file $f` + + # + # First, check to see if it's a script, and try figure out what + # intpreter it requires. This is more work on HP-UX, since `file' + # doesn't tell us what interpreter the script uses, or even if it + # really is a script. + # + is_shell_script=`od -N 2 -t c $f 2>/dev/null | grep '0000000 # !'` + if test X"$is_shell_script" != X ; then + # + # it's a shell script. Now figure out what interpreter it needs + # Look at me! I'm good with sed. ;-) + interp=`head -1 $f | sed -e 's/^#! \{0,1\}\([^ ]*\).*$/\1/'` + if test X"$interp" != X ; then + echo "$interp" + # + # We've found what we need for this file. Skip back to the + # top of the loop. This saves me an `else' and another indent + # level! ;-) + continue + fi + fi + + # + # The `else' is implied here by the `continue' above + # + + # + # Is it a shared library? + # + maybe_shared_lib=`echo "$file_output" | egrep '(executable|library)'` + if test X"$maybe_shared_lib" != X ; then + chatr $f 2>/dev/null \ + | awk ' + + # + # For you non-awk-ers, no single quotes in comments -- the shell + # sees them and things get hosed. + # + + BEGIN { + in_shlib_list = 0; + FS = " "; + RS = "\n"; + } + + # uncomment the next line for debugging information + #{ print NR, ": ", $0 } + + + in_shlib_list == 1 && /dynamic[ ]+[\/\.]/ { + + # split the line on "/" and print out the last element + numfields = split($0,fields,"/") + print fields[numfields] + + } + + /^ +shared library list: *$/ { + in_shlib_list = 1 + } + + /^ +shared library binding: *$/ { + exit + } + ' # end of awk + fi # end of shared library if. +done | sort -u +#comment out the previous line and uncomment the next one if debugging. +#done diff --git a/rpm-5.4.9/autodeps/irix6.prov b/rpm-5.4.9/autodeps/irix6.prov new file mode 100644 index 0000000..8fb61f2 --- /dev/null +++ b/rpm-5.4.9/autodeps/irix6.prov @@ -0,0 +1,201 @@ +#! /usr/bin/ksh + +# Original Author: Tim Mooney +# $Id: irix6.prov,v 1.7 2001/09/15 13:49:11 jbj Exp $ +# +# This file is distributed under the terms of the GNU Public License +# +# find-provides is part of RPM, the Red Hat Package Manager. find-provides +# reads a list of full pathnames (in a package) on stdin, and outputs all +# shared libraries provided by (contained in) the package. +# +# NOTE: IRIX libraries (even system libraries) have "version information" +# in both the soname and the internal version field, so it's important to +# be able to separate the soname and internal version fields. As has +# become the case on other platforms, the soname/iversion delimiters have +# become the `(' and `)' characters. +# +# On IRIX, use `elfdump -L' to find what libraries a package provides +# +# Example `elfdump -L' output: +# +#$elfdump -L /usr/lib/libc.so +# +# +#/usr/lib/libc.so: +# +# **** DYNAMIC SECTION INFORMATION **** +#.dynamic : +#[INDEX] Tag Value +#[0] HASH 0xfa099d0 +#[1] STRTAB 0xfa0027c +#[2] SYMTAB 0xfa10e3c +#[3] STRSZ 0x9751 +#[4] SYMENT 0x10 +#[5] INIT 0 +#[6] FINI 0 +#[7] RLDVERS 0x1 +#[8] FLAGS 0x1411 +#[9] BASEADDR 0xfa00000 +#[10] LOCGOTNO 0x3c +#[11] PROTECT 0x3c +#[12] HIDDEN 0x12 +#[13] CNFLCTNO 0 +#[14] LBLISTNO 0 +#[15] SYMTABNO 0xd19 +#[16] UNREFEXT 0x8 +#[17] GOTSYM 0x8b3 +#[18] LOCAL 0x12 +#[19] LOCALPG 0x1 +#[20] LOCALPG 0x10 +#[21] PLTGOT 0xfb483b0 +#[22] RLDTXT_ADR0xfb6b580 +#[23] OPTIONS 0xfa000f4 +#[24] SONAME libc.so.1 +#[25] TIMSTAMP Jun 16 18:23:15 1997 +#[26] CHECKSUM 0x92321a0c +#[27] IVERSION sgi1.0 +#[28] REL 0xfa1dfcc +#[29] RELSZ 0x1988 +#[30] RELENT 0x8 +#[31] MSYM 0xfa1f954 +#[32] COMPCTSIZE0xc60c +#No Library List Section in /usr/lib/libc.so +# + +PATH=/usr/bin:/usr/sbin +export PATH + +# +# TVM: Marc Stephenson (marc@austin.ibm.com) points out we run things +# like `file', et. al. and expect the output to be what we see in the +# C/POSIX locale. Make sure it is so. +# +LANG=C +export LANG + +# +# Use `while read ...' instead of `for f in ...', because there may be too +# many files to stuff into one shell variable. +# +IFS="" +while read f +do + # + # If it's a shared library, run elfdump on it. + # + maybe_shared_lib=`file $f | egrep 'ELF.*dynamic lib'` + if test X"$maybe_shared_lib" != X ; then + elfdump -L $f 2>/dev/null | awk ' + + # + # Since this entire awk script is enclosed in single quotes, + # you need to be careful to not use single quotes, even in awk + # comments, if you modify this script. + # + + BEGIN { + FS = " "; + RS = "\n"; + OFS = ""; + + found_soname = 0; + found_iversion = 0; + } + + # Uncomment the next line for some debugging info. + #{ print NR , ":", $0 } + + /[ ]+SONAME .*[ ]*$/ { + found_soname = 1; + numfields = split($0, internal_name) + if (numfields == 3) { + soname = $3 + } else { + # + # Should never be here. + # + print "Really odd looking soname:", $0 | "cat 1>&2" + exit + } + } + + /[ ]+IVERSION .*[ ]*$/ { + if (found_soname == 1) { + numfields = split($0, iversion) + if (numfields == 3) { + version = $3 + # + # handle libraries with multiple versions, like + # 1.1:1.2. Since they really provide both versions, + # we need to generate output for each version. + # + numfields = split(version, versions, ":") + if (numfields > 1) { + for (i = 1; i < numfields; i++) { + print soname, "(", versions[i], ")" + } + # + # let our END routine print out the *last* version + # provided + # + version = versions[numfields] + } + # + # stick a fork in us. + # + found_iversion = 1; + exit + } else { + # + # handle libraries with comments and other junk in + # the version field. IRIX has a number of system libraries + # with whitespace and other junk in the version field! + # + # we discard the whitespace and keep the identifier after + # the # sign. + # + version = iversion[numfields] + numfields = split(version, version_junk, "#") + if (numfields > 1) { + version = version_junk[numfields] + found_iversion = 1; + } + } + } else { + # + # found an iversion without an soname. Is that possible? + # + print "Found version but no soname:", $0 | "cat 1>&2" + exit + } + } + + # + # we could probably watch for some other token (like RELSZ) + # that *generally* occurs later in the input than the stuff we watch + # for, and exit if we see it, but it is just as easy to read all + # the output, even after we have seen what we are looking for. + # + + END { + # Uncomment the next line for debugging info + #{ print "END: NR: ", NR } + if ( (found_soname == 1) && (found_iversion == 1) ) { + print soname, "(", version, ")" + exit + } else if ( (found_soname == 1) && (found_iversion == 0) ) { + # + # no library version information *BUT* any programs linked + # against this library will pick up a dependency on version 0 + # of this library, so we output that. + # + print soname, "(", 0, ")" + } + # else do nothing + } + ' # end of awk + fi # end of the 'if test X"$maybe_shared_lib != X ; then' clause +done | sort -u +#comment out the previous line and uncomment the next line when debugging +#done diff --git a/rpm-5.4.9/autodeps/irix6.req b/rpm-5.4.9/autodeps/irix6.req new file mode 100644 index 0000000..396cd78 --- /dev/null +++ b/rpm-5.4.9/autodeps/irix6.req @@ -0,0 +1,164 @@ +#! /usr/bin/ksh + +# Original Author: Tim Mooney +# $Id: irix6.req,v 1.7 2001/09/15 13:49:11 jbj Exp $ +# +# This file is distributed under the terms of the GNU Public License +# +# find-requires is part of RPM, the Red Hat Package Manager. find-requires +# reads a list of full pathnames (in a package) on stdin, and outputs all +# shared libraries the package requires to execute. +# +# NOTE: IRIX libraries (even system libraries) have "version information" +# in both the soname and the internal version field, so it's important to +# be able to separate the soname and internal version fields. As has +# become the case on other platforms, the soname/iversion delimiters have +# become the `(' and `)' characters. +# +# On IRIX, use `elfdump -Dl' to find what libraries are required by +# an executable. `elfdump -L' does what we need too, but it gives us more +# than we really need. +# +# Example `elfdump -Dl' output: +# +#$elfdump -Dl /usr/bin/X11/xterm +# +# +# +#/usr/bin/X11/xterm: +# +# **** MIPS LIBLIST INFORMATION **** +#.liblist : +#[INDEX] Timestamp Checksum Flags Name Version +#[1] Nov 23 15:39:02 1997 0x4da65893 ----- libXaw.so.2 sgi2.0 +#[2] Nov 23 15:39:02 1997 0x414eece6 ----- libXmu.so sgi1.0 +#[3] Nov 23 15:39:02 1997 0x6f314e69 ----- libXt.so sgi1.0 +#[4] Nov 23 15:39:02 1997 0xcbe81fff ----- libXext.so sgi1.0 +#[5] Nov 23 15:39:02 1997 0x89ae8e98 ----- libX11.so.1 sgi1.0 +#[6] Oct 27 01:00:29 1997 0x99b27890 ----- libcurses.so sgi1.0 +#[7] Jun 16 18:23:15 1997 0x92321a0c ----- libc.so.1 sgi1.0 +# + +# +# TVM: it might be better to re-write this so that `file' isn't used, since +# it can all be done with `elfdump', but this works. +# + +PATH=/usr/bin:/usr/sbin +export PATH + +# +# TVM: Marc Stephenson (marc@austin.ibm.com) points out we run things +# like `file', et. al. and expect the output to be what we see in the +# C/POSIX locale. Make sure it is so. +# +LANG=C +export LANG + +# +# TVM: switch to using `while read ...' instead of `for f in ...', because +# packages with a large number of files could be too big for one shell +# variable to hold. +# +IFS="" +while read f +do + + # + # Uncomment the next line for additional debugging: + #echo "read ->$f<-" + + # + # Only run file once per file: + # + file_output=`file $f` + + # + # Handle scripts first + # + is_shell_script=`echo "$file_output" | grep 'script text' | \ + cut -d: -f 2 | awk '{ print $1 }'` + + # + # If it's a script... + # + if test X"$is_shell_script" != X ; then + echo "$is_shell_script" + # + # use `continue' to skip back up to the top of the loop. We've + # already done as much as we need to, and this saves me from having + # to have an else, and another indent level... ;-) + # + continue + fi + + # + # the `else' is implied here, since we used `continue' in the test above + # + + # + # It might be a shared library. + # + maybe_shared_lib=`echo "$file_output" | egrep 'executable|lib'` + if test X"$maybe_shared_lib" != X ; then + + elfdump -Dl $f 2>/dev/null \ + | awk ' + + # + # Since this entire awk script is enclosed in single quotes, + # you need to be careful to not use single quotes, even in awk + # comments, if you modify this script. + # + + BEGIN { + found_column_headers = 0; + FS = " "; + RS = "\n"; + OFS=""; + } + + # uncomment the next line for debugging information + #{ print "Saw input:", $0 } + + found_column_headers == 1 && $0 !~ /^$/ { + + # get the library name (field 15) and the library version (field 16) + # if present. + numfields = split($0,fields) + if (numfields == 8) { + print fields[8] + } else if (numfields == 9) { + # + print fields[8], "(", fields[9], ")" + } else if (numfields > 9) { + # + # SGI has this annoying habit of putting comments, complete + # with whitespace, in their library IVERSION field. Yuck. + # + # Handle libraries like this gracefully. + # + verfields = split(fields[NF], junk, "#") + if (verfields == 2) { + print fields[8], "(", junk[2], ")" + } else if (verfields > 2) { + print fields[8], "(", junk[verfields], ")" + } else { + print "Cannot find version:", fields[numfields] | "cat 2>&1" + } + } + } + + /^\[INDEX\].Timestamp.*Checksum.*Flags.*Name.*Version$/ { + # we better start paying attention now. + found_column_headers = 1 + # + # uncomment the next line for debugging information + #print "found the column headers: ", $0 + } + + ' # end of awk + fi +done | sort -u +# comment out the previous line and uncomment the next when debugging +#done diff --git a/rpm-5.4.9/autodeps/linux.prov b/rpm-5.4.9/autodeps/linux.prov new file mode 100644 index 0000000..47f0674 --- /dev/null +++ b/rpm-5.4.9/autodeps/linux.prov @@ -0,0 +1,70 @@ +#!/bin/bash + +OBJDUMP="${OBJDUMP:-objdump}" +usrlibrpm="${usrlibrpm:-/usr/lib/rpm}" + +# This script reads filenames from STDIN and outputs any relevant provides +# information that needs to be included in the package. + +filelist=`sed "s/['\"]/\\\&/g"` + +solist=$(echo $filelist | grep "\\.so" | grep -v "^/lib/ld.so" | \ + xargs file -L 2>/dev/null | grep "ELF.*shared object" | cut -d: -f1) +pythonlist= +tcllist= +rubygemlist=$(echo "$filelist"| egrep "\.gemspec$") + +# +# --- Alpha does not mark 64bit dependencies +case `uname -m` in + alpha*) mark64="" ;; + *) mark64="()(64bit)" ;; +esac + +# +# --- Library sonames and weak symbol versions (from glibc). +for f in $solist; do + soname=$($OBJDUMP -p $f | awk '/SONAME/ {print $2}') + + lib64=`if file -L $f 2>/dev/null | \ + grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi` + if [ "$soname" != "" ]; then + if [ ! -L $f ]; then + echo $soname$lib64 + $OBJDUMP -p $f | awk ' + BEGIN { START=0 ; } + /Version definitions:/ { START=1; } + /^[0-9]/ && (START==1) { print $4; } + /^$/ { START=0; } + ' | \ + grep -v $soname | \ + while read symbol ; do + echo "$soname($symbol)`echo $lib64 | sed 's/()//'`" + done + fi + else + echo ${f##*/}$lib64 + fi +done | sort -u + +# +# --- Perl modules. +[ -x "$usrlibrpm/perl.prov" ] && + echo $filelist | tr '[:blank:]' \\n | grep '\.pm$' | "$usrlibrpm/perl.prov" | sort -u + +# +# --- Python modules. +[ -x "$usrlibrpm/python.prov" -a -n "$pythonlist" ] && + echo $pythonlist | tr '[:blank:]' \\n | "$usrlibrpm/python.prov" | sort -u + +# +# --- Tcl modules. +[ -x "$usrlibrpm/tcl.prov" -a -n "$tcllist" ] && + echo $tcllist | tr '[:blank:]' \\n | "$usrlibrpm/tcl.prov" | sort -u + +# +# --- Ruby gems. +[ -x "$usrlibrpm/rubygems.rb" -a -n "$rubygemlist" ] && + echo $rubygemlist | tr '[:blank:]' \\n | "$usrlibrpm/rubygems.rb" --provides | sort -u + +exit 0 diff --git a/rpm-5.4.9/autodeps/linux.req b/rpm-5.4.9/autodeps/linux.req new file mode 100644 index 0000000..058a05c --- /dev/null +++ b/rpm-5.4.9/autodeps/linux.req @@ -0,0 +1,143 @@ +#!/bin/bash + +OBJDUMP="${OBJDUMP:-objdump}" +usrlibrpm="${usrlibrpm:-/usr/lib/rpm}" + +# +# Auto-generate requirements for executables (both ELF and a.out) and library +# sonames, script interpreters, and perl modules. +# + +ulimit -c 0 + +# +# --- Set needed to 0 for traditional find-requires behavior. +needed=1 +if [ X"$1" = Xldd ]; then + needed=0 +elif [ X"$1" = Xobjdump ]; then + needed=1 +fi + +# +# --- Grab the file manifest and classify files. +#filelist=`sed "s/['\"]/\\\&/g"` +filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"` +exelist=`echo $filelist | xargs -r file | egrep -v ":.* (commands|script) " | \ + grep ":.*executable" | cut -d: -f1` +scriptlist=`echo $filelist | xargs -r file | \ + egrep ":.* (commands|script) " | cut -d: -f1` +liblist=`echo $filelist | xargs -r file | \ + grep ":.*shared object" | cut -d : -f1` + +interplist= +perllist= +pythonlist= +tcllist= +rubygemlist=`echo "$filelist"| egrep "\.gemspec$"` + +# +# --- Alpha does not mark 64bit dependencies +case `uname -m` in + alpha*) mark64="" ;; + *) mark64="()(64bit)" ;; +esac + +if [ "$needed" -eq 0 ]; then +# +# --- Executable dependency sonames. + for f in $exelist; do + [ -r $f -a -x $f ] || continue + lib64=`if file -L $f 2>/dev/null | \ + grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi` + ldd $f | awk '/=>/ { + if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /libredhat-kernel.so/) { + gsub(/'\''"/,"\\&",$1); + printf "%s'$lib64'\n", $1 + } + }' + done | xargs -r -n 1 basename | sort -u + +# +# --- Library dependency sonames. + for f in $liblist; do + [ -r $f ] || continue + lib64=`if file -L $f 2>/dev/null | \ + grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi` + ldd $f | awk '/=>/ { + if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /libredhat-kernel.so/) { + gsub(/'\''"/,"\\&",$1); + printf "%s'$lib64'\n", $1 + } + }' + done | xargs -r -n 1 basename | sort -u +fi + +# +# --- Script interpreters. +for f in $scriptlist; do + [ -r $f -a -x $f ] || continue + interp=`head -n 1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1` + interplist="$interplist $interp" + case $interp in + */perl) perllist="$perllist $f" ;; + esac +done +[ -n "$interplist" ] && { echo "$interplist" | tr '[:blank:]' \\n | sort -u ; } + +# +# --- Add perl module files to perllist. +for f in $filelist; do + [ -r $f -a "${f%.pm}" != "${f}" ] && perllist="$perllist $f" +done + +# +# --- Weak symbol versions (from glibc). +[ -n "$mark64" ] && mark64="(64bit)" +for f in $liblist $exelist ; do + [ -r $f ] || continue + lib64=`if file -L $f 2>/dev/null | \ + grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi` + $OBJDUMP -p $f | awk 'BEGIN { START=0; LIBNAME=""; needed='$needed'; } + /^$/ { START=0; } + /^Dynamic Section:$/ { START=1; } + (START==1) && /NEEDED/ { + if (needed) { + if ("'$lib64'" != "") { + sub(/$/, "()'$lib64'", $2) ; + } + print $2 ; + } + } + /^Version References:$/ { START=2; } + (START==2) && /required from/ { + sub(/:/, "", $3); + LIBNAME=$3; + } + (START==2) && (LIBNAME!="") && ($4!="") { + print LIBNAME "(" $4 ")'$lib64'"; + } + ' +done | sort -u + +# +# --- Perl modules. +[ -x "$usrlibrpm/perl.req" -a -n "$perllist" ] && \ + echo $perllist | tr '[:blank:]' \\n | "$usrlibrpm/perl.req" | sort -u + +# +# --- Python modules. +[ -x "$usrlibrpm/python.req" -a -n "$pythonlist" ] && \ + echo $pythonlist | tr '[:blank:]' \\n | "$usrlibrpm/python.req" | sort -u + +# +# --- Tcl modules. +[ -x "$usrlibrpm/tcl.req" -a -n "$tcllist" ] && \ + echo $tcllist | tr '[:blank:]' \\n | "$usrlibrpm/tcl.req" | sort -u + +# +# --- Ruby gems +[ -x "$usrlibrpm/rubygems.rb" -a -n "$rubygemlist" ] && + echo $rubygemlist | tr '[:blank:]' \\n | "$usrlibrpm/rubygems.rb" --requires | sort -u + +exit 0 diff --git a/rpm-5.4.9/autodeps/mint.prov b/rpm-5.4.9/autodeps/mint.prov new file mode 100644 index 0000000..a752f8f --- /dev/null +++ b/rpm-5.4.9/autodeps/mint.prov @@ -0,0 +1,5 @@ +#!/bin/sh +# +# No shared libs on MiNT yet, sigh. + +echo > /dev/null diff --git a/rpm-5.4.9/autodeps/mint.req b/rpm-5.4.9/autodeps/mint.req new file mode 100644 index 0000000..a752f8f --- /dev/null +++ b/rpm-5.4.9/autodeps/mint.req @@ -0,0 +1,5 @@ +#!/bin/sh +# +# No shared libs on MiNT yet, sigh. + +echo > /dev/null diff --git a/rpm-5.4.9/autodeps/none b/rpm-5.4.9/autodeps/none new file mode 100644 index 0000000..87ad08f --- /dev/null +++ b/rpm-5.4.9/autodeps/none @@ -0,0 +1,3 @@ +#!/bin/sh + +cat > /dev/null diff --git a/rpm-5.4.9/autodeps/openbsd.prov b/rpm-5.4.9/autodeps/openbsd.prov new file mode 100644 index 0000000..1e7b06e --- /dev/null +++ b/rpm-5.4.9/autodeps/openbsd.prov @@ -0,0 +1,9 @@ +#!/bin/sh +# ---------------------------------------------------------- +# find-provides for OpenBSD-2.5 +# ---------------------------------------------------------- +filelist=$(grep "\\.so" | grep -v "^/lib/ld.so" | xargs file -L 2>/dev/null | grep "OpenBSD.*shared" | cut -d: -f1) + +for f in $filelist; do + echo ${f##*/} +done | sort -u diff --git a/rpm-5.4.9/autodeps/openbsd.req b/rpm-5.4.9/autodeps/openbsd.req new file mode 100644 index 0000000..551ac2c --- /dev/null +++ b/rpm-5.4.9/autodeps/openbsd.req @@ -0,0 +1,22 @@ +#!/bin/sh +# ---------------------------------------------------------------- +# find-requires for OpenBSD-2.2.x +# how do we know what is required by a.out shared libraries? +# ---------------------------------------------------------------- +ulimit -c 0 + +filelist=`sed "s/['\"]/\\\&/g"` +exelist=`echo $filelist | xargs file | fgrep executable | cut -d: -f1 ` +scriptlist=`echo $filelist | xargs file | egrep ":.* (commands|script) " | cut -d: -f1 ` + +for f in $exelist; do + if [ -x $f ]; then + ldd $f | /usr/bin/awk '/\=\>/&&!/not found/ { print $3 }' + fi +done | sort -u | sed "s/['\"]/\\\&/g" | xargs -n 1 basename | sort -u + +for f in $scriptlist; do + if [ -x $f ]; then + head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1 + fi +done | sort -u diff --git a/rpm-5.4.9/autodeps/osf.prov b/rpm-5.4.9/autodeps/osf.prov new file mode 100644 index 0000000..3d7c57b --- /dev/null +++ b/rpm-5.4.9/autodeps/osf.prov @@ -0,0 +1,188 @@ +#! /usr/bin/ksh + +# Original Author: Tim Mooney +# $Id: osf.prov,v 1.7 2000/10/31 20:47:23 mooney Exp $ +# +# This file is distributed under the terms of the GNU Public License +# +# find-provides is part of RPM, the Red Hat Package Manager. find-provides +# reads a list of full pathnames (in a package) on stdin, and outputs all +# shared libraries provided by (contained in) the package. +# +# +# On Digital/Tru64 Unix (OSF1), use `odump -D' to find what libraries a +# package provides. Note that Tru64 Unix 5.x and later come with `ldd', +# but sticking with `odump' works with versions of the OS back to at least +# 3.x, so it's the preferred method. +# +# Example `odump -D' output: +# +#$odump -D /usr/shlib/libc.so +# +# +# +# +# ***DYNAMIC SECTION*** +# Tag Value +# +#/usr/shlib/libc.so: +# UNREFEXTNO: 14. +# LOCAL_GOTNO: 521. +# GOTSYM: 2205. +# LOCAL_GOTNO: 1606. +# GOTSYM: 3289. +# SONAME: libc.so +# TIME_STAMP: (0x34a82daa) Mon Dec 29 17:09:30 1997 +# +# ICHECKSUM: 0x5e955f9b +# IVERSION: osf.1 +# CONFLICTNO: 0. +# RLD_VERSION: 2. +# HASH: 0x000003ff800a82e0 +# STRTAB: 0x000003ff8008aad0 +# SYMTAB: 0x000003ff80094ab0 +# MSYM: 0x000003ff800842c0 +# STRSZ: 40922. +# SYMENT: 24. +# PLTGOT: 0x000003ffc008f240 +# SYMTABNO: 3330. +# BASE_ADDRESS: 0x000003ff80080000 +# HIPAGENO: 0. +# RELSZ: 15296. +# RELENT: 16. +# REL: 0x000003ff80080700 +# LIBLISTNO: 0. +# INIT: 0x000003ff8019c520 +# FINI: 0x000003ff8019c570 +# FLAGS: 0x00000001 +# + +PATH=/usr/bin:/usr/sbin:/sbin:/usr/ccs/bin +export PATH + +# +# TVM: Marc Stephenson (marc@austin.ibm.com) points out we run things +# like `file', et. al. and expect the output to be what we see in the +# C/POSIX locale. Make sure it is so. +# +LANG=C +export LANG + +# +# Use `while read ...' instead of a `for f in ...', because there may +# be too many files to stuff into one shell variable. +# +IFS="" +while read f +do + + # + # if it's a shared library, run odump on it. + # + maybe_shared_lib=`file $f | egrep 'COFF.*shared library'` + if test X"$maybe_shared_lib" != X ; then + odump -D $f 2>/dev/null | awk ' + + BEGIN { + FS = " "; + RS = "\n"; + OFS = ""; + + found_soname = 0; + found_iversion = 0; + + } + + # Uncomment the next line for some debugging info. + #{ print NR , ":", $0 } + + /^[ ]+SONAME: .*[ ]*$/ { + found_soname = 1; + numfields = split($0, internal_name) + if (numfields == 2) { + soname = $2 + # + # we should probably check to see if the soname ends with + # a number (indicating that it contains versioning info, + # possibly in addition to the versioning info in the + # versions field) and generate a warning here. Shared + # libraries should not be built with version info in + # the soname on Digital/Tru64 Unix. + # + } else { + # + # Should never be here. + # + print "Really odd looking soname:", $0 | "cat 1>&2" + exit + } + } + + /^[ ]+IVERSION: .*[ ]*$/ { + if (found_soname == 1) { + numfields = split($0, iversion) + if (numfields == 2) { + version = $2 + # + # handle libraries with multiple versions, like + # 1.1:1.2. Since they really provide both versions, + # we need to generate output for each version. + # + numfields = split(version, versions, ":") + if (numfields > 1) { + for (i = 1; i < numfields; i++) { + print soname, "(", versions[i], ")" + } + # + # let our END routine print out the *last* version + # provided + # + version = versions[numfields] + } + # + # stick a fork in us. + # + found_iversion = 1; + exit + } else { + # + # Should never be here. + # + print "Odd looking library version:", $0 | "cat 1>&2" + exit + } + } else { + # + # found an iversion without an soname. Is that possible? + # + print "Found version but no soname:", $0 | "cat 1>&2" + exit + } + } + + # + # we could probably watch for some other token (like RLD_VERSION) + # that *generally* occurs later in the input than the stuff we watch + # for, and exit if we see it, but it is just as easy to read all + # the output, even after we have seen what we are looking for. + # + + END { + # Uncomment the next line for debugging info + #{ print "END: NR: ", NR } + if ( (found_soname == 1) && (found_iversion == 1) ) { + print soname, "(", version, ")" + exit + } else if (found_soname == 1) { + # + # no library version information + # + print soname + } + # else do nothing + } + ' # end of awk + fi +done | sort -u +#comment out the previous line and uncomment the next line when debugging +#done diff --git a/rpm-5.4.9/autodeps/osf.req b/rpm-5.4.9/autodeps/osf.req new file mode 100644 index 0000000..39d00c3 --- /dev/null +++ b/rpm-5.4.9/autodeps/osf.req @@ -0,0 +1,142 @@ +#! /usr/bin/ksh + +# Original Author: Tim Mooney +# $Id: osf.req,v 1.9 2001/09/15 13:49:11 jbj Exp $ +# +# This file is distributed under the terms of the GNU Public License +# +# find-requires is part of RPM, the Red Hat Package Manager. find-requires +# reads a list of full pathnames (in a package) on stdin, and outputs all +# shared libraries the package requires to execute. +# +# On Digital/Tru64 Unix (OSF1), use `odump -Dl' to find the library +# dependencies for an executable. `odump -D' does most of what we need, +# but it doesn't give us library version information, so you must use +# `odump -Dl'. Note that Tru64 5.x and on have `ldd', but this works just +# as well, and works on older versions of the OS. +# +# Example `odump -Dl' output: +# +#$odump -Dl /usr/bin/X11/xterm +# +# +# +# +# ***LIBRARY LIST SECTION*** +# Name Time-Stamp CheckSum Flags Version +#/usr/bin/X11/xterm: +# libXaw.so Dec 9 00:15:35 1997 0x285006d0 0 6.0 +# libXmu.so Dec 9 00:13:36 1997 0x3bf3a33d 0 +# libXt.so Dec 9 00:12:18 1997 0x10dd9a17 0 +# libSM.so Dec 9 00:08:11 1997 0xb64c7082 0 +# libICE.so Dec 9 00:07:52 1997 0x1199be32 0 +# libXext.so Dec 9 00:08:51 1997 0xafcb84d5 0 +# libX11.so Dec 9 00:06:05 1997 0xaa1bf091 0 +# libc.so Dec 8 18:41:11 1997 0x5e955f9b 0 osf.1 + +PATH=/usr/bin:/usr/sbin:/sbin:/usr/ccs/bin +export PATH + +# +# TVM: Marc Stephenson (marc@austin.ibm.com) points out we run things +# like `file', et. al. and expect the output to be what we see in the +# C/POSIX locale. Make sure it is so. +# +LANG=C +export LANG + +# +# TVM: switch to using `while read ...' instead of `for f in ...', because +# packages with a large number of files could be too big for one shell variable +# to hold. +# +IFS="" +while read f +do + + # + # Uncomment the next line for addtional debugging: + # echo "read ->$f<-" + + # + # Only run file once per file: + # + file_output=`file $f` + + # + # handle shell scripts first + # + is_shell_script=`echo "$file_output" | grep 'shell script' | \ + cut -d: -f 2 | awk '{ print $1 }'` + + # + # If it's a script... + # + if test X"$is_shell_script" != X ; then + echo "$is_shell_script" + # + # use `continue' to skip back up to the top of the loop. + # We have already done as much as we need to for this + # file, and this saves me from having to have an else, + # and another indent level... ;-) + # + continue + fi + + # + # The `else' here is implied by the `continue' above... + # + + # + # it might be a shared library. + # + + maybe_shared_lib=`echo "$file_output" | grep 'executable'` + if test X"$maybe_shared_lib" != X ; then + + odump -Dl $f 2>/dev/null \ + | awk ' + + # + # Since this entire awk script is enclosed in single quotes, + # you need to be careful to not use single quotes, even in awk + # comments, if you modify this script. + # + + BEGIN { + found_program_name = 0; + FS = " "; + RS = "\n"; + OFS=""; + } + + # uncomment the next line for debugging information + #{ print "Saw input:", $0 } + + found_program_name == 1 && $0 !~ /^$/ { + + # uncomment for debugging information + #print "found shared library: $0" + + # get the library name (field 1) and the library version + # (field 8) if present. + numfields = split($0,fields) + if (numfields == 7) { + print fields[1] + } else if (numfields == 8) { + print fields[1], "(", fields[8], ")" + } + } + + /^.*: *$/ { + found_program_name = 1 + # + # uncomment the next line for debugging information + #print "found the program name: ", $1 + } + + ' # end of awk + fi +done | sort -u +# comment out the previous line and uncomment the next when debugging +# done diff --git a/rpm-5.4.9/autodeps/solaris.prov b/rpm-5.4.9/autodeps/solaris.prov new file mode 100644 index 0000000..6e0fe9f --- /dev/null +++ b/rpm-5.4.9/autodeps/solaris.prov @@ -0,0 +1,14 @@ +#!/bin/sh + +# This script reads filenames from STDIN and outputs any relevant provides +# information that needs to be included in the package. + +PATH=/usr/bin:/usr/ccs/bin:/usr/sbin:/sbin +export PATH + +filelist=`grep "lib.*\\.so" | xargs /usr/ucb/file -L 2>/dev/null |\ + grep "ELF.*dynamic lib" | cut -d: -f1 | sort -u` +for I in $filelist; do + basename $I +done + diff --git a/rpm-5.4.9/autodeps/solaris.req b/rpm-5.4.9/autodeps/solaris.req new file mode 100644 index 0000000..d0f7f89 --- /dev/null +++ b/rpm-5.4.9/autodeps/solaris.req @@ -0,0 +1,16 @@ +#!/bin/sh + +# note this works for both a.out and ELF executables + +PATH=/usr/bin:/usr/ccs/bin:/usr/sbin:/sbin +export PATH + +ulimit -c 0 + +filelist=`sed "s/['\"]/\\\&/g"` +[ -z "$filelist" ] && exit #emulate -r option for xargs + +for f in `echo $filelist | xargs file | fgrep executable | cut -d: -f1`; do + ldd $f 2>/dev/null | awk '/\=\>/ { print $1 }' +done | sort -u | sed "s/['\"]/\\\&/g" | xargs -n 1 basename | sort -u + diff --git a/rpm-5.4.9/autogen.sh b/rpm-5.4.9/autogen.sh new file mode 100755 index 0000000..a869a28 --- /dev/null +++ b/rpm-5.4.9/autogen.sh @@ -0,0 +1,80 @@ +#!/bin/sh + +# configure the requirements +AMV="automake (GNU automake) 1.12" +ACV="autoconf (GNU Autoconf) 2.69" +LTV="libtoolize (GNU libtool) 2.4" +GTT="gettextize (GNU gettext-tools) 0.18.1.1" +USAGE=" +To build RPM from plain CVS sources the following +installed developer tools are mandatory: + $AMV + $ACV + $LTV + $GTT +" + +# wrapper for running GNU libtool's libtoolize(1) +libtoolize () { + _libtoolize=`which glibtoolize 2>/dev/null` + _libtoolize_args="$*" + case "$_libtoolize" in + /* ) ;; + * ) _libtoolize=`which libtoolize 2>/dev/null` + case "$_libtoolize" in + /* ) ;; + * ) _libtoolize="libtoolize" ;; + esac + ;; + esac + _libtoolize_version="`$_libtoolize --version | sed -e '1q' | sed -e 's;^[^0-9]*;;'`" + case "$_libtoolize_version" in + 1.* ) _libtoolize_args=`echo "X$_libtoolize_args" | sed -e 's;^X;;' -e 's;--quiet;;' -e 's;--install;;'` ;; + esac + eval $_libtoolize $_libtoolize_args +} + +# requirements sanity check +[ "`automake --version | head -1`" != "$AMV" ] && echo "$USAGE" # && exit 1 +[ "`autoconf --version | head -1`" != "$ACV" ] && echo "$USAGE" # && exit 1 +[ "`libtoolize --version | head -1`" != "$LTV" ] && echo "$USAGE" # && exit 1 +[ "`gettextize --version | head -1 | sed -e 's;^.*/\\(gettextize\\);\\1;'`" != "$GTT" ] && echo "$USAGE" # && exit 1 + +for dir in bash beecrypt file gpsee libgit2 neon pcre popt rc syck xar xz; do + + [ -d $dir ] || continue + echo "===> $dir" + case $dir in + libgit2) + ( cd $dir && cmake . && + echo "check: test" >> Makefile && + echo "distclean: clean" >> Makefile + ) + ;; + *) + ( cd $dir && sh ./autogen.sh --noconfigure "$@" ) + ;; + esac + echo "<=== $dir" +done + +echo "===> rpm" +rm -rf autom4te.cache || true +echo "---> generate files via GNU libtool (libtoolize)" +libtoolize --quiet --copy --force --install +echo "---> generate files via GNU gettext (autopoint)" +po_dir=./po +LANG=C +ls "$po_dir"/*.po 2>/dev/null | + sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" +autopoint --force +echo "---> generate files via GNU autoconf (aclocal, autoheader)" +rm -f aclocal.m4 +aclocal -I m4 +autoheader -I m4 +echo "---> generate files via GNU automake (automake)" +automake -Wall -Wno-override -a -c +echo "---> generate files via GNU autoconf (autoconf)" +autoconf -I m4 +echo "<=== rpm" + diff --git a/rpm-5.4.9/build.c b/rpm-5.4.9/build.c new file mode 100644 index 0000000..5b7de92 --- /dev/null +++ b/rpm-5.4.9/build.c @@ -0,0 +1,369 @@ +/** \ingroup rpmcli + * Parse spec file and build package. + */ + +#include "system.h" + +#include +#include +#include +#include + +#include +#include + +#include + +#include "rpmps.h" +#include "rpmte.h" +#include "rpmts.h" + +#include "build.h" + +#include + +#include "debug.h" + +/*@access rpmts @*/ /* XXX compared with NULL @*/ +/*@access rpmdb @*/ /* XXX compared with NULL @*/ +/*@access FD_t @*/ /* XXX compared with NULL @*/ + +#ifdef __cplusplus + +#define QVA_ISSET(_qvaflags, _FLAG) ((_qvaflags) & (VERIFY_##_FLAG)) + +#define VSF_ISSET(_vsflags, _FLAG) ((_vsflags) & (RPMVSF_##_FLAG)) +#define VSF_SET(_vsflags, _FLAG) \ + (*((unsigned *)&(_vsflags)) |= (RPMVSF_##_FLAG)) +#define VSF_CLR(_vsflags, _FLAG) \ + (*((unsigned *)&(_vsflags)) &= ~(RPMVSF_##_FLAG)) + +#else /* __cplusplus */ + +#define QVA_ISSET(_qvaflags, _FLAG) ((_qvaflags) & (VERIFY_##_FLAG)) + +#define VSF_ISSET(_vsflags, _FLAG) ((_vsflags) & (RPMVSF_##_FLAG)) +#define VSF_SET(_vsflags, _FLAG) (_vsflags) |= (RPMVSF_##_FLAG) +#define VSF_CLR(_vsflags, _FLAG) (_vsflags) &= ~(RPMVSF_##_FLAG) + +#endif /* __cplusplus */ + +/** + */ +static int checkSpec(rpmts ts, Header h) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + int rc; + + if (!headerIsEntry(h, RPMTAG_REQUIRENAME) + && !headerIsEntry(h, RPMTAG_CONFLICTNAME)) + return 0; + + rc = rpmtsAddInstallElement(ts, h, NULL, 0, NULL); + + rc = rpmcliInstallProblems(ts, _("Failed build dependencies"), rpmtsCheck(ts)); + + /* XXX nuke the added package. */ + rpmtsClean(ts); + + return rc; +} + +/* + * Kurwa, durni ameryka?ce sobe zawsze my?l?, ?e ca?y ?wiat mówi po + * angielsku... + */ +/* XXX this is still a dumb test but at least it's i18n aware */ +/** + */ +static int isSpecFile(const char * specfile) + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies fileSystem, internalState @*/ +{ + char buf[256]; + const char * s; + FD_t fd; + int count; + int checking; + + fd = Fopen(specfile, "r"); + if (fd == NULL || Ferror(fd)) { + rpmlog(RPMLOG_ERR, _("Unable to open spec file %s: %s\n"), + specfile, Fstrerror(fd)); + return 0; + } + count = Fread(buf, sizeof(buf[0]), sizeof(buf), fd); + (void) Fclose(fd); + + checking = 1; + for (s = buf; count--; s++) { + switch (*s) { + case '\r': + case '\n': + checking = 1; + /*@switchbreak@*/ break; + case ':': + checking = 0; + /*@switchbreak@*/ break; +/*@-boundsread@*/ + default: + if (checking && !(isprint(*s) || isspace(*s))) return 0; + /*@switchbreak@*/ break; +/*@=boundsread@*/ + } + } + return 1; +} + +/** + */ +/*@-boundswrite@*/ +static int buildForTarget(rpmts ts, BTA_t ba) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + const char * passPhrase = ba->passPhrase; + const char * cookie = ba->cookie; + int buildAmount = ba->buildAmount; + const char * specFile = NULL; + const char * specURL = NULL; + int specut; + const char * s; + char * se; + const char * arg = ba->specFile; + size_t nb = strlen(arg) + BUFSIZ; + char * buf = (char *) alloca(nb); + Spec spec = NULL; + int verify = ((ba->buildAmount & RPMBUILD_TRACK) ? 0 : 1); + int xx; + int rc; + + if (ba->buildMode == 't') { + static const char * sfpats[] = { "Specfile", "\\*.spec", NULL }; + static const char _specfn[] = "%{mkstemp:%{_specdir}/rpm-spec.XXXXXX}"; + char * tmpSpecFile = (char *) rpmGetPath(_specfn, NULL); + FILE *fp; + int bingo = 0; + int i; + + for (i = 0; sfpats[i]; i++) { + se = rpmExpand("%{uncompress: %{u2p:", arg, "}}", + " | %{__tar} -xOvf - %{?__tar_wildcards} ", sfpats[i], + " 2>&1 > '", tmpSpecFile, "'", NULL); + fp = popen(se, "r"); + se = _free(se); + if (fp== NULL) + continue; + s = fgets(buf, nb - 1, fp); + xx = pclose(fp); + if (!s || !*s || strstr(s, ": Not found in archive")) + continue; + bingo = 1; + break; + } + if (!bingo) { + rpmlog(RPMLOG_ERR, _("Failed to read spec file from %s\n"), arg); + xx = Unlink(tmpSpecFile); + tmpSpecFile = _free(tmpSpecFile); + return 1; + } + + s = se = basename(buf); + se += strlen(se); + while (--se > s && strchr("\r\n", *se) != NULL) + *se = '\0'; + specURL = rpmGetPath("%{_specdir}/", s, NULL); + specut = urlPath(specURL, &specFile); + xx = Rename(tmpSpecFile, specFile); + if (xx) { + rpmlog(RPMLOG_ERR, _("Failed to rename %s to %s: %m\n"), + tmpSpecFile, s); + (void) Unlink(tmpSpecFile); + } + tmpSpecFile = _free(tmpSpecFile); + if (xx) + return 1; + + se = buf; *se = '\0'; + se = stpcpy(se, "_sourcedir "); + (void) urlPath(arg, &s); + if (*s != '/') { + if (getcwd(se, nb - sizeof("_sourcedir ")) != NULL) + se += strlen(se); + else + se = stpcpy(se, "."); + } else + se = stpcpy(se, dirname(strcpy(se, s))); + while (se > buf && se[-1] == '/') + *se-- = '0'; + rpmCleanPath(buf + sizeof("_sourcedir ") - 1); + rpmDefineMacro(NULL, buf, RMIL_TARBALL); + } else { + specut = urlPath(arg, &s); + se = buf; *se = '\0'; + if (*s != '/') { + if (getcwd(se, nb - sizeof("_sourcedir ")) != NULL) + se += strlen(se); + else + se = stpcpy(se, "."); + *se++ = '/'; + se += strlen(strcpy(se,strcpy(se, s))); + } else + se = stpcpy(se, s); + specURL = rpmGetPath(buf, NULL); + specut = urlPath(specURL, &specFile); + } + + if (specut != URL_IS_DASH) { + struct stat sb; + if (Stat(specURL, &sb) < 0) { + rpmlog(RPMLOG_ERR, _("failed to stat %s: %m\n"), specURL); + rc = 1; + goto exit; + } + if (! S_ISREG(sb.st_mode)) { + rpmlog(RPMLOG_ERR, _("File %s is not a regular file.\n"), + specURL); + rc = 1; + goto exit; + } + + /* Try to verify that the file is actually a specfile */ + if (!isSpecFile(specURL)) { + rpmlog(RPMLOG_ERR, + _("File %s does not appear to be a specfile.\n"), specURL); + rc = 1; + goto exit; + } + } + + /* Parse the spec file */ +#define _anyarch(_f) \ +(((_f)&(RPMBUILD_PREP|RPMBUILD_BUILD|RPMBUILD_INSTALL|RPMBUILD_PACKAGEBINARY)) == 0) + if (parseSpec(ts, specURL, ba->rootdir, 0, passPhrase, + cookie, _anyarch(buildAmount), 0, verify)) + { + rc = 1; + goto exit; + } +#undef _anyarch + if ((spec = rpmtsSetSpec(ts, NULL)) == NULL) { + rc = 1; + goto exit; + } + + /* Assemble source header from parsed components */ + xx = initSourceHeader(spec, NULL); + + /* Check build prerequisites */ + if (!ba->noDeps && checkSpec(ts, spec->sourceHeader)) { + rc = 1; + goto exit; + } + + if (buildSpec(ts, spec, buildAmount, ba->noBuild)) { + rc = 1; + goto exit; + } + + if (ba->buildMode == 't') + (void) Unlink(specURL); + rc = 0; + +exit: + spec = freeSpec(spec); + specURL = _free(specURL); + return rc; +} +/*@=boundswrite@*/ + +int build(rpmts ts, BTA_t ba, const char * rcfile) +{ + const char *t, *te; + int rc = 0; + const char * targets = rpmcliTargets; + char *target; +#define buildCleanMask (RPMBUILD_RMSOURCE|RPMBUILD_RMSPEC) + int cleanFlags = ba->buildAmount & buildCleanMask; + rpmVSFlags vsflags, ovsflags; + int nbuilds = 0; + + vsflags = (rpmVSFlags) rpmExpandNumeric("%{?_vsflags_build}"); + vsflags = (rpmVSFlags) 0; /* XXX FIXME: ignore default disablers. */ +#if defined(SUPPORT_NOSIGNATURES) + if (!QVA_ISSET(ba->qva_flags, DIGEST)) { + VSF_SET(vsflags, NOSHA1HEADER); + VSF_SET(vsflags, NOMD5HEADER); + VSF_SET(vsflags, NOSHA1); + VSF_SET(vsflags, NOMD5); + } + if (!QVA_ISSET(ba->qva_flags, SIGNATURE)) { + VSF_SET(vsflags, NODSAHEADER); + VSF_SET(vsflags, NORSAHEADER); + VSF_SET(vsflags, NODSA); + VSF_SET(vsflags, NORSA); + } + if (!QVA_ISSET(ba->qva_flags, HDRCHK)) { + VSF_SET(vsflags, NOHDRCHK); + } + VSF_CLR(vsflags, NEEDPAYLOAD); /* XXX needed? */ +#endif + ovsflags = rpmtsSetVSFlags(ts, vsflags); + + if (targets == NULL) { + rc = buildForTarget(ts, ba); + nbuilds++; + goto exit; + } + + /* parse up the build operators */ + + printf(_("Building target platforms: %s\n"), targets); + + ba->buildAmount &= ~buildCleanMask; + for (t = targets; *t != '\0'; t = te) { + /* Parse out next target platform. */ + if ((te = strchr(t, ',')) == NULL) + te = t + strlen(t); + target = (char *) alloca(te-t+1); + strncpy(target, t, (te-t)); + target[te-t] = '\0'; + if (*te != '\0') + te++; + else /* XXX Perform clean-up after last target build. */ + ba->buildAmount |= cleanFlags; + + rpmlog(RPMLOG_DEBUG, _(" target platform: %s\n"), target); + + /* Read in configuration for target. */ + if (t != targets) { + rpmFreeMacros(NULL); + rpmFreeRpmrc(); + (void) rpmReadConfigFiles(rcfile, target); + } + rc = buildForTarget(ts, ba); + nbuilds++; + if (rc) + break; + } + +exit: + /* Restore original configuration. */ + if (nbuilds > 1) { + t = targets; + if ((te = strchr(t, ',')) == NULL) + te = t + strlen(t); + target = (char *) alloca(te-t+1); + strncpy(target, t, (te-t)); + target[te-t] = '\0'; + if (*te != '\0') + te++; + rpmFreeMacros(NULL); + rpmFreeRpmrc(); + (void) rpmReadConfigFiles(rcfile, target); + } + vsflags = rpmtsSetVSFlags(ts, ovsflags); + + return rc; +} diff --git a/rpm-5.4.9/build.h b/rpm-5.4.9/build.h new file mode 100644 index 0000000..b52f020 --- /dev/null +++ b/rpm-5.4.9/build.h @@ -0,0 +1,19 @@ +#ifndef H_BUILD +#define H_BUILD + +#ifdef __cplusplus +extern "C" { +#endif + +int build(rpmts ts, BTA_t ba, /*@null@*/ const char * rcfile) + /*@globals rpmGlobalMacroContext, rpmCLIMacroContext, + h_errno, fileSystem, internalState @*/ + /*@modifies ts, ba->buildAmount, rpmGlobalMacroContext, rpmCLIMacroContext, + fileSystem, internalState @*/; + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/rpm-5.4.9/build/Makefile.am b/rpm-5.4.9/build/Makefile.am new file mode 100644 index 0000000..d61499c --- /dev/null +++ b/rpm-5.4.9/build/Makefile.am @@ -0,0 +1,126 @@ +# Makefile for rpmbuild library. + +AUTOMAKE_OPTIONS = 1.4 foreign + +LINT = splint +MCCABE = pmccabe + +EXTRA_DIST = librpmbuild.vers + +SUBDIRS = auto # tests + +AM_CPPFLAGS = \ + -I$(srcdir) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/build \ + -I$(top_srcdir)/lib \ + -I$(top_builddir)/lib \ + -I$(top_srcdir)/rpmdb \ + -I$(top_srcdir)/rpmio \ + -I$(top_srcdir)/misc \ + @WITH_DB_CPPFLAGS@ \ + @WITH_FILE_CPPFLAGS@ \ + @WITH_LUA_CPPFLAGS@ \ + @WITH_PCRE_CPPFLAGS@ \ + @WITH_POPT_CPPFLAGS@ \ + @WITH_XAR_CPPFLAGS@ \ + @WITH_ZLIB_CPPFLAGS@ + +AM_CFLAGS = $(OPENMP_CFLAGS) + +pkgincdir = $(pkgincludedir)$(WITH_PATH_VERSIONED_SUFFIX) +pkginc_HEADERS = rpmbuild.h rpmspec.h +noinst_HEADERS = buildio.h + +usrlibdir = $(libdir) +usrlib_LTLIBRARIES = librpmbuild.la +librpmbuild_la_SOURCES = \ + build.c expression.c files.c misc.c names.c pack.c \ + parseBuildInstallClean.c parseChangelog.c parseDescription.c \ + parseFiles.c parsePreamble.c parsePrep.c parseReqs.c parseScript.c \ + parseSpec.c poptBT.c reqprov.c spec.c +librpmbuild_la_LDFLAGS = -release $(LT_CURRENT).$(LT_REVISION) +if HAVE_LD_VERSION_SCRIPT +librpmbuild_la_LDFLAGS += -Wl,@LD_VERSION_SCRIPT_FLAG@,@top_srcdir@/build/librpmbuild.vers +endif +librpmbuild_la_LIBADD = +if ENABLE_BUILD_INTLIBDEP +librpmbuild_la_LIBADD += \ + $(top_builddir)/lib/librpm.la \ + $(top_builddir)/rpmdb/librpmdb.la \ + $(top_builddir)/rpmio/librpmio.la \ + $(top_builddir)/misc/librpmmisc.la +endif +if ENABLE_BUILD_MAXEXTLIBDEP +librpmbuild_la_LDFLAGS += $(LDFLAGS) +librpmbuild_la_LIBADD += $(LIBS) +endif +librpmbuild.la: $(librpmbuild_la_OBJECTS) $(librpmbuild_la_DEPENDENCIES) + $(librpmbuild_la_LINK) -rpath $(usrlibdir) $(librpmbuild_la_OBJECTS) $(librpmbuild_la_LIBADD) + +install-data-hook: +if !ENABLE_BUILD_LAFILES + -for l in $(usrlib_LTLIBRARIES); do \ + rm -f $(DESTDIR)$(usrlibdir)/$${l}; \ + done +endif +if WITH_PATH_VERSIONED + -for l in $(usrlib_LTLIBRARIES); do \ + base=`echo "$${l}" | sed -e 's;\.la$$;;'`; \ + if [ -f $(DESTDIR)$(usrlibdir)/$${base}.a ]; then \ + mv $(DESTDIR)$(usrlibdir)/$${base}.a \ + $(DESTDIR)$(usrlibdir)/$${base}-$(VERSION).a; \ + fi; \ + done +endif + +check-local: + +clean-local: + rm -f *.o # .created $(FILELOBJS) + +#BUILT_SOURCES = rpmbuild.lcd + +rpmbuild.lcd: Makefile.am ${librpmbuild_la_SOURCES} ${pkginc_HEADERS} ${noinst_HEADERS} + -lclint ${DEFS} ${INCLUDES} ${librpmbuild_la_SOURCES} -dump $@ 2>/dev/null + +.PHONY: sources +sources: + @echo $(librpmbuild_la_SOURCES:%=build/%) + +.PHONY: lint +lint: + $(LINT) ${DEFS} ${INCLUDES} ${librpmbuild_la_SOURCES} + +.PHONY: mccabe +mccabe: + $(MCCABE) $(librpmbuild_la_SOURCES) | sort -n -r | head -n 20 + +.PHONY: lcov-reset # run lcov from scratch, always +lcov-reset: + make lcov-run + make lcov-report + +.PHONY: lcov # run lcov from scratch if the dir is not there +lcov: + make lcov-reset + +.PHONY: lcov-run # reset run coverage tests +lcov-run: + @-rm -rf lcov + find . -name "*.gcda" -exec rm {} \; + make check + +.PHONY: lcov-report # generate report based on current coverage data +lcov-report: + mkdir lcov + lcov --directory . --capture --output-file lcov/lcov.info + lcov -l lcov/lcov.info | grep -v "`cd $(top_srcdir) && pwd`" | cut -d: -f1 > lcov/remove + lcov -r lcov/lcov.info `cat lcov/remove` > lcov/lcov.cleaned.info + rm lcov/remove + mv lcov/lcov.cleaned.info lcov/lcov.info + genhtml -t "$(PACKAGE_STRING)" -o lcov lcov/lcov.info + +#.PHONY: lcov-upload +#lcov-upload: lcov +# rsync -rvz -e ssh --delete lcov/* ??? diff --git a/rpm-5.4.9/build/Makefile.in b/rpm-5.4.9/build/Makefile.in new file mode 100644 index 0000000..4b476b2 --- /dev/null +++ b/rpm-5.4.9/build/Makefile.in @@ -0,0 +1,1197 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ + +# Makefile for rpmbuild library. + + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +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@ +target_triplet = @target@ +@HAVE_LD_VERSION_SCRIPT_TRUE@am__append_1 = -Wl,@LD_VERSION_SCRIPT_FLAG@,@top_srcdir@/build/librpmbuild.vers +@ENABLE_BUILD_INTLIBDEP_TRUE@am__append_2 = \ +@ENABLE_BUILD_INTLIBDEP_TRUE@ $(top_builddir)/lib/librpm.la \ +@ENABLE_BUILD_INTLIBDEP_TRUE@ $(top_builddir)/rpmdb/librpmdb.la \ +@ENABLE_BUILD_INTLIBDEP_TRUE@ $(top_builddir)/rpmio/librpmio.la \ +@ENABLE_BUILD_INTLIBDEP_TRUE@ $(top_builddir)/misc/librpmmisc.la + +@ENABLE_BUILD_MAXEXTLIBDEP_TRUE@am__append_3 = $(LDFLAGS) +@ENABLE_BUILD_MAXEXTLIBDEP_TRUE@am__append_4 = $(LIBS) +subdir = build +DIST_COMMON = $(noinst_HEADERS) $(pkginc_HEADERS) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in TODO +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(usrlibdir)" "$(DESTDIR)$(pkgincdir)" +LTLIBRARIES = $(usrlib_LTLIBRARIES) +am__DEPENDENCIES_1 = +@ENABLE_BUILD_MAXEXTLIBDEP_TRUE@am__DEPENDENCIES_2 = \ +@ENABLE_BUILD_MAXEXTLIBDEP_TRUE@ $(am__DEPENDENCIES_1) +librpmbuild_la_DEPENDENCIES = $(am__append_2) $(am__DEPENDENCIES_2) +am_librpmbuild_la_OBJECTS = build.lo expression.lo files.lo misc.lo \ + names.lo pack.lo parseBuildInstallClean.lo parseChangelog.lo \ + parseDescription.lo parseFiles.lo parsePreamble.lo \ + parsePrep.lo parseReqs.lo parseScript.lo parseSpec.lo \ + poptBT.lo reqprov.lo spec.lo +librpmbuild_la_OBJECTS = $(am_librpmbuild_la_OBJECTS) +librpmbuild_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(librpmbuild_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(librpmbuild_la_SOURCES) +DIST_SOURCES = $(librpmbuild_la_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +HEADERS = $(noinst_HEADERS) $(pkginc_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDROOTDIR_MACRO = @BUILDROOTDIR_MACRO@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBAPI = @DBAPI@ +DBLIBOBJS = @DBLIBOBJS@ +DBLIBSRCS = @DBLIBSRCS@ +DBPATH = @DBPATH@ +DBPATH_MACRO = @DBPATH_MACRO@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTRO_MACROS = @DISTRO_MACROS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIXPERMS = @FIXPERMS@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GPSEE_MODULES_PATH = @GPSEE_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_STATIC = @LDFLAGS_STATIC@ +LD_VERSION_SCRIPT_FLAG = @LD_VERSION_SCRIPT_FLAG@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOLIZE = @LIBTOOLIZE@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MACROFILES = @MACROFILES@ +MAGIC_MACRO = @MAGIC_MACRO@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR = @MKDIR@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NCPUS_COMMAND = @NCPUS_COMMAND@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENMP_CFLAGS = @OPENMP_CFLAGS@ +OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_INSTALLDIRS = @PERL_INSTALLDIRS@ +PERL_URPM_INSTALLDIRS = @PERL_URPM_INSTALLDIRS@ +PKGSRCDIR = @PKGSRCDIR@ +PKGSRCDIR_MACRO = @PKGSRCDIR_MACRO@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +ROOT_GROUP = @ROOT_GROUP@ +RPMCANONARCH = @RPMCANONARCH@ +RPMCANONCOLOR = @RPMCANONCOLOR@ +RPMCANONGNU = @RPMCANONGNU@ +RPMCANONOS = @RPMCANONOS@ +RPMCANONVENDOR = @RPMCANONVENDOR@ +RPMGID = @RPMGID@ +RPMGROUP = @RPMGROUP@ +RPMLUAFILES = @RPMLUAFILES@ +RPMPOPTFILES = @RPMPOPTFILES@ +RPMUID = @RPMUID@ +RPMUSER = @RPMUSER@ +RPM_TIMESTAMP = @RPM_TIMESTAMP@ +RPM_VENDOR = @RPM_VENDOR@ +RPM_VERSION = @RPM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFIGDIR = @SYSCONFIGDIR@ +USE_NLS = @USE_NLS@ +USRLIBRPM = @USRLIBRPM@ +VERSION = @VERSION@ +WITH_ACL = @WITH_ACL@ +WITH_APIDOCS = @WITH_APIDOCS@ +WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ +WITH_APR = @WITH_APR@ +WITH_ATERM = @WITH_ATERM@ +WITH_ATTR = @WITH_ATTR@ +WITH_AUGEAS = @WITH_AUGEAS@ +WITH_AUGEAS_AUGTOOL = @WITH_AUGEAS_AUGTOOL@ +WITH_BASH = @WITH_BASH@ +WITH_BASH_CPPFLAGS = @WITH_BASH_CPPFLAGS@ +WITH_BASH_LDFLAGS = @WITH_BASH_LDFLAGS@ +WITH_BASH_LIBS = @WITH_BASH_LIBS@ +WITH_BASH_SUBDIR = @WITH_BASH_SUBDIR@ +WITH_BEECRYPT = @WITH_BEECRYPT@ +WITH_BEECRYPT_CPPFLAGS = @WITH_BEECRYPT_CPPFLAGS@ +WITH_BEECRYPT_LDFLAGS = @WITH_BEECRYPT_LDFLAGS@ +WITH_BEECRYPT_LIBS = @WITH_BEECRYPT_LIBS@ +WITH_BEECRYPT_SUBDIR = @WITH_BEECRYPT_SUBDIR@ +WITH_BZIP2 = @WITH_BZIP2@ +WITH_CPUINFO = @WITH_CPUINFO@ +WITH_CUDF = @WITH_CUDF@ +WITH_CUDF_CUDFTOOL = @WITH_CUDF_CUDFTOOL@ +WITH_DB = @WITH_DB@ +WITH_DBSQL = @WITH_DBSQL@ +WITH_DBSQL_CPPFLAGS = @WITH_DBSQL_CPPFLAGS@ +WITH_DBSQL_LDFLAGS = @WITH_DBSQL_LDFLAGS@ +WITH_DBSQL_LIBS = @WITH_DBSQL_LIBS@ +WITH_DBSQL_SUBDIR = @WITH_DBSQL_SUBDIR@ +WITH_DB_CPPFLAGS = @WITH_DB_CPPFLAGS@ +WITH_DB_LDFLAGS = @WITH_DB_LDFLAGS@ +WITH_DB_LIBS = @WITH_DB_LIBS@ +WITH_DB_SUBDIR = @WITH_DB_SUBDIR@ +WITH_DMALLOC = @WITH_DMALLOC@ +WITH_EFENCE = @WITH_EFENCE@ +WITH_EXPAT = @WITH_EXPAT@ +WITH_FICL = @WITH_FICL@ +WITH_FICL_CPPFLAGS = @WITH_FICL_CPPFLAGS@ +WITH_FICL_LDFLAGS = @WITH_FICL_LDFLAGS@ +WITH_FICL_LIBS = @WITH_FICL_LIBS@ +WITH_FICL_SUBDIR = @WITH_FICL_SUBDIR@ +WITH_FILE = @WITH_FILE@ +WITH_FILE_CPPFLAGS = @WITH_FILE_CPPFLAGS@ +WITH_FILE_LDFLAGS = @WITH_FILE_LDFLAGS@ +WITH_FILE_LIBS = @WITH_FILE_LIBS@ +WITH_FILE_SUBDIR = @WITH_FILE_SUBDIR@ +WITH_GCRYPT = @WITH_GCRYPT@ +WITH_GNUTLS = @WITH_GNUTLS@ +WITH_GPSEE = @WITH_GPSEE@ +WITH_GPSEE_CPPFLAGS = @WITH_GPSEE_CPPFLAGS@ +WITH_GPSEE_LDFLAGS = @WITH_GPSEE_LDFLAGS@ +WITH_GPSEE_LIBS = @WITH_GPSEE_LIBS@ +WITH_GPSEE_SUBDIR = @WITH_GPSEE_SUBDIR@ +WITH_JS_SUBDIR = @WITH_JS_SUBDIR@ +WITH_KEYUTILS = @WITH_KEYUTILS@ +WITH_KEYUTILS_RPMKEY = @WITH_KEYUTILS_RPMKEY@ +WITH_LIBELF_DEBUGEDIT = @WITH_LIBELF_DEBUGEDIT@ +WITH_LIBGIT2 = @WITH_LIBGIT2@ +WITH_LIBGIT2_CPPFLAGS = @WITH_LIBGIT2_CPPFLAGS@ +WITH_LIBGIT2_LDFLAGS = @WITH_LIBGIT2_LDFLAGS@ +WITH_LIBGIT2_LIBS = @WITH_LIBGIT2_LIBS@ +WITH_LIBGIT2_SUBDIR = @WITH_LIBGIT2_SUBDIR@ +WITH_LIBTASN1 = @WITH_LIBTASN1@ +WITH_LUA = @WITH_LUA@ +WITH_LUA_CPPFLAGS = @WITH_LUA_CPPFLAGS@ +WITH_LUA_LDFLAGS = @WITH_LUA_LDFLAGS@ +WITH_LUA_LIBS = @WITH_LUA_LIBS@ +WITH_LUA_SUBDIR = @WITH_LUA_SUBDIR@ +WITH_LUA_SUBDIR_DEF = @WITH_LUA_SUBDIR_DEF@ +WITH_LUA_SUBDIR_LIB = @WITH_LUA_SUBDIR_LIB@ +WITH_MOZJS185 = @WITH_MOZJS185@ +WITH_MOZJS185_CPPFLAGS = @WITH_MOZJS185_CPPFLAGS@ +WITH_MOZJS185_LDFLAGS = @WITH_MOZJS185_LDFLAGS@ +WITH_MOZJS185_LIBS = @WITH_MOZJS185_LIBS@ +WITH_MOZJS185_SUBDIR = @WITH_MOZJS185_SUBDIR@ +WITH_NEON = @WITH_NEON@ +WITH_NEON_CPPFLAGS = @WITH_NEON_CPPFLAGS@ +WITH_NEON_LDFLAGS = @WITH_NEON_LDFLAGS@ +WITH_NEON_LIBS = @WITH_NEON_LIBS@ +WITH_NEON_SUBDIR = @WITH_NEON_SUBDIR@ +WITH_NIX = @WITH_NIX@ +WITH_NSS = @WITH_NSS@ +WITH_OPENSSL = @WITH_OPENSSL@ +WITH_PAKCHOIS = @WITH_PAKCHOIS@ +WITH_PATH_VERSIONED = @WITH_PATH_VERSIONED@ +WITH_PATH_VERSIONED_SUFFIX = @WITH_PATH_VERSIONED_SUFFIX@ +WITH_PCRE = @WITH_PCRE@ +WITH_PCRE_CPPFLAGS = @WITH_PCRE_CPPFLAGS@ +WITH_PCRE_LDFLAGS = @WITH_PCRE_LDFLAGS@ +WITH_PCRE_LIBS = @WITH_PCRE_LIBS@ +WITH_PCRE_SUBDIR = @WITH_PCRE_SUBDIR@ +WITH_PERLEMBED = @WITH_PERLEMBED@ +WITH_PERL_LIBS = @WITH_PERL_LIBS@ +WITH_PERL_SUBDIR = @WITH_PERL_SUBDIR@ +WITH_PERL_SUBPACKAGE = @WITH_PERL_SUBPACKAGE@ +WITH_PERL_URPM_LIBS = @WITH_PERL_URPM_LIBS@ +WITH_PERL_URPM_SUBDIR = @WITH_PERL_URPM_SUBDIR@ +WITH_PERL_URPM_SUBPACKAGE = @WITH_PERL_URPM_SUBPACKAGE@ +WITH_POPT = @WITH_POPT@ +WITH_POPT_CPPFLAGS = @WITH_POPT_CPPFLAGS@ +WITH_POPT_LDFLAGS = @WITH_POPT_LDFLAGS@ +WITH_POPT_LIBS = @WITH_POPT_LIBS@ +WITH_POPT_SUBDIR = @WITH_POPT_SUBDIR@ +WITH_PYTHONEMBED = @WITH_PYTHONEMBED@ +WITH_PYTHON_INCDIR = @WITH_PYTHON_INCDIR@ +WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ +WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ +WITH_RC = @WITH_RC@ +WITH_RC_CPPFLAGS = @WITH_RC_CPPFLAGS@ +WITH_RC_LDFLAGS = @WITH_RC_LDFLAGS@ +WITH_RC_LIBS = @WITH_RC_LIBS@ +WITH_RC_SUBDIR = @WITH_RC_SUBDIR@ +WITH_READLINE = @WITH_READLINE@ +WITH_RUBY = @WITH_RUBY@ +WITH_RUBY_CPPFLAGS = @WITH_RUBY_CPPFLAGS@ +WITH_RUBY_SUBDIR = @WITH_RUBY_SUBDIR@ +WITH_RUBY_VENDORARCHDIR = @WITH_RUBY_VENDORARCHDIR@ +WITH_SELINUX = @WITH_SELINUX@ +WITH_SEMANAGE = @WITH_SEMANAGE@ +WITH_SEMANAGE_SEMODULE = @WITH_SEMANAGE_SEMODULE@ +WITH_SEPOL = @WITH_SEPOL@ +WITH_SPIDERMONKEY_SUBDIR = @WITH_SPIDERMONKEY_SUBDIR@ +WITH_SQLITE = @WITH_SQLITE@ +WITH_SQLITE_CPPFLAGS = @WITH_SQLITE_CPPFLAGS@ +WITH_SQLITE_LDFLAGS = @WITH_SQLITE_LDFLAGS@ +WITH_SQLITE_LIBS = @WITH_SQLITE_LIBS@ +WITH_SQLITE_SUBDIR = @WITH_SQLITE_SUBDIR@ +WITH_SQUIRREL = @WITH_SQUIRREL@ +WITH_SUBVERSION = @WITH_SUBVERSION@ +WITH_SYCK = @WITH_SYCK@ +WITH_SYCK_CPPFLAGS = @WITH_SYCK_CPPFLAGS@ +WITH_SYCK_LDFLAGS = @WITH_SYCK_LDFLAGS@ +WITH_SYCK_LIBS = @WITH_SYCK_LIBS@ +WITH_SYCK_SUBDIR = @WITH_SYCK_SUBDIR@ +WITH_TCL = @WITH_TCL@ +WITH_TCL_SUBDIR = @WITH_TCL_SUBDIR@ +WITH_TOMCRYPT = @WITH_TOMCRYPT@ +WITH_TPM = @WITH_TPM@ +WITH_UNIXODBC = @WITH_UNIXODBC@ +WITH_UUID = @WITH_UUID@ +WITH_XAR = @WITH_XAR@ +WITH_XAR_CPPFLAGS = @WITH_XAR_CPPFLAGS@ +WITH_XAR_LDFLAGS = @WITH_XAR_LDFLAGS@ +WITH_XAR_LIBS = @WITH_XAR_LIBS@ +WITH_XAR_SUBDIR = @WITH_XAR_SUBDIR@ +WITH_XZ = @WITH_XZ@ +WITH_XZ_CPPFLAGS = @WITH_XZ_CPPFLAGS@ +WITH_XZ_LDFLAGS = @WITH_XZ_LDFLAGS@ +WITH_XZ_LIBS = @WITH_XZ_LIBS@ +WITH_XZ_SUBDIR = @WITH_XZ_SUBDIR@ +WITH_ZLIB = @WITH_ZLIB@ +WITH_ZLIB_CPPFLAGS = @WITH_ZLIB_CPPFLAGS@ +WITH_ZLIB_LDFLAGS = @WITH_ZLIB_LDFLAGS@ +WITH_ZLIB_LIBS = @WITH_ZLIB_LIBS@ +WITH_ZLIB_SUBDIR = @WITH_ZLIB_SUBDIR@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__BASH = @__BASH@ +__BZIP2 = @__BZIP2@ +__CAT = @__CAT@ +__CHATTR = @__CHATTR@ +__CHGRP = @__CHGRP@ +__CHGRP_RHF = @__CHGRP_RHF@ +__CHMOD = @__CHMOD@ +__CHOWN = @__CHOWN@ +__CHOWN_RHF = @__CHOWN_RHF@ +__CMAKE = @__CMAKE@ +__CPIO = @__CPIO@ +__CURL = @__CURL@ +__CVS = @__CVS@ +__DBSQL = @__DBSQL@ +__DB_ARCHIVE = @__DB_ARCHIVE@ +__DB_CHECKPOINT = @__DB_CHECKPOINT@ +__DB_DEADLOCK = @__DB_DEADLOCK@ +__DB_DUMP = @__DB_DUMP@ +__DB_HOTBACKUP = @__DB_HOTBACKUP@ +__DB_LOAD = @__DB_LOAD@ +__DB_LOG_VERIFY = @__DB_LOG_VERIFY@ +__DB_PRINTLOG = @__DB_PRINTLOG@ +__DB_RECOVER = @__DB_RECOVER@ +__DB_REPLICATE = @__DB_REPLICATE@ +__DB_SQL_CODEGEN = @__DB_SQL_CODEGEN@ +__DB_STAT = @__DB_STAT@ +__DB_TUNER = @__DB_TUNER@ +__DB_UPGRADE = @__DB_UPGRADE@ +__DB_VERIFY = @__DB_VERIFY@ +__DIFF = @__DIFF@ +__DITTO = @__DITTO@ +__DOXYGEN = @__DOXYGEN@ +__FILE = @__FILE@ +__GIT = @__GIT@ +__GPG = @__GPG@ +__GSR = @__GSR@ +__GST_INSPECT = @__GST_INSPECT@ +__GZIP = @__GZIP@ +__HG = @__HG@ +__ID = @__ID@ +__ID_U = @__ID_U@ +__INSTALL = @__INSTALL@ +__INSTALL_INFO = @__INSTALL_INFO@ +__LD = @__LD@ +__LDCONFIG = @__LDCONFIG@ +__LN = @__LN@ +__LRZIP = @__LRZIP@ +__LSATTR = @__LSATTR@ +__LZIP = @__LZIP@ +__LZMA = @__LZMA@ +__LZOP = @__LZOP@ +__MAKE = @__MAKE@ +__MKDIR = @__MKDIR@ +__MKDIR_P = @__MKDIR_P@ +__MODINFO = @__MODINFO@ +__MONGO = @__MONGO@ +__MV = @__MV@ +__NM = @__NM@ +__OBJCOPY = @__OBJCOPY@ +__OBJDUMP = @__OBJDUMP@ +__PATCH = @__PATCH@ +__PAX = @__PAX@ +__PERL = @__PERL@ +__PGP = @__PGP@ +__PHP = @__PHP@ +__PYTHON = @__PYTHON@ +__RM = @__RM@ +__RMDIR = @__RMDIR@ +__RSH = @__RSH@ +__RUBY = @__RUBY@ +__SED = @__SED@ +__SH = @__SH@ +__SQLITE3 = @__SQLITE3@ +__SSH = @__SSH@ +__STRIP = @__STRIP@ +__SVN = @__SVN@ +__TAR = @__TAR@ +__TCLSH = @__TCLSH@ +__UNZIP = @__UNZIP@ +__XZ = @__XZ@ +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_CXX = @ac_ct_CXX@ +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@ +autorelocate_dcolor = @autorelocate_dcolor@ +autorelocate_path = @autorelocate_path@ +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@ +exeext = @exeext@ +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@ +libext = @libext@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +objext = @objext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +shlibext = @shlibext@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +testdir = @testdir@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrprefix = @usrprefix@ +varprefix = @varprefix@ +AUTOMAKE_OPTIONS = 1.4 foreign +LINT = splint +MCCABE = pmccabe +EXTRA_DIST = librpmbuild.vers +SUBDIRS = auto # tests +AM_CPPFLAGS = \ + -I$(srcdir) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/build \ + -I$(top_srcdir)/lib \ + -I$(top_builddir)/lib \ + -I$(top_srcdir)/rpmdb \ + -I$(top_srcdir)/rpmio \ + -I$(top_srcdir)/misc \ + @WITH_DB_CPPFLAGS@ \ + @WITH_FILE_CPPFLAGS@ \ + @WITH_LUA_CPPFLAGS@ \ + @WITH_PCRE_CPPFLAGS@ \ + @WITH_POPT_CPPFLAGS@ \ + @WITH_XAR_CPPFLAGS@ \ + @WITH_ZLIB_CPPFLAGS@ + +AM_CFLAGS = $(OPENMP_CFLAGS) +pkgincdir = $(pkgincludedir)$(WITH_PATH_VERSIONED_SUFFIX) +pkginc_HEADERS = rpmbuild.h rpmspec.h +noinst_HEADERS = buildio.h +usrlibdir = $(libdir) +usrlib_LTLIBRARIES = librpmbuild.la +librpmbuild_la_SOURCES = \ + build.c expression.c files.c misc.c names.c pack.c \ + parseBuildInstallClean.c parseChangelog.c parseDescription.c \ + parseFiles.c parsePreamble.c parsePrep.c parseReqs.c parseScript.c \ + parseSpec.c poptBT.c reqprov.c spec.c + +librpmbuild_la_LDFLAGS = -release $(LT_CURRENT).$(LT_REVISION) \ + $(am__append_1) $(am__append_3) +librpmbuild_la_LIBADD = $(am__append_2) $(am__append_4) +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 build/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign build/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-usrlibLTLIBRARIES: $(usrlib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(usrlib_LTLIBRARIES)'; test -n "$(usrlibdir)" || 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)$(usrlibdir)'"; \ + $(MKDIR_P) '$(DESTDIR)$(usrlibdir)' || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(usrlibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(usrlibdir)"; \ + } + +uninstall-usrlibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(usrlib_LTLIBRARIES)'; test -n "$(usrlibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(usrlibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(usrlibdir)/$$f"; \ + done + +clean-usrlibLTLIBRARIES: + -test -z "$(usrlib_LTLIBRARIES)" || rm -f $(usrlib_LTLIBRARIES) + @list='$(usrlib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/build.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expression.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/files.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/names.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parseBuildInstallClean.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parseChangelog.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parseDescription.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parseFiles.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsePreamble.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsePrep.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parseReqs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parseScript.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parseSpec.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poptBT.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reqprov.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spec.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgincHEADERS: $(pkginc_HEADERS) + @$(NORMAL_INSTALL) + @list='$(pkginc_HEADERS)'; test -n "$(pkgincdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgincdir)'"; \ + $(MKDIR_P) '$(DESTDIR)$(pkgincdir)' || 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)$(pkgincdir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincdir)" || exit $$?; \ + done + +uninstall-pkgincHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginc_HEADERS)'; test -n "$(pkgincdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgincdir)'; $(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. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(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" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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 +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-recursive +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(usrlibdir)" "$(DESTDIR)$(pkgincdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool clean-local \ + clean-usrlibLTLIBRARIES mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-pkgincHEADERS install-usrlibLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -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-pkgincHEADERS uninstall-usrlibLTLIBRARIES + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \ + ctags-recursive install-am install-data-am install-strip \ + tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am check-local clean clean-generic \ + clean-libtool clean-local clean-usrlibLTLIBRARIES ctags \ + ctags-recursive distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-data-hook 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-pkgincHEADERS install-ps install-ps-am \ + install-strip install-usrlibLTLIBRARIES installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am \ + uninstall-pkgincHEADERS uninstall-usrlibLTLIBRARIES + +librpmbuild.la: $(librpmbuild_la_OBJECTS) $(librpmbuild_la_DEPENDENCIES) + $(librpmbuild_la_LINK) -rpath $(usrlibdir) $(librpmbuild_la_OBJECTS) $(librpmbuild_la_LIBADD) + +install-data-hook: +@ENABLE_BUILD_LAFILES_FALSE@ -for l in $(usrlib_LTLIBRARIES); do \ +@ENABLE_BUILD_LAFILES_FALSE@ rm -f $(DESTDIR)$(usrlibdir)/$${l}; \ +@ENABLE_BUILD_LAFILES_FALSE@ done +@WITH_PATH_VERSIONED_TRUE@ -for l in $(usrlib_LTLIBRARIES); do \ +@WITH_PATH_VERSIONED_TRUE@ base=`echo "$${l}" | sed -e 's;\.la$$;;'`; \ +@WITH_PATH_VERSIONED_TRUE@ if [ -f $(DESTDIR)$(usrlibdir)/$${base}.a ]; then \ +@WITH_PATH_VERSIONED_TRUE@ mv $(DESTDIR)$(usrlibdir)/$${base}.a \ +@WITH_PATH_VERSIONED_TRUE@ $(DESTDIR)$(usrlibdir)/$${base}-$(VERSION).a; \ +@WITH_PATH_VERSIONED_TRUE@ fi; \ +@WITH_PATH_VERSIONED_TRUE@ done + +check-local: + +clean-local: + rm -f *.o # .created $(FILELOBJS) + +#BUILT_SOURCES = rpmbuild.lcd + +rpmbuild.lcd: Makefile.am ${librpmbuild_la_SOURCES} ${pkginc_HEADERS} ${noinst_HEADERS} + -lclint ${DEFS} ${INCLUDES} ${librpmbuild_la_SOURCES} -dump $@ 2>/dev/null + +.PHONY: sources +sources: + @echo $(librpmbuild_la_SOURCES:%=build/%) + +.PHONY: lint +lint: + $(LINT) ${DEFS} ${INCLUDES} ${librpmbuild_la_SOURCES} + +.PHONY: mccabe +mccabe: + $(MCCABE) $(librpmbuild_la_SOURCES) | sort -n -r | head -n 20 + +.PHONY: lcov-reset # run lcov from scratch, always +lcov-reset: + make lcov-run + make lcov-report + +.PHONY: lcov # run lcov from scratch if the dir is not there +lcov: + make lcov-reset + +.PHONY: lcov-run # reset run coverage tests +lcov-run: + @-rm -rf lcov + find . -name "*.gcda" -exec rm {} \; + make check + +.PHONY: lcov-report # generate report based on current coverage data +lcov-report: + mkdir lcov + lcov --directory . --capture --output-file lcov/lcov.info + lcov -l lcov/lcov.info | grep -v "`cd $(top_srcdir) && pwd`" | cut -d: -f1 > lcov/remove + lcov -r lcov/lcov.info `cat lcov/remove` > lcov/lcov.cleaned.info + rm lcov/remove + mv lcov/lcov.cleaned.info lcov/lcov.info + genhtml -t "$(PACKAGE_STRING)" -o lcov lcov/lcov.info + +#.PHONY: lcov-upload +#lcov-upload: lcov +# rsync -rvz -e ssh --delete lcov/* ??? + +# 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/rpm-5.4.9/build/TODO b/rpm-5.4.9/build/TODO new file mode 100644 index 0000000..448050e --- /dev/null +++ b/rpm-5.4.9/build/TODO @@ -0,0 +1,40 @@ +>I just found an odd little bug in rpm 2.5, when there is something like +> +>%doc readme +> +>in the %files list, then if readme doesn't exit, rpm will just put an empty +>doc directory in the package. + + +option to %setup to *not* do chown/chgrp/chmod + +> Most of my spec files have empty Distribution: and Vendor: tag because I +> really don't care. Now, empty tags are frowned upon. So, I try to comment +> out the lines and get a funny error message: +> +> Distribution field must be present in package: solaris2.6 +> Vendor field must be present in package: solaris2.6 +> +> This happens to be my value of 'Build Os' which gets into the error message! + +posix %attr + +some /foo/*/*.foo entries don't get matches + +detect multiple summary/description entries + +verify langs + +remove prefix stuff from files.c (not used anymore) + +i18n strings + +===================================================================== +triggers + +custom find-requires, find-provides + +messages (normal, verbose, debug) + +deprecate require_distribution, require_icon, require_vendor +deprecate RPMVAR_ROOT, and the RPMVAR_REQUIRE* stuff above diff --git a/rpm-5.4.9/build/auto/Makefile.am b/rpm-5.4.9/build/auto/Makefile.am new file mode 100644 index 0000000..bcd0dd5 --- /dev/null +++ b/rpm-5.4.9/build/auto/Makefile.am @@ -0,0 +1,22 @@ +AUTOMAKE_OPTIONS = 1.4 foreign + +EXTRA_DIST = types desc + +# http://forge.ispras.ru/projects/abi-compliance-checker +ABITEST = @abs_top_srcdir@/scripts/abi-check/abi-compliance-checker.pl +# http://forge.ispras.ru/projects/api-sanity-autotest +AUTOTEST = @abs_top_srcdir@/scripts/api-sanity-checker.pl + +TDIRS = descriptors_storage header_compile_errors test_results tests + +desc.xml: desc + cp $< $@ + +clean-local: + rm -rf $(TDIRS) desc.xml + +check-local: desc.xml + -[ -d tests ] && ${AUTOTEST} -l build -d desc.xml -clean + -${AUTOTEST} -l build -d desc.xml -st types -td test_data \ + -gen -splint-specs -build -run + diff --git a/rpm-5.4.9/build/auto/Makefile.in b/rpm-5.4.9/build/auto/Makefile.in new file mode 100644 index 0000000..828d1a8 --- /dev/null +++ b/rpm-5.4.9/build/auto/Makefile.in @@ -0,0 +1,738 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +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@ +target_triplet = @target@ +subdir = build/auto +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/desc.in $(srcdir)/types.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = desc types +CONFIG_CLEAN_VPATH_FILES = +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 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDROOTDIR_MACRO = @BUILDROOTDIR_MACRO@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBAPI = @DBAPI@ +DBLIBOBJS = @DBLIBOBJS@ +DBLIBSRCS = @DBLIBSRCS@ +DBPATH = @DBPATH@ +DBPATH_MACRO = @DBPATH_MACRO@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTRO_MACROS = @DISTRO_MACROS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIXPERMS = @FIXPERMS@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GPSEE_MODULES_PATH = @GPSEE_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_STATIC = @LDFLAGS_STATIC@ +LD_VERSION_SCRIPT_FLAG = @LD_VERSION_SCRIPT_FLAG@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOLIZE = @LIBTOOLIZE@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MACROFILES = @MACROFILES@ +MAGIC_MACRO = @MAGIC_MACRO@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR = @MKDIR@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NCPUS_COMMAND = @NCPUS_COMMAND@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENMP_CFLAGS = @OPENMP_CFLAGS@ +OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_INSTALLDIRS = @PERL_INSTALLDIRS@ +PERL_URPM_INSTALLDIRS = @PERL_URPM_INSTALLDIRS@ +PKGSRCDIR = @PKGSRCDIR@ +PKGSRCDIR_MACRO = @PKGSRCDIR_MACRO@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +ROOT_GROUP = @ROOT_GROUP@ +RPMCANONARCH = @RPMCANONARCH@ +RPMCANONCOLOR = @RPMCANONCOLOR@ +RPMCANONGNU = @RPMCANONGNU@ +RPMCANONOS = @RPMCANONOS@ +RPMCANONVENDOR = @RPMCANONVENDOR@ +RPMGID = @RPMGID@ +RPMGROUP = @RPMGROUP@ +RPMLUAFILES = @RPMLUAFILES@ +RPMPOPTFILES = @RPMPOPTFILES@ +RPMUID = @RPMUID@ +RPMUSER = @RPMUSER@ +RPM_TIMESTAMP = @RPM_TIMESTAMP@ +RPM_VENDOR = @RPM_VENDOR@ +RPM_VERSION = @RPM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFIGDIR = @SYSCONFIGDIR@ +USE_NLS = @USE_NLS@ +USRLIBRPM = @USRLIBRPM@ +VERSION = @VERSION@ +WITH_ACL = @WITH_ACL@ +WITH_APIDOCS = @WITH_APIDOCS@ +WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ +WITH_APR = @WITH_APR@ +WITH_ATERM = @WITH_ATERM@ +WITH_ATTR = @WITH_ATTR@ +WITH_AUGEAS = @WITH_AUGEAS@ +WITH_AUGEAS_AUGTOOL = @WITH_AUGEAS_AUGTOOL@ +WITH_BASH = @WITH_BASH@ +WITH_BASH_CPPFLAGS = @WITH_BASH_CPPFLAGS@ +WITH_BASH_LDFLAGS = @WITH_BASH_LDFLAGS@ +WITH_BASH_LIBS = @WITH_BASH_LIBS@ +WITH_BASH_SUBDIR = @WITH_BASH_SUBDIR@ +WITH_BEECRYPT = @WITH_BEECRYPT@ +WITH_BEECRYPT_CPPFLAGS = @WITH_BEECRYPT_CPPFLAGS@ +WITH_BEECRYPT_LDFLAGS = @WITH_BEECRYPT_LDFLAGS@ +WITH_BEECRYPT_LIBS = @WITH_BEECRYPT_LIBS@ +WITH_BEECRYPT_SUBDIR = @WITH_BEECRYPT_SUBDIR@ +WITH_BZIP2 = @WITH_BZIP2@ +WITH_CPUINFO = @WITH_CPUINFO@ +WITH_CUDF = @WITH_CUDF@ +WITH_CUDF_CUDFTOOL = @WITH_CUDF_CUDFTOOL@ +WITH_DB = @WITH_DB@ +WITH_DBSQL = @WITH_DBSQL@ +WITH_DBSQL_CPPFLAGS = @WITH_DBSQL_CPPFLAGS@ +WITH_DBSQL_LDFLAGS = @WITH_DBSQL_LDFLAGS@ +WITH_DBSQL_LIBS = @WITH_DBSQL_LIBS@ +WITH_DBSQL_SUBDIR = @WITH_DBSQL_SUBDIR@ +WITH_DB_CPPFLAGS = @WITH_DB_CPPFLAGS@ +WITH_DB_LDFLAGS = @WITH_DB_LDFLAGS@ +WITH_DB_LIBS = @WITH_DB_LIBS@ +WITH_DB_SUBDIR = @WITH_DB_SUBDIR@ +WITH_DMALLOC = @WITH_DMALLOC@ +WITH_EFENCE = @WITH_EFENCE@ +WITH_EXPAT = @WITH_EXPAT@ +WITH_FICL = @WITH_FICL@ +WITH_FICL_CPPFLAGS = @WITH_FICL_CPPFLAGS@ +WITH_FICL_LDFLAGS = @WITH_FICL_LDFLAGS@ +WITH_FICL_LIBS = @WITH_FICL_LIBS@ +WITH_FICL_SUBDIR = @WITH_FICL_SUBDIR@ +WITH_FILE = @WITH_FILE@ +WITH_FILE_CPPFLAGS = @WITH_FILE_CPPFLAGS@ +WITH_FILE_LDFLAGS = @WITH_FILE_LDFLAGS@ +WITH_FILE_LIBS = @WITH_FILE_LIBS@ +WITH_FILE_SUBDIR = @WITH_FILE_SUBDIR@ +WITH_GCRYPT = @WITH_GCRYPT@ +WITH_GNUTLS = @WITH_GNUTLS@ +WITH_GPSEE = @WITH_GPSEE@ +WITH_GPSEE_CPPFLAGS = @WITH_GPSEE_CPPFLAGS@ +WITH_GPSEE_LDFLAGS = @WITH_GPSEE_LDFLAGS@ +WITH_GPSEE_LIBS = @WITH_GPSEE_LIBS@ +WITH_GPSEE_SUBDIR = @WITH_GPSEE_SUBDIR@ +WITH_JS_SUBDIR = @WITH_JS_SUBDIR@ +WITH_KEYUTILS = @WITH_KEYUTILS@ +WITH_KEYUTILS_RPMKEY = @WITH_KEYUTILS_RPMKEY@ +WITH_LIBELF_DEBUGEDIT = @WITH_LIBELF_DEBUGEDIT@ +WITH_LIBGIT2 = @WITH_LIBGIT2@ +WITH_LIBGIT2_CPPFLAGS = @WITH_LIBGIT2_CPPFLAGS@ +WITH_LIBGIT2_LDFLAGS = @WITH_LIBGIT2_LDFLAGS@ +WITH_LIBGIT2_LIBS = @WITH_LIBGIT2_LIBS@ +WITH_LIBGIT2_SUBDIR = @WITH_LIBGIT2_SUBDIR@ +WITH_LIBTASN1 = @WITH_LIBTASN1@ +WITH_LUA = @WITH_LUA@ +WITH_LUA_CPPFLAGS = @WITH_LUA_CPPFLAGS@ +WITH_LUA_LDFLAGS = @WITH_LUA_LDFLAGS@ +WITH_LUA_LIBS = @WITH_LUA_LIBS@ +WITH_LUA_SUBDIR = @WITH_LUA_SUBDIR@ +WITH_LUA_SUBDIR_DEF = @WITH_LUA_SUBDIR_DEF@ +WITH_LUA_SUBDIR_LIB = @WITH_LUA_SUBDIR_LIB@ +WITH_MOZJS185 = @WITH_MOZJS185@ +WITH_MOZJS185_CPPFLAGS = @WITH_MOZJS185_CPPFLAGS@ +WITH_MOZJS185_LDFLAGS = @WITH_MOZJS185_LDFLAGS@ +WITH_MOZJS185_LIBS = @WITH_MOZJS185_LIBS@ +WITH_MOZJS185_SUBDIR = @WITH_MOZJS185_SUBDIR@ +WITH_NEON = @WITH_NEON@ +WITH_NEON_CPPFLAGS = @WITH_NEON_CPPFLAGS@ +WITH_NEON_LDFLAGS = @WITH_NEON_LDFLAGS@ +WITH_NEON_LIBS = @WITH_NEON_LIBS@ +WITH_NEON_SUBDIR = @WITH_NEON_SUBDIR@ +WITH_NIX = @WITH_NIX@ +WITH_NSS = @WITH_NSS@ +WITH_OPENSSL = @WITH_OPENSSL@ +WITH_PAKCHOIS = @WITH_PAKCHOIS@ +WITH_PATH_VERSIONED = @WITH_PATH_VERSIONED@ +WITH_PATH_VERSIONED_SUFFIX = @WITH_PATH_VERSIONED_SUFFIX@ +WITH_PCRE = @WITH_PCRE@ +WITH_PCRE_CPPFLAGS = @WITH_PCRE_CPPFLAGS@ +WITH_PCRE_LDFLAGS = @WITH_PCRE_LDFLAGS@ +WITH_PCRE_LIBS = @WITH_PCRE_LIBS@ +WITH_PCRE_SUBDIR = @WITH_PCRE_SUBDIR@ +WITH_PERLEMBED = @WITH_PERLEMBED@ +WITH_PERL_LIBS = @WITH_PERL_LIBS@ +WITH_PERL_SUBDIR = @WITH_PERL_SUBDIR@ +WITH_PERL_SUBPACKAGE = @WITH_PERL_SUBPACKAGE@ +WITH_PERL_URPM_LIBS = @WITH_PERL_URPM_LIBS@ +WITH_PERL_URPM_SUBDIR = @WITH_PERL_URPM_SUBDIR@ +WITH_PERL_URPM_SUBPACKAGE = @WITH_PERL_URPM_SUBPACKAGE@ +WITH_POPT = @WITH_POPT@ +WITH_POPT_CPPFLAGS = @WITH_POPT_CPPFLAGS@ +WITH_POPT_LDFLAGS = @WITH_POPT_LDFLAGS@ +WITH_POPT_LIBS = @WITH_POPT_LIBS@ +WITH_POPT_SUBDIR = @WITH_POPT_SUBDIR@ +WITH_PYTHONEMBED = @WITH_PYTHONEMBED@ +WITH_PYTHON_INCDIR = @WITH_PYTHON_INCDIR@ +WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ +WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ +WITH_RC = @WITH_RC@ +WITH_RC_CPPFLAGS = @WITH_RC_CPPFLAGS@ +WITH_RC_LDFLAGS = @WITH_RC_LDFLAGS@ +WITH_RC_LIBS = @WITH_RC_LIBS@ +WITH_RC_SUBDIR = @WITH_RC_SUBDIR@ +WITH_READLINE = @WITH_READLINE@ +WITH_RUBY = @WITH_RUBY@ +WITH_RUBY_CPPFLAGS = @WITH_RUBY_CPPFLAGS@ +WITH_RUBY_SUBDIR = @WITH_RUBY_SUBDIR@ +WITH_RUBY_VENDORARCHDIR = @WITH_RUBY_VENDORARCHDIR@ +WITH_SELINUX = @WITH_SELINUX@ +WITH_SEMANAGE = @WITH_SEMANAGE@ +WITH_SEMANAGE_SEMODULE = @WITH_SEMANAGE_SEMODULE@ +WITH_SEPOL = @WITH_SEPOL@ +WITH_SPIDERMONKEY_SUBDIR = @WITH_SPIDERMONKEY_SUBDIR@ +WITH_SQLITE = @WITH_SQLITE@ +WITH_SQLITE_CPPFLAGS = @WITH_SQLITE_CPPFLAGS@ +WITH_SQLITE_LDFLAGS = @WITH_SQLITE_LDFLAGS@ +WITH_SQLITE_LIBS = @WITH_SQLITE_LIBS@ +WITH_SQLITE_SUBDIR = @WITH_SQLITE_SUBDIR@ +WITH_SQUIRREL = @WITH_SQUIRREL@ +WITH_SUBVERSION = @WITH_SUBVERSION@ +WITH_SYCK = @WITH_SYCK@ +WITH_SYCK_CPPFLAGS = @WITH_SYCK_CPPFLAGS@ +WITH_SYCK_LDFLAGS = @WITH_SYCK_LDFLAGS@ +WITH_SYCK_LIBS = @WITH_SYCK_LIBS@ +WITH_SYCK_SUBDIR = @WITH_SYCK_SUBDIR@ +WITH_TCL = @WITH_TCL@ +WITH_TCL_SUBDIR = @WITH_TCL_SUBDIR@ +WITH_TOMCRYPT = @WITH_TOMCRYPT@ +WITH_TPM = @WITH_TPM@ +WITH_UNIXODBC = @WITH_UNIXODBC@ +WITH_UUID = @WITH_UUID@ +WITH_XAR = @WITH_XAR@ +WITH_XAR_CPPFLAGS = @WITH_XAR_CPPFLAGS@ +WITH_XAR_LDFLAGS = @WITH_XAR_LDFLAGS@ +WITH_XAR_LIBS = @WITH_XAR_LIBS@ +WITH_XAR_SUBDIR = @WITH_XAR_SUBDIR@ +WITH_XZ = @WITH_XZ@ +WITH_XZ_CPPFLAGS = @WITH_XZ_CPPFLAGS@ +WITH_XZ_LDFLAGS = @WITH_XZ_LDFLAGS@ +WITH_XZ_LIBS = @WITH_XZ_LIBS@ +WITH_XZ_SUBDIR = @WITH_XZ_SUBDIR@ +WITH_ZLIB = @WITH_ZLIB@ +WITH_ZLIB_CPPFLAGS = @WITH_ZLIB_CPPFLAGS@ +WITH_ZLIB_LDFLAGS = @WITH_ZLIB_LDFLAGS@ +WITH_ZLIB_LIBS = @WITH_ZLIB_LIBS@ +WITH_ZLIB_SUBDIR = @WITH_ZLIB_SUBDIR@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__BASH = @__BASH@ +__BZIP2 = @__BZIP2@ +__CAT = @__CAT@ +__CHATTR = @__CHATTR@ +__CHGRP = @__CHGRP@ +__CHGRP_RHF = @__CHGRP_RHF@ +__CHMOD = @__CHMOD@ +__CHOWN = @__CHOWN@ +__CHOWN_RHF = @__CHOWN_RHF@ +__CMAKE = @__CMAKE@ +__CPIO = @__CPIO@ +__CURL = @__CURL@ +__CVS = @__CVS@ +__DBSQL = @__DBSQL@ +__DB_ARCHIVE = @__DB_ARCHIVE@ +__DB_CHECKPOINT = @__DB_CHECKPOINT@ +__DB_DEADLOCK = @__DB_DEADLOCK@ +__DB_DUMP = @__DB_DUMP@ +__DB_HOTBACKUP = @__DB_HOTBACKUP@ +__DB_LOAD = @__DB_LOAD@ +__DB_LOG_VERIFY = @__DB_LOG_VERIFY@ +__DB_PRINTLOG = @__DB_PRINTLOG@ +__DB_RECOVER = @__DB_RECOVER@ +__DB_REPLICATE = @__DB_REPLICATE@ +__DB_SQL_CODEGEN = @__DB_SQL_CODEGEN@ +__DB_STAT = @__DB_STAT@ +__DB_TUNER = @__DB_TUNER@ +__DB_UPGRADE = @__DB_UPGRADE@ +__DB_VERIFY = @__DB_VERIFY@ +__DIFF = @__DIFF@ +__DITTO = @__DITTO@ +__DOXYGEN = @__DOXYGEN@ +__FILE = @__FILE@ +__GIT = @__GIT@ +__GPG = @__GPG@ +__GSR = @__GSR@ +__GST_INSPECT = @__GST_INSPECT@ +__GZIP = @__GZIP@ +__HG = @__HG@ +__ID = @__ID@ +__ID_U = @__ID_U@ +__INSTALL = @__INSTALL@ +__INSTALL_INFO = @__INSTALL_INFO@ +__LD = @__LD@ +__LDCONFIG = @__LDCONFIG@ +__LN = @__LN@ +__LRZIP = @__LRZIP@ +__LSATTR = @__LSATTR@ +__LZIP = @__LZIP@ +__LZMA = @__LZMA@ +__LZOP = @__LZOP@ +__MAKE = @__MAKE@ +__MKDIR = @__MKDIR@ +__MKDIR_P = @__MKDIR_P@ +__MODINFO = @__MODINFO@ +__MONGO = @__MONGO@ +__MV = @__MV@ +__NM = @__NM@ +__OBJCOPY = @__OBJCOPY@ +__OBJDUMP = @__OBJDUMP@ +__PATCH = @__PATCH@ +__PAX = @__PAX@ +__PERL = @__PERL@ +__PGP = @__PGP@ +__PHP = @__PHP@ +__PYTHON = @__PYTHON@ +__RM = @__RM@ +__RMDIR = @__RMDIR@ +__RSH = @__RSH@ +__RUBY = @__RUBY@ +__SED = @__SED@ +__SH = @__SH@ +__SQLITE3 = @__SQLITE3@ +__SSH = @__SSH@ +__STRIP = @__STRIP@ +__SVN = @__SVN@ +__TAR = @__TAR@ +__TCLSH = @__TCLSH@ +__UNZIP = @__UNZIP@ +__XZ = @__XZ@ +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_CXX = @ac_ct_CXX@ +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@ +autorelocate_dcolor = @autorelocate_dcolor@ +autorelocate_path = @autorelocate_path@ +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@ +exeext = @exeext@ +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@ +libext = @libext@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +objext = @objext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +shlibext = @shlibext@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +testdir = @testdir@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrprefix = @usrprefix@ +varprefix = @varprefix@ +AUTOMAKE_OPTIONS = 1.4 foreign +EXTRA_DIST = types desc + +# http://forge.ispras.ru/projects/abi-compliance-checker +ABITEST = @abs_top_srcdir@/scripts/abi-check/abi-compliance-checker.pl +# http://forge.ispras.ru/projects/api-sanity-autotest +AUTOTEST = @abs_top_srcdir@/scripts/api-sanity-checker.pl +TDIRS = descriptors_storage header_compile_errors test_results tests +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 build/auto/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign build/auto/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +desc: $(top_builddir)/config.status $(srcdir)/desc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +types: $(top_builddir)/config.status $(srcdir)/types.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool 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-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: check-am install-am install-strip + +.PHONY: all all-am check check-am check-local clean clean-generic \ + clean-libtool clean-local distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am + + +desc.xml: desc + cp $< $@ + +clean-local: + rm -rf $(TDIRS) desc.xml + +check-local: desc.xml + -[ -d tests ] && ${AUTOTEST} -l build -d desc.xml -clean + -${AUTOTEST} -l build -d desc.xml -st types -td test_data \ + -gen -splint-specs -build -run + +# 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/rpm-5.4.9/build/auto/desc b/rpm-5.4.9/build/auto/desc new file mode 100644 index 0000000..3b7ca94 --- /dev/null +++ b/rpm-5.4.9/build/auto/desc @@ -0,0 +1,97 @@ + + 5.4.9 + + + + buildio.h + rpmbuild.h + rpmspec.h + + + + /home/mdawkins/wdj54/build/.libs/librpmbuild.so + + + + + + + /home/mdawkins/wdj54/build + /home/mdawkins/wdj54/lib + /home/mdawkins/wdj54/rpmdb + /home/mdawkins/wdj54/rpmio + + + + -O2 -g -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC -DPIC -Wall -W -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -Wno-unused-parameter -Wformat-security -g3 -fno-delete-null-pointer-checks -D_FORTIFY_SOURCE=2 -fstack-protector -fexceptions -fexceptions -Wno-missing-field-initializers -D_GNU_SOURCE -D_REENTRANT + + + + stdint.h + stdio.h + stdlib.h + string.h + assert.h + rpmiotypes.h + rpmio.h + rpmtypes.h + rpmevr.h + rpmtag.h + + + + + + + + + + + + + + + + /usr/include/rpm/*.h + + + + /usr/lib64/libdb.so + /usr/lib64/libsqlite3.so + + + + + + + + + + + + + + + + + + /home/mdawkins/wdj54/lib/.libs/librpm.so + /home/mdawkins/wdj54/rpmdb/.libs/librpmdb.so + /home/mdawkins/wdj54/rpmio/.libs/librpmio.so + /home/mdawkins/wdj54/misc/.libs/librpmmisc.so + + + + + + + + + + + + + + + + diff --git a/rpm-5.4.9/build/auto/desc.in b/rpm-5.4.9/build/auto/desc.in new file mode 100644 index 0000000..95f5e51 --- /dev/null +++ b/rpm-5.4.9/build/auto/desc.in @@ -0,0 +1,97 @@ + + @VERSION@ + + + + buildio.h + rpmbuild.h + rpmspec.h + + + + @abs_top_builddir@/build/.libs/librpmbuild.@shlibext@ + + + + + + + @abs_top_srcdir@/build + @abs_top_srcdir@/lib + @abs_top_srcdir@/rpmdb + @abs_top_srcdir@/rpmio + + + + @CFLAGS@ + + + + stdint.h + stdio.h + stdlib.h + string.h + assert.h + rpmiotypes.h + rpmio.h + rpmtypes.h + rpmevr.h + rpmtag.h + + + + + + + + + + + + + + + + @prefix@/include/rpm/*.h + + + + @prefix@/lib64/libdb.@shlibext@ + @prefix@/lib64/libsqlite3.@shlibext@ + + + + + + + + + + + + + + + + + + @abs_top_builddir@/lib/.libs/librpm.@shlibext@ + @abs_top_builddir@/rpmdb/.libs/librpmdb.@shlibext@ + @abs_top_builddir@/rpmio/.libs/librpmio.@shlibext@ + @abs_top_builddir@/misc/.libs/librpmmisc.@shlibext@ + + + + + + + + + + + + + + + + diff --git a/rpm-5.4.9/build/auto/types b/rpm-5.4.9/build/auto/types new file mode 100644 index 0000000..4c5f80b --- /dev/null +++ b/rpm-5.4.9/build/auto/types @@ -0,0 +1,289 @@ + + + + + common_env + + #include /* XXX rpmioItem */ + #include + #include + static struct poptOption optionsTable[] = { + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0, + "Common options for all rpmio executables:", NULL }, + POPT_AUTOHELP + POPT_TABLEEND + }; + + + poptContext con = rpmcliInit(argc, argv, optionsTable); + + + con = rpmcliFini(con); + + + + + + + + common_param + mode_t + 0700 + + + normal + void * + &__pglob + + #include + static glob_t __pglob; + + + (void) Glob("*", 0, Glob_error, $0); + + + Globfree + param1 + + + + normal + char * + NULL + + Realpath + param2 + + + + + + common_param + DIGEST_CTX + NULL + + #include /* XXX rpmioItem */ + static pgpHashAlgo _algo = PGPHASHALGO_MD5; + static rpmDigestFlags _flags = RPMDIGEST_NONE; + + + $0 = rpmDigestInit(_algo, _flags); + + + (void) rpmDigestFinal($0, NULL, NULL, 0); + + + + normal + DIGEST_CTX + NULL + + #include /* XXX rpmioItem */ + static pgpHashAlgo _algo = PGPHASHALGO_MD5; + static rpmDigestFlags _flags = RPMDIGEST_NONE; + + + $0 = rpmDigestInit(_algo, _flags); + + + rpmDigestFinal + param1 + + + + normal + const char * + NULL + + $0 = strdup("foo"); + + + xstrtolocale + param1 + + + + normal + rpmioP + NULL + + (void) rpmioParse(&$0, "bing bang boom"); + + + rpmioPFree + param1 + + + + + + common_param + rpmsw + NULL + + #include /* XXX rpmioItem */ + + + $0 = calloc(1, sizeof(*$0)); + + + if ($0) + free($0); + + + + + + common_param + yarnThread + NULL + + static unsigned int _seconds = 10; + static void _snooze (void * _uip) { + unsigned int * uip = _uip; + if (uip) + sleep(*uip); + } + + + $0 = yarnLaunch(_snooze, &_seconds); + + + + + + common_param + Header + headerNew() + + + + common_param + HE_t + &_he + + static struct _HE_s _he = { .tag = RPMTAG_NVRA }; + + + + + + common_param + rpmfi + NULL + + #include + #include + static rpmts _ts; + static Header _h; + + + if (_ts == NULL) _ts = rpmtsCreate(); + if (_h == NULL) _h = headerNew(); + $0 = rpmfiNew(_ts, _h, RPMTAG_BASENAMES, 0); + + + $0 = rpmfiFree($0); + if (_h) _h = headerFree(_h); + if (_ts) _ts = rpmtsFree(_ts); + + + + + + common_param + rpmps + NULL + + #include + + + $0 = rpmpsCreate(); + rpmpsAppend($0, 2, "pkg-1.2-3", NULL, "/dn/", "bn", "alt-4.5-6", 789UL); + + + $0 = rpmpsFree($0); + + + + + common_param + rpmProblem + NULL + + #include + static rpmps _ps; + + + if (_ps == NULL) _ps = rpmpsCreate(); + rpmpsAppend(_ps, 2, "pkg-1.2-3", NULL, "/dn/", "bn", "alt-4.5-6", 789UL); + $0 = rpmpsGetProblem(_ps, 0); + + + if (_ps) _ps = rpmpsFree(_ps); + + + + common_param + fnpyKey + NULL + + $0 = (fnpyKey) "fnpyKey"; + + + + + + + + + common_param + Spec + newSpec() + + + common_param + Package + newPackage(_spec) + + static Spec _spec; + + + if (_spec == NULL) _spec = newSpec(); + $0 = newPackage(_spec); + + + $0 = freePackage($0); + if (_spec) _spec = freeSpec(_spec); + + + + + normal + rpmTag + RPMTAG_SOURCE + + addSource + param4 + + + + + diff --git a/rpm-5.4.9/build/auto/types.in b/rpm-5.4.9/build/auto/types.in new file mode 100644 index 0000000..4c5f80b --- /dev/null +++ b/rpm-5.4.9/build/auto/types.in @@ -0,0 +1,289 @@ + + + + + common_env + + #include /* XXX rpmioItem */ + #include + #include + static struct poptOption optionsTable[] = { + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0, + "Common options for all rpmio executables:", NULL }, + POPT_AUTOHELP + POPT_TABLEEND + }; + + + poptContext con = rpmcliInit(argc, argv, optionsTable); + + + con = rpmcliFini(con); + + + + + + + + common_param + mode_t + 0700 + + + normal + void * + &__pglob + + #include + static glob_t __pglob; + + + (void) Glob("*", 0, Glob_error, $0); + + + Globfree + param1 + + + + normal + char * + NULL + + Realpath + param2 + + + + + + common_param + DIGEST_CTX + NULL + + #include /* XXX rpmioItem */ + static pgpHashAlgo _algo = PGPHASHALGO_MD5; + static rpmDigestFlags _flags = RPMDIGEST_NONE; + + + $0 = rpmDigestInit(_algo, _flags); + + + (void) rpmDigestFinal($0, NULL, NULL, 0); + + + + normal + DIGEST_CTX + NULL + + #include /* XXX rpmioItem */ + static pgpHashAlgo _algo = PGPHASHALGO_MD5; + static rpmDigestFlags _flags = RPMDIGEST_NONE; + + + $0 = rpmDigestInit(_algo, _flags); + + + rpmDigestFinal + param1 + + + + normal + const char * + NULL + + $0 = strdup("foo"); + + + xstrtolocale + param1 + + + + normal + rpmioP + NULL + + (void) rpmioParse(&$0, "bing bang boom"); + + + rpmioPFree + param1 + + + + + + common_param + rpmsw + NULL + + #include /* XXX rpmioItem */ + + + $0 = calloc(1, sizeof(*$0)); + + + if ($0) + free($0); + + + + + + common_param + yarnThread + NULL + + static unsigned int _seconds = 10; + static void _snooze (void * _uip) { + unsigned int * uip = _uip; + if (uip) + sleep(*uip); + } + + + $0 = yarnLaunch(_snooze, &_seconds); + + + + + + common_param + Header + headerNew() + + + + common_param + HE_t + &_he + + static struct _HE_s _he = { .tag = RPMTAG_NVRA }; + + + + + + common_param + rpmfi + NULL + + #include + #include + static rpmts _ts; + static Header _h; + + + if (_ts == NULL) _ts = rpmtsCreate(); + if (_h == NULL) _h = headerNew(); + $0 = rpmfiNew(_ts, _h, RPMTAG_BASENAMES, 0); + + + $0 = rpmfiFree($0); + if (_h) _h = headerFree(_h); + if (_ts) _ts = rpmtsFree(_ts); + + + + + + common_param + rpmps + NULL + + #include + + + $0 = rpmpsCreate(); + rpmpsAppend($0, 2, "pkg-1.2-3", NULL, "/dn/", "bn", "alt-4.5-6", 789UL); + + + $0 = rpmpsFree($0); + + + + + common_param + rpmProblem + NULL + + #include + static rpmps _ps; + + + if (_ps == NULL) _ps = rpmpsCreate(); + rpmpsAppend(_ps, 2, "pkg-1.2-3", NULL, "/dn/", "bn", "alt-4.5-6", 789UL); + $0 = rpmpsGetProblem(_ps, 0); + + + if (_ps) _ps = rpmpsFree(_ps); + + + + common_param + fnpyKey + NULL + + $0 = (fnpyKey) "fnpyKey"; + + + + + + + + + common_param + Spec + newSpec() + + + common_param + Package + newPackage(_spec) + + static Spec _spec; + + + if (_spec == NULL) _spec = newSpec(); + $0 = newPackage(_spec); + + + $0 = freePackage($0); + if (_spec) _spec = freeSpec(_spec); + + + + + normal + rpmTag + RPMTAG_SOURCE + + addSource + param4 + + + + + diff --git a/rpm-5.4.9/build/build.c b/rpm-5.4.9/build/build.c new file mode 100644 index 0000000..875bfdf --- /dev/null +++ b/rpm-5.4.9/build/build.c @@ -0,0 +1,442 @@ +/** \ingroup rpmbuild + * \file build/build.c + * Top-level build dispatcher. + */ + +#include "system.h" + +#define _RPMBC_INTERNAL +#include /* XXX fdGetFp */ +#include +#include + +#define _RPMTAG_INTERNAL +#include +#include "signature.h" /* XXX rpmTempFile */ + +#include "debug.h" + +/** + */ +#if defined(RPM_VENDOR_OPENPKG) /* splitted-source-directory */ +const char * getSourceDir(rpmfileAttrs attr, const char *filename) +#else +const char * getSourceDir(rpmfileAttrs attr) +#endif +{ + const char * dir = NULL; +#if defined(RPM_VENDOR_OPENPKG) /* splitted-source-directory */ + const char *fn; + + /* support splitted source directories, i.e., source files which + are alternatively placed into the .spec directory and picked + up from there, too. */ + if (attr & (RPMFILE_SOURCE|RPMFILE_PATCH|RPMFILE_ICON) && filename != NULL) + { + fn = rpmGetPath("%{_specdir}/", filename, NULL); + if (access(fn, F_OK) == 0) + dir = "%{_specdir}/"; + fn = _free(fn); + } + if (dir != NULL) { + } else +#endif + if (attr & RPMFILE_SOURCE) + dir = "%{_sourcedir}/"; + else if (attr & RPMFILE_PATCH) + dir = "%{_patchdir}/"; + else if (attr & RPMFILE_ICON) + dir = "%{_icondir}/"; + + return dir; +} + +/*@access urlinfo @*/ /* XXX compared with NULL */ +/*@access FD_t @*/ + +/** + */ +static void doRmSource(Spec spec) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + struct Source *sp; + int rc; + +#if 0 + rc = Unlink(spec->specFile); +#endif + + for (sp = spec->sources; sp != NULL; sp = sp->next) { + const char *dn, *fn; + if (sp->flags & RPMFILE_GHOST) + continue; +#if defined(RPM_VENDOR_OPENPKG) /* splitted-source-directory */ + if (! (dn = getSourceDir(sp->flags, sp->source))) +#else + if (! (dn = getSourceDir(sp->flags))) +#endif + continue; + fn = rpmGenPath(NULL, dn, sp->source); + rc = Unlink(fn); + fn = _free(fn); + } +} + +/* + * @todo Single use by %%doc in files.c prevents static. + */ +rpmRC doScript(Spec spec, int what, const char *name, rpmiob iob, int test) +{ + const char * rootURL = spec->rootURL; + const char * rootDir; + const char * scriptName = NULL; + const char * buildDirURL = rpmGenPath(rootURL, "%{_builddir}", ""); + const char * buildScript; + const char * buildCmd = NULL; + const char * buildTemplate = NULL; + const char * buildPost = NULL; + const char * mTemplate = NULL; + const char * mCmd = NULL; + const char * mPost = NULL; + int argc = 0; + const char **argv = NULL; + FILE * fp = NULL; + urlinfo u = NULL; + rpmop op = NULL; + int ix = -1; + + FD_t fd; + FD_t xfd; + int status; + rpmRC rc; + size_t i; + + switch (what) { + case RPMBUILD_PREP: + name = "%prep"; + iob = spec->prep; + op = memset(alloca(sizeof(*op)), 0, sizeof(*op)); + ix = RPMSCRIPT_PREP; + mTemplate = "%{__spec_prep_template}"; + mPost = "%{__spec_prep_post}"; + mCmd = "%{__spec_prep_cmd}"; + break; + case RPMBUILD_BUILD: + name = "%build"; + iob = spec->build; + op = memset(alloca(sizeof(*op)), 0, sizeof(*op)); + ix = RPMSCRIPT_BUILD; + mTemplate = "%{__spec_build_template}"; + mPost = "%{__spec_build_post}"; + mCmd = "%{__spec_build_cmd}"; + break; + case RPMBUILD_INSTALL: + name = "%install"; + iob = spec->install; + op = memset(alloca(sizeof(*op)), 0, sizeof(*op)); + ix = RPMSCRIPT_INSTALL; + mTemplate = "%{__spec_install_template}"; + mPost = "%{__spec_install_post}"; + mCmd = "%{__spec_install_cmd}"; + break; + case RPMBUILD_CHECK: + name = "%check"; + iob = spec->check; + op = memset(alloca(sizeof(*op)), 0, sizeof(*op)); + ix = RPMSCRIPT_CHECK; + mTemplate = "%{__spec_check_template}"; + mPost = "%{__spec_check_post}"; + mCmd = "%{__spec_check_cmd}"; + break; + case RPMBUILD_CLEAN: + name = "%clean"; + iob = spec->clean; + mTemplate = "%{__spec_clean_template}"; + mPost = "%{__spec_clean_post}"; + mCmd = "%{__spec_clean_cmd}"; + break; + case RPMBUILD_RMBUILD: + name = "--clean"; + mTemplate = "%{__spec_clean_template}"; + mPost = "%{__spec_clean_post}"; + mCmd = "%{__spec_clean_cmd}"; + break; + /* support "%track" script/section */ + case RPMBUILD_TRACK: + name = "%track"; + iob = NULL; + if (spec->foo) + for (i = 0; i < spec->nfoo; i++) { + if (spec->foo[i].str == NULL || spec->foo[i].iob == NULL) + continue; + if (xstrcasecmp(spec->foo[i].str, "track")) + continue; + iob = spec->foo[i].iob; + /*@loopbreak@*/ break; + } + mTemplate = "%{__spec_track_template}"; + mPost = "%{__spec_track_post}"; + mCmd = "%{__spec_track_cmd}"; + break; + case RPMBUILD_STRINGBUF: + default: + mTemplate = "%{___build_template}"; + mPost = "%{___build_post}"; + mCmd = "%{___build_cmd}"; + break; + } + +assert(name != NULL); + + if ((what != RPMBUILD_RMBUILD) && iob == NULL) { + rc = RPMRC_OK; + goto exit; + } + + if (rpmTempFile(rootURL, &scriptName, &fd) || fd == NULL || Ferror(fd)) { + rpmlog(RPMLOG_ERR, _("Unable to open temp file.\n")); + rc = RPMRC_FAIL; + goto exit; + } + + if (fdGetFp(fd) == NULL) + xfd = Fdopen(fd, "w.fpio"); + else + xfd = fd; + + /*@-type@*/ /* FIX: cast? */ + if ((fp = fdGetFp(xfd)) == NULL) { + rc = RPMRC_FAIL; + goto exit; + } + /*@=type@*/ + + (void) urlPath(rootURL, &rootDir); + if (*rootDir == '\0') rootDir = "/"; + + (void) urlPath(scriptName, &buildScript); + + buildTemplate = rpmExpand(mTemplate, NULL); + buildPost = rpmExpand(mPost, NULL); + + (void) fputs(buildTemplate, fp); + + /* support "%track" script/section */ + if (what != RPMBUILD_PREP && what != RPMBUILD_RMBUILD && spec->buildSubdir && what != RPMBUILD_TRACK) + fprintf(fp, "cd '%s'\n", spec->buildSubdir); + + if (what == RPMBUILD_RMBUILD) { + if (spec->buildSubdir) + fprintf(fp, "rm -rf '%s'\n", spec->buildSubdir); + } else if (iob != NULL) + fprintf(fp, "%s", rpmiobStr(iob)); + + (void) fputs(buildPost, fp); + + (void) Fclose(xfd); + + if (test) { + rc = RPMRC_OK; + goto exit; + } + + if (buildDirURL && buildDirURL[0] != '/' && + (urlSplit(buildDirURL, &u) != 0)) { + rc = RPMRC_FAIL; + goto exit; + } + + switch (urlType(u)) { + case URL_IS_HTTPS: + case URL_IS_HTTP: + case URL_IS_FTP: + addMacro(spec->macros, "_remsh", NULL, "%{__remsh}", RMIL_SPEC); + addMacro(spec->macros, "_remhost", NULL, u->host, RMIL_SPEC); + if (strcmp(rootDir, "/")) + addMacro(spec->macros, "_remroot", NULL, rootDir, RMIL_SPEC); + break; + case URL_IS_UNKNOWN: + case URL_IS_DASH: + case URL_IS_PATH: + case URL_IS_HKP: + case URL_IS_MONGO: /* XXX FIXME */ + default: + break; + } + + buildCmd = rpmExpand(mCmd, " ", buildScript, NULL); + (void) poptParseArgvString(buildCmd, &argc, &argv); + + if (what != RPMBUILD_TRACK) /* support "%track" script/section */ + rpmlog(RPMLOG_NOTICE, _("Executing(%s): %s\n"), name, buildCmd); + + /* Run the script with a stopwatch. */ + if (op != NULL) + (void) rpmswEnter(op, 0); + + status = rpmsqExecve(argv); + if (ix >= 0 && ix < RPMSCRIPT_MAX) + spec->sstates[ix] = + (RPMSCRIPT_STATE_EXEC | RPMSCRIPT_STATE_REAPED) | (status & 0xffff); + + if (!WIFEXITED(status) || WEXITSTATUS(status)) { + rpmlog(RPMLOG_ERR, _("Bad exit status from %s (%s)\n"), + scriptName, name); + rc = RPMRC_FAIL; + } else + rc = RPMRC_OK; + + if (op != NULL) { + static unsigned int scale = 1000; + (void) rpmswExit(op, 0); + if (ix >= 0 && ix < RPMSCRIPT_MAX) + spec->smetrics[ix] += op->usecs / scale; + } + +exit: + if (scriptName) { +#if defined(RPM_VENDOR_OPENPKG) /* always-remove-tempfiles */ + /* Unconditionally remove temporary files ("rpm-tmp.XXXXX") which + were generated for the executed scripts. In OpenPKG we run the + scripts in debug mode ("set -x") anyway, so we never need to + see the whole generated script -- not even if it breaks. Instead + we would just have temporary files staying around forever. */ +#else + if (rc == RPMRC_OK) +#endif + (void) Unlink(scriptName); + scriptName = _free(scriptName); + } + + switch (urlType(u)) { + case URL_IS_HTTPS: + case URL_IS_HTTP: + case URL_IS_FTP: + delMacro(spec->macros, "_remsh"); + delMacro(spec->macros, "_remhost"); + if (strcmp(rootDir, "/")) + delMacro(spec->macros, "_remroot"); + break; + case URL_IS_UNKNOWN: + case URL_IS_DASH: + case URL_IS_PATH: + case URL_IS_HKP: + case URL_IS_MONGO: /* XXX FIXME */ + default: + break; + } + + argv = _free(argv); + buildCmd = _free(buildCmd); + buildTemplate = _free(buildTemplate); + buildPost = _free(buildPost); + buildDirURL = _free(buildDirURL); + return rc; +} + +rpmRC buildSpec(rpmts ts, Spec spec, int what, int test) +{ + rpmRC rc = RPMRC_OK; + + /* Generate a keypair lazily. */ + if (spec->dig == NULL) + spec->dig = pgpDigNew(RPMVSF_DEFAULT, PGPPUBKEYALGO_DSA); + + if (!spec->recursing && spec->BACount) { + int x; + /* When iterating over BANames, do the source */ + /* packaging on the first run, and skip RMSOURCE altogether */ + if (spec->BASpecs != NULL) + for (x = 0; x < spec->BACount; x++) { + if ((rc = buildSpec(ts, spec->BASpecs[x], + (what & ~RPMBUILD_RMSOURCE) | + (x ? 0 : (what & RPMBUILD_PACKAGESOURCE)), + test))) { + goto exit; + } + } + } else { + /* support "%track" script/section */ + if ((what & RPMBUILD_TRACK) && + (rc = doScript(spec, RPMBUILD_TRACK, NULL, NULL, test))) + goto exit; + + if ((what & RPMBUILD_PREP) && + (rc = doScript(spec, RPMBUILD_PREP, NULL, NULL, test))) + goto exit; + + if ((what & RPMBUILD_BUILD) && + (rc = doScript(spec, RPMBUILD_BUILD, NULL, NULL, test))) + goto exit; + + if ((what & RPMBUILD_INSTALL) && + (rc = doScript(spec, RPMBUILD_INSTALL, NULL, NULL, test))) + goto exit; + + if ((what & RPMBUILD_CHECK) && + (rc = doScript(spec, RPMBUILD_CHECK, NULL, NULL, test))) + goto exit; + + if ((what & RPMBUILD_PACKAGESOURCE) && + (rc = processSourceFiles(spec))) + goto exit; + + if (((what & RPMBUILD_INSTALL) || (what & RPMBUILD_PACKAGEBINARY) || + (what & RPMBUILD_FILECHECK)) && + (rc = processBinaryFiles(spec, what & RPMBUILD_INSTALL, test))) + goto exit; + + if (((what & RPMBUILD_PACKAGESOURCE) && !test) && + (rc = packageSources(spec))) + return rc; + + if (((what & RPMBUILD_PACKAGEBINARY) && !test) && + (rc = packageBinaries(spec))) + goto exit; + + if ((what & RPMBUILD_CLEAN) && + (rc = doScript(spec, RPMBUILD_CLEAN, NULL, NULL, test))) + goto exit; + + if ((what & RPMBUILD_RMBUILD) && + (rc = doScript(spec, RPMBUILD_RMBUILD, NULL, NULL, test))) + goto exit; + } + + if (what & RPMBUILD_RMSOURCE) + doRmSource(spec); + + if (what & RPMBUILD_RMSPEC) + (void) Unlink(spec->specFile); + +#if defined(RPM_VENDOR_OPENPKG) /* auto-remove-source-directories */ + /* In OpenPKG we use per-package %{_sourcedir} and %{_specdir} + definitions (macros have trailing ".../%{name}"). On removal of + source(s) and .spec file, this per-package directory would be kept + (usually /RPM/SRC//), because RPM does not know about + this OpenPKG convention. So, let RPM try(!) to remove the two + directories (if they are empty) and just ignore removal failures + (if they are still not empty). */ + if (what & RPMBUILD_RMSOURCE) { + const char *pn; + pn = rpmGetPath("%{_sourcedir}", NULL); + Rmdir(pn); /* ignore error, it is ok if it fails (usually with ENOTEMPTY) */ + pn = _free(pn); + } + if (what & RPMBUILD_RMSPEC) { + const char *pn; + pn = rpmGetPath("%{_specdir}", NULL); + Rmdir(pn); /* ignore error, it is ok if it fails (usually with ENOTEMPTY) */ + pn = _free(pn); + } +#endif + +exit: + if (rc != RPMRC_OK && rpmlogGetNrecs() > 0) { + rpmlog(RPMLOG_NOTICE, _("\n\nRPM build errors:\n")); + rpmlogPrint(NULL); + } + + return rc; +} diff --git a/rpm-5.4.9/build/buildio.h b/rpm-5.4.9/build/buildio.h new file mode 100644 index 0000000..3164e0f --- /dev/null +++ b/rpm-5.4.9/build/buildio.h @@ -0,0 +1,79 @@ +#ifndef _H_BUILDIO_ +#define _H_BUILDIO_ + +/** \ingroup rpmbuild + * \file build/buildio.h + * Routines to read and write packages. + * @deprecated this information will move elsewhere eventually. + * @todo Eliminate, merge into rpmlib. + */ + +#include "rpmbuild.h" + +/** + */ +typedef /*@abstract@*/ struct cpioSourceArchive_s { + rpmuint32_t cpioArchiveSize; +/*@relnull@*/ + FD_t cpioFdIn; +/*@refcounted@*/ /*@relnull@*/ + rpmfi fi; +/*@only@*/ + struct rpmlead * lead; /* XXX FIXME: exorcize lead/arch/os */ +} * CSA_t; + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(DEAD) +/** + * Read rpm package components from file. + * @param fileName file name of package (or NULL to use stdin) + * @retval specp spec structure to carry package header (or NULL) + * @retval lead package lead + * @retval sigs package signature + * @param csa + * @return 0 on success + */ +/*@unused@*/ int readRPM(/*@null@*/ const char * fileName, + /*@out@*/ Spec * specp, + /*@out@*/ void * l, + /*@out@*/ Header * sigs, + CSA_t csa) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies *specp, *lead, *sigs, csa, csa->cpioFdIn, + rpmGlobalMacroContext, fileSystem, internalState @*/; +#endif + +/** + * Write rpm package to file. + * + * @warning The first argument (header) is now passed by reference in order to + * return a reloaded contiguous header to the caller. + * + * @retval *hdrp header to write (final header is returned). + * @retval *pkgidp header+payload MD5 of package (NULL to disable). + * @param fileName file name of package + * @param csa + * @param passPhrase + * @retval cookie generated cookie (i.e build host/time) + * @param _dig DSA keypair for auto-signing (or NULL) + * @return RPMRC_OK on success + */ +rpmRC writeRPM(Header * hdrp, /*@null@*/ unsigned char ** pkgidp, + const char * fileName, + CSA_t csa, + /*@null@*/ char * passPhrase, + /*@out@*/ const char ** cookie, void * _dig) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies *hdrp, *pkgidp, *cookie, csa, csa->cpioArchiveSize, + rpmGlobalMacroContext, fileSystem, internalState @*/; + +#ifdef __cplusplus +} +#endif + +#endif /* _H_BUILDIO_ */ diff --git a/rpm-5.4.9/build/expression.c b/rpm-5.4.9/build/expression.c new file mode 100644 index 0000000..6919a46 --- /dev/null +++ b/rpm-5.4.9/build/expression.c @@ -0,0 +1,773 @@ +/** \ingroup rpmbuild + * \file build/expression.c + * Simple logical expression parser. + * This module implements a basic expression parser with support for + * integer and string datatypes. For ease of programming, we use the + * top-down "recursive descent" method of parsing. While a + * table-driven bottom-up parser might be faster, it does not really + * matter for the expressions we will be parsing. + * + * Copyright (C) 1998 Tom Dyas + * This work is provided under the GPL or LGPL at your choice. + */ + +#include "system.h" + +#include +#include +#include + +#include + +#include "debug.h" + +/* #define DEBUG_PARSER 1 */ + +#ifdef DEBUG_PARSER +#include +#define DEBUG(x) do { x ; } while (0) +#else +#define DEBUG(x) +#endif + +/** + * Encapsulation of a "value" + */ +typedef struct _value { + enum { VALUE_TYPE_INTEGER, VALUE_TYPE_STRING } type; + union { + const char *s; + int i; + } data; +} *Value; + +/** + */ +static Value valueMakeInteger(int i) + /*@*/ +{ + Value v; + + v = (Value) xmalloc(sizeof(*v)); + v->type = VALUE_TYPE_INTEGER; + v->data.i = i; + return v; +} + +/** + */ +static Value valueMakeString(/*@only@*/ const char *s) + /*@*/ +{ + Value v; + + v = (Value) xmalloc(sizeof(*v)); + v->type = VALUE_TYPE_STRING; + v->data.s = s; + return v; +} + +/** + */ +static void valueFree( /*@only@*/ Value v) + /*@modifies v @*/ +{ + if (v) { + if (v->type == VALUE_TYPE_STRING) + v->data.s = _free(v->data.s); + v = _free(v); + } +} + +#ifdef DEBUG_PARSER +static void valueDump(const char *msg, Value v, FILE *fp) + /*@*/ +{ + if (msg) + fprintf(fp, "%s ", msg); + if (v) { + if (v->type == VALUE_TYPE_INTEGER) + fprintf(fp, "INTEGER %d\n", v->data.i); + else + fprintf(fp, "STRING '%s'\n", v->data.s); + } else + fprintf(fp, "NULL\n"); +} +#endif + +#define valueIsInteger(v) ((v)->type == VALUE_TYPE_INTEGER) +#define valueIsString(v) ((v)->type == VALUE_TYPE_STRING) +#define valueSameType(v1,v2) ((v1)->type == (v2)->type) + + +/** + * Parser state. + */ +typedef struct _parseState { +/*@owned@*/ + char *str; /*!< expression string */ +/*@dependent@*/ + char *p; /*!< current position in expression string */ + int nextToken; /*!< current lookahead token */ +/*@relnull@*/ + Value tokenValue; /*!< valid when TOK_INTEGER or TOK_STRING */ + Spec spec; /*!< spec file that we are parsing inside of */ +} *ParseState; + + +/** + * \name Parser tokens + */ +/*@{*/ +#define TOK_EOF 1 +#define TOK_INTEGER 2 +#define TOK_STRING 3 +#define TOK_IDENTIFIER 4 +#define TOK_ADD 5 +#define TOK_MINUS 6 +#define TOK_MULTIPLY 7 +#define TOK_DIVIDE 8 +#define TOK_OPEN_P 9 +#define TOK_CLOSE_P 10 +#define TOK_EQ 11 +#define TOK_NEQ 12 +#define TOK_LT 13 +#define TOK_LE 14 +#define TOK_GT 15 +#define TOK_GE 16 +#define TOK_NOT 17 +#define TOK_LOGICAL_AND 18 +#define TOK_LOGICAL_OR 19 +/*@}*/ + +#define EXPRBUFSIZ BUFSIZ + +#if defined(DEBUG_PARSER) +typedef struct exprTokTableEntry { + const char *name; + int val; +} ETTE_t; + +ETTE_t exprTokTable[] = { + { "EOF", TOK_EOF }, + { "I", TOK_INTEGER }, + { "S", TOK_STRING }, + { "ID", TOK_IDENTIFIER }, + { "+", TOK_ADD }, + { "-", TOK_MINUS }, + { "*", TOK_MULTIPLY }, + { "/", TOK_DIVIDE }, + { "( ", TOK_OPEN_P }, + { " )", TOK_CLOSE_P }, + { "==", TOK_EQ }, + { "!=", TOK_NEQ }, + { "<", TOK_LT }, + { "<=", TOK_LE }, + { ">", TOK_GT }, + { ">=", TOK_GE }, + { "!", TOK_NOT }, + { "&&", TOK_LOGICAL_AND }, + { "||", TOK_LOGICAL_OR }, + { NULL, 0 } +}; + +static const char *prToken(int val) + /*@*/ +{ + ETTE_t *et; + + for (et = exprTokTable; et->name != NULL; et++) { + if (val == et->val) + return et->name; + } + return "???"; +} +#endif /* DEBUG_PARSER */ + +/** + * @param state expression parser state + */ +static int rdToken(ParseState state) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies state->nextToken, state->p, state->tokenValue, + rpmGlobalMacroContext, internalState @*/ +{ + int token; + Value v = NULL; + char *p = state->p; + + /* Skip whitespace before the next token. */ + while (*p && xisspace(*p)) p++; + + switch (*p) { + case '\0': + token = TOK_EOF; + p--; + break; + case '+': + token = TOK_ADD; + break; + case '-': + token = TOK_MINUS; + break; + case '*': + token = TOK_MULTIPLY; + break; + case '/': + token = TOK_DIVIDE; + break; + case '(': + token = TOK_OPEN_P; + break; + case ')': + token = TOK_CLOSE_P; + break; + case '=': + if (p[1] == '=') { + token = TOK_EQ; + p++; + } else { + rpmlog(RPMLOG_ERR, _("syntax error while parsing ==\n")); + return -1; + } + break; + case '!': + if (p[1] == '=') { + token = TOK_NEQ; + p++; + } else + token = TOK_NOT; + break; + case '<': + if (p[1] == '=') { + token = TOK_LE; + p++; + } else + token = TOK_LT; + break; + case '>': + if (p[1] == '=') { + token = TOK_GE; + p++; + } else + token = TOK_GT; + break; + case '&': + if (p[1] == '&') { + token = TOK_LOGICAL_AND; + p++; + } else { + rpmlog(RPMLOG_ERR, _("syntax error while parsing &&\n")); + return -1; + } + break; + case '|': + if (p[1] == '|') { + token = TOK_LOGICAL_OR; + p++; + } else { + rpmlog(RPMLOG_ERR, _("syntax error while parsing ||\n")); + return -1; + } + break; + + default: + if (xisdigit(*p)) { + char temp[EXPRBUFSIZ], *t = temp; + + temp[0] = '\0'; + while (*p && xisdigit(*p)) + *t++ = *p++; + *t++ = '\0'; + p--; + + token = TOK_INTEGER; + v = valueMakeInteger(atoi(temp)); + + } else if (xisalpha(*p)) { + char temp[EXPRBUFSIZ], *t = temp; + + temp[0] = '\0'; + while (*p && (xisalnum(*p) || *p == '_')) + *t++ = *p++; + *t++ = '\0'; + p--; + + token = TOK_IDENTIFIER; + v = valueMakeString( xstrdup(temp) ); + + } else if (*p == '\"') { + char temp[EXPRBUFSIZ], *t = temp; + + temp[0] = '\0'; + p++; + while (*p && *p != '\"') + *t++ = *p++; + *t++ = '\0'; + + token = TOK_STRING; + v = valueMakeString( rpmExpand(temp, NULL) ); + + } else { + rpmlog(RPMLOG_ERR, _("parse error in expression\n")); + return -1; + } + } + + state->p = p + 1; + state->nextToken = token; + state->tokenValue = v; + + DEBUG(printf("rdToken: \"%s\" (%d)\n", prToken(token), token)); + DEBUG(valueDump("rdToken:", state->tokenValue, stdout)); + + return 0; +} + +/*@null@*/ +static Value doLogical(ParseState state) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies state->nextToken, state->p, state->tokenValue, + rpmGlobalMacroContext, internalState @*/; + +/** + * @param state expression parser state + */ +/*@null@*/ +static Value doPrimary(ParseState state) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies state->nextToken, state->p, state->tokenValue, + rpmGlobalMacroContext, internalState @*/ +{ + Value v; + + DEBUG(printf("doPrimary()\n")); + + switch (state->nextToken) { + case TOK_OPEN_P: + if (rdToken(state)) + return NULL; + v = doLogical(state); + if (state->nextToken != TOK_CLOSE_P) { + rpmlog(RPMLOG_ERR, _("unmatched (\n")); + return NULL; + } + if (rdToken(state)) + return NULL; + break; + + case TOK_INTEGER: + case TOK_STRING: + v = state->tokenValue; + if (rdToken(state)) + return NULL; + break; + + case TOK_IDENTIFIER: { + const char *name = state->tokenValue->data.s; + + v = valueMakeString( rpmExpand(name, NULL) ); + if (rdToken(state)) + return NULL; + break; + } + + case TOK_MINUS: + if (rdToken(state)) + return NULL; + + v = doPrimary(state); + if (v == NULL) + return NULL; + + if (! valueIsInteger(v)) { + rpmlog(RPMLOG_ERR, _("- only on numbers\n")); + return NULL; + } + + v = valueMakeInteger(- v->data.i); + break; + + case TOK_NOT: + if (rdToken(state)) + return NULL; + + v = doPrimary(state); + if (v == NULL) + return NULL; + + if (! valueIsInteger(v)) { + rpmlog(RPMLOG_ERR, _("! only on numbers\n")); + return NULL; + } + + v = valueMakeInteger(! v->data.i); + break; + default: + return NULL; + /*@notreached@*/ break; + } + + DEBUG(valueDump("doPrimary:", v, stdout)); + return v; +} + +/** + * @param state expression parser state + */ +/*@null@*/ +static Value doMultiplyDivide(ParseState state) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies state->nextToken, state->p, state->tokenValue, + rpmGlobalMacroContext, internalState @*/ +{ + Value v1, v2 = NULL; + + DEBUG(printf("doMultiplyDivide()\n")); + + v1 = doPrimary(state); + if (v1 == NULL) + return NULL; + + while (state->nextToken == TOK_MULTIPLY + || state->nextToken == TOK_DIVIDE) + { + int op = state->nextToken; + + if (rdToken(state)) + return NULL; + + if (v2) valueFree(v2); + + v2 = doPrimary(state); + if (v2 == NULL) + return NULL; + + if (! valueSameType(v1, v2)) { + rpmlog(RPMLOG_ERR, _("types must match\n")); + return NULL; + } + + if (valueIsInteger(v1)) { + int i1 = v1->data.i, i2 = v2->data.i; + + valueFree(v1); + if (op == TOK_MULTIPLY) + v1 = valueMakeInteger(i1 * i2); + else + v1 = valueMakeInteger(i1 / i2); + } else { + rpmlog(RPMLOG_ERR, _("* / not suported for strings\n")); + return NULL; + } + } + + if (v2) valueFree(v2); + return v1; +} + +/** + * @param state expression parser state + */ +/*@null@*/ +static Value doAddSubtract(ParseState state) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies state->nextToken, state->p, state->tokenValue, + rpmGlobalMacroContext, internalState @*/ +{ + Value v1, v2 = NULL; + + DEBUG(printf("doAddSubtract()\n")); + + v1 = doMultiplyDivide(state); + if (v1 == NULL) + return NULL; + + while (state->nextToken == TOK_ADD || state->nextToken == TOK_MINUS) { + int op = state->nextToken; + + if (rdToken(state)) + return NULL; + + if (v2) valueFree(v2); + + v2 = doMultiplyDivide(state); + if (v2 == NULL) + return NULL; + + if (! valueSameType(v1, v2)) { + rpmlog(RPMLOG_ERR, _("types must match\n")); + return NULL; + } + + if (valueIsInteger(v1)) { + int i1 = v1->data.i, i2 = v2->data.i; + + valueFree(v1); + if (op == TOK_ADD) + v1 = valueMakeInteger(i1 + i2); + else + v1 = valueMakeInteger(i1 - i2); + } else { + char *copy; + + if (op == TOK_MINUS) { + rpmlog(RPMLOG_ERR, _("- not suported for strings\n")); + return NULL; + } + + copy = xmalloc(strlen(v1->data.s) + strlen(v2->data.s) + 1); + (void) stpcpy( stpcpy(copy, v1->data.s), v2->data.s); + + valueFree(v1); + v1 = valueMakeString(copy); + } + } + + if (v2) valueFree(v2); + return v1; +} + +/** + * @param state expression parser state + */ +/*@null@*/ +static Value doRelational(ParseState state) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies state->nextToken, state->p, state->tokenValue, + rpmGlobalMacroContext, internalState @*/ +{ + Value v1, v2 = NULL; + + DEBUG(printf("doRelational()\n")); + + v1 = doAddSubtract(state); + if (v1 == NULL) + return NULL; + + while (state->nextToken >= TOK_EQ && state->nextToken <= TOK_GE) { + int op = state->nextToken; + + if (rdToken(state)) + return NULL; + + if (v2) valueFree(v2); + + v2 = doAddSubtract(state); + if (v2 == NULL) + return NULL; + + if (! valueSameType(v1, v2)) { + rpmlog(RPMLOG_ERR, _("types must match\n")); + return NULL; + } + + if (valueIsInteger(v1)) { + int i1 = v1->data.i, i2 = v2->data.i, r = 0; + switch (op) { + case TOK_EQ: + r = (i1 == i2); + /*@switchbreak@*/ break; + case TOK_NEQ: + r = (i1 != i2); + /*@switchbreak@*/ break; + case TOK_LT: + r = (i1 < i2); + /*@switchbreak@*/ break; + case TOK_LE: + r = (i1 <= i2); + /*@switchbreak@*/ break; + case TOK_GT: + r = (i1 > i2); + /*@switchbreak@*/ break; + case TOK_GE: + r = (i1 >= i2); + /*@switchbreak@*/ break; + default: + /*@switchbreak@*/ break; + } + valueFree(v1); + v1 = valueMakeInteger(r); + } else { + const char * s1 = v1->data.s; + const char * s2 = v2->data.s; + int r = 0; + switch (op) { + case TOK_EQ: + r = (strcmp(s1,s2) == 0); + /*@switchbreak@*/ break; + case TOK_NEQ: + r = (strcmp(s1,s2) != 0); + /*@switchbreak@*/ break; + case TOK_LT: + r = (strcmp(s1,s2) < 0); + /*@switchbreak@*/ break; + case TOK_LE: + r = (strcmp(s1,s2) <= 0); + /*@switchbreak@*/ break; + case TOK_GT: + r = (strcmp(s1,s2) > 0); + /*@switchbreak@*/ break; + case TOK_GE: + r = (strcmp(s1,s2) >= 0); + /*@switchbreak@*/ break; + default: + /*@switchbreak@*/ break; + } + valueFree(v1); + v1 = valueMakeInteger(r); + } + } + + if (v2) valueFree(v2); + return v1; +} + +/** + * @param state expression parser state + */ +static Value doLogical(ParseState state) + /*@globals rpmGlobalMacroContext, h_errno @*/ + /*@modifies state->nextToken, state->p, state->tokenValue, + rpmGlobalMacroContext @*/ +{ + Value v1, v2 = NULL; + + DEBUG(printf("doLogical()\n")); + + v1 = doRelational(state); + if (v1 == NULL) + return NULL; + + while (state->nextToken == TOK_LOGICAL_AND + || state->nextToken == TOK_LOGICAL_OR) + { + int op = state->nextToken; + + if (rdToken(state)) + return NULL; + + if (v2) valueFree(v2); + + v2 = doRelational(state); + if (v2 == NULL) + return NULL; + + if (! valueSameType(v1, v2)) { + rpmlog(RPMLOG_ERR, _("types must match\n")); + return NULL; + } + + if (valueIsInteger(v1)) { + int i1 = v1->data.i, i2 = v2->data.i; + + valueFree(v1); + if (op == TOK_LOGICAL_AND) + v1 = valueMakeInteger(i1 && i2); + else + v1 = valueMakeInteger(i1 || i2); + } else { + rpmlog(RPMLOG_ERR, _("&& and || not suported for strings\n")); + return NULL; + } + } + + if (v2) valueFree(v2); + return v1; +} + +int parseExpressionBoolean(Spec spec, const char *expr) +{ + struct _parseState state; + int result = -1; + Value v; + + DEBUG(printf("parseExprBoolean(?, '%s')\n", expr)); + + /* Initialize the expression parser state. */ + state.p = state.str = xstrdup(expr); + state.spec = spec; + state.nextToken = 0; + state.tokenValue = NULL; + (void) rdToken(&state); + + /* Parse the expression. */ + v = doLogical(&state); + if (!v) { + state.str = _free(state.str); + return -1; + } + + /* If the next token is not TOK_EOF, we have a syntax error. */ + if (state.nextToken != TOK_EOF) { + rpmlog(RPMLOG_ERR, _("syntax error in expression\n")); + state.str = _free(state.str); + return -1; + } + + DEBUG(valueDump("parseExprBoolean:", v, stdout)); + + switch (v->type) { + case VALUE_TYPE_INTEGER: + result = v->data.i != 0; + break; + case VALUE_TYPE_STRING: + result = v->data.s[0] != '\0'; + break; + default: + break; + } + + state.str = _free(state.str); + valueFree(v); + return result; +} + +char * parseExpressionString(Spec spec, const char *expr) +{ + struct _parseState state; + char *result = NULL; + Value v; + + DEBUG(printf("parseExprString(?, '%s')\n", expr)); + + /* Initialize the expression parser state. */ + state.p = state.str = xstrdup(expr); + state.spec = spec; + state.nextToken = 0; + state.tokenValue = NULL; + (void) rdToken(&state); + + /* Parse the expression. */ + v = doLogical(&state); + if (!v) { + state.str = _free(state.str); + return NULL; + } + + /* If the next token is not TOK_EOF, we have a syntax error. */ + if (state.nextToken != TOK_EOF) { + rpmlog(RPMLOG_ERR, _("syntax error in expression\n")); + state.str = _free(state.str); + return NULL; + } + + DEBUG(valueDump("parseExprString:", v, stdout)); + + switch (v->type) { + case VALUE_TYPE_INTEGER: { + char buf[128]; + sprintf(buf, "%d", v->data.i); + result = xstrdup(buf); + } break; + case VALUE_TYPE_STRING: + result = xstrdup(v->data.s); + break; + default: + break; + } + + state.str = _free(state.str); + valueFree(v); + return result; +} diff --git a/rpm-5.4.9/build/files.c b/rpm-5.4.9/build/files.c new file mode 100644 index 0000000..4bfba8b --- /dev/null +++ b/rpm-5.4.9/build/files.c @@ -0,0 +1,3187 @@ +/** \ingroup rpmbuild + * \file build/files.c + * The post-build, pre-packaging file tree walk to assemble the package + * manifest. + */ + +#include "system.h" + +#define MYALLPERMS 07777 + +#if defined(WITH_PCRE) && defined(WITH_PCRE_POSIX) +#include +#else +#include +#endif + +#define _RPMIOB_INTERNAL +#include +#include /* XXX fdGetFp */ +#include +#include +#define _RPMSX_INTERNAL /* XXX permit disabling. */ +#include +#include +#include + +#include "iosm.h" +#define _RPMTAG_INTERNAL /* XXX rpmTags->aTags */ +#define _RPMFI_INTERNAL +#include + +#define _RPMTE_INTERNAL +#include + +#include "rpmfc.h" + +#include "buildio.h" + +#include "legacy.h" /* XXX dodigest */ +#include "debug.h" + +/*@access Header @*/ +/*@access rpmfi @*/ +/*@access rpmte @*/ +/*@access FD_t @*/ + +#define SKIPWHITE(_x) {while(*(_x) && (xisspace(*_x) || *(_x) == ',')) (_x)++;} +#define SKIPNONWHITE(_x){while(*(_x) &&!(xisspace(*_x) || *(_x) == ',')) (_x)++;} + +#define MAXDOCDIR 1024 + +/** + */ +typedef enum specdFlags_e { + SPECD_DEFFILEMODE = (1 << 0), + SPECD_DEFDIRMODE = (1 << 1), + SPECD_DEFUID = (1 << 2), + SPECD_DEFGID = (1 << 3), + SPECD_DEFVERIFY = (1 << 4), + + SPECD_FILEMODE = (1 << 8), + SPECD_DIRMODE = (1 << 9), + SPECD_UID = (1 << 10), + SPECD_GID = (1 << 11), + SPECD_VERIFY = (1 << 12) +} specdFlags; + +/** + */ +typedef struct FileListRec_s { + struct stat fl_st; +#define fl_dev fl_st.st_dev +#define fl_ino fl_st.st_ino +#define fl_mode fl_st.st_mode +#define fl_nlink fl_st.st_nlink +#define fl_uid fl_st.st_uid +#define fl_gid fl_st.st_gid +#define fl_rdev fl_st.st_rdev +#define fl_size fl_st.st_size +#define fl_mtime fl_st.st_mtime + +/*@only@*/ + const char *diskURL; /* get file from here */ +/*@only@*/ + const char *fileURL; /* filename in cpio archive */ +/*@observer@*/ + const char *uname; +/*@observer@*/ + const char *gname; + unsigned flags; + specdFlags specdFlags; /* which attributes have been explicitly specified. */ + unsigned verifyFlags; +/*@only@*/ + const char *langs; /* XXX locales separated with | */ +} * FileListRec; + +/** + */ +typedef struct AttrRec_s { +/*@null@*/ + const char *ar_fmodestr; +/*@null@*/ + const char *ar_dmodestr; +/*@null@*/ + const char *ar_user; +/*@null@*/ + const char *ar_group; + mode_t ar_fmode; + mode_t ar_dmode; +} * AttrRec; + +/*@-readonlytrans@*/ +/*@unchecked@*/ /*@observer@*/ +static struct AttrRec_s root_ar = { NULL, NULL, "root", "root", 0, 0 }; +/*@=readonlytrans@*/ + +/** + * Package file tree walk data. + */ +typedef struct FileList_s { +/*@only@*/ + const char * buildRootURL; +/*@only@*/ + const char * prefix; + + int fileCount; + int totalFileSize; + int processingFailed; + + int passedSpecialDoc; + int isSpecialDoc; + + int noGlob; + unsigned devtype; + unsigned devmajor; + int devminor; + + int isDir; + int inFtw; + int currentFlags; + specdFlags currentSpecdFlags; + unsigned currentVerifyFlags; + struct AttrRec_s cur_ar; + struct AttrRec_s def_ar; + specdFlags defSpecdFlags; + unsigned defVerifyFlags; + int nLangs; +/*@only@*/ /*@null@*/ + const char ** currentLangs; + + /* Hard coded limit of MAXDOCDIR docdirs. */ + /* If you break it you are doing something wrong. */ + const char * docDirs[MAXDOCDIR]; + int docDirCount; + +/*@only@*/ + FileListRec fileList; + int fileListRecsAlloced; + int fileListRecsUsed; +} * FileList; + +/** + */ +static void nullAttrRec(/*@out@*/ AttrRec ar) /*@modifies ar @*/ +{ + ar->ar_fmodestr = NULL; + ar->ar_dmodestr = NULL; + ar->ar_user = NULL; + ar->ar_group = NULL; + ar->ar_fmode = 0; + ar->ar_dmode = 0; +} + +/** + */ +static void freeAttrRec(AttrRec ar) /*@modifies ar @*/ +{ + ar->ar_fmodestr = _free(ar->ar_fmodestr); + ar->ar_dmodestr = _free(ar->ar_dmodestr); + ar->ar_user = _free(ar->ar_user); + ar->ar_group = _free(ar->ar_group); + /* XXX doesn't free ar (yet) */ + /*@-nullstate@*/ + return; + /*@=nullstate@*/ +} + +/** + */ +static void dupAttrRec(const AttrRec oar, /*@in@*/ /*@out@*/ AttrRec nar) + /*@modifies nar @*/ +{ + if (oar == nar) + return; + freeAttrRec(nar); + nar->ar_fmodestr = (oar->ar_fmodestr ? xstrdup(oar->ar_fmodestr) : NULL); + nar->ar_dmodestr = (oar->ar_dmodestr ? xstrdup(oar->ar_dmodestr) : NULL); + nar->ar_user = (oar->ar_user ? xstrdup(oar->ar_user) : NULL); + nar->ar_group = (oar->ar_group ? xstrdup(oar->ar_group) : NULL); + nar->ar_fmode = oar->ar_fmode; + nar->ar_dmode = oar->ar_dmode; +} + +#if 0 +/** + */ +static void dumpAttrRec(const char * msg, AttrRec ar) + /*@globals fileSystem@*/ + /*@modifies fileSystem @*/ +{ + if (msg) + fprintf(stderr, "%s:\t", msg); + fprintf(stderr, "(%s, %s, %s, %s)\n", + ar->ar_fmodestr, + ar->ar_user, + ar->ar_group, + ar->ar_dmodestr); +} +#endif + +/** + * Strip quotes from strtok(3) string. + * @param s string + * @param delim token delimiters + */ +/*@null@*/ +static char *strtokWithQuotes(/*@null@*/ char *s, const char *delim) + /*@modifies *s @*/ +{ + static char *olds = NULL; + char *token; + + if (s == NULL) + s = olds; + if (s == NULL) + return NULL; + + /* Skip leading delimiters */ + s += strspn(s, delim); + if (*s == '\0') + return NULL; + + /* Find the end of the token. */ + token = s; + if (*token == '"') { + token++; + /* Find next " char */ + s = strchr(token, '"'); + } else { + s = strpbrk(token, delim); + } + + /* Terminate it */ + if (s == NULL) { + /* This token finishes the string */ + olds = strchr(token, '\0'); + } else { + /* Terminate the token and make olds point past it */ + *s = '\0'; + olds = s+1; + } + + /*@-retalias -temptrans @*/ + return token; + /*@=retalias =temptrans @*/ +} + +/** + */ +static void timeCheck(int tc, Header h) + /*@globals internalState @*/ + /*@modifies internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmuint32_t currentTime = (rpmuint32_t) time(NULL); + rpmuint32_t * mtime; + int xx; + size_t i; + + he->tag = RPMTAG_FILEMTIMES; + xx = headerGet(h, he, 0); + mtime = he->p.ui32p; + he->tag = RPMTAG_OLDFILENAMES; + xx = headerGet(h, he, 0); + + for (i = 0; i < he->c; i++) { + xx = currentTime - mtime[i]; + if (xx < 0) xx = -xx; + if (xx > tc) + rpmlog(RPMLOG_WARNING, _("TIMECHECK failure: %s\n"), he->p.argv[i]); + } + he->p.ptr = _free(he->p.ptr); + mtime = _free(mtime); +} + +/** + */ +typedef struct VFA { +/*@observer@*/ /*@null@*/ const char * attribute; + int not; + int flag; +} VFA_t; + +/** + */ +/*@-exportlocal -exportheadervar@*/ +/*@unchecked@*/ +static VFA_t verifyAttrs[] = { + { "md5", 0, RPMVERIFY_FDIGEST }, /* XXX legacy syntax */ + { "size", 0, RPMVERIFY_FILESIZE }, + { "link", 0, RPMVERIFY_LINKTO }, + { "user", 0, RPMVERIFY_USER }, + { "group", 0, RPMVERIFY_GROUP }, + { "mtime", 0, RPMVERIFY_MTIME }, + { "mode", 0, RPMVERIFY_MODE }, + { "rdev", 0, RPMVERIFY_RDEV }, + { "digest", 0, RPMVERIFY_FDIGEST }, + { "hmac", 0, RPMVERIFY_HMAC }, + { NULL, 0, 0 } +}; +/*@=exportlocal =exportheadervar@*/ + +/** + * Parse %verify and %defverify from file manifest. + * @param buf current spec file line + * @param fl package file tree walk data + * @return RPMRC_OK on success + */ +static rpmRC parseForVerify(char * buf, FileList fl) + /*@modifies buf, fl->processingFailed, + fl->currentVerifyFlags, fl->defVerifyFlags, + fl->currentSpecdFlags, fl->defSpecdFlags @*/ +{ + char *p, *pe, *q; + const char *name; + unsigned *resultVerify; + int negated; + unsigned verifyFlags; + specdFlags * specdFlags; + + if ((p = strstr(buf, (name = "%verify"))) != NULL) { + resultVerify = &(fl->currentVerifyFlags); + specdFlags = &fl->currentSpecdFlags; + } else if ((p = strstr(buf, (name = "%defverify"))) != NULL) { + resultVerify = &(fl->defVerifyFlags); + specdFlags = &fl->defSpecdFlags; + } else + return RPMRC_OK; + + for (pe = p; (size_t)(pe-p) < strlen(name); pe++) + *pe = ' '; + + SKIPSPACE(pe); + + if (*pe != '(') { + rpmlog(RPMLOG_ERR, _("Missing '(' in %s %s\n"), name, pe); + fl->processingFailed = 1; + return RPMRC_FAIL; + } + + /* Bracket %*verify args */ + *pe++ = ' '; + for (p = pe; *pe && *pe != ')'; pe++) + {}; + + if (*pe == '\0') { + rpmlog(RPMLOG_ERR, _("Missing ')' in %s(%s\n"), name, p); + fl->processingFailed = 1; + return RPMRC_FAIL; + } + + /* Localize. Erase parsed string */ + q = alloca((pe-p) + 1); + strncpy(q, p, pe-p); + q[pe-p] = '\0'; + while (p <= pe) + *p++ = ' '; + + negated = 0; + verifyFlags = RPMVERIFY_NONE; + + for (p = q; *p != '\0'; p = pe) { + SKIPWHITE(p); + if (*p == '\0') + break; + pe = p; + SKIPNONWHITE(pe); + if (*pe != '\0') + *pe++ = '\0'; + + { VFA_t *vfa; + for (vfa = verifyAttrs; vfa->attribute != NULL; vfa++) { + if (strcmp(p, vfa->attribute)) + /*@innercontinue@*/ continue; + verifyFlags |= vfa->flag; + verifyFlags &= ~RPMVERIFY_FDIGEST; + /*@innerbreak@*/ break; + } + if (vfa->attribute) + continue; + } + + if (!strcmp(p, "not")) { + negated ^= 1; + } else { + rpmlog(RPMLOG_ERR, _("Invalid %s token: %s\n"), name, p); + fl->processingFailed = 1; + return RPMRC_FAIL; + } + } + + *resultVerify = negated ? ~(verifyFlags) : verifyFlags; + if (negated) { + /* Make sure "no digest" implies "no hmac" */ + if (!(*resultVerify & RPMVERIFY_FDIGEST)) + *resultVerify &= ~RPMVERIFY_HMAC; + } else { + /* Make sure "hmac" implies "no digest" */ + if (*resultVerify & RPMVERIFY_HMAC) + *resultVerify &= ~RPMVERIFY_FDIGEST; + } + *specdFlags |= SPECD_VERIFY; + + return RPMRC_OK; +} + +#define isAttrDefault(_ars) ((_ars)[0] == '-' && (_ars)[1] == '\0') + +/** + * Parse %dev from file manifest. + * @param buf current spec file line + * @param fl package file tree walk data + * @return RPMRC_OK on success + */ +static rpmRC parseForDev(char * buf, FileList fl) + /*@modifies buf, fl->processingFailed, + fl->noGlob, fl->devtype, fl->devmajor, fl->devminor @*/ +{ + const char * name; + const char * errstr = NULL; + char *p, *pe, *q; + rpmRC rc = RPMRC_FAIL; /* assume error */ + + if ((p = strstr(buf, (name = "%dev"))) == NULL) + return RPMRC_OK; + + for (pe = p; (size_t)(pe-p) < strlen(name); pe++) + *pe = ' '; + SKIPSPACE(pe); + + if (*pe != '(') { + errstr = "'('"; + goto exit; + } + + /* Bracket %dev args */ + *pe++ = ' '; + for (p = pe; *pe && *pe != ')'; pe++) + {}; + if (*pe != ')') { + errstr = "')'"; + goto exit; + } + + /* Localize. Erase parsed string */ + q = alloca((pe-p) + 1); + strncpy(q, p, pe-p); + q[pe-p] = '\0'; + while (p <= pe) + *p++ = ' '; + + p = q; SKIPWHITE(p); + pe = p; SKIPNONWHITE(pe); if (*pe != '\0') *pe++ = '\0'; + if (*p == 'b') + fl->devtype = 'b'; + else if (*p == 'c') + fl->devtype = 'c'; + else { + errstr = "devtype"; + goto exit; + } + + p = pe; SKIPWHITE(p); + pe = p; SKIPNONWHITE(pe); if (*pe != '\0') *pe++ = '\0'; + for (pe = p; *pe && xisdigit(*pe); pe++) + {} ; + if (*pe == '\0') { + fl->devmajor = atoi(p); + /*@-unsignedcompare @*/ /* LCL: ge is ok */ + if (!((int)fl->devmajor >= 0 && (int)fl->devmajor < 256)) { + errstr = "devmajor"; + goto exit; + } + /*@=unsignedcompare @*/ + pe++; + } else { + errstr = "devmajor"; + goto exit; + } + + p = pe; SKIPWHITE(p); + pe = p; SKIPNONWHITE(pe); if (*pe != '\0') *pe++ = '\0'; + for (pe = p; *pe && xisdigit(*pe); pe++) + {} ; + if (*pe == '\0') { + fl->devminor = atoi(p); + if (!(fl->devminor >= 0 && fl->devminor < 256)) { + errstr = "devminor"; + goto exit; + } + pe++; + } else { + errstr = "devminor"; + goto exit; + } + + fl->noGlob = 1; + + rc = 0; + +exit: + if (rc) { + rpmlog(RPMLOG_ERR, _("Missing %s in %s %s\n"), errstr, name, p); + fl->processingFailed = 1; + } + return rc; +} + +/** + * Parse %attr and %defattr from file manifest. + * @param buf current spec file line + * @param fl package file tree walk data + * @return RPMRC_OK on success + */ +static rpmRC parseForAttr(char * buf, FileList fl) + /*@modifies buf, fl->processingFailed, + fl->cur_ar, fl->def_ar, + fl->currentSpecdFlags, fl->defSpecdFlags @*/ +{ + const char *name; + char *p, *pe, *q; + int x; + struct AttrRec_s arbuf; + AttrRec ar = &arbuf, ret_ar; + specdFlags * specdFlags; + + if ((p = strstr(buf, (name = "%attr"))) != NULL) { + ret_ar = &(fl->cur_ar); + specdFlags = &fl->currentSpecdFlags; + } else if ((p = strstr(buf, (name = "%defattr"))) != NULL) { + ret_ar = &(fl->def_ar); + specdFlags = &fl->defSpecdFlags; + } else + return RPMRC_OK; + + for (pe = p; (size_t)(pe-p) < strlen(name); pe++) + *pe = ' '; + + SKIPSPACE(pe); + + if (*pe != '(') { + rpmlog(RPMLOG_ERR, _("Missing '(' in %s %s\n"), name, pe); + fl->processingFailed = 1; + return RPMRC_FAIL; + } + + /* Bracket %*attr args */ + *pe++ = ' '; + for (p = pe; *pe && *pe != ')'; pe++) + {}; + + if (ret_ar == &(fl->def_ar)) { /* %defattr */ + q = pe; + q++; + SKIPSPACE(q); + if (*q != '\0') { + rpmlog(RPMLOG_ERR, + _("Non-white space follows %s(): %s\n"), name, q); + fl->processingFailed = 1; + return RPMRC_FAIL; + } + } + + /* Localize. Erase parsed string */ + q = alloca((pe-p) + 1); + strncpy(q, p, pe-p); + q[pe-p] = '\0'; + while (p <= pe) + *p++ = ' '; + + nullAttrRec(ar); + + p = q; SKIPWHITE(p); + if (*p != '\0') { + pe = p; SKIPNONWHITE(pe); if (*pe != '\0') *pe++ = '\0'; + ar->ar_fmodestr = p; + p = pe; SKIPWHITE(p); + } + if (*p != '\0') { + pe = p; SKIPNONWHITE(pe); if (*pe != '\0') *pe++ = '\0'; + ar->ar_user = p; + p = pe; SKIPWHITE(p); + } + if (*p != '\0') { + pe = p; SKIPNONWHITE(pe); if (*pe != '\0') *pe++ = '\0'; + ar->ar_group = p; + p = pe; SKIPWHITE(p); + } + if (*p != '\0' && ret_ar == &(fl->def_ar)) { /* %defattr */ + pe = p; SKIPNONWHITE(pe); if (*pe != '\0') *pe++ = '\0'; + ar->ar_dmodestr = p; + p = pe; SKIPWHITE(p); + } + + if (!(ar->ar_fmodestr && ar->ar_user && ar->ar_group) || *p != '\0') { + rpmlog(RPMLOG_ERR, _("Bad syntax: %s(%s)\n"), name, q); + fl->processingFailed = 1; + return RPMRC_FAIL; + } + + /* Do a quick test on the mode argument and adjust for "-" */ + if (ar->ar_fmodestr && !isAttrDefault(ar->ar_fmodestr)) { + unsigned int ui; + x = sscanf(ar->ar_fmodestr, "%o", &ui); + if ((x == 0) || (ar->ar_fmode & ~MYALLPERMS)) { + rpmlog(RPMLOG_ERR, _("Bad mode spec: %s(%s)\n"), name, q); + fl->processingFailed = 1; + return RPMRC_FAIL; + } + ar->ar_fmode = ui; + } else + ar->ar_fmodestr = NULL; + + if (ar->ar_dmodestr && !isAttrDefault(ar->ar_dmodestr)) { + unsigned int ui; + x = sscanf(ar->ar_dmodestr, "%o", &ui); + if ((x == 0) || (ar->ar_dmode & ~MYALLPERMS)) { + rpmlog(RPMLOG_ERR, _("Bad dirmode spec: %s(%s)\n"), name, q); + fl->processingFailed = 1; + return RPMRC_FAIL; + } + ar->ar_dmode = ui; + } else + ar->ar_dmodestr = NULL; + + if (!(ar->ar_user && !isAttrDefault(ar->ar_user))) + ar->ar_user = NULL; + + if (!(ar->ar_group && !isAttrDefault(ar->ar_group))) + ar->ar_group = NULL; + + dupAttrRec(ar, ret_ar); + + /* XXX fix all this */ + *specdFlags |= SPECD_UID | SPECD_GID | SPECD_FILEMODE | SPECD_DIRMODE; + + return RPMRC_OK; +} + +/** + * Parse %config from file manifest. + * @param buf current spec file line + * @param fl package file tree walk data + * @return RPMRC_OK on success + */ +static rpmRC parseForConfig(char * buf, FileList fl) + /*@modifies buf, fl->processingFailed, fl->currentFlags @*/ +{ + char *p, *pe, *q; + const char *name; + + if ((p = strstr(buf, (name = "%config"))) == NULL) + return RPMRC_OK; + + fl->currentFlags |= RPMFILE_CONFIG; + + /* Erase "%config" token. */ + for (pe = p; (size_t)(pe-p) < strlen(name); pe++) + *pe = ' '; + SKIPSPACE(pe); + if (*pe != '(') + return RPMRC_OK; + + /* Bracket %config args */ + *pe++ = ' '; + for (p = pe; *pe && *pe != ')'; pe++) + {}; + + if (*pe == '\0') { + rpmlog(RPMLOG_ERR, _("Missing ')' in %s(%s\n"), name, p); + fl->processingFailed = 1; + return RPMRC_FAIL; + } + + /* Localize. Erase parsed string. */ + q = alloca((pe-p) + 1); + strncpy(q, p, pe-p); + q[pe-p] = '\0'; + while (p <= pe) + *p++ = ' '; + + for (p = q; *p != '\0'; p = pe) { + SKIPWHITE(p); + if (*p == '\0') + break; + pe = p; + SKIPNONWHITE(pe); + if (*pe != '\0') + *pe++ = '\0'; + if (!strcmp(p, "missingok")) { + fl->currentFlags |= RPMFILE_MISSINGOK; + } else if (!strcmp(p, "noreplace")) { + fl->currentFlags |= RPMFILE_NOREPLACE; + } else { + rpmlog(RPMLOG_ERR, _("Invalid %s token: %s\n"), name, p); + fl->processingFailed = 1; + return RPMRC_FAIL; + } + } + + return RPMRC_OK; +} + +/** + */ +static int langCmp(const void * ap, const void * bp) + /*@*/ +{ + return strcmp(*(const char **)ap, *(const char **)bp); +} + +/** + * Parse %lang from file manifest. + * @param buf current spec file line + * @param fl package file tree walk data + * @return RPMRC_OK on success + */ +static rpmRC parseForLang(char * buf, FileList fl) + /*@modifies buf, fl->processingFailed, + fl->currentLangs, fl->nLangs @*/ +{ + char *p, *pe, *q; + const char *name; + + while ((p = strstr(buf, (name = "%lang"))) != NULL) { + + for (pe = p; (size_t)(pe-p) < strlen(name); pe++) + *pe = ' '; + SKIPSPACE(pe); + + if (*pe != '(') { + rpmlog(RPMLOG_ERR, _("Missing '(' in %s %s\n"), name, pe); + fl->processingFailed = 1; + return RPMRC_FAIL; + } + + /* Bracket %lang args */ + *pe++ = ' '; + for (pe = p; *pe && *pe != ')'; pe++) + {}; + + if (*pe == '\0') { + rpmlog(RPMLOG_ERR, _("Missing ')' in %s(%s\n"), name, p); + fl->processingFailed = 1; + return RPMRC_FAIL; + } + + /* Localize. Erase parsed string. */ + q = alloca((pe-p) + 1); + strncpy(q, p, pe-p); + q[pe-p] = '\0'; + while (p <= pe) + *p++ = ' '; + + /* Parse multiple arguments from %lang */ + for (p = q; *p != '\0'; p = pe) { + char *newp; + size_t np; + int i; + + SKIPWHITE(p); + pe = p; + SKIPNONWHITE(pe); + + np = pe - p; + + /* Sanity check on locale lengths */ + if (np < 1 || (np == 1 && *p != 'C') || np >= 32) { + rpmlog(RPMLOG_ERR, + _("Unusual locale length: \"%.*s\" in %%lang(%s)\n"), + (int)np, p, q); + fl->processingFailed = 1; + return RPMRC_FAIL; + } + + /* Check for duplicate locales */ + if (fl->currentLangs != NULL) + for (i = 0; i < fl->nLangs; i++) { + if (strncmp(fl->currentLangs[i], p, np)) + /*@innercontinue@*/ continue; + rpmlog(RPMLOG_ERR, _("Duplicate locale %.*s in %%lang(%s)\n"), + (int)np, p, q); + fl->processingFailed = 1; + return RPMRC_FAIL; + } + + /* Add new locale */ + fl->currentLangs = xrealloc(fl->currentLangs, + (fl->nLangs + 1) * sizeof(*fl->currentLangs)); + newp = xmalloc( np+1 ); + strncpy(newp, p, np); + newp[np] = '\0'; + fl->currentLangs[fl->nLangs++] = newp; + if (*pe == ',') pe++; /* skip , if present */ + } + } + + /* Insure that locales are sorted. */ + if (fl->currentLangs) + qsort(fl->currentLangs, fl->nLangs, sizeof(*fl->currentLangs), langCmp); + + return RPMRC_OK; +} + +/** + */ +static int parseForRegexLang(const char * fileName, /*@out@*/ char ** lang) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies *lang, rpmGlobalMacroContext, internalState @*/ +{ + static int initialized = 0; + static int hasRegex = 0; + static regex_t compiledPatt; + static char buf[BUFSIZ]; + int x; + regmatch_t matches[2]; + const char *s; + + if (! initialized) { + const char *patt = rpmExpand("%{?_langpatt}", NULL); + int rc = 0; + if (!(patt && *patt != '\0')) + rc = 1; + else if (regcomp(&compiledPatt, patt, REG_EXTENDED)) + rc = -1; + patt = _free(patt); + if (rc) + return rc; + hasRegex = 1; + initialized = 1; + } + + memset(matches, 0, sizeof(matches)); + if (! hasRegex || regexec(&compiledPatt, fileName, 2, matches, REG_NOTEOL)) + return 1; + + /* Got match */ + s = fileName + matches[1].rm_eo - 1; + x = (int)matches[1].rm_eo - (int)matches[1].rm_so; + buf[x] = '\0'; + while (x) { + buf[--x] = *s--; + } + if (lang) + *lang = buf; + return 0; +} + +/** + */ +/*@-exportlocal -exportheadervar@*/ +/*@unchecked@*/ +static VFA_t virtualFileAttributes[] = { + { "%dir", 0, 0 }, /* XXX why not RPMFILE_DIR? */ + { "%doc", 0, RPMFILE_DOC }, + { "%ghost", 0, RPMFILE_GHOST }, + { "%exclude", 0, RPMFILE_EXCLUDE }, + { "%readme", 0, RPMFILE_README }, + { "%license", 0, RPMFILE_LICENSE }, + { "%pubkey", 0, RPMFILE_PUBKEY }, + { "%policy", 0, RPMFILE_POLICY }, + { "%optional", 0, RPMFILE_OPTIONAL }, + { "%remove", 0, RPMFILE_REMOVE }, + +#if WHY_NOT + { "%icon", 0, RPMFILE_ICON }, + { "%spec", 0, RPMFILE_SPEC }, + { "%config", 0, RPMFILE_CONFIG }, + { "%missingok", 0, RPMFILE_CONFIG|RPMFILE_MISSINGOK }, + { "%noreplace", 0, RPMFILE_CONFIG|RPMFILE_NOREPLACE }, +#endif + + { NULL, 0, 0 } +}; +/*@=exportlocal =exportheadervar@*/ + +/** + * Parse simple attributes (e.g. %dir) from file manifest. + * @param spec spec file control structure + * @param pkg package control structure + * @param buf current spec file line + * @param fl package file tree walk data + * @retval *fileName file name + * @return RPMRC_OK on success + */ +static rpmRC parseForSimple(/*@unused@*/ Spec spec, Package pkg, + char * buf, FileList fl, /*@out@*/ const char ** fileName) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies buf, fl->processingFailed, *fileName, + fl->currentFlags, + fl->docDirs, fl->docDirCount, fl->isDir, + fl->passedSpecialDoc, fl->isSpecialDoc, + pkg->header, pkg->specialDoc, + rpmGlobalMacroContext, internalState @*/ +{ + char *s, *t; + int specialDoc = 0; + char specialDocBuf[BUFSIZ]; + rpmRC res = RPMRC_OK; /* assume success */ + + specialDocBuf[0] = '\0'; + *fileName = NULL; + + t = buf; + while ((s = strtokWithQuotes(t, " \t\n")) != NULL) { + t = NULL; + if (!strcmp(s, "%docdir")) { + s = strtokWithQuotes(NULL, " \t\n"); + if (fl->docDirCount == MAXDOCDIR) { + rpmlog(RPMLOG_CRIT, _("Hit limit for %%docdir\n")); + fl->processingFailed = 1; + res = RPMRC_FAIL; + } + + if (s != NULL) + fl->docDirs[fl->docDirCount++] = xstrdup(s); + if (s == NULL || strtokWithQuotes(NULL, " \t\n")) { + rpmlog(RPMLOG_CRIT, _("Only one arg for %%docdir\n")); + fl->processingFailed = 1; + res = RPMRC_FAIL; + } + break; + } +#if defined(__LCLINT__) + assert(s != NULL); +#endif + + /* Set flags for virtual file attributes */ + { VFA_t *vfa; + for (vfa = virtualFileAttributes; vfa->attribute != NULL; vfa++) { + if (strcmp(s, vfa->attribute)) + /*@innercontinue@*/ continue; + if (!vfa->flag) { + if (!strcmp(s, "%dir")) + fl->isDir = 1; /* XXX why not RPMFILE_DIR? */ + } else { + if (vfa->not) + fl->currentFlags &= ~vfa->flag; + else + fl->currentFlags |= vfa->flag; + } + + /*@innerbreak@*/ break; + } + /* if we got an attribute, continue with next token */ + if (vfa->attribute != NULL) + continue; + } + + if (*fileName) { + /* We already got a file -- error */ + rpmlog(RPMLOG_ERR, _("Two files on one line: %s\n"), + *fileName); + fl->processingFailed = 1; + res = RPMRC_FAIL; + } + + if (*s != '/') { + if (fl->currentFlags & RPMFILE_DOC) { + specialDoc = 1; + strcat(specialDocBuf, " "); + strcat(specialDocBuf, s); + } else + if (fl->currentFlags & (RPMFILE_POLICY|RPMFILE_PUBKEY|RPMFILE_ICON)) + { + *fileName = s; + } else { + const char * sfn = NULL; + int urltype = urlPath(s, &sfn); + switch (urltype) { + default: /* relative path, not in %doc and not a URL */ + rpmlog(RPMLOG_ERR, + _("File must begin with \"/\": %s\n"), s); + fl->processingFailed = 1; + res = RPMRC_FAIL; + /*@switchbreak@*/ break; + case URL_IS_PATH: + *fileName = s; + /*@switchbreak@*/ break; + } + } + } else { + *fileName = s; + } + } + + if (specialDoc) { + if (*fileName || (fl->currentFlags & ~(RPMFILE_DOC))) { + rpmlog(RPMLOG_ERR, + _("Can't mix special %%doc with other forms: %s\n"), + (*fileName ? *fileName : "")); + fl->processingFailed = 1; + res = RPMRC_FAIL; + } else { + /* XXX WATCHOUT: buf is an arg */ + { + /*@only@*/ + static char *_docdir_fmt = NULL; /* XXX memleak */ + static int oneshot = 0; + const char *ddir, *fmt, *errstr; + if (!oneshot) { + _docdir_fmt = rpmExpand("%{?_docdir_fmt}", NULL); + if (!(_docdir_fmt && *_docdir_fmt)) + _docdir_fmt = _free(_docdir_fmt); + oneshot = 1; + } + if (_docdir_fmt == NULL) + _docdir_fmt = xstrdup("%{NAME}-%{VERSION}"); + fmt = headerSprintf(pkg->header, _docdir_fmt, NULL, rpmHeaderFormats, &errstr); + if (fmt == NULL) { + rpmlog(RPMLOG_ERR, _("illegal _docdir_fmt: %s\n"), errstr); + fl->processingFailed = 1; + res = RPMRC_FAIL; + } else { + ddir = rpmGetPath("%{_docdir}/", fmt, NULL); + strcpy(buf, ddir); + ddir = _free(ddir); + fmt = _free(fmt); + } + } + + /* XXX FIXME: this is easy to do as macro expansion */ + + if (! fl->passedSpecialDoc) { + char *compress_doc; + char *mkdir_p; + + pkg->specialDoc = rpmiobNew(0); + pkg->specialDoc = rpmiobAppend(pkg->specialDoc, "DOCDIR=\"$RPM_BUILD_ROOT\"", 0); + pkg->specialDoc = rpmiobAppend(pkg->specialDoc, buf, 1); + pkg->specialDoc = rpmiobAppend(pkg->specialDoc, "export DOCDIR", 1); + mkdir_p = rpmExpand("%{?__mkdir_p}%{!?__mkdir_p:mkdir -p}", NULL); + if (!mkdir_p) + mkdir_p = xstrdup("mkdir -p"); + pkg->specialDoc = rpmiobAppend(pkg->specialDoc, mkdir_p, 0); + mkdir_p = _free(mkdir_p); + pkg->specialDoc = rpmiobAppend(pkg->specialDoc, " \"$DOCDIR\"", 1); + + compress_doc = rpmExpand("%{__compress_doc}", NULL); + if (compress_doc && *compress_doc != '%') + pkg->specialDoc = rpmiobAppend(pkg->specialDoc, compress_doc, 1); + compress_doc = _free(compress_doc); + + /*@-temptrans@*/ + *fileName = buf; + /*@=temptrans@*/ + fl->passedSpecialDoc = 1; + fl->isSpecialDoc = 1; + } + + pkg->specialDoc = rpmiobAppend(pkg->specialDoc, "cp -pr ", 0); + pkg->specialDoc = rpmiobAppend(pkg->specialDoc, specialDocBuf, 0); + pkg->specialDoc = rpmiobAppend(pkg->specialDoc, " \"$DOCDIR\"", 1); + } + } + + return res; +} + +/** + */ +static int compareFileListRecs(const void * ap, const void * bp) /*@*/ +{ + const char *aurl = ((FileListRec)ap)->fileURL; + const char *a = NULL; + const char *burl = ((FileListRec)bp)->fileURL; + const char *b = NULL; + (void) urlPath(aurl, &a); + (void) urlPath(burl, &b); + return strcmp(a, b); +} + +/** + * Test if file is located in a %docdir. + * @param fl package file tree walk data + * @param fileName file path + * @return 1 if doc file, 0 if not + */ +static int isDoc(FileList fl, const char * fileName) /*@*/ +{ + int x = fl->docDirCount; + size_t k, l; + + k = strlen(fileName); + while (x--) { + l = strlen(fl->docDirs[x]); + if (l < k && strncmp(fileName, fl->docDirs[x], l) == 0 && fileName[l] == '/') + return 1; + } + return 0; +} + +/** + * Verify that file attributes scope over hardlinks correctly. + * If partial hardlink sets are possible, then add tracking dependency. + * @param fl package file tree walk data + * @return 1 if partial hardlink sets can exist, 0 otherwise. + */ +static int checkHardLinks(FileList fl) + /*@*/ +{ + FileListRec ilp, jlp; + int i, j; + + for (i = 0; i < fl->fileListRecsUsed; i++) { + ilp = fl->fileList + i; + if (!(S_ISREG(ilp->fl_mode) && ilp->fl_nlink > 1)) + continue; + if (ilp->flags & (RPMFILE_EXCLUDE | RPMFILE_GHOST)) + continue; + + for (j = i + 1; j < fl->fileListRecsUsed; j++) { + jlp = fl->fileList + j; + if (!S_ISREG(jlp->fl_mode)) + /*@innercontinue@*/ continue; + if (ilp->fl_nlink != jlp->fl_nlink) + /*@innercontinue@*/ continue; + if (ilp->fl_ino != jlp->fl_ino) + /*@innercontinue@*/ continue; + if (ilp->fl_dev != jlp->fl_dev) + /*@innercontinue@*/ continue; + if (jlp->flags & (RPMFILE_EXCLUDE | RPMFILE_GHOST)) + /*@innercontinue@*/ continue; + return 1; + } + } + return 0; +} + +static int dncmp(const void * a, const void * b) + /*@*/ +{ + const char ** aurlp = (const char **)a; + const char ** burlp = (const char **)b; + const char * adn; + const char * bdn; + (void) urlPath(*aurlp, &adn); + (void) urlPath(*burlp, &bdn); + return strcmp(adn, bdn); +} + +/** + * Convert absolute path tag to (dirname,basename,dirindex) tags. + * @param h header + */ +static void compressFilelist(Header h) + /*@globals internalState @*/ + /*@modifies h, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + const char ** fileNames; + const char * fn; + const char ** dirNames; + const char ** baseNames; + rpmuint32_t * dirIndexes; + int count; + int dirIndex = -1; + int xx; + int i; + + /* + * This assumes the file list is already sorted, and begins with a + * single '/'. That assumption isn't critical, but it makes things go + * a bit faster. + */ + + if (headerIsEntry(h, RPMTAG_DIRNAMES)) { + he->tag = RPMTAG_OLDFILENAMES; + xx = headerDel(h, he, 0); + return; /* Already converted. */ + } + + he->tag = RPMTAG_OLDFILENAMES; + xx = headerGet(h, he, 0); + fileNames = he->p.argv; + count = he->c; + if (!xx || fileNames == NULL || count <= 0) + return; /* no file list */ + + dirNames = alloca(sizeof(*dirNames) * count); /* worst case */ + baseNames = alloca(sizeof(*dirNames) * count); + dirIndexes = alloca(sizeof(*dirIndexes) * count); + + (void) urlPath(fileNames[0], &fn); + if (fn[0] != '/') { + /* HACK. Source RPM, so just do things differently */ + dirIndex = 0; + dirNames[dirIndex] = ""; + for (i = 0; i < count; i++) { + dirIndexes[i] = dirIndex; + baseNames[i] = fileNames[i]; + } + goto exit; + } + + for (i = 0; i < count; i++) { + const char ** needle; + char savechar; + char * baseName; + size_t len; + + if (fileNames[i] == NULL) /* XXX can't happen */ + continue; + baseName = strrchr(fileNames[i], '/') + 1; + len = baseName - fileNames[i]; + needle = dirNames; + savechar = *baseName; + *baseName = '\0'; +/*@-compdef@*/ + if (dirIndex < 0 || + (needle = bsearch(&fileNames[i], dirNames, dirIndex + 1, sizeof(dirNames[0]), dncmp)) == NULL) { + char *s = alloca(len + 1); + memcpy(s, fileNames[i], len + 1); + s[len] = '\0'; + dirIndexes[i] = ++dirIndex; + dirNames[dirIndex] = s; + } else + dirIndexes[i] = needle - dirNames; +/*@=compdef@*/ + + *baseName = savechar; + baseNames[i] = baseName; + } + +exit: + if (count > 0) { + he->tag = RPMTAG_DIRINDEXES; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = dirIndexes; + he->c = count; + xx = headerPut(h, he, 0); + + he->tag = RPMTAG_BASENAMES; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = baseNames; + he->c = count; + xx = headerPut(h, he, 0); + + he->tag = RPMTAG_DIRNAMES; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = dirNames; + he->c = dirIndex + 1; + xx = headerPut(h, he, 0); + } + + fileNames = _free(fileNames); + + he->tag = RPMTAG_OLDFILENAMES; + xx = headerDel(h, he, 0); +} + +static rpmuint32_t getDigestAlgo(Header h, int isSrc) + /*@modifies h @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + static rpmuint32_t source_file_dalgo = 0; + static rpmuint32_t binary_file_dalgo = 0; + static int oneshot = 0; + rpmuint32_t dalgo = 0; + int xx; + + if (!oneshot) { + source_file_dalgo = + rpmExpandNumeric("%{?_build_source_file_digest_algo}"); + binary_file_dalgo = + rpmExpandNumeric("%{?_build_binary_file_digest_algo}"); + oneshot++; + } + + dalgo = (isSrc ? source_file_dalgo : binary_file_dalgo); + switch (dalgo) { + case PGPHASHALGO_SHA1: + case PGPHASHALGO_MD2: + case PGPHASHALGO_SHA256: + case PGPHASHALGO_SHA384: + case PGPHASHALGO_SHA512: + (void) rpmlibNeedsFeature(h, "FileDigests", "4.6.0-1"); + he->tag = RPMTAG_FILEDIGESTALGO; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &dalgo; + he->c = 1; + xx = headerPut(h, he, 0); + /*@fallthgrough@*/ + case PGPHASHALGO_RIPEMD160: + case PGPHASHALGO_TIGER192: + case PGPHASHALGO_MD4: + case PGPHASHALGO_RIPEMD128: + case PGPHASHALGO_CRC32: + case PGPHASHALGO_ADLER32: + case PGPHASHALGO_CRC64: + (void) rpmlibNeedsFeature(h, "FileDigestParameterized", "4.4.6-1"); + /*@switchbreak@*/ break; + case PGPHASHALGO_MD5: + case PGPHASHALGO_HAVAL_5_160: /* XXX unimplemented */ + default: + dalgo = PGPHASHALGO_MD5; + /*@switchbreak@*/ break; + } + + return dalgo; +} + +/** + * Add file entries to header. + * @todo Should directories have %doc/%config attributes? (#14531) + * @todo Remove RPMTAG_OLDFILENAMES, add dirname/basename instead. + * @param fl package file tree walk data + * @retval *fip file info for package + * @param h + * @param isSrc + */ +static void genCpioListAndHeader(/*@partial@*/ FileList fl, + rpmfi * fip, Header h, int isSrc) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies h, *fip, fl->processingFailed, fl->fileList, + fl->totalFileSize, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + const char * apath; + rpmuint16_t ui16; + rpmuint32_t ui32; + int _addDotSlash = !isSrc; + int apathlen = 0; + int dpathlen = 0; + int skipLen = 0; + rpmsx sx = rpmsxNew("%{?_build_file_context_path}", 0); + FileListRec flp; + rpmuint32_t dalgo = getDigestAlgo(h, isSrc); + char buf[BUFSIZ]; + int i, xx; + +memset(buf, 0, sizeof(buf)); /* XXX valgrind on rhel6 beta pickier */ + + /* Sort the big list */ + if (fl->fileListRecsUsed > 1) + qsort(fl->fileList, fl->fileListRecsUsed, + sizeof(*(fl->fileList)), compareFileListRecs); + + /* Generate the header. */ + if (! isSrc) { + skipLen = 1; + if (fl->prefix) + skipLen += strlen(fl->prefix); + } + + for (i = 0, flp = fl->fileList; i < fl->fileListRecsUsed; i++, flp++) { + const char *s; + + /* Merge duplicate entries. */ + while (i < (fl->fileListRecsUsed - 1) && + !strcmp(flp->fileURL, flp[1].fileURL)) { + + /* Two entries for the same file found, merge the entries. */ + /* Note that an %exclude is a duplication of a file reference */ + + /* file flags */ + flp[1].flags |= flp->flags; + + if (!(flp[1].flags & RPMFILE_EXCLUDE)) + rpmlog(RPMLOG_WARNING, _("File listed twice: %s\n"), + flp->fileURL); + + /* file mode */ + if (S_ISDIR(flp->fl_mode)) { + if ((flp[1].specdFlags & (SPECD_DIRMODE | SPECD_DEFDIRMODE)) < + (flp->specdFlags & (SPECD_DIRMODE | SPECD_DEFDIRMODE))) + flp[1].fl_mode = flp->fl_mode; + } else { + if ((flp[1].specdFlags & (SPECD_FILEMODE | SPECD_DEFFILEMODE)) < + (flp->specdFlags & (SPECD_FILEMODE | SPECD_DEFFILEMODE))) + flp[1].fl_mode = flp->fl_mode; + } + + /* uid */ + if ((flp[1].specdFlags & (SPECD_UID | SPECD_DEFUID)) < + (flp->specdFlags & (SPECD_UID | SPECD_DEFUID))) + { + flp[1].fl_uid = flp->fl_uid; + flp[1].uname = flp->uname; + } + + /* gid */ + if ((flp[1].specdFlags & (SPECD_GID | SPECD_DEFGID)) < + (flp->specdFlags & (SPECD_GID | SPECD_DEFGID))) + { + flp[1].fl_gid = flp->fl_gid; + flp[1].gname = flp->gname; + } + + /* verify flags */ + if ((flp[1].specdFlags & (SPECD_VERIFY | SPECD_DEFVERIFY)) < + (flp->specdFlags & (SPECD_VERIFY | SPECD_DEFVERIFY))) + flp[1].verifyFlags = flp->verifyFlags; + + /* XXX to-do: language */ + + flp++; i++; + } + + /* Skip files that were marked with %exclude. */ + if (flp->flags & RPMFILE_EXCLUDE) continue; + + /* Omit '/' and/or URL prefix, leave room for "./" prefix */ + (void) urlPath(flp->fileURL, &apath); + apathlen += (strlen(apath) - skipLen + (_addDotSlash ? 3 : 1)); + + /* Leave room for both dirname and basename NUL's */ + dpathlen += (strlen(flp->diskURL) + 2); + + /* + * Make the header, the OLDFILENAMES will get converted to a + * compressed file list write before we write the actual package to + * disk. + */ + he->tag = RPMTAG_OLDFILENAMES; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &flp->fileURL; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + +/*@-sizeoftype@*/ + ui32 = (rpmuint32_t) flp->fl_size; + he->tag = RPMTAG_FILESIZES; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &ui32; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + + he->tag = RPMTAG_FILEUSERNAME; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &flp->uname; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + + he->tag = RPMTAG_FILEGROUPNAME; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &flp->gname; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + + ui32 = (rpmuint32_t) flp->fl_mtime; + he->tag = RPMTAG_FILEMTIMES; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &ui32; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + + ui16 = (rpmuint16_t)flp->fl_mode; + he->tag = RPMTAG_FILEMODES; + he->t = RPM_UINT16_TYPE; + he->p.ui16p = &ui16; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + + { dev_t _dev = flp->fl_rdev; + ui16 = _dev; + } + he->tag = RPMTAG_FILERDEVS; + he->t = RPM_UINT16_TYPE; + he->p.ui16p = &ui16; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + + /* XXX Hash instead of 64b->32b truncate to prevent aliasing. */ + { dev_t _dev = flp->fl_dev; + ui32 = hashFunctionString(0, &_dev, sizeof(_dev)); + } + he->tag = RPMTAG_FILEDEVICES; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &ui32; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + + /* XXX Hash instead of 64b->32b truncate to prevent aliasing. */ + { ino_t _ino = flp->fl_ino; + ui32 = hashFunctionString(0, &_ino, sizeof(_ino)); + } + he->tag = RPMTAG_FILEINODES; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &ui32; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + +/*@=sizeoftype@*/ + + he->tag = RPMTAG_FILELANGS; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &flp->langs; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + + buf[0] = '\0'; + if (S_ISREG(flp->fl_mode)) { + unsigned dflags = 0x01; /* asAscii */ +#define _mask (RPMVERIFY_FDIGEST|RPMVERIFY_HMAC) + if ((flp->verifyFlags & _mask) == RPMVERIFY_HMAC) + dflags |= 0x02; /* doHmac */ +#undef _mask + (void) dodigest(dalgo, flp->diskURL, (unsigned char *)buf, + dflags, NULL); + } + s = buf; + + he->tag = RPMTAG_FILEDIGESTS; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &s; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + +if (!(_rpmbuildFlags & 4)) { + ui32 = dalgo; + he->tag = RPMTAG_FILEDIGESTALGOS; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &ui32; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; +} + + buf[0] = '\0'; + if (S_ISLNK(flp->fl_mode)) { + xx = Readlink(flp->diskURL, buf, BUFSIZ); + if (xx >= 0) + buf[xx] = '\0'; + if (fl->buildRootURL) { + const char * buildRoot; + (void) urlPath(fl->buildRootURL, &buildRoot); + + if (buf[0] == '/' && strcmp(buildRoot, "/") && + !strncmp(buf, buildRoot, strlen(buildRoot))) { + rpmlog(RPMLOG_ERR, + _("Symlink points to BuildRoot: %s -> %s\n"), + flp->fileURL, buf); + fl->processingFailed = 1; + } + } + } + s = buf; + he->tag = RPMTAG_FILELINKTOS; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &s; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + + if (flp->flags & RPMFILE_GHOST) { + flp->verifyFlags &= ~(RPMVERIFY_FDIGEST | RPMVERIFY_FILESIZE | + RPMVERIFY_LINKTO | RPMVERIFY_MTIME); + } + ui32 = flp->verifyFlags; + he->tag = RPMTAG_FILEVERIFYFLAGS; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &ui32; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + + if (!isSrc && isDoc(fl, flp->fileURL)) + flp->flags |= RPMFILE_DOC; + /* XXX Should directories have %doc/%config attributes? (#14531) */ + if (S_ISDIR(flp->fl_mode)) + flp->flags &= ~(RPMFILE_CONFIG|RPMFILE_DOC); + + ui32 = flp->flags; + he->tag = RPMTAG_FILEFLAGS; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &ui32; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + + /* Add file security context to package. */ + if (sx && sx->fn && *sx->fn && !(_rpmbuildFlags & 4)) { + const char * scon = rpmsxMatch(sx, flp->fileURL, flp->fl_mode); + if (scon) { + he->tag = RPMTAG_FILECONTEXTS; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &scon; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + } + scon = _free(scon); /* XXX freecon(scon) instead()? */ + } + } + + sx = rpmsxFree(sx); + +if (_rpmbuildFlags & 4) { +(void) rpmlibNeedsFeature(h, "PayloadFilesHavePrefix", "4.0-1"); +(void) rpmlibNeedsFeature(h, "CompressedFileNames", "3.0.4-1"); +} + + compressFilelist(h); + + { static int scareMem = 0; + void * ts = NULL; /* XXX FIXME drill rpmts ts all the way down here */ + rpmfi fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, scareMem); + char * a, * d; + + if (fi == NULL) return; /* XXX can't happen */ + +/*@-onlytrans@*/ + fi->te = xcalloc(1, sizeof(*((rpmte)fi->te))); +/*@=onlytrans@*/ + ((rpmte)fi->te)->type = TR_ADDED; + + fi->dnl = _free(fi->dnl); + fi->bnl = _free(fi->bnl); + if (!scareMem) fi->dil = _free(fi->dil); + + /* XXX Insure at least 1 byte is always allocated. */ + fi->dnl = xmalloc(fi->fc * sizeof(*fi->dnl) + dpathlen + 1); + d = (char *)(fi->dnl + fi->fc); + *d = '\0'; + + fi->bnl = xmalloc(fi->fc * (sizeof(*fi->bnl) + sizeof(*fi->dil))); +/*@-dependenttrans@*/ /* FIX: artifact of spoofing header tag store */ + fi->dil = (!scareMem) + ? xcalloc(sizeof(*fi->dil), fi->fc) + : (rpmuint32_t *)(fi->bnl + fi->fc); +/*@=dependenttrans@*/ + + /* XXX Insure at least 1 byte is always allocated. */ + fi->apath = xmalloc(fi->fc * sizeof(*fi->apath) + apathlen + 1); + a = (char *)(fi->apath + fi->fc); + *a = '\0'; + + fi->actions = _free(fi->actions); /* XXX memory leak */ + fi->actions = xcalloc(sizeof(*fi->actions), fi->fc); + fi->fmapflags = xcalloc(sizeof(*fi->fmapflags), fi->fc); + fi->astriplen = 0; + if (fl->buildRootURL) + fi->astriplen = strlen(fl->buildRootURL); + fi->striplen = 0; + fi->fuser = _free(fi->fuser); + fi->fgroup = _free(fi->fgroup); + + /* Make the cpio list */ + if (fi->dil != NULL) /* XXX can't happen */ + for (i = 0, flp = fl->fileList; (unsigned)i < fi->fc; i++, flp++) { + char * b; + + /* Skip (possible) duplicate file entries, use last entry info. */ + while (((flp - fl->fileList) < (fl->fileListRecsUsed - 1)) && + !strcmp(flp->fileURL, flp[1].fileURL)) + flp++; + + if (flp->flags & RPMFILE_EXCLUDE) { + i--; + continue; + } + + { + /* this fi uses diskURL (with buildroot), not fileURL */ + size_t fnlen = strlen(flp->diskURL); + if (fnlen > fi->fnlen) { + /* fnlen-sized buffer must not be allocated yet */ + assert(fi->fn == NULL); + fi->fnlen = fnlen; + } + } + + /* Create disk directory and base name. */ + fi->dil[i] = i; +/*@-dependenttrans@*/ /* FIX: artifact of spoofing header tag store */ + fi->dnl[fi->dil[i]] = d; +/*@=dependenttrans@*/ + d = stpcpy(d, flp->diskURL); + + /* Make room for the dirName NUL, find start of baseName. */ + for (b = d; b > fi->dnl[fi->dil[i]] && *b != '/'; b--) + b[1] = b[0]; + b++; /* dirname's end in '/' */ + *b++ = '\0'; /* terminate dirname, b points to basename */ + fi->bnl[i] = b; + d += 2; /* skip both dirname and basename NUL's */ + + /* Create archive path, normally adding "./" */ + /*@-dependenttrans@*/ /* FIX: xstrdup? nah ... */ + fi->apath[i] = a; + /*@=dependenttrans@*/ + if (_addDotSlash) + a = stpcpy(a, "./"); + (void) urlPath(flp->fileURL, &apath); + a = stpcpy(a, (apath + skipLen)); + a++; /* skip apath NUL */ + + if (flp->flags & RPMFILE_GHOST) { + fi->actions[i] = FA_SKIP; + continue; + } + fi->actions[i] = FA_COPYOUT; + fi->fmapflags[i] = IOSM_MAP_PATH | + IOSM_MAP_TYPE | IOSM_MAP_MODE | IOSM_MAP_UID | IOSM_MAP_GID; + if (isSrc) + fi->fmapflags[i] |= IOSM_FOLLOW_SYMLINKS; + + if (S_ISREG(flp->fl_mode)) { + int bingo = 1; + /* Hard links need be tallied only once. */ + if (flp->fl_nlink > 1) { + FileListRec jlp = flp + 1; + int j = i + 1; + for (; (unsigned)j < fi->fc; j++, jlp++) { + /* follow outer loop logic */ + while (((jlp - fl->fileList) < (fl->fileListRecsUsed - 1)) && + !strcmp(jlp->fileURL, jlp[1].fileURL)) + jlp++; + if (jlp->flags & RPMFILE_EXCLUDE) { + j--; + /*@innercontinue@*/ continue; + } + if (jlp->flags & RPMFILE_GHOST) + /*@innercontinue@*/ continue; + if (!S_ISREG(jlp->fl_mode)) + /*@innercontinue@*/ continue; + if (flp->fl_nlink != jlp->fl_nlink) + /*@innercontinue@*/ continue; + if (flp->fl_ino != jlp->fl_ino) + /*@innercontinue@*/ continue; + if (flp->fl_dev != jlp->fl_dev) + /*@innercontinue@*/ continue; + bingo = 0; /* don't tally hardlink yet. */ + /*@innerbreak@*/ break; + } + } + if (bingo) + fl->totalFileSize += flp->fl_size; + } + } + + ui32 = fl->totalFileSize; + he->tag = RPMTAG_SIZE; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &ui32; + he->c = 1; + xx = headerPut(h, he, 0); + + /*@-compdef@*/ + if (fip) + *fip = fi; + else + fi = rpmfiFree(fi); + /*@=compdef@*/ + } +} + +/** + */ +static /*@null@*/ FileListRec freeFileList(/*@only@*/ FileListRec fileList, + int count) + /*@*/ +{ + while (count--) { + fileList[count].diskURL = _free(fileList[count].diskURL); + fileList[count].fileURL = _free(fileList[count].fileURL); + fileList[count].langs = _free(fileList[count].langs); + } + fileList = _free(fileList); + return NULL; +} + +/* forward ref */ +static rpmRC recurseDir(FileList fl, const char * diskURL) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies *fl, fl->processingFailed, + fl->fileList, fl->fileListRecsAlloced, fl->fileListRecsUsed, + fl->totalFileSize, fl->fileCount, fl->inFtw, fl->isDir, + rpmGlobalMacroContext, + fileSystem, internalState @*/; + +/** + * Add a file to the package manifest. + * @param fl package file tree walk data + * @param diskURL path to file + * @param statp file stat (possibly NULL) + * @return RPMRC_OK on success + */ +static int addFile(FileList fl, const char * diskURL, + /*@null@*/ struct stat * statp) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies *statp, *fl, fl->processingFailed, + fl->fileList, fl->fileListRecsAlloced, fl->fileListRecsUsed, + fl->totalFileSize, fl->fileCount, + rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + const char *fn = xstrdup(diskURL); + const char *fileURL = fn; + struct stat statbuf; + mode_t fileMode; + uid_t fileUid; + gid_t fileGid; + const char *fileUname; + const char *fileGname; + char *lang; + rpmRC rc = RPMRC_OK; + + /* Path may have prepended buildRootURL, so locate the original filename. */ + /* + * XXX There are 3 types of entry into addFile: + * + * From diskUrl statp + * ===================================================== + * processBinaryFile path NULL + * processBinaryFile glob result path NULL + * recurseDir path stat + * + */ + { const char *fileName; + int urltype = urlPath(fileURL, &fileName); + switch (urltype) { + case URL_IS_PATH: + fileURL += (fileName - fileURL); + if (fl->buildRootURL && strcmp(fl->buildRootURL, "/")) { + size_t nb = strlen(fl->buildRootURL); + const char * s = fileURL + nb; + char * t = (char *) fileURL; + (void) memmove(t, s, nb); + } + fileURL = fn; + break; + default: + if (fl->buildRootURL && strcmp(fl->buildRootURL, "/")) + fileURL += strlen(fl->buildRootURL); + break; + } + } + + /* XXX make sure '/' can be packaged also */ + if (*fileURL == '\0') + fileURL = "/"; + + /* If we are using a prefix, validate the file */ + if (!fl->inFtw && fl->prefix) { + const char *prefixTest; + const char *prefixPtr = fl->prefix; + + (void) urlPath(fileURL, &prefixTest); + while (*prefixPtr && *prefixTest && (*prefixTest == *prefixPtr)) { + prefixPtr++; + prefixTest++; + } + if (*prefixPtr || (*prefixTest && *prefixTest != '/')) { + rpmlog(RPMLOG_ERR, _("File doesn't match prefix (%s): %s\n"), + fl->prefix, fileURL); + fl->processingFailed = 1; + rc = RPMRC_FAIL; + goto exit; + } + } + + if (statp == NULL) { + statp = &statbuf; + memset(statp, 0, sizeof(*statp)); + if (fl->devtype) { + time_t now = time(NULL); + + /* XXX hack up a stat structure for a %dev(...) directive. */ + statp->st_nlink = 1; + statp->st_rdev = + ((fl->devmajor & 0xff) << 8) | (fl->devminor & 0xff); + statp->st_dev = statp->st_rdev; + statp->st_mode = (fl->devtype == 'b' ? S_IFBLK : S_IFCHR); + statp->st_mode |= (fl->cur_ar.ar_fmode & 0777); + statp->st_atime = now; + statp->st_mtime = now; + statp->st_ctime = now; + } else if (Lstat(diskURL, statp)) { + if (fl->currentFlags & RPMFILE_OPTIONAL) { + rpmlog(RPMLOG_WARNING, _("Optional file not found: %s\n"), diskURL); + rc = RPMRC_OK; + } else { + rpmlog(RPMLOG_ERR, _("File not found: %s\n"), diskURL); + fl->processingFailed = 1; + rc = RPMRC_FAIL; + } + goto exit; + } + } + + if ((! fl->isDir) && S_ISDIR(statp->st_mode)) { +/*@-nullstate@*/ /* FIX: fl->buildRootURL may be NULL */ + rc = recurseDir(fl, diskURL); + goto exit; +/*@=nullstate@*/ + } + + fileMode = statp->st_mode; + fileUid = statp->st_uid; + fileGid = statp->st_gid; + + if (S_ISDIR(fileMode) && fl->cur_ar.ar_dmodestr) { + fileMode &= S_IFMT; + fileMode |= fl->cur_ar.ar_dmode; + } else if (fl->cur_ar.ar_fmodestr != NULL) { + fileMode &= S_IFMT; + fileMode |= fl->cur_ar.ar_fmode; + } + if (fl->cur_ar.ar_user) { + fileUname = getUnameS(fl->cur_ar.ar_user); + } else { + fileUname = getUname(fileUid); + } + if (fl->cur_ar.ar_group) { + fileGname = getGnameS(fl->cur_ar.ar_group); + } else { + fileGname = getGname(fileGid); + } + + /* Default user/group to builder's user/group */ + if (fileUname == NULL) + fileUname = getUname(getuid()); + if (fileGname == NULL) + fileGname = getGname(getgid()); + + /* Add to the file list */ + if (fl->fileListRecsUsed == fl->fileListRecsAlloced) { + fl->fileListRecsAlloced += 128; + fl->fileList = xrealloc(fl->fileList, + fl->fileListRecsAlloced * sizeof(*(fl->fileList))); + } + + { FileListRec flp = &fl->fileList[fl->fileListRecsUsed]; + int i; + + flp->fl_st = *statp; /* structure assignment */ + flp->fl_mode = fileMode; + flp->fl_uid = fileUid; + flp->fl_gid = fileGid; + + flp->fileURL = xstrdup(fileURL); + flp->diskURL = xstrdup(diskURL); + flp->uname = fileUname; + flp->gname = fileGname; + + if (fl->currentLangs && fl->nLangs > 0) { + char * ncl; + size_t nl = 0; + + for (i = 0; i < fl->nLangs; i++) + nl += strlen(fl->currentLangs[i]) + 1; + + flp->langs = ncl = xmalloc(nl); + for (i = 0; i < fl->nLangs; i++) { + const char *ocl; + if (i) *ncl++ = '|'; + for (ocl = fl->currentLangs[i]; *ocl != '\0'; ocl++) + *ncl++ = *ocl; + *ncl = '\0'; + } + } else if (! parseForRegexLang(fileURL, &lang)) { + flp->langs = xstrdup(lang); + } else { + flp->langs = xstrdup(""); + } + + flp->flags = fl->currentFlags; + flp->specdFlags = fl->currentSpecdFlags; + flp->verifyFlags = fl->currentVerifyFlags; + } + + fl->fileListRecsUsed++; + fl->fileCount++; + +exit: +/*@i@*/ fn = _free(fn); + return rc; +} + +/** + * Add directory (and all of its files) to the package manifest. + * @param fl package file tree walk data + * @param diskURL path to file + * @return RPMRC_OK on success + */ +static rpmRC recurseDir(FileList fl, const char * diskURL) +{ + char * ftsSet[2]; + FTS * ftsp; + FTSENT * fts; + int myFtsOpts = (FTS_COMFOLLOW | FTS_NOCHDIR | FTS_PHYSICAL); + rpmRC rc = RPMRC_FAIL; + + fl->inFtw = 1; /* Flag to indicate file has buildRootURL prefixed */ + fl->isDir = 1; /* Keep it from following myftw() again */ + + ftsSet[0] = (char *) diskURL; + ftsSet[1] = NULL; + ftsp = Fts_open(ftsSet, myFtsOpts, NULL); + while ((fts = Fts_read(ftsp)) != NULL) { + switch (fts->fts_info) { + case FTS_D: /* preorder directory */ + case FTS_F: /* regular file */ + case FTS_SL: /* symbolic link */ + case FTS_SLNONE: /* symbolic link without target */ + case FTS_DEFAULT: /* none of the above */ + rc = addFile(fl, fts->fts_accpath, fts->fts_statp); + /*@switchbreak@*/ break; + case FTS_DOT: /* dot or dot-dot */ + case FTS_DP: /* postorder directory */ + rc = RPMRC_OK; + /*@switchbreak@*/ break; + case FTS_NS: /* stat(2) failed */ + case FTS_DNR: /* unreadable directory */ + case FTS_ERR: /* error; errno is set */ + case FTS_DC: /* directory that causes cycles */ + case FTS_NSOK: /* no stat(2) requested */ + case FTS_INIT: /* initialized only */ + case FTS_W: /* whiteout object */ + default: + rc = RPMRC_FAIL; + /*@switchbreak@*/ break; + } + if (rc != RPMRC_OK) + break; + } + (void) Fts_close(ftsp); + + fl->isDir = 0; + fl->inFtw = 0; + + return rc; +} + +/** + * Add a pubkey/policy/icon to a binary package. + * @param pkg package control structure + * @param fl package file tree walk data + * @param fileURL path to file, relative is builddir, absolute buildroot. + * @param tag tag to add + * @return RPMRC_OK on success + */ +static rpmRC processMetadataFile(Package pkg, FileList fl, const char * fileURL, + rpmTag tag) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies pkg->header, *fl, fl->processingFailed, + fl->fileList, fl->fileListRecsAlloced, fl->fileListRecsUsed, + fl->totalFileSize, fl->fileCount, + rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + const char * buildURL = "%{_builddir}/%{?buildsubdir}/"; + const char * fn = NULL; + const char * apkt = NULL; + rpmiob iob = NULL; + rpmuint8_t * pkt = NULL; + ssize_t pktlen = 0; + int absolute = 0; + rpmRC rc = RPMRC_FAIL; + int xx; + + (void) urlPath(fileURL, &fn); + if (*fn == '/') { + fn = rpmGenPath(fl->buildRootURL, NULL, fn); + absolute = 1; + } else + fn = rpmGenPath(buildURL, NULL, fn); + + switch (tag) { + default: + rpmlog(RPMLOG_ERR, _("%s: can't load unknown tag (%d).\n"), + fn, tag); + goto exit; + /*@notreached@*/ break; + case RPMTAG_PUBKEYS: + if ((xx = pgpReadPkts(fn, &pkt, (size_t *)&pktlen)) <= 0) { + rpmlog(RPMLOG_ERR, _("%s: public key read failed.\n"), fn); + goto exit; + } + if (xx != PGPARMOR_PUBKEY) { + rpmlog(RPMLOG_ERR, _("%s: not an armored public key.\n"), fn); + goto exit; + } + apkt = pgpArmorWrap(PGPARMOR_PUBKEY, pkt, pktlen); + break; + case RPMTAG_POLICIES: + xx = rpmiobSlurp(fn, &iob); + if (!(xx == 0 && iob != NULL)) { + rpmlog(RPMLOG_ERR, _("%s: *.te policy read failed.\n"), fn); + goto exit; + } + apkt = (const char *) iob->b; /* XXX unsigned char */ + /* XXX steal the I/O buffer */ + iob->b = (rpmuint8_t *)xcalloc(1, sizeof(*iob->b)); + iob->blen = 0; + break; + } + + he->tag = tag; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &apkt; + he->c = 1; + he->append = 1; + xx = headerPut(pkg->header, he, 0); + he->append = 0; + + rc = RPMRC_OK; + if (absolute) + rc = addFile(fl, fn, NULL); + +exit: + apkt = _free(apkt); + pkt = _free(pkt); + iob = rpmiobFree(iob); + fn = _free(fn); + if (rc != RPMRC_OK) + fl->processingFailed = 1; + return rc; +} + +/** + * Add a file to a binary package. + * @param pkg package control structure + * @param fl package file tree walk data + * @param fileURL + * @return RPMRC_OK on success + */ +static rpmRC processBinaryFile(/*@unused@*/ Package pkg, FileList fl, + const char * fileURL) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies *fl, fl->processingFailed, + fl->fileList, fl->fileListRecsAlloced, fl->fileListRecsUsed, + fl->totalFileSize, fl->fileCount, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + int quote = 1; /* XXX permit quoted glob characters. */ + int doGlob; + const char *diskURL = NULL; + rpmRC rc = RPMRC_OK; + int xx; + + doGlob = Glob_pattern_p(fileURL, quote); + + /* Check that file starts with leading "/" */ + { const char * fileName; + (void) urlPath(fileURL, &fileName); + if (*fileName != '/') { + rpmlog(RPMLOG_ERR, _("File needs leading \"/\": %s\n"), + fileName); + rc = RPMRC_FAIL; + goto exit; + } + } + + /* Copy file name or glob pattern removing multiple "/" chars. */ + /* + * Note: rpmGetPath should guarantee a "canonical" path. That means + * that the following pathologies should be weeded out: + * //bin//sh + * //usr//bin/ + * /.././../usr/../bin//./sh + */ + diskURL = rpmGenPath(fl->buildRootURL, NULL, fileURL); + + if (doGlob) { + const char ** argv = NULL; + int argc = 0; + int i; + + /* XXX for %dev marker in file manifest only */ + if (fl->noGlob) { + rpmlog(RPMLOG_ERR, _("Glob not permitted: %s\n"), + diskURL); + rc = RPMRC_FAIL; + goto exit; + } + + xx = rpmGlob(diskURL, &argc, &argv); + if (xx == 0 && argc >= 1) { + for (i = 0; i < argc; i++) { + rc = addFile(fl, argv[i], NULL); + argv[i] = _free(argv[i]); + } + argv = _free(argv); + } else { + if (fl->currentFlags & RPMFILE_OPTIONAL) { + rpmlog(RPMLOG_WARNING, _("Optional file not found by glob: %s\n"), + diskURL); + rc = RPMRC_OK; + } else { + rpmlog(RPMLOG_ERR, _("File not found by glob: %s\n"), + diskURL); + rc = RPMRC_FAIL; + } + goto exit; + } + } else + rc = addFile(fl, diskURL, NULL); + +exit: + diskURL = _free(diskURL); + if (rc != RPMRC_OK) + fl->processingFailed = 1; + return rc; +} + +/** + */ +static rpmRC processPackageFiles(Spec spec, Package pkg, + int installSpecialDoc, int test) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState@*/ + /*@modifies spec->macros, + pkg->fi, pkg->fileList, pkg->specialDoc, pkg->header, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + struct FileList_s fl; + ARGV_t files = NULL; + ARGV_t fp; + const char *fileName; + char buf[BUFSIZ]; + struct AttrRec_s arbuf; + AttrRec specialDocAttrRec = &arbuf; + char *specialDoc = NULL; + int xx; + + nullAttrRec(specialDocAttrRec); + pkg->fi = NULL; + + if (pkg->fileFile) { + char *saveptr = NULL; + char *filesFiles = xstrdup(pkg->fileFile); +/*@-unrecog@*/ + char *token = strtok_r(filesFiles, ",", &saveptr); +/*@=unrecog@*/ + do { + const char *ffn; + FILE * f; + FD_t fd; + + /* XXX W2DO? urlPath might be useful here. */ + if (*token == '/') { + ffn = rpmGetPath(token, NULL); + } else { + /* XXX FIXME: add %{buildsubdir} */ + ffn = rpmGetPath("%{_builddir}/", + (spec->buildSubdir ? spec->buildSubdir : "") , + "/", token, NULL); + } + + fd = Fopen(ffn, "r.fpio"); + + if (fd == NULL || Ferror(fd)) { + rpmlog(RPMLOG_ERR, + _("Could not open %%files file %s: %s\n"), + ffn, Fstrerror(fd)); + return RPMRC_FAIL; + } + ffn = _free(ffn); + + /*@+voidabstract@*/ f = fdGetFp(fd); /*@=voidabstract@*/ + if (f != NULL) { + while (fgets(buf, (int)sizeof(buf), f)) { + handleComments(buf); + if (expandMacros(spec, spec->macros, buf, sizeof(buf))) { + rpmlog(RPMLOG_ERR, _("line: %s\n"), buf); + return RPMRC_FAIL; + } + pkg->fileList = rpmiobAppend(pkg->fileList, buf, 0); + } + } + (void) Fclose(fd); + } while((token = strtok_r(NULL, ",", &saveptr)) != NULL); + filesFiles = _free(filesFiles); + } + + /* Init the file list structure */ + memset(&fl, 0, sizeof(fl)); + + fl.buildRootURL = rpmGenPath(spec->rootURL, "%{?buildroot}", NULL); + + he->tag = RPMTAG_DEFAULTPREFIX; + xx = headerGet(pkg->header, he, 0); + fl.prefix = he->p.str; + + fl.fileCount = 0; + fl.totalFileSize = 0; + fl.processingFailed = 0; + + fl.passedSpecialDoc = 0; + fl.isSpecialDoc = 0; + + fl.isDir = 0; + fl.inFtw = 0; + fl.currentFlags = 0; + fl.currentVerifyFlags = 0; + + fl.noGlob = 0; + fl.devtype = 0; + fl.devmajor = 0; + fl.devminor = 0; + + nullAttrRec(&fl.cur_ar); + nullAttrRec(&fl.def_ar); + dupAttrRec(&root_ar, &fl.def_ar); /* XXX assume %defattr(-,root,root) */ + + fl.defVerifyFlags = RPMVERIFY_ALL; + fl.nLangs = 0; + fl.currentLangs = NULL; + + fl.currentSpecdFlags = 0; + fl.defSpecdFlags = 0; + + fl.docDirCount = 0; +#if defined(RPM_VENDOR_OPENPKG) /* no-default-doc-files */ + /* do not declare any files as %doc files by default. */ +#else + fl.docDirs[fl.docDirCount++] = xstrdup("/usr/doc"); + fl.docDirs[fl.docDirCount++] = xstrdup("/usr/man"); + fl.docDirs[fl.docDirCount++] = xstrdup("/usr/info"); + fl.docDirs[fl.docDirCount++] = xstrdup("/usr/X11R6/man"); + fl.docDirs[fl.docDirCount++] = xstrdup("/usr/share/doc"); + fl.docDirs[fl.docDirCount++] = xstrdup("/usr/share/man"); + fl.docDirs[fl.docDirCount++] = xstrdup("/usr/share/info"); + fl.docDirs[fl.docDirCount++] = xstrdup("/usr/src/examples"); + fl.docDirs[fl.docDirCount++] = rpmGetPath("%{_docdir}", NULL); + fl.docDirs[fl.docDirCount++] = rpmGetPath("%{_mandir}", NULL); + fl.docDirs[fl.docDirCount++] = rpmGetPath("%{_infodir}", NULL); + fl.docDirs[fl.docDirCount++] = rpmGetPath("%{_javadocdir}", NULL); + fl.docDirs[fl.docDirCount++] = rpmGetPath("%{_examplesdir}", NULL); +#endif + + fl.fileList = NULL; + fl.fileListRecsAlloced = 0; + fl.fileListRecsUsed = 0; + + xx = argvSplit(&files, rpmiobStr(pkg->fileList), "\n"); + + for (fp = files; *fp != NULL; fp++) { + const char * s; + s = *fp; + SKIPSPACE(s); + if (*s == '\0') + continue; + fileName = NULL; + /*@-nullpass@*/ /* LCL: buf is NULL ?!? */ + strncpy(buf, s, sizeof(buf)-1); + buf[sizeof(buf)-1] = '\0'; + /*@=nullpass@*/ + + /* Reset for a new line in %files */ + fl.isDir = 0; + fl.inFtw = 0; + fl.currentFlags = 0; + /* turn explicit flags into %def'd ones (gosh this is hacky...) */ + fl.currentSpecdFlags = ((unsigned)fl.defSpecdFlags) >> 8; + fl.currentVerifyFlags = fl.defVerifyFlags; + fl.isSpecialDoc = 0; + + fl.noGlob = 0; + fl.devtype = 0; + fl.devmajor = 0; + fl.devminor = 0; + + /* XXX should reset to %deflang value */ + if (fl.currentLangs) { + int i; + for (i = 0; i < fl.nLangs; i++) + /*@-unqualifiedtrans@*/ + fl.currentLangs[i] = _free(fl.currentLangs[i]); + /*@=unqualifiedtrans@*/ + fl.currentLangs = _free(fl.currentLangs); + } + fl.nLangs = 0; + + dupAttrRec(&fl.def_ar, &fl.cur_ar); + + /*@-nullpass@*/ /* LCL: buf is NULL ?!? */ + if (parseForVerify(buf, &fl) != RPMRC_OK) + continue; + if (parseForAttr(buf, &fl) != RPMRC_OK) + continue; + if (parseForDev(buf, &fl) != RPMRC_OK) + continue; + if (parseForConfig(buf, &fl) != RPMRC_OK) + continue; + if (parseForLang(buf, &fl) != RPMRC_OK) + continue; + /*@-nullstate@*/ /* FIX: pkg->fileFile might be NULL */ + if (parseForSimple(spec, pkg, buf, &fl, &fileName) != RPMRC_OK) + /*@=nullstate@*/ + continue; + /*@=nullpass@*/ + if (fileName == NULL) + continue; + + if (fl.isSpecialDoc) { + /* Save this stuff for last */ + specialDoc = _free(specialDoc); + specialDoc = xstrdup(fileName); + dupAttrRec(&fl.cur_ar, specialDocAttrRec); + } else if (fl.currentFlags & RPMFILE_PUBKEY) { +/*@-nullstate@*/ /* FIX: pkg->fileFile might be NULL */ + (void) processMetadataFile(pkg, &fl, fileName, RPMTAG_PUBKEYS); +/*@=nullstate@*/ + } else if (fl.currentFlags & RPMFILE_POLICY) { +/*@-nullstate@*/ /* FIX: pkg->fileFile might be NULL */ + (void) processMetadataFile(pkg, &fl, fileName, RPMTAG_POLICIES); +/*@=nullstate@*/ + } else { +/*@-nullstate@*/ /* FIX: pkg->fileFile might be NULL */ + (void) processBinaryFile(pkg, &fl, fileName); +/*@=nullstate@*/ + } + } + + /* Now process special doc, if there is one */ + if (specialDoc) { + if (installSpecialDoc) { + int _missing_doc_files_terminate_build = + rpmExpandNumeric("%{?_missing_doc_files_terminate_build}"); + rpmRC rc; + + rc = doScript(spec, RPMBUILD_STRINGBUF, "%doc", pkg->specialDoc, test); + if (rc != RPMRC_OK && _missing_doc_files_terminate_build) + fl.processingFailed = 1; + } + + /* Reset for %doc */ + fl.isDir = 0; + fl.inFtw = 0; + fl.currentFlags = 0; + fl.currentVerifyFlags = fl.defVerifyFlags; + + fl.noGlob = 0; + fl.devtype = 0; + fl.devmajor = 0; + fl.devminor = 0; + + /* XXX should reset to %deflang value */ + if (fl.currentLangs) { + int i; + for (i = 0; i < fl.nLangs; i++) + /*@-unqualifiedtrans@*/ + fl.currentLangs[i] = _free(fl.currentLangs[i]); + /*@=unqualifiedtrans@*/ + fl.currentLangs = _free(fl.currentLangs); + } + fl.nLangs = 0; + + dupAttrRec(specialDocAttrRec, &fl.cur_ar); + freeAttrRec(specialDocAttrRec); + + /*@-nullstate@*/ /* FIX: pkg->fileFile might be NULL */ + (void) processBinaryFile(pkg, &fl, specialDoc); + /*@=nullstate@*/ + + specialDoc = _free(specialDoc); + } + + files = argvFree(files); + + if (fl.processingFailed) + goto exit; + + /* Verify that file attributes scope over hardlinks correctly. */ + if (checkHardLinks(&fl)) + (void) rpmlibNeedsFeature(pkg->header, + "PartialHardlinkSets", "4.0.4-1"); + + /* XXX should tags be added if filelist is empty? */ + genCpioListAndHeader(&fl, &pkg->fi, pkg->header, 0); + + if (spec->timeCheck) + timeCheck(spec->timeCheck, pkg->header); + +exit: + fl.buildRootURL = _free(fl.buildRootURL); + fl.prefix = _free(fl.prefix); + + freeAttrRec(&fl.cur_ar); + freeAttrRec(&fl.def_ar); + + if (fl.currentLangs) { + int i; + for (i = 0; i < fl.nLangs; i++) + /*@-unqualifiedtrans@*/ + fl.currentLangs[i] = _free(fl.currentLangs[i]); + /*@=unqualifiedtrans@*/ + fl.currentLangs = _free(fl.currentLangs); + } + + fl.fileList = freeFileList(fl.fileList, fl.fileListRecsUsed); + while (fl.docDirCount--) + fl.docDirs[fl.docDirCount] = _free(fl.docDirs[fl.docDirCount]); + return (fl.processingFailed ? RPMRC_FAIL : RPMRC_OK); +} + +int initSourceHeader(Spec spec, rpmiob *sfp) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + HeaderIterator hi; + rpmiob sourceFiles; + struct Source *srcPtr; + static rpmTag classTag = 0xffffffff; + int xx; + size_t i; + + if (classTag == 0xffffffff) + classTag = tagValue("Class"); + + /* Only specific tags are added to the source package header */ + if (spec->packages && !spec->sourceHdrInit) { + for (hi = headerInit(spec->packages->header); + headerNext(hi, he, 0); + he->p.ptr = _free(he->p.ptr)) + { + switch (he->tag) { + case RPMTAG_NAME: + case RPMTAG_VERSION: + case RPMTAG_RELEASE: + case RPMTAG_DISTEPOCH: + case RPMTAG_EPOCH: + case RPMTAG_SUMMARY: + case RPMTAG_DESCRIPTION: + case RPMTAG_PACKAGER: + case RPMTAG_DISTRIBUTION: + case RPMTAG_DISTURL: + case RPMTAG_VENDOR: + case RPMTAG_LICENSE: + case RPMTAG_GROUP: + case RPMTAG_OS: + case RPMTAG_ARCH: + case RPMTAG_CHANGELOGTIME: + case RPMTAG_CHANGELOGNAME: + case RPMTAG_CHANGELOGTEXT: + case RPMTAG_URL: + case RPMTAG_BUGURL: + case RPMTAG_ICON: + case RPMTAG_GIF: + case RPMTAG_XPM: + case HEADER_I18NTABLE: +#if defined(RPM_VENDOR_OPENPKG) /* propagate-provides-to-srpms */ + /* make sure the "Provides" headers are available for querying from the .src.rpm files. */ + case RPMTAG_PROVIDENAME: + case RPMTAG_PROVIDEVERSION: + case RPMTAG_PROVIDEFLAGS: +#endif + if (he->p.ptr) + xx = headerPut(spec->sourceHeader, he, 0); + /*@switchbreak@*/ break; + default: + if (classTag == he->tag && he->p.ptr != NULL) + xx = headerPut(spec->sourceHeader, he, 0); + /*@switchbreak@*/ break; + } + } + hi = headerFini(hi); + + if (spec->BANames && spec->BACount > 0) { + he->tag = RPMTAG_BUILDARCHS; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = spec->BANames; + he->c = spec->BACount; + xx = headerPut(spec->sourceHeader, he, 0); + } + + /* Load arbitrary tags into srpm header. */ + if (spec->foo) + for (i = 0; i < spec->nfoo; i++) { + const char * str = spec->foo[i].str; + rpmTag tag = spec->foo[i].tag; + rpmiob iob = spec->foo[i].iob; + char * s; + + if (str == NULL || iob == NULL) + continue; + + /* XXX Special case %track interpreter for now. */ + if (!xstrcasecmp(str, "track")) { + he->p.str = rpmExpand("%{?__vcheck}", NULL); + if (!(he->p.str != NULL && he->p.str[0] != '\0')) { + he->p.str = _free(he->p.str); + continue; + } + he->tag = tagValue("Trackprog"); + he->t = RPM_STRING_TYPE; + he->c = 1; + xx = headerPut(spec->sourceHeader, he, 0); + he->p.str = _free(he->p.str); + } + + s = rpmiobStr(iob); + he->tag = tag; + he->append = headerIsEntry(spec->sourceHeader, tag); + if (he->append) { + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = (const char **) &s; + he->c = 1; + } else { + he->t = RPM_STRING_TYPE; + he->p.str = s; + he->c = 1; + } + xx = headerPut(spec->sourceHeader, he, 0); + he->append = 0; + } + } + + if (sfp != NULL && *sfp != NULL) + sourceFiles = *sfp; + else + sourceFiles = rpmiobNew(0); + + /* Construct the source/patch tag entries */ + if (spec->specFile != NULL) /* XXX segfault avoidance */ + sourceFiles = rpmiobAppend(sourceFiles, spec->specFile, 1); + if (spec->sourceHeader != NULL) + for (srcPtr = spec->sources; srcPtr != NULL; srcPtr = srcPtr->next) { + { const char * sfn; +/*@-nullpass@*/ /* XXX getSourceDir returns NULL with bad flags. */ + sfn = rpmGetPath( ((srcPtr->flags & RPMFILE_GHOST) ? "!" : ""), +#if defined(RPM_VENDOR_OPENPKG) /* splitted-source-directory */ + getSourceDir(srcPtr->flags, srcPtr->source), srcPtr->source, NULL); +#else + getSourceDir(srcPtr->flags), srcPtr->source, NULL); +#endif +/*@=nullpass@*/ + sourceFiles = rpmiobAppend(sourceFiles, sfn, 1); + sfn = _free(sfn); + } + + if (spec->sourceHdrInit) + continue; + + if (srcPtr->flags & RPMFILE_SOURCE) { + he->tag = RPMTAG_SOURCE; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &srcPtr->source; + he->c = 1; + he->append = 1; + xx = headerPut(spec->sourceHeader, he, 0); + he->append = 0; + if (srcPtr->flags & RPMFILE_GHOST) { + he->tag = RPMTAG_NOSOURCE; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &srcPtr->num; + he->c = 1; + he->append = 1; + xx = headerPut(spec->sourceHeader, he, 0); + he->append = 0; + } + } + if (srcPtr->flags & RPMFILE_PATCH) { + he->tag = RPMTAG_PATCH; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &srcPtr->source; + he->c = 1; + he->append = 1; + xx = headerPut(spec->sourceHeader, he, 0); + he->append = 0; + if (srcPtr->flags & RPMFILE_GHOST) { + he->tag = RPMTAG_NOPATCH; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &srcPtr->num; + he->c = 1; + he->append = 1; + xx = headerPut(spec->sourceHeader, he, 0); + he->append = 0; + } + } + } + + if (sfp == NULL) + sourceFiles = rpmiobFree(sourceFiles); + + spec->sourceHdrInit = 1; + +/*@-usereleased@*/ + return 0; +/*@=usereleased@*/ +} + +int processSourceFiles(Spec spec) +{ + rpmiob sourceFiles, *sfp = &sourceFiles; + int x, isSpec = 1; + struct FileList_s fl; + ARGV_t files = NULL; + ARGV_t fp; + int rc; + /* srcdefattr: needed variables */ + char _srcdefattr_buf[BUFSIZ]; + char * _srcdefattr = rpmExpand("%{?_srcdefattr}", NULL); + int xx; + + *sfp = rpmiobNew(0); + x = initSourceHeader(spec, sfp); + + /* srcdefattr: initialize file list structure */ + memset(&fl, 0, sizeof(fl)); + if (_srcdefattr && *_srcdefattr) { + xx = snprintf(_srcdefattr_buf, sizeof(_srcdefattr_buf), "%%defattr %s", _srcdefattr); + _srcdefattr_buf[sizeof(_srcdefattr_buf)-1] = '\0'; + xx = parseForAttr(_srcdefattr_buf, &fl); + } + + /* Construct the SRPM file list. */ + fl.fileList = xcalloc((spec->numSources + 1), sizeof(*fl.fileList)); + rc = fl.processingFailed = 0; + fl.fileListRecsUsed = 0; + fl.totalFileSize = 0; + fl.prefix = NULL; + fl.buildRootURL = NULL; + + xx = argvSplit(&files, rpmiobStr(*sfp), "\n"); + + /* The first source file is the spec file */ + x = 0; + for (fp = files; *fp != NULL; fp++) { + const char * diskURL, *diskPath; + FileListRec flp; + + diskURL = *fp; + SKIPSPACE(diskURL); + if (! *diskURL) + continue; + + flp = &fl.fileList[x]; + + flp->flags = isSpec ? RPMFILE_SPECFILE : 0; + /* files with leading ! are no source files */ + if (*diskURL == '!') { + flp->flags |= RPMFILE_GHOST; + diskURL++; + } + + (void) urlPath(diskURL, &diskPath); + + flp->diskURL = xstrdup(diskURL); + diskPath = strrchr(diskPath, '/'); + if (diskPath) + diskPath++; + else + diskPath = diskURL; + + flp->fileURL = xstrdup(diskPath); + flp->verifyFlags = RPMVERIFY_ALL; + + if (Stat(diskURL, &flp->fl_st)) { + rpmlog(RPMLOG_ERR, _("Bad file: %s: %s\n"), + diskURL, strerror(errno)); + rc = fl.processingFailed = 1; + } + +#if defined(RPM_VENDOR_OPENPKG) /* support-srcdefattr */ + /* srcdefattr: allow to set SRPM file attributes via %{_srcdefattr} macro */ + if (fl.def_ar.ar_fmodestr) { + flp->fl_mode &= S_IFMT; + flp->fl_mode |= fl.def_ar.ar_fmode; + } + flp->uname = fl.def_ar.ar_user ? getUnameS(fl.def_ar.ar_user) : getUname(flp->fl_uid); + flp->gname = fl.def_ar.ar_group ? getGnameS(fl.def_ar.ar_group) : getGname(flp->fl_gid); +#else + flp->uname = getUname(flp->fl_uid); + flp->gname = getGname(flp->fl_gid); +#endif + flp->langs = xstrdup(""); + + if (! (flp->uname && flp->gname)) { + rpmlog(RPMLOG_ERR, _("Bad owner/group: %s\n"), diskURL); + rc = fl.processingFailed = 1; + } + + isSpec = 0; + x++; + } + fl.fileListRecsUsed = x; + files = argvFree(files); + + if (rc) + goto exit; + + /* XXX should tags be added if filelist is empty? */ + spec->fi = NULL; + genCpioListAndHeader(&fl, &spec->fi, spec->sourceHeader, 1); + +exit: + *sfp = rpmiobFree(*sfp); + fl.fileList = freeFileList(fl.fileList, fl.fileListRecsUsed); + _srcdefattr = _free(_srcdefattr); + return rc; +} + +/** + * Check for unpackaged files against what's in the build root. + * @param spec spec file control structure + * @return -1 if skipped, 0 on OK, 1 on error + */ +static int checkUnpackagedFiles(Spec spec) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies *spec->packages, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ +/*@-readonlytrans@*/ + static const char * av_ckfile[] = { "%{?__check_files}", NULL }; +/*@=readonlytrans@*/ + rpmiob iob_stdout = NULL; + const char * s; + int rc; + rpmiob fileList = NULL; + Package pkg; + int n = 0; + + s = rpmExpand(av_ckfile[0], NULL); + if (!(s && *s)) { + rc = -1; + goto exit; + } + rc = 0; + + /* initialize fileList */ + fileList = rpmiobNew(0); + for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { + int i; +#ifndef DYING /* XXX rpmfiNew is necessary here. why?!? */ + rpmfi fi = rpmfiNew(NULL, pkg->header, RPMTAG_BASENAMES, 0); +#else + rpmfi fi = rpmfiLink(pkg->fi, __FUNCTION__); +#endif + fi = rpmfiInit(fi, 0); + while ((i = rpmfiNext(fi)) >= 0) { + const char *fn = rpmfiFN(fi); + fileList = rpmiobAppend(fileList, fn, 1); + n++; + } + fi = rpmfiFree(fi); + } + + if (n == 0) { + /* no packaged files, and buildroot may not exist - + * no need to run check */ + rc = -1; + goto exit; + } + + rpmlog(RPMLOG_NOTICE, _("Checking for unpackaged file(s): %s\n"), s); + + rc = rpmfcExec(av_ckfile, fileList, &iob_stdout, 0); + if (rc < 0) + goto exit; + + if (iob_stdout) { + int _unpackaged_files_terminate_build = + rpmExpandNumeric("%{?_unpackaged_files_terminate_build}"); + const char * t; + + t = rpmiobStr(iob_stdout); + if ((*t != '\0') && (*t != '\n')) { + rc = (_unpackaged_files_terminate_build) ? 1 : 0; + rpmlog((rc ? RPMLOG_ERR : RPMLOG_WARNING), + _("Installed (but unpackaged) file(s) found:\n%s"), t); + } + } + +exit: + fileList = rpmiobFree(fileList); + iob_stdout = rpmiobFree(iob_stdout); + s = _free(s); + return rc; +} + +/* auxiliary function for checkDuplicateFiles() */ +/* XXX need to pass Header because fi->h is NULL */ +static int fiIntersect(/*@null@*/ rpmfi fi1, /*@null@*/ rpmfi fi2) + /*@globals internalState @*/ + /*@modifies fi1, fi2, internalState @*/ +{ + int n = 0; + int i1, i2; + const char *fn1, *fn2; + rpmiob dups = NULL; + + if ((fi1 = rpmfiInit(fi1, 0)) != NULL) + while ((i1 = rpmfiNext(fi1)) >= 0) { + if (S_ISDIR(rpmfiFMode(fi1))) + continue; + fn1 = rpmfiFN(fi1); + if ((fi2 = rpmfiInit(fi2, 0)) != NULL) + while ((i2 = rpmfiNext(fi2)) >= 0) { + if (S_ISDIR(rpmfiFMode(fi2))) + /*@innercontinue@*/ continue; + fn2 = rpmfiFN(fi2); + if (strcmp(fn1, fn2)) + /*@innercontinue@*/ continue; + if (!dups) + dups = rpmiobNew(0); + dups = rpmiobAppend(dups, "\t", 0); + dups = rpmiobAppend(dups, fn1, 1); + n++; + } + } + + if (n > 0) { + const char *N1, *N2; + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + + he->tag = RPMTAG_NVRA; + N1 = (headerGet(fi1->h, he, 0) ? he->p.str : NULL); + he->tag = RPMTAG_NVRA; + N2 = (headerGet(fi2->h, he, 0) ? he->p.str : NULL); + + rpmlog(RPMLOG_WARNING, + _("File(s) packaged into both %s and %s:\n%s"), + N1, N2, rpmiobStr(dups)); + + N1 = _free(N1); + N2 = _free(N2); + dups = rpmiobFree(dups); + } + + return n; +} + +/** + * Check if the same files are packaged into a few sub-packages. + * @param spec spec file control structure + * @return number of duplicate files + */ +static int checkDuplicateFiles(Spec spec) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies *spec->packages, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + int n = 0; + Package pkg1, pkg2; + + if (spec->packages) /* XXX segfault avoidance */ + for (pkg1 = spec->packages; pkg1->next; pkg1 = pkg1->next) { +#ifdef DYING + rpmfi fi1 = rpmfiNew(NULL, pkg1->header, RPMTAG_BASENAMES, 0); +#else + rpmfi fi1 = rpmfiLink(pkg1->fi, __FUNCTION__); +#endif + if (fi1 == NULL) continue; + (void) rpmfiSetHeader(fi1, pkg1->header); + for (pkg2 = pkg1->next; pkg2; pkg2 = pkg2->next) { +#ifdef DYING + rpmfi fi2 = rpmfiNew(NULL, pkg2->header, RPMTAG_BASENAMES, 0); +#else + rpmfi fi2 = rpmfiLink(pkg2->fi, __FUNCTION__); +#endif + if (fi2 == NULL) continue; + (void) rpmfiSetHeader(fi2, pkg2->header); + n += fiIntersect(fi1, fi2); + (void) rpmfiSetHeader(fi2, NULL); + fi2 = rpmfiFree(fi2); + } + (void) rpmfiSetHeader(fi1, NULL); + fi1 = rpmfiFree(fi1); + } + return n; +} + +/* auxiliary function: check if directory d is packaged */ +static inline int packagedDir(Package pkg, const char *d) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies pkg->header, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + return rpmbfChk(rpmfiFNBF(pkg->fi), d, strlen(d)); +} + +/* auxiliary function: find unpackaged subdirectories + * + * E.g. consider this %files section: + * %dir /A + * /A/B/C/D + * Now directories "/A/B" and "/A/B/C" should also be packaged. + */ +static int pkgUnpackagedSubdirs(Package pkg) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies pkg->header, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + int n = 0; + int i, j; + char **unpackaged = NULL; + char *fn; +#ifdef DYING + rpmfi fi = rpmfiNew(NULL, pkg->header, RPMTAG_BASENAMES, 0); +#else + rpmfi fi = rpmfiLink(pkg->fi, __FUNCTION__); +#endif + + if (rpmfiFC(fi) <= 1) { + fi = rpmfiFree(fi); + return 0; + } + fn = alloca(rpmfiFNMaxLen(fi) + 1); + + fi = rpmfiInit(fi, 0); + while ((i = rpmfiNext(fi)) >= 0) { + int found = 0; + /* make local copy of file name */ + char *p = fn; + strcpy(fn, rpmfiFN(fi)); + /* find the first path component that is packaged */ + while ((p = strchr(p + 1, '/'))) { + *p = '\0'; + found = packagedDir(pkg, fn); + *p = '/'; + if (found) + /*@innerbreak@*/ break; + } + if (!found) + continue; + /* other path components should be packaged, too */ + if (p != NULL) + while ((p = strchr(p + 1, '/'))) { + *p = '\0'; + if (packagedDir(pkg, fn)) { + *p = '/'; + /*@innercontinue@*/ continue; + } + /* might be already added */ + found = 0; + for (j = 0; j < n; j++) + if (strcmp(fn, unpackaged[j]) == 0) { + found = 1; + /*@innerbreak@*/ break; + } + if (found) { + *p = '/'; + /*@innercontinue@*/ continue; + } + unpackaged = xrealloc(unpackaged, sizeof(*unpackaged) * (n + 1)); + unpackaged[n++] = xstrdup(fn); + *p = '/'; + } + } + fi = rpmfiFree(fi); + + if (n > 0) { + const char *N; + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmiob list = rpmiobNew(0); + + he->tag = RPMTAG_NVRA; + N = (headerGet(pkg->header, he, 0) ? he->p.str : NULL); + + for (i = 0; i < n; i++) { + list = rpmiobAppend(list, "\t", 0); + list = rpmiobAppend(list, unpackaged[i], 1); + unpackaged[i] = _free(unpackaged[i]); + } + unpackaged = _free(unpackaged); + + rpmlog(RPMLOG_WARNING, + _("Unpackaged subdir(s) in %s:\n%s"), + N, rpmiobStr(list)); + + N = _free(N); + list = rpmiobFree(list); + } + + return n; +} + +/** + * Check for unpackaged subdirectories. + * @param spec spec file control structure + * @return number of unpackaged subdirectories + */ +static int checkUnpackagedSubdirs(Spec spec) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies *spec->packages, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + int n = 0; + Package pkg; + + for (pkg = spec->packages; pkg; pkg = pkg->next) + n += pkgUnpackagedSubdirs(pkg); + return n; +} + +/*@-incondefs@*/ +rpmRC processBinaryFiles(Spec spec, int installSpecialDoc, int test) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + Package pkg; + rpmRC res = RPMRC_OK; + + for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { + int rc; + + if (pkg->fileList == NULL) + continue; + + (void) headerMacrosLoad(pkg->header); + + he->tag = RPMTAG_NVRA; + rc = headerGet(pkg->header, he, 0); + rpmlog(RPMLOG_NOTICE, _("Processing files: %s\n"), he->p.str); + he->p.ptr = _free(he->p.ptr); + + if ((rc = processPackageFiles(spec, pkg, installSpecialDoc, test))) { + res = RPMRC_FAIL; + (void) headerMacrosUnload(pkg->header); + break; + } + + /* Finalize package scriptlets before extracting dependencies. */ + if ((rc = processScriptFiles(spec, pkg))) { + res = rc; + (void) headerMacrosUnload(pkg->header); + break; + } + + if ((rc = rpmfcGenerateDepends(spec, pkg))) { + res = RPMRC_FAIL; + (void) headerMacrosUnload(pkg->header); + break; + } + + /* XXX this should be earlier for deps to be entirely sorted. */ + providePackageNVR(pkg->header); + + (void) headerMacrosUnload(pkg->header); + } + + if (res == RPMRC_OK) { + if (checkUnpackagedFiles(spec) > 0) + res = RPMRC_FAIL; + (void) checkDuplicateFiles(spec); + (void) checkUnpackagedSubdirs(spec); + } + + return res; +} +/*@=incondefs@*/ diff --git a/rpm-5.4.9/build/librpmbuild.vers b/rpm-5.4.9/build/librpmbuild.vers new file mode 100644 index 0000000..ebff3ed --- /dev/null +++ b/rpm-5.4.9/build/librpmbuild.vers @@ -0,0 +1,61 @@ +LIBRPMBUILD_0 +{ + global: + addChangelogEntry; + addReqProv; + addSource; + buildHost; + buildSpec; + closeSpec; + doScript; + _fini; + freeNames; + freePackages; + getBuildTime; + getGidS; + getGname; + getGnameS; + getUidS; + getUname; + getUnameS; + handleComments; + _init; + initSourceHeader; + isPart; + lookupPackage; + newOpenFileInfo; + newPackage; + newSpec; + noLang; + packageBinaries; + packageSources; + parseBuildInstallClean; + parseChangelog; + parseDescription; + parseExpressionBoolean; + parseExpressionString; + parseFiles; + parseNoSource; + parseNum; + parsePreamble; + parsePrep; + parseRCPOT; + parseScript; + parseSpec; + _pkgPool; + processBinaryFiles; + processSourceFiles; + readLine; + readRPM; + rpmBTArgs; + rpmBuildPoptTable; + rpmlibNeedsFeature; + rpmspecQuery; + _specPool; + stashSt; + verifyAttrs; + virtualFileAttributes; + writeRPM; + local: + *; +}; diff --git a/rpm-5.4.9/build/misc.c b/rpm-5.4.9/build/misc.c new file mode 100644 index 0000000..6863a5f --- /dev/null +++ b/rpm-5.4.9/build/misc.c @@ -0,0 +1,20 @@ +/** \ingroup rpmbuild + * \file build/misc.c + */ +#include "system.h" + +#include +#include +#include "rpmbuild.h" +#include "debug.h" + +int parseNum(const char * line, rpmuint32_t * res) +{ + char * s1 = NULL; + unsigned long rc; + + if (line == NULL) return 1; + rc = strtoul(line, &s1, 10); + if (res) *res = rc; + return (((*s1) || (s1 == line) || (rc == ULONG_MAX)) ? 1 : 0); +} diff --git a/rpm-5.4.9/build/names.c b/rpm-5.4.9/build/names.c new file mode 100644 index 0000000..e7496ca --- /dev/null +++ b/rpm-5.4.9/build/names.c @@ -0,0 +1,228 @@ +/*@-mods@*/ +/** \ingroup rpmbuild + * \file build/names.c + * Simple user/group name/id cache (plus hostname and buildtime) + */ + + +#include "system.h" + +#include +#include +#include +#include "rpmbuild.h" +#include "debug.h" + +typedef /*@owned@*/ /*@null@*/ const char * ugstr_t; + +/*@unchecked@*/ +static uid_t uids[1024]; +/*@unchecked@*/ +static ugstr_t unames[1024]; +/*@unchecked@*/ +static int uid_used = 0; + +/*@unchecked@*/ +static gid_t gids[1024]; +/*@unchecked@*/ +static ugstr_t gnames[1024]; +/*@unchecked@*/ +static int gid_used = 0; + +void freeNames(void) +{ + int x; + for (x = 0; x < uid_used; x++) + unames[x] = _free(unames[x]); + for (x = 0; x < gid_used; x++) + gnames[x] = _free(gnames[x]); +} + +const char *getUname(uid_t uid) + /*@globals uid_used, uids, unames @*/ + /*@modifies uid_used, uids, unames @*/ +{ + struct passwd *pw; + int x; + + for (x = 0; x < uid_used; x++) { + if (unames[x] == NULL) continue; + if (uids[x] == uid) + return unames[x]; + } + + /* XXX - This is the other hard coded limit */ + if (x == 1024) + rpmlog(RPMLOG_CRIT, _("getUname: too many uid's\n")); + + if ((pw = getpwuid(uid)) == NULL) + return NULL; + uids[uid_used] = uid; + unames[uid_used] = xstrdup(pw->pw_name); + return unames[uid_used++]; +} + +const char *getUnameS(const char *uname) + /*@globals uid_used, uids, unames @*/ + /*@modifies uid_used, uids, unames @*/ +{ + struct passwd *pw; + int x; + + for (x = 0; x < uid_used; x++) { + if (unames[x] == NULL) continue; + if (!strcmp(unames[x],uname)) + return unames[x]; + } + + /* XXX - This is the other hard coded limit */ + if (x == 1024) + rpmlog(RPMLOG_CRIT, _("getUnameS: too many uid's\n")); + + if ((pw = getpwnam(uname)) == NULL) { + uids[uid_used] = -1; + unames[uid_used] = xstrdup(uname); + } else { + uids[uid_used] = pw->pw_uid; + unames[uid_used] = xstrdup(pw->pw_name); + } + return unames[uid_used++]; +} + +uid_t getUidS(const char *uname) + /*@globals uid_used, uids, unames @*/ + /*@modifies uid_used, uids, unames @*/ +{ + struct passwd *pw; + int x; + + for (x = 0; x < uid_used; x++) { + if (unames[x] == NULL) continue; + if (!strcmp(unames[x],uname)) + return uids[x]; + } + + /* XXX - This is the other hard coded limit */ + if (x == 1024) + rpmlog(RPMLOG_CRIT, _("getUidS: too many uid's\n")); + + if ((pw = getpwnam(uname)) == NULL) { + uids[uid_used] = -1; + unames[uid_used] = xstrdup(uname); + } else { + uids[uid_used] = pw->pw_uid; + unames[uid_used] = xstrdup(pw->pw_name); + } + return uids[uid_used++]; +} + +const char *getGname(gid_t gid) + /*@globals gid_used, gids, gnames @*/ + /*@modifies gid_used, gids, gnames @*/ +{ + struct group *gr; + int x; + + for (x = 0; x < gid_used; x++) { + if (gnames[x] == NULL) continue; + if (gids[x] == gid) + return gnames[x]; + } + + /* XXX - This is the other hard coded limit */ + if (x == 1024) + rpmlog(RPMLOG_CRIT, _("getGname: too many gid's\n")); + + if ((gr = getgrgid(gid)) == NULL) + return NULL; + gids[gid_used] = gid; + gnames[gid_used] = xstrdup(gr->gr_name); + return gnames[gid_used++]; +} + +const char *getGnameS(const char *gname) + /*@globals gid_used, gids, gnames @*/ + /*@modifies gid_used, gids, gnames @*/ +{ + struct group *gr; + int x; + + for (x = 0; x < gid_used; x++) { + if (gnames[x] == NULL) continue; + if (!strcmp(gnames[x], gname)) + return gnames[x]; + } + + /* XXX - This is the other hard coded limit */ + if (x == 1024) + rpmlog(RPMLOG_CRIT, _("getGnameS: too many gid's\n")); + + if ((gr = getgrnam(gname)) == NULL) { + gids[gid_used] = -1; + gnames[gid_used] = xstrdup(gname); + } else { + gids[gid_used] = gr->gr_gid; + gnames[gid_used] = xstrdup(gr->gr_name); + } + return gnames[gid_used++]; +} + +gid_t getGidS(const char *gname) + /*@globals gid_used, gids, gnames @*/ + /*@modifies gid_used, gids, gnames @*/ +{ + struct group *gr; + int x; + + for (x = 0; x < gid_used; x++) { + if (gnames[x] == NULL) continue; + if (!strcmp(gnames[x], gname)) + return gids[x]; + } + + /* XXX - This is the other hard coded limit */ + if (x == 1024) + rpmlog(RPMLOG_CRIT, _("getGidS: too many gid's\n")); + + if ((gr = getgrnam(gname)) == NULL) { + gids[gid_used] = -1; + gnames[gid_used] = xstrdup(gname); + } else { + gids[gid_used] = gr->gr_gid; + gnames[gid_used] = xstrdup(gr->gr_name); + } + return gids[gid_used++]; +} + +rpmuint32_t * getBuildTime(void) +{ + static rpmuint32_t buildTime[1]; + + if (buildTime[0] == 0) + buildTime[0] = (rpmuint32_t) time(NULL); + return buildTime; +} + +const char * buildHost(void) +{ + static char hostname[1024]; + static int oneshot = 0; + struct hostent *hbn; + + if (! oneshot) { + (void) gethostname(hostname, sizeof(hostname)); + /*@-unrecog -multithreaded @*/ + /*@-globs@*/ /* FIX: h_errno access */ + hbn = gethostbyname(hostname); + /*@=globs@*/ + /*@=unrecog =multithreaded @*/ + if (hbn) + strcpy(hostname, hbn->h_name); + else + rpmlog(RPMLOG_WARNING, + _("Could not canonicalize hostname: %s\n"), hostname); + oneshot = 1; + } + return(hostname); +} +/*@=mods@*/ diff --git a/rpm-5.4.9/build/pack.c b/rpm-5.4.9/build/pack.c new file mode 100644 index 0000000..6bab3cc --- /dev/null +++ b/rpm-5.4.9/build/pack.c @@ -0,0 +1,1351 @@ +/** \ingroup rpmbuild + * \file build/pack.c + * Assemble components of an RPM package. + */ + +#include "system.h" + +#include /* XXX fdGetFp, fdInitDigest, fdFiniDigest */ +#include +#include + +#include +#include + +#include +#include "signature.h" /* XXX rpmTempFile */ + +#define _RPMFI_INTERNAL /* XXX fi->fsm */ +#define _RPMEVR_INTERNAL /* XXX RPMSENSE_ANY */ +#define _RPMTAG_INTERNAL +#include + +#include "rpmfi.h" +#include "fsm.h" + +#include +#include "buildio.h" + +#include "debug.h" + +/*@access rpmts @*/ +/*@access rpmfi @*/ /* compared with NULL */ +/*@access Header @*/ /* compared with NULL */ +/*@access FD_t @*/ /* compared with NULL */ +/*@access CSA_t @*/ + +/** + * @todo Create transaction set *much* earlier. + */ +static rpmRC cpio_doio(FD_t fdo, /*@unused@*/ Header h, CSA_t csa, + const char * payload_format, const char * fmodeMacro) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies fdo, csa, rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + rpmts ts = rpmtsCreate(); + rpmfi fi = csa->fi; + const char *failedFile = NULL; + FD_t cfd; + rpmRC rc = RPMRC_OK; + int xx; + + { const char *fmode = rpmExpand(fmodeMacro, NULL); + if (!(fmode && fmode[0] == 'w')) + fmode = xstrdup("w9.gzdio"); + /*@-nullpass@*/ + (void) Fflush(fdo); + cfd = Fdopen(fdDup(Fileno(fdo)), fmode); + /*@=nullpass@*/ + fmode = _free(fmode); + } + if (cfd == NULL) + return RPMRC_FAIL; + + xx = fsmSetup(fi->fsm, IOSM_PKGBUILD, payload_format, ts, fi, cfd, + &csa->cpioArchiveSize, &failedFile); + if (xx) + rc = RPMRC_FAIL; + (void) Fclose(cfd); + xx = fsmTeardown(fi->fsm); + if (rc == RPMRC_OK && xx) rc = RPMRC_FAIL; + + if (rc) { + const char * msg = iosmStrerror(rc); + if (failedFile) + rpmlog(RPMLOG_ERR, _("create archive failed on file %s: %s\n"), + failedFile, msg); + else + rpmlog(RPMLOG_ERR, _("create archive failed: %s\n"), msg); + msg = _free(msg); + rc = RPMRC_FAIL; + } + + failedFile = _free(failedFile); + (void)rpmtsFree(ts); + ts = NULL; + + return rc; +} + +/** + */ +static rpmRC cpio_copy(FD_t fdo, CSA_t csa) + /*@globals fileSystem, internalState @*/ + /*@modifies fdo, csa, fileSystem, internalState @*/ +{ + char buf[BUFSIZ]; + size_t nb; + + while((nb = Fread(buf, sizeof(buf[0]), sizeof(buf), csa->cpioFdIn)) > 0) { + if (Fwrite(buf, sizeof(buf[0]), nb, fdo) != nb) { + rpmlog(RPMLOG_ERR, _("cpio_copy write failed: %s\n"), + Fstrerror(fdo)); + return RPMRC_FAIL; + } + csa->cpioArchiveSize += nb; + } + if (Ferror(csa->cpioFdIn)) { + rpmlog(RPMLOG_ERR, _("cpio_copy read failed: %s\n"), + Fstrerror(csa->cpioFdIn)); + return RPMRC_FAIL; + } + return RPMRC_OK; +} + +/** + */ +static /*@only@*/ /*@null@*/ rpmiob addFileToTagAux(Spec spec, + const char * file, /*@only@*/ rpmiob iob) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + char buf[BUFSIZ]; + const char * fn = buf; + FILE * f; + FD_t fd; + + fn = rpmGetPath("%{_builddir}/%{?buildsubdir:%{buildsubdir}/}", file, NULL); + + fd = Fopen(fn, "r.fdio"); + if (fn != buf) fn = _free(fn); + if (fd == NULL || Ferror(fd)) { + iob = rpmiobFree(iob); + return NULL; + } + /*@-type@*/ /* FIX: cast? */ + if ((f = fdGetFp(fd)) != NULL) + /*@=type@*/ + while (fgets(buf, (int)sizeof(buf), f)) { + /* XXX display fn in error msg */ + if (expandMacros(spec, spec->macros, buf, sizeof(buf))) { + rpmlog(RPMLOG_ERR, _("line: %s\n"), buf); + iob = rpmiobFree(iob); + break; + } + iob = rpmiobAppend(iob, buf, 0); + } + (void) Fclose(fd); + + return iob; +} + +/** + */ +static int addFileToTag(Spec spec, const char * file, Header h, rpmTag tag) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies h, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmiob iob = rpmiobNew(0); + int xx; + + he->tag = tag; + xx = headerGet(h, he, 0); + if (xx) { + iob = rpmiobAppend(iob, he->p.str, 1); + xx = headerDel(h, he, 0); + } + he->p.ptr = _free(he->p.ptr); + + if ((iob = addFileToTagAux(spec, file, iob)) == NULL) + return 1; + + he->tag = tag; + he->t = RPM_STRING_TYPE; + he->p.str = rpmiobStr(iob); + he->c = 1; + xx = headerPut(h, he, 0); + + iob = rpmiobFree(iob); + return 0; +} + +/** + */ +static int addFileToArrayTag(Spec spec, const char *file, Header h, rpmTag tag) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies h, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmiob iob = rpmiobNew(0); + const char *s; + int xx; + + if ((iob = addFileToTagAux(spec, file, iob)) == NULL) + return 1; + + s = rpmiobStr(iob); + + he->tag = tag; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &s; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + + iob = rpmiobFree(iob); + return 0; +} + +rpmRC processScriptFiles(Spec spec, Package pkg) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies pkg->header, rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + struct TriggerFileEntry *p; + int xx; + + if (pkg->preInFile) { + if (addFileToTag(spec, pkg->preInFile, pkg->header, RPMTAG_PREIN)) { + rpmlog(RPMLOG_ERR, + _("Could not open PreIn file: %s\n"), pkg->preInFile); + return RPMRC_FAIL; + } + } + if (pkg->preUnFile) { + if (addFileToTag(spec, pkg->preUnFile, pkg->header, RPMTAG_PREUN)) { + rpmlog(RPMLOG_ERR, + _("Could not open PreUn file: %s\n"), pkg->preUnFile); + return RPMRC_FAIL; + } + } + if (pkg->preTransFile) { + if (addFileToTag(spec, pkg->preTransFile, pkg->header, RPMTAG_PRETRANS)) { + rpmlog(RPMLOG_ERR, + _("Could not open PreTrans file: %s\n"), pkg->preTransFile); + return RPMRC_FAIL; + } + } + if (pkg->postInFile) { + if (addFileToTag(spec, pkg->postInFile, pkg->header, RPMTAG_POSTIN)) { + rpmlog(RPMLOG_ERR, + _("Could not open PostIn file: %s\n"), pkg->postInFile); + return RPMRC_FAIL; + } + } + if (pkg->postUnFile) { + if (addFileToTag(spec, pkg->postUnFile, pkg->header, RPMTAG_POSTUN)) { + rpmlog(RPMLOG_ERR, + _("Could not open PostUn file: %s\n"), pkg->postUnFile); + return RPMRC_FAIL; + } + } + if (pkg->postTransFile) { + if (addFileToTag(spec, pkg->postTransFile, pkg->header, RPMTAG_POSTTRANS)) { + rpmlog(RPMLOG_ERR, + _("Could not open PostTrans file: %s\n"), pkg->postTransFile); + return RPMRC_FAIL; + } + } + if (pkg->verifyFile) { + if (addFileToTag(spec, pkg->verifyFile, pkg->header, + RPMTAG_VERIFYSCRIPT)) { + rpmlog(RPMLOG_ERR, + _("Could not open VerifyScript file: %s\n"), pkg->verifyFile); + return RPMRC_FAIL; + } + } + + if (pkg->sanityCheckFile) { + if (addFileToTag(spec, pkg->sanityCheckFile, pkg->header, RPMTAG_SANITYCHECK)) { + rpmlog(RPMLOG_ERR, _("Could not open Test file: %s\n"), pkg->sanityCheckFile); + return RPMRC_FAIL; + } + } + + for (p = pkg->triggerFiles; p != NULL; p = p->next) { + he->tag = RPMTAG_TRIGGERSCRIPTPROG; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = (const char **)&p->prog; /* XXX NOCAST */ + he->c = 1; + he->append = 1; + xx = headerPut(pkg->header, he, 0); + he->append = 0; + if (p->script) { + he->tag = RPMTAG_TRIGGERSCRIPTS; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = (const char **)&p->script; /* XXX NOCAST */ + he->c = 1; + he->append = 1; + xx = headerPut(pkg->header, he, 0); + he->append = 0; + } else if (p->fileName) { + if (addFileToArrayTag(spec, p->fileName, pkg->header, + RPMTAG_TRIGGERSCRIPTS)) { + rpmlog(RPMLOG_ERR, + _("Could not open Trigger script file: %s\n"), + p->fileName); + return RPMRC_FAIL; + } + } else { + /*@observer@*/ + static const char *bull = ""; + he->tag = RPMTAG_TRIGGERSCRIPTS; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = • + he->c = 1; + he->append = 1; + xx = headerPut(pkg->header, he, 0); + he->append = 0; + } + } + + return RPMRC_OK; +} + +#if defined(DEAD) +int readRPM(const char *fileName, Spec *specp, void * l, + Header *sigs, CSA_t csa) +{ + const char * msg = ""; + FD_t fdi; + Spec spec; + rpmRC rc; + + fdi = (fileName != NULL) + ? Fopen(fileName, "r.fdio") + : fdDup(STDIN_FILENO); + + if (fdi == NULL || Ferror(fdi)) { + rpmlog(RPMLOG_ERR, _("readRPM: open %s: %s\n"), + (fileName ? fileName : ""), + Fstrerror(fdi)); + if (fdi) (void) Fclose(fdi); + return RPMRC_FAIL; + } + + { const char item[] = "Lead"; + size_t nl = rpmpkgSizeof(item, NULL); + + if (nl == 0) { + rc = RPMRC_FAIL; + msg = xstrdup("item size is zero"); + } else { + l = xcalloc(1, nl); /* XXX memory leak */ + msg = NULL; + rc = rpmpkgRead(item, fdi, l, &msg); + } + } + + if (rc != RPMRC_OK) { + rpmlog(RPMLOG_ERR, _("readRPM: read %s: %s\n"), + (fileName ? fileName : ""), msg); + msg = _free(msg); + return RPMRC_FAIL; + } + msg = _free(msg); + /*@=sizeoftype@*/ + + /* XXX FIXME: EPIPE on */ + if (Fseek(fdi, 0, SEEK_SET) == -1) { + rpmlog(RPMLOG_ERR, _("%s: Fseek failed: %s\n"), + (fileName ? fileName : ""), Fstrerror(fdi)); + return RPMRC_FAIL; + } + + /* Reallocate build data structures */ + spec = newSpec(); + spec->packages = newPackage(spec); + + /* XXX the header just allocated will be allocated again */ + (void)headerFree(spec->packages->header); + spec->packages->header = NULL; + + /* Read the rpm lead, signatures, and header */ + { rpmts ts = rpmtsCreate(); + + /* XXX W2DO? pass fileName? */ + /*@-mustmod@*/ /* LCL: segfault */ + rc = rpmReadPackageFile(ts, fdi, "readRPM", + &spec->packages->header); + /*@=mustmod@*/ + + (void)rpmtsFree(ts); + ts = NULL; + + if (sigs) *sigs = NULL; /* XXX HACK */ + } + + switch (rc) { + case RPMRC_OK: + case RPMRC_NOKEY: + case RPMRC_NOTTRUSTED: + break; + case RPMRC_NOTFOUND: + rpmlog(RPMLOG_ERR, _("readRPM: %s is not an RPM package\n"), + (fileName ? fileName : "")); + return RPMRC_FAIL; + case RPMRC_FAIL: + default: + rpmlog(RPMLOG_ERR, _("readRPM: reading header from %s\n"), + (fileName ? fileName : "")); + return RPMRC_FAIL; + /*@notreached@*/ break; + } + + if (specp) + *specp = spec; + else + spec = freeSpec(spec); + + if (csa != NULL) + csa->cpioFdIn = fdi; + else + (void) Fclose(fdi); + + return 0; +} +#endif + +#if defined(DEAD) +#define RPMPKGVERSION_MIN 30004 +#define RPMPKGVERSION_MAX 40003 +/*@unchecked@*/ +static int rpmpkg_version = -1; + +static int rpmLeadVersion(void) + /*@globals rpmpkg_version, rpmGlobalMacroContext, h_errno @*/ + /*@modifies rpmpkg_version, rpmGlobalMacroContext @*/ +{ + int rpmlead_version; + + /* Intitialize packaging version from macro configuration. */ + if (rpmpkg_version < 0) { + rpmpkg_version = rpmExpandNumeric("%{_package_version}"); + if (rpmpkg_version < RPMPKGVERSION_MIN) + rpmpkg_version = RPMPKGVERSION_MIN; + if (rpmpkg_version > RPMPKGVERSION_MAX) + rpmpkg_version = RPMPKGVERSION_MAX; + } + + rpmlead_version = rpmpkg_version / 10000; + /* XXX silly sanity check. */ + if (rpmlead_version < 3 || rpmlead_version > 4) + rpmlead_version = 3; + return rpmlead_version; +} +#endif + +void providePackageNVR(Header h) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + const char *N, *V, *R; +#ifdef RPM_VENDOR_MANDRIVA + const char *D; + int gotD; +#endif + rpmuint32_t E; + int gotE; + const char *pEVR; + char *p; + rpmuint32_t pFlags = RPMSENSE_EQUAL; + const char ** provides = NULL; + const char ** providesEVR = NULL; + rpmuint32_t * provideFlags = NULL; + int providesCount; + int bingo = 1; + size_t nb; + int xx; + int i; + + /* Generate provides for this package N-V-R. */ + xx = headerNEVRA(h, &N, NULL, &V, &R, NULL); + if (!(N && V && R)) + return; + + nb = 21 + strlen(V) + 1 + strlen(R) + 1; +#ifdef RPM_VENDOR_MANDRIVA + he->tag = RPMTAG_DISTEPOCH; + gotD = headerGet(h, he, 0); + D = (he->p.str ? he->p.str : NULL); + nb += (gotD ? strlen(D) + 1 : 0); +#endif + pEVR = p = alloca(nb); + *p = '\0'; + he->tag = RPMTAG_EPOCH; + gotE = headerGet(h, he, 0); + E = (he->p.ui32p ? he->p.ui32p[0] : 0); + he->p.ptr = _free(he->p.ptr); + if (gotE) { + sprintf(p, "%d:", E); + p += strlen(p); + } + p = stpcpy( stpcpy( stpcpy(p, V) , "-") , R); +#ifdef RPM_VENDOR_MANDRIVA + if (gotD) { + p = stpcpy( stpcpy( p, ":"), D); + D = _free(D); + } +#endif + V = _free(V); + R = _free(R); + + /* + * Rpm prior to 3.0.3 does not have versioned provides. + * If no provides at all are available, we can just add. + */ + he->tag = RPMTAG_PROVIDENAME; +/*@-nullstate@*/ + xx = headerGet(h, he, 0); +/*@=nullstate@*/ + provides = he->p.argv; + providesCount = he->c; + if (!xx) + goto exit; + + /* + * Otherwise, fill in entries on legacy packages. + */ + he->tag = RPMTAG_PROVIDEVERSION; +/*@-nullstate@*/ + xx = headerGet(h, he, 0); +/*@=nullstate@*/ + providesEVR = he->p.argv; + if (!xx) { + for (i = 0; i < providesCount; i++) { + /*@observer@*/ + static const char * vdummy = ""; + static rpmsenseFlags fdummy = RPMSENSE_ANY; + + he->tag = RPMTAG_PROVIDEVERSION; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &vdummy; + he->c = 1; + he->append = 1; +/*@-nullstate@*/ + xx = headerPut(h, he, 0); +/*@=nullstate@*/ + he->append = 0; + + he->tag = RPMTAG_PROVIDEFLAGS; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = (void *) &fdummy; + he->c = 1; + he->append = 1; +/*@-nullstate@*/ + xx = headerPut(h, he, 0); +/*@=nullstate@*/ + he->append = 0; + } + goto exit; + } + + he->tag = RPMTAG_PROVIDEFLAGS; +/*@-nullstate@*/ + xx = headerGet(h, he, 0); +/*@=nullstate@*/ + provideFlags = he->p.ui32p; + + /*@-nullderef@*/ /* LCL: providesEVR is not NULL */ + if (provides && providesEVR && provideFlags) + for (i = 0; i < providesCount; i++) { + if (!(provides[i] && providesEVR[i])) + continue; + if (!(provideFlags[i] == RPMSENSE_EQUAL && + !strcmp(N, provides[i]) && !strcmp(pEVR, providesEVR[i]))) + continue; + bingo = 0; + break; + } + /*@=nullderef@*/ + +exit: +/*@-usereleased@*/ + provides = _free(provides); + providesEVR = _free(providesEVR); + provideFlags = _free(provideFlags); +/*@=usereleased@*/ + + if (bingo) { + he->tag = RPMTAG_PROVIDENAME; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &N; + he->c = 1; + he->append = 1; +/*@-nullstate@*/ + xx = headerPut(h, he, 0); +/*@=nullstate@*/ + he->append = 0; + + he->tag = RPMTAG_PROVIDEVERSION; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &pEVR; + he->c = 1; + he->append = 1; +/*@-nullstate@*/ + xx = headerPut(h, he, 0); +/*@=nullstate@*/ + he->append = 0; + + he->tag = RPMTAG_PROVIDEFLAGS; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &pFlags; + he->c = 1; + he->append = 1; +/*@-nullstate@*/ + xx = headerPut(h, he, 0); +/*@=nullstate@*/ + he->append = 0; + } + N = _free(N); +} + +/** + * Convert hex to binary nibble. + * @param c hex character + * @return binary nibble + */ +static +unsigned char nibble(char c) + /*@*/ +{ + if (c >= '0' && c <= '9') + return (unsigned char) (c - '0'); + if (c >= 'A' && c <= 'F') + return (unsigned char)((int)(c - 'A') + 10); + if (c >= 'a' && c <= 'f') + return (unsigned char)((int)(c - 'a') + 10); + return (unsigned char) '\0'; +} + +rpmRC writeRPM(Header *hdrp, unsigned char ** pkgidp, const char * fn, + CSA_t csa, char * passPhrase, const char ** cookie, void * _dig) + +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + FD_t fd = NULL; + FD_t ifd = NULL; +pgpDig dig = _dig; + rpmuint32_t sigtag; + const char * sigtarget; + const char * rpmio_flags = NULL; + const char * payload_format = NULL; + const char * SHA1 = NULL; + const char * msg = NULL; + char * s; + char buf[BUFSIZ]; + Header h; + Header sigh = NULL; + int addsig = 0; + int isSource; + rpmRC rc = RPMRC_OK; + size_t nbr; + size_t nbw; + int xx; + + /* Transfer header reference form *hdrp to h. */ + h = headerLink(*hdrp); + + (void)headerFree(*hdrp); + *hdrp = NULL; + + if (pkgidp) + *pkgidp = NULL; + + /* Save payload information */ + isSource = + (headerIsEntry(h, RPMTAG_SOURCERPM) == 0 && + headerIsEntry(h, RPMTAG_ARCH) != 0); + if (isSource) { + payload_format = rpmExpand("%{?_source_payload_format}", NULL); + rpmio_flags = rpmExpand("%{?_source_payload}", NULL); + } else { + payload_format = rpmExpand("%{?_binary_payload_format}", NULL); + rpmio_flags = rpmExpand("%{?_binary_payload}", NULL); + } + + if (!(payload_format && *payload_format)) { + payload_format = _free(payload_format); + payload_format = xstrdup("cpio"); + } + if (!(rpmio_flags && *rpmio_flags)) { + rpmio_flags = _free(rpmio_flags); + rpmio_flags = xstrdup("w9.gzdio"); + } + s = strchr(rpmio_flags, '.'); + if (s) { + + if (payload_format) { + if (!strcmp(payload_format, "tar") + || !strcmp(payload_format, "ustar")) { + /* XXX addition to header is too late to be displayed/sorted. */ + /* Add prereq on rpm version that understands tar payloads */ + (void) rpmlibNeedsFeature(h, "PayloadIsUstar", "4.4.4-1"); + } +#if defined(SUPPORT_AR_PAYLOADS) + if (!strcmp(payload_format, "ar")) { + /* XXX addition to header is too late to be displayed/sorted. */ + /* Add prereq on rpm version that understands tar payloads */ + (void) rpmlibNeedsFeature(h, "PayloadIsAr", "5.1-1"); + } +#endif + + he->tag = RPMTAG_PAYLOADFORMAT; + he->t = RPM_STRING_TYPE; + he->p.str = payload_format; + he->c = 1; + xx = headerPut(h, he, 0); + } + + /* XXX addition to header is too late to be displayed/sorted. */ + if (s[1] == 'g' && s[2] == 'z') { + he->tag = RPMTAG_PAYLOADCOMPRESSOR; + he->t = RPM_STRING_TYPE; + he->p.str = xstrdup("gzip"); + he->c = 1; + xx = headerPut(h, he, 0); + he->p.ptr = _free(he->p.ptr); + } else if (s[1] == 'b' && s[2] == 'z') { + he->tag = RPMTAG_PAYLOADCOMPRESSOR; + he->t = RPM_STRING_TYPE; + he->p.str = xstrdup("bzip2"); + he->c = 1; + xx = headerPut(h, he, 0); + he->p.ptr = _free(he->p.ptr); + } else if (s[1] == 'l' && s[2] == 'z') { + he->tag = RPMTAG_PAYLOADCOMPRESSOR; + he->t = RPM_STRING_TYPE; + he->p.str = xstrdup("lzma"); + he->c = 1; + xx = headerPut(h, he, 0); + he->p.ptr = _free(he->p.ptr); + (void) rpmlibNeedsFeature(h, "PayloadIsLzma", "4.4.6-1"); + } else if (s[1] == 'x' && s[2] == 'z') { + he->tag = RPMTAG_PAYLOADCOMPRESSOR; + he->t = RPM_STRING_TYPE; + he->p.str = xstrdup("xz"); + he->c = 1; + xx = headerPut(h, he, 0); + he->p.ptr = _free(he->p.ptr); + (void) rpmlibNeedsFeature(h, "PayloadIsXz", "5.2-1"); + } + strcpy(buf, rpmio_flags); + buf[s - rpmio_flags] = '\0'; + + he->tag = RPMTAG_PAYLOADFLAGS; + he->t = RPM_STRING_TYPE; + he->p.str = buf+1; + he->c = 1; + xx = headerPut(h, he, 0); + } + s = NULL; + + /* Create and add the cookie */ + if (cookie) { + sprintf(buf, "%s %u", buildHost(), (unsigned) (*getBuildTime())); + *cookie = xstrdup(buf); /* XXX memory leak */ + he->tag = RPMTAG_COOKIE; + he->t = RPM_STRING_TYPE; + he->p.str = *cookie; + he->c = 1; + xx = headerPut(h, he, 0); + } + + /* Add the non-repudiable public key (skip if --sign was specified) */ + if (!addsig && dig && dig->pub && dig->publen > 0) { + rpmuint8_t atype = PGPARMOR_PUBKEY; + s = pgpArmorWrap(atype, dig->pub, dig->publen); +assert(s); + he->tag = (rpmTag) RPMTAG_PUBKEYS; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = (const char **) &s; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + s = _free(s); + } + + /* Reallocate the header into one contiguous region. */ + h = headerReload(h, RPMTAG_HEADERIMMUTABLE); + if (h == NULL) { /* XXX can't happen */ + rpmlog(RPMLOG_ERR, _("Unable to create immutable header region.\n")); + rc = RPMRC_FAIL; + goto exit; + } + /* Re-reference reallocated header. */ + *hdrp = headerLink(h); + + /* + * Write the header+archive into a temp file so that the size of + * archive (after compression) can be added to the header. + */ + sigtarget = NULL; + if (rpmTempFile(NULL, &sigtarget, &fd)) { + rpmlog(RPMLOG_ERR, _("Unable to open temp file.\n")); + rc = RPMRC_FAIL; + goto exit; + } + + /* Write the header to a temp file, computing header SHA1 on the fly. */ + fdInitDigest(fd, PGPHASHALGO_SHA1, 0); +assert(fd->ndigests == 1); + { const char item[] = "Header"; + msg = NULL; + rc = rpmpkgWrite(item, fd, h, &msg); + if (rc != RPMRC_OK) { + rpmlog(RPMLOG_ERR, "%s: %s: %s\n", sigtarget, item, + (msg && *msg ? msg : "write failed\n")); + msg = _free(msg); + rc = RPMRC_FAIL; + goto exit; + } + msg = _free(msg); + (void) Fflush(fd); + } + + { /* XXX Dupe the header SHA1 for the RFC 2440/4880 signature. */ + DIGEST_CTX ctx = (dig ? rpmDigestDup(fd->digests[0]) : NULL); +pgpDigParams sigp = pgpGetSignature(dig); + + /* Finalize the header SHA1. */ + /* XXX FIXME: get binary octets, not ASCII. */ + fdFiniDigest(fd, PGPHASHALGO_SHA1, &SHA1, NULL, 1); + +sigp->hash_algo = PGPHASHALGO_SHA1; /* XXX DSA assumed */ +sigp->signhash16[0] = (rpmuint8_t) (nibble(SHA1[0]) << 4) | nibble(SHA1[1]); +sigp->signhash16[1] = (rpmuint8_t) (nibble(SHA1[2]) << 4) | nibble(SHA1[3]); + + /* Sign the header SHA1. */ + if (ctx) + rpmbcExportSignature(dig, ctx); + + } + + /* Append the payload to the temp file. */ + if (csa->fi != NULL) + rc = cpio_doio(fd, h, csa, payload_format, rpmio_flags); + else if (Fileno(csa->cpioFdIn) >= 0) + rc = cpio_copy(fd, csa); + else +assert(0); + + rpmio_flags = _free(rpmio_flags); + payload_format = _free(payload_format); + if (rc != RPMRC_OK) + goto exit; + + (void) Fclose(fd); + fd = NULL; + (void) Unlink(fn); + + /* Generate the signature */ + (void) fflush(stdout); + sigh = headerNew(); + (void) rpmAddSignature(sigh, sigtarget, RPMSIGTAG_SIZE, passPhrase); + (void) rpmAddSignature(sigh, sigtarget, RPMSIGTAG_MD5, passPhrase); + + sigtag = RPMSIGTAG_GPG; + addsig = (passPhrase && passPhrase[0]); + + if (addsig) { + rpmlog(RPMLOG_NOTICE, _("Generating signature: %d\n"), sigtag); + (void) rpmAddSignature(sigh, sigtarget, sigtag, passPhrase); + } + else if (dig && dig->sig && dig->siglen > 0) { + he->tag = (rpmTag) RPMSIGTAG_DSA; /* XXX DSA assumed */ + he->t = RPM_BIN_TYPE; + he->p.ptr = (void *) dig->sig; + he->c = dig->siglen; + xx = headerPut(sigh, he, 0); + dig->sig = _free(dig->sig); /* XXX lazily instead? */ + dig->siglen = 0; + } + + if (SHA1) { + he->tag = (rpmTag) RPMSIGTAG_SHA1; + he->t = RPM_STRING_TYPE; + he->p.str = SHA1; + he->c = 1; + xx = headerPut(sigh, he, 0); + SHA1 = _free(SHA1); + } + + { rpmuint32_t payloadSize = csa->cpioArchiveSize; + he->tag = (rpmTag) RPMSIGTAG_PAYLOADSIZE; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &payloadSize; + he->c = 1; + xx = headerPut(sigh, he, 0); + } + + /* Reallocate the signature header into one contiguous region. */ + sigh = headerReload(sigh, RPMTAG_HEADERSIGNATURES); + if (sigh == NULL) { /* XXX can't happen */ + rpmlog(RPMLOG_ERR, _("Unable to reload signature header.\n")); + rc = RPMRC_FAIL; + goto exit; + } + + /* Pad the signature header to put the metadata header at known offset. */ + { size_t slen = 0; + void * uh = headerUnload(sigh, &slen); + static const size_t align = 1024; + size_t nb = align - 96 - 16 - 16; + rpmuint8_t * b; + + uh = _free(uh); +assert(slen < nb); + nb -= slen; + b = memset(alloca(nb), 0, nb); + he->tag = (rpmTag) RPMSIGTAG_PADDING; + he->t = RPM_BIN_TYPE; + he->p.ui8p = b; + he->c = nb; + xx = headerPut(sigh, he, 0); + sigh = headerReload(sigh, RPMTAG_HEADERSIGNATURES); +assert(sigh != NULL); + } + + /* Open the output file */ + fd = Fopen(fn, "w.fdio"); + if (fd == NULL || Ferror(fd)) { + rpmlog(RPMLOG_ERR, _("Could not open %s: %s\n"), + fn, Fstrerror(fd)); + rc = RPMRC_FAIL; + goto exit; + } + + /* Write the lead section into the package. */ + { const char item[] = "Lead"; + size_t nl = rpmpkgSizeof(item, NULL); + + msg = NULL; + if (nl == 0) + rc = RPMRC_FAIL; + else { + void * l = memset(alloca(nl), 0, nl); + const char *N, *V, *R; + (void) headerNEVRA(h, &N, NULL, &V, &R, NULL); + sprintf(buf, "%s-%s-%s", N, V, R); + N = _free(N); + V = _free(V); + R = _free(R); + msg = buf; + rc = rpmpkgWrite(item, fd, l, &msg); + } + + if (rc != RPMRC_OK) { + rpmlog(RPMLOG_ERR, _("Unable to write package: %s\n"), + Fstrerror(fd)); + rc = RPMRC_FAIL; + goto exit; + } + } + + /* Write the signature section into the package. */ + { const char item[] = "Signature"; + + msg = NULL; + rc = rpmpkgWrite(item, fd, sigh, &msg); + if (rc != RPMRC_OK) { + rpmlog(RPMLOG_ERR, "%s: %s: %s\n", fn, item, + (msg && *msg ? msg : "write failed\n")); + msg = _free(msg); + rc = RPMRC_FAIL; + goto exit; + } + msg = _free(msg); + } + + /* Append the header and archive */ + ifd = Fopen(sigtarget, "r.fdio"); + if (ifd == NULL || Ferror(ifd)) { + rpmlog(RPMLOG_ERR, _("Unable to open sigtarget %s: %s\n"), + sigtarget, Fstrerror(ifd)); + rc = RPMRC_FAIL; + goto exit; + } + + /* Add signatures to header, and write header into the package. */ + { const char item[] = "Header"; + Header nh = NULL; + + msg = NULL; + rc = rpmpkgRead(item, ifd, &nh, &msg); + if (rc != RPMRC_OK) { + rpmlog(RPMLOG_ERR, "%s: %s: %s\n", sigtarget, item, + (msg && *msg ? msg : "read failed\n")); + msg = _free(msg); + rc = RPMRC_FAIL; + goto exit; + } + msg = _free(msg); + +#ifdef NOTYET + (void) headerMergeLegacySigs(nh, sigh); +#endif + + msg = NULL; + rc = rpmpkgWrite(item, fd, nh, &msg); + (void)headerFree(nh); + nh = NULL; + if (rc != RPMRC_OK) { + rpmlog(RPMLOG_ERR, "%s: %s: %s\n", fn, item, + (msg && *msg ? msg : "write failed\n")); + msg = _free(msg); + rc = RPMRC_FAIL; + goto exit; + } + msg = _free(msg); + } + + /* Write the payload into the package. */ + while ((nbr = Fread(buf, sizeof(buf[0]), sizeof(buf), ifd)) > 0) { + if (Ferror(ifd)) { + rpmlog(RPMLOG_ERR, _("Unable to read payload from %s: %s\n"), + sigtarget, Fstrerror(ifd)); + rc = RPMRC_FAIL; + goto exit; + } + nbw = (int)Fwrite(buf, sizeof(buf[0]), nbr, fd); + if (nbr != nbw || Ferror(fd)) { + rpmlog(RPMLOG_ERR, _("Unable to write payload to %s: %s\n"), + fn, Fstrerror(fd)); + rc = RPMRC_FAIL; + goto exit; + } + } + rc = RPMRC_OK; + +exit: + SHA1 = _free(SHA1); + (void)headerFree(h); + h = NULL; + + /* XXX Fish the pkgid out of the signature header. */ + if (sigh != NULL && pkgidp != NULL) { + he->tag = (rpmTag) RPMSIGTAG_MD5; + xx = headerGet(sigh, he, 0); + if (he->t == RPM_BIN_TYPE && he->p.ptr != NULL && he->c == 16) + *pkgidp = he->p.ui8p; /* XXX memory leak */ + } + + (void)headerFree(sigh); + sigh = NULL; + if (ifd) { + (void) Fclose(ifd); + ifd = NULL; + } + if (fd) { + (void) Fclose(fd); + fd = NULL; + } + if (sigtarget) { + (void) Unlink(sigtarget); + sigtarget = _free(sigtarget); + } + + if (rc == RPMRC_OK) + rpmlog(RPMLOG_NOTICE, _("Wrote: %s\n"), fn); + else + (void) Unlink(fn); + + return rc; +} + +static int rpmlibMarkers(Header h) + /*@modifies h @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmuint32_t val; + int xx; + + he->tag = RPMTAG_RPMVERSION; + he->t = RPM_STRING_TYPE; + he->p.str = xstrdup(VERSION); + he->c = 1; + xx = headerPut(h, he, 0); + he->p.ptr = _free(he->p.ptr); + + if (!(_rpmbuildFlags & 4)) { + val = (rpmuint32_t)rpmlibTimestamp(); + he->tag = RPMTAG_RPMLIBTIMESTAMP; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &val; + he->c = 1; + xx = headerPut(h, he, 0); + + val = (rpmuint32_t)rpmlibVendor(); + he->tag = RPMTAG_RPMLIBVENDOR; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &val; + he->c = 1; + xx = headerPut(h, he, 0); + + val = (rpmuint32_t)rpmlibVersion(); + he->tag = RPMTAG_RPMLIBVERSION; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &val; + he->c = 1; + xx = headerPut(h, he, 0); + } + + he->tag = RPMTAG_BUILDHOST; + he->t = RPM_STRING_TYPE; + he->p.str = buildHost(); + he->c = 1; + xx = headerPut(h, he, 0); + + he->tag = RPMTAG_BUILDTIME; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = getBuildTime(); + he->c = 1; + xx = headerPut(h, he, 0); + + return 0; +} + +/*@unchecked@*/ +static rpmTag copyTags[] = { + RPMTAG_CHANGELOGTIME, + RPMTAG_CHANGELOGNAME, + RPMTAG_CHANGELOGTEXT, + 0 +}; + +rpmRC packageBinaries(Spec spec) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + struct cpioSourceArchive_s csabuf; + CSA_t csa = &csabuf; + const char *errorString; + Package pkg; + rpmRC rc = RPMRC_OK; /* assume success */ + int xx; + + for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { + const char *fn; + + if (pkg->fileList == NULL) + continue; + + if (spec->cookie) { + he->tag = RPMTAG_COOKIE; + he->t = RPM_STRING_TYPE; + he->p.str = spec->cookie; + he->c = 1; + xx = headerPut(pkg->header, he, 0); + } + + /* Copy changelog from src rpm */ + headerCopyTags(spec->packages->header, pkg->header, copyTags); + + /* Add rpmlib markers for tracking. */ + (void) rpmlibMarkers(pkg->header); + + he->tag = RPMTAG_OPTFLAGS; + he->t = RPM_STRING_TYPE; + he->p.str = rpmExpand("%{optflags}", NULL); + he->c = 1; + xx = headerPut(pkg->header, he, 0); + he->p.ptr = _free(he->p.ptr); + +if (!(_rpmbuildFlags & 4)) { + if (spec->sourcePkgId != NULL) { + he->tag = RPMTAG_SOURCEPKGID; + he->t = RPM_BIN_TYPE; + he->p.ptr = spec->sourcePkgId; + he->c = 16; + xx = headerPut(pkg->header, he, 0); + } +} + + { const char *binFormat = rpmGetPath("%{_rpmfilename}", NULL); + char *binRpm, *binDir; + binRpm = headerSprintf(pkg->header, binFormat, NULL, + rpmHeaderFormats, &errorString); + binFormat = _free(binFormat); + if (binRpm == NULL) { + he->tag = RPMTAG_NVRA; + xx = headerGet(pkg->header, he, 0); + rpmlog(RPMLOG_ERR, _("Could not generate output " + "filename for package %s: %s\n"), he->p.str, errorString); + he->p.ptr = _free(he->p.ptr); + rc = RPMRC_FAIL; + goto exit; + } + fn = rpmGetPath("%{_rpmdir}/", binRpm, NULL); + if ((binDir = strchr(binRpm, '/')) != NULL) { + struct stat st; + const char *dn; + *binDir = '\0'; + dn = rpmGetPath("%{_rpmdir}/", binRpm, NULL); + if (Stat(dn, &st) < 0) { + switch(errno) { + case ENOENT: + if (rpmioMkpath(dn, 0755, -1, -1) == 0) + /*@switchbreak@*/ break; + /*@fallthrough@*/ + default: + rpmlog(RPMLOG_ERR,_("cannot create %s: %s\n"), + dn, strerror(errno)); + /*@switchbreak@*/ break; + } + } + dn = _free(dn); + } + binRpm = _free(binRpm); + } + + memset(csa, 0, sizeof(*csa)); + csa->cpioArchiveSize = 0; + /*@-type@*/ /* LCL: function typedefs */ +/*@-onlytrans@*/ + csa->cpioFdIn = fdNew("init (packageBinaries)"); +/*@=onlytrans@*/ +/*@-assignexpose -newreftrans@*/ + csa->fi = rpmfiLink(pkg->fi, "packageBinaries"); +/*@=assignexpose =newreftrans@*/ +assert(csa->fi != NULL); + + rc = writeRPM(&pkg->header, NULL, fn, + csa, spec->passPhrase, NULL, spec->dig); + +/*@-onlytrans@*/ + csa->fi->te = _free(csa->fi->te); /* XXX memory leak */ +/*@=onlytrans@*/ + csa->fi = rpmfiFree(csa->fi); +/*@-nullpass -onlytrans -refcounttrans @*/ + csa->cpioFdIn = fdFree(csa->cpioFdIn, "init (packageBinaries)"); +/*@=nullpass =onlytrans =refcounttrans @*/ + /*@=type@*/ + fn = _free(fn); + if (rc) + goto exit; + } + +exit: + + return rc; +} + +rpmRC packageSources(Spec spec) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + struct cpioSourceArchive_s csabuf; + CSA_t csa = &csabuf; + rpmRC rc; + int xx; +#if defined(RPM_VENDOR_OPENPKG) || defined(RPM_VENDOR_FEDORA) || defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_ARK) /* backward-compat-rpmtag-sourcepackage */ + rpmuint32_t val; +#endif + + /* Add rpmlib markers for tracking. */ + (void) rpmlibMarkers(spec->sourceHeader); + +#if defined(RPM_VENDOR_OPENPKG) || defined(RPM_VENDOR_FEDORA) || defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_ARK) /* backward-compat-rpmtag-sourcepackage */ + /* Mark package as a SRPM for backward compatibility with RPM < 4.4.6 */ + he->tag = RPMTAG_SOURCEPACKAGE; + he->t = RPM_UINT32_TYPE; + val = 1; + he->p.ui32p = &val; + he->c = 1; + xx = headerPut(spec->sourceHeader, he, 0); +#endif + + /* Add build scriptlet status/time (if any) to SRPM's. */ + { int ix; + for (ix = 0; ix < RPMSCRIPT_MAX; ix++) { + if (spec->sstates[ix] == 0) + continue; + if (spec->smetrics[ix] == 0) + continue; + break; + } + if (ix >= 0 && ix < RPMSCRIPT_MAX) { + he->tag = RPMTAG_SCRIPTSTATES; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = spec->sstates; + he->c = RPMSCRIPT_MAX; + xx = headerPut(spec->sourceHeader, he, 0); + he->tag = RPMTAG_SCRIPTMETRICS; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = spec->smetrics; + he->c = RPMSCRIPT_MAX; + xx = headerPut(spec->sourceHeader, he, 0); + } + } + + /* Add macros used during build to SRPM's. */ + { const char ** av = NULL; + (void)rpmGetMacroEntries(NULL, NULL, 1, &av); + if (av != NULL && av[0] != NULL) { + he->tag = RPMTAG_BUILDMACROS; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = av; + he->c = argvCount(av); + xx = headerPut(spec->sourceHeader, he, 0); + } +/*@-nullstate@*/ + av = argvFree(av); +/*@=nullstate@*/ + } + + spec->cookie = _free(spec->cookie); + + /* XXX this should be %_srpmdir */ + { const char *srcrpmdir = rpmGetPath("%{_srcrpmdir}/", NULL); + const char *fn = rpmGetPath("%{_srcrpmdir}/", spec->sourceRpmName,NULL); + + rc = rpmioMkpath(srcrpmdir, 0755, -1, -1); + + memset(csa, 0, sizeof(*csa)); + csa->cpioArchiveSize = 0; + /*@-type@*/ /* LCL: function typedefs */ +/*@-onlytrans@*/ + csa->cpioFdIn = fdNew("init (packageSources)"); +/*@=onlytrans@*/ +/*@-assignexpose -newreftrans@*/ + csa->fi = rpmfiLink(spec->fi, "packageSources"); +/*@=assignexpose =newreftrans@*/ +#ifdef DYING +assert(csa->fi != NULL); +#else + if (csa->fi == NULL) /* XXX segfault avoidance */ + return RPMRC_FAIL; +#endif + + spec->sourcePkgId = NULL; + rc = writeRPM(&spec->sourceHeader, &spec->sourcePkgId, fn, + csa, spec->passPhrase, &spec->cookie, spec->dig); + +/*@-onlytrans@*/ + csa->fi->te = _free(csa->fi->te); /* XXX memory leak */ +/*@=onlytrans@*/ + csa->fi = rpmfiFree(csa->fi); +/*@-nullpass -onlytrans -refcounttrans @*/ + csa->cpioFdIn = fdFree(csa->cpioFdIn, "init (packageSources)"); +/*@=nullpass =onlytrans =refcounttrans @*/ + /*@=type@*/ + srcrpmdir = _free(srcrpmdir); + fn = _free(fn); + } + + rc = (rc ? RPMRC_FAIL : RPMRC_OK); + + return rc; +} diff --git a/rpm-5.4.9/build/parseBuildInstallClean.c b/rpm-5.4.9/build/parseBuildInstallClean.c new file mode 100644 index 0000000..aeb6c39 --- /dev/null +++ b/rpm-5.4.9/build/parseBuildInstallClean.c @@ -0,0 +1,91 @@ +/** \ingroup rpmbuild + * \file build/parseBuildInstallClean.c + * Parse %build/%install/%clean section from spec file. + */ +#include "system.h" + +#include +#include +#include +#define _RPMTAG_INTERNAL +#include "rpmbuild.h" +#include "debug.h" + +int parseBuildInstallClean(Spec spec, rpmParseState parsePart) +{ + rpmParseState nextPart; + rpmiob *iobp = NULL; + const char *name = NULL; + rpmRC rc; + + switch (parsePart) { + case PART_BUILD: + iobp = &spec->build; + name = "build"; + break; + case PART_INSTALL: + iobp = &spec->install; + name = "install"; + break; + case PART_CHECK: + iobp = &spec->check; + name = "check"; + break; + case PART_CLEAN: + iobp = &spec->clean; + name = "clean"; + break; + case PART_ARBITRARY: +assert(spec->nfoo > 0); + iobp = &spec->foo[spec->nfoo-1].iob; + name = spec->foo[spec->nfoo-1].str; + break; + default: + rpmlog(RPMLOG_ERR, _("line %d: unknown specfile section\n"), + spec->lineNum); + return RPMRC_FAIL; + break; + } + + if (*iobp != NULL) { + rpmlog(RPMLOG_ERR, _("line %d: second %%%s section\n"), + spec->lineNum, name); + return RPMRC_FAIL; + } + + *iobp = rpmiobNew(0); + + /* Make sure the buildroot is removed where needed. */ + if (parsePart == PART_INSTALL) { + const char * s = rpmExpand("%{!?__spec_install_pre:%{?buildroot:%{__rm} -rf '%{buildroot}'\n%{__mkdir_p} '%{buildroot}'\n}}\n", NULL); + if (s && *s) + *iobp = rpmiobAppend(*iobp, s, 0); + s = _free(s); + } else if (parsePart == PART_CLEAN) { + const char * s = rpmExpand("%{?__spec_clean_body}%{!?__spec_clean_body:%{?buildroot:rm -rf '%{buildroot}'\n}}\n", NULL); + if (s && *s) + *iobp = rpmiobAppend(*iobp, s, 0); + s = _free(s); +#if !defined(RPM_VENDOR_OPENPKG) /* still-support-section-clean */ + /* OpenPKG still wishes to use "%clean" script/section */ + iobp = NULL; /* XXX skip %clean from spec file. */ +#endif + } + + /* There are no options to %build, %install, %check, or %clean */ + if ((rc = readLine(spec, STRIP_NOTHING)) > 0) + return PART_NONE; + if (rc != RPMRC_OK) + return rc; + + while ((nextPart = isPart(spec)) == PART_NONE) { + if (iobp) + *iobp = rpmiobAppend(*iobp, spec->line, 0); + if ((rc = readLine(spec, STRIP_NOTHING)) > 0) + return PART_NONE; + if (rc) + return rc; + } + + return nextPart; +} diff --git a/rpm-5.4.9/build/parseChangelog.c b/rpm-5.4.9/build/parseChangelog.c new file mode 100644 index 0000000..50964f6 --- /dev/null +++ b/rpm-5.4.9/build/parseChangelog.c @@ -0,0 +1,303 @@ +/** \ingroup rpmbuild + * \file build/parseChangelog.c + * Parse %changelog section from spec file. + */ + +#include "system.h" + +#include +#include +#include +#include "rpmbuild.h" +#include "debug.h" + +#define mySKIPSPACE(s) { while (*(s) && isspace(*(s))) (s)++; } +#define mySKIPNONSPACE(s) { while (*(s) && !isspace(*(s))) (s)++; } + +void addChangelogEntry(Header h, time_t time, const char *name, const char *text) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmuint32_t mytime = (rpmuint32_t)time; /* XXX convert to rpmuint32_t for header */ + int xx; + + he->tag = RPMTAG_CHANGELOGTIME; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &mytime; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + + he->tag = RPMTAG_CHANGELOGNAME; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &name; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + + he->tag = RPMTAG_CHANGELOGTEXT; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &text; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; +} + +/** + * Parse date string to seconds. + * @param datestr date string (e.g. 'Wed Jan 1 1997') + * @retval secs secs since the unix epoch + * @return 0 on success, -1 on error + */ +static int dateToTimet(const char * datestr, /*@out@*/ time_t * secs) + /*@modifies *secs @*/ +{ + struct tm time; + time_t timezone_offset; + char * p, * pe, * q, ** idx; + char * date = strcpy(alloca(strlen(datestr) + 1), datestr); +/*@observer@*/ static char * days[] = + { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", NULL }; +/*@observer@*/ static char * months[] = + { "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", NULL }; +/*@observer@*/ static char lengths[] = + { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; + + memset(&time, 0, sizeof(time)); + + pe = date; + + /* day of week */ + p = pe; mySKIPSPACE(p); + if (*p == '\0') return -1; + pe = p; mySKIPNONSPACE(pe); if (*pe != '\0') *pe++ = '\0'; + for (idx = days; *idx && strcmp(*idx, p); idx++) + {}; + if (*idx == NULL) return -1; + + /* month */ + p = pe; mySKIPSPACE(p); + if (*p == '\0') return -1; + pe = p; mySKIPNONSPACE(pe); if (*pe != '\0') *pe++ = '\0'; + for (idx = months; *idx && strcmp(*idx, p); idx++) + {}; + if (*idx == NULL) return -1; + time.tm_mon = idx - months; + + /* day */ + p = pe; mySKIPSPACE(p); + if (*p == '\0') return -1; + pe = p; mySKIPNONSPACE(pe); if (*pe != '\0') *pe++ = '\0'; + + /* make this noon so the day is always right (as we make this UTC) */ + time.tm_hour = 12; + + time.tm_mday = strtol(p, &q, 10); + if (!(q && *q == '\0')) return -1; + if (time.tm_mday < 0 || time.tm_mday > lengths[time.tm_mon]) return -1; + + /* year */ + p = pe; mySKIPSPACE(p); + if (*p == '\0') return -1; + pe = p; mySKIPNONSPACE(pe); if (*pe != '\0') *pe++ = '\0'; + time.tm_year = strtol(p, &q, 10); + if (!(q && *q == '\0')) return -1; + if (time.tm_year < 1990 || time.tm_year >= 3000) return -1; + time.tm_year -= 1900; + + *secs = mktime(&time); + if (*secs == -1) return -1; + + /* determine timezone offset */ +/*@-nullpass@*/ /* gmtime(3) unlikely to return NULL soon. */ + timezone_offset = mktime(gmtime(secs)) - *secs; +/*@=nullpass@*/ + + /* adjust to UTC */ + *secs += timezone_offset; + + return 0; +} + +/*@-redecl@*/ +extern time_t get_date(const char * p, void * now); /* XXX expedient lies */ +/*@=redecl@*/ + +/** + * Add %changelog section to header. + * @param h header + * @param iob changelog strings + * @return RPMRC_OK on success + */ +static rpmRC addChangelog(Header h, rpmiob iob) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies h, rpmGlobalMacroContext, internalState @*/ +{ + char * s = rpmiobStr(iob); + char * se; + char *date, *name, *text; + int i; + time_t time; + time_t lastTime = 0; + int nentries = 0; + static time_t last = 0; + static int oneshot = 0; + + /* Determine changelog truncation criteria. */ + if (!oneshot++) { + char * t = rpmExpand("%{?_changelog_truncate}", NULL); + char *te = NULL; + if (t && *t) { + long res = strtol(t, &te, 0); + if (res >= 0 && *te == '\0') { + last = res; /* truncate to no. of entries. */ + } else { +/*@-moduncon@*/ + res = (long)get_date (t, NULL); +/*@=moduncon@*/ + /* XXX malformed date string silently ignored. */ + if (res > 0) { + last = res; /* truncate to date. */ + } + } + } + t = _free(t); + } + + /* skip space */ + mySKIPSPACE(s); + + while (*s != '\0') { + if (*s != '*') { + rpmlog(RPMLOG_ERR, + _("%%changelog entries must start with *\n")); + return RPMRC_FAIL; + } + + /* find end of line */ + date = s; + while(*s && *s != '\n') s++; + if (! *s) { + rpmlog(RPMLOG_ERR, _("incomplete %%changelog entry\n")); + return RPMRC_FAIL; + } +/*@-modobserver@*/ + *s = '\0'; +/*@=modobserver@*/ + text = s + 1; + + /* 4 fields of date */ + date++; + s = date; + for (i = 0; i < 4; i++) { + mySKIPSPACE(s); + mySKIPNONSPACE(s); + } + mySKIPSPACE(date); + if (dateToTimet(date, &time)) { + rpmlog(RPMLOG_ERR, _("bad date in %%changelog: %s\n"), date); + return RPMRC_FAIL; + } + if (lastTime && lastTime < time) { + rpmlog(RPMLOG_ERR, + _("%%changelog not in descending chronological order\n")); + return RPMRC_FAIL; + } + lastTime = time; + + /* skip space to the name */ + mySKIPSPACE(s); + if (! *s) { + rpmlog(RPMLOG_ERR, _("missing name in %%changelog\n")); + return RPMRC_FAIL; + } + + /* name */ + name = s; + while (*s != '\0') s++; + while (s > name && isspace(*s)) + *s-- = '\0'; + + if (s == name) { + rpmlog(RPMLOG_ERR, _("missing name in %%changelog\n")); + return RPMRC_FAIL; + } + + /* text */ + mySKIPSPACE(text); + if (! *text) { + rpmlog(RPMLOG_ERR, _("no description in %%changelog\n")); + return RPMRC_FAIL; + } + + /* find the next leading '*' (or eos) */ + s = text; + do { + s++; + } while (*s && (*(s-1) != '\n' || *s != '*')); + se = s; + s--; + + /* backup to end of description */ + while ((s > text) && xisspace(*s)) + *s-- = '\0'; + + /* Add entry if not truncated. */ + nentries++; + + if (last <= 0 + || (last < 1000 && nentries < (int)last) + || (last > 1000 && time >= last)) + addChangelogEntry(h, time, name, text); + + s = se; + + } + + return 0; +} + +int parseChangelog(Spec spec) +{ + rpmParseState nextPart; + rpmiob iob = rpmiobNew(0); + rpmRC rc; + + /* There are no options to %changelog */ + if ((rc = readLine(spec, STRIP_COMMENTS)) > 0) { + iob = rpmiobFree(iob); +#if defined(RPM_VENDOR_MANDRIVA) + return (spec->clean == NULL) ? PART_CLEAN : PART_NONE; +#else + return PART_NONE; +#endif + } + if (rc != RPMRC_OK) + return rc; + + while ((nextPart = isPart(spec)) == PART_NONE) { + const char * line; + line = xstrdup(spec->line); + line = xstrtolocale(line); + iob = rpmiobAppend(iob, spec->line, 0); + line = _free(line); + if ((rc = readLine(spec, STRIP_COMMENTS | STRIP_NOEXPAND)) > 0) { +#if defined(RPM_VENDOR_MANDRIVA) + nextPart = (spec->clean == NULL) ? PART_CLEAN : PART_NONE; +#else + nextPart = PART_NONE; +#endif + break; + } + if (rc != RPMRC_OK) + return rc; + } + + rc = addChangelog(spec->packages->header, iob); + iob = rpmiobFree(iob); + + return (rc != RPMRC_OK ? rc : (rpmRC)nextPart); +} diff --git a/rpm-5.4.9/build/parseDescription.c b/rpm-5.4.9/build/parseDescription.c new file mode 100644 index 0000000..3eadc35 --- /dev/null +++ b/rpm-5.4.9/build/parseDescription.c @@ -0,0 +1,150 @@ +/** \ingroup rpmbuild + * \file build/parseDescription.c + * Parse %description section from spec file. + */ + +#include "system.h" + +#include +#include +#include +#include "rpmbuild.h" +#include "debug.h" + +/*@-exportheadervar@*/ +/*@unchecked@*/ +extern int noLang; +/*@=exportheadervar@*/ + +/* These have to be global scope to make up for *stupid* compilers */ +/*@unchecked@*/ + /*@observer@*/ /*@null@*/ static const char *name = NULL; +/*@unchecked@*/ + /*@observer@*/ /*@null@*/ static const char *lang = NULL; + +/*@unchecked@*/ + static struct poptOption optionsTable[] = { + { NULL, 'n', POPT_ARG_STRING, &name, 0, NULL, NULL}, + { NULL, 'l', POPT_ARG_STRING, &lang, 0, NULL, NULL}, + { 0, 0, 0, 0, 0, NULL, NULL} + }; + +int parseDescription(Spec spec) + /*@globals name, lang @*/ + /*@modifies name, lang @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmParseState nextPart = (rpmParseState) RPMRC_FAIL; /* assume error */ + rpmiob iob = NULL; + int flag = PART_SUBNAME; + Package pkg; + int rc, argc; + int arg; + const char **argv = NULL; + poptContext optCon = NULL; + spectag t = NULL; + int xx; + + { char * se = strchr(spec->line, '#'); + if (se) { + *se = '\0'; + while (--se >= spec->line && strchr(" \t\n\r", *se) != NULL) + *se = '\0'; + } + } + + if ((rc = poptParseArgvString(spec->line, &argc, &argv))) { + rpmlog(RPMLOG_ERR, _("line %d: Error parsing %%description: %s\n"), + spec->lineNum, poptStrerror(rc)); + goto exit; + } + + name = NULL; + lang = RPMBUILD_DEFAULT_LANG; + optCon = poptGetContext(NULL, argc, argv, optionsTable, 0); + while ((arg = poptGetNextOpt(optCon)) > 0) + {;} + if (name != NULL) + flag = PART_NAME; + + if (arg < -1) { + rpmlog(RPMLOG_ERR, _("line %d: Bad option %s: %s\n"), + spec->lineNum, + poptBadOption(optCon, POPT_BADOPTION_NOALIAS), + spec->line); + goto exit; + } + + if (poptPeekArg(optCon)) { + if (name == NULL) + name = poptGetArg(optCon); + if (poptPeekArg(optCon)) { + rpmlog(RPMLOG_ERR, _("line %d: Too many names: %s\n"), + spec->lineNum, spec->line); + goto exit; + } + } + + if (lookupPackage(spec, name, flag, &pkg) != RPMRC_OK) { + rpmlog(RPMLOG_ERR, _("line %d: Package does not exist: %s\n"), + spec->lineNum, spec->line); + goto exit; + } + + /* Lose the inheirited %description (if present). */ + if (spec->packages->header != pkg->header) { + he->tag = RPMTAG_DESCRIPTION; + xx = headerGet(pkg->header, he, 0); + he->p.ptr = _free(he->p.ptr); + if (xx && he->t == RPM_STRING_TYPE) + xx = headerDel(pkg->header, he, 0); + } + + t = stashSt(spec, pkg->header, RPMTAG_DESCRIPTION, lang); + + iob = rpmiobNew(0); + + if ((rc = readLine(spec, STRIP_TRAILINGSPACE | STRIP_COMMENTS)) > 0) { + nextPart = PART_NONE; + goto exit; + } + if (rc < 0) { + nextPart = (rpmParseState) RPMRC_FAIL; + goto exit; + } + + while ((nextPart = isPart(spec)) == PART_NONE) { + iob = rpmiobAppend(iob, spec->line, 1); + if (t) t->t_nlines++; + if ((rc = readLine(spec, STRIP_TRAILINGSPACE | STRIP_COMMENTS)) > 0) { + nextPart = PART_NONE; + break; + } + if (rc) { + nextPart = (rpmParseState) RPMRC_FAIL; + goto exit; + } + } + + iob = rpmiobRTrim(iob); + if (!(noLang && strcmp(lang, RPMBUILD_DEFAULT_LANG))) { +#if defined(SUPPORT_I18NSTRING_TYPE) + const char * s = rpmiobStr(iob); + (void) headerAddI18NString(pkg->header, RPMTAG_DESCRIPTION, s, lang); +#else + if (!strcmp(lang, RPMBUILD_DEFAULT_LANG)) { + he->tag = RPMTAG_DESCRIPTION; + he->t = RPM_STRING_TYPE; + he->p.str = rpmiobStr(iob); + he->c = 1; + xx = headerPut(pkg->header, he, 0); + } +#endif + } + +exit: + iob = rpmiobFree(iob); + argv = _free(argv); + optCon = poptFreeContext(optCon); + return nextPart; +} diff --git a/rpm-5.4.9/build/parseFiles.c b/rpm-5.4.9/build/parseFiles.c new file mode 100644 index 0000000..9366cf3 --- /dev/null +++ b/rpm-5.4.9/build/parseFiles.c @@ -0,0 +1,129 @@ +/** \ingroup rpmbuild + * \file build/parseFiles.c + * Parse %files section from spec file. + */ + +#include "system.h" + +#include +#include +#include +#include "rpmbuild.h" +#include "debug.h" + +/*@access poptContext @*/ /* compared with NULL */ + +/* These have to be global scope to make up for *stupid* compilers */ +/*@unchecked@*/ + /*@observer@*/ /*@null@*/ static const char *name = NULL; +/*@unchecked@*/ + /*@observer@*/ /*@null@*/ static const char *file = NULL; +/*@unchecked@*/ + static struct poptOption optionsTable[] = { + { NULL, 'n', POPT_ARG_STRING, &name, 'n', NULL, NULL}, + { NULL, 'f', POPT_ARG_STRING, &file, 'f', NULL, NULL}, + { 0, 0, 0, 0, 0, NULL, NULL} + }; + +int parseFiles(Spec spec) +{ + rpmParseState nextPart; + Package pkg; + int rc, argc; + int arg; + const char ** argv = NULL; + int flag = PART_SUBNAME; + poptContext optCon = NULL; + + /*@-mods@*/ + name = NULL; + file = NULL; + /*@=mods@*/ + + if ((rc = poptParseArgvString(spec->line, &argc, &argv))) { + rpmlog(RPMLOG_ERR, _("line %d: Error parsing %%files: %s\n"), + spec->lineNum, poptStrerror(rc)); + rc = RPMRC_FAIL; + goto exit; + } + + optCon = poptGetContext(NULL, argc, argv, optionsTable, 0); + while ((arg = poptGetNextOpt(optCon)) > 0) { + if (arg == 'n') { + flag = PART_NAME; + } + } + + if (arg < -1) { + rpmlog(RPMLOG_ERR, _("line %d: Bad option %s: %s\n"), + spec->lineNum, + poptBadOption(optCon, POPT_BADOPTION_NOALIAS), + spec->line); + rc = RPMRC_FAIL; + goto exit; + } + + if (poptPeekArg(optCon)) { + /*@-mods@*/ + if (name == NULL) + name = poptGetArg(optCon); + /*@=mods@*/ + if (poptPeekArg(optCon)) { + rpmlog(RPMLOG_ERR, _("line %d: Too many names: %s\n"), + spec->lineNum, + spec->line); + rc = RPMRC_FAIL; + goto exit; + } + } + + if (lookupPackage(spec, name, flag, &pkg) != RPMRC_OK) { + rpmlog(RPMLOG_ERR, _("line %d: Package does not exist: %s\n"), + spec->lineNum, spec->line); + rc = RPMRC_FAIL; + goto exit; + } + + if (pkg->fileList != NULL) { + rpmlog(RPMLOG_ERR, _("line %d: Second %%files list\n"), + spec->lineNum); + rc = RPMRC_FAIL; + goto exit; + } + + if (file) { + /* XXX not necessary as readline has expanded already, but won't hurt. */ + pkg->fileFile = rpmGetPath(file, NULL); + } + + pkg->fileList = rpmiobNew(0); + + if ((rc = readLine(spec, STRIP_COMMENTS)) > 0) { + nextPart = PART_NONE; + } else { + if (rc) + goto exit; + while ((nextPart = isPart(spec)) == PART_NONE) { + pkg->fileList = rpmiobAppend(pkg->fileList, spec->line, 0); + if ((rc = readLine(spec, STRIP_COMMENTS)) > 0) { + nextPart = PART_NONE; + break; + } + if (rc) + goto exit; + } + } + +#if defined(RPM_VENDOR_MANDRIVA) + /* if no %clean section, add implicit */ + rc = (nextPart == PART_NONE && spec->clean == NULL) ? PART_CLEAN : nextPart; +#else + rc = nextPart; +#endif + +exit: + argv = _free(argv); + optCon = poptFreeContext(optCon); + + return rc; +} diff --git a/rpm-5.4.9/build/parsePreamble.c b/rpm-5.4.9/build/parsePreamble.c new file mode 100644 index 0000000..a58937f --- /dev/null +++ b/rpm-5.4.9/build/parsePreamble.c @@ -0,0 +1,1234 @@ +/** \ingroup rpmbuild + * \file build/parsePreamble.c + * Parse tags in global section from spec file. + */ + +#include "system.h" + +#include +#include +#include +#include +#include +#include + +#define _RPMEVR_INTERNAL +#define _RPMTAG_INTERNAL /* XXX rpmTags->aTags */ +#include +#include "debug.h" + +/*@access FD_t @*/ /* compared with NULL */ +/*@access headerTagIndices @*/ /* rpmTags->aTags */ + +/** + */ +/*@observer@*/ /*@unchecked@*/ +static rpmTag copyTagsDuringParse[] = { + RPMTAG_EPOCH, + RPMTAG_VERSION, + RPMTAG_RELEASE, + RPMTAG_DISTEPOCH, + RPMTAG_LICENSE, + RPMTAG_GROUP, /* XXX permissive. */ + RPMTAG_SUMMARY, /* XXX permissive. */ + RPMTAG_DESCRIPTION, /* XXX permissive. */ + RPMTAG_PACKAGER, + RPMTAG_DISTRIBUTION, + RPMTAG_DISTURL, + RPMTAG_VENDOR, + RPMTAG_ICON, + RPMTAG_GIF, + RPMTAG_XPM, + RPMTAG_URL, + RPMTAG_CHANGELOGTIME, + RPMTAG_CHANGELOGNAME, + RPMTAG_CHANGELOGTEXT, + RPMTAG_PREFIXES, + RPMTAG_DISTTAG, + RPMTAG_BUGURL, + RPMTAG_CVSID, + RPMTAG_VARIANTS, + RPMTAG_XMAJOR, + RPMTAG_XMINOR, + RPMTAG_REPOTAG, + RPMTAG_KEYWORDS, + 0 +}; + +/** + */ +/*@observer@*/ /*@unchecked@*/ +static rpmTag requiredTags[] = { + RPMTAG_NAME, + RPMTAG_VERSION, + RPMTAG_RELEASE, + RPMTAG_SUMMARY, + RPMTAG_GROUP, + RPMTAG_LICENSE, + 0 +}; + +/** + */ +static void addOrAppendListEntry(Header h, rpmTag tag, char * line) + /*@modifies h @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + int xx; + int argc; + const char **argv; + + xx = poptParseArgvString(line, &argc, &argv); + if (argc) { + he->tag = tag; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = argv; + he->c = argc; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + } + argv = _free(argv); +} + +/* Parse a simple part line that only take -n or */ +/* is returned in name as a pointer into malloc'd storage. */ + +/** + */ +static int parseSimplePart(Spec spec, /*@out@*/char ** Np, + /*@out@*/rpmParseState *flag) + /*@globals internalState@*/ + /*@modifies *Np, *flag, internalState, spec->line @*/ +{ + char * s, * se; + int rc = 0; /* assume failure */ + + if (Np) + *Np = NULL; + + se = strchr(spec->line, '#'); + if (se) { + *se = '\0'; + while (--se >= spec->line && strchr(" \t\n\r", *se) != NULL) + *se = '\0'; + } + + s = xstrdup(spec->line); + /* Throw away the first token (the %xxxx) */ + (void)strtok(s, " \t\n"); + + if (!(se = strtok(NULL, " \t\n"))) + goto exit; + + if (!strcmp(se, "-n")) { + if (!(se = strtok(NULL, " \t\n"))) { + rc = 1; + goto exit; + } + *flag = PART_NAME; + } else + *flag = PART_SUBNAME; + + if (Np) + *Np = xstrdup(se); + + rc = (strtok(NULL, " \t\n") ? 1 : 0); + +exit: + s = _free(s); + return rc; +} + +/** + */ +static inline int parseYesNo(const char * s) + /*@*/ +{ + return ((!s || (s[0] == 'n' || s[0] == 'N' || s[0] == '0') || + !xstrcasecmp(s, "false") || !xstrcasecmp(s, "off")) + ? 0 : 1); +} + +typedef struct tokenBits_s { +/*@observer@*/ /*@null@*/ + const char * name; + rpmsenseFlags bits; +} * tokenBits; + +/** + */ +/*@observer@*/ /*@unchecked@*/ +static struct tokenBits_s installScriptBits[] = { + { "interp", RPMSENSE_INTERP }, + { "preun", RPMSENSE_SCRIPT_PREUN }, + { "pre", RPMSENSE_SCRIPT_PRE }, + { "postun", RPMSENSE_SCRIPT_POSTUN }, + { "post", RPMSENSE_SCRIPT_POST }, + { "rpmlib", RPMSENSE_RPMLIB }, + { "verify", RPMSENSE_SCRIPT_VERIFY }, + { "hint", RPMSENSE_MISSINGOK }, + { NULL, 0 } +}; + +/** + */ +/*@observer@*/ /*@unchecked@*/ +static struct tokenBits_s buildScriptBits[] = { + { "prep", RPMSENSE_SCRIPT_PREP }, + { "build", RPMSENSE_SCRIPT_BUILD }, + { "install", RPMSENSE_SCRIPT_INSTALL }, + { "clean", RPMSENSE_SCRIPT_CLEAN }, + { "hint", RPMSENSE_MISSINGOK }, + { NULL, 0 } +}; + +/** + */ +static int parseBits(const char * s, const tokenBits tokbits, + /*@out@*/ rpmsenseFlags * bp) + /*@modifies *bp @*/ +{ + tokenBits tb; + const char * se; + rpmsenseFlags bits = RPMSENSE_ANY; + int c = 0; + + if (s) { + while (*s != '\0') { + while ((c = *s) && xisspace(c)) s++; + se = s; + while ((c = *se) && xisalpha(c)) se++; + if (s == se) + break; + for (tb = tokbits; tb->name; tb++) { + if (tb->name != NULL && + strlen(tb->name) == (size_t)(se-s) && !strncmp(tb->name, s, (se-s))) + /*@innerbreak@*/ break; + } + if (tb->name == NULL) + break; + bits |= tb->bits; + while ((c = *se) && xisspace(c)) se++; + if (c != ',') + break; + s = ++se; + } + } + if (c == 0 && bp) *bp = bits; + return (c ? RPMRC_FAIL : RPMRC_OK); +} + +/** + */ +/*@null@*/ +static inline char * findLastChar(char * s) + /*@modifies *s @*/ +{ + char *se = s + strlen(s); + + /* Right trim white space. */ + while (--se > s && strchr(" \t\n\r", *se) != NULL) + *se = '\0'; + /* Truncate comments. */ + if ((se = strchr(s, '#')) != NULL) { + *se = '\0'; + while (--se > s && strchr(" \t\n\r", *se) != NULL) + *se = '\0'; + } +/*@-temptrans -retalias @*/ + return se; +/*@=temptrans =retalias @*/ +} + +/** + */ +static int isMemberInEntry(Header h, const char *name, rpmTag tag) + /*@globals internalState @*/ + /*@modifies internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + int rc = -1; + int xx; + + he->tag = tag; + xx = headerGet(h, he, 0); + if (!xx) + return rc; + rc = 0; + while (he->c) { + he->c--; + if (xstrcasecmp(he->p.argv[he->c], name)) + continue; + rc = 1; + break; + } + he->p.ptr = _free(he->p.ptr); + return rc; +} + +/** + */ +static int checkForValidArchitectures(Spec spec) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies rpmGlobalMacroContext, internalState @*/ +{ + const char *arch = rpmExpand("%{_target_cpu}", NULL); + const char *os = rpmExpand("%{_target_os}", NULL); + int rc = RPMRC_FAIL; /* assume failure. */ + + if (isMemberInEntry(spec->sourceHeader, arch, RPMTAG_EXCLUDEARCH) == 1) { + rpmlog(RPMLOG_ERR, _("Architecture is excluded: %s\n"), arch); + goto exit; + } + if (isMemberInEntry(spec->sourceHeader, arch, RPMTAG_EXCLUSIVEARCH) == 0) { + rpmlog(RPMLOG_ERR, _("Architecture is not included: %s\n"), arch); + goto exit; + } + if (isMemberInEntry(spec->sourceHeader, os, RPMTAG_EXCLUDEOS) == 1) { + rpmlog(RPMLOG_ERR, _("OS is excluded: %s\n"), os); + goto exit; + } + if (isMemberInEntry(spec->sourceHeader, os, RPMTAG_EXCLUSIVEOS) == 0) { + rpmlog(RPMLOG_ERR, _("OS is not included: %s\n"), os); + goto exit; + } + rc = 0; +exit: + arch = _free(arch); + os = _free(os); + return rc; +} + +/** + * Check that required tags are present in header. + * @param h header + * @param NVR package name-version-release + * @return RPMRC_OK if OK + */ +static rpmRC checkForRequired(Header h, const char * NVR) + /*@*/ +{ + rpmTag * p; + rpmRC rc = RPMRC_OK; + + for (p = requiredTags; *p != 0; p++) { + if (!headerIsEntry(h, *p)) { + rpmlog(RPMLOG_ERR, + _("%s field must be present in package: %s\n"), + tagName(*p), NVR); + rc = RPMRC_FAIL; + } + } + + return rc; +} + +/** + * Check that no duplicate tags are present in header. + * @param h header + * @param NVR package name-version-release + * @return RPMRC_OK if OK + */ +static rpmRC checkForDuplicates(Header h, const char * NVR) + /*@globals internalState @*/ + /*@modifies h, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + HeaderIterator hi; + rpmTag lastTag = 0; + rpmRC rc = RPMRC_OK; + + for (hi = headerInit(h); + headerNext(hi, he, 0); + he->p.ptr = _free(he->p.ptr)) + { + if (he->tag != lastTag) { + lastTag = he->tag; + continue; + } + rpmlog(RPMLOG_ERR, _("Duplicate %s entries in package: %s\n"), + tagName(he->tag), NVR); + rc = RPMRC_FAIL; + } + hi = headerFini(hi); + + return rc; +} + +/** + */ +/*@observer@*/ /*@unchecked@*/ +static struct optionalTag { + rpmTag ot_tag; +/*@observer@*/ /*@null@*/ + const char * ot_mac; +} optionalTags[] = { + { RPMTAG_VENDOR, "%{vendor}" }, + { RPMTAG_PACKAGER, "%{packager}" }, + { RPMTAG_DISTEPOCH, "%{distepoch}" }, + { RPMTAG_DISTRIBUTION, "%{distribution}" }, + { RPMTAG_DISTTAG, "%{disttag}" }, + { RPMTAG_DISTURL, "%{disturl}" }, + { RPMTAG_BUGURL, "%{bugurl}" }, + { 0xffffffff, "%{class}" }, + { -1, NULL } +}; + +/** + */ +static void fillOutMainPackage(Header h) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies h, rpmGlobalMacroContext, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + struct optionalTag *ot; + int xx; + + for (ot = optionalTags; ot->ot_mac != NULL; ot++) { + const char * val; + rpmTag tag; + + tag = ot->ot_tag; + + /* Generate arbitrary tag (if necessary). */ + if (tag == 0xffffffff) { + val = tagCanonicalize(ot->ot_mac + (sizeof("%{")-1)); + tag = tagGenerate(val); + val = _free(val); + } + + if (headerIsEntry(h, tag)) + continue; + val = rpmExpand(ot->ot_mac, NULL); + if (val && *val != '%') { + he->tag = tag; + he->t = RPM_STRING_TYPE; + he->p.str = val; + he->c = 1; + xx = headerPut(h, he, 0); + } + val = _free(val); + } +} + +/** + */ +static int doIcon(Spec spec, Header h) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies h, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + static size_t iconsize = 0; + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + const char *fn, *Lurlfn = NULL; + struct Source *sp; + size_t nb; + rpmuint8_t * icon; + FD_t fd = NULL; + int rc = RPMRC_FAIL; /* assume error */ + int urltype; + int xx; + + if (iconsize == 0) { + iconsize = rpmExpandNumeric("%{?_build_iconsize}"); + if (iconsize < 2048) + iconsize = 2048; + } + icon = alloca(iconsize+1); + + for (sp = spec->sources; sp != NULL; sp = sp->next) { + if (sp->flags & RPMFILE_ICON) + break; + } + if (sp == NULL) { + rpmlog(RPMLOG_ERR, _("No icon file in sources\n")); + goto exit; + } + +#if defined(RPM_VENDOR_OPENPKG) /* splitted-source-directory */ + /* support splitted source directories, i.e., source files which + are alternatively placed into the .spec directory and picked + up from there, too. */ + Lurlfn = rpmGenPath(NULL, "%{_specdir}/", sp->source); + if (access(Lurlfn, F_OK) == -1) { + Lurlfn = _free(Lurlfn); + Lurlfn = rpmGenPath(NULL, "%{_icondir}/", sp->source); + } +#else + Lurlfn = rpmGenPath(NULL, "%{_icondir}/", sp->source); +#endif + + fn = NULL; + urltype = urlPath(Lurlfn, &fn); + switch (urltype) { + case URL_IS_HTTPS: + case URL_IS_HTTP: + case URL_IS_FTP: + case URL_IS_PATH: + case URL_IS_UNKNOWN: + break; + case URL_IS_DASH: + case URL_IS_HKP: + case URL_IS_MONGO: /* XXX FIXME */ + rpmlog(RPMLOG_ERR, _("Invalid icon URL: %s\n"), Lurlfn); + goto exit; + /*@notreached@*/ break; + } + + fd = Fopen(fn, "r%{?_rpmgio}"); + if (fd == NULL || Ferror(fd)) { + rpmlog(RPMLOG_ERR, _("Unable to open icon %s: %s\n"), + fn, Fstrerror(fd)); + rc = RPMRC_FAIL; + goto exit; + } + + *icon = '\0'; + nb = Fread(icon, sizeof(icon[0]), iconsize, fd); + if (Ferror(fd) || nb == 0) { + rpmlog(RPMLOG_ERR, _("Unable to read icon %s: %s\n"), + fn, Fstrerror(fd)); + goto exit; + } + if (nb >= iconsize) { + rpmlog(RPMLOG_ERR, _("Icon %s is too big (max. %d bytes)\n"), + fn, (int)iconsize); + goto exit; + } + + if (icon[0] == 'G' && icon[1] == 'I' && icon[2] == 'F') + he->tag = RPMTAG_GIF; + else + if (icon[0] == '/' && icon[1] == '*' && icon[2] == ' ' + && icon[3] == 'X' && icon[4] == 'P' && icon[5] == 'M') + he->tag = RPMTAG_XPM; + else + he->tag = tagValue("Icon"); + he->t = RPM_BIN_TYPE; + he->p.ui8p = icon; + he->c = (rpmTagCount)nb; + xx = headerPut(h, he, 0); + rc = 0; + +exit: + if (fd) { + (void) Fclose(fd); + fd = NULL; + } + Lurlfn = _free(Lurlfn); + return rc; +} + +spectag stashSt(Spec spec, Header h, rpmTag tag, const char * lang) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + spectag t = NULL; + int xx; + + if (spec->st) { + spectags st = spec->st; + if (st->st_ntags == st->st_nalloc) { + st->st_nalloc += 10; + st->st_t = xrealloc(st->st_t, st->st_nalloc * sizeof(*(st->st_t))); + } + t = st->st_t + st->st_ntags++; + t->t_tag = tag; + t->t_startx = spec->lineNum - 1; + t->t_nlines = 1; + t->t_lang = xstrdup(lang); + t->t_msgid = NULL; + if (!(t->t_lang && strcmp(t->t_lang, RPMBUILD_DEFAULT_LANG))) { + he->tag = RPMTAG_NAME; + xx = headerGet(h, he, 0); + if (xx) { + char buf[1024]; + sprintf(buf, "%s(%s)", he->p.str, tagName(tag)); + t->t_msgid = xstrdup(buf); + } + he->p.ptr = _free(he->p.ptr); + } + } + /*@-usereleased -compdef@*/ + return t; + /*@=usereleased =compdef@*/ +} + +#define SINGLE_TOKEN_ONLY \ +if (multiToken) { \ + rpmlog(RPMLOG_ERR, _("line %d: Tag takes single token only: %s\n"), \ + spec->lineNum, spec->line); \ + return RPMRC_FAIL; \ +} + +/*@-redecl@*/ +extern int noLang; +/*@=redecl@*/ + +static rpmRC tagValidate(Spec spec, rpmTag tag, const char * value) + /*@*/ +{ + const char * tagN = tagName(tag); + const char * pattern = rpmExpand("%{?pattern_", tagN, "}", NULL); + rpmRC ec = RPMRC_OK; + + if (pattern && *pattern) { + miRE mire; + int xx; + + mire = mireNew(RPMMIRE_REGEX, tag); + xx = mireSetCOptions(mire, RPMMIRE_REGEX, 0, 0, NULL); + if (!xx) + xx = mireRegcomp(mire, pattern); + if (!xx) + xx = mireRegexec(mire, value, strlen(value)); + if (!xx) + ec = RPMRC_OK; + else { + rpmlog(RPMLOG_ERR, _("line %d: invalid tag value(\"%s\") %s: %s\n"), + spec->lineNum, pattern, tagN, spec->line); + ec = RPMRC_FAIL; + } + + mire = mireFree(mire); + } + + pattern = _free(pattern); + + return ec; +} + +/** + */ +static rpmRC handlePreambleTag(Spec spec, Package pkg, rpmTag tag, + const char *macro, const char *lang) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies spec->macros, spec->st, + spec->sources, spec->numSources, spec->noSource, + spec->sourceHeader, spec->BANames, spec->BACount, + spec->line, + pkg->header, pkg->autoProv, pkg->autoReq, pkg->noarch, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + char * field = spec->line; + char * end; + int multiToken = 0; + rpmsenseFlags tagflags; + int len; + rpmuint32_t num; + int rc; + int xx; + + if (field == NULL) return RPMRC_FAIL; /* XXX can't happen */ + /* Find the start of the "field" and strip trailing space */ + while ((*field) && (*field != ':')) + field++; + if (*field != ':') { + rpmlog(RPMLOG_ERR, _("line %d: Malformed tag: %s\n"), + spec->lineNum, spec->line); + return RPMRC_FAIL; + } + field++; + SKIPSPACE(field); + if (!*field) { + /* Empty field */ + rpmlog(RPMLOG_ERR, _("line %d: Empty tag: %s\n"), + spec->lineNum, spec->line); + return RPMRC_FAIL; + } + end = findLastChar(field); + + /* Validate tag data content. */ + if (tagValidate(spec, tag, field) != RPMRC_OK) + return RPMRC_FAIL; + + /* See if this is multi-token */ + end = field; + SKIPNONSPACE(end); + if (*end != '\0') + multiToken = 1; + + switch (tag) { + case RPMTAG_NAME: + case RPMTAG_VERSION: + case RPMTAG_RELEASE: + case RPMTAG_DISTEPOCH: + case RPMTAG_URL: + case RPMTAG_DISTTAG: + case RPMTAG_REPOTAG: + case RPMTAG_CVSID: + case RPMTAG_BUGURL: + SINGLE_TOKEN_ONLY; + /* These macros are for backward compatibility */ + if (tag == RPMTAG_VERSION) { + if (strchr(field, '-') != NULL) { + rpmlog(RPMLOG_ERR, _("line %d: Illegal char '-' in %s: %s\n"), + spec->lineNum, "version", spec->line); + return RPMRC_FAIL; + } + addMacro(spec->macros, "PACKAGE_VERSION", NULL, field, RMIL_OLDSPEC); + } else if (tag == RPMTAG_RELEASE) { + if (strchr(field, '-') != NULL) { + rpmlog(RPMLOG_ERR, _("line %d: Illegal char '-' in %s: %s\n"), + spec->lineNum, "release", spec->line); + return RPMRC_FAIL; + } + addMacro(spec->macros, "PACKAGE_RELEASE", NULL, field, RMIL_OLDSPEC-1); + } + he->tag = tag; + he->t = RPM_STRING_TYPE; + he->p.str = field; + he->c = 1; + xx = headerPut(pkg->header, he, 0); + break; + case RPMTAG_GROUP: + case RPMTAG_SUMMARY: +#if defined(RPM_VENDOR_OPENPKG) /* make-class-available-as-macro */ + case RPMTAG_CLASS: +#endif + (void) stashSt(spec, pkg->header, tag, lang); + /*@fallthrough@*/ + case RPMTAG_DISTRIBUTION: + case RPMTAG_VENDOR: + case RPMTAG_LICENSE: + case RPMTAG_PACKAGER: + if (!*lang) { + he->tag = tag; + he->t = RPM_STRING_TYPE; + he->p.str = field; + he->c = 1; + xx = headerPut(pkg->header, he, 0); + } else if (!(noLang && strcmp(lang, RPMBUILD_DEFAULT_LANG))) { +#if defined(SUPPORT_I18NSTRING_TYPE) + (void) headerAddI18NString(pkg->header, tag, field, lang); +#else + if (!strcmp(lang, RPMBUILD_DEFAULT_LANG)) { + he->tag = tag; + he->t = RPM_STRING_TYPE; + he->p.str = field; + he->c = 1; + xx = headerPut(pkg->header, he, 0); + } +#endif + } + break; + /* XXX silently ignore BuildRoot: */ + case RPMTAG_BUILDROOT: + SINGLE_TOKEN_ONLY; + macro = NULL; +#ifdef DYING + buildRootURL = rpmGenPath(spec->rootURL, "%{?buildroot}", NULL); + (void) urlPath(buildRootURL, &buildRoot); + if (*buildRoot == '\0') buildRoot = "/"; + if (!strcmp(buildRoot, "/")) { + rpmlog(RPMLOG_ERR, + _("BuildRoot can not be \"/\": %s\n"), spec->buildRootURL); + buildRootURL = _free(buildRootURL); + return RPMRC_FAIL; + } + buildRootURL = _free(buildRootURL); +#endif + break; + case RPMTAG_KEYWORDS: + case RPMTAG_VARIANTS: + case RPMTAG_PREFIXES: + addOrAppendListEntry(pkg->header, tag, field); + he->tag = tag; + xx = headerGet(pkg->header, he, 0); + if (tag == RPMTAG_PREFIXES) + while (he->c--) { + if (he->p.argv[he->c][0] != '/') { + rpmlog(RPMLOG_ERR, + _("line %d: Prefixes must begin with \"/\": %s\n"), + spec->lineNum, spec->line); + he->p.ptr = _free(he->p.ptr); + return RPMRC_FAIL; + } + len = (int)strlen(he->p.argv[he->c]); + if (he->p.argv[he->c][len - 1] == '/' && len > 1) { + rpmlog(RPMLOG_ERR, + _("line %d: Prefixes must not end with \"/\": %s\n"), + spec->lineNum, spec->line); + he->p.ptr = _free(he->p.ptr); + return RPMRC_FAIL; + } + } + he->p.ptr = _free(he->p.ptr); + break; + case RPMTAG_DOCDIR: + SINGLE_TOKEN_ONLY; + if (field[0] != '/') { + rpmlog(RPMLOG_ERR, + _("line %d: Docdir must begin with '/': %s\n"), + spec->lineNum, spec->line); + return RPMRC_FAIL; + } + macro = NULL; + delMacro(NULL, "_docdir"); + addMacro(NULL, "_docdir", NULL, field, RMIL_SPEC); + break; + case RPMTAG_XMAJOR: + case RPMTAG_XMINOR: + case RPMTAG_EPOCH: + SINGLE_TOKEN_ONLY; + if (parseNum(field, &num)) { + rpmlog(RPMLOG_ERR, + _("line %d: %s takes an integer value: %s\n"), + spec->lineNum, tagName(tag), spec->line); + return RPMRC_FAIL; + } + he->tag = tag; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = # + he->c = 1; + xx = headerPut(pkg->header, he, 0); + break; + case RPMTAG_AUTOREQPROV: + pkg->autoReq = parseYesNo(field); + pkg->autoProv = pkg->autoReq; + break; + case RPMTAG_AUTOREQ: + pkg->autoReq = parseYesNo(field); + break; + case RPMTAG_AUTOPROV: + pkg->autoProv = parseYesNo(field); + break; + case RPMTAG_SOURCE: + case RPMTAG_PATCH: + SINGLE_TOKEN_ONLY; + macro = NULL; + if ((rc = addSource(spec, pkg, field, tag))) + return rc; + break; + case RPMTAG_ICON: + SINGLE_TOKEN_ONLY; + macro = NULL; + if ((rc = addSource(spec, pkg, field, tag))) + return rc; + /* XXX the fetch/load of icon needs to be elsewhere. */ + if ((rc = doIcon(spec, pkg->header))) + return rc; + break; + case RPMTAG_NOSOURCE: + case RPMTAG_NOPATCH: + spec->noSource = 1; + if ((rc = parseNoSource(spec, field, tag))) + return rc; + break; + case RPMTAG_BUILDPREREQ: + case RPMTAG_BUILDREQUIRES: + if ((rc = parseBits(lang, buildScriptBits, &tagflags))) { + rpmlog(RPMLOG_ERR, + _("line %d: Bad %s: qualifiers: %s\n"), + spec->lineNum, tagName(tag), spec->line); + return rc; + } + if ((rc = parseRCPOT(spec, pkg, field, tag, 0, tagflags))) + return rc; + break; + case RPMTAG_PREREQ: + case RPMTAG_REQUIREFLAGS: + if ((rc = parseBits(lang, installScriptBits, &tagflags))) { + rpmlog(RPMLOG_ERR, + _("line %d: Bad %s: qualifiers: %s\n"), + spec->lineNum, tagName(tag), spec->line); + return rc; + } + if ((rc = parseRCPOT(spec, pkg, field, tag, 0, tagflags))) + return rc; + break; + /* Aliases for BuildRequires(hint): */ + case RPMTAG_BUILDSUGGESTS: + case RPMTAG_BUILDENHANCES: + tagflags = RPMSENSE_MISSINGOK; + if ((rc = parseRCPOT(spec, pkg, field, tag, 0, tagflags))) + return rc; + break; + /* Aliases for Requires(hint): */ + case RPMTAG_SUGGESTSFLAGS: + case RPMTAG_ENHANCESFLAGS: + tag = RPMTAG_REQUIREFLAGS; + tagflags = RPMSENSE_MISSINGOK; + if ((rc = parseRCPOT(spec, pkg, field, tag, 0, tagflags))) + return rc; + break; + case RPMTAG_BUILDOBSOLETES: + case RPMTAG_BUILDPROVIDES: + case RPMTAG_BUILDCONFLICTS: + case RPMTAG_CONFLICTFLAGS: + case RPMTAG_OBSOLETEFLAGS: + case RPMTAG_PROVIDEFLAGS: + tagflags = RPMSENSE_ANY; + if ((rc = parseRCPOT(spec, pkg, field, tag, 0, tagflags))) + return rc; + break; + case RPMTAG_BUILDPLATFORMS: /* XXX needs pattern parsing */ + case RPMTAG_EXCLUDEARCH: + case RPMTAG_EXCLUSIVEARCH: + case RPMTAG_EXCLUDEOS: + case RPMTAG_EXCLUSIVEOS: + addOrAppendListEntry(spec->sourceHeader, tag, field); + break; + + case RPMTAG_BUILDARCHS: + { const char ** BANames = NULL; + int BACount = 0; + if ((rc = poptParseArgvString(field, &BACount, &BANames))) { + rpmlog(RPMLOG_ERR, + _("line %d: Bad BuildArchitecture format: %s\n"), + spec->lineNum, spec->line); + return RPMRC_FAIL; + } + if (spec->toplevel) { + if (BACount > 0 && BANames != NULL) { + spec->BACount = BACount; + spec->BANames = BANames; + BANames = NULL; /* XXX don't free. */ + } + } else { + if (BACount != 1 || strcmp(BANames[0], "noarch")) { + rpmlog(RPMLOG_ERR, + _("line %d: Only \"noarch\" sub-packages are supported: %s\n"), + spec->lineNum, spec->line); + BANames = _free(BANames); + return RPMRC_FAIL; + } + pkg->noarch = 1; + } + BANames = _free(BANames); + } break; + + default: + macro = NULL; + he->tag = tag; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv= (const char **) &field; /* XXX NOCAST */ + he->c = 1; + he->append = 1; + xx = headerPut(pkg->header, he, 0); + he->append = 0; + break; + } + +/*@-usereleased@*/ + if (macro) + addMacro(spec->macros, macro, NULL, field, RMIL_SPEC); +/*@=usereleased@*/ + + return RPMRC_OK; +} + +/* This table has to be in a peculiar order. If one tag is the */ +/* same as another, plus a few letters, it must come first. */ + +/** + */ +typedef struct PreambleRec_s { + rpmTag tag; + int multiLang; + int obsolete; +/*@observer@*/ /*@null@*/ + const char * token; +} * PreambleRec; + +/*@unchecked@*/ +static struct PreambleRec_s preambleList[] = { + {RPMTAG_NAME, 0, 0, "name"}, + {RPMTAG_VERSION, 0, 0, "version"}, + {RPMTAG_RELEASE, 0, 0, "release"}, + {RPMTAG_DISTEPOCH, 0, 0, "distepoch"}, + {RPMTAG_EPOCH, 0, 0, "epoch"}, + {RPMTAG_EPOCH, 0, 1, "serial"}, + {RPMTAG_SUMMARY, 1, 0, "summary"}, + {RPMTAG_LICENSE, 0, 0, "copyright"}, + {RPMTAG_LICENSE, 0, 0, "license"}, + {RPMTAG_DISTRIBUTION, 0, 0, "distribution"}, + {RPMTAG_DISTURL, 0, 0, "disturl"}, + {RPMTAG_VENDOR, 0, 0, "vendor"}, + {RPMTAG_GROUP, 1, 0, "group"}, + {RPMTAG_PACKAGER, 0, 0, "packager"}, + {RPMTAG_URL, 0, 0, "url"}, + {RPMTAG_SOURCE, 0, 0, "source"}, + {RPMTAG_PATCH, 0, 0, "patch"}, + {RPMTAG_NOSOURCE, 0, 0, "nosource"}, + {RPMTAG_NOPATCH, 0, 0, "nopatch"}, + {RPMTAG_EXCLUDEARCH, 0, 0, "excludearch"}, + {RPMTAG_EXCLUSIVEARCH, 0, 0, "exclusivearch"}, + {RPMTAG_EXCLUDEOS, 0, 0, "excludeos"}, + {RPMTAG_EXCLUSIVEOS, 0, 0, "exclusiveos"}, + {RPMTAG_ICON, 0, 0, "icon"}, + {RPMTAG_PROVIDEFLAGS, 0, 0, "provides"}, + {RPMTAG_REQUIREFLAGS, 1, 0, "requires"}, + {RPMTAG_PREREQ, 1, 0, "prereq"}, + {RPMTAG_CONFLICTFLAGS, 0, 0, "conflicts"}, + {RPMTAG_OBSOLETEFLAGS, 0, 0, "obsoletes"}, + {RPMTAG_PREFIXES, 0, 0, "prefixes"}, + {RPMTAG_PREFIXES, 0, 0, "prefix"}, + {RPMTAG_BUILDROOT, 0, 0, "buildroot"}, + {RPMTAG_BUILDARCHS, 0, 0, "buildarchitectures"}, + {RPMTAG_BUILDARCHS, 0, 0, "buildarch"}, + {RPMTAG_BUILDCONFLICTS, 0, 0, "buildconflicts"}, + {RPMTAG_BUILDOBSOLETES, 0, 0, "buildobsoletes"}, + {RPMTAG_BUILDPREREQ, 1, 0, "buildprereq"}, + {RPMTAG_BUILDPROVIDES, 0, 0, "buildprovides"}, + {RPMTAG_BUILDREQUIRES, 1, 0, "buildrequires"}, + {RPMTAG_AUTOREQPROV, 0, 0, "autoreqprov"}, + {RPMTAG_AUTOREQ, 0, 0, "autoreq"}, + {RPMTAG_AUTOPROV, 0, 0, "autoprov"}, + {RPMTAG_DOCDIR, 0, 0, "docdir"}, + {RPMTAG_DISTTAG, 0, 0, "disttag"}, + {RPMTAG_BUGURL, 0, 0, "bugurl"}, + {RPMTAG_CVSID, 0, 0, "cvsid"}, + {RPMTAG_SVNID, 0, 0, "svnid"}, + {RPMTAG_SUGGESTSFLAGS, 0, 0, "suggests"}, + {RPMTAG_ENHANCESFLAGS, 0, 0, "enhances"}, + {RPMTAG_BUILDSUGGESTS, 0, 0, "buildsuggests"}, + {RPMTAG_BUILDENHANCES, 0, 0, "buildenhances"}, + {RPMTAG_VARIANTS, 0, 0, "variants"}, + {RPMTAG_VARIANTS, 0, 0, "variant"}, + {RPMTAG_XMAJOR, 0, 0, "xmajor"}, + {RPMTAG_XMINOR, 0, 0, "xminor"}, + {RPMTAG_REPOTAG, 0, 0, "repotag"}, + {RPMTAG_KEYWORDS, 0, 0, "keywords"}, + {RPMTAG_KEYWORDS, 0, 0, "keyword"}, + {RPMTAG_BUILDPLATFORMS, 0, 0, "buildplatforms"}, +#if defined(RPM_VENDOR_OPENPKG) /* make-class-available-as-macro */ + {RPMTAG_CLASS, 0, 0, "class"}, +#endif + /*@-nullassign@*/ /* LCL: can't add null annotation */ + {0, 0, 0, 0} + /*@=nullassign@*/ +}; + +/** + */ +static int findPreambleTag(Spec spec, /*@out@*/rpmTag * tagp, + /*@null@*/ /*@out@*/ const char ** macro, /*@out@*/ char * lang) + /*@modifies *tagp, *macro, *lang @*/ +{ + PreambleRec p; + char *s; + size_t len = 0; + + /* Search for defined tags. */ + for (p = preambleList; p->token != NULL; p++) { + len = strlen(p->token); + if (!(p->token && !xstrncasecmp(spec->line, p->token, len))) + continue; + if (p->obsolete) { + rpmlog(RPMLOG_ERR, _("Legacy syntax is unsupported: %s\n"), + p->token); + p = NULL; + } + break; + } + if (p == NULL) + return 1; + + /* Search for arbitrary tags. */ + if (tagp && p->token == NULL) { + ARGV_t aTags = NULL; + int rc = 1; /* assume failure */ + +/*@-noeffect@*/ + (void) tagName(0); /* XXX force arbitrary tags to be initialized. */ +/*@=noeffect@*/ + aTags = rpmTags->aTags; + if (aTags != NULL && aTags[0] != NULL) { + ARGV_t av; + s = tagCanonicalize(spec->line); +#if defined(RPM_VENDOR_OPENPKG) /* wildcard-matching-arbitrary-tagnames */ + av = argvSearchLinear(aTags, s, argvFnmatchCasefold); +#else + av = argvSearch(aTags, s, argvStrcasecmp); +#endif + if (av != NULL) { + *tagp = tagGenerate(s); + rc = 0; + } + s = _free(s); + } + return rc; + } + + s = spec->line + len; + SKIPSPACE(s); + + switch (p->multiLang) { + default: + case 0: + /* Unless this is a source or a patch, a ':' better be next */ + if (p->tag != RPMTAG_SOURCE && p->tag != RPMTAG_PATCH) { + if (*s != ':') return 1; + } + *lang = '\0'; + break; + case 1: /* Parse optional ( ). */ + if (*s == ':') { + strcpy(lang, RPMBUILD_DEFAULT_LANG); + break; + } + if (*s != '(') return 1; + s++; + SKIPSPACE(s); + while (!xisspace(*s) && *s != ')') + *lang++ = *s++; + *lang = '\0'; + SKIPSPACE(s); + if (*s != ')') return 1; + s++; + SKIPSPACE(s); + if (*s != ':') return 1; + break; + } + + if (tagp) + *tagp = p->tag; + if (macro) + /*@-onlytrans -observertrans -dependenttrans@*/ /* FIX: double indirection. */ + *macro = p->token; + /*@=onlytrans =observertrans =dependenttrans@*/ + return 0; +} + +/* XXX should return rpmParseState, but RPMRC_FAIL forces int return. */ +int parsePreamble(Spec spec, int initialPackage) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmParseState nextPart; + int xx; + char *linep; + Package pkg; + char NVR[BUFSIZ]; + char lang[BUFSIZ]; + rpmRC rc; + + strcpy(NVR, "(main package)"); + + pkg = newPackage(spec); + if (spec->packages == NULL) { + spec->packages = pkg; +assert(initialPackage); + } else if (! initialPackage) { + char *name = NULL; + rpmParseState flag; + Package lastpkg; + + /* There is one option to %package: or -n */ + flag = PART_NONE; + if (parseSimplePart(spec, &name, &flag)) { + rpmlog(RPMLOG_ERR, _("Bad package specification: %s\n"), + spec->line); + pkg = freePackages(pkg); + return RPMRC_FAIL; + } + + lastpkg = NULL; + if (lookupPackage(spec, name, flag, &lastpkg) == RPMRC_OK) { + pkg->next = lastpkg->next; + } else { + /* Add package to end of list */ + for (lastpkg = spec->packages; lastpkg->next != NULL; lastpkg = lastpkg->next) + {}; + } +assert(lastpkg != NULL); + lastpkg->next = pkg; + + /* Construct the package */ + if (flag == PART_SUBNAME) { + he->tag = RPMTAG_NAME; + xx = headerGet(spec->packages->header, he, 0); + sprintf(NVR, "%s-%s", he->p.str, name); + he->p.ptr = _free(he->p.ptr); + } else + strcpy(NVR, name); + name = _free(name); + he->tag = RPMTAG_NAME; + he->t = RPM_STRING_TYPE; + he->p.str = NVR; + he->c = 1; + xx = headerPut(pkg->header, he, 0); + } + + if ((rc = readLine(spec, STRIP_TRAILINGSPACE | STRIP_COMMENTS)) > 0) { + nextPart = PART_NONE; + } else { + if (rc) + return rc; + while ((nextPart = isPart(spec)) == PART_NONE) { + const char * macro = NULL; + rpmTag tag = 0; + + /* Skip blank lines */ + linep = spec->line; + SKIPSPACE(linep); + if (*linep != '\0') { + if (findPreambleTag(spec, &tag, ¯o, lang)) { + rpmlog(RPMLOG_ERR, _("line %d: Unknown tag: %s\n"), + spec->lineNum, spec->line); + return RPMRC_FAIL; + } + if (handlePreambleTag(spec, pkg, tag, macro, lang)) + return RPMRC_FAIL; + if (spec->BANames && !spec->recursing && spec->toplevel) + return PART_BUILDARCHITECTURES; + } + if ((rc = + readLine(spec, STRIP_TRAILINGSPACE | STRIP_COMMENTS)) > 0) { + nextPart = PART_NONE; + break; + } + if (rc) + return rc; + } + } + + /* Do some final processing on the header */ + + /* + * Expand buildroot one more time to get %{version} and the like + * from the main package. + */ + if (initialPackage) { + const char *s = rpmExpand("%{?buildroot}", NULL); + if (s && *s) + (void) addMacro(NULL, "buildroot", NULL, s, -1); + s = _free(s); + } + + /* XXX Skip valid arch check if not building binary package */ + if (!spec->anyarch && checkForValidArchitectures(spec)) + return RPMRC_FAIL; + + if (pkg == spec->packages) + fillOutMainPackage(pkg->header); + + if (checkForDuplicates(pkg->header, NVR) != RPMRC_OK) + return RPMRC_FAIL; + + if (pkg != spec->packages) + headerCopyTags(spec->packages->header, pkg->header, + (void *)copyTagsDuringParse); + +#ifdef RPM_VENDOR_PLD /* rpm-epoch0 */ + /* Add Epoch: 0 to package header if it was not set by spec */ + he->tag = RPMTAG_NAME; + if (headerGet(spec->packages->header, he, 0) == 0) { + rpmuint32_t num = 0; + + he->tag = RPMTAG_EPOCH; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = # + he->c = 1; + xx = headerPut(pkg->header, he, 0); + + /* also declare %{epoch} to be same */ + addMacro(spec->macros, "epoch", NULL, "0", RMIL_SPEC); + } +#endif /* RPM_VENDOR_PLD rpm-epoch0 */ + + if (checkForRequired(pkg->header, NVR) != RPMRC_OK) + return RPMRC_FAIL; + + return nextPart; +} diff --git a/rpm-5.4.9/build/parsePrep.c b/rpm-5.4.9/build/parsePrep.c new file mode 100644 index 0000000..8decdd0 --- /dev/null +++ b/rpm-5.4.9/build/parsePrep.c @@ -0,0 +1,955 @@ +/** \ingroup rpmbuild + * \file build/parsePrep.c + * Parse %prep section from spec file. + */ + +#include "system.h" + +#include +#include +#include +#include +#include +#ifdef NOTYET +#include +#endif + +#include + +#include "misc.h" /* XXX rpmMkdirPath */ +#include "debug.h" + +/* These have to be global to make up for stupid compilers */ +/*@unchecked@*/ + static int leaveDirs, skipDefaultAction; +/*@unchecked@*/ + static int createDir, quietly; +/*@unchecked@*/ /*@observer@*/ /*@null@*/ + static const char * dirName = NULL; +/*@unchecked@*/ /*@observer@*/ + static struct poptOption optionsTable[] = { + { NULL, 'a', POPT_ARG_STRING, NULL, 'a', NULL, NULL}, + { NULL, 'b', POPT_ARG_STRING, NULL, 'b', NULL, NULL}, + { NULL, 'c', 0, &createDir, 0, NULL, NULL}, + { NULL, 'D', 0, &leaveDirs, 0, NULL, NULL}, + { NULL, 'n', POPT_ARG_STRING, &dirName, 0, NULL, NULL}, + { NULL, 'T', 0, &skipDefaultAction, 0, NULL, NULL}, + { NULL, 'q', 0, &quietly, 0, NULL, NULL}, + { 0, 0, 0, 0, 0, NULL, NULL} + }; + +/** + * Check that file owner and group are known. + * @param urlfn file url + * @return RPMRC_OK on success + */ +static rpmRC checkOwners(const char * urlfn) + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies fileSystem, internalState @*/ +{ + struct stat sb; + + if (Lstat(urlfn, &sb)) { + rpmlog(RPMLOG_ERR, _("Bad source: %s: %s\n"), + urlfn, strerror(errno)); + return RPMRC_FAIL; + } + if (!getUname(sb.st_uid) || !getGname(sb.st_gid)) { + rpmlog(RPMLOG_ERR, _("Bad owner/group: %s\n"), urlfn); + return RPMRC_FAIL; + } + + return RPMRC_OK; +} + +#ifndef DYING +/** + * Expand %patchN macro into %prep scriptlet. + * @param spec build info + * @param c patch index + * @param strip patch level (i.e. patch -p argument) + * @param db saved file suffix (i.e. patch --suffix argument) + * @param reverse include -R? + * @param removeEmpties include -E? + * @param fuzz include -F? (fuzz<0 means no) + * @param subdir sub-directory (i.e patch -d argument); + * @return expanded %patch macro (NULL on error) + */ +/*@observer@*/ +static char *doPatch(Spec spec, rpmuint32_t c, int strip, const char *db, + int reverse, int removeEmpties, int fuzz, const char *subdir) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + const char *fn, *Lurlfn; + static char buf[BUFSIZ]; + char args[BUFSIZ], *t = args; + struct Source *sp; + rpmCompressedMagic compressed = COMPRESSED_NOT; + int urltype; + const char *patch, *flags; + + *t = '\0'; + if (db) + t = stpcpy( stpcpy(t, "-b --suffix "), db); +#if defined(RPM_VENDOR_OPENPKG) /* always-backup-on-patching */ + /* always create backup files in OpenPKG */ + else + t = stpcpy(t, "-b --suffix .orig "); +#endif + if (subdir) + t = stpcpy( stpcpy(t, "-d "), subdir); + if (fuzz >= 0) { + t = stpcpy(t, "-F "); + sprintf(t, "%10.10d", fuzz); + t += strlen(t); + } + if (reverse) + t = stpcpy(t, " -R"); + if (removeEmpties) + t = stpcpy(t, " -E"); + + for (sp = spec->sources; sp != NULL; sp = sp->next) { + if ((sp->flags & RPMFILE_PATCH) && (sp->num == c)) + break; + } + if (sp == NULL) { + rpmlog(RPMLOG_ERR, _("No patch number %d\n"), c); + return NULL; + } + + Lurlfn = rpmGenPath(NULL, "%{_patchdir}/", sp->source); + + /* XXX On non-build parse's, file cannot be stat'd or read */ + if (!spec->force && (isCompressed(Lurlfn, &compressed) || checkOwners(Lurlfn))) { + Lurlfn = _free(Lurlfn); + return NULL; + } + + fn = NULL; + urltype = urlPath(Lurlfn, &fn); + switch (urltype) { + case URL_IS_HTTPS: /* XXX WRONG WRONG WRONG */ + case URL_IS_HTTP: /* XXX WRONG WRONG WRONG */ + case URL_IS_FTP: /* XXX WRONG WRONG WRONG */ + case URL_IS_HKP: /* XXX WRONG WRONG WRONG */ + case URL_IS_MONGO: /* XXX FIXME */ + case URL_IS_PATH: + case URL_IS_UNKNOWN: + break; + case URL_IS_DASH: + Lurlfn = _free(Lurlfn); + return NULL; + /*@notreached@*/ break; + } + + patch = rpmGetPath("%{__patch}", NULL); + if (strcmp(patch, "%{__patch}") == 0) + patch = xstrdup("patch"); + + flags = rpmExpand("%{?_default_patch_flags}%{!?_default_patch_flags:-s}", NULL); + + if (compressed) { + const char *zipper; + + switch (compressed) { + default: + case COMPRESSED_NOT: /* XXX can't happen */ + case COMPRESSED_OTHER: + case COMPRESSED_ZIP: /* XXX wrong */ + zipper = "%{__gzip}"; + break; + case COMPRESSED_BZIP2: + zipper = "%{__bzip2}"; + break; + case COMPRESSED_LZOP: + zipper = "%{__lzop}"; + break; + case COMPRESSED_LZMA: + zipper = "%{__lzma}"; + break; + case COMPRESSED_XZ: + zipper = "%{__xz}"; + break; + } + zipper = rpmGetPath(zipper, NULL); + + sprintf(buf, + "echo \"Patch #%d (%s):\"\n" + "%s -d < '%s' | %s -p%d %s %s\n" + "STATUS=$?\n" + "if [ $STATUS -ne 0 ]; then\n" + " exit $STATUS\n" + "fi", + c, +/*@-moduncon@*/ + (const char *) basename((char *)fn), +/*@=moduncon@*/ + zipper, + fn, patch, strip, args, flags); + zipper = _free(zipper); + } else { + sprintf(buf, + "echo \"Patch #%d (%s):\"\n" + "%s -p%d %s %s < '%s'", c, +/*@-moduncon@*/ + (const char *) basename((char *)fn), +/*@=moduncon@*/ + patch, strip, args, flags, fn); + } + + patch = _free(patch); + flags = _free(flags); + Lurlfn = _free(Lurlfn); + return buf; +} +#endif + +/** + * Expand %setup macro into %prep scriptlet. + * @param spec build info + * @param c source index + * @param quietly should -vv be omitted from tar? + * @return expanded %setup macro (NULL on error) + */ +/*@observer@*/ +static const char *doUntar(Spec spec, rpmuint32_t c, int quietly) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + const char *fn, *Lurlfn; + static char buf[BUFSIZ]; + char taropts[8]; + char *t = NULL; + struct Source *sp; + rpmCompressedMagic compressed = COMPRESSED_NOT; + int urltype; + const char *tar; + int rubygem = 0; + + for (sp = spec->sources; sp != NULL; sp = sp->next) { + if ((sp->flags & RPMFILE_SOURCE) && (sp->num == c)) { + break; + } + } + if (sp == NULL) { + rpmlog(RPMLOG_ERR, _("No source number %d\n"), c); + return NULL; + } + + t = strrchr(sp->source, '.'); + if(t && !strcasecmp(t, ".gem")) + rubygem = 1; + + t = stpcpy(taropts, "-x"); + /*@-internalglobs@*/ /* FIX: shrug */ + if(rpmIsVerbose() && !quietly) + t = stpcpy(t, "vv"); + if(rubygem) + t = stpcpy(t, "m"); + + t = stpcpy(t, "f"); + /*@=internalglobs@*/ + +#if defined(RPM_VENDOR_OPENPKG) /* splitted-source-directory */ + Lurlfn = rpmGenPath(NULL, getSourceDir(sp->flags, sp->source), sp->source); +#else + Lurlfn = rpmGenPath(NULL, getSourceDir(sp->flags), sp->source); +#endif + + /* XXX On non-build parse's, file cannot be stat'd or read */ + if (!spec->force && (isCompressed(Lurlfn, &compressed) || checkOwners(Lurlfn))) { + Lurlfn = _free(Lurlfn); + return NULL; + } + + fn = NULL; + urltype = urlPath(Lurlfn, &fn); + switch (urltype) { + case URL_IS_HTTPS: /* XXX WRONG WRONG WRONG */ + case URL_IS_HTTP: /* XXX WRONG WRONG WRONG */ + case URL_IS_FTP: /* XXX WRONG WRONG WRONG */ + case URL_IS_HKP: /* XXX WRONG WRONG WRONG */ + case URL_IS_MONGO: /* XXX FIXME */ + case URL_IS_PATH: + case URL_IS_UNKNOWN: + break; + case URL_IS_DASH: + Lurlfn = _free(Lurlfn); + return NULL; + /*@notreached@*/ break; + } +#ifdef NOTYET + { rpmmg mg; + +_rpmmg_debug = 1; + mg = rpmmgNew(NULL, 0); + t = (char *) rpmmgFile(mg, fn); + mg = rpmmgFree(mg); +fprintf(stderr, "==> %s: %s\n", fn, t); + t = _free(t); +_rpmmg_debug = 0; + } +#endif + + tar = rpmGetPath("%{__tar}", NULL); + if (strcmp(tar, "%{__tar}") == 0) + tar = xstrdup("tar"); + +#if defined(RPM_VENDOR_ARK) /* use-gnu-tar-compression-detection */ +/* We leave compression handling for all tar based files up to GNU tar */ + if (compressed == COMPRESSED_ZIP) +#else + if (compressed != COMPRESSED_NOT) +#endif + { + const char *zipper; + int needtar = 1; + + switch (compressed) { + case COMPRESSED_NOT: /* XXX can't happen */ + case COMPRESSED_OTHER: + t = "%{__gzip} -dc"; + break; + case COMPRESSED_BZIP2: + t = "%{__bzip2} -dc"; + break; + case COMPRESSED_LZOP: + t = "%{__lzop} -dc"; + break; + case COMPRESSED_LZMA: + t = "%{__lzma} -dc"; + break; + case COMPRESSED_XZ: + t = "%{__xz} -dc"; + break; + case COMPRESSED_LZIP: + t = "%{__lzip} -dc"; + break; + case COMPRESSED_LRZIP: + t = "%{__lrzip} -dqo-"; + break; + case COMPRESSED_ZIP: +#if defined(RPM_VENDOR_OPENPKG) /* use-bsdtar-for-zip-files */ + t = "%{__bsdtar} -x -f"; +#else + if (rpmIsVerbose() && !quietly) + t = "%{__unzip}"; + else + t = "%{__unzip} -qq"; +#endif + needtar = 0; + break; + } + zipper = rpmGetPath(t, NULL); + buf[0] = '\0'; + t = stpcpy(buf, zipper); + zipper = _free(zipper); + *t++ = ' '; + *t++ = '\''; + t = stpcpy(t, fn); + *t++ = '\''; + if (needtar) { + t = stpcpy(t, " | "); + t = stpcpy(t, tar); + t = stpcpy(t, " "); + t = stpcpy(t, taropts); + t = stpcpy(t, " -"); + } + t = stpcpy(t, + "\n" + "STATUS=$?\n" + "if [ $STATUS -ne 0 ]; then\n" + " exit $STATUS\n" + "fi"); + } else { + buf[0] = '\0'; + t = stpcpy(buf, tar); + t = stpcpy(t, " "); + t = stpcpy(t, taropts); + *t++ = ' '; + t = stpcpy(t, fn); + if(rubygem) { + t = stpcpy(t, + "\n" + "if [ -f data.tar.gz ]; then\n" + " tar "); + t = stpcpy(t, taropts); + t = stpcpy(t, + " data.tar.gz\n" + "fi"); + } + } + + tar = _free(tar); + Lurlfn = _free(Lurlfn); + return buf; +} + +/** + * Parse %setup macro. + * @todo FIXME: Option -q broken when not immediately after %setup. + * @param spec build info + * @param line current line from spec file + * @return 0 on success + */ +static int doSetupMacro(Spec spec, const char * line) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies spec->buildSubdir, spec->macros, spec->prep, + spec->packages->header, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + char buf[BUFSIZ]; + rpmiob before = NULL; + rpmiob after = NULL; + poptContext optCon; + int argc; + const char ** argv; + int arg; + const char * optArg; + int rc; + rpmuint32_t num; + rpmRC ec = RPMRC_FAIL; /* XXX assume failure */ + + /*@-mods@*/ + leaveDirs = skipDefaultAction = 0; + createDir = quietly = 0; + dirName = NULL; + /*@=mods@*/ + + if ((rc = poptParseArgvString(line, &argc, &argv))) { + rpmlog(RPMLOG_ERR, _("Error parsing %%setup: %s\n"), + poptStrerror(rc)); + goto exit; + } + + before = rpmiobNew(0); + after = rpmiobNew(0); + + optCon = poptGetContext(NULL, argc, argv, optionsTable, 0); + while ((arg = poptGetNextOpt(optCon)) > 0) { + optArg = poptGetOptArg(optCon); + + /* We only parse -a and -b here */ + + if (parseNum(optArg, &num)) { + rpmlog(RPMLOG_ERR, _("line %d: Bad arg to %%setup: %s\n"), + spec->lineNum, (optArg ? optArg : "???")); + optCon = poptFreeContext(optCon); + argv = _free(argv); + goto exit; + } + + { const char *chptr = doUntar(spec, num, quietly); + if (chptr == NULL) + goto exit; + + (void) rpmiobAppend((arg == 'a' ? after : before), chptr, 1); + } + } + + if (arg < -1) { + rpmlog(RPMLOG_ERR, _("line %d: Bad %%setup option %s: %s\n"), + spec->lineNum, + poptBadOption(optCon, POPT_BADOPTION_NOALIAS), + poptStrerror(arg)); + optCon = poptFreeContext(optCon); + argv = _free(argv); + goto exit; + } + + if (dirName) { + spec->buildSubdir = xstrdup(dirName); + } else { + const char *N, *V; + (void) headerNEVRA(spec->packages->header, &N, NULL, &V, NULL, NULL); + (void) snprintf(buf, sizeof(buf), "%s-%s", N, V); + buf[sizeof(buf)-1] = '\0'; + N = _free(N); + V = _free(V); + spec->buildSubdir = xstrdup(buf); + } + addMacro(spec->macros, "buildsubdir", NULL, spec->buildSubdir, RMIL_SPEC); + + optCon = poptFreeContext(optCon); + argv = _free(argv); + + /* cd to the build dir */ + { const char * buildDirURL = rpmGenPath(spec->rootURL, "%{_builddir}", ""); + const char *buildDir; + + (void) urlPath(buildDirURL, &buildDir); + rc = rpmioMkpath(buildDir, 0755, -1, -1); + sprintf(buf, "cd '%s'", buildDir); + spec->prep = rpmiobAppend(spec->prep, buf, 1); + buildDirURL = _free(buildDirURL); + } + + /* delete any old sources */ + if (!leaveDirs) { + sprintf(buf, "rm -rf '%s'", spec->buildSubdir); + spec->prep = rpmiobAppend(spec->prep, buf, 1); + } + + /* check if source is a ruby gem */ + { struct Source *sp; + for (sp = spec->sources; sp != NULL; sp = sp->next) { + if ((sp->flags & RPMFILE_SOURCE) && (sp->num == 0)) { + break; + } + } + if (sp != NULL) { + char *t = strrchr(sp->source, '.'); + if(t && !strcasecmp(t, ".gem")) + createDir = 1; + } + } + + /* if necessary, create and cd into the proper dir */ + if (createDir) { + char *mkdir_p; + mkdir_p = rpmExpand("%{?__mkdir_p}%{!?__mkdir_p:mkdir -p}", NULL); + if (!mkdir_p) + mkdir_p = xstrdup("mkdir -p"); + sprintf(buf, "%s '%s'\ncd '%s'", + mkdir_p, spec->buildSubdir, spec->buildSubdir); + mkdir_p = _free(mkdir_p); + spec->prep = rpmiobAppend(spec->prep, buf, 1); + } + + /* do the default action */ + if (!createDir && !skipDefaultAction) { + const char *chptr = doUntar(spec, 0, quietly); + if (chptr == NULL) + goto exit; + spec->prep = rpmiobAppend(spec->prep, chptr, 1); + } + + spec->prep = rpmiobAppend(spec->prep, rpmiobStr(before), 0); + + if (!createDir) { + sprintf(buf, "cd '%s'", spec->buildSubdir); + spec->prep = rpmiobAppend(spec->prep, buf, 1); + } + + if (createDir && !skipDefaultAction) { + const char * chptr = doUntar(spec, 0, quietly); + if (chptr == NULL) + goto exit; + spec->prep = rpmiobAppend(spec->prep, chptr, 1); + } + + spec->prep = rpmiobAppend(spec->prep, rpmiobStr(after), 0); + + /* XXX FIXME: owner & group fixes were conditioned on !geteuid() */ + /* Fix the owner, group, and permissions of the setup build tree */ + { /*@observer@*/ static const char *fixmacs[] = + { "%{_fixowner}", "%{_fixgroup}", "%{_fixperms}", NULL }; + const char ** fm; + + for (fm = fixmacs; *fm; fm++) { + const char *fix; + fix = rpmExpand(*fm, " .", NULL); + if (fix && *fix != '%') + spec->prep = rpmiobAppend(spec->prep, fix, 1); + fix = _free(fix); + } + } + ec = RPMRC_OK; + +exit: + before = rpmiobFree(before); + after = rpmiobFree(after); + return ec; +} + +#ifndef DYING +/** + * Parse %patch line. + * @param spec build info + * @param line current line from spec file + * @return RPMRC_OK on success + */ +static rpmRC doPatchMacro(Spec spec, const char * line) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies spec->prep, rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + char *s; + char *opt_b; + char *opt_d; + rpmuint32_t opt_P, opt_p, opt_R, opt_E, opt_F; + char buf[BUFSIZ], *bp; + rpmuint32_t patch_nums[1024]; /* XXX - we can only handle 1024 patches! */ + int patch_index, x; + + memset(patch_nums, 0, sizeof(patch_nums)); + opt_P = opt_p = opt_R = opt_E = 0; + opt_F = rpmExpandNumeric("%{?_default_patch_fuzz}%{!?_default_patch_fuzz:-1}"); + opt_b = NULL; + opt_d = NULL; + patch_index = 0; + + if (! strchr(" \t\n", line[6])) { + /* %patchN */ + sprintf(buf, "%%patch -P %s", line + 6); + } else { + strcpy(buf, line); + } + + /*@-internalglobs@*/ /* FIX: strtok has state */ + for (bp = buf; (s = strtok(bp, " \t\n")) != NULL;) { + if (bp) { /* remove 1st token (%patch) */ + bp = NULL; + continue; + } + if (!strcmp(s, "-P")) { + opt_P = 1; + } else if (!strcmp(s, "-R")) { + opt_R = 1; + } else if (!strcmp(s, "-E")) { + opt_E = 1; + } else if (!strcmp(s, "-b")) { + /* orig suffix */ + opt_b = strtok(NULL, " \t\n"); + if (! opt_b) { + rpmlog(RPMLOG_ERR, + _("line %d: Need arg to %%patch -b: %s\n"), + spec->lineNum, spec->line); + return RPMRC_FAIL; + } + } else if (!strcmp(s, "-z")) { + /* orig suffix */ + opt_b = strtok(NULL, " \t\n"); + if (! opt_b) { + rpmlog(RPMLOG_ERR, + _("line %d: Need arg to %%patch -z: %s\n"), + spec->lineNum, spec->line); + return RPMRC_FAIL; + } + } else if (!strcmp(s, "-F")) { + /* fuzz factor */ + const char * fnum = (!strchr(" \t\n", s[2]) + ? s+2 : strtok(NULL, " \t\n")); + char * end = NULL; + + opt_F = (fnum ? strtol(fnum, &end, 10) : 0); + if (! opt_F || *end) { + rpmlog(RPMLOG_ERR, + _("line %d: Bad arg to %%patch -F: %s\n"), + spec->lineNum, spec->line); + return RPMRC_FAIL; + } + } else if (!strcmp(s, "-d")) { + /* subdirectory */ + opt_d = strtok(NULL, " \t\n"); + if (! opt_d) { + rpmlog(RPMLOG_ERR, + _("line %d: Need arg to %%patch -d: %s\n"), + spec->lineNum, spec->line); + return RPMRC_FAIL; + } + } else if (!strncmp(s, "-p", sizeof("-p")-1)) { + /* unfortunately, we must support -pX */ + if (! strchr(" \t\n", s[2])) { + s = s + 2; + } else { + s = strtok(NULL, " \t\n"); + if (s == NULL) { + rpmlog(RPMLOG_ERR, + _("line %d: Need arg to %%patch -p: %s\n"), + spec->lineNum, spec->line); + return RPMRC_FAIL; + } + } + if (parseNum(s, &opt_p)) { + rpmlog(RPMLOG_ERR, + _("line %d: Bad arg to %%patch -p: %s\n"), + spec->lineNum, spec->line); + return RPMRC_FAIL; + } + } else { + /* Must be a patch num */ + if (patch_index == 1024) { + rpmlog(RPMLOG_ERR, _("Too many patches!\n")); + return RPMRC_FAIL; + } + if (parseNum(s, &(patch_nums[patch_index]))) { + rpmlog(RPMLOG_ERR, _("line %d: Bad arg to %%patch: %s\n"), + spec->lineNum, spec->line); + return RPMRC_FAIL; + } + patch_index++; + } + } + /*@=internalglobs@*/ + + /* All args processed */ + + if (! opt_P) { + s = doPatch(spec, 0, opt_p, opt_b, opt_R, opt_E, opt_F, opt_d); + if (s == NULL) + return RPMRC_FAIL; + spec->prep = rpmiobAppend(spec->prep, s, 1); + } + + for (x = 0; x < patch_index; x++) { + s = doPatch(spec, patch_nums[x], opt_p, opt_b, opt_R, opt_E, opt_F, opt_d); + if (s == NULL) + return RPMRC_FAIL; + spec->prep = rpmiobAppend(spec->prep, s, 1); + } + + return RPMRC_OK; +} +#endif + +static void prepFetchVerbose(/*@unused@*/ struct Source *sp, + /*@unused@*/ struct stat *st) + /*@globals internalState @*/ + /*@modifies internalState @*/ +{ + char *buf; + size_t buf_len; + int xx; + int i; + + if (!(rpmIsVerbose() && !quietly && (rpmBTArgs.buildAmount & RPMBUILD_FETCHSOURCE))) + return; + buf_len = 2*80; + if ((buf = (char *)malloc(buf_len)) == NULL) + return; + xx = snprintf(buf, buf_len, "%s%d:", (sp->flags & RPMFILE_SOURCE) ? "Source" : "Patch", sp->num); + for (i = (int)strlen(buf); i <= 11; i++) + buf[i] = ' '; + xx = snprintf(buf+i, buf_len-i, "%-52.52s", sp->source); + i = (int)strlen(buf); + if (st != NULL) + xx = snprintf(buf+i, buf_len-i, " %9lu Bytes\n", (unsigned long)st->st_size); + else + xx = snprintf(buf+i, buf_len-i, " ...MISSING\n"); + rpmlog(RPMLOG_NOTICE, "%s", buf); + buf = _free(buf); + return; +} + +/** + * Check that all sources/patches/icons exist locally, fetching if necessary. + */ +static int prepFetch(Spec spec) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ +{ +#if defined(RPM_VENDOR_OPENPKG) /* splitted-source-directory */ + const char *Smacro; +#endif + const char *Lmacro, *Lurlfn = NULL; + const char *Rmacro, *Rurlfn = NULL; + struct Source *sp; + struct stat st; + rpmRC rpmrc; + int ec, rc; + char *cp; + + /* XXX insure that %{_sourcedir} exists */ + rpmrc = RPMRC_OK; + Lurlfn = rpmGenPath(NULL, "%{?_sourcedir}", NULL); + if (Lurlfn != NULL && *Lurlfn != '\0') + rpmrc = rpmMkdirPath(Lurlfn, "_sourcedir"); + Lurlfn = _free(Lurlfn); + if (rpmrc != RPMRC_OK) + return -1; + + /* XXX insure that %{_patchdir} exists */ + rpmrc = RPMRC_OK; + Lurlfn = rpmGenPath(NULL, "%{?_patchdir}", NULL); + if (Lurlfn != NULL && *Lurlfn != '\0') + rpmrc = rpmMkdirPath(Lurlfn, "_patchdir"); + Lurlfn = _free(Lurlfn); + if (rpmrc != RPMRC_OK) + return -1; + + /* XXX insure that %{_icondir} exists */ + rpmrc = RPMRC_OK; + Lurlfn = rpmGenPath(NULL, "%{?_icondir}", NULL); + if (Lurlfn != NULL && *Lurlfn != '\0') + rpmrc = rpmMkdirPath(Lurlfn, "_icondir"); + Lurlfn = _free(Lurlfn); + if (rpmrc != RPMRC_OK) + return -1; + + if (rpmIsVerbose() && !quietly && (rpmBTArgs.buildAmount & RPMBUILD_FETCHSOURCE)) + rpmlog(RPMLOG_NOTICE, "Checking source and patch file(s):\n"); + + ec = 0; + for (sp = spec->sources; sp != NULL; sp = sp->next) { + +#if defined(RPM_VENDOR_OPENPKG) /* splitted-source-directory */ + Smacro = "%{?_specdir}/"; +#endif +#if defined(RPM_VENDOR_OPENPKG) /* splitted-source-directory */ + if (! (Lmacro = getSourceDir(sp->flags, sp->source))) +#else + if (! (Lmacro = getSourceDir(sp->flags))) +#endif + continue; + if (sp->flags & RPMFILE_SOURCE) { + Rmacro = "%{?_Rsourcedir}/"; + } else + if (sp->flags & RPMFILE_PATCH) { + Rmacro = "%{?_Rpatchdir}/"; + } else + if (sp->flags & RPMFILE_ICON) { + Rmacro = "%{?_Ricondir}/"; + } else + continue; + +#if defined(RPM_VENDOR_OPENPKG) /* splitted-source-directory */ + /* support splitted source directories, i.e., source files which + are alternatively placed into the .spec directory and picked + up from there, too. */ + Lurlfn = rpmGenPath(NULL, Smacro, sp->source); + rc = Lstat(Lurlfn, &st); + if (rc == 0) { + prepFetchVerbose(sp, &st); + goto bottom; + } +#endif + Lurlfn = rpmGenPath(NULL, Lmacro, sp->source); + rc = Lstat(Lurlfn, &st); + if (rc == 0) { +/*@-noeffect@*/ + prepFetchVerbose(sp, &st); +/*@=noeffect@*/ + goto bottom; + } +/*@-noeffect@*/ + prepFetchVerbose(sp, NULL); +/*@=noeffect@*/ + if (errno != ENOENT) { + ec++; + rpmlog(RPMLOG_ERR, _("Missing %s%d %s: %s\n"), + ((sp->flags & RPMFILE_SOURCE) ? "Source" : "Patch"), + sp->num, sp->source, strerror(ENOENT)); + goto bottom; + } + + /* try to fetch via macro-controlled remote locations */ + cp = rpmExpand(Rmacro, NULL); + if (cp != NULL && strcmp(cp, "/") != 0) { + cp = _free(cp); + Rurlfn = rpmGenPath(NULL, Rmacro, sp->source); + if (!(Rurlfn == NULL || Rurlfn[0] == '\0' || !strcmp(Rurlfn, "/") || !strcmp(Lurlfn, Rurlfn))) { + rpmlog(RPMLOG_NOTICE, _("Fetching(%s%d): %s\n"), + (sp->flags & RPMFILE_SOURCE) ? "Source" : "Patch", sp->num, Rurlfn); + rc = urlGetFile(Rurlfn, Lurlfn); + if (rc == 0) + goto bottom; + else { + rpmlog(RPMLOG_ERR, _("Fetching %s%d failed: %s\n"), + (sp->flags & RPMFILE_SOURCE) ? "Source" : "Patch", sp->num, ftpStrerror(rc)); + ec++; + } + } + } + cp = _free(cp); + + /* try to fetch from original location */ + rpmlog(RPMLOG_NOTICE, _("Fetching(%s%d): %s\n"), + (sp->flags & RPMFILE_SOURCE) ? "Source" : "Patch", sp->num, sp->fullSource); + rc = urlGetFile(sp->fullSource, Lurlfn); + if (rc == 0) + goto bottom; + else { + rpmlog(RPMLOG_ERR, _("Fetching %s%d failed: %s\n"), + (sp->flags & RPMFILE_SOURCE) ? "Source" : "Patch", sp->num, ftpStrerror(rc)); + ec++; + } + + rpmlog(RPMLOG_ERR, _("Missing %s%d: %s: %s\n"), + ((sp->flags & RPMFILE_SOURCE) ? "Source" : "Patch"), + sp->num, sp->source, strerror(ENOENT)); + ec++; + +bottom: + Lurlfn = _free(Lurlfn); + Rurlfn = _free(Rurlfn); + } + + return ec; +} + +int parsePrep(Spec spec, int verify) +{ + rpmParseState nextPart; + int res, rc; + rpmiob iob; + ARGV_t saveLines = NULL; + ARGV_t lines; + const char * cp; + int xx; + + if (spec->prep != NULL) { + rpmlog(RPMLOG_ERR, _("line %d: second %%prep\n"), spec->lineNum); + return RPMRC_FAIL; + } + + spec->prep = rpmiobNew(0); + + /* There are no options to %prep */ + if ((rc = readLine(spec, STRIP_NOTHING)) > 0) + return PART_NONE; + if (rc) + return rc; + + /* Check to make sure that all sources/patches are present. */ + if (verify) { + rc = prepFetch(spec); + if (rc) + return RPMRC_FAIL; + } + + iob = rpmiobNew(0); + + while ((nextPart = isPart(spec)) == PART_NONE) { + /* Need to expand the macros inline. That way we */ + /* can give good line number information on error. */ + iob = rpmiobAppend(iob, spec->line, 0); + if ((rc = readLine(spec, STRIP_NOTHING)) > 0) { + nextPart = PART_NONE; + break; + } + if (rc) + return rc; + } + + xx = argvSplit(&saveLines, rpmiobStr(iob), "\n"); + +/*@-usereleased@*/ + for (lines = saveLines; *lines; lines++) { + res = 0; + for (cp = *lines; *cp == ' ' || *cp == '\t'; cp++) + {}; + if (!strncmp(cp, "%setup", sizeof("%setup")-1)) { + res = doSetupMacro(spec, cp); +#ifndef DYING + } else if (! strncmp(cp, "%patch", sizeof("%patch")-1)) { + res = doPatchMacro(spec, cp); +#endif + } else { + spec->prep = rpmiobAppend(spec->prep, *lines, 1); + } + if (res && !spec->force) { + saveLines = argvFree(saveLines); + iob = rpmiobFree(iob); + return res; + } + } +/*@=usereleased@*/ + + saveLines = argvFree(saveLines); + iob = rpmiobFree(iob); + + return nextPart; +} diff --git a/rpm-5.4.9/build/parseReqs.c b/rpm-5.4.9/build/parseReqs.c new file mode 100644 index 0000000..dd0e84a --- /dev/null +++ b/rpm-5.4.9/build/parseReqs.c @@ -0,0 +1,204 @@ +/** \ingroup rpmbuild + * \file build/parseReqs.c + * Parse dependency tag from spec file or from auto-dependency generator. + */ + +#include "system.h" + +#include +#include +#include +#define _RPMEVR_INTERNAL +#include "rpmbuild.h" +#include "debug.h" + +/*@access EVR_t @*/ + +#define SKIPWHITE(_x) {while(*(_x) && (xisspace(*_x) || *(_x) == ',')) (_x)++;} +#define SKIPNONWHITE(_x){while(*(_x) &&!(xisspace(*_x) || *(_x) == ',')) (_x)++;} + +rpmRC parseRCPOT(Spec spec, Package pkg, const char *field, rpmTag tagN, + rpmuint32_t index, rpmsenseFlags tagflags) +{ + EVR_t evr = alloca(sizeof(*evr)); + const char *r, *re, *v, *ve; + char * N = NULL; + char * EVR = NULL; + rpmsenseFlags Flags; + Header h; + rpmRC rc = RPMRC_FAIL; /* assume failure */ + int ix; + + switch (tagN) { + case RPMTAG_PROVIDEFLAGS: + tagflags |= RPMSENSE_PROVIDES; + h = pkg->header; + break; + case RPMTAG_OBSOLETEFLAGS: + tagflags |= RPMSENSE_OBSOLETES; + h = pkg->header; + break; + case RPMTAG_CONFLICTFLAGS: + tagflags |= RPMSENSE_CONFLICTS; + h = pkg->header; + break; + case RPMTAG_BUILDCONFLICTS: + tagflags |= RPMSENSE_CONFLICTS; + h = spec->sourceHeader; + break; + case RPMTAG_PREREQ: + tagflags |= RPMSENSE_ANY; + h = pkg->header; + break; + case RPMTAG_TRIGGERPREIN: + tagflags |= RPMSENSE_TRIGGERPREIN; + h = pkg->header; + break; + case RPMTAG_TRIGGERIN: + tagflags |= RPMSENSE_TRIGGERIN; + h = pkg->header; + break; + case RPMTAG_TRIGGERPOSTUN: + tagflags |= RPMSENSE_TRIGGERPOSTUN; + h = pkg->header; + break; + case RPMTAG_TRIGGERUN: + tagflags |= RPMSENSE_TRIGGERUN; + h = pkg->header; + break; + case RPMTAG_BUILDSUGGESTS: + case RPMTAG_BUILDENHANCES: + tagflags |= RPMSENSE_MISSINGOK; + h = spec->sourceHeader; + break; + case RPMTAG_BUILDPREREQ: + case RPMTAG_BUILDREQUIRES: + tagflags |= RPMSENSE_ANY; + h = spec->sourceHeader; + break; + case RPMTAG_BUILDPROVIDES: + tagflags |= RPMSENSE_PROVIDES; + h = spec->sourceHeader; + break; + case RPMTAG_BUILDOBSOLETES: + tagflags |= RPMSENSE_OBSOLETES; + h = spec->sourceHeader; + break; + default: + case RPMTAG_REQUIREFLAGS: + tagflags |= RPMSENSE_ANY; + h = pkg->header; + break; + } + + for (r = field; *r != '\0'; r = re) { + size_t nr; + SKIPWHITE(r); + if (*r == '\0') + break; + + Flags = (tagflags & ~RPMSENSE_SENSEMASK); + + re = r; + SKIPNONWHITE(re); + N = xmalloc((re-r) + 1); + strncpy(N, r, (re-r)); + N[re-r] = '\0'; + + /* N must begin with alphanumeric, _, or /, or a macro. */ + nr = strlen(N); + ix = 0; + if (N[ix] == '!') + ix++; + if (!(xisalnum(N[ix]) || N[ix] == '_' || N[ix] == '/' + || (nr > 5 && N[ix] == '%' && N[ix+1] == '{' && N[nr-1] == '}'))) + { + rpmlog(RPMLOG_ERR, + _("line %d: Dependency \"%s\" must begin with alpha-numeric, '_' or '/': %s\n"), + spec->lineNum, N, spec->line); + goto exit; + } + + /* Parse EVR */ + v = re; + SKIPWHITE(v); + ve = v; + SKIPNONWHITE(ve); + + re = v; /* ==> next token (if no EVR found) starts here */ + + /* Check for possible logical operator */ + if (ve > v) { +/*@-mods@*/ + rpmsenseFlags F = rpmEVRflags(v, &ve); +/*@=mods@*/ + if (F && r[0] == '/') { + rpmlog(RPMLOG_ERR, + _("line %d: Versioned file name not permitted: %s\n"), + spec->lineNum, spec->line); + goto exit; + } + if (F) { + /* now parse EVR */ + v = ve; + SKIPWHITE(v); + ve = v; + SKIPNONWHITE(ve); + } + Flags &= ~RPMSENSE_SENSEMASK; + Flags |= F; + } + + if (Flags & RPMSENSE_SENSEMASK) { + char * t; + + EVR = t = xmalloc((ve-v) + 1); + nr = 0; + while (v < ve && *v != '\0') + switch ((int)*v) { + case '-': nr++; /*@fallthrough@*/ + default: *t++ = *v++; break; + } + *t = '\0'; + + if (*EVR == '\0') { + rpmlog(RPMLOG_ERR, _("line %d: %s must be specified: %s\n"), + spec->lineNum, "EVR", spec->line); + goto exit; + } + if (nr > 1) { + rpmlog(RPMLOG_ERR, _("line %d: Illegal char '-' in %s: %s\n"), + spec->lineNum, "EVR", spec->line); + goto exit; + } + /* EVR must be parseable (or a macro). */ + ix = 0; + nr = strlen(EVR); + if (!(nr > 3 && EVR[0] == '%' && EVR[1] == '{' && EVR[nr-1] == '}')) + { + memset(evr, 0, sizeof(*evr)); + ix = rpmEVRparse(xstrdup(EVR), evr); + evr->str = _free(evr->str); + } + if (ix != 0) { + rpmlog(RPMLOG_ERR, _("line %d: %s does not parse: %s\n"), + spec->lineNum, "EVR", spec->line); + goto exit; + } + re = ve; /* ==> next token after EVR string starts here */ + } else + EVR = NULL; + + (void) addReqProv(spec, h, tagN, N, EVR, Flags, index); + + N = _free(N); + EVR = _free(EVR); + + } + rc = RPMRC_OK; + +exit: + N = _free(N); + EVR = _free(EVR); + return rc; +} diff --git a/rpm-5.4.9/build/parseScript.c b/rpm-5.4.9/build/parseScript.c new file mode 100644 index 0000000..3f10826 --- /dev/null +++ b/rpm-5.4.9/build/parseScript.c @@ -0,0 +1,466 @@ +/** \ingroup rpmbuild + * \file build/parseScript.c + * Parse install-time script section from spec file. + */ + +#include "system.h" + +#include +#include +#include +#define _RPMEVR_INTERNAL +#include "rpmbuild.h" +#include "debug.h" + +#include + +/*@access poptContext @*/ /* compared with NULL */ + +/** + */ +static rpmuint32_t addTriggerIndex(Package pkg, const char *file, + const char *script, const char *prog) + /*@modifies pkg->triggerFiles @*/ +{ + struct TriggerFileEntry *tfe; + struct TriggerFileEntry *list = pkg->triggerFiles; + struct TriggerFileEntry *last = NULL; + rpmuint32_t index = 0; + + while (list) { + last = list; + list = list->next; + } + + if (last) + index = last->index + 1; + + tfe = xcalloc(1, sizeof(*tfe)); + + tfe->fileName = (file) ? xstrdup(file) : NULL; + tfe->script = (script && *script != '\0') ? xstrdup(script) : NULL; + tfe->prog = xstrdup(prog); + tfe->index = index; + tfe->next = NULL; + + if (last) + last->next = tfe; + else + pkg->triggerFiles = tfe; + + return index; +} + +/* these have to be global because of stupid compilers */ +/*@unchecked@*/ + /*@observer@*/ /*@null@*/ static const char *name = NULL; +/*@unchecked@*/ + /*@observer@*/ /*@null@*/ static const char *prog = NULL; +/*@unchecked@*/ + /*@observer@*/ /*@null@*/ static const char *file = NULL; +/*@unchecked@*/ + static struct poptOption optionsTable[] = { + { NULL, 'p', POPT_ARG_STRING, &prog, 'p', NULL, NULL}, + { NULL, 'n', POPT_ARG_STRING, &name, 'n', NULL, NULL}, + { NULL, 'f', POPT_ARG_STRING, &file, 'f', NULL, NULL}, + { 0, 0, 0, 0, 0, NULL, NULL} + }; + +/* %trigger is a strange combination of %pre and Requires: behavior */ +/* We can handle it by parsing the args before "--" in parseScript. */ +/* We then pass the remaining arguments to parseRCPOT, along with */ +/* an index we just determined. */ + +int parseScript(Spec spec, int parsePart) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + int xx; + + /* There are a few options to scripts: */ + /* */ + /* -n */ + /* -p */ + /* -p " ..." */ + /* -f */ + + char *p; + const char **progArgv = NULL; + int progArgc; + char *partname = NULL; + rpmTag reqtag = 0; + rpmTag tag = 0; + rpmsenseFlags tagflags = 0; + rpmTag progtag = 0; + int flag = PART_SUBNAME; + Package pkg; + rpmiob iob = NULL; + rpmParseState nextPart; + char reqargs[BUFSIZ]; + + int argc; + int arg; + const char **argv = NULL; + poptContext optCon = NULL; + rpmRC rc; + + reqargs[0] = '\0'; + /*@-mods@*/ + name = NULL; + prog = "/bin/sh"; + file = NULL; + /*@=mods@*/ + + switch (parsePart) { + case PART_PRE: + tag = RPMTAG_PREIN; + tagflags = RPMSENSE_SCRIPT_PRE; + progtag = RPMTAG_PREINPROG; + partname = "%pre"; + break; + case PART_POST: + tag = RPMTAG_POSTIN; + tagflags = RPMSENSE_SCRIPT_POST; + progtag = RPMTAG_POSTINPROG; + partname = "%post"; + break; + case PART_PREUN: + tag = RPMTAG_PREUN; + tagflags = RPMSENSE_SCRIPT_PREUN; + progtag = RPMTAG_PREUNPROG; + partname = "%preun"; + break; + case PART_POSTUN: + tag = RPMTAG_POSTUN; + tagflags = RPMSENSE_SCRIPT_POSTUN; + progtag = RPMTAG_POSTUNPROG; + partname = "%postun"; + break; + case PART_PRETRANS: + tag = RPMTAG_PRETRANS; + tagflags = 0; + progtag = RPMTAG_PRETRANSPROG; + partname = "%pretrans"; + break; + case PART_POSTTRANS: + tag = RPMTAG_POSTTRANS; + tagflags = 0; + progtag = RPMTAG_POSTTRANSPROG; + partname = "%posttrans"; + break; + case PART_VERIFYSCRIPT: + tag = RPMTAG_VERIFYSCRIPT; + tagflags = RPMSENSE_SCRIPT_VERIFY; + progtag = RPMTAG_VERIFYSCRIPTPROG; + partname = "%verifyscript"; + break; + case PART_TRIGGERPREIN: + tag = RPMTAG_TRIGGERSCRIPTS; + tagflags = 0; + reqtag = RPMTAG_TRIGGERPREIN; + progtag = RPMTAG_TRIGGERSCRIPTPROG; + partname = "%triggerprein"; + break; + case PART_TRIGGERIN: + tag = RPMTAG_TRIGGERSCRIPTS; + tagflags = 0; + reqtag = RPMTAG_TRIGGERIN; + progtag = RPMTAG_TRIGGERSCRIPTPROG; + partname = "%triggerin"; + break; + case PART_TRIGGERUN: + tag = RPMTAG_TRIGGERSCRIPTS; + tagflags = 0; + reqtag = RPMTAG_TRIGGERUN; + progtag = RPMTAG_TRIGGERSCRIPTPROG; + partname = "%triggerun"; + break; + case PART_TRIGGERPOSTUN: + tag = RPMTAG_TRIGGERSCRIPTS; + tagflags = 0; + reqtag = RPMTAG_TRIGGERPOSTUN; + progtag = RPMTAG_TRIGGERSCRIPTPROG; + partname = "%triggerpostun"; + break; + /* support "%sanitycheck" script/section */ + case PART_SANITYCHECK: + tag = RPMTAG_SANITYCHECK; + tagflags = RPMSENSE_SCRIPT_SANITYCHECK; + progtag = RPMTAG_SANITYCHECKPROG; + partname = "%sanitycheck"; + break; + } + + if (tag == RPMTAG_TRIGGERSCRIPTS) { + /* break line into two */ + p = strstr(spec->line, "--"); + if (!p) { + rpmlog(RPMLOG_ERR, _("line %d: triggers must have --: %s\n"), + spec->lineNum, spec->line); + return RPMRC_FAIL; + } + + *p = '\0'; + strcpy(reqargs, p + 2); + } + + if ((rc = poptParseArgvString(spec->line, &argc, &argv))) { + rpmlog(RPMLOG_ERR, _("line %d: Error parsing %s: %s\n"), + spec->lineNum, partname, poptStrerror(rc)); + return RPMRC_FAIL; + } + + optCon = poptGetContext(NULL, argc, argv, optionsTable, 0); + while ((arg = poptGetNextOpt(optCon)) > 0) { + switch (arg) { + case 'p': + if (prog[0] == '<') { + const char * s = prog; + while (s && s[1] && s[1] != '>') + s++; + if (s[1] != '>') { + rpmlog(RPMLOG_ERR, + _("line %d: embedded interpreter token must end " + "with \'>\': %s\n"), spec->lineNum, prog); + rc = RPMRC_FAIL; + goto exit; + } + } else if (prog[0] == '%') { + /* XXX check well-formed macro? */ + } else if (prog[0] != '/') { + rpmlog(RPMLOG_ERR, + _("line %d: script program must begin " + "with \'/\': %s\n"), spec->lineNum, prog); + rc = RPMRC_FAIL; + goto exit; + } + /*@switchbreak@*/ break; + case 'n': + flag = PART_NAME; + /*@switchbreak@*/ break; + } + } + + if (arg < -1) { + rpmlog(RPMLOG_ERR, _("line %d: Bad option %s: %s\n"), + spec->lineNum, + poptBadOption(optCon, POPT_BADOPTION_NOALIAS), + spec->line); + rc = RPMRC_FAIL; + goto exit; + } + + if (poptPeekArg(optCon)) { + /*@-mods@*/ + if (name == NULL) + name = poptGetArg(optCon); + /*@=mods@*/ + if (poptPeekArg(optCon)) { + rpmlog(RPMLOG_ERR, _("line %d: Too many names: %s\n"), + spec->lineNum, + spec->line); + rc = RPMRC_FAIL; + goto exit; + } + } + + if (lookupPackage(spec, name, flag, &pkg) != RPMRC_OK) { + rpmlog(RPMLOG_ERR, _("line %d: Package does not exist: %s\n"), + spec->lineNum, spec->line); + rc = RPMRC_FAIL; + goto exit; + } + + if (tag != RPMTAG_TRIGGERSCRIPTS) { + if (headerIsEntry(pkg->header, progtag)) { + rpmlog(RPMLOG_ERR, _("line %d: Second %s\n"), + spec->lineNum, partname); + rc = RPMRC_FAIL; + goto exit; + } + } + + if ((rc = poptParseArgvString(prog, &progArgc, &progArgv))) { + rpmlog(RPMLOG_ERR, _("line %d: Error parsing %s: %s\n"), + spec->lineNum, partname, poptStrerror(rc)); + rc = RPMRC_FAIL; + goto exit; + } + + iob = rpmiobNew(0); + if ((rc = readLine(spec, STRIP_NOTHING)) > 0) { + nextPart = PART_NONE; + } else { + if (rc) + goto exit; + while ((nextPart = isPart(spec)) == PART_NONE) { + iob = rpmiobAppend(iob, spec->line, 0); + if ((rc = readLine(spec, STRIP_NOTHING)) > 0) { + nextPart = PART_NONE; + break; + } + if (rc) + goto exit; + } + } + iob = rpmiobRTrim(iob); + p = rpmiobStr(iob); + +#ifdef WITH_LUA + if (!strcmp(progArgv[0], "")) { + rpmlua lua = NULL; /* Global state. */ + if (rpmluaCheckScript(lua, p, partname) != RPMRC_OK) { + rc = RPMRC_FAIL; + goto exit; + } + (void) rpmlibNeedsFeature(pkg->header, + "BuiltinLuaScripts", "4.2.2-1"); + } else +#endif +#ifdef WITH_AUGEAS + if (!strcmp(progArgv[0], "")) { + (void) rpmlibNeedsFeature(pkg->header, + "BuiltinAugeasScripts", "5.3-1"); + } else +#endif +#ifdef WITH_FICL + if (!strcmp(progArgv[0], "")) { + (void) rpmlibNeedsFeature(pkg->header, + "BuiltinFiclScripts", "5.2-1"); + } else +#endif +#ifdef WITH_GPSEE + if (!strcmp(progArgv[0], "")) { + (void) rpmlibNeedsFeature(pkg->header, + "BuiltinJavaScript", "5.2-1"); + } else +#endif +#ifdef WITH_PERLEMBED + if (!strcmp(progArgv[0], "")) { + (void) rpmlibNeedsFeature(pkg->header, + "BuiltinPerlScripts", "5.2-1"); + } else +#endif +#ifdef WITH_PYTHONEMBED + if (!strcmp(progArgv[0], "")) { + (void) rpmlibNeedsFeature(pkg->header, + "BuiltinPythonScripts", "5.2-1"); + } else +#endif +#ifdef WITH_RUBYEMBED + if (!strcmp(progArgv[0], "")) { + (void) rpmlibNeedsFeature(pkg->header, + "BuiltinRubyScripts", "5.2-1"); + } else +#endif +#ifdef WITH_SEMANAGE + if (!strcmp(progArgv[0], "")) { + (void) rpmlibNeedsFeature(pkg->header, + "BuiltinSpookScripts", "5.3-1"); + } else +#endif +#ifdef WITH_SQLITE + if (!strcmp(progArgv[0], "")) { + (void) rpmlibNeedsFeature(pkg->header, + "BuiltinSqlScripts", "5.3-1"); + } else +#endif +#ifdef WITH_SQUIRREL + if (!strcmp(progArgv[0], "")) { + (void) rpmlibNeedsFeature(pkg->header, + "BuiltinSquirrelScripts", "5.2-1"); + } else +#endif +#ifdef WITH_TCL + if (!strcmp(progArgv[0], "")) { + (void) rpmlibNeedsFeature(pkg->header, + "BuiltinTclScripts", "5.2-1"); + } else +#endif + if (progArgv[0][0] == '<') { + rpmlog(RPMLOG_ERR, + _("line %d: unsupported internal script: %s\n"), + spec->lineNum, progArgv[0]); + rc = RPMRC_FAIL; + goto exit; + } else + if (!(rpmExpandNumeric("%{?_disable_shell_interpreter_deps}") + && !strcmp(progArgv[0], "/bin/sh"))) + { + + (void) addReqProv(spec, pkg->header, RPMTAG_REQUIRENAME, + progArgv[0], NULL, (tagflags | RPMSENSE_INTERP), 0); + } + + /* Trigger script insertion is always delayed in order to */ + /* get the index right. */ + if (tag == RPMTAG_TRIGGERSCRIPTS) { + /* Add file/index/prog triple to the trigger file list */ + rpmuint32_t index = addTriggerIndex(pkg, file, p, progArgv[0]); + + /* Generate the trigger tags */ + if ((rc = parseRCPOT(spec, pkg, reqargs, reqtag, index, tagflags))) + goto exit; + } else { + if (progArgc == 1) { + he->tag = progtag; + he->t = RPM_STRING_TYPE; + he->p.str = *progArgv; + he->c = progArgc; + xx = headerPut(pkg->header, he, 0); + } else { + (void) rpmlibNeedsFeature(pkg->header, + "ScriptletInterpreterArgs", "4.0.3-1"); + he->tag = progtag; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = progArgv; + he->c = progArgc; + xx = headerPut(pkg->header, he, 0); + } + + if (*p != '\0') { + he->tag = tag; + he->t = RPM_STRING_TYPE; + he->p.str = p; + he->c = 1; + xx = headerPut(pkg->header, he, 0); + } + + if (file) { + switch (parsePart) { + case PART_PRE: + pkg->preInFile = xstrdup(file); + break; + case PART_POST: + pkg->postInFile = xstrdup(file); + break; + case PART_PREUN: + pkg->preUnFile = xstrdup(file); + break; + case PART_POSTUN: + pkg->postUnFile = xstrdup(file); + break; + case PART_PRETRANS: + pkg->preTransFile = xstrdup(file); + break; + case PART_POSTTRANS: + pkg->postTransFile = xstrdup(file); + break; + case PART_VERIFYSCRIPT: + pkg->verifyFile = xstrdup(file); + break; + case PART_SANITYCHECK: + pkg->sanityCheckFile = xstrdup(file); + break; + } + } + } + rc = (rpmRC) nextPart; + +exit: + iob = rpmiobFree(iob); + progArgv = _free(progArgv); + argv = _free(argv); + optCon = poptFreeContext(optCon); + + return rc; +} diff --git a/rpm-5.4.9/build/parseSpec.c b/rpm-5.4.9/build/parseSpec.c new file mode 100644 index 0000000..6791936 --- /dev/null +++ b/rpm-5.4.9/build/parseSpec.c @@ -0,0 +1,771 @@ +/** \ingroup rpmbuild + * \file build/parseSpec.c + * Top level dispatcher for spec file parsing. + */ + +#include "system.h" + +#include /* XXX fdGetFp */ +#include +#include + +#define _RPMTAG_INTERNAL /* XXX rpmTags->aTags */ +#include +#include "rpmds.h" +#include "rpmts.h" +#include "debug.h" + +/*@access headerTagIndices @*/ +/*@access FD_t @*/ /* compared with NULL */ + +/** + */ +/*@unchecked@*/ +static struct PartRec { + rpmParseState part; + size_t len; +/*@observer@*/ /*@null@*/ + const char * token; +} partList[] = { + { PART_PREAMBLE, 0, "%package"}, + { PART_PREP, 0, "%prep"}, + { PART_BUILD, 0, "%build"}, + { PART_INSTALL, 0, "%install"}, + { PART_CHECK, 0, "%check"}, + { PART_CLEAN, 0, "%clean"}, + { PART_PREUN, 0, "%preun"}, + { PART_POSTUN, 0, "%postun"}, + { PART_PRETRANS, 0, "%pretrans"}, + { PART_POSTTRANS, 0, "%posttrans"}, + { PART_PRE, 0, "%pre"}, + { PART_POST, 0, "%post"}, + { PART_FILES, 0, "%files"}, + { PART_CHANGELOG, 0, "%changelog"}, + { PART_DESCRIPTION, 0, "%description"}, + { PART_TRIGGERPOSTUN, 0, "%triggerpostun"}, + { PART_TRIGGERPREIN, 0, "%triggerprein"}, + { PART_TRIGGERUN, 0, "%triggerun"}, + { PART_TRIGGERIN, 0, "%triggerin"}, + { PART_TRIGGERIN, 0, "%trigger"}, + { PART_VERIFYSCRIPT, 0, "%verifyscript"}, + { PART_SANITYCHECK, 0, "%sanitycheck"}, /* support "%sanitycheck" scriptlet */ + {0, 0, NULL} +}; + +/** + */ +static inline void initParts(struct PartRec *p) + /*@modifies p->len @*/ +{ + for (; p->token != NULL; p++) + p->len = strlen(p->token); +} + +rpmParseState isPart(Spec spec) +{ + const char * line = spec->line; + struct PartRec *p; + rpmParseState nextPart = PART_NONE; /* assume plain text */ + + if (partList[0].len == 0) + initParts(partList); + + for (p = partList; p->token != NULL; p++) { + char c; + if (xstrncasecmp(line, p->token, p->len)) + continue; + c = *(line + p->len); + if (c == '\0' || xisspace(c)) { + nextPart = p->part; + goto exit; + } + } + + /* If %foo is not found explictly, check for an arbitrary %foo tag. */ + if (line[0] == '%') { + ARGV_t aTags = NULL; + const char * s; +/*@-noeffect@*/ + (void) tagName(0); /* XXX force arbitrary tags to be initialized. */ +/*@=noeffect@*/ + aTags = rpmTags->aTags; + if (aTags != NULL && aTags[0] != NULL) { + ARGV_t av; + s = tagCanonicalize(line+1); /* XXX +1 to skip leading '%' */ +#if defined(RPM_VENDOR_OPENPKG) /* wildcard-matching-arbitrary-tagnames */ + av = argvSearchLinear(aTags, s, argvFnmatchCasefold); +#else + av = argvSearch(aTags, s, argvStrcasecmp); +#endif + if (av != NULL) { + spec->foo = xrealloc(spec->foo, (spec->nfoo + 1) * sizeof(*spec->foo)); + spec->foo[spec->nfoo].str = xstrdup(s); + spec->foo[spec->nfoo].tag = tagGenerate(s); + spec->foo[spec->nfoo].iob = NULL; + spec->nfoo++; + nextPart = PART_ARBITRARY; + } + s = _free(s); + } + } + +exit: + return nextPart; +} + +/** + */ +static int matchTok(const char *token, const char *line) + /*@*/ +{ + const char *b, *be = line; + size_t toklen = strlen(token); + int rc = 0; + + while ( *(b = be) != '\0' ) { + SKIPSPACE(b); + be = b; + SKIPNONSPACE(be); + if (be == b) + break; + if (toklen != (size_t)(be-b) || xstrncasecmp(token, b, (be-b))) + continue; + rc = 1; + break; + } + + return rc; +} + +void handleComments(char *s) +{ + SKIPSPACE(s); + if (*s == '#') + *s = '\0'; +} + +/** + */ +static void forceIncludeFile(Spec spec, const char * fileName) + /*@modifies spec->fileStack @*/ +{ + OFI_t * ofi; + + ofi = newOpenFileInfo(); + ofi->fileName = xstrdup(fileName); + ofi->next = spec->fileStack; + spec->fileStack = ofi; +} + +/** + */ +static int restoreFirstChar(Spec spec) + /*@modifies spec->nextline, spec->nextpeekc @*/ +{ + /* Restore 1st char in (possible) next line */ + if (spec->nextline != NULL && spec->nextpeekc != '\0') { + *spec->nextline = spec->nextpeekc; + spec->nextpeekc = '\0'; + return 1; + } + return 0; +} + +/** + */ +static int copyNextLineFromOFI(Spec spec, OFI_t * ofi, rpmStripFlags strip) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies spec->nextline, spec->lbuf, spec->lbufPtr, + ofi->readPtr, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + char ch; + + /* Expand next line from file into line buffer */ + if (!(spec->nextline && *spec->nextline)) { + int pc = 0, bc = 0, nc = 0; + char *from, *to, *p; + to = spec->lbufPtr ? spec->lbufPtr : spec->lbuf; + from = ofi->readPtr; + ch = ' '; + while (from && *from && ch != '\n') + ch = *to++ = *from++; +/*@-mods@*/ + spec->lbufPtr = to; +/*@=mods@*/ + *to++ = '\0'; + ofi->readPtr = from; + + /* Check if we need another line before expanding the buffer. */ + for (p = spec->lbuf; *p; p++) { + switch (*p) { + case '\\': + switch (*(p+1)) { + case '\n': p++, nc = 1; /*@innerbreak@*/ break; + case '\0': /*@innerbreak@*/ break; + default: p++; /*@innerbreak@*/ break; + } + /*@switchbreak@*/ break; + case '\n': nc = 0; /*@switchbreak@*/ break; + case '%': + switch (*(p+1)) { + case '{': p++, bc++; /*@innerbreak@*/ break; + case '(': p++, pc++; /*@innerbreak@*/ break; + case '%': p++; /*@innerbreak@*/ break; + } + /*@switchbreak@*/ break; + case '{': if (bc > 0) bc++; /*@switchbreak@*/ break; + case '}': if (bc > 0) bc--; /*@switchbreak@*/ break; + case '(': if (pc > 0) pc++; /*@switchbreak@*/ break; + case ')': if (pc > 0) pc--; /*@switchbreak@*/ break; + } + } + + /* If it doesn't, ask for one more line. We need a better + * error code for this. */ + if (pc || bc || nc ) { +/*@-observertrans -readonlytrans@*/ + spec->nextline = ""; +/*@=observertrans =readonlytrans@*/ + return RPMRC_FAIL; + } +/*@-mods@*/ + spec->lbufPtr = spec->lbuf; +/*@=mods@*/ + + /* Don't expand macros (eg. %define) in false branch of %if clause */ + /* Also don't expand macros in %changelog if STRIP_NOEXPAND is set */ + /* (first line is omitted, so %date macro will be expanded */ + if (!(strip & STRIP_NOEXPAND)) { + if (spec->readStack->reading && + expandMacros(spec, spec->macros, spec->lbuf, spec->lbuf_len)) { + rpmlog(RPMLOG_ERR, _("line %d: %s\n"), + spec->lineNum, spec->lbuf); + return RPMRC_FAIL; + } + } + spec->nextline = spec->lbuf; + } + return 0; +} + +/** + */ +static int copyNextLineFinish(Spec spec, int strip) + /*@modifies spec->line, spec->nextline, spec->nextpeekc @*/ +{ + char *last; + char ch; + + /* Find next line in expanded line buffer */ + spec->line = last = spec->nextline; + ch = ' '; + while (*spec->nextline && ch != '\n') { + ch = *spec->nextline++; + if (!xisspace(ch)) + last = spec->nextline; + } + + /* Save 1st char of next line in order to terminate current line. */ + if (*spec->nextline != '\0') { + spec->nextpeekc = *spec->nextline; + *spec->nextline = '\0'; + } + + if (strip & STRIP_COMMENTS) + handleComments(spec->line); + + if (strip & STRIP_TRAILINGSPACE) + *last = '\0'; + + return 0; +} + +/** + */ +static int readLineFromOFI(Spec spec, OFI_t *ofi) + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies ofi, spec->fileStack, spec->lineNum, spec->sl, + fileSystem, internalState @*/ +{ +retry: + /* Make sure the current file is open */ + if (ofi->fd == NULL) { + ofi->fd = Fopen(ofi->fileName, "r.fpio"); + if (ofi->fd == NULL || Ferror(ofi->fd)) { + /* XXX Fstrerror */ + rpmlog(RPMLOG_ERR, _("Unable to open %s: %s\n"), + ofi->fileName, Fstrerror(ofi->fd)); + return RPMRC_FAIL; + } + spec->lineNum = ofi->lineNum = 0; + } + + /* Make sure we have something in the read buffer */ + if (!(ofi->readPtr && *(ofi->readPtr))) { + /*@-type@*/ /* FIX: cast? */ + FILE * f = fdGetFp(ofi->fd); + /*@=type@*/ + if (f == NULL || !fgets(ofi->readBuf, (int)sizeof(ofi->readBuf), f)) { + /* EOF */ + if (spec->readStack->next) { + rpmlog(RPMLOG_ERR, _("Unclosed %%if\n")); + return RPMRC_FAIL; + } + + /* remove this file from the stack */ + spec->fileStack = ofi->next; + (void) Fclose(ofi->fd); + ofi->fileName = _free(ofi->fileName); +/*@-temptrans@*/ + ofi = _free(ofi); +/*@=temptrans@*/ + + /* only on last file do we signal EOF to caller */ + ofi = spec->fileStack; + if (ofi == NULL) + return 1; + + /* otherwise, go back and try the read again. */ + goto retry; + } + ofi->readPtr = ofi->readBuf; + ofi->lineNum++; + spec->lineNum = ofi->lineNum; + if (spec->sl) { + speclines sl = spec->sl; + if (sl->sl_nlines == sl->sl_nalloc) { + sl->sl_nalloc += 100; + sl->sl_lines = (char **) xrealloc(sl->sl_lines, + sl->sl_nalloc * sizeof(*(sl->sl_lines))); + } + sl->sl_lines[sl->sl_nlines++] = xstrdup(ofi->readBuf); + } + } + return 0; +} + +int readLine(Spec spec, rpmStripFlags strip) +{ + char *s; + int match; + struct ReadLevelEntry *rl; + OFI_t *ofi = spec->fileStack; + int rc; + + if (ofi == NULL) /* XXX segfault avoidance */ + return 1; + if (!restoreFirstChar(spec)) { + retry: + if ((rc = readLineFromOFI(spec, ofi)) != 0) + return rc; + + /* Copy next file line into the spec line buffer */ + + if ((rc = copyNextLineFromOFI(spec, ofi, strip)) != 0) { + if (rc == RPMRC_FAIL) + goto retry; + return rc; + } + } + + (void) copyNextLineFinish(spec, strip); + + s = spec->line; + SKIPSPACE(s); + + match = -1; + if (!(strip & STRIP_NOEXPAND)) { + if (!spec->readStack->reading && !strncmp("%if", s, sizeof("%if")-1)) { + match = 0; + } else if (! strncmp("%ifarch", s, sizeof("%ifarch")-1)) { + const char *arch = rpmExpand("%{_target_cpu}", NULL); + s += 7; + match = matchTok(arch, s); + arch = _free(arch); + } else if (! strncmp("%ifnarch", s, sizeof("%ifnarch")-1)) { + const char *arch = rpmExpand("%{_target_cpu}", NULL); + s += 8; + match = !matchTok(arch, s); + arch = _free(arch); + } else if (! strncmp("%ifos", s, sizeof("%ifos")-1)) { + const char *os = rpmExpand("%{_target_os}", NULL); + s += 5; + match = matchTok(os, s); + os = _free(os); + } else if (! strncmp("%ifnos", s, sizeof("%ifnos")-1)) { + const char *os = rpmExpand("%{_target_os}", NULL); + s += 6; + match = !matchTok(os, s); + os = _free(os); + } else if (! strncmp("%if", s, sizeof("%if")-1)) { + s += 3; + match = parseExpressionBoolean(spec, s); + if (match < 0) { + rpmlog(RPMLOG_ERR, + _("%s:%d: parseExpressionBoolean returns %d\n"), + ofi->fileName, ofi->lineNum, match); + return RPMRC_FAIL; + } + } else if (! strncmp("%else", s, sizeof("%else")-1)) { + s += 5; + if (! spec->readStack->next) { + /* Got an else with no %if ! */ + rpmlog(RPMLOG_ERR, + _("%s:%d: Got a %%else with no %%if\n"), + ofi->fileName, ofi->lineNum); + return RPMRC_FAIL; + } + spec->readStack->reading = + spec->readStack->next->reading && ! spec->readStack->reading; + spec->line[0] = '\0'; + } else if (! strncmp("%endif", s, sizeof("%endif")-1)) { + s += 6; + if (! spec->readStack->next) { + /* Got an end with no %if ! */ + rpmlog(RPMLOG_ERR, + _("%s:%d: Got a %%endif with no %%if\n"), + ofi->fileName, ofi->lineNum); + return RPMRC_FAIL; + } + rl = spec->readStack; + spec->readStack = spec->readStack->next; + free(rl); + spec->line[0] = '\0'; + } else if (spec->readStack->reading && ! strncmp("%include", s, sizeof("%include")-1)) { + char *fileName, *endFileName, *p; + + s += 8; + fileName = s; + if (! xisspace(*fileName)) { + rpmlog(RPMLOG_ERR, _("malformed %%include statement\n")); + return RPMRC_FAIL; + } + SKIPSPACE(fileName); + endFileName = fileName; + SKIPNONSPACE(endFileName); + p = endFileName; + SKIPSPACE(p); + if (*p != '\0') { + rpmlog(RPMLOG_ERR, _("malformed %%include statement\n")); + return RPMRC_FAIL; + } + *endFileName = '\0'; + + forceIncludeFile(spec, fileName); + + ofi = spec->fileStack; + goto retry; + } + } + + if (match != -1) { + rl = xmalloc(sizeof(*rl)); + rl->reading = spec->readStack->reading && match; + rl->next = spec->readStack; + spec->readStack = rl; + spec->line[0] = '\0'; + } + + if (! spec->readStack->reading) { + spec->line[0] = '\0'; + } + + /*@-compmempass@*/ /* FIX: spec->readStack->next should be dependent */ + return 0; + /*@=compmempass@*/ +} + +void closeSpec(Spec spec) +{ + OFI_t *ofi; + + while (spec->fileStack) { + ofi = spec->fileStack; + spec->fileStack = spec->fileStack->next; + if (ofi->fd) (void) Fclose(ofi->fd); + ofi->fileName = _free(ofi->fileName); + ofi = _free(ofi); + } +} + +/** + */ +static inline int genSourceRpmName(Spec spec) + /*@globals internalState @*/ + /*@modifies spec->sourceRpmName, spec->packages->header, + internalState @*/ +{ + if (spec->sourceRpmName == NULL) { + const char *N, *V, *R; + char fileName[BUFSIZ]; + + (void) headerNEVRA(spec->packages->header, &N, NULL, &V, &R, NULL); + (void) snprintf(fileName, sizeof(fileName), "%s-%s-%s.%ssrc.rpm", + N, V, R, spec->noSource ? "no" : ""); + fileName[sizeof(fileName)-1] = '\0'; + N = _free(N); + V = _free(V); + R = _free(R); + spec->sourceRpmName = xstrdup(fileName); + } + + return 0; +} + +/*@-redecl@*/ +/*@unchecked@*/ +extern int noLang; /* XXX FIXME: pass as arg */ +/*@=redecl@*/ + +/*@todo Skip parse recursion if os is not compatible. @*/ +int parseSpec(rpmts ts, const char *specFile, const char *rootURL, + int recursing, const char *passPhrase, + const char *cookie, int anyarch, int force, int verify) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmParseState parsePart = PART_PREAMBLE; + int initialPackage = 1; + Package pkg; + Spec spec; + int xx; + + /* Set up a new Spec structure with no packages. */ + spec = newSpec(); + + /* + * Note: rpmGetPath should guarantee a "canonical" path. That means + * that the following pathologies should be weeded out: + * //bin//sh + * //usr//bin/ + * /.././../usr/../bin//./sh (XXX FIXME: dots not handled yet) + */ + spec->specFile = rpmGetPath(specFile, NULL); + spec->fileStack = newOpenFileInfo(); + spec->fileStack->fileName = xstrdup(spec->specFile); + + spec->recursing = recursing; + spec->toplevel = (!recursing ? 1 : 0); + spec->anyarch = anyarch; + spec->force = force; + + if (rootURL) + spec->rootURL = xstrdup(rootURL); + if (passPhrase) + spec->passPhrase = xstrdup(passPhrase); + if (cookie) + spec->cookie = xstrdup(cookie); + + spec->timeCheck = rpmExpandNumeric("%{_timecheck}"); + + /* XXX %_docdir should be set somewhere else. */ + addMacro(NULL, "_docdir", NULL, "%{_defaultdocdir}", RMIL_SPEC); + + /* All the parse*() functions expect to have a line pre-read */ + /* in the spec's line buffer. Except for parsePreamble(), */ + /* which handles the initial entry into a spec file. */ + + /*@-infloops@*/ /* LCL: parsePart is modified @*/ + while (parsePart > PART_NONE) { + int goterror = 0; + + switch (parsePart) { + default: + goterror = 1; + /*@switchbreak@*/ break; + case PART_PREAMBLE: + parsePart = parsePreamble(spec, initialPackage); + initialPackage = 0; + /*@switchbreak@*/ break; + case PART_PREP: + parsePart = parsePrep(spec, verify); + /*@switchbreak@*/ break; + case PART_BUILD: + case PART_INSTALL: + case PART_CHECK: + case PART_CLEAN: + case PART_ARBITRARY: + parsePart = parseBuildInstallClean(spec, parsePart); + /*@switchbreak@*/ break; + case PART_CHANGELOG: + parsePart = parseChangelog(spec); + /*@switchbreak@*/ break; + case PART_DESCRIPTION: + parsePart = parseDescription(spec); + /*@switchbreak@*/ break; + + case PART_PRE: + case PART_POST: + case PART_PREUN: + case PART_POSTUN: + case PART_PRETRANS: + case PART_POSTTRANS: + case PART_VERIFYSCRIPT: + case PART_SANITYCHECK: + case PART_TRIGGERPREIN: + case PART_TRIGGERIN: + case PART_TRIGGERUN: + case PART_TRIGGERPOSTUN: + parsePart = parseScript(spec, parsePart); + /*@switchbreak@*/ break; + + case PART_FILES: + parsePart = parseFiles(spec); + /*@switchbreak@*/ break; + + case PART_NONE: /* XXX avoid gcc whining */ + case PART_LAST: + case PART_BUILDARCHITECTURES: + /*@switchbreak@*/ break; + } + + if (goterror || parsePart >= PART_LAST) { + spec = freeSpec(spec); + return parsePart; + } + + /* Detect whether BuildArch: is toplevel or within %package. */ + if (spec->toplevel && parsePart != PART_BUILDARCHITECTURES) + spec->toplevel = 0; + + /* Restart parse iff toplevel BuildArch: is encountered. */ + if (spec->toplevel && parsePart == PART_BUILDARCHITECTURES) { + int index; + int x; + + closeSpec(spec); + + /* LCL: sizeof(spec->BASpecs[0]) -nullderef whine here */ + spec->BASpecs = xcalloc(spec->BACount, sizeof(*spec->BASpecs)); + index = 0; + if (spec->BANames != NULL) + for (x = 0; x < spec->BACount; x++) { + + /* XXX DIEDIEDIE: filter irrelevant platforms here. */ + + /* XXX there's more to do than set the macro. */ + addMacro(NULL, "_target_cpu", NULL, spec->BANames[x], RMIL_RPMRC); + spec->BASpecs[index] = NULL; + if (parseSpec(ts, specFile, spec->rootURL, 1, + passPhrase, cookie, anyarch, force, verify) + || (spec->BASpecs[index] = rpmtsSetSpec(ts, NULL)) == NULL) + { + spec->BACount = index; +/*@-nullstate@*/ + spec = freeSpec(spec); + return RPMRC_FAIL; +/*@=nullstate@*/ + } + + /* XXX there's more to do than delete the macro. */ + delMacro(NULL, "_target_cpu"); + index++; + } + + spec->BACount = index; + if (! index) { + rpmlog(RPMLOG_ERR, + _("No compatible architectures found for build\n")); +/*@-nullstate@*/ + spec = freeSpec(spec); + return RPMRC_FAIL; +/*@=nullstate@*/ + } + + /* + * Return the 1st child's fully parsed Spec structure. + * The restart of the parse when encountering BuildArch + * causes problems for "rpm -q --specfile". This is + * still a hack because there may be more than 1 arch + * specified (unlikely but possible.) There's also the + * further problem that the macro context, particularly + * %{_target_cpu}, disagrees with the info in the header. + */ + if (spec->BACount >= 1) { + Spec nspec = spec->BASpecs[0]; + spec->BASpecs = _free(spec->BASpecs); + spec = freeSpec(spec); + spec = nspec; + } + + (void) rpmtsSetSpec(ts, spec); + return 0; + } + } + /*@=infloops@*/ /* LCL: parsePart is modified @*/ + + /* Initialize source RPM name. */ + (void) genSourceRpmName(spec); + + /* Check for description in each package and add arch and os */ + { + const char *platform = rpmExpand("%{_target_platform}", NULL); + const char *platformNoarch = NULL; + const char *arch = rpmExpand("%{_target_cpu}", NULL); + const char *os = rpmExpand("%{_target_os}", NULL); + + for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { + he->tag = RPMTAG_OS; + he->t = RPM_STRING_TYPE; + /* XXX todo: really need "noos" like pkg->noarch somewhen. */ + he->p.str = os; + he->c = 1; + xx = headerPut(pkg->header, he, 0); + + he->tag = RPMTAG_ARCH; + he->t = RPM_STRING_TYPE; + he->p.str = (pkg->noarch ? "noarch" : arch); + he->c = 1; + xx = headerPut(pkg->header, he, 0); + + /* + * If "noarch" subpackages of different arch, we need + * to use a separate platform tag for these (mdvbz#61746). + */ + if(pkg->noarch && !platformNoarch && strcmp(arch, "noarch")) { + addMacro(NULL, "_target_cpu", NULL, "noarch", RMIL_RPMRC); + platformNoarch = rpmExpand("%{_target_platform}", NULL); + addMacro(NULL, "_target_cpu", NULL, arch, RMIL_RPMRC); + } + he->tag = RPMTAG_PLATFORM; + he->t = RPM_STRING_TYPE; + he->p.str = (pkg->noarch && platformNoarch ? platformNoarch : platform); + he->c = 1; + xx = headerPut(pkg->header, he, 0); + + he->tag = RPMTAG_SOURCERPM; + he->t = RPM_STRING_TYPE; + he->p.str = spec->sourceRpmName; + he->c = 1; + xx = headerPut(pkg->header, he, 0); + + if (!headerIsEntry(pkg->header, RPMTAG_DESCRIPTION)) { + he->tag = RPMTAG_NVRA; + xx = headerGet(pkg->header, he, 0); + rpmlog(RPMLOG_ERR, _("Package has no %%description: %s\n"), + he->p.str); + he->p.ptr = _free(he->p.ptr); + platform = _free(platform); + platformNoarch = _free(platformNoarch); + arch = _free(arch); + os = _free(os); + spec = freeSpec(spec); + return RPMRC_FAIL; + } + + pkg->ds = rpmdsThis(pkg->header, RPMTAG_REQUIRENAME, RPMSENSE_EQUAL); + + } + + platform = _free(platform); + platformNoarch = _free(platformNoarch); + arch = _free(arch); + os = _free(os); + } + + closeSpec(spec); + (void) rpmtsSetSpec(ts, spec); + + return 0; +} diff --git a/rpm-5.4.9/build/poptBT.c b/rpm-5.4.9/build/poptBT.c new file mode 100644 index 0000000..0b6b40f --- /dev/null +++ b/rpm-5.4.9/build/poptBT.c @@ -0,0 +1,224 @@ +/** \ingroup rpmcli + * \file build/poptBT.c + * Popt tables for build modes. + */ + +#include "system.h" + +#include +#include +#include + +#include +#include + +#include + +#include "build.h" + +#include + +#include "debug.h" + +/*@unchecked@*/ +extern int _pkg_debug; +/*@unchecked@*/ +extern int _spec_debug; + +/*@unchecked@*/ +struct rpmBuildArguments_s rpmBTArgs; + +#define POPT_NOLANG -1012 + +#define POPT_REBUILD 0x4220 +#define POPT_RECOMPILE 0x4320 +#define POPT_BA 0x6261 +#define POPT_BB 0x6262 +#define POPT_BC 0x6263 +#define POPT_BI 0x6269 +#define POPT_BL 0x626c +#define POPT_BP 0x6270 +#define POPT_BS 0x6273 +#define POPT_BT 0x6274 /* support "%track" script/section */ +#define POPT_BF 0x6266 +#define POPT_TA 0x7461 +#define POPT_TB 0x7462 +#define POPT_TC 0x7463 +#define POPT_TI 0x7469 +#define POPT_TL 0x746c +#define POPT_TP 0x7470 +#define POPT_TS 0x7473 + +/*@unchecked@*/ +int _rpmbuildFlags = 3; + +/*@-exportlocal@*/ +/*@unchecked@*/ +int noLang = 0; +/*@=exportlocal@*/ + +/** + */ +static void buildArgCallback( /*@unused@*/ poptContext con, + /*@unused@*/ enum poptCallbackReason reason, + const struct poptOption * opt, + /*@unused@*/ const char * arg, + /*@unused@*/ const void * data) +{ + BTA_t rba = &rpmBTArgs; + + switch (opt->val) { + case POPT_REBUILD: + case POPT_RECOMPILE: + case POPT_BA: + case POPT_BB: + case POPT_BC: + case POPT_BI: + case POPT_BL: + case POPT_BP: + case POPT_BS: + case POPT_BT: /* support "%track" script/section */ + case POPT_BF: + case POPT_TA: + case POPT_TB: + case POPT_TC: + case POPT_TI: + case POPT_TL: + case POPT_TP: + case POPT_TS: + if (rba->buildMode == '\0' && rba->buildChar == '\0') { + rba->buildMode = (char)((((unsigned int)opt->val) >> 8) & 0xff); + rba->buildChar = (char)(opt->val & 0xff); + } + break; + + case POPT_NOLANG: rba->noLang = 1; break; + + case RPMCLI_POPT_NODIGEST: + rba->qva_flags |= VERIFY_DIGEST; + break; + + case RPMCLI_POPT_NOSIGNATURE: + rba->qva_flags |= VERIFY_SIGNATURE; + break; + + case RPMCLI_POPT_NOHDRCHK: + rba->qva_flags |= VERIFY_HDRCHK; + break; + + case RPMCLI_POPT_NODEPS: + rba->noDeps = 1; + break; + } +} + +/** + */ +/*@-bitwisesigned -compmempass @*/ +/*@unchecked@*/ +struct poptOption rpmBuildPoptTable[] = { +/*@-type@*/ /* FIX: cast? */ + { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, + buildArgCallback, 0, NULL, NULL }, +/*@=type@*/ + + { "bp", 0, POPT_ARGFLAG_ONEDASH, NULL, POPT_BP, + N_("build through %prep (unpack sources and apply patches) from "), + N_("") }, + { "bc", 0, POPT_ARGFLAG_ONEDASH, NULL, POPT_BC, + N_("build through %build (%prep, then compile) from "), + N_("") }, + { "bi", 0, POPT_ARGFLAG_ONEDASH, NULL, POPT_BI, + N_("build through %install (%prep, %build, then install) from "), + N_("") }, + { "bl", 0, POPT_ARGFLAG_ONEDASH, NULL, POPT_BL, + N_("verify %files section from "), + N_("") }, + { "ba", 0, POPT_ARGFLAG_ONEDASH, NULL, POPT_BA, + N_("build source and binary packages from "), + N_("") }, + { "bb", 0, POPT_ARGFLAG_ONEDASH, NULL, POPT_BB, + N_("build binary package only from "), + N_("") }, + { "bs", 0, POPT_ARGFLAG_ONEDASH, NULL, POPT_BS, + N_("build source package only from "), + N_("") }, + /* support "%track" script/section */ + { "bt", 0, POPT_ARGFLAG_ONEDASH, 0, POPT_BT, + N_("track versions of sources from "), + N_("") }, + { "bf", 0, POPT_ARGFLAG_ONEDASH, 0, POPT_BF, + N_("fetch missing source and patch files"), + N_("") }, + + { "tp", 0, POPT_ARGFLAG_ONEDASH, NULL, POPT_TP, + N_("build through %prep (unpack sources and apply patches) from "), + N_("") }, + { "tc", 0, POPT_ARGFLAG_ONEDASH, NULL, POPT_TC, + N_("build through %build (%prep, then compile) from "), + N_("") }, + { "ti", 0, POPT_ARGFLAG_ONEDASH, NULL, POPT_TI, + N_("build through %install (%prep, %build, then install) from "), + N_("") }, + { "tl", 0, POPT_ARGFLAG_ONEDASH|POPT_ARGFLAG_DOC_HIDDEN, NULL, POPT_TL, + N_("verify %files section from "), + N_("") }, + { "ta", 0, POPT_ARGFLAG_ONEDASH, NULL, POPT_TA, + N_("build source and binary packages from "), + N_("") }, + { "tb", 0, POPT_ARGFLAG_ONEDASH, NULL, POPT_TB, + N_("build binary package only from "), + N_("") }, + { "ts", 0, POPT_ARGFLAG_ONEDASH, NULL, POPT_TS, + N_("build source package only from "), + N_("") }, + + { "rebuild", '\0', 0, NULL, POPT_REBUILD, + N_("build binary package from "), + N_("") }, + { "recompile", '\0', 0, NULL, POPT_RECOMPILE, + N_("build through %install (%prep, %build, then install) from "), + N_("") }, + + { "clean", '\0', POPT_BIT_SET, &rpmBTArgs.buildAmount, RPMBUILD_RMBUILD, + N_("remove build tree when done"), NULL}, + { "nobuild", '\0', POPT_ARG_VAL, &rpmBTArgs.noBuild, 1, + N_("do not execute any stages of the build"), NULL }, + { "nodeps", '\0', 0, NULL, RPMCLI_POPT_NODEPS, + N_("do not verify build dependencies"), NULL }, + + { "noautoprov", '\0', POPT_BIT_CLR|POPT_ARGFLAG_DOC_HIDDEN, &_rpmbuildFlags, 1, + N_("disable automagic Provides: extraction"), NULL }, + { "noautoreq", '\0', POPT_BIT_CLR|POPT_ARGFLAG_DOC_HIDDEN, &_rpmbuildFlags, 2, + N_("disable automagic Requires: extraction"), NULL }, + { "notinlsb", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &_rpmbuildFlags, 4, + N_("disable tags forbidden by LSB"), NULL }, + + { "nodigest", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NODIGEST, + N_("don't verify package digest(s)"), NULL }, + { "nohdrchk", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NOHDRCHK, + N_("don't verify database header(s) when retrieved"), NULL }, + { "nosignature", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NOSIGNATURE, + N_("don't verify package signature(s)"), NULL }, + + { "pkgdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_pkg_debug, -1, + N_("Debug Package objects"), NULL}, + { "specdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_spec_debug, -1, + N_("Debug Spec objects"), NULL}, + + { "nolang", '\0', POPT_ARGFLAG_DOC_HIDDEN, &noLang, POPT_NOLANG, + N_("do not accept i18n msgstr's from specfile"), NULL}, + { "rmsource", '\0', POPT_BIT_SET, &rpmBTArgs.buildAmount, RPMBUILD_RMSOURCE, + N_("remove sources when done"), NULL}, + { "rmspec", '\0', POPT_BIT_SET, &rpmBTArgs.buildAmount, RPMBUILD_RMSPEC, + N_("remove specfile when done"), NULL}, + { "short-circuit", '\0', POPT_ARG_VAL, &rpmBTArgs.shortCircuit, 1, + N_("skip straight to specified stage (only for c,i)"), NULL }, + { "sign", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &rpmBTArgs.sign, 1, + N_("generate PGP/GPG signature"), NULL }, + { "target", '\0', POPT_ARG_STRING, NULL, RPMCLI_POPT_TARGETPLATFORM, + N_("override target platform"), N_("CPU-VENDOR-OS") }, + + POPT_TABLEEND +}; +/*@=bitwisesigned =compmempass @*/ diff --git a/rpm-5.4.9/build/reqprov.c b/rpm-5.4.9/build/reqprov.c new file mode 100644 index 0000000..9911918 --- /dev/null +++ b/rpm-5.4.9/build/reqprov.c @@ -0,0 +1,218 @@ +/** \ingroup rpmbuild + * \file build/reqprov.c + * Add dependency tags to package header(s). + */ + +#include "system.h" + +#include +#include +#define _RPMEVR_INTERNAL +#include "rpmbuild.h" +#include "debug.h" + +int addReqProv(/*@unused@*/ Spec spec, Header h, + /*@unused@*/ rpmTag tagN, + const char * N, const char * EVR, rpmsenseFlags Flags, + rpmuint32_t index) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + const char ** names; + rpmTag nametag = 0; + rpmTag versiontag = 0; + rpmTag flagtag = 0; + rpmTag indextag = 0; + int len; + rpmsenseFlags extra = RPMSENSE_ANY; + int xx; + + if (Flags & RPMSENSE_PROVIDES) { + nametag = RPMTAG_PROVIDENAME; + versiontag = RPMTAG_PROVIDEVERSION; + flagtag = RPMTAG_PROVIDEFLAGS; + extra = Flags & RPMSENSE_FIND_PROVIDES; + } else if (Flags & RPMSENSE_OBSOLETES) { + nametag = RPMTAG_OBSOLETENAME; + versiontag = RPMTAG_OBSOLETEVERSION; + flagtag = RPMTAG_OBSOLETEFLAGS; + } else if (Flags & RPMSENSE_CONFLICTS) { + nametag = RPMTAG_CONFLICTNAME; + versiontag = RPMTAG_CONFLICTVERSION; + flagtag = RPMTAG_CONFLICTFLAGS; + } else if (Flags & RPMSENSE_TRIGGER) { + nametag = RPMTAG_TRIGGERNAME; + versiontag = RPMTAG_TRIGGERVERSION; + flagtag = RPMTAG_TRIGGERFLAGS; + indextag = RPMTAG_TRIGGERINDEX; + extra = Flags & RPMSENSE_TRIGGER; + } else { + nametag = RPMTAG_REQUIRENAME; + versiontag = RPMTAG_REQUIREVERSION; + flagtag = RPMTAG_REQUIREFLAGS; + extra = Flags & _ALL_REQUIRES_MASK; + } + + Flags = (Flags & RPMSENSE_SENSEMASK) | extra; + + if (EVR == NULL) + EVR = ""; +#if defined(RPM_VENDOR_MANDRIVA) + /* Check that provide isn't duplicate of package */ + else if (nametag == RPMTAG_PROVIDENAME) { + const char *NEVR; + size_t len; + int duplicate; + + len = strlen(N); + NEVR = headerSprintf(h, "%{NAME}-%|EPOCH?{%{EPOCH}:}|%{VERSION}-%{RELEASE}", NULL, NULL, NULL); + duplicate = !strncmp(NEVR, N, len) && !strcmp(NEVR+len+1, EVR); + + _free(NEVR); + + if (duplicate) + return 0; + } +#endif + + /* Check for duplicate dependencies. */ + he->tag = nametag; + xx = headerGet(h, he, 0); + names = he->p.argv; + len = he->c; + if (xx) { + const char ** versions = NULL; + rpmuint32_t * flags = NULL; + rpmuint32_t * indexes = NULL; + int duplicate = 0; + + if (flagtag) { + he->tag = versiontag; + xx = headerGet(h, he, 0); + versions = he->p.argv; + he->tag = flagtag; + xx = headerGet(h, he, 0); + flags = he->p.ui32p; + } + if (indextag) { + he->tag = indextag; + xx = headerGet(h, he, 0); + indexes = he->p.ui32p; + } + + while (len > 0) { + len--; + if (strcmp(names[len], N)) + continue; + +#if defined(RPM_VENDOR_MANDRIVA) /* filter-overlapping-dependencies */ + /* XXX: Potential drawbacks? Need to study & discuess this one a + * bit further, leaving under #ifdef for now... + * TODO: auto-generated deps too + */ + if (flagtag && versions != NULL) { + int overlap; + + if(*EVR && !*versions[len]) { + overlap = 1; + flags[len] = Flags; + he->tag = flagtag; + he->t = RPM_UINT32_TYPE; + he->p.argv = (void *) &Flags; + xx = headerMod(h, he, 0); + } else { + EVR_t lEVR = rpmEVRnew(RPMSENSE_ANY, 0), + rEVR = rpmEVRnew(RPMSENSE_ANY, 0); + + rpmEVRparse(EVR, lEVR); + rpmEVRparse(versions[len], rEVR); + lEVR->Flags = Flags | RPMSENSE_EQUAL; + rEVR->Flags = flags[len] | RPMSENSE_EQUAL; + overlap = rpmEVRoverlap(lEVR, rEVR); + if (!overlap) + if (rpmEVRoverlap(rEVR, lEVR)) + duplicate = 1; + lEVR = rpmEVRfree(lEVR); + rEVR = rpmEVRfree(rEVR); + } + if (overlap) { + versions[len] = EVR; + he->tag = versiontag; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = versions; + xx = headerMod(h, he, 0); + } else + continue; + } +#else + if (flagtag && versions != NULL && + (strcmp(versions[len], EVR) || (rpmsenseFlags)flags[len] != Flags)) + continue; +#endif + + if (indextag && indexes != NULL && indexes[len] != index) + continue; + + /* This is a duplicate dependency. */ + duplicate = 1; + + break; + } +/*@-usereleased@*/ + names = _free(names); + versions = _free(versions); + flags = _free(flags); + indexes = _free(indexes); +/*@=usereleased@*/ + if (duplicate) + return 0; + } + + /* Add this dependency. */ + he->tag = nametag; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &N; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + + if (flagtag) { + he->tag = versiontag; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &EVR; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + + he->tag = flagtag; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = (void *) &Flags; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + } + if (indextag) { + he->tag = indextag; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &index; + he->c = 1; + he->append = 1; + xx = headerPut(h, he, 0); + he->append = 0; + } + + return 0; +} + +int rpmlibNeedsFeature(Header h, const char * feature, const char * featureEVR) +{ + char * reqname = alloca(sizeof("rpmlib()") + strlen(feature)); + + (void) stpcpy( stpcpy( stpcpy(reqname, "rpmlib("), feature), ")"); + + /* XXX 1st arg is unused */ + return addReqProv(NULL, h, RPMTAG_REQUIRENAME, reqname, featureEVR, + RPMSENSE_RPMLIB|(RPMSENSE_LESS|RPMSENSE_EQUAL), 0); +} diff --git a/rpm-5.4.9/build/rpmbuild.h b/rpm-5.4.9/build/rpmbuild.h new file mode 100644 index 0000000..ebdc114 --- /dev/null +++ b/rpm-5.4.9/build/rpmbuild.h @@ -0,0 +1,598 @@ +#ifndef _H_RPMBUILD_ +#define _H_RPMBUILD_ + +/** \ingroup rpmbuild + * \file build/rpmbuild.h + * This is the *only* module users of librpmbuild should need to include. + */ + +#include +#include +#include +#include + +#include + +#include + +#include "rpmspec.h" + +/** \ingroup rpmbuild + * Bit(s) to control buildSpec() operation. + */ +/*@-typeuse@*/ +typedef enum rpmBuildFlags_e { +/*@-enummemuse@*/ + RPMBUILD_NONE = 0, +/*@=enummemuse@*/ + RPMBUILD_PREP = (1 << 0), /*!< Execute %%prep. */ + RPMBUILD_BUILD = (1 << 1), /*!< Execute %%build. */ + RPMBUILD_INSTALL = (1 << 2), /*!< Execute %%install. */ + RPMBUILD_CHECK = (1 << 3), /*!< Execute %%check. */ + RPMBUILD_CLEAN = (1 << 4), /*!< Execute %%clean. */ + RPMBUILD_FILECHECK = (1 << 5), /*!< Check %%files manifest. */ + RPMBUILD_PACKAGESOURCE = (1 << 6), /*!< Create source package. */ + RPMBUILD_PACKAGEBINARY = (1 << 7), /*!< Create binary package(s). */ + RPMBUILD_RMSOURCE = (1 << 8), /*!< Remove source(s) and patch(s). */ + RPMBUILD_RMBUILD = (1 << 9), /*!< Remove build sub-tree. */ + RPMBUILD_STRINGBUF = (1 << 10), /*!< only for doScript() */ + RPMBUILD_TRACK = (1 << 11), /*!< Execute %%track. */ + RPMBUILD_RMSPEC = (1 << 12), /*!< Remove spec file. */ + RPMBUILD_FETCHSOURCE= (1 << 13) /*!< Fetch source(s) and patch(s). */ +} rpmBuildFlags; +/*@=typeuse@*/ + +#define SKIPSPACE(s) { while (*(s) && xisspace(*(s))) (s)++; } +#define SKIPNONSPACE(s) { while (*(s) && !xisspace(*(s))) (s)++; } + +#define PART_SUBNAME 0 +#define PART_NAME 1 + +/** \ingroup rpmbuild + * Spec file parser states. + */ +#define PART_BASE 100 +typedef enum rpmParseState_e { + PART_NONE = 0+PART_BASE, /*!< */ + /* leave room for RPMRC_NOTFOUND returns. */ + PART_PREAMBLE = 11+PART_BASE, /*!< */ + PART_PREP = 12+PART_BASE, /*!< */ + PART_BUILD = 13+PART_BASE, /*!< */ + PART_INSTALL = 14+PART_BASE, /*!< */ + PART_CHECK = 15+PART_BASE, /*!< */ + PART_CLEAN = 16+PART_BASE, /*!< */ + PART_FILES = 17+PART_BASE, /*!< */ + PART_PRE = 18+PART_BASE, /*!< */ + PART_POST = 19+PART_BASE, /*!< */ + PART_PREUN = 20+PART_BASE, /*!< */ + PART_POSTUN = 21+PART_BASE, /*!< */ + PART_PRETRANS = 22+PART_BASE, /*!< */ + PART_POSTTRANS = 23+PART_BASE, /*!< */ + PART_DESCRIPTION = 24+PART_BASE, /*!< */ + PART_CHANGELOG = 25+PART_BASE, /*!< */ + PART_TRIGGERIN = 26+PART_BASE, /*!< */ + PART_TRIGGERUN = 27+PART_BASE, /*!< */ + PART_VERIFYSCRIPT = 28+PART_BASE, /*!< */ + PART_BUILDARCHITECTURES= 29+PART_BASE,/*!< */ + PART_TRIGGERPOSTUN = 30+PART_BASE, /*!< */ + PART_TRIGGERPREIN = 31+PART_BASE, /*!< */ + /* support "%sanitycheck" script */ + PART_SANITYCHECK = 32+PART_BASE, /*!< */ + PART_ARBITRARY = 33+PART_BASE, /*!< */ + PART_LAST = 34+PART_BASE /*!< */ +} rpmParseState; + +/** \ingroup rpmbuild + * Spec file parser stripping flags. + */ +typedef enum rpmStripFlags_e { + STRIP_NOTHING = 0, + STRIP_TRAILINGSPACE = (1 << 0), + STRIP_COMMENTS = (1 << 1), + STRIP_NOEXPAND = (1 << 2) +} rpmStripFlags; + +/*@unchecked@*/ +extern int _rpmbuildFlags; + +#ifdef __cplusplus +extern "C" { +#endif +/*@-redecl@*/ + +/** \ingroup rpmbuild + * Destroy uid/gid caches. + */ +void freeNames(void) + /*@globals internalState@*/ + /*@modifies internalState */; + +/** \ingroup rpmbuild + * Return cached user name from user id. + * @todo Implement using hash. + * @param uid user id + * @return cached user name + */ +extern /*@observer@*/ const char * getUname(uid_t uid) + /*@globals internalState @*/ + /*@modifies internalState @*/; + +/** \ingroup rpmbuild + * Return cached user name. + * @todo Implement using hash. + * @param uname user name + * @return cached user name + */ +extern /*@observer@*/ const char * getUnameS(const char * uname) + /*@globals internalState @*/ + /*@modifies internalState @*/; + +/** \ingroup rpmbuild + * Return cached user id. + * @todo Implement using hash. + * @param uname user name + * @return cached uid + */ +uid_t getUidS(const char * uname) + /*@globals internalState @*/ + /*@modifies internalState @*/; + +/** \ingroup rpmbuild + * Return cached group name from group id. + * @todo Implement using hash. + * @param gid group id + * @return cached group name + */ +extern /*@observer@*/ const char * getGname(gid_t gid) + /*@globals internalState @*/ + /*@modifies internalState @*/; + +/** \ingroup rpmbuild + * Return cached group name. + * @todo Implement using hash. + * @param gname group name + * @return cached group name + */ +extern /*@observer@*/ const char * getGnameS(const char * gname) + /*@globals internalState @*/ + /*@modifies internalState @*/; + +/** \ingroup rpmbuild + * Return cached group id. + * @todo Implement using hash. + * @param gname group name + * @return cached gid + */ +gid_t getGidS(const char * gname) + /*@globals internalState @*/ + /*@modifies internalState @*/; + +/** \ingroup rpmbuild + * Return build hostname. + * @return build hostname + */ +/*@observer@*/ +extern const char * buildHost(void) + /*@*/; + +/** \ingroup rpmbuild + * Return build time stamp. + * @return build time stamp + */ +/*@observer@*/ +extern rpmuint32_t * getBuildTime(void) + /*@*/; + +/** \ingroup rpmbuild + * Read next line from spec file. + * @param spec spec file control structure + * @param strip truncate comments? + * @return 0 on success, 1 on EOF, <0 on error + */ +int readLine(Spec spec, rpmStripFlags strip) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies spec->fileStack, spec->readStack, spec->line, spec->lineNum, + spec->lbufPtr, + spec->nextline, spec->nextpeekc, spec->lbuf, spec->sl, + rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmbuild + * Stop reading from spec file, freeing resources. + * @param spec spec file control structure + */ +void closeSpec(/*@partial@*/ Spec spec) + /*@globals fileSystem, internalState @*/ + /*@modifies spec->fileStack, fileSystem, internalState @*/; + +/** \ingroup rpmbuild + * Truncate comment lines. + * @param s skip white space, truncate line at '#' + */ +void handleComments(char * s) + /*@modifies s @*/; + +/** \ingroup rpmbuild + * Check line for section separator, return next parser state. + * @param spec spec file control structure + * @return next parser state + */ +rpmParseState isPart(Spec spec) + /*@modifies spec->foo, spec->nfoo @*/; + +/** \ingroup rpmbuild + * Parse a number. + * @param line from spec file + * @retval res pointer to int + * @return 0 on success, 1 on failure + */ +int parseNum(/*@null@*/ const char * line, /*@null@*/ /*@out@*/rpmuint32_t * res) + /*@modifies *res @*/; + +/** \ingroup rpmbuild + * Add changelog entry to header. + * @todo addChangelogEntry should be static. + * @param h header + * @param time time of change + * @param name person who made the change + * @param text description of change + */ +void addChangelogEntry(Header h, time_t time, const char * name, + const char * text) + /*@modifies h @*/; + +/** \ingroup rpmbuild + * Parse %%build/%%install/%%clean section(s) of a spec file. + * @param spec spec file control structure + * @param parsePart current rpmParseState + * @return >= 0 next rpmParseState, < 0 on error + */ +int parseBuildInstallClean(Spec spec, rpmParseState parsePart) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies spec->build, spec->install, spec->check, spec->clean, + spec->macros, spec->foo, spec->nfoo, spec->lbufPtr, + spec->fileStack, spec->readStack, spec->line, spec->lineNum, + spec->nextline, spec->nextpeekc, spec->lbuf, spec->sl, + rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmbuild + * Parse %%changelog section of a spec file. + * @param spec spec file control structure + * @return >= 0 next rpmParseState, < 0 on error + */ +int parseChangelog(Spec spec) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies spec->fileStack, spec->readStack, spec->line, spec->lineNum, + spec->foo, spec->nfoo, spec->lbufPtr, + spec->nextline, spec->nextpeekc, spec->lbuf, spec->sl, + spec->packages->header, + rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmbuild + * Parse %%description section of a spec file. + * @param spec spec file control structure + * @return >= 0 next rpmParseState, < 0 on error + */ +int parseDescription(Spec spec) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies spec->packages, + spec->foo, spec->nfoo, spec->lbufPtr, + spec->fileStack, spec->readStack, spec->line, spec->lineNum, + spec->nextline, spec->nextpeekc, spec->lbuf, spec->sl, + spec->st, + rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmbuild + * Parse %%files section of a spec file. + * @param spec spec file control structure + * @return >= 0 next rpmParseState, < 0 on error + */ +int parseFiles(Spec spec) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies spec->packages, + spec->foo, spec->nfoo, spec->lbufPtr, + spec->fileStack, spec->readStack, spec->line, spec->lineNum, + spec->nextline, spec->nextpeekc, spec->lbuf, spec->sl, + rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmbuild + * Parse tags from preamble of a spec file. + * @param spec spec file control structure + * @param initialPackage + * @return >= 0 next rpmParseState, < 0 on error + */ +int parsePreamble(Spec spec, int initialPackage) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies spec->packages, + spec->foo, spec->nfoo, spec->lbufPtr, + spec->fileStack, spec->readStack, spec->line, spec->lineNum, + spec->buildSubdir, + spec->macros, spec->st, + spec->sources, spec->numSources, spec->noSource, + spec->sourceHeader, spec->BANames, spec->BACount, + spec->nextline, spec->nextpeekc, spec->lbuf, spec->sl, + rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmbuild + * Parse %%prep section of a spec file. + * @param spec spec file control structure + * @param verify verify existence of sources/patches? + * @return >= 0 next rpmParseState, < 0 on error + */ +int parsePrep(Spec spec, int verify) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies spec->prep, spec->buildSubdir, spec->macros, + spec->foo, spec->nfoo, spec->lbufPtr, + spec->fileStack, spec->readStack, spec->line, spec->lineNum, + spec->nextline, spec->nextpeekc, spec->lbuf, spec->sl, + spec->packages->header, + rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmbuild + * Parse dependency relations from spec file and/or autogenerated output buffer. + * @param spec spec file control structure + * @param pkg package control structure + * @param field text to parse (e.g. "foo < 0:1.2-3, bar = 5:6.7") + * @param tagN tag, identifies type of dependency + * @param index (0 always) + * @param tagflags dependency flags already known from context + * @return RPMRC_OK on success + */ +rpmRC parseRCPOT(Spec spec, Package pkg, const char * field, rpmTag tagN, + rpmuint32_t index, rpmsenseFlags tagflags) + /*@globals internalState @*/ + /*@modifies internalState @*/; + +/** \ingroup rpmbuild + * Parse %%pre et al scriptlets from a spec file. + * @param spec spec file control structure + * @param parsePart current rpmParseState + * @return >= 0 next rpmParseState, < 0 on error + */ +int parseScript(Spec spec, int parsePart) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies spec->packages, + spec->foo, spec->nfoo, spec->lbufPtr, + spec->fileStack, spec->readStack, spec->line, spec->lineNum, + spec->nextline, spec->nextpeekc, spec->lbuf, spec->sl, + rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmbuild + * Evaluate boolean expression. + * @param spec spec file control structure + * @param expr expression to parse + * @return + */ +int parseExpressionBoolean(Spec spec, const char * expr) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies rpmGlobalMacroContext, internalState @*/; + +/** \ingroup rpmbuild + * Evaluate string expression. + * @param spec spec file control structure + * @param expr expression to parse + * @return + */ +/*@unused@*/ /*@null@*/ +char * parseExpressionString(Spec spec, const char * expr) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies rpmGlobalMacroContext, internalState @*/; + +/** \ingroup rpmbuild + * Run a build script, assembled from spec file scriptlet section. + * + * @param spec spec file control structure + * @param what type of script + * @param name name of scriptlet section + * @param iob lines that compose script body + * @param test don't execute scripts or package if testing + * @return RPMRC_OK on success, RPMRC_FAIL on failure + */ +rpmRC doScript(Spec spec, int what, /*@null@*/ const char * name, + /*@null@*/ rpmiob iob, int test) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies spec->macros, + rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmbuild + * Find sub-package control structure by name. + * @param spec spec file control structure + * @param name (sub-)package name + * @param flag if PART_SUBNAME, then 1st package name is prepended + * @retval pkg package control structure + * @return RPMRC_OK on success + */ +rpmRC lookupPackage(Spec spec, /*@null@*/ const char * name, int flag, + /*@out@*/ Package * pkg) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies spec->packages, *pkg, rpmGlobalMacroContext, + internalState @*/; + +/** \ingroup rpmbuild + * Destroy all packages associated with spec file. + * @param packages package control structure chain + * @return NULL + */ +/*@null@*/ +Package freePackages(/*@only@*/ /*@null@*/ Package packages) + /*@globals fileSystem @*/ + /*@modifies packages, fileSystem @*/; + +/** \ingroup rpmbuild + * Destroy a package control structure. + * @todo Rename to pkgFree. + * @param pkg package control structure + * @return NULL on last dereference + */ +/*@null@*/ +Package freePackage(/*@killref@*/ /*@null@*/ Package pkg) + /*@globals fileSystem @*/ + /*@modifies pkg, fileSystem @*/; +#define freePackage(_pkg) \ + ((Package)rpmioFreePoolItem((rpmioItem)(_pkg), __FUNCTION__, __FILE__, __LINE__)) + +/** \ingroup rpmbuild + * Create and initialize package control structure. + * @param spec spec file control structure + * @return package control structure + */ +/*@only@*/ +Package newPackage(Spec spec) + /*@modifies spec->packages, spec->packages->next @*/; + +/** \ingroup rpmbuild + * Add dependency to header, filtering duplicates. + * @param spec spec file control structure + * @param h header + * @param tagN tag, identifies type of dependency + * @param N (e.g. Requires: foo < 0:1.2-3, "foo") + * @param EVR (e.g. Requires: foo < 0:1.2-3, "0:1.2-3") + * @param Flags (e.g. Requires: foo < 0:1.2-3, both "Requires:" and "<") + * @param index (0 always) + * @return 0 always + */ +int addReqProv(/*@unused@*/Spec spec, Header h, rpmTag tagN, + const char * N, const char * EVR, rpmsenseFlags Flags, + rpmuint32_t index) + /*@globals internalState @*/ + /*@modifies h, internalState @*/; + +/** + * Append files (if any) to scriptlet tags. + * @param spec spec file control structure + * @param pkg package control structure + * @return RPMRC_OK on success + */ +rpmRC processScriptFiles(Spec spec, Package pkg) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies pkg->header, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +/** + * Retrofit an explicit Provides: N = E:V-R dependency into package headers. + * Up to rpm 3.0.4, packages implicitly provided their own name-version-release. + * @param h header + */ +void providePackageNVR(Header h) + /*@globals internalState @*/ + /*@modifies h, internalState @*/; + +/** \ingroup rpmbuild + * Add rpmlib feature dependency. + * @param h header + * @param feature rpm feature name (i.e. "rpmlib(Foo)" for feature Foo) + * @param featureEVR rpm feature epoch/version/release + * @return 0 always + */ +int rpmlibNeedsFeature(Header h, const char * feature, const char * featureEVR) + /*@globals internalState @*/ + /*@modifies h, internalState @*/; + +/** \ingroup rpmbuild + * Post-build processing for binary package(s). + * @param spec spec file control structure + * @param installSpecialDoc + * @param test don't execute scripts or package if testing + * @return RPMRC_OK on success + */ +rpmRC processBinaryFiles(Spec spec, int installSpecialDoc, int test) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies spec->macros, *spec->packages, + spec->packages->fi, spec->packages->fileList, + spec->packages->specialDoc, spec->packages->header, + rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmbuild + * Create and initialize header for source package. + * @param spec spec file control structure + * @retval *sfp srpm file list (may be NULL) + * @return 0 always + */ +int initSourceHeader(Spec spec, /*@null@*/ rpmiob *sfp) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies spec->sourceHeader, spec->sourceHdrInit, + spec->BANames, *sfp, + spec->packages->header, + rpmGlobalMacroContext, internalState @*/; + +/** \ingroup rpmbuild + * Post-build processing for source package. + * @param spec spec file control structure + * @return 0 on success + */ +int processSourceFiles(Spec spec) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies spec->sourceHeader, spec->sourceCpioList, + spec->BANames, spec->sourceHdrInit, + spec->packages->header, + rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmbuild + * Parse spec file into spec control structure. + * @param ts transaction set (spec file control in ts->spec) + * @param specFile + * @param rootURL + * @param recursing parse is recursive? + * @param passPhrase + * @param cookie + * @param anyarch + * @param force + * @param verify + * @return + */ +int parseSpec(rpmts ts, const char * specFile, + /*@null@*/ const char * rootURL, + int recursing, + /*@null@*/ const char * passPhrase, + /*@null@*/ const char * cookie, + int anyarch, int force, int verify) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmbuild + * Build stages state machine driver. + * @param ts transaction set + * @param spec spec file control structure + * @param what bit(s) to enable stages of build + * @param test don't execute scripts or package if testing + * @return RPMRC_OK on success + */ +rpmRC buildSpec(rpmts ts, Spec spec, int what, int test) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies spec->sourceHeader, spec->sourceCpioList, spec->cookie, + spec->sourceRpmName, spec->sourcePkgId, spec->sourceHdrInit, + spec->macros, spec->BASpecs, + spec->BANames, *spec->packages, + spec->packages->fi, spec->packages->fileList, + spec->packages->specialDoc, spec->packages->header, + rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmbuild + * Generate binary package(s). + * @param spec spec file control structure + * @return rpmRC on success + */ +rpmRC packageBinaries(Spec spec) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies spec->packages->header, spec->packages->fi, + spec->sourceRpmName, spec->cookie, spec->sourcePkgId, + rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmbuild + * Generate source package. + * @param spec spec file control structure + * @return RPMRC_OK on success + */ +rpmRC packageSources(Spec spec) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies spec->sourceHeader, spec->cookie, spec->sourceCpioList, + spec->sourceRpmName, spec->sourcePkgId, spec->packages->header, + rpmGlobalMacroContext, fileSystem, internalState @*/; + +/*@=redecl@*/ +#ifdef __cplusplus +} +#endif + +#endif /* _H_RPMBUILD_ */ diff --git a/rpm-5.4.9/build/rpmspec.h b/rpm-5.4.9/build/rpmspec.h new file mode 100644 index 0000000..bb44a8c --- /dev/null +++ b/rpm-5.4.9/build/rpmspec.h @@ -0,0 +1,403 @@ +#ifndef _H_RPMSPEC_ +#define _H_RPMSPEC_ + +/** \ingroup rpmbuild + * \file build/rpmspec.h + * The Spec and Package data structures used during build. + */ + +#include +#include /* XXX rpmfi typedef */ +#include /* XXX QVA_t typedef */ + +/** \ingroup rpmbuild + */ +typedef /*@abstract@*/ /*@refcounted@*/ struct Package_s * Package; + +/** \ingroup rpmbuild + */ +typedef struct Source * SpecSource; + +/** \ingroup rpmbuild + */ +struct TriggerFileEntry { + int index; +/*@only@*/ + char * fileName; +/*@only@*/ + char * script; +/*@only@*/ + char * prog; +/*@owned@*/ + struct TriggerFileEntry * next; +}; + +#define RPMBUILD_DEFAULT_LANG "C" + +/** \ingroup rpmbuild + */ +struct Source { +/*@owned@*/ + const char * fullSource; +/*@dependent@*/ /*@relnull@*/ + const char * source; /* Pointer into fullSource */ + int flags; + rpmuint32_t num; +/*@owned@*/ + struct Source * next; +}; + +/** \ingroup rpmbuild + */ +/*@-typeuse@*/ +typedef struct ReadLevelEntry { + int reading; +/*@dependent@*/ + struct ReadLevelEntry * next; +} RLE_t; +/*@=typeuse@*/ + +/** \ingroup rpmbuild + */ +typedef struct OpenFileInfo { +/*@only@*/ + const char * fileName; +/*@relnull@*/ + FD_t fd; + int lineNum; + char readBuf[BUFSIZ]; +/*@dependent@*/ + char * readPtr; +/*@owned@*/ + struct OpenFileInfo * next; +} OFI_t; + +/** \ingroup rpmbuild + */ +typedef struct spectag_s { + int t_tag; + int t_startx; + int t_nlines; +/*@only@*/ + const char * t_lang; +/*@only@*/ + const char * t_msgid; +} * spectag; + +/** \ingroup rpmbuild + */ +typedef struct spectags_s { +/*@owned@*/ + spectag st_t; + int st_nalloc; + int st_ntags; +} * spectags; + +/** \ingroup rpmbuild + */ +typedef struct speclines_s { +/*@only@*/ + char **sl_lines; + int sl_nalloc; + int sl_nlines; +} * speclines; + +/** \ingroup rpmbuild + * The structure used to store values parsed from a spec file. + */ +struct Spec_s { + struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ +/*@only@*/ + const char * specFile; /*!< Name of the spec file. */ +/*@only@*/ + const char * buildSubdir; +/*@only@*/ + const char * rootURL; + +/*@owned@*/ /*@null@*/ + speclines sl; +/*@owned@*/ /*@null@*/ + spectags st; + +/*@owned@*/ + struct OpenFileInfo * fileStack; +/*@owned@*/ + char *lbuf; + size_t lbuf_len; +/*@dependent@*/ + char *lbufPtr; + char nextpeekc; +/*@dependent@*/ + char * nextline; +/*@dependent@*/ + char * line; + int lineNum; + +/*@owned@*/ + struct ReadLevelEntry * readStack; + +/*@owned@*/ /*@null@*/ + Spec * BASpecs; +/*@only@*/ /*@null@*/ + const char ** BANames; + int BACount; + int recursing; /*!< parse is recursive? */ + int toplevel; + + int force; + int anyarch; + +/*@null@*/ + char * passPhrase; + int timeCheck; +/*@null@*/ + const char * cookie; + +/*@owned@*/ + struct Source * sources; + int numSources; + int noSource; + +/*@only@*/ + const char * sourceRpmName; +/*@only@*/ + unsigned char * sourcePkgId; +/*@refcounted@*/ + Header sourceHeader; +/*@refcounted@*/ + rpmfi fi; + int sourceHdrInit; + +/*@dependent@*/ /*@null@*/ + MacroContext macros; + + rpmRC (*_parseRCPOT) (Spec spec, Package pkg, const char *field, rpmTag tagN, + rpmuint32_t index, rpmsenseFlags tagflags); + + rpmuint32_t sstates[RPMSCRIPT_MAX]; /*!< scriptlet states. */ + rpmuint32_t smetrics[RPMSCRIPT_MAX]; /*!< scriptlet time metrics. */ + +/*@only@*/ + rpmiob prep; /*!< %prep scriptlet. */ +/*@only@*/ + rpmiob build; /*!< %build scriptlet. */ +/*@only@*/ + rpmiob install; /*!< %install scriptlet. */ +/*@only@*/ + rpmiob check; /*!< %check scriptlet. */ +/*@only@*/ + rpmiob clean; /*!< %clean scriptlet. */ + + size_t nfoo; +/*@only@*/ /*@relnull@*/ + tagStore_t foo; + + void * dig; /*!< Auto-signing keypair. */ + + Package packages; /*!< Package list. */ +#if defined(__LCLINT__) +/*@refs@*/ + int nrefs; /*!< (unused) keep splint happy */ +#endif +}; + +/** \ingroup rpmbuild + * The structure used to store values for a package. + */ +struct Package_s { + struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ +/*@refcounted@*/ + Header header; +/*@refcounted@*/ + rpmds ds; /*!< Requires: N = EVR */ +/*@refcounted@*/ + rpmfi fi; + + int autoReq; + int autoProv; + int noarch; + +/*@only@*/ + const char * preInFile; /*!< %pre scriptlet. */ +/*@only@*/ + const char * postInFile; /*!< %post scriptlet. */ +/*@only@*/ + const char * preUnFile; /*!< %preun scriptlet. */ +/*@only@*/ + const char * postUnFile; /*!< %postun scriptlet. */ +/*@only@*/ + const char * preTransFile; /*!< %pretrans scriptlet. */ +/*@only@*/ + const char * postTransFile; /*!< %posttrans scriptlet. */ +/*@only@*/ + const char * verifyFile; /*!< %verifyscript scriptlet. */ +/*@only@*/ + const char * sanityCheckFile;/*!< %sanitycheck scriptlet. */ + +/*@only@*/ + rpmiob specialDoc; + +/*@only@*/ + struct TriggerFileEntry * triggerFiles; + +/*@only@*/ + const char * fileFile; +/*@only@*/ + rpmiob fileList; /* If NULL, package will not be written */ + + Package next; +#if defined(__LCLINT__) +/*@refs@*/ + int nrefs; /*!< (unused) keep splint happy */ +#endif +}; + +#ifdef __cplusplus +extern "C" { +#endif + +/** \ingroup rpmbuild + * Destroy a spec file control structure. + * @todo Rename to specFree. + * @param spec spec file control structure + * @return NULL on last dereference + */ +/*@null@*/ +Spec freeSpec(/*@killref@*/ /*@null@*/ Spec spec) + /*@globals fileSystem, internalState @*/ + /*@modifies spec, fileSystem, internalState @*/; +#define freeSpec(_spec) \ + ((Spec)rpmioFreePoolItem((rpmioItem)(_spec), __FUNCTION__, __FILE__, __LINE__)) + +/** \ingroup rpmbuild + * Create and initialize Spec structure. + * @return spec spec file control structure + */ +/*@only@*/ +Spec newSpec(void) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies rpmGlobalMacroContext, internalState @*/; + +/** \ingroup rpmbuild + * Function to query spec file(s). + * @param ts transaction set + * @param qva parsed query/verify options + * @param arg query argument + * @return 0 on success, else no. of failures + */ +int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg) + /*@globals rpmCLIMacroContext, + rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, qva, rpmCLIMacroContext, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +/** \ingroup rpmbuild + */ +struct OpenFileInfo * newOpenFileInfo(void) + /*@*/; + +/** \ingroup rpmbuild + * stashSt. + * @param spec spec file control structure + * @param h header + * @param tag tag + * @param lang locale + * @return ptr to saved entry + */ +spectag stashSt(Spec spec, Header h, rpmTag tag, const char * lang) + /*@globals internalState @*/ + /*@modifies spec->st, internalState @*/; + +/** \ingroup rpmbuild + * addSource. + * @param spec spec file control structure + * @param pkg package control + * @param field field to parse + * @param tag tag + * @return 0 on success + */ +int addSource(Spec spec, Package pkg, const char * field, rpmTag tag) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies spec->sources, spec->numSources, + spec->st, spec->macros, + rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmbuild + * parseNoSource. + * @param spec spec file control structure + * @param field field to parse + * @param tag tag + * @return 0 on success + */ +int parseNoSource(Spec spec, const char * field, rpmTag tag) + /*@*/; + +/** \ingroup rpmbuild + * Return the count of source set in specfile + * @param spec spec file control structure + * @return the count of source + */ +int SpecSourceCount(Spec spec) + /*@*/; + +/** \ingroup rpmbuild + * Return a source control structure + * @param spec spec file control structure + * @param num the number of the wanted source (starting from 0) + * @return a SpecSource structure, NULL if not found + */ +SpecSource getSource(Spec spec, int num) + /*@*/; + +/** \ingroup rpmbuild + * Return a ptr to the source file name + * @param source SpecSource control structure + * @return ptr to filename + */ +/*@exposed@*/ +const char * specSourceName(SpecSource source) + /*@*/; + +/** \ingroup rpmbuild + * Return a ptr to the full url of the source + * @param source SpecSource control structure + * @return ptr to url + */ +/*@exposed@*/ +const char * specFullSourceName(SpecSource source) + /*@*/; + +/** \ingroup rpmbuild + * Return the spec or source patch number + * @param source SpecSource control structure + * @return the number of the source + */ +int specSourceNum(SpecSource source) + /*@*/; + +/** \ingroup rpmbuild + * Return flags set for the source + * @param source SpecSource control structure + * @return flags + */ +int specSourceFlags(SpecSource source) + /*@*/; + +/** \ingroup rpmbuild + * Return the macro directory location from source file flags + * @param attr rpmfileAttrs from source + * @return string containings macros about location, NULL on failure + */ +/*@null@*/ +#if defined(RPM_VENDOR_OPENPKG) /* splitted-source-directory */ +const char * getSourceDir(rpmfileAttrs attr, const char *filename) +#else +const char * getSourceDir(rpmfileAttrs attr) +#endif + /*@*/; + +#ifdef __cplusplus +} +#endif + +#endif /* _H_SPEC_ */ diff --git a/rpm-5.4.9/build/spec.c b/rpm-5.4.9/build/spec.c new file mode 100644 index 0000000..8baedc8 --- /dev/null +++ b/rpm-5.4.9/build/spec.c @@ -0,0 +1,1025 @@ +/** \ingroup rpmbuild + * \file build/spec.c + * Handle spec data structure. + */ + +#include "system.h" + +#include +#include +#include +#include + +#include "buildio.h" +#include "rpmds.h" +#include "rpmfi.h" +#include "rpmts.h" + +#include "rpmlua.h" + +#include "debug.h" + +/*@unchecked@*/ +int _pkg_debug; + +/*@unchecked@*/ +int _spec_debug; + +/*@-redecl@*/ +extern int specedit; +/*@=redecl@*/ + +#define SKIPWHITE(_x) {while(*(_x) && (xisspace(*_x) || *(_x) == ',')) (_x)++;} +#define SKIPNONWHITE(_x){while(*(_x) &&!(xisspace(*_x) || *(_x) == ',')) (_x)++;} + +/*@access rpmluav @*/ + +/** + * @param p trigger entry chain + * @return NULL always + */ +static inline +/*@null@*/ struct TriggerFileEntry * freeTriggerFiles(/*@only@*/ /*@null@*/ struct TriggerFileEntry * p) + /*@modifies p @*/ +{ + struct TriggerFileEntry *o, *q = p; + + while (q != NULL) { + o = q; + q = q->next; + o->fileName = _free(o->fileName); + o->script = _free(o->script); + o->prog = _free(o->prog); + o = _free(o); + } + return NULL; +} + +/** + * Destroy source component chain. + * @param s source component chain + * @return NULL always + */ +static inline +/*@null@*/ struct Source * freeSources(/*@only@*/ /*@null@*/ struct Source * s) + /*@modifies s @*/ +{ + struct Source *r, *t = s; + + while (t != NULL) { + r = t; + t = t->next; + r->fullSource = _free(r->fullSource); + r = _free(r); + } + return NULL; +} + +rpmRC lookupPackage(Spec spec, const char *name, int flag, /*@out@*/Package *pkgp) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + char *NV = NULL; + char *N = NULL; + char *V = NULL; + Package p; + Package lastp = spec->packages; + rpmRC rc = RPMRC_OK; + int xx; + + if (lastp == NULL) /* XXX segfault avoidance */ + goto exit; + /* "main" package */ + if (name == NULL) + goto exit; + + /* Construct package name */ + if (flag == PART_SUBNAME) { + he->tag = RPMTAG_NAME; + xx = headerGet(spec->packages->header, he, 0); +assert(xx != 0 && he->p.str != NULL); + N = rpmExpand(he->p.str, "-", name, NULL); + he->p.ptr = _free(he->p.ptr); + } else { + N = xstrdup(name); + /* XXX restrict V to leading digit to prevent NV split ambiguity. */ + if ((V = strrchr(N, '-')) != NULL && xisdigit(V[1])) { + NV = xstrdup(N); + *V++ = '\0'; + } else + V = NULL; + } + + /* Match last package with same N or same {N,V} */ + lastp = NULL; + for (p = spec->packages; p != NULL; p = p->next) { + char *nv, *n, *v; + nv = n = v = NULL; + he->tag = RPMTAG_NAME; + xx = headerGet(p->header, he, 0); + if (xx && he->p.str != NULL) { + n = (char *) he->p.str; + he->p.str = NULL; + } + if (NV != NULL) { + he->tag = RPMTAG_VERSION; + xx = headerGet(p->header, he, 0); + if (xx && he->p.str != NULL) { + v = (char *) he->p.str; + he->p.str = NULL; + nv = rpmExpand(n, "-", v, NULL); + } + } + + if (NV == NULL) { + if (!strcmp(N, n)) + lastp = p; + } else { + if (!strcmp(NV, nv) || !strcmp(NV, n) + || (!strcmp(N, n) && (V == NULL || !strcmp(V, v)))) + lastp = p; + } +/*@-usereleased@*/ + n = _free(n); + v = _free(v); + nv = _free(nv); +/*@=usereleased@*/ + } + rc = (lastp == NULL ? RPMRC_FAIL : RPMRC_OK); + NV = _free(NV); + N = _free(N); + +exit: + if (pkgp) + /*@-dependenttrans@*/ *pkgp = lastp; /*@=dependenttrans@*/ + return rc; +} + +static void pkgFini(void * _pkg) + /*@modifies _pkg @*/ +{ + Package pkg = _pkg; + + if (pkg == NULL) return; /* XXX assert? */ + + pkg->preInFile = _free(pkg->preInFile); + pkg->postInFile = _free(pkg->postInFile); + pkg->preUnFile = _free(pkg->preUnFile); + pkg->postUnFile = _free(pkg->postUnFile); + pkg->verifyFile = _free(pkg->verifyFile); + pkg->sanityCheckFile = _free(pkg->sanityCheckFile); + + (void)headerFree(pkg->header); + pkg->header = NULL; + (void)rpmdsFree(pkg->ds); + pkg->ds = NULL; + pkg->fileList = rpmiobFree(pkg->fileList); + pkg->fileFile = _free(pkg->fileFile); + if (pkg->fi != NULL) { + rpmfi fi = pkg->fi; + pkg->fi = NULL; + fi = rpmfiFree(fi); + } + + pkg->specialDoc = rpmiobFree(pkg->specialDoc); + pkg->triggerFiles = freeTriggerFiles(pkg->triggerFiles); +} + +/*@unchecked@*/ /*@only@*/ /*@null@*/ +rpmioPool _pkgPool; + +static Package pkgGetPool(rpmioPool pool) +{ + Package pkg; + + if (_pkgPool == NULL) { + _pkgPool = rpmioNewPool("pkg", sizeof(*pkg), -1, _pkg_debug, + NULL, NULL, pkgFini); + pool = _pkgPool; + } + pkg = (Package) rpmioGetPool(pool, sizeof(*pkg)); + memset(((char *)pkg)+sizeof(pkg->_item), 0, sizeof(*pkg)-sizeof(pkg->_item)); + return pkg; +} + +Package newPackage(/*@unused@*/ Spec spec) +{ + Package pkg = pkgGetPool(_pkgPool); + + pkg->header = headerNew(); + pkg->ds = NULL; + + pkg->autoProv = ((_rpmbuildFlags & 0x1) != 0); + pkg->autoReq = ((_rpmbuildFlags & 0x2) != 0); + +#if 0 + pkg->reqProv = NULL; + pkg->triggers = NULL; + pkg->triggerScripts = NULL; +#endif + + pkg->triggerFiles = NULL; + + pkg->fileFile = NULL; + pkg->fileList = NULL; + + pkg->fi = NULL; + + pkg->preInFile = NULL; + pkg->postInFile = NULL; + pkg->preUnFile = NULL; + pkg->postUnFile = NULL; + pkg->verifyFile = NULL; + pkg->sanityCheckFile = NULL; + + pkg->specialDoc = NULL; + + pkg->next = NULL; + + return (Package)rpmioLinkPoolItem((rpmioItem)pkg, __FUNCTION__, __FILE__, __LINE__); +} + +Package freePackages(Package packages) +{ + Package p; + + while ((p = packages) != NULL) { + packages = p->next; + p->next = NULL; + p = freePackage(p); + } + return NULL; +} + +/** + */ +static inline /*@owned@*/ struct Source *findSource(Spec spec, rpmuint32_t num, int flag) + /*@*/ +{ + struct Source *p; + + for (p = spec->sources; p != NULL; p = p->next) + if ((num == p->num) && (p->flags & flag)) return p; + + return NULL; +} + +/** + */ +int SpecSourceCount(Spec spec) +{ + return spec->numSources; +} + +/** + */ +SpecSource getSource(Spec spec, int num) + /* @ */ +{ + struct Source *p = spec->sources; + int i; + + for (i = 0; i < num; i++) + if ((p = p->next) == NULL) return NULL; + +/*@-usereleased@*/ + return p; +/*@=usereleased@*/ +} + +/** + */ +const char * specSourceName(SpecSource source) +{ + return source->source; +} + +/** + */ +const char * specFullSourceName(SpecSource source) +{ + return source->fullSource; +} + +/** + */ +int specSourceNum(SpecSource source) +{ + return source->num; +} + +/** + */ +int specSourceFlags(SpecSource source) +{ + return source->flags; +} + +int parseNoSource(Spec spec, const char * field, rpmTag tag) +{ + const char *f, *fe; + const char *name; + rpmuint32_t num, flag; + + if (tag == RPMTAG_NOSOURCE) { + flag = RPMFILE_SOURCE; + name = "source"; + } else { + flag = RPMFILE_PATCH; + name = "patch"; + } + + fe = field; + for (f = fe; *f != '\0'; f = fe) { + struct Source *p; + + SKIPWHITE(f); + if (*f == '\0') + break; + fe = f; + SKIPNONWHITE(fe); + if (*fe != '\0') fe++; + + if (parseNum(f, &num)) { + rpmlog(RPMLOG_ERR, _("line %d: Bad number: %s\n"), + spec->lineNum, f); + return RPMRC_FAIL; + } + + if (! (p = findSource(spec, num, flag))) { + rpmlog(RPMLOG_ERR, _("line %d: Bad no%s number: %d\n"), + spec->lineNum, name, num); + return RPMRC_FAIL; + } + + p->flags |= RPMFILE_GHOST; + + } + + return RPMRC_OK; +} + +int addSource(Spec spec, /*@unused@*/ Package pkg, + const char *field, rpmTag tag) +{ + struct Source *p; +#if defined(RPM_VENDOR_OPENPKG) /* regular-ordered-sources */ + struct Source *p_last; +#endif + int flag = 0; + const char *name = NULL; + const char *mdir = NULL; + const char *fieldp = NULL; + char buf[BUFSIZ]; + uint32_t num = 0; + + buf[0] = '\0'; + switch (tag) { + case RPMTAG_SOURCE: + flag = RPMFILE_SOURCE; + name = "source"; + fieldp = spec->line + strlen(name); + break; + case RPMTAG_PATCH: + flag = RPMFILE_PATCH; + name = "patch"; + fieldp = spec->line + strlen(name); + break; + case RPMTAG_ICON: + flag = RPMFILE_ICON; + name = "icon"; + fieldp = NULL; + break; + default: +assert(0); + /*@notreached@*/ break; + } +#if !defined(RPM_VENDOR_OPENPKG) /* splitted-source-directory */ + mdir = getSourceDir(flag); +assert(mdir != NULL); +#endif + + /* Get the number */ + if (fieldp != NULL) { + char * end = NULL; + + num = strtoul(fieldp, &end, 10); + SKIPSPACE(end); + if (*end != ':') { + rpmlog(RPMLOG_ERR, _("line %d: No ':' terminator: %s\n"), + spec->lineNum, spec->line); + return RPMRC_FAIL; + } + } + + /* Check whether tags of the same number haven't already been defined */ + for (p = spec->sources; p != NULL; p = p->next) { + if ( p->num != num ) continue; + if ((tag == RPMTAG_SOURCE && p->flags == RPMFILE_SOURCE) || + (tag == RPMTAG_PATCH && p->flags == RPMFILE_PATCH)) { + rpmlog(RPMLOG_ERR, _("%s %d defined multiple times\n"), name, num); + return RPMRC_FAIL; + } + } + + /* Create the entry and link it in */ + p = xmalloc(sizeof(*p)); + p->num = num; + p->fullSource = xstrdup(field); + p->flags = flag; + p->source = strrchr(p->fullSource, '/'); + if (p->source) + p->source++; + else + p->source = p->fullSource; + +#if defined(RPM_VENDOR_OPENPKG) /* regular-ordered-sources */ + p->next = NULL; + p_last = spec->sources; + while (p_last != NULL && p_last->next != NULL) + p_last = p_last->next; + if (p_last != NULL) + p_last->next = p; + else + spec->sources = p; +#else + p->next = spec->sources; + spec->sources = p; +#endif + + spec->numSources++; + + /* XXX FIXME: need to add ICON* macros. */ +#if defined(RPM_VENDOR_OPENPKG) /* splitted-source-directory */ + mdir = getSourceDir(flag, p->source); +#endif + if (tag != RPMTAG_ICON) { + const char *body = rpmGenPath(NULL, mdir, p->source); + + sprintf(buf, "%s%d", + (flag & RPMFILE_PATCH) ? "PATCH" : "SOURCE", num); + addMacro(spec->macros, buf, NULL, body, RMIL_SPEC); + sprintf(buf, "%sURL%d", + (flag & RPMFILE_PATCH) ? "PATCH" : "SOURCE", num); + addMacro(spec->macros, buf, NULL, p->fullSource, RMIL_SPEC); +#ifdef WITH_LUA + if (!spec->recursing) { + rpmlua lua = NULL; /* global state */ + const char * what = (flag & RPMFILE_PATCH) ? "patches" : "sources"; + rpmluav var = rpmluavNew(); + + rpmluaPushTable(lua, what); + rpmluavSetListMode(var, 1); + rpmluavSetValue(var, RPMLUAV_STRING, body); + rpmluaSetVar(lua, var); +/*@-moduncon@*/ + var = (rpmluav) rpmluavFree(var); +/*@=moduncon@*/ + rpmluaPop(lua); + } +#endif + body = _free(body); + } + + return RPMRC_OK; +} + +/** + */ +static inline /*@only@*/ /*@null@*/ speclines newSl(void) + /*@*/ +{ + speclines sl = NULL; + if (specedit) { + sl = xmalloc(sizeof(*sl)); + sl->sl_lines = NULL; + sl->sl_nalloc = 0; + sl->sl_nlines = 0; + } + return sl; +} + +/** + */ +static inline /*@null@*/ speclines freeSl(/*@only@*/ /*@null@*/ speclines sl) + /*@modifies sl @*/ +{ + int i; + if (sl == NULL) return NULL; + for (i = 0; i < sl->sl_nlines; i++) + /*@-unqualifiedtrans@*/ + sl->sl_lines[i] = _free(sl->sl_lines[i]); + /*@=unqualifiedtrans@*/ + sl->sl_lines = _free(sl->sl_lines); + return _free(sl); +} + +/** + */ +static inline /*@only@*/ /*@null@*/ spectags newSt(void) + /*@*/ +{ + spectags st = NULL; + if (specedit) { + st = xmalloc(sizeof(*st)); + st->st_t = NULL; + st->st_nalloc = 0; + st->st_ntags = 0; + } + return st; +} + +/** + */ +static inline /*@null@*/ spectags freeSt(/*@only@*/ /*@null@*/ spectags st) + /*@modifies st @*/ +{ + int i; + if (st == NULL) return NULL; + for (i = 0; i < st->st_ntags; i++) { + spectag t = st->st_t + i; + t->t_lang = _free(t->t_lang); + t->t_msgid = _free(t->t_msgid); + } + st->st_t = _free(st->st_t); + return _free(st); +} + +static void specFini(void * _spec) + /*@modifies _spec @*/ +{ + Spec spec = _spec; + struct ReadLevelEntry *rl; + + if (spec == NULL) return; /* XXX assert? */ + + spec->lbuf = _free(spec->lbuf); + + spec->sl = freeSl(spec->sl); + spec->st = freeSt(spec->st); + + spec->prep = rpmiobFree(spec->prep); + spec->build = rpmiobFree(spec->build); + spec->install = rpmiobFree(spec->install); + spec->check = rpmiobFree(spec->check); + spec->clean = rpmiobFree(spec->clean); + spec->foo = tagStoreFree(spec->foo, spec->nfoo); + spec->nfoo = 0; + + spec->buildSubdir = _free(spec->buildSubdir); + spec->rootURL = _free(spec->rootURL); + spec->specFile = _free(spec->specFile); + + closeSpec(spec); + + while (spec->readStack) { + rl = spec->readStack; + /*@-dependenttrans@*/ + spec->readStack = rl->next; + /*@=dependenttrans@*/ + rl->next = NULL; + rl = _free(rl); + } + + spec->sourceRpmName = _free(spec->sourceRpmName); + spec->sourcePkgId = _free(spec->sourcePkgId); + spec->sourceHeader = headerFree(spec->sourceHeader); + + if (spec->fi != NULL) { + rpmfi fi = spec->fi; + spec->fi = NULL; + fi = rpmfiFree(fi); + } + + if (!spec->recursing) { + if (spec->BASpecs != NULL) + while (spec->BACount--) { + /*@-unqualifiedtrans@*/ + spec->BASpecs[spec->BACount] = + freeSpec(spec->BASpecs[spec->BACount]); + /*@=unqualifiedtrans@*/ + } + /*@-compdef@*/ + spec->BASpecs = _free(spec->BASpecs); + /*@=compdef@*/ + } + spec->BANames = _free(spec->BANames); + + spec->passPhrase = _free(spec->passPhrase); + spec->cookie = _free(spec->cookie); + +#ifdef WITH_LUA + { rpmlua lua = NULL; /* global state */ + rpmluaDelVar(lua, "patches"); + rpmluaDelVar(lua, "sources"); + } +#endif + + spec->sources = freeSources(spec->sources); + + spec->dig = pgpDigFree(spec->dig); + spec->packages = freePackages(spec->packages); + +} + +/*@unchecked@*/ /*@only@*/ /*@null@*/ +rpmioPool _specPool; + +static Spec specGetPool(rpmioPool pool) +{ + Spec spec; + + if (_specPool == NULL) { + _specPool = rpmioNewPool("spec", sizeof(*spec), -1, _spec_debug, + NULL, NULL, specFini); + pool = _specPool; + } + spec = (Spec) rpmioGetPool(pool, sizeof(*spec)); + memset(((char *)spec)+sizeof(spec->_item), 0, sizeof(*spec)-sizeof(spec->_item)); + return spec; +} + +Spec newSpec(void) +{ + static const char _spec_line_buffer_size[] = + "%{?_spec_line_buffer_size}%{!?_spec_line_buffer_size:100000}"; + Spec spec = specGetPool(_specPool); + + spec->specFile = NULL; + + spec->sl = newSl(); + spec->st = newSt(); + + spec->fileStack = NULL; + spec->lbuf_len = (size_t)rpmExpandNumeric(_spec_line_buffer_size); + spec->lbuf = (char *)xmalloc(spec->lbuf_len); + spec->lbuf[0] = '\0'; + spec->line = spec->lbuf; + spec->nextline = NULL; + spec->nextpeekc = '\0'; + spec->lineNum = 0; + spec->readStack = xmalloc(sizeof(*spec->readStack)); + spec->readStack->next = NULL; + spec->readStack->reading = 1; + + spec->rootURL = NULL; + + memset(&spec->sstates, 0, sizeof(spec->sstates)); + memset(&spec->smetrics, 0, sizeof(spec->smetrics)); + + spec->prep = NULL; + spec->build = NULL; + spec->install = NULL; + spec->check = NULL; + spec->clean = NULL; + spec->foo = NULL; + spec->nfoo = 0; + + spec->dig = NULL; + + spec->sources = NULL; + spec->packages = NULL; + spec->noSource = 0; + spec->numSources = 0; + + spec->sourceRpmName = NULL; + spec->sourcePkgId = NULL; + spec->sourceHeader = headerNew(); + spec->fi = NULL; + + spec->buildSubdir = NULL; + + spec->passPhrase = NULL; + spec->timeCheck = 0; + spec->cookie = NULL; + + spec->BANames = NULL; + spec->BACount = 0; + spec->recursing = 0; + spec->toplevel = 1; + spec->BASpecs = NULL; + + spec->force = 0; + spec->anyarch = 0; + +/*@i@*/ spec->macros = rpmGlobalMacroContext; + + spec->_parseRCPOT = parseRCPOT; /* XXX hack around backward linkage. */ + + return (Spec)rpmioLinkPoolItem((rpmioItem)spec, __FUNCTION__, __FILE__, __LINE__); +} + +/*@only@*/ +struct OpenFileInfo * newOpenFileInfo(void) +{ + struct OpenFileInfo *ofi; + + ofi = xmalloc(sizeof(*ofi)); + ofi->fd = NULL; + ofi->fileName = NULL; + ofi->lineNum = 0; + ofi->readBuf[0] = '\0'; + ofi->readPtr = NULL; + ofi->next = NULL; + + return ofi; +} + +/** + * Print copy of spec file, filling in Group/Description/Summary from specspo. + * @param spec spec file control structure + */ +static void +printNewSpecfile(Spec spec) + /*@globals fileSystem, internalState @*/ + /*@modifies spec->sl->sl_lines[], spec->packages->header, + fileSystem, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + Header h; + speclines sl = spec->sl; + spectags st = spec->st; + const char * msgstr = NULL; + int i, j; + int xx; + + if (sl == NULL || st == NULL) + return; + + for (i = 0; i < st->st_ntags; i++) { + spectag t = st->st_t + i; + const char * tn = tagName(t->t_tag); + const char * errstr; + char fmt[1024]; + + fmt[0] = '\0'; + if (t->t_msgid == NULL) + h = spec->packages->header; + else { + Package pkg; + char *fe; + + strcpy(fmt, t->t_msgid); + for (fe = fmt; *fe && *fe != '('; fe++) + {} ; + if (*fe == '(') *fe = '\0'; + h = NULL; + for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { + h = pkg->header; + he->tag = RPMTAG_NAME; + xx = headerGet(h, he, 0); + if (!strcmp(he->p.str, fmt)) { + he->p.ptr = _free(he->p.ptr); + /*@innerbreak@*/ break; + } + he->p.ptr = _free(he->p.ptr); + } + if (pkg == NULL || h == NULL) + h = spec->packages->header; + } + + if (h == NULL) + continue; + + fmt[0] = '\0'; + (void) stpcpy( stpcpy( stpcpy( fmt, "%{"), tn), "}"); + msgstr = _free(msgstr); + + /* XXX this should use queryHeader(), but prints out tn as well. */ + msgstr = headerSprintf(h, fmt, NULL, rpmHeaderFormats, &errstr); + if (msgstr == NULL) { + rpmlog(RPMLOG_ERR, _("can't query %s: %s\n"), tn, errstr); + return; + } + + switch(t->t_tag) { + case RPMTAG_SUMMARY: + case RPMTAG_GROUP: + /*@-unqualifiedtrans@*/ + sl->sl_lines[t->t_startx] = _free(sl->sl_lines[t->t_startx]); + /*@=unqualifiedtrans@*/ + if (t->t_lang && strcmp(t->t_lang, RPMBUILD_DEFAULT_LANG)) + continue; + { char *buf = xmalloc(strlen(tn) + sizeof(": ") + strlen(msgstr)); + (void) stpcpy( stpcpy( stpcpy(buf, tn), ": "), msgstr); + sl->sl_lines[t->t_startx] = buf; + } + /*@switchbreak@*/ break; + case RPMTAG_DESCRIPTION: + for (j = 1; j < t->t_nlines; j++) { + if (*sl->sl_lines[t->t_startx + j] == '%') + /*@innercontinue@*/ continue; + /*@-unqualifiedtrans@*/ + sl->sl_lines[t->t_startx + j] = + _free(sl->sl_lines[t->t_startx + j]); + /*@=unqualifiedtrans@*/ + } + if (t->t_lang && strcmp(t->t_lang, RPMBUILD_DEFAULT_LANG)) { + sl->sl_lines[t->t_startx] = _free(sl->sl_lines[t->t_startx]); + continue; + } + sl->sl_lines[t->t_startx + 1] = xstrdup(msgstr); + if (t->t_nlines > 2) + sl->sl_lines[t->t_startx + 2] = xstrdup("\n\n"); + /*@switchbreak@*/ break; + } + } + msgstr = _free(msgstr); + + for (i = 0; i < sl->sl_nlines; i++) { + const char * s = sl->sl_lines[i]; + if (s == NULL) + continue; + printf("%s", s); + if (strchr(s, '\n') == NULL && s[strlen(s)-1] != '\n') + printf("\n"); + } +} + +/** + * Add expanded build scriptlet to srpm header. + * @param h srpm header + * @param progTag interpreter tag (0 disables) + * @param scriptTag script tag (0 disables) + * @param iob script body sting buf (NULL disables) + * @return 0 always + */ +static int initSourceHeaderScriptlet(Header h, + rpmTag progTag, rpmTag scriptTag, rpmiob iob) + /*@modifies h @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + int xx; + + if (progTag !=(rpmTag) 0) { + static const char prog[] = "/bin/sh"; /* XXX FIXME */ + he->tag = progTag; + he->t = RPM_STRING_TYPE; + he->p.str = prog; + he->c = 1; + xx = headerPut(h, he, 0); + } + + if (scriptTag != (rpmTag)0 && iob != NULL) { + he->tag = scriptTag; + he->t = RPM_STRING_TYPE; + he->p.str = rpmiobStr(iob); + he->c = 1; + xx = headerPut(h, he, 0); + } + return 0; +} + +/** + * Add expanded build scriptlets to srpm header. + * @param spec spec file control structure + * @return 0 always + */ +static int initSourceHeaderScriptlets(Spec spec) + /*@modifies spec->sourceHeader @*/ +{ + int xx; + + if (spec->prep != NULL) + xx = initSourceHeaderScriptlet(spec->sourceHeader, + tagValue("Buildprepprog"), tagValue("Buildprep"), spec->prep); + if (spec->build != NULL) + xx = initSourceHeaderScriptlet(spec->sourceHeader, + tagValue("Buildbuildprog"), tagValue("Buildbuild"), spec->build); + if (spec->install != NULL) + xx = initSourceHeaderScriptlet(spec->sourceHeader, + tagValue("Buildinstallprog"), tagValue("Buildinstall"), spec->install); + if (spec->check != NULL) + xx = initSourceHeaderScriptlet(spec->sourceHeader, + tagValue("Buildcheckprog"), tagValue("Buildcheck"), spec->check); + if (spec->clean != NULL) + xx = initSourceHeaderScriptlet(spec->sourceHeader, + tagValue("Buildcleanprog"), tagValue("Buildclean"), spec->clean); + + return 0; +} + +/** + * Parse a spec file, and query the resultant header. + * @param ts rpm transaction + * @param qva query args + * @param specName specfile to parse + * @param target cpu-vender-os platform for query (NULL is current) + * @return 0 on success + */ +static int _specQuery(rpmts ts, QVA_t qva, const char *specName, + /*@null@*/ const char *target) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + Spec spec = NULL; + Package pkg; + int res = 1; /* assume error */ + int anyarch = (target == NULL) ? 1 : 0; + char * passPhrase = ""; + int recursing = 0; + char *cookie = NULL; + int verify = 0; + int xx; + + /*@-mods@*/ /* FIX: make spec abstract */ + if (parseSpec(ts, specName, "/", recursing, passPhrase, + cookie, anyarch, 1, verify) + || (spec = rpmtsSetSpec(ts, NULL)) == NULL) + { + rpmlog(RPMLOG_ERR, + _("query of specfile %s failed, can't parse\n"), + specName); + goto exit; + } + /*@=mods@*/ + + res = 0; + if (specedit) { + printNewSpecfile(spec); + goto exit; + } + + switch (qva->qva_source) { + case RPMQV_SPECSRPM: + xx = initSourceHeader(spec, NULL); + xx = initSourceHeaderScriptlets(spec); + xx = qva->qva_showPackage(qva, ts, spec->sourceHeader); + break; + default: + case RPMQV_SPECFILE: + for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { + /* If no target was specified, display all packages. + * Packages with empty file lists are not produced. + */ + /* XXX DIEDIEDIE: this logic looks flawed. */ + if (target == NULL || pkg->fileList != NULL) + xx = qva->qva_showPackage(qva, ts, pkg->header); + } + break; + } + +exit: + spec = freeSpec(spec); + return res; +} + +int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg) +{ + int res = 1; + const char * targets = rpmcliTargets; + char *target; + const char * t; + const char * te; + int nqueries = 0; + + if (qva->qva_showPackage == NULL) + goto exit; + + if (targets == NULL) { + res = _specQuery(ts, qva, arg, NULL); + nqueries++; + goto exit; + } + + rpmlog(RPMLOG_DEBUG, + _("Query specfile for platform(s): %s\n"), targets); + for (t = targets; *t != '\0'; t = te) { + /* Parse out next target platform. */ + if ((te = strchr(t, ',')) == NULL) + te = t + strlen(t); + target = alloca(te-t+1); + strncpy(target, t, (te-t)); + target[te-t] = '\0'; + if (*te != '\0') + te++; + + /* Query spec for this target platform. */ + rpmlog(RPMLOG_DEBUG, _(" target platform: %s\n"), target); + /* Read in configuration for target. */ + if (t != targets) { + rpmFreeMacros(NULL); + rpmFreeRpmrc(); + (void) rpmReadConfigFiles(NULL, target); + } + res = _specQuery(ts, qva, arg, target); + nqueries++; + if (res) break; + } + +exit: + /* Restore original configuration. */ + if (nqueries > 1) { + t = targets; + if ((te = strchr(t, ',')) == NULL) + te = t + strlen(t); + target = alloca(te-t+1); + strncpy(target, t, (te-t)); + target[te-t] = '\0'; + if (*te != '\0') + te++; + rpmFreeMacros(NULL); + rpmFreeRpmrc(); + (void) rpmReadConfigFiles(NULL, target); + } + return res; +} diff --git a/rpm-5.4.9/config.guess b/rpm-5.4.9/config.guess new file mode 100755 index 0000000..49ba16f --- /dev/null +++ b/rpm-5.4.9/config.guess @@ -0,0 +1,1522 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +timestamp='2012-01-01' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -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 + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/rpm-5.4.9/config.h.in b/rpm-5.4.9/config.h.in new file mode 100644 index 0000000..6d9c002 --- /dev/null +++ b/rpm-5.4.9/config.h.in @@ -0,0 +1,1513 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* Predefined possible va_copy() implementation (id: ASP) */ +#define __VA_COPY_USE_ASP(d, s) do { *(d) = *(s); } while (0) + +/* Predefined possible va_copy() implementation (id: ASS) */ +#define __VA_COPY_USE_ASS(d, s) do { (d) = (s); } while (0) + +/* Predefined possible va_copy() implementation (id: C99) */ +#define __VA_COPY_USE_C99(d, s) va_copy((d), (s)) + +/* Define as 1 if chown() follows symlinks and you don't have lchown() */ +#undef CHOWN_FOLLOWS_SYMLINK + +/* Predefined possible va_copy() implementation (id: CPP) */ +#define __VA_COPY_USE_CPP(d, s) memcpy((void *)(d), (void *)(s), sizeof(*(s))) + +/* Predefined possible va_copy() implementation (id: CPS) */ +#define __VA_COPY_USE_CPS(d, s) memcpy((void *)&(d), (void *)&(s), sizeof((s))) + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +#undef CRAY_STACKSEG_END + +/* Define to 1 if using `alloca.c'. */ +#undef C_ALLOCA + +/* Full path to RPM database directory */ +#undef DBPATH + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#undef ENABLE_NLS + +/* Predefined possible va_copy() implementation (id: GCB) */ +#define __VA_COPY_USE_GCB(d, s) __builtin_va_copy((d), (s)) + +/* Predefined possible va_copy() implementation (id: GCH) */ +#define __VA_COPY_USE_GCH(d, s) __va_copy((d), (s)) + +/* Predefined possible va_copy() implementation (id: GCM) */ +#define __VA_COPY_USE_GCM(d, s) VA_COPY((d), (s)) + +/* Define to 1 if you have `alloca', as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +#undef HAVE_ALLOCA_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_APR_1_APR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define to 1 if you have the `asprintf' function. */ +#undef HAVE_ASPRINTF + +/* Define to 1 if you have the header file. */ +#undef HAVE_ASSERT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ATERM1_H + +/* Define to 1 if you have the `atoi' function. */ +#undef HAVE_ATOI + +/* Define to 1 if you have the `atol' function. */ +#undef HAVE_ATOL + +/* Define to 1 if you have the header file. */ +#undef HAVE_AUGEAS_H + +/* Define to 1 if you have the `basename' function. */ +#undef HAVE_BASENAME + +/* Define to 1 if you have the header file. */ +#undef HAVE_BASHTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_BEECRYPT_API_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_BZLIB_H + +/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +#undef HAVE_CFLOCALECOPYCURRENT + +/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +#undef HAVE_CFPREFERENCESCOPYAPPVALUE + +/* Define to 1 if you have the `chflags' function. */ +#undef HAVE_CHFLAGS + +/* Define to 1 if you have the `clearenv' function. */ +#undef HAVE_CLEARENV + +/* Define to 1 if you have the `confstr' function. */ +#undef HAVE_CONFSTR + +/* Define to 1 if you have the header file. */ +#undef HAVE_CPUINFO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_CUDF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DBSQL_H + +/* Have header */ +#undef HAVE_DB_H + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +#undef HAVE_DCGETTEXT + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DMALLOC_H + +/* Define to 1 if you have the `dnl' function. */ +#undef HAVE_DNL + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +#undef HAVE_DOPRNT + +/* Define to 1 if you have the DSA_generate_parameters_ex() function. */ +#undef HAVE_DSA_GENERATE_PARAMETERS_EX + +/* Define to 1 if you have the `error' function. */ +#undef HAVE_ERROR + +/* Define to 1 if you have the header file. */ +#undef HAVE_ERROR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ERR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_EXPAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_EXTERN_H + +/* Define to 1 if you have the `fallocate' function. */ +#undef HAVE_FALLOCATE + +/* Define to 1 if you have the `fchflags' function. */ +#undef HAVE_FCHFLAGS + +/* Define to 1 if you have the `fchmod' function. */ +#undef HAVE_FCHMOD + +/* Define to 1 if you have the `fclose' function. */ +#undef HAVE_FCLOSE + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the `fgetc' function. */ +#undef HAVE_FGETC + +/* Define to 1 if you have the `fgets' function. */ +#undef HAVE_FGETS + +/* Define to 1 if you have */ +#undef HAVE_FICL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FLOAT_H + +/* Define to 1 if you have the `fopen' function. */ +#undef HAVE_FOPEN + +/* Define to 1 if you have the `ftok' function. */ +#undef HAVE_FTOK + +/* Define to 1 if you have the `futimens' function. */ +#undef HAVE_FUTIMENS + +/* Define to 1 if you have the `futimes' function. */ +#undef HAVE_FUTIMES + +/* Define to 1 if you have the `futimesat' function. */ +#undef HAVE_FUTIMESAT + +/* Define to 1 if you have the `fwrite' function. */ +#undef HAVE_FWRITE + +/* Define to 1 if you have the header file. */ +#undef HAVE_GCRYPT_H + +/* Define to 1 if you have the gelf_getnote() function. */ +#undef HAVE_GELF_GETNOTE + +/* Define to 1 if you have the gelf_getvernaux() function. */ +#undef HAVE_GELF_GETVERNAUX + +/* Define to 1 if you have gelf.h */ +#undef HAVE_GELF_H + +/* Define to 1 if you have the `getaddrinfo' function. */ +#undef HAVE_GETADDRINFO + +/* Define to 1 if you have the `getattrlist' function. */ +#undef HAVE_GETATTRLIST + +/* Define to 1 if you have the `getcwd' function. */ +#undef HAVE_GETCWD + +/* Define to 1 if you have the `getdelim' function. */ +#undef HAVE_GETDELIM + +/* Define to 1 if you have the `getline' function. */ +#undef HAVE_GETLINE + +/* Define if you have the getmntent() function */ +#undef HAVE_GETMNTENT + +/* Define as 1 if you have getmntinfo() (Mac OS X) */ +#undef HAVE_GETMNTINFO + +/* Define as 1 if you have getmntinfo_r() (only osf?) */ +#undef HAVE_GETMNTINFO_R + +/* Define to 1 if you have the `getmode' function. */ +#undef HAVE_GETMODE + +/* Define to 1 if you have the `getnameinfo' function. */ +#undef HAVE_GETNAMEINFO + +/* Define to 1 if you have the `getopt' function. */ +#undef HAVE_GETOPT + +/* Define to 1 if you have the header file. */ +#undef HAVE_GETOPT_H + +/* Define to 1 if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE + +/* Define to 1 if you have the `getpassphrase' function. */ +#undef HAVE_GETPASSPHRASE + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#undef HAVE_GETTEXT + +/* Define to 1 if you have the `getwd' function. */ +#undef HAVE_GETWD + +/* Define to 1 if you have the `getxattr' function. */ +#undef HAVE_GETXATTR + +/* Define to 1 if you have */ +#undef HAVE_GIT2_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_GLOBALS_HH + +/* Define to 1 if you have the header file. */ +#undef HAVE_GLOB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_GNUTLS_GNUTLS_H + +/* Define to 1 if you have */ +#undef HAVE_GPSEE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_GRP_H + +/* Define as 1 if defines h_errno */ +#undef HAVE_HERRNO + +/* Define to 1 if you have the `iconv' function. */ +#undef HAVE_ICONV + +/* Define to 1 if you have the `inet_aton' function. */ +#undef HAVE_INET_ATON + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `isalpha' function. */ +#undef HAVE_ISALPHA + +/* Define to 1 if you have the `isdigit' function. */ +#undef HAVE_ISDIGIT + +/* Define to 1 if you have the `isprint' function. */ +#undef HAVE_ISPRINT + +/* Define to 1 if you have the `isspace' function. */ +#undef HAVE_ISSPACE + +/* Define to 1 if you have the header file. */ +#undef HAVE_JSAPI_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_KEYUTILS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LANGINFO_H + +/* Define to 1 if you have the `lchflags' function. */ +#undef HAVE_LCHFLAGS + +/* Define to 1 if you have the `lchmod' function. */ +#undef HAVE_LCHMOD + +/* Define to 1 if you have the `lchown' function. */ +#undef HAVE_LCHOWN + +/* Define to 1 if you have the `lgetxattr' function. */ +#undef HAVE_LGETXATTR + +/* Define to 1 if you have the `acl' library (-lacl). */ +#undef HAVE_LIBACL + +/* Define to 1 if you have the `apr-1' library (-lapr-1). */ +#undef HAVE_LIBAPR_1 + +/* Define to 1 if you have the `ATerm' library (-lATerm). */ +#undef HAVE_LIBATERM + +/* Define to 1 if you have the `attr' library (-lattr). */ +#undef HAVE_LIBATTR + +/* Define to 1 if you have the `augeas' library (-laugeas). */ +#undef HAVE_LIBAUGEAS + +/* Define to 1 if you have the 'bash' library (-lbash). */ +#undef HAVE_LIBBASH + +/* Define to 1 if you have the `beecrypt' library (-lbeecrypt). */ +#undef HAVE_LIBBEECRYPT + +/* Define to 1 if you have the `bz2' library (-lbz2). */ +#undef HAVE_LIBBZ2 + +/* Define to 1 if you have the `compat' library (-lcompat). */ +#undef HAVE_LIBCOMPAT + +/* Define to 1 if you have the `cpuinfo' library (-lcpuinfo). */ +#undef HAVE_LIBCPUINFO + +/* Define to 1 if you have the `crypto' library (-lcrypto). */ +#undef HAVE_LIBCRYPTO + +/* Define to 1 if you have the `cudf' library (-lcudf). */ +#undef HAVE_LIBCUDF + +/* Define to 1 if you have the `db-5.3' library (-ldb-5.3). */ +#undef HAVE_LIBDB_5_3 + +/* Define to 1 if you have the `db_sql-5.3' library (-ldb_sql-5.3). */ +#undef HAVE_LIBDB_SQL_5_3 + +/* Define to 1 if you have the `dl' library (-ldl). */ +#undef HAVE_LIBDL + +/* Define to 1 if you have the `dmalloc' library (-ldmalloc). */ +#undef HAVE_LIBDMALLOC + +/* Define to 1 if you have the `efence' library (-lefence). */ +#undef HAVE_LIBEFENCE + +/* Define to 1 if you have ELF library */ +#undef HAVE_LIBELF + +/* Define to 1 if you have libelf.h */ +#undef HAVE_LIBELF_H + +/* Define to 1 if you have the `expat' library (-lexpat). */ +#undef HAVE_LIBEXPAT + +/* Define to 1 if you have the 'ficl' library (-lficl). */ +#undef HAVE_LIBFICL + +/* Define to 1 if you have the `format' library (-lformat). */ +#undef HAVE_LIBFORMAT + +/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */ +#undef HAVE_LIBGCRYPT + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBGEN_H + +/* Define to 1 if you have the `git2' library (-lgit2). */ +#undef HAVE_LIBGIT2 + +/* Define to 1 if you have the `gnutls' library (-lgnutls). */ +#undef HAVE_LIBGNUTLS + +/* Define to 1 if you have the 'gpsee' library (-ljs). */ +#undef HAVE_LIBGPSEE + +/* Define to 1 if you have the `gz' library (-lgz). */ +#undef HAVE_LIBGZ + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBIO_H + +/* Define to 1 if you have the 'mozjs185' library (-lmozjs185). */ +#undef HAVE_LIBJS + +/* Define to 1 if you have the `keyutils' library (-lkeyutils). */ +#undef HAVE_LIBKEYUTILS + +/* Define to 1 if you have the `lua' library (-llua). */ +#undef HAVE_LIBLUA + +/* Define to 1 if you have the `lzma' library (-llzma). */ +#undef HAVE_LIBLZMA + +/* Define to 1 if you have the `m' library (-lm). */ +#undef HAVE_LIBM + +/* Define to 1 if you have the `magic' library (-lmagic). */ +#undef HAVE_LIBMAGIC + +/* Define to 1 if you have the `mozjs185' library (-lmozjs185). */ +#undef HAVE_LIBMOZJS185 + +/* Define to 1 if you have the `neon' library (-lneon). */ +#undef HAVE_LIBNEON + +/* Define to 1 if you have the `nsl' library (-lnsl). */ +#undef HAVE_LIBNSL + +/* Define to 1 if you have the `nss' library (-lnss). */ +#undef HAVE_LIBNSS + +/* Define to 1 if you have the `nss3' library (-lnss3). */ +#undef HAVE_LIBNSS3 + +/* Define to 1 if you have the `odbc' library (-lodbc). */ +#undef HAVE_LIBODBC + +/* Define to 1 if you have the `ossp-uuid' library (-lossp-uuid). */ +#undef HAVE_LIBOSSP_UUID + +/* Define to 1 if you have the `pakchois' library (-lpakchois). */ +#undef HAVE_LIBPAKCHOIS + +/* Define to 1 if you have the 'pcre' library (-lpcre). */ +#undef HAVE_LIBPCRE + +/* Define to 1 if you have the `perl' library (-lperl). */ +#undef HAVE_LIBPERL + +/* Define to 1 if you have the `popt' library (-lpopt). */ +#undef HAVE_LIBPOPT + +/* Define to 1 if you have the `port' library (-lport). */ +#undef HAVE_LIBPORT + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +#undef HAVE_LIBPTHREAD + +/* Define to 1 if you have the `python2.4' library (-lpython2.4). */ +#undef HAVE_LIBPYTHON2_4 + +/* Define to 1 if you have the `python2.5' library (-lpython2.5). */ +#undef HAVE_LIBPYTHON2_5 + +/* Define to 1 if you have the `python2.6' library (-lpython2.6). */ +#undef HAVE_LIBPYTHON2_6 + +/* Define to 1 if you have the `python2.7' library (-lpython2.7). */ +#undef HAVE_LIBPYTHON2_7 + +/* Define to 1 if you have the `rand' library (-lrand). */ +#undef HAVE_LIBRAND + +/* Define to 1 if you have the 'rc' library (-lrc). */ +#undef HAVE_LIBRC + +/* Define to 1 if you have the `readline' library (-lreadline). */ +#undef HAVE_LIBREADLINE + +/* Define to 1 if you have the `rt' library (-lrt). */ +#undef HAVE_LIBRT + +/* Define to 1 if you have the `ruby' library (-lruby). */ +#undef HAVE_LIBRUBY + +/* Define to 1 if you have the `selinux' library (-lselinux). */ +#undef HAVE_LIBSELINUX + +/* Define to 1 if you have the `semanage' library (-lsemanage). */ +#undef HAVE_LIBSEMANAGE + +/* Define to 1 if you have the `sepol' library (-lsepol). */ +#undef HAVE_LIBSEPOL + +/* Define to 1 if you have the `socket' library (-lsocket). */ +#undef HAVE_LIBSOCKET + +/* Define to 1 if you have the `sqlite3' library (-lsqlite3). */ +#undef HAVE_LIBSQLITE3 + +/* Define to 1 if you have the `squirrel' library (-lsquirrel). */ +#undef HAVE_LIBSQUIRREL + +/* Define to 1 if you have the `svn_client-1' library (-lsvn_client-1). */ +#undef HAVE_LIBSVN_CLIENT_1 + +/* Define to 1 if you have the `syck' library (-lsyck). */ +#undef HAVE_LIBSYCK + +/* Define to 1 if you have the `tasn1' library (-ltasn1). */ +#undef HAVE_LIBTASN1 + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBTASN1_H + +/* Define to 1 if you have the `tcl' library (-ltcl). */ +#undef HAVE_LIBTCL + +/* Define to 1 if you have the `tcl8.5' library (-ltcl8.5). */ +#undef HAVE_LIBTCL8_5 + +/* Define to 1 if you have the `tcl8.6' library (-ltcl8.6). */ +#undef HAVE_LIBTCL8_6 + +/* Define to 1 if you have the `thread' library (-lthread). */ +#undef HAVE_LIBTHREAD + +/* Define to 1 if you have the `tomcrypt' library (-ltomcrypt). */ +#undef HAVE_LIBTOMCRYPT + +/* Define to 1 if you have the `tpm' library (-ltpm). */ +#undef HAVE_LIBTPM + +/* Define to 1 if you have the `uuid' library (-luuid). */ +#undef HAVE_LIBUUID + +/* Define to 1 if you have the `xar' library (-lxar). */ +#undef HAVE_LIBXAR + +/* Define to 1 if you have the `z' library (-lz). */ +#undef HAVE_LIBZ + +/* 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 you have the `localtime' function. */ +#undef HAVE_LOCALTIME + +/* Define to 1 if the system has the type `long double'. */ +#undef HAVE_LONG_DOUBLE + +/* Define to 1 if the system has the type `long long'. */ +#undef HAVE_LONG_LONG + +/* Define to 1 if you have the `lsetxattr' function. */ +#undef HAVE_LSETXATTR + +/* Define to 1 if you have the header file. */ +#undef HAVE_LUA_H + +/* Define to 1 if you have the `lutimes' function. */ +#undef HAVE_LUTIMES + +/* Define to 1 if you have */ +#undef HAVE_LZMA_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MACHINE_TYPES_H + +/* Define to 1 if you have the `madvise' function. */ +#undef HAVE_MADVISE + +/* Define to 1 if you have */ +#undef HAVE_MAGIC_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MCHECK_H + +/* Define to 1 if you have the `memcmp' function. */ +#undef HAVE_MEMCMP + +/* Define to 1 if you have the `memcpy' function. */ +#undef HAVE_MEMCPY + +/* Define to 1 if you have the `memmove' function. */ +#undef HAVE_MEMMOVE + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `mempcpy' function. */ +#undef HAVE_MEMPCPY + +/* Define to 1 if you have the `mkdtemp' function. */ +#undef HAVE_MKDTEMP + +/* Define to 1 if you have the `mkstemp' function. */ +#undef HAVE_MKSTEMP + +/* Define to 1 if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define as 1 if you have mntctl() (only aix?) */ +#undef HAVE_MNTCTL + +/* Define to 1 if you have the header file. */ +#undef HAVE_MNTENT_H + +/* Define to 1 if you have the `mtrace' function. */ +#undef HAVE_MTRACE + +/* Define to 1 if the number of available CPU cores can be detected with + sysconf(_SC_NPROCESSORS_ONLN). */ +#undef HAVE_NCPU_SYSCONF + +/* Define to 1 if the number of available CPU cores can be detected with + sysctl(). */ +#undef HAVE_NCPU_SYSCTL + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you have ne_get_response_header() in libneon. */ +#undef HAVE_NEON_NE_GET_RESPONSE_HEADER + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETDB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_SYSTM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NE_SESSION_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NSS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_OPENSSL_CRYPTO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_PAKCHOIS_PAKCHOIS_H + +/* Define to 1 if you have */ +#undef HAVE_PCRE_H + +/* Define to 1 if the amount of physical memory can be detected with + sysconf(_SC_PAGESIZE) and sysconf(_SC_PHYS_PAGES). */ +#undef HAVE_PHYSMEM_SYSCONF + +/* Define to 1 if the amount of physical memory can be detected with sysctl(). + */ +#undef HAVE_PHYSMEM_SYSCTL + +/* Define to 1 if you have the header file. */ +#undef HAVE_POLL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_POPT_H + +/* Define to 1 if you have the `posix_fadvise' function. */ +#undef HAVE_POSIX_FADVISE + +/* Define to 1 if you have the `posix_fallocate' function. */ +#undef HAVE_POSIX_FALLOCATE + +/* Define to 1 if you have the `printf' function. */ +#undef HAVE_PRINTF + +/* Define to 1 if you have the header file. */ +#undef HAVE_PTHREAD_H + +/* Define to 1 if you have the `putenv' function. */ +#undef HAVE_PUTENV + +/* Define to 1 if you have the header file. */ +#undef HAVE_PWD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_PYTHON_H + +/* Define to 1 if you have the `qsort' function. */ +#undef HAVE_QSORT + +/* Define to 1 if you have the `raise' function. */ +#undef HAVE_RAISE + +/* Define to 1 if you have the `rand' function. */ +#undef HAVE_RAND + +/* Define to 1 if you have */ +#undef HAVE_RC_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_READLINE_HISTORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_READLINE_READLINE_H + +/* Define to 1 if you have the `realpath' function. */ +#undef HAVE_REALPATH + +/* Define to 1 if you have the `regcomp' function. */ +#undef HAVE_REGCOMP + +/* Define to 1 if you have the `rl_completion_matches' function. */ +#undef HAVE_RL_COMPLETION_MATCHES + +/* Define to 1 if you have the RSA_generate_key_ex() function. */ +#undef HAVE_RSA_GENERATE_KEY_EX + +/* Define to 1 if you have the header file. */ +#undef HAVE_RUBY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SEARCH_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SELINUX_SELINUX_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SEMANAGE_SEMANAGE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SEMAPHORE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SEPOL_SEPOL_H + +/* Define to 1 if you have the `setattrlist' function. */ +#undef HAVE_SETATTRLIST + +/* Define to 1 if you have the `setenv' function. */ +#undef HAVE_SETENV + +/* Define to 1 if you have the `setlocale' function. */ +#undef HAVE_SETLOCALE + +/* Define to 1 if you have the `setmode' function. */ +#undef HAVE_SETMODE + +/* Define to 1 if you have the `setproctitle' function. */ +#undef HAVE_SETPROCTITLE + +/* Define to 1 if you have the `setxattr' function. */ +#undef HAVE_SETXATTR + +/* Define to 1 if you have the `sigaction' function. */ +#undef HAVE_SIGACTION + +/* Define to 1 if you have the `sigaddset' function. */ +#undef HAVE_SIGADDSET + +/* Define to 1 if you have the `sigdelset' function. */ +#undef HAVE_SIGDELSET + +/* Define to 1 if you have the `sigemptyset' function. */ +#undef HAVE_SIGEMPTYSET + +/* Define to 1 if the system has the type `sighanlder_t'. */ +#undef HAVE_SIGHANLDER_T + +/* Define to 1 if you have the `sighold' function. */ +#undef HAVE_SIGHOLD + +/* Define to 1 if you have the header file. */ +#undef HAVE_SIGNAL_H + +/* Define to 1 if you have the `sigpause' function. */ +#undef HAVE_SIGPAUSE + +/* Define to 1 if you have the `sigprocmask' function. */ +#undef HAVE_SIGPROCMASK + +/* Define to 1 if you have the `sigrelse' function. */ +#undef HAVE_SIGRELSE + +/* Define to 1 if you have the `sigsuspend' function. */ +#undef HAVE_SIGSUSPEND + +/* Define to 1 if the system has the type `sig_t'. */ +#undef HAVE_SIG_T + +/* Define to 1 if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + +/* Define to 1 if you have the header file. */ +#undef HAVE_SQLEXT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SQLITE3_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SQUIRREL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `stpcpy' function. */ +#undef HAVE_STPCPY + +/* Define to 1 if you have the `stpncpy' function. */ +#undef HAVE_STPNCPY + +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the `strcat' function. */ +#undef HAVE_STRCAT + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the `strcoll' function. */ +#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 `strmode' function. */ +#undef HAVE_STRMODE + +/* Define to 1 if you have the `strncat' function. */ +#undef HAVE_STRNCAT + +/* Define to 1 if you have the `strncmp' function. */ +#undef HAVE_STRNCMP + +/* Define to 1 if you have the `strndup' function. */ +#undef HAVE_STRNDUP + +/* Define to 1 if you have the `strrchr' function. */ +#undef HAVE_STRRCHR + +/* Define to 1 if you have the `strsep' function. */ +#undef HAVE_STRSEP + +/* 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 as 1 if you have "struct mnttab" (only sco?) */ +#undef HAVE_STRUCT_MNTTAB + +/* Define to 1 if `st_atimensec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIMENSEC + +/* Define to 1 if `st_atimespec.tv_nsec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC + +/* Define to 1 if `st_atim.st__tim.tv_nsec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC + +/* Define to 1 if `st_atim.tv_nsec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC + +/* Define to 1 if `st_birthtime' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_BIRTHTIME + +/* Define to 1 if `st_flags' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_FLAGS + +/* Define to 1 if `st_uatime' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_UATIME + +/* Define to 1 if you have the `strverscmp' function. */ +#undef HAVE_STRVERSCMP + +/* Define to 1 if you have the header file. */ +#undef HAVE_SUBVERSION_1_SVN_CLIENT_H + +/* Have header */ +#undef HAVE_SYCK_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYNCH_H + +/* Define to 1 if you have the `syslog' function. */ +#undef HAVE_SYSLOG + +/* Have header */ +#undef HAVE_SYS_ACL_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_DIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_ENDIAN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IPC_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MMAN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MNTCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MNTTAB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MOUNT_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_NDIR_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_PRCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_RESOURCE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_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_STDTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SYSTEMCFG_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_SYS_UTSNAME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_VMOUNT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_WAIT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_XATTR_H + +/* Define as 1 if defines S_IFSOCK */ +#undef HAVE_S_IFSOCK + +/* Define as 1 if defines S_ISLNK */ +#undef HAVE_S_ISLNK + +/* Define as 1 if defines S_ISSOCK */ +#undef HAVE_S_ISSOCK + +/* Define as 1 if defines S_ISTXT */ +#undef HAVE_S_ISTXT + +/* Define as 1 if defines S_ISVTX */ +#undef HAVE_S_ISVTX + +/* Define to 1 if you have the header file. */ +#undef HAVE_TCL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_THREAD_H + +/* Define to 1 if you have the `time' function. */ +#undef HAVE_TIME + +/* Define to 1 if you have the header file. */ +#undef HAVE_TOMCRYPT_TOMCRYPT_CFG_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_TPM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `utime' function. */ +#undef HAVE_UTIME + +/* Define to 1 if you have the `utimes' function. */ +#undef HAVE_UTIMES + +/* Define to 1 if you have the header file. */ +#undef HAVE_UTIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UUID_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_VALGRIND_VALGRIND_H + +/* Define if va_copy() macro exists (and no fallback implementation is + required) */ +#undef HAVE_VA_COPY + +/* Define as 1 if your va_list type is an array */ +#undef HAVE_VA_LIST_AS_ARRAY + +/* Define to 1 if you have the `vprintf' function. */ +#undef HAVE_VPRINTF + +/* Define to 1 if you have the `vsnprintf' function. */ +#undef HAVE_VSNPRINTF + +/* Define to 1 if you have xar_get_size() in libxar. */ +#undef HAVE_XAR_GET_SIZE + +/* Have header */ +#undef HAVE_XAR_H + +/* Define to 1 if you have */ +#undef HAVE_ZLIB_H + +/* Define to 1 if you have the `__secure_getenv' function. */ +#undef HAVE___SECURE_GETENV + +/* Define to 1 if libelf.h is incompatible with LFS API */ +#undef LIBELF_H_LFS_CONFLICT + +/* Full path to RPM locale directory */ +#undef LOCALEDIR + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* Colon separated RPM macro files path */ +#undef MACROFILES + +/* 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 + +/* Define as 1 if we need myrealloc */ +#undef NEED_MYREALLOC + +/* Define as one if we need to include (along with ) */ +#undef NEED_STRINGS_H + +/* 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 + +/* Perl install directory (vendor/site) */ +#undef PERL_INSTALLDIRS + +/* Perl install directory (vendor/site) */ +#undef PERL_URPM_INSTALLDIRS + +/* Full path to RPM package sources directory */ +#undef PKGSRCDIR + +/* Colon separated RPM Lua script files path */ +#undef RPMLUAFILES + +/* Colon separated RPM POPT configuration files path */ +#undef RPMPOPTFILES + +/* Permit in RPM version comparison that digits beat alpha */ +#undef RPMVERCMP_DIGITS_BEAT_ALPHA + +/* Adds RPM Lua extensions based on rpmlib functionality */ +#undef RPM_LUA_EXTENSIONS_BASED_ON_RPMLIB + +/* official name of program */ +#undef RPM_NAME + +/* permit to disable via macro the automatic dirname and symlink dependecy */ +#undef RPM_OPTIONAL_DIRNAME_AND_SYMLINK_DEPS + +/* Vendor is Ark */ +#undef RPM_VENDOR_ARK + +/* Vendor is Fedora */ +#undef RPM_VENDOR_FEDORA + +/* Vendor is Mandriva */ +#undef RPM_VENDOR_MANDRIVA + +/* Vendor is openmamba */ +#undef RPM_VENDOR_OPENMAMBA + +/* Vendor is suse */ +#undef RPM_VENDOR_SUSE + +/* The size of `char', as computed by sizeof. */ +#undef SIZEOF_CHAR + +/* The size of `int', as computed by sizeof. */ +#undef SIZEOF_INT + +/* The size of `long', as computed by sizeof. */ +#undef SIZEOF_LONG + +/* The size of `long long', as computed by sizeof. */ +#undef SIZEOF_LONG_LONG + +/* The size of `short', as computed by sizeof. */ +#undef SIZEOF_SHORT + +/* The size of `unsigned char', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_CHAR + +/* The size of `unsigned int', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_INT + +/* The size of `unsigned long', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_LONG + +/* The size of `unsigned long long', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_LONG_LONG + +/* The size of `unsigned short', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_SHORT + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define if struct statfs has the f_bavail member */ +#undef STATFS_HAS_F_BAVAIL + +/* statfs in (for Digital Unix 4.0D systems) */ +#undef STATFS_IN_SYS_MOUNT + +/* statfs in (for IRIX 6.4 systems) */ +#undef STATFS_IN_SYS_STATFS + +/* statfs in (for Solaris 2.6+ systems) */ +#undef STATFS_IN_SYS_STATVFS + +/* statfs in (for Linux systems) */ +#undef STATFS_IN_SYS_VFS + +/* Define if statfs() takes 4 arguments */ +#undef STAT_STATFS4 + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Full path to RPM global configuration directory */ +#undef SYSCONFIGDIR + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define to 1 for using BeeCrypt as default cryptography library */ +#undef USE_CRYPTO_BEECRYPT + +/* Define to 1 for using Apple CDSA as default cryptography library */ +#undef USE_CRYPTO_CDSA + +/* Define to 1 for using GCrypt as default cryptography library */ +#undef USE_CRYPTO_GCRYPT + +/* Define to 1 for using Mozilla NSS as default cryptography library */ +#undef USE_CRYPTO_NSS + +/* Define to 1 for using OpenSSL as default cryptography library */ +#undef USE_CRYPTO_OPENSSL + +/* Define to 1 for using TomCrypt as default cryptography library */ +#undef USE_CRYPTO_TOMCRYPT + +/* Defined if getmntent replacement is used */ +#undef USE_GETMNTENT + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + +/* Full path to RPM system library directory */ +#undef USRLIBRPM + +/* Path to /usr */ +#undef USRPREFIX + +/* Path to /var */ +#undef VARPREFIX + +/* Version number of package */ +#undef VERSION + +/* Define as 1 if building with ACL library */ +#undef WITH_ACL + +/* Define if building with Apr */ +#undef WITH_APR + +/* Define as 1 if building with ATerm library */ +#undef WITH_ATERM + +/* Define as 1 if building with ATTR library */ +#undef WITH_ATTR + +/* Define as 1 if building with Augeas library */ +#undef WITH_AUGEAS + +/* Define as 1 if building with Bash library */ +#undef WITH_BASH + +/* Define as 1 if building with BeeCrypt library */ +#undef WITH_BEECRYPT + +/* Define as 1 if building with GNU BZip2 library */ +#undef WITH_BZIP2 + +/* Define as 1 if building with CPUInfo library */ +#undef WITH_CPUINFO + +/* Define as 1 if building with Libcudf library */ +#undef WITH_CUDF + +/* Define as 1 if building with Berkeley-DB library */ +#undef WITH_DB + +/* Define as 1 if building with Berkeley-DB (+SQLite3) library */ +#undef WITH_DBSQL + +/* Define as 1 if building with DMalloc library */ +#undef WITH_DMALLOC + +/* Define as 1 if building with Electric Fence library */ +#undef WITH_EFENCE + +/* Define if building with Expat */ +#undef WITH_EXPAT + +/* Define as 1 if building with FICL library */ +#undef WITH_FICL + +/* Define as 1 if building with File (magic) library */ +#undef WITH_FILE + +/* Define if building with GCrypt */ +#undef WITH_GCRYPT + +/* Define if building with GnuTLS */ +#undef WITH_GNUTLS + +/* Define to 1 if to use GPSEE as the embedded JS interpreter */ +#undef WITH_GPSEE + +/* Define as 1 if building with Linux keyutils library */ +#undef WITH_KEYUTILS + +/* Define if building with Libgit2 */ +#undef WITH_LIBGIT2 + +/* Define if building with Libtasn1 */ +#undef WITH_LIBTASN1 + +/* Define as 1 if building with Lua library */ +#undef WITH_LUA + +/* Define if building with internal Lua */ +#undef WITH_LUA_INTERNAL + +/* Define as 1 if building with JavaScript library */ +#undef WITH_MOZJS185 + +/* Define as 1 if building with Neon library */ +#undef WITH_NEON + +/* Define as 1 if building with Nix expressions library */ +#undef WITH_NIX + +/* Define if building with Mozilla NSS */ +#undef WITH_NSS + +/* Define as 1 if building with OpenSSL library */ +#undef WITH_OPENSSL + +/* Define if building with Pakchois */ +#undef WITH_PAKCHOIS + +/* Define as 1 if building with PCRE library */ +#undef WITH_PCRE + +/* Define as 1 if PCRE's POSIX API is available */ +#undef WITH_PCRE_POSIX + +/* Define as 1 if building with Perl ExtUtils::Embed library */ +#undef WITH_PERLEMBED + +/* Define as 1 if building with POPT library */ +#undef WITH_POPT + +/* Define to 1 for using Pthreads */ +#undef WITH_PTHREADS + +/* Define as 1 if building with Python embedding library */ +#undef WITH_PYTHONEMBED + +/* Define as 1 if building with Rc library */ +#undef WITH_RC + +/* Define to 1 if you want to use Readline */ +#undef WITH_READLINE + +/* Define as 1 if building with Ruby library */ +#undef WITH_RUBY + +/* Define to 1 if you want embedded Ruby */ +#undef WITH_RUBYEMBED + +/* Define if building with Libselinux */ +#undef WITH_SELINUX + +/* Define if building with Libsemanage */ +#undef WITH_SEMANAGE + +/* Define if building with Libsepol */ +#undef WITH_SEPOL + +/* Define as 1 if building with SQLite library */ +#undef WITH_SQLITE + +/* Define as 1 if building with Squirrel library */ +#undef WITH_SQUIRREL + +/* Define if building with OpenSSL */ +#undef WITH_SSL + +/* Define if building with Subversion */ +#undef WITH_SUBVERSION + +/* Define as 1 if building with Syck library */ +#undef WITH_SYCK + +/* Define as 1 if building with Tcl library */ +#undef WITH_TCL + +/* Define if building with LibTomCrypt */ +#undef WITH_TOMCRYPT + +/* Define if building with IBM TPM 1.2 emulator */ +#undef WITH_TPM + +/* Define if building with UnixODBC */ +#undef WITH_UNIXODBC + +/* Define as 1 if building with OSSP uuid library */ +#undef WITH_UUID + +/* Build with valgrind support? */ +#undef WITH_VALGRIND + +/* Define as 1 if building with XAR library */ +#undef WITH_XAR + +/* Define as 1 if building with XZ libLZMA library */ +#undef WITH_XZ + +/* Define as 1 if building with ZLib library */ +#undef WITH_ZLIB + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#if defined(__BIG_ENDIAN__) +#define WORDS_BIGENDIAN 1 +#elif defined(__LITTLE_ENDIAN__) +/* #undef WORDS_BIGENDIAN */ +#else +/* use configure result: */ +#undef WORDS_BIGENDIAN +#endif + +/* 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 1 if on MINIX. */ +#undef _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE + +/* full path to a 'mkdir -p' style program */ +#undef __MKDIR_P + +/* Optional va_copy() implementation activation */ +#ifndef HAVE_VA_COPY +#define va_copy(d, s) __VA_COPY_USE(d, s) +#endif + + +/* Define to id of used va_copy() implementation */ +#undef __VA_COPY_USE + +/* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */ +#undef __func__ + +/* 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 `int' if does not define. */ +#undef mode_t + +/* Define to `long int' if does not define. */ +#undef off_t + +/* Define to `int' if does not define. */ +#undef pid_t + +/* Define to `unsigned int' if does not define. */ +#undef size_t diff --git a/rpm-5.4.9/config.rpath b/rpm-5.4.9/config.rpath new file mode 100755 index 0000000..17298f2 --- /dev/null +++ b/rpm-5.4.9/config.rpath @@ -0,0 +1,672 @@ +#! /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-2010 Free Software Foundation, Inc. +# Taken from GNU libtool, 2001 +# Originally by Gordon Matzigkeit , 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# should be set by the caller. +# +# The set of defined variables is at the end of this script. + +# Known limitations: +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +shrext=.so + +host="$1" +host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Code taken from libtool.m4's _LT_CC_BASENAME. + +for cc_temp in $CC""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` + +# Code taken from libtool.m4's _LT_COMPILER_PIC. + +wl= +if test "$GCC" = yes; then + wl='-Wl,' +else + case "$host_os" in + aix*) + wl='-Wl,' + ;; + darwin*) + case $cc_basename in + xlc*) + wl='-Wl,' + ;; + esac + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' + ;; + irix5* | irix6* | nonstopux*) + wl='-Wl,' + ;; + newsos6) + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + ecc*) + wl='-Wl,' + ;; + icc* | ifort*) + wl='-Wl,' + ;; + lf95*) + wl='-Wl,' + ;; + pgcc | pgf77 | pgf90) + wl='-Wl,' + ;; + ccc*) + wl='-Wl,' + ;; + como) + wl='-lopt=' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + wl='-Wl,' + ;; + esac + ;; + esac + ;; + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; + rdos*) + ;; + solaris*) + wl='-Wl,' + ;; + sunos4*) + wl='-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3*) + wl='-Wl,' + ;; + sysv4*MP*) + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + wl='-Wl,' + ;; + unicos*) + wl='-Wl,' + ;; + uts4*) + ;; + esac +fi + +# Code taken from libtool.m4's _LT_LINKER_SHLIBS. + +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no + +case "$host_os" in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + case "$host_os" in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + fi + ;; + amigaos*) + 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 cannot use + # them. + ld_shlibs=no + ;; + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32* | cegcc*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + interix[3-9]*) + hardcode_direct=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + gnu* | linux* | k*bsd*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + netbsd*) + ;; + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + else + ld_shlibs=no + fi + ;; + esac + ;; + sunos4*) + hardcode_direct=yes + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + esac + if test "$ld_shlibs" = no; then + hardcode_libdir_flag_spec= + fi +else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + else + aix_use_runtimelinking=no + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + fi + hardcode_direct=yes + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath="/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + fi + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + bsdi[45]*) + ;; + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + libext=lib + ;; + darwin* | rhapsody*) + hardcode_direct=no + if test "$GCC" = yes ; then + : + else + case $cc_basename in + xlc*) + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + freebsd1*) + ld_shlibs=no + ;; + freebsd2.2*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + freebsd2*) + hardcode_direct=yes + hardcode_minus_L=yes + ;; + freebsd* | dragonfly*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + hpux9*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + hpux10*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + hpux11*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + ;; + *) + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + netbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + newsos6) + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + osf3*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) + if test "$GCC" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + solaris*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + ;; + sysv4) + case $host_vendor in + sni) + hardcode_direct=yes # is this really true??? + ;; + siemens) + hardcode_direct=no + ;; + motorola) + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + ;; + sysv4.3*) + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=yes + fi + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + ;; + sysv5* | sco3.2v5* | sco5v6*) + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + *) + ld_shlibs=no + ;; + esac +fi + +# Check dynamic linker characteristics +# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. +# Unlike libtool.m4, here we don't care about _all_ names of the library, but +# only about the one the linker finds when passed -lNAME. This is the last +# element of library_names_spec in libtool.m4, or possibly two of them if the +# linker has special search rules. +library_names_spec= # the last element of library_names_spec in libtool.m4 +libname_spec='lib$name' +case "$host_os" in + aix3*) + library_names_spec='$libname.a' + ;; + aix[4-9]*) + library_names_spec='$libname$shrext' + ;; + amigaos*) + library_names_spec='$libname.a' + ;; + beos*) + library_names_spec='$libname$shrext' + ;; + bsdi[45]*) + library_names_spec='$libname$shrext' + ;; + cygwin* | mingw* | pw32* | cegcc*) + shrext=.dll + library_names_spec='$libname.dll.a $libname.lib' + ;; + darwin* | rhapsody*) + shrext=.dylib + library_names_spec='$libname$shrext' + ;; + dgux*) + library_names_spec='$libname$shrext' + ;; + freebsd1*) + ;; + freebsd* | dragonfly*) + case "$host_os" in + freebsd[123]*) + library_names_spec='$libname$shrext$versuffix' ;; + *) + library_names_spec='$libname$shrext' ;; + esac + ;; + gnu*) + library_names_spec='$libname$shrext' + ;; + hpux9* | hpux10* | hpux11*) + case $host_cpu in + ia64*) + shrext=.so + ;; + hppa*64*) + shrext=.sl + ;; + *) + shrext=.sl + ;; + esac + library_names_spec='$libname$shrext' + ;; + interix[3-9]*) + library_names_spec='$libname$shrext' + ;; + irix5* | irix6* | nonstopux*) + library_names_spec='$libname$shrext' + case "$host_os" in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; + *) libsuff= shlibsuff= ;; + esac + ;; + esac + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; + linux* | k*bsd*-gnu) + library_names_spec='$libname$shrext' + ;; + knetbsd*-gnu) + library_names_spec='$libname$shrext' + ;; + netbsd*) + library_names_spec='$libname$shrext' + ;; + newsos6) + library_names_spec='$libname$shrext' + ;; + nto-qnx*) + library_names_spec='$libname$shrext' + ;; + openbsd*) + library_names_spec='$libname$shrext$versuffix' + ;; + os2*) + libname_spec='$name' + shrext=.dll + library_names_spec='$libname.a' + ;; + osf3* | osf4* | osf5*) + library_names_spec='$libname$shrext' + ;; + rdos*) + ;; + solaris*) + library_names_spec='$libname$shrext' + ;; + sunos4*) + library_names_spec='$libname$shrext$versuffix' + ;; + sysv4 | sysv4.3*) + library_names_spec='$libname$shrext' + ;; + sysv4*MP*) + library_names_spec='$libname$shrext' + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + library_names_spec='$libname$shrext' + ;; + uts4*) + library_names_spec='$libname$shrext' + ;; +esac + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=`echo "$shrext" | sed -e 's,^\.,,'` +escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + +LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. Submit a context +# diff and a properly formatted GNU ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 \ + | ns16k | ns32k \ + | open8 \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i386-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/rpm-5.4.9/configure b/rpm-5.4.9/configure new file mode 100755 index 0000000..d8c0506 --- /dev/null +++ b/rpm-5.4.9/configure @@ -0,0 +1,81309 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.68 for rpm 5.4.9. +# +# Report bugs to . +# +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # 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 + export CONFIG_SHELL + 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+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: rpm-devel@rpm5.org about your system, including +$0: any error possibly output before this message. Then +$0: install a modern shell, or manually run the script +$0: under such a 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_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +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 + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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='rpm' +PACKAGE_TARNAME='rpm' +PACKAGE_VERSION='5.4.9' +PACKAGE_STRING='rpm 5.4.9' +PACKAGE_BUGREPORT='rpm-devel@rpm5.org' +PACKAGE_URL='' + +ac_unique_file="rpmqv.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +gt_needs= +ac_header_list= +enable_option_checking=no +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +testdir +DISTRO_MACROS +RPMLUAFILES +RPMPOPTFILES +MACROFILES +SYSCONFIGDIR +USRLIBRPM +LOCALEDIR +BUILDROOTDIR_MACRO +MAGIC_MACRO +PKGSRCDIR_MACRO +PKGSRCDIR +DBPATH_MACRO +DBPATH +exeext +shlibext +libext +objext +usrprefix +varprefix +WITH_PATH_VERSIONED +WITH_PATH_VERSIONED_SUFFIX +WITH_PATH_VERSIONED_FALSE +WITH_PATH_VERSIONED_TRUE +NCPUS_COMMAND +RPMGID +RPMGROUP +RPMUID +RPMUSER +RPMCANONGNU +RPMCANONOS +RPMCANONVENDOR +RPMCANONARCH +autorelocate_dcolor +autorelocate_path +RPMCANONCOLOR +ROOT_GROUP +WITH_CPUINFO +WITH_KEYUTILS_RPMKEY +WITH_KEYUTILS +WITH_EFENCE +WITH_DMALLOC +WITH_XAR_FALSE +WITH_XAR_TRUE +WITH_XAR_LIBS +WITH_XAR_LDFLAGS +WITH_XAR_CPPFLAGS +WITH_XAR_SUBDIR +WITH_XAR +WITH_ACL +WITH_ATTR +WITH_SYCK_LIBS +WITH_SYCK_LDFLAGS +WITH_SYCK_CPPFLAGS +WITH_SYCK_SUBDIR +WITH_SYCK +WITH_UUID +WITH_PCRE_LIBS +WITH_PCRE_LDFLAGS +WITH_PCRE_CPPFLAGS +WITH_PCRE_SUBDIR +WITH_PCRE +USE_LUA_SOCKET_FALSE +USE_LUA_SOCKET_TRUE +USE_LUA_CRYPTO_FALSE +USE_LUA_CRYPTO_TRUE +USE_LUA_CHKCONFIG_FALSE +USE_LUA_CHKCONFIG_TRUE +USE_LUA_SHADOW_FALSE +USE_LUA_SHADOW_TRUE +WITH_LUA_SUBDIR_LIB +WITH_LUA_SUBDIR_DEF +WITH_LUA_LIBS +WITH_LUA_LDFLAGS +WITH_LUA_CPPFLAGS +WITH_LUA_SUBDIR +WITH_LUA +WITH_BASH_LIBS +WITH_BASH_LDFLAGS +WITH_BASH_CPPFLAGS +WITH_BASH_SUBDIR +WITH_BASH +WITH_RC_LIBS +WITH_RC_LDFLAGS +WITH_RC_CPPFLAGS +WITH_RC_SUBDIR +WITH_RC +GPSEE_MODULES_PATH +WITH_GPSEE_LIBS +WITH_GPSEE_LDFLAGS +WITH_GPSEE_CPPFLAGS +WITH_GPSEE_SUBDIR +WITH_GPSEE +WITH_JS_SUBDIR +WITH_SPIDERMONKEY_SUBDIR +WITH_MOZJS185_LIBS +WITH_MOZJS185_LDFLAGS +WITH_MOZJS185_CPPFLAGS +WITH_MOZJS185_SUBDIR +WITH_MOZJS185 +WITH_NIX +WITH_ATERM +WITH_FICL_LIBS +WITH_FICL_LDFLAGS +WITH_FICL_CPPFLAGS +WITH_FICL_SUBDIR +WITH_FICL +WITH_TCL_SUBDIR +WITH_TCL +WITH_SQUIRREL +WITH_RUBY_VENDORARCHDIR +WITH_RUBY_SUBDIR +WITH_RUBY_CPPFLAGS +WITH_RUBY +WITH_PYTHONEMBED +WITH_PERLEMBED +WITH_CUDF_CUDFTOOL +WITH_CUDF +WITH_AUGEAS_AUGTOOL +WITH_AUGEAS +WITH_READLINE +DBAPI +WITH_DBSQL_CODEGEN_FALSE +WITH_DBSQL_CODEGEN_TRUE +WITH_DB_TOOLS_INTEGRATED_FALSE +WITH_DB_TOOLS_INTEGRATED_TRUE +WITH_DB_RPC_FALSE +WITH_DB_RPC_TRUE +DBLIBOBJS +DBLIBSRCS +WITH_DBSQL_FALSE +WITH_DBSQL_TRUE +WITH_DBSQL_LIBS +WITH_DBSQL_LDFLAGS +WITH_DBSQL_CPPFLAGS +WITH_DBSQL_SUBDIR +WITH_DBSQL +WITH_SQLITE_LIBS +WITH_SQLITE_LDFLAGS +WITH_SQLITE_CPPFLAGS +WITH_SQLITE_SUBDIR +WITH_SQLITE +WITH_DB_INTERNAL_FALSE +WITH_DB_INTERNAL_TRUE +WITH_DB_FALSE +WITH_DB_TRUE +WITH_DB_LIBS +WITH_DB_LDFLAGS +WITH_DB_CPPFLAGS +WITH_DB_SUBDIR +WITH_DB +WITH_UNIXODBC_FALSE +WITH_UNIXODBC_TRUE +WITH_UNIXODBC +WITH_FILE_INTERNAL_FALSE +WITH_FILE_INTERNAL_TRUE +WITH_FILE_LIBS +WITH_FILE_LDFLAGS +WITH_FILE_CPPFLAGS +WITH_FILE_SUBDIR +WITH_FILE +WITH_SUBVERSION +WITH_APR +WITH_LIBGIT2_FALSE +WITH_LIBGIT2_TRUE +WITH_LIBGIT2_LIBS +WITH_LIBGIT2_LDFLAGS +WITH_LIBGIT2_CPPFLAGS +WITH_LIBGIT2_SUBDIR +WITH_LIBGIT2 +WITH_NEON_LIBS +WITH_NEON_LDFLAGS +WITH_NEON_CPPFLAGS +WITH_NEON_SUBDIR +WITH_NEON +WITH_GNUTLS +WITH_PAKCHOIS +WITH_LIBTASN1 +WITH_EXPAT +WITH_SEMANAGE_SEMODULE +WITH_SEMANAGE +WITH_SEPOL +WITH_SELINUX +WITH_TPM_FALSE +WITH_TPM_TRUE +WITH_TPM +WITH_TOMCRYPT +WITH_OPENSSL +WITH_NSS +WITH_GCRYPT +WITH_BEECRYPT_LIBS +WITH_BEECRYPT_LDFLAGS +WITH_BEECRYPT_CPPFLAGS +WITH_BEECRYPT_SUBDIR +WITH_BEECRYPT +WITH_XZ_LIBS +WITH_XZ_LDFLAGS +WITH_XZ_CPPFLAGS +WITH_XZ_SUBDIR +WITH_XZ +WITH_BZIP2 +WITH_ZLIB_LIBS +WITH_ZLIB_LDFLAGS +WITH_ZLIB_CPPFLAGS +WITH_ZLIB_SUBDIR +WITH_ZLIB +WITH_POPT_LIBS +WITH_POPT_LDFLAGS +WITH_POPT_CPPFLAGS +WITH_POPT_SUBDIR +WITH_POPT +subdirs +pkgpyexecdir +pyexecdir +pkgpythondir +pythondir +PYTHON_EXEC_PREFIX +PYTHON_PREFIX +PYTHON_VERSION +PYTHON +WITH_PYTHON_INCDIR +WITH_PYTHON_SUBPACKAGE +WITH_PYTHON_SUBDIR +WITH_PERL_URPM_LIBS +WITH_PERL_URPM_SUBPACKAGE +WITH_PERL_URPM_SUBDIR +PERL_URPM_INSTALLDIRS +WITH_PERL_LIBS +WITH_PERL_SUBPACKAGE +WITH_PERL_SUBDIR +PERL_INSTALLDIRS +WITH_LIBELF_DEBUGEDIT +ALLOCA +LIBOBJS +USE_NLS_FALSE +USE_NLS_TRUE +POSUB +LTLIBINTL +LIBINTL +INTLLIBS +LTLIBICONV +LIBICONV +INTL_MACOSX_LIBS +XGETTEXT_EXTRA_OPTIONS +MSGMERGE +XGETTEXT_015 +XGETTEXT +GMSGFMT_015 +MSGFMT_015 +GMSGFMT +MSGFMT +GETTEXT_MACRO_VERSION +USE_NLS +WITH_APIDOCS +WITH_APIDOCS_TARGET +__DOXYGEN +__ID_U +LIBTOOLIZE +__STRIP +__OBJDUMP +__OBJCOPY +__NM +__LD +__XZ +__UNZIP +__TCLSH +__TAR +__SVN +__SSH +__SQLITE3 +__SH +__SED +__RUBY +__RSH +__RMDIR +__RM +__PYTHON +__PHP +__PGP +__PERL +__PAX +__PATCH +__MV +__MODINFO +__MONGO +__MKDIR +__MAKE +__LZOP +__LZMA +__LSATTR +__LN +__LDCONFIG +__INSTALL_INFO +__LRZIP +__LZIP +__INSTALL +__ID +__HG +__GZIP +__GST_INSPECT +__GSR +__GPG +__GIT +__FILE +__DITTO +__DIFF +__DB_VERIFY +__DB_UPGRADE +__DB_TUNER +__DB_STAT +__DB_SQL_CODEGEN +__DBSQL +__DB_REPLICATE +__DB_RECOVER +__DB_PRINTLOG +__DB_LOG_VERIFY +__DB_LOAD +__DB_HOTBACKUP +__DB_DUMP +__DB_DEADLOCK +__DB_CHECKPOINT +__DB_ARCHIVE +__CVS +__CURL +__CPIO +__CMAKE +__CHOWN +__CHMOD +__CHGRP +__CHATTR +__CAT +__BZIP2 +__BASH +PERL +__CHGRP_RHF +__CHOWN_RHF +__MKDIR_P +MKDIR +FIXPERMS +ENABLE_BUILD_LAFILES_FALSE +ENABLE_BUILD_LAFILES_TRUE +ENABLE_BUILD_MAXEXTLIBDEP_FALSE +ENABLE_BUILD_MAXEXTLIBDEP_TRUE +ENABLE_BUILD_EXTLIBDEP_FALSE +ENABLE_BUILD_EXTLIBDEP_TRUE +ENABLE_BUILD_INTLIBDEP_FALSE +ENABLE_BUILD_INTLIBDEP_TRUE +HAVE_LD_VERSION_SCRIPT_FALSE +HAVE_LD_VERSION_SCRIPT_TRUE +LD_VERSION_SCRIPT_FLAG +LDFLAGS_STATIC +OPENMP_CXXFLAGS +OPENMP_CFLAGS +AS +YFLAGS +YACC +CXXCPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +DLLTOOL +OBJDUMP +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +SED +LIBTOOL +LN_S +EGREP +GREP +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +RPM_VENDOR +RPM_TIMESTAMP +RPM_VERSION +LT_AGE +LT_REVISION +LT_CURRENT +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +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_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_maintainer_mode +with_name +with_bugreport +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_build_pic +enable_build_pie +enable_build_warnings +enable_build_debug +enable_build_gcov +with_valgrind +enable_openmp +enable_build_static +enable_build_versionscript +enable_build_intlibdep +enable_build_extlibdep +enable_build_maxextlibdep +enable_build_lafiles +enable_dirname_and_symlink_deps +enable_rpm_lua_extensions_based_on_rpmlib +enable_rpmvercmp_digits_beat_alpha +enable_broken_chown +with_apidocs +enable_nls +enable_rpath +with_libiconv_prefix +with_libintl_prefix +enable_largefile +with_pthreads +with_libelf +with_perl +with_perl_urpm +with_python +with_python_inc_dir +with_python_lib_dir +with_popt +with_zlib +with_bzip2 +with_xz +with_beecrypt +with_gcrypt +with_nss +with_openssl +with_tomcrypt +with_tpm +with_usecrypto +with_selinux +with_sepol +with_semanage +with_expat +with_libtasn1 +with_pakchois +with_gnutls +with_neon +with_libgit2 +with_apr +with_subversion +with_file +with_unixodbc +with_db +with_sqlite +with_dbsql +with_db_largefile +with_db_mutex +with_db_rpc +with_db_tools_integrated +with_readline +with_augeas +with_cudf +with_perlembed +with_pythonembed +with_ruby +with_squirrel +with_tcl +with_ficl +with_aterm +with_nix +with_mozjs185 +with_gpsee +with_rc +with_bash +with_lua +with_pcre +with_uuid +with_syck +with_attr +with_acl +with_xar +with_dmalloc +with_efence +with_keyutils +with_cpuinfo +with_path_versioned +with_path_database +with_path_sources +with_path_magic +with_path_buildroot +with_path_locale +with_path_lib +with_path_cfg +with_extra_path_macros +with_path_macros +with_path_rpmpopt +with_path_rpmlua +with_vendor +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +CXX +CXXFLAGS +CCC +CXXCPP +YACC +YFLAGS' +ac_subdirs_all='popt +zlib +xz +beecrypt +neon +libgit2 +file +db3 +sqlite +db3/sql +ficl +mozjs185 +gpsee +rc +bash +lua +pcre +syck +xar +' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures rpm 5.4.9 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/rpm] + --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] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of rpm 5.4.9:";; + 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-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-build-pic build RPM with Position Independent Code (PIC) (GCC + only) + --enable-build-pie build RPM as Position Independent Executable (PIE) + (GCC only) + --enable-build-warnings build RPM with extra compiler warnings turned on + (GCC only) + --enable-build-debug build RPM instrumented for debugging + --enable-build-gcov build RPM instrumented for gcov + --disable-openmp do not use OpenMP + --enable-build-static build RPM as a static executable + --enable-build-versionscript + enable/disable use of linker version script. + (default is system dependent) + --disable-build-intlibdep + disable use of implicit internal library + dependencies + --disable-build-extlibdep + disable use of implicit external library + dependencies + --disable-build-maxextlibdep + disable use of implicit maximum external library + dependencies + --disable-build-lafiles disable the removal of GNU libtool *.la files on + installation + --disable-dirname-and-symlink-deps + permit to disable via macro the automatic dirname + and symlink dependecy + --enable-rpm-lua-extensions-based-on-rpmlib + Adds RPM Lua extensions based on rpmlib + functionality (default:no) + --enable-rpmvercmp-digits-beat-alpha + Permit in RPM version comparison that digits beat + alpha (default:no) + --enable-broken-chown this system's chown follows symbolic links + --disable-nls do not use Native Language Support + --disable-rpath do not hardcode runtime library paths + --disable-largefile omit support for large files + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-name=NAME set official name of program (default: "RPM") + --with-bugreport=ADDRESS + set packager bugreport Email/Web address + (rpm-devel@rpm5.org) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --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-valgrind build RPM insturmented for valgrind tools + --with-apidocs build RPM API documentation + --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-pthreads build RPM without POSIX pthreads + --with-libelf use libelf/gelf API + --with-perl build with RPM Perl language bindings + --with-perl-urpm build with Perl URPM language bindings + --with-python build with RPM Python language bindings + --with-python-inc-dir=DIR + directory with Python include files + --with-python-lib-dir=DIR + directory with Python library + --with-popt=ARG build with POPT library (yes) + (location path: "internal:external") + --with-zlib=ARG build with ZLib library (yes) + (location path: "external:none") + --with-bzip2=ARG build with GNU BZip2 library (yes) + (location path: "external:none") + --with-xz=ARG build with XZ libLZMA library (yes) + (location path: "external:internal:none") + --with-beecrypt=ARG build with BeeCrypt library (yes) + (location path: "internal:external") + --with-gcrypt=ARG build with GCrypt library (no) + (location path: "external:none") + --with-nss=ARG build with Mozilla NSS library + (no) (location path: + "external:none") + --with-openssl=ARG build with OpenSSL library (no) + (location path: "external:none") + --with-tomcrypt=ARG build with TomCrypt library (no) + (location path: "external:none") + --with-tpm=ARG build with IBM TPM library (no) + (location path: "external:none") + --with-usecrypto=ID use particular default for --usecrypto option + ("beecrypt", "cdsa", "gcrypt", "nss", "openssl", + "tomcrypt" ) + --with-selinux=ARG build with Libselinux library (no) + (location path: "external:none") + --with-sepol=ARG build with Libsepol library (no) + (location path: "external:none") + --with-semanage=ARG build with Libsemanage library + (no) (location path: + "external:none") + --with-expat=ARG build with Expat library (no) + (location path: "external:none") + --with-libtasn1=ARG build with Libtasn1 library (no) + (location path: "external:none") + --with-pakchois=ARG build with Pakchois library (no) + (location path: "external:none") + --with-gnutls=ARG build with GnuTLS library (no) + (location path: "external:none") + --with-neon=ARG build with Neon library (no) + (location path: "internal:external:none") + --with-libgit2=ARG build with Libgit2 library (no) + (location path: "internal:external:none") + --with-apr=ARG build with Apr library (no) + (location path: "external:none") + --with-subversion=ARG build with Subversion library (no) + (location path: "external:none") + --with-file=ARG build with File (magic) library + (yes) (location path: + "internal:external:none") + --with-unixodbc=ARG build with UnixODBC library (no) + (location path: "external:none") + --with-db=ARG build with Berkeley-DB library + (yes) (location path: + "external") + --with-sqlite=ARG build with SQLite library (no) + (location path: "external:none") + --with-dbsql=ARG build with Berkeley-DB (+SQLite3) library + (yes) (location path: + "external") + --with-db-largefile build Berkeley-DB with LARGEFILE support + --with-db-mutex=ARG build Berkeley-DB with MUTEX type ARG + --with-db-rpc build Berkeley-DB with RPC support + --with-db-tools-integrated + install integrated Berkeley-DB tools + --with-readline=ARG build with Readline library (no) + (location path: "external:none") + --with-augeas=ARG build with Augeas library (no) + (location path: "external:none") + --with-cudf=ARG build with Libcudf library (no) + (location path: "external:none") + --with-perlembed=ARG build with Perl ExtUtils::Embed library + (no) (location path: + "external:none") + --with-pythonembed=ARG build with Python embedding library + (no) (location path: + "external:none") + --with-ruby=ARG build with Ruby library (no) + (location path: "external:none") + --with-squirrel=ARG build with Squirrel library (no) + (location path: "external:none") + --with-tcl=ARG build with Tcl library (no) + (location path: "external:none") + --with-ficl=ARG build with FICL library (no) + (location path: "internal:external:none") + --with-aterm=ARG build with ATerm library (no) + (location path: "external:none") + --with-nix=ARG build with Nix expressions library + (no) (location path: + "external:none") + --with-mozjs185=ARG build with JavaScript library (no) + (location path: "external:none") + --with-gpsee=ARG build with GPSEE library (no) + (location path: "external:internal:none") + --with-rc=ARG build with Rc library (no) + (location path: "internal:none") + --with-bash=ARG build with Bash library (no) + (location path: "internal:none") + --with-lua=ARG build with Lua library (no) + (location path: "internal:external:none") + --with-pcre=ARG build with PCRE library (yes) + (location path: "external:internal:none") + --with-uuid=ARG build with OSSP uuid library (no) + (location path: "external:none") + --with-syck=ARG build with Syck library (no) + (location path: "internal:external:none") + --with-attr=ARG build with ATTR library (no) + (location path: "external:none") + --with-acl=ARG build with ACL library (no) + (location path: "external:none") + --with-xar=ARG build with XAR library (no) + (location path: "external:internal:none") + --with-dmalloc=ARG build with DMalloc library (no) + (location path: "external:none") + --with-efence=ARG build with Electric Fence library + (no) (location path: + "external:none") + --with-keyutils=ARG build with Linux keyutils library + (no) (location path: + "external:none") + --with-cpuinfo=ARG build with CPUInfo library (no) + (location path: "external:none") + --with-path-versioned install with versioned paths + --with-path-database=ARG + build with RPM database directory path + --with-path-sources=ARG build with RPM package sourcs directory path + --with-path-magic=ARG build with RPM magic file path (or macro) + --with-path-buildroot=ARG + build with RPM buildroot path (or macro) + --with-path-locale=ARG build with RPM locale directory path + --with-path-lib=ARG build with RPM system library directory path + --with-path-cfg=ARG build with RPM global configuration directory path + --with-extra-path-macros=ARG + build with additional colon-separated RPM macro + files path not overriding defaults + --with-path-macros=ARG build with colon-separated RPM macro files path + --with-path-rpmpopt=ARG build with colon-separated RPM POPT configuration + file path + --with-path-rpmlua=ARG build with colon-separated RPM Lua script file path + --with-vendor=VENDOR build with a supported vendor's specific set of + changes: mandriva, ark, fedora, openmamba + +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 + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP C++ preprocessor + YACC The `Yet Another Compiler Compiler' implementation to use. + Defaults to the first program found out of: `bison -y', `byacc', + `yacc'. + YFLAGS The list of arguments that will be passed by default to $YACC. + This script will default YFLAGS to the empty string to avoid a + default value of `-d' given by some make applications. + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +rpm configure 5.4.9 +generated by GNU Autoconf 2.68 + +Copyright (C) 2010 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## --------------------------------- ## +## Report this to rpm-devel@rpm5.org ## +## --------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + +# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +# ---------------------------------------------------- +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_c_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if eval \${$4+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_member + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 &5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## --------------------------------- ## +## Report this to rpm-devel@rpm5.org ## +## --------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_header_mongrel +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 rpm $as_me 5.4.9, which was +generated by GNU Autoconf 2.68. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +gt_needs="$gt_needs " +as_fn_append ac_header_list " stdlib.h" +as_fn_append ac_header_list " unistd.h" +as_fn_append ac_header_list " sys/param.h" +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +PACKAGE_TIMESTAMP="2012-04-02" + $as_echo "Configuring RPM Package Manager (RPM), Version $PACKAGE_VERSION" >&6 + + + + $as_echo "" >&6 + $as_echo "=== INITIALIZATION ===" >&6 + + +ac_config_headers="$ac_config_headers config.h" + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if ${ac_cv_target+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- +am__api_version='1.11' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + 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 ( + 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 + rm -f conftest.file + 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 + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +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='rpm' + VERSION='5.4.9' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. 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}' + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 +$as_echo_n "checking how to create a ustar tar archive... " >&6; } +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar plaintar pax cpio none' +_am_tools=${am_cv_prog_tar_ustar-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + { echo "$as_me:$LINENO: $_am_tar --version" >&5 + ($_am_tar --version) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && break + done + am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x ustar -w "$$tardir"' + am__tar_='pax -L -x ustar -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H ustar -L' + am__tar_='find "$tardir" -print | cpio -o -H ustar -L' + am__untar='cpio -i -H ustar -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_ustar}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 + (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + rm -rf conftest.dir + if test -s conftest.tar; then + { echo "$as_me:$LINENO: $am__untar &5 + ($am__untar &5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +if ${am_cv_prog_tar_ustar+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_prog_tar_ustar=$_am_tool +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 +$as_echo "$am_cv_prog_tar_ustar" >&6; } + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + +RPM_NAME="RPM" + +# Check whether --with-name was given. +if test "${with_name+set}" = set; then : + withval=$with_name; RPM_NAME="$withval" + +fi + + +cat >>confdefs.h <<_ACEOF +#define RPM_NAME "$RPM_NAME" +_ACEOF + + + +# Check whether --with-bugreport was given. +if test "${with_bugreport+set}" = set; then : + withval=$with_bugreport; case "$withval" in + *@*|http*://* ) PACKAGE_BUGREPORT="$withval" ;; + * ) as_fn_error $? "invalid bugreport Email/Web address" "$LINENO" 5 ;; + esac + +fi + + +LT_CURRENT=5 + +LT_REVISION=4 + +LT_AGE=0 + + +RPM_VERSION="0,0,_,0,0,_" +case "$PACKAGE_VERSION" in + *.*.DEVEL ) + RPM_VERSION=`echo "$PACKAGE_VERSION" |\ + sed -e 's;^\([^.]*\)\.\([^.]*\).*;\1,\2,_,0,0,_;'` + ;; + *.*.SNAPSHOT.* ) + RPM_VERSION=`echo "$PACKAGE_VERSION" |\ + sed -e 's;^\([^.]*\)\.\([^.]*\).*;\1,\2,_,0,0,s;'` + ;; + *.*a* ) + RPM_VERSION=`echo "$PACKAGE_VERSION" |\ + sed -e 's;^;X;' \ + -e 's;^X\([^.]*\)\.\([^.]*\)a\([^.]*\)\.\([^.]*\)$;\1,\2,a,\3,\4,_;' \ + -e 's;^X\([^.]*\)\.\([^.]*\)a\([^.]*\)$;\1,\2,a,\3,0,_;'` + ;; + *.*b* ) + RPM_VERSION=`echo "$PACKAGE_VERSION" |\ + sed -e 's;^;X;' \ + -e 's;^X\([^.]*\)\.\([^.]*\)b\([^.]*\)\.\([^.]*\)$;\1,\2,b,\3,\4,_;' \ + -e 's;^X\([^.]*\)\.\([^.]*\)b\([^.]*\)$;\1,\2,b,\3,0,_;'` + ;; + *.*rc* ) + RPM_VERSION=`echo "$PACKAGE_VERSION" |\ + sed -e 's;^;X;' \ + -e 's;^X\([^.]*\)\.\([^.]*\)rc\([^.]*\)\.\([^.]*\)$;\1,\2,c,\3,\4,_;' \ + -e 's;^X\([^.]*\)\.\([^.]*\)rc\([^.]*\)$;\1,\2,c,\3,0,_;'` + ;; + *.*.* ) + RPM_VERSION=`echo "$PACKAGE_VERSION" |\ + sed -e 's;^;X;' \ + -e 's;^X\([^.]*\)\.\([^.]*\)\.\([^.]*\)\.\([^.]*\)$;\1,\2,c,\3,\4,_;' \ + -e 's;^X\([^.]*\)\.\([^.]*\)\.\([^.]*\)$;\1,\2,r,\3,0,_;'` + ;; +esac +RPM_TIMESTAMP=`echo "$PACKAGE_TIMESTAMP" |\ + sed -e 's;^;X;' \ + -e 's;^X\([0-9]*\)-\([0-9]*\)-\([0-9]*\) \([0-9]*\):\([0-9]*\)$;\1,\2,\3,\4,\5;' \ + -e 's;^X\([0-9]*\)-\([0-9]*\)-\([0-9]*\) \([0-9]*\)$;\1,\2,\3,\4,0;' \ + -e 's;^X\([0-9]*\)-\([0-9]*\)-\([0-9]*\)$;\1,\2,\3,0,0;' \ + -e 's;^X\([0-9]*\)-\([0-9]*\)$;\1,\2,0,0,0;' \ + -e 's;^X\([0-9]*\)$;\1,0,0,0,0;' \ + -e 's;^X.*$;0,0,0,0,0;' \ + -e 's;,0\([0-9]\);,\1;g'` +RPM_VENDOR="'R','P','M','5'" + + + + + + + $as_echo "" >&6 + $as_echo "=== TOOL-CHAIN CHECKS ===" >&6 + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + case $ac_cv_prog_cc_stdc in #( + no) : + ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 +$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } +if ${ac_cv_prog_cc_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +#include + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +#define debug(...) fprintf (stderr, __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 + your preprocessor is broken; +#endif +#if BIG_OK +#else + 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 void +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; + float fnumber; + + 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); +} + +int +main () +{ + + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + 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[ni.number - 1] = 543; + + // work around unused variable warnings + return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' + || dynamic_array[ni.number - 1] != 543); + + ; + return 0; +} +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99 +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 + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c99" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c99" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c99" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 +else + ac_cv_prog_cc_stdc=no +fi + +fi + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 +$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } + if ${ac_cv_prog_cc_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +fi + + case $ac_cv_prog_cc_stdc in #( + no) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; #( + '') : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 +$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; +esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +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="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_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 8's {/usr,}/bin/sh. + touch 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_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes; then : + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h + + +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +$as_echo "#define _MINIX 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if ${ac_cv_safe_to_define___extensions__+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C99-conforming __func__" >&5 +$as_echo_n "checking for an ANSI C99-conforming __func__... " >&6; } +if ${ac_cv_cpp_func+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +char *foo = __func__; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_cpp_func=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +char *foo = __FUNCTION__; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_cpp_func=__FUNCTION__ +else + ac_cv_cpp_func=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cpp_func" >&5 +$as_echo "$ac_cv_cpp_func" >&6; } +if test $ac_cv_cpp_func = __FUNCTION__; then + +$as_echo "#define __func__ __FUNCTION__" >>confdefs.h + +elif test $ac_cv_cpp_func = no; then + +$as_echo "#define __func__ \"\"" >>confdefs.h + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.2' +macro_revision='1.3337' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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"; 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 $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con'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* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + + +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf + + + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + pic_mode=default +fi + + +test -z "$pic_mode" && pic_mode=default + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + 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 "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + 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 which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + 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 "$with_gnu_ld" = yes; 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 "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.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 (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $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' ;; + 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 "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | 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 "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $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 "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + 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) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + link_all_deplibs=no + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + if test "$with_gnu_ld" = yes; 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 + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; 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*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; 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 $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; 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 "$with_gnu_ld" = no; 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 "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; 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 "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && 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 "$GCC" = yes; 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 "$GCC" = yes; 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 "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; 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` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # 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 "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.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}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux # 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=no + hardcode_into_libs=yes + ;; + +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=yes + 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 "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # 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 "$lt_cv_prog_gnu_ld" = yes; 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 + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # 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 "$with_gnu_ld" = yes; 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=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $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 -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $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 -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" 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 + +else + _lt_caught_CXX_error=yes +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +compiler_needs_object_CXX=no +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_direct_absolute_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +inherit_rpath_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + + + + + + +# 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 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* + + + # 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 + compiler_CXX=$CC + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' + else + lt_prog_compiler_no_builtin_flag_CXX= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$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' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${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 + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + 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. + archive_cmds_CXX='$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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + ld_shlibs_CXX=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + file_list_spec_CXX='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_CXX=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_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + link_all_deplibs_CXX=no + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec_CXX='${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_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`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__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$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 "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`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__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='${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_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # 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_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $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, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='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, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + + + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec_CXX='`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_CXX='' + fi + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds_CXX="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_CXX="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}" + if test "$lt_cv_apple_cc_single_mod" != "yes"; then + archive_cmds_CXX="\$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}" + archive_expsym_cmds_CXX="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 + ld_shlibs_CXX=no + fi + + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; + + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + + gnu*) + ;; + + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; + + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=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 + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$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 $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_minus_L_CXX=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 + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$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 "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$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 + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + interix[3-9]*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${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_CXX='$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_CXX='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++ + archive_cmds_CXX='$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. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$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 + archive_cmds_CXX='$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 + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + inherit_rpath_CXX=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='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' + archive_expsym_cmds_CXX='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"' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$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."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$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 + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + prelink_cmds_CXX='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`"' + old_archive_cmds_CXX='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' + archive_cmds_CXX='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' + archive_expsym_cmds_CXX='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 + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$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 + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${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++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$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 + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # 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 + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds_CXX='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 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='${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_CXX=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. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=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*) + ld_shlibs_CXX=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + hardcode_direct_absolute_CXX=yes + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + ld_shlibs_CXX=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. + archive_cmds_CXX='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' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + case $host in + osf3*) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$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' + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + ;; + *) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$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' + archive_expsym_cmds_CXX='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' + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + ;; + esac + + hardcode_libdir_separator_CXX=: + + # 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 "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + archive_cmds_CXX='$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' + ;; + *) + archive_cmds_CXX='$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 + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # 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 + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='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' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=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?) + whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + ;; + esac + link_all_deplibs_CXX=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. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$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. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='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 -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. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$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 + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } + test "$ld_shlibs_CXX" = no && can_build_shared=no + + GCC_CXX="$GXX" + LD_CXX="$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... + # Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_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 + +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # 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 $p = "-L" || + test $p = "-R"; 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 "$pre_test_object_deps_done" = no; 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 "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${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 "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${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 "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +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. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + compiler_lib_search_dirs_CXX= +if test -n "${compiler_lib_search_path_CXX}"; then + compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic_CXX='-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_CXX='-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 + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; + 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_prog_compiler_pic_CXX=-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_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix[4-9]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--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). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+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_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-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_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-qpic' + lt_prog_compiler_static_CXX='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$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_CXX=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works_CXX=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_CXX=yes + fi + else + lt_cv_prog_compiler_static_works_CXX=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } + +if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=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_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=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_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_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 AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + export_symbols_cmds_CXX='$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_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; + linux* | k*bsd*-gnu) + link_all_deplibs_CXX=no + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +with_gnu_ld_CXX=$with_gnu_ld + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +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 "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.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}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # 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}' + + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux # 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=no + hardcode_into_libs=yes + ;; + +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=yes + 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 "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # 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 "$lt_cv_prog_gnu_ld" = yes; 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 + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # 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 "$with_gnu_ld" = yes; 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=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || + test -n "$runpath_var_CXX" || + test "X$hardcode_automatic_CXX" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +$as_echo "$hardcode_action_CXX" >&6; } + +if test "$hardcode_action_CXX" = relink || + test "$inherit_rpath_CXX" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + + 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 "$_lt_caught_CXX_error" != yes + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + +for ac_prog in 'bison -y' byacc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_YACC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_YACC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +YACC=$ac_cv_prog_YACC +if test -n "$YACC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 +$as_echo "$YACC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$YACC" && break +done +test -n "$YACC" || YACC="yacc" + + +# Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $AS in + [\\/]* | ?:[\\/]*) + ac_cv_path_AS="$AS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_AS="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_AS" && ac_cv_path_AS="as" + ;; +esac +fi +AS=$ac_cv_path_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +if test $ac_cv_c_compiler_gnu = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 +$as_echo_n "checking whether $CC needs -traditional... " >&6; } +if ${ac_cv_prog_gcc_traditional+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_pattern="Autoconf.*'x'" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +rm -f conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 +$as_echo "$ac_cv_prog_gcc_traditional" >&6; } + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + +# Check whether --enable-build-pic was given. +if test "${enable_build_pic+set}" = set; then : + enableval=$enable_build_pic; if test ".$enableval" = .yes; then + if test ".`$CC --version 2>&1 | grep 'GCC'`" != .; then + CFLAGS="$CFLAGS -fPIC -DPIC" + elif test ".`$CC -V 2>&1 | grep 'Sun C'`" != .; then + CFLAGS="$CFLAGS -KPIC -DPIC" + elif test ".`$CC -help 2>&1 | grep 'Intel Corporation'`" != .; then + CFLAGS="$CFLAGS -fPIC -DPIC" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-build-pic requires GCC, Sun Studio or Intel C/C++" >&5 +$as_echo "$as_me: WARNING: --enable-build-pic requires GCC, Sun Studio or Intel C/C++" >&2;} + fi + fi + +fi + +# Check whether --enable-build-pie was given. +if test "${enable_build_pie+set}" = set; then : + enableval=$enable_build_pie; if test ".$enableval" = .yes; then + if test ".$GCC" = .yes; then + CFLAGS="$CFLAGS -fpie" + LDFLAGS="$LDFLAGS -pie" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-build-pie requires GCC" >&5 +$as_echo "$as_me: WARNING: --enable-build-pie requires GCC" >&2;} + fi + fi + +fi + +# Check whether --enable-build-warnings was given. +if test "${enable_build_warnings+set}" = set; then : + enableval=$enable_build_warnings; if test ".$enableval" = .yes; then + if test ".`$CC --version 2>&1 | grep 'GCC'`" != .; then + CFLAGS="$CFLAGS -Wall -W -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -Wno-unused-parameter -Wformat-security" +# XXX gcc-4.2 on Mac OS X hasn't +# CFLAGS="$CFLAGS -Wno-unused-but-set-variable" +# XXX rpmio/set.c needs this +# CFLAGS="$CFLAGS -Wno-override-init" + elif test ".`$CC -V 2>&1 | grep 'Sun C'`" != .; then + CFLAGS="$CFLAGS -v" + elif test ".`$CC -help 2>&1 | grep 'Intel Corporation'`" != .; then + CFLAGS="$CFLAGS -Wall -Wcheck -w1 -wr188 -wr981 -wr593 -wr869 -wr810" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-build-warnings requires GCC, Sun Studio or Intel C/C++" >&5 +$as_echo "$as_me: WARNING: --enable-build-warnings requires GCC, Sun Studio or Intel C/C++" >&2;} + fi + fi + +fi + +# Check whether --enable-build-debug was given. +if test "${enable_build_debug+set}" = set; then : + enableval=$enable_build_debug; if test ".$enableval" = .yes; then + if test ".`$CC --version 2>&1 | grep 'GCC'`" != .; then + CFLAGS="$CFLAGS -g3" + elif test ".`$CC -V 2>&1 | grep 'Sun C'`" != .; then + CFLAGS="$CFLAGS -xO0 -g" + elif test ".`$CC -help 2>&1 | grep 'Intel Corporation'`" != .; then + CFLAGS="$CFLAGS -O0 -g" + else + CFLAGS="$CFLAGS -g" + fi + fi + +fi + +if test ".`$CC --version 2>&1 | grep 'GCC'`" != .; then + for c in -fno-delete-null-pointer-checks -D_FORTIFY_SOURCE=2 -fstack-protector -fexceptions -fnested-functions -Wno-missing-field-initializers + do + my_save_cflags="$CFLAGS" + CFLAGS=$c + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GCC supports $c" >&5 +$as_echo_n "checking whether GCC supports $c... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + my_cflags=$c +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$my_save_cflags $my_cflags" + done +fi +# Check whether --enable-build-gcov was given. +if test "${enable_build_gcov+set}" = set; then : + enableval=$enable_build_gcov; if test ".$enableval" = .yes; then + if test ".`$CC --version 2>&1 | grep 'GCC'`" != .; then + CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" + fi + fi + +fi + + + +# Check whether --with-valgrind was given. +if test "${with_valgrind+set}" = set; then : + withval=$with_valgrind; + if test ".$withval" = .yes; then + for ac_header in valgrind/valgrind.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "valgrind/valgrind.h" "ac_cv_header_valgrind_valgrind_h" "$ac_includes_default" +if test "x$ac_cv_header_valgrind_valgrind_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VALGRIND_VALGRIND_H 1 +_ACEOF + +fi + +done + + +$as_echo "#define WITH_VALGRIND 1" >>confdefs.h + + 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 + + + OPENMP_CFLAGS= + # Check whether --enable-openmp was given. +if test "${enable_openmp+set}" = set; then : + enableval=$enable_openmp; +fi + + if test "$enable_openmp" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to support OpenMP" >&5 +$as_echo_n "checking for $CC option to support OpenMP... " >&6; } +if ${ac_cv_prog_c_openmp+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifndef _OPENMP + choke me +#endif +#include +int main () { return omp_get_num_threads (); } + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_prog_c_openmp='none needed' +else + ac_cv_prog_c_openmp='unsupported' + for ac_option in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp; do + ac_save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $ac_option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifndef _OPENMP + choke me +#endif +#include +int main () { return omp_get_num_threads (); } + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_prog_c_openmp=$ac_option +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$ac_save_CFLAGS + if test "$ac_cv_prog_c_openmp" != unsupported; then + break + fi + done +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_c_openmp" >&5 +$as_echo "$ac_cv_prog_c_openmp" >&6; } + case $ac_cv_prog_c_openmp in #( + "none needed" | unsupported) + ;; #( + *) + OPENMP_CFLAGS=$ac_cv_prog_c_openmp ;; + esac + 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=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + OPENMP_CXXFLAGS= + # Check whether --enable-openmp was given. +if test "${enable_openmp+set}" = set; then : + enableval=$enable_openmp; +fi + + if test "$enable_openmp" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CXX option to support OpenMP" >&5 +$as_echo_n "checking for $CXX option to support OpenMP... " >&6; } +if ${ac_cv_prog_cxx_openmp+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifndef _OPENMP + choke me +#endif +#include +int main () { return omp_get_num_threads (); } + +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_prog_cxx_openmp='none needed' +else + ac_cv_prog_cxx_openmp='unsupported' + for ac_option in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp; do + ac_save_CXXFLAGS=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $ac_option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifndef _OPENMP + choke me +#endif +#include +int main () { return omp_get_num_threads (); } + +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_prog_cxx_openmp=$ac_option +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CXXFLAGS=$ac_save_CXXFLAGS + if test "$ac_cv_prog_cxx_openmp" != unsupported; then + break + fi + done +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_openmp" >&5 +$as_echo "$ac_cv_prog_cxx_openmp" >&6; } + case $ac_cv_prog_cxx_openmp in #( + "none needed" | unsupported) + ;; #( + *) + OPENMP_CXXFLAGS=$ac_cv_prog_cxx_openmp ;; + esac + 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 + + +RPM_OS_NAME=` echo "$host_os" | \ + sed -e 's;^;X;' \ + -e 's;^X[^a-zA-Z]*\([a-zA-Z][a-zA-Z/-]*\).*$;\1;' \ + -e 's;^X.*;UNKNOWN;' | \ + sed -e 's;[/-];;' | \ + tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +case "$RPM_OS_NAME" in + LINUX* ) RPM_OS_NAME="LINUX" ;; +esac +v1=0; v2=0; v3=0 +my_os="$host_os" +case "$my_os" in + *[0-9]* ) ;; + * ) my_os="${my_os}`uname -r`" ;; +esac +eval ` echo "$my_os" | \ + sed -e 's/^[^0-9]*\([0-9][0-9.]*\).*$/\1/' | \ + sed -e 's/^/X/' \ + -e 's/^X\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"; v3="\3"/' \ + -e 's/^X\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"/' \ + -e 's/^X\([0-9][0-9]*\).*$/v1="\1"/' \ + -e 's/^X.*$/:/'` +RPM_OS_VERS=`echo . |\ + awk '{ printf("%02d%02d%02d", v1, v2, v3); }' \ + v1="$v1" v2="$v2" v3="$v3"` +CPPFLAGS="$CPPFLAGS -DRPM_OS_${RPM_OS_NAME}=${RPM_OS_VERS}" + +LDFLAGS_STATIC="" +# Check whether --enable-build-static was given. +if test "${enable_build_static+set}" = set; then : + enableval=$enable_build_static; { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build RPM as a static executable (via GNU libtool)" >&5 +$as_echo_n "checking whether to build RPM as a static executable (via GNU libtool)... " >&6; } + if test ".$enableval" = .yes; then + case "$target" in + *-*-darwin*) LDFLAGS_STATIC="";; # Mac OS X does not do static binaries. + *-*-sysv5uw*) LDFLAGS_STATIC="-static";; # Unixware has no shared libthread. + *-*-linux*) LDFLAGS_STATIC="-all-static";; + *-*-freebsd*) LDFLAGS_STATIC="-all-static";; + *-*-osf*) LDFLAGS_STATIC="";; # OSF5 has no shared pthreads libs + *-*-aix*) LDFLAGS_STATIC="-static";; # -Wl,-bnso doesn't seem to work... + *-*-hpux*) LDFLAGS_STATIC="-static";; + *-*-solaris*) LDFLAGS_STATIC="-static";; + *-*-irix*) LDFLAGS_STATIC="-static";; # should be -non_shared, but can't link because of crt1.o then. + *-*-ultrix*) LDFLAGS_STATIC="-all-static";; # ultrix doesn't have shared libs. + *-*-*) LDFLAGS_STATIC="-static";; # let GNU libtool decide how to do it for the particular platform + esac + case "$target" in + *-*-linux*) + if test -f /usr/lib/nptl/libpthread.a; then + LDFLAGS_STATIC="$LDFLAGS_STATIC -L/usr/lib/nptl" + fi + if test -f /usr/lib64/nptl/libpthread.a; then + LDFLAGS_STATIC="$LDFLAGS_STATIC -L/usr/lib64/nptl" + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (flag \"$LDFLAGS_STATIC\")" >&5 +$as_echo "yes (flag \"$LDFLAGS_STATIC\")" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + +fi + + + +# Check whether --enable-build-versionscript was given. +if test "${enable_build_versionscript+set}" = set; then : + enableval=$enable_build_versionscript; have_ld_version_script=$enableval +else + have_ld_version_script=yes +fi + + +if test "x$have_ld_version_script" = xyes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld version-script works - GNU ld, Solaris ld" >&5 +$as_echo_n "checking if ld version-script works - GNU ld, Solaris ld... " >&6; } + cat > conftest.map <conftest.$ac_ext +/* end confdefs.h. */ + + void rpm_symbol1(void) {} + void rpmi_symbol2(void) {} + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + have_ld_version_script=yes +else + have_ld_version_script=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + if test x$have_ld_version_script != xyes + then + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,-M,conftest.map" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + void rpm_symbol1(void) {} + void rpmi_symbol2(void) {} + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + have_ld_version_script=yes +else + have_ld_version_script=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + if test x$have_ld_version_script = xyes + then + LD_VERSION_SCRIPT_FLAG=-M + fi + else + LD_VERSION_SCRIPT_FLAG=--version-script + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ld_version_script" >&5 +$as_echo "$have_ld_version_script" >&6; } + rm -f conftest.map conftest.c + +fi + + if test "$have_ld_version_script" = "yes"; then + HAVE_LD_VERSION_SCRIPT_TRUE= + HAVE_LD_VERSION_SCRIPT_FALSE='#' +else + HAVE_LD_VERSION_SCRIPT_TRUE='#' + HAVE_LD_VERSION_SCRIPT_FALSE= +fi + + +# Check whether --enable-build-intlibdep was given. +if test "${enable_build_intlibdep+set}" = set; then : + enableval=$enable_build_intlibdep; do_build_intlibdep=$enableval +else + do_build_intlibdep=yes +fi + + if test ".$do_build_intlibdep" = .yes; then + ENABLE_BUILD_INTLIBDEP_TRUE= + ENABLE_BUILD_INTLIBDEP_FALSE='#' +else + ENABLE_BUILD_INTLIBDEP_TRUE='#' + ENABLE_BUILD_INTLIBDEP_FALSE= +fi + + +# Check whether --enable-build-extlibdep was given. +if test "${enable_build_extlibdep+set}" = set; then : + enableval=$enable_build_extlibdep; do_build_extlibdep=$enableval +else + do_build_extlibdep=yes +fi + + if test ".$do_build_extlibdep" = .yes; then + ENABLE_BUILD_EXTLIBDEP_TRUE= + ENABLE_BUILD_EXTLIBDEP_FALSE='#' +else + ENABLE_BUILD_EXTLIBDEP_TRUE='#' + ENABLE_BUILD_EXTLIBDEP_FALSE= +fi + + +# Check whether --enable-build-maxextlibdep was given. +if test "${enable_build_maxextlibdep+set}" = set; then : + enableval=$enable_build_maxextlibdep; do_build_maxextlibdep=$enableval +else + do_build_maxextlibdep=yes +fi + + if test ".$do_build_maxextlibdep" = .yes; then + ENABLE_BUILD_MAXEXTLIBDEP_TRUE= + ENABLE_BUILD_MAXEXTLIBDEP_FALSE='#' +else + ENABLE_BUILD_MAXEXTLIBDEP_TRUE='#' + ENABLE_BUILD_MAXEXTLIBDEP_FALSE= +fi + + +# Check whether --enable-build-lafiles was given. +if test "${enable_build_lafiles+set}" = set; then : + enableval=$enable_build_lafiles; do_build_lafiles=$enableval +else + do_build_lafiles=yes +fi + + if test ".$do_build_lafiles" = .yes; then + ENABLE_BUILD_LAFILES_TRUE= + ENABLE_BUILD_LAFILES_FALSE='#' +else + ENABLE_BUILD_LAFILES_TRUE='#' + ENABLE_BUILD_LAFILES_FALSE= +fi + + +# Check whether --enable-dirname-and-symlink-deps was given. +if test "${enable_dirname_and_symlink_deps+set}" = set; then : + enableval=$enable_dirname_and_symlink_deps; do_optional_dirname_and_symlink_deps=$enableval +else + do_optional_dirname_and_symlink_deps=yes +fi + + +if test "x$do_optional_dirname_and_symlink_deps" != xyes; then : + + +$as_echo "#define RPM_OPTIONAL_DIRNAME_AND_SYMLINK_DEPS 1" >>confdefs.h + + +fi + + +# Check whether --enable-rpm-lua-extensions-based-on-rpmlib was given. +if test "${enable_rpm_lua_extensions_based_on_rpmlib+set}" = set; then : + enableval=$enable_rpm_lua_extensions_based_on_rpmlib; do_rpm_lua_extensions_based_on_rpmlib=$enableval +else + do_rpm_lua_extensions_based_on_rpmlib=no +fi + + +if test "x$do_rpm_lua_extensions_based_on_rpmlib" != xno; then : + + +$as_echo "#define RPM_LUA_EXTENSIONS_BASED_ON_RPMLIB 1" >>confdefs.h + + +fi + + +# Check whether --enable-rpmvercmp-digits-beat-alpha was given. +if test "${enable_rpmvercmp_digits_beat_alpha+set}" = set; then : + enableval=$enable_rpmvercmp_digits_beat_alpha; do_rpmvercmp_digits_beat_alpha=$enableval +else + do_rpmvercmp_digits_beat_alpha=no +fi + + +if test "x$do_rpmvercmp_digits_beat_alpha" != xno; then : + + +$as_echo "#define RPMVERCMP_DIGITS_BEAT_ALPHA 1" >>confdefs.h + + +fi + +CFLAGS="$CFLAGS -D_GNU_SOURCE -D_REENTRANT" + + + + $as_echo "" >&6 + $as_echo "=== PROGRAM CHECKS ===" >&6 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking POSIX chmod" >&5 +$as_echo_n "checking POSIX chmod... " >&6; } +touch foo.chmodtest +chmod 744 foo.chmodtest +chmod +X foo.chmodtest 2>/dev/null || true +a=`ls -l foo.chmodtest | awk '{print $1}'` +rm -f foo.chmodtest +if test "$a" = "-rwxr-xr-x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + FIXPERMS=a+rX,u+w,g-w,o-w +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (tell your OS vendor about GNU fileutils)" >&5 +$as_echo "no (tell your OS vendor about GNU fileutils)" >&6; } + FIXPERMS=a+r,u+w,g-w,o-w +fi + + +for ac_prog in mkdir +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_MKDIR+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MKDIR in + [\\/]* | ?:[\\/]*) + ac_cv_path_MKDIR="$MKDIR" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_MKDIR="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +MKDIR=$ac_cv_path_MKDIR +if test -n "$MKDIR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR" >&5 +$as_echo "$MKDIR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$MKDIR" && break +done +test -n "$MKDIR" || MKDIR="mkdir" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MKDIR supports -p" >&5 +$as_echo_n "checking if $MKDIR supports -p... " >&6; } +rm -rf conftest +__MKDIR_P="" +$MKDIR -p conftest/a 2>/dev/null +if test $? = 0; then + rmdir conftest/a 2>/dev/null + if test $? = 0; then + rmdir conftest 2>/dev/null + if test $? = 0; then + __MKDIR_P="$MKDIR -p" + fi + fi +fi +if test ".$__MKDIR_P" = .; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + __MKDIR_P="%{_rpmhome}/mkinstalldirs" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi + +cat >>confdefs.h <<_ACEOF +#define __MKDIR_P "${__MKDIR_P}" +_ACEOF + + + +ac_fn_c_check_func "$LINENO" "lchown" "ac_cv_func_lchown" +if test "x$ac_cv_func_lchown" = xyes; then : + __CHOWN_RHF="%{__chown} -Rhf" + __CHGRP_RHF="%{__chgrp} -Rhf" + +$as_echo "#define HAVE_LCHOWN 1" >>confdefs.h + +else + __CHOWN_RHF="%{__chown} -Rf" + __CHGRP_RHF="%{__chgrp} -Rf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether chown() follows symlinks" >&5 +$as_echo_n "checking whether chown() follows symlinks... " >&6; } + # Check whether --enable-broken-chown was given. +if test "${enable_broken_chown+set}" = set; then : + enableval=$enable_broken_chown; result=$enableval +else + result=unknown +fi + + if echo "$build" | egrep "(aix|hpux|linux)" >/dev/null; then + result=yes + elif echo "$build" | grep "nextstep" >/dev/null; then + result=no + fi + if test $result = unknown; then + if test `${__ID} | cut -f2 -d\= | cut -f1 -d\(` = 0; then + rm -f foo bar + touch foo + ln -s foo bar + ${__CHOWN} 10 bar + if test `ls -l foo | awk '{print $3}'` != "root"; then + result=yes + else + result=no + fi + ${__RM} -f foo bar + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking (cannot check by non-root user)" >&5 +$as_echo_n "checking (cannot check by non-root user)... " >&6; } + result=no + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 +$as_echo "$result" >&6; } + if test $result = yes; then + +$as_echo "#define CHOWN_FOLLOWS_SYMLINK 1" >>confdefs.h + + fi +fi + + + + +# Extract the first word of "perl perl5 miniperl", so it can be a program name with args. +set dummy perl perl5 miniperl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PERL=$ac_cv_path_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test ".$PERL" = .; then + as_fn_error $? "Perl required in PATH for building rpmconstant/" "$LINENO" 5 +fi + + +if test "$cross_compiling" = "yes"; then + MYPATH=":" +else + MYPATH=$PATH +fi + +DBXY=db53 + +# Extract the first word of "bash", so it can be a program name with args. +set dummy bash; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___BASH+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__BASH in + [\\/]* | ?:[\\/]*) + ac_cv_path___BASH="$__BASH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___BASH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___BASH" && ac_cv_path___BASH="%{_bindir}/bash" + ;; +esac +fi +__BASH=$ac_cv_path___BASH +if test -n "$__BASH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__BASH" >&5 +$as_echo "$__BASH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "bzip2", so it can be a program name with args. +set dummy bzip2; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___BZIP2+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__BZIP2 in + [\\/]* | ?:[\\/]*) + ac_cv_path___BZIP2="$__BZIP2" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___BZIP2="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___BZIP2" && ac_cv_path___BZIP2="%{_bindir}/bzip2" + ;; +esac +fi +__BZIP2=$ac_cv_path___BZIP2 +if test -n "$__BZIP2"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__BZIP2" >&5 +$as_echo "$__BZIP2" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "cat", so it can be a program name with args. +set dummy cat; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___CAT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__CAT in + [\\/]* | ?:[\\/]*) + ac_cv_path___CAT="$__CAT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___CAT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___CAT" && ac_cv_path___CAT="/bin/cat" + ;; +esac +fi +__CAT=$ac_cv_path___CAT +if test -n "$__CAT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__CAT" >&5 +$as_echo "$__CAT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "chattr", so it can be a program name with args. +set dummy chattr; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___CHATTR+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__CHATTR in + [\\/]* | ?:[\\/]*) + ac_cv_path___CHATTR="$__CHATTR" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___CHATTR="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___CHATTR" && ac_cv_path___CHATTR="%{_bindir}/chattr" + ;; +esac +fi +__CHATTR=$ac_cv_path___CHATTR +if test -n "$__CHATTR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__CHATTR" >&5 +$as_echo "$__CHATTR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "chgrp", so it can be a program name with args. +set dummy chgrp; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___CHGRP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__CHGRP in + [\\/]* | ?:[\\/]*) + ac_cv_path___CHGRP="$__CHGRP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___CHGRP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___CHGRP" && ac_cv_path___CHGRP="/bin/chgrp" + ;; +esac +fi +__CHGRP=$ac_cv_path___CHGRP +if test -n "$__CHGRP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__CHGRP" >&5 +$as_echo "$__CHGRP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "chmod", so it can be a program name with args. +set dummy chmod; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___CHMOD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__CHMOD in + [\\/]* | ?:[\\/]*) + ac_cv_path___CHMOD="$__CHMOD" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___CHMOD="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___CHMOD" && ac_cv_path___CHMOD="/bin/chmod" + ;; +esac +fi +__CHMOD=$ac_cv_path___CHMOD +if test -n "$__CHMOD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__CHMOD" >&5 +$as_echo "$__CHMOD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "chown", so it can be a program name with args. +set dummy chown; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___CHOWN+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__CHOWN in + [\\/]* | ?:[\\/]*) + ac_cv_path___CHOWN="$__CHOWN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___CHOWN="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___CHOWN" && ac_cv_path___CHOWN="/bin/chown" + ;; +esac +fi +__CHOWN=$ac_cv_path___CHOWN +if test -n "$__CHOWN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__CHOWN" >&5 +$as_echo "$__CHOWN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "cmake", so it can be a program name with args. +set dummy cmake; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___CMAKE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__CMAKE in + [\\/]* | ?:[\\/]*) + ac_cv_path___CMAKE="$__CMAKE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___CMAKE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___CMAKE" && ac_cv_path___CMAKE="%{_bindir}/cmake" + ;; +esac +fi +__CMAKE=$ac_cv_path___CMAKE +if test -n "$__CMAKE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__CMAKE" >&5 +$as_echo "$__CMAKE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "cpio", so it can be a program name with args. +set dummy cpio; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___CPIO+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__CPIO in + [\\/]* | ?:[\\/]*) + ac_cv_path___CPIO="$__CPIO" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___CPIO="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___CPIO" && ac_cv_path___CPIO="/bin/cpio" + ;; +esac +fi +__CPIO=$ac_cv_path___CPIO +if test -n "$__CPIO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__CPIO" >&5 +$as_echo "$__CPIO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "curl", so it can be a program name with args. +set dummy curl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___CURL+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__CURL in + [\\/]* | ?:[\\/]*) + ac_cv_path___CURL="$__CURL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___CURL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___CURL" && ac_cv_path___CURL="%{_bindir}/curl" + ;; +esac +fi +__CURL=$ac_cv_path___CURL +if test -n "$__CURL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__CURL" >&5 +$as_echo "$__CURL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "cvs", so it can be a program name with args. +set dummy cvs; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___CVS+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__CVS in + [\\/]* | ?:[\\/]*) + ac_cv_path___CVS="$__CVS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___CVS="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___CVS" && ac_cv_path___CVS="%{_bindir}/cvs" + ;; +esac +fi +__CVS=$ac_cv_path___CVS +if test -n "$__CVS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__CVS" >&5 +$as_echo "$__CVS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "${DBXY}_archive", so it can be a program name with args. +set dummy ${DBXY}_archive; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___DB_ARCHIVE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__DB_ARCHIVE in + [\\/]* | ?:[\\/]*) + ac_cv_path___DB_ARCHIVE="$__DB_ARCHIVE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___DB_ARCHIVE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___DB_ARCHIVE" && ac_cv_path___DB_ARCHIVE="%{_bindir}/${DBXY}_archive" + ;; +esac +fi +__DB_ARCHIVE=$ac_cv_path___DB_ARCHIVE +if test -n "$__DB_ARCHIVE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__DB_ARCHIVE" >&5 +$as_echo "$__DB_ARCHIVE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "${DBXY}_checkpoint", so it can be a program name with args. +set dummy ${DBXY}_checkpoint; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___DB_CHECKPOINT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__DB_CHECKPOINT in + [\\/]* | ?:[\\/]*) + ac_cv_path___DB_CHECKPOINT="$__DB_CHECKPOINT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___DB_CHECKPOINT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___DB_CHECKPOINT" && ac_cv_path___DB_CHECKPOINT="%{_bindir}/${DBXY}_checkpoint" + ;; +esac +fi +__DB_CHECKPOINT=$ac_cv_path___DB_CHECKPOINT +if test -n "$__DB_CHECKPOINT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__DB_CHECKPOINT" >&5 +$as_echo "$__DB_CHECKPOINT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "${DBXY}_deadlock", so it can be a program name with args. +set dummy ${DBXY}_deadlock; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___DB_DEADLOCK+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__DB_DEADLOCK in + [\\/]* | ?:[\\/]*) + ac_cv_path___DB_DEADLOCK="$__DB_DEADLOCK" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___DB_DEADLOCK="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___DB_DEADLOCK" && ac_cv_path___DB_DEADLOCK="%{_bindir}/${DBXY}_deadlock" + ;; +esac +fi +__DB_DEADLOCK=$ac_cv_path___DB_DEADLOCK +if test -n "$__DB_DEADLOCK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__DB_DEADLOCK" >&5 +$as_echo "$__DB_DEADLOCK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "${DBXY}_dump", so it can be a program name with args. +set dummy ${DBXY}_dump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___DB_DUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__DB_DUMP in + [\\/]* | ?:[\\/]*) + ac_cv_path___DB_DUMP="$__DB_DUMP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___DB_DUMP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___DB_DUMP" && ac_cv_path___DB_DUMP="%{_bindir}/${DBXY}_dump" + ;; +esac +fi +__DB_DUMP=$ac_cv_path___DB_DUMP +if test -n "$__DB_DUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__DB_DUMP" >&5 +$as_echo "$__DB_DUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "${DBXY}_hotbackup", so it can be a program name with args. +set dummy ${DBXY}_hotbackup; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___DB_HOTBACKUP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__DB_HOTBACKUP in + [\\/]* | ?:[\\/]*) + ac_cv_path___DB_HOTBACKUP="$__DB_HOTBACKUP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___DB_HOTBACKUP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___DB_HOTBACKUP" && ac_cv_path___DB_HOTBACKUP="%{_bindir}/${DBXY}_hotbackup" + ;; +esac +fi +__DB_HOTBACKUP=$ac_cv_path___DB_HOTBACKUP +if test -n "$__DB_HOTBACKUP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__DB_HOTBACKUP" >&5 +$as_echo "$__DB_HOTBACKUP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "${DBXY}_load", so it can be a program name with args. +set dummy ${DBXY}_load; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___DB_LOAD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__DB_LOAD in + [\\/]* | ?:[\\/]*) + ac_cv_path___DB_LOAD="$__DB_LOAD" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___DB_LOAD="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___DB_LOAD" && ac_cv_path___DB_LOAD="%{_bindir}/${DBXY}_load" + ;; +esac +fi +__DB_LOAD=$ac_cv_path___DB_LOAD +if test -n "$__DB_LOAD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__DB_LOAD" >&5 +$as_echo "$__DB_LOAD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "${DBXY}_log_verify", so it can be a program name with args. +set dummy ${DBXY}_log_verify; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___DB_LOG_VERIFY+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__DB_LOG_VERIFY in + [\\/]* | ?:[\\/]*) + ac_cv_path___DB_LOG_VERIFY="$__DB_LOG_VERIFY" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___DB_LOG_VERIFY="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___DB_LOG_VERIFY" && ac_cv_path___DB_LOG_VERIFY="%{_bindir}/${DBXY}_log_verify" + ;; +esac +fi +__DB_LOG_VERIFY=$ac_cv_path___DB_LOG_VERIFY +if test -n "$__DB_LOG_VERIFY"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__DB_LOG_VERIFY" >&5 +$as_echo "$__DB_LOG_VERIFY" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "${DBXY}_printlog", so it can be a program name with args. +set dummy ${DBXY}_printlog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___DB_PRINTLOG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__DB_PRINTLOG in + [\\/]* | ?:[\\/]*) + ac_cv_path___DB_PRINTLOG="$__DB_PRINTLOG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___DB_PRINTLOG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___DB_PRINTLOG" && ac_cv_path___DB_PRINTLOG="%{_bindir}/${DBXY}_printlog" + ;; +esac +fi +__DB_PRINTLOG=$ac_cv_path___DB_PRINTLOG +if test -n "$__DB_PRINTLOG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__DB_PRINTLOG" >&5 +$as_echo "$__DB_PRINTLOG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "${DBXY}_recover", so it can be a program name with args. +set dummy ${DBXY}_recover; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___DB_RECOVER+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__DB_RECOVER in + [\\/]* | ?:[\\/]*) + ac_cv_path___DB_RECOVER="$__DB_RECOVER" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___DB_RECOVER="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___DB_RECOVER" && ac_cv_path___DB_RECOVER="%{_bindir}/${DBXY}_recover" + ;; +esac +fi +__DB_RECOVER=$ac_cv_path___DB_RECOVER +if test -n "$__DB_RECOVER"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__DB_RECOVER" >&5 +$as_echo "$__DB_RECOVER" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "${DBXY}_replicate", so it can be a program name with args. +set dummy ${DBXY}_replicate; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___DB_REPLICATE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__DB_REPLICATE in + [\\/]* | ?:[\\/]*) + ac_cv_path___DB_REPLICATE="$__DB_REPLICATE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___DB_REPLICATE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___DB_REPLICATE" && ac_cv_path___DB_REPLICATE="%{_bindir}/${DBXY}_replicate" + ;; +esac +fi +__DB_REPLICATE=$ac_cv_path___DB_REPLICATE +if test -n "$__DB_REPLICATE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__DB_REPLICATE" >&5 +$as_echo "$__DB_REPLICATE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "${DBXY}sql", so it can be a program name with args. +set dummy ${DBXY}sql; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___DBSQL+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__DBSQL in + [\\/]* | ?:[\\/]*) + ac_cv_path___DBSQL="$__DBSQL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___DBSQL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___DBSQL" && ac_cv_path___DBSQL="%{_bindir}/${DBXY}sql" + ;; +esac +fi +__DBSQL=$ac_cv_path___DBSQL +if test -n "$__DBSQL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__DBSQL" >&5 +$as_echo "$__DBSQL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "${DBXY}_sql_codegen", so it can be a program name with args. +set dummy ${DBXY}_sql_codegen; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___DB_SQL_CODEGEN+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__DB_SQL_CODEGEN in + [\\/]* | ?:[\\/]*) + ac_cv_path___DB_SQL_CODEGEN="$__DB_SQL_CODEGEN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___DB_SQL_CODEGEN="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___DB_SQL_CODEGEN" && ac_cv_path___DB_SQL_CODEGEN="%{_bindir}/${DBXY}_sql_codegen" + ;; +esac +fi +__DB_SQL_CODEGEN=$ac_cv_path___DB_SQL_CODEGEN +if test -n "$__DB_SQL_CODEGEN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__DB_SQL_CODEGEN" >&5 +$as_echo "$__DB_SQL_CODEGEN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "${DBXY}_stat", so it can be a program name with args. +set dummy ${DBXY}_stat; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___DB_STAT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__DB_STAT in + [\\/]* | ?:[\\/]*) + ac_cv_path___DB_STAT="$__DB_STAT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___DB_STAT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___DB_STAT" && ac_cv_path___DB_STAT="%{_bindir}/${DBXY}_stat" + ;; +esac +fi +__DB_STAT=$ac_cv_path___DB_STAT +if test -n "$__DB_STAT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__DB_STAT" >&5 +$as_echo "$__DB_STAT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "${DBXY}_tuner", so it can be a program name with args. +set dummy ${DBXY}_tuner; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___DB_TUNER+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__DB_TUNER in + [\\/]* | ?:[\\/]*) + ac_cv_path___DB_TUNER="$__DB_TUNER" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___DB_TUNER="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___DB_TUNER" && ac_cv_path___DB_TUNER="%{_bindir}/${DBXY}_tuner" + ;; +esac +fi +__DB_TUNER=$ac_cv_path___DB_TUNER +if test -n "$__DB_TUNER"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__DB_TUNER" >&5 +$as_echo "$__DB_TUNER" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "${DBXY}_upgrade", so it can be a program name with args. +set dummy ${DBXY}_upgrade; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___DB_UPGRADE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__DB_UPGRADE in + [\\/]* | ?:[\\/]*) + ac_cv_path___DB_UPGRADE="$__DB_UPGRADE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___DB_UPGRADE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___DB_UPGRADE" && ac_cv_path___DB_UPGRADE="%{_bindir}/${DBXY}_upgrade" + ;; +esac +fi +__DB_UPGRADE=$ac_cv_path___DB_UPGRADE +if test -n "$__DB_UPGRADE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__DB_UPGRADE" >&5 +$as_echo "$__DB_UPGRADE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "${DBXY}_verify", so it can be a program name with args. +set dummy ${DBXY}_verify; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___DB_VERIFY+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__DB_VERIFY in + [\\/]* | ?:[\\/]*) + ac_cv_path___DB_VERIFY="$__DB_VERIFY" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___DB_VERIFY="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___DB_VERIFY" && ac_cv_path___DB_VERIFY="%{_bindir}/${DBXY}_verify" + ;; +esac +fi +__DB_VERIFY=$ac_cv_path___DB_VERIFY +if test -n "$__DB_VERIFY"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__DB_VERIFY" >&5 +$as_echo "$__DB_VERIFY" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "diff", so it can be a program name with args. +set dummy diff; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___DIFF+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__DIFF in + [\\/]* | ?:[\\/]*) + ac_cv_path___DIFF="$__DIFF" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___DIFF="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___DIFF" && ac_cv_path___DIFF="/bin/diff" + ;; +esac +fi +__DIFF=$ac_cv_path___DIFF +if test -n "$__DIFF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__DIFF" >&5 +$as_echo "$__DIFF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "ditto", so it can be a program name with args. +set dummy ditto; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___DITTO+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__DITTO in + [\\/]* | ?:[\\/]*) + ac_cv_path___DITTO="$__DITTO" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___DITTO="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___DITTO" && ac_cv_path___DITTO="%{_bindir}/ditto" + ;; +esac +fi +__DITTO=$ac_cv_path___DITTO +if test -n "$__DITTO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__DITTO" >&5 +$as_echo "$__DITTO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "file", so it can be a program name with args. +set dummy file; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___FILE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__FILE in + [\\/]* | ?:[\\/]*) + ac_cv_path___FILE="$__FILE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___FILE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___FILE" && ac_cv_path___FILE="%{_bindir}/file" + ;; +esac +fi +__FILE=$ac_cv_path___FILE +if test -n "$__FILE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__FILE" >&5 +$as_echo "$__FILE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "git", so it can be a program name with args. +set dummy git; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___GIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__GIT in + [\\/]* | ?:[\\/]*) + ac_cv_path___GIT="$__GIT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___GIT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___GIT" && ac_cv_path___GIT="%{_bindir}/git" + ;; +esac +fi +__GIT=$ac_cv_path___GIT +if test -n "$__GIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__GIT" >&5 +$as_echo "$__GIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "gpg2", so it can be a program name with args. +set dummy gpg2; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___GPG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__GPG in + [\\/]* | ?:[\\/]*) + ac_cv_path___GPG="$__GPG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___GPG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___GPG" && ac_cv_path___GPG="%{_bindir}/gpg2" + ;; +esac +fi +__GPG=$ac_cv_path___GPG +if test -n "$__GPG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__GPG" >&5 +$as_echo "$__GPG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "gsr", so it can be a program name with args. +set dummy gsr; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___GSR+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__GSR in + [\\/]* | ?:[\\/]*) + ac_cv_path___GSR="$__GSR" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___GSR="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___GSR" && ac_cv_path___GSR="%{_bindir}/gsr" + ;; +esac +fi +__GSR=$ac_cv_path___GSR +if test -n "$__GSR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__GSR" >&5 +$as_echo "$__GSR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "gst-inspect-0.10", so it can be a program name with args. +set dummy gst-inspect-0.10; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___GST_INSPECT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__GST_INSPECT in + [\\/]* | ?:[\\/]*) + ac_cv_path___GST_INSPECT="$__GST_INSPECT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___GST_INSPECT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___GST_INSPECT" && ac_cv_path___GST_INSPECT="%{_bindir}/gst-inspect-0.10" + ;; +esac +fi +__GST_INSPECT=$ac_cv_path___GST_INSPECT +if test -n "$__GST_INSPECT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__GST_INSPECT" >&5 +$as_echo "$__GST_INSPECT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "gzip", so it can be a program name with args. +set dummy gzip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___GZIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__GZIP in + [\\/]* | ?:[\\/]*) + ac_cv_path___GZIP="$__GZIP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___GZIP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___GZIP" && ac_cv_path___GZIP="/bin/gzip" + ;; +esac +fi +__GZIP=$ac_cv_path___GZIP +if test -n "$__GZIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__GZIP" >&5 +$as_echo "$__GZIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "hg", so it can be a program name with args. +set dummy hg; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___HG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__HG in + [\\/]* | ?:[\\/]*) + ac_cv_path___HG="$__HG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___HG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___HG" && ac_cv_path___HG="%{_bindir}/hg" + ;; +esac +fi +__HG=$ac_cv_path___HG +if test -n "$__HG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__HG" >&5 +$as_echo "$__HG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "id", so it can be a program name with args. +set dummy id; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___ID+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__ID in + [\\/]* | ?:[\\/]*) + ac_cv_path___ID="$__ID" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___ID="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___ID" && ac_cv_path___ID="/usr/bin/id" + ;; +esac +fi +__ID=$ac_cv_path___ID +if test -n "$__ID"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__ID" >&5 +$as_echo "$__ID" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "install", so it can be a program name with args. +set dummy install; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___INSTALL+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__INSTALL in + [\\/]* | ?:[\\/]*) + ac_cv_path___INSTALL="$__INSTALL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___INSTALL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___INSTALL" && ac_cv_path___INSTALL="/usr/bin/install" + ;; +esac +fi +__INSTALL=$ac_cv_path___INSTALL +if test -n "$__INSTALL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__INSTALL" >&5 +$as_echo "$__INSTALL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "lzip", so it can be a program name with args. +set dummy lzip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___LZIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__LZIP in + [\\/]* | ?:[\\/]*) + ac_cv_path___LZIP="$__LZIP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___LZIP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___LZIP" && ac_cv_path___LZIP="/usr/bin/lzip" + ;; +esac +fi +__LZIP=$ac_cv_path___LZIP +if test -n "$__LZIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__LZIP" >&5 +$as_echo "$__LZIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "lrzip", so it can be a program name with args. +set dummy lrzip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___LRZIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__LRZIP in + [\\/]* | ?:[\\/]*) + ac_cv_path___LRZIP="$__LRZIP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___LRZIP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___LRZIP" && ac_cv_path___LRZIP="/usr/bin/lrzip" + ;; +esac +fi +__LRZIP=$ac_cv_path___LRZIP +if test -n "$__LRZIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__LRZIP" >&5 +$as_echo "$__LRZIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "install-info", so it can be a program name with args. +set dummy install-info; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___INSTALL_INFO+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__INSTALL_INFO in + [\\/]* | ?:[\\/]*) + ac_cv_path___INSTALL_INFO="$__INSTALL_INFO" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___INSTALL_INFO="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___INSTALL_INFO" && ac_cv_path___INSTALL_INFO="/sbin/install-info" + ;; +esac +fi +__INSTALL_INFO=$ac_cv_path___INSTALL_INFO +if test -n "$__INSTALL_INFO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__INSTALL_INFO" >&5 +$as_echo "$__INSTALL_INFO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "ldconfig", so it can be a program name with args. +set dummy ldconfig; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___LDCONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__LDCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path___LDCONFIG="$__LDCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___LDCONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___LDCONFIG" && ac_cv_path___LDCONFIG="/sbin/ldconfig" + ;; +esac +fi +__LDCONFIG=$ac_cv_path___LDCONFIG +if test -n "$__LDCONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__LDCONFIG" >&5 +$as_echo "$__LDCONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "ln", so it can be a program name with args. +set dummy ln; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___LN+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__LN in + [\\/]* | ?:[\\/]*) + ac_cv_path___LN="$__LN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___LN="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___LN" && ac_cv_path___LN="/bin/ln" + ;; +esac +fi +__LN=$ac_cv_path___LN +if test -n "$__LN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__LN" >&5 +$as_echo "$__LN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "lsattr", so it can be a program name with args. +set dummy lsattr; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___LSATTR+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__LSATTR in + [\\/]* | ?:[\\/]*) + ac_cv_path___LSATTR="$__LSATTR" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___LSATTR="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___LSATTR" && ac_cv_path___LSATTR="%{_bindir}/lsattr" + ;; +esac +fi +__LSATTR=$ac_cv_path___LSATTR +if test -n "$__LSATTR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__LSATTR" >&5 +$as_echo "$__LSATTR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "lzma", so it can be a program name with args. +set dummy lzma; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___LZMA+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__LZMA in + [\\/]* | ?:[\\/]*) + ac_cv_path___LZMA="$__LZMA" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___LZMA="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___LZMA" && ac_cv_path___LZMA="%{_bindir}/lzma" + ;; +esac +fi +__LZMA=$ac_cv_path___LZMA +if test -n "$__LZMA"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__LZMA" >&5 +$as_echo "$__LZMA" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "lzop", so it can be a program name with args. +set dummy lzop; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___LZOP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__LZOP in + [\\/]* | ?:[\\/]*) + ac_cv_path___LZOP="$__LZOP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___LZOP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___LZOP" && ac_cv_path___LZOP="%{_bindir}/lzop" + ;; +esac +fi +__LZOP=$ac_cv_path___LZOP +if test -n "$__LZOP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__LZOP" >&5 +$as_echo "$__LZOP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "make", so it can be a program name with args. +set dummy make; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___MAKE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__MAKE in + [\\/]* | ?:[\\/]*) + ac_cv_path___MAKE="$__MAKE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___MAKE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___MAKE" && ac_cv_path___MAKE="%{_bindir}/make" + ;; +esac +fi +__MAKE=$ac_cv_path___MAKE +if test -n "$__MAKE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__MAKE" >&5 +$as_echo "$__MAKE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "mkdir", so it can be a program name with args. +set dummy mkdir; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___MKDIR+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__MKDIR in + [\\/]* | ?:[\\/]*) + ac_cv_path___MKDIR="$__MKDIR" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___MKDIR="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___MKDIR" && ac_cv_path___MKDIR="/bin/mkdir" + ;; +esac +fi +__MKDIR=$ac_cv_path___MKDIR +if test -n "$__MKDIR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__MKDIR" >&5 +$as_echo "$__MKDIR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "mongo", so it can be a program name with args. +set dummy mongo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___MONGO+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__MONGO in + [\\/]* | ?:[\\/]*) + ac_cv_path___MONGO="$__MONGO" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___MONGO="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___MONGO" && ac_cv_path___MONGO="%{_bindir}/mongo" + ;; +esac +fi +__MONGO=$ac_cv_path___MONGO +if test -n "$__MONGO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__MONGO" >&5 +$as_echo "$__MONGO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "modinfo", so it can be a program name with args. +set dummy modinfo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___MODINFO+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__MODINFO in + [\\/]* | ?:[\\/]*) + ac_cv_path___MODINFO="$__MODINFO" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___MODINFO="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___MODINFO" && ac_cv_path___MODINFO="/sbin/modinfo" + ;; +esac +fi +__MODINFO=$ac_cv_path___MODINFO +if test -n "$__MODINFO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__MODINFO" >&5 +$as_echo "$__MODINFO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "mv", so it can be a program name with args. +set dummy mv; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___MV+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__MV in + [\\/]* | ?:[\\/]*) + ac_cv_path___MV="$__MV" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___MV="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___MV" && ac_cv_path___MV="/bin/mv" + ;; +esac +fi +__MV=$ac_cv_path___MV +if test -n "$__MV"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__MV" >&5 +$as_echo "$__MV" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "patch", so it can be a program name with args. +set dummy patch; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___PATCH+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__PATCH in + [\\/]* | ?:[\\/]*) + ac_cv_path___PATCH="$__PATCH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___PATCH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___PATCH" && ac_cv_path___PATCH="%{_bindir}/patch" + ;; +esac +fi +__PATCH=$ac_cv_path___PATCH +if test -n "$__PATCH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__PATCH" >&5 +$as_echo "$__PATCH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "pax", so it can be a program name with args. +set dummy pax; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___PAX+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__PAX in + [\\/]* | ?:[\\/]*) + ac_cv_path___PAX="$__PAX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___PAX="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___PAX" && ac_cv_path___PAX="%{_bindir}/pax" + ;; +esac +fi +__PAX=$ac_cv_path___PAX +if test -n "$__PAX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__PAX" >&5 +$as_echo "$__PAX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path___PERL="$__PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___PERL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___PERL" && ac_cv_path___PERL="%{_bindir}/perl" + ;; +esac +fi +__PERL=$ac_cv_path___PERL +if test -n "$__PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__PERL" >&5 +$as_echo "$__PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "pgp", so it can be a program name with args. +set dummy pgp; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___PGP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__PGP in + [\\/]* | ?:[\\/]*) + ac_cv_path___PGP="$__PGP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___PGP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___PGP" && ac_cv_path___PGP="%{_bindir}/pgp" + ;; +esac +fi +__PGP=$ac_cv_path___PGP +if test -n "$__PGP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__PGP" >&5 +$as_echo "$__PGP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "php", so it can be a program name with args. +set dummy php; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___PHP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__PHP in + [\\/]* | ?:[\\/]*) + ac_cv_path___PHP="$__PHP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___PHP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___PHP" && ac_cv_path___PHP="%{_bindir}/php" + ;; +esac +fi +__PHP=$ac_cv_path___PHP +if test -n "$__PHP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__PHP" >&5 +$as_echo "$__PHP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "python", so it can be a program name with args. +set dummy python; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___PYTHON+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__PYTHON in + [\\/]* | ?:[\\/]*) + ac_cv_path___PYTHON="$__PYTHON" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___PYTHON="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___PYTHON" && ac_cv_path___PYTHON="%{_bindir}/python" + ;; +esac +fi +__PYTHON=$ac_cv_path___PYTHON +if test -n "$__PYTHON"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__PYTHON" >&5 +$as_echo "$__PYTHON" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "rm", so it can be a program name with args. +set dummy rm; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___RM+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__RM in + [\\/]* | ?:[\\/]*) + ac_cv_path___RM="$__RM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___RM="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___RM" && ac_cv_path___RM="/bin/rm" + ;; +esac +fi +__RM=$ac_cv_path___RM +if test -n "$__RM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__RM" >&5 +$as_echo "$__RM" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "rmdir", so it can be a program name with args. +set dummy rmdir; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___RMDIR+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__RMDIR in + [\\/]* | ?:[\\/]*) + ac_cv_path___RMDIR="$__RMDIR" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___RMDIR="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___RMDIR" && ac_cv_path___RMDIR="/bin/rmdir" + ;; +esac +fi +__RMDIR=$ac_cv_path___RMDIR +if test -n "$__RMDIR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__RMDIR" >&5 +$as_echo "$__RMDIR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "rsh", so it can be a program name with args. +set dummy rsh; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___RSH+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__RSH in + [\\/]* | ?:[\\/]*) + ac_cv_path___RSH="$__RSH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___RSH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___RSH" && ac_cv_path___RSH="%{_bindir}/rsh" + ;; +esac +fi +__RSH=$ac_cv_path___RSH +if test -n "$__RSH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__RSH" >&5 +$as_echo "$__RSH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "ruby", so it can be a program name with args. +set dummy ruby; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___RUBY+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__RUBY in + [\\/]* | ?:[\\/]*) + ac_cv_path___RUBY="$__RUBY" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___RUBY="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___RUBY" && ac_cv_path___RUBY="%{_bindir}/ruby" + ;; +esac +fi +__RUBY=$ac_cv_path___RUBY +if test -n "$__RUBY"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__RUBY" >&5 +$as_echo "$__RUBY" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "sed", so it can be a program name with args. +set dummy sed; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__SED in + [\\/]* | ?:[\\/]*) + ac_cv_path___SED="$__SED" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___SED="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___SED" && ac_cv_path___SED="/bin/sed" + ;; +esac +fi +__SED=$ac_cv_path___SED +if test -n "$__SED"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__SED" >&5 +$as_echo "$__SED" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "sh", so it can be a program name with args. +set dummy sh; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___SH+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__SH in + [\\/]* | ?:[\\/]*) + ac_cv_path___SH="$__SH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___SH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___SH" && ac_cv_path___SH="/bin/sh" + ;; +esac +fi +__SH=$ac_cv_path___SH +if test -n "$__SH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__SH" >&5 +$as_echo "$__SH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "sqlite3", so it can be a program name with args. +set dummy sqlite3; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___SQLITE3+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__SQLITE3 in + [\\/]* | ?:[\\/]*) + ac_cv_path___SQLITE3="$__SQLITE3" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___SQLITE3="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___SQLITE3" && ac_cv_path___SQLITE3="%{_bindir}/sqlite3" + ;; +esac +fi +__SQLITE3=$ac_cv_path___SQLITE3 +if test -n "$__SQLITE3"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__SQLITE3" >&5 +$as_echo "$__SQLITE3" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "ssh", so it can be a program name with args. +set dummy ssh; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___SSH+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__SSH in + [\\/]* | ?:[\\/]*) + ac_cv_path___SSH="$__SSH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___SSH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___SSH" && ac_cv_path___SSH="%{_bindir}/ssh" + ;; +esac +fi +__SSH=$ac_cv_path___SSH +if test -n "$__SSH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__SSH" >&5 +$as_echo "$__SSH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "svn", so it can be a program name with args. +set dummy svn; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___SVN+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__SVN in + [\\/]* | ?:[\\/]*) + ac_cv_path___SVN="$__SVN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___SVN="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___SVN" && ac_cv_path___SVN="%{_bindir}/svn" + ;; +esac +fi +__SVN=$ac_cv_path___SVN +if test -n "$__SVN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__SVN" >&5 +$as_echo "$__SVN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "tar", so it can be a program name with args. +set dummy tar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___TAR+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__TAR in + [\\/]* | ?:[\\/]*) + ac_cv_path___TAR="$__TAR" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___TAR="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___TAR" && ac_cv_path___TAR="/bin/tar" + ;; +esac +fi +__TAR=$ac_cv_path___TAR +if test -n "$__TAR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__TAR" >&5 +$as_echo "$__TAR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "tclsh", so it can be a program name with args. +set dummy tclsh; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___TCLSH+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__TCLSH in + [\\/]* | ?:[\\/]*) + ac_cv_path___TCLSH="$__TCLSH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___TCLSH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___TCLSH" && ac_cv_path___TCLSH="%{_bindir}/tclsh" + ;; +esac +fi +__TCLSH=$ac_cv_path___TCLSH +if test -n "$__TCLSH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__TCLSH" >&5 +$as_echo "$__TCLSH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "unzip", so it can be a program name with args. +set dummy unzip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___UNZIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__UNZIP in + [\\/]* | ?:[\\/]*) + ac_cv_path___UNZIP="$__UNZIP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___UNZIP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___UNZIP" && ac_cv_path___UNZIP="%{_bindir}/unzip" + ;; +esac +fi +__UNZIP=$ac_cv_path___UNZIP +if test -n "$__UNZIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__UNZIP" >&5 +$as_echo "$__UNZIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "xz", so it can be a program name with args. +set dummy xz; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___XZ+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__XZ in + [\\/]* | ?:[\\/]*) + ac_cv_path___XZ="$__XZ" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___XZ="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___XZ" && ac_cv_path___XZ="%{_bindir}/xz" + ;; +esac +fi +__XZ=$ac_cv_path___XZ +if test -n "$__XZ"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__XZ" >&5 +$as_echo "$__XZ" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "ld", so it can be a program name with args. +set dummy ld; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__LD in + [\\/]* | ?:[\\/]*) + ac_cv_path___LD="$__LD" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___LD="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___LD" && ac_cv_path___LD="%{_bindir}/ld" + ;; +esac +fi +__LD=$ac_cv_path___LD +if test -n "$__LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__LD" >&5 +$as_echo "$__LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "nm", so it can be a program name with args. +set dummy nm; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__NM in + [\\/]* | ?:[\\/]*) + ac_cv_path___NM="$__NM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___NM="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___NM" && ac_cv_path___NM="%{_bindir}/nm" + ;; +esac +fi +__NM=$ac_cv_path___NM +if test -n "$__NM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__NM" >&5 +$as_echo "$__NM" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "objcopy", so it can be a program name with args. +set dummy objcopy; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___OBJCOPY+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__OBJCOPY in + [\\/]* | ?:[\\/]*) + ac_cv_path___OBJCOPY="$__OBJCOPY" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___OBJCOPY="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___OBJCOPY" && ac_cv_path___OBJCOPY="%{_bindir}/objcopy" + ;; +esac +fi +__OBJCOPY=$ac_cv_path___OBJCOPY +if test -n "$__OBJCOPY"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__OBJCOPY" >&5 +$as_echo "$__OBJCOPY" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__OBJDUMP in + [\\/]* | ?:[\\/]*) + ac_cv_path___OBJDUMP="$__OBJDUMP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___OBJDUMP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___OBJDUMP" && ac_cv_path___OBJDUMP="%{_bindir}/objdump" + ;; +esac +fi +__OBJDUMP=$ac_cv_path___OBJDUMP +if test -n "$__OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__OBJDUMP" >&5 +$as_echo "$__OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__STRIP in + [\\/]* | ?:[\\/]*) + ac_cv_path___STRIP="$__STRIP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $MYPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___STRIP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___STRIP" && ac_cv_path___STRIP="%{_bindir}/strip" + ;; +esac +fi +__STRIP=$ac_cv_path___STRIP +if test -n "$__STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__STRIP" >&5 +$as_echo "$__STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + +for ac_prog in libtoolize glibtoolize +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIBTOOLIZE+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIBTOOLIZE"; then + ac_cv_prog_LIBTOOLIZE="$LIBTOOLIZE" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIBTOOLIZE="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIBTOOLIZE=$ac_cv_prog_LIBTOOLIZE +if test -n "$LIBTOOLIZE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBTOOLIZE" >&5 +$as_echo "$LIBTOOLIZE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$LIBTOOLIZE" && break +done +test -n "$LIBTOOLIZE" || LIBTOOLIZE="libtoolize" + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether id supports -u" >&5 +$as_echo_n "checking whether id supports -u... " >&6; } +if ${__ID} -u 2>&1 > /dev/null; then + __ID_U="%{__id} -u" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + __ID_U="%{__id} | %{__sed} 's/[^=]*=\\\\([0-9][0-9]*\\\\).*$/\\\\1/'" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "doxygen", so it can be a program name with args. +set dummy doxygen; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path___DOXYGEN+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $__DOXYGEN in + [\\/]* | ?:[\\/]*) + ac_cv_path___DOXYGEN="$__DOXYGEN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path___DOXYGEN="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path___DOXYGEN" && ac_cv_path___DOXYGEN="no" + ;; +esac +fi +__DOXYGEN=$ac_cv_path___DOXYGEN +if test -n "$__DOXYGEN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $__DOXYGEN" >&5 +$as_echo "$__DOXYGEN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +withval=auto + +# Check whether --with-apidocs was given. +if test "${with_apidocs+set}" = set; then : + withval=$with_apidocs; +fi + +if test $withval = auto -a $__DOXYGEN != no; then + withval=yes +elif test $withval = yes -a $__DOXYGEN = no; then + as_fn_error $? "RPM API docs need doxygen in PATH" "$LINENO" 5 +fi +if test $withval = yes; then + WITH_APIDOCS_TARGET=apidocs + WITH_APIDOCS=1 +else + WITH_APIDOCS=0 +fi + + + + + + $as_echo "" >&6 + $as_echo "=== API CHECKS ===" >&6 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 +$as_echo_n "checking for library containing strerror... " >&6; } +if ${ac_cv_search_strerror+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char strerror (); +int +main () +{ +return strerror (); + ; + return 0; +} +_ACEOF +for ac_lib in '' cposix; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_strerror=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_strerror+:} false; then : + break +fi +done +if ${ac_cv_search_strerror+:} false; then : + +else + ac_cv_search_strerror=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 +$as_echo "$ac_cv_search_strerror" >&6; } +ac_res=$ac_cv_search_strerror +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines makedev" >&5 +$as_echo_n "checking whether sys/types.h defines makedev... " >&6; } +if ${ac_cv_header_sys_types_h_makedev+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +return makedev(0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_header_sys_types_h_makedev=yes +else + ac_cv_header_sys_types_h_makedev=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_types_h_makedev" >&5 +$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; } + +if test $ac_cv_header_sys_types_h_makedev = no; then +ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mkdev_h" = xyes; then : + +$as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h + +fi + + + + if test $ac_cv_header_sys_mkdev_h = no; then + ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then : + +$as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h + +fi + + + fi +fi + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } +if eval \${$as_ac_Header+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_ac_Header=yes" +else + eval "$as_ac_Header=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_ac_Header + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir; 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_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x; 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_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if ${ac_cv_header_time+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_time=yes +else + ac_cv_header_time=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h + +fi + + +for ac_header in fcntl.h getopt.h grp.h memory.h netdb.h pwd.h utime.h signal.h stdbool.h sys/endian.h sys/ipc.h sys/socket.h sys/select.h sys/time.h sys/types.h sys/stdtypes.h sys/mman.h sys/resource.h sys/utsname.h sys/prctl.h sys/wait.h netinet/in_systm.h machine/types.h mntent.h sys/mnttab.h sys/systemcfg.h sys/param.h sys/mount.h sys/mntctl.h sys/vmount.h libio.h err.h mcheck.h limits.h libgen.h float.h glob.h poll.h netinet/in.h arpa/inet.h langinfo.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in locale.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" +if test "x$ac_cv_header_locale_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LOCALE_H 1 +_ACEOF + +fi + +done + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +$as_echo_n "checking whether NLS is requested... " >&6; } + # Check whether --enable-nls was given. +if test "${enable_nls+set}" = set; then : + enableval=$enable_nls; USE_NLS=$enableval +else + USE_NLS=yes +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +$as_echo "$USE_NLS" >&6; } + + + + + GETTEXT_MACRO_VERSION=0.18 + + + + +# 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_MSGFMT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case "$MSGFMT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != ":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +$as_echo "$MSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GMSGFMT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +$as_echo "$GMSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; + *) MSGFMT_015=$MSGFMT ;; + esac + + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; + *) GMSGFMT_015=$GMSGFMT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_XGETTEXT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case "$XGETTEXT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +$as_echo "$XGETTEXT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + rm -f messages.po + + case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; + *) XGETTEXT_015=$XGETTEXT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_MSGMERGE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case "$MSGMERGE" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" + ;; +esac +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 +$as_echo "$MSGMERGE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$localedir" || localedir='${datadir}/locale' + + + test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= + + + ac_config_commands="$ac_config_commands po-directories" + + + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + 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. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 +$as_echo_n "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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${acl_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${acl_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 +$as_echo_n "checking for shared library run path origin... " >&6; } +if ${acl_cv_rpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 +$as_echo "$acl_cv_rpath" >&6; } + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath was given. +if test "${enable_rpath+set}" = set; then : + enableval=$enable_rpath; : +else + enable_rpath=yes +fi + + + + + acl_libdirstem=lib + acl_libdirstem2= + case "$host_os" in + solaris*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 +$as_echo_n "checking for 64-bit host... " >&6; } +if ${gl_cv_solaris_64bit+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _LP64 +sixtyfour bits +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "sixtyfour bits" >/dev/null 2>&1; then : + gl_cv_solaris_64bit=yes +else + gl_cv_solaris_64bit=no +fi +rm -f conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 +$as_echo "$gl_cv_solaris_64bit" >&6; } + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; + esac + fi + ;; + *) + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libiconv-prefix was given. +if test "${with_libiconv_prefix+set}" = set; then : + withval=$with_libiconv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBICONV= + LTLIBICONV= + INCICONV= + LIBICONV_PREFIX= + HAVE_LIBICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 +$as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } +if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : + $as_echo_n "(cached) " >&6 +else + gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +CFPreferencesCopyAppValue(NULL, NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_CFPreferencesCopyAppValue=yes +else + gt_cv_func_CFPreferencesCopyAppValue=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 +$as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + +$as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 +$as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } +if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then : + $as_echo_n "(cached) " >&6 +else + gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +CFLocaleCopyCurrent(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_CFLocaleCopyCurrent=yes +else + gt_cv_func_CFLocaleCopyCurrent=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 +$as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then + +$as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h + + fi + INTL_MACOSX_LIBS= + if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" + fi + + + + + + + LIBINTL= + LTLIBINTL= + POSUB= + + case " $gt_needs " in + *" need-formatstring-macros "*) gt_api_version=3 ;; + *" need-ngettext "*) gt_api_version=2 ;; + *) gt_api_version=1 ;; + esac + gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" + gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" + + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + + + if test $gt_api_version -ge 3; then + gt_revision_test_code=' +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +' + else + gt_revision_test_code= + fi + if test $gt_api_version -ge 2; then + gt_expression_test_code=' + * ngettext ("", "", 0)' + else + gt_expression_test_code= + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 +$as_echo_n "checking for GNU gettext in libc... " >&6; } +if eval \${$gt_func_gnugettext_libc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; +int +main () +{ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$gt_func_gnugettext_libc=yes" +else + eval "$gt_func_gnugettext_libc=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$gt_func_gnugettext_libc + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +$as_echo_n "checking for iconv... " >&6; } +if ${am_cv_func_iconv+:} false; then : + $as_echo_n "(cached) " >&6 +else + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +$as_echo "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 +$as_echo_n "checking for working iconv... " >&6; } +if ${am_cv_func_iconv_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + if test "$cross_compiling" = yes; then : + case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +int main () +{ + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static const char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + return 1; + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static const char input[] = "\263"; + char buf[10]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + return 1; + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + return 1; + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + am_cv_func_iconv_works=yes +else + am_cv_func_iconv_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 + + LIBS="$am_save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 +$as_echo "$am_cv_func_iconv_works" >&6; } + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + +$as_echo "#define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +$as_echo_n "checking how to link with libiconv... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +$as_echo "$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libintl-prefix was given. +if test "${with_libintl_prefix+set}" = set; then : + withval=$with_libintl_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + +fi + + LIBINTL= + LTLIBINTL= + INCINTL= + LIBINTL_PREFIX= + HAVE_LIBINTL= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='intl ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" + ;; + esac + done + fi + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" + done + fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 +$as_echo_n "checking for GNU gettext in libintl... " >&6; } +if eval \${$gt_func_gnugettext_libintl+:} false; then : + $as_echo_n "(cached) " >&6 +else + gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); +int +main () +{ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$gt_func_gnugettext_libintl=yes" +else + eval "$gt_func_gnugettext_libintl=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); +int +main () +{ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS" +fi +eval ac_res=\$$gt_func_gnugettext_libintl + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + fi + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ + || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + + + if test -n "$INTL_MACOSX_LIBS"; then + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" + LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" + fi + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + +$as_echo "#define ENABLE_NLS 1" >>confdefs.h + + else + USE_NLS=no + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 +$as_echo_n "checking whether to use NLS... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +$as_echo "$USE_NLS" >&6; } + if test "$USE_NLS" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 +$as_echo_n "checking where the gettext function comes from... " >&6; } + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 +$as_echo "$gt_source" >&6; } + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 +$as_echo_n "checking how to link with libintl... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 +$as_echo "$LIBINTL" >&6; } + + for element in $INCINTL; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + fi + + +$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h + + +$as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h + + fi + + POSUB=po + fi + + + + INTLLIBS="$LIBINTL" + + + + + + + if test ".$USE_NLS" = .yes ; then + USE_NLS_TRUE= + USE_NLS_FALSE='#' +else + USE_NLS_TRUE='#' + USE_NLS_FALSE= +fi + + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if ${ac_cv_sys_largefile_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO"; then : + break +fi +rm -f core conftest.err conftest.$ac_objext + 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 + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if ${ac_cv_sys_file_offset_bits+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + 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.$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 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + 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.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if ${ac_cv_sys_large_files+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + 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.$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 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + 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.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -rf conftest* + fi +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether va_list assignments need array notation" >&5 +$as_echo_n "checking whether va_list assignments need array notation... " >&6; } +if ${ac_cv_valistisarray+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_valistisarray=false +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + void foo(int i, ...) { + va_list ap1, ap2; + va_start(ap1, i); + ap2 = ap1; + if (va_arg(ap2, int) != 123 || va_arg(ap1, int) != 123) + { exit(1); } + va_end(ap1); va_end(ap2); + } + int main() { foo(0, 123); return(0); } +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_valistisarray=false +else + ac_cv_valistisarray=true +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + + +if test "$ac_cv_valistisarray" = true ; then + +$as_echo "#define HAVE_VA_LIST_AS_ARRAY 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for va_copy() function" >&5 +$as_echo_n "checking for va_copy() function... " >&6; } + if ${ac_cv_va_copy+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_cv_va_copy="" + + + if test ".$ac_cv_va_copy" = .; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#define DO_VA_COPY(d, s) va_copy((d), (s)) +void test(char *str, ...) +{ + va_list ap, ap2; + int i; + va_start(ap, str); + DO_VA_COPY(ap2, ap); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + DO_VA_COPY(ap, ap2); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + va_end(ap); +} +int main(int argc, char *argv[]) +{ + test("test", 1, 2, 3, 4, 5, 6, 7, 8, 9); + exit(0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_va_copy="C99" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + + + + if test ".$ac_cv_va_copy" = .; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#define DO_VA_COPY(d, s) VA_COPY((d), (s)) +void test(char *str, ...) +{ + va_list ap, ap2; + int i; + va_start(ap, str); + DO_VA_COPY(ap2, ap); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + DO_VA_COPY(ap, ap2); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + va_end(ap); +} +int main(int argc, char *argv[]) +{ + test("test", 1, 2, 3, 4, 5, 6, 7, 8, 9); + exit(0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_va_copy="GCM" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + + + + if test ".$ac_cv_va_copy" = .; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#define DO_VA_COPY(d, s) __va_copy((d), (s)) +void test(char *str, ...) +{ + va_list ap, ap2; + int i; + va_start(ap, str); + DO_VA_COPY(ap2, ap); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + DO_VA_COPY(ap, ap2); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + va_end(ap); +} +int main(int argc, char *argv[]) +{ + test("test", 1, 2, 3, 4, 5, 6, 7, 8, 9); + exit(0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_va_copy="GCH" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + + + + if test ".$ac_cv_va_copy" = .; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#define DO_VA_COPY(d, s) __builtin_va_copy((d), (s)) +void test(char *str, ...) +{ + va_list ap, ap2; + int i; + va_start(ap, str); + DO_VA_COPY(ap2, ap); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + DO_VA_COPY(ap, ap2); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + va_end(ap); +} +int main(int argc, char *argv[]) +{ + test("test", 1, 2, 3, 4, 5, 6, 7, 8, 9); + exit(0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_va_copy="GCB" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + + + + if test ".$ac_cv_va_copy" = .; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#define DO_VA_COPY(d, s) do { (d) = (s); } while (0) +void test(char *str, ...) +{ + va_list ap, ap2; + int i; + va_start(ap, str); + DO_VA_COPY(ap2, ap); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + DO_VA_COPY(ap, ap2); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + va_end(ap); +} +int main(int argc, char *argv[]) +{ + test("test", 1, 2, 3, 4, 5, 6, 7, 8, 9); + exit(0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_va_copy="ASS" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + + + + if test ".$ac_cv_va_copy" = .; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#define DO_VA_COPY(d, s) do { *(d) = *(s); } while (0) +void test(char *str, ...) +{ + va_list ap, ap2; + int i; + va_start(ap, str); + DO_VA_COPY(ap2, ap); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + DO_VA_COPY(ap, ap2); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + va_end(ap); +} +int main(int argc, char *argv[]) +{ + test("test", 1, 2, 3, 4, 5, 6, 7, 8, 9); + exit(0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_va_copy="ASP" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + + + + if test ".$ac_cv_va_copy" = .; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#define DO_VA_COPY(d, s) memcpy((void *)&(d), (void *)&(s), sizeof((s))) +void test(char *str, ...) +{ + va_list ap, ap2; + int i; + va_start(ap, str); + DO_VA_COPY(ap2, ap); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + DO_VA_COPY(ap, ap2); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + va_end(ap); +} +int main(int argc, char *argv[]) +{ + test("test", 1, 2, 3, 4, 5, 6, 7, 8, 9); + exit(0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_va_copy="CPS" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + + + + if test ".$ac_cv_va_copy" = .; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#define DO_VA_COPY(d, s) memcpy((void *)(d), (void *)(s), sizeof(*(s))) +void test(char *str, ...) +{ + va_list ap, ap2; + int i; + va_start(ap, str); + DO_VA_COPY(ap2, ap); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + DO_VA_COPY(ap, ap2); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + va_end(ap); +} +int main(int argc, char *argv[]) +{ + test("test", 1, 2, 3, 4, 5, 6, 7, 8, 9); + exit(0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_va_copy="CPP" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + + if test ".$ac_cv_va_copy" = .; then + as_fn_error $? "no working implementation found" "$LINENO" 5 + fi + +fi + + if test ".$ac_cv_va_copy" = ".C99"; then + +$as_echo "#define HAVE_VA_COPY 1" >>confdefs.h + + fi + +cat >>confdefs.h <<_ACEOF +#define __VA_COPY_USE __VA_COPY_USE_$ac_cv_va_copy +_ACEOF + + + if test ".$ac_cv_va_copy" = ".C99"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (using fallback implementation)" >&5 +$as_echo "no (using fallback implementation)" >&6; } + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct statfs" >&5 +$as_echo_n "checking for struct statfs... " >&6; } + found_struct_statfs=no + if test ".$found_struct_statfs" = .no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#include + +int +main () +{ + + struct statvfs sfs; + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: in " >&5 +$as_echo "in " >&6; } + +$as_echo "#define STATFS_IN_SYS_STATVFS 1" >>confdefs.h + + found_struct_statfs=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test ".$found_struct_statfs" = .no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#include + +int +main () +{ + + struct statfs sfs; + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: in " >&5 +$as_echo "in " >&6; } + +$as_echo "#define STATFS_IN_SYS_VFS 1" >>confdefs.h + + found_struct_statfs=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test ".$found_struct_statfs" = .no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_PARAM_H +#include +#endif +#include + +int +main () +{ + + struct statfs sfs; + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: in " >&5 +$as_echo "in " >&6; } + +$as_echo "#define STATFS_IN_SYS_MOUNT 1" >>confdefs.h + + found_struct_statfs=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test ".$found_struct_statfs" = Xno; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#include + +int +main () +{ + + struct statfs sfs; + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: in " >&5 +$as_echo "in " >&6; } + +$as_echo "#define STATFS_IN_SYS_STATFS 1" >>confdefs.h + + found_struct_statfs=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test ".$found_struct_statfs" = .no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: struct statfs not found" >&5 +$as_echo "$as_me: WARNING: struct statfs not found" >&2;} + fi + + if test ".$found_struct_statfs" = .yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for f_bavail member in struct statfs" >&5 +$as_echo_n "checking for f_bavail member in struct statfs... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if STATFS_IN_SYS_STATVFS +#include + typedef struct statvfs STATFS_t; +#else + typedef struct statfs STATFS_t; +#if STATFS_IN_SYS_VFS +#include +#elif STATFS_IN_SYS_MOUNT +#include +#elif STATFS_IN_SYS_STATFS +#include +#endif +#endif + +int +main () +{ + + STATFS_t sfs; + sfs.f_bavail = 0; + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define STATFS_HAS_F_BAVAIL 1" >>confdefs.h + + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + + if test ".$found_struct_statfs" = .yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if statfs(2) requires 4 arguments" >&5 +$as_echo_n "checking if statfs(2) requires 4 arguments... " >&6; } + if test "$cross_compiling" = yes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef STATFS_IN_SYS_VFS +#include +#elif STATFS_IN_SYS_MOUNT +#include +#elif STATFS_IN_SYS_STATFS +#include +#endif + main() { + struct statfs sfs; + exit (statfs(".", &sfs, sizeof(sfs), 0)); + } + + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define STAT_STATFS4 1" >>confdefs.h + + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + + +ac_fn_c_check_func "$LINENO" "setreuid" "ac_cv_func_setreuid" +if test "x$ac_cv_func_setreuid" = xyes; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setreuid in -lucb" >&5 +$as_echo_n "checking for setreuid in -lucb... " >&6; } +if ${ac_cv_lib_ucb_setreuid+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lucb $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char setreuid (); +int +main () +{ +return setreuid (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ucb_setreuid=yes +else + ac_cv_lib_ucb_setreuid=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ucb_setreuid" >&5 +$as_echo "$ac_cv_lib_ucb_setreuid" >&6; } +if test "x$ac_cv_lib_ucb_setreuid" = xyes; then : + if echo $LIBS | grep -- -lucb >/dev/null; then :; else LIBS="$LIBS -lc -lucb" USEUCB=y; fi +fi + +fi + +ac_fn_c_check_func "$LINENO" "rand" "ac_cv_func_rand" +if test "x$ac_cv_func_rand" = xyes; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rand in -lrand" >&5 +$as_echo_n "checking for rand in -lrand... " >&6; } +if ${ac_cv_lib_rand_rand+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrand $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char rand (); +int +main () +{ +return rand (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rand_rand=yes +else + ac_cv_lib_rand_rand=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rand_rand" >&5 +$as_echo "$ac_cv_lib_rand_rand" >&6; } +if test "x$ac_cv_lib_rand_rand" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBRAND 1 +_ACEOF + + LIBS="-lrand $LIBS" + +fi + +fi + +ac_fn_c_check_func "$LINENO" "getdomainname" "ac_cv_func_getdomainname" +if test "x$ac_cv_func_getdomainname" = xyes; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getdomainname in -lnsl" >&5 +$as_echo_n "checking for getdomainname in -lnsl... " >&6; } +if ${ac_cv_lib_nsl_getdomainname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char getdomainname (); +int +main () +{ +return getdomainname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nsl_getdomainname=yes +else + ac_cv_lib_nsl_getdomainname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_getdomainname" >&5 +$as_echo "$ac_cv_lib_nsl_getdomainname" >&6; } +if test "x$ac_cv_lib_nsl_getdomainname" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBNSL 1 +_ACEOF + + LIBS="-lnsl $LIBS" + +fi + +fi + +ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket" +if test "x$ac_cv_func_socket" = xyes; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 +$as_echo_n "checking for socket in -lsocket... " >&6; } +if ${ac_cv_lib_socket_socket+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char socket (); +int +main () +{ +return socket (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_socket_socket=yes +else + ac_cv_lib_socket_socket=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 +$as_echo "$ac_cv_lib_socket_socket" >&6; } +if test "x$ac_cv_lib_socket_socket" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSOCKET 1 +_ACEOF + + LIBS="-lsocket $LIBS" + +fi + +fi + + +ac_fn_c_check_func "$LINENO" "fdatasync" "ac_cv_func_fdatasync" +if test "x$ac_cv_func_fdatasync" = xyes; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fdatasync in -lrt" >&5 +$as_echo_n "checking for fdatasync in -lrt... " >&6; } +if ${ac_cv_lib_rt_fdatasync+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char fdatasync (); +int +main () +{ +return fdatasync (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rt_fdatasync=yes +else + ac_cv_lib_rt_fdatasync=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_fdatasync" >&5 +$as_echo "$ac_cv_lib_rt_fdatasync" >&6; } +if test "x$ac_cv_lib_rt_fdatasync" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBRT 1 +_ACEOF + + LIBS="-lrt $LIBS" + +fi + +fi + +ac_fn_c_check_func "$LINENO" "sched_yield" "ac_cv_func_sched_yield" +if test "x$ac_cv_func_sched_yield" = xyes; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5 +$as_echo_n "checking for sched_yield in -lrt... " >&6; } +if ${ac_cv_lib_rt_sched_yield+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sched_yield (); +int +main () +{ +return sched_yield (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rt_sched_yield=yes +else + ac_cv_lib_rt_sched_yield=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5 +$as_echo "$ac_cv_lib_rt_sched_yield" >&6; } +if test "x$ac_cv_lib_rt_sched_yield" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBRT 1 +_ACEOF + + LIBS="-lrt $LIBS" + +fi + +fi + +ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" +if test "x$ac_cv_func_clock_gettime" = xyes; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 +$as_echo_n "checking for clock_gettime in -lrt... " >&6; } +if ${ac_cv_lib_rt_clock_gettime+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (); +int +main () +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rt_clock_gettime=yes +else + ac_cv_lib_rt_clock_gettime=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 +$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } +if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBRT 1 +_ACEOF + + LIBS="-lrt $LIBS" + +fi + +fi + + +for ac_func in vsnprintf snprintf +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in strcoll strverscmp +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_header in error.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "error.h" "ac_cv_header_error_h" "$ac_includes_default" +if test "x$ac_cv_header_error_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ERROR_H 1 +_ACEOF + +fi + +done + +for ac_func in error +do : + ac_fn_c_check_func "$LINENO" "error" "ac_cv_func_error" +if test "x$ac_cv_func_error" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ERROR 1 +_ACEOF + +fi +done + + +for ac_header in search.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default" +if test "x$ac_cv_header_search_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SEARCH_H 1 +_ACEOF + +fi + +done + +ac_fn_c_check_func "$LINENO" "insque" "ac_cv_func_insque" +if test "x$ac_cv_func_insque" = xyes; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for insque in -lcompat" >&5 +$as_echo_n "checking for insque in -lcompat... " >&6; } +if ${ac_cv_lib_compat_insque+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcompat $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char insque (); +int +main () +{ +return insque (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_compat_insque=yes +else + ac_cv_lib_compat_insque=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_compat_insque" >&5 +$as_echo "$ac_cv_lib_compat_insque" >&6; } +if test "x$ac_cv_lib_compat_insque" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCOMPAT 1 +_ACEOF + + LIBS="-lcompat $LIBS" + +fi + +fi + + +WITH_PTHREADS=no + +# Check whether --with-pthreads was given. +if test "${with_pthreads+set}" = set; then : + withval=$with_pthreads; WITH_PTHREADS="$withval" +else + WITH_PTHREADS=yes +fi + +if test ".$WITH_PTHREADS" = .yes; then + +$as_echo "#define WITH_PTHREADS 1" >>confdefs.h + + for ac_header in thread.h pthread.h synch.h semaphore.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_trylock in -lpthread" >&5 +$as_echo_n "checking for pthread_mutex_trylock in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_pthread_mutex_trylock+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_mutex_trylock (); +int +main () +{ +return pthread_mutex_trylock (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pthread_pthread_mutex_trylock=yes +else + ac_cv_lib_pthread_pthread_mutex_trylock=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_trylock" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_mutex_trylock" >&6; } +if test "x$ac_cv_lib_pthread_pthread_mutex_trylock" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPTHREAD 1 +_ACEOF + + LIBS="-lpthread $LIBS" + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __pthread_mutex_trylock in -lpthread" >&5 +$as_echo_n "checking for __pthread_mutex_trylock in -lpthread... " >&6; } +if ${ac_cv_lib_pthread___pthread_mutex_trylock+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char __pthread_mutex_trylock (); +int +main () +{ +return __pthread_mutex_trylock (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pthread___pthread_mutex_trylock=yes +else + ac_cv_lib_pthread___pthread_mutex_trylock=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_mutex_trylock" >&5 +$as_echo "$ac_cv_lib_pthread___pthread_mutex_trylock" >&6; } +if test "x$ac_cv_lib_pthread___pthread_mutex_trylock" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPTHREAD 1 +_ACEOF + + LIBS="-lpthread $LIBS" + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mutex_lock in -lthread" >&5 +$as_echo_n "checking for mutex_lock in -lthread... " >&6; } +if ${ac_cv_lib_thread_mutex_lock+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char mutex_lock (); +int +main () +{ +return mutex_lock (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_thread_mutex_lock=yes +else + ac_cv_lib_thread_mutex_lock=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_thread_mutex_lock" >&5 +$as_echo "$ac_cv_lib_thread_mutex_lock" >&6; } +if test "x$ac_cv_lib_thread_mutex_lock" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBTHREAD 1 +_ACEOF + + LIBS="-lthread $LIBS" + +fi + + +fi + + +fi + +fi + +for ac_header in assert.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "assert.h" "ac_cv_header_assert_h" "$ac_includes_default" +if test "x$ac_cv_header_assert_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ASSERT_H 1 +_ACEOF + +fi + +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for writev in -lport" >&5 +$as_echo_n "checking for writev in -lport... " >&6; } +if ${ac_cv_lib_port_writev+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lport $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char writev (); +int +main () +{ +return writev (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_port_writev=yes +else + ac_cv_lib_port_writev=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_port_writev" >&5 +$as_echo "$ac_cv_lib_port_writev" >&6; } +if test "x$ac_cv_lib_port_writev" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPORT 1 +_ACEOF + + LIBS="-lport $LIBS" + +fi + + +case "$target" in + m68k-*-amigaos ) CFLAGS="$CFLAGS -Dfork=vfork" ;; +esac + +case "$host" in + *-*-darwin* ) LDFLAGS="$LDFLAGS -Wl,-search_paths_first" ;; +esac + +if echo "$target_os" | grep sco > /dev/null; then + +$as_echo "#define NEED_STRINGS_H 1" >>confdefs.h + + +$as_echo "#define HAVE_STRUCT_MNTTAB 1" >>confdefs.h + +elif echo "$target_os" | grep sunos > /dev/null; then + CFLAGS="$CFLAGS -D__USE_FIXED_PROTOTYPES__" + +$as_echo "#define NEED_STRINGS_H 1" >>confdefs.h + + +$as_echo "#define NEED_MYREALLOC 1" >>confdefs.h + + case " $LIBOBJS " in + *" myrealloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS myrealloc.$ac_objext" + ;; +esac + +fi + +PROVIDES_ERRNO=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if defines h_errno" >&5 +$as_echo_n "checking if defines h_errno... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +printf("%d",h_errno) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + PROVIDES_ERRNO=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROVIDES_ERRNO" >&5 +$as_echo "$PROVIDES_ERRNO" >&6; } +if test $PROVIDES_ERRNO = yes; then + +$as_echo "#define HAVE_HERRNO 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if defines S_IFSOCK" >&5 +$as_echo_n "checking if defines S_IFSOCK... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +printf("%d", S_IFSOCK) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + HAS_S_IFSOCK=yes +else + HAS_S_IFSOCK=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAS_S_IFSOCK" >&5 +$as_echo "$HAS_S_IFSOCK" >&6; } +if test $HAS_S_IFSOCK = yes; then + +$as_echo "#define HAVE_S_IFSOCK 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if defines S_ISLNK" >&5 +$as_echo_n "checking if defines S_ISLNK... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +printf("%d", S_ISLNK(0755)) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + HAS_S_ISLNK=yes +else + HAS_S_ISLNK=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAS_S_ISLNK" >&5 +$as_echo "$HAS_S_ISLNK" >&6; } +if test $HAS_S_ISLNK = yes; then + +$as_echo "#define HAVE_S_ISLNK 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if defines S_ISSOCK" >&5 +$as_echo_n "checking if defines S_ISSOCK... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +printf("%d", S_ISSOCK(0755)) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + HAS_S_ISSOCK=yes +else + HAS_S_ISSOCK=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAS_S_ISSOCK" >&5 +$as_echo "$HAS_S_ISSOCK" >&6; } +if test $HAS_S_ISSOCK = yes; then + +$as_echo "#define HAVE_S_ISSOCK 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if defines S_ISTXT" >&5 +$as_echo_n "checking if defines S_ISTXT... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +printf("%d", S_ISTXT) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + HAS_S_ISTXT=yes +else + HAS_S_ISTXT=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAS_S_ISTXT" >&5 +$as_echo "$HAS_S_ISTXT" >&6; } +if test $HAS_S_ISTXT = yes; then + +$as_echo "#define HAVE_S_ISTXT 1" >>confdefs.h + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if defines S_ISVTX" >&5 +$as_echo_n "checking if defines S_ISVTX... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +printf("%d", S_ISVTX) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + HAS_S_ISVTX=yes +else + HAS_S_ISVTX=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAS_S_ISVTX" >&5 +$as_echo "$HAS_S_ISVTX" >&6; } +if test $HAS_S_ISVTX = yes; then + +$as_echo "#define HAVE_S_ISVTX 1" >>confdefs.h + +fi + +# Find the best function to set timestamps. +for ac_func in futimens futimes futimesat utimes utime +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + break +fi +done + + +ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct stat" "st_uatime" "ac_cv_member_struct_stat_st_uatime" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_uatime" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_UATIME 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtime" "ac_cv_member_struct_stat_st_birthtime" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_birthtime" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct stat" "st_flags" "ac_cv_member_struct_stat_st_flags" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_flags" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_FLAGS 1 +_ACEOF + + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if timezone is defined" >&5 +$as_echo_n "checking if timezone is defined... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +printf("%ld", timezone) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + HAS_TIMEZONE=yes +else + HAS_TIMEZONE=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAS_TIMEZONE" >&5 +$as_echo "$HAS_TIMEZONE" >&6; } + +ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" +if test "x$ac_cv_type_mode_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define mode_t int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define pid_t int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + + +ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" +if test "x$ac_cv_type_long_long" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_LONG_LONG 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "long double" "ac_cv_type_long_double" "$ac_includes_default" +if test "x$ac_cv_type_long_double" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_LONG_DOUBLE 1 +_ACEOF + + +fi + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5 +$as_echo_n "checking size of char... " >&6; } +if ${ac_cv_sizeof_char+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_char" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (char) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_char=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5 +$as_echo "$ac_cv_sizeof_char" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_CHAR $ac_cv_sizeof_char +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned char" >&5 +$as_echo_n "checking size of unsigned char... " >&6; } +if ${ac_cv_sizeof_unsigned_char+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned char))" "ac_cv_sizeof_unsigned_char" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_unsigned_char" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (unsigned char) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_unsigned_char=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_char" >&5 +$as_echo "$ac_cv_sizeof_unsigned_char" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UNSIGNED_CHAR $ac_cv_sizeof_unsigned_char +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 +$as_echo_n "checking size of short... " >&6; } +if ${ac_cv_sizeof_short+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_short" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (short) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_short=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 +$as_echo "$ac_cv_sizeof_short" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SHORT $ac_cv_sizeof_short +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned short" >&5 +$as_echo_n "checking size of unsigned short... " >&6; } +if ${ac_cv_sizeof_unsigned_short+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned short))" "ac_cv_sizeof_unsigned_short" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_unsigned_short" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (unsigned short) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_unsigned_short=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_short" >&5 +$as_echo "$ac_cv_sizeof_unsigned_short" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UNSIGNED_SHORT $ac_cv_sizeof_unsigned_short +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } +if ${ac_cv_sizeof_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (int) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_int=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned int" >&5 +$as_echo_n "checking size of unsigned int... " >&6; } +if ${ac_cv_sizeof_unsigned_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned int))" "ac_cv_sizeof_unsigned_int" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_unsigned_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (unsigned int) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_unsigned_int=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_int" >&5 +$as_echo "$ac_cv_sizeof_unsigned_int" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UNSIGNED_INT $ac_cv_sizeof_unsigned_int +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long" >&5 +$as_echo_n "checking size of unsigned long... " >&6; } +if ${ac_cv_sizeof_unsigned_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long))" "ac_cv_sizeof_unsigned_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_unsigned_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (unsigned long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_unsigned_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long" >&5 +$as_echo "$ac_cv_sizeof_unsigned_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } +if ${ac_cv_sizeof_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long long" >&5 +$as_echo_n "checking size of unsigned long long... " >&6; } +if ${ac_cv_sizeof_unsigned_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long long))" "ac_cv_sizeof_unsigned_long_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_unsigned_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (unsigned long long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_unsigned_long_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long_long" >&5 +$as_echo "$ac_cv_sizeof_unsigned_long_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UNSIGNED_LONG_LONG $ac_cv_sizeof_unsigned_long_long +_ACEOF + + + +ac_fn_c_check_type "$LINENO" "sighanlder_t" "ac_cv_type_sighanlder_t" "$ac_includes_default" +if test "x$ac_cv_type_sighanlder_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIGHANLDER_T 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "sig_t" "ac_cv_type_sig_t" "$ac_includes_default" +if test "x$ac_cv_type_sig_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIG_T 1 +_ACEOF + + +fi + + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +$as_echo_n "checking for working alloca.h... " >&6; } +if ${ac_cv_working_alloca_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_working_alloca_h=yes +else + ac_cv_working_alloca_h=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +$as_echo "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then + +$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +$as_echo_n "checking for alloca... " >&6; } +if ${ac_cv_func_alloca_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# ifdef HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +void *alloca (size_t); +# endif +# endif +# endif +# endif +#endif + +int +main () +{ +char *p = (char *) alloca (1); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_func_alloca_works=yes +else + ac_cv_func_alloca_works=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +$as_echo "$ac_cv_func_alloca_works" >&6; } + +if test $ac_cv_func_alloca_works = yes; then + +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h + +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext + +$as_echo "#define C_ALLOCA 1" >>confdefs.h + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 +$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } +if ${ac_cv_os_cray+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined CRAY && ! defined CRAY2 +webecray +#else +wenotbecray +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "webecray" >/dev/null 2>&1; then : + ac_cv_os_cray=yes +else + ac_cv_os_cray=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 +$as_echo "$ac_cv_os_cray" >&6; } +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + +cat >>confdefs.h <<_ACEOF +#define CRAY_STACKSEG_END $ac_func +_ACEOF + + break +fi + + done +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +$as_echo_n "checking stack direction for C alloca... " >&6; } +if ${ac_cv_c_stack_direction+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_c_stack_direction=0 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +find_stack_direction () +{ + static char *addr = 0; + auto char dummy; + if (addr == 0) + { + addr = &dummy; + return find_stack_direction (); + } + else + return (&dummy > addr) ? 1 : -1; +} + +int +main () +{ + return find_stack_direction () < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_stack_direction=1 +else + ac_cv_c_stack_direction=-1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +$as_echo "$ac_cv_c_stack_direction" >&6; } +cat >>confdefs.h <<_ACEOF +#define STACK_DIRECTION $ac_cv_c_stack_direction +_ACEOF + + +fi + +for ac_func in vprintf +do : + ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" +if test "x$ac_cv_func_vprintf" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VPRINTF 1 +_ACEOF + +ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" +if test "x$ac_cv_func__doprnt" = xyes; then : + +$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h + +fi + +fi +done + + + + + + for ac_header in $ac_header_list +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + +for ac_func in getpagesize +do : + ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" +if test "x$ac_cv_func_getpagesize" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETPAGESIZE 1 +_ACEOF + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 +$as_echo_n "checking for working mmap... " >&6; } +if ${ac_cv_func_mmap_fixed_mapped+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_mmap_fixed_mapped=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +/* malloc might have been renamed as rpl_malloc. */ +#undef malloc + +/* Thanks to Mike Haertel and Jim Avera for this test. + Here is a matrix of mmap possibilities: + mmap private not fixed + mmap private fixed at somewhere currently unmapped + mmap private fixed at somewhere already mapped + mmap shared not fixed + mmap shared fixed at somewhere currently unmapped + mmap shared fixed at somewhere already mapped + For private mappings, we should verify that changes cannot be read() + back from the file, nor mmap's back from the file at a different + address. (There have been systems where private was not correctly + implemented like the infamous i386 svr4.0, and systems where the + VM page cache was not coherent with the file system buffer cache + like early versions of FreeBSD and possibly contemporary NetBSD.) + For shared mappings, we should conversely verify that changes get + propagated back to all the places they're supposed to be. + + Grep wants private fixed already mapped. + The main things grep needs to know about mmap are: + * does it exist and is it safe to write into the mmap'd area + * how to use it (BSD variants) */ + +#include +#include + +#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H +char *malloc (); +#endif + +/* This mess was copied from the GNU getpagesize.h. */ +#ifndef HAVE_GETPAGESIZE +# ifdef _SC_PAGESIZE +# define getpagesize() sysconf(_SC_PAGESIZE) +# else /* no _SC_PAGESIZE */ +# ifdef HAVE_SYS_PARAM_H +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else /* no EXEC_PAGESIZE */ +# ifdef NBPG +# define getpagesize() NBPG * CLSIZE +# ifndef CLSIZE +# define CLSIZE 1 +# endif /* no CLSIZE */ +# else /* no NBPG */ +# ifdef NBPC +# define getpagesize() NBPC +# else /* no NBPC */ +# ifdef PAGESIZE +# define getpagesize() PAGESIZE +# endif /* PAGESIZE */ +# endif /* no NBPC */ +# endif /* no NBPG */ +# endif /* no EXEC_PAGESIZE */ +# else /* no HAVE_SYS_PARAM_H */ +# define getpagesize() 8192 /* punt totally */ +# endif /* no HAVE_SYS_PARAM_H */ +# endif /* no _SC_PAGESIZE */ + +#endif /* no HAVE_GETPAGESIZE */ + +int +main () +{ + char *data, *data2, *data3; + const char *cdata2; + int i, pagesize; + int fd, fd2; + + pagesize = getpagesize (); + + /* First, make a file with some known garbage in it. */ + data = (char *) malloc (pagesize); + if (!data) + return 1; + for (i = 0; i < pagesize; ++i) + *(data + i) = rand (); + umask (0); + fd = creat ("conftest.mmap", 0600); + if (fd < 0) + return 2; + if (write (fd, data, pagesize) != pagesize) + return 3; + close (fd); + + /* Next, check that the tail of a page is zero-filled. File must have + non-zero length, otherwise we risk SIGBUS for entire page. */ + fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); + if (fd2 < 0) + return 4; + cdata2 = ""; + if (write (fd2, cdata2, 1) != 1) + return 5; + data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); + if (data2 == MAP_FAILED) + return 6; + for (i = 0; i < pagesize; ++i) + if (*(data2 + i)) + return 7; + close (fd2); + if (munmap (data2, pagesize)) + return 8; + + /* Next, try to mmap the file at a fixed address which already has + something else allocated at it. If we can, also make sure that + we see the same garbage. */ + fd = open ("conftest.mmap", O_RDWR); + if (fd < 0) + return 9; + if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + return 10; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + return 11; + + /* Finally, make sure that changes to the mapped area do not + percolate back to the file as seen by read(). (This is a bug on + some variants of i386 svr4.0.) */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = (char *) malloc (pagesize); + if (!data3) + return 12; + if (read (fd, data3, pagesize) != pagesize) + return 13; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + return 14; + close (fd); + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_mmap_fixed_mapped=yes +else + ac_cv_func_mmap_fixed_mapped=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 +$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } +if test $ac_cv_func_mmap_fixed_mapped = yes; then + +$as_echo "#define HAVE_MMAP 1" >>confdefs.h + +fi +rm -f conftest.mmap conftest.txt + + +for ac_func in asprintf basename chflags clearenv confstr fallocate fchflags fchmod ftok getaddrinfo getattrlist getcwd getdelim getline getmode getnameinfo getpassphrase getxattr getwd iconv inet_aton lchflags lchmod lchown lgetxattr lsetxattr lutimes madvise mempcpy mkdtemp mkstemp mtrace posix_fadvise posix_fallocate putenv realpath regcomp __secure_getenv setattrlist setenv setlocale setmode setxattr sigaddset sigdelset sigemptyset sighold sigrelse sigpause sigprocmask sigsuspend sigaction stpcpy stpncpy strcspn strdup strerror strmode strndup strspn strstr strtol strtoul +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in isalpha isdigit isprint isspace localtime memcmp memcpy memmove printf qsort raise rand strcasecmp strcat strchr strncat strncmp strrchr strsep time atoi atol getopt fclose fgetc fgets fopen fwrite +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +ac_fn_c_check_func "$LINENO" "getmntent" "ac_cv_func_getmntent" +if test "x$ac_cv_func_getmntent" = xyes; then : + +$as_echo "#define HAVE_GETMNTENT 1" >>confdefs.h + +else + + ac_fn_c_check_func "$LINENO" "mntctl" "ac_cv_func_mntctl" +if test "x$ac_cv_func_mntctl" = xyes; then : + +$as_echo "#define HAVE_MNTCTL 1" >>confdefs.h + +else + + ac_fn_c_check_func "$LINENO" "getmntinfo" "ac_cv_func_getmntinfo" +if test "x$ac_cv_func_getmntinfo" = xyes; then : + +$as_echo "#define HAVE_GETMNTINFO 1" >>confdefs.h + +else + + ac_fn_c_check_func "$LINENO" "getmntinfo_r" "ac_cv_func_getmntinfo_r" +if test "x$ac_cv_func_getmntinfo_r" = xyes; then : + +$as_echo "#define HAVE_GETMNTINFO_R 1" >>confdefs.h + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getmntinfo_r in -lc_r" >&5 +$as_echo_n "checking for getmntinfo_r in -lc_r... " >&6; } +if ${ac_cv_lib_c_r_getmntinfo_r+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc_r $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char getmntinfo_r (); +int +main () +{ +return getmntinfo_r (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_c_r_getmntinfo_r=yes +else + ac_cv_lib_c_r_getmntinfo_r=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_getmntinfo_r" >&5 +$as_echo "$ac_cv_lib_c_r_getmntinfo_r" >&6; } +if test "x$ac_cv_lib_c_r_getmntinfo_r" = xyes; then : + LIBS="$LIBS -lc_r"; + +$as_echo "#define HAVE_GETMNTINFO_R 1" >>confdefs.h + +else + + +$as_echo "#define USE_GETMNTENT 1" >>confdefs.h + + case " $LIBOBJS " in + *" getmntent.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS getmntent.$ac_objext" + ;; +esac + +fi + + +fi + + +fi + + +fi + + +fi + + +for ac_func in syslog +do : + ac_fn_c_check_func "$LINENO" "syslog" "ac_cv_func_syslog" +if test "x$ac_cv_func_syslog" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYSLOG 1 +_ACEOF + +fi +done + +if test $ac_cv_func_syslog = no; then + # syslog is not in the default libraries. See if it's in some other. + for lib in bsd socket inet; do + as_ac_Lib=`$as_echo "ac_cv_lib_$lib''_syslog" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for syslog in -l$lib" >&5 +$as_echo_n "checking for syslog in -l$lib... " >&6; } +if eval \${$as_ac_Lib+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-l$lib $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char syslog (); +int +main () +{ +return syslog (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_ac_Lib=yes" +else + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + $as_echo "#define HAVE_SYSLOG 1" >>confdefs.h + + LIBS="$LIBS -l$lib"; break +fi + + done +fi + +for ac_func in setproctitle +do : + ac_fn_c_check_func "$LINENO" "setproctitle" "ac_cv_func_setproctitle" +if test "x$ac_cv_func_setproctitle" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SETPROCTITLE 1 +_ACEOF + +fi +done + +if test $ac_cv_func_setproctitle = no; then + # setproctitle is not in the default libraries. See if it's in some other. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setproctitle in -lsetproctitle" >&5 +$as_echo_n "checking for setproctitle in -lsetproctitle... " >&6; } +if ${ac_cv_lib_setproctitle_setproctitle+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsetproctitle $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char setproctitle (); +int +main () +{ +return setproctitle (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_setproctitle_setproctitle=yes +else + ac_cv_lib_setproctitle_setproctitle=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_setproctitle_setproctitle" >&5 +$as_echo "$ac_cv_lib_setproctitle_setproctitle" >&6; } +if test "x$ac_cv_lib_setproctitle_setproctitle" = xyes; then : + $as_echo "#define HAVE_SETPROCTITLE 1" >>confdefs.h + + LIBS="$LIBS -lsetproctitle" +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to detect the amount of physical memory" >&5 +$as_echo_n "checking how to detect the amount of physical memory... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int +main() +{ + long i; + i = sysconf(_SC_PAGESIZE); + i = sysconf(_SC_PHYS_PAGES); + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + +$as_echo "#define HAVE_PHYSMEM_SYSCONF 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: sysconf" >&5 +$as_echo "sysconf" >&6; } + +else + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_SYS_PARAM_H +# include +#endif +#include +int +main() +{ + int name[2] = { CTL_HW, HW_PHYSMEM }; + unsigned long mem; + size_t mem_ptr_size = sizeof(mem); + sysctl(name, 2, &mem, &mem_ptr_size, NULL, NULL); + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + +$as_echo "#define HAVE_PHYSMEM_SYSCTL 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: sysctl" >&5 +$as_echo "sysctl" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5 +$as_echo "unknown" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to detect the number of available CPU cores" >&5 +$as_echo_n "checking how to detect the number of available CPU cores... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int +main() +{ + long i; + i = sysconf(_SC_NPROCESSORS_ONLN); + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + +$as_echo "#define HAVE_NCPU_SYSCONF 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: sysconf" >&5 +$as_echo "sysconf" >&6; } + +else + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_SYS_PARAM_H +# include +#endif +#include +int +main() +{ + int name[2] = { CTL_HW, HW_NCPU }; + int cpus; + size_t cpus_size = sizeof(cpus); + sysctl(name, 2, &cpus, &cpus_size, NULL, NULL); + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + +$as_echo "#define HAVE_NCPU_SYSCTL 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: sysctl" >&5 +$as_echo "sysctl" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5 +$as_echo "unknown" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + + $as_echo "" >&6 + $as_echo "=== THIRD-PARTY LIBRARIES (1/2) ===" >&6 + + +WITH_LIBELF_DEBUGEDIT="" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use libelf/gelf API" >&5 +$as_echo_n "checking whether to use libelf/gelf API... " >&6; } + +# Check whether --with-libelf was given. +if test "${with_libelf+set}" = set; then : + withval=$with_libelf; + if test ".$withval" = .yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + for ac_header in libelf.h gelf.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + if test ".$ac_cv_header_libelf_h" = .no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libelf.h conflicts with _LARGEFILE_SOURCE" >&5 +$as_echo_n "checking if libelf.h conflicts with _LARGEFILE_SOURCE... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#undef _LARGEFILE64_SOURCE +#undef _LARGEFILE_SOURCE +#if !defined(_LP64) +# undef _FILE_OFFSET_BITS +# define _FILE_OFFSET_BITS 32 +#endif +#include + +int +main () +{ + + Elf_Data foo; + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + +$as_echo "#define HAVE_LIBELF_H 1" >>confdefs.h + + ac_cv_header_libelf_h=yes + +$as_echo "#define LIBELF_H_LFS_CONFLICT 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test ".$ac_cv_header_gelf_h" = .no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gelf.h conflicts with _LARGEFILE_SOURCE" >&5 +$as_echo_n "checking if gelf.h conflicts with _LARGEFILE_SOURCE... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#undef _LARGEFILE64_SOURCE +#undef _LARGEFILE_SOURCE +#if !defined(_LP64) +# undef _FILE_OFFSET_BITS +# define _FILE_OFFSET_BITS 32 +#endif +#include + +int +main () +{ + + Elf32_Verdef foo; + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + +$as_echo "#define HAVE_GELF_H 1" >>confdefs.h + + ac_cv_header_gelf_h=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test ".$ac_cv_header_gelf_h" = .yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_version in -lelf" >&5 +$as_echo_n "checking for elf_version in -lelf... " >&6; } +if ${ac_cv_lib_elf_elf_version+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lelf $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char elf_version (); +int +main () +{ +return elf_version (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_elf_elf_version=yes +else + ac_cv_lib_elf_elf_version=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_elf_elf_version" >&5 +$as_echo "$ac_cv_lib_elf_elf_version" >&6; } +if test "x$ac_cv_lib_elf_elf_version" = xyes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gelf_getvernaux in -lelf" >&5 +$as_echo_n "checking for gelf_getvernaux in -lelf... " >&6; } +if ${ac_cv_lib_elf_gelf_getvernaux+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lelf $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gelf_getvernaux (); +int +main () +{ +return gelf_getvernaux (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_elf_gelf_getvernaux=yes +else + ac_cv_lib_elf_gelf_getvernaux=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_elf_gelf_getvernaux" >&5 +$as_echo "$ac_cv_lib_elf_gelf_getvernaux" >&6; } +if test "x$ac_cv_lib_elf_gelf_getvernaux" = xyes; then : + + +$as_echo "#define HAVE_GELF_GETVERNAUX 1" >>confdefs.h + + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gelf_getnote in -lelf" >&5 +$as_echo_n "checking for gelf_getnote in -lelf... " >&6; } +if ${ac_cv_lib_elf_gelf_getnote+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lelf $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gelf_getnote (); +int +main () +{ +return gelf_getnote (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_elf_gelf_getnote=yes +else + ac_cv_lib_elf_gelf_getnote=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_elf_gelf_getnote" >&5 +$as_echo "$ac_cv_lib_elf_gelf_getnote" >&6; } +if test "x$ac_cv_lib_elf_gelf_getnote" = xyes; then : + + +$as_echo "#define HAVE_GELF_GETNOTE 1" >>confdefs.h + + +fi + + +$as_echo "#define HAVE_LIBELF 1" >>confdefs.h + + WITH_LIBELF_DEBUGEDIT="debugedit" + LIBS="$LIBS -lelf" + +fi + + else + as_fn_error $? "libelf/gelf API requested but not found or not usable" "$LINENO" 5 + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + + + +WITH_PERL_SUBDIR="" +WITH_PERL_SUBPACKAGE=0 +WITH_PERL_LIBS="" +if test ".$WITH_PTHREADS" = .yes; then + WITH_PERL_LIBS="$LIBS" +fi + +# Check whether --with-perl was given. +if test "${with_perl+set}" = set; then : + withval=$with_perl; + if test ".$withval" != .no; then + PERL_INSTALLDIRS="" + if test "$withval" == "vendor"; then + PERL_INSTALLDIRS="'INSTALLDIRS' => 'vendor'," + fi + if test "$withval" == "site"; then + PERL_INSTALLDIRS="'INSTALLDIRS' => 'site'," + fi + +cat >>confdefs.h <<_ACEOF +#define PERL_INSTALLDIRS $PERL_INSTALLDIRS +_ACEOF + + + WITH_PERL_SUBDIR=perl + WITH_PERL_SUBPACKAGE=1 + ac_config_files="$ac_config_files perl/Makefile.PL" + + ac_config_files="$ac_config_files perl/Makefile" + + fi + +fi + + + + + +WITH_PERL_URPM_SUBDIR="" +WITH_PERL_URPM_SUBPACKAGE=0 +WITH_PERL_URPM_LIBS="" +if test ".$WITH_PTHREADS" = .yes; then + WITH_PERL_URPM_LIBS="$LIBS" +fi + +# Check whether --with-perl-urpm was given. +if test "${with_perl_urpm+set}" = set; then : + withval=$with_perl_urpm; + if test ".$withval" != .no; then + PERL_URPM_INSTALLDIRS="" + if test "$withval" == "vendor"; then + PERL_URPM_INSTALLDIRS="'INSTALLDIRS' => 'vendor'," + fi + if test "$withval" == "site"; then + PERL_URPM_INSTALLDIRS="'INSTALLDIRS' => 'site'," + fi + +cat >>confdefs.h <<_ACEOF +#define PERL_URPM_INSTALLDIRS $PERL_URPM_INSTALLDIRS +_ACEOF + + + WITH_PERL_URPM_SUBDIR=perl-URPM + WITH_PERL_URPM_SUBPACKAGE=1 + ac_config_files="$ac_config_files perl-URPM/Makefile.PL" + + ac_config_files="$ac_config_files perl-URPM/Makefile" + + fi + +fi + + + + + +WITH_PYTHON_SUBDIR="" +WITH_PYTHON_SUBPACKAGE=0 +WITH_PYTHON_INCDIR="" + +PYTHON="" +PYTHON_VERSION="" +PYTHON_PREFIX="" +PYTHON_EXEC_PREFIX="" +#PYTHON_PLATFORM="" +pythondir="" +pkgpythondir="" +pyexecdir="" +pkgpyexecdir="" + + +# Check whether --with-python was given. +if test "${with_python+set}" = set; then : + withval=$with_python; + if test ".$withval" != .no; then + case "$withval" in + 2.x|2.3|2.4|2.5|2.6|2.7) + python_version=$withval + ;; + yes) + python_version="2.7 2.6 2.5 2.4 2.3 2.x" + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-python only supports values \"2.x\", \"2.3\", \"2.4\", \"2.5\", \"2.6\" or \"2.7\" ignoring..." >&5 +$as_echo "$as_me: WARNING: --with-python only supports values \"2.x\", \"2.3\", \"2.4\", \"2.5\", \"2.6\" or \"2.7\" ignoring..." >&2;} + python_version="" + ;; + esac + for python_ver in $python_version ; do + if test "$python_ver" != "2.x" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python ${python_ver} API" >&5 +$as_echo_n "checking for Python ${python_ver} API... " >&6; } + save_CFLAGS="${CFLAGS}" + for i in "$prefix" "/usr/local" "/usr"; do + CFLAGS="${save_CFLAGS} -I$i/include/python${python_ver}" + if test "$cross_compiling" = yes; then : + + if test "$withval" = "$python_ver"; then + PYTHON_VERSION="${python_ver}" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + break + fi + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "Python.h" + main() { exit(strncmp("${python_ver}", PY_VERSION, 3)); } + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + + PYTHON_VERSION="${python_ver}" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + PYTHON_PREFIX="${i}" + break + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + done + CFLAGS="${save_CFLAGS}" + if test ".$PYTHON_VERSION" == "."; then + save_CFLAGS="${CFLAGS}" + for f in "~" "" "/System" "/Network"; do + CFLAGS="${save_CFLAGS} -I$f/Library/Frameworks/Python.framework/Versions/${python_ver}/include/python${python_ver}" + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "Python.h" + main() { exit(strncmp("${python_ver}", PY_VERSION, 3)); } + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + + PYTHON_VERSION="${python_ver}" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (using Python.framework)" >&5 +$as_echo "yes (using Python.framework)" >&6; } + PYTHON_PREFIX="$f/Library/Frameworks/Python.framework/Versions/${python_ver}" + break + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + done + CFLAGS="${save_CFLAGS}" + fi + if test ".$PYTHON_VERSION" == "."; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python 2.x API" >&5 +$as_echo_n "checking for Python 2.x API... " >&6; } + if test "$cross_compiling" = yes; then : + + if test "$withval" = "$python_ver"; then + PYTHON_VERSION="${python_ver}" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + main() { exit(strncmp("2.", PY_VERSION, 2)); } + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + + PYTHON_VERSION="" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + if test ".$PYTHON_VERSION" != "."; then + WITH_PYTHON_SUBDIR=python + WITH_PYTHON_SUBPACKAGE=1 + break + fi + done + fi + +# Check whether --with-python-inc-dir was given. +if test "${with_python_inc_dir+set}" = set; then : + withval=$with_python_inc_dir; WITH_PYTHON_INCDIR="$withval" +else + WITH_PYTHON_INCDIR="`(${__PYTHON} -c 'from distutils.sysconfig import get_python_inc; print get_python_inc()') 2>/dev/null`" +fi + + +# Check whether --with-python-lib-dir was given. +if test "${with_python_lib_dir+set}" = set; then : + withval=$with_python_lib_dir; pythondir="$withval" +else + pythondir="`(${__PYTHON} -c 'from distutils.sysconfig import get_python_lib; print get_python_lib(1)') 2>/dev/null`" +fi + + +fi + + + + + +if test ".$pythondir" != "."; then + PYTHON="${__PYTHON}" + PYTHON_PREFIX="\${prefix}" + PYTHON_EXEC_PREFIX="\${exec_prefix}" +# PYTHON_PLATFORM="???" + pkgpythondir="\${pythondir}/\${PACKAGE}" + pyexecdir="\${pythondir}" + pkgpyexecdir="\${pyexecdir}/\${PACKAGE}" +fi + + + + + +#AC_SUBST(PYTHON_PLATFORM) + + + + + + + + $as_echo "" >&6 + $as_echo "=== THIRD-PARTY LIBRARIES (2/2) ===" >&6 + + + + + + + + + + if test ".${with_popt+set}" != .set; then + with_popt="yes" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-popt=$with_popt" >&6 + fi + + fi + if test ".${with_popt}" = .yes; then + with_popt="internal:external" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-popt=yes to --with-popt=\"$with_popt\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_popt="" + __rcl_location_last="" + + WITH_POPT_SUBDIR="" + WITH_POPT_CPPFLAGS="" + WITH_POPT_LDFLAGS="" + WITH_POPT_LIBS="" + + +# Check whether --with-popt was given. +if test "${with_popt+set}" = set; then : + withval=$with_popt; if test ".${with_popt}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_popt}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + elif test ".${__rcl_location}" = .internal; then + + if test -d ${srcdir}/popt; then + + if test ".$verbose" = .yes; then + $as_echo "-- activating local sub-directory: popt" >&6 + fi + + if test -f ${srcdir}/popt/configure; then + subdirs="$subdirs popt" + + fi + WITH_POPT_SUBDIR="popt" + __rcl_location_popt=internal + + if test ".$verbose" = .yes; then + $as_echo "++ post-adjustments for --with-popt (${__rcl_location_popt})" >&6 + fi + + __rcl_dirs_inc=`echo 'popt' | sed -e 's/^[^:]*://' -e 's/:[^:]*$//'` + __rcl_dirs_lib=`echo 'popt' | sed -e 's/^[^:]*:[^:]*://'` + __rcl_srcdir="\$(top_srcdir)/\$(WITH_POPT_SUBDIR)" + __rcl_builddir="\$(top_builddir)/\$(WITH_POPT_SUBDIR)" + __rcl_firstlib="popt" + if test ".${__rcl_dirs_inc}" != ".popt"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_POPT_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}" >&6 + fi + + WITH_POPT_CPPFLAGS="${WITH_POPT_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_POPT_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_POPT_CPPFLAGS="${WITH_POPT_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_POPT_CPPFLAGS: -I${__rcl_srcdir}" >&6 + fi + + WITH_POPT_CPPFLAGS="${WITH_POPT_CPPFLAGS} -I${__rcl_srcdir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_POPT_CPPFLAGS: -I${__rcl_builddir}" >&6 + fi + + WITH_POPT_CPPFLAGS="${WITH_POPT_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".popt"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_POPT_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_POPT_LDFLAGS="${WITH_POPT_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_POPT_LDFLAGS: -L${__rcl_builddir}" >&6 + fi + + WITH_POPT_LDFLAGS="${WITH_POPT_LDFLAGS} -L${__rcl_builddir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_POPT_LIBS: -l${__rcl_firstlib}" >&6 + fi + + WITH_POPT_LIBS="${WITH_POPT_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory popt" + break + else + + if test ".$verbose" = .yes; then + $as_echo "-- skipping not existing local sub-directory: popt" >&6 + fi + + fi + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists popt || pkg-config --exists libpopt) 2>/dev/null; then + + if (pkg-config --exists popt) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config popt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config popt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config popt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config popt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config popt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config popt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config popt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config popt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config popt" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libpopt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libpopt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libpopt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libpopt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libpopt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libpopt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libpopt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libpopt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libpopt" + fi + break + elif test ".`(popt-config --version; libpopt-config --version) 2>/dev/null`" != .; then + + if test ".`(popt-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(popt-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(popt-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(popt-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(popt-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via popt-config" + else + + __rcl_flags="`(libpopt-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libpopt-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libpopt-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libpopt-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libpopt-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lpopt ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char poptGetContext (); +int +main () +{ +return poptGetContext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lpopt ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char poptGetContext (); +int +main () +{ +return poptGetContext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/popt-config" && test ! -f "${__rcl_dir}/popt-config.in"; then + if test ".`(${__rcl_dir}/popt-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/popt-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/popt-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/popt-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/popt-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/popt-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libpopt-config" && test ! -f "${__rcl_dir}/libpopt-config.in"; then + if test ".`(${__rcl_dir}/libpopt-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libpopt-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libpopt-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libpopt-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libpopt-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libpopt-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists popt) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config popt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config popt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config popt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config popt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config popt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config popt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config popt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config popt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config popt" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libpopt) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libpopt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libpopt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libpopt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libpopt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libpopt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libpopt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libpopt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libpopt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libpopt" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/popt ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/popt.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/popt ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libpopt.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libpopt.a" || \ + test -f "${__rcl_dir}/libpopt.so" || \ + test -f "${__rcl_dir}/libpopt.sl" || \ + test -f "${__rcl_dir}/libpopt.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "popt.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libpopt.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + if test ".${__rcl_location_last}" = .internal; then + with_popt=yes + if test ".${__rcl_location_popt}" != .internal; then + as_fn_error $? "unable to find internal POPT library" "$LINENO" 5 + fi + else + __rcl_found=yes + for ac_header in popt.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "popt.h" "ac_cv_header_popt_h" "$ac_includes_default" +if test "x$ac_cv_header_popt_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_POPT_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for poptGetContext in -lpopt" >&5 +$as_echo_n "checking for poptGetContext in -lpopt... " >&6; } +if ${ac_cv_lib_popt_poptGetContext+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpopt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char poptGetContext (); +int +main () +{ +return poptGetContext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_popt_poptGetContext=yes +else + ac_cv_lib_popt_poptGetContext=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_popt_poptGetContext" >&5 +$as_echo "$ac_cv_lib_popt_poptGetContext" >&6; } +if test "x$ac_cv_lib_popt_poptGetContext" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPOPT 1 +_ACEOF + + LIBS="-lpopt $LIBS" + +fi + + test ".${ac_cv_lib_popt_poptGetContext}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_popt=${__rcl_found} + fi + if test ".${with_popt}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_popt}" = .yes; then + +$as_echo "#define WITH_POPT 1" >>confdefs.h + + fi + WITH_POPT="${with_popt}" + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with POPT library" >&5 +$as_echo_n "checking whether to build with POPT library... " >&6; } + __rcl_msg="${with_popt}" + if test ".${with_popt}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_popt}" = .yes; then + +$as_echo "#define WITH_POPT 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + : + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + as_fn_error $? "mandatory POPT library not found" "$LINENO" 5 + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + +HAVE_RPM_COMPRESSION=no + + + + + + if test ".${with_zlib+set}" != .set; then + with_zlib="yes" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-zlib=$with_zlib" >&6 + fi + + fi + if test ".${with_zlib}" = .yes; then + with_zlib="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-zlib=yes to --with-zlib=\"$with_zlib\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_zlib="" + __rcl_location_last="" + + WITH_ZLIB_SUBDIR="" + WITH_ZLIB_CPPFLAGS="" + WITH_ZLIB_LDFLAGS="" + WITH_ZLIB_LIBS="" + + +# Check whether --with-zlib was given. +if test "${with_zlib+set}" = set; then : + withval=$with_zlib; if test ".${with_zlib}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_zlib}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + elif test ".${__rcl_location}" = .internal; then + + if test -d ${srcdir}/zlib; then + + if test ".$verbose" = .yes; then + $as_echo "-- activating local sub-directory: zlib" >&6 + fi + + if test -f ${srcdir}/zlib/configure; then + subdirs="$subdirs zlib" + + fi + WITH_ZLIB_SUBDIR="zlib" + __rcl_location_zlib=internal + + if test ".$verbose" = .yes; then + $as_echo "++ post-adjustments for --with-zlib (${__rcl_location_zlib})" >&6 + fi + + __rcl_dirs_inc=`echo 'zlib' | sed -e 's/^[^:]*://' -e 's/:[^:]*$//'` + __rcl_dirs_lib=`echo 'zlib' | sed -e 's/^[^:]*:[^:]*://'` + __rcl_srcdir="\$(top_srcdir)/\$(WITH_ZLIB_SUBDIR)" + __rcl_builddir="\$(top_builddir)/\$(WITH_ZLIB_SUBDIR)" + __rcl_firstlib="z" + if test ".${__rcl_dirs_inc}" != ".zlib"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_ZLIB_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}" >&6 + fi + + WITH_ZLIB_CPPFLAGS="${WITH_ZLIB_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_ZLIB_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_ZLIB_CPPFLAGS="${WITH_ZLIB_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_ZLIB_CPPFLAGS: -I${__rcl_srcdir}" >&6 + fi + + WITH_ZLIB_CPPFLAGS="${WITH_ZLIB_CPPFLAGS} -I${__rcl_srcdir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_ZLIB_CPPFLAGS: -I${__rcl_builddir}" >&6 + fi + + WITH_ZLIB_CPPFLAGS="${WITH_ZLIB_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".zlib"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_ZLIB_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_ZLIB_LDFLAGS="${WITH_ZLIB_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_ZLIB_LDFLAGS: -L${__rcl_builddir}" >&6 + fi + + WITH_ZLIB_LDFLAGS="${WITH_ZLIB_LDFLAGS} -L${__rcl_builddir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_ZLIB_LIBS: -l${__rcl_firstlib}" >&6 + fi + + WITH_ZLIB_LIBS="${WITH_ZLIB_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory zlib" + break + else + + if test ".$verbose" = .yes; then + $as_echo "-- skipping not existing local sub-directory: zlib" >&6 + fi + + fi + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists zlib || pkg-config --exists libzlib) 2>/dev/null; then + + if (pkg-config --exists zlib) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config zlib $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config zlib $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config zlib $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config zlib $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config zlib $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config zlib $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config zlib $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config zlib $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config zlib" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libzlib $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libzlib $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libzlib $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libzlib $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libzlib $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libzlib $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libzlib $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libzlib $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libzlib" + fi + break + elif test ".`(zlib-config --version; libzlib-config --version) 2>/dev/null`" != .; then + + if test ".`(zlib-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(zlib-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(zlib-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(zlib-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(zlib-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via zlib-config" + else + + __rcl_flags="`(libzlib-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libzlib-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libzlib-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libzlib-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libzlib-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lz ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gzread (); +int +main () +{ +return gzread (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lgz ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gzread (); +int +main () +{ +return gzread (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lz ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gzread (); +int +main () +{ +return gzread (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lgz ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gzread (); +int +main () +{ +return gzread (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/zlib-config" && test ! -f "${__rcl_dir}/zlib-config.in"; then + if test ".`(${__rcl_dir}/zlib-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/zlib-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/zlib-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/zlib-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/zlib-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/zlib-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libzlib-config" && test ! -f "${__rcl_dir}/libzlib-config.in"; then + if test ".`(${__rcl_dir}/libzlib-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libzlib-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libzlib-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libzlib-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libzlib-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libzlib-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists zlib) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config zlib $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config zlib $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config zlib $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config zlib $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config zlib $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config zlib $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config zlib $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config zlib $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config zlib" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libzlib) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libzlib $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libzlib $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libzlib $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libzlib $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libzlib $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libzlib $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libzlib $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libzlib $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libzlib" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/zlib ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/zlib.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/zlib ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libz.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libz.a" || \ + test -f "${__rcl_dir}/libz.so" || \ + test -f "${__rcl_dir}/libz.sl" || \ + test -f "${__rcl_dir}/libz.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + if test -f "${__rcl_dir}/libgz.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libgz.a" || \ + test -f "${__rcl_dir}/libgz.so" || \ + test -f "${__rcl_dir}/libgz.sl" || \ + test -f "${__rcl_dir}/libgz.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "zlib.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libz.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + for __rcl_file in _ `find ${__rcl_location} -name "libgz.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + if test ".${__rcl_location_last}" = .internal; then + with_zlib=yes + if test ".${__rcl_location_zlib}" != .internal; then + as_fn_error $? "unable to find internal ZLib library" "$LINENO" 5 + fi + else + __rcl_found=yes + for ac_header in zlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" +if test "x$ac_cv_header_zlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ZLIB_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzread in -lz" >&5 +$as_echo_n "checking for gzread in -lz... " >&6; } +if ${ac_cv_lib_z_gzread+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gzread (); +int +main () +{ +return gzread (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_gzread=yes +else + ac_cv_lib_z_gzread=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzread" >&5 +$as_echo "$ac_cv_lib_z_gzread" >&6; } +if test "x$ac_cv_lib_z_gzread" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBZ 1 +_ACEOF + + LIBS="-lz $LIBS" + +fi + + test ".${ac_cv_lib_z_gzread}" = .yes && __rcl_found_lib=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzread in -lgz" >&5 +$as_echo_n "checking for gzread in -lgz... " >&6; } +if ${ac_cv_lib_gz_gzread+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gzread (); +int +main () +{ +return gzread (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_gz_gzread=yes +else + ac_cv_lib_gz_gzread=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gz_gzread" >&5 +$as_echo "$ac_cv_lib_gz_gzread" >&6; } +if test "x$ac_cv_lib_gz_gzread" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBGZ 1 +_ACEOF + + LIBS="-lgz $LIBS" + +fi + + test ".${ac_cv_lib_gz_gzread}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_zlib=${__rcl_found} + fi + if test ".${with_zlib}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_zlib}" = .yes; then + +$as_echo "#define WITH_ZLIB 1" >>confdefs.h + + fi + WITH_ZLIB="${with_zlib}" + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with ZLib library" >&5 +$as_echo_n "checking whether to build with ZLib library... " >&6; } + __rcl_msg="${with_zlib}" + if test ".${with_zlib}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_zlib}" = .yes; then + +$as_echo "#define WITH_ZLIB 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + ac_fn_c_check_func "$LINENO" "gzseek" "ac_cv_func_gzseek" +if test "x$ac_cv_func_gzseek" = xyes; then : + +fi + + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + +$as_echo "#define HAVE_ZLIB_H 1" >>confdefs.h + + fi + HAVE_RPM_COMPRESSION=yes + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable ZLib library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + if test ".${with_bzip2+set}" != .set; then + with_bzip2="yes" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-bzip2=$with_bzip2" >&6 + fi + + fi + if test ".${with_bzip2}" = .yes; then + with_bzip2="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-bzip2=yes to --with-bzip2=\"$with_bzip2\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_bzip2="" + __rcl_location_last="" + + +# Check whether --with-bzip2 was given. +if test "${with_bzip2+set}" = set; then : + withval=$with_bzip2; if test ".${with_bzip2}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_bzip2}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists bzip2 || pkg-config --exists libbzip2) 2>/dev/null; then + + if (pkg-config --exists bzip2) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config bzip2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config bzip2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config bzip2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config bzip2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config bzip2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config bzip2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config bzip2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config bzip2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config bzip2" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libbzip2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libbzip2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libbzip2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libbzip2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libbzip2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libbzip2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libbzip2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libbzip2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libbzip2" + fi + break + elif test ".`(bzip2-config --version; libbzip2-config --version) 2>/dev/null`" != .; then + + if test ".`(bzip2-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(bzip2-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(bzip2-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(bzip2-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(bzip2-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via bzip2-config" + else + + __rcl_flags="`(libbzip2-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libbzip2-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libbzip2-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libbzip2-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libbzip2-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lbz2 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char BZ2_bzread (); +int +main () +{ +return BZ2_bzread (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lbz2 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char BZ2_bzread (); +int +main () +{ +return BZ2_bzread (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/bzip2-config" && test ! -f "${__rcl_dir}/bzip2-config.in"; then + if test ".`(${__rcl_dir}/bzip2-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/bzip2-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/bzip2-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/bzip2-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/bzip2-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/bzip2-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libbzip2-config" && test ! -f "${__rcl_dir}/libbzip2-config.in"; then + if test ".`(${__rcl_dir}/libbzip2-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libbzip2-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libbzip2-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libbzip2-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libbzip2-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libbzip2-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists bzip2) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config bzip2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config bzip2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config bzip2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config bzip2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config bzip2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config bzip2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config bzip2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config bzip2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config bzip2" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libbzip2) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libbzip2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libbzip2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libbzip2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libbzip2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libbzip2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libbzip2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libbzip2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libbzip2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libbzip2" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/bzip2 ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/bzlib.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/bzip2 ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libbz2.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libbz2.a" || \ + test -f "${__rcl_dir}/libbz2.so" || \ + test -f "${__rcl_dir}/libbz2.sl" || \ + test -f "${__rcl_dir}/libbz2.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "bzlib.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libbz2.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in bzlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default" +if test "x$ac_cv_header_bzlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BZLIB_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzread in -lbz2" >&5 +$as_echo_n "checking for BZ2_bzread in -lbz2... " >&6; } +if ${ac_cv_lib_bz2_BZ2_bzread+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbz2 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char BZ2_bzread (); +int +main () +{ +return BZ2_bzread (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_bz2_BZ2_bzread=yes +else + ac_cv_lib_bz2_BZ2_bzread=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzread" >&5 +$as_echo "$ac_cv_lib_bz2_BZ2_bzread" >&6; } +if test "x$ac_cv_lib_bz2_BZ2_bzread" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBBZ2 1 +_ACEOF + + LIBS="-lbz2 $LIBS" + +fi + + test ".${ac_cv_lib_bz2_BZ2_bzread}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_bzip2=${__rcl_found} + + if test ".${with_bzip2}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_bzip2}" = .yes; then + +$as_echo "#define WITH_BZIP2 1" >>confdefs.h + + fi + WITH_BZIP2="${with_bzip2}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with GNU BZip2 library" >&5 +$as_echo_n "checking whether to build with GNU BZip2 library... " >&6; } + __rcl_msg="${with_bzip2}" + if test ".${with_bzip2}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_bzip2}" = .yes; then + +$as_echo "#define WITH_BZIP2 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + + HAVE_RPM_COMPRESSION=yes + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable GNU BZip2 library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + +WITH_XZ_INTERNAL=false + + + + + + if test ".${with_xz+set}" != .set; then + with_xz="yes" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-xz=$with_xz" >&6 + fi + + fi + if test ".${with_xz}" = .yes; then + with_xz="external:internal:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-xz=yes to --with-xz=\"$with_xz\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_xz="" + __rcl_location_last="" + + WITH_XZ_SUBDIR="" + WITH_XZ_CPPFLAGS="" + WITH_XZ_LDFLAGS="" + WITH_XZ_LIBS="" + + +# Check whether --with-xz was given. +if test "${with_xz+set}" = set; then : + withval=$with_xz; if test ".${with_xz}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_xz}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + elif test ".${__rcl_location}" = .internal; then + + if test -d ${srcdir}/xz; then + + if test ".$verbose" = .yes; then + $as_echo "-- activating local sub-directory: xz" >&6 + fi + + if test -f ${srcdir}/xz/configure; then + subdirs="$subdirs xz" + + fi + WITH_XZ_SUBDIR="xz" + __rcl_location_xz=internal + + if test ".$verbose" = .yes; then + $as_echo "++ post-adjustments for --with-xz (${__rcl_location_xz})" >&6 + fi + + __rcl_dirs_inc=`echo 'xz:src/liblzma/api:src/liblzma' | sed -e 's/^[^:]*://' -e 's/:[^:]*$//'` + __rcl_dirs_lib=`echo 'xz:src/liblzma/api:src/liblzma' | sed -e 's/^[^:]*:[^:]*://'` + __rcl_srcdir="\$(top_srcdir)/\$(WITH_XZ_SUBDIR)" + __rcl_builddir="\$(top_builddir)/\$(WITH_XZ_SUBDIR)" + __rcl_firstlib="lzma" + if test ".${__rcl_dirs_inc}" != ".xz:src/liblzma/api:src/liblzma"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_XZ_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}" >&6 + fi + + WITH_XZ_CPPFLAGS="${WITH_XZ_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_XZ_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_XZ_CPPFLAGS="${WITH_XZ_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_XZ_CPPFLAGS: -I${__rcl_srcdir}" >&6 + fi + + WITH_XZ_CPPFLAGS="${WITH_XZ_CPPFLAGS} -I${__rcl_srcdir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_XZ_CPPFLAGS: -I${__rcl_builddir}" >&6 + fi + + WITH_XZ_CPPFLAGS="${WITH_XZ_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".xz:src/liblzma/api:src/liblzma"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_XZ_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_XZ_LDFLAGS="${WITH_XZ_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_XZ_LDFLAGS: -L${__rcl_builddir}" >&6 + fi + + WITH_XZ_LDFLAGS="${WITH_XZ_LDFLAGS} -L${__rcl_builddir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_XZ_LIBS: -l${__rcl_firstlib}" >&6 + fi + + WITH_XZ_LIBS="${WITH_XZ_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory xz" + break + else + + if test ".$verbose" = .yes; then + $as_echo "-- skipping not existing local sub-directory: xz" >&6 + fi + + fi + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists xz || pkg-config --exists libxz) 2>/dev/null; then + + if (pkg-config --exists xz) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config xz $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config xz $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config xz $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config xz $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config xz $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config xz $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config xz $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config xz $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config xz" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libxz $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libxz $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libxz $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libxz $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libxz $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libxz $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libxz $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libxz $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libxz" + fi + break + elif test ".`(xz-config --version; libxz-config --version) 2>/dev/null`" != .; then + + if test ".`(xz-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(xz-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(xz-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(xz-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(xz-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via xz-config" + else + + __rcl_flags="`(libxz-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libxz-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libxz-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libxz-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libxz-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-llzma ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char lzma_auto_decoder (); +int +main () +{ +return lzma_auto_decoder (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-llzma ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char lzma_auto_decoder (); +int +main () +{ +return lzma_auto_decoder (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/xz-config" && test ! -f "${__rcl_dir}/xz-config.in"; then + if test ".`(${__rcl_dir}/xz-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/xz-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/xz-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/xz-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/xz-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/xz-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libxz-config" && test ! -f "${__rcl_dir}/libxz-config.in"; then + if test ".`(${__rcl_dir}/libxz-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libxz-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libxz-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libxz-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libxz-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libxz-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists xz) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config xz $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config xz $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config xz $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config xz $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config xz $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config xz $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config xz $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config xz $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config xz" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libxz) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libxz $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libxz $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libxz $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libxz $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libxz $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libxz $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libxz $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libxz $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libxz" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/xz ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/lzma.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/xz ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/liblzma.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/liblzma.a" || \ + test -f "${__rcl_dir}/liblzma.so" || \ + test -f "${__rcl_dir}/liblzma.sl" || \ + test -f "${__rcl_dir}/liblzma.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "lzma.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "liblzma.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + if test ".${__rcl_location_last}" = .internal; then + with_xz=yes + if test ".${__rcl_location_xz}" != .internal; then + as_fn_error $? "unable to find internal XZ libLZMA library" "$LINENO" 5 + fi + else + __rcl_found=yes + for ac_header in lzma.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default" +if test "x$ac_cv_header_lzma_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LZMA_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_auto_decoder in -llzma" >&5 +$as_echo_n "checking for lzma_auto_decoder in -llzma... " >&6; } +if ${ac_cv_lib_lzma_lzma_auto_decoder+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-llzma $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char lzma_auto_decoder (); +int +main () +{ +return lzma_auto_decoder (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_lzma_lzma_auto_decoder=yes +else + ac_cv_lib_lzma_lzma_auto_decoder=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_auto_decoder" >&5 +$as_echo "$ac_cv_lib_lzma_lzma_auto_decoder" >&6; } +if test "x$ac_cv_lib_lzma_lzma_auto_decoder" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBLZMA 1 +_ACEOF + + LIBS="-llzma $LIBS" + +fi + + test ".${ac_cv_lib_lzma_lzma_auto_decoder}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_xz=${__rcl_found} + fi + if test ".${with_xz}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_xz}" = .yes; then + +$as_echo "#define WITH_XZ 1" >>confdefs.h + + fi + WITH_XZ="${with_xz}" + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with XZ libLZMA library" >&5 +$as_echo_n "checking whether to build with XZ libLZMA library... " >&6; } + __rcl_msg="${with_xz}" + if test ".${with_xz}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_xz}" = .yes; then + +$as_echo "#define WITH_XZ 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + WITH_XZ_INTERNAL=true + +$as_echo "#define HAVE_LZMA_H 1" >>confdefs.h + + fi + HAVE_RPM_COMPRESSION=yes + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable XZ libLZMA library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + +if test ".$HAVE_RPM_COMPRESSION" = .no; then + as_fn_error $? "you have passed --without-{xz,bzip2,zlib} together but it isn't possible to build rpm without any form of compression library. At a minimum, i suggest adding --with-zlib if you want to actually build and install a *.rpm package" "$LINENO" 5 +fi + + + + + + + if test ".${with_beecrypt+set}" != .set; then + with_beecrypt="yes" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-beecrypt=$with_beecrypt" >&6 + fi + + fi + if test ".${with_beecrypt}" = .yes; then + with_beecrypt="internal:external" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-beecrypt=yes to --with-beecrypt=\"$with_beecrypt\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_beecrypt="" + __rcl_location_last="" + + WITH_BEECRYPT_SUBDIR="" + WITH_BEECRYPT_CPPFLAGS="" + WITH_BEECRYPT_LDFLAGS="" + WITH_BEECRYPT_LIBS="" + + +# Check whether --with-beecrypt was given. +if test "${with_beecrypt+set}" = set; then : + withval=$with_beecrypt; if test ".${with_beecrypt}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_beecrypt}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + elif test ".${__rcl_location}" = .internal; then + + if test -d ${srcdir}/beecrypt; then + + if test ".$verbose" = .yes; then + $as_echo "-- activating local sub-directory: beecrypt" >&6 + fi + + if test -f ${srcdir}/beecrypt/configure; then + subdirs="$subdirs beecrypt" + + fi + WITH_BEECRYPT_SUBDIR="beecrypt" + __rcl_location_beecrypt=internal + + if test ".$verbose" = .yes; then + $as_echo "++ post-adjustments for --with-beecrypt (${__rcl_location_beecrypt})" >&6 + fi + + __rcl_dirs_inc=`echo 'beecrypt:include' | sed -e 's/^[^:]*://' -e 's/:[^:]*$//'` + __rcl_dirs_lib=`echo 'beecrypt:include' | sed -e 's/^[^:]*:[^:]*://'` + __rcl_srcdir="\$(top_srcdir)/\$(WITH_BEECRYPT_SUBDIR)" + __rcl_builddir="\$(top_builddir)/\$(WITH_BEECRYPT_SUBDIR)" + __rcl_firstlib="beecrypt" + if test ".${__rcl_dirs_inc}" != ".beecrypt:include"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_BEECRYPT_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}" >&6 + fi + + WITH_BEECRYPT_CPPFLAGS="${WITH_BEECRYPT_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_BEECRYPT_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_BEECRYPT_CPPFLAGS="${WITH_BEECRYPT_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_BEECRYPT_CPPFLAGS: -I${__rcl_srcdir}" >&6 + fi + + WITH_BEECRYPT_CPPFLAGS="${WITH_BEECRYPT_CPPFLAGS} -I${__rcl_srcdir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_BEECRYPT_CPPFLAGS: -I${__rcl_builddir}" >&6 + fi + + WITH_BEECRYPT_CPPFLAGS="${WITH_BEECRYPT_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".beecrypt:include"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_BEECRYPT_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_BEECRYPT_LDFLAGS="${WITH_BEECRYPT_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_BEECRYPT_LDFLAGS: -L${__rcl_builddir}" >&6 + fi + + WITH_BEECRYPT_LDFLAGS="${WITH_BEECRYPT_LDFLAGS} -L${__rcl_builddir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_BEECRYPT_LIBS: -l${__rcl_firstlib}" >&6 + fi + + WITH_BEECRYPT_LIBS="${WITH_BEECRYPT_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory beecrypt" + break + else + + if test ".$verbose" = .yes; then + $as_echo "-- skipping not existing local sub-directory: beecrypt" >&6 + fi + + fi + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists beecrypt || pkg-config --exists libbeecrypt) 2>/dev/null; then + + if (pkg-config --exists beecrypt) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config beecrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config beecrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config beecrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config beecrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config beecrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config beecrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config beecrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config beecrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config beecrypt" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libbeecrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libbeecrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libbeecrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libbeecrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libbeecrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libbeecrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libbeecrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libbeecrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libbeecrypt" + fi + break + elif test ".`(beecrypt-config --version; libbeecrypt-config --version) 2>/dev/null`" != .; then + + if test ".`(beecrypt-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(beecrypt-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(beecrypt-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(beecrypt-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(beecrypt-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via beecrypt-config" + else + + __rcl_flags="`(libbeecrypt-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libbeecrypt-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libbeecrypt-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libbeecrypt-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libbeecrypt-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lbeecrypt ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char mpfprintln (); +int +main () +{ +return mpfprintln (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lbeecrypt ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char mpfprintln (); +int +main () +{ +return mpfprintln (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/beecrypt-config" && test ! -f "${__rcl_dir}/beecrypt-config.in"; then + if test ".`(${__rcl_dir}/beecrypt-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/beecrypt-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/beecrypt-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/beecrypt-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/beecrypt-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/beecrypt-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libbeecrypt-config" && test ! -f "${__rcl_dir}/libbeecrypt-config.in"; then + if test ".`(${__rcl_dir}/libbeecrypt-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libbeecrypt-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libbeecrypt-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libbeecrypt-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libbeecrypt-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libbeecrypt-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists beecrypt) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config beecrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config beecrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config beecrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config beecrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config beecrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config beecrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config beecrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config beecrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config beecrypt" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libbeecrypt) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libbeecrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libbeecrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libbeecrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libbeecrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libbeecrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libbeecrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libbeecrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libbeecrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libbeecrypt" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/beecrypt ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/beecrypt/api.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/beecrypt ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libbeecrypt.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libbeecrypt.a" || \ + test -f "${__rcl_dir}/libbeecrypt.so" || \ + test -f "${__rcl_dir}/libbeecrypt.sl" || \ + test -f "${__rcl_dir}/libbeecrypt.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "beecrypt/api.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libbeecrypt.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + if test ".${__rcl_location_last}" = .internal; then + with_beecrypt=yes + if test ".${__rcl_location_beecrypt}" != .internal; then + as_fn_error $? "unable to find internal BeeCrypt library" "$LINENO" 5 + fi + else + __rcl_found=yes + for ac_header in beecrypt/api.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "beecrypt/api.h" "ac_cv_header_beecrypt_api_h" "$ac_includes_default" +if test "x$ac_cv_header_beecrypt_api_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BEECRYPT_API_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpfprintln in -lbeecrypt" >&5 +$as_echo_n "checking for mpfprintln in -lbeecrypt... " >&6; } +if ${ac_cv_lib_beecrypt_mpfprintln+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbeecrypt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char mpfprintln (); +int +main () +{ +return mpfprintln (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_beecrypt_mpfprintln=yes +else + ac_cv_lib_beecrypt_mpfprintln=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_beecrypt_mpfprintln" >&5 +$as_echo "$ac_cv_lib_beecrypt_mpfprintln" >&6; } +if test "x$ac_cv_lib_beecrypt_mpfprintln" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBBEECRYPT 1 +_ACEOF + + LIBS="-lbeecrypt $LIBS" + +fi + + test ".${ac_cv_lib_beecrypt_mpfprintln}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_beecrypt=${__rcl_found} + fi + if test ".${with_beecrypt}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_beecrypt}" = .yes; then + +$as_echo "#define WITH_BEECRYPT 1" >>confdefs.h + + fi + WITH_BEECRYPT="${with_beecrypt}" + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with BeeCrypt library" >&5 +$as_echo_n "checking whether to build with BeeCrypt library... " >&6; } + __rcl_msg="${with_beecrypt}" + if test ".${with_beecrypt}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_beecrypt}" = .yes; then + +$as_echo "#define WITH_BEECRYPT 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + : + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + as_fn_error $? "mandatory BeeCrypt library not found" "$LINENO" 5 + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + if test ".$WITH_BEECRYPT" = .no; then + as_fn_error $? "BEECRYPT is mandatory" "$LINENO" 5 + fi + + + + + + + if test ".${with_gcrypt+set}" != .set; then + with_gcrypt="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-gcrypt=$with_gcrypt" >&6 + fi + + fi + if test ".${with_gcrypt}" = .yes; then + with_gcrypt="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-gcrypt=yes to --with-gcrypt=\"$with_gcrypt\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_gcrypt="" + __rcl_location_last="" + + +# Check whether --with-gcrypt was given. +if test "${with_gcrypt+set}" = set; then : + withval=$with_gcrypt; if test ".${with_gcrypt}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_gcrypt}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists gcrypt || pkg-config --exists libgcrypt) 2>/dev/null; then + + if (pkg-config --exists gcrypt) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config gcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config gcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config gcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config gcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config gcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config gcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config gcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config gcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config gcrypt" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libgcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libgcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libgcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libgcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libgcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libgcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libgcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libgcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libgcrypt" + fi + break + elif test ".`(gcrypt-config --version; libgcrypt-config --version) 2>/dev/null`" != .; then + + if test ".`(gcrypt-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(gcrypt-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(gcrypt-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(gcrypt-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(gcrypt-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via gcrypt-config" + else + + __rcl_flags="`(libgcrypt-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libgcrypt-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libgcrypt-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libgcrypt-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libgcrypt-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lgcrypt ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gcry_pk_verify (); +int +main () +{ +return gcry_pk_verify (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lgcrypt ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gcry_pk_verify (); +int +main () +{ +return gcry_pk_verify (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/gcrypt-config" && test ! -f "${__rcl_dir}/gcrypt-config.in"; then + if test ".`(${__rcl_dir}/gcrypt-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/gcrypt-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/gcrypt-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/gcrypt-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/gcrypt-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/gcrypt-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libgcrypt-config" && test ! -f "${__rcl_dir}/libgcrypt-config.in"; then + if test ".`(${__rcl_dir}/libgcrypt-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libgcrypt-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libgcrypt-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libgcrypt-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libgcrypt-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libgcrypt-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists gcrypt) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config gcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config gcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config gcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config gcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config gcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config gcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config gcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config gcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config gcrypt" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libgcrypt) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libgcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libgcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libgcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libgcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libgcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libgcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libgcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libgcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libgcrypt" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/gcrypt ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/gcrypt.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/gcrypt ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libgcrypt.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libgcrypt.a" || \ + test -f "${__rcl_dir}/libgcrypt.so" || \ + test -f "${__rcl_dir}/libgcrypt.sl" || \ + test -f "${__rcl_dir}/libgcrypt.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "gcrypt.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libgcrypt.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in gcrypt.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "gcrypt.h" "ac_cv_header_gcrypt_h" "$ac_includes_default" +if test "x$ac_cv_header_gcrypt_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GCRYPT_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_pk_verify in -lgcrypt" >&5 +$as_echo_n "checking for gcry_pk_verify in -lgcrypt... " >&6; } +if ${ac_cv_lib_gcrypt_gcry_pk_verify+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgcrypt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gcry_pk_verify (); +int +main () +{ +return gcry_pk_verify (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_gcrypt_gcry_pk_verify=yes +else + ac_cv_lib_gcrypt_gcry_pk_verify=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcrypt_gcry_pk_verify" >&5 +$as_echo "$ac_cv_lib_gcrypt_gcry_pk_verify" >&6; } +if test "x$ac_cv_lib_gcrypt_gcry_pk_verify" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBGCRYPT 1 +_ACEOF + + LIBS="-lgcrypt $LIBS" + +fi + + test ".${ac_cv_lib_gcrypt_gcry_pk_verify}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_gcrypt=${__rcl_found} + + if test ".${with_gcrypt}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_gcrypt}" = .yes; then + +$as_echo "#define WITH_GCRYPT 1" >>confdefs.h + + fi + WITH_GCRYPT="${with_gcrypt}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with GCrypt library" >&5 +$as_echo_n "checking whether to build with GCrypt library... " >&6; } + __rcl_msg="${with_gcrypt}" + if test ".${with_gcrypt}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_gcrypt}" = .yes; then + +$as_echo "#define WITH_GCRYPT 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + +$as_echo "#define WITH_GCRYPT 1" >>confdefs.h + + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable GCrypt library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + if test ".${with_nss+set}" != .set; then + with_nss="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-nss=$with_nss" >&6 + fi + + fi + if test ".${with_nss}" = .yes; then + with_nss="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-nss=yes to --with-nss=\"$with_nss\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_nss="" + __rcl_location_last="" + + +# Check whether --with-nss was given. +if test "${with_nss+set}" = set; then : + withval=$with_nss; if test ".${with_nss}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_nss}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists nss || pkg-config --exists libnss) 2>/dev/null; then + + if (pkg-config --exists nss) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config nss $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config nss $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config nss $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config nss $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config nss $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config nss $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config nss $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config nss $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config nss" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libnss $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libnss $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libnss $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libnss $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libnss $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libnss $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libnss $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libnss $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libnss" + fi + break + elif test ".`(nss-config --version; libnss-config --version) 2>/dev/null`" != .; then + + if test ".`(nss-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(nss-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(nss-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(nss-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(nss-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via nss-config" + else + + __rcl_flags="`(libnss-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libnss-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libnss-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libnss-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libnss-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lnss3 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char NSS_NoDB_Init (); +int +main () +{ +return NSS_NoDB_Init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lnss ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char NSS_NoDB_Init (); +int +main () +{ +return NSS_NoDB_Init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lnss3 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char NSS_NoDB_Init (); +int +main () +{ +return NSS_NoDB_Init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lnss ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char NSS_NoDB_Init (); +int +main () +{ +return NSS_NoDB_Init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/nss-config" && test ! -f "${__rcl_dir}/nss-config.in"; then + if test ".`(${__rcl_dir}/nss-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/nss-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/nss-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/nss-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/nss-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/nss-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libnss-config" && test ! -f "${__rcl_dir}/libnss-config.in"; then + if test ".`(${__rcl_dir}/libnss-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libnss-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libnss-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libnss-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libnss-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libnss-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists nss) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config nss $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config nss $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config nss $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config nss $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config nss $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config nss $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config nss $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config nss $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config nss" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libnss) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libnss $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libnss $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libnss $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libnss $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libnss $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libnss $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libnss $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libnss $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libnss" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/nss ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/nss.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/nss ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libnss3.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libnss3.a" || \ + test -f "${__rcl_dir}/libnss3.so" || \ + test -f "${__rcl_dir}/libnss3.sl" || \ + test -f "${__rcl_dir}/libnss3.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + if test -f "${__rcl_dir}/libnss.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libnss.a" || \ + test -f "${__rcl_dir}/libnss.so" || \ + test -f "${__rcl_dir}/libnss.sl" || \ + test -f "${__rcl_dir}/libnss.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "nss.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libnss3.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + for __rcl_file in _ `find ${__rcl_location} -name "libnss.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in nss.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "nss.h" "ac_cv_header_nss_h" "$ac_includes_default" +if test "x$ac_cv_header_nss_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NSS_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NSS_NoDB_Init in -lnss3" >&5 +$as_echo_n "checking for NSS_NoDB_Init in -lnss3... " >&6; } +if ${ac_cv_lib_nss3_NSS_NoDB_Init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnss3 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char NSS_NoDB_Init (); +int +main () +{ +return NSS_NoDB_Init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nss3_NSS_NoDB_Init=yes +else + ac_cv_lib_nss3_NSS_NoDB_Init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nss3_NSS_NoDB_Init" >&5 +$as_echo "$ac_cv_lib_nss3_NSS_NoDB_Init" >&6; } +if test "x$ac_cv_lib_nss3_NSS_NoDB_Init" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBNSS3 1 +_ACEOF + + LIBS="-lnss3 $LIBS" + +fi + + test ".${ac_cv_lib_nss3_NSS_NoDB_Init}" = .yes && __rcl_found_lib=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NSS_NoDB_Init in -lnss" >&5 +$as_echo_n "checking for NSS_NoDB_Init in -lnss... " >&6; } +if ${ac_cv_lib_nss_NSS_NoDB_Init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnss $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char NSS_NoDB_Init (); +int +main () +{ +return NSS_NoDB_Init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nss_NSS_NoDB_Init=yes +else + ac_cv_lib_nss_NSS_NoDB_Init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nss_NSS_NoDB_Init" >&5 +$as_echo "$ac_cv_lib_nss_NSS_NoDB_Init" >&6; } +if test "x$ac_cv_lib_nss_NSS_NoDB_Init" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBNSS 1 +_ACEOF + + LIBS="-lnss $LIBS" + +fi + + test ".${ac_cv_lib_nss_NSS_NoDB_Init}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_nss=${__rcl_found} + + if test ".${with_nss}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_nss}" = .yes; then + +$as_echo "#define WITH_NSS 1" >>confdefs.h + + fi + WITH_NSS="${with_nss}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Mozilla NSS library" >&5 +$as_echo_n "checking whether to build with Mozilla NSS library... " >&6; } + __rcl_msg="${with_nss}" + if test ".${with_nss}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_nss}" = .yes; then + +$as_echo "#define WITH_NSS 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + +$as_echo "#define WITH_NSS 1" >>confdefs.h + + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Mozilla NSS library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + if test ".${with_openssl+set}" != .set; then + with_openssl="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-openssl=$with_openssl" >&6 + fi + + fi + if test ".${with_openssl}" = .yes; then + with_openssl="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-openssl=yes to --with-openssl=\"$with_openssl\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_openssl="" + __rcl_location_last="" + + +# Check whether --with-openssl was given. +if test "${with_openssl+set}" = set; then : + withval=$with_openssl; if test ".${with_openssl}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_openssl}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists openssl || pkg-config --exists libopenssl) 2>/dev/null; then + + if (pkg-config --exists openssl) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config openssl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config openssl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config openssl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config openssl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config openssl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config openssl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config openssl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config openssl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config openssl" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libopenssl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libopenssl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libopenssl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libopenssl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libopenssl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libopenssl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libopenssl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libopenssl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libopenssl" + fi + break + elif test ".`(openssl-config --version; libopenssl-config --version) 2>/dev/null`" != .; then + + if test ".`(openssl-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(openssl-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(openssl-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(openssl-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(openssl-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via openssl-config" + else + + __rcl_flags="`(libopenssl-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libopenssl-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libopenssl-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libopenssl-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libopenssl-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lcrypto ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ERR_load_CRYPTO_strings (); +int +main () +{ +return ERR_load_CRYPTO_strings (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lcrypto ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ERR_load_CRYPTO_strings (); +int +main () +{ +return ERR_load_CRYPTO_strings (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/openssl-config" && test ! -f "${__rcl_dir}/openssl-config.in"; then + if test ".`(${__rcl_dir}/openssl-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/openssl-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/openssl-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/openssl-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/openssl-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/openssl-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libopenssl-config" && test ! -f "${__rcl_dir}/libopenssl-config.in"; then + if test ".`(${__rcl_dir}/libopenssl-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libopenssl-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libopenssl-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libopenssl-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libopenssl-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libopenssl-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists openssl) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config openssl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config openssl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config openssl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config openssl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config openssl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config openssl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config openssl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config openssl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config openssl" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libopenssl) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libopenssl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libopenssl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libopenssl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libopenssl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libopenssl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libopenssl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libopenssl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libopenssl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libopenssl" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/openssl ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/openssl/crypto.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/openssl ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libcrypto.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libcrypto.a" || \ + test -f "${__rcl_dir}/libcrypto.so" || \ + test -f "${__rcl_dir}/libcrypto.sl" || \ + test -f "${__rcl_dir}/libcrypto.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "openssl/crypto.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libcrypto.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in openssl/crypto.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "openssl/crypto.h" "ac_cv_header_openssl_crypto_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_crypto_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_OPENSSL_CRYPTO_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ERR_load_CRYPTO_strings in -lcrypto" >&5 +$as_echo_n "checking for ERR_load_CRYPTO_strings in -lcrypto... " >&6; } +if ${ac_cv_lib_crypto_ERR_load_CRYPTO_strings+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ERR_load_CRYPTO_strings (); +int +main () +{ +return ERR_load_CRYPTO_strings (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_crypto_ERR_load_CRYPTO_strings=yes +else + ac_cv_lib_crypto_ERR_load_CRYPTO_strings=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_load_CRYPTO_strings" >&5 +$as_echo "$ac_cv_lib_crypto_ERR_load_CRYPTO_strings" >&6; } +if test "x$ac_cv_lib_crypto_ERR_load_CRYPTO_strings" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCRYPTO 1 +_ACEOF + + LIBS="-lcrypto $LIBS" + +fi + + test ".${ac_cv_lib_crypto_ERR_load_CRYPTO_strings}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_openssl=${__rcl_found} + + if test ".${with_openssl}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_openssl}" = .yes; then + +$as_echo "#define WITH_OPENSSL 1" >>confdefs.h + + fi + WITH_OPENSSL="${with_openssl}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with OpenSSL library" >&5 +$as_echo_n "checking whether to build with OpenSSL library... " >&6; } + __rcl_msg="${with_openssl}" + if test ".${with_openssl}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_openssl}" = .yes; then + +$as_echo "#define WITH_OPENSSL 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + +$as_echo "#define WITH_SSL 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RSA_generate_key_ex in -lopenssl" >&5 +$as_echo_n "checking for RSA_generate_key_ex in -lopenssl... " >&6; } +if ${ac_cv_lib_openssl_RSA_generate_key_ex+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lopenssl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char RSA_generate_key_ex (); +int +main () +{ +return RSA_generate_key_ex (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_openssl_RSA_generate_key_ex=yes +else + ac_cv_lib_openssl_RSA_generate_key_ex=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_openssl_RSA_generate_key_ex" >&5 +$as_echo "$ac_cv_lib_openssl_RSA_generate_key_ex" >&6; } +if test "x$ac_cv_lib_openssl_RSA_generate_key_ex" = xyes; then : + + +$as_echo "#define HAVE_RSA_GENERATE_KEY_EX 1" >>confdefs.h + + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DSA_generate_parameters_ex in -lopenssl" >&5 +$as_echo_n "checking for DSA_generate_parameters_ex in -lopenssl... " >&6; } +if ${ac_cv_lib_openssl_DSA_generate_parameters_ex+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lopenssl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char DSA_generate_parameters_ex (); +int +main () +{ +return DSA_generate_parameters_ex (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_openssl_DSA_generate_parameters_ex=yes +else + ac_cv_lib_openssl_DSA_generate_parameters_ex=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_openssl_DSA_generate_parameters_ex" >&5 +$as_echo "$ac_cv_lib_openssl_DSA_generate_parameters_ex" >&6; } +if test "x$ac_cv_lib_openssl_DSA_generate_parameters_ex" = xyes; then : + + +$as_echo "#define HAVE_DSA_GENERATE_PARAMETERS_EX 1" >>confdefs.h + + +fi + + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable OpenSSL library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + if test ".${with_tomcrypt+set}" != .set; then + with_tomcrypt="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-tomcrypt=$with_tomcrypt" >&6 + fi + + fi + if test ".${with_tomcrypt}" = .yes; then + with_tomcrypt="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-tomcrypt=yes to --with-tomcrypt=\"$with_tomcrypt\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_tomcrypt="" + __rcl_location_last="" + + +# Check whether --with-tomcrypt was given. +if test "${with_tomcrypt+set}" = set; then : + withval=$with_tomcrypt; if test ".${with_tomcrypt}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_tomcrypt}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists tomcrypt || pkg-config --exists libtomcrypt) 2>/dev/null; then + + if (pkg-config --exists tomcrypt) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config tomcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config tomcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config tomcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config tomcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config tomcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config tomcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config tomcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config tomcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config tomcrypt" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libtomcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libtomcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libtomcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libtomcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libtomcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libtomcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libtomcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libtomcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libtomcrypt" + fi + break + elif test ".`(tomcrypt-config --version; libtomcrypt-config --version) 2>/dev/null`" != .; then + + if test ".`(tomcrypt-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(tomcrypt-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(tomcrypt-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(tomcrypt-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(tomcrypt-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via tomcrypt-config" + else + + __rcl_flags="`(libtomcrypt-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libtomcrypt-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libtomcrypt-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libtomcrypt-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libtomcrypt-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-ltomcrypt ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ltc_init_multi (); +int +main () +{ +return ltc_init_multi (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-ltomcrypt ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ltc_init_multi (); +int +main () +{ +return ltc_init_multi (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/tomcrypt-config" && test ! -f "${__rcl_dir}/tomcrypt-config.in"; then + if test ".`(${__rcl_dir}/tomcrypt-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/tomcrypt-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/tomcrypt-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/tomcrypt-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/tomcrypt-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/tomcrypt-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libtomcrypt-config" && test ! -f "${__rcl_dir}/libtomcrypt-config.in"; then + if test ".`(${__rcl_dir}/libtomcrypt-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libtomcrypt-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libtomcrypt-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libtomcrypt-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libtomcrypt-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libtomcrypt-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists tomcrypt) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config tomcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config tomcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config tomcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config tomcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config tomcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config tomcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config tomcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config tomcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config tomcrypt" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libtomcrypt) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libtomcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libtomcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libtomcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libtomcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libtomcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libtomcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libtomcrypt $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libtomcrypt $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libtomcrypt" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/tomcrypt ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/tomcrypt/tomcrypt_cfg.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/tomcrypt ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libtomcrypt.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libtomcrypt.a" || \ + test -f "${__rcl_dir}/libtomcrypt.so" || \ + test -f "${__rcl_dir}/libtomcrypt.sl" || \ + test -f "${__rcl_dir}/libtomcrypt.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "tomcrypt/tomcrypt_cfg.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libtomcrypt.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in tomcrypt/tomcrypt_cfg.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "tomcrypt/tomcrypt_cfg.h" "ac_cv_header_tomcrypt_tomcrypt_cfg_h" "$ac_includes_default" +if test "x$ac_cv_header_tomcrypt_tomcrypt_cfg_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_TOMCRYPT_TOMCRYPT_CFG_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ltc_init_multi in -ltomcrypt" >&5 +$as_echo_n "checking for ltc_init_multi in -ltomcrypt... " >&6; } +if ${ac_cv_lib_tomcrypt_ltc_init_multi+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltomcrypt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ltc_init_multi (); +int +main () +{ +return ltc_init_multi (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_tomcrypt_ltc_init_multi=yes +else + ac_cv_lib_tomcrypt_ltc_init_multi=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tomcrypt_ltc_init_multi" >&5 +$as_echo "$ac_cv_lib_tomcrypt_ltc_init_multi" >&6; } +if test "x$ac_cv_lib_tomcrypt_ltc_init_multi" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBTOMCRYPT 1 +_ACEOF + + LIBS="-ltomcrypt $LIBS" + +fi + + test ".${ac_cv_lib_tomcrypt_ltc_init_multi}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_tomcrypt=${__rcl_found} + + if test ".${with_tomcrypt}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_tomcrypt}" = .yes; then + +$as_echo "#define WITH_TOMCRYPT 1" >>confdefs.h + + fi + WITH_TOMCRYPT="${with_tomcrypt}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with TomCrypt library" >&5 +$as_echo_n "checking whether to build with TomCrypt library... " >&6; } + __rcl_msg="${with_tomcrypt}" + if test ".${with_tomcrypt}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_tomcrypt}" = .yes; then + +$as_echo "#define WITH_TOMCRYPT 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + +$as_echo "#define WITH_TOMCRYPT 1" >>confdefs.h + + CPPFLAGS="$CPPFLAGS -DLTM_DESC -I${includedir}/tomcrypt -I${includedir}/tommath" + LIBS="$LIBS -ltommath" + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable TomCrypt library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + if test ".${with_tpm+set}" != .set; then + with_tpm="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-tpm=$with_tpm" >&6 + fi + + fi + if test ".${with_tpm}" = .yes; then + with_tpm="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-tpm=yes to --with-tpm=\"$with_tpm\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_tpm="" + __rcl_location_last="" + + +# Check whether --with-tpm was given. +if test "${with_tpm+set}" = set; then : + withval=$with_tpm; if test ".${with_tpm}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_tpm}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists tpm || pkg-config --exists libtpm) 2>/dev/null; then + + if (pkg-config --exists tpm) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config tpm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config tpm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config tpm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config tpm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config tpm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config tpm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config tpm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config tpm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config tpm" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libtpm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libtpm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libtpm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libtpm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libtpm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libtpm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libtpm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libtpm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libtpm" + fi + break + elif test ".`(tpm-config --version; libtpm-config --version) 2>/dev/null`" != .; then + + if test ".`(tpm-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(tpm-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(tpm-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(tpm-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(tpm-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via tpm-config" + else + + __rcl_flags="`(libtpm-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libtpm-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libtpm-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libtpm-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libtpm-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-ltpm ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char TPM_Init (); +int +main () +{ +return TPM_Init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-ltpm ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char TPM_Init (); +int +main () +{ +return TPM_Init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/tpm-config" && test ! -f "${__rcl_dir}/tpm-config.in"; then + if test ".`(${__rcl_dir}/tpm-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/tpm-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/tpm-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/tpm-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/tpm-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/tpm-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libtpm-config" && test ! -f "${__rcl_dir}/libtpm-config.in"; then + if test ".`(${__rcl_dir}/libtpm-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libtpm-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libtpm-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libtpm-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libtpm-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libtpm-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists tpm) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config tpm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config tpm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config tpm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config tpm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config tpm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config tpm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config tpm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config tpm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config tpm" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libtpm) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libtpm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libtpm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libtpm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libtpm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libtpm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libtpm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libtpm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libtpm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libtpm" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/tpm ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/tpm.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/tpm ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libtpm.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libtpm.a" || \ + test -f "${__rcl_dir}/libtpm.so" || \ + test -f "${__rcl_dir}/libtpm.sl" || \ + test -f "${__rcl_dir}/libtpm.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "tpm.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libtpm.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in tpm.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "tpm.h" "ac_cv_header_tpm_h" "$ac_includes_default" +if test "x$ac_cv_header_tpm_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_TPM_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TPM_Init in -ltpm" >&5 +$as_echo_n "checking for TPM_Init in -ltpm... " >&6; } +if ${ac_cv_lib_tpm_TPM_Init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltpm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char TPM_Init (); +int +main () +{ +return TPM_Init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_tpm_TPM_Init=yes +else + ac_cv_lib_tpm_TPM_Init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tpm_TPM_Init" >&5 +$as_echo "$ac_cv_lib_tpm_TPM_Init" >&6; } +if test "x$ac_cv_lib_tpm_TPM_Init" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBTPM 1 +_ACEOF + + LIBS="-ltpm $LIBS" + +fi + + test ".${ac_cv_lib_tpm_TPM_Init}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_tpm=${__rcl_found} + + if test ".${with_tpm}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_tpm}" = .yes; then + +$as_echo "#define WITH_TPM 1" >>confdefs.h + + fi + WITH_TPM="${with_tpm}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with IBM TPM library" >&5 +$as_echo_n "checking whether to build with IBM TPM library... " >&6; } + __rcl_msg="${with_tpm}" + if test ".${with_tpm}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_tpm}" = .yes; then + +$as_echo "#define WITH_TPM 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + +$as_echo "#define WITH_TPM 1" >>confdefs.h + + if true; then + WITH_TPM_TRUE= + WITH_TPM_FALSE='#' +else + WITH_TPM_TRUE='#' + WITH_TPM_FALSE= +fi + + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if false; then + WITH_TPM_TRUE= + WITH_TPM_FALSE='#' +else + WITH_TPM_TRUE='#' + WITH_TPM_FALSE= +fi + + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + +# Check whether --with-usecrypto was given. +if test "${with_usecrypto+set}" = set; then : + withval=$with_usecrypto; + case "`echo $withval | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`" in + beecrypt | bc ) +$as_echo "#define USE_CRYPTO_BEECRYPT 1" >>confdefs.h + ;; + cdsa ) +$as_echo "#define USE_CRYPTO_CDSA 1" >>confdefs.h + ;; + gcrypt | gc ) +$as_echo "#define USE_CRYPTO_GCRYPT 1" >>confdefs.h + ;; + nss ) +$as_echo "#define USE_CRYPTO_NSS 1" >>confdefs.h + ;; + openssl | ssl ) +$as_echo "#define USE_CRYPTO_OPENSSL 1" >>confdefs.h + ;; + tomcrypt | tc ) +$as_echo "#define USE_CRYPTO_TOMCRYPT 1" >>confdefs.h + ;; + * ) as_fn_error $? "invalid cryptography library identifier specified for --with-usecrypto option" "$LINENO" 5 ;; + esac + +fi + + + + + + + + if test ".${with_selinux+set}" != .set; then + with_selinux="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-selinux=$with_selinux" >&6 + fi + + fi + if test ".${with_selinux}" = .yes; then + with_selinux="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-selinux=yes to --with-selinux=\"$with_selinux\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_selinux="" + __rcl_location_last="" + + +# Check whether --with-selinux was given. +if test "${with_selinux+set}" = set; then : + withval=$with_selinux; if test ".${with_selinux}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_selinux}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists selinux || pkg-config --exists libselinux) 2>/dev/null; then + + if (pkg-config --exists selinux) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config selinux $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config selinux $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config selinux $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config selinux $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config selinux $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config selinux $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config selinux $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config selinux $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config selinux" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libselinux $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libselinux $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libselinux $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libselinux $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libselinux $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libselinux $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libselinux $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libselinux $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libselinux" + fi + break + elif test ".`(selinux-config --version; libselinux-config --version) 2>/dev/null`" != .; then + + if test ".`(selinux-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(selinux-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(selinux-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(selinux-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(selinux-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via selinux-config" + else + + __rcl_flags="`(libselinux-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libselinux-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libselinux-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libselinux-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libselinux-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lselinux ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char is_selinux_enabled (); +int +main () +{ +return is_selinux_enabled (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lselinux ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char is_selinux_enabled (); +int +main () +{ +return is_selinux_enabled (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/selinux-config" && test ! -f "${__rcl_dir}/selinux-config.in"; then + if test ".`(${__rcl_dir}/selinux-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/selinux-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/selinux-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/selinux-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/selinux-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/selinux-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libselinux-config" && test ! -f "${__rcl_dir}/libselinux-config.in"; then + if test ".`(${__rcl_dir}/libselinux-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libselinux-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libselinux-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libselinux-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libselinux-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libselinux-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists selinux) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config selinux $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config selinux $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config selinux $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config selinux $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config selinux $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config selinux $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config selinux $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config selinux $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config selinux" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libselinux) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libselinux $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libselinux $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libselinux $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libselinux $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libselinux $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libselinux $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libselinux $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libselinux $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libselinux" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/selinux ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/selinux/selinux.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/selinux ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libselinux.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libselinux.a" || \ + test -f "${__rcl_dir}/libselinux.so" || \ + test -f "${__rcl_dir}/libselinux.sl" || \ + test -f "${__rcl_dir}/libselinux.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "selinux/selinux.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libselinux.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in selinux/selinux.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default" +if test "x$ac_cv_header_selinux_selinux_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SELINUX_SELINUX_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for is_selinux_enabled in -lselinux" >&5 +$as_echo_n "checking for is_selinux_enabled in -lselinux... " >&6; } +if ${ac_cv_lib_selinux_is_selinux_enabled+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lselinux $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char is_selinux_enabled (); +int +main () +{ +return is_selinux_enabled (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_selinux_is_selinux_enabled=yes +else + ac_cv_lib_selinux_is_selinux_enabled=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_is_selinux_enabled" >&5 +$as_echo "$ac_cv_lib_selinux_is_selinux_enabled" >&6; } +if test "x$ac_cv_lib_selinux_is_selinux_enabled" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSELINUX 1 +_ACEOF + + LIBS="-lselinux $LIBS" + +fi + + test ".${ac_cv_lib_selinux_is_selinux_enabled}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_selinux=${__rcl_found} + + if test ".${with_selinux}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_selinux}" = .yes; then + +$as_echo "#define WITH_SELINUX 1" >>confdefs.h + + fi + WITH_SELINUX="${with_selinux}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Libselinux library" >&5 +$as_echo_n "checking whether to build with Libselinux library... " >&6; } + __rcl_msg="${with_selinux}" + if test ".${with_selinux}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_selinux}" = .yes; then + +$as_echo "#define WITH_SELINUX 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + +$as_echo "#define WITH_SELINUX 1" >>confdefs.h + + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Libselinux library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + if test ".${with_sepol+set}" != .set; then + with_sepol="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-sepol=$with_sepol" >&6 + fi + + fi + if test ".${with_sepol}" = .yes; then + with_sepol="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-sepol=yes to --with-sepol=\"$with_sepol\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_sepol="" + __rcl_location_last="" + + +# Check whether --with-sepol was given. +if test "${with_sepol+set}" = set; then : + withval=$with_sepol; if test ".${with_sepol}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_sepol}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists sepol || pkg-config --exists libsepol) 2>/dev/null; then + + if (pkg-config --exists sepol) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config sepol $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config sepol $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config sepol $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config sepol $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config sepol $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config sepol $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config sepol $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config sepol $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config sepol" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsepol $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsepol $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsepol $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsepol $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsepol $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsepol $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsepol $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsepol $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libsepol" + fi + break + elif test ".`(sepol-config --version; libsepol-config --version) 2>/dev/null`" != .; then + + if test ".`(sepol-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(sepol-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(sepol-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(sepol-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(sepol-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via sepol-config" + else + + __rcl_flags="`(libsepol-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libsepol-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libsepol-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libsepol-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libsepol-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lsepol ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sepol_policydb_create (); +int +main () +{ +return sepol_policydb_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lsepol ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sepol_policydb_create (); +int +main () +{ +return sepol_policydb_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/sepol-config" && test ! -f "${__rcl_dir}/sepol-config.in"; then + if test ".`(${__rcl_dir}/sepol-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/sepol-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/sepol-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/sepol-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/sepol-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/sepol-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libsepol-config" && test ! -f "${__rcl_dir}/libsepol-config.in"; then + if test ".`(${__rcl_dir}/libsepol-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libsepol-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libsepol-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libsepol-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libsepol-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libsepol-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists sepol) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config sepol $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config sepol $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config sepol $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config sepol $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config sepol $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config sepol $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config sepol $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config sepol $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config sepol" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libsepol) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsepol $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsepol $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsepol $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsepol $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsepol $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsepol $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsepol $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsepol $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libsepol" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/sepol ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/sepol/sepol.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/sepol ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libsepol.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libsepol.a" || \ + test -f "${__rcl_dir}/libsepol.so" || \ + test -f "${__rcl_dir}/libsepol.sl" || \ + test -f "${__rcl_dir}/libsepol.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "sepol/sepol.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libsepol.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in sepol/sepol.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sepol/sepol.h" "ac_cv_header_sepol_sepol_h" "$ac_includes_default" +if test "x$ac_cv_header_sepol_sepol_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SEPOL_SEPOL_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sepol_policydb_create in -lsepol" >&5 +$as_echo_n "checking for sepol_policydb_create in -lsepol... " >&6; } +if ${ac_cv_lib_sepol_sepol_policydb_create+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsepol $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sepol_policydb_create (); +int +main () +{ +return sepol_policydb_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_sepol_sepol_policydb_create=yes +else + ac_cv_lib_sepol_sepol_policydb_create=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sepol_sepol_policydb_create" >&5 +$as_echo "$ac_cv_lib_sepol_sepol_policydb_create" >&6; } +if test "x$ac_cv_lib_sepol_sepol_policydb_create" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSEPOL 1 +_ACEOF + + LIBS="-lsepol $LIBS" + +fi + + test ".${ac_cv_lib_sepol_sepol_policydb_create}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_sepol=${__rcl_found} + + if test ".${with_sepol}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_sepol}" = .yes; then + +$as_echo "#define WITH_SEPOL 1" >>confdefs.h + + fi + WITH_SEPOL="${with_sepol}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Libsepol library" >&5 +$as_echo_n "checking whether to build with Libsepol library... " >&6; } + __rcl_msg="${with_sepol}" + if test ".${with_sepol}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_sepol}" = .yes; then + +$as_echo "#define WITH_SEPOL 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + +$as_echo "#define WITH_SEPOL 1" >>confdefs.h + + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Libsepol library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + +WITH_SEMANAGE_SEMODULE="" + + + + + + if test ".${with_semanage+set}" != .set; then + with_semanage="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-semanage=$with_semanage" >&6 + fi + + fi + if test ".${with_semanage}" = .yes; then + with_semanage="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-semanage=yes to --with-semanage=\"$with_semanage\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_semanage="" + __rcl_location_last="" + + +# Check whether --with-semanage was given. +if test "${with_semanage+set}" = set; then : + withval=$with_semanage; if test ".${with_semanage}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_semanage}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists semanage || pkg-config --exists libsemanage) 2>/dev/null; then + + if (pkg-config --exists semanage) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config semanage $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config semanage $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config semanage $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config semanage $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config semanage $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config semanage $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config semanage $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config semanage $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config semanage" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsemanage $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsemanage $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsemanage $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsemanage $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsemanage $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsemanage $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsemanage $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsemanage $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libsemanage" + fi + break + elif test ".`(semanage-config --version; libsemanage-config --version) 2>/dev/null`" != .; then + + if test ".`(semanage-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(semanage-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(semanage-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(semanage-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(semanage-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via semanage-config" + else + + __rcl_flags="`(libsemanage-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libsemanage-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libsemanage-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libsemanage-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libsemanage-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lsemanage ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char semanage_handle_create (); +int +main () +{ +return semanage_handle_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lsemanage ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char semanage_handle_create (); +int +main () +{ +return semanage_handle_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/semanage-config" && test ! -f "${__rcl_dir}/semanage-config.in"; then + if test ".`(${__rcl_dir}/semanage-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/semanage-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/semanage-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/semanage-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/semanage-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/semanage-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libsemanage-config" && test ! -f "${__rcl_dir}/libsemanage-config.in"; then + if test ".`(${__rcl_dir}/libsemanage-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libsemanage-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libsemanage-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libsemanage-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libsemanage-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libsemanage-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists semanage) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config semanage $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config semanage $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config semanage $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config semanage $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config semanage $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config semanage $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config semanage $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config semanage $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config semanage" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libsemanage) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsemanage $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsemanage $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsemanage $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsemanage $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsemanage $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsemanage $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsemanage $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsemanage $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libsemanage" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/semanage ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/semanage/semanage.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/semanage ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libsemanage.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libsemanage.a" || \ + test -f "${__rcl_dir}/libsemanage.so" || \ + test -f "${__rcl_dir}/libsemanage.sl" || \ + test -f "${__rcl_dir}/libsemanage.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "semanage/semanage.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libsemanage.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in semanage/semanage.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "semanage/semanage.h" "ac_cv_header_semanage_semanage_h" "$ac_includes_default" +if test "x$ac_cv_header_semanage_semanage_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SEMANAGE_SEMANAGE_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for semanage_handle_create in -lsemanage" >&5 +$as_echo_n "checking for semanage_handle_create in -lsemanage... " >&6; } +if ${ac_cv_lib_semanage_semanage_handle_create+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsemanage $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char semanage_handle_create (); +int +main () +{ +return semanage_handle_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_semanage_semanage_handle_create=yes +else + ac_cv_lib_semanage_semanage_handle_create=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_semanage_semanage_handle_create" >&5 +$as_echo "$ac_cv_lib_semanage_semanage_handle_create" >&6; } +if test "x$ac_cv_lib_semanage_semanage_handle_create" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSEMANAGE 1 +_ACEOF + + LIBS="-lsemanage $LIBS" + +fi + + test ".${ac_cv_lib_semanage_semanage_handle_create}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_semanage=${__rcl_found} + + if test ".${with_semanage}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_semanage}" = .yes; then + +$as_echo "#define WITH_SEMANAGE 1" >>confdefs.h + + fi + WITH_SEMANAGE="${with_semanage}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Libsemanage library" >&5 +$as_echo_n "checking whether to build with Libsemanage library... " >&6; } + __rcl_msg="${with_semanage}" + if test ".${with_semanage}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_semanage}" = .yes; then + +$as_echo "#define WITH_SEMANAGE 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + +$as_echo "#define WITH_SEMANAGE 1" >>confdefs.h + + WITH_SEMANAGE_SEMODULE="semodule spooktool" + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Libsemanage library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + +# Expat + + + + + + if test ".${with_expat+set}" != .set; then + with_expat="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-expat=$with_expat" >&6 + fi + + fi + if test ".${with_expat}" = .yes; then + with_expat="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-expat=yes to --with-expat=\"$with_expat\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_expat="" + __rcl_location_last="" + + +# Check whether --with-expat was given. +if test "${with_expat+set}" = set; then : + withval=$with_expat; if test ".${with_expat}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_expat}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists expat || pkg-config --exists libexpat) 2>/dev/null; then + + if (pkg-config --exists expat) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config expat $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config expat $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config expat $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config expat $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config expat $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config expat $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config expat $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config expat $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config expat" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libexpat $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libexpat $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libexpat $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libexpat $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libexpat $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libexpat $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libexpat $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libexpat $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libexpat" + fi + break + elif test ".`(expat-config --version; libexpat-config --version) 2>/dev/null`" != .; then + + if test ".`(expat-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(expat-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(expat-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(expat-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(expat-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via expat-config" + else + + __rcl_flags="`(libexpat-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libexpat-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libexpat-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libexpat-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libexpat-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lexpat ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XML_SetXmlDeclHandler (); +int +main () +{ +return XML_SetXmlDeclHandler (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lexpat ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XML_SetXmlDeclHandler (); +int +main () +{ +return XML_SetXmlDeclHandler (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/expat-config" && test ! -f "${__rcl_dir}/expat-config.in"; then + if test ".`(${__rcl_dir}/expat-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/expat-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/expat-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/expat-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/expat-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/expat-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libexpat-config" && test ! -f "${__rcl_dir}/libexpat-config.in"; then + if test ".`(${__rcl_dir}/libexpat-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libexpat-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libexpat-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libexpat-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libexpat-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libexpat-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists expat) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config expat $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config expat $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config expat $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config expat $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config expat $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config expat $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config expat $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config expat $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config expat" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libexpat) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libexpat $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libexpat $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libexpat $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libexpat $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libexpat $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libexpat $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libexpat $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libexpat $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libexpat" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/expat ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/expat.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/expat ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libexpat.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libexpat.a" || \ + test -f "${__rcl_dir}/libexpat.so" || \ + test -f "${__rcl_dir}/libexpat.sl" || \ + test -f "${__rcl_dir}/libexpat.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "expat.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libexpat.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in expat.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "expat.h" "ac_cv_header_expat_h" "$ac_includes_default" +if test "x$ac_cv_header_expat_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_EXPAT_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML_SetXmlDeclHandler in -lexpat" >&5 +$as_echo_n "checking for XML_SetXmlDeclHandler in -lexpat... " >&6; } +if ${ac_cv_lib_expat_XML_SetXmlDeclHandler+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lexpat $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XML_SetXmlDeclHandler (); +int +main () +{ +return XML_SetXmlDeclHandler (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_expat_XML_SetXmlDeclHandler=yes +else + ac_cv_lib_expat_XML_SetXmlDeclHandler=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_expat_XML_SetXmlDeclHandler" >&5 +$as_echo "$ac_cv_lib_expat_XML_SetXmlDeclHandler" >&6; } +if test "x$ac_cv_lib_expat_XML_SetXmlDeclHandler" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBEXPAT 1 +_ACEOF + + LIBS="-lexpat $LIBS" + +fi + + test ".${ac_cv_lib_expat_XML_SetXmlDeclHandler}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_expat=${__rcl_found} + + if test ".${with_expat}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_expat}" = .yes; then + +$as_echo "#define WITH_EXPAT 1" >>confdefs.h + + fi + WITH_EXPAT="${with_expat}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Expat library" >&5 +$as_echo_n "checking whether to build with Expat library... " >&6; } + __rcl_msg="${with_expat}" + if test ".${with_expat}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_expat}" = .yes; then + +$as_echo "#define WITH_EXPAT 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + +$as_echo "#define WITH_EXPAT 1" >>confdefs.h + + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Expat library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + +# Libtasn1 + + + + + + if test ".${with_libtasn1+set}" != .set; then + with_libtasn1="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-libtasn1=$with_libtasn1" >&6 + fi + + fi + if test ".${with_libtasn1}" = .yes; then + with_libtasn1="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-libtasn1=yes to --with-libtasn1=\"$with_libtasn1\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_libtasn1="" + __rcl_location_last="" + + +# Check whether --with-libtasn1 was given. +if test "${with_libtasn1+set}" = set; then : + withval=$with_libtasn1; if test ".${with_libtasn1}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_libtasn1}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists libtasn1 || pkg-config --exists liblibtasn1) 2>/dev/null; then + + if (pkg-config --exists libtasn1) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libtasn1 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libtasn1 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libtasn1 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libtasn1 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libtasn1 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libtasn1 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libtasn1 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libtasn1 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libtasn1" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config liblibtasn1 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config liblibtasn1 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config liblibtasn1 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config liblibtasn1 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config liblibtasn1 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config liblibtasn1 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config liblibtasn1 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config liblibtasn1 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config liblibtasn1" + fi + break + elif test ".`(libtasn1-config --version; liblibtasn1-config --version) 2>/dev/null`" != .; then + + if test ".`(libtasn1-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(libtasn1-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libtasn1-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libtasn1-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libtasn1-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libtasn1-config" + else + + __rcl_flags="`(liblibtasn1-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(liblibtasn1-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(liblibtasn1-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(liblibtasn1-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via liblibtasn1-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-ltasn1 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char asn1_array2tree (); +int +main () +{ +return asn1_array2tree (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-ltasn1 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char asn1_array2tree (); +int +main () +{ +return asn1_array2tree (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/libtasn1-config" && test ! -f "${__rcl_dir}/libtasn1-config.in"; then + if test ".`(${__rcl_dir}/libtasn1-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libtasn1-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libtasn1-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libtasn1-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libtasn1-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libtasn1-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/liblibtasn1-config" && test ! -f "${__rcl_dir}/liblibtasn1-config.in"; then + if test ".`(${__rcl_dir}/liblibtasn1-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/liblibtasn1-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/liblibtasn1-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/liblibtasn1-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/liblibtasn1-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/liblibtasn1-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists libtasn1) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libtasn1 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libtasn1 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libtasn1 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libtasn1 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libtasn1 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libtasn1 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libtasn1 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libtasn1 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libtasn1" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists liblibtasn1) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config liblibtasn1 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config liblibtasn1 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config liblibtasn1 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config liblibtasn1 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config liblibtasn1 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config liblibtasn1 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config liblibtasn1 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config liblibtasn1 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config liblibtasn1" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/libtasn1 ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/libtasn1.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/libtasn1 ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libtasn1.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libtasn1.a" || \ + test -f "${__rcl_dir}/libtasn1.so" || \ + test -f "${__rcl_dir}/libtasn1.sl" || \ + test -f "${__rcl_dir}/libtasn1.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "libtasn1.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libtasn1.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in libtasn1.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "libtasn1.h" "ac_cv_header_libtasn1_h" "$ac_includes_default" +if test "x$ac_cv_header_libtasn1_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBTASN1_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for asn1_array2tree in -ltasn1" >&5 +$as_echo_n "checking for asn1_array2tree in -ltasn1... " >&6; } +if ${ac_cv_lib_tasn1_asn1_array2tree+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltasn1 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char asn1_array2tree (); +int +main () +{ +return asn1_array2tree (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_tasn1_asn1_array2tree=yes +else + ac_cv_lib_tasn1_asn1_array2tree=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tasn1_asn1_array2tree" >&5 +$as_echo "$ac_cv_lib_tasn1_asn1_array2tree" >&6; } +if test "x$ac_cv_lib_tasn1_asn1_array2tree" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBTASN1 1 +_ACEOF + + LIBS="-ltasn1 $LIBS" + +fi + + test ".${ac_cv_lib_tasn1_asn1_array2tree}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_libtasn1=${__rcl_found} + + if test ".${with_libtasn1}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_libtasn1}" = .yes; then + +$as_echo "#define WITH_LIBTASN1 1" >>confdefs.h + + fi + WITH_LIBTASN1="${with_libtasn1}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Libtasn1 library" >&5 +$as_echo_n "checking whether to build with Libtasn1 library... " >&6; } + __rcl_msg="${with_libtasn1}" + if test ".${with_libtasn1}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_libtasn1}" = .yes; then + +$as_echo "#define WITH_LIBTASN1 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + +$as_echo "#define WITH_LIBTASN1 1" >>confdefs.h + + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Libtasn1 library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + +# Pakchois + + + + + + if test ".${with_pakchois+set}" != .set; then + with_pakchois="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-pakchois=$with_pakchois" >&6 + fi + + fi + if test ".${with_pakchois}" = .yes; then + with_pakchois="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-pakchois=yes to --with-pakchois=\"$with_pakchois\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_pakchois="" + __rcl_location_last="" + + +# Check whether --with-pakchois was given. +if test "${with_pakchois+set}" = set; then : + withval=$with_pakchois; if test ".${with_pakchois}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_pakchois}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists pakchois || pkg-config --exists libpakchois) 2>/dev/null; then + + if (pkg-config --exists pakchois) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config pakchois $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config pakchois $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config pakchois $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config pakchois $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config pakchois $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config pakchois $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config pakchois $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config pakchois $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config pakchois" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libpakchois $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libpakchois $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libpakchois $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libpakchois $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libpakchois $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libpakchois $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libpakchois $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libpakchois $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libpakchois" + fi + break + elif test ".`(pakchois-config --version; libpakchois-config --version) 2>/dev/null`" != .; then + + if test ".`(pakchois-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(pakchois-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(pakchois-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(pakchois-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(pakchois-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pakchois-config" + else + + __rcl_flags="`(libpakchois-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libpakchois-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libpakchois-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libpakchois-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libpakchois-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lpakchois ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pakchois_module_load (); +int +main () +{ +return pakchois_module_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lpakchois ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pakchois_module_load (); +int +main () +{ +return pakchois_module_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pakchois-config" && test ! -f "${__rcl_dir}/pakchois-config.in"; then + if test ".`(${__rcl_dir}/pakchois-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/pakchois-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/pakchois-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/pakchois-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/pakchois-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pakchois-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libpakchois-config" && test ! -f "${__rcl_dir}/libpakchois-config.in"; then + if test ".`(${__rcl_dir}/libpakchois-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libpakchois-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libpakchois-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libpakchois-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libpakchois-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libpakchois-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists pakchois) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config pakchois $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config pakchois $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config pakchois $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config pakchois $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config pakchois $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config pakchois $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config pakchois $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config pakchois $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config pakchois" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libpakchois) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libpakchois $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libpakchois $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libpakchois $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libpakchois $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libpakchois $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libpakchois $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libpakchois $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libpakchois $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libpakchois" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/pakchois ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/pakchois/pakchois.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/pakchois ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libpakchois.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libpakchois.a" || \ + test -f "${__rcl_dir}/libpakchois.so" || \ + test -f "${__rcl_dir}/libpakchois.sl" || \ + test -f "${__rcl_dir}/libpakchois.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "pakchois/pakchois.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libpakchois.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in pakchois/pakchois.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "pakchois/pakchois.h" "ac_cv_header_pakchois_pakchois_h" "$ac_includes_default" +if test "x$ac_cv_header_pakchois_pakchois_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PAKCHOIS_PAKCHOIS_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pakchois_module_load in -lpakchois" >&5 +$as_echo_n "checking for pakchois_module_load in -lpakchois... " >&6; } +if ${ac_cv_lib_pakchois_pakchois_module_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpakchois $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pakchois_module_load (); +int +main () +{ +return pakchois_module_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pakchois_pakchois_module_load=yes +else + ac_cv_lib_pakchois_pakchois_module_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pakchois_pakchois_module_load" >&5 +$as_echo "$ac_cv_lib_pakchois_pakchois_module_load" >&6; } +if test "x$ac_cv_lib_pakchois_pakchois_module_load" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPAKCHOIS 1 +_ACEOF + + LIBS="-lpakchois $LIBS" + +fi + + test ".${ac_cv_lib_pakchois_pakchois_module_load}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_pakchois=${__rcl_found} + + if test ".${with_pakchois}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_pakchois}" = .yes; then + +$as_echo "#define WITH_PAKCHOIS 1" >>confdefs.h + + fi + WITH_PAKCHOIS="${with_pakchois}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Pakchois library" >&5 +$as_echo_n "checking whether to build with Pakchois library... " >&6; } + __rcl_msg="${with_pakchois}" + if test ".${with_pakchois}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_pakchois}" = .yes; then + +$as_echo "#define WITH_PAKCHOIS 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + +$as_echo "#define WITH_PAKCHOIS 1" >>confdefs.h + + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Pakchois library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + +# GnuTLS + + + + + + if test ".${with_gnutls+set}" != .set; then + with_gnutls="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-gnutls=$with_gnutls" >&6 + fi + + fi + if test ".${with_gnutls}" = .yes; then + with_gnutls="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-gnutls=yes to --with-gnutls=\"$with_gnutls\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_gnutls="" + __rcl_location_last="" + + +# Check whether --with-gnutls was given. +if test "${with_gnutls+set}" = set; then : + withval=$with_gnutls; if test ".${with_gnutls}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_gnutls}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists gnutls || pkg-config --exists libgnutls) 2>/dev/null; then + + if (pkg-config --exists gnutls) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config gnutls $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config gnutls $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config gnutls $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config gnutls $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config gnutls $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config gnutls $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config gnutls $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config gnutls $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config gnutls" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libgnutls $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libgnutls $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libgnutls $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libgnutls $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libgnutls $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libgnutls $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libgnutls $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libgnutls $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libgnutls" + fi + break + elif test ".`(gnutls-config --version; libgnutls-config --version) 2>/dev/null`" != .; then + + if test ".`(gnutls-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(gnutls-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(gnutls-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(gnutls-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(gnutls-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via gnutls-config" + else + + __rcl_flags="`(libgnutls-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libgnutls-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libgnutls-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libgnutls-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libgnutls-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lgnutls ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gnutls_global_init (); +int +main () +{ +return gnutls_global_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lgnutls ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gnutls_global_init (); +int +main () +{ +return gnutls_global_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/gnutls-config" && test ! -f "${__rcl_dir}/gnutls-config.in"; then + if test ".`(${__rcl_dir}/gnutls-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/gnutls-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/gnutls-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/gnutls-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/gnutls-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/gnutls-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libgnutls-config" && test ! -f "${__rcl_dir}/libgnutls-config.in"; then + if test ".`(${__rcl_dir}/libgnutls-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libgnutls-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libgnutls-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libgnutls-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libgnutls-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libgnutls-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists gnutls) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config gnutls $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config gnutls $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config gnutls $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config gnutls $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config gnutls $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config gnutls $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config gnutls $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config gnutls $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config gnutls" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libgnutls) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libgnutls $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libgnutls $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libgnutls $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libgnutls $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libgnutls $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libgnutls $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libgnutls $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libgnutls $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libgnutls" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/gnutls ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/gnutls/gnutls.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/gnutls ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libgnutls.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libgnutls.a" || \ + test -f "${__rcl_dir}/libgnutls.so" || \ + test -f "${__rcl_dir}/libgnutls.sl" || \ + test -f "${__rcl_dir}/libgnutls.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "gnutls/gnutls.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libgnutls.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in gnutls/gnutls.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "gnutls/gnutls.h" "ac_cv_header_gnutls_gnutls_h" "$ac_includes_default" +if test "x$ac_cv_header_gnutls_gnutls_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GNUTLS_GNUTLS_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnutls_global_init in -lgnutls" >&5 +$as_echo_n "checking for gnutls_global_init in -lgnutls... " >&6; } +if ${ac_cv_lib_gnutls_gnutls_global_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgnutls $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gnutls_global_init (); +int +main () +{ +return gnutls_global_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_gnutls_gnutls_global_init=yes +else + ac_cv_lib_gnutls_gnutls_global_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnutls_gnutls_global_init" >&5 +$as_echo "$ac_cv_lib_gnutls_gnutls_global_init" >&6; } +if test "x$ac_cv_lib_gnutls_gnutls_global_init" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBGNUTLS 1 +_ACEOF + + LIBS="-lgnutls $LIBS" + +fi + + test ".${ac_cv_lib_gnutls_gnutls_global_init}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_gnutls=${__rcl_found} + + if test ".${with_gnutls}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_gnutls}" = .yes; then + +$as_echo "#define WITH_GNUTLS 1" >>confdefs.h + + fi + WITH_GNUTLS="${with_gnutls}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with GnuTLS library" >&5 +$as_echo_n "checking whether to build with GnuTLS library... " >&6; } + __rcl_msg="${with_gnutls}" + if test ".${with_gnutls}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_gnutls}" = .yes; then + +$as_echo "#define WITH_GNUTLS 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + +$as_echo "#define WITH_GNUTLS 1" >>confdefs.h + + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable GnuTLS library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + if test ".${with_neon+set}" != .set; then + with_neon="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-neon=$with_neon" >&6 + fi + + fi + if test ".${with_neon}" = .yes; then + with_neon="internal:external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-neon=yes to --with-neon=\"$with_neon\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_neon="" + __rcl_location_last="" + + WITH_NEON_SUBDIR="" + WITH_NEON_CPPFLAGS="" + WITH_NEON_LDFLAGS="" + WITH_NEON_LIBS="" + + +# Check whether --with-neon was given. +if test "${with_neon+set}" = set; then : + withval=$with_neon; if test ".${with_neon}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_neon}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + elif test ".${__rcl_location}" = .internal; then + + if test -d ${srcdir}/neon; then + + if test ".$verbose" = .yes; then + $as_echo "-- activating local sub-directory: neon" >&6 + fi + + if test -f ${srcdir}/neon/configure; then + subdirs="$subdirs neon" + + fi + WITH_NEON_SUBDIR="neon" + __rcl_location_neon=internal + + if test ".$verbose" = .yes; then + $as_echo "++ post-adjustments for --with-neon (${__rcl_location_neon})" >&6 + fi + + __rcl_dirs_inc=`echo 'neon:src:src' | sed -e 's/^[^:]*://' -e 's/:[^:]*$//'` + __rcl_dirs_lib=`echo 'neon:src:src' | sed -e 's/^[^:]*:[^:]*://'` + __rcl_srcdir="\$(top_srcdir)/\$(WITH_NEON_SUBDIR)" + __rcl_builddir="\$(top_builddir)/\$(WITH_NEON_SUBDIR)" + __rcl_firstlib="neon" + if test ".${__rcl_dirs_inc}" != ".neon:src:src"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_NEON_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}" >&6 + fi + + WITH_NEON_CPPFLAGS="${WITH_NEON_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_NEON_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_NEON_CPPFLAGS="${WITH_NEON_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_NEON_CPPFLAGS: -I${__rcl_srcdir}" >&6 + fi + + WITH_NEON_CPPFLAGS="${WITH_NEON_CPPFLAGS} -I${__rcl_srcdir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_NEON_CPPFLAGS: -I${__rcl_builddir}" >&6 + fi + + WITH_NEON_CPPFLAGS="${WITH_NEON_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".neon:src:src"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_NEON_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_NEON_LDFLAGS="${WITH_NEON_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_NEON_LDFLAGS: -L${__rcl_builddir}" >&6 + fi + + WITH_NEON_LDFLAGS="${WITH_NEON_LDFLAGS} -L${__rcl_builddir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_NEON_LIBS: -l${__rcl_firstlib}" >&6 + fi + + WITH_NEON_LIBS="${WITH_NEON_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory neon" + break + else + + if test ".$verbose" = .yes; then + $as_echo "-- skipping not existing local sub-directory: neon" >&6 + fi + + fi + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists neon || pkg-config --exists libneon) 2>/dev/null; then + + if (pkg-config --exists neon) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config neon $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config neon $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config neon $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config neon $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config neon $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config neon $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config neon $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config neon $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config neon" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libneon $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libneon $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libneon $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libneon $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libneon $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libneon $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libneon $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libneon $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libneon" + fi + break + elif test ".`(neon-config --version; libneon-config --version) 2>/dev/null`" != .; then + + if test ".`(neon-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(neon-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(neon-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(neon-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(neon-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via neon-config" + else + + __rcl_flags="`(libneon-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libneon-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libneon-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libneon-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libneon-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lneon ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ne_session_create (); +int +main () +{ +return ne_session_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lneon ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ne_session_create (); +int +main () +{ +return ne_session_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/neon-config" && test ! -f "${__rcl_dir}/neon-config.in"; then + if test ".`(${__rcl_dir}/neon-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/neon-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/neon-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/neon-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/neon-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/neon-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libneon-config" && test ! -f "${__rcl_dir}/libneon-config.in"; then + if test ".`(${__rcl_dir}/libneon-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libneon-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libneon-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libneon-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libneon-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libneon-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists neon) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config neon $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config neon $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config neon $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config neon $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config neon $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config neon $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config neon $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config neon $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config neon" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libneon) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libneon $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libneon $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libneon $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libneon $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libneon $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libneon $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libneon $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libneon $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libneon" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/neon ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/ne_session.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/neon ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libneon.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libneon.a" || \ + test -f "${__rcl_dir}/libneon.so" || \ + test -f "${__rcl_dir}/libneon.sl" || \ + test -f "${__rcl_dir}/libneon.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "ne_session.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libneon.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + if test ".${__rcl_location_last}" = .internal; then + with_neon=yes + if test ".${__rcl_location_neon}" != .internal; then + as_fn_error $? "unable to find internal Neon library" "$LINENO" 5 + fi + else + __rcl_found=yes + for ac_header in ne_session.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ne_session.h" "ac_cv_header_ne_session_h" "$ac_includes_default" +if test "x$ac_cv_header_ne_session_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NE_SESSION_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ne_session_create in -lneon" >&5 +$as_echo_n "checking for ne_session_create in -lneon... " >&6; } +if ${ac_cv_lib_neon_ne_session_create+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lneon $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ne_session_create (); +int +main () +{ +return ne_session_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_neon_ne_session_create=yes +else + ac_cv_lib_neon_ne_session_create=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_neon_ne_session_create" >&5 +$as_echo "$ac_cv_lib_neon_ne_session_create" >&6; } +if test "x$ac_cv_lib_neon_ne_session_create" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBNEON 1 +_ACEOF + + LIBS="-lneon $LIBS" + +fi + + test ".${ac_cv_lib_neon_ne_session_create}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_neon=${__rcl_found} + fi + if test ".${with_neon}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_neon}" = .yes; then + +$as_echo "#define WITH_NEON 1" >>confdefs.h + + fi + WITH_NEON="${with_neon}" + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Neon library" >&5 +$as_echo_n "checking whether to build with Neon library... " >&6; } + __rcl_msg="${with_neon}" + if test ".${with_neon}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_neon}" = .yes; then + +$as_echo "#define WITH_NEON 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + +$as_echo "#define HAVE_NEON_NE_GET_RESPONSE_HEADER 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ne_get_response_header in -lneon" >&5 +$as_echo_n "checking for ne_get_response_header in -lneon... " >&6; } +if ${ac_cv_lib_neon_ne_get_response_header+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lneon $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ne_get_response_header (); +int +main () +{ +return ne_get_response_header (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_neon_ne_get_response_header=yes +else + ac_cv_lib_neon_ne_get_response_header=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_neon_ne_get_response_header" >&5 +$as_echo "$ac_cv_lib_neon_ne_get_response_header" >&6; } +if test "x$ac_cv_lib_neon_ne_get_response_header" = xyes; then : + + +$as_echo "#define HAVE_NEON_NE_GET_RESPONSE_HEADER 1" >>confdefs.h + +fi + + fi + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No Neon library found, using unsupported configuration" >&5 +$as_echo "$as_me: WARNING: No Neon library found, using unsupported configuration" >&2;} + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + +# Libgit2 + + + + + + if test ".${with_libgit2+set}" != .set; then + with_libgit2="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-libgit2=$with_libgit2" >&6 + fi + + fi + if test ".${with_libgit2}" = .yes; then + with_libgit2="internal:external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-libgit2=yes to --with-libgit2=\"$with_libgit2\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_libgit2="" + __rcl_location_last="" + + WITH_LIBGIT2_SUBDIR="" + WITH_LIBGIT2_CPPFLAGS="" + WITH_LIBGIT2_LDFLAGS="" + WITH_LIBGIT2_LIBS="" + + +# Check whether --with-libgit2 was given. +if test "${with_libgit2+set}" = set; then : + withval=$with_libgit2; if test ".${with_libgit2}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_libgit2}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + elif test ".${__rcl_location}" = .internal; then + + if test -d ${srcdir}/libgit2; then + + if test ".$verbose" = .yes; then + $as_echo "-- activating local sub-directory: libgit2" >&6 + fi + + if test -f ${srcdir}/libgit2/configure; then + subdirs="$subdirs libgit2" + + fi + WITH_LIBGIT2_SUBDIR="libgit2" + __rcl_location_libgit2=internal + + if test ".$verbose" = .yes; then + $as_echo "++ post-adjustments for --with-libgit2 (${__rcl_location_libgit2})" >&6 + fi + + __rcl_dirs_inc=`echo 'libgit2:include' | sed -e 's/^[^:]*://' -e 's/:[^:]*$//'` + __rcl_dirs_lib=`echo 'libgit2:include' | sed -e 's/^[^:]*:[^:]*://'` + __rcl_srcdir="\$(top_srcdir)/\$(WITH_LIBGIT2_SUBDIR)" + __rcl_builddir="\$(top_builddir)/\$(WITH_LIBGIT2_SUBDIR)" + __rcl_firstlib="git2" + if test ".${__rcl_dirs_inc}" != ".libgit2:include"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_LIBGIT2_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}" >&6 + fi + + WITH_LIBGIT2_CPPFLAGS="${WITH_LIBGIT2_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_LIBGIT2_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_LIBGIT2_CPPFLAGS="${WITH_LIBGIT2_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_LIBGIT2_CPPFLAGS: -I${__rcl_srcdir}" >&6 + fi + + WITH_LIBGIT2_CPPFLAGS="${WITH_LIBGIT2_CPPFLAGS} -I${__rcl_srcdir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_LIBGIT2_CPPFLAGS: -I${__rcl_builddir}" >&6 + fi + + WITH_LIBGIT2_CPPFLAGS="${WITH_LIBGIT2_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".libgit2:include"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_LIBGIT2_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_LIBGIT2_LDFLAGS="${WITH_LIBGIT2_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_LIBGIT2_LDFLAGS: -L${__rcl_builddir}" >&6 + fi + + WITH_LIBGIT2_LDFLAGS="${WITH_LIBGIT2_LDFLAGS} -L${__rcl_builddir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_LIBGIT2_LIBS: -l${__rcl_firstlib}" >&6 + fi + + WITH_LIBGIT2_LIBS="${WITH_LIBGIT2_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory libgit2" + break + else + + if test ".$verbose" = .yes; then + $as_echo "-- skipping not existing local sub-directory: libgit2" >&6 + fi + + fi + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists libgit2 || pkg-config --exists liblibgit2) 2>/dev/null; then + + if (pkg-config --exists libgit2) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libgit2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libgit2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libgit2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libgit2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libgit2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libgit2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libgit2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libgit2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libgit2" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config liblibgit2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config liblibgit2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config liblibgit2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config liblibgit2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config liblibgit2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config liblibgit2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config liblibgit2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config liblibgit2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config liblibgit2" + fi + break + elif test ".`(libgit2-config --version; liblibgit2-config --version) 2>/dev/null`" != .; then + + if test ".`(libgit2-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(libgit2-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libgit2-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libgit2-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libgit2-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libgit2-config" + else + + __rcl_flags="`(liblibgit2-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(liblibgit2-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(liblibgit2-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(liblibgit2-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via liblibgit2-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lgit2 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char git_repository_open (); +int +main () +{ +return git_repository_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lgit2 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char git_repository_open (); +int +main () +{ +return git_repository_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/libgit2-config" && test ! -f "${__rcl_dir}/libgit2-config.in"; then + if test ".`(${__rcl_dir}/libgit2-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libgit2-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libgit2-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libgit2-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libgit2-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libgit2-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/liblibgit2-config" && test ! -f "${__rcl_dir}/liblibgit2-config.in"; then + if test ".`(${__rcl_dir}/liblibgit2-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/liblibgit2-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/liblibgit2-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/liblibgit2-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/liblibgit2-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/liblibgit2-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists libgit2) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libgit2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libgit2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libgit2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libgit2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libgit2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libgit2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libgit2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libgit2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libgit2" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists liblibgit2) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config liblibgit2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config liblibgit2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config liblibgit2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config liblibgit2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config liblibgit2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config liblibgit2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config liblibgit2 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config liblibgit2 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config liblibgit2" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/libgit2 ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/git2.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/libgit2 ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libgit2.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libgit2.a" || \ + test -f "${__rcl_dir}/libgit2.so" || \ + test -f "${__rcl_dir}/libgit2.sl" || \ + test -f "${__rcl_dir}/libgit2.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "git2.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libgit2.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + if test ".${__rcl_location_last}" = .internal; then + with_libgit2=yes + if test ".${__rcl_location_libgit2}" != .internal; then + as_fn_error $? "unable to find internal Libgit2 library" "$LINENO" 5 + fi + else + __rcl_found=yes + for ac_header in git2.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "git2.h" "ac_cv_header_git2_h" "$ac_includes_default" +if test "x$ac_cv_header_git2_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GIT2_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for git_repository_open in -lgit2" >&5 +$as_echo_n "checking for git_repository_open in -lgit2... " >&6; } +if ${ac_cv_lib_git2_git_repository_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgit2 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char git_repository_open (); +int +main () +{ +return git_repository_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_git2_git_repository_open=yes +else + ac_cv_lib_git2_git_repository_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_git2_git_repository_open" >&5 +$as_echo "$ac_cv_lib_git2_git_repository_open" >&6; } +if test "x$ac_cv_lib_git2_git_repository_open" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBGIT2 1 +_ACEOF + + LIBS="-lgit2 $LIBS" + +fi + + test ".${ac_cv_lib_git2_git_repository_open}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_libgit2=${__rcl_found} + fi + if test ".${with_libgit2}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_libgit2}" = .yes; then + +$as_echo "#define WITH_LIBGIT2 1" >>confdefs.h + + fi + WITH_LIBGIT2="${with_libgit2}" + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Libgit2 library" >&5 +$as_echo_n "checking whether to build with Libgit2 library... " >&6; } + __rcl_msg="${with_libgit2}" + if test ".${with_libgit2}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_libgit2}" = .yes; then + +$as_echo "#define WITH_LIBGIT2 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + +$as_echo "#define WITH_LIBGIT2 1" >>confdefs.h + + if true; then + WITH_LIBGIT2_TRUE= + WITH_LIBGIT2_FALSE='#' +else + WITH_LIBGIT2_TRUE='#' + WITH_LIBGIT2_FALSE= +fi + + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + +$as_echo "#define HAVE_GIT2_H 1" >>confdefs.h + + fi + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if false; then + WITH_LIBGIT2_TRUE= + WITH_LIBGIT2_FALSE='#' +else + WITH_LIBGIT2_TRUE='#' + WITH_LIBGIT2_FALSE= +fi + + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + +# APR + + + + + + if test ".${with_apr+set}" != .set; then + with_apr="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-apr=$with_apr" >&6 + fi + + fi + if test ".${with_apr}" = .yes; then + with_apr="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-apr=yes to --with-apr=\"$with_apr\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_apr="" + __rcl_location_last="" + + +# Check whether --with-apr was given. +if test "${with_apr+set}" = set; then : + withval=$with_apr; if test ".${with_apr}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_apr}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists apr || pkg-config --exists libapr) 2>/dev/null; then + + if (pkg-config --exists apr) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config apr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config apr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config apr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config apr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config apr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config apr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config apr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config apr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config apr" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libapr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libapr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libapr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libapr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libapr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libapr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libapr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libapr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libapr" + fi + break + elif test ".`(apr-config --version; libapr-config --version) 2>/dev/null`" != .; then + + if test ".`(apr-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(apr-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(apr-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(apr-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(apr-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via apr-config" + else + + __rcl_flags="`(libapr-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libapr-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libapr-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libapr-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libapr-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lapr-1 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char apr_initialize (); +int +main () +{ +return apr_initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lapr-1 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char apr_initialize (); +int +main () +{ +return apr_initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/apr-config" && test ! -f "${__rcl_dir}/apr-config.in"; then + if test ".`(${__rcl_dir}/apr-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/apr-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/apr-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/apr-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/apr-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/apr-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libapr-config" && test ! -f "${__rcl_dir}/libapr-config.in"; then + if test ".`(${__rcl_dir}/libapr-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libapr-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libapr-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libapr-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libapr-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libapr-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists apr) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config apr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config apr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config apr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config apr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config apr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config apr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config apr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config apr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config apr" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libapr) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libapr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libapr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libapr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libapr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libapr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libapr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libapr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libapr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libapr" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/apr ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/apr-1/apr.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/apr ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libapr-1.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libapr-1.a" || \ + test -f "${__rcl_dir}/libapr-1.so" || \ + test -f "${__rcl_dir}/libapr-1.sl" || \ + test -f "${__rcl_dir}/libapr-1.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "apr-1/apr.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libapr-1.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in apr-1/apr.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "apr-1/apr.h" "ac_cv_header_apr_1_apr_h" "$ac_includes_default" +if test "x$ac_cv_header_apr_1_apr_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_APR_1_APR_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for apr_initialize in -lapr-1" >&5 +$as_echo_n "checking for apr_initialize in -lapr-1... " >&6; } +if ${ac_cv_lib_apr_1_apr_initialize+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lapr-1 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char apr_initialize (); +int +main () +{ +return apr_initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_apr_1_apr_initialize=yes +else + ac_cv_lib_apr_1_apr_initialize=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_apr_1_apr_initialize" >&5 +$as_echo "$ac_cv_lib_apr_1_apr_initialize" >&6; } +if test "x$ac_cv_lib_apr_1_apr_initialize" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBAPR_1 1 +_ACEOF + + LIBS="-lapr-1 $LIBS" + +fi + + test ".${ac_cv_lib_apr_1_apr_initialize}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_apr=${__rcl_found} + + if test ".${with_apr}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_apr}" = .yes; then + +$as_echo "#define WITH_APR 1" >>confdefs.h + + fi + WITH_APR="${with_apr}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Apr library" >&5 +$as_echo_n "checking whether to build with Apr library... " >&6; } + __rcl_msg="${with_apr}" + if test ".${with_apr}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_apr}" = .yes; then + +$as_echo "#define WITH_APR 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + +$as_echo "#define WITH_APR 1" >>confdefs.h + + CPPFLAGS="$CPPFLAGS -I$prefix/include/apr-1" + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Apr library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + +# Subversion + + + + + + if test ".${with_subversion+set}" != .set; then + with_subversion="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-subversion=$with_subversion" >&6 + fi + + fi + if test ".${with_subversion}" = .yes; then + with_subversion="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-subversion=yes to --with-subversion=\"$with_subversion\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_subversion="" + __rcl_location_last="" + + +# Check whether --with-subversion was given. +if test "${with_subversion+set}" = set; then : + withval=$with_subversion; if test ".${with_subversion}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_subversion}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists subversion || pkg-config --exists libsubversion) 2>/dev/null; then + + if (pkg-config --exists subversion) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config subversion $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config subversion $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config subversion $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config subversion $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config subversion $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config subversion $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config subversion $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config subversion $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config subversion" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsubversion $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsubversion $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsubversion $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsubversion $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsubversion $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsubversion $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsubversion $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsubversion $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libsubversion" + fi + break + elif test ".`(subversion-config --version; libsubversion-config --version) 2>/dev/null`" != .; then + + if test ".`(subversion-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(subversion-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(subversion-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(subversion-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(subversion-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via subversion-config" + else + + __rcl_flags="`(libsubversion-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libsubversion-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libsubversion-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libsubversion-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libsubversion-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lsvn_client-1 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char svn_client_create_context (); +int +main () +{ +return svn_client_create_context (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lsvn_client-1 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char svn_client_create_context (); +int +main () +{ +return svn_client_create_context (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/subversion-config" && test ! -f "${__rcl_dir}/subversion-config.in"; then + if test ".`(${__rcl_dir}/subversion-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/subversion-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/subversion-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/subversion-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/subversion-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/subversion-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libsubversion-config" && test ! -f "${__rcl_dir}/libsubversion-config.in"; then + if test ".`(${__rcl_dir}/libsubversion-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libsubversion-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libsubversion-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libsubversion-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libsubversion-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libsubversion-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists subversion) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config subversion $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config subversion $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config subversion $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config subversion $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config subversion $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config subversion $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config subversion $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config subversion $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config subversion" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libsubversion) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsubversion $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsubversion $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsubversion $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsubversion $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsubversion $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsubversion $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsubversion $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsubversion $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libsubversion" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/subversion ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/subversion-1/svn_client.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/subversion ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libsvn_client-1.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libsvn_client-1.a" || \ + test -f "${__rcl_dir}/libsvn_client-1.so" || \ + test -f "${__rcl_dir}/libsvn_client-1.sl" || \ + test -f "${__rcl_dir}/libsvn_client-1.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "subversion-1/svn_client.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libsvn_client-1.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in subversion-1/svn_client.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "subversion-1/svn_client.h" "ac_cv_header_subversion_1_svn_client_h" "$ac_includes_default" +if test "x$ac_cv_header_subversion_1_svn_client_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SUBVERSION_1_SVN_CLIENT_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for svn_client_create_context in -lsvn_client-1" >&5 +$as_echo_n "checking for svn_client_create_context in -lsvn_client-1... " >&6; } +if ${ac_cv_lib_svn_client_1_svn_client_create_context+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvn_client-1 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char svn_client_create_context (); +int +main () +{ +return svn_client_create_context (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svn_client_1_svn_client_create_context=yes +else + ac_cv_lib_svn_client_1_svn_client_create_context=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svn_client_1_svn_client_create_context" >&5 +$as_echo "$ac_cv_lib_svn_client_1_svn_client_create_context" >&6; } +if test "x$ac_cv_lib_svn_client_1_svn_client_create_context" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSVN_CLIENT_1 1 +_ACEOF + + LIBS="-lsvn_client-1 $LIBS" + +fi + + test ".${ac_cv_lib_svn_client_1_svn_client_create_context}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_subversion=${__rcl_found} + + if test ".${with_subversion}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_subversion}" = .yes; then + +$as_echo "#define WITH_SUBVERSION 1" >>confdefs.h + + fi + WITH_SUBVERSION="${with_subversion}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Subversion library" >&5 +$as_echo_n "checking whether to build with Subversion library... " >&6; } + __rcl_msg="${with_subversion}" + if test ".${with_subversion}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_subversion}" = .yes; then + +$as_echo "#define WITH_SUBVERSION 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + +$as_echo "#define WITH_SUBVERSION 1" >>confdefs.h + + CPPFLAGS="$CPPFLAGS -I$prefix/include/subversion-1" + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Subversion library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + +WITH_FILE_INTERNAL=false + + + + + + if test ".${with_file+set}" != .set; then + with_file="yes" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-file=$with_file" >&6 + fi + + fi + if test ".${with_file}" = .yes; then + with_file="internal:external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-file=yes to --with-file=\"$with_file\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_file="" + __rcl_location_last="" + + WITH_FILE_SUBDIR="" + WITH_FILE_CPPFLAGS="" + WITH_FILE_LDFLAGS="" + WITH_FILE_LIBS="" + + +# Check whether --with-file was given. +if test "${with_file+set}" = set; then : + withval=$with_file; if test ".${with_file}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_file}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + elif test ".${__rcl_location}" = .internal; then + + if test -d ${srcdir}/file; then + + if test ".$verbose" = .yes; then + $as_echo "-- activating local sub-directory: file" >&6 + fi + + if test -f ${srcdir}/file/configure; then + subdirs="$subdirs file" + + fi + WITH_FILE_SUBDIR="file" + __rcl_location_file=internal + + if test ".$verbose" = .yes; then + $as_echo "++ post-adjustments for --with-file (${__rcl_location_file})" >&6 + fi + + __rcl_dirs_inc=`echo 'file:src:src' | sed -e 's/^[^:]*://' -e 's/:[^:]*$//'` + __rcl_dirs_lib=`echo 'file:src:src' | sed -e 's/^[^:]*:[^:]*://'` + __rcl_srcdir="\$(top_srcdir)/\$(WITH_FILE_SUBDIR)" + __rcl_builddir="\$(top_builddir)/\$(WITH_FILE_SUBDIR)" + __rcl_firstlib="magic" + if test ".${__rcl_dirs_inc}" != ".file:src:src"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_FILE_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}" >&6 + fi + + WITH_FILE_CPPFLAGS="${WITH_FILE_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_FILE_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_FILE_CPPFLAGS="${WITH_FILE_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_FILE_CPPFLAGS: -I${__rcl_srcdir}" >&6 + fi + + WITH_FILE_CPPFLAGS="${WITH_FILE_CPPFLAGS} -I${__rcl_srcdir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_FILE_CPPFLAGS: -I${__rcl_builddir}" >&6 + fi + + WITH_FILE_CPPFLAGS="${WITH_FILE_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".file:src:src"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_FILE_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_FILE_LDFLAGS="${WITH_FILE_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_FILE_LDFLAGS: -L${__rcl_builddir}" >&6 + fi + + WITH_FILE_LDFLAGS="${WITH_FILE_LDFLAGS} -L${__rcl_builddir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_FILE_LIBS: -l${__rcl_firstlib}" >&6 + fi + + WITH_FILE_LIBS="${WITH_FILE_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory file" + break + else + + if test ".$verbose" = .yes; then + $as_echo "-- skipping not existing local sub-directory: file" >&6 + fi + + fi + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists file || pkg-config --exists libfile) 2>/dev/null; then + + if (pkg-config --exists file) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config file $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config file $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config file $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config file $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config file $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config file $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config file $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config file $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config file" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libfile $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libfile $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libfile $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libfile $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libfile $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libfile $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libfile $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libfile $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libfile" + fi + break + elif test ".`(file-config --version; libfile-config --version) 2>/dev/null`" != .; then + + if test ".`(file-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(file-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(file-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(file-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(file-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via file-config" + else + + __rcl_flags="`(libfile-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libfile-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libfile-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libfile-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libfile-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lmagic ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char magic_open (); +int +main () +{ +return magic_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lmagic ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char magic_open (); +int +main () +{ +return magic_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/file-config" && test ! -f "${__rcl_dir}/file-config.in"; then + if test ".`(${__rcl_dir}/file-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/file-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/file-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/file-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/file-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/file-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libfile-config" && test ! -f "${__rcl_dir}/libfile-config.in"; then + if test ".`(${__rcl_dir}/libfile-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libfile-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libfile-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libfile-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libfile-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libfile-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists file) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config file $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config file $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config file $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config file $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config file $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config file $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config file $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config file $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config file" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libfile) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libfile $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libfile $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libfile $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libfile $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libfile $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libfile $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libfile $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libfile $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libfile" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/file ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/magic.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/file ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libmagic.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libmagic.a" || \ + test -f "${__rcl_dir}/libmagic.so" || \ + test -f "${__rcl_dir}/libmagic.sl" || \ + test -f "${__rcl_dir}/libmagic.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "magic.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libmagic.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + if test ".${__rcl_location_last}" = .internal; then + with_file=yes + if test ".${__rcl_location_file}" != .internal; then + as_fn_error $? "unable to find internal File (magic) library" "$LINENO" 5 + fi + else + __rcl_found=yes + for ac_header in magic.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "magic.h" "ac_cv_header_magic_h" "$ac_includes_default" +if test "x$ac_cv_header_magic_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MAGIC_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for magic_open in -lmagic" >&5 +$as_echo_n "checking for magic_open in -lmagic... " >&6; } +if ${ac_cv_lib_magic_magic_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmagic $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char magic_open (); +int +main () +{ +return magic_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_magic_magic_open=yes +else + ac_cv_lib_magic_magic_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_magic_magic_open" >&5 +$as_echo "$ac_cv_lib_magic_magic_open" >&6; } +if test "x$ac_cv_lib_magic_magic_open" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBMAGIC 1 +_ACEOF + + LIBS="-lmagic $LIBS" + +fi + + test ".${ac_cv_lib_magic_magic_open}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_file=${__rcl_found} + fi + if test ".${with_file}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_file}" = .yes; then + +$as_echo "#define WITH_FILE 1" >>confdefs.h + + fi + WITH_FILE="${with_file}" + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with File (magic) library" >&5 +$as_echo_n "checking whether to build with File (magic) library... " >&6; } + __rcl_msg="${with_file}" + if test ".${with_file}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_file}" = .yes; then + +$as_echo "#define WITH_FILE 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + if test ".$RPM_CHECK_LIB_LOCATION" = .internal ; then + WITH_FILE_INTERNAL_TRUE= + WITH_FILE_INTERNAL_FALSE='#' +else + WITH_FILE_INTERNAL_TRUE='#' + WITH_FILE_INTERNAL_FALSE= +fi + + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + WITH_FILE_INTERNAL=true + +$as_echo "#define HAVE_MAGIC_H 1" >>confdefs.h + + fi + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + if false ; then + WITH_FILE_INTERNAL_TRUE= + WITH_FILE_INTERNAL_FALSE='#' +else + WITH_FILE_INTERNAL_TRUE='#' + WITH_FILE_INTERNAL_FALSE= +fi + + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + +# UnixODBC + + + + + + if test ".${with_unixodbc+set}" != .set; then + with_unixodbc="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-unixodbc=$with_unixodbc" >&6 + fi + + fi + if test ".${with_unixodbc}" = .yes; then + with_unixodbc="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-unixodbc=yes to --with-unixodbc=\"$with_unixodbc\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_unixodbc="" + __rcl_location_last="" + + +# Check whether --with-unixodbc was given. +if test "${with_unixodbc+set}" = set; then : + withval=$with_unixodbc; if test ".${with_unixodbc}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_unixodbc}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists unixodbc || pkg-config --exists libunixodbc) 2>/dev/null; then + + if (pkg-config --exists unixodbc) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config unixodbc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config unixodbc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config unixodbc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config unixodbc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config unixodbc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config unixodbc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config unixodbc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config unixodbc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config unixodbc" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libunixodbc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libunixodbc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libunixodbc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libunixodbc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libunixodbc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libunixodbc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libunixodbc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libunixodbc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libunixodbc" + fi + break + elif test ".`(unixodbc-config --version; libunixodbc-config --version) 2>/dev/null`" != .; then + + if test ".`(unixodbc-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(unixodbc-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(unixodbc-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(unixodbc-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(unixodbc-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via unixodbc-config" + else + + __rcl_flags="`(libunixodbc-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libunixodbc-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libunixodbc-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libunixodbc-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libunixodbc-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lodbc ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char SQLAllocHandle (); +int +main () +{ +return SQLAllocHandle (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lodbc ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char SQLAllocHandle (); +int +main () +{ +return SQLAllocHandle (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/unixodbc-config" && test ! -f "${__rcl_dir}/unixodbc-config.in"; then + if test ".`(${__rcl_dir}/unixodbc-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/unixodbc-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/unixodbc-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/unixodbc-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/unixodbc-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/unixodbc-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libunixodbc-config" && test ! -f "${__rcl_dir}/libunixodbc-config.in"; then + if test ".`(${__rcl_dir}/libunixodbc-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libunixodbc-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libunixodbc-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libunixodbc-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libunixodbc-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libunixodbc-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists unixodbc) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config unixodbc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config unixodbc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config unixodbc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config unixodbc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config unixodbc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config unixodbc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config unixodbc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config unixodbc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config unixodbc" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libunixodbc) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libunixodbc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libunixodbc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libunixodbc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libunixodbc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libunixodbc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libunixodbc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libunixodbc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libunixodbc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libunixodbc" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/unixodbc ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/sqlext.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/unixodbc ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libodbc.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libodbc.a" || \ + test -f "${__rcl_dir}/libodbc.so" || \ + test -f "${__rcl_dir}/libodbc.sl" || \ + test -f "${__rcl_dir}/libodbc.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "sqlext.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libodbc.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in sqlext.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sqlext.h" "ac_cv_header_sqlext_h" "$ac_includes_default" +if test "x$ac_cv_header_sqlext_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SQLEXT_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SQLAllocHandle in -lodbc" >&5 +$as_echo_n "checking for SQLAllocHandle in -lodbc... " >&6; } +if ${ac_cv_lib_odbc_SQLAllocHandle+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lodbc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char SQLAllocHandle (); +int +main () +{ +return SQLAllocHandle (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_odbc_SQLAllocHandle=yes +else + ac_cv_lib_odbc_SQLAllocHandle=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odbc_SQLAllocHandle" >&5 +$as_echo "$ac_cv_lib_odbc_SQLAllocHandle" >&6; } +if test "x$ac_cv_lib_odbc_SQLAllocHandle" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBODBC 1 +_ACEOF + + LIBS="-lodbc $LIBS" + +fi + + test ".${ac_cv_lib_odbc_SQLAllocHandle}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_unixodbc=${__rcl_found} + + if test ".${with_unixodbc}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_unixodbc}" = .yes; then + +$as_echo "#define WITH_UNIXODBC 1" >>confdefs.h + + fi + WITH_UNIXODBC="${with_unixodbc}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with UnixODBC library" >&5 +$as_echo_n "checking whether to build with UnixODBC library... " >&6; } + __rcl_msg="${with_unixodbc}" + if test ".${with_unixodbc}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_unixodbc}" = .yes; then + +$as_echo "#define WITH_UNIXODBC 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + +$as_echo "#define WITH_UNIXODBC 1" >>confdefs.h + + if true; then + WITH_UNIXODBC_TRUE= + WITH_UNIXODBC_FALSE='#' +else + WITH_UNIXODBC_TRUE='#' + WITH_UNIXODBC_FALSE= +fi + + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + if false; then + WITH_UNIXODBC_TRUE= + WITH_UNIXODBC_FALSE='#' +else + WITH_UNIXODBC_TRUE='#' + WITH_UNIXODBC_FALSE= +fi + + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + +DBLIBSRCS="" +# XXX won't handle --includedir override +CPPFLAGS="${CPPFLAGS} -I${prefix}/include/${DBXY}" + + + + + + if test ".${with_db+set}" != .set; then + with_db="yes" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-db=$with_db" >&6 + fi + + fi + if test ".${with_db}" = .yes; then + with_db="external" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-db=yes to --with-db=\"$with_db\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_db="" + __rcl_location_last="" + + WITH_DB_SUBDIR="" + WITH_DB_CPPFLAGS="" + WITH_DB_LDFLAGS="" + WITH_DB_LIBS="" + + +# Check whether --with-db was given. +if test "${with_db+set}" = set; then : + withval=$with_db; if test ".${with_db}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_db}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + elif test ".${__rcl_location}" = .internal; then + + if test -d ${srcdir}/db3; then + + if test ".$verbose" = .yes; then + $as_echo "-- activating local sub-directory: db3" >&6 + fi + + if test -f ${srcdir}/db3/configure; then + subdirs="$subdirs db3" + + fi + WITH_DB_SUBDIR="db3" + __rcl_location_db=internal + + if test ".$verbose" = .yes; then + $as_echo "++ post-adjustments for --with-db (${__rcl_location_db})" >&6 + fi + + __rcl_dirs_inc=`echo 'db3' | sed -e 's/^[^:]*://' -e 's/:[^:]*$//'` + __rcl_dirs_lib=`echo 'db3' | sed -e 's/^[^:]*:[^:]*://'` + __rcl_srcdir="\$(top_srcdir)/\$(WITH_DB_SUBDIR)" + __rcl_builddir="\$(top_builddir)/\$(WITH_DB_SUBDIR)" + __rcl_firstlib="db-5.3" + if test ".${__rcl_dirs_inc}" != ".db3"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_DB_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}" >&6 + fi + + WITH_DB_CPPFLAGS="${WITH_DB_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_DB_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_DB_CPPFLAGS="${WITH_DB_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_DB_CPPFLAGS: -I${__rcl_srcdir}" >&6 + fi + + WITH_DB_CPPFLAGS="${WITH_DB_CPPFLAGS} -I${__rcl_srcdir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_DB_CPPFLAGS: -I${__rcl_builddir}" >&6 + fi + + WITH_DB_CPPFLAGS="${WITH_DB_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".db3"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_DB_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_DB_LDFLAGS="${WITH_DB_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_DB_LDFLAGS: -L${__rcl_builddir}" >&6 + fi + + WITH_DB_LDFLAGS="${WITH_DB_LDFLAGS} -L${__rcl_builddir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_DB_LIBS: -l${__rcl_firstlib}" >&6 + fi + + WITH_DB_LIBS="${WITH_DB_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory db3" + break + else + + if test ".$verbose" = .yes; then + $as_echo "-- skipping not existing local sub-directory: db3" >&6 + fi + + fi + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists db || pkg-config --exists libdb) 2>/dev/null; then + + if (pkg-config --exists db) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config db $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config db $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config db $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config db $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config db $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config db $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config db $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config db $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config db" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libdb $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libdb $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libdb $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libdb $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libdb $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libdb $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libdb $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libdb $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libdb" + fi + break + elif test ".`(db-config --version; libdb-config --version) 2>/dev/null`" != .; then + + if test ".`(db-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(db-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(db-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(db-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(db-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via db-config" + else + + __rcl_flags="`(libdb-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libdb-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libdb-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libdb-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libdb-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-ldb-5.3 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char db_create (); +int +main () +{ +return db_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-ldb-5.3 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char db_create (); +int +main () +{ +return db_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/db-config" && test ! -f "${__rcl_dir}/db-config.in"; then + if test ".`(${__rcl_dir}/db-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/db-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/db-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/db-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/db-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/db-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libdb-config" && test ! -f "${__rcl_dir}/libdb-config.in"; then + if test ".`(${__rcl_dir}/libdb-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libdb-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libdb-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libdb-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libdb-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libdb-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists db) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config db $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config db $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config db $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config db $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config db $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config db $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config db $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config db $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config db" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libdb) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libdb $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libdb $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libdb $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libdb $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libdb $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libdb $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libdb $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libdb $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libdb" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/db ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/db.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/db ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libdb-5.3.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libdb-5.3.a" || \ + test -f "${__rcl_dir}/libdb-5.3.so" || \ + test -f "${__rcl_dir}/libdb-5.3.sl" || \ + test -f "${__rcl_dir}/libdb-5.3.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "db.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libdb-5.3.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + if test ".${__rcl_location_last}" = .internal; then + with_db=yes + if test ".${__rcl_location_db}" != .internal; then + as_fn_error $? "unable to find internal Berkeley-DB library" "$LINENO" 5 + fi + else + __rcl_found=yes + for ac_header in db.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "db.h" "ac_cv_header_db_h" "$ac_includes_default" +if test "x$ac_cv_header_db_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DB_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_create in -ldb-5.3" >&5 +$as_echo_n "checking for db_create in -ldb-5.3... " >&6; } +if ${ac_cv_lib_db_5_3_db_create+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldb-5.3 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char db_create (); +int +main () +{ +return db_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_db_5_3_db_create=yes +else + ac_cv_lib_db_5_3_db_create=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_db_5_3_db_create" >&5 +$as_echo "$ac_cv_lib_db_5_3_db_create" >&6; } +if test "x$ac_cv_lib_db_5_3_db_create" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDB_5_3 1 +_ACEOF + + LIBS="-ldb-5.3 $LIBS" + +fi + + test ".${ac_cv_lib_db_5_3_db_create}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_db=${__rcl_found} + fi + if test ".${with_db}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_db}" = .yes; then + +$as_echo "#define WITH_DB 1" >>confdefs.h + + fi + WITH_DB="${with_db}" + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Berkeley-DB library" >&5 +$as_echo_n "checking whether to build with Berkeley-DB library... " >&6; } + __rcl_msg="${with_db}" + if test ".${with_db}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_db}" = .yes; then + +$as_echo "#define WITH_DB 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + DBLIBSRCS="$DBLIBSRCS db3.c" + if true ; then + WITH_DB_TRUE= + WITH_DB_FALSE='#' +else + WITH_DB_TRUE='#' + WITH_DB_FALSE= +fi + + if test ".$RPM_CHECK_LIB_LOCATION" = .internal ; then + WITH_DB_INTERNAL_TRUE= + WITH_DB_INTERNAL_FALSE='#' +else + WITH_DB_INTERNAL_TRUE='#' + WITH_DB_INTERNAL_FALSE= +fi + + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + +$as_echo "#define HAVE_DB_H 1" >>confdefs.h + + else + WITH_DB_SUBDIR="" + fi + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + if false ; then + WITH_DB_TRUE= + WITH_DB_FALSE='#' +else + WITH_DB_TRUE='#' + WITH_DB_FALSE= +fi + + if false ; then + WITH_DB_INTERNAL_TRUE= + WITH_DB_INTERNAL_FALSE='#' +else + WITH_DB_INTERNAL_TRUE='#' + WITH_DB_INTERNAL_FALSE= +fi + + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + if test ".${with_sqlite+set}" != .set; then + with_sqlite="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-sqlite=$with_sqlite" >&6 + fi + + fi + if test ".${with_sqlite}" = .yes; then + with_sqlite="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-sqlite=yes to --with-sqlite=\"$with_sqlite\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_sqlite="" + __rcl_location_last="" + + WITH_SQLITE_SUBDIR="" + WITH_SQLITE_CPPFLAGS="" + WITH_SQLITE_LDFLAGS="" + WITH_SQLITE_LIBS="" + + +# Check whether --with-sqlite was given. +if test "${with_sqlite+set}" = set; then : + withval=$with_sqlite; if test ".${with_sqlite}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_sqlite}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + elif test ".${__rcl_location}" = .internal; then + + if test -d ${srcdir}/sqlite; then + + if test ".$verbose" = .yes; then + $as_echo "-- activating local sub-directory: sqlite" >&6 + fi + + if test -f ${srcdir}/sqlite/configure; then + subdirs="$subdirs sqlite" + + fi + WITH_SQLITE_SUBDIR="sqlite" + __rcl_location_sqlite=internal + + if test ".$verbose" = .yes; then + $as_echo "++ post-adjustments for --with-sqlite (${__rcl_location_sqlite})" >&6 + fi + + __rcl_dirs_inc=`echo 'sqlite' | sed -e 's/^[^:]*://' -e 's/:[^:]*$//'` + __rcl_dirs_lib=`echo 'sqlite' | sed -e 's/^[^:]*:[^:]*://'` + __rcl_srcdir="\$(top_srcdir)/\$(WITH_SQLITE_SUBDIR)" + __rcl_builddir="\$(top_builddir)/\$(WITH_SQLITE_SUBDIR)" + __rcl_firstlib="sqlite3" + if test ".${__rcl_dirs_inc}" != ".sqlite"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_SQLITE_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}" >&6 + fi + + WITH_SQLITE_CPPFLAGS="${WITH_SQLITE_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_SQLITE_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_SQLITE_CPPFLAGS="${WITH_SQLITE_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_SQLITE_CPPFLAGS: -I${__rcl_srcdir}" >&6 + fi + + WITH_SQLITE_CPPFLAGS="${WITH_SQLITE_CPPFLAGS} -I${__rcl_srcdir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_SQLITE_CPPFLAGS: -I${__rcl_builddir}" >&6 + fi + + WITH_SQLITE_CPPFLAGS="${WITH_SQLITE_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".sqlite"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_SQLITE_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_SQLITE_LDFLAGS="${WITH_SQLITE_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_SQLITE_LDFLAGS: -L${__rcl_builddir}" >&6 + fi + + WITH_SQLITE_LDFLAGS="${WITH_SQLITE_LDFLAGS} -L${__rcl_builddir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_SQLITE_LIBS: -l${__rcl_firstlib}" >&6 + fi + + WITH_SQLITE_LIBS="${WITH_SQLITE_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory sqlite" + break + else + + if test ".$verbose" = .yes; then + $as_echo "-- skipping not existing local sub-directory: sqlite" >&6 + fi + + fi + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists sqlite || pkg-config --exists libsqlite) 2>/dev/null; then + + if (pkg-config --exists sqlite) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config sqlite $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config sqlite $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config sqlite $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config sqlite $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config sqlite $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config sqlite $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config sqlite $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config sqlite $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config sqlite" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsqlite $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsqlite $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsqlite $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsqlite $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsqlite $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsqlite $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsqlite $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsqlite $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libsqlite" + fi + break + elif test ".`(sqlite-config --version; libsqlite-config --version) 2>/dev/null`" != .; then + + if test ".`(sqlite-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(sqlite-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(sqlite-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(sqlite-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(sqlite-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via sqlite-config" + else + + __rcl_flags="`(libsqlite-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libsqlite-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libsqlite-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libsqlite-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libsqlite-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lsqlite3 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sqlite3_open (); +int +main () +{ +return sqlite3_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lsqlite3 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sqlite3_open (); +int +main () +{ +return sqlite3_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/sqlite-config" && test ! -f "${__rcl_dir}/sqlite-config.in"; then + if test ".`(${__rcl_dir}/sqlite-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/sqlite-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/sqlite-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/sqlite-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/sqlite-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/sqlite-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libsqlite-config" && test ! -f "${__rcl_dir}/libsqlite-config.in"; then + if test ".`(${__rcl_dir}/libsqlite-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libsqlite-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libsqlite-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libsqlite-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libsqlite-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libsqlite-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists sqlite) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config sqlite $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config sqlite $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config sqlite $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config sqlite $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config sqlite $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config sqlite $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config sqlite $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config sqlite $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config sqlite" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libsqlite) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsqlite $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsqlite $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsqlite $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsqlite $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsqlite $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsqlite $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsqlite $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsqlite $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libsqlite" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/sqlite ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/sqlite3.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/sqlite ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libsqlite3.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libsqlite3.a" || \ + test -f "${__rcl_dir}/libsqlite3.so" || \ + test -f "${__rcl_dir}/libsqlite3.sl" || \ + test -f "${__rcl_dir}/libsqlite3.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "sqlite3.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libsqlite3.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + if test ".${__rcl_location_last}" = .internal; then + with_sqlite=yes + if test ".${__rcl_location_sqlite}" != .internal; then + as_fn_error $? "unable to find internal SQLite library" "$LINENO" 5 + fi + else + __rcl_found=yes + for ac_header in sqlite3.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sqlite3.h" "ac_cv_header_sqlite3_h" "$ac_includes_default" +if test "x$ac_cv_header_sqlite3_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SQLITE3_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqlite3_open in -lsqlite3" >&5 +$as_echo_n "checking for sqlite3_open in -lsqlite3... " >&6; } +if ${ac_cv_lib_sqlite3_sqlite3_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsqlite3 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sqlite3_open (); +int +main () +{ +return sqlite3_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_sqlite3_sqlite3_open=yes +else + ac_cv_lib_sqlite3_sqlite3_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5 +$as_echo "$ac_cv_lib_sqlite3_sqlite3_open" >&6; } +if test "x$ac_cv_lib_sqlite3_sqlite3_open" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSQLITE3 1 +_ACEOF + + LIBS="-lsqlite3 $LIBS" + +fi + + test ".${ac_cv_lib_sqlite3_sqlite3_open}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_sqlite=${__rcl_found} + fi + if test ".${with_sqlite}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_sqlite}" = .yes; then + +$as_echo "#define WITH_SQLITE 1" >>confdefs.h + + fi + WITH_SQLITE="${with_sqlite}" + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with SQLite library" >&5 +$as_echo_n "checking whether to build with SQLite library... " >&6; } + __rcl_msg="${with_sqlite}" + if test ".${with_sqlite}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_sqlite}" = .yes; then + +$as_echo "#define WITH_SQLITE 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + DBLIBSRCS="$DBLIBSRCS sqlite.c" + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable SQLite library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + if test ".${with_dbsql+set}" != .set; then + with_dbsql="yes" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-dbsql=$with_dbsql" >&6 + fi + + fi + if test ".${with_dbsql}" = .yes; then + with_dbsql="external" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-dbsql=yes to --with-dbsql=\"$with_dbsql\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_dbsql="" + __rcl_location_last="" + + WITH_DBSQL_SUBDIR="" + WITH_DBSQL_CPPFLAGS="" + WITH_DBSQL_LDFLAGS="" + WITH_DBSQL_LIBS="" + + +# Check whether --with-dbsql was given. +if test "${with_dbsql+set}" = set; then : + withval=$with_dbsql; if test ".${with_dbsql}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_dbsql}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + elif test ".${__rcl_location}" = .internal; then + + if test -d ${srcdir}/db3/sql; then + + if test ".$verbose" = .yes; then + $as_echo "-- activating local sub-directory: db3/sql" >&6 + fi + + if test -f ${srcdir}/db3/sql/configure; then + subdirs="$subdirs db3/sql" + + fi + WITH_DBSQL_SUBDIR="db3/sql" + __rcl_location_dbsql=internal + + if test ".$verbose" = .yes; then + $as_echo "++ post-adjustments for --with-dbsql (${__rcl_location_dbsql})" >&6 + fi + + __rcl_dirs_inc=`echo 'db3/sql' | sed -e 's/^[^:]*://' -e 's/:[^:]*$//'` + __rcl_dirs_lib=`echo 'db3/sql' | sed -e 's/^[^:]*:[^:]*://'` + __rcl_srcdir="\$(top_srcdir)/\$(WITH_DBSQL_SUBDIR)" + __rcl_builddir="\$(top_builddir)/\$(WITH_DBSQL_SUBDIR)" + __rcl_firstlib="db_sql-5.3" + if test ".${__rcl_dirs_inc}" != ".db3/sql"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_DBSQL_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}" >&6 + fi + + WITH_DBSQL_CPPFLAGS="${WITH_DBSQL_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_DBSQL_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_DBSQL_CPPFLAGS="${WITH_DBSQL_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_DBSQL_CPPFLAGS: -I${__rcl_srcdir}" >&6 + fi + + WITH_DBSQL_CPPFLAGS="${WITH_DBSQL_CPPFLAGS} -I${__rcl_srcdir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_DBSQL_CPPFLAGS: -I${__rcl_builddir}" >&6 + fi + + WITH_DBSQL_CPPFLAGS="${WITH_DBSQL_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".db3/sql"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_DBSQL_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_DBSQL_LDFLAGS="${WITH_DBSQL_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_DBSQL_LDFLAGS: -L${__rcl_builddir}" >&6 + fi + + WITH_DBSQL_LDFLAGS="${WITH_DBSQL_LDFLAGS} -L${__rcl_builddir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_DBSQL_LIBS: -l${__rcl_firstlib}" >&6 + fi + + WITH_DBSQL_LIBS="${WITH_DBSQL_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory db3/sql" + break + else + + if test ".$verbose" = .yes; then + $as_echo "-- skipping not existing local sub-directory: db3/sql" >&6 + fi + + fi + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists dbsql || pkg-config --exists libdbsql) 2>/dev/null; then + + if (pkg-config --exists dbsql) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config dbsql $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config dbsql $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config dbsql $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config dbsql $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config dbsql $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config dbsql $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config dbsql $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config dbsql $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config dbsql" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libdbsql $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libdbsql $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libdbsql $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libdbsql $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libdbsql $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libdbsql $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libdbsql $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libdbsql $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libdbsql" + fi + break + elif test ".`(dbsql-config --version; libdbsql-config --version) 2>/dev/null`" != .; then + + if test ".`(dbsql-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(dbsql-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(dbsql-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(dbsql-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(dbsql-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via dbsql-config" + else + + __rcl_flags="`(libdbsql-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libdbsql-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libdbsql-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libdbsql-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libdbsql-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-ldb_sql-5.3 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sqlite3_open (); +int +main () +{ +return sqlite3_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-ldb_sql-5.3 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sqlite3_open (); +int +main () +{ +return sqlite3_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/dbsql-config" && test ! -f "${__rcl_dir}/dbsql-config.in"; then + if test ".`(${__rcl_dir}/dbsql-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/dbsql-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/dbsql-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/dbsql-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/dbsql-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/dbsql-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libdbsql-config" && test ! -f "${__rcl_dir}/libdbsql-config.in"; then + if test ".`(${__rcl_dir}/libdbsql-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libdbsql-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libdbsql-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libdbsql-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libdbsql-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libdbsql-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists dbsql) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config dbsql $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config dbsql $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config dbsql $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config dbsql $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config dbsql $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config dbsql $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config dbsql $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config dbsql $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config dbsql" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libdbsql) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libdbsql $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libdbsql $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libdbsql $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libdbsql $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libdbsql $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libdbsql $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libdbsql $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libdbsql $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libdbsql" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/dbsql ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/dbsql.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/dbsql ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libdb_sql-5.3.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libdb_sql-5.3.a" || \ + test -f "${__rcl_dir}/libdb_sql-5.3.so" || \ + test -f "${__rcl_dir}/libdb_sql-5.3.sl" || \ + test -f "${__rcl_dir}/libdb_sql-5.3.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "dbsql.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libdb_sql-5.3.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + if test ".${__rcl_location_last}" = .internal; then + with_dbsql=yes + if test ".${__rcl_location_dbsql}" != .internal; then + as_fn_error $? "unable to find internal Berkeley-DB (+SQLite3) library" "$LINENO" 5 + fi + else + __rcl_found=yes + for ac_header in dbsql.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "dbsql.h" "ac_cv_header_dbsql_h" "$ac_includes_default" +if test "x$ac_cv_header_dbsql_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DBSQL_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqlite3_open in -ldb_sql-5.3" >&5 +$as_echo_n "checking for sqlite3_open in -ldb_sql-5.3... " >&6; } +if ${ac_cv_lib_db_sql_5_3_sqlite3_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldb_sql-5.3 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sqlite3_open (); +int +main () +{ +return sqlite3_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_db_sql_5_3_sqlite3_open=yes +else + ac_cv_lib_db_sql_5_3_sqlite3_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_db_sql_5_3_sqlite3_open" >&5 +$as_echo "$ac_cv_lib_db_sql_5_3_sqlite3_open" >&6; } +if test "x$ac_cv_lib_db_sql_5_3_sqlite3_open" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDB_SQL_5_3 1 +_ACEOF + + LIBS="-ldb_sql-5.3 $LIBS" + +fi + + test ".${ac_cv_lib_db_sql_5_3_sqlite3_open}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_dbsql=${__rcl_found} + fi + if test ".${with_dbsql}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_dbsql}" = .yes; then + +$as_echo "#define WITH_DBSQL 1" >>confdefs.h + + fi + WITH_DBSQL="${with_dbsql}" + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Berkeley-DB (+SQLite3) library" >&5 +$as_echo_n "checking whether to build with Berkeley-DB (+SQLite3) library... " >&6; } + __rcl_msg="${with_dbsql}" + if test ".${with_dbsql}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_dbsql}" = .yes; then + +$as_echo "#define WITH_DBSQL 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + + if true ; then + WITH_DBSQL_TRUE= + WITH_DBSQL_FALSE='#' +else + WITH_DBSQL_TRUE='#' + WITH_DBSQL_FALSE= +fi + + +$as_echo "#define WITH_SQLITE 1" >>confdefs.h + + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + WITH_DB_CPPFLAGS="${WITH_DB_CPPFLAGS} -I\$(top_srcdir)/db/sql/generated" + WITH_DB_LIBS="${WITH_DBSQL_LIBS}" + DBLIBSRCS="$DBLIBSRCS sqlite.c" + else + WITH_DBSQL_SUBDIR="" + fi + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if false ; then + WITH_DBSQL_TRUE= + WITH_DBSQL_FALSE='#' +else + WITH_DBSQL_TRUE='#' + WITH_DBSQL_FALSE= +fi + + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + +DBLIBOBJS=`echo $DBLIBSRCS | sed -e "s/\.c/\.lo/g"` + + + + + +# Check whether --with-db-largefile was given. +if test "${with_db_largefile+set}" = set; then : + withval=$with_db_largefile; +fi + + +# Check whether --with-db-mutex was given. +if test "${with_db_mutex+set}" = set; then : + withval=$with_db_mutex; +fi + + + +# Check whether --with-db-rpc was given. +if test "${with_db_rpc+set}" = set; then : + withval=$with_db_rpc; +fi + + if test ".$with_db_rpc" = .yes; then + WITH_DB_RPC_TRUE= + WITH_DB_RPC_FALSE='#' +else + WITH_DB_RPC_TRUE='#' + WITH_DB_RPC_FALSE= +fi + + + +# Check whether --with-db-tools-integrated was given. +if test "${with_db_tools_integrated+set}" = set; then : + withval=$with_db_tools_integrated; +fi + + if test ".$with_db_tools_integrated" = .yes; then + WITH_DB_TOOLS_INTEGRATED_TRUE= + WITH_DB_TOOLS_INTEGRATED_FALSE='#' +else + WITH_DB_TOOLS_INTEGRATED_TRUE='#' + WITH_DB_TOOLS_INTEGRATED_FALSE= +fi + + + if true; then + WITH_DBSQL_CODEGEN_TRUE= + WITH_DBSQL_CODEGEN_FALSE='#' +else + WITH_DBSQL_CODEGEN_TRUE='#' + WITH_DBSQL_CODEGEN_FALSE= +fi + + +DBAPI=3 + + + + + + + + if test ".${with_readline+set}" != .set; then + with_readline="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-readline=$with_readline" >&6 + fi + + fi + if test ".${with_readline}" = .yes; then + with_readline="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-readline=yes to --with-readline=\"$with_readline\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_readline="" + __rcl_location_last="" + + +# Check whether --with-readline was given. +if test "${with_readline+set}" = set; then : + withval=$with_readline; if test ".${with_readline}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_readline}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists readline || pkg-config --exists libreadline) 2>/dev/null; then + + if (pkg-config --exists readline) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config readline $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config readline $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config readline $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config readline $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config readline $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config readline $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config readline $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config readline $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config readline" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libreadline $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libreadline $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libreadline $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libreadline $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libreadline $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libreadline $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libreadline $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libreadline $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libreadline" + fi + break + elif test ".`(readline-config --version; libreadline-config --version) 2>/dev/null`" != .; then + + if test ".`(readline-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(readline-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(readline-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(readline-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(readline-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via readline-config" + else + + __rcl_flags="`(libreadline-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libreadline-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libreadline-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libreadline-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libreadline-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lreadline ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char readline (); +int +main () +{ +return readline (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lreadline ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char readline (); +int +main () +{ +return readline (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/readline-config" && test ! -f "${__rcl_dir}/readline-config.in"; then + if test ".`(${__rcl_dir}/readline-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/readline-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/readline-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/readline-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/readline-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/readline-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libreadline-config" && test ! -f "${__rcl_dir}/libreadline-config.in"; then + if test ".`(${__rcl_dir}/libreadline-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libreadline-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libreadline-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libreadline-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libreadline-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libreadline-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists readline) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config readline $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config readline $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config readline $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config readline $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config readline $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config readline $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config readline $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config readline $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config readline" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libreadline) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libreadline $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libreadline $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libreadline $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libreadline $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libreadline $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libreadline $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libreadline $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libreadline $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libreadline" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/readline ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/readline/readline.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/readline ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libreadline.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libreadline.a" || \ + test -f "${__rcl_dir}/libreadline.so" || \ + test -f "${__rcl_dir}/libreadline.sl" || \ + test -f "${__rcl_dir}/libreadline.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "readline/readline.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libreadline.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in readline/readline.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default" +if test "x$ac_cv_header_readline_readline_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_READLINE_READLINE_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 +$as_echo_n "checking for readline in -lreadline... " >&6; } +if ${ac_cv_lib_readline_readline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lreadline $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char readline (); +int +main () +{ +return readline (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_readline_readline=yes +else + ac_cv_lib_readline_readline=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 +$as_echo "$ac_cv_lib_readline_readline" >&6; } +if test "x$ac_cv_lib_readline_readline" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBREADLINE 1 +_ACEOF + + LIBS="-lreadline $LIBS" + +fi + + test ".${ac_cv_lib_readline_readline}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_readline=${__rcl_found} + + if test ".${with_readline}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_readline}" = .yes; then + +$as_echo "#define WITH_READLINE 1" >>confdefs.h + + fi + WITH_READLINE="${with_readline}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Readline library" >&5 +$as_echo_n "checking whether to build with Readline library... " >&6; } + __rcl_msg="${with_readline}" + if test ".${with_readline}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_readline}" = .yes; then + +$as_echo "#define WITH_READLINE 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + +$as_echo "#define WITH_READLINE 1" >>confdefs.h + + for ac_header in readline/history.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default" +if test "x$ac_cv_header_readline_history_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_READLINE_HISTORY_H 1 +_ACEOF + +fi + +done + + for ac_func in rl_completion_matches +do : + ac_fn_c_check_func "$LINENO" "rl_completion_matches" "ac_cv_func_rl_completion_matches" +if test "x$ac_cv_func_rl_completion_matches" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_RL_COMPLETION_MATCHES 1 +_ACEOF + +fi +done + + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Readline library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + +WITH_AUGEAS_AUGTOOL="" + + + + + + if test ".${with_augeas+set}" != .set; then + with_augeas="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-augeas=$with_augeas" >&6 + fi + + fi + if test ".${with_augeas}" = .yes; then + with_augeas="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-augeas=yes to --with-augeas=\"$with_augeas\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_augeas="" + __rcl_location_last="" + + +# Check whether --with-augeas was given. +if test "${with_augeas+set}" = set; then : + withval=$with_augeas; if test ".${with_augeas}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_augeas}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists augeas || pkg-config --exists libaugeas) 2>/dev/null; then + + if (pkg-config --exists augeas) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config augeas $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config augeas $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config augeas $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config augeas $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config augeas $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config augeas $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config augeas $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config augeas $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config augeas" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libaugeas $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libaugeas $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libaugeas $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libaugeas $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libaugeas $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libaugeas $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libaugeas $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libaugeas $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libaugeas" + fi + break + elif test ".`(augeas-config --version; libaugeas-config --version) 2>/dev/null`" != .; then + + if test ".`(augeas-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(augeas-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(augeas-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(augeas-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(augeas-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via augeas-config" + else + + __rcl_flags="`(libaugeas-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libaugeas-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libaugeas-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libaugeas-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libaugeas-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-laugeas ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char aug_init (); +int +main () +{ +return aug_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-laugeas ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char aug_init (); +int +main () +{ +return aug_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/augeas-config" && test ! -f "${__rcl_dir}/augeas-config.in"; then + if test ".`(${__rcl_dir}/augeas-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/augeas-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/augeas-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/augeas-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/augeas-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/augeas-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libaugeas-config" && test ! -f "${__rcl_dir}/libaugeas-config.in"; then + if test ".`(${__rcl_dir}/libaugeas-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libaugeas-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libaugeas-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libaugeas-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libaugeas-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libaugeas-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists augeas) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config augeas $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config augeas $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config augeas $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config augeas $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config augeas $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config augeas $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config augeas $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config augeas $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config augeas" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libaugeas) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libaugeas $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libaugeas $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libaugeas $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libaugeas $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libaugeas $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libaugeas $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libaugeas $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libaugeas $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libaugeas" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/augeas ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/augeas.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/augeas ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libaugeas.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libaugeas.a" || \ + test -f "${__rcl_dir}/libaugeas.so" || \ + test -f "${__rcl_dir}/libaugeas.sl" || \ + test -f "${__rcl_dir}/libaugeas.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "augeas.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libaugeas.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in augeas.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "augeas.h" "ac_cv_header_augeas_h" "$ac_includes_default" +if test "x$ac_cv_header_augeas_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_AUGEAS_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for aug_init in -laugeas" >&5 +$as_echo_n "checking for aug_init in -laugeas... " >&6; } +if ${ac_cv_lib_augeas_aug_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-laugeas $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char aug_init (); +int +main () +{ +return aug_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_augeas_aug_init=yes +else + ac_cv_lib_augeas_aug_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_augeas_aug_init" >&5 +$as_echo "$ac_cv_lib_augeas_aug_init" >&6; } +if test "x$ac_cv_lib_augeas_aug_init" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBAUGEAS 1 +_ACEOF + + LIBS="-laugeas $LIBS" + +fi + + test ".${ac_cv_lib_augeas_aug_init}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_augeas=${__rcl_found} + + if test ".${with_augeas}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_augeas}" = .yes; then + +$as_echo "#define WITH_AUGEAS 1" >>confdefs.h + + fi + WITH_AUGEAS="${with_augeas}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Augeas library" >&5 +$as_echo_n "checking whether to build with Augeas library... " >&6; } + __rcl_msg="${with_augeas}" + if test ".${with_augeas}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_augeas}" = .yes; then + +$as_echo "#define WITH_AUGEAS 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + WITH_AUGEAS_AUGTOOL="augtool" + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Augeas library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + +WITH_CUDF_CUDFTOOL="" + + + + + + if test ".${with_cudf+set}" != .set; then + with_cudf="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-cudf=$with_cudf" >&6 + fi + + fi + if test ".${with_cudf}" = .yes; then + with_cudf="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-cudf=yes to --with-cudf=\"$with_cudf\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_cudf="" + __rcl_location_last="" + + +# Check whether --with-cudf was given. +if test "${with_cudf+set}" = set; then : + withval=$with_cudf; if test ".${with_cudf}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_cudf}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists cudf || pkg-config --exists libcudf) 2>/dev/null; then + + if (pkg-config --exists cudf) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config cudf $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config cudf $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config cudf $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config cudf $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config cudf $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config cudf $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config cudf $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config cudf $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config cudf" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libcudf $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libcudf $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libcudf $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libcudf $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libcudf $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libcudf $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libcudf $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libcudf $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libcudf" + fi + break + elif test ".`(cudf-config --version; libcudf-config --version) 2>/dev/null`" != .; then + + if test ".`(cudf-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(cudf-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(cudf-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(cudf-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(cudf-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via cudf-config" + else + + __rcl_flags="`(libcudf-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libcudf-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libcudf-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libcudf-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libcudf-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lcudf ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cudf_parse_from_file (); +int +main () +{ +return cudf_parse_from_file (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lcudf ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cudf_parse_from_file (); +int +main () +{ +return cudf_parse_from_file (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/cudf-config" && test ! -f "${__rcl_dir}/cudf-config.in"; then + if test ".`(${__rcl_dir}/cudf-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/cudf-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/cudf-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/cudf-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/cudf-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/cudf-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libcudf-config" && test ! -f "${__rcl_dir}/libcudf-config.in"; then + if test ".`(${__rcl_dir}/libcudf-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libcudf-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libcudf-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libcudf-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libcudf-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libcudf-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists cudf) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config cudf $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config cudf $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config cudf $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config cudf $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config cudf $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config cudf $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config cudf $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config cudf $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config cudf" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libcudf) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libcudf $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libcudf $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libcudf $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libcudf $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libcudf $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libcudf $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libcudf $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libcudf $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libcudf" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/cudf ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/cudf.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/cudf ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libcudf.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libcudf.a" || \ + test -f "${__rcl_dir}/libcudf.so" || \ + test -f "${__rcl_dir}/libcudf.sl" || \ + test -f "${__rcl_dir}/libcudf.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "cudf.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libcudf.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in cudf.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "cudf.h" "ac_cv_header_cudf_h" "$ac_includes_default" +if test "x$ac_cv_header_cudf_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CUDF_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cudf_parse_from_file in -lcudf" >&5 +$as_echo_n "checking for cudf_parse_from_file in -lcudf... " >&6; } +if ${ac_cv_lib_cudf_cudf_parse_from_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcudf $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cudf_parse_from_file (); +int +main () +{ +return cudf_parse_from_file (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_cudf_cudf_parse_from_file=yes +else + ac_cv_lib_cudf_cudf_parse_from_file=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cudf_cudf_parse_from_file" >&5 +$as_echo "$ac_cv_lib_cudf_cudf_parse_from_file" >&6; } +if test "x$ac_cv_lib_cudf_cudf_parse_from_file" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCUDF 1 +_ACEOF + + LIBS="-lcudf $LIBS" + +fi + + test ".${ac_cv_lib_cudf_cudf_parse_from_file}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_cudf=${__rcl_found} + + if test ".${with_cudf}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_cudf}" = .yes; then + +$as_echo "#define WITH_CUDF 1" >>confdefs.h + + fi + WITH_CUDF="${with_cudf}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Libcudf library" >&5 +$as_echo_n "checking whether to build with Libcudf library... " >&6; } + __rcl_msg="${with_cudf}" + if test ".${with_cudf}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_cudf}" = .yes; then + +$as_echo "#define WITH_CUDF 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + WITH_CUDF_CUDFTOOL="cudftool" + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Libcudf library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + + if test ".${with_perlembed+set}" != .set; then + with_perlembed="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-perlembed=$with_perlembed" >&6 + fi + + fi + if test ".${with_perlembed}" = .yes; then + with_perlembed="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-perlembed=yes to --with-perlembed=\"$with_perlembed\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_perlembed="" + __rcl_location_last="" + + +# Check whether --with-perlembed was given. +if test "${with_perlembed+set}" = set; then : + withval=$with_perlembed; if test ".${with_perlembed}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_perlembed}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists perlembed || pkg-config --exists libperlembed) 2>/dev/null; then + + if (pkg-config --exists perlembed) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config perlembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config perlembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config perlembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config perlembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config perlembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config perlembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config perlembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config perlembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config perlembed" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libperlembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libperlembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libperlembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libperlembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libperlembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libperlembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libperlembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libperlembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libperlembed" + fi + break + elif test ".`(perlembed-config --version; libperlembed-config --version) 2>/dev/null`" != .; then + + if test ".`(perlembed-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(perlembed-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(perlembed-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(perlembed-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(perlembed-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via perlembed-config" + else + + __rcl_flags="`(libperlembed-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libperlembed-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libperlembed-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libperlembed-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libperlembed-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lperl ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char perl_alloc (); +int +main () +{ +return perl_alloc (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lperl ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char perl_alloc (); +int +main () +{ +return perl_alloc (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/perlembed-config" && test ! -f "${__rcl_dir}/perlembed-config.in"; then + if test ".`(${__rcl_dir}/perlembed-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/perlembed-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/perlembed-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/perlembed-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/perlembed-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/perlembed-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libperlembed-config" && test ! -f "${__rcl_dir}/libperlembed-config.in"; then + if test ".`(${__rcl_dir}/libperlembed-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libperlembed-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libperlembed-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libperlembed-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libperlembed-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libperlembed-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists perlembed) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config perlembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config perlembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config perlembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config perlembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config perlembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config perlembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config perlembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config perlembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config perlembed" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libperlembed) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libperlembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libperlembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libperlembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libperlembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libperlembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libperlembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libperlembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libperlembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libperlembed" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/perlembed ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/EXTERN.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/perlembed ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libperl.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libperl.a" || \ + test -f "${__rcl_dir}/libperl.so" || \ + test -f "${__rcl_dir}/libperl.sl" || \ + test -f "${__rcl_dir}/libperl.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "EXTERN.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libperl.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in EXTERN.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "EXTERN.h" "ac_cv_header_EXTERN_h" "$ac_includes_default" +if test "x$ac_cv_header_EXTERN_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_EXTERN_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl_alloc in -lperl" >&5 +$as_echo_n "checking for perl_alloc in -lperl... " >&6; } +if ${ac_cv_lib_perl_perl_alloc+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lperl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char perl_alloc (); +int +main () +{ +return perl_alloc (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_perl_perl_alloc=yes +else + ac_cv_lib_perl_perl_alloc=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_perl_perl_alloc" >&5 +$as_echo "$ac_cv_lib_perl_perl_alloc" >&6; } +if test "x$ac_cv_lib_perl_perl_alloc" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPERL 1 +_ACEOF + + LIBS="-lperl $LIBS" + +fi + + test ".${ac_cv_lib_perl_perl_alloc}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_perlembed=${__rcl_found} + + if test ".${with_perlembed}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_perlembed}" = .yes; then + +$as_echo "#define WITH_PERLEMBED 1" >>confdefs.h + + fi + WITH_PERLEMBED="${with_perlembed}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Perl ExtUtils::Embed library" >&5 +$as_echo_n "checking whether to build with Perl ExtUtils::Embed library... " >&6; } + __rcl_msg="${with_perlembed}" + if test ".${with_perlembed}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_perlembed}" = .yes; then + +$as_echo "#define WITH_PERLEMBED 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Perl ExtUtils::Embed library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + if test ".${with_pythonembed+set}" != .set; then + with_pythonembed="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-pythonembed=$with_pythonembed" >&6 + fi + + fi + if test ".${with_pythonembed}" = .yes; then + with_pythonembed="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-pythonembed=yes to --with-pythonembed=\"$with_pythonembed\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_pythonembed="" + __rcl_location_last="" + + +# Check whether --with-pythonembed was given. +if test "${with_pythonembed+set}" = set; then : + withval=$with_pythonembed; if test ".${with_pythonembed}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_pythonembed}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists pythonembed || pkg-config --exists libpythonembed) 2>/dev/null; then + + if (pkg-config --exists pythonembed) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config pythonembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config pythonembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config pythonembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config pythonembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config pythonembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config pythonembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config pythonembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config pythonembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config pythonembed" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libpythonembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libpythonembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libpythonembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libpythonembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libpythonembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libpythonembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libpythonembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libpythonembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libpythonembed" + fi + break + elif test ".`(pythonembed-config --version; libpythonembed-config --version) 2>/dev/null`" != .; then + + if test ".`(pythonembed-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(pythonembed-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(pythonembed-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(pythonembed-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(pythonembed-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pythonembed-config" + else + + __rcl_flags="`(libpythonembed-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libpythonembed-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libpythonembed-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libpythonembed-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libpythonembed-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lpython2.7 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Py_Initialize (); +int +main () +{ +return Py_Initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lpython2.6 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Py_Initialize (); +int +main () +{ +return Py_Initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lpython2.5 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Py_Initialize (); +int +main () +{ +return Py_Initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lpython2.4 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Py_Initialize (); +int +main () +{ +return Py_Initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lpython2.7 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Py_Initialize (); +int +main () +{ +return Py_Initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lpython2.6 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Py_Initialize (); +int +main () +{ +return Py_Initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lpython2.5 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Py_Initialize (); +int +main () +{ +return Py_Initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lpython2.4 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Py_Initialize (); +int +main () +{ +return Py_Initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pythonembed-config" && test ! -f "${__rcl_dir}/pythonembed-config.in"; then + if test ".`(${__rcl_dir}/pythonembed-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/pythonembed-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/pythonembed-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/pythonembed-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/pythonembed-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pythonembed-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libpythonembed-config" && test ! -f "${__rcl_dir}/libpythonembed-config.in"; then + if test ".`(${__rcl_dir}/libpythonembed-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libpythonembed-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libpythonembed-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libpythonembed-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libpythonembed-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libpythonembed-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists pythonembed) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config pythonembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config pythonembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config pythonembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config pythonembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config pythonembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config pythonembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config pythonembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config pythonembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config pythonembed" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libpythonembed) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libpythonembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libpythonembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libpythonembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libpythonembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libpythonembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libpythonembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libpythonembed $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libpythonembed $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libpythonembed" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/pythonembed ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/Python.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/pythonembed ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libpython2.7.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libpython2.7.a" || \ + test -f "${__rcl_dir}/libpython2.7.so" || \ + test -f "${__rcl_dir}/libpython2.7.sl" || \ + test -f "${__rcl_dir}/libpython2.7.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + if test -f "${__rcl_dir}/libpython2.6.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libpython2.6.a" || \ + test -f "${__rcl_dir}/libpython2.6.so" || \ + test -f "${__rcl_dir}/libpython2.6.sl" || \ + test -f "${__rcl_dir}/libpython2.6.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + if test -f "${__rcl_dir}/libpython2.5.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libpython2.5.a" || \ + test -f "${__rcl_dir}/libpython2.5.so" || \ + test -f "${__rcl_dir}/libpython2.5.sl" || \ + test -f "${__rcl_dir}/libpython2.5.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + if test -f "${__rcl_dir}/libpython2.4.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libpython2.4.a" || \ + test -f "${__rcl_dir}/libpython2.4.so" || \ + test -f "${__rcl_dir}/libpython2.4.sl" || \ + test -f "${__rcl_dir}/libpython2.4.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "Python.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libpython2.7.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + for __rcl_file in _ `find ${__rcl_location} -name "libpython2.6.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + for __rcl_file in _ `find ${__rcl_location} -name "libpython2.5.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + for __rcl_file in _ `find ${__rcl_location} -name "libpython2.4.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in Python.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default" +if test "x$ac_cv_header_Python_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PYTHON_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Py_Initialize in -lpython2.7" >&5 +$as_echo_n "checking for Py_Initialize in -lpython2.7... " >&6; } +if ${ac_cv_lib_python2_7_Py_Initialize+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpython2.7 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Py_Initialize (); +int +main () +{ +return Py_Initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_python2_7_Py_Initialize=yes +else + ac_cv_lib_python2_7_Py_Initialize=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_python2_7_Py_Initialize" >&5 +$as_echo "$ac_cv_lib_python2_7_Py_Initialize" >&6; } +if test "x$ac_cv_lib_python2_7_Py_Initialize" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPYTHON2_7 1 +_ACEOF + + LIBS="-lpython2.7 $LIBS" + +fi + + test ".${ac_cv_lib_python2_7_Py_Initialize}" = .yes && __rcl_found_lib=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Py_Initialize in -lpython2.6" >&5 +$as_echo_n "checking for Py_Initialize in -lpython2.6... " >&6; } +if ${ac_cv_lib_python2_6_Py_Initialize+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpython2.6 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Py_Initialize (); +int +main () +{ +return Py_Initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_python2_6_Py_Initialize=yes +else + ac_cv_lib_python2_6_Py_Initialize=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_python2_6_Py_Initialize" >&5 +$as_echo "$ac_cv_lib_python2_6_Py_Initialize" >&6; } +if test "x$ac_cv_lib_python2_6_Py_Initialize" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPYTHON2_6 1 +_ACEOF + + LIBS="-lpython2.6 $LIBS" + +fi + + test ".${ac_cv_lib_python2_6_Py_Initialize}" = .yes && __rcl_found_lib=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Py_Initialize in -lpython2.5" >&5 +$as_echo_n "checking for Py_Initialize in -lpython2.5... " >&6; } +if ${ac_cv_lib_python2_5_Py_Initialize+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpython2.5 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Py_Initialize (); +int +main () +{ +return Py_Initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_python2_5_Py_Initialize=yes +else + ac_cv_lib_python2_5_Py_Initialize=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_python2_5_Py_Initialize" >&5 +$as_echo "$ac_cv_lib_python2_5_Py_Initialize" >&6; } +if test "x$ac_cv_lib_python2_5_Py_Initialize" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPYTHON2_5 1 +_ACEOF + + LIBS="-lpython2.5 $LIBS" + +fi + + test ".${ac_cv_lib_python2_5_Py_Initialize}" = .yes && __rcl_found_lib=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Py_Initialize in -lpython2.4" >&5 +$as_echo_n "checking for Py_Initialize in -lpython2.4... " >&6; } +if ${ac_cv_lib_python2_4_Py_Initialize+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpython2.4 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Py_Initialize (); +int +main () +{ +return Py_Initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_python2_4_Py_Initialize=yes +else + ac_cv_lib_python2_4_Py_Initialize=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_python2_4_Py_Initialize" >&5 +$as_echo "$ac_cv_lib_python2_4_Py_Initialize" >&6; } +if test "x$ac_cv_lib_python2_4_Py_Initialize" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPYTHON2_4 1 +_ACEOF + + LIBS="-lpython2.4 $LIBS" + +fi + + test ".${ac_cv_lib_python2_4_Py_Initialize}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_pythonembed=${__rcl_found} + + if test ".${with_pythonembed}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_pythonembed}" = .yes; then + +$as_echo "#define WITH_PYTHONEMBED 1" >>confdefs.h + + fi + WITH_PYTHONEMBED="${with_pythonembed}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Python embedding library" >&5 +$as_echo_n "checking whether to build with Python embedding library... " >&6; } + __rcl_msg="${with_pythonembed}" + if test ".${with_pythonembed}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_pythonembed}" = .yes; then + +$as_echo "#define WITH_PYTHONEMBED 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Python embedding library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + +WITH_RUBY_SUBDIR="" +WITH_RUBY_CPPFLAGS="" +WITH_RUBY_VENDORARCHDIR="" + + + + + + if test ".${with_ruby+set}" != .set; then + with_ruby="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-ruby=$with_ruby" >&6 + fi + + fi + if test ".${with_ruby}" = .yes; then + with_ruby="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-ruby=yes to --with-ruby=\"$with_ruby\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_ruby="" + __rcl_location_last="" + + +# Check whether --with-ruby was given. +if test "${with_ruby+set}" = set; then : + withval=$with_ruby; if test ".${with_ruby}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_ruby}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists ruby || pkg-config --exists libruby) 2>/dev/null; then + + if (pkg-config --exists ruby) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config ruby $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config ruby $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config ruby $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config ruby $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config ruby $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config ruby $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config ruby $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config ruby $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config ruby" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libruby $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libruby $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libruby $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libruby $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libruby $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libruby $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libruby $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libruby $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libruby" + fi + break + elif test ".`(ruby-config --version; libruby-config --version) 2>/dev/null`" != .; then + + if test ".`(ruby-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(ruby-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(ruby-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(ruby-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(ruby-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ruby-config" + else + + __rcl_flags="`(libruby-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libruby-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libruby-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libruby-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libruby-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lruby ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ruby_init (); +int +main () +{ +return ruby_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lruby ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ruby_init (); +int +main () +{ +return ruby_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/ruby-config" && test ! -f "${__rcl_dir}/ruby-config.in"; then + if test ".`(${__rcl_dir}/ruby-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/ruby-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/ruby-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/ruby-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/ruby-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/ruby-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libruby-config" && test ! -f "${__rcl_dir}/libruby-config.in"; then + if test ".`(${__rcl_dir}/libruby-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libruby-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libruby-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libruby-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libruby-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libruby-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists ruby) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config ruby $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config ruby $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config ruby $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config ruby $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config ruby $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config ruby $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config ruby $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config ruby $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config ruby" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libruby) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libruby $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libruby $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libruby $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libruby $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libruby $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libruby $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libruby $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libruby $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libruby" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/ruby ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/ruby.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/ruby ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libruby.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libruby.a" || \ + test -f "${__rcl_dir}/libruby.so" || \ + test -f "${__rcl_dir}/libruby.sl" || \ + test -f "${__rcl_dir}/libruby.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "ruby.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libruby.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in ruby.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ruby.h" "ac_cv_header_ruby_h" "$ac_includes_default" +if test "x$ac_cv_header_ruby_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_RUBY_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ruby_init in -lruby" >&5 +$as_echo_n "checking for ruby_init in -lruby... " >&6; } +if ${ac_cv_lib_ruby_ruby_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lruby $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ruby_init (); +int +main () +{ +return ruby_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ruby_ruby_init=yes +else + ac_cv_lib_ruby_ruby_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ruby_ruby_init" >&5 +$as_echo "$ac_cv_lib_ruby_ruby_init" >&6; } +if test "x$ac_cv_lib_ruby_ruby_init" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBRUBY 1 +_ACEOF + + LIBS="-lruby $LIBS" + +fi + + test ".${ac_cv_lib_ruby_ruby_init}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_ruby=${__rcl_found} + + if test ".${with_ruby}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_ruby}" = .yes; then + +$as_echo "#define WITH_RUBY 1" >>confdefs.h + + fi + WITH_RUBY="${with_ruby}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Ruby library" >&5 +$as_echo_n "checking whether to build with Ruby library... " >&6; } + __rcl_msg="${with_ruby}" + if test ".${with_ruby}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_ruby}" = .yes; then + +$as_echo "#define WITH_RUBY 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + +$as_echo "#define WITH_RUBYEMBED 1" >>confdefs.h + + WITH_RUBY_SUBDIR=ruby + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Ruby library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + + + + + if test ".${with_squirrel+set}" != .set; then + with_squirrel="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-squirrel=$with_squirrel" >&6 + fi + + fi + if test ".${with_squirrel}" = .yes; then + with_squirrel="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-squirrel=yes to --with-squirrel=\"$with_squirrel\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_squirrel="" + __rcl_location_last="" + + +# Check whether --with-squirrel was given. +if test "${with_squirrel+set}" = set; then : + withval=$with_squirrel; if test ".${with_squirrel}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_squirrel}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists squirrel || pkg-config --exists libsquirrel) 2>/dev/null; then + + if (pkg-config --exists squirrel) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config squirrel $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config squirrel $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config squirrel $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config squirrel $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config squirrel $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config squirrel $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config squirrel $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config squirrel $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config squirrel" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsquirrel $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsquirrel $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsquirrel $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsquirrel $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsquirrel $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsquirrel $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsquirrel $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsquirrel $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libsquirrel" + fi + break + elif test ".`(squirrel-config --version; libsquirrel-config --version) 2>/dev/null`" != .; then + + if test ".`(squirrel-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(squirrel-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(squirrel-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(squirrel-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(squirrel-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via squirrel-config" + else + + __rcl_flags="`(libsquirrel-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libsquirrel-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libsquirrel-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libsquirrel-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libsquirrel-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lsquirrel ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sq_open (); +int +main () +{ +return sq_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lsquirrel ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sq_open (); +int +main () +{ +return sq_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/squirrel-config" && test ! -f "${__rcl_dir}/squirrel-config.in"; then + if test ".`(${__rcl_dir}/squirrel-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/squirrel-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/squirrel-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/squirrel-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/squirrel-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/squirrel-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libsquirrel-config" && test ! -f "${__rcl_dir}/libsquirrel-config.in"; then + if test ".`(${__rcl_dir}/libsquirrel-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libsquirrel-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libsquirrel-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libsquirrel-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libsquirrel-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libsquirrel-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists squirrel) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config squirrel $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config squirrel $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config squirrel $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config squirrel $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config squirrel $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config squirrel $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config squirrel $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config squirrel $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config squirrel" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libsquirrel) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsquirrel $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsquirrel $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsquirrel $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsquirrel $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsquirrel $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsquirrel $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsquirrel $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsquirrel $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libsquirrel" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/squirrel ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/squirrel.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/squirrel ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libsquirrel.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libsquirrel.a" || \ + test -f "${__rcl_dir}/libsquirrel.so" || \ + test -f "${__rcl_dir}/libsquirrel.sl" || \ + test -f "${__rcl_dir}/libsquirrel.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "squirrel.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libsquirrel.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in squirrel.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "squirrel.h" "ac_cv_header_squirrel_h" "$ac_includes_default" +if test "x$ac_cv_header_squirrel_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SQUIRREL_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sq_open in -lsquirrel" >&5 +$as_echo_n "checking for sq_open in -lsquirrel... " >&6; } +if ${ac_cv_lib_squirrel_sq_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsquirrel $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sq_open (); +int +main () +{ +return sq_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_squirrel_sq_open=yes +else + ac_cv_lib_squirrel_sq_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_squirrel_sq_open" >&5 +$as_echo "$ac_cv_lib_squirrel_sq_open" >&6; } +if test "x$ac_cv_lib_squirrel_sq_open" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSQUIRREL 1 +_ACEOF + + LIBS="-lsquirrel $LIBS" + +fi + + test ".${ac_cv_lib_squirrel_sq_open}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_squirrel=${__rcl_found} + + if test ".${with_squirrel}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_squirrel}" = .yes; then + +$as_echo "#define WITH_SQUIRREL 1" >>confdefs.h + + fi + WITH_SQUIRREL="${with_squirrel}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Squirrel library" >&5 +$as_echo_n "checking whether to build with Squirrel library... " >&6; } + __rcl_msg="${with_squirrel}" + if test ".${with_squirrel}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_squirrel}" = .yes; then + +$as_echo "#define WITH_SQUIRREL 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Squirrel library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + +WITH_TCL_SUBDIR="" + + + + + + if test ".${with_tcl+set}" != .set; then + with_tcl="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-tcl=$with_tcl" >&6 + fi + + fi + if test ".${with_tcl}" = .yes; then + with_tcl="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-tcl=yes to --with-tcl=\"$with_tcl\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_tcl="" + __rcl_location_last="" + + +# Check whether --with-tcl was given. +if test "${with_tcl+set}" = set; then : + withval=$with_tcl; if test ".${with_tcl}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_tcl}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists tcl || pkg-config --exists libtcl) 2>/dev/null; then + + if (pkg-config --exists tcl) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config tcl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config tcl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config tcl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config tcl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config tcl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config tcl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config tcl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config tcl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config tcl" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libtcl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libtcl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libtcl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libtcl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libtcl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libtcl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libtcl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libtcl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libtcl" + fi + break + elif test ".`(tcl-config --version; libtcl-config --version) 2>/dev/null`" != .; then + + if test ".`(tcl-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(tcl-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(tcl-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(tcl-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(tcl-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via tcl-config" + else + + __rcl_flags="`(libtcl-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libtcl-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libtcl-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libtcl-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libtcl-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-ltcl8.6 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Tcl_CreateInterp (); +int +main () +{ +return Tcl_CreateInterp (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + __rcl_safe_LIBS="${LIBS}" + LIBS="-ltcl8.5 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Tcl_CreateInterp (); +int +main () +{ +return Tcl_CreateInterp (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + __rcl_safe_LIBS="${LIBS}" + LIBS="-ltcl ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Tcl_CreateInterp (); +int +main () +{ +return Tcl_CreateInterp (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-ltcl8.6 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Tcl_CreateInterp (); +int +main () +{ +return Tcl_CreateInterp (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + __rcl_safe_LIBS="${LIBS}" + LIBS="-ltcl8.5 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Tcl_CreateInterp (); +int +main () +{ +return Tcl_CreateInterp (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + __rcl_safe_LIBS="${LIBS}" + LIBS="-ltcl ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Tcl_CreateInterp (); +int +main () +{ +return Tcl_CreateInterp (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/tcl-config" && test ! -f "${__rcl_dir}/tcl-config.in"; then + if test ".`(${__rcl_dir}/tcl-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/tcl-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/tcl-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/tcl-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/tcl-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/tcl-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libtcl-config" && test ! -f "${__rcl_dir}/libtcl-config.in"; then + if test ".`(${__rcl_dir}/libtcl-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libtcl-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libtcl-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libtcl-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libtcl-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libtcl-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists tcl) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config tcl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config tcl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config tcl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config tcl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config tcl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config tcl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config tcl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config tcl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config tcl" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libtcl) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libtcl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libtcl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libtcl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libtcl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libtcl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libtcl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libtcl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libtcl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libtcl" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/tcl ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/tcl.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/tcl ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libtcl8.6.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libtcl8.6.a" || \ + test -f "${__rcl_dir}/libtcl8.6.so" || \ + test -f "${__rcl_dir}/libtcl8.6.sl" || \ + test -f "${__rcl_dir}/libtcl8.6.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + if test -f "${__rcl_dir}/libtcl8.5.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libtcl8.5.a" || \ + test -f "${__rcl_dir}/libtcl8.5.so" || \ + test -f "${__rcl_dir}/libtcl8.5.sl" || \ + test -f "${__rcl_dir}/libtcl8.5.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + if test -f "${__rcl_dir}/libtcl.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libtcl.a" || \ + test -f "${__rcl_dir}/libtcl.so" || \ + test -f "${__rcl_dir}/libtcl.sl" || \ + test -f "${__rcl_dir}/libtcl.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "tcl.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libtcl8.6.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + for __rcl_file in _ `find ${__rcl_location} -name "libtcl8.5.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + for __rcl_file in _ `find ${__rcl_location} -name "libtcl.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in tcl.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "tcl.h" "ac_cv_header_tcl_h" "$ac_includes_default" +if test "x$ac_cv_header_tcl_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_TCL_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl_CreateInterp in -ltcl8.6" >&5 +$as_echo_n "checking for Tcl_CreateInterp in -ltcl8.6... " >&6; } +if ${ac_cv_lib_tcl8_6_Tcl_CreateInterp+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltcl8.6 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Tcl_CreateInterp (); +int +main () +{ +return Tcl_CreateInterp (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_tcl8_6_Tcl_CreateInterp=yes +else + ac_cv_lib_tcl8_6_Tcl_CreateInterp=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tcl8_6_Tcl_CreateInterp" >&5 +$as_echo "$ac_cv_lib_tcl8_6_Tcl_CreateInterp" >&6; } +if test "x$ac_cv_lib_tcl8_6_Tcl_CreateInterp" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBTCL8_6 1 +_ACEOF + + LIBS="-ltcl8.6 $LIBS" + +fi + + test ".${ac_cv_lib_tcl8_6_Tcl_CreateInterp}" = .yes && __rcl_found_lib=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl_CreateInterp in -ltcl8.5" >&5 +$as_echo_n "checking for Tcl_CreateInterp in -ltcl8.5... " >&6; } +if ${ac_cv_lib_tcl8_5_Tcl_CreateInterp+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltcl8.5 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Tcl_CreateInterp (); +int +main () +{ +return Tcl_CreateInterp (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_tcl8_5_Tcl_CreateInterp=yes +else + ac_cv_lib_tcl8_5_Tcl_CreateInterp=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tcl8_5_Tcl_CreateInterp" >&5 +$as_echo "$ac_cv_lib_tcl8_5_Tcl_CreateInterp" >&6; } +if test "x$ac_cv_lib_tcl8_5_Tcl_CreateInterp" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBTCL8_5 1 +_ACEOF + + LIBS="-ltcl8.5 $LIBS" + +fi + + test ".${ac_cv_lib_tcl8_5_Tcl_CreateInterp}" = .yes && __rcl_found_lib=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl_CreateInterp in -ltcl" >&5 +$as_echo_n "checking for Tcl_CreateInterp in -ltcl... " >&6; } +if ${ac_cv_lib_tcl_Tcl_CreateInterp+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltcl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Tcl_CreateInterp (); +int +main () +{ +return Tcl_CreateInterp (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_tcl_Tcl_CreateInterp=yes +else + ac_cv_lib_tcl_Tcl_CreateInterp=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tcl_Tcl_CreateInterp" >&5 +$as_echo "$ac_cv_lib_tcl_Tcl_CreateInterp" >&6; } +if test "x$ac_cv_lib_tcl_Tcl_CreateInterp" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBTCL 1 +_ACEOF + + LIBS="-ltcl $LIBS" + +fi + + test ".${ac_cv_lib_tcl_Tcl_CreateInterp}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_tcl=${__rcl_found} + + if test ".${with_tcl}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_tcl}" = .yes; then + +$as_echo "#define WITH_TCL 1" >>confdefs.h + + fi + WITH_TCL="${with_tcl}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Tcl library" >&5 +$as_echo_n "checking whether to build with Tcl library... " >&6; } + __rcl_msg="${with_tcl}" + if test ".${with_tcl}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_tcl}" = .yes; then + +$as_echo "#define WITH_TCL 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Tcl library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + + if test ".${with_ficl+set}" != .set; then + with_ficl="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-ficl=$with_ficl" >&6 + fi + + fi + if test ".${with_ficl}" = .yes; then + with_ficl="internal:external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-ficl=yes to --with-ficl=\"$with_ficl\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_ficl="" + __rcl_location_last="" + + WITH_FICL_SUBDIR="" + WITH_FICL_CPPFLAGS="" + WITH_FICL_LDFLAGS="" + WITH_FICL_LIBS="" + + +# Check whether --with-ficl was given. +if test "${with_ficl+set}" = set; then : + withval=$with_ficl; if test ".${with_ficl}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_ficl}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + elif test ".${__rcl_location}" = .internal; then + + if test -d ${srcdir}/ficl; then + + if test ".$verbose" = .yes; then + $as_echo "-- activating local sub-directory: ficl" >&6 + fi + + if test -f ${srcdir}/ficl/configure; then + subdirs="$subdirs ficl" + + fi + WITH_FICL_SUBDIR="ficl" + __rcl_location_ficl=internal + + if test ".$verbose" = .yes; then + $as_echo "++ post-adjustments for --with-ficl (${__rcl_location_ficl})" >&6 + fi + + __rcl_dirs_inc=`echo 'ficl' | sed -e 's/^[^:]*://' -e 's/:[^:]*$//'` + __rcl_dirs_lib=`echo 'ficl' | sed -e 's/^[^:]*:[^:]*://'` + __rcl_srcdir="\$(top_srcdir)/\$(WITH_FICL_SUBDIR)" + __rcl_builddir="\$(top_builddir)/\$(WITH_FICL_SUBDIR)" + __rcl_firstlib="ficl" + if test ".${__rcl_dirs_inc}" != ".ficl"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_FICL_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}" >&6 + fi + + WITH_FICL_CPPFLAGS="${WITH_FICL_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_FICL_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_FICL_CPPFLAGS="${WITH_FICL_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_FICL_CPPFLAGS: -I${__rcl_srcdir}" >&6 + fi + + WITH_FICL_CPPFLAGS="${WITH_FICL_CPPFLAGS} -I${__rcl_srcdir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_FICL_CPPFLAGS: -I${__rcl_builddir}" >&6 + fi + + WITH_FICL_CPPFLAGS="${WITH_FICL_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".ficl"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_FICL_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_FICL_LDFLAGS="${WITH_FICL_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_FICL_LDFLAGS: -L${__rcl_builddir}" >&6 + fi + + WITH_FICL_LDFLAGS="${WITH_FICL_LDFLAGS} -L${__rcl_builddir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_FICL_LIBS: -l${__rcl_firstlib}" >&6 + fi + + WITH_FICL_LIBS="${WITH_FICL_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory ficl" + break + else + + if test ".$verbose" = .yes; then + $as_echo "-- skipping not existing local sub-directory: ficl" >&6 + fi + + fi + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists ficl || pkg-config --exists libficl) 2>/dev/null; then + + if (pkg-config --exists ficl) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config ficl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config ficl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config ficl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config ficl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config ficl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config ficl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config ficl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config ficl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config ficl" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libficl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libficl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libficl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libficl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libficl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libficl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libficl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libficl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libficl" + fi + break + elif test ".`(ficl-config --version; libficl-config --version) 2>/dev/null`" != .; then + + if test ".`(ficl-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(ficl-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(ficl-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(ficl-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(ficl-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ficl-config" + else + + __rcl_flags="`(libficl-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libficl-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libficl-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libficl-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libficl-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lficl ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ficlSystemCreate (); +int +main () +{ +return ficlSystemCreate (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lficl ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ficlSystemCreate (); +int +main () +{ +return ficlSystemCreate (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/ficl-config" && test ! -f "${__rcl_dir}/ficl-config.in"; then + if test ".`(${__rcl_dir}/ficl-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/ficl-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/ficl-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/ficl-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/ficl-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/ficl-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libficl-config" && test ! -f "${__rcl_dir}/libficl-config.in"; then + if test ".`(${__rcl_dir}/libficl-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libficl-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libficl-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libficl-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libficl-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libficl-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists ficl) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config ficl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config ficl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config ficl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config ficl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config ficl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config ficl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config ficl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config ficl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config ficl" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libficl) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libficl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libficl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libficl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libficl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libficl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libficl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libficl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libficl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libficl" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/ficl ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/ficl.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/ficl ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libficl.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libficl.a" || \ + test -f "${__rcl_dir}/libficl.so" || \ + test -f "${__rcl_dir}/libficl.sl" || \ + test -f "${__rcl_dir}/libficl.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "ficl.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libficl.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + if test ".${__rcl_location_last}" = .internal; then + with_ficl=yes + if test ".${__rcl_location_ficl}" != .internal; then + as_fn_error $? "unable to find internal FICL library" "$LINENO" 5 + fi + else + __rcl_found=yes + for ac_header in ficl.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ficl.h" "ac_cv_header_ficl_h" "$ac_includes_default" +if test "x$ac_cv_header_ficl_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FICL_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ficlSystemCreate in -lficl" >&5 +$as_echo_n "checking for ficlSystemCreate in -lficl... " >&6; } +if ${ac_cv_lib_ficl_ficlSystemCreate+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lficl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ficlSystemCreate (); +int +main () +{ +return ficlSystemCreate (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ficl_ficlSystemCreate=yes +else + ac_cv_lib_ficl_ficlSystemCreate=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ficl_ficlSystemCreate" >&5 +$as_echo "$ac_cv_lib_ficl_ficlSystemCreate" >&6; } +if test "x$ac_cv_lib_ficl_ficlSystemCreate" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBFICL 1 +_ACEOF + + LIBS="-lficl $LIBS" + +fi + + test ".${ac_cv_lib_ficl_ficlSystemCreate}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_ficl=${__rcl_found} + fi + if test ".${with_ficl}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_ficl}" = .yes; then + +$as_echo "#define WITH_FICL 1" >>confdefs.h + + fi + WITH_FICL="${with_ficl}" + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with FICL library" >&5 +$as_echo_n "checking whether to build with FICL library... " >&6; } + __rcl_msg="${with_ficl}" + if test ".${with_ficl}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_ficl}" = .yes; then + +$as_echo "#define WITH_FICL 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + +$as_echo "#define HAVE_FICL_H 1" >>confdefs.h + + +$as_echo "#define HAVE_LIBFICL 1" >>confdefs.h + + fi + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable FICL library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + if test ".${with_aterm+set}" != .set; then + with_aterm="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-aterm=$with_aterm" >&6 + fi + + fi + if test ".${with_aterm}" = .yes; then + with_aterm="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-aterm=yes to --with-aterm=\"$with_aterm\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_aterm="" + __rcl_location_last="" + + +# Check whether --with-aterm was given. +if test "${with_aterm+set}" = set; then : + withval=$with_aterm; if test ".${with_aterm}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_aterm}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists aterm || pkg-config --exists libaterm) 2>/dev/null; then + + if (pkg-config --exists aterm) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config aterm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config aterm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config aterm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config aterm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config aterm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config aterm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config aterm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config aterm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config aterm" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libaterm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libaterm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libaterm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libaterm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libaterm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libaterm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libaterm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libaterm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libaterm" + fi + break + elif test ".`(aterm-config --version; libaterm-config --version) 2>/dev/null`" != .; then + + if test ".`(aterm-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(aterm-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(aterm-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(aterm-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(aterm-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via aterm-config" + else + + __rcl_flags="`(libaterm-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libaterm-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libaterm-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libaterm-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libaterm-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lATerm ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ATinit (); +int +main () +{ +return ATinit (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lATerm ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ATinit (); +int +main () +{ +return ATinit (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/aterm-config" && test ! -f "${__rcl_dir}/aterm-config.in"; then + if test ".`(${__rcl_dir}/aterm-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/aterm-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/aterm-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/aterm-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/aterm-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/aterm-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libaterm-config" && test ! -f "${__rcl_dir}/libaterm-config.in"; then + if test ".`(${__rcl_dir}/libaterm-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libaterm-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libaterm-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libaterm-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libaterm-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libaterm-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists aterm) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config aterm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config aterm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config aterm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config aterm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config aterm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config aterm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config aterm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config aterm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config aterm" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libaterm) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libaterm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libaterm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libaterm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libaterm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libaterm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libaterm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libaterm $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libaterm $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libaterm" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/aterm ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/aterm1.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/aterm ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libATerm.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libATerm.a" || \ + test -f "${__rcl_dir}/libATerm.so" || \ + test -f "${__rcl_dir}/libATerm.sl" || \ + test -f "${__rcl_dir}/libATerm.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "aterm1.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libATerm.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in aterm1.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "aterm1.h" "ac_cv_header_aterm1_h" "$ac_includes_default" +if test "x$ac_cv_header_aterm1_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ATERM1_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ATinit in -lATerm" >&5 +$as_echo_n "checking for ATinit in -lATerm... " >&6; } +if ${ac_cv_lib_ATerm_ATinit+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lATerm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ATinit (); +int +main () +{ +return ATinit (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ATerm_ATinit=yes +else + ac_cv_lib_ATerm_ATinit=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ATerm_ATinit" >&5 +$as_echo "$ac_cv_lib_ATerm_ATinit" >&6; } +if test "x$ac_cv_lib_ATerm_ATinit" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBATERM 1 +_ACEOF + + LIBS="-lATerm $LIBS" + +fi + + test ".${ac_cv_lib_ATerm_ATinit}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_aterm=${__rcl_found} + + if test ".${with_aterm}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_aterm}" = .yes; then + +$as_echo "#define WITH_ATERM 1" >>confdefs.h + + fi + WITH_ATERM="${with_aterm}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with ATerm library" >&5 +$as_echo_n "checking whether to build with ATerm library... " >&6; } + __rcl_msg="${with_aterm}" + if test ".${with_aterm}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_aterm}" = .yes; then + +$as_echo "#define WITH_ATERM 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable ATerm library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + + + + + if test ".${with_nix+set}" != .set; then + with_nix="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-nix=$with_nix" >&6 + fi + + fi + if test ".${with_nix}" = .yes; then + with_nix="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-nix=yes to --with-nix=\"$with_nix\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_nix="" + __rcl_location_last="" + + +# Check whether --with-nix was given. +if test "${with_nix+set}" = set; then : + withval=$with_nix; if test ".${with_nix}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_nix}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists nix || pkg-config --exists libnix) 2>/dev/null; then + + if (pkg-config --exists nix) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config nix $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config nix $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config nix $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config nix $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config nix $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config nix $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config nix $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config nix $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config nix" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libnix $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libnix $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libnix $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libnix $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libnix $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libnix $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libnix $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libnix $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libnix" + fi + break + elif test ".`(nix-config --version; libnix-config --version) 2>/dev/null`" != .; then + + if test ".`(nix-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(nix-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(nix-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(nix-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(nix-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via nix-config" + else + + __rcl_flags="`(libnix-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libnix-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libnix-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libnix-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libnix-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lformat ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char _init (); +int +main () +{ +return _init (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lformat ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char _init (); +int +main () +{ +return _init (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/nix-config" && test ! -f "${__rcl_dir}/nix-config.in"; then + if test ".`(${__rcl_dir}/nix-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/nix-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/nix-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/nix-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/nix-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/nix-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libnix-config" && test ! -f "${__rcl_dir}/libnix-config.in"; then + if test ".`(${__rcl_dir}/libnix-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libnix-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libnix-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libnix-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libnix-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libnix-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists nix) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config nix $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config nix $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config nix $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config nix $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config nix $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config nix $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config nix $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config nix $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config nix" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libnix) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libnix $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libnix $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libnix $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libnix $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libnix $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libnix $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libnix $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libnix $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libnix" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/nix ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/globals.hh"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/nix ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libformat.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libformat.a" || \ + test -f "${__rcl_dir}/libformat.so" || \ + test -f "${__rcl_dir}/libformat.sl" || \ + test -f "${__rcl_dir}/libformat.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "globals.hh" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libformat.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in globals.hh +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "globals.hh" "ac_cv_header_globals_hh" "$ac_includes_default" +if test "x$ac_cv_header_globals_hh" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GLOBALS_HH 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _init in -lformat" >&5 +$as_echo_n "checking for _init in -lformat... " >&6; } +if ${ac_cv_lib_format__init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lformat $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char _init (); +int +main () +{ +return _init (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_format__init=yes +else + ac_cv_lib_format__init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_format__init" >&5 +$as_echo "$ac_cv_lib_format__init" >&6; } +if test "x$ac_cv_lib_format__init" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBFORMAT 1 +_ACEOF + + LIBS="-lformat $LIBS" + +fi + + test ".${ac_cv_lib_format__init}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_nix=${__rcl_found} + + if test ".${with_nix}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_nix}" = .yes; then + +$as_echo "#define WITH_NIX 1" >>confdefs.h + + fi + WITH_NIX="${with_nix}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Nix expressions library" >&5 +$as_echo_n "checking whether to build with Nix expressions library... " >&6; } + __rcl_msg="${with_nix}" + if test ".${with_nix}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_nix}" = .yes; then + +$as_echo "#define WITH_NIX 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Nix expressions library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + +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 + + +WITH_JS_SUBDIR="" +WITH_SPIDERMONKEY_SUBDIR="" + + + + + + if test ".${with_mozjs185+set}" != .set; then + with_mozjs185="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-mozjs185=$with_mozjs185" >&6 + fi + + fi + if test ".${with_mozjs185}" = .yes; then + with_mozjs185="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-mozjs185=yes to --with-mozjs185=\"$with_mozjs185\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_mozjs185="" + __rcl_location_last="" + + WITH_MOZJS185_SUBDIR="" + WITH_MOZJS185_CPPFLAGS="" + WITH_MOZJS185_LDFLAGS="" + WITH_MOZJS185_LIBS="" + + +# Check whether --with-mozjs185 was given. +if test "${with_mozjs185+set}" = set; then : + withval=$with_mozjs185; if test ".${with_mozjs185}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_mozjs185}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + elif test ".${__rcl_location}" = .internal; then + + if test -d ${srcdir}/mozjs185; then + + if test ".$verbose" = .yes; then + $as_echo "-- activating local sub-directory: mozjs185" >&6 + fi + + if test -f ${srcdir}/mozjs185/configure; then + subdirs="$subdirs mozjs185" + + fi + WITH_MOZJS185_SUBDIR="mozjs185" + __rcl_location_mozjs185=internal + + if test ".$verbose" = .yes; then + $as_echo "++ post-adjustments for --with-mozjs185 (${__rcl_location_mozjs185})" >&6 + fi + + __rcl_dirs_inc=`echo 'mozjs185:src:src' | sed -e 's/^[^:]*://' -e 's/:[^:]*$//'` + __rcl_dirs_lib=`echo 'mozjs185:src:src' | sed -e 's/^[^:]*:[^:]*://'` + __rcl_srcdir="\$(top_srcdir)/\$(WITH_MOZJS185_SUBDIR)" + __rcl_builddir="\$(top_builddir)/\$(WITH_MOZJS185_SUBDIR)" + __rcl_firstlib="mozjs185" + if test ".${__rcl_dirs_inc}" != ".mozjs185:src:src"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_MOZJS185_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}" >&6 + fi + + WITH_MOZJS185_CPPFLAGS="${WITH_MOZJS185_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_MOZJS185_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_MOZJS185_CPPFLAGS="${WITH_MOZJS185_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_MOZJS185_CPPFLAGS: -I${__rcl_srcdir}" >&6 + fi + + WITH_MOZJS185_CPPFLAGS="${WITH_MOZJS185_CPPFLAGS} -I${__rcl_srcdir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_MOZJS185_CPPFLAGS: -I${__rcl_builddir}" >&6 + fi + + WITH_MOZJS185_CPPFLAGS="${WITH_MOZJS185_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".mozjs185:src:src"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_MOZJS185_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_MOZJS185_LDFLAGS="${WITH_MOZJS185_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_MOZJS185_LDFLAGS: -L${__rcl_builddir}" >&6 + fi + + WITH_MOZJS185_LDFLAGS="${WITH_MOZJS185_LDFLAGS} -L${__rcl_builddir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_MOZJS185_LIBS: -l${__rcl_firstlib}" >&6 + fi + + WITH_MOZJS185_LIBS="${WITH_MOZJS185_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory mozjs185" + break + else + + if test ".$verbose" = .yes; then + $as_echo "-- skipping not existing local sub-directory: mozjs185" >&6 + fi + + fi + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists mozjs185 || pkg-config --exists libmozjs185) 2>/dev/null; then + + if (pkg-config --exists mozjs185) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config mozjs185 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config mozjs185 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config mozjs185 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config mozjs185 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config mozjs185 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config mozjs185 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config mozjs185 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config mozjs185 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config mozjs185" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libmozjs185 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libmozjs185 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libmozjs185 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libmozjs185 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libmozjs185 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libmozjs185 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libmozjs185 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libmozjs185 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libmozjs185" + fi + break + elif test ".`(mozjs185-config --version; libmozjs185-config --version) 2>/dev/null`" != .; then + + if test ".`(mozjs185-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(mozjs185-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(mozjs185-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(mozjs185-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(mozjs185-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via mozjs185-config" + else + + __rcl_flags="`(libmozjs185-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libmozjs185-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libmozjs185-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libmozjs185-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libmozjs185-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lmozjs185 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char JS_NewContext (); +int +main () +{ +return JS_NewContext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lmozjs185 ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char JS_NewContext (); +int +main () +{ +return JS_NewContext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/mozjs185-config" && test ! -f "${__rcl_dir}/mozjs185-config.in"; then + if test ".`(${__rcl_dir}/mozjs185-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/mozjs185-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/mozjs185-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/mozjs185-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/mozjs185-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/mozjs185-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libmozjs185-config" && test ! -f "${__rcl_dir}/libmozjs185-config.in"; then + if test ".`(${__rcl_dir}/libmozjs185-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libmozjs185-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libmozjs185-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libmozjs185-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libmozjs185-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libmozjs185-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists mozjs185) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config mozjs185 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config mozjs185 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config mozjs185 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config mozjs185 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config mozjs185 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config mozjs185 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config mozjs185 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config mozjs185 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config mozjs185" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libmozjs185) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libmozjs185 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libmozjs185 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libmozjs185 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libmozjs185 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libmozjs185 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libmozjs185 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libmozjs185 $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libmozjs185 $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libmozjs185" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/mozjs185 ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/jsapi.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/mozjs185 ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libmozjs185.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libmozjs185.a" || \ + test -f "${__rcl_dir}/libmozjs185.so" || \ + test -f "${__rcl_dir}/libmozjs185.sl" || \ + test -f "${__rcl_dir}/libmozjs185.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "jsapi.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libmozjs185.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + if test ".${__rcl_location_last}" = .internal; then + with_mozjs185=yes + if test ".${__rcl_location_mozjs185}" != .internal; then + as_fn_error $? "unable to find internal JavaScript library" "$LINENO" 5 + fi + else + __rcl_found=yes + for ac_header in jsapi.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "jsapi.h" "ac_cv_header_jsapi_h" "$ac_includes_default" +if test "x$ac_cv_header_jsapi_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_JSAPI_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JS_NewContext in -lmozjs185" >&5 +$as_echo_n "checking for JS_NewContext in -lmozjs185... " >&6; } +if ${ac_cv_lib_mozjs185_JS_NewContext+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmozjs185 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char JS_NewContext (); +int +main () +{ +return JS_NewContext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_mozjs185_JS_NewContext=yes +else + ac_cv_lib_mozjs185_JS_NewContext=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mozjs185_JS_NewContext" >&5 +$as_echo "$ac_cv_lib_mozjs185_JS_NewContext" >&6; } +if test "x$ac_cv_lib_mozjs185_JS_NewContext" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBMOZJS185 1 +_ACEOF + + LIBS="-lmozjs185 $LIBS" + +fi + + test ".${ac_cv_lib_mozjs185_JS_NewContext}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_mozjs185=${__rcl_found} + fi + if test ".${with_mozjs185}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_mozjs185}" = .yes; then + +$as_echo "#define WITH_MOZJS185 1" >>confdefs.h + + fi + WITH_MOZJS185="${with_mozjs185}" + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with JavaScript library" >&5 +$as_echo_n "checking whether to build with JavaScript library... " >&6; } + __rcl_msg="${with_mozjs185}" + if test ".${with_mozjs185}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_mozjs185}" = .yes; then + +$as_echo "#define WITH_MOZJS185 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + WITH_SPIDERMONKEY_SUBDIR="$WITH_JS_SUBDIR/src" + +$as_echo "#define HAVE_LIBJS 1" >>confdefs.h + + else + WITH_JS_SUBDIR=js + fi + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable JavaScript library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + + + if test ".${with_gpsee+set}" != .set; then + with_gpsee="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-gpsee=$with_gpsee" >&6 + fi + + fi + if test ".${with_gpsee}" = .yes; then + with_gpsee="external:internal:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-gpsee=yes to --with-gpsee=\"$with_gpsee\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_gpsee="" + __rcl_location_last="" + + WITH_GPSEE_SUBDIR="" + WITH_GPSEE_CPPFLAGS="" + WITH_GPSEE_LDFLAGS="" + WITH_GPSEE_LIBS="" + + +# Check whether --with-gpsee was given. +if test "${with_gpsee+set}" = set; then : + withval=$with_gpsee; if test ".${with_gpsee}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_gpsee}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + elif test ".${__rcl_location}" = .internal; then + + if test -d ${srcdir}/gpsee; then + + if test ".$verbose" = .yes; then + $as_echo "-- activating local sub-directory: gpsee" >&6 + fi + + if test -f ${srcdir}/gpsee/configure; then + subdirs="$subdirs gpsee" + + fi + WITH_GPSEE_SUBDIR="gpsee" + __rcl_location_gpsee=internal + + if test ".$verbose" = .yes; then + $as_echo "++ post-adjustments for --with-gpsee (${__rcl_location_gpsee})" >&6 + fi + + __rcl_dirs_inc=`echo 'gpsee' | sed -e 's/^[^:]*://' -e 's/:[^:]*$//'` + __rcl_dirs_lib=`echo 'gpsee' | sed -e 's/^[^:]*:[^:]*://'` + __rcl_srcdir="\$(top_srcdir)/\$(WITH_GPSEE_SUBDIR)" + __rcl_builddir="\$(top_builddir)/\$(WITH_GPSEE_SUBDIR)" + __rcl_firstlib="gpsee" + if test ".${__rcl_dirs_inc}" != ".gpsee"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_GPSEE_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}" >&6 + fi + + WITH_GPSEE_CPPFLAGS="${WITH_GPSEE_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_GPSEE_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_GPSEE_CPPFLAGS="${WITH_GPSEE_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_GPSEE_CPPFLAGS: -I${__rcl_srcdir}" >&6 + fi + + WITH_GPSEE_CPPFLAGS="${WITH_GPSEE_CPPFLAGS} -I${__rcl_srcdir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_GPSEE_CPPFLAGS: -I${__rcl_builddir}" >&6 + fi + + WITH_GPSEE_CPPFLAGS="${WITH_GPSEE_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".gpsee"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_GPSEE_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_GPSEE_LDFLAGS="${WITH_GPSEE_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_GPSEE_LDFLAGS: -L${__rcl_builddir}" >&6 + fi + + WITH_GPSEE_LDFLAGS="${WITH_GPSEE_LDFLAGS} -L${__rcl_builddir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_GPSEE_LIBS: -l${__rcl_firstlib}" >&6 + fi + + WITH_GPSEE_LIBS="${WITH_GPSEE_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory gpsee" + break + else + + if test ".$verbose" = .yes; then + $as_echo "-- skipping not existing local sub-directory: gpsee" >&6 + fi + + fi + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists gpsee || pkg-config --exists libgpsee) 2>/dev/null; then + + if (pkg-config --exists gpsee) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config gpsee $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config gpsee $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config gpsee $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config gpsee $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config gpsee $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config gpsee $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config gpsee $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config gpsee $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config gpsee" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libgpsee $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libgpsee $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libgpsee $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libgpsee $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libgpsee $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libgpsee $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libgpsee $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libgpsee $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libgpsee" + fi + break + elif test ".`(gpsee-config --version; libgpsee-config --version) 2>/dev/null`" != .; then + + if test ".`(gpsee-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(gpsee-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(gpsee-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(gpsee-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(gpsee-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via gpsee-config" + else + + __rcl_flags="`(libgpsee-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libgpsee-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libgpsee-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libgpsee-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libgpsee-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lgpsee ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gpsee_createInterpreter (); +int +main () +{ +return gpsee_createInterpreter (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lgpsee ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gpsee_createInterpreter (); +int +main () +{ +return gpsee_createInterpreter (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/gpsee-config" && test ! -f "${__rcl_dir}/gpsee-config.in"; then + if test ".`(${__rcl_dir}/gpsee-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/gpsee-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/gpsee-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/gpsee-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/gpsee-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/gpsee-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libgpsee-config" && test ! -f "${__rcl_dir}/libgpsee-config.in"; then + if test ".`(${__rcl_dir}/libgpsee-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libgpsee-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libgpsee-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libgpsee-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libgpsee-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libgpsee-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists gpsee) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config gpsee $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config gpsee $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config gpsee $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config gpsee $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config gpsee $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config gpsee $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config gpsee $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config gpsee $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config gpsee" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libgpsee) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libgpsee $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libgpsee $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libgpsee $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libgpsee $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libgpsee $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libgpsee $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libgpsee $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libgpsee $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libgpsee" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/gpsee ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/gpsee.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/gpsee ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libgpsee.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libgpsee.a" || \ + test -f "${__rcl_dir}/libgpsee.so" || \ + test -f "${__rcl_dir}/libgpsee.sl" || \ + test -f "${__rcl_dir}/libgpsee.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "gpsee.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libgpsee.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + if test ".${__rcl_location_last}" = .internal; then + with_gpsee=yes + if test ".${__rcl_location_gpsee}" != .internal; then + as_fn_error $? "unable to find internal GPSEE library" "$LINENO" 5 + fi + else + __rcl_found=yes + for ac_header in gpsee.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "gpsee.h" "ac_cv_header_gpsee_h" "$ac_includes_default" +if test "x$ac_cv_header_gpsee_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GPSEE_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gpsee_createInterpreter in -lgpsee" >&5 +$as_echo_n "checking for gpsee_createInterpreter in -lgpsee... " >&6; } +if ${ac_cv_lib_gpsee_gpsee_createInterpreter+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgpsee $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gpsee_createInterpreter (); +int +main () +{ +return gpsee_createInterpreter (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_gpsee_gpsee_createInterpreter=yes +else + ac_cv_lib_gpsee_gpsee_createInterpreter=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gpsee_gpsee_createInterpreter" >&5 +$as_echo "$ac_cv_lib_gpsee_gpsee_createInterpreter" >&6; } +if test "x$ac_cv_lib_gpsee_gpsee_createInterpreter" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBGPSEE 1 +_ACEOF + + LIBS="-lgpsee $LIBS" + +fi + + test ".${ac_cv_lib_gpsee_gpsee_createInterpreter}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_gpsee=${__rcl_found} + fi + if test ".${with_gpsee}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_gpsee}" = .yes; then + +$as_echo "#define WITH_GPSEE 1" >>confdefs.h + + fi + WITH_GPSEE="${with_gpsee}" + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with GPSEE library" >&5 +$as_echo_n "checking whether to build with GPSEE library... " >&6; } + __rcl_msg="${with_gpsee}" + if test ".${with_gpsee}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_gpsee}" = .yes; then + +$as_echo "#define WITH_GPSEE 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + +$as_echo "#define WITH_GPSEE 1" >>confdefs.h + + CPPFLAGS="$CPPFLAGS -I${includedir}/js" + LIBS="$LIBS -lmozjs185" + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + +$as_echo "#define HAVE_GPSEE_H 1" >>confdefs.h + + +$as_echo "#define HAVE_LIBGPSEE 1" >>confdefs.h + + else + GPSEE_MODULES_PATH="$prefix/libexec/gpsee" + + fi + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable GPSEE library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + + if test ".${with_rc+set}" != .set; then + with_rc="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-rc=$with_rc" >&6 + fi + + fi + if test ".${with_rc}" = .yes; then + with_rc="internal:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-rc=yes to --with-rc=\"$with_rc\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_rc="" + __rcl_location_last="" + + WITH_RC_SUBDIR="" + WITH_RC_CPPFLAGS="" + WITH_RC_LDFLAGS="" + WITH_RC_LIBS="" + + +# Check whether --with-rc was given. +if test "${with_rc+set}" = set; then : + withval=$with_rc; if test ".${with_rc}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_rc}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + elif test ".${__rcl_location}" = .internal; then + + if test -d ${srcdir}/rc; then + + if test ".$verbose" = .yes; then + $as_echo "-- activating local sub-directory: rc" >&6 + fi + + if test -f ${srcdir}/rc/configure; then + subdirs="$subdirs rc" + + fi + WITH_RC_SUBDIR="rc" + __rcl_location_rc=internal + + if test ".$verbose" = .yes; then + $as_echo "++ post-adjustments for --with-rc (${__rcl_location_rc})" >&6 + fi + + __rcl_dirs_inc=`echo 'rc' | sed -e 's/^[^:]*://' -e 's/:[^:]*$//'` + __rcl_dirs_lib=`echo 'rc' | sed -e 's/^[^:]*:[^:]*://'` + __rcl_srcdir="\$(top_srcdir)/\$(WITH_RC_SUBDIR)" + __rcl_builddir="\$(top_builddir)/\$(WITH_RC_SUBDIR)" + __rcl_firstlib="rc" + if test ".${__rcl_dirs_inc}" != ".rc"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_RC_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}" >&6 + fi + + WITH_RC_CPPFLAGS="${WITH_RC_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_RC_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_RC_CPPFLAGS="${WITH_RC_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_RC_CPPFLAGS: -I${__rcl_srcdir}" >&6 + fi + + WITH_RC_CPPFLAGS="${WITH_RC_CPPFLAGS} -I${__rcl_srcdir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_RC_CPPFLAGS: -I${__rcl_builddir}" >&6 + fi + + WITH_RC_CPPFLAGS="${WITH_RC_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".rc"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_RC_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_RC_LDFLAGS="${WITH_RC_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_RC_LDFLAGS: -L${__rcl_builddir}" >&6 + fi + + WITH_RC_LDFLAGS="${WITH_RC_LDFLAGS} -L${__rcl_builddir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_RC_LIBS: -l${__rcl_firstlib}" >&6 + fi + + WITH_RC_LIBS="${WITH_RC_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory rc" + break + else + + if test ".$verbose" = .yes; then + $as_echo "-- skipping not existing local sub-directory: rc" >&6 + fi + + fi + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists rc || pkg-config --exists librc) 2>/dev/null; then + + if (pkg-config --exists rc) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config rc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config rc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config rc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config rc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config rc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config rc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config rc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config rc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config rc" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config librc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config librc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config librc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config librc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config librc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config librc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config librc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config librc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config librc" + fi + break + elif test ".`(rc-config --version; librc-config --version) 2>/dev/null`" != .; then + + if test ".`(rc-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(rc-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(rc-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(rc-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(rc-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via rc-config" + else + + __rcl_flags="`(librc-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(librc-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(librc-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(librc-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via librc-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lrc ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char rc_main (); +int +main () +{ +return rc_main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lrc ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char rc_main (); +int +main () +{ +return rc_main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/rc-config" && test ! -f "${__rcl_dir}/rc-config.in"; then + if test ".`(${__rcl_dir}/rc-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/rc-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/rc-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/rc-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/rc-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/rc-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/librc-config" && test ! -f "${__rcl_dir}/librc-config.in"; then + if test ".`(${__rcl_dir}/librc-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/librc-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/librc-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/librc-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/librc-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/librc-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists rc) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config rc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config rc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config rc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config rc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config rc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config rc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config rc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config rc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config rc" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists librc) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config librc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config librc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config librc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config librc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config librc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config librc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config librc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config librc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config librc" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/rc ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/rc.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/rc ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/librc.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/librc.a" || \ + test -f "${__rcl_dir}/librc.so" || \ + test -f "${__rcl_dir}/librc.sl" || \ + test -f "${__rcl_dir}/librc.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "rc.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "librc.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + if test ".${__rcl_location_last}" = .internal; then + with_rc=yes + if test ".${__rcl_location_rc}" != .internal; then + as_fn_error $? "unable to find internal Rc library" "$LINENO" 5 + fi + else + __rcl_found=yes + for ac_header in rc.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "rc.h" "ac_cv_header_rc_h" "$ac_includes_default" +if test "x$ac_cv_header_rc_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_RC_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rc_main in -lrc" >&5 +$as_echo_n "checking for rc_main in -lrc... " >&6; } +if ${ac_cv_lib_rc_rc_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char rc_main (); +int +main () +{ +return rc_main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rc_rc_main=yes +else + ac_cv_lib_rc_rc_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rc_rc_main" >&5 +$as_echo "$ac_cv_lib_rc_rc_main" >&6; } +if test "x$ac_cv_lib_rc_rc_main" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBRC 1 +_ACEOF + + LIBS="-lrc $LIBS" + +fi + + test ".${ac_cv_lib_rc_rc_main}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_rc=${__rcl_found} + fi + if test ".${with_rc}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_rc}" = .yes; then + +$as_echo "#define WITH_RC 1" >>confdefs.h + + fi + WITH_RC="${with_rc}" + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Rc library" >&5 +$as_echo_n "checking whether to build with Rc library... " >&6; } + __rcl_msg="${with_rc}" + if test ".${with_rc}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_rc}" = .yes; then + +$as_echo "#define WITH_RC 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + +$as_echo "#define HAVE_RC_H 1" >>confdefs.h + + +$as_echo "#define HAVE_LIBRC 1" >>confdefs.h + + fi + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Rc library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + if test ".${with_bash+set}" != .set; then + with_bash="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-bash=$with_bash" >&6 + fi + + fi + if test ".${with_bash}" = .yes; then + with_bash="internal:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-bash=yes to --with-bash=\"$with_bash\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_bash="" + __rcl_location_last="" + + WITH_BASH_SUBDIR="" + WITH_BASH_CPPFLAGS="" + WITH_BASH_LDFLAGS="" + WITH_BASH_LIBS="" + + +# Check whether --with-bash was given. +if test "${with_bash+set}" = set; then : + withval=$with_bash; if test ".${with_bash}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_bash}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + elif test ".${__rcl_location}" = .internal; then + + if test -d ${srcdir}/bash; then + + if test ".$verbose" = .yes; then + $as_echo "-- activating local sub-directory: bash" >&6 + fi + + if test -f ${srcdir}/bash/configure; then + subdirs="$subdirs bash" + + fi + WITH_BASH_SUBDIR="bash" + __rcl_location_bash=internal + + if test ".$verbose" = .yes; then + $as_echo "++ post-adjustments for --with-bash (${__rcl_location_bash})" >&6 + fi + + __rcl_dirs_inc=`echo 'bash' | sed -e 's/^[^:]*://' -e 's/:[^:]*$//'` + __rcl_dirs_lib=`echo 'bash' | sed -e 's/^[^:]*:[^:]*://'` + __rcl_srcdir="\$(top_srcdir)/\$(WITH_BASH_SUBDIR)" + __rcl_builddir="\$(top_builddir)/\$(WITH_BASH_SUBDIR)" + __rcl_firstlib="bash" + if test ".${__rcl_dirs_inc}" != ".bash"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_BASH_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}" >&6 + fi + + WITH_BASH_CPPFLAGS="${WITH_BASH_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_BASH_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_BASH_CPPFLAGS="${WITH_BASH_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_BASH_CPPFLAGS: -I${__rcl_srcdir}" >&6 + fi + + WITH_BASH_CPPFLAGS="${WITH_BASH_CPPFLAGS} -I${__rcl_srcdir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_BASH_CPPFLAGS: -I${__rcl_builddir}" >&6 + fi + + WITH_BASH_CPPFLAGS="${WITH_BASH_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".bash"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_BASH_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_BASH_LDFLAGS="${WITH_BASH_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_BASH_LDFLAGS: -L${__rcl_builddir}" >&6 + fi + + WITH_BASH_LDFLAGS="${WITH_BASH_LDFLAGS} -L${__rcl_builddir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_BASH_LIBS: -l${__rcl_firstlib}" >&6 + fi + + WITH_BASH_LIBS="${WITH_BASH_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory bash" + break + else + + if test ".$verbose" = .yes; then + $as_echo "-- skipping not existing local sub-directory: bash" >&6 + fi + + fi + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists bash || pkg-config --exists libbash) 2>/dev/null; then + + if (pkg-config --exists bash) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config bash $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config bash $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config bash $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config bash $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config bash $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config bash $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config bash $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config bash $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config bash" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libbash $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libbash $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libbash $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libbash $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libbash $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libbash $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libbash $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libbash $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libbash" + fi + break + elif test ".`(bash-config --version; libbash-config --version) 2>/dev/null`" != .; then + + if test ".`(bash-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(bash-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(bash-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(bash-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(bash-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via bash-config" + else + + __rcl_flags="`(libbash-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libbash-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libbash-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libbash-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libbash-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lbash ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char bash_main (); +int +main () +{ +return bash_main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lbash ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char bash_main (); +int +main () +{ +return bash_main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/bash-config" && test ! -f "${__rcl_dir}/bash-config.in"; then + if test ".`(${__rcl_dir}/bash-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/bash-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/bash-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/bash-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/bash-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/bash-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libbash-config" && test ! -f "${__rcl_dir}/libbash-config.in"; then + if test ".`(${__rcl_dir}/libbash-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libbash-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libbash-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libbash-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libbash-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libbash-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists bash) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config bash $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config bash $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config bash $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config bash $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config bash $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config bash $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config bash $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config bash $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config bash" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libbash) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libbash $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libbash $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libbash $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libbash $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libbash $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libbash $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libbash $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libbash $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libbash" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/bash ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/bashtypes.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/bash ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libbash.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libbash.a" || \ + test -f "${__rcl_dir}/libbash.so" || \ + test -f "${__rcl_dir}/libbash.sl" || \ + test -f "${__rcl_dir}/libbash.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "bashtypes.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libbash.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + if test ".${__rcl_location_last}" = .internal; then + with_bash=yes + if test ".${__rcl_location_bash}" != .internal; then + as_fn_error $? "unable to find internal Bash library" "$LINENO" 5 + fi + else + __rcl_found=yes + for ac_header in bashtypes.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "bashtypes.h" "ac_cv_header_bashtypes_h" "$ac_includes_default" +if test "x$ac_cv_header_bashtypes_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BASHTYPES_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bash_main in -lbash" >&5 +$as_echo_n "checking for bash_main in -lbash... " >&6; } +if ${ac_cv_lib_bash_bash_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbash $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char bash_main (); +int +main () +{ +return bash_main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_bash_bash_main=yes +else + ac_cv_lib_bash_bash_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bash_bash_main" >&5 +$as_echo "$ac_cv_lib_bash_bash_main" >&6; } +if test "x$ac_cv_lib_bash_bash_main" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBBASH 1 +_ACEOF + + LIBS="-lbash $LIBS" + +fi + + test ".${ac_cv_lib_bash_bash_main}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_bash=${__rcl_found} + fi + if test ".${with_bash}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_bash}" = .yes; then + +$as_echo "#define WITH_BASH 1" >>confdefs.h + + fi + WITH_BASH="${with_bash}" + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Bash library" >&5 +$as_echo_n "checking whether to build with Bash library... " >&6; } + __rcl_msg="${with_bash}" + if test ".${with_bash}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_bash}" = .yes; then + +$as_echo "#define WITH_BASH 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + +$as_echo "#define HAVE_LIBBASH 1" >>confdefs.h + + fi + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Bash library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + +WITH_LUA_SUBDIR_DEF="" +WITH_LUA_SUBDIR_LIB="" +USE_LUA_SHADOW=no +USE_LUA_CHKCONFIG=no +USE_LUA_CRYPTO=no +USE_LUA_SOCKET=no + + + + + + if test ".${with_lua+set}" != .set; then + with_lua="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-lua=$with_lua" >&6 + fi + + fi + if test ".${with_lua}" = .yes; then + with_lua="internal:external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-lua=yes to --with-lua=\"$with_lua\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_lua="" + __rcl_location_last="" + + WITH_LUA_SUBDIR="" + WITH_LUA_CPPFLAGS="" + WITH_LUA_LDFLAGS="" + WITH_LUA_LIBS="" + + +# Check whether --with-lua was given. +if test "${with_lua+set}" = set; then : + withval=$with_lua; if test ".${with_lua}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_lua}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + elif test ".${__rcl_location}" = .internal; then + + if test -d ${srcdir}/lua; then + + if test ".$verbose" = .yes; then + $as_echo "-- activating local sub-directory: lua" >&6 + fi + + if test -f ${srcdir}/lua/configure; then + subdirs="$subdirs lua" + + fi + WITH_LUA_SUBDIR="lua" + __rcl_location_lua=internal + + if test ".$verbose" = .yes; then + $as_echo "++ post-adjustments for --with-lua (${__rcl_location_lua})" >&6 + fi + + __rcl_dirs_inc=`echo 'lua:local' | sed -e 's/^[^:]*://' -e 's/:[^:]*$//'` + __rcl_dirs_lib=`echo 'lua:local' | sed -e 's/^[^:]*:[^:]*://'` + __rcl_srcdir="\$(top_srcdir)/\$(WITH_LUA_SUBDIR)" + __rcl_builddir="\$(top_builddir)/\$(WITH_LUA_SUBDIR)" + __rcl_firstlib="lua" + if test ".${__rcl_dirs_inc}" != ".lua:local"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_LUA_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}" >&6 + fi + + WITH_LUA_CPPFLAGS="${WITH_LUA_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_LUA_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_LUA_CPPFLAGS="${WITH_LUA_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_LUA_CPPFLAGS: -I${__rcl_srcdir}" >&6 + fi + + WITH_LUA_CPPFLAGS="${WITH_LUA_CPPFLAGS} -I${__rcl_srcdir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_LUA_CPPFLAGS: -I${__rcl_builddir}" >&6 + fi + + WITH_LUA_CPPFLAGS="${WITH_LUA_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".lua:local"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_LUA_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_LUA_LDFLAGS="${WITH_LUA_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_LUA_LDFLAGS: -L${__rcl_builddir}" >&6 + fi + + WITH_LUA_LDFLAGS="${WITH_LUA_LDFLAGS} -L${__rcl_builddir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_LUA_LIBS: -l${__rcl_firstlib}" >&6 + fi + + WITH_LUA_LIBS="${WITH_LUA_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory lua" + break + else + + if test ".$verbose" = .yes; then + $as_echo "-- skipping not existing local sub-directory: lua" >&6 + fi + + fi + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists lua || pkg-config --exists liblua) 2>/dev/null; then + + if (pkg-config --exists lua) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config lua $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config lua $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config lua $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config lua $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config lua $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config lua $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config lua $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config lua $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config lua" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config liblua $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config liblua $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config liblua $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config liblua $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config liblua $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config liblua $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config liblua $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config liblua $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config liblua" + fi + break + elif test ".`(lua-config --version; liblua-config --version) 2>/dev/null`" != .; then + + if test ".`(lua-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(lua-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(lua-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(lua-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(lua-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via lua-config" + else + + __rcl_flags="`(liblua-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(liblua-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(liblua-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(liblua-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via liblua-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-llua ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char lua_newstate (); +int +main () +{ +return lua_newstate (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-llua ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char lua_newstate (); +int +main () +{ +return lua_newstate (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/lua-config" && test ! -f "${__rcl_dir}/lua-config.in"; then + if test ".`(${__rcl_dir}/lua-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/lua-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/lua-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/lua-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/lua-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/lua-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/liblua-config" && test ! -f "${__rcl_dir}/liblua-config.in"; then + if test ".`(${__rcl_dir}/liblua-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/liblua-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/liblua-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/liblua-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/liblua-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/liblua-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists lua) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config lua $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config lua $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config lua $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config lua $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config lua $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config lua $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config lua $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config lua $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config lua" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists liblua) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config liblua $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config liblua $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config liblua $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config liblua $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config liblua $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config liblua $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config liblua $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config liblua $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config liblua" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/lua ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/lua.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/lua ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/liblua.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/liblua.a" || \ + test -f "${__rcl_dir}/liblua.so" || \ + test -f "${__rcl_dir}/liblua.sl" || \ + test -f "${__rcl_dir}/liblua.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "lua.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "liblua.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + if test ".${__rcl_location_last}" = .internal; then + with_lua=yes + if test ".${__rcl_location_lua}" != .internal; then + as_fn_error $? "unable to find internal Lua library" "$LINENO" 5 + fi + else + __rcl_found=yes + for ac_header in lua.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "lua.h" "ac_cv_header_lua_h" "$ac_includes_default" +if test "x$ac_cv_header_lua_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LUA_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lua_newstate in -llua" >&5 +$as_echo_n "checking for lua_newstate in -llua... " >&6; } +if ${ac_cv_lib_lua_lua_newstate+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-llua $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char lua_newstate (); +int +main () +{ +return lua_newstate (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_lua_lua_newstate=yes +else + ac_cv_lib_lua_lua_newstate=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lua_lua_newstate" >&5 +$as_echo "$ac_cv_lib_lua_lua_newstate" >&6; } +if test "x$ac_cv_lib_lua_lua_newstate" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBLUA 1 +_ACEOF + + LIBS="-llua $LIBS" + +fi + + test ".${ac_cv_lib_lua_lua_newstate}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_lua=${__rcl_found} + fi + if test ".${with_lua}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_lua}" = .yes; then + +$as_echo "#define WITH_LUA 1" >>confdefs.h + + fi + WITH_LUA="${with_lua}" + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Lua library" >&5 +$as_echo_n "checking whether to build with Lua library... " >&6; } + __rcl_msg="${with_lua}" + if test ".${with_lua}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_lua}" = .yes; then + +$as_echo "#define WITH_LUA 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fabs in -lm" >&5 +$as_echo_n "checking for fabs in -lm... " >&6; } +if ${ac_cv_lib_m_fabs+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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. */ +#ifdef __cplusplus +extern "C" +#endif +char fabs (); +int +main () +{ +return fabs (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_fabs=yes +else + ac_cv_lib_m_fabs=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fabs" >&5 +$as_echo "$ac_cv_lib_m_fabs" >&6; } +if test "x$ac_cv_lib_m_fabs" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 +_ACEOF + + LIBS="-lm $LIBS" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDL 1 +_ACEOF + + LIBS="-ldl $LIBS" + +fi + + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + WITH_LUA_SUBDIR_DEF="$WITH_LUA_SUBDIR_DEF -DLUA_USE_DLOPEN" +fi + + ac_fn_c_check_func "$LINENO" "regcomp" "ac_cv_func_regcomp" +if test "x$ac_cv_func_regcomp" = xyes; then : + WITH_LUA_SUBDIR_DEF="$WITH_LUA_SUBDIR_DEF -DLUA_USE_POSIX" +fi + + case "$host" in + *-*-linux* ) USE_LUA_SHADOW=yes; USE_LUA_CHKCONFIG=yes; ;; + esac + +$as_echo "#define WITH_LUA_INTERNAL 1" >>confdefs.h + + ac_config_files="$ac_config_files lua/Makefile" + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fabs in -lm" >&5 +$as_echo_n "checking for fabs in -lm... " >&6; } +if ${ac_cv_lib_m_fabs+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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. */ +#ifdef __cplusplus +extern "C" +#endif +char fabs (); +int +main () +{ +return fabs (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_fabs=yes +else + ac_cv_lib_m_fabs=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fabs" >&5 +$as_echo "$ac_cv_lib_m_fabs" >&6; } +if test "x$ac_cv_lib_m_fabs" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 +_ACEOF + + LIBS="-lm $LIBS" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDL 1 +_ACEOF + + LIBS="-ldl $LIBS" + +fi + + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + +fi + + fi + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Lua library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + if test ".$USE_LUA_SHADOW" = .yes ; then + USE_LUA_SHADOW_TRUE= + USE_LUA_SHADOW_FALSE='#' +else + USE_LUA_SHADOW_TRUE='#' + USE_LUA_SHADOW_FALSE= +fi + + if test ".$USE_LUA_CHKCONFIG" = .yes ; then + USE_LUA_CHKCONFIG_TRUE= + USE_LUA_CHKCONFIG_FALSE='#' +else + USE_LUA_CHKCONFIG_TRUE='#' + USE_LUA_CHKCONFIG_FALSE= +fi + + if test ".$USE_LUA_CRYPTO" = .yes ; then + USE_LUA_CRYPTO_TRUE= + USE_LUA_CRYPTO_FALSE='#' +else + USE_LUA_CRYPTO_TRUE='#' + USE_LUA_CRYPTO_FALSE= +fi + + if test ".$USE_LUA_SOCKET" = .yes ; then + USE_LUA_SOCKET_TRUE= + USE_LUA_SOCKET_FALSE='#' +else + USE_LUA_SOCKET_TRUE='#' + USE_LUA_SOCKET_FALSE= +fi + + +WITH_PCRE_INTERNAL=false + + + + + + if test ".${with_pcre+set}" != .set; then + with_pcre="yes" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-pcre=$with_pcre" >&6 + fi + + fi + if test ".${with_pcre}" = .yes; then + with_pcre="external:internal:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-pcre=yes to --with-pcre=\"$with_pcre\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_pcre="" + __rcl_location_last="" + + WITH_PCRE_SUBDIR="" + WITH_PCRE_CPPFLAGS="" + WITH_PCRE_LDFLAGS="" + WITH_PCRE_LIBS="" + + +# Check whether --with-pcre was given. +if test "${with_pcre+set}" = set; then : + withval=$with_pcre; if test ".${with_pcre}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_pcre}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + elif test ".${__rcl_location}" = .internal; then + + if test -d ${srcdir}/pcre; then + + if test ".$verbose" = .yes; then + $as_echo "-- activating local sub-directory: pcre" >&6 + fi + + if test -f ${srcdir}/pcre/configure; then + subdirs="$subdirs pcre" + + fi + WITH_PCRE_SUBDIR="pcre" + __rcl_location_pcre=internal + + if test ".$verbose" = .yes; then + $as_echo "++ post-adjustments for --with-pcre (${__rcl_location_pcre})" >&6 + fi + + __rcl_dirs_inc=`echo 'pcre' | sed -e 's/^[^:]*://' -e 's/:[^:]*$//'` + __rcl_dirs_lib=`echo 'pcre' | sed -e 's/^[^:]*:[^:]*://'` + __rcl_srcdir="\$(top_srcdir)/\$(WITH_PCRE_SUBDIR)" + __rcl_builddir="\$(top_builddir)/\$(WITH_PCRE_SUBDIR)" + __rcl_firstlib="pcre" + if test ".${__rcl_dirs_inc}" != ".pcre"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_PCRE_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}" >&6 + fi + + WITH_PCRE_CPPFLAGS="${WITH_PCRE_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_PCRE_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_PCRE_CPPFLAGS="${WITH_PCRE_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_PCRE_CPPFLAGS: -I${__rcl_srcdir}" >&6 + fi + + WITH_PCRE_CPPFLAGS="${WITH_PCRE_CPPFLAGS} -I${__rcl_srcdir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_PCRE_CPPFLAGS: -I${__rcl_builddir}" >&6 + fi + + WITH_PCRE_CPPFLAGS="${WITH_PCRE_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".pcre"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_PCRE_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_PCRE_LDFLAGS="${WITH_PCRE_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_PCRE_LDFLAGS: -L${__rcl_builddir}" >&6 + fi + + WITH_PCRE_LDFLAGS="${WITH_PCRE_LDFLAGS} -L${__rcl_builddir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_PCRE_LIBS: -l${__rcl_firstlib}" >&6 + fi + + WITH_PCRE_LIBS="${WITH_PCRE_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory pcre" + break + else + + if test ".$verbose" = .yes; then + $as_echo "-- skipping not existing local sub-directory: pcre" >&6 + fi + + fi + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists pcre || pkg-config --exists libpcre) 2>/dev/null; then + + if (pkg-config --exists pcre) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config pcre $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config pcre $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config pcre $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config pcre $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config pcre $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config pcre $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config pcre $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config pcre $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config pcre" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libpcre $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libpcre $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libpcre $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libpcre $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libpcre $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libpcre $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libpcre $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libpcre $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libpcre" + fi + break + elif test ".`(pcre-config --version; libpcre-config --version) 2>/dev/null`" != .; then + + if test ".`(pcre-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(pcre-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(pcre-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(pcre-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(pcre-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pcre-config" + else + + __rcl_flags="`(libpcre-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libpcre-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libpcre-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libpcre-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libpcre-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lpcre ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pcre_compile (); +int +main () +{ +return pcre_compile (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lpcre ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pcre_compile (); +int +main () +{ +return pcre_compile (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pcre-config" && test ! -f "${__rcl_dir}/pcre-config.in"; then + if test ".`(${__rcl_dir}/pcre-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/pcre-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/pcre-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/pcre-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/pcre-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pcre-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libpcre-config" && test ! -f "${__rcl_dir}/libpcre-config.in"; then + if test ".`(${__rcl_dir}/libpcre-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libpcre-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libpcre-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libpcre-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libpcre-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libpcre-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists pcre) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config pcre $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config pcre $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config pcre $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config pcre $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config pcre $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config pcre $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config pcre $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config pcre $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config pcre" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libpcre) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libpcre $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libpcre $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libpcre $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libpcre $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libpcre $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libpcre $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libpcre $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libpcre $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libpcre" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/pcre ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/pcre.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/pcre ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libpcre.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libpcre.a" || \ + test -f "${__rcl_dir}/libpcre.so" || \ + test -f "${__rcl_dir}/libpcre.sl" || \ + test -f "${__rcl_dir}/libpcre.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "pcre.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libpcre.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + if test ".${__rcl_location_last}" = .internal; then + with_pcre=yes + if test ".${__rcl_location_pcre}" != .internal; then + as_fn_error $? "unable to find internal PCRE library" "$LINENO" 5 + fi + else + __rcl_found=yes + for ac_header in pcre.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "pcre.h" "ac_cv_header_pcre_h" "$ac_includes_default" +if test "x$ac_cv_header_pcre_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PCRE_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 +$as_echo_n "checking for pcre_compile in -lpcre... " >&6; } +if ${ac_cv_lib_pcre_pcre_compile+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpcre $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pcre_compile (); +int +main () +{ +return pcre_compile (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pcre_pcre_compile=yes +else + ac_cv_lib_pcre_pcre_compile=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 +$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } +if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPCRE 1 +_ACEOF + + LIBS="-lpcre $LIBS" + +fi + + test ".${ac_cv_lib_pcre_pcre_compile}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_pcre=${__rcl_found} + fi + if test ".${with_pcre}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_pcre}" = .yes; then + +$as_echo "#define WITH_PCRE 1" >>confdefs.h + + fi + WITH_PCRE="${with_pcre}" + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with PCRE library" >&5 +$as_echo_n "checking whether to build with PCRE library... " >&6; } + __rcl_msg="${with_pcre}" + if test ".${with_pcre}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_pcre}" = .yes; then + +$as_echo "#define WITH_PCRE 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + WITH_PCRE_INTERNAL=true + +$as_echo "#define HAVE_PCRE_H 1" >>confdefs.h + + +$as_echo "#define HAVE_LIBPCRE 1" >>confdefs.h + + +$as_echo "#define WITH_PCRE_POSIX 1" >>confdefs.h + + WITH_PCRE_LIBS="-lpcreposix" # override, not prepend! (see attention above) + if test ".$WITH_LUA" = .yes; then + WITH_LUA_SUBDIR_DEF="$WITH_LUA_SUBDIR_DEF -DREX_POSIX_INCLUDE=\"\"" + fi + + else + LIBS_SAVED="$LIBS" + LIBS="-lpcreposix $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main () +{ +(void)regcomp(0, 0, 0) + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + +$as_echo "#define WITH_PCRE_POSIX 1" >>confdefs.h + + if test ".$WITH_LUA" = .yes; then + WITH_LUA_SUBDIR_DEF="$WITH_LUA_SUBDIR_DEF -DREX_POSIX_INCLUDE=\"\"" + fi + +else + + LIBS="$LIBS_SAVED" + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi + if test ".$WITH_LUA" = .yes; then + WITH_LUA_SUBDIR_DEF="$WITH_LUA_SUBDIR_DEF -DLUA_USE_PCRE" + fi + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable PCRE library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + if test ".$WITH_PCRE" = .no; then + as_fn_error $? "PCRE is mandatory. If you don't have libpcre then --with-pcre=internal could be used" "$LINENO" 5 + fi + +case "$host" in + *-*-darwin* ) +mv confdefs.h confdefs.h-SAVE +grep -v 'define HAVE_UNISTD_H' confdefs.h-SAVE > confdefs.h +;; +esac + + + + + + if test ".${with_uuid+set}" != .set; then + with_uuid="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-uuid=$with_uuid" >&6 + fi + + fi + if test ".${with_uuid}" = .yes; then + with_uuid="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-uuid=yes to --with-uuid=\"$with_uuid\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_uuid="" + __rcl_location_last="" + + +# Check whether --with-uuid was given. +if test "${with_uuid+set}" = set; then : + withval=$with_uuid; if test ".${with_uuid}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_uuid}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists uuid || pkg-config --exists libuuid) 2>/dev/null; then + + if (pkg-config --exists uuid) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config uuid $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config uuid $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config uuid $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config uuid $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config uuid $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config uuid $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config uuid $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config uuid $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config uuid" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libuuid $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libuuid $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libuuid $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libuuid $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libuuid $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libuuid $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libuuid $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libuuid $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libuuid" + fi + break + elif test ".`(uuid-config --version; libuuid-config --version) 2>/dev/null`" != .; then + + if test ".`(uuid-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(uuid-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(uuid-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(uuid-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(uuid-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via uuid-config" + else + + __rcl_flags="`(libuuid-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libuuid-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libuuid-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libuuid-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libuuid-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lossp-uuid ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char uuid_import (); +int +main () +{ +return uuid_import (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + __rcl_safe_LIBS="${LIBS}" + LIBS="-luuid ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char uuid_import (); +int +main () +{ +return uuid_import (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lossp-uuid ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char uuid_import (); +int +main () +{ +return uuid_import (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + __rcl_safe_LIBS="${LIBS}" + LIBS="-luuid ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char uuid_import (); +int +main () +{ +return uuid_import (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/uuid-config" && test ! -f "${__rcl_dir}/uuid-config.in"; then + if test ".`(${__rcl_dir}/uuid-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/uuid-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/uuid-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/uuid-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/uuid-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/uuid-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libuuid-config" && test ! -f "${__rcl_dir}/libuuid-config.in"; then + if test ".`(${__rcl_dir}/libuuid-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libuuid-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libuuid-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libuuid-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libuuid-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libuuid-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists uuid) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config uuid $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config uuid $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config uuid $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config uuid $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config uuid $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config uuid $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config uuid $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config uuid $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config uuid" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libuuid) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libuuid $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libuuid $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libuuid $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libuuid $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libuuid $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libuuid $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libuuid $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libuuid $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libuuid" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/uuid ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/uuid.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/uuid ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libossp-uuid.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libossp-uuid.a" || \ + test -f "${__rcl_dir}/libossp-uuid.so" || \ + test -f "${__rcl_dir}/libossp-uuid.sl" || \ + test -f "${__rcl_dir}/libossp-uuid.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + if test -f "${__rcl_dir}/libuuid.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libuuid.a" || \ + test -f "${__rcl_dir}/libuuid.so" || \ + test -f "${__rcl_dir}/libuuid.sl" || \ + test -f "${__rcl_dir}/libuuid.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "uuid.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libossp-uuid.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + for __rcl_file in _ `find ${__rcl_location} -name "libuuid.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in uuid.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default" +if test "x$ac_cv_header_uuid_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_UUID_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_import in -lossp-uuid" >&5 +$as_echo_n "checking for uuid_import in -lossp-uuid... " >&6; } +if ${ac_cv_lib_ossp_uuid_uuid_import+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lossp-uuid $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char uuid_import (); +int +main () +{ +return uuid_import (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ossp_uuid_uuid_import=yes +else + ac_cv_lib_ossp_uuid_uuid_import=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ossp_uuid_uuid_import" >&5 +$as_echo "$ac_cv_lib_ossp_uuid_uuid_import" >&6; } +if test "x$ac_cv_lib_ossp_uuid_uuid_import" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBOSSP_UUID 1 +_ACEOF + + LIBS="-lossp-uuid $LIBS" + +fi + + test ".${ac_cv_lib_ossp_uuid_uuid_import}" = .yes && __rcl_found_lib=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_import in -luuid" >&5 +$as_echo_n "checking for uuid_import in -luuid... " >&6; } +if ${ac_cv_lib_uuid_uuid_import+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-luuid $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char uuid_import (); +int +main () +{ +return uuid_import (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_uuid_uuid_import=yes +else + ac_cv_lib_uuid_uuid_import=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_import" >&5 +$as_echo "$ac_cv_lib_uuid_uuid_import" >&6; } +if test "x$ac_cv_lib_uuid_uuid_import" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBUUID 1 +_ACEOF + + LIBS="-luuid $LIBS" + +fi + + test ".${ac_cv_lib_uuid_uuid_import}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_uuid=${__rcl_found} + + if test ".${with_uuid}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_uuid}" = .yes; then + +$as_echo "#define WITH_UUID 1" >>confdefs.h + + fi + WITH_UUID="${with_uuid}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with OSSP uuid library" >&5 +$as_echo_n "checking whether to build with OSSP uuid library... " >&6; } + __rcl_msg="${with_uuid}" + if test ".${with_uuid}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_uuid}" = .yes; then + +$as_echo "#define WITH_UUID 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + if test ".$WITH_LUA" = .yes; then + WITH_LUA_SUBDIR_DEF="$WITH_LUA_SUBDIR_DEF -DLUA_USE_UUID" + fi + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable OSSP uuid library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + +case "$host" in + *-*-darwin* ) +mv confdefs.h-SAVE confdefs.h;; +esac + + + + + + + if test ".${with_syck+set}" != .set; then + with_syck="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-syck=$with_syck" >&6 + fi + + fi + if test ".${with_syck}" = .yes; then + with_syck="internal:external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-syck=yes to --with-syck=\"$with_syck\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_syck="" + __rcl_location_last="" + + WITH_SYCK_SUBDIR="" + WITH_SYCK_CPPFLAGS="" + WITH_SYCK_LDFLAGS="" + WITH_SYCK_LIBS="" + + +# Check whether --with-syck was given. +if test "${with_syck+set}" = set; then : + withval=$with_syck; if test ".${with_syck}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_syck}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + elif test ".${__rcl_location}" = .internal; then + + if test -d ${srcdir}/syck; then + + if test ".$verbose" = .yes; then + $as_echo "-- activating local sub-directory: syck" >&6 + fi + + if test -f ${srcdir}/syck/configure; then + subdirs="$subdirs syck" + + fi + WITH_SYCK_SUBDIR="syck" + __rcl_location_syck=internal + + if test ".$verbose" = .yes; then + $as_echo "++ post-adjustments for --with-syck (${__rcl_location_syck})" >&6 + fi + + __rcl_dirs_inc=`echo 'syck:lib:lib' | sed -e 's/^[^:]*://' -e 's/:[^:]*$//'` + __rcl_dirs_lib=`echo 'syck:lib:lib' | sed -e 's/^[^:]*:[^:]*://'` + __rcl_srcdir="\$(top_srcdir)/\$(WITH_SYCK_SUBDIR)" + __rcl_builddir="\$(top_builddir)/\$(WITH_SYCK_SUBDIR)" + __rcl_firstlib="syck" + if test ".${__rcl_dirs_inc}" != ".syck:lib:lib"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_SYCK_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}" >&6 + fi + + WITH_SYCK_CPPFLAGS="${WITH_SYCK_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_SYCK_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_SYCK_CPPFLAGS="${WITH_SYCK_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_SYCK_CPPFLAGS: -I${__rcl_srcdir}" >&6 + fi + + WITH_SYCK_CPPFLAGS="${WITH_SYCK_CPPFLAGS} -I${__rcl_srcdir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_SYCK_CPPFLAGS: -I${__rcl_builddir}" >&6 + fi + + WITH_SYCK_CPPFLAGS="${WITH_SYCK_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".syck:lib:lib"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_SYCK_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_SYCK_LDFLAGS="${WITH_SYCK_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_SYCK_LDFLAGS: -L${__rcl_builddir}" >&6 + fi + + WITH_SYCK_LDFLAGS="${WITH_SYCK_LDFLAGS} -L${__rcl_builddir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_SYCK_LIBS: -l${__rcl_firstlib}" >&6 + fi + + WITH_SYCK_LIBS="${WITH_SYCK_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory syck" + break + else + + if test ".$verbose" = .yes; then + $as_echo "-- skipping not existing local sub-directory: syck" >&6 + fi + + fi + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists syck || pkg-config --exists libsyck) 2>/dev/null; then + + if (pkg-config --exists syck) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config syck $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config syck $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config syck $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config syck $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config syck $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config syck $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config syck $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config syck $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config syck" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsyck $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsyck $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsyck $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsyck $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsyck $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsyck $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libsyck $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libsyck $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libsyck" + fi + break + elif test ".`(syck-config --version; libsyck-config --version) 2>/dev/null`" != .; then + + if test ".`(syck-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(syck-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(syck-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(syck-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(syck-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via syck-config" + else + + __rcl_flags="`(libsyck-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libsyck-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libsyck-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libsyck-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libsyck-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lsyck ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char syckparse (); +int +main () +{ +return syckparse (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lsyck ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char syckparse (); +int +main () +{ +return syckparse (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/syck-config" && test ! -f "${__rcl_dir}/syck-config.in"; then + if test ".`(${__rcl_dir}/syck-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/syck-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/syck-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/syck-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/syck-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/syck-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libsyck-config" && test ! -f "${__rcl_dir}/libsyck-config.in"; then + if test ".`(${__rcl_dir}/libsyck-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libsyck-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libsyck-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libsyck-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libsyck-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libsyck-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists syck) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config syck $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config syck $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config syck $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config syck $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config syck $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config syck $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config syck $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config syck $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config syck" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libsyck) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsyck $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsyck $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsyck $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsyck $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsyck $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsyck $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libsyck $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libsyck $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libsyck" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/syck ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/syck.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/syck ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libsyck.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libsyck.a" || \ + test -f "${__rcl_dir}/libsyck.so" || \ + test -f "${__rcl_dir}/libsyck.sl" || \ + test -f "${__rcl_dir}/libsyck.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "syck.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libsyck.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + if test ".${__rcl_location_last}" = .internal; then + with_syck=yes + if test ".${__rcl_location_syck}" != .internal; then + as_fn_error $? "unable to find internal Syck library" "$LINENO" 5 + fi + else + __rcl_found=yes + for ac_header in syck.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "syck.h" "ac_cv_header_syck_h" "$ac_includes_default" +if test "x$ac_cv_header_syck_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYCK_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for syckparse in -lsyck" >&5 +$as_echo_n "checking for syckparse in -lsyck... " >&6; } +if ${ac_cv_lib_syck_syckparse+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsyck $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char syckparse (); +int +main () +{ +return syckparse (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_syck_syckparse=yes +else + ac_cv_lib_syck_syckparse=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_syck_syckparse" >&5 +$as_echo "$ac_cv_lib_syck_syckparse" >&6; } +if test "x$ac_cv_lib_syck_syckparse" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSYCK 1 +_ACEOF + + LIBS="-lsyck $LIBS" + +fi + + test ".${ac_cv_lib_syck_syckparse}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_syck=${__rcl_found} + fi + if test ".${with_syck}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_syck}" = .yes; then + +$as_echo "#define WITH_SYCK 1" >>confdefs.h + + fi + WITH_SYCK="${with_syck}" + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Syck library" >&5 +$as_echo_n "checking whether to build with Syck library... " >&6; } + __rcl_msg="${with_syck}" + if test ".${with_syck}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_syck}" = .yes; then + +$as_echo "#define WITH_SYCK 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + +$as_echo "#define HAVE_SYCK_H 1" >>confdefs.h + + fi + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Syck library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + if test ".${with_attr+set}" != .set; then + with_attr="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-attr=$with_attr" >&6 + fi + + fi + if test ".${with_attr}" = .yes; then + with_attr="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-attr=yes to --with-attr=\"$with_attr\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_attr="" + __rcl_location_last="" + + +# Check whether --with-attr was given. +if test "${with_attr+set}" = set; then : + withval=$with_attr; if test ".${with_attr}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_attr}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists attr || pkg-config --exists libattr) 2>/dev/null; then + + if (pkg-config --exists attr) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config attr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config attr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config attr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config attr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config attr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config attr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config attr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config attr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config attr" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libattr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libattr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libattr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libattr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libattr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libattr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libattr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libattr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libattr" + fi + break + elif test ".`(attr-config --version; libattr-config --version) 2>/dev/null`" != .; then + + if test ".`(attr-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(attr-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(attr-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(attr-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(attr-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via attr-config" + else + + __rcl_flags="`(libattr-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libattr-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libattr-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libattr-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libattr-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lattr ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char attr_get (); +int +main () +{ +return attr_get (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lattr ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char attr_get (); +int +main () +{ +return attr_get (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/attr-config" && test ! -f "${__rcl_dir}/attr-config.in"; then + if test ".`(${__rcl_dir}/attr-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/attr-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/attr-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/attr-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/attr-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/attr-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libattr-config" && test ! -f "${__rcl_dir}/libattr-config.in"; then + if test ".`(${__rcl_dir}/libattr-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libattr-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libattr-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libattr-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libattr-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libattr-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists attr) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config attr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config attr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config attr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config attr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config attr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config attr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config attr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config attr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config attr" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libattr) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libattr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libattr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libattr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libattr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libattr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libattr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libattr $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libattr $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libattr" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/attr ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/sys/xattr.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/attr ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libattr.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libattr.a" || \ + test -f "${__rcl_dir}/libattr.so" || \ + test -f "${__rcl_dir}/libattr.sl" || \ + test -f "${__rcl_dir}/libattr.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "sys/xattr.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libattr.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in sys/xattr.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/xattr.h" "ac_cv_header_sys_xattr_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_xattr_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_XATTR_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for attr_get in -lattr" >&5 +$as_echo_n "checking for attr_get in -lattr... " >&6; } +if ${ac_cv_lib_attr_attr_get+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lattr $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char attr_get (); +int +main () +{ +return attr_get (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_attr_attr_get=yes +else + ac_cv_lib_attr_attr_get=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_attr_attr_get" >&5 +$as_echo "$ac_cv_lib_attr_attr_get" >&6; } +if test "x$ac_cv_lib_attr_attr_get" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBATTR 1 +_ACEOF + + LIBS="-lattr $LIBS" + +fi + + test ".${ac_cv_lib_attr_attr_get}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_attr=${__rcl_found} + + if test ".${with_attr}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_attr}" = .yes; then + +$as_echo "#define WITH_ATTR 1" >>confdefs.h + + fi + WITH_ATTR="${with_attr}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with ATTR library" >&5 +$as_echo_n "checking whether to build with ATTR library... " >&6; } + __rcl_msg="${with_attr}" + if test ".${with_attr}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_attr}" = .yes; then + +$as_echo "#define WITH_ATTR 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + : + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable ATTR library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + if test ".${with_acl+set}" != .set; then + with_acl="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-acl=$with_acl" >&6 + fi + + fi + if test ".${with_acl}" = .yes; then + with_acl="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-acl=yes to --with-acl=\"$with_acl\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_acl="" + __rcl_location_last="" + + +# Check whether --with-acl was given. +if test "${with_acl+set}" = set; then : + withval=$with_acl; if test ".${with_acl}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_acl}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists acl || pkg-config --exists libacl) 2>/dev/null; then + + if (pkg-config --exists acl) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config acl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config acl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config acl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config acl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config acl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config acl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config acl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config acl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config acl" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libacl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libacl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libacl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libacl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libacl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libacl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libacl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libacl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libacl" + fi + break + elif test ".`(acl-config --version; libacl-config --version) 2>/dev/null`" != .; then + + if test ".`(acl-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(acl-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(acl-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(acl-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(acl-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via acl-config" + else + + __rcl_flags="`(libacl-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libacl-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libacl-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libacl-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libacl-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lacl ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char acl_free (); +int +main () +{ +return acl_free (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lacl ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char acl_free (); +int +main () +{ +return acl_free (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/acl-config" && test ! -f "${__rcl_dir}/acl-config.in"; then + if test ".`(${__rcl_dir}/acl-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/acl-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/acl-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/acl-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/acl-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/acl-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libacl-config" && test ! -f "${__rcl_dir}/libacl-config.in"; then + if test ".`(${__rcl_dir}/libacl-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libacl-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libacl-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libacl-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libacl-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libacl-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists acl) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config acl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config acl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config acl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config acl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config acl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config acl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config acl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config acl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config acl" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libacl) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libacl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libacl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libacl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libacl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libacl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libacl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libacl $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libacl $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libacl" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/acl ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/sys/acl.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/acl ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libacl.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libacl.a" || \ + test -f "${__rcl_dir}/libacl.so" || \ + test -f "${__rcl_dir}/libacl.sl" || \ + test -f "${__rcl_dir}/libacl.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "sys/acl.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libacl.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in sys/acl.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/acl.h" "ac_cv_header_sys_acl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_acl_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_ACL_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acl_free in -lacl" >&5 +$as_echo_n "checking for acl_free in -lacl... " >&6; } +if ${ac_cv_lib_acl_acl_free+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lacl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char acl_free (); +int +main () +{ +return acl_free (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_acl_acl_free=yes +else + ac_cv_lib_acl_acl_free=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_acl_acl_free" >&5 +$as_echo "$ac_cv_lib_acl_acl_free" >&6; } +if test "x$ac_cv_lib_acl_acl_free" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBACL 1 +_ACEOF + + LIBS="-lacl $LIBS" + +fi + + test ".${ac_cv_lib_acl_acl_free}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_acl=${__rcl_found} + + if test ".${with_acl}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_acl}" = .yes; then + +$as_echo "#define WITH_ACL 1" >>confdefs.h + + fi + WITH_ACL="${with_acl}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with ACL library" >&5 +$as_echo_n "checking whether to build with ACL library... " >&6; } + __rcl_msg="${with_acl}" + if test ".${with_acl}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_acl}" = .yes; then + +$as_echo "#define WITH_ACL 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + : + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable ACL library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + if test ".${with_xar+set}" != .set; then + with_xar="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-xar=$with_xar" >&6 + fi + + fi + if test ".${with_xar}" = .yes; then + with_xar="external:internal:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-xar=yes to --with-xar=\"$with_xar\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_xar="" + __rcl_location_last="" + + WITH_XAR_SUBDIR="" + WITH_XAR_CPPFLAGS="" + WITH_XAR_LDFLAGS="" + WITH_XAR_LIBS="" + + +# Check whether --with-xar was given. +if test "${with_xar+set}" = set; then : + withval=$with_xar; if test ".${with_xar}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_xar}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + elif test ".${__rcl_location}" = .internal; then + + if test -d ${srcdir}/xar; then + + if test ".$verbose" = .yes; then + $as_echo "-- activating local sub-directory: xar" >&6 + fi + + if test -f ${srcdir}/xar/configure; then + subdirs="$subdirs xar" + + fi + WITH_XAR_SUBDIR="xar" + __rcl_location_xar=internal + + if test ".$verbose" = .yes; then + $as_echo "++ post-adjustments for --with-xar (${__rcl_location_xar})" >&6 + fi + + __rcl_dirs_inc=`echo 'xar:include:lib' | sed -e 's/^[^:]*://' -e 's/:[^:]*$//'` + __rcl_dirs_lib=`echo 'xar:include:lib' | sed -e 's/^[^:]*:[^:]*://'` + __rcl_srcdir="\$(top_srcdir)/\$(WITH_XAR_SUBDIR)" + __rcl_builddir="\$(top_builddir)/\$(WITH_XAR_SUBDIR)" + __rcl_firstlib="xar" + if test ".${__rcl_dirs_inc}" != ".xar:include:lib"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_inc}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_XAR_CPPFLAGS: -I${__rcl_srcdir}/${__rcl_dir}" >&6 + fi + + WITH_XAR_CPPFLAGS="${WITH_XAR_CPPFLAGS} -I${__rcl_srcdir}/${__rcl_dir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_XAR_CPPFLAGS: -I${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_XAR_CPPFLAGS="${WITH_XAR_CPPFLAGS} -I${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_XAR_CPPFLAGS: -I${__rcl_srcdir}" >&6 + fi + + WITH_XAR_CPPFLAGS="${WITH_XAR_CPPFLAGS} -I${__rcl_srcdir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_XAR_CPPFLAGS: -I${__rcl_builddir}" >&6 + fi + + WITH_XAR_CPPFLAGS="${WITH_XAR_CPPFLAGS} -I${__rcl_builddir}" + if test ".${__rcl_dirs_lib}" != ".xar:include:lib"; then + __rcl_IFS="${IFS}"; IFS="," + for __rcl_dir in ${__rcl_dirs_lib}; do + IFS="${__rcl_IFS}" + test ".${__rcl_dir}" = . && continue + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_XAR_LDFLAGS: -L${__rcl_builddir}/${__rcl_dir}" >&6 + fi + + WITH_XAR_LDFLAGS="${WITH_XAR_LDFLAGS} -L${__rcl_builddir}/${__rcl_dir}" + done + IFS="${__rcl_IFS}" + fi + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_XAR_LDFLAGS: -L${__rcl_builddir}" >&6 + fi + + WITH_XAR_LDFLAGS="${WITH_XAR_LDFLAGS} -L${__rcl_builddir}" + + if test ".$verbose" = .yes; then + $as_echo "-- extending WITH_XAR_LIBS: -l${__rcl_firstlib}" >&6 + fi + + WITH_XAR_LIBS="${WITH_XAR_LIBS} -l${__rcl_firstlib}" + __rcl_result_hint="internal: sub-directory xar" + break + else + + if test ".$verbose" = .yes; then + $as_echo "-- skipping not existing local sub-directory: xar" >&6 + fi + + fi + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists xar || pkg-config --exists libxar) 2>/dev/null; then + + if (pkg-config --exists xar) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config xar $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config xar $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config xar $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config xar $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config xar $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config xar $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config xar $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config xar $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config xar" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libxar $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libxar $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libxar $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libxar $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libxar $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libxar $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libxar $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libxar $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libxar" + fi + break + elif test ".`(xar-config --version; libxar-config --version) 2>/dev/null`" != .; then + + if test ".`(xar-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(xar-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(xar-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(xar-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(xar-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via xar-config" + else + + __rcl_flags="`(libxar-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libxar-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libxar-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libxar-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libxar-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lxar ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char xar_open (); +int +main () +{ +return xar_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lxar ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char xar_open (); +int +main () +{ +return xar_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/xar-config" && test ! -f "${__rcl_dir}/xar-config.in"; then + if test ".`(${__rcl_dir}/xar-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/xar-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/xar-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/xar-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/xar-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/xar-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libxar-config" && test ! -f "${__rcl_dir}/libxar-config.in"; then + if test ".`(${__rcl_dir}/libxar-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libxar-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libxar-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libxar-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libxar-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libxar-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists xar) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config xar $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config xar $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config xar $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config xar $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config xar $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config xar $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config xar $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config xar $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config xar" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libxar) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libxar $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libxar $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libxar $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libxar $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libxar $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libxar $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libxar $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libxar $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libxar" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/xar ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/xar.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/xar ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libxar.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libxar.a" || \ + test -f "${__rcl_dir}/libxar.so" || \ + test -f "${__rcl_dir}/libxar.sl" || \ + test -f "${__rcl_dir}/libxar.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "xar.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libxar.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + if test ".${__rcl_location_last}" = .internal; then + with_xar=yes + if test ".${__rcl_location_xar}" != .internal; then + as_fn_error $? "unable to find internal XAR library" "$LINENO" 5 + fi + else + __rcl_found=yes + for ac_header in xar.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "xar.h" "ac_cv_header_xar_h" "$ac_includes_default" +if test "x$ac_cv_header_xar_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_XAR_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xar_open in -lxar" >&5 +$as_echo_n "checking for xar_open in -lxar... " >&6; } +if ${ac_cv_lib_xar_xar_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lxar $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char xar_open (); +int +main () +{ +return xar_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_xar_xar_open=yes +else + ac_cv_lib_xar_xar_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xar_xar_open" >&5 +$as_echo "$ac_cv_lib_xar_xar_open" >&6; } +if test "x$ac_cv_lib_xar_xar_open" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBXAR 1 +_ACEOF + + LIBS="-lxar $LIBS" + +fi + + test ".${ac_cv_lib_xar_xar_open}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_xar=${__rcl_found} + fi + if test ".${with_xar}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_xar}" = .yes; then + +$as_echo "#define WITH_XAR 1" >>confdefs.h + + fi + WITH_XAR="${with_xar}" + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with XAR library" >&5 +$as_echo_n "checking whether to build with XAR library... " >&6; } + __rcl_msg="${with_xar}" + if test ".${with_xar}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_xar}" = .yes; then + +$as_echo "#define WITH_XAR 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + if true ; then + WITH_XAR_TRUE= + WITH_XAR_FALSE='#' +else + WITH_XAR_TRUE='#' + WITH_XAR_FALSE= +fi + + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + +$as_echo "#define HAVE_XAR_H 1" >>confdefs.h + + +$as_echo "#define HAVE_XAR_GET_SIZE 1" >>confdefs.h + + +$as_echo "#define HAVE_SYS_ACL_H 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xar_get_size in -lxar" >&5 +$as_echo_n "checking for xar_get_size in -lxar... " >&6; } +if ${ac_cv_lib_xar_xar_get_size+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lxar $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char xar_get_size (); +int +main () +{ +return xar_get_size (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_xar_xar_get_size=yes +else + ac_cv_lib_xar_xar_get_size=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xar_xar_get_size" >&5 +$as_echo "$ac_cv_lib_xar_xar_get_size" >&6; } +if test "x$ac_cv_lib_xar_xar_get_size" = xyes; then : + + +$as_echo "#define HAVE_XAR_GET_SIZE 1" >>confdefs.h + +fi + + fi + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + if false ; then + WITH_XAR_TRUE= + WITH_XAR_FALSE='#' +else + WITH_XAR_TRUE='#' + WITH_XAR_FALSE= +fi + + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + if test ".${with_dmalloc+set}" != .set; then + with_dmalloc="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-dmalloc=$with_dmalloc" >&6 + fi + + fi + if test ".${with_dmalloc}" = .yes; then + with_dmalloc="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-dmalloc=yes to --with-dmalloc=\"$with_dmalloc\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_dmalloc="" + __rcl_location_last="" + + +# Check whether --with-dmalloc was given. +if test "${with_dmalloc+set}" = set; then : + withval=$with_dmalloc; if test ".${with_dmalloc}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_dmalloc}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists dmalloc || pkg-config --exists libdmalloc) 2>/dev/null; then + + if (pkg-config --exists dmalloc) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config dmalloc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config dmalloc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config dmalloc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config dmalloc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config dmalloc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config dmalloc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config dmalloc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config dmalloc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config dmalloc" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libdmalloc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libdmalloc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libdmalloc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libdmalloc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libdmalloc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libdmalloc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libdmalloc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libdmalloc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libdmalloc" + fi + break + elif test ".`(dmalloc-config --version; libdmalloc-config --version) 2>/dev/null`" != .; then + + if test ".`(dmalloc-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(dmalloc-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(dmalloc-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(dmalloc-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(dmalloc-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via dmalloc-config" + else + + __rcl_flags="`(libdmalloc-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libdmalloc-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libdmalloc-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libdmalloc-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libdmalloc-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-ldmalloc ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dmalloc_malloc (); +int +main () +{ +return dmalloc_malloc (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-ldmalloc ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dmalloc_malloc (); +int +main () +{ +return dmalloc_malloc (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/dmalloc-config" && test ! -f "${__rcl_dir}/dmalloc-config.in"; then + if test ".`(${__rcl_dir}/dmalloc-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/dmalloc-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/dmalloc-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/dmalloc-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/dmalloc-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/dmalloc-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libdmalloc-config" && test ! -f "${__rcl_dir}/libdmalloc-config.in"; then + if test ".`(${__rcl_dir}/libdmalloc-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libdmalloc-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libdmalloc-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libdmalloc-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libdmalloc-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libdmalloc-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists dmalloc) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config dmalloc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config dmalloc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config dmalloc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config dmalloc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config dmalloc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config dmalloc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config dmalloc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config dmalloc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config dmalloc" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libdmalloc) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libdmalloc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libdmalloc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libdmalloc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libdmalloc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libdmalloc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libdmalloc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libdmalloc $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libdmalloc $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libdmalloc" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/dmalloc ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/dmalloc.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/dmalloc ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libdmalloc.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libdmalloc.a" || \ + test -f "${__rcl_dir}/libdmalloc.so" || \ + test -f "${__rcl_dir}/libdmalloc.sl" || \ + test -f "${__rcl_dir}/libdmalloc.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "dmalloc.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libdmalloc.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in dmalloc.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "dmalloc.h" "ac_cv_header_dmalloc_h" "$ac_includes_default" +if test "x$ac_cv_header_dmalloc_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DMALLOC_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dmalloc_malloc in -ldmalloc" >&5 +$as_echo_n "checking for dmalloc_malloc in -ldmalloc... " >&6; } +if ${ac_cv_lib_dmalloc_dmalloc_malloc+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldmalloc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dmalloc_malloc (); +int +main () +{ +return dmalloc_malloc (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dmalloc_dmalloc_malloc=yes +else + ac_cv_lib_dmalloc_dmalloc_malloc=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dmalloc_dmalloc_malloc" >&5 +$as_echo "$ac_cv_lib_dmalloc_dmalloc_malloc" >&6; } +if test "x$ac_cv_lib_dmalloc_dmalloc_malloc" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDMALLOC 1 +_ACEOF + + LIBS="-ldmalloc $LIBS" + +fi + + test ".${ac_cv_lib_dmalloc_dmalloc_malloc}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_dmalloc=${__rcl_found} + + if test ".${with_dmalloc}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_dmalloc}" = .yes; then + +$as_echo "#define WITH_DMALLOC 1" >>confdefs.h + + fi + WITH_DMALLOC="${with_dmalloc}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with DMalloc library" >&5 +$as_echo_n "checking whether to build with DMalloc library... " >&6; } + __rcl_msg="${with_dmalloc}" + if test ".${with_dmalloc}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_dmalloc}" = .yes; then + +$as_echo "#define WITH_DMALLOC 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + : + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable DMalloc library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + + + + if test ".${with_efence+set}" != .set; then + with_efence="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-efence=$with_efence" >&6 + fi + + fi + if test ".${with_efence}" = .yes; then + with_efence="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-efence=yes to --with-efence=\"$with_efence\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_efence="" + __rcl_location_last="" + + +# Check whether --with-efence was given. +if test "${with_efence+set}" = set; then : + withval=$with_efence; if test ".${with_efence}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_efence}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists efence || pkg-config --exists libefence) 2>/dev/null; then + + if (pkg-config --exists efence) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config efence $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config efence $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config efence $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config efence $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config efence $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config efence $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config efence $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config efence $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config efence" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libefence $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libefence $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libefence $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libefence $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libefence $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libefence $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libefence $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libefence $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libefence" + fi + break + elif test ".`(efence-config --version; libefence-config --version) 2>/dev/null`" != .; then + + if test ".`(efence-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(efence-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(efence-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(efence-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(efence-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via efence-config" + else + + __rcl_flags="`(libefence-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libefence-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libefence-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libefence-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libefence-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lefence ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char malloc (); +int +main () +{ +return malloc (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lefence ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char malloc (); +int +main () +{ +return malloc (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/efence-config" && test ! -f "${__rcl_dir}/efence-config.in"; then + if test ".`(${__rcl_dir}/efence-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/efence-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/efence-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/efence-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/efence-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/efence-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libefence-config" && test ! -f "${__rcl_dir}/libefence-config.in"; then + if test ".`(${__rcl_dir}/libefence-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libefence-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libefence-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libefence-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libefence-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libefence-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists efence) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config efence $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config efence $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config efence $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config efence $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config efence $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config efence $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config efence $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config efence $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config efence" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libefence) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libefence $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libefence $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libefence $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libefence $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libefence $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libefence $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libefence $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libefence $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libefence" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/efence ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/stdlib.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/efence ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libefence.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libefence.a" || \ + test -f "${__rcl_dir}/libefence.so" || \ + test -f "${__rcl_dir}/libefence.sl" || \ + test -f "${__rcl_dir}/libefence.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "stdlib.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libefence.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for malloc in -lefence" >&5 +$as_echo_n "checking for malloc in -lefence... " >&6; } +if ${ac_cv_lib_efence_malloc+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lefence $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char malloc (); +int +main () +{ +return malloc (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_efence_malloc=yes +else + ac_cv_lib_efence_malloc=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_efence_malloc" >&5 +$as_echo "$ac_cv_lib_efence_malloc" >&6; } +if test "x$ac_cv_lib_efence_malloc" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBEFENCE 1 +_ACEOF + + LIBS="-lefence $LIBS" + +fi + + test ".${ac_cv_lib_efence_malloc}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_efence=${__rcl_found} + + if test ".${with_efence}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_efence}" = .yes; then + +$as_echo "#define WITH_EFENCE 1" >>confdefs.h + + fi + WITH_EFENCE="${with_efence}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Electric Fence library" >&5 +$as_echo_n "checking whether to build with Electric Fence library... " >&6; } + __rcl_msg="${with_efence}" + if test ".${with_efence}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_efence}" = .yes; then + +$as_echo "#define WITH_EFENCE 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + : + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Electric Fence library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + +WITH_KEYUTILS_RPMKEY="" + + + + + + if test ".${with_keyutils+set}" != .set; then + with_keyutils="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-keyutils=$with_keyutils" >&6 + fi + + fi + if test ".${with_keyutils}" = .yes; then + with_keyutils="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-keyutils=yes to --with-keyutils=\"$with_keyutils\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_keyutils="" + __rcl_location_last="" + + +# Check whether --with-keyutils was given. +if test "${with_keyutils+set}" = set; then : + withval=$with_keyutils; if test ".${with_keyutils}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_keyutils}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists keyutils || pkg-config --exists libkeyutils) 2>/dev/null; then + + if (pkg-config --exists keyutils) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config keyutils $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config keyutils $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config keyutils $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config keyutils $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config keyutils $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config keyutils $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config keyutils $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config keyutils $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config keyutils" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libkeyutils $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libkeyutils $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libkeyutils $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libkeyutils $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libkeyutils $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libkeyutils $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libkeyutils $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libkeyutils $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libkeyutils" + fi + break + elif test ".`(keyutils-config --version; libkeyutils-config --version) 2>/dev/null`" != .; then + + if test ".`(keyutils-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(keyutils-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(keyutils-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(keyutils-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(keyutils-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via keyutils-config" + else + + __rcl_flags="`(libkeyutils-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libkeyutils-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libkeyutils-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libkeyutils-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libkeyutils-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lkeyutils ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char keyctl_read (); +int +main () +{ +return keyctl_read (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lkeyutils ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char keyctl_read (); +int +main () +{ +return keyctl_read (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/keyutils-config" && test ! -f "${__rcl_dir}/keyutils-config.in"; then + if test ".`(${__rcl_dir}/keyutils-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/keyutils-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/keyutils-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/keyutils-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/keyutils-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/keyutils-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libkeyutils-config" && test ! -f "${__rcl_dir}/libkeyutils-config.in"; then + if test ".`(${__rcl_dir}/libkeyutils-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libkeyutils-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libkeyutils-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libkeyutils-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libkeyutils-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libkeyutils-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists keyutils) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config keyutils $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config keyutils $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config keyutils $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config keyutils $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config keyutils $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config keyutils $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config keyutils $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config keyutils $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config keyutils" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libkeyutils) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libkeyutils $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libkeyutils $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libkeyutils $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libkeyutils $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libkeyutils $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libkeyutils $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libkeyutils $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libkeyutils $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libkeyutils" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/keyutils ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/keyutils.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/keyutils ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libkeyutils.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libkeyutils.a" || \ + test -f "${__rcl_dir}/libkeyutils.so" || \ + test -f "${__rcl_dir}/libkeyutils.sl" || \ + test -f "${__rcl_dir}/libkeyutils.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "keyutils.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libkeyutils.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in keyutils.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "keyutils.h" "ac_cv_header_keyutils_h" "$ac_includes_default" +if test "x$ac_cv_header_keyutils_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_KEYUTILS_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for keyctl_read in -lkeyutils" >&5 +$as_echo_n "checking for keyctl_read in -lkeyutils... " >&6; } +if ${ac_cv_lib_keyutils_keyctl_read+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lkeyutils $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char keyctl_read (); +int +main () +{ +return keyctl_read (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_keyutils_keyctl_read=yes +else + ac_cv_lib_keyutils_keyctl_read=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_keyutils_keyctl_read" >&5 +$as_echo "$ac_cv_lib_keyutils_keyctl_read" >&6; } +if test "x$ac_cv_lib_keyutils_keyctl_read" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBKEYUTILS 1 +_ACEOF + + LIBS="-lkeyutils $LIBS" + +fi + + test ".${ac_cv_lib_keyutils_keyctl_read}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_keyutils=${__rcl_found} + + if test ".${with_keyutils}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_keyutils}" = .yes; then + +$as_echo "#define WITH_KEYUTILS 1" >>confdefs.h + + fi + WITH_KEYUTILS="${with_keyutils}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Linux keyutils library" >&5 +$as_echo_n "checking whether to build with Linux keyutils library... " >&6; } + __rcl_msg="${with_keyutils}" + if test ".${with_keyutils}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_keyutils}" = .yes; then + +$as_echo "#define WITH_KEYUTILS 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + WITH_KEYUTILS_RPMKEY="rpmkey" + + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable Linux keyutils library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + +# later.. + + + + + + if test ".${with_cpuinfo+set}" != .set; then + with_cpuinfo="no" + + if test ".$verbose" = .yes; then + $as_echo "++ assuming --with-cpuinfo=$with_cpuinfo" >&6 + fi + + fi + if test ".${with_cpuinfo}" = .yes; then + with_cpuinfo="external:none" + + if test ".$verbose" = .yes; then + $as_echo "++ mapping --with-cpuinfo=yes to --with-cpuinfo=\"$with_cpuinfo\"" >&6 + fi + + fi + + + __rcl_result_hint="" + __rcl_location_cpuinfo="" + __rcl_location_last="" + + +# Check whether --with-cpuinfo was given. +if test "${with_cpuinfo+set}" = set; then : + withval=$with_cpuinfo; if test ".${with_cpuinfo}" != .no; then + __rcl_IFS="${IFS}"; IFS=":" + for __rcl_location in ${with_cpuinfo}; do + IFS="${__rcl_IFS}" + __rcl_location_last="${__rcl_location}" + + if test ".$verbose" = .yes; then + $as_echo "++ searching location: ${__rcl_location}" >&6 + fi + + if test ".${__rcl_location}" = .none; then + + if test ".$verbose" = .yes; then + $as_echo "-- no operation" >&6 + fi + + + elif test ".${__rcl_location}" = .external; then + if (pkg-config --exists cpuinfo || pkg-config --exists libcpuinfo) 2>/dev/null; then + + if (pkg-config --exists cpuinfo) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config cpuinfo $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config cpuinfo $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config cpuinfo $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config cpuinfo $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config cpuinfo $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config cpuinfo $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config cpuinfo $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config cpuinfo $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config cpuinfo" + else + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libcpuinfo $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libcpuinfo $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libcpuinfo $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libcpuinfo $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libcpuinfo $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libcpuinfo $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(pkg-config libcpuinfo $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(pkg-config libcpuinfo $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via pkg-config libcpuinfo" + fi + break + elif test ".`(cpuinfo-config --version; libcpuinfo-config --version) 2>/dev/null`" != .; then + + if test ".`(cpuinfo-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(cpuinfo-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(cpuinfo-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(cpuinfo-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(cpuinfo-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via cpuinfo-config" + else + + __rcl_flags="`(libcpuinfo-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libcpuinfo-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libcpuinfo-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(libcpuinfo-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via libcpuinfo-config" + fi + break + elif test ".${__rcl_found}" = .no; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lcpuinfo ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cpuinfo_new (); +int +main () +{ +return cpuinfo_new (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="external: implicit or default location" + break + fi + fi + elif test ".${__rcl_location}" = .system; then + __rcl_found_hdr=no + __rcl_found_lib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + __rcl_found_hdr=yes +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + __rcl_safe_LIBS="${LIBS}" + LIBS="-lcpuinfo ${LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cpuinfo_new (); +int +main () +{ +return cpuinfo_new (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + __rcl_found_lib=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${__rcl_safe_LIBS}" + + if test ".${__rcl_found_hdr}:${__rcl_found_lib}" = ".yes:yes"; then + __rcl_result_hint="system: explicitly controlled or system location" + break + fi + elif test -d "${__rcl_location}"; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/cpuinfo-config" && test ! -f "${__rcl_dir}/cpuinfo-config.in"; then + if test ".`(${__rcl_dir}/cpuinfo-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/cpuinfo-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/cpuinfo-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/cpuinfo-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/cpuinfo-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/cpuinfo-config" + __rcl_found=yes + break + fi + elif test -f "${__rcl_dir}/libcpuinfo-config" && test ! -f "${__rcl_dir}/libcpuinfo-config.in"; then + if test ".`(${__rcl_dir}/libcpuinfo-config --version) 2>/dev/null`" != .; then + + __rcl_flags="`(${__rcl_dir}/libcpuinfo-config --cppflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libcpuinfo-config --cflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libcpuinfo-config --ldflags) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="`(${__rcl_dir}/libcpuinfo-config --libs) 2>/dev/null`" + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/libcpuinfo-config" + __rcl_found=yes + break + fi + fi + done + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/bin ${__rcl_location}; do + if test -f "${__rcl_dir}/pkg-config"; then + if (${__rcl_dir}/pkg-config --exists cpuinfo) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config cpuinfo $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config cpuinfo $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config cpuinfo $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config cpuinfo $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config cpuinfo $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config cpuinfo $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config cpuinfo $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config cpuinfo $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config cpuinfo" + __rcl_found=yes + break + elif (${__rcl_dir}/pkg-config --exists libcpuinfo) 2>/dev/null; then + + __rcl_flags="" + for __rcl_query in --cflags-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libcpuinfo $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libcpuinfo $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CFLAGS: ${__rcl_flags}" >&6 + fi + + CFLAGS="${CFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --cflags-only-I; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libcpuinfo $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libcpuinfo $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: ${__rcl_flags}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-L --libs-only-other; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libcpuinfo $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libcpuinfo $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: ${__rcl_flags}" >&6 + fi + + LDFLAGS="${LDFLAGS} ${__rcl_flags}" + fi + + + __rcl_flags="" + for __rcl_query in --libs-only-l; do + if test ".$__rcl_flags" != .; then + __rcl_flags="${__rcl_flags} `(${__rcl_dir}/pkg-config libcpuinfo $__rcl_query) 2>/dev/null`" + else + __rcl_flags="`(${__rcl_dir}/pkg-config libcpuinfo $__rcl_query) 2>/dev/null`" + fi + done + if test ".${__rcl_flags}" != .; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LIBS: ${__rcl_flags}" >&6 + fi + + LIBS="${LIBS} ${__rcl_flags}" + fi + + __rcl_result_hint="external: via ${__rcl_dir}/pkg-config libcpuinfo" + __rcl_found=yes + break + fi + fi + done + fi + if test ".${__rcl_found}" = .no; then + for __rcl_dir in ${__rcl_location}/include/cpuinfo ${__rcl_location}/include ${__rcl_location}; do + if test -f "${__rcl_dir}/cpuinfo.h"; then + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + fi + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + for __rcl_dir in ${__rcl_location}/lib/cpuinfo ${__rcl_location}/lib ${__rcl_location}; do + + if test -f "${__rcl_dir}/libcpuinfo.la" && \ + test -d "${__rcl_dir}/.libs"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}/.libs" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir} -L${__rcl_dir}/.libs" + fi + __rcl_found=yes + break + fi + if test -f "${__rcl_dir}/libcpuinfo.a" || \ + test -f "${__rcl_dir}/libcpuinfo.so" || \ + test -f "${__rcl_dir}/libcpuinfo.sl" || \ + test -f "${__rcl_dir}/libcpuinfo.dylib"; then + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + fi + + done + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: directory ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .no; then + for __rcl_file in _ `find ${__rcl_location} -name "cpuinfo.h" -type f -print 2>/dev/null`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/include"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending CPPFLAGS: -I${__rcl_dir}" >&6 + fi + + CPPFLAGS="${CPPFLAGS} -I${__rcl_dir}" + fi + __rcl_found=yes + break + done + if test ".${__rcl_found}" = .yes; then + __rcl_found=no + + for __rcl_file in _ `find ${__rcl_location} -name "libcpuinfo.*" -type f -print 2>/dev/null | \ + egrep '\.(a|so|sl|dylib)$'`; do + test .${__rcl_file} = ._ && continue + __rcl_dir=`echo ${__rcl_file} | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` + if test ".${__rcl_dir}" != "./usr/lib"; then + + if test ".$verbose" = .yes; then + $as_echo "-- extending LDFLAGS: -L${__rcl_dir}" >&6 + fi + + LDFLAGS="${LDFLAGS} -L${__rcl_dir}" + fi + __rcl_found=yes + break + done + + fi + if test ".${__rcl_found}" = .yes; then + __rcl_result_hint="external: tree ${__rcl_location}" + fi + fi + if test ".${__rcl_found}" = .yes; then + break + fi + else + as_fn_error $? "Unknown location specification $__rcl_location" "$LINENO" 5 + fi + done + IFS="${__rcl_IFS}" + + + __rcl_found=yes + for ac_header in cpuinfo.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "cpuinfo.h" "ac_cv_header_cpuinfo_h" "$ac_includes_default" +if test "x$ac_cv_header_cpuinfo_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CPUINFO_H 1 +_ACEOF + +else + __rcl_found=no +fi + +done + + __rcl_found_lib=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cpuinfo_new in -lcpuinfo" >&5 +$as_echo_n "checking for cpuinfo_new in -lcpuinfo... " >&6; } +if ${ac_cv_lib_cpuinfo_cpuinfo_new+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcpuinfo $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cpuinfo_new (); +int +main () +{ +return cpuinfo_new (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_cpuinfo_cpuinfo_new=yes +else + ac_cv_lib_cpuinfo_cpuinfo_new=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpuinfo_cpuinfo_new" >&5 +$as_echo "$ac_cv_lib_cpuinfo_cpuinfo_new" >&6; } +if test "x$ac_cv_lib_cpuinfo_cpuinfo_new" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCPUINFO 1 +_ACEOF + + LIBS="-lcpuinfo $LIBS" + +fi + + test ".${ac_cv_lib_cpuinfo_cpuinfo_new}" = .yes && __rcl_found_lib=yes + + test ".${__rcl_found_lib}" = .no && __rcl_found="no" + with_cpuinfo=${__rcl_found} + + if test ".${with_cpuinfo}" = .yes && test ".${__rcl_result_hint}" = .; then + __rcl_result_hint="external: implicitly" + fi + fi + +fi + + + + if test ".${with_cpuinfo}" = .yes; then + +$as_echo "#define WITH_CPUINFO 1" >>confdefs.h + + fi + WITH_CPUINFO="${with_cpuinfo}" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with CPUInfo library" >&5 +$as_echo_n "checking whether to build with CPUInfo library... " >&6; } + __rcl_msg="${with_cpuinfo}" + if test ".${with_cpuinfo}" = .yes && test ".${__rcl_result_hint}" != .; then + __rcl_msg="${__rcl_msg} (${__rcl_result_hint})" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${__rcl_msg}" >&5 +$as_echo "${__rcl_msg}" >&6; } + + RPM_CHECK_LIB_LOCATION="${__rcl_location_last}" + if test ".${with_cpuinfo}" = .yes; then + +$as_echo "#define WITH_CPUINFO 1" >>confdefs.h + + + if test ".$verbose" = .yes; then + $as_echo "++ executing success action" >&6 + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: CPUInfo support is under development" >&5 +$as_echo "$as_me: WARNING: CPUInfo support is under development" >&2;} + else + + if test ".$verbose" = .yes; then + $as_echo "++ executing failure action" >&6 + fi + + + if test ".${RPM_CHECK_LIB_LOCATION}" != . && \ + test ".${RPM_CHECK_LIB_LOCATION}" != .none; then + as_fn_error $? "unable to find usable CPUInfo library" "$LINENO" 5 + fi + + fi + ${as_unset} RPM_CHECK_LIB_LOCATION + + + + + $as_echo "" >&6 + $as_echo "=== INSTALLATION PARAMETERS ===" >&6 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking root's primary group" >&5 +$as_echo_n "checking root's primary group... " >&6; } +if test "$cross_compiling" = yes; then : + ROOT_GROUP="root" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +int main() +{ + struct passwd *root = NULL; + struct group *roots_group = NULL; + FILE * tempfile = NULL; + root = getpwuid( (uid_t) 0 ); + if (root != NULL) { + roots_group = getgrgid(root->pw_gid); + if (roots_group != NULL) { + tempfile = fopen("conftest_rootg", "w"); + if (tempfile != NULL) { + fprintf(tempfile, "%s\n", roots_group->gr_name); + fclose(tempfile); + exit(0); + } + } + } + exit(1); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ROOT_GROUP=`cat conftest_rootg`; rm -f conftest_rootg +else + ROOT_GROUP="root" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ROOT_GROUP" >&5 +$as_echo "$ROOT_GROUP" >&6; } + + +target_os_gnu="%{nil}" +if echo "$target_os" | grep '.*-gnulibc1' > /dev/null ; then + target_os=`echo "${target_os}" | sed 's/-gnulibc1$//'` + target_os_gnu="-gnulibc1" +fi +if echo "$target_os" | grep '.*-gnu' > /dev/null ; then + target_os=`echo "${target_os}" | sed 's/-gnu$//'` + target_os_gnu="-gnu" +fi + +target_os_exact="${target_os}" +target_os_major=`echo "${target_os}" | sed 's/\..*$//'` +target_os_noversion=`echo "${target_os}" | sed 's/[0-9]*\..*$//'` + +rm -f ./find-provides +if test -f ${srcdir}/autodeps/${target_cpu}-${target_os_exact}.prov ; then + ln -s ${srcdir}/autodeps/${target_cpu}-${target_os_exact}.prov ./find-provides +elif test -f ${srcdir}/autodeps/${target_os_exact}.prov ; then + ln -s ${srcdir}/autodeps/${target_os_exact}.prov ./find-provides +elif test -f ${srcdir}/autodeps/${target_os_major}.prov ; then + ln -s ${srcdir}/autodeps/${target_os_major}.prov ./find-provides +elif test -f ${srcdir}/autodeps/${target_os_noversion}.prov ; then + ln -s ${srcdir}/autodeps/${target_os_noversion}.prov ./find-provides +else + ln -s ${srcdir}/autodeps/none ./find-provides +fi +rm -f ./find-requires +if test -f ${srcdir}/autodeps/${target_cpu}-${target_os_exact}.req ; then + ln -s ${srcdir}/autodeps/${target_cpu}-${target_os_exact}.req ./find-requires +elif test -f ${srcdir}/autodeps/${target_os_exact}.req ; then + ln -s ${srcdir}/autodeps/${target_os_exact}.req ./find-requires +elif test -f ${srcdir}/autodeps/${target_os_major}.req ; then + ln -s ${srcdir}/autodeps/${target_os_major}.req ./find-requires +elif test -f ${srcdir}/autodeps/${target_os_noversion}.req ; then + ln -s ${srcdir}/autodeps/${target_os_noversion}.req ./find-requires +else + ln -s ${srcdir}/autodeps/none ./find-requires +fi + +autorelocate_path='%{nil}' +autorelocate_dcolor='0' +RPMCANONCOLOR=3 +case "${target_cpu}" in +*86) RPMCANONARCH=i386 ;; +ia32e*) RPMCANONARCH=ia32e ;; +amd64*) RPMCANONARCH=amd64 ;; +x86_64*) RPMCANONARCH=x86_64 ;; +alpha*) RPMCANONARCH=alpha ;; +sparc64*) RPMCANONARCH=sparc64 ;; +sparc*) RPMCANONARCH=sparc ;; +ia64*) RPMCANONCOLOR=2; RPMCANONARCH=ia64; + autorelocate_path='/emul/%%{ARCH}-%%{OS}' + autorelocate_dcolor='1' ;; +s390x*) RPMCANONARCH=s390x ;; +s390*) RPMCANONARCH=s390 ;; +powerpc64*|ppc64*) RPMCANONARCH=ppc64 ;; +powerpc*|ppc*) RPMCANONARCH=ppc ;; +armv3l*) RPMCANONARCH=armv3l ;; +armv4l*) RPMCANONARCH=armv4l ;; +armv4b*) RPMCANONARCH=armv4b ;; +arm*) RPMCANONARCH="${target_cpu}" ;; +mipsel*) RPMCANONCOLOR=7; RPMCANONARCH=mipsel ;; +mips*) RPMCANONCOLOR=7; RPMCANONARCH=mips ;; +m68k*) RPMCANONARCH=m68k ;; +*) RPMCANONARCH=unknown ;; +esac +case "${target_os_noversion}" in +mint) RPMCANONARCH=m68kmint ;; +esac +RPMCANONVENDOR="$target_vendor" +case "${target_vendor}" in +unknown|pc|ibm|redhat|pld|mandriva|conectiva|lvr|yellowdog|caos|crux|ark|momonga|openmamba) + test -f /etc/SuSE-release && RPMCANONVENDOR=suse + test -f /etc/momonga-release && RPMCANONVENDOR=momonga + test -f /etc/owl-release -o -f /etc/owl-setup.conf -o -d /etc/mtree && RPMCANONVENDOR=openwall + test -f /etc/fedora-release && RPMCANONVENDOR=fedora + test -f /etc/redhat-release && RPMCANONVENDOR=redhat + test -f /etc/pld-release && RPMCANONVENDOR=pld + test -f /etc/mandriva-release && RPMCANONVENDOR=mandriva + test -f /etc/conectiva-release && RPMCANONVENDOR=conectiva + test -f /etc/lvr-release && RPMCANONVENDOR=lvr + test -f /etc/yellowdog-release && RPMCANONVENDOR=yellowdog + test -f /etc/caos-release && RPMCANONVENDOR=caos + test -f /usr/bin/crux && RPMCANONVENDOR=crux + test -f /etc/ark-release && RPMCANONVENDOR=ark + test -f /etc/openmamba-release && RPMCANONVENDOR=openmamba + ;; +esac +RPMCANONOS="$target_os_noversion" +RPMCANONGNU="$target_os_gnu" + + + + + + + + +: ${RPMUSER=rpm} +: ${RPMUID=37} +: ${RPMGROUP=rpm} +: ${RPMGID=37} +export RPMUSER RPMUID RPMGROUP RPMGID + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to determine NCPUS" >&5 +$as_echo_n "checking how to determine NCPUS... " >&6; } +NCPUS_COMMAND="echo 1" +case "$host" in + *-*-linux* ) NCPUS_COMMAND="/usr/bin/getconf _NPROCESSORS_ONLN" ;; + *-*-freebsd* ) NCPUS_COMMAND="/usr/bin/getconf NPROCESSORS_ONLN" ;; + *-*-solaris* ) NCPUS_COMMAND="psrinfo | egrep 'on-line' | wc -l | sed -e 's+^ *++'" ;; + *-*-darwin* ) NCPUS_COMMAND="/usr/sbin/sysctl -n hw.ncpu" ;; +esac +NCPUS_RESULT=`$NCPUS_COMMAND` +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \`$NCPUS_COMMAND\` ($NCPUS_RESULT)" >&5 +$as_echo "\`$NCPUS_COMMAND\` ($NCPUS_RESULT)" >&6; } + + + +# Check whether --with-path-versioned was given. +if test "${with_path_versioned+set}" = set; then : + withval=$with_path_versioned; WITH_PATH_VERSIONED=$withval +else + WITH_PATH_VERSIONED=no +fi + + if test ".$WITH_PATH_VERSIONED" = .yes ; then + WITH_PATH_VERSIONED_TRUE= + WITH_PATH_VERSIONED_FALSE='#' +else + WITH_PATH_VERSIONED_TRUE='#' + WITH_PATH_VERSIONED_FALSE= +fi + +if test ".$WITH_PATH_VERSIONED" = .yes; then + WITH_PATH_VERSIONED_SUFFIX="-${VERSION}" +else + WITH_PATH_VERSIONED_SUFFIX="" +fi + + + +if test "x$varprefix" = "x"; then + # For /usr and /usr/local, we want the 'var' directory to go + # in /var and /var/local respectively. For everything else, + # just put the 'var' directory in prefix/var. + case $prefix in + /usr | /usr/local ) varprefix=`echo $prefix | sed 's/usr/var/'` ;; + NONE ) varprefix=`echo $ac_default_prefix | sed 's/usr/var/'` ;; + * ) varprefix=$prefix/var ;; + esac +fi + +cat >>confdefs.h <<_ACEOF +#define VARPREFIX "$varprefix" +_ACEOF + + +if test X"$prefix" = XNONE ; then + usrprefix="$ac_default_prefix" +else + usrprefix=$prefix +fi + +cat >>confdefs.h <<_ACEOF +#define USRPREFIX "$usrprefix" +_ACEOF + + + +objext="$ac_cv_objext" + + +libext="$acl_cv_libext" + + +shlibext="$acl_cv_shlibext" + + +exeext="$ac_exeext" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM database directory" >&5 +$as_echo_n "checking for RPM database directory... " >&6; } +DBPATH=`echo "${varprefix}/lib/rpm"` +if test ".$WITH_PATH_VERSIONED" = .yes; then + DBPATH="${DBPATH}-${VERSION}" +fi + +# Check whether --with-path-database was given. +if test "${with_path_database+set}" = set; then : + withval=$with_path_database; DBPATH="$withval" + +fi + + +cat >>confdefs.h <<_ACEOF +#define DBPATH "$DBPATH" +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBPATH" >&5 +$as_echo "$DBPATH" >&6; } +DBPATH_MACRO=`echo "$DBPATH" | sed -e "s;^${varprefix}/;%{_var}/;" -e "s;^${usrprefix}/;%{_usr}/;"` + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM package sources directory" >&5 +$as_echo_n "checking for RPM package sources directory... " >&6; } +PKGSRCDIR=`echo "${usrprefix}/src/rpm"` +if test ".$WITH_PATH_VERSIONED" = .yes; then + PKGSRCDIR="${PKGSRCDIR}-${VERSION}" +fi + +# Check whether --with-path-sources was given. +if test "${with_path_sources+set}" = set; then : + withval=$with_path_sources; PKGSRCDIR="$withval" + +fi + + +cat >>confdefs.h <<_ACEOF +#define PKGSRCDIR "$PKGSRCDIR" +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGSRCDIR" >&5 +$as_echo "$PKGSRCDIR" >&6; } +PKGSRCDIR_MACRO=`echo "$PKGSRCDIR" | sed -e "s;^${varprefix}/;%{_var}/;" -e "s;^${usrprefix}/;%{_usr}/;"` + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM magic file" >&5 +$as_echo_n "checking for RPM magic file... " >&6; } +MAGIC_MACRO=`echo "${prefix}/share/file/magic"` +if $WITH_FILE_INTERNAL; then + MAGIC_MACRO="%{_rpmhome}/magic" +fi + +# Check whether --with-path-magic was given. +if test "${with_path_magic+set}" = set; then : + withval=$with_path_magic; MAGIC_MACRO="$withval" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_MACRO" >&5 +$as_echo "$MAGIC_MACRO" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM buildroot directory" >&5 +$as_echo_n "checking for RPM buildroot directory... " >&6; } +BUILDROOTDIR_MACRO="%{_tmppath}" + +# Check whether --with-path-buildroot was given. +if test "${with_path_buildroot+set}" = set; then : + withval=$with_path_buildroot; BUILDROOTDIR_MACRO="$withval" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILDROOTDIR_MACRO" >&5 +$as_echo "$BUILDROOTDIR_MACRO" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM locale directory" >&5 +$as_echo_n "checking for RPM locale directory... " >&6; } +LOCALEDIR=`echo "${usrprefix}/share/locale"` +if test ".$WITH_PATH_VERSIONED" = .yes; then + LOCALEDIR="$LOCALEDIR/rpm-$VERSION" +fi + +# Check whether --with-path-locale was given. +if test "${with_path_locale+set}" = set; then : + withval=$with_path_locale; LOCALEDIR="$withval" + +fi + + +cat >>confdefs.h <<_ACEOF +#define LOCALEDIR "$LOCALEDIR" +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LOCALEDIR" >&5 +$as_echo "$LOCALEDIR" >&6; } +localedir="$LOCALEDIR" # (pass-through to foreign generated po/Makefile, too) + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM system library directory" >&5 +$as_echo_n "checking for RPM system library directory... " >&6; } +USRLIBRPM=`echo "${usrprefix}/lib/rpm"` +if test ".$WITH_PATH_VERSIONED" = .yes; then + USRLIBRPM="${USRLIBRPM}-${VERSION}" +fi + +# Check whether --with-path-lib was given. +if test "${with_path_lib+set}" = set; then : + withval=$with_path_lib; USRLIBRPM="$withval" +else + ac_configure_args="$ac_configure_args --with-path-lib=\"$USRLIBRPM\"" + +fi + + +cat >>confdefs.h <<_ACEOF +#define USRLIBRPM "$USRLIBRPM" +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $USRLIBRPM" >&5 +$as_echo "$USRLIBRPM" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM global configuration directory" >&5 +$as_echo_n "checking for RPM global configuration directory... " >&6; } +SYSCONFIGDIR="/etc/rpm" +if test ".$WITH_PATH_VERSIONED" = .yes; then + SYSCONFIGDIR="$SYSCONFIGDIR/$VERSION" +fi + +# Check whether --with-path-cfg was given. +if test "${with_path_cfg+set}" = set; then : + withval=$with_path_cfg; SYSCONFIGDIR="$withval" + +fi + + +cat >>confdefs.h <<_ACEOF +#define SYSCONFIGDIR "$SYSCONFIGDIR" +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYSCONFIGDIR" >&5 +$as_echo "$SYSCONFIGDIR" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM macro files path" >&5 +$as_echo_n "checking for RPM macro files path... " >&6; } +MACROFILES="${USRLIBRPM}/macros" +MACROFILES="${MACROFILES}:${USRLIBRPM}/%{_target}/macros" +MACROFILES="${MACROFILES}:${SYSCONFIGDIR}/macros.*" +MACROFILES="${MACROFILES}:${SYSCONFIGDIR}/macros" +MACROFILES="${MACROFILES}:${SYSCONFIGDIR}/%{_target}/macros" + +# Check whether --with-extra-path-macros was given. +if test "${with_extra_path_macros+set}" = set; then : + withval=$with_extra_path_macros; MACROFILES="$MACROFILES:$withval" + +fi + +if test ".$WITH_PATH_VERSIONED" = .yes; then + MACROFILES="${MACROFILES}:~/.rpmmacros-${VERSION}" +else + MACROFILES="${MACROFILES}:~/.rpmmacros" +fi + +# Check whether --with-path-macros was given. +if test "${with_path_macros+set}" = set; then : + withval=$with_path_macros; MACROFILES="$withval" + +fi + + +cat >>confdefs.h <<_ACEOF +#define MACROFILES "$MACROFILES" +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MACROFILES" >&5 +$as_echo "$MACROFILES" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM POPT configuration files path" >&5 +$as_echo_n "checking for RPM POPT configuration files path... " >&6; } +RPMPOPTFILES="${USRLIBRPM}/rpmpopt" +RPMPOPTFILES="${RPMPOPTFILES}:${USRLIBRPM}/%{_target}/rpmpopt" +RPMPOPTFILES="${RPMPOPTFILES}:${SYSCONFIGDIR}/rpmpopt.*" +RPMPOPTFILES="${RPMPOPTFILES}:${SYSCONFIGDIR}/rpmpopt" +RPMPOPTFILES="${RPMPOPTFILES}:${SYSCONFIGDIR}/%{_target}/rpmpopt" +if test ".$WITH_PATH_VERSIONED" = .yes; then + RPMPOPTFILES="${RPMPOPTFILES}:~/.rpmpopt-${VERSION}" +else + RPMPOPTFILES="${RPMPOPTFILES}:~/.rpmpopt" +fi + +# Check whether --with-path-rpmpopt was given. +if test "${with_path_rpmpopt+set}" = set; then : + withval=$with_path_rpmpopt; RPMPOPTFILES="$withval" + +fi + + +cat >>confdefs.h <<_ACEOF +#define RPMPOPTFILES "$RPMPOPTFILES" +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $RPMPOPTFILES" >&5 +$as_echo "$RPMPOPTFILES" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM Lua script files path" >&5 +$as_echo_n "checking for RPM Lua script files path... " >&6; } +RPMLUAFILES="${USRLIBRPM}/init.lua:${USRLIBRPM}/rpmlua" +RPMLUAFILES="${RPMLUAFILES}:${USRLIBRPM}/%{_target}/rpmlua" +RPMLUAFILES="${RPMLUAFILES}:${SYSCONFIGDIR}/rpmlua.*" +RPMLUAFILES="${RPMLUAFILES}:${SYSCONFIGDIR}/rpmlua" +RPMLUAFILES="${RPMLUAFILES}:${SYSCONFIGDIR}/%{_target}/rpmlua" +if test ".$WITH_PATH_VERSIONED" = .yes; then + RPMLUAFILES="${RPMLUAFILES}:~/.rpmlua-${VERSION}" +else + RPMLUAFILES="${RPMLUAFILES}:~/.rpmlua" +fi + +# Check whether --with-path-rpmlua was given. +if test "${with_path_rpmlua+set}" = set; then : + withval=$with_path_rpmlua; RPMLUAFILES="$withval" + +fi + + +cat >>confdefs.h <<_ACEOF +#define RPMLUAFILES "$RPMLUAFILES" +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $RPMLUAFILES" >&5 +$as_echo "$RPMLUAFILES" >&6; } + +DISTRO_MACROS="#" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if building for a specfic vendor" >&5 +$as_echo_n "checking if building for a specfic vendor... " >&6; } + +# Check whether --with-vendor was given. +if test "${with_vendor+set}" = set; then : + withval=$with_vendor; if test ".$withval" != .no; then + case "$withval" in + "mandriva") + +$as_echo "#define RPM_VENDOR_MANDRIVA 1" >>confdefs.h + + DISTRO_MACROS="" + ;; + "ark") + +$as_echo "#define RPM_VENDOR_ARK 1" >>confdefs.h + + ;; + "fedora") + +$as_echo "#define RPM_VENDOR_FEDORA 1" >>confdefs.h + + ;; + "openmamba") + +$as_echo "#define RPM_VENDOR_OPENMAMBA 1" >>confdefs.h + + ;; + "suse") + +$as_echo "#define RPM_VENDOR_SUSE 1" >>confdefs.h + + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 +$as_echo "$withval" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + +fi + + + +testdir="`pwd`/tests" + + + + + $as_echo "" >&6 + $as_echo "=== OUTPUT GENERATION ===" >&6 + + +subdirs="$subdirs " + + +ac_config_files="$ac_config_files po/Makefile.in Doxyfile Makefile rpmpopt rpm.spec misc/Makefile rpmio/Makefile rpmio/auto/Makefile rpmio/auto/desc rpmio/auto/types rpmdb/Makefile rpmdb/auto/Makefile rpmdb/auto/desc rpmdb/auto/types lib/Makefile lib/auto/Makefile lib/auto/desc lib/auto/types build/Makefile build/auto/Makefile build/auto/desc build/auto/types tools/Makefile scripts/Makefile rpmdb/DB_CONFIG macros/macros macros/macros.rpmbuild macros/cmake macros/gstreamer macros/java macros/kernel macros/libtool macros/mandriva macros/suse macros/fedora macros/mono macros/perl macros/pkgconfig macros/php macros/python macros/ruby macros/selinux macros/tcl doc/Makefile doc/manual/Makefile doc/fr/Makefile doc/ja/Makefile doc/ko/Makefile doc/pl/Makefile doc/ru/Makefile doc/sk/Makefile js/Makefile python/Makefile ruby/Makefile scripts/rpm.pc lib/rpmversion.h rpmconstant/Makefile tests/Makefile tests/macros tests/mongo/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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_LD_VERSION_SCRIPT_TRUE}" && test -z "${HAVE_LD_VERSION_SCRIPT_FALSE}"; then + as_fn_error $? "conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_BUILD_INTLIBDEP_TRUE}" && test -z "${ENABLE_BUILD_INTLIBDEP_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_BUILD_INTLIBDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_BUILD_EXTLIBDEP_TRUE}" && test -z "${ENABLE_BUILD_EXTLIBDEP_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_BUILD_EXTLIBDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_BUILD_MAXEXTLIBDEP_TRUE}" && test -z "${ENABLE_BUILD_MAXEXTLIBDEP_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_BUILD_MAXEXTLIBDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_BUILD_LAFILES_TRUE}" && test -z "${ENABLE_BUILD_LAFILES_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_BUILD_LAFILES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +if test -z "${USE_NLS_TRUE}" && test -z "${USE_NLS_FALSE}"; then + as_fn_error $? "conditional \"USE_NLS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_TPM_TRUE}" && test -z "${WITH_TPM_FALSE}"; then + as_fn_error $? "conditional \"WITH_TPM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_TPM_TRUE}" && test -z "${WITH_TPM_FALSE}"; then + as_fn_error $? "conditional \"WITH_TPM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_LIBGIT2_TRUE}" && test -z "${WITH_LIBGIT2_FALSE}"; then + as_fn_error $? "conditional \"WITH_LIBGIT2\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_LIBGIT2_TRUE}" && test -z "${WITH_LIBGIT2_FALSE}"; then + as_fn_error $? "conditional \"WITH_LIBGIT2\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_FILE_INTERNAL_TRUE}" && test -z "${WITH_FILE_INTERNAL_FALSE}"; then + as_fn_error $? "conditional \"WITH_FILE_INTERNAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_FILE_INTERNAL_TRUE}" && test -z "${WITH_FILE_INTERNAL_FALSE}"; then + as_fn_error $? "conditional \"WITH_FILE_INTERNAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_UNIXODBC_TRUE}" && test -z "${WITH_UNIXODBC_FALSE}"; then + as_fn_error $? "conditional \"WITH_UNIXODBC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_UNIXODBC_TRUE}" && test -z "${WITH_UNIXODBC_FALSE}"; then + as_fn_error $? "conditional \"WITH_UNIXODBC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_DB_TRUE}" && test -z "${WITH_DB_FALSE}"; then + as_fn_error $? "conditional \"WITH_DB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_DB_INTERNAL_TRUE}" && test -z "${WITH_DB_INTERNAL_FALSE}"; then + as_fn_error $? "conditional \"WITH_DB_INTERNAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_DB_TRUE}" && test -z "${WITH_DB_FALSE}"; then + as_fn_error $? "conditional \"WITH_DB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_DB_INTERNAL_TRUE}" && test -z "${WITH_DB_INTERNAL_FALSE}"; then + as_fn_error $? "conditional \"WITH_DB_INTERNAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_DBSQL_TRUE}" && test -z "${WITH_DBSQL_FALSE}"; then + as_fn_error $? "conditional \"WITH_DBSQL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_DBSQL_TRUE}" && test -z "${WITH_DBSQL_FALSE}"; then + as_fn_error $? "conditional \"WITH_DBSQL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_DB_RPC_TRUE}" && test -z "${WITH_DB_RPC_FALSE}"; then + as_fn_error $? "conditional \"WITH_DB_RPC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_DB_TOOLS_INTEGRATED_TRUE}" && test -z "${WITH_DB_TOOLS_INTEGRATED_FALSE}"; then + as_fn_error $? "conditional \"WITH_DB_TOOLS_INTEGRATED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_DBSQL_CODEGEN_TRUE}" && test -z "${WITH_DBSQL_CODEGEN_FALSE}"; then + as_fn_error $? "conditional \"WITH_DBSQL_CODEGEN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_LUA_SHADOW_TRUE}" && test -z "${USE_LUA_SHADOW_FALSE}"; then + as_fn_error $? "conditional \"USE_LUA_SHADOW\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_LUA_CHKCONFIG_TRUE}" && test -z "${USE_LUA_CHKCONFIG_FALSE}"; then + as_fn_error $? "conditional \"USE_LUA_CHKCONFIG\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_LUA_CRYPTO_TRUE}" && test -z "${USE_LUA_CRYPTO_FALSE}"; then + as_fn_error $? "conditional \"USE_LUA_CRYPTO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_LUA_SOCKET_TRUE}" && test -z "${USE_LUA_SOCKET_FALSE}"; then + as_fn_error $? "conditional \"USE_LUA_SOCKET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_XAR_TRUE}" && test -z "${WITH_XAR_FALSE}"; then + as_fn_error $? "conditional \"WITH_XAR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_XAR_TRUE}" && test -z "${WITH_XAR_FALSE}"; then + as_fn_error $? "conditional \"WITH_XAR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_PATH_VERSIONED_TRUE}" && test -z "${WITH_PATH_VERSIONED_FALSE}"; then + as_fn_error $? "conditional \"WITH_PATH_VERSIONED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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 rpm $as_me 5.4.9, which was +generated by GNU Autoconf 2.68. 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="`echo $ac_config_files`" +config_headers="`echo $ac_config_headers`" +config_commands="`echo $ac_config_commands`" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +rpm config.status 5.4.9 +configured by $0, generated by GNU Autoconf 2.68, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_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"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $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"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $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"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ +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 \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +reload_flag_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_static_CXX \ +lt_cv_prog_compiler_c_o_CXX \ +export_dynamic_flag_spec_CXX \ +whole_archive_flag_spec_CXX \ +compiler_needs_object_CXX \ +with_gnu_ld_CXX \ +allow_undefined_flag_CXX \ +no_undefined_flag_CXX \ +hardcode_libdir_flag_spec_CXX \ +hardcode_libdir_separator_CXX \ +exclude_expsyms_CXX \ +include_expsyms_CXX \ +file_list_spec_CXX \ +compiler_lib_search_dirs_CXX \ +predep_objects_CXX \ +postdep_objects_CXX \ +predeps_CXX \ +postdeps_CXX \ +compiler_lib_search_path_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + 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 \ +sys_lib_dlsearch_path_spec \ +reload_cmds_CXX \ +old_archive_cmds_CXX \ +old_archive_from_new_cmds_CXX \ +old_archive_from_expsyms_cmds_CXX \ +archive_cmds_CXX \ +archive_expsym_cmds_CXX \ +module_cmds_CXX \ +module_expsym_cmds_CXX \ +export_symbols_cmds_CXX \ +prelink_cmds_CXX \ +postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + + +# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it + # from automake < 1.5. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; + "perl/Makefile.PL") CONFIG_FILES="$CONFIG_FILES perl/Makefile.PL" ;; + "perl/Makefile") CONFIG_FILES="$CONFIG_FILES perl/Makefile" ;; + "perl-URPM/Makefile.PL") CONFIG_FILES="$CONFIG_FILES perl-URPM/Makefile.PL" ;; + "perl-URPM/Makefile") CONFIG_FILES="$CONFIG_FILES perl-URPM/Makefile" ;; + "lua/Makefile") CONFIG_FILES="$CONFIG_FILES lua/Makefile" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + "Doxyfile") CONFIG_FILES="$CONFIG_FILES Doxyfile" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "rpmpopt") CONFIG_FILES="$CONFIG_FILES rpmpopt" ;; + "rpm.spec") CONFIG_FILES="$CONFIG_FILES rpm.spec" ;; + "misc/Makefile") CONFIG_FILES="$CONFIG_FILES misc/Makefile" ;; + "rpmio/Makefile") CONFIG_FILES="$CONFIG_FILES rpmio/Makefile" ;; + "rpmio/auto/Makefile") CONFIG_FILES="$CONFIG_FILES rpmio/auto/Makefile" ;; + "rpmio/auto/desc") CONFIG_FILES="$CONFIG_FILES rpmio/auto/desc" ;; + "rpmio/auto/types") CONFIG_FILES="$CONFIG_FILES rpmio/auto/types" ;; + "rpmdb/Makefile") CONFIG_FILES="$CONFIG_FILES rpmdb/Makefile" ;; + "rpmdb/auto/Makefile") CONFIG_FILES="$CONFIG_FILES rpmdb/auto/Makefile" ;; + "rpmdb/auto/desc") CONFIG_FILES="$CONFIG_FILES rpmdb/auto/desc" ;; + "rpmdb/auto/types") CONFIG_FILES="$CONFIG_FILES rpmdb/auto/types" ;; + "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "lib/auto/Makefile") CONFIG_FILES="$CONFIG_FILES lib/auto/Makefile" ;; + "lib/auto/desc") CONFIG_FILES="$CONFIG_FILES lib/auto/desc" ;; + "lib/auto/types") CONFIG_FILES="$CONFIG_FILES lib/auto/types" ;; + "build/Makefile") CONFIG_FILES="$CONFIG_FILES build/Makefile" ;; + "build/auto/Makefile") CONFIG_FILES="$CONFIG_FILES build/auto/Makefile" ;; + "build/auto/desc") CONFIG_FILES="$CONFIG_FILES build/auto/desc" ;; + "build/auto/types") CONFIG_FILES="$CONFIG_FILES build/auto/types" ;; + "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; + "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; + "rpmdb/DB_CONFIG") CONFIG_FILES="$CONFIG_FILES rpmdb/DB_CONFIG" ;; + "macros/macros") CONFIG_FILES="$CONFIG_FILES macros/macros" ;; + "macros/macros.rpmbuild") CONFIG_FILES="$CONFIG_FILES macros/macros.rpmbuild" ;; + "macros/cmake") CONFIG_FILES="$CONFIG_FILES macros/cmake" ;; + "macros/gstreamer") CONFIG_FILES="$CONFIG_FILES macros/gstreamer" ;; + "macros/java") CONFIG_FILES="$CONFIG_FILES macros/java" ;; + "macros/kernel") CONFIG_FILES="$CONFIG_FILES macros/kernel" ;; + "macros/libtool") CONFIG_FILES="$CONFIG_FILES macros/libtool" ;; + "macros/mandriva") CONFIG_FILES="$CONFIG_FILES macros/mandriva" ;; + "macros/suse") CONFIG_FILES="$CONFIG_FILES macros/suse" ;; + "macros/fedora") CONFIG_FILES="$CONFIG_FILES macros/fedora" ;; + "macros/mono") CONFIG_FILES="$CONFIG_FILES macros/mono" ;; + "macros/perl") CONFIG_FILES="$CONFIG_FILES macros/perl" ;; + "macros/pkgconfig") CONFIG_FILES="$CONFIG_FILES macros/pkgconfig" ;; + "macros/php") CONFIG_FILES="$CONFIG_FILES macros/php" ;; + "macros/python") CONFIG_FILES="$CONFIG_FILES macros/python" ;; + "macros/ruby") CONFIG_FILES="$CONFIG_FILES macros/ruby" ;; + "macros/selinux") CONFIG_FILES="$CONFIG_FILES macros/selinux" ;; + "macros/tcl") CONFIG_FILES="$CONFIG_FILES macros/tcl" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "doc/manual/Makefile") CONFIG_FILES="$CONFIG_FILES doc/manual/Makefile" ;; + "doc/fr/Makefile") CONFIG_FILES="$CONFIG_FILES doc/fr/Makefile" ;; + "doc/ja/Makefile") CONFIG_FILES="$CONFIG_FILES doc/ja/Makefile" ;; + "doc/ko/Makefile") CONFIG_FILES="$CONFIG_FILES doc/ko/Makefile" ;; + "doc/pl/Makefile") CONFIG_FILES="$CONFIG_FILES doc/pl/Makefile" ;; + "doc/ru/Makefile") CONFIG_FILES="$CONFIG_FILES doc/ru/Makefile" ;; + "doc/sk/Makefile") CONFIG_FILES="$CONFIG_FILES doc/sk/Makefile" ;; + "js/Makefile") CONFIG_FILES="$CONFIG_FILES js/Makefile" ;; + "python/Makefile") CONFIG_FILES="$CONFIG_FILES python/Makefile" ;; + "ruby/Makefile") CONFIG_FILES="$CONFIG_FILES ruby/Makefile" ;; + "scripts/rpm.pc") CONFIG_FILES="$CONFIG_FILES scripts/rpm.pc" ;; + "lib/rpmversion.h") CONFIG_FILES="$CONFIG_FILES lib/rpmversion.h" ;; + "rpmconstant/Makefile") CONFIG_FILES="$CONFIG_FILES rpmconstant/Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "tests/macros") CONFIG_FILES="$CONFIG_FILES tests/macros" ;; + "tests/mongo/Makefile") CONFIG_FILES="$CONFIG_FILES tests/mongo/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+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="CXX " + +# ### 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 + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm 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 + +# 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 in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# 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 + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# 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 + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects +postdep_objects=$lt_postdep_objects +predeps=$lt_predeps +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +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) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: CXX + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_CXX + +# A language specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU compiler? +with_gcc=$GCC_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# 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_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# 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_CXX + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# 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_CXX + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects_CXX +postdep_objects=$lt_postdep_objects_CXX +predeps=$lt_predeps_CXX +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# ### END LIBTOOL TAG CONFIG: CXX +_LT_EOF + + ;; + "po-directories":C) + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + # Treat a directory as a PO directory if and only if it has a + # POTFILES.in file. This allows packages to have multiple PO + # directories under different names or in different locations. + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + # Hide the ALL_LINGUAS assigment from automake < 1.5. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi + +# +# CONFIG_SUBDIRS section. +# +if test "$no_recursion" != yes; then + + # Remove --cache-file, --srcdir, and --disable-option-checking arguments + # so they do not pile up. + ac_sub_configure_args= + ac_prev= + eval "set x $ac_configure_args" + shift + for ac_arg + do + if test -n "$ac_prev"; then + ac_prev= + continue + fi + case $ac_arg in + -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=*) + ;; + --config-cache | -C) + ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + ;; + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + ;; + --disable-option-checking) + ;; + *) + case $ac_arg in + *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_sub_configure_args " '$ac_arg'" ;; + esac + done + + # Always prepend --prefix to ensure using the same prefix + # in subdir configurations. + ac_arg="--prefix=$prefix" + case $ac_arg in + *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" + + # Pass --silent + if test "$silent" = yes; then + ac_sub_configure_args="--silent $ac_sub_configure_args" + fi + + # Always prepend --disable-option-checking to silence warnings, since + # different subdirs can have different --enable and --with options. + ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" + + ac_popdir=`pwd` + for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. + test -d "$srcdir/$ac_dir" || continue + + ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" + $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 + $as_echo "$ac_msg" >&6 + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + cd "$ac_dir" + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f "$ac_srcdir/configure.gnu"; then + ac_sub_configure=$ac_srcdir/configure.gnu + elif test -f "$ac_srcdir/configure"; then + ac_sub_configure=$ac_srcdir/configure + elif test -f "$ac_srcdir/configure.in"; then + # This should be Cygnus configure. + ac_sub_configure=$ac_aux_dir/configure + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 +$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + # Make the cache file name correct relative to the subdirectory. + case $cache_file in + [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; + *) # Relative name. + ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 +$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} + # The eval makes quoting arguments work. + eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ + --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || + as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5 + fi + + cd "$ac_popdir" + done +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + diff --git a/rpm-5.4.9/configure.ac b/rpm-5.4.9/configure.ac new file mode 100644 index 0000000..61785ee --- /dev/null +++ b/rpm-5.4.9/configure.ac @@ -0,0 +1,2500 @@ +dnl ## +dnl ## configure.ac -- RPM Autoconf specification +dnl ## + +dnl ## +dnl ## ==== REQUIREMENTS & INITIALIZATION ==== +dnl ## + +AC_PREREQ(2.63) +m4_define([PACKAGE_BUGREPORT_DEFAULT], [rpm-devel@rpm5.org]) +AC_INIT([rpm],[5.4.9],[PACKAGE_BUGREPORT_DEFAULT]) +PACKAGE_TIMESTAMP="2012-04-02" dnl # YYYY[-MM[-DD[ HH[:MM]]]] +AC_MSG_TITLE([RPM Package Manager (RPM)], [$PACKAGE_VERSION]) + +AC_MSG_HEADER([INITIALIZATION]) +AC_CONFIG_SRCDIR([rpmqv.c]) +AC_CONFIG_HEADERS([config.h]) +AC_CANONICAL_TARGET +AM_INIT_AUTOMAKE([foreign tar-ustar]) +AC_REQUIRE_AUX_FILE([install-sh]) +AC_REQUIRE_AUX_FILE([mkinstalldirs]) +AM_MAINTAINER_MODE + +dnl # allow packagers to override the officially branding name +RPM_NAME="RPM" +AC_ARG_WITH(name, + AS_HELP_STRING([--with-name=NAME], [set official name of program (default: "RPM")]), [dnl + RPM_NAME="$withval" +]) +AC_DEFINE_UNQUOTED(RPM_NAME, "$RPM_NAME", [official name of program]) + +dnl # allow packagers to override the bugreport address +AC_ARG_WITH(bugreport, + AS_HELP_STRING([--with-bugreport=ADDRESS], [set packager bugreport Email/Web address (PACKAGE_BUGREPORT_DEFAULT)]), [dnl + case "$withval" in + *@*|http*://* ) PACKAGE_BUGREPORT="$withval" ;; + * ) AC_MSG_ERROR([invalid bugreport Email/Web address]) ;; + esac +]) + +dnl # Library code modified: REVISION++ +dnl # Interfaces changed/added/removed: CURRENT++ REVISION=0 +dnl # Interfaces added: AGE++ +dnl # Interfaces removed: AGE=0 +AC_SUBST(LT_CURRENT, 5) +AC_SUBST(LT_REVISION, 4) +AC_SUBST(LT_AGE, 0) + +dnl # provide RPM exported version +RPM_VERSION="0,0,_,0,0,_" +case "$PACKAGE_VERSION" in + *.*.DEVEL ) + RPM_VERSION=`echo "$PACKAGE_VERSION" |\ + sed -e 's;^\([[^.]]*\)\.\([[^.]]*\).*;\1,\2,_,0,0,_;'` + ;; + *.*.SNAPSHOT.* ) + RPM_VERSION=`echo "$PACKAGE_VERSION" |\ + sed -e 's;^\([[^.]]*\)\.\([[^.]]*\).*;\1,\2,_,0,0,s;'` + ;; + *.*a* ) + RPM_VERSION=`echo "$PACKAGE_VERSION" |\ + sed -e 's;^;X;' \ + -e 's;^X\([[^.]]*\)\.\([[^.]]*\)a\([[^.]]*\)\.\([[^.]]*\)$;\1,\2,a,\3,\4,_;' \ + -e 's;^X\([[^.]]*\)\.\([[^.]]*\)a\([[^.]]*\)$;\1,\2,a,\3,0,_;'` + ;; + *.*b* ) + RPM_VERSION=`echo "$PACKAGE_VERSION" |\ + sed -e 's;^;X;' \ + -e 's;^X\([[^.]]*\)\.\([[^.]]*\)b\([[^.]]*\)\.\([[^.]]*\)$;\1,\2,b,\3,\4,_;' \ + -e 's;^X\([[^.]]*\)\.\([[^.]]*\)b\([[^.]]*\)$;\1,\2,b,\3,0,_;'` + ;; + *.*rc* ) + RPM_VERSION=`echo "$PACKAGE_VERSION" |\ + sed -e 's;^;X;' \ + -e 's;^X\([[^.]]*\)\.\([[^.]]*\)rc\([[^.]]*\)\.\([[^.]]*\)$;\1,\2,c,\3,\4,_;' \ + -e 's;^X\([[^.]]*\)\.\([[^.]]*\)rc\([[^.]]*\)$;\1,\2,c,\3,0,_;'` + ;; + *.*.* ) + RPM_VERSION=`echo "$PACKAGE_VERSION" |\ + sed -e 's;^;X;' \ + -e 's;^X\([[^.]]*\)\.\([[^.]]*\)\.\([[^.]]*\)\.\([[^.]]*\)$;\1,\2,c,\3,\4,_;' \ + -e 's;^X\([[^.]]*\)\.\([[^.]]*\)\.\([[^.]]*\)$;\1,\2,r,\3,0,_;'` + ;; +esac +RPM_TIMESTAMP=`echo "$PACKAGE_TIMESTAMP" |\ + sed -e 's;^;X;' \ + -e 's;^X\([[0-9]]*\)-\([[0-9]]*\)-\([[0-9]]*\) \([[0-9]]*\):\([[0-9]]*\)$;\1,\2,\3,\4,\5;' \ + -e 's;^X\([[0-9]]*\)-\([[0-9]]*\)-\([[0-9]]*\) \([[0-9]]*\)$;\1,\2,\3,\4,0;' \ + -e 's;^X\([[0-9]]*\)-\([[0-9]]*\)-\([[0-9]]*\)$;\1,\2,\3,0,0;' \ + -e 's;^X\([[0-9]]*\)-\([[0-9]]*\)$;\1,\2,0,0,0;' \ + -e 's;^X\([[0-9]]*\)$;\1,0,0,0,0;' \ + -e 's;^X.*$;0,0,0,0,0;' \ + -e 's;,0\([[0-9]]\);,\1;g'` +RPM_VENDOR="'R','P','M','5'" +AC_SUBST([RPM_VERSION]) +AC_SUBST([RPM_TIMESTAMP]) +AC_SUBST([RPM_VENDOR]) + +dnl ## +dnl ## ==== TOOL-CHAIN CHECKS ==== +dnl ## + +AC_MSG_HEADER([TOOL-CHAIN CHECKS]) + +AC_PROG_CC_STDC +AC_PROG_CC +AC_PROG_CPP +AC_PROG_CXX + +AC_USE_SYSTEM_EXTENSIONS + +AC_CPP_FUNC + +AC_PROG_AWK +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_PROG_LIBTOOL +AC_PROG_YACC + +AC_PATH_PROG(AS, as, as) + +dnl # GCC specifics +AC_PROG_GCC_TRADITIONAL +AC_ARG_ENABLE(build-pic, + AS_HELP_STRING([--enable-build-pic], [build RPM with Position Independent Code (PIC) (GCC only)]), [dnl + if test ".$enableval" = .yes; then + if test ".`$CC --version 2>&1 | grep 'GCC'`" != .; then + dnl # GNU GCC (usually "gcc") + CFLAGS="$CFLAGS -fPIC -DPIC" + elif test ".`$CC -V 2>&1 | grep 'Sun C'`" != .; then + dnl # Sun Studio (usually "cc") + CFLAGS="$CFLAGS -KPIC -DPIC" + elif test ".`$CC -help 2>&1 | grep 'Intel Corporation'`" != .; then + dnl # Intel C/C++ Compiler (usually "icc") + CFLAGS="$CFLAGS -fPIC -DPIC" + else + AC_MSG_WARN([--enable-build-pic requires GCC, Sun Studio or Intel C/C++]) + fi + fi +]) +AC_ARG_ENABLE(build-pie, + AS_HELP_STRING([--enable-build-pie], [build RPM as Position Independent Executable (PIE) (GCC only)]), [dnl + if test ".$enableval" = .yes; then + if test ".$GCC" = .yes; then + CFLAGS="$CFLAGS -fpie" + LDFLAGS="$LDFLAGS -pie" + else + AC_MSG_WARN([--enable-build-pie requires GCC]) + fi + fi +]) +AC_ARG_ENABLE(build-warnings, + AS_HELP_STRING([--enable-build-warnings], [build RPM with extra compiler warnings turned on (GCC only)]), [dnl + if test ".$enableval" = .yes; then + if test ".`$CC --version 2>&1 | grep 'GCC'`" != .; then + dnl # GNU GCC (usually "gcc") + CFLAGS="$CFLAGS -Wall -W -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -Wno-unused-parameter -Wformat-security" +# XXX gcc-4.2 on Mac OS X hasn't +# CFLAGS="$CFLAGS -Wno-unused-but-set-variable" +# XXX rpmio/set.c needs this +# CFLAGS="$CFLAGS -Wno-override-init" + elif test ".`$CC -V 2>&1 | grep 'Sun C'`" != .; then + dnl # Sun Studio (usually "cc") + CFLAGS="$CFLAGS -v" + elif test ".`$CC -help 2>&1 | grep 'Intel Corporation'`" != .; then + dnl # Intel C/C++ Compiler (usually "icc") + CFLAGS="$CFLAGS -Wall -Wcheck -w1 -wr188 -wr981 -wr593 -wr869 -wr810" + else + AC_MSG_WARN([--enable-build-warnings requires GCC, Sun Studio or Intel C/C++]) + fi + fi +]) +AC_ARG_ENABLE(build-debug, + AS_HELP_STRING([--enable-build-debug], [build RPM instrumented for debugging]), [dnl + if test ".$enableval" = .yes; then + if test ".`$CC --version 2>&1 | grep 'GCC'`" != .; then + dnl # GNU GCC (usually "gcc") + CFLAGS="$CFLAGS -g3" + elif test ".`$CC -V 2>&1 | grep 'Sun C'`" != .; then + dnl # Sun Studio (usually "cc") + CFLAGS="$CFLAGS -xO0 -g" + elif test ".`$CC -help 2>&1 | grep 'Intel Corporation'`" != .; then + dnl # Intel C/C++ Compiler (usually "icc") + CFLAGS="$CFLAGS -O0 -g" + else + CFLAGS="$CFLAGS -g" + fi + fi +]) +dnl # build RPM instrumented for extra optimization/security (GCC only) +dnl # -fno-delete-null-pointer as the kernel does http://patchwork.kernel.org/patch/36060/ +if test ".`$CC --version 2>&1 | grep 'GCC'`" != .; then +dnl # GNU GCC (usually "gcc") + for c in -fno-delete-null-pointer-checks -D_FORTIFY_SOURCE=2 -fstack-protector -fexceptions -fnested-functions -Wno-missing-field-initializers + do + my_save_cflags="$CFLAGS" + CFLAGS=$c + AC_MSG_CHECKING([whether GCC supports $c]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], + [AC_MSG_RESULT([yes])] + [my_cflags=$c], + [AC_MSG_RESULT([no])] + ) + CFLAGS="$my_save_cflags $my_cflags" + done +fi +AC_ARG_ENABLE(build-gcov, + AS_HELP_STRING([--enable-build-gcov], [build RPM instrumented for gcov]), [dnl + if test ".$enableval" = .yes; then + if test ".`$CC --version 2>&1 | grep 'GCC'`" != .; then + dnl # GNU GCC (usually "gcc") + CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" + fi + fi +]) + +dnl # optional valgrind/cachegrind support +AC_ARG_WITH(valgrind, AS_HELP_STRING([--with-valgrind], [build RPM insturmented for valgrind tools]), [ + if test ".$withval" = .yes; then + AC_CHECK_HEADERS(valgrind/valgrind.h) + AC_DEFINE(WITH_VALGRIND, 1, [Build with valgrind support?]) + fi +]) + +dnl # Checks for OpenMP support +AC_LANG_PUSH(C) +AC_OPENMP +AC_LANG_POP(C) +AC_LANG_PUSH(C++) +AC_OPENMP +AC_LANG_POP(C++) + +dnl # RPM tries hard to use adaptive "feature tests" instead of +dnl # problematic "platform tests". Nevertheless for some extremely +dnl # platform specific parts of the code, we have to know for what +dnl # particular target Unix platform we are building. +RPM_OS_NAME=`dnl + [echo "$host_os" | \ + sed -e 's;^;X;' \ + -e 's;^X[^a-zA-Z]*\([a-zA-Z][a-zA-Z/-]*\).*$;\1;' \ + -e 's;^X.*;UNKNOWN;' | \ + sed -e 's;[/-];;' | \ + tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ']` +case "$RPM_OS_NAME" in + LINUX* ) RPM_OS_NAME="LINUX" ;; +esac +v1=0; v2=0; v3=0 +my_os="$host_os" +case "$my_os" in + *[[0-9]]* ) ;; + * ) my_os="${my_os}`uname -r`" ;; +esac +eval `dnl + [echo "$my_os" | \ + sed -e 's/^[^0-9]*\([0-9][0-9.]*\).*$/\1/' | \ + sed -e 's/^/X/' \ + -e 's/^X\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"; v3="\3"/' \ + -e 's/^X\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"/' \ + -e 's/^X\([0-9][0-9]*\).*$/v1="\1"/' \ + -e 's/^X.*$/:/']` +RPM_OS_VERS=`echo . |\ + awk '{ printf("%02d%02d%02d", v1, v2, v3); }' \ + v1="$v1" v2="$v2" v3="$v3"` +CPPFLAGS="$CPPFLAGS -DRPM_OS_${RPM_OS_NAME}=${RPM_OS_VERS}" + +dnl # support static linking of RPM via GNU libtool +LDFLAGS_STATIC="" +AC_ARG_ENABLE(build-static, + AS_HELP_STRING([--enable-build-static], [build RPM as a static executable]), [dnl + AC_MSG_CHECKING([whether to build RPM as a static executable (via GNU libtool)]) + if test ".$enableval" = .yes; then + case "$target" in + *-*-darwin*) LDFLAGS_STATIC="";; # Mac OS X does not do static binaries. + *-*-sysv5uw*) LDFLAGS_STATIC="-static";; # Unixware has no shared libthread. + *-*-linux*) LDFLAGS_STATIC="-all-static";; + *-*-freebsd*) LDFLAGS_STATIC="-all-static";; + *-*-osf*) LDFLAGS_STATIC="";; # OSF5 has no shared pthreads libs + *-*-aix*) LDFLAGS_STATIC="-static";; # -Wl,-bnso doesn't seem to work... + *-*-hpux*) LDFLAGS_STATIC="-static";; + *-*-solaris*) LDFLAGS_STATIC="-static";; + *-*-irix*) LDFLAGS_STATIC="-static";; # should be -non_shared, but can't link because of crt1.o then. + *-*-ultrix*) LDFLAGS_STATIC="-all-static";; # ultrix doesn't have shared libs. + *-*-*) LDFLAGS_STATIC="-static";; # let GNU libtool decide how to do it for the particular platform + esac + case "$target" in + *-*-linux*) + dnl # use libpthread.a that is NPTL aware + if test -f /usr/lib/nptl/libpthread.a; then + LDFLAGS_STATIC="$LDFLAGS_STATIC -L/usr/lib/nptl" + fi + if test -f /usr/lib64/nptl/libpthread.a; then + LDFLAGS_STATIC="$LDFLAGS_STATIC -L/usr/lib64/nptl" + fi + ;; + esac + AC_MSG_RESULT([yes (flag "$LDFLAGS_STATIC")]) + else + AC_MSG_RESULT([no]) + fi +]) +AC_SUBST(LDFLAGS_STATIC) + +dnl check for version script support in the linker (GNU ld, or Solaris ld style) +AC_ARG_ENABLE([build-versionscript], + AS_HELP_STRING([--enable-build-versionscript],[enable/disable use of linker version script. + (default is system dependent)]), + [have_ld_version_script=$enableval], + [have_ld_version_script=yes] ) + +AS_IF([test "x$have_ld_version_script" = xyes], + [ + AC_MSG_CHECKING([if ld version-script works - GNU ld, Solaris ld]) + cat > conftest.map </dev/null || true +a=`ls -l foo.chmodtest | awk '{print $1}'` +rm -f foo.chmodtest +if test "$a" = "-rwxr-xr-x"; then + AC_MSG_RESULT(yes) + FIXPERMS=a+rX,u+w,g-w,o-w +else + AC_MSG_RESULT([no (tell your OS vendor about GNU fileutils)]) + FIXPERMS=a+r,u+w,g-w,o-w +fi +AC_SUBST(FIXPERMS) + +dnl # see if we have a mkdir(1) that supports option "-p". +AC_PATH_PROGS(MKDIR, mkdir, mkdir) +AC_MSG_CHECKING([if $MKDIR supports -p]) +rm -rf conftest +__MKDIR_P="" +$MKDIR -p conftest/a 2>/dev/null +if test $? = 0; then + rmdir conftest/a 2>/dev/null + if test $? = 0; then + rmdir conftest 2>/dev/null + if test $? = 0; then + __MKDIR_P="$MKDIR -p" + fi + fi +fi +if test ".$__MKDIR_P" = .; then + AC_MSG_RESULT(no) + __MKDIR_P="%{_rpmhome}/mkinstalldirs" +else + AC_MSG_RESULT(yes) +fi +AC_DEFINE_UNQUOTED(__MKDIR_P, "${__MKDIR_P}", [full path to a 'mkdir -p' style program]) +AC_SUBST(__MKDIR_P) + +dnl # check for chown and symlink handling +AC_CHECK_FUNC(lchown, + [__CHOWN_RHF="%{__chown} -Rhf" + __CHGRP_RHF="%{__chgrp} -Rhf" + AC_DEFINE(HAVE_LCHOWN, 1, [Define as 1 if you have lchown()])], + [__CHOWN_RHF="%{__chown} -Rf" + __CHGRP_RHF="%{__chgrp} -Rf" + dnl Does chown() follow symlinks? This should be a good enough test. + AC_MSG_CHECKING(whether chown() follows symlinks) + AC_ARG_ENABLE([broken-chown], + [ --enable-broken-chown this system's chown follows symbolic links], + result=$enableval, result=unknown) + if echo "$build" | egrep "(aix|hpux|linux)" >/dev/null; then + result=yes + elif echo "$build" | grep "nextstep" >/dev/null; then + result=no + fi + if test $result = unknown; then + if test `${__ID} | cut -f2 -d\= | cut -f1 -d\(` = 0; then + rm -f foo bar + touch foo + ln -s foo bar + ${__CHOWN} 10 bar + if test `ls -l foo | awk '{print $3}'` != "root"; then + result=yes + else + result=no + fi + ${__RM} -f foo bar + else + AC_MSG_CHECKING((cannot check by non-root user)) + result=no + fi + fi + + AC_MSG_RESULT($result) + if test $result = yes; then + AC_DEFINE(CHOWN_FOLLOWS_SYMLINK, 1, [Define as 1 if chown() follows symlinks and you don't have lchown()]) + fi]) +AC_SUBST(__CHOWN_RHF) +AC_SUBST(__CHGRP_RHF) + +dnl # find the Perl interpreter +AC_PATH_PROG(PERL, perl perl5 miniperl) +if test ".$PERL" = .; then + AC_MSG_ERROR([Perl required in PATH for building rpmconstant/]) +fi +AC_SUBST(PERL) + +dnl # find some common programs +if test "$cross_compiling" = "yes"; then + MYPATH=":" +else + MYPATH=$PATH +fi + +DBXY=db53 + +AC_PATH_PROG(__BASH, bash, %{_bindir}/bash, $MYPATH) +AC_PATH_PROG(__BZIP2, bzip2, %{_bindir}/bzip2, $MYPATH) +AC_PATH_PROG(__CAT, cat, /bin/cat, $MYPATH) +AC_PATH_PROG(__CHATTR, chattr, %{_bindir}/chattr, $MYPATH) +AC_PATH_PROG(__CHGRP, chgrp, /bin/chgrp, $MYPATH) +AC_PATH_PROG(__CHMOD, chmod, /bin/chmod, $MYPATH) +AC_PATH_PROG(__CHOWN, chown, /bin/chown, $MYPATH) +AC_PATH_PROG(__CMAKE, cmake, %{_bindir}/cmake, $MYPATH) +AC_PATH_PROG(__CPIO, cpio, /bin/cpio, $MYPATH) +AC_PATH_PROG(__CURL, curl, %{_bindir}/curl, $MYPATH) +AC_PATH_PROG(__CVS, cvs, %{_bindir}/cvs, $MYPATH) +AC_PATH_PROG(__DB_ARCHIVE, ${DBXY}_archive, %{_bindir}/${DBXY}_archive, $MYPATH) +AC_PATH_PROG(__DB_CHECKPOINT, ${DBXY}_checkpoint, %{_bindir}/${DBXY}_checkpoint, $MYPATH) +AC_PATH_PROG(__DB_DEADLOCK, ${DBXY}_deadlock, %{_bindir}/${DBXY}_deadlock, $MYPATH) +AC_PATH_PROG(__DB_DUMP, ${DBXY}_dump, %{_bindir}/${DBXY}_dump, $MYPATH) +AC_PATH_PROG(__DB_HOTBACKUP, ${DBXY}_hotbackup, %{_bindir}/${DBXY}_hotbackup, $MYPATH) +AC_PATH_PROG(__DB_LOAD, ${DBXY}_load, %{_bindir}/${DBXY}_load, $MYPATH) +AC_PATH_PROG(__DB_LOG_VERIFY, ${DBXY}_log_verify, %{_bindir}/${DBXY}_log_verify, $MYPATH) +AC_PATH_PROG(__DB_PRINTLOG, ${DBXY}_printlog, %{_bindir}/${DBXY}_printlog, $MYPATH) +AC_PATH_PROG(__DB_RECOVER, ${DBXY}_recover, %{_bindir}/${DBXY}_recover, $MYPATH) +AC_PATH_PROG(__DB_REPLICATE, ${DBXY}_replicate, %{_bindir}/${DBXY}_replicate, $MYPATH) +AC_PATH_PROG(__DBSQL, ${DBXY}sql, %{_bindir}/${DBXY}sql, $MYPATH) +AC_PATH_PROG(__DB_SQL_CODEGEN, ${DBXY}_sql_codegen, %{_bindir}/${DBXY}_sql_codegen, $MYPATH) +AC_PATH_PROG(__DB_STAT, ${DBXY}_stat, %{_bindir}/${DBXY}_stat, $MYPATH) +AC_PATH_PROG(__DB_TUNER, ${DBXY}_tuner, %{_bindir}/${DBXY}_tuner, $MYPATH) +AC_PATH_PROG(__DB_UPGRADE, ${DBXY}_upgrade, %{_bindir}/${DBXY}_upgrade, $MYPATH) +AC_PATH_PROG(__DB_VERIFY, ${DBXY}_verify, %{_bindir}/${DBXY}_verify, $MYPATH) +AC_PATH_PROG(__DIFF, diff, /bin/diff, $MYPATH) +AC_PATH_PROG(__DITTO, ditto, %{_bindir}/ditto, $MYPATH) +AC_PATH_PROG(__FILE, file, %{_bindir}/file, $MYPATH) +AC_PATH_PROG(__GIT, git, %{_bindir}/git, $MYPATH) +AC_PATH_PROG(__GPG, gpg2, %{_bindir}/gpg2, $MYPATH) +AC_PATH_PROG(__GSR, gsr, %{_bindir}/gsr, $MYPATH) +AC_PATH_PROG(__GST_INSPECT, gst-inspect-0.10, %{_bindir}/gst-inspect-0.10, $MYPATH) +AC_PATH_PROG(__GZIP, gzip, /bin/gzip, $MYPATH) +AC_PATH_PROG(__HG, hg, %{_bindir}/hg, $MYPATH) +AC_PATH_PROG(__ID, id, /usr/bin/id, $MYPATH) +AC_PATH_PROG(__INSTALL, install, /usr/bin/install, $MYPATH) +AC_PATH_PROG(__LZIP, lzip, /usr/bin/lzip, $MYPATH) +AC_PATH_PROG(__LRZIP, lrzip, /usr/bin/lrzip, $MYPATH) +AC_PATH_PROG(__INSTALL_INFO, install-info, /sbin/install-info, $MYPATH) +AC_PATH_PROG(__LDCONFIG, ldconfig, /sbin/ldconfig, $MYPATH) +AC_PATH_PROG(__LN, ln, /bin/ln, $MYPATH) +AC_PATH_PROG(__LSATTR, lsattr, %{_bindir}/lsattr, $MYPATH) +AC_PATH_PROG(__LZMA, lzma, %{_bindir}/lzma, $MYPATH) +AC_PATH_PROG(__LZOP, lzop, %{_bindir}/lzop, $MYPATH) +AC_PATH_PROG(__MAKE, make, %{_bindir}/make, $MYPATH) +AC_PATH_PROG(__MKDIR, mkdir, /bin/mkdir, $MYPATH) +AC_PATH_PROG(__MONGO, mongo, %{_bindir}/mongo, $MYPATH) +AC_PATH_PROG(__MODINFO, modinfo, /sbin/modinfo, $MYPATH) +AC_PATH_PROG(__MV, mv, /bin/mv, $MYPATH) +AC_PATH_PROG(__PATCH, patch, %{_bindir}/patch, $MYPATH) +AC_PATH_PROG(__PAX, pax, %{_bindir}/pax, $MYPATH) +AC_PATH_PROG(__PERL, perl, %{_bindir}/perl, $MYPATH) +AC_PATH_PROG(__PGP, pgp, %{_bindir}/pgp, $MYPATH) +AC_PATH_PROG(__PHP, php, %{_bindir}/php, $MYPATH) +AC_PATH_PROG(__PYTHON, python, %{_bindir}/python, $MYPATH) +AC_PATH_PROG(__RM, rm, /bin/rm, $MYPATH) +AC_PATH_PROG(__RMDIR, rmdir, /bin/rmdir, $MYPATH) +AC_PATH_PROG(__RSH, rsh, %{_bindir}/rsh, $MYPATH) +AC_PATH_PROG(__RUBY, ruby, %{_bindir}/ruby, $MYPATH) +AC_PATH_PROG(__SED, sed, /bin/sed, $MYPATH) +AC_PATH_PROG(__SH, sh, /bin/sh, $MYPATH) +AC_PATH_PROG(__SQLITE3, sqlite3, %{_bindir}/sqlite3, $MYPATH) +AC_PATH_PROG(__SSH, ssh, %{_bindir}/ssh, $MYPATH) +AC_PATH_PROG(__SVN, svn, %{_bindir}/svn, $MYPATH) +AC_PATH_PROG(__TAR, tar, /bin/tar, $MYPATH) +AC_PATH_PROG(__TCLSH, tclsh, %{_bindir}/tclsh, $MYPATH) +AC_PATH_PROG(__UNZIP, unzip, %{_bindir}/unzip, $MYPATH) +AC_PATH_PROG(__XZ, xz, %{_bindir}/xz, $MYPATH) +AC_PATH_PROG(__LD, ld, %{_bindir}/ld, $MYPATH) +AC_PATH_PROG(__NM, nm, %{_bindir}/nm, $MYPATH) +AC_PATH_PROG(__OBJCOPY, objcopy, %{_bindir}/objcopy, $MYPATH) +AC_PATH_PROG(__OBJDUMP, objdump, %{_bindir}/objdump, $MYPATH) +AC_PATH_PROG(__STRIP, strip, %{_bindir}/strip, $MYPATH) + + +AC_CHECK_PROGS(LIBTOOLIZE, libtoolize glibtoolize, libtoolize) +AC_SUBST(LIBTOOLIZE) + +dnl # check for id -u +AC_MSG_CHECKING(whether id supports -u) +if ${__ID} -u 2>&1 > /dev/null; then + __ID_U="%{__id} -u" + AC_MSG_RESULT(yes) +else + __ID_U="%{__id} | %{__sed} 's/[[^=]]*=\\\\([[0-9]][[0-9]]*\\\\).*$/\\\\1/'" + AC_MSG_RESULT(no) +fi +AC_SUBST(__ID_U) + +dnl # auto-detect whether doxygen generated API docs should be included. +AC_PATH_PROG(__DOXYGEN, doxygen, no, $PATH) +withval=auto +AC_ARG_WITH(apidocs, AS_HELP_STRING([--with-apidocs], [build RPM API documentation])) +if test $withval = auto -a $__DOXYGEN != no; then + withval=yes +elif test $withval = yes -a $__DOXYGEN = no; then + AC_MSG_ERROR([RPM API docs need doxygen in PATH]) +fi +if test $withval = yes; then + WITH_APIDOCS_TARGET=apidocs + WITH_APIDOCS=1 +else + WITH_APIDOCS=0 +fi +AC_SUBST(WITH_APIDOCS_TARGET) +AC_SUBST(WITH_APIDOCS) + +dnl ## +dnl ## ==== API CHECKS ==== +dnl ## + +AC_MSG_HEADER([API CHECKS]) + +dnl # platform specific checks +AC_SEARCH_LIBS([strerror],[cposix]) + +dnl # standard checks +AC_C_INLINE +AC_C_BIGENDIAN + +dnl # platform-hack: don't trust darwin's configure-time check for endianness +dnl # configure result is used on platforms not using GCC compile-time macros +AH_VERBATIM([WORDS_BIGENDIAN], +[/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#if defined(__BIG_ENDIAN__) +#define WORDS_BIGENDIAN 1 +#elif defined(__LITTLE_ENDIAN__) +/* #undef WORDS_BIGENDIAN */ +#else +/* use configure result: */ +#undef WORDS_BIGENDIAN +#endif]) + +dnl # standard headers (specific) +AC_HEADER_STDC +AC_HEADER_MAJOR +AC_HEADER_DIRENT +AC_HEADER_TIME + +dnl # standard headers (generic) +AC_CHECK_HEADERS([dnl + fcntl.h getopt.h grp.h memory.h netdb.h pwd.h utime.h dnl + signal.h stdbool.h sys/endian.h sys/ipc.h sys/socket.h sys/select.h dnl + sys/time.h sys/types.h sys/stdtypes.h sys/mman.h sys/resource.h dnl + sys/utsname.h sys/prctl.h sys/wait.h netinet/in_systm.h dnl + machine/types.h mntent.h sys/mnttab.h sys/systemcfg.h dnl + sys/param.h sys/mount.h sys/mntctl.h sys/vmount.h dnl + libio.h err.h mcheck.h limits.h libgen.h float.h dnl + glob.h poll.h netinet/in.h arpa/inet.h dnl + langinfo.h dnl +]) + +dnl # GNU gettext support +AC_CHECK_HEADERS(locale.h) +AM_GNU_GETTEXT_VERSION(0.18.1) +AM_GNU_GETTEXT([external]) +AM_CONDITIONAL(USE_NLS, [ test ".$USE_NLS" = .yes ]) + +dnl # specific features +AC_SYS_LARGEFILE + +dnl Does this platform require array notation to assign to a va_list? +dnl If cross-compiling, we assume va_list is "normal". If this breaks +dnl you, set ac_cv_valistisarray=true and maybe define HAVE_VA_LIST_AS_ARRAY +dnl also just to be sure. +AC_MSG_CHECKING(whether va_list assignments need array notation) +AC_CACHE_VAL(ac_cv_valistisarray, + [AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include +#include + void foo(int i, ...) { + va_list ap1, ap2; + va_start(ap1, i); + ap2 = ap1; + if (va_arg(ap2, int) != 123 || va_arg(ap1, int) != 123) + { exit(1); } + va_end(ap1); va_end(ap2); + } + int main() { foo(0, 123); return(0); }]])],[ac_cv_valistisarray=false],[ac_cv_valistisarray=true],[ac_cv_valistisarray=false])]) + +if test "$ac_cv_valistisarray" = true ; then + AC_DEFINE(HAVE_VA_LIST_AS_ARRAY, 1, + [Define as 1 if your va_list type is an array]) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +AC_CHECK_VA_COPY +AC_CHECK_STATFS + +dnl # specific functions (specific) +AC_CHECK_FUNC(setreuid, [], [ AC_CHECK_LIB(ucb, setreuid, [if echo $LIBS | grep -- -lucb >/dev/null; then :; else LIBS="$LIBS -lc -lucb" USEUCB=y; fi]) ]) +AC_CHECK_FUNC(rand, [], [ AC_CHECK_LIB(rand, rand) ]) +AC_CHECK_FUNC(getdomainname, [], [ AC_CHECK_LIB(nsl, getdomainname) ]) +AC_CHECK_FUNC(socket, [], [ AC_CHECK_LIB(socket, socket) ]) + +dnl # specific functions (for linking against *external* Berkeley-DB under Solaris) +AC_CHECK_FUNC(fdatasync, [], [ AC_CHECK_LIB(rt, fdatasync) ]) +AC_CHECK_FUNC(sched_yield, [], [ AC_CHECK_LIB(rt, sched_yield) ]) +AC_CHECK_FUNC(clock_gettime, [], [ AC_CHECK_LIB(rt, clock_gettime) ]) + +dnl # specific functions (generic) +AC_CHECK_FUNCS(vsnprintf snprintf) +AC_CHECK_FUNCS(strcoll strverscmp) + +dnl # Error API +AC_CHECK_HEADERS(error.h) +AC_CHECK_FUNCS(error) + +dnl # POSIX search(3) API +AC_CHECK_HEADERS(search.h) +AC_CHECK_FUNC(insque, [], [ AC_CHECK_LIB(compat, insque) ]) + +dnl # POSIX pthreads API +WITH_PTHREADS=no +AC_ARG_WITH([pthreads], + AS_HELP_STRING([--without-pthreads], [build RPM without POSIX pthreads]), + [ WITH_PTHREADS="$withval" ], [ WITH_PTHREADS=yes ]) +if test ".$WITH_PTHREADS" = .yes; then + AC_DEFINE(WITH_PTHREADS, 1, [Define to 1 for using Pthreads]) + AC_CHECK_HEADERS(thread.h pthread.h synch.h semaphore.h) + AC_CHECK_LIB(pthread, pthread_mutex_trylock, [], [ + AC_CHECK_LIB(pthread, __pthread_mutex_trylock, [], [ + AC_CHECK_LIB(thread, mutex_lock) + ]) + ]) +fi + +dnl # tries to retrofit an assert(x) macro +AC_CHECK_HEADERS(assert.h) + +dnl # FIXME: platform-hack: MiNT +AC_CHECK_LIB(port, writev) + +dnl # FIXME: platform-hack: AmigaOS and IXEmul have a fork() dummy +case "$target" in + m68k-*-amigaos ) CFLAGS="$CFLAGS -Dfork=vfork" ;; +esac + +dnl # platform-hack: The Mac OS X (aka Darwin) ld(1) uses a strange +dnl # non-standard Unix library search path order. This causes great +dnl # problems when linking against the third-party libraries. +dnl # Force ld(1) to stick standard Unix search path order. +case "$host" in + *-*-darwin* ) LDFLAGS="$LDFLAGS -Wl,-search_paths_first" ;; +esac + +dnl # FIXME: platform-hack: SCO and SunOS 4.x +if echo "$target_os" | grep sco > /dev/null; then + AC_DEFINE(NEED_STRINGS_H, 1, [Define as one if we need to include (along with )]) + AC_DEFINE(HAVE_STRUCT_MNTTAB, 1, [Define as 1 if you have "struct mnttab" (only sco?)]) +elif echo "$target_os" | grep sunos > /dev/null; then + CFLAGS="$CFLAGS -D__USE_FIXED_PROTOTYPES__" + AC_DEFINE(NEED_STRINGS_H, 1, [Define as one if we need to include (along with )]) + AC_DEFINE(NEED_MYREALLOC, 1, [Define as 1 if we need myrealloc]) + AC_LIBOBJ(myrealloc) +fi + +dnl look for libc features +PROVIDES_ERRNO=no +AC_MSG_CHECKING(if defines h_errno) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[printf("%d",h_errno)]])],[PROVIDES_ERRNO=yes],[]) +AC_MSG_RESULT($PROVIDES_ERRNO) +if test $PROVIDES_ERRNO = yes; then + AC_DEFINE(HAVE_HERRNO, 1, [ Define as 1 if defines h_errno]) +fi + +dnl If a system doesn't have S_IFSOCK, define it as 0 which will +dnl make S_ISSOCK always return false (nice, eh?) +AC_MSG_CHECKING(if defines S_IFSOCK) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[printf("%d", S_IFSOCK)]])],[HAS_S_IFSOCK=yes],[HAS_S_IFSOCK=no]) +AC_MSG_RESULT($HAS_S_IFSOCK) +if test $HAS_S_IFSOCK = yes; then + AC_DEFINE(HAVE_S_IFSOCK, 1, [Define as 1 if defines S_IFSOCK]) +fi + +dnl Some Unix's are missing S_ISLNK, S_ISSOCK +AC_MSG_CHECKING(if defines S_ISLNK) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[printf("%d", S_ISLNK(0755))]])],[HAS_S_ISLNK=yes],[HAS_S_ISLNK=no]) +AC_MSG_RESULT($HAS_S_ISLNK) +if test $HAS_S_ISLNK = yes; then + AC_DEFINE(HAVE_S_ISLNK, 1, [Define as 1 if defines S_ISLNK]) +fi + +AC_MSG_CHECKING(if defines S_ISSOCK) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[printf("%d", S_ISSOCK(0755))]])],[HAS_S_ISSOCK=yes],[HAS_S_ISSOCK=no]) +AC_MSG_RESULT($HAS_S_ISSOCK) +if test $HAS_S_ISSOCK = yes; then + AC_DEFINE(HAVE_S_ISSOCK, 1, [Define as 1 if defines S_ISSOCK]) +fi + +dnl Handle uglix dialectical differences with S_ISTXT and S_ISVTX +AC_MSG_CHECKING(if defines S_ISTXT) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[printf("%d", S_ISTXT)]])],[HAS_S_ISTXT=yes],[HAS_S_ISTXT=no]) +AC_MSG_RESULT($HAS_S_ISTXT) +if test $HAS_S_ISTXT = yes; then + AC_DEFINE(HAVE_S_ISTXT, 1, [Define as 1 if defines S_ISTXT]) +fi +AC_MSG_CHECKING(if defines S_ISVTX) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[printf("%d", S_ISVTX)]])],[HAS_S_ISVTX=yes],[HAS_S_ISVTX=no]) +AC_MSG_RESULT($HAS_S_ISVTX) +if test $HAS_S_ISVTX = yes; then + AC_DEFINE(HAVE_S_ISVTX, 1, [Define as 1 if defines S_ISVTX]) +fi + +# Find the best function to set timestamps. +AC_CHECK_FUNCS([futimens futimes futimesat utimes utime], [break]) + +dnl # The command line tool can copy high resolution timestamps if such +dnl # information is availabe in struct stat. Otherwise one second accuracy +dnl # is used. +AC_CHECK_MEMBERS([ + struct stat.st_atim.tv_nsec, + struct stat.st_atimespec.tv_nsec, + struct stat.st_atimensec, + struct stat.st_uatime, + struct stat.st_atim.st__tim.tv_nsec, + struct stat.st_birthtime, + struct stat.st_flags]) + +AC_MSG_CHECKING(if timezone is defined) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[printf("%ld", timezone)]])],[HAS_TIMEZONE=yes],[HAS_TIMEZONE=no]) +AC_MSG_RESULT($HAS_TIMEZONE) + +dnl check for missing typedefs +AC_TYPE_MODE_T +AC_TYPE_OFF_T +AC_TYPE_PID_T +AC_TYPE_SIZE_T + +dnl check size of built-in types +AC_CHECK_TYPES([long long, long double]) +AC_CHECK_SIZEOF(char, 1) +AC_CHECK_SIZEOF(unsigned char, 1) +AC_CHECK_SIZEOF(short, 2) +AC_CHECK_SIZEOF(unsigned short, 2) +AC_CHECK_SIZEOF(int, 4) +AC_CHECK_SIZEOF(unsigned int, 4) +AC_CHECK_SIZEOF(long, 4) +AC_CHECK_SIZEOF(unsigned long, 4) +AC_CHECK_SIZEOF(long long, 8) +AC_CHECK_SIZEOF(unsigned long long, 8) + +dnl linux/posix and *BSD signals differ still, sigh +AC_CHECK_TYPES([sighanlder_t, sig_t]) + +dnl checks for library functions (specific) +AC_FUNC_ALLOCA +AC_FUNC_VPRINTF +AC_FUNC_MMAP + +dnl checks for library functions (generic) +AC_CHECK_FUNCS([dnl + asprintf basename chflags clearenv confstr fallocate fchflags fchmod dnl + ftok getaddrinfo getattrlist getcwd getdelim getline getmode getnameinfo dnl + getpassphrase getxattr getwd iconv inet_aton lchflags lchmod lchown dnl + lgetxattr lsetxattr lutimes madvise mempcpy mkdtemp mkstemp mtrace dnl + posix_fadvise posix_fallocate putenv realpath regcomp __secure_getenv dnl + setattrlist setenv setlocale setmode setxattr dnl + sigaddset sigdelset sigemptyset sighold sigrelse sigpause dnl + sigprocmask sigsuspend sigaction dnl + stpcpy stpncpy strcspn strdup strerror strmode strndup strspn strstr dnl + strtol strtoul dnl +]) + +dnl # specific additional tests needed to replace Berkeley-DB db_config.h with RPM config.h +AC_CHECK_FUNCS([dnl + isalpha isdigit isprint isspace localtime memcmp memcpy memmove printf dnl + qsort raise rand strcasecmp strcat strchr strncat strncmp strrchr strsep dnl + time atoi atol getopt fclose fgetc fgets fopen fwrite dnl +]) + +dnl # check for getmntent and alternatives +AC_CHECK_FUNC(getmntent, AC_DEFINE(HAVE_GETMNTENT, 1, [Define if you have the getmntent() function]), [ + AC_CHECK_FUNC(mntctl, AC_DEFINE(HAVE_MNTCTL, 1, [Define as 1 if you have mntctl() (only aix?)]),[ + AC_CHECK_FUNC(getmntinfo, AC_DEFINE(HAVE_GETMNTINFO, 1, [Define as 1 if you have getmntinfo() (Mac OS X)]), [ + AC_CHECK_FUNC(getmntinfo_r, AC_DEFINE(HAVE_GETMNTINFO_R, 1, [Define as 1 if you have getmntinfo_r() (only osf?)]), [ + AC_CHECK_LIB(c_r, getmntinfo_r, [LIBS="$LIBS -lc_r"; + AC_DEFINE(HAVE_GETMNTINFO_R, 1, [Define as 1 if you have getmntinfo_r() (only osf?)])], [ + AC_DEFINE([USE_GETMNTENT], 1, [Defined if getmntent replacement is used]) + AC_LIBOBJ(getmntent)]) + ]) + ]) + ]) +]) + +AC_CHECK_FUNCS(syslog) +if test $ac_cv_func_syslog = no; then + # syslog is not in the default libraries. See if it's in some other. + for lib in bsd socket inet; do + AC_CHECK_LIB($lib, syslog, [AC_DEFINE(HAVE_SYSLOG) + LIBS="$LIBS -l$lib"; break]) + done +fi + +AC_CHECK_FUNCS(setproctitle) +if test $ac_cv_func_setproctitle = no; then + # setproctitle is not in the default libraries. See if it's in some other. + AC_CHECK_LIB(setproctitle, setproctitle, [AC_DEFINE(HAVE_SETPROCTITLE) + LIBS="$LIBS -lsetproctitle"]) +fi + +dnl # Check how to find out the amount of physical memory in the system. The +dnl # xz command line tool uses this to automatically limit its memory usage. +dnl # - sysconf() gives all the needed info on GNU+Linux and Solaris. +dnl # - BSDs use sysctl(). +AC_MSG_CHECKING([how to detect the amount of physical memory]) +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#include +int +main() +{ + long i; + i = sysconf(_SC_PAGESIZE); + i = sysconf(_SC_PHYS_PAGES); + return 0; +} +]])], [ + AC_DEFINE([HAVE_PHYSMEM_SYSCONF], [1], + [Define to 1 if the amount of physical memory can be detected + with sysconf(_SC_PAGESIZE) and sysconf(_SC_PHYS_PAGES).]) + AC_MSG_RESULT([sysconf]) +], [ +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#include +#ifdef HAVE_SYS_PARAM_H +# include +#endif +#include +int +main() +{ + int name[2] = { CTL_HW, HW_PHYSMEM }; + unsigned long mem; + size_t mem_ptr_size = sizeof(mem); + sysctl(name, 2, &mem, &mem_ptr_size, NULL, NULL); + return 0; +} +]])], [ + AC_DEFINE([HAVE_PHYSMEM_SYSCTL], [1], + [Define to 1 if the amount of physical memory can be detected + with sysctl().]) + AC_MSG_RESULT([sysctl]) +], [ + AC_MSG_RESULT([unknown]) +])]) + +dnl # Check how to find out the number of available CPU cores in the system. +dnl # sysconf(_SC_NPROCESSORS_ONLN) works on most systems, except that BSDs +dnl # use sysctl(). +AC_MSG_CHECKING([how to detect the number of available CPU cores]) +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#include +int +main() +{ + long i; + i = sysconf(_SC_NPROCESSORS_ONLN); + return 0; +} +]])], [ + AC_DEFINE([HAVE_NCPU_SYSCONF], [1], + [Define to 1 if the number of available CPU cores can be + detected with sysconf(_SC_NPROCESSORS_ONLN).]) + AC_MSG_RESULT([sysconf]) +], [ +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#include +#ifdef HAVE_SYS_PARAM_H +# include +#endif +#include +int +main() +{ + int name[2] = { CTL_HW, HW_NCPU }; + int cpus; + size_t cpus_size = sizeof(cpus); + sysctl(name, 2, &cpus, &cpus_size, NULL, NULL); + return 0; +} +]])], [ + AC_DEFINE([HAVE_NCPU_SYSCTL], [1], + [Define to 1 if the number of available CPU cores can be + detected with sysctl().]) + AC_MSG_RESULT([sysctl]) +], [ + AC_MSG_RESULT([unknown]) +])]) + +dnl ## +dnl ## ==== THIRD-PARTY LIBRARIES (1/2) ==== +dnl ## + +AC_MSG_HEADER([THIRD-PARTY LIBRARIES (1/2)]) + +dnl # optional ELF support +WITH_LIBELF_DEBUGEDIT="" +AC_MSG_CHECKING([whether to use libelf/gelf API]) +AC_ARG_WITH(libelf, AS_HELP_STRING([--with-libelf], [use libelf/gelf API]), [ + if test ".$withval" = .yes; then + AC_MSG_RESULT(yes) + AC_CHECK_HEADERS([libelf.h gelf.h]) + if test ".$ac_cv_header_libelf_h" = .no; then + dnl # on Solaris is incompatible with LFS. If we couldn't + dnl # include , see if we can when _FILE_OFFSET_BITS is + dnl # set for non-LFS. Same applies for , since it probably + dnl # includes + AC_MSG_CHECKING([if libelf.h conflicts with _LARGEFILE_SOURCE]) + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ +#undef _LARGEFILE64_SOURCE +#undef _LARGEFILE_SOURCE +#if !defined(_LP64) +# undef _FILE_OFFSET_BITS +# define _FILE_OFFSET_BITS 32 +#endif +#include + ]], [[ + Elf_Data foo; + ]]) + ], [ + AC_DEFINE(HAVE_LIBELF_H, 1, [Define to 1 if you have libelf.h]) + ac_cv_header_libelf_h=yes + AC_DEFINE(LIBELF_H_LFS_CONFLICT, 1, [Define to 1 if libelf.h is incompatible with LFS API]) + AC_MSG_RESULT(yes) + ], [ + AC_MSG_RESULT(no) + ]) + fi + if test ".$ac_cv_header_gelf_h" = .no; then + AC_MSG_CHECKING([if gelf.h conflicts with _LARGEFILE_SOURCE]) + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ +#undef _LARGEFILE64_SOURCE +#undef _LARGEFILE_SOURCE +#if !defined(_LP64) +# undef _FILE_OFFSET_BITS +# define _FILE_OFFSET_BITS 32 +#endif +#include + ]], [[ + Elf32_Verdef foo; + ]]) + ], [ + AC_DEFINE(HAVE_GELF_H, 1, [Define to 1 if you have gelf.h]) + ac_cv_header_gelf_h=yes + AC_MSG_RESULT(yes) + ], [ + AC_MSG_RESULT(no) + ]) + fi + if test ".$ac_cv_header_gelf_h" = .yes; then + AC_CHECK_LIB([elf], [elf_version], [ + AC_CHECK_LIB([elf], [gelf_getvernaux], [ + AC_DEFINE(HAVE_GELF_GETVERNAUX, 1, [Define to 1 if you have the gelf_getvernaux() function.]) + ]) + AC_CHECK_LIB([elf], [gelf_getnote], [ + AC_DEFINE(HAVE_GELF_GETNOTE, 1, [Define to 1 if you have the gelf_getnote() function.]) + ]) + AC_DEFINE(HAVE_LIBELF, 1, [Define to 1 if you have ELF library]) + WITH_LIBELF_DEBUGEDIT="debugedit" + LIBS="$LIBS -lelf" + ]) + else + AC_MSG_ERROR([libelf/gelf API requested but not found or not usable]) + fi + else + AC_MSG_RESULT(no) + fi +], [ + AC_MSG_RESULT(no) +]) +AC_SUBST(WITH_LIBELF_DEBUGEDIT) + +dnl # optional Perl language bindings +WITH_PERL_SUBDIR="" +WITH_PERL_SUBPACKAGE=0 +WITH_PERL_LIBS="" +if test ".$WITH_PTHREADS" = .yes; then + WITH_PERL_LIBS="$LIBS" +fi +AC_ARG_WITH(perl, AS_HELP_STRING([--with-perl], [build with RPM Perl language bindings]), [ + if test ".$withval" != .no; then + PERL_INSTALLDIRS="" + if test "$withval" == "vendor"; then + PERL_INSTALLDIRS="'INSTALLDIRS' => 'vendor'," + fi + if test "$withval" == "site"; then + PERL_INSTALLDIRS="'INSTALLDIRS' => 'site'," + fi + AC_DEFINE_UNQUOTED([PERL_INSTALLDIRS], [$PERL_INSTALLDIRS], [Perl install directory (vendor/site)]) + AC_SUBST(PERL_INSTALLDIRS) + WITH_PERL_SUBDIR=perl + WITH_PERL_SUBPACKAGE=1 + AC_CONFIG_FILES([perl/Makefile.PL]) + AC_CONFIG_FILES([perl/Makefile]) + fi +]) +AC_SUBST(WITH_PERL_SUBDIR) +AC_SUBST(WITH_PERL_SUBPACKAGE) +AC_SUBST(WITH_PERL_LIBS) + +dnl # optional Perl-URPM language bindings +WITH_PERL_URPM_SUBDIR="" +WITH_PERL_URPM_SUBPACKAGE=0 +WITH_PERL_URPM_LIBS="" +if test ".$WITH_PTHREADS" = .yes; then + WITH_PERL_URPM_LIBS="$LIBS" +fi +AC_ARG_WITH(perl-urpm, AS_HELP_STRING([--with-perl-urpm], [build with Perl URPM language bindings]), [ + if test ".$withval" != .no; then + PERL_URPM_INSTALLDIRS="" + if test "$withval" == "vendor"; then + PERL_URPM_INSTALLDIRS="'INSTALLDIRS' => 'vendor'," + fi + if test "$withval" == "site"; then + PERL_URPM_INSTALLDIRS="'INSTALLDIRS' => 'site'," + fi + AC_DEFINE_UNQUOTED([PERL_URPM_INSTALLDIRS], [$PERL_URPM_INSTALLDIRS], [Perl install directory (vendor/site)]) + AC_SUBST(PERL_URPM_INSTALLDIRS) + WITH_PERL_URPM_SUBDIR=perl-URPM + WITH_PERL_URPM_SUBPACKAGE=1 + AC_CONFIG_FILES([perl-URPM/Makefile.PL]) + AC_CONFIG_FILES([perl-URPM/Makefile]) + fi +]) +AC_SUBST(WITH_PERL_URPM_SUBDIR) +AC_SUBST(WITH_PERL_URPM_SUBPACKAGE) +AC_SUBST(WITH_PERL_URPM_LIBS) + +dnl # optional Python language bindings +WITH_PYTHON_SUBDIR="" +WITH_PYTHON_SUBPACKAGE=0 +WITH_PYTHON_INCDIR="" + +PYTHON="" +PYTHON_VERSION="" +PYTHON_PREFIX="" +PYTHON_EXEC_PREFIX="" +#PYTHON_PLATFORM="" +pythondir="" +pkgpythondir="" +pyexecdir="" +pkgpyexecdir="" + +AC_ARG_WITH(python, AS_HELP_STRING([--with-python], [build with RPM Python language bindings]), [ + if test ".$withval" != .no; then + case "$withval" in + 2.x|2.3|2.4|2.5|2.6|2.7) + python_version=$withval + ;; + yes) + python_version="2.7 2.6 2.5 2.4 2.3 2.x" + ;; + *) + AC_MSG_WARN([--with-python only supports values "2.x", "2.3", "2.4", "2.5", "2.6" or "2.7" ignoring...]) + python_version="" + ;; + esac + for python_ver in $python_version ; do + if test "$python_ver" != "2.x" ; then + AC_MSG_CHECKING([for Python ${python_ver} API]) + save_CFLAGS="${CFLAGS}" + for i in "$prefix" "/usr/local" "/usr"; do + CFLAGS="${save_CFLAGS} -I$i/include/python${python_ver}" + AC_RUN_IFELSE([AC_LANG_SOURCE( + [[#include "Python.h" + main() { exit(strncmp("${python_ver}", PY_VERSION, 3)); } ]]) + ], [ + PYTHON_VERSION="${python_ver}" + AC_MSG_RESULT(yes) + PYTHON_PREFIX="${i}" + break + ], [ + ], [ + dnl if we're cross compiling, assume the user has a clue + if test "$withval" = "$python_ver"; then + PYTHON_VERSION="${python_ver}" + AC_MSG_RESULT(yes) + break + fi + ]) + done + CFLAGS="${save_CFLAGS}" + if test ".$PYTHON_VERSION" == "."; then + dnl check Mac OS X framework + save_CFLAGS="${CFLAGS}" + for f in "~" "" "/System" "/Network"; do + CFLAGS="${save_CFLAGS} -I$f/Library/Frameworks/Python.framework/Versions/${python_ver}/include/python${python_ver}" + AC_RUN_IFELSE([AC_LANG_SOURCE( + [[#include "Python.h" + main() { exit(strncmp("${python_ver}", PY_VERSION, 3)); } ]]) + ], [ + PYTHON_VERSION="${python_ver}" + AC_MSG_RESULT([yes (using Python.framework)]) + PYTHON_PREFIX="$f/Library/Frameworks/Python.framework/Versions/${python_ver}" + break + ], [ + ]) + done + CFLAGS="${save_CFLAGS}" + fi + if test ".$PYTHON_VERSION" == "."; then + AC_MSG_RESULT(no) + fi + else + AC_MSG_CHECKING([for Python 2.x API]) + AC_RUN_IFELSE([AC_LANG_SOURCE( + [[#include + main() { exit(strncmp("2.", PY_VERSION, 2)); } ]]) + ], [ + PYTHON_VERSION="" + AC_MSG_RESULT(yes) + ], [ + AC_MSG_RESULT(no) + ], [ + dnl if we're cross compiling, assume the user has a clue + if test "$withval" = "$python_ver"; then + PYTHON_VERSION="${python_ver}" + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + ]) + fi + if test ".$PYTHON_VERSION" != "."; then + WITH_PYTHON_SUBDIR=python + WITH_PYTHON_SUBPACKAGE=1 + break + fi + done + fi + AC_ARG_WITH(python-inc-dir, AS_HELP_STRING([--with-python-inc-dir=DIR], [directory with Python include files]), + [WITH_PYTHON_INCDIR="$withval"], [WITH_PYTHON_INCDIR="`(${__PYTHON} -c 'from distutils.sysconfig import get_python_inc; print get_python_inc()') 2>/dev/null`"]) + AC_ARG_WITH(python-lib-dir, AS_HELP_STRING([--with-python-lib-dir=DIR], [directory with Python library]), + [pythondir="$withval"], [pythondir="`(${__PYTHON} -c 'from distutils.sysconfig import get_python_lib; print get_python_lib(1)') 2>/dev/null`"]) +]) +AC_SUBST(WITH_PYTHON_SUBDIR) +AC_SUBST(WITH_PYTHON_SUBPACKAGE) +AC_SUBST(WITH_PYTHON_INCDIR) + +if test ".$pythondir" != "."; then + PYTHON="${__PYTHON}" + PYTHON_PREFIX="\${prefix}" + PYTHON_EXEC_PREFIX="\${exec_prefix}" +# PYTHON_PLATFORM="???" + pkgpythondir="\${pythondir}/\${PACKAGE}" + pyexecdir="\${pythondir}" + pkgpyexecdir="\${pyexecdir}/\${PACKAGE}" +fi + +AC_SUBST(PYTHON) +AC_SUBST(PYTHON_VERSION) +AC_SUBST(PYTHON_PREFIX) +AC_SUBST(PYTHON_EXEC_PREFIX) +#AC_SUBST(PYTHON_PLATFORM) +AC_SUBST(pythondir) +AC_SUBST(pkgpythondir) +AC_SUBST(pyexecdir) +AC_SUBST(pkgpyexecdir) + +dnl ## +dnl ## ==== THIRD-PARTY LIBRARIES (2/2) ==== +dnl ## + +AC_MSG_HEADER([THIRD-PARTY LIBRARIES (2/2)]) + +dnl # POPT +RPM_CHECK_LIB( + [POPT], [popt], + [popt], [poptGetContext], [popt.h], + [yes,internal:external], [popt], + [], [AC_MSG_ERROR([mandatory POPT library not found])]) + +HAVE_RPM_COMPRESSION=no +dnl # ZLib +RPM_CHECK_LIB( + [ZLib], [zlib], + [z gz], [gzread], [zlib.h], + [yes,external:none], [zlib], + [ AC_CHECK_FUNC(gzseek) + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + AC_DEFINE(HAVE_ZLIB_H, 1, [Define to 1 if you have ]) + fi + HAVE_RPM_COMPRESSION=yes + ], []) + +dnl # GNU BZip2 +RPM_CHECK_LIB( + [GNU BZip2], [bzip2], + [bz2], [BZ2_bzread], [bzlib.h], + [yes,external:none], [], + [ + HAVE_RPM_COMPRESSION=yes + ], []) + +dnl # libLZMA +WITH_XZ_INTERNAL=false +RPM_CHECK_LIB( + [XZ libLZMA], [xz], + [lzma], [lzma_auto_decoder], [lzma.h], + [yes,external:internal:none], [xz:src/liblzma/api:src/liblzma], + [ if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + WITH_XZ_INTERNAL=true + AC_DEFINE(HAVE_LZMA_H, 1, [Define to 1 if you have ]) + fi + HAVE_RPM_COMPRESSION=yes + ], []) + +if test ".$HAVE_RPM_COMPRESSION" = .no; then + AC_MSG_ERROR([you have passed --without-{xz,bzip2,zlib} together but it isn't possible to build rpm without any form of compression library. At a minimum, i suggest adding --with-zlib if you want to actually build and install a *.rpm package]) +fi + +dnl # BeeCrypt +RPM_CHECK_LIB( + [BeeCrypt], [beecrypt], + [beecrypt], [mpfprintln], [beecrypt/api.h], + [yes,internal:external], [beecrypt:include], + [], [ AC_MSG_ERROR([mandatory BeeCrypt library not found]) ]) + if test ".$WITH_BEECRYPT" = .no; then + AC_MSG_ERROR([BEECRYPT is mandatory]) + fi + +dnl # GCrypt +RPM_CHECK_LIB( + [GCrypt], [gcrypt], + [gcrypt], [gcry_pk_verify], [gcrypt.h], + [no,external:none], [], + [ AC_DEFINE(WITH_GCRYPT, 1, [Define if building with GCrypt]) + ], []) + +dnl # Mozilla NSS +RPM_CHECK_LIB( + [Mozilla NSS], [nss], + [nss3 nss], [NSS_NoDB_Init], [nss.h], + [no,external:none], [], + [ AC_DEFINE(WITH_NSS, 1, [Define if building with Mozilla NSS]) + ], []) + +dnl # OpenSSL +RPM_CHECK_LIB( + [OpenSSL], [openssl], + [crypto], [ERR_load_CRYPTO_strings], [openssl/crypto.h], + [no,external:none], [], + [ AC_DEFINE(WITH_SSL, 1, [Define if building with OpenSSL]) + AC_CHECK_LIB([openssl], [RSA_generate_key_ex], [ + AC_DEFINE(HAVE_RSA_GENERATE_KEY_EX, 1, [Define to 1 if you have the RSA_generate_key_ex() function.]) + ]) + AC_CHECK_LIB([openssl], [DSA_generate_parameters_ex], [ + AC_DEFINE(HAVE_DSA_GENERATE_PARAMETERS_EX, 1, [Define to 1 if you have the DSA_generate_parameters_ex() function.]) + ]) + ], []) + +dnl # TomCrypt +dnl XXX FIXME: add libtomcrypt.pc +RPM_CHECK_LIB( + [TomCrypt], [tomcrypt], + [tomcrypt], [ltc_init_multi], [tomcrypt/tomcrypt_cfg.h], + [no,external:none], [], + [ AC_DEFINE(WITH_TOMCRYPT, 1, [Define if building with LibTomCrypt]) + CPPFLAGS="$CPPFLAGS -DLTM_DESC -I${includedir}/tomcrypt -I${includedir}/tommath" + LIBS="$LIBS -ltommath" + ], []) + +dnl # IBM TPM 1.2 software emulation +RPM_CHECK_LIB( + [IBM TPM], [tpm], + [tpm], [TPM_Init], [tpm.h], + [no,external:none], [], + [ AC_DEFINE(WITH_TPM, 1, [Define if building with IBM TPM 1.2 emulator]) + AM_CONDITIONAL([WITH_TPM], [true]) + ],[ + AM_CONDITIONAL([WITH_TPM], [false]) + ]) + + +dnl # select default Cryptography implementation to use (default for CLI option --usecrypto) +AC_ARG_WITH([usecrypto], + AS_HELP_STRING( + [--with-usecrypto=ID], + [use particular default for --usecrypto option ("beecrypt", "cdsa", "gcrypt", "nss", "openssl", "tomcrypt" )] + ), [ + case "`echo $withval | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`" in + beecrypt | bc ) AC_DEFINE(USE_CRYPTO_BEECRYPT, 1, [Define to 1 for using BeeCrypt as default cryptography library]) ;; + cdsa ) AC_DEFINE(USE_CRYPTO_CDSA, 1, [Define to 1 for using Apple CDSA as default cryptography library]) ;; + gcrypt | gc ) AC_DEFINE(USE_CRYPTO_GCRYPT, 1, [Define to 1 for using GCrypt as default cryptography library]) ;; + nss ) AC_DEFINE(USE_CRYPTO_NSS, 1, [Define to 1 for using Mozilla NSS as default cryptography library]) ;; + openssl | ssl ) AC_DEFINE(USE_CRYPTO_OPENSSL, 1, [Define to 1 for using OpenSSL as default cryptography library]) ;; + tomcrypt | tc ) AC_DEFINE(USE_CRYPTO_TOMCRYPT, 1, [Define to 1 for using TomCrypt as default cryptography library]) ;; + * ) AC_MSG_ERROR([invalid cryptography library identifier specified for --with-usecrypto option]) ;; + esac +]) + +dnl # Libselinux +RPM_CHECK_LIB( + [Libselinux], [selinux], + [selinux], [is_selinux_enabled], [selinux/selinux.h], + [no,external:none], [], + [ AC_DEFINE(WITH_SELINUX, 1, [Define if building with Libselinux]) + ], []) + +dnl # Libsepol +RPM_CHECK_LIB( + [Libsepol], [sepol], + [sepol], [sepol_policydb_create], [sepol/sepol.h], + [no,external:none], [], + [ AC_DEFINE(WITH_SEPOL, 1, [Define if building with Libsepol]) + ], []) + +dnl # Libsemanage +WITH_SEMANAGE_SEMODULE="" +RPM_CHECK_LIB( + [Libsemanage], [semanage], + [semanage], [semanage_handle_create], [semanage/semanage.h], + [no,external:none], [], + [ AC_DEFINE(WITH_SEMANAGE, 1, [Define if building with Libsemanage]) + WITH_SEMANAGE_SEMODULE="semodule spooktool" + ], []) +AC_SUBST(WITH_SEMANAGE_SEMODULE) + +# Expat +RPM_CHECK_LIB( + [Expat], [expat], + [expat], [XML_SetXmlDeclHandler], [expat.h], + [no,external:none], [], + [ AC_DEFINE(WITH_EXPAT, 1, [Define if building with Expat]) + ], []) + +# Libtasn1 +RPM_CHECK_LIB( + [Libtasn1], [libtasn1], + [tasn1], [asn1_array2tree], [libtasn1.h], + [no,external:none], [], + [ AC_DEFINE(WITH_LIBTASN1, 1, [Define if building with Libtasn1]) + ], []) + +# Pakchois +RPM_CHECK_LIB( + [Pakchois], [pakchois], + [pakchois], [pakchois_module_load], [pakchois/pakchois.h], + [no,external:none], [], + [ AC_DEFINE(WITH_PAKCHOIS, 1, [Define if building with Pakchois]) + ], []) + +# GnuTLS +RPM_CHECK_LIB( + [GnuTLS], [gnutls], + [gnutls], [gnutls_global_init], [gnutls/gnutls.h], + [no,external:none], [], + [ AC_DEFINE(WITH_GNUTLS, 1, [Define if building with GnuTLS]) + ], []) + +dnl # Neon +RPM_CHECK_LIB( + [Neon], [neon], + [neon], [ne_session_create], [ne_session.h], + [no,internal:external:none], [neon:src:src], + [ if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + AC_DEFINE(HAVE_NEON_NE_GET_RESPONSE_HEADER, 1, + [Define to 1 if you have ne_get_response_header() in libneon.]) + else + AC_CHECK_LIB(neon, ne_get_response_header, [ + AC_DEFINE(HAVE_NEON_NE_GET_RESPONSE_HEADER, 1, + [Define to 1 if you have ne_get_response_header() in libneon.]) ]) + fi + ], [ AC_MSG_WARN([No Neon library found, using unsupported configuration]) ]) + +# Libgit2 +RPM_CHECK_LIB( + [Libgit2], [libgit2], + [git2], [git_repository_open], [git2.h], + [no,internal:external:none], [libgit2:include], + [ AC_DEFINE(WITH_LIBGIT2, 1, [Define if building with Libgit2]) + AM_CONDITIONAL([WITH_LIBGIT2], [true]) + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + AC_DEFINE(HAVE_GIT2_H, 1, [Define to 1 if you have ]) + fi + ],[ + AM_CONDITIONAL([WITH_LIBGIT2], [false]) + ]) + +# APR +RPM_CHECK_LIB( + [Apr], [apr], + [apr-1], [apr_initialize], [apr-1/apr.h], + [no,external:none], [], + [ AC_DEFINE(WITH_APR, 1, [Define if building with Apr]) + CPPFLAGS="$CPPFLAGS -I$prefix/include/apr-1" + ], []) + +# Subversion +RPM_CHECK_LIB( + [Subversion], [subversion], + [svn_client-1], [svn_client_create_context], [subversion-1/svn_client.h], + [no,external:none], [], + [ AC_DEFINE(WITH_SUBVERSION, 1, [Define if building with Subversion]) + CPPFLAGS="$CPPFLAGS -I$prefix/include/subversion-1" + ], []) + +dnl # File (magic) +WITH_FILE_INTERNAL=false +RPM_CHECK_LIB( + [File (magic)], [file], + [magic], [magic_open], [magic.h], + [yes,internal:external:none], [file:src:src], + [ AM_CONDITIONAL(WITH_FILE_INTERNAL, [ test ".$RPM_CHECK_LIB_LOCATION" = .internal ]) + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + WITH_FILE_INTERNAL=true + AC_DEFINE(HAVE_MAGIC_H, 1, [Define to 1 if you have ]) + fi + ], + [ AM_CONDITIONAL(WITH_FILE_INTERNAL, [ false ]) + ]) + +# UnixODBC +RPM_CHECK_LIB( + [UnixODBC], [unixodbc], + [odbc], [SQLAllocHandle], [sqlext.h], + [no,external:none], [], + [ AC_DEFINE(WITH_UNIXODBC, 1, [Define if building with UnixODBC]) + AM_CONDITIONAL([WITH_UNIXODBC], [true]) + ], + [ AM_CONDITIONAL([WITH_UNIXODBC], [false]) + ]) + +dnl # Berkeley-DB & SQLite +DBLIBSRCS="" +# XXX won't handle --includedir override +CPPFLAGS="${CPPFLAGS} -I${prefix}/include/${DBXY}" +RPM_CHECK_LIB( + [Berkeley-DB], [db], + [db-5.3], [db_create], [db.h], + [yes,external], [db3], + [ DBLIBSRCS="$DBLIBSRCS db3.c" + AM_CONDITIONAL(WITH_DB, [ true ]) + AM_CONDITIONAL(WITH_DB_INTERNAL, [ test ".$RPM_CHECK_LIB_LOCATION" = .internal ]) + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + AC_DEFINE(HAVE_DB_H, 1, [Have header]) + else + WITH_DB_SUBDIR="" + fi + ], + [ AM_CONDITIONAL(WITH_DB, [ false ]) + AM_CONDITIONAL(WITH_DB_INTERNAL, [ false ]) + ]) + +dnl # Sqlite external +RPM_CHECK_LIB( + [SQLite], [sqlite], + [sqlite3], [sqlite3_open], [sqlite3.h], + [no,external:none], [sqlite], + [ DBLIBSRCS="$DBLIBSRCS sqlite.c" ], + []) + +dnl # Sqlite 3.7.0.1 from db-5.1.19 +dnl XXX error: `db3' is already registered with AC_CONFIG_SUBDIRS. +RPM_CHECK_LIB( + [Berkeley-DB (+SQLite3)], [dbsql], + [db_sql-5.3], [sqlite3_open], [dbsql.h], + [yes,external], [db3/sql], + [ + AM_CONDITIONAL(WITH_DBSQL, [ true ]) + AC_DEFINE(WITH_SQLITE, 1, [Define as 1 if building with SQLite library]) + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + WITH_DB_CPPFLAGS="${WITH_DB_CPPFLAGS} -I\$(top_srcdir)/db/sql/generated" + WITH_DB_LIBS="${WITH_DBSQL_LIBS}" + DBLIBSRCS="$DBLIBSRCS sqlite.c" + else + WITH_DBSQL_SUBDIR="" + fi + ], [ + AM_CONDITIONAL(WITH_DBSQL, [ false ]) + ]) + +DBLIBOBJS=`echo $DBLIBSRCS | sed -e "s/\.c/\.lo/g"` + +AC_SUBST(DBLIBSRCS) +AC_SUBST(DBLIBOBJS) + +AC_ARG_WITH(db-largefile, AS_HELP_STRING([--with-db-largefile], [build Berkeley-DB with LARGEFILE support])) +AC_ARG_WITH(db-mutex, AS_HELP_STRING([--with-db-mutex=ARG], [build Berkeley-DB with MUTEX type ARG])) + +AC_ARG_WITH(db-rpc, AS_HELP_STRING([--with-db-rpc], [build Berkeley-DB with RPC support])) +AM_CONDITIONAL(WITH_DB_RPC, test ".$with_db_rpc" = .yes) + +AC_ARG_WITH(db-tools-integrated, AS_HELP_STRING([--with-db-tools-integrated], [install integrated Berkeley-DB tools])) +AM_CONDITIONAL(WITH_DB_TOOLS_INTEGRATED, test ".$with_db_tools_integrated" = .yes) + +dnl # determine whether the db sqlite3 tool/library should be built +dnl XXX hot-wire --with-dbsql; --with-dbsql=external will need RPM_CHECK_LIB +AM_CONDITIONAL(WITH_DBSQL_CODEGEN, true) + +dnl # determine default RPM DB API and configuration +DBAPI=3 +dnl case ".$DBLIBSRCS" in +dnl *db3.c* ) DBAPI=3 ;; +dnl *sqlite.c* ) DBAPI=4 ;; +dnl * ) AC_MSG_ERROR([either Berkeley-DB (--with-db) or SQLite (--with-sqlite) have to be used]) ;; +dnl esac +dnl AC_ARG_WITH([dbapi], +dnl AS_HELP_STRING([--with-dbapi=ID], [use particular default RPM DB API ("db", "sqlite" or numeric)]), [ +dnl case "$withval" in +dnl db|3 ) DBAPI=3 ;; +dnl sqlite|4 ) DBAPI=4 ;; +dnl [0-9] ) DBAPI=$withval ;; +dnl esac +dnl ]) +AC_SUBST(DBAPI) + +dnl # Readline (eventually needed by augtool) +RPM_CHECK_LIB( + [Readline], [readline], + [readline], [readline], [readline/readline.h], + [no,external:none], [], + [ AC_DEFINE(WITH_READLINE, 1, [Define to 1 if you want to use Readline]) + AC_CHECK_HEADERS([readline/history.h]) + AC_CHECK_FUNCS([rl_completion_matches]) + ], []) + +dnl # Augeas +WITH_AUGEAS_AUGTOOL="" +RPM_CHECK_LIB( + [Augeas], [augeas], + [augeas], [aug_init], [augeas.h], + [no,external:none], [], + [ WITH_AUGEAS_AUGTOOL="augtool" + ], []) +AC_SUBST(WITH_AUGEAS_AUGTOOL) + +dnl # CUDF +WITH_CUDF_CUDFTOOL="" +RPM_CHECK_LIB( + [Libcudf], [cudf], + [cudf], [cudf_parse_from_file], [cudf.h], + [no,external:none], [], + [ WITH_CUDF_CUDFTOOL="cudftool" + ], []) +AC_SUBST(WITH_CUDF_CUDFTOOL) + +dnl # Perl ExtUtils::Embed +RPM_CHECK_LIB( + [Perl ExtUtils::Embed], [perlembed], + [perl], [perl_alloc], [EXTERN.h], + [no,external:none], [], + [ + ], []) + +dnl # Python embedding +RPM_CHECK_LIB( + [Python embedding], [pythonembed], + [python2.7 python2.6 python2.5 python2.4], [Py_Initialize], [Python.h], + [no,external:none], [], + [ + ], []) + +dnl # Ruby +WITH_RUBY_SUBDIR="" +WITH_RUBY_CPPFLAGS="" +WITH_RUBY_VENDORARCHDIR="" +RPM_CHECK_LIB( + [Ruby], [ruby], + [ruby], [ruby_init], [ruby.h], + [no,external:none], [], + [ AC_DEFINE(WITH_RUBYEMBED, 1, [Define to 1 if you want embedded Ruby]) + WITH_RUBY_SUBDIR=ruby + ], []) +AC_SUBST(WITH_RUBY_CPPFLAGS) +AC_SUBST(WITH_RUBY_SUBDIR) +AC_SUBST(WITH_RUBY_VENDORARCHDIR) + + +dnl # Squirrel +RPM_CHECK_LIB( + [Squirrel], [squirrel], + [squirrel], [sq_open], [squirrel.h], + [no,external:none], [], + [ + ], []) + +dnl # Tcl (should tcl8.4 be supported too?) +WITH_TCL_SUBDIR="" +RPM_CHECK_LIB( + [Tcl], [tcl], + [tcl8.6 tcl8.5 tcl], [Tcl_CreateInterp], [tcl.h], + [no,external:none], [], + [ + ], []) +AC_SUBST(WITH_TCL_SUBDIR) + +dnl # FICL +RPM_CHECK_LIB( + [FICL], [ficl], + [ficl], [ficlSystemCreate], [ficl.h], + [no,internal:external:none], [ficl], + [ if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + AC_DEFINE(HAVE_FICL_H, 1, [Define to 1 if you have ]) + AC_DEFINE(HAVE_LIBFICL, 1, [Define to 1 if you have the 'ficl' library (-lficl).]) + fi + ], []) + +dnl # ATerm (needed by Nix) +RPM_CHECK_LIB( + [ATerm], [aterm], + [ATerm], [ATinit], [aterm1.h], + [no,external:none], [], + [ + ], []) +dnl # Nix +dnl # XXX the tests are mostly pointless, all bow to the AutoFu! +AC_LANG_PUSH(C++) +RPM_CHECK_LIB( + [Nix expressions], [nix], + [format], [_init], [globals.hh], + [no,external:none], [], + [ + ], []) +AC_LANG_POP(C++) + +dnl # JavaScript +WITH_JS_SUBDIR="" +WITH_SPIDERMONKEY_SUBDIR="" +RPM_CHECK_LIB( + [JavaScript], [mozjs185], + [mozjs185], [JS_NewContext], [jsapi.h], + [no,external:none], [mozjs185:src:src], + [ if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + WITH_SPIDERMONKEY_SUBDIR="$WITH_JS_SUBDIR/src" + AC_DEFINE(HAVE_LIBJS, 1, [Define to 1 if you have the 'mozjs185' library (-lmozjs185).]) + else + WITH_JS_SUBDIR=js + fi + ], []) +AC_SUBST(WITH_SPIDERMONKEY_SUBDIR) +AC_SUBST(WITH_JS_SUBDIR) + +dnl # GPSEE +dnl # XXX hotwire the GPSEE -> JS dependency implictly +RPM_CHECK_LIB( + [GPSEE], [gpsee], + [gpsee], [gpsee_createInterpreter], [gpsee.h], + [no,external:internal:none], [gpsee], + [ AC_DEFINE(WITH_GPSEE, 1, [Define to 1 if to use GPSEE as the embedded JS interpreter]) + CPPFLAGS="$CPPFLAGS -I${includedir}/js" + LIBS="$LIBS -lmozjs185" + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + AC_DEFINE(HAVE_GPSEE_H, 1, [Define to 1 if you have ]) + AC_DEFINE(HAVE_LIBGPSEE, 1, [Define to 1 if you have the 'gpsee' library (-ljs).]) + else + GPSEE_MODULES_PATH="$prefix/libexec/gpsee" + AC_SUBST(GPSEE_MODULES_PATH) + fi + ], []) + +dnl # Mongo +dnl # XXX mostly bogus tests, but sufficient to get WITH_MONGO defined +dnl RPM_CHECK_LIB( +dnl [Mongo DB], [mongo], +dnl [mongoclient], [md5_init], [targetver.h], +dnl [no,external:none], [mongo], +dnl [], []) + +dnl # Rc +RPM_CHECK_LIB( + [Rc], [rc], + [rc], [rc_main], [rc.h], + [no,internal:none], [rc], + [ if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + AC_DEFINE(HAVE_RC_H, 1, [Define to 1 if you have ]) + AC_DEFINE(HAVE_LIBRC, 1, [Define to 1 if you have the 'rc' library (-lrc).]) + fi + ], []) + +dnl # Bash +RPM_CHECK_LIB( + [Bash], [bash], + [bash], [bash_main], [bashtypes.h], + [no,internal:none], [bash], + [ if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + AC_DEFINE(HAVE_LIBBASH, 1, [Define to 1 if you have the 'bash' library (-lbash).]) + fi + ], []) + +dnl # Lua +WITH_LUA_SUBDIR_DEF="" +WITH_LUA_SUBDIR_LIB="" +USE_LUA_SHADOW=no +USE_LUA_CHKCONFIG=no +USE_LUA_CRYPTO=no +USE_LUA_SOCKET=no +RPM_CHECK_LIB( + [Lua], [lua], + [lua], [lua_newstate], [lua.h], + [no,internal:external:none], [lua:local], + [ if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + AC_CHECK_LIB(m, fabs) + AC_CHECK_LIB(dl, dlopen) + AC_CHECK_FUNC(dlopen, [ WITH_LUA_SUBDIR_DEF="$WITH_LUA_SUBDIR_DEF -DLUA_USE_DLOPEN" ]) + AC_CHECK_FUNC(regcomp, [ WITH_LUA_SUBDIR_DEF="$WITH_LUA_SUBDIR_DEF -DLUA_USE_POSIX" ]) + case "$host" in + *-*-linux* ) USE_LUA_SHADOW=yes; USE_LUA_CHKCONFIG=yes; ;; + esac + AC_DEFINE(WITH_LUA_INTERNAL, 1, [Define if building with internal Lua]) + AC_CONFIG_FILES([lua/Makefile]) + else + AC_CHECK_LIB(m, fabs) + AC_CHECK_LIB(dl, dlopen) + AC_CHECK_FUNC(dlopen) + fi + ], []) +AC_SUBST(WITH_LUA_SUBDIR_DEF) +AC_SUBST(WITH_LUA_SUBDIR_LIB) +AM_CONDITIONAL(USE_LUA_SHADOW, [ test ".$USE_LUA_SHADOW" = .yes ]) +AM_CONDITIONAL(USE_LUA_CHKCONFIG, [ test ".$USE_LUA_CHKCONFIG" = .yes ]) +AM_CONDITIONAL(USE_LUA_CRYPTO, [ test ".$USE_LUA_CRYPTO" = .yes ]) +AM_CONDITIONAL(USE_LUA_SOCKET, [ test ".$USE_LUA_SOCKET" = .yes ]) + +dnl # PCRE +dnl # use cases: +dnl # - RPM under WITH_PCRE uses +libpcre in addition to +dnl # - RPM under WITH_PCRE+WITH_PCRE_POSIX uses +libpcreposix instead of +dnl # - RPM/Lua under LUA_USE_PCRE uses +libpcre in addition to +dnl # - RPM/Lua under REX_POSIX_INCLUDE uses +libposixpcre instead of +dnl # attention: +dnl # - In the locally bundled PCRE all libpcre objects are embedded into libpcreposix +dnl # because of s/lib/noinst/ changes in pcre/Makefile.am. Here we have to link +dnl # against libpcreposix only! +WITH_PCRE_INTERNAL=false +RPM_CHECK_LIB( + [PCRE], [pcre], + [pcre], [pcre_compile], [pcre.h], + [yes,external:internal:none], [pcre], + [ if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + WITH_PCRE_INTERNAL=true + AC_DEFINE(HAVE_PCRE_H, 1, [Define to 1 if you have ]) + AC_DEFINE(HAVE_LIBPCRE, 1, [Define to 1 if you have the 'pcre' library (-lpcre).]) + AC_DEFINE(WITH_PCRE_POSIX, 1, [Define as 1 if PCRE's POSIX API is available]) + WITH_PCRE_LIBS="-lpcreposix" # override, not prepend! (see attention above) + if test ".$WITH_LUA" = .yes; then + WITH_LUA_SUBDIR_DEF="$WITH_LUA_SUBDIR_DEF -DREX_POSIX_INCLUDE=\"\"" + fi + AC_SUBST(WITH_PCRE_LIBS) + else + dnl # make sure PCRE POSIX API can be really _USED_ by RPM + LIBS_SAVED="$LIBS" + LIBS="-lpcreposix $LIBS" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([#include ], [(void)regcomp(0, 0, 0)]) + ], [ + AC_DEFINE(WITH_PCRE_POSIX, 1, [Define as 1 if PCRE's POSIX API is available]) + if test ".$WITH_LUA" = .yes; then + WITH_LUA_SUBDIR_DEF="$WITH_LUA_SUBDIR_DEF -DREX_POSIX_INCLUDE=\"\"" + fi + ], [ + LIBS="$LIBS_SAVED" + ]) + fi + dnl # enable PCRE native API support for embedded Lua + if test ".$WITH_LUA" = .yes; then + WITH_LUA_SUBDIR_DEF="$WITH_LUA_SUBDIR_DEF -DLUA_USE_PCRE" + fi + ], []) + dnl # check PCRE + if test ".$WITH_PCRE" = .no; then + AC_MSG_ERROR([PCRE is mandatory. If you don't have libpcre then --with-pcre=internal could be used]) + fi + +dnl # OSSP uuid +dnl XXX hack-o-round typedef __darwin_uuid_t uuid_t; in Mac OS X +case "$host" in + *-*-darwin* ) +mv confdefs.h confdefs.h-SAVE +grep -v 'define HAVE_UNISTD_H' confdefs.h-SAVE > confdefs.h +;; +esac +RPM_CHECK_LIB( + [OSSP uuid], [uuid], + [ossp-uuid uuid], [uuid_import], [uuid.h], + [no,external:none], [], + [ dnl # enable OSSP uuid native API support for embedded Lua + if test ".$WITH_LUA" = .yes; then + WITH_LUA_SUBDIR_DEF="$WITH_LUA_SUBDIR_DEF -DLUA_USE_UUID" + fi + ], []) +case "$host" in + *-*-darwin* ) +mv confdefs.h-SAVE confdefs.h;; +esac + +dnl # Syck +RPM_CHECK_LIB( + [Syck], [syck], + [syck], [syckparse], [syck.h], + [no,internal:external:none], [syck:lib:lib], + [ if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + AC_DEFINE(HAVE_SYCK_H, 1, [Have header]) + fi + ], []) + +dnl # FIXME: AutoFu tests for and -lacl are needed w/o --with-xar +RPM_CHECK_LIB( + [ATTR], [attr], + [attr], [attr_get], [sys/xattr.h], + [no,external:none], [], + [], []) +RPM_CHECK_LIB( + [ACL], [acl], + [acl], [acl_free], [sys/acl.h], + [no,external:none], [], + [], []) + +dnl # XAR +RPM_CHECK_LIB( + [XAR], [xar], + [xar], [xar_open], [xar.h], + [no,external:internal:none], [xar:include:lib], + [ AM_CONDITIONAL(WITH_XAR, [ true ]) + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then + AC_DEFINE(HAVE_XAR_H, 1, [Have header]) + AC_DEFINE(HAVE_XAR_GET_SIZE, 1, [Have xar_get_size()]) + AC_DEFINE(HAVE_SYS_ACL_H, 1, [Have header]) + else + AC_CHECK_LIB(xar, xar_get_size, [ + AC_DEFINE(HAVE_XAR_GET_SIZE, 1, + [Define to 1 if you have xar_get_size() in libxar.]) ]) + fi + ], + [ AM_CONDITIONAL(WITH_XAR, [ false ]) + ]) + +dnl # DMalloc +RPM_CHECK_LIB( + [DMalloc], [dmalloc], + [dmalloc], [dmalloc_malloc], [dmalloc.h], + [no,external:none], [], + [], []) + +dnl # Electric Fence +RPM_CHECK_LIB( + [Electric Fence], [efence], + [efence], [malloc], [stdlib.h], + [no,external:none], [], + [], []) + +dnl # Linux keyutils +WITH_KEYUTILS_RPMKEY="" +RPM_CHECK_LIB( + [Linux keyutils], [keyutils], + [keyutils], [keyctl_read], [keyutils.h], + [no,external:none], [], + [ WITH_KEYUTILS_RPMKEY="rpmkey" + ], []) +AC_SUBST(WITH_KEYUTILS_RPMKEY) + +# later.. +dnl # CPUInfo +RPM_CHECK_LIB( + [CPUInfo], [cpuinfo], + [cpuinfo], [cpuinfo_new], [cpuinfo.h], + [no,external:none], [], + [AC_MSG_WARN([CPUInfo support is under development])], []) + +dnl ## +dnl ## ==== INSTALLATION PARAMETERS ==== +dnl ## + +AC_MSG_HEADER([INSTALLATION PARAMETERS]) + +dnl # figure out what root's primary group is +AC_MSG_CHECKING([root's primary group]) +AC_RUN_IFELSE([AC_LANG_SOURCE([[#include +#include +#include +#include +int main() +{ + struct passwd *root = NULL; + struct group *roots_group = NULL; + FILE * tempfile = NULL; + root = getpwuid( (uid_t) 0 ); + if (root != NULL) { + roots_group = getgrgid(root->pw_gid); + if (roots_group != NULL) { + tempfile = fopen("conftest_rootg", "w"); + if (tempfile != NULL) { + fprintf(tempfile, "%s\n", roots_group->gr_name); + fclose(tempfile); + exit(0); + } + } + } + exit(1); +}]])],[ROOT_GROUP=`cat conftest_rootg`; rm -f conftest_rootg],[ROOT_GROUP="root"],[ROOT_GROUP="root" +]) +AC_MSG_RESULT([$ROOT_GROUP]) +AC_SUBST(ROOT_GROUP) + +dnl # provide platform-specific "find-provides" and "find-requires" script symlinks +target_os_gnu="%{nil}" +if echo "$target_os" | grep '.*-gnulibc1' > /dev/null ; then + target_os=`echo "${target_os}" | sed 's/-gnulibc1$//'` + target_os_gnu="-gnulibc1" +fi +if echo "$target_os" | grep '.*-gnu' > /dev/null ; then + target_os=`echo "${target_os}" | sed 's/-gnu$//'` + target_os_gnu="-gnu" +fi +changequote(<, >) +target_os_exact="${target_os}" +target_os_major=`echo "${target_os}" | sed 's/\..*$//'` +target_os_noversion=`echo "${target_os}" | sed 's/[0-9]*\..*$//'` +changequote([, ]) +rm -f ./find-provides +if test -f ${srcdir}/autodeps/${target_cpu}-${target_os_exact}.prov ; then + ln -s ${srcdir}/autodeps/${target_cpu}-${target_os_exact}.prov ./find-provides +elif test -f ${srcdir}/autodeps/${target_os_exact}.prov ; then + ln -s ${srcdir}/autodeps/${target_os_exact}.prov ./find-provides +elif test -f ${srcdir}/autodeps/${target_os_major}.prov ; then + ln -s ${srcdir}/autodeps/${target_os_major}.prov ./find-provides +elif test -f ${srcdir}/autodeps/${target_os_noversion}.prov ; then + ln -s ${srcdir}/autodeps/${target_os_noversion}.prov ./find-provides +else + ln -s ${srcdir}/autodeps/none ./find-provides +fi +rm -f ./find-requires +if test -f ${srcdir}/autodeps/${target_cpu}-${target_os_exact}.req ; then + ln -s ${srcdir}/autodeps/${target_cpu}-${target_os_exact}.req ./find-requires +elif test -f ${srcdir}/autodeps/${target_os_exact}.req ; then + ln -s ${srcdir}/autodeps/${target_os_exact}.req ./find-requires +elif test -f ${srcdir}/autodeps/${target_os_major}.req ; then + ln -s ${srcdir}/autodeps/${target_os_major}.req ./find-requires +elif test -f ${srcdir}/autodeps/${target_os_noversion}.req ; then + ln -s ${srcdir}/autodeps/${target_os_noversion}.req ./find-requires +else + ln -s ${srcdir}/autodeps/none ./find-requires +fi + +dnl # determine the canonical arch-vendor-os for the build machine +autorelocate_path='%{nil}' +autorelocate_dcolor='0' +RPMCANONCOLOR=3 +case "${target_cpu}" in +*86) RPMCANONARCH=i386 ;; +ia32e*) RPMCANONARCH=ia32e ;; +amd64*) RPMCANONARCH=amd64 ;; +x86_64*) RPMCANONARCH=x86_64 ;; +alpha*) RPMCANONARCH=alpha ;; +sparc64*) RPMCANONARCH=sparc64 ;; +sparc*) RPMCANONARCH=sparc ;; +ia64*) RPMCANONCOLOR=2; RPMCANONARCH=ia64; + autorelocate_path='/emul/%%{ARCH}-%%{OS}' + autorelocate_dcolor='1' ;; +s390x*) RPMCANONARCH=s390x ;; +s390*) RPMCANONARCH=s390 ;; +powerpc64*|ppc64*) RPMCANONARCH=ppc64 ;; +powerpc*|ppc*) RPMCANONARCH=ppc ;; +armv3l*) RPMCANONARCH=armv3l ;; +armv4l*) RPMCANONARCH=armv4l ;; +armv4b*) RPMCANONARCH=armv4b ;; +arm*) RPMCANONARCH="${target_cpu}" ;; +mipsel*) RPMCANONCOLOR=7; RPMCANONARCH=mipsel ;; +mips*) RPMCANONCOLOR=7; RPMCANONARCH=mips ;; +m68k*) RPMCANONARCH=m68k ;; +*) RPMCANONARCH=unknown ;; +esac +case "${target_os_noversion}" in +mint) RPMCANONARCH=m68kmint ;; +esac +RPMCANONVENDOR="$target_vendor" +case "${target_vendor}" in +unknown|pc|ibm|redhat|pld|mandriva|conectiva|lvr|yellowdog|caos|crux|ark|momonga|openmamba) + test -f /etc/SuSE-release && RPMCANONVENDOR=suse + test -f /etc/momonga-release && RPMCANONVENDOR=momonga + test -f /etc/owl-release -o -f /etc/owl-setup.conf -o -d /etc/mtree && RPMCANONVENDOR=openwall + test -f /etc/fedora-release && RPMCANONVENDOR=fedora + test -f /etc/redhat-release && RPMCANONVENDOR=redhat + test -f /etc/pld-release && RPMCANONVENDOR=pld + test -f /etc/mandriva-release && RPMCANONVENDOR=mandriva + test -f /etc/conectiva-release && RPMCANONVENDOR=conectiva + test -f /etc/lvr-release && RPMCANONVENDOR=lvr + test -f /etc/yellowdog-release && RPMCANONVENDOR=yellowdog + test -f /etc/caos-release && RPMCANONVENDOR=caos + test -f /usr/bin/crux && RPMCANONVENDOR=crux + test -f /etc/ark-release && RPMCANONVENDOR=ark + test -f /etc/openmamba-release && RPMCANONVENDOR=openmamba + ;; +esac +RPMCANONOS="$target_os_noversion" +RPMCANONGNU="$target_os_gnu" +AC_SUBST(RPMCANONCOLOR) +AC_SUBST(autorelocate_path) +AC_SUBST(autorelocate_dcolor) +AC_SUBST(RPMCANONARCH) +AC_SUBST(RPMCANONVENDOR) +AC_SUBST(RPMCANONOS) +AC_SUBST(RPMCANONGNU) + +dnl # RPM installation user/group and uid/gid +: ${RPMUSER=rpm} +: ${RPMUID=37} +: ${RPMGROUP=rpm} +: ${RPMGID=37} +export RPMUSER RPMUID RPMGROUP RPMGID +AC_SUBST(RPMUSER) +AC_SUBST(RPMUID) +AC_SUBST(RPMGROUP) +AC_SUBST(RPMGID) + +dnl # determine number of CPUs command +AC_MSG_CHECKING([how to determine NCPUS]) +NCPUS_COMMAND="echo 1" +case "$host" in + *-*-linux* ) NCPUS_COMMAND="/usr/bin/getconf _NPROCESSORS_ONLN" ;; + *-*-freebsd* ) NCPUS_COMMAND="/usr/bin/getconf NPROCESSORS_ONLN" ;; + *-*-solaris* ) NCPUS_COMMAND="psrinfo | egrep 'on-line' | wc -l | sed -e 's+^ *++'" ;; + *-*-darwin* ) NCPUS_COMMAND="/usr/sbin/sysctl -n hw.ncpu" ;; +esac +NCPUS_RESULT=`$NCPUS_COMMAND` +AC_MSG_RESULT([`$NCPUS_COMMAND` ($NCPUS_RESULT)]) +AC_SUBST(NCPUS_COMMAND) + +dnl # support for versioned installation paths +AC_ARG_WITH( + [path-versioned], + AS_HELP_STRING([--with-path-versioned],[install with versioned paths]), + [WITH_PATH_VERSIONED=$withval], + [WITH_PATH_VERSIONED=no]) +AM_CONDITIONAL( + [WITH_PATH_VERSIONED], + [ test ".$WITH_PATH_VERSIONED" = .yes ]) +if test ".$WITH_PATH_VERSIONED" = .yes; then + WITH_PATH_VERSIONED_SUFFIX="-${VERSION}" +else + WITH_PATH_VERSIONED_SUFFIX="" +fi +AC_SUBST([WITH_PATH_VERSIONED_SUFFIX]) +AC_SUBST([WITH_PATH_VERSIONED]) + +dnl # FIXME: hard-coded paths?! +if test "x$varprefix" = "x"; then + # For /usr and /usr/local, we want the 'var' directory to go + # in /var and /var/local respectively. For everything else, + # just put the 'var' directory in prefix/var. + case $prefix in + /usr | /usr/local ) varprefix=`echo $prefix | sed 's/usr/var/'` ;; + NONE ) varprefix=`echo $ac_default_prefix | sed 's/usr/var/'` ;; + * ) varprefix=$prefix/var ;; + esac +fi +AC_DEFINE_UNQUOTED( + [VARPREFIX], ["$varprefix"], + [Path to /var] +) +AC_SUBST(varprefix) +if test X"$prefix" = XNONE ; then + usrprefix="$ac_default_prefix" +else + usrprefix=$prefix +fi +AC_DEFINE_UNQUOTED( + [USRPREFIX], ["$usrprefix"], + [Path to /usr] +) +AC_SUBST(usrprefix) + +dnl # Object file suffix (normally "o"). +objext="$ac_cv_objext" +AC_SUBST(objext) + +dnl # Static library suffix (normally "a"). +libext="$acl_cv_libext" +AC_SUBST(libext) + +dnl # Shared library suffix (normally "so"). +shlibext="$acl_cv_shlibext" +AC_SUBST(shlibext) + +dnl # Executable file suffix (normally ""). +exeext="$ac_exeext" +AC_SUBST(exeext) + +dnl # determine RPM database directory path +AC_MSG_CHECKING([for RPM database directory]) +DBPATH=`echo "${varprefix}/lib/rpm"` +if test ".$WITH_PATH_VERSIONED" = .yes; then + DBPATH="${DBPATH}-${VERSION}" +fi +AC_ARG_WITH( + [path-database], + AS_HELP_STRING([--with-path-database=ARG], [build with RPM database directory path]), + [DBPATH="$withval"] +) +AC_DEFINE_UNQUOTED( + [DBPATH], ["$DBPATH"], + [Full path to RPM database directory] +) +AC_SUBST(DBPATH) +AC_MSG_RESULT([$DBPATH]) +DBPATH_MACRO=`echo "$DBPATH" | sed -e "s;^${varprefix}/;%{_var}/;" -e "s;^${usrprefix}/;%{_usr}/;"` +AC_SUBST(DBPATH_MACRO) + +dnl # determine RPM package sources directory path +AC_MSG_CHECKING([for RPM package sources directory]) +PKGSRCDIR=`echo "${usrprefix}/src/rpm"` +if test ".$WITH_PATH_VERSIONED" = .yes; then + PKGSRCDIR="${PKGSRCDIR}-${VERSION}" +fi +AC_ARG_WITH( + [path-sources], + AS_HELP_STRING([--with-path-sources=ARG], [build with RPM package sourcs directory path]), + [PKGSRCDIR="$withval"] +) +AC_DEFINE_UNQUOTED( + [PKGSRCDIR], ["$PKGSRCDIR"], + [Full path to RPM package sources directory] +) +AC_SUBST(PKGSRCDIR) +AC_MSG_RESULT([$PKGSRCDIR]) +PKGSRCDIR_MACRO=`echo "$PKGSRCDIR" | sed -e "s;^${varprefix}/;%{_var}/;" -e "s;^${usrprefix}/;%{_usr}/;"` +AC_SUBST(PKGSRCDIR_MACRO) + +dnl # determine RPM magic file path +AC_MSG_CHECKING([for RPM magic file]) +MAGIC_MACRO=`echo "${prefix}/share/file/magic"` +if $WITH_FILE_INTERNAL; then + MAGIC_MACRO="%{_rpmhome}/magic" +fi +AC_ARG_WITH( + [path-magic], + AS_HELP_STRING([--with-path-magic=ARG], [build with RPM magic file path (or macro)]), + [MAGIC_MACRO="$withval"] +) +AC_MSG_RESULT([$MAGIC_MACRO]) +AC_SUBST(MAGIC_MACRO) + +dnl # determine RPM buildroot directory path +AC_MSG_CHECKING([for RPM buildroot directory]) +BUILDROOTDIR_MACRO="%{_tmppath}" +AC_ARG_WITH( + [path-buildroot], + AS_HELP_STRING([--with-path-buildroot=ARG], [build with RPM buildroot path (or macro)]), + [BUILDROOTDIR_MACRO="$withval"] +) +AC_MSG_RESULT([$BUILDROOTDIR_MACRO]) +AC_SUBST(BUILDROOTDIR_MACRO) + +dnl # determine RPM locale directory path +AC_MSG_CHECKING([for RPM locale directory]) +LOCALEDIR=`echo "${usrprefix}/share/locale"` +if test ".$WITH_PATH_VERSIONED" = .yes; then + LOCALEDIR="$LOCALEDIR/rpm-$VERSION" +fi +AC_ARG_WITH( + [path-locale], + AS_HELP_STRING([--with-path-locale=ARG], [build with RPM locale directory path]), + [LOCALEDIR="$withval"] +) +AC_DEFINE_UNQUOTED( + [LOCALEDIR], ["$LOCALEDIR"], + [Full path to RPM locale directory] +) +AC_SUBST(LOCALEDIR) +AC_MSG_RESULT([$LOCALEDIR]) +localedir="$LOCALEDIR" # (pass-through to foreign generated po/Makefile, too) + +dnl # determine RPM system library directory path +AC_MSG_CHECKING([for RPM system library directory]) +USRLIBRPM=`echo "${usrprefix}/lib/rpm"` +if test ".$WITH_PATH_VERSIONED" = .yes; then + USRLIBRPM="${USRLIBRPM}-${VERSION}" +fi +AC_ARG_WITH( + [path-lib], + AS_HELP_STRING([--with-path-lib=ARG], [build with RPM system library directory path]), + [USRLIBRPM="$withval"], [ ac_configure_args="$ac_configure_args --with-path-lib=\"$USRLIBRPM\"" ] +) +AC_DEFINE_UNQUOTED( + [USRLIBRPM], ["$USRLIBRPM"], + [Full path to RPM system library directory] +) +AC_SUBST(USRLIBRPM) +AC_MSG_RESULT([$USRLIBRPM]) + +dnl # determine RPM global configuration directory path +AC_MSG_CHECKING([for RPM global configuration directory]) +SYSCONFIGDIR="/etc/rpm" +if test ".$WITH_PATH_VERSIONED" = .yes; then + SYSCONFIGDIR="$SYSCONFIGDIR/$VERSION" +fi +AC_ARG_WITH( + [path-cfg], + AS_HELP_STRING([--with-path-cfg=ARG], [build with RPM global configuration directory path]), + [SYSCONFIGDIR="$withval"] +) +AC_DEFINE_UNQUOTED( + [SYSCONFIGDIR], ["$SYSCONFIGDIR"], + [Full path to RPM global configuration directory] +) +AC_SUBST(SYSCONFIGDIR) +AC_MSG_RESULT([$SYSCONFIGDIR]) + +dnl # determine RPM macro files path +AC_MSG_CHECKING([for RPM macro files path]) +MACROFILES="${USRLIBRPM}/macros" +MACROFILES="${MACROFILES}:${USRLIBRPM}/%{_target}/macros" +MACROFILES="${MACROFILES}:${SYSCONFIGDIR}/macros.*" +MACROFILES="${MACROFILES}:${SYSCONFIGDIR}/macros" +MACROFILES="${MACROFILES}:${SYSCONFIGDIR}/%{_target}/macros" +AC_ARG_WITH( + [extra-path-macros], + AS_HELP_STRING([--with-extra-path-macros=ARG], [build with additional colon-separated RPM macro files path not overriding defaults]), + [MACROFILES="$MACROFILES:$withval"] +) +if test ".$WITH_PATH_VERSIONED" = .yes; then + MACROFILES="${MACROFILES}:~/.rpmmacros-${VERSION}" +else + MACROFILES="${MACROFILES}:~/.rpmmacros" +fi +AC_ARG_WITH( + [path-macros], + AS_HELP_STRING([--with-path-macros=ARG], [build with colon-separated RPM macro files path]), + [MACROFILES="$withval"] +) +AC_DEFINE_UNQUOTED( + [MACROFILES], ["$MACROFILES"], + [Colon separated RPM macro files path] +) +AC_SUBST(MACROFILES) +AC_MSG_RESULT([$MACROFILES]) + +dnl # determine POPT configuration files path +AC_MSG_CHECKING([for RPM POPT configuration files path]) +RPMPOPTFILES="${USRLIBRPM}/rpmpopt" +RPMPOPTFILES="${RPMPOPTFILES}:${USRLIBRPM}/%{_target}/rpmpopt" +RPMPOPTFILES="${RPMPOPTFILES}:${SYSCONFIGDIR}/rpmpopt.*" +RPMPOPTFILES="${RPMPOPTFILES}:${SYSCONFIGDIR}/rpmpopt" +RPMPOPTFILES="${RPMPOPTFILES}:${SYSCONFIGDIR}/%{_target}/rpmpopt" +if test ".$WITH_PATH_VERSIONED" = .yes; then + RPMPOPTFILES="${RPMPOPTFILES}:~/.rpmpopt-${VERSION}" +else + RPMPOPTFILES="${RPMPOPTFILES}:~/.rpmpopt" +fi +AC_ARG_WITH( + [path-rpmpopt], + AS_HELP_STRING([--with-path-rpmpopt=ARG], [build with colon-separated RPM POPT configuration file path]), + [RPMPOPTFILES="$withval"] +) +AC_DEFINE_UNQUOTED( + [RPMPOPTFILES], ["$RPMPOPTFILES"], + [Colon separated RPM POPT configuration files path] +) +AC_SUBST(RPMPOPTFILES) +AC_MSG_RESULT([$RPMPOPTFILES]) + +dnl # determine RPM Lua script files path +AC_MSG_CHECKING([for RPM Lua script files path]) +RPMLUAFILES="${USRLIBRPM}/init.lua:${USRLIBRPM}/rpmlua" +RPMLUAFILES="${RPMLUAFILES}:${USRLIBRPM}/%{_target}/rpmlua" +RPMLUAFILES="${RPMLUAFILES}:${SYSCONFIGDIR}/rpmlua.*" +RPMLUAFILES="${RPMLUAFILES}:${SYSCONFIGDIR}/rpmlua" +RPMLUAFILES="${RPMLUAFILES}:${SYSCONFIGDIR}/%{_target}/rpmlua" +if test ".$WITH_PATH_VERSIONED" = .yes; then + RPMLUAFILES="${RPMLUAFILES}:~/.rpmlua-${VERSION}" +else + RPMLUAFILES="${RPMLUAFILES}:~/.rpmlua" +fi +AC_ARG_WITH( + [path-rpmlua], + AS_HELP_STRING([--with-path-rpmlua=ARG], [build with colon-separated RPM Lua script file path]), + [RPMLUAFILES="$withval"] +) +AC_DEFINE_UNQUOTED( + [RPMLUAFILES], ["$RPMLUAFILES"], + [Colon separated RPM Lua script files path] +) +AC_SUBST(RPMLUAFILES) +AC_MSG_RESULT([$RPMLUAFILES]) + +DISTRO_MACROS="#" +dnl # determine whether to build using a specific vendor's changes or not +AC_MSG_CHECKING([if building for a specfic vendor]) +AC_ARG_WITH( + [vendor], + AS_HELP_STRING([--with-vendor=VENDOR], [build with a supported vendor's specific set of changes: mandriva, ark, fedora, openmamba]), + [if test ".$withval" != .no; then + case "$withval" in + "mandriva") + AC_DEFINE([RPM_VENDOR_MANDRIVA], 1, Vendor is Mandriva) + DISTRO_MACROS="" + ;; + "ark") + AC_DEFINE([RPM_VENDOR_ARK], 1, Vendor is Ark) + ;; + "fedora") + AC_DEFINE([RPM_VENDOR_FEDORA], 1, Vendor is Fedora) + ;; + "openmamba") + AC_DEFINE([RPM_VENDOR_OPENMAMBA], 1, Vendor is openmamba) + ;; + "suse") + AC_DEFINE([RPM_VENDOR_SUSE], 1, Vendor is suse) + ;; + esac + AC_MSG_RESULT([$withval]) + else + AC_MSG_RESULT(no) + fi] +) +AC_SUBST(DISTRO_MACROS) + +testdir="`pwd`/tests" +AC_SUBST(testdir) + +dnl ## +dnl ## ==== OUTPUT GENERATION ==== +dnl ## + +AC_MSG_HEADER([OUTPUT GENERATION]) + +dnl # explicit list of sub-directories to step into for additional "configure" scripts +dnl # (RPM_CHECK_LIB extends this implicitly, too) +AC_CONFIG_SUBDIRS() + +dnl # explicit list of files to generate +AC_CONFIG_FILES([ po/Makefile.in + Doxyfile Makefile rpmpopt rpm.spec + misc/Makefile + rpmio/Makefile rpmio/auto/Makefile rpmio/auto/desc rpmio/auto/types + rpmdb/Makefile rpmdb/auto/Makefile rpmdb/auto/desc rpmdb/auto/types + lib/Makefile lib/auto/Makefile lib/auto/desc lib/auto/types + build/Makefile build/auto/Makefile build/auto/desc build/auto/types + tools/Makefile + scripts/Makefile + rpmdb/DB_CONFIG + macros/macros macros/macros.rpmbuild + macros/cmake macros/gstreamer macros/java macros/kernel macros/libtool + macros/mandriva macros/suse macros/fedora macros/mono macros/perl macros/pkgconfig macros/php + macros/python macros/ruby macros/selinux macros/tcl + doc/Makefile + doc/manual/Makefile doc/fr/Makefile doc/ja/Makefile doc/ko/Makefile + doc/pl/Makefile doc/ru/Makefile doc/sk/Makefile + js/Makefile python/Makefile + ruby/Makefile scripts/rpm.pc lib/rpmversion.h rpmconstant/Makefile + tests/Makefile tests/macros tests/mongo/Makefile +]) + +dnl # final step: generate output +AC_OUTPUT + diff --git a/rpm-5.4.9/cpuinfo.yaml b/rpm-5.4.9/cpuinfo.yaml new file mode 100644 index 0000000..dcef6c1 --- /dev/null +++ b/rpm-5.4.9/cpuinfo.yaml @@ -0,0 +1,124 @@ +--- +cpuinfo: + - Family: cpuinfo([x86]) + Priority: + - x86_64 + - pentium4 + - pentium3 + - athlon + - pentium2 + - i686 + - geode + - i586 + - i486 + - i386 + - fat + + Arch: + - Name: fat + + - Name: i386 + + - Name: i486 + Extends: i386 + Features: + - cpuinfo(ac) + + - Name: i586 + Extends: i486 + Features: + - cpuinfo(tsc) + + - Name: geode + Alias: + - k6-3 + - k6-2 + Extends: i586 + Features: + - cpuinfo(3dnow) + - cpuinfo(mmx) + + - Name: i686 + Extends: i586 + Features: + - cpuinfo(cmov) + + - Name: pentium2 + Extends: i686 + Features: + - cpuinfo(mmx) + + - Name: athlon + Extends: pentium2 + Features: + - cpuinfo(3dnowext) + + - Name: pentium3 + Extends: pentium2 + Features: + - cpuinfo(sse) + + - Name: pentium4 + Extends: pentium3 + Features: + - cpuinfo(sse2) + + - Name: x86_64 + Alias: + - amd64 + - ia32e + Features: + - cpuinfo(64bit) + + - Family: cpuinfo([ppc]) + Priority: + - ppc64 + - ppc + - fat + + Arch: + - Name: fat + + - Name: ppc + + - Name: ppc64 + Extends: ppc + Features: + - cpuinfo(64bit) + + - Family: cpuinfo([ia64]) + Priority: + - ia64 + + Arch: + - Name: ia64 + + - Family: cpuinfo([mips]) + Priority: + - mips64 + - mips64el + - mips + - mipsel + + Arch: + - Name: mips + Alias: + - mipseb + Features: + - cpuinfo(endian) == big + + - Name: mips64 + Alias: + - mips64eb + Extends: mips + Features: + - cpuinfo(64bit) + + - Name: mipsel + Features: + - cpuinfo(endian) == little + + - Name: mips64el + Extends: mipsel + Features: + - cpuinfo(64bit) diff --git a/rpm-5.4.9/debug.h b/rpm-5.4.9/debug.h new file mode 100644 index 0000000..c1510aa --- /dev/null +++ b/rpm-5.4.9/debug.h @@ -0,0 +1,180 @@ +/** + * To be included after all other includes. + */ +#ifndef H_DEBUG +#define H_DEBUG + +#ifdef HAVE_ASSERT_H +#undef assert /* XXX tries to retrofit an assert(x) macro */ +#include +#endif + +#ifdef __LCLINT__ +#define ntohl(_x) (_x) +#define ntohs(_x) (_x) +#define htonl(_x) (_x) +#define htons(_x) (_x) +#endif + +#if defined(_OPENMP) +#include +#endif + +#ifdef WITH_DMALLOC +#include +#endif + +/* If using GCC, wrap __builtin_expect() (reduces overhead in lookup3.c) */ +#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__) +# define UNLIKELY(value) __builtin_expect((value), 0) +#else +# define UNLIKELY(value) (value) +#endif + +#if defined(WITH_VALGRIND) && defined(HAVE_VALGRIND_VALGRIND_H) + +#include +#include +#include +#include +#include + +#if !defined(ANNOTATE_BENIGN_RACE_SIZED) +#define ANNOTATE_BENIGN_RACE_SIZED(_a, _b, _c) +#endif + +static inline void * DRD_xmalloc(size_t nb) +{ + void * ptr = xmalloc(nb); +ANNOTATE_BENIGN_RACE_SIZED(ptr, nb, __FUNCTION__); /* XXX tsan sanity. */ + return ptr; +} + +static inline void * DRD_xcalloc(size_t nmemb, size_t size) +{ + size_t nb = nmemb * size; + void * ptr = DRD_xmalloc(nb); + memset(ptr, 0, nb); + return ptr; +} + +static inline void * DRD_xrealloc(void * ptr, size_t size) +{ + ptr = xrealloc(ptr, size); +ANNOTATE_BENIGN_RACE_SIZED(ptr, size, __FUNCTION__); /* XXX tsan sanity. */ + return ptr; +} + +static inline char * DRD_xstrdup(const char * s) +{ + size_t nb = strlen(s) + 1; + char * t = (char *) DRD_xmalloc(nb); + return strcpy(t, s); +} + +#else + +/* XXX list most everything just to see the valgrind namespace. */ + +#define RUNNING_ON_VALGRIND (0) +#define VALGRIND_DISCARD_TRANSLATIONS(_qzz_addr,_qzz_len) + +#define VALGRIND_MALLOCLIKE_BLOCK(addr, sizeB, rzB, is_zeroed) +#define VALGRIND_FREELIKE_BLOCK(addr, rzB) + +#define VALGRIND_CREATE_MEMPOOL(pool, rzB, is_zeroed) +#define VALGRIND_DESTROY_MEMPOOL(pool) +#define VALGRIND_MEMPOOL_ALLOC(pool, addr, size) +#define VALGRIND_MEMPOOL_FREE(pool, addr) +#define VALGRIND_MEMPOOL_TRIM(pool, addr, size) +#define VALGRIND_MOVE_MEMPOOL(poolA, poolB) +#define VALGRIND_MEMPOOL_CHANGE(pool, addrA, addrB, size) +#define VALGRIND_MEMPOOL_EXISTS(pool) (0) + +#define VALGRIND_MAKE_MEM_NOACCESS(_qzz_addr,_qzz_len) +#define VALGRIND_MAKE_MEM_UNDEFINED(_qzz_addr,_qzz_len) +#define VALGRIND_MAKE_MEM_DEFINED(_qzz_addr,_qzz_len) +#define VALGRIND_MAKE_MEM_DEFINED_IF_ADDRESSABLE(_qzz_addr,_qzz_len) +#define VALGRIND_CREATE_BLOCK(_qzz_addr,_qzz_len, _qzz_desc) +#define VALGRIND_DISCARD(_qzz_blkindex) +#define VALGRIND_CHECK_MEM_IS_ADDRESSABLE(_qzz_addr,_qzz_len) +#define VALGRIND_CHECK_MEM_IS_DEFINED(_qzz_addr,_qzz_len) +#define VALGRIND_CHECK_VALUE_IS_DEFINED(__lvalue) +#define VALGRIND_DO_LEAK_CHECK +#define VALGRIND_DO_QUICK_LEAK_CHECK +#define VALGRIND_COUNT_LEAKS(leaked, dubious, reachable, suppressed) +#define VALGRIND_COUNT_LEAK_BLOCKS(leaked, dubious, reachable, suppressed) +#define VALGRIND_GET_VBITS(zza,zzvbits,zznbytes) +#define VALGRIND_SET_VBITS(zza,zzvbits,zznbytes) + +#define CALLGRIND_DUMP_STATS +#define CALLGRIND_DUMP_STATS_AT(pos_str) +#define CALLGRIND_ZERO_STATS +#define CALLGRIND_TOGGLE_COLLECT +#define CALLGRIND_START_INSTRUMENTATION +#define CALLGRIND_STOP_INSTRUMENTATION + +#define VALGRIND_HG_MUTEX_INIT_POST(_mutex, _mbRec) +#define VALGRIND_HG_MUTEX_LOCK_PRE(_mutex, _isTryLock) +#define VALGRIND_HG_MUTEX_LOCK_POST(_mutex) +#define VALGRIND_HG_MUTEX_UNLOCK_PRE(_mutex) +#define VALGRIND_HG_MUTEX_UNLOCK_POST(_mutex) +#define VALGRIND_HG_MUTEX_DESTROY_PRE(_mutex) +#define VALGRIND_HG_SEM_INIT_POST(_sem, _value) +#define VALGRIND_HG_SEM_WAIT_POST(_sem) +#define VALGRIND_HG_SEM_POST_PRE(_sem) +#define VALGRIND_HG_SEM_DESTROY_PRE(_sem) +#define VALGRIND_HG_BARRIER_INIT_PRE(_bar, _count, _resizable) +#define VALGRIND_HG_BARRIER_WAIT_PRE(_bar) +#define VALGRIND_HG_BARRIER_RESIZE_PRE(_bar, _newcount) +#define VALGRIND_HG_BARRIER_DESTROY_PRE(_bar) +#define VALGRIND_HG_CLEAN_MEMORY(_qzz_start, _qzz_len) +#define VALGRIND_HG_CLEAN_MEMORY_HEAPBLOCK(_qzz_blockstart) +#define VALGRIND_HG_DISABLE_CHECKING(_qzz_start, _qzz_len) +#define VALGRIND_HG_ENABLE_CHECKING(_qzz_start, _qzz_len) + +#define DRD_GET_VALGRIND_THREADID +#define DRD_GET_DRD_THREADID +#define DRD_IGNORE_VAR(x) +#define DRD_STOP_IGNORING_VAR(x) +#define DRD_TRACE_VAR(x) + +#define ANNOTATE_HAPPENS_BEFORE(_obj) +#define ANNOTATE_HAPPENS_AFTER(_obj) + +#define ANNOTATE_RWLOCK_CREATE(rwlock) +#define ANNOTATE_RWLOCK_DESTROY(rwlock) +#define ANNOTATE_RWLOCK_ACQUIRED(rwlock, is_w) +#define ANNOTATE_READERLOCK_ACQUIRED(rwlock) +#define ANNOTATE_WRITERLOCK_ACQUIRED(rwlock) +#define ANNOTATE_RWLOCK_RELEASED(rwlock, is_w) +#define ANNOTATE_READERLOCK_RELEASED(rwlock) +#define ANNOTATE_WRITERLOCK_RELEASED(rwlock) + +#define ANNOTATE_BARRIER_INIT(barrier, count, reinitialization_allowed) +#define ANNOTATE_BARRIER_DESTROY(barrier) +#define ANNOTATE_BARRIER_WAIT_BEFORE(barrier) +#define ANNOTATE_BARRIER_WAIT_AFTER(barrier) + +#define ANNOTATE_BENIGN_RACE(_a, _b) +#define ANNOTATE_BENIGN_RACE_SIZED(_a, _b, _c) + +#define ANNOTATE_IGNORE_READS_BEGIN() +#define ANNOTATE_IGNORE_READS_END() +#define ANNOTATE_IGNORE_WRITES_BEGIN() +#define ANNOTATE_IGNORE_WRITES_END() +#define ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() +#define ANNOTATE_IGNORE_READS_AND_WRITES_END() + +#define ANNOTATE_NEW_MEMORY(_addr, _size) +#define ANNOTATE_TRACE_MEMORY(_addr) +#define ANNOTATE_THREAD_NAME(_name) + +#define DRD_xmalloc(_nb) xmalloc(_nb) +#define DRD_xcalloc(_nmemb, _size) xcalloc(_nmemb, _size) +#define DRD_xrealloc(_ptr, _size) xrealloc(_ptr, _size) +#define DRD_xstrdup(_str) xstrdup(_str) + +#endif + +#endif /* H_DEBUG */ diff --git a/rpm-5.4.9/depcomp b/rpm-5.4.9/depcomp new file mode 100755 index 0000000..25a39e6 --- /dev/null +++ b/rpm-5.4.9/depcomp @@ -0,0 +1,708 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2012-03-27.16; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, +# 2011, 2012 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 + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +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 informations. + 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 -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' "$nl" < "$tmpdepfile" | +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. 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. + 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 -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$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 + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +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. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependent.h'. + # Do two passes, one to just change these to + # '$object: dependent.h' and one to simply 'dependent.h:'. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. + # However on + # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\': + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + # tcc 0.9.26 (FIXME still under development at the moment of writing) + # will emit a similar output, but also prepend the continuation lines + # with horizontal tabulation characters. + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form 'foo.o: dependent.h', + # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. + # Do two passes, one to just change these to + # '$object: dependent.h' and one to simply 'dependent.h:'. + sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ + < "$tmpdepfile" > "$depfile" + sed ' + s/[ '"$tab"'][ '"$tab"']*/ /g + s/^ *// + s/ *\\*$// + s/^[^:]*: *// + /^$/d + /:$/d + s/$/ :/ + ' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +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" = 0; then : + else + 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" + 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" + tr ' ' "$nl" < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "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" + sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/rpm-5.4.9/doc/Makefile.am b/rpm-5.4.9/doc/Makefile.am new file mode 100644 index 0000000..fa76216 --- /dev/null +++ b/rpm-5.4.9/doc/Makefile.am @@ -0,0 +1,24 @@ +## Process this file with automake to produce Makefile.in + +SUBDIRS = manual +if USE_NLS +SUBDIRS += fr ja ko pl ru sk +endif + +man_MANS = gendiff.1 rpm.8 rpmbuild.8 rpmcache.8 rpmdeps.8 \ + rpm2cpio.8 rpmconstant.8 rpmmtree.8 # rpmgraph.8 + +EXTRA_DIST = $(man_MANS) + +install-data-hook: +if WITH_PATH_VERSIONED + -for p in $(man_MANS); do \ + case "$$p" in \ + *.1 ) mv $(DESTDIR)$(man1dir)/$${p} \ + `echo "$(DESTDIR)$(man1dir)/$${p}" | sed 's/\.1$$/-$(VERSION).1/'` ;; \ + *.8 ) mv $(DESTDIR)$(man8dir)/$${p} \ + `echo "$(DESTDIR)$(man1dir)/$${p}" | sed 's/\.8$$/-$(VERSION).8/'` ;; \ + esac; \ + done +endif + diff --git a/rpm-5.4.9/doc/Makefile.in b/rpm-5.4.9/doc/Makefile.in new file mode 100644 index 0000000..bdc2b16 --- /dev/null +++ b/rpm-5.4.9/doc/Makefile.in @@ -0,0 +1,1066 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +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@ +target_triplet = @target@ +@USE_NLS_TRUE@am__append_1 = fr ja ko pl ru sk +subdir = doc +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +man1dir = $(mandir)/man1 +am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" +man8dir = $(mandir)/man8 +NROFF = nroff +MANS = $(man_MANS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = manual fr ja ko pl ru sk +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDROOTDIR_MACRO = @BUILDROOTDIR_MACRO@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBAPI = @DBAPI@ +DBLIBOBJS = @DBLIBOBJS@ +DBLIBSRCS = @DBLIBSRCS@ +DBPATH = @DBPATH@ +DBPATH_MACRO = @DBPATH_MACRO@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTRO_MACROS = @DISTRO_MACROS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIXPERMS = @FIXPERMS@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GPSEE_MODULES_PATH = @GPSEE_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_STATIC = @LDFLAGS_STATIC@ +LD_VERSION_SCRIPT_FLAG = @LD_VERSION_SCRIPT_FLAG@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOLIZE = @LIBTOOLIZE@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MACROFILES = @MACROFILES@ +MAGIC_MACRO = @MAGIC_MACRO@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR = @MKDIR@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NCPUS_COMMAND = @NCPUS_COMMAND@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENMP_CFLAGS = @OPENMP_CFLAGS@ +OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_INSTALLDIRS = @PERL_INSTALLDIRS@ +PERL_URPM_INSTALLDIRS = @PERL_URPM_INSTALLDIRS@ +PKGSRCDIR = @PKGSRCDIR@ +PKGSRCDIR_MACRO = @PKGSRCDIR_MACRO@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +ROOT_GROUP = @ROOT_GROUP@ +RPMCANONARCH = @RPMCANONARCH@ +RPMCANONCOLOR = @RPMCANONCOLOR@ +RPMCANONGNU = @RPMCANONGNU@ +RPMCANONOS = @RPMCANONOS@ +RPMCANONVENDOR = @RPMCANONVENDOR@ +RPMGID = @RPMGID@ +RPMGROUP = @RPMGROUP@ +RPMLUAFILES = @RPMLUAFILES@ +RPMPOPTFILES = @RPMPOPTFILES@ +RPMUID = @RPMUID@ +RPMUSER = @RPMUSER@ +RPM_TIMESTAMP = @RPM_TIMESTAMP@ +RPM_VENDOR = @RPM_VENDOR@ +RPM_VERSION = @RPM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFIGDIR = @SYSCONFIGDIR@ +USE_NLS = @USE_NLS@ +USRLIBRPM = @USRLIBRPM@ +VERSION = @VERSION@ +WITH_ACL = @WITH_ACL@ +WITH_APIDOCS = @WITH_APIDOCS@ +WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ +WITH_APR = @WITH_APR@ +WITH_ATERM = @WITH_ATERM@ +WITH_ATTR = @WITH_ATTR@ +WITH_AUGEAS = @WITH_AUGEAS@ +WITH_AUGEAS_AUGTOOL = @WITH_AUGEAS_AUGTOOL@ +WITH_BASH = @WITH_BASH@ +WITH_BASH_CPPFLAGS = @WITH_BASH_CPPFLAGS@ +WITH_BASH_LDFLAGS = @WITH_BASH_LDFLAGS@ +WITH_BASH_LIBS = @WITH_BASH_LIBS@ +WITH_BASH_SUBDIR = @WITH_BASH_SUBDIR@ +WITH_BEECRYPT = @WITH_BEECRYPT@ +WITH_BEECRYPT_CPPFLAGS = @WITH_BEECRYPT_CPPFLAGS@ +WITH_BEECRYPT_LDFLAGS = @WITH_BEECRYPT_LDFLAGS@ +WITH_BEECRYPT_LIBS = @WITH_BEECRYPT_LIBS@ +WITH_BEECRYPT_SUBDIR = @WITH_BEECRYPT_SUBDIR@ +WITH_BZIP2 = @WITH_BZIP2@ +WITH_CPUINFO = @WITH_CPUINFO@ +WITH_CUDF = @WITH_CUDF@ +WITH_CUDF_CUDFTOOL = @WITH_CUDF_CUDFTOOL@ +WITH_DB = @WITH_DB@ +WITH_DBSQL = @WITH_DBSQL@ +WITH_DBSQL_CPPFLAGS = @WITH_DBSQL_CPPFLAGS@ +WITH_DBSQL_LDFLAGS = @WITH_DBSQL_LDFLAGS@ +WITH_DBSQL_LIBS = @WITH_DBSQL_LIBS@ +WITH_DBSQL_SUBDIR = @WITH_DBSQL_SUBDIR@ +WITH_DB_CPPFLAGS = @WITH_DB_CPPFLAGS@ +WITH_DB_LDFLAGS = @WITH_DB_LDFLAGS@ +WITH_DB_LIBS = @WITH_DB_LIBS@ +WITH_DB_SUBDIR = @WITH_DB_SUBDIR@ +WITH_DMALLOC = @WITH_DMALLOC@ +WITH_EFENCE = @WITH_EFENCE@ +WITH_EXPAT = @WITH_EXPAT@ +WITH_FICL = @WITH_FICL@ +WITH_FICL_CPPFLAGS = @WITH_FICL_CPPFLAGS@ +WITH_FICL_LDFLAGS = @WITH_FICL_LDFLAGS@ +WITH_FICL_LIBS = @WITH_FICL_LIBS@ +WITH_FICL_SUBDIR = @WITH_FICL_SUBDIR@ +WITH_FILE = @WITH_FILE@ +WITH_FILE_CPPFLAGS = @WITH_FILE_CPPFLAGS@ +WITH_FILE_LDFLAGS = @WITH_FILE_LDFLAGS@ +WITH_FILE_LIBS = @WITH_FILE_LIBS@ +WITH_FILE_SUBDIR = @WITH_FILE_SUBDIR@ +WITH_GCRYPT = @WITH_GCRYPT@ +WITH_GNUTLS = @WITH_GNUTLS@ +WITH_GPSEE = @WITH_GPSEE@ +WITH_GPSEE_CPPFLAGS = @WITH_GPSEE_CPPFLAGS@ +WITH_GPSEE_LDFLAGS = @WITH_GPSEE_LDFLAGS@ +WITH_GPSEE_LIBS = @WITH_GPSEE_LIBS@ +WITH_GPSEE_SUBDIR = @WITH_GPSEE_SUBDIR@ +WITH_JS_SUBDIR = @WITH_JS_SUBDIR@ +WITH_KEYUTILS = @WITH_KEYUTILS@ +WITH_KEYUTILS_RPMKEY = @WITH_KEYUTILS_RPMKEY@ +WITH_LIBELF_DEBUGEDIT = @WITH_LIBELF_DEBUGEDIT@ +WITH_LIBGIT2 = @WITH_LIBGIT2@ +WITH_LIBGIT2_CPPFLAGS = @WITH_LIBGIT2_CPPFLAGS@ +WITH_LIBGIT2_LDFLAGS = @WITH_LIBGIT2_LDFLAGS@ +WITH_LIBGIT2_LIBS = @WITH_LIBGIT2_LIBS@ +WITH_LIBGIT2_SUBDIR = @WITH_LIBGIT2_SUBDIR@ +WITH_LIBTASN1 = @WITH_LIBTASN1@ +WITH_LUA = @WITH_LUA@ +WITH_LUA_CPPFLAGS = @WITH_LUA_CPPFLAGS@ +WITH_LUA_LDFLAGS = @WITH_LUA_LDFLAGS@ +WITH_LUA_LIBS = @WITH_LUA_LIBS@ +WITH_LUA_SUBDIR = @WITH_LUA_SUBDIR@ +WITH_LUA_SUBDIR_DEF = @WITH_LUA_SUBDIR_DEF@ +WITH_LUA_SUBDIR_LIB = @WITH_LUA_SUBDIR_LIB@ +WITH_MOZJS185 = @WITH_MOZJS185@ +WITH_MOZJS185_CPPFLAGS = @WITH_MOZJS185_CPPFLAGS@ +WITH_MOZJS185_LDFLAGS = @WITH_MOZJS185_LDFLAGS@ +WITH_MOZJS185_LIBS = @WITH_MOZJS185_LIBS@ +WITH_MOZJS185_SUBDIR = @WITH_MOZJS185_SUBDIR@ +WITH_NEON = @WITH_NEON@ +WITH_NEON_CPPFLAGS = @WITH_NEON_CPPFLAGS@ +WITH_NEON_LDFLAGS = @WITH_NEON_LDFLAGS@ +WITH_NEON_LIBS = @WITH_NEON_LIBS@ +WITH_NEON_SUBDIR = @WITH_NEON_SUBDIR@ +WITH_NIX = @WITH_NIX@ +WITH_NSS = @WITH_NSS@ +WITH_OPENSSL = @WITH_OPENSSL@ +WITH_PAKCHOIS = @WITH_PAKCHOIS@ +WITH_PATH_VERSIONED = @WITH_PATH_VERSIONED@ +WITH_PATH_VERSIONED_SUFFIX = @WITH_PATH_VERSIONED_SUFFIX@ +WITH_PCRE = @WITH_PCRE@ +WITH_PCRE_CPPFLAGS = @WITH_PCRE_CPPFLAGS@ +WITH_PCRE_LDFLAGS = @WITH_PCRE_LDFLAGS@ +WITH_PCRE_LIBS = @WITH_PCRE_LIBS@ +WITH_PCRE_SUBDIR = @WITH_PCRE_SUBDIR@ +WITH_PERLEMBED = @WITH_PERLEMBED@ +WITH_PERL_LIBS = @WITH_PERL_LIBS@ +WITH_PERL_SUBDIR = @WITH_PERL_SUBDIR@ +WITH_PERL_SUBPACKAGE = @WITH_PERL_SUBPACKAGE@ +WITH_PERL_URPM_LIBS = @WITH_PERL_URPM_LIBS@ +WITH_PERL_URPM_SUBDIR = @WITH_PERL_URPM_SUBDIR@ +WITH_PERL_URPM_SUBPACKAGE = @WITH_PERL_URPM_SUBPACKAGE@ +WITH_POPT = @WITH_POPT@ +WITH_POPT_CPPFLAGS = @WITH_POPT_CPPFLAGS@ +WITH_POPT_LDFLAGS = @WITH_POPT_LDFLAGS@ +WITH_POPT_LIBS = @WITH_POPT_LIBS@ +WITH_POPT_SUBDIR = @WITH_POPT_SUBDIR@ +WITH_PYTHONEMBED = @WITH_PYTHONEMBED@ +WITH_PYTHON_INCDIR = @WITH_PYTHON_INCDIR@ +WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ +WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ +WITH_RC = @WITH_RC@ +WITH_RC_CPPFLAGS = @WITH_RC_CPPFLAGS@ +WITH_RC_LDFLAGS = @WITH_RC_LDFLAGS@ +WITH_RC_LIBS = @WITH_RC_LIBS@ +WITH_RC_SUBDIR = @WITH_RC_SUBDIR@ +WITH_READLINE = @WITH_READLINE@ +WITH_RUBY = @WITH_RUBY@ +WITH_RUBY_CPPFLAGS = @WITH_RUBY_CPPFLAGS@ +WITH_RUBY_SUBDIR = @WITH_RUBY_SUBDIR@ +WITH_RUBY_VENDORARCHDIR = @WITH_RUBY_VENDORARCHDIR@ +WITH_SELINUX = @WITH_SELINUX@ +WITH_SEMANAGE = @WITH_SEMANAGE@ +WITH_SEMANAGE_SEMODULE = @WITH_SEMANAGE_SEMODULE@ +WITH_SEPOL = @WITH_SEPOL@ +WITH_SPIDERMONKEY_SUBDIR = @WITH_SPIDERMONKEY_SUBDIR@ +WITH_SQLITE = @WITH_SQLITE@ +WITH_SQLITE_CPPFLAGS = @WITH_SQLITE_CPPFLAGS@ +WITH_SQLITE_LDFLAGS = @WITH_SQLITE_LDFLAGS@ +WITH_SQLITE_LIBS = @WITH_SQLITE_LIBS@ +WITH_SQLITE_SUBDIR = @WITH_SQLITE_SUBDIR@ +WITH_SQUIRREL = @WITH_SQUIRREL@ +WITH_SUBVERSION = @WITH_SUBVERSION@ +WITH_SYCK = @WITH_SYCK@ +WITH_SYCK_CPPFLAGS = @WITH_SYCK_CPPFLAGS@ +WITH_SYCK_LDFLAGS = @WITH_SYCK_LDFLAGS@ +WITH_SYCK_LIBS = @WITH_SYCK_LIBS@ +WITH_SYCK_SUBDIR = @WITH_SYCK_SUBDIR@ +WITH_TCL = @WITH_TCL@ +WITH_TCL_SUBDIR = @WITH_TCL_SUBDIR@ +WITH_TOMCRYPT = @WITH_TOMCRYPT@ +WITH_TPM = @WITH_TPM@ +WITH_UNIXODBC = @WITH_UNIXODBC@ +WITH_UUID = @WITH_UUID@ +WITH_XAR = @WITH_XAR@ +WITH_XAR_CPPFLAGS = @WITH_XAR_CPPFLAGS@ +WITH_XAR_LDFLAGS = @WITH_XAR_LDFLAGS@ +WITH_XAR_LIBS = @WITH_XAR_LIBS@ +WITH_XAR_SUBDIR = @WITH_XAR_SUBDIR@ +WITH_XZ = @WITH_XZ@ +WITH_XZ_CPPFLAGS = @WITH_XZ_CPPFLAGS@ +WITH_XZ_LDFLAGS = @WITH_XZ_LDFLAGS@ +WITH_XZ_LIBS = @WITH_XZ_LIBS@ +WITH_XZ_SUBDIR = @WITH_XZ_SUBDIR@ +WITH_ZLIB = @WITH_ZLIB@ +WITH_ZLIB_CPPFLAGS = @WITH_ZLIB_CPPFLAGS@ +WITH_ZLIB_LDFLAGS = @WITH_ZLIB_LDFLAGS@ +WITH_ZLIB_LIBS = @WITH_ZLIB_LIBS@ +WITH_ZLIB_SUBDIR = @WITH_ZLIB_SUBDIR@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__BASH = @__BASH@ +__BZIP2 = @__BZIP2@ +__CAT = @__CAT@ +__CHATTR = @__CHATTR@ +__CHGRP = @__CHGRP@ +__CHGRP_RHF = @__CHGRP_RHF@ +__CHMOD = @__CHMOD@ +__CHOWN = @__CHOWN@ +__CHOWN_RHF = @__CHOWN_RHF@ +__CMAKE = @__CMAKE@ +__CPIO = @__CPIO@ +__CURL = @__CURL@ +__CVS = @__CVS@ +__DBSQL = @__DBSQL@ +__DB_ARCHIVE = @__DB_ARCHIVE@ +__DB_CHECKPOINT = @__DB_CHECKPOINT@ +__DB_DEADLOCK = @__DB_DEADLOCK@ +__DB_DUMP = @__DB_DUMP@ +__DB_HOTBACKUP = @__DB_HOTBACKUP@ +__DB_LOAD = @__DB_LOAD@ +__DB_LOG_VERIFY = @__DB_LOG_VERIFY@ +__DB_PRINTLOG = @__DB_PRINTLOG@ +__DB_RECOVER = @__DB_RECOVER@ +__DB_REPLICATE = @__DB_REPLICATE@ +__DB_SQL_CODEGEN = @__DB_SQL_CODEGEN@ +__DB_STAT = @__DB_STAT@ +__DB_TUNER = @__DB_TUNER@ +__DB_UPGRADE = @__DB_UPGRADE@ +__DB_VERIFY = @__DB_VERIFY@ +__DIFF = @__DIFF@ +__DITTO = @__DITTO@ +__DOXYGEN = @__DOXYGEN@ +__FILE = @__FILE@ +__GIT = @__GIT@ +__GPG = @__GPG@ +__GSR = @__GSR@ +__GST_INSPECT = @__GST_INSPECT@ +__GZIP = @__GZIP@ +__HG = @__HG@ +__ID = @__ID@ +__ID_U = @__ID_U@ +__INSTALL = @__INSTALL@ +__INSTALL_INFO = @__INSTALL_INFO@ +__LD = @__LD@ +__LDCONFIG = @__LDCONFIG@ +__LN = @__LN@ +__LRZIP = @__LRZIP@ +__LSATTR = @__LSATTR@ +__LZIP = @__LZIP@ +__LZMA = @__LZMA@ +__LZOP = @__LZOP@ +__MAKE = @__MAKE@ +__MKDIR = @__MKDIR@ +__MKDIR_P = @__MKDIR_P@ +__MODINFO = @__MODINFO@ +__MONGO = @__MONGO@ +__MV = @__MV@ +__NM = @__NM@ +__OBJCOPY = @__OBJCOPY@ +__OBJDUMP = @__OBJDUMP@ +__PATCH = @__PATCH@ +__PAX = @__PAX@ +__PERL = @__PERL@ +__PGP = @__PGP@ +__PHP = @__PHP@ +__PYTHON = @__PYTHON@ +__RM = @__RM@ +__RMDIR = @__RMDIR@ +__RSH = @__RSH@ +__RUBY = @__RUBY@ +__SED = @__SED@ +__SH = @__SH@ +__SQLITE3 = @__SQLITE3@ +__SSH = @__SSH@ +__STRIP = @__STRIP@ +__SVN = @__SVN@ +__TAR = @__TAR@ +__TCLSH = @__TCLSH@ +__UNZIP = @__UNZIP@ +__XZ = @__XZ@ +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_CXX = @ac_ct_CXX@ +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@ +autorelocate_dcolor = @autorelocate_dcolor@ +autorelocate_path = @autorelocate_path@ +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@ +exeext = @exeext@ +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@ +libext = @libext@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +objext = @objext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +shlibext = @shlibext@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +testdir = @testdir@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrprefix = @usrprefix@ +varprefix = @varprefix@ +SUBDIRS = manual $(am__append_1) +man_MANS = gendiff.1 rpm.8 rpmbuild.8 rpmcache.8 rpmdeps.8 \ + rpm2cpio.8 rpmconstant.8 rpmmtree.8 # rpmgraph.8 + +EXTRA_DIST = $(man_MANS) +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 doc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign doc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man1: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(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='$(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-man8: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(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='$(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) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(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" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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 +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically \`make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(MANS) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-man + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: install-man1 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 Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-man + +uninstall-man: uninstall-man1 uninstall-man8 + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-data-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive 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-data-hook install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-man1 \ + install-man8 install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-man uninstall-man1 \ + uninstall-man8 + + +install-data-hook: +@WITH_PATH_VERSIONED_TRUE@ -for p in $(man_MANS); do \ +@WITH_PATH_VERSIONED_TRUE@ case "$$p" in \ +@WITH_PATH_VERSIONED_TRUE@ *.1 ) mv $(DESTDIR)$(man1dir)/$${p} \ +@WITH_PATH_VERSIONED_TRUE@ `echo "$(DESTDIR)$(man1dir)/$${p}" | sed 's/\.1$$/-$(VERSION).1/'` ;; \ +@WITH_PATH_VERSIONED_TRUE@ *.8 ) mv $(DESTDIR)$(man8dir)/$${p} \ +@WITH_PATH_VERSIONED_TRUE@ `echo "$(DESTDIR)$(man1dir)/$${p}" | sed 's/\.8$$/-$(VERSION).8/'` ;; \ +@WITH_PATH_VERSIONED_TRUE@ esac; \ +@WITH_PATH_VERSIONED_TRUE@ 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/rpm-5.4.9/doc/fr/Makefile.am b/rpm-5.4.9/doc/fr/Makefile.am new file mode 100644 index 0000000..2a6de6d --- /dev/null +++ b/rpm-5.4.9/doc/fr/Makefile.am @@ -0,0 +1,21 @@ +## Process this file with automake to produce Makefile.in + +@SET_MAKE@ + +man_MANS = rpm.8 +mandir = @mandir@/fr + +EXTRA_DIST = $(man_MANS) + +install-data-hook: +if WITH_PATH_VERSIONED + -for p in $(man_MANS); do \ + case "$$p" in \ + *.1 ) mv $(DESTDIR)$(man1dir)/$${p} \ + `echo "$(DESTDIR)$(man1dir)/$${p}" | sed 's/\.1$$/-$(VERSION).1/'` ;; \ + *.8 ) mv $(DESTDIR)$(man8dir)/$${p} \ + `echo "$(DESTDIR)$(man8dir)/$${p}" | sed 's/\.8$$/-$(VERSION).8/'` ;; \ + esac; \ + done +endif + diff --git a/rpm-5.4.9/doc/fr/Makefile.in b/rpm-5.4.9/doc/fr/Makefile.in new file mode 100644 index 0000000..530bb20 --- /dev/null +++ b/rpm-5.4.9/doc/fr/Makefile.in @@ -0,0 +1,820 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +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@ +target_triplet = @target@ +subdir = doc/fr +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +man8dir = $(mandir)/man8 +am__installdirs = "$(DESTDIR)$(man8dir)" +NROFF = nroff +MANS = $(man_MANS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDROOTDIR_MACRO = @BUILDROOTDIR_MACRO@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBAPI = @DBAPI@ +DBLIBOBJS = @DBLIBOBJS@ +DBLIBSRCS = @DBLIBSRCS@ +DBPATH = @DBPATH@ +DBPATH_MACRO = @DBPATH_MACRO@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTRO_MACROS = @DISTRO_MACROS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIXPERMS = @FIXPERMS@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GPSEE_MODULES_PATH = @GPSEE_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_STATIC = @LDFLAGS_STATIC@ +LD_VERSION_SCRIPT_FLAG = @LD_VERSION_SCRIPT_FLAG@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOLIZE = @LIBTOOLIZE@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MACROFILES = @MACROFILES@ +MAGIC_MACRO = @MAGIC_MACRO@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR = @MKDIR@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NCPUS_COMMAND = @NCPUS_COMMAND@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENMP_CFLAGS = @OPENMP_CFLAGS@ +OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_INSTALLDIRS = @PERL_INSTALLDIRS@ +PERL_URPM_INSTALLDIRS = @PERL_URPM_INSTALLDIRS@ +PKGSRCDIR = @PKGSRCDIR@ +PKGSRCDIR_MACRO = @PKGSRCDIR_MACRO@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +ROOT_GROUP = @ROOT_GROUP@ +RPMCANONARCH = @RPMCANONARCH@ +RPMCANONCOLOR = @RPMCANONCOLOR@ +RPMCANONGNU = @RPMCANONGNU@ +RPMCANONOS = @RPMCANONOS@ +RPMCANONVENDOR = @RPMCANONVENDOR@ +RPMGID = @RPMGID@ +RPMGROUP = @RPMGROUP@ +RPMLUAFILES = @RPMLUAFILES@ +RPMPOPTFILES = @RPMPOPTFILES@ +RPMUID = @RPMUID@ +RPMUSER = @RPMUSER@ +RPM_TIMESTAMP = @RPM_TIMESTAMP@ +RPM_VENDOR = @RPM_VENDOR@ +RPM_VERSION = @RPM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFIGDIR = @SYSCONFIGDIR@ +USE_NLS = @USE_NLS@ +USRLIBRPM = @USRLIBRPM@ +VERSION = @VERSION@ +WITH_ACL = @WITH_ACL@ +WITH_APIDOCS = @WITH_APIDOCS@ +WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ +WITH_APR = @WITH_APR@ +WITH_ATERM = @WITH_ATERM@ +WITH_ATTR = @WITH_ATTR@ +WITH_AUGEAS = @WITH_AUGEAS@ +WITH_AUGEAS_AUGTOOL = @WITH_AUGEAS_AUGTOOL@ +WITH_BASH = @WITH_BASH@ +WITH_BASH_CPPFLAGS = @WITH_BASH_CPPFLAGS@ +WITH_BASH_LDFLAGS = @WITH_BASH_LDFLAGS@ +WITH_BASH_LIBS = @WITH_BASH_LIBS@ +WITH_BASH_SUBDIR = @WITH_BASH_SUBDIR@ +WITH_BEECRYPT = @WITH_BEECRYPT@ +WITH_BEECRYPT_CPPFLAGS = @WITH_BEECRYPT_CPPFLAGS@ +WITH_BEECRYPT_LDFLAGS = @WITH_BEECRYPT_LDFLAGS@ +WITH_BEECRYPT_LIBS = @WITH_BEECRYPT_LIBS@ +WITH_BEECRYPT_SUBDIR = @WITH_BEECRYPT_SUBDIR@ +WITH_BZIP2 = @WITH_BZIP2@ +WITH_CPUINFO = @WITH_CPUINFO@ +WITH_CUDF = @WITH_CUDF@ +WITH_CUDF_CUDFTOOL = @WITH_CUDF_CUDFTOOL@ +WITH_DB = @WITH_DB@ +WITH_DBSQL = @WITH_DBSQL@ +WITH_DBSQL_CPPFLAGS = @WITH_DBSQL_CPPFLAGS@ +WITH_DBSQL_LDFLAGS = @WITH_DBSQL_LDFLAGS@ +WITH_DBSQL_LIBS = @WITH_DBSQL_LIBS@ +WITH_DBSQL_SUBDIR = @WITH_DBSQL_SUBDIR@ +WITH_DB_CPPFLAGS = @WITH_DB_CPPFLAGS@ +WITH_DB_LDFLAGS = @WITH_DB_LDFLAGS@ +WITH_DB_LIBS = @WITH_DB_LIBS@ +WITH_DB_SUBDIR = @WITH_DB_SUBDIR@ +WITH_DMALLOC = @WITH_DMALLOC@ +WITH_EFENCE = @WITH_EFENCE@ +WITH_EXPAT = @WITH_EXPAT@ +WITH_FICL = @WITH_FICL@ +WITH_FICL_CPPFLAGS = @WITH_FICL_CPPFLAGS@ +WITH_FICL_LDFLAGS = @WITH_FICL_LDFLAGS@ +WITH_FICL_LIBS = @WITH_FICL_LIBS@ +WITH_FICL_SUBDIR = @WITH_FICL_SUBDIR@ +WITH_FILE = @WITH_FILE@ +WITH_FILE_CPPFLAGS = @WITH_FILE_CPPFLAGS@ +WITH_FILE_LDFLAGS = @WITH_FILE_LDFLAGS@ +WITH_FILE_LIBS = @WITH_FILE_LIBS@ +WITH_FILE_SUBDIR = @WITH_FILE_SUBDIR@ +WITH_GCRYPT = @WITH_GCRYPT@ +WITH_GNUTLS = @WITH_GNUTLS@ +WITH_GPSEE = @WITH_GPSEE@ +WITH_GPSEE_CPPFLAGS = @WITH_GPSEE_CPPFLAGS@ +WITH_GPSEE_LDFLAGS = @WITH_GPSEE_LDFLAGS@ +WITH_GPSEE_LIBS = @WITH_GPSEE_LIBS@ +WITH_GPSEE_SUBDIR = @WITH_GPSEE_SUBDIR@ +WITH_JS_SUBDIR = @WITH_JS_SUBDIR@ +WITH_KEYUTILS = @WITH_KEYUTILS@ +WITH_KEYUTILS_RPMKEY = @WITH_KEYUTILS_RPMKEY@ +WITH_LIBELF_DEBUGEDIT = @WITH_LIBELF_DEBUGEDIT@ +WITH_LIBGIT2 = @WITH_LIBGIT2@ +WITH_LIBGIT2_CPPFLAGS = @WITH_LIBGIT2_CPPFLAGS@ +WITH_LIBGIT2_LDFLAGS = @WITH_LIBGIT2_LDFLAGS@ +WITH_LIBGIT2_LIBS = @WITH_LIBGIT2_LIBS@ +WITH_LIBGIT2_SUBDIR = @WITH_LIBGIT2_SUBDIR@ +WITH_LIBTASN1 = @WITH_LIBTASN1@ +WITH_LUA = @WITH_LUA@ +WITH_LUA_CPPFLAGS = @WITH_LUA_CPPFLAGS@ +WITH_LUA_LDFLAGS = @WITH_LUA_LDFLAGS@ +WITH_LUA_LIBS = @WITH_LUA_LIBS@ +WITH_LUA_SUBDIR = @WITH_LUA_SUBDIR@ +WITH_LUA_SUBDIR_DEF = @WITH_LUA_SUBDIR_DEF@ +WITH_LUA_SUBDIR_LIB = @WITH_LUA_SUBDIR_LIB@ +WITH_MOZJS185 = @WITH_MOZJS185@ +WITH_MOZJS185_CPPFLAGS = @WITH_MOZJS185_CPPFLAGS@ +WITH_MOZJS185_LDFLAGS = @WITH_MOZJS185_LDFLAGS@ +WITH_MOZJS185_LIBS = @WITH_MOZJS185_LIBS@ +WITH_MOZJS185_SUBDIR = @WITH_MOZJS185_SUBDIR@ +WITH_NEON = @WITH_NEON@ +WITH_NEON_CPPFLAGS = @WITH_NEON_CPPFLAGS@ +WITH_NEON_LDFLAGS = @WITH_NEON_LDFLAGS@ +WITH_NEON_LIBS = @WITH_NEON_LIBS@ +WITH_NEON_SUBDIR = @WITH_NEON_SUBDIR@ +WITH_NIX = @WITH_NIX@ +WITH_NSS = @WITH_NSS@ +WITH_OPENSSL = @WITH_OPENSSL@ +WITH_PAKCHOIS = @WITH_PAKCHOIS@ +WITH_PATH_VERSIONED = @WITH_PATH_VERSIONED@ +WITH_PATH_VERSIONED_SUFFIX = @WITH_PATH_VERSIONED_SUFFIX@ +WITH_PCRE = @WITH_PCRE@ +WITH_PCRE_CPPFLAGS = @WITH_PCRE_CPPFLAGS@ +WITH_PCRE_LDFLAGS = @WITH_PCRE_LDFLAGS@ +WITH_PCRE_LIBS = @WITH_PCRE_LIBS@ +WITH_PCRE_SUBDIR = @WITH_PCRE_SUBDIR@ +WITH_PERLEMBED = @WITH_PERLEMBED@ +WITH_PERL_LIBS = @WITH_PERL_LIBS@ +WITH_PERL_SUBDIR = @WITH_PERL_SUBDIR@ +WITH_PERL_SUBPACKAGE = @WITH_PERL_SUBPACKAGE@ +WITH_PERL_URPM_LIBS = @WITH_PERL_URPM_LIBS@ +WITH_PERL_URPM_SUBDIR = @WITH_PERL_URPM_SUBDIR@ +WITH_PERL_URPM_SUBPACKAGE = @WITH_PERL_URPM_SUBPACKAGE@ +WITH_POPT = @WITH_POPT@ +WITH_POPT_CPPFLAGS = @WITH_POPT_CPPFLAGS@ +WITH_POPT_LDFLAGS = @WITH_POPT_LDFLAGS@ +WITH_POPT_LIBS = @WITH_POPT_LIBS@ +WITH_POPT_SUBDIR = @WITH_POPT_SUBDIR@ +WITH_PYTHONEMBED = @WITH_PYTHONEMBED@ +WITH_PYTHON_INCDIR = @WITH_PYTHON_INCDIR@ +WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ +WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ +WITH_RC = @WITH_RC@ +WITH_RC_CPPFLAGS = @WITH_RC_CPPFLAGS@ +WITH_RC_LDFLAGS = @WITH_RC_LDFLAGS@ +WITH_RC_LIBS = @WITH_RC_LIBS@ +WITH_RC_SUBDIR = @WITH_RC_SUBDIR@ +WITH_READLINE = @WITH_READLINE@ +WITH_RUBY = @WITH_RUBY@ +WITH_RUBY_CPPFLAGS = @WITH_RUBY_CPPFLAGS@ +WITH_RUBY_SUBDIR = @WITH_RUBY_SUBDIR@ +WITH_RUBY_VENDORARCHDIR = @WITH_RUBY_VENDORARCHDIR@ +WITH_SELINUX = @WITH_SELINUX@ +WITH_SEMANAGE = @WITH_SEMANAGE@ +WITH_SEMANAGE_SEMODULE = @WITH_SEMANAGE_SEMODULE@ +WITH_SEPOL = @WITH_SEPOL@ +WITH_SPIDERMONKEY_SUBDIR = @WITH_SPIDERMONKEY_SUBDIR@ +WITH_SQLITE = @WITH_SQLITE@ +WITH_SQLITE_CPPFLAGS = @WITH_SQLITE_CPPFLAGS@ +WITH_SQLITE_LDFLAGS = @WITH_SQLITE_LDFLAGS@ +WITH_SQLITE_LIBS = @WITH_SQLITE_LIBS@ +WITH_SQLITE_SUBDIR = @WITH_SQLITE_SUBDIR@ +WITH_SQUIRREL = @WITH_SQUIRREL@ +WITH_SUBVERSION = @WITH_SUBVERSION@ +WITH_SYCK = @WITH_SYCK@ +WITH_SYCK_CPPFLAGS = @WITH_SYCK_CPPFLAGS@ +WITH_SYCK_LDFLAGS = @WITH_SYCK_LDFLAGS@ +WITH_SYCK_LIBS = @WITH_SYCK_LIBS@ +WITH_SYCK_SUBDIR = @WITH_SYCK_SUBDIR@ +WITH_TCL = @WITH_TCL@ +WITH_TCL_SUBDIR = @WITH_TCL_SUBDIR@ +WITH_TOMCRYPT = @WITH_TOMCRYPT@ +WITH_TPM = @WITH_TPM@ +WITH_UNIXODBC = @WITH_UNIXODBC@ +WITH_UUID = @WITH_UUID@ +WITH_XAR = @WITH_XAR@ +WITH_XAR_CPPFLAGS = @WITH_XAR_CPPFLAGS@ +WITH_XAR_LDFLAGS = @WITH_XAR_LDFLAGS@ +WITH_XAR_LIBS = @WITH_XAR_LIBS@ +WITH_XAR_SUBDIR = @WITH_XAR_SUBDIR@ +WITH_XZ = @WITH_XZ@ +WITH_XZ_CPPFLAGS = @WITH_XZ_CPPFLAGS@ +WITH_XZ_LDFLAGS = @WITH_XZ_LDFLAGS@ +WITH_XZ_LIBS = @WITH_XZ_LIBS@ +WITH_XZ_SUBDIR = @WITH_XZ_SUBDIR@ +WITH_ZLIB = @WITH_ZLIB@ +WITH_ZLIB_CPPFLAGS = @WITH_ZLIB_CPPFLAGS@ +WITH_ZLIB_LDFLAGS = @WITH_ZLIB_LDFLAGS@ +WITH_ZLIB_LIBS = @WITH_ZLIB_LIBS@ +WITH_ZLIB_SUBDIR = @WITH_ZLIB_SUBDIR@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__BASH = @__BASH@ +__BZIP2 = @__BZIP2@ +__CAT = @__CAT@ +__CHATTR = @__CHATTR@ +__CHGRP = @__CHGRP@ +__CHGRP_RHF = @__CHGRP_RHF@ +__CHMOD = @__CHMOD@ +__CHOWN = @__CHOWN@ +__CHOWN_RHF = @__CHOWN_RHF@ +__CMAKE = @__CMAKE@ +__CPIO = @__CPIO@ +__CURL = @__CURL@ +__CVS = @__CVS@ +__DBSQL = @__DBSQL@ +__DB_ARCHIVE = @__DB_ARCHIVE@ +__DB_CHECKPOINT = @__DB_CHECKPOINT@ +__DB_DEADLOCK = @__DB_DEADLOCK@ +__DB_DUMP = @__DB_DUMP@ +__DB_HOTBACKUP = @__DB_HOTBACKUP@ +__DB_LOAD = @__DB_LOAD@ +__DB_LOG_VERIFY = @__DB_LOG_VERIFY@ +__DB_PRINTLOG = @__DB_PRINTLOG@ +__DB_RECOVER = @__DB_RECOVER@ +__DB_REPLICATE = @__DB_REPLICATE@ +__DB_SQL_CODEGEN = @__DB_SQL_CODEGEN@ +__DB_STAT = @__DB_STAT@ +__DB_TUNER = @__DB_TUNER@ +__DB_UPGRADE = @__DB_UPGRADE@ +__DB_VERIFY = @__DB_VERIFY@ +__DIFF = @__DIFF@ +__DITTO = @__DITTO@ +__DOXYGEN = @__DOXYGEN@ +__FILE = @__FILE@ +__GIT = @__GIT@ +__GPG = @__GPG@ +__GSR = @__GSR@ +__GST_INSPECT = @__GST_INSPECT@ +__GZIP = @__GZIP@ +__HG = @__HG@ +__ID = @__ID@ +__ID_U = @__ID_U@ +__INSTALL = @__INSTALL@ +__INSTALL_INFO = @__INSTALL_INFO@ +__LD = @__LD@ +__LDCONFIG = @__LDCONFIG@ +__LN = @__LN@ +__LRZIP = @__LRZIP@ +__LSATTR = @__LSATTR@ +__LZIP = @__LZIP@ +__LZMA = @__LZMA@ +__LZOP = @__LZOP@ +__MAKE = @__MAKE@ +__MKDIR = @__MKDIR@ +__MKDIR_P = @__MKDIR_P@ +__MODINFO = @__MODINFO@ +__MONGO = @__MONGO@ +__MV = @__MV@ +__NM = @__NM@ +__OBJCOPY = @__OBJCOPY@ +__OBJDUMP = @__OBJDUMP@ +__PATCH = @__PATCH@ +__PAX = @__PAX@ +__PERL = @__PERL@ +__PGP = @__PGP@ +__PHP = @__PHP@ +__PYTHON = @__PYTHON@ +__RM = @__RM@ +__RMDIR = @__RMDIR@ +__RSH = @__RSH@ +__RUBY = @__RUBY@ +__SED = @__SED@ +__SH = @__SH@ +__SQLITE3 = @__SQLITE3@ +__SSH = @__SSH@ +__STRIP = @__STRIP@ +__SVN = @__SVN@ +__TAR = @__TAR@ +__TCLSH = @__TCLSH@ +__UNZIP = @__UNZIP@ +__XZ = @__XZ@ +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_CXX = @ac_ct_CXX@ +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@ +autorelocate_dcolor = @autorelocate_dcolor@ +autorelocate_path = @autorelocate_path@ +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@ +exeext = @exeext@ +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@ +libext = @libext@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@/fr +mkdir_p = @mkdir_p@ +objext = @objext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +shlibext = @shlibext@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +testdir = @testdir@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrprefix = @usrprefix@ +varprefix = @varprefix@ +man_MANS = rpm.8 +EXTRA_DIST = $(man_MANS) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 doc/fr/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign doc/fr/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man8: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(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='$(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) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically \`make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi + @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 $(MANS) +installdirs: + for dir in "$(DESTDIR)$(man8dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-man + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +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-man8 + +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-man + +uninstall-man: uninstall-man8 + +.MAKE: install-am install-data-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + 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-hook install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man8 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 uninstall uninstall-am uninstall-man uninstall-man8 + + +@SET_MAKE@ + +install-data-hook: +@WITH_PATH_VERSIONED_TRUE@ -for p in $(man_MANS); do \ +@WITH_PATH_VERSIONED_TRUE@ case "$$p" in \ +@WITH_PATH_VERSIONED_TRUE@ *.1 ) mv $(DESTDIR)$(man1dir)/$${p} \ +@WITH_PATH_VERSIONED_TRUE@ `echo "$(DESTDIR)$(man1dir)/$${p}" | sed 's/\.1$$/-$(VERSION).1/'` ;; \ +@WITH_PATH_VERSIONED_TRUE@ *.8 ) mv $(DESTDIR)$(man8dir)/$${p} \ +@WITH_PATH_VERSIONED_TRUE@ `echo "$(DESTDIR)$(man8dir)/$${p}" | sed 's/\.8$$/-$(VERSION).8/'` ;; \ +@WITH_PATH_VERSIONED_TRUE@ esac; \ +@WITH_PATH_VERSIONED_TRUE@ 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/rpm-5.4.9/doc/fr/rpm.8 b/rpm-5.4.9/doc/fr/rpm.8 new file mode 100644 index 0000000..7ad08b8 --- /dev/null +++ b/rpm-5.4.9/doc/fr/rpm.8 @@ -0,0 +1,462 @@ +.\" Traduction 06/08/2000 par Frédéric Delanoy (fdelanoy@info.fundp.ac.be) +.\" +.\" rpm - Gestionnaire de Paquetages Red Hat +.TH RPM 8 "6 Août 2000" "Red Hat" "Manuel de l'administrateur Linux" +.SH NOM +rpm \- Gestionnaire de Paquetages Red Hat. +.SH SYNOPSIS +\fBrpm\fP [options] +.SH DESCRIPTION +\fBrpm\fP est un puissant \fIgestionnaire de paquetages\fP, qui peut être utilisé pour construire, installer, interroger, vérifier, mettre à jour, et désinstaller des paquetages de logicies individuels. Un \fIpaquetage\fP consiste en une archive de fichiers, et en de l'information sur ce paquetage, incluant le nom, la version et la description du paquetage. + +Un des modes de base suivants doit être sélectionné : +\fIInitialiser Base De Données\fP, \fIReconstruire Base De Données\fP, \fIConstruire Paquetage\fP, \fIRecompiler Paquetage\fP, \fIConstruire Paquetage à partir Tarball\fP, \fIInterroger\fP, \fIMontrer Etiquettes de Requêtes\fP, \fIInstaller\fP, \fIRafraîchir\fP, \fIDésinstaller\fP, \fIVérifier\fP, \fIVérifier Signature\fP, \fIResigner\fP, \fIAjouter Signature\fP, \fIfixer propriétaires et groupes\fR et \fIMontrer Configuration\fP. + +Maintenance de la Base De Données : +.br +.I "\fB rpm \-i [\-\-initdb]\fP" +.br +.I "\fB rpm \-i [\-\-rebuiddb]\fP" + +Construction : +.br +.I "\fB rpm [\-b|t] [spec_paquetage]+\fP" +.br +.I "\fB rpm [\-\-rebuild] [source_rpm]+\fP" +.br +.I "\fB rpm [\-\-tarbuild] [source_tarrée]+\fP" +.br + +Requêtes : +.br +.I "\fB rpm [\-\-query] [options_de_requête]\fP" +.br +.I "\fB rpm [\-\-querytags]\fP" +.br + +Maintenir les paquetages installés : +.br +.I "\fB rpm [\-\-install] [options] [fichier_paquetage]+\fP" +.br +.I "\fB rpm [\-\-freshen|\-F] [options_installation] [fichier_paquetage]+\fP" +.br +.I "\fB rpm [\-\-uninstall|\-e] [options_désinstallation] [paquetage]+\fP" +.br +.I "\fB rpm [\-\-verify|\-V] [options_vérification] [paquetage]+\fP" +.br + +Signatures: +.br +.I "\fB rpm [\-\-verify|\-V] [options_vérification] [paquetage]+\fP" +.br +.I "\fB rpm [\-\-resign] [fichier_paquetage]+\fP" +.br +.I "\fB rpm [\-\-addsign] [fichier_paquetage]+\fP" +.br + +Divers : +.br +.I "\fB rpm [\-\-showrc]\fP" +.br +.I "\fB rpm [\-\-setperms] [paquetage]+\fP" +.br +.I "\fB rpm [\-\-setgids] [paquetage]+\fP" +.br + + +.SH OPTIONS GENERALES +Ces options peuvent être utilisées dans différents modes. +.IP "\fB\-vv\fP" +Afficher un tas d'horribles informations de déboggage. +.IP "\fB\-\-quiet\fP" +Afficher le moins possible ; normalement seuls les messages d'erreur seront affichés. +.IP "\fB\-\-help\fP" +Afficher un message d'utilisation plus long que d'habitude. +.IP "\fB\-\-version\fP" +Afficher une seule ligne contenant le numéro de version utilisé par \fBrpm\fP. +.IP "\fB\-\-rcfile \fI\fP" +Chacun des fichiers dans la \fI\fP séparés par des deux\-point est lu séquentiellement par \fBrpm\fP pour obtenir des informations de configuration. La \fI\fP par défaut est \fB/usr/lib/rpm/rpmrc:/etc/rpmrc:~/.rpmrc\fP. Seul le premier fichier dans la liste doit exister, les tildes sont étendues à \fB$HOME\fP. +.IP "\fB\-\-root \fI\fP" +Utiliser le système "enraciné" dans \fI\fP pour toutes les opérations. Notez que cela signifie que la base de données sera lue ou modifiée dans \fI\fP et que chacun des scripts \fIpre\fP et \fIpost\fP seront lancés après un chroot() vers \fI\fP. +.IP "\fB\-\-dbpath \fI\fP" +Utiliser la base de données RPM située dans \fI\fP. +.IP "\fB\-\-justdb\fP" +Mettre à jour uniquement la base de données, pas le système de fichiers. +.IP "\fB\-\-ftpproxy \fI\fP, \fB\-\-httpproxy \fI\fP" +Utiliser \fI\fP en tant qu'hôte proxy FTP ou HTTP. Voir \fBOPTIONS FTP/HTTP\fP. +.IP "\fB\-\-ftpport \fI\fP, \fB\-\-httpport \fI\fP" +Utiliser \fI\fP comme port FTP ou HTTP sur l'hôte proxy. Voir \fBOPTIONS FTP/HTTP\fP. +.IP "\fB\-\-pipe \fI\fP" +Envoyer la sortie de \fBrpm\fP à la commande \fI\fP par l'intermédiaire d'un tube. + +.SH OPTIONS D'INSTALLATION ET DE MISE A NIVEAU +La forme de la commande d'installation rpm est +.PP + \fBrpm \-i [options_installation] \fI+\fP +.PP +Ceci installe un nouveau paquetage. La forme générale d'une commande de mise à niveau rpm est +.PP + \fBrpm \-U [options_installation] \fI+\fP +.PP +Ceci met à jour ou installe le paquetage installé actuellement à la version du nouveau RPM. Ceci est la même chose que l'installation, sauf que les autres versions du paquetage sont supprimées du système. +.PP + \fBrpm [\-F|-\-rafraîchir] [options_installation] \fI+\fP +.PP +Ceci mettra à niveau les paquetages, mais uniquement si une version plus ancienne existe actuellement. + +Le \fI\fP peut être spécifié par une URL ftp ou http, auquel cas le paquetage sera téléchargé avant d'être installé. Voir \fBOPTIONS FTP/HTTP\fP pour obtenir des informations sur le support intégré de ftp et http par RPM. +.PP +.IP "\fB\-\-force\fP" +Idem que \fB\-\-replacepkgs\fP, \fB\-\-replacefiles\fP, et \fB\-\-oldpaquetage\fP. +.IP "\fB\-h\fP, \fB\-\-hash\fP" +Afficher 50 marques de hachage quand l'archive du paquetage est déballée. A utiliser avec \fB\-v\fP pour un bel affichage. +.IP "\fB\-\-oldpackage\fP" +Permettre à une mise à niveau de remplacer un paquetage par un paquetage plus ancien. +.IP "\fB\-\-percent\fP" +Afficher les pourcentages quand les fichiers sont extraits de l'archive du paquetage, ceci dans le but de rendre RPM facile à lancer à partir d'autres outils. +.IP "\fB\-\-replacefiles\fP" +Installer les paquetages même s'ils remplacent des fichiers d'autres paquetages déjà installés. +.IP "\fB\-\-replacepkgs\fP" +Installer les paquetages même si certains d'entre eux sont déjà installés sur ce système. +.IP "\fB\-\-allfiles\fP" +Installer ou mettre à niveau tous les fichiers manquants du paquetage, même s'ils existent déjà. +.IP "\fB\-\-nodeps\fP" +Ne pas effectuer de vérification de dépendances avant d'installer ou de mettre à niveau un paquetage. +.IP "\fB\-\-noscripts\fP" +Ne pas exécuter les scripts de pré\- et post\- installation. +.IP "\fB\-\-notriggers\fP" +Ne pas exécuter les scripts qui sont déclenchés par l'installation de ce paquetage. +.IP "\fB\-\-ignoresize\fP" +Ne pas examiner les systèmes de fichiers montés pour vérifier qu'il y ait un espace disque suffisant avant d'installer ce paquetage. +.IP "\fB\-\-excludepath \fI\fP" +Ne pas installer les fichiers dont les noms commencent par \fI\fP. +.IP "\fB\-\-excludedocs\fP" +Ne pas installer de fichiers qui sont marqués comme documentation (ce qui inclut les pages de manuel et les documents texinfo). +.IP "\fB\-\-includedocs\fP" +Installer les fichiers de documentation. C'est le comportement par défaut. +.IP "\fB\-\-test\fP" +Ne pas installer le paquetage, uniquement le vérifier et rapporter les conflits potentiels. +.IP "\fB\-\-ignorearch\fP" +Ceci permet l'installation ou la mise à niveau même si l'architecture du binaire RPM et de l'hôte ne correspondent pas. +.IP "\fB\-\-ignoreos\fP" +Ceci permet l'installation ou la mise à niveau même si les systèmes d'exploitation du binaire RPM et de l'hôte ne correspondent pas. +.IP "\fB\-\-prefix \fI\fP" +Ceci fixe le préfixe d'installation à \fI\fP pour les paquetages relogeables. +.IP "\fB\-\-relocate \fI\fB=\fI\fP" +Pour les paquetages relogeables, traduit les fichiers qui seraient mis dans \fI\fP par \fI\fP. +.IP "\fB\-\-badreloc\fP" +A utiliser en conjonction avec \-\-relocate, ceci force le relogement même si le paquetage n'est pas relogeable. +.IP "\fB\-\-noorder\fP" +Ne pas réordonner les paquetages pour une installation. La liste des paquetages devrait normalement être réordonnée pour satisfaire aux dépendances. + +.SH OPTIONS DE REQUETE +La forme générale d'une commande de requête rpm est +.PP + \fBrpm \-q [options_de_requête]\fP +.PP +Vous pouvez spécifier le format d'information de paquetage qui sera affiché. Pour cela, utilisez l'option \fB[\-\-queryformat|\-qf]\fP, suivie de la chaîne de caractères de format. + +Les formats de requête sont des versions modifiées du formattage standard \fBprintf(3)\fP. Ce format est constitué de chaînes de caractères statiques (qui peuvent inclure les séquences d'échappement du C standard pour les sauts de lignes, les tabulations, et d'autres caractères spéciaux) et les formatteurs du type de ceux de \fBprintf(3)\fP. Comme \fBrpm\fP connaît déjà les types à afficher, le spécificateur de type doit néanmoins être omis, et remplacé par le nom de l'étiquette (tag) d'entête à afficher, enfermé dans des caractères \fB{}\fP. La partie \fBRPMTAG_\fP du nom de l'étiquette peut être omise. + +Des formats de sortie alternatifs peuvent être requis en faisant suivre l'étiquette par \fB:\fItypetag\fR. Actuellement, les types suivants sont supportés : \fBoctal\fR, \fBdate\fR, \fBshescape\fR, \fBperms\fR, \fBfflags\fR, et \fBdepflags\fR. + +Par exemple, pour afficher uniquement les noms des paquetages requis, vous pouvez utiliser \fB%{NOM}\fP comme chaîne de caractères de format. Pour afficher de l'information de nom et de distribution en deux colonnes, vous pouvez utiliser \fB%\-30{NOM}%{DISTRIBUTION}\fP. + +\fBrpm\fP affichera une liste de toutes les étiquettes qu'il connaît quand il est invoqué avec l'argument \fB\-\-querytags\fP. + +Il y a deux sous\-ensembles d'option pour les requêtes : la sélection de paquetages et la sélection d'information. + +Options de sélection de paquetages : +.br +.IP "\fB\fI\fP" +Interroger le paquetage intallé nommé \fI\fP. +.IP "\fB\-a\fP, \fB\-\-all\fP" +Interroger tous les paquetages intallés. +.IP "\fB\-\-whatrequires \fI\fP" +Interroger tous les paquetages qui ont besoin de \fI\fP pour leur fonctionnement propre. +.IP "\fB\-\-whatprovides \fI\fP" +Interroger tous les paquetages qui fournissent la capacité \fI\fP. +.IP "\fB\-f \fI\fP, \fB\-\-fichier \fI\fP" +Interroger le paquetage possédant \fI\fP. +.IP "\fB\-g \fI\fP, \fB\-\-groupe \fI\fP" +Interroger les paquetages dont le groupe est \fI\fP. +.IP "\fB\-p \fI\fP" +Interroger un paquetage \fI\fP non installé . Le \fI\fP peut être spécifié comme une URL de type ftp ou http, auquel cas l'entête du paquetage sera téléchargée et interrogée. Voir \fBOPTIONS FTP/HTTP\fP pour obtenir de l'information sur le support intégré d'un client ftp et http par RPM. +.IP "\fB\-\-specfile \fI\fP" +Analyse syntaxiquement (parse) et interroge \fI\fP comme s'il était un paquetage. Bien que toutes les informations (p.ex. les listes de fichiers) ne soient pas disponibles, ce type d'interrogation permet à rpm d'être utilisé pour extraire de l'information de fichiers de spécifications sans avoir à écrire un parseur de fichiers de spécifications. +.IP "\fB\-\-querybynombre \fI\fP" +Interroger la \fI\fPième entrée de la base de données directement; ceci est utile à des fins de déboggage. +.IP "\fB\-\-triggeredby \fI\fP" +Interroger les paquetages qui sont déclenchés par les paquetages \fI\fP. + +.P +Options de sélection d'information : +.br +.IP "\fB\-i\fP" +Afficher l'information du paquetage, incluant son nom, sa version, et sa description. Cette option utilisera \fB\-\-queryformat\fP s'il a été spécifié. +.IP "\fB\-R\fP, \fB\-\-requires\fP" +Lister les paquetages desquels dépend ce paquetage. +.IP "\fB\-\-provides\fP" +Lister les capacités que fournit ce paquetage. +.IP "\fB\-\-changelog\fP" +Lister les informations de modifications de ce paquetage. +.IP "\fB\-l\fP, \fB\-\-list\fP" +Lister les fichiers du paquetage. +.IP "\fB\-s\fP, \fB\-\-state\fP" +Afficher les \fIétats\fP des fichiers du paquetage (implique \fB\-l\fP). L'état de chaque fichier est soit \fInormal\fP, \fInon installé\fP, ou \fIremplacé\fP. +.IP "\fB\-d\fP, \fB\-\-docfiles\fP" +Lister uniquement les fichiers de documentation (implique \fB\-l\fP). +.IP "\fB\-c\fP, \fB\-\-configfiles\fP" +Lister uniquement les fichiers de configuration (implique \fB\-l\fP). +.IP "\fB\-\-scripts\fP" +Lister les scripts shell spécifiques au paquetage qui sont utilisés comme une partie des processus d'installation et de désinstallation, s'il y en a. +.IP "\fB\-\-triggers\fP, \fB\-\-triggerscripts\fP" +Afficher les scripts de déclenchement, s'il y en a, qui sont contenus dans le paquetage. +.IP "\fB\-\-dump\fP" +Afficher l'information du fichier comme suit : chemin taille mtime somme_md5 mode propriétaire groupe isconfig isdoc rdev symlink. Ceci doit être utilisé avec au moins une option parmi \fB\-l\fP, \fB\-c\fP, \fB\-d\fP. +.IP "\fB\-\-last\fP" +Ordonner le listing des paquetages par date d'installation de sorte que les derniers fichiers installés soient au sommet. +.IP "\fB\-\-filesbypkg\fP" +Lister tous les fichiers de chaque paquetage. +.IP "\fB\-\-triggerscripts\fP" +Montrer tous les scripts de déclenchement pour les paquetages sélectionnés. + +.SH OPTIONS DE VERIFICATION +La forme générale d'une commande de vérification rpm est +.PP + \fBrpm \-V|\-y|\-\-verify [verify\-options]\fP +.PP +Vérifier un paquetage compare les informations sur les fichiers installés dans le paquetage avec les informations sur les fichiers obtenues à partir du paquetage original et conservées dans la base de données rpm. Entre autres choses, la vérification compare la taille, la somme MD5, les permissions, le propriétaire et les groupes de chaque fichier. Toutes les discordances sont affichées. Les options de spécification de paquetage sont les mêmes que pour l'interrogation de paquetages. + +Les fichiers qui n'étaient pas installés en provenance du paquetage, par exemple les fichiers de documentation exclus à l'installation en utilisant l'option "\fB\-\-excludedocs\fP", sont ignorés silencieusement. + +Options pouvant être utilisées en mode de vérification : + +.IP "\fB\-\-nomd5\fP" +Ignore les erreurs de somme de contrôle MD5 pendant la vérification. +.IP "\fB\-\-nopgp\fP" +Ignore les erreurs de contrôle PGP pendant la vérification. +.IP "\fB\-\-nofiles\fP" +Ignore les fichiers manquants pendant la vérification. + +Le format de sortie est constitué d'une chaîne de caractères de 8 caractère, d'un "\fBc\fP" éventuel dénottant un fichier de configuration, et ensuite du nom du fichier. Chacun des 8 caractères dénote le résultat d'une comparaison d'un attribut du fichier avec la valeur de cet attribut enregistré dans la base de données rpm. Un simple "\fB.\fP" (point) signifie que le test s'est bien passé. Les caractères suivants dénote l'échec à certains tests : + +.IP "\fB5\fP" +Somme MD5 +.IP "\fBS\fP" +Taille du fichier +.IP "\fBL\fP" +Lien symbolique +.IP "\fBT\fP" +Mtime +.IP "\fBD\fP" +Périphérique +.IP "\fBU\fP" +Utilisateur +.IP "\fBG\fP" +Groupe +.IP "\fBM\fP" +Mode (inclut les permissions et le type de fichier) + +.SH VERIFICATION DE SIGNATURE +La forme générale d'une commande de vérification d'une signature rpm est +.PP + \fBrpm \-\-checksig \fI+\fP +.PP +Ceci vérifie la signature PGP du paquetage \fI\fP pour s'assurer de son intégrité et de son origine. Les informations de configurations de PGP sont lues à partir des fichiers de configuration. Voir la section sur les SIGNATURES PGP pour les détails. + +.SH OPTIONS DE DESINSTALLATION +La forme générale d'une commande de désinstallation rpm est +.PP + \fB rpm \-e \fI+\fP +.PP +.IP "\fB\-\-allmatches\fP" +Supprimer toutes les versions du paquetage auquel correspond \fI\fR. Normalement, une erreur est émise si \fI\fR correspond à de multiples paquetages. +.IP "\fB\-\-noscripts\fP" +Ne pas exécuter les scripts de pré\- et de post\- désinstallation. +.IP "\fB\-\-notriggers\fP" +Ne pas exécuter les scripts qui sont déclenchés par la suppression de ce paquetage. +.IP "\fB\-\-nodeps\fP" +Ne pas vérifier les dépendances avant de désinstaller les paquetages. +.IP "\fB\-\-test\fP" +Ne pas réellement désinstaller quoi que ce soit, juste effectuer un test pour voir si c'est possible. Utile en conjonction avec l'option \fB\-vv\fP. + +.SH OPTIONS DE CONSTRUCTION +La forme générale d'une commande de construction rpm est +.PP + \fBrpm \-[b|t]\fIO\fP [options_de_construction] \fI+\fP +.PP +L'argument utilisé est \fB-b\fR si un fichier de spécifications est utilisé pour construire le paquetage et \fB-t\fR si \fBRPM\fR devrait regarder à l'intérieur d'un fichier gzippé (ou tarré) pour obtenir le fichier de spécifications à utiliser. Après le premier argument, l'argument suivant (\fIO\fR) spécifie les étapes de construction et de mise en paquets à effectuer et est un argument parmi : + +.IP "\fB\-bp\fP" +Exécute l'étape "%prep" du fichier de spécifications. Normalement, ceci implique de déballer les sources et d'appliquer tous les patchs. +.IP "\fB\-bl\fP" +Faire une "vérification de liste". La section "%files" du fichier de spécifications subit l'expansion des macros, et des vérifications sont effectuées pour vérifier que chaque fichier existe. +.IP "\fB\-bc\fP" +Effectuer l'étape "%build" du fichier de spécifications (après avoir effectué l'étape prep). Cela implique en général l'équivalent d'un "make". +.IP "\fB\-bi\fP" +Effectuer l'étape "%install" du fichier de spécifications (après avoir effectué les étapes prep et build). Cela implique en général l'équivalent d'un "make install". +.IP "\fB\-bb\fP" +Construire un paquetage binaire (après avoir effectué les étapes prep, build, et install). +.IP "\fB\-bs\fP" +Construire uniquement le paquetage source (après avoir effectué les étapes prep, build, et install). +.IP "\fB\-ba\fP" +Construire les paquetages paquetages binaires et sources (après avoir effectué les étapes prep, build, et install). +.PP +Les options suivantes peuvent également être utilisées : +.IP "\fB\-\-short\-circuit\fP" +Passer directement à l'étape spécifiée (çàd, passer toutes les étapes menant à l'étape spécifiée). Uniquement valide avec \fB\-bc\fP et \fB\-bi\fP. +.IP "\fB\-\-timecheck\fP" +Fixer l'âge de "timecheck" (0 pour le désactiver). Cette valeur peut également être configurée en définissant la macro "_timecheck". La valeur de timecheck exprime, en secondes, l'âge maximum d'un fichier en train d'être mis en paquetage. Des avertissements seront affichés pour tous les fichiers au\-delà de l'âge de timecheck. +.IP "\fB\-\-clean\fP" +Supprimer l'arbre de construction après que les paquetages aient été créés. +.IP "\fB\-\-rmsource\fP" +Supprimer les sources et le fichier de spécifications après la construction (peut également être utilisé seul, p.ex. "\fBrpm \-\-rmsource foo.spec\fP"). +.IP "\fB\-\-test\fP" +N'exécuter aucune étape de construction. Utile pour tester en profondeur les fichiers de spécifications. +.IP "\fB\-\-sign\fP" +Incorpore une signature PGP dans le paquetage. Cette signature peut être utilisée pour vérifier l'intégrité et l'origine du paquetage. Voir la section sur les SIGNATURES PGP pour les détails de configuration. +.IP "\fB\-\-buildroot \fI\fP" +Pendant la construction du paquetage, surcharger l'étiquette de Construction de Racine avec le répertoire \fI\fP. +.IP "\fB\-\-target \fI\fP" +Pendant la construction du paquetage, interpréter \fI\fP comme \fBarch-vendor-os\fP et fixer les macros \fB_target\fP, \fB_target_arch\fP et \fB_target_os\fP en conséquence. +.IP "\fB\-\-buildarch \fI\fP" +Pendant la construction du paquetage, fixer l'architecture à \fI\fP. Cette option a été rendue obsolète par \fB\-\-target\fI dans RPM 3.0. +.IP "\fB\-\-buildos \fI\fP" +Pendant la construction du paquetage, fixer l'architecture à \fI\fP. Cette option a été rendue obsolète par \fB\-\-target\fI dans RPM 3.0. + +.SH OPTIONS DE RECONSTRUCTION ET DE RECOMPILATION + +Il y a deux autres façons d'invoquer une construction avec rpm: + +.I "\fBrpm \-\-recompile \fI+\fP" + +.I "\fBrpm \-\-rebuild \fI+\fP" + +Quand il est invoqué de cette façon, \fBrpm\fP installe le paquetage de sources désigné, et effectue une préparation, une compilation et une installation. En plus, \fB\-\-rebuild\fP construit un nouveau paquetage bianire. Quand la construction est terminée, le répertoire de construction est supprimé (comme avec \fB\-\-clean\fP) et les sources ainsi que le fichier de spécifications du paquetage sont supprimés. + +.SH SIGNATURE D'UN RPM EXISTANT + +.I "\fBrpm \-\-resign \fI+\fP" + +Cette option génère et insère de nouvelles signatures pour les paquetages spécifiés. Toute signature existante est supprimée. + +.I "\fBrpm \-\-addsign \fI+\fP" + +Cette option génère et concatène les nouvelles signatures des paquetages spécifiés à celles qui existaient déjà. + +.SH SIGNATURES PGP + +Pour utiliser la caractéristique des signatures, RPM doit être configuré pour lancer PGP, et il doit être capable de trouver un groupe de clés publiques (keyring) avec des clés publiques RPM à l'intérieur. Par défaut, RPM utilise les comportements par défaut de PGP pour trouver les keyrings (en utilisant PGPPATH). Si vos keyrings ne sont pas situées là où PGP s'attend à ce qu'elles soient, vous aurez besoin de configurer la macro + +.IP "\fB_pgp_path\fP" +pour fournir la localisation des keyrings PGP à utiliser. +.PP + +Si vous voulez être capable de signer les paquetages que vous avez créés vous\-même, vous devrez également créer votre propre paire clé publique/clé secrète (voir le manuel PGP). Vous devrez également configurer les macros suivantes : + +.IP "\fB_signature\fP" +Le type de la signature. Actuellement, seule celle de pgp est supportée. +.IP "\fB_pgp_name\fP" +Le nom de l'"utilisateur" dont vous voulez utiliser la clé pour signer vos paquetages. +.PP + +Pendant la construction de paquetages, vous ajouterez ensuite le signe \-\- à la ligne de commandes. On vous demandera votre phrase de passe, et votre paquetage sera construit et signé. + +Par exemple, pour être capable d'utiliser PGP pour signer les paquetages en tant qu'utilisateur \fp"John Doe "\fP à partir des key rings situées dans \fB/etc/rpm/.pgp\fP en utilisant l'exécutable \fB/usr/bin/pgp\fP, vous devriez inclure + +.I "\fB%_signature pgp\fP" + +.I "\fB%_pgp_path /etc/rpm/.pgp\fP" + +.I "\fB%_pgp_name John Doe \fP" + +.I "\fB%_pgpbin /usr/bin/pgp\fP" + +dans un fichier de configuration de macros. Utilisez \fB/etc/rpm/macros\fP pour une configuration par système et \fB~/.rpmmacros\fP pour une configuration par utilisateur. + +.SH OPTIONS DE RECONSTRUCTION DE LA BASE DE DONNEES + +La forme générale d'une commande de reconstruction d'une base de données rpm est +.PP + \fBrpm \-\-rebuiddb\fP +.PP + +Pour reconstuire une nouvelle base de données, tapez : +.PP + \fBrpm \-\-initdb\fP +.PP + +Les seules options pour ces modes sont \fB-\-dbchemin\fP et \fB-\-root\fP. + +.SH SHOWRC + +Lancer + +.PP + \fBrpm \-\-showrc\fP + +.PP +montrera les valeurs que va utiliser RPM pour toutes les options qui peuvent être fixées dans les fichiers \fIrpmrc\fP. + +.SH OPTIONS FTP/HTTP + +RPM inclut des simples clients FTP et HTTP pour simplifier l'installation et l'interrogation de paquetages qui sont disponibles sur internet. Les fichiers de paquetage pour l'installation, la mise à niveau et les opérations d'interrogation peuvent être spécifiés dans une URL du style ftp ou http : + +.PP + \fBftp://:@nom_hôte:/chemin/vers/paquetage.rpm\fP +.PP +Si la partie \fB:mot_de_passe\fP est omise, le mot de passe sera demandé (une seule fois par paire utilisateur/nom_hôte). Si l'utilisateur et le mot de passe sont omis, le ftp anonyme est utilisé. Dans tous les cas, des transferts ftp passifs (PASV) sont utilisés. + +RPM permet d'utiliser les options suivantes avec les URLs ftp : + +.IP "\fB\-\-ftpproxy \fI\fP" +L'hôte \fI\fP sera utilisé comme un serveur délégué (proxy) pour tous les transferts ftp, ce qui permet aux utilisateurs d'effectuer des connexions au travers des gardes\-barrière qui utilisent des systèmes de proxies. Cette option peut également être spécifiée en configurant la macro \fB_ftpproxy\fP. + +.IP "\fB\-\-ftpport \fI\fP" +Le port TCP numéro \fI\fP à utiliser pour les connexions ftp sur le serveur proxy ftp au lieu du port par défaut. Cette option peut également être spécifiée en configurant la macro \fB_ftpport\fP. +.PP + +RPM permet d'utiliser les options suivantes avec les URLs http : + +.IP "\fB\-\-httpproxy \fI\fP" +L'hôte \fI\fP sera utilisé comme un serveur délégué (proxy) pour tous les transferts http. Cette option peut également être spécifiée en configurant la macro \fB_httpproxy\fP. + +.IP "\fB\-\-httpport \fI\fP" +Le port TCP numéro \fI\fP à utiliser pour les connexions http sur le serveur proxy ftp au lieu du port par défaut. Cette option peut également être spécifiée en configurant la macro \fB_httpport\fP. +.PP + +.SH FICHIERS +.nf +/usr/lib/rpm/rpmrc +/etc/rpmrc +~/.rpmrc +/usr/lib/rpm/macros +/etc/rpm/macros +~/.rpmmacros +/var/lib/rpm/conflictsindex.rpm +/var/lib/rpm/fileindex.rpm +/var/lib/rpm/groupindex.rpm +/var/lib/rpm/nameindex.rpm +/var/lib/rpm/packages.rpm +/var/lib/rpm/providesindex.rpm +/var/lib/rpm/requiredby.rpm +/var/lib/rpm/triggerindex.rpm +/tmp/rpm* +.fi +.El +.SH VOIR AUSSI +.IR glint (8) +, +.IR rpm2cpio (8) +, +.B http://www.rpm.org/ +.nf +.SH AUTEURS +.nf +Marc Ewing +Jeff Johnson +Erik Troan +.fi +.SH TRADUCTION +Frédéric Delanoy, 2000. diff --git a/rpm-5.4.9/doc/gendiff.1 b/rpm-5.4.9/doc/gendiff.1 new file mode 100644 index 0000000..fd49943 --- /dev/null +++ b/rpm-5.4.9/doc/gendiff.1 @@ -0,0 +1,45 @@ +.TH GENDIFF 1 "Mon Jan 10 2000" +.UC 4 +.SH NAME +gendiff \- utility to aid in error-free diff file generation +.SH SYNOPSIS +\fBgendiff\fR +.SH DESCRIPTION +\fBgendiff\fR is a rather simple script which aids in generating a +diff file from a single directory. It takes a directory name and a +"diff-extension" as its only arguments. The diff extension should be +a unique sequence of characters added to the end of all original, +unmodified files. The output of the program is a diff file which may +be applied with the \fBpatch\fR program to recreate the changes. +.PP +The usual sequence of events for creating a diff is to create two +identical directories, make changes in one directory, and then use the +\fBdiff\fR utility to create a list of differences between the two. +Using gendiff eliminates the need for the extra, original and +unmodified directory copy. Instead, only the individual files that +are modified need to be saved. +.PP +Before editing a file, copy the file, appending the extension you have chosen +to the filename. I.e. if you were going to edit somefile.cpp and have chosen +the extension "fix", copy it to somefile.cpp.fix before editing it. +Then edit the first copy (somefile.cpp). +.PP +After editing all the files you need to edit in this fashion, enter the +directory one level above where your source code resides, and then type +.sp +.nf + $ gendiff somedirectory .fix > mydiff-fix.patch +.fi +.PP +You should redirect the output to a file (as illustrated) unless you want to +see the results on stdout. + +.PD +.SH "SEE ALSO" +.BR diff (1), +.BR patch (1) + +.SH AUTHOR +.nf +Marc Ewing +.fi diff --git a/rpm-5.4.9/doc/ja/Makefile.am b/rpm-5.4.9/doc/ja/Makefile.am new file mode 100644 index 0000000..39bc032 --- /dev/null +++ b/rpm-5.4.9/doc/ja/Makefile.am @@ -0,0 +1,21 @@ +## Process this file with automake to produce Makefile.in + +@SET_MAKE@ + +man_MANS = rpm.8 rpm2cpio.8 rpmbuild.8 rpmcache.8 rpmgraph.8 +mandir = @mandir@/ja + +EXTRA_DIST = $(man_MANS) + +install-data-hook: +if WITH_PATH_VERSIONED + -for p in $(man_MANS); do \ + case "$$p" in \ + *.1 ) mv $(DESTDIR)$(man1dir)/$${p} \ + `echo "$(DESTDIR)$(man1dir)/$${p}" | sed 's/\.1$$/-$(VERSION).1/'` ;; \ + *.8 ) mv $(DESTDIR)$(man8dir)/$${p} \ + `echo "$(DESTDIR)$(man8dir)/$${p}" | sed 's/\.8$$/-$(VERSION).8/'` ;; \ + esac; \ + done +endif + diff --git a/rpm-5.4.9/doc/ja/Makefile.in b/rpm-5.4.9/doc/ja/Makefile.in new file mode 100644 index 0000000..c6da015 --- /dev/null +++ b/rpm-5.4.9/doc/ja/Makefile.in @@ -0,0 +1,820 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +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@ +target_triplet = @target@ +subdir = doc/ja +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +man8dir = $(mandir)/man8 +am__installdirs = "$(DESTDIR)$(man8dir)" +NROFF = nroff +MANS = $(man_MANS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDROOTDIR_MACRO = @BUILDROOTDIR_MACRO@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBAPI = @DBAPI@ +DBLIBOBJS = @DBLIBOBJS@ +DBLIBSRCS = @DBLIBSRCS@ +DBPATH = @DBPATH@ +DBPATH_MACRO = @DBPATH_MACRO@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTRO_MACROS = @DISTRO_MACROS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIXPERMS = @FIXPERMS@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GPSEE_MODULES_PATH = @GPSEE_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_STATIC = @LDFLAGS_STATIC@ +LD_VERSION_SCRIPT_FLAG = @LD_VERSION_SCRIPT_FLAG@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOLIZE = @LIBTOOLIZE@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MACROFILES = @MACROFILES@ +MAGIC_MACRO = @MAGIC_MACRO@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR = @MKDIR@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NCPUS_COMMAND = @NCPUS_COMMAND@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENMP_CFLAGS = @OPENMP_CFLAGS@ +OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_INSTALLDIRS = @PERL_INSTALLDIRS@ +PERL_URPM_INSTALLDIRS = @PERL_URPM_INSTALLDIRS@ +PKGSRCDIR = @PKGSRCDIR@ +PKGSRCDIR_MACRO = @PKGSRCDIR_MACRO@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +ROOT_GROUP = @ROOT_GROUP@ +RPMCANONARCH = @RPMCANONARCH@ +RPMCANONCOLOR = @RPMCANONCOLOR@ +RPMCANONGNU = @RPMCANONGNU@ +RPMCANONOS = @RPMCANONOS@ +RPMCANONVENDOR = @RPMCANONVENDOR@ +RPMGID = @RPMGID@ +RPMGROUP = @RPMGROUP@ +RPMLUAFILES = @RPMLUAFILES@ +RPMPOPTFILES = @RPMPOPTFILES@ +RPMUID = @RPMUID@ +RPMUSER = @RPMUSER@ +RPM_TIMESTAMP = @RPM_TIMESTAMP@ +RPM_VENDOR = @RPM_VENDOR@ +RPM_VERSION = @RPM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFIGDIR = @SYSCONFIGDIR@ +USE_NLS = @USE_NLS@ +USRLIBRPM = @USRLIBRPM@ +VERSION = @VERSION@ +WITH_ACL = @WITH_ACL@ +WITH_APIDOCS = @WITH_APIDOCS@ +WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ +WITH_APR = @WITH_APR@ +WITH_ATERM = @WITH_ATERM@ +WITH_ATTR = @WITH_ATTR@ +WITH_AUGEAS = @WITH_AUGEAS@ +WITH_AUGEAS_AUGTOOL = @WITH_AUGEAS_AUGTOOL@ +WITH_BASH = @WITH_BASH@ +WITH_BASH_CPPFLAGS = @WITH_BASH_CPPFLAGS@ +WITH_BASH_LDFLAGS = @WITH_BASH_LDFLAGS@ +WITH_BASH_LIBS = @WITH_BASH_LIBS@ +WITH_BASH_SUBDIR = @WITH_BASH_SUBDIR@ +WITH_BEECRYPT = @WITH_BEECRYPT@ +WITH_BEECRYPT_CPPFLAGS = @WITH_BEECRYPT_CPPFLAGS@ +WITH_BEECRYPT_LDFLAGS = @WITH_BEECRYPT_LDFLAGS@ +WITH_BEECRYPT_LIBS = @WITH_BEECRYPT_LIBS@ +WITH_BEECRYPT_SUBDIR = @WITH_BEECRYPT_SUBDIR@ +WITH_BZIP2 = @WITH_BZIP2@ +WITH_CPUINFO = @WITH_CPUINFO@ +WITH_CUDF = @WITH_CUDF@ +WITH_CUDF_CUDFTOOL = @WITH_CUDF_CUDFTOOL@ +WITH_DB = @WITH_DB@ +WITH_DBSQL = @WITH_DBSQL@ +WITH_DBSQL_CPPFLAGS = @WITH_DBSQL_CPPFLAGS@ +WITH_DBSQL_LDFLAGS = @WITH_DBSQL_LDFLAGS@ +WITH_DBSQL_LIBS = @WITH_DBSQL_LIBS@ +WITH_DBSQL_SUBDIR = @WITH_DBSQL_SUBDIR@ +WITH_DB_CPPFLAGS = @WITH_DB_CPPFLAGS@ +WITH_DB_LDFLAGS = @WITH_DB_LDFLAGS@ +WITH_DB_LIBS = @WITH_DB_LIBS@ +WITH_DB_SUBDIR = @WITH_DB_SUBDIR@ +WITH_DMALLOC = @WITH_DMALLOC@ +WITH_EFENCE = @WITH_EFENCE@ +WITH_EXPAT = @WITH_EXPAT@ +WITH_FICL = @WITH_FICL@ +WITH_FICL_CPPFLAGS = @WITH_FICL_CPPFLAGS@ +WITH_FICL_LDFLAGS = @WITH_FICL_LDFLAGS@ +WITH_FICL_LIBS = @WITH_FICL_LIBS@ +WITH_FICL_SUBDIR = @WITH_FICL_SUBDIR@ +WITH_FILE = @WITH_FILE@ +WITH_FILE_CPPFLAGS = @WITH_FILE_CPPFLAGS@ +WITH_FILE_LDFLAGS = @WITH_FILE_LDFLAGS@ +WITH_FILE_LIBS = @WITH_FILE_LIBS@ +WITH_FILE_SUBDIR = @WITH_FILE_SUBDIR@ +WITH_GCRYPT = @WITH_GCRYPT@ +WITH_GNUTLS = @WITH_GNUTLS@ +WITH_GPSEE = @WITH_GPSEE@ +WITH_GPSEE_CPPFLAGS = @WITH_GPSEE_CPPFLAGS@ +WITH_GPSEE_LDFLAGS = @WITH_GPSEE_LDFLAGS@ +WITH_GPSEE_LIBS = @WITH_GPSEE_LIBS@ +WITH_GPSEE_SUBDIR = @WITH_GPSEE_SUBDIR@ +WITH_JS_SUBDIR = @WITH_JS_SUBDIR@ +WITH_KEYUTILS = @WITH_KEYUTILS@ +WITH_KEYUTILS_RPMKEY = @WITH_KEYUTILS_RPMKEY@ +WITH_LIBELF_DEBUGEDIT = @WITH_LIBELF_DEBUGEDIT@ +WITH_LIBGIT2 = @WITH_LIBGIT2@ +WITH_LIBGIT2_CPPFLAGS = @WITH_LIBGIT2_CPPFLAGS@ +WITH_LIBGIT2_LDFLAGS = @WITH_LIBGIT2_LDFLAGS@ +WITH_LIBGIT2_LIBS = @WITH_LIBGIT2_LIBS@ +WITH_LIBGIT2_SUBDIR = @WITH_LIBGIT2_SUBDIR@ +WITH_LIBTASN1 = @WITH_LIBTASN1@ +WITH_LUA = @WITH_LUA@ +WITH_LUA_CPPFLAGS = @WITH_LUA_CPPFLAGS@ +WITH_LUA_LDFLAGS = @WITH_LUA_LDFLAGS@ +WITH_LUA_LIBS = @WITH_LUA_LIBS@ +WITH_LUA_SUBDIR = @WITH_LUA_SUBDIR@ +WITH_LUA_SUBDIR_DEF = @WITH_LUA_SUBDIR_DEF@ +WITH_LUA_SUBDIR_LIB = @WITH_LUA_SUBDIR_LIB@ +WITH_MOZJS185 = @WITH_MOZJS185@ +WITH_MOZJS185_CPPFLAGS = @WITH_MOZJS185_CPPFLAGS@ +WITH_MOZJS185_LDFLAGS = @WITH_MOZJS185_LDFLAGS@ +WITH_MOZJS185_LIBS = @WITH_MOZJS185_LIBS@ +WITH_MOZJS185_SUBDIR = @WITH_MOZJS185_SUBDIR@ +WITH_NEON = @WITH_NEON@ +WITH_NEON_CPPFLAGS = @WITH_NEON_CPPFLAGS@ +WITH_NEON_LDFLAGS = @WITH_NEON_LDFLAGS@ +WITH_NEON_LIBS = @WITH_NEON_LIBS@ +WITH_NEON_SUBDIR = @WITH_NEON_SUBDIR@ +WITH_NIX = @WITH_NIX@ +WITH_NSS = @WITH_NSS@ +WITH_OPENSSL = @WITH_OPENSSL@ +WITH_PAKCHOIS = @WITH_PAKCHOIS@ +WITH_PATH_VERSIONED = @WITH_PATH_VERSIONED@ +WITH_PATH_VERSIONED_SUFFIX = @WITH_PATH_VERSIONED_SUFFIX@ +WITH_PCRE = @WITH_PCRE@ +WITH_PCRE_CPPFLAGS = @WITH_PCRE_CPPFLAGS@ +WITH_PCRE_LDFLAGS = @WITH_PCRE_LDFLAGS@ +WITH_PCRE_LIBS = @WITH_PCRE_LIBS@ +WITH_PCRE_SUBDIR = @WITH_PCRE_SUBDIR@ +WITH_PERLEMBED = @WITH_PERLEMBED@ +WITH_PERL_LIBS = @WITH_PERL_LIBS@ +WITH_PERL_SUBDIR = @WITH_PERL_SUBDIR@ +WITH_PERL_SUBPACKAGE = @WITH_PERL_SUBPACKAGE@ +WITH_PERL_URPM_LIBS = @WITH_PERL_URPM_LIBS@ +WITH_PERL_URPM_SUBDIR = @WITH_PERL_URPM_SUBDIR@ +WITH_PERL_URPM_SUBPACKAGE = @WITH_PERL_URPM_SUBPACKAGE@ +WITH_POPT = @WITH_POPT@ +WITH_POPT_CPPFLAGS = @WITH_POPT_CPPFLAGS@ +WITH_POPT_LDFLAGS = @WITH_POPT_LDFLAGS@ +WITH_POPT_LIBS = @WITH_POPT_LIBS@ +WITH_POPT_SUBDIR = @WITH_POPT_SUBDIR@ +WITH_PYTHONEMBED = @WITH_PYTHONEMBED@ +WITH_PYTHON_INCDIR = @WITH_PYTHON_INCDIR@ +WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ +WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ +WITH_RC = @WITH_RC@ +WITH_RC_CPPFLAGS = @WITH_RC_CPPFLAGS@ +WITH_RC_LDFLAGS = @WITH_RC_LDFLAGS@ +WITH_RC_LIBS = @WITH_RC_LIBS@ +WITH_RC_SUBDIR = @WITH_RC_SUBDIR@ +WITH_READLINE = @WITH_READLINE@ +WITH_RUBY = @WITH_RUBY@ +WITH_RUBY_CPPFLAGS = @WITH_RUBY_CPPFLAGS@ +WITH_RUBY_SUBDIR = @WITH_RUBY_SUBDIR@ +WITH_RUBY_VENDORARCHDIR = @WITH_RUBY_VENDORARCHDIR@ +WITH_SELINUX = @WITH_SELINUX@ +WITH_SEMANAGE = @WITH_SEMANAGE@ +WITH_SEMANAGE_SEMODULE = @WITH_SEMANAGE_SEMODULE@ +WITH_SEPOL = @WITH_SEPOL@ +WITH_SPIDERMONKEY_SUBDIR = @WITH_SPIDERMONKEY_SUBDIR@ +WITH_SQLITE = @WITH_SQLITE@ +WITH_SQLITE_CPPFLAGS = @WITH_SQLITE_CPPFLAGS@ +WITH_SQLITE_LDFLAGS = @WITH_SQLITE_LDFLAGS@ +WITH_SQLITE_LIBS = @WITH_SQLITE_LIBS@ +WITH_SQLITE_SUBDIR = @WITH_SQLITE_SUBDIR@ +WITH_SQUIRREL = @WITH_SQUIRREL@ +WITH_SUBVERSION = @WITH_SUBVERSION@ +WITH_SYCK = @WITH_SYCK@ +WITH_SYCK_CPPFLAGS = @WITH_SYCK_CPPFLAGS@ +WITH_SYCK_LDFLAGS = @WITH_SYCK_LDFLAGS@ +WITH_SYCK_LIBS = @WITH_SYCK_LIBS@ +WITH_SYCK_SUBDIR = @WITH_SYCK_SUBDIR@ +WITH_TCL = @WITH_TCL@ +WITH_TCL_SUBDIR = @WITH_TCL_SUBDIR@ +WITH_TOMCRYPT = @WITH_TOMCRYPT@ +WITH_TPM = @WITH_TPM@ +WITH_UNIXODBC = @WITH_UNIXODBC@ +WITH_UUID = @WITH_UUID@ +WITH_XAR = @WITH_XAR@ +WITH_XAR_CPPFLAGS = @WITH_XAR_CPPFLAGS@ +WITH_XAR_LDFLAGS = @WITH_XAR_LDFLAGS@ +WITH_XAR_LIBS = @WITH_XAR_LIBS@ +WITH_XAR_SUBDIR = @WITH_XAR_SUBDIR@ +WITH_XZ = @WITH_XZ@ +WITH_XZ_CPPFLAGS = @WITH_XZ_CPPFLAGS@ +WITH_XZ_LDFLAGS = @WITH_XZ_LDFLAGS@ +WITH_XZ_LIBS = @WITH_XZ_LIBS@ +WITH_XZ_SUBDIR = @WITH_XZ_SUBDIR@ +WITH_ZLIB = @WITH_ZLIB@ +WITH_ZLIB_CPPFLAGS = @WITH_ZLIB_CPPFLAGS@ +WITH_ZLIB_LDFLAGS = @WITH_ZLIB_LDFLAGS@ +WITH_ZLIB_LIBS = @WITH_ZLIB_LIBS@ +WITH_ZLIB_SUBDIR = @WITH_ZLIB_SUBDIR@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__BASH = @__BASH@ +__BZIP2 = @__BZIP2@ +__CAT = @__CAT@ +__CHATTR = @__CHATTR@ +__CHGRP = @__CHGRP@ +__CHGRP_RHF = @__CHGRP_RHF@ +__CHMOD = @__CHMOD@ +__CHOWN = @__CHOWN@ +__CHOWN_RHF = @__CHOWN_RHF@ +__CMAKE = @__CMAKE@ +__CPIO = @__CPIO@ +__CURL = @__CURL@ +__CVS = @__CVS@ +__DBSQL = @__DBSQL@ +__DB_ARCHIVE = @__DB_ARCHIVE@ +__DB_CHECKPOINT = @__DB_CHECKPOINT@ +__DB_DEADLOCK = @__DB_DEADLOCK@ +__DB_DUMP = @__DB_DUMP@ +__DB_HOTBACKUP = @__DB_HOTBACKUP@ +__DB_LOAD = @__DB_LOAD@ +__DB_LOG_VERIFY = @__DB_LOG_VERIFY@ +__DB_PRINTLOG = @__DB_PRINTLOG@ +__DB_RECOVER = @__DB_RECOVER@ +__DB_REPLICATE = @__DB_REPLICATE@ +__DB_SQL_CODEGEN = @__DB_SQL_CODEGEN@ +__DB_STAT = @__DB_STAT@ +__DB_TUNER = @__DB_TUNER@ +__DB_UPGRADE = @__DB_UPGRADE@ +__DB_VERIFY = @__DB_VERIFY@ +__DIFF = @__DIFF@ +__DITTO = @__DITTO@ +__DOXYGEN = @__DOXYGEN@ +__FILE = @__FILE@ +__GIT = @__GIT@ +__GPG = @__GPG@ +__GSR = @__GSR@ +__GST_INSPECT = @__GST_INSPECT@ +__GZIP = @__GZIP@ +__HG = @__HG@ +__ID = @__ID@ +__ID_U = @__ID_U@ +__INSTALL = @__INSTALL@ +__INSTALL_INFO = @__INSTALL_INFO@ +__LD = @__LD@ +__LDCONFIG = @__LDCONFIG@ +__LN = @__LN@ +__LRZIP = @__LRZIP@ +__LSATTR = @__LSATTR@ +__LZIP = @__LZIP@ +__LZMA = @__LZMA@ +__LZOP = @__LZOP@ +__MAKE = @__MAKE@ +__MKDIR = @__MKDIR@ +__MKDIR_P = @__MKDIR_P@ +__MODINFO = @__MODINFO@ +__MONGO = @__MONGO@ +__MV = @__MV@ +__NM = @__NM@ +__OBJCOPY = @__OBJCOPY@ +__OBJDUMP = @__OBJDUMP@ +__PATCH = @__PATCH@ +__PAX = @__PAX@ +__PERL = @__PERL@ +__PGP = @__PGP@ +__PHP = @__PHP@ +__PYTHON = @__PYTHON@ +__RM = @__RM@ +__RMDIR = @__RMDIR@ +__RSH = @__RSH@ +__RUBY = @__RUBY@ +__SED = @__SED@ +__SH = @__SH@ +__SQLITE3 = @__SQLITE3@ +__SSH = @__SSH@ +__STRIP = @__STRIP@ +__SVN = @__SVN@ +__TAR = @__TAR@ +__TCLSH = @__TCLSH@ +__UNZIP = @__UNZIP@ +__XZ = @__XZ@ +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_CXX = @ac_ct_CXX@ +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@ +autorelocate_dcolor = @autorelocate_dcolor@ +autorelocate_path = @autorelocate_path@ +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@ +exeext = @exeext@ +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@ +libext = @libext@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@/ja +mkdir_p = @mkdir_p@ +objext = @objext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +shlibext = @shlibext@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +testdir = @testdir@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrprefix = @usrprefix@ +varprefix = @varprefix@ +man_MANS = rpm.8 rpm2cpio.8 rpmbuild.8 rpmcache.8 rpmgraph.8 +EXTRA_DIST = $(man_MANS) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 doc/ja/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign doc/ja/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man8: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(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='$(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) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically \`make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi + @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 $(MANS) +installdirs: + for dir in "$(DESTDIR)$(man8dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-man + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +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-man8 + +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-man + +uninstall-man: uninstall-man8 + +.MAKE: install-am install-data-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + 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-hook install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man8 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 uninstall uninstall-am uninstall-man uninstall-man8 + + +@SET_MAKE@ + +install-data-hook: +@WITH_PATH_VERSIONED_TRUE@ -for p in $(man_MANS); do \ +@WITH_PATH_VERSIONED_TRUE@ case "$$p" in \ +@WITH_PATH_VERSIONED_TRUE@ *.1 ) mv $(DESTDIR)$(man1dir)/$${p} \ +@WITH_PATH_VERSIONED_TRUE@ `echo "$(DESTDIR)$(man1dir)/$${p}" | sed 's/\.1$$/-$(VERSION).1/'` ;; \ +@WITH_PATH_VERSIONED_TRUE@ *.8 ) mv $(DESTDIR)$(man8dir)/$${p} \ +@WITH_PATH_VERSIONED_TRUE@ `echo "$(DESTDIR)$(man8dir)/$${p}" | sed 's/\.8$$/-$(VERSION).8/'` ;; \ +@WITH_PATH_VERSIONED_TRUE@ esac; \ +@WITH_PATH_VERSIONED_TRUE@ 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/rpm-5.4.9/doc/ja/rpm.8 b/rpm-5.4.9/doc/ja/rpm.8 new file mode 100644 index 0000000..4bbc243 --- /dev/null +++ b/rpm-5.4.9/doc/ja/rpm.8 @@ -0,0 +1,1232 @@ +.\" This manpage has been automatically generated by docbook2man +.\" from a DocBook document. This tool can be found at: +.\" +.\" Please send any bug reports, improvements, comments, patches, +.\" etc. to Steve Cheng . +.\" +.\" This program is free software; you can redistribute it and/or modify +.\" it under the terms of the GNU General Public License as published by +.\" the Free Software Foundation; either version 2, or (at your option) +.\" any later version. +.\" +.\" This program is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with this program; if not, write to the Free Software +.\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +.\" USA. +.\" +.\" Japanese Version Copyright (C) 2003 System Design and Research +.\" Institute Co.,Ltd. All rights reserved. +.\" +.\" Translated 14 March 2003 by +.\" System Design and Research Institute Co.,Ltd. +.\" +.\"WORD: verify 検査 +.\"WORD: upgrade アップグレード +.\"WORD: freshen æ›´æ–° +.\"WORD: resign å†ç½²å +.\"WORD: querytag 検索タグ +.\"WORD: relocation å†é…ç½® +.\"WORD: format string 書å¼æ–‡å­—列 +.\"WORD: identifier è­˜åˆ¥å­ +.\"WORD: glob expression パスåå±•é–‹å¼ +.\"WORD: capability 能力 +.\"WORD: key ring éµãƒªãƒ³ã‚° +.\"WORD: firewall ファイアウォール +.\"subsubsction start +.de SSS +.SS " \\$1" +.RS 0.5i +.. +.TH "RPM" "8" "09 June 2002" "Red Hat, Inc." "Red Hat Linux" +.SH åå‰ +rpm \- RPM パッケージマãƒãƒ¼ã‚¸ãƒ£ +.SH æ›¸å¼ +.SS パッケージã®æ¤œç´¢ã¨æ¤œæŸ»: +.BR rpm " {" \-q|\-\-query "} [" select-options "] [" query-options ] + +.BR rpm " {" \-V|\-\-verify "} [" select-options "] [" verify-options ] + +.BI "rpm \-\-import " "PUBKEY ..." + +.BR rpm " {" \-K|\-\-checksig "} [" \-\-nogpg "] [" \-\-nopgp "] [" \-\-nomd5 "]" +.br +.I " PACKAGE_FILE" ... +.SS パッケージã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ãƒ»ã‚¢ãƒƒãƒ—グレード・削除: +.BR rpm " {" \-i|\-\-install "} [" install-options ] +.I PACKAGE_FILE ... + +.BR rpm " {" \-U|\-\-upgrade "} [" install-options ] +.I PACKAGE_FILE ... + +.BR rpm " {" \-F|\-\-freshen "} [" install-options ] +.I PACKAGE_FILE ... + +.BR rpm " {" \-e|\-\-erase "} [" \-\-allmatches "] [" \-\-nodeps "] [" \-\-noscripts ] +.br +.RB " [" \-\-notriggers "] [" \-\-repackage "] [" \-\-test ] +.I PACKAGE_NAME ... +.SS ãã®ä»–: +.BR rpm " {" \-\-initdb|\-\-rebuilddb } + +.BR rpm " {" \-\-addsign|\-\-resign } +.I PACKAGE_FILE ... + +.BR rpm " {" \-\-querytags|\-\-showrc } + +.BR rpm " {" \-\-setperms|\-\-setugids } +.I PACKAGE_NAME ... +.SS select-options(é¸æŠžã‚ªãƒ—ション) +.RI [ PACKAGE_NAME ] +.RB [ \-a , \-\-all ] +.RB [ \-f , \-\-file " " "\fIFILE" ] +.br +.RB [ \-g , \-\-group " " "\fIGROUP" ] +.RB [ \-p , \-\-package " " "\fIPACKAGE_FILE" ] +.br +.RB [ \-\-fileid " " "\fIMD5" ] +.RB [ \-\-hdrid " " "\fISHA1" ] +.RB [ \-\-pkgid " " "\fIMD5" ] +.RB [ \-\-tid " " "\fITID" ] +.br +.RB [ \-\-querybynumber " " "\fIHDRNUM" ] +.RB [ \-\-triggerdby " " "\fIPACKAGE_NAME" ] +.br +.RB [ \-\-whatprovies " " "\fICAPABILITY" ] +.RB [ \-\-whatrequires " " "\fICAPABILITY" ] +.SS query-options(検索オプション) +.RB [ \-\-changelog ] +.RB [ \-c , \-\-configfiles ] +.RB [ \-d , \-\-docfiles ] +.RB [ \-\-dump ] +.br +.RB [ \-\-filesbypkg ] +.RB [ \-i , \-\-info ] +.RB [ \-\-last ] +.RB [ \-l , \-\-list ] +.br +.RB [ \-\-provides ] +.RB [ \-\-qf , \-\-queryformat " " "\fIQUERYFMT" ] +.RB [ \-R , \-\-requires ] +.br +.RB [ \-\-scripts ] +.RB [ \-s , \-\-state ] +.RB [ \-\-triggers , \-\-triggerscripts ] +.SS verify-options(検査オプション) +.RB [ \-\-nodeps ] +.RB [ \-\-nofiles ] +.RB [ \-\-noscripts ] +.RB [ \-\-nodigest ] +.br +.RB [ \-\-nosignature ] +.RB [ \-\-nolinkto ] +.RB [ \-\-nomd5 ] +.RB [ \-\-nosize ] +.br +.RB [ \-\-nouser ] +.RB [ \-\-nogroup ] +.RB [ \-\-nomtime ] +.RB [ \-\-nomode ] +.RB [ \-\-nordev ] +.SS install-options(インストールオプション) +.RB [ \-\-aid ] +.RB [ \-\-allfiles ] +.RB [ \-\-badreloc ] +.RB [ \-\-excludepath " " "\fIOLDPATH" ] +.br +.RB [ \-\-excludedocs ] +.RB [ \-\-force ] +.RB [ \-h , \-\-hash ] +.RB [ \-\-ignoresize ] +.br +.RB [ \-\-ignorearch ] +.RB [ \-\-ignoreos ] +.RB [ \-\-includedocs ] +.RB [ \-\-justdb ] +.br +.RB [ \-\-nodeps ] +.RB [ \-\-nodigest ] +.RB [ \-\-nosignature ] +.RB [ \-\-nosuggest ] +.br +.RB [ \-\-noorder ] +.RB [ \-\-noscripts ] +.RB [ \-\-notriggers ] +.br +.RB [ \-\-oldpackage ] +.RB [ \-\-percent ] +.RB [ \-\-prefix " " "\fINEWPATH" ] +.br +.RB [ \-\-relocate " " "\fIOLDPATH" = "\fINEWPATH" ] +.RB [ \-\-repackage ] +.br +.RB [ \-\-replacefiles ] +.RB [ \-\-replacepkgs ] +.RB [ \-\-test ] +.SH 説明 +.B rpm +ã¯å¼·åŠ›ãª +.B パッケージマãƒãƒ¼ã‚¸ãƒ£ +ã§ã‚ã‚Šã€å€‹ã€…ã®ã‚½ãƒ•ãƒˆã‚¦ã‚§ã‚¢ãƒ‘ッケージを +ビルド・インストール・検索・検査・更新・削除ã™ã‚‹ã®ã«ä½¿ã†ã“ã¨ãŒã§ãる。 +.B パッケージ +ã¯ãƒ•ã‚¡ã‚¤ãƒ«ã®ã‚¢ãƒ¼ã‚«ã‚¤ãƒ–ã¨ã€ã‚¢ãƒ¼ã‚«ã‚¤ãƒ–ã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã® +インストール・アンインストールã«ä½¿ã‚れるメタデータã‹ã‚‰ãªã‚‹ã€‚ +メタデータã¯è£œåŠ©ã‚¹ã‚¯ãƒªãƒ—トã€ãƒ•ã‚¡ã‚¤ãƒ«å±žæ€§ã€ +ãã—ã¦ãƒ‘ッケージã®èª¬æ˜Žã«é–¢ã™ã‚‹æƒ…å ±ã‹ã‚‰ãªã‚‹ã€‚ +.B パッケージ +ã«ã¯ 2 種類ã‚る。 +インストールã™ã‚‹ãŸã‚ã®ã‚½ãƒ•ãƒˆã‚¦ã‚§ã‚¢ã‚’カプセル化ã™ã‚‹ã®ã«ä½¿ã‚れるãƒã‚¤ãƒŠãƒª +パッケージã¨ã€ãƒã‚¤ãƒŠãƒªãƒ‘ッケージを生æˆã™ã‚‹ã®ã«å¿…è¦ãªãƒ¬ã‚·ãƒ”ã¨ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ +ã‹ã‚‰ãªã‚‹ã‚½ãƒ¼ã‚¹ãƒ‘ッケージã§ã‚る。 +.PP +以下ã®åŸºæœ¬ãƒ¢ãƒ¼ãƒ‰ã®ã„ãšã‚Œã‹ãŒé¸æŠžã•ã‚Œãªã‘ã‚Œã°ãªã‚‰ãªã„: +\fB検索\fR〠+\fB検査\fR〠+\fBç½²åã®æ¤œæŸ»\fR〠+\fBインストール/アップグレード/æ›´æ–°\fR〠+\fBアンインストール\fR〠+\fBデータベースã®åˆæœŸåŒ–\fR〠+\fBデータベースã®å†ä½œæˆ\fR〠+\fBå†ç½²å\fR〠+\fBç½²åã®è¿½åŠ \fR〠+\fB所有者/グループã®è¨­å®š\fR〠+\fB検索タグã®è¡¨ç¤º\fR〠+\fB設定ã®è¡¨ç¤º\fR。 +.SS 共通ã®ã‚ªãƒ—ション +次ã®ã‚ªãƒ—ションã¯ã™ã¹ã¦ã®ãƒ¢ãƒ¼ãƒ‰ã§ä½¿ç”¨ã™ã‚‹ã“ã¨ãŒã§ãる。 +.TP +.BR \-? ", " \-\-help +使ã„方を通常ã®ã‚‚ã®ã‚ˆã‚Šã‚‚é•·ã表示ã™ã‚‹ã€‚ +.TP +.B \-\-version +使用ã•ã‚Œã‚‹ +.B rpm +ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ç•ªå·ã‹ã‚‰ãªã‚‹ 1 行を表示ã™ã‚‹ã€‚ +.TP +.B \-\-quiet +ã§ãã‚‹ã ã‘å°‘ãªã表示ã™ã‚‹ã€‚ +通常ã¯ã€ã‚¨ãƒ©ãƒ¼ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã ã‘ãŒè¡¨ç¤ºã•ã‚Œã‚‹ã€‚ +.TP +.B \-v +より多ãã®æƒ…報を表示ã™ã‚‹ã€‚ +通常ã¯ã€ãƒ«ãƒ¼ãƒãƒ³ã®é€²æ—メッセージãŒè¡¨ç¤ºã•ã‚Œã‚‹ã€‚ +.TP +.B \-vv +沢山ã®æ±šã„デãƒãƒƒã‚°æƒ…報を表示ã™ã‚‹ã€‚ +.TP +.BI "\-\-rcfile " FILELIST +コロン(`:')ã§åŒºåˆ‡ã‚‰ã‚ŒãŸ +.I FILELIST +ã®å„ファイルã¯ã€è¨­å®šæƒ…å ±ã¨ã—㦠+.B rpm +ã«ã‚ˆã£ã¦é †ç•ªã«èª­ã¿è¾¼ã¾ã‚Œã‚‹ã€‚ +.I FILELIST +ã®ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã¯ +.IR /usr/lib/rpm/rpmrc : /usr/lib/rpm/redhat/rpmrc : ~/.rpmrc +ã§ã‚る。 +.TP +.BI "\-\-pipe " CMD +.B rpm +コマンドã®å‡ºåŠ›ã‚’ +.I CMD +ã¸ãƒ‘イプã™ã‚‹ã€‚ +.TP +.BI "\-\-dbpath " DIRECTORY +データベースã®ãƒ‘スã«ã€ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã® +.I /var/lib/rpm +ã§ã¯ãªã +.I DIRECTORY +を使ã†ã€‚ +.TP +.BI "\-\-root " DIRECTORY +ã™ã¹ã¦ã®ã‚ªãƒ—ションã«å¯¾ã—〠+.I DIRECTORY +をルートã¨ã—ãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚·ã‚¹ãƒ†ãƒ ã‚’使ã†ã€‚ +ã“ã‚Œã¯ã€ +ä¾å­˜æ€§ã®ãƒã‚§ãƒƒã‚¯ã¨ã™ã¹ã¦ã®ã‚¹ã‚¯ãƒªãƒ—ト(群) +(例ãˆã°ã€ãƒ‘ッケージインストール時㮠+.B %post +ã‚„ã€ãƒ‘ッケージビルド時㮠+.B %prep +ãªã©)㌠+.I DIRECTORY +ã« chroot(2) ã—ãŸå¾Œã§ã€ +.I DIRECTORY +内ã«ã‚るデータベースãŒä½¿ç”¨ã•ã‚Œã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ã€‚ +.SS インストールã¨ã‚¢ãƒƒãƒ—グレードã®ã‚ªãƒ—ション +rpm をインストールã™ã‚‹ã‚³ãƒžãƒ³ãƒ‰ã®ä¸€èˆ¬çš„ãªå½¢å¼ã¯: +.PP +.BR rpm " {" \-i|\-\-install "} [" install-options ] +.I PACKAGE_FILE ... +.PP +ã“ã‚Œã¯æ–°ã—ã„パッケージをインストールã™ã‚‹ã€‚ +.br +アップグレードã™ã‚‹ã‚³ãƒžãƒ³ãƒ‰ã®ä¸€èˆ¬çš„ãªå½¢å¼ã¯: +.PP +.BR rpm " {" \-U|\-\-upgrade "} [" install-options ] +.I PACKAGE_FILE ... +.PP +ã“ã‚Œã¯ç¾åœ¨ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚Œã¦ã„るパッケージを新ã—ã„ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã« +アップグレードã™ã‚‹ã‹ã€ãƒ‘ッケージをインストールã™ã‚‹ã€‚ +æ–°ã—ã„パッケージãŒã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚ŒãŸã‚‰ä»–ã®ã™ã¹ã¦ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã®ã‚‚ã®ãŒ +削除ã•ã‚Œã‚‹ã“ã¨ã‚’除ã‘ã°ã€ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã¨åŒã˜ã§ã‚る。 +.PP +.BR rpm " {" \-F|\-\-freshen "} [" install-options ] +.I PACKAGE_FILE ... +.PP +ã“ã‚Œã¯ä»¥å‰ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ãŒã€ç¾åœ¨ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚Œã¦ã„ã‚‹å ´åˆã«ã®ã¿ +パッケージを更新ã™ã‚‹ã€‚ +.PP +.I PACKAGE_FILE +ã«ã¯ +.B ftp +ã¾ãŸã¯ +.B http +ã® URL を指定ã™ã‚‹ã“ã¨ãŒå¯èƒ½ã§ã€ãã®å ´åˆã«ã¯ãƒ‘ッケージをインストールã™ã‚‹å‰ã« +ダウンロードã™ã‚‹ã€‚ +.B rpm +内部ã§ã® +.B ftp +㨠+.B http +ã®ã‚µãƒãƒ¼ãƒˆã«ã¤ã„ã¦ã®æƒ…報㯠+.B FTP/HTTP オプション +ã®ç¯€ã‚’å‚ç…§ã®ã“ã¨ã€‚ +.TP +.B \-\-aid +指定ã•ã‚ŒãŸãƒ‘ッケージをã€å¿…è¦ãŒã‚ã‚Œã°ãƒˆãƒ©ãƒ³ã‚¶ãƒ³ã‚¯ã‚·ãƒ§ãƒ³ã«åŠ ãˆã‚‹ã€‚ +.TP +\fB\-\-allfiles +パッケージ内㮠missingok ファイルをã€å­˜åœ¨ã™ã‚‹/ã—ãªã„ã«ã‹ã‹ã‚ら㚠+インストールã¾ãŸã¯ã‚¢ãƒƒãƒ—グレードã™ã‚‹ã€‚ +.TP +.B \-\-badreloc +.B \-\-relocate +ã¨ä¸€ç·’ã«ä½¿ã‚れるã¨ã€ãƒ‘ッケージå†é…ç½®ã®ãƒ’ント(群)ã®ä¸­ã«ãã® +.I OLDPATH +ãŒå«ã¾ã‚Œã¦ã„ãªãã¦ã‚‚ã€ã™ã¹ã¦ã®ãƒ•ã‚¡ã‚¤ãƒ«ãƒ‘スã®å†é…置を許å¯ã™ã‚‹ã€‚ +.TP +.BI "\-\-excludepath " OLDPATH +パスã®åå‰ãŒ +.I OLDPATH +ã§å§‹ã¾ã‚‹ãƒ•ã‚¡ã‚¤ãƒ«ã‚’インストールã—ãªã„。 +.TP +.B \-\-excludedocs +(man ページã€tenxinfo 文書をå«ã‚ãŸ)文書ã§ã‚ã‚‹ã¨ãƒžãƒ¼ã‚¯ä»˜ã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’ +インストールã—ãªã„。 +.TP +.B \-\-force +.BR \-\-replacepkgs ", " \-\-replacefiles ", " \-\-oldpackage +ã®çµ„ã¿åˆã‚ã›ã«åŒã˜ã€‚ +.TP +.BR \-h ", " \-\-hash +パッケージアーカイブã‹ã‚‰å–り出ã•ã‚Œã‚‹ã«ã¤ã‚Œã€50個ã®ãƒãƒƒã‚·ãƒ¥ãƒžãƒ¼ã‚¯("#") +を表示ã™ã‚‹ã€‚ +.B \-v|\-\-verbose +ã¨ä¸€ç·’ã«ä½¿ãˆã°ã€ã‚ˆã‚Šã‚ˆã„表示ãŒå¾—られる。 +.TP +.B \-\-ignoresize +パッケージをインストールã™ã‚‹å‰ã«ã€ãƒ‡ã‚£ã‚¹ã‚¯ã«å分ãªç©ºããŒã‚ã‚‹ã‹ã® +ãƒã‚§ãƒƒã‚¯ã‚’ファイルシステムã«å¯¾ã—ã¦è¡Œã‚ãªã„。 +.TP +.B \-\-ignorearch +ãƒã‚¤ãƒŠãƒªãƒ‘ッケージã®ã‚¢ãƒ¼ã‚­ãƒ†ã‚¯ãƒãƒ£ã¨ã€ãã®ãƒ›ã‚¹ãƒˆã®ã‚¢ãƒ¼ã‚­ãƒ†ã‚¯ãƒãƒ£ãŒ +一致ã—ãªãã¦ã‚‚ã€ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã‚„アップグレードを行ã†ã€‚ +.TP +.B \-\-ignoreos +ãƒã‚¤ãƒŠãƒªãƒ‘ッケージã®OSã¨ã€ãã®ãƒ›ã‚¹ãƒˆã®OSãŒä¸€è‡´ã—ãªãã¦ã‚‚〠+インストールやアップグレードを行ã†ã€‚ +.TP +.B \-\-includedocs +文書ファイルをインストールã™ã‚‹ã€‚ã“ã‚Œã¯ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®å‹•ä½œã§ã‚る。 +.TP +.B \-\-justdb +データベースã ã‘ã‚’æ›´æ–°ã—ã€ãƒ•ã‚¡ã‚¤ãƒ«ã‚·ã‚¹ãƒ†ãƒ ã‚’æ›´æ–°ã—ãªã„。 +.TP +.B \-\-nodigest +読ã¿è¾¼ã¿æ™‚ã«ãƒ‘ッケージã¾ãŸã¯ã¸ãƒƒãƒ€ã®ãƒ€ã‚¤ã‚¸ã‚§ã‚¹ãƒˆã‚’検査ã—ãªã„。 +.TP +.B \-\-nosignature +読ã¿è¾¼ã¿æ™‚ã«ãƒ‘ッケージã¾ãŸã¯ã¸ãƒƒãƒ€ã®ç½²åを検査ã—ãªã„。 +.TP +.B \-\-nodeps +パッケージã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã‚„アップグレードã®å‰ã«ã€ä¾å­˜æ€§ã®ãƒã‚§ãƒƒã‚¯ã‚’ã—ãªã„。 +.TP +.B \-\-nosuggest +ä¸æ˜Žãªä¾å­˜æ€§ã‚’解消ã™ã‚‹ãƒ‘ッケージ(群)ã‚’æ案ã—ãªã„。 +.TP +.B \-\-noorder +パッケージã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«é †ã‚’変更ã—ãªã„。 +通常ã¯ä¾å­˜æ€§ã‚’満ãŸã™ãŸã‚ã«ã€ãƒ‘ッケージã®ãƒªã‚¹ãƒˆã¯ä¸¦ã³æ›¿ãˆã‚‰ã‚Œã‚‹ã€‚ +.TP +.B \-\-noscriopts +.PD 0 +.TP +.B \-\-nopre +.TP +.B \-\-nopost +.TP +.B \-\-nopreun +.TP +.B \-\-nopostun +.PD +ãã‚Œãžã‚ŒåŒã˜åå‰ã‚’æŒã£ãŸã‚¹ã‚¯ãƒªãƒ—トを実行ã—ãªã„。 +.B \-\-noscripts +オプション㯠+ +.B "\-\-nopre \-\-nopost \-\-nopreun \-\-nopostun" + +ã«ç­‰ã—ãã€å¯¾å¿œã™ã‚‹ +.BR %pre ", " +.BR %post ", " +.BR %preun ", " +.BR %postun +スクリプト(群)を実行ã—ãªã„。 +.TP +.B \-\-notriggers +.PD 0 +.TP +.B \-\-notriggerin +.TP +.B \-\-notriggerun +.TP +.B \-\-notriggerpostun +.PD +指定ã•ã‚ŒãŸç¨®é¡žã®ãƒˆãƒªã‚¬ãƒ¼ã‚¹ã‚¯ãƒªãƒ—トを実行ã—ãªã„。 +.B \-\-notriggers +オプション㯠+ +.B "\-\-notriggerin \-\-notriggerun \-\-notriggerpostun" + +ã«ç­‰ã—ãã€å¯¾å¿œã™ã‚‹ +.BR %triggerin , +.BR %triggerun , +.BR %triggerpostun +スクリプト(群)を実行ã—ãªã„。 +.TP +.B \-\-oldpackage +æ–°ã—ã„パッケージをãれよりå¤ã„パッケージã§ã‚¢ãƒƒãƒ—グレードã§ãるよã†ã«ã™ã‚‹ã€‚ +.TP +.B \-\-percent +パッケージアーカイブã‹ã‚‰ãƒ•ã‚¡ã‚¤ãƒ«ãŒå–り出ã•ã‚Œã‚‹ã«ã¤ã‚Œã¦ã€ +ãã®å‰²åˆã‚’を表示ã™ã‚‹ã€‚ +ã“れ㯠+.B rpm +ãŒä»–ã®ãƒ„ールã‹ã‚‰å®Ÿè¡Œã•ã‚Œã‚‹ã®ã‚’容易ã«ã™ã‚‹ã“ã¨ã‚’æ„図ã—ã¦ã„る。 +.TP +.BI "\-\-prefix " NEWPATH +å†é…ç½®å¯èƒ½ãªãƒã‚¤ãƒŠãƒªãƒ‘ッケージã«ãŠã„ã¦ã€ãƒ‘ッケージã®å†é…置ヒント(群)ã«ã‚ã‚‹ +インストールプレフィックスã§å§‹ã¾ã‚‹ãƒ•ã‚¡ã‚¤ãƒ«ã®ãƒ‘スを〠+.I NEWPATH +ã«ç½®ãæ›ãˆã‚‹ã€‚ +.TP +.BI "\-\-reloacte " OLDPATH = NEWPATH +å†é…ç½®å¯èƒ½ãªãƒã‚¤ãƒŠãƒªãƒ‘ッケージã«ãŠã„ã¦ã€ãƒ‘ッケージã®å†é…置ヒント(群)ã«ã‚ã‚‹ +.I OLDPATH +ã§å§‹ã¾ã‚‹ãƒ•ã‚¡ã‚¤ãƒ«ã®ãƒ‘ス㨠+.I NEWPATH +ã§ç½®ãæ›ãˆã‚‹ã€‚ +パッケージ内ã§ã€è¤‡æ•°ã® +.I OLDPATH +ãŒå†é…ç½®ã•ã‚Œãªã‘ã‚Œã°ãªã‚‰ãªã„ã®ãªã‚‰ã€ +ã“ã®ã‚ªãƒ—ションを繰り返ã—指定ã™ã‚‹ã“ã¨ãŒã§ãる。 +.TP +.B \-\-repackage +ファイルを削除ã™ã‚‹å‰ã«å†ãƒ‘ッケージã™ã‚‹ã€‚ +以å‰ã«ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚Œã¦ã„ãŸãƒ‘ッケージã¯ã€ãƒžã‚¯ãƒ­ +.B %_repackage_name_fmt +ã«ã‚ˆã£ã¦å付ã‘られã€ãƒžã‚¯ãƒ­ +.B %_repackage_dir +(デフォルト㯠+.IR /var/spool/repackage ; +訳注: /usr/lib/rpm/macros ã§ã¯ /var/spool/repackage ã«è¨­å®šã•ã‚Œã¦ã„ã‚‹) +ã§æŒ‡å®šã•ã‚ŒãŸãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã«ä½œæˆã•ã‚Œã‚‹ã€‚ +.TP +.B \-\-replacefiles +æ—¢ã«ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚ŒãŸä»–ã®ãƒ‘ッケージã®ãƒ•ã‚¡ã‚¤ãƒ«ã‚’ç½®ãæ›ãˆã¦ã—ã¾ã†å ´åˆã§ã‚‚〠+パッケージをインストールã™ã‚‹ã€‚ +.TP +.B \-\-replacepkgs +指定ã•ã‚ŒãŸãƒ‘ッケージã®ã†ã¡ã®ã„ãã¤ã‹ãŒã‚·ã‚¹ãƒ†ãƒ ã«æ—¢ã«ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ« +ã•ã‚Œã¦ã„ã¦ã‚‚ã€ãƒ‘ッケージをインストールã™ã‚‹ã€‚ +.TP +.B \-\-test +パッケージをインストールã›ãšã€å˜ã«ãƒã‚§ãƒƒã‚¯ã¨ã€ +潜在的ãªè¡çªã®å ±å‘Šã‚’è¡Œã†ã€‚ +.SS 削除ã®ã‚ªãƒ—ション +rpm を削除ã™ã‚‹ã‚³ãƒžãƒ³ãƒ‰ã®ä¸€èˆ¬çš„ãªå½¢å¼ã¯: +.PP +.BR rpm " {" \-e|\-\-erase "} [" \-\-allmatches "] [" \-\-nodeps "] [" \-\-noscripts ] +.br +.RB " [" \-\-notriggers "] [" \-\-repackage "] [" \-\-test ] +.I "PACKAGE_NAME ..." +.PP +以下ã®ã‚ªãƒ—ションãŒä½¿ç”¨ã§ãã‚‹: +.TP +.B \-\-allmatces +.I PACKAGE_NAME +ã«ä¸€è‡´ã™ã‚‹ã™ã¹ã¦ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã®ãƒ‘ッケージを削除ã™ã‚‹ã€‚ +.TP +.B \-\-nodeps +パッケージをアンインストールã™ã‚‹å‰ã«ä¾å­˜æ€§ã®ãƒã‚§ãƒƒã‚¯ã‚’ã—ãªã„。 +.TP +.B \-\-noscripts +.PD 0 +.TP +.B \-\-nopreun +.TP +.B \-\-nopostun +.PD +ãã‚Œãžã‚ŒåŒã˜åå‰ã‚’æŒã£ãŸã‚¹ã‚¯ãƒªãƒ—トを実行ã—ãªã„。 +.B \-\-noscripts +オプション㯠+ +.B "\-\-nopreun \-\-nopostun" + +ã«ç­‰ã—ãã€å¯¾å¿œã™ã‚‹ +.B %preun +㨠+.B %postun +スクリプト(群)を実行ã—ãªã„。 +.TP +.B \-\-notriggers +.PD 0 +.TP +.B \-\-notriggerun +.TP +.B \-\-notriggerpostun +.PD +指定ã•ã‚ŒãŸç¨®é¡žã®ãƒˆãƒªã‚¬ãƒ¼ã‚¹ã‚¯ãƒªãƒ—トを実行ã—ãªã„。 +オプション +.B \-\-notriggers +㯠+ +.B "\-\-notriggerun \-\-notriggerpostun" + +ã«ç­‰ã—ãã€å¯¾å¿œã™ã‚‹ +.B %triggerun +㨠+.B %triggerpostun +スクリプト(群)を実行ã—ãªã„。 +.TP +.B \-\-repackage +ファイルを削除ã™ã‚‹å‰ã«å†ãƒ‘ッケージã™ã‚‹ã€‚ +以å‰ã«ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚Œã¦ã„ãŸãƒ‘ッケージã¯ã€ãƒžã‚¯ãƒ­ +.B %_repackage_name_fmt +ã«ã‚ˆã£ã¦å付ã‘られã€ãƒžã‚¯ãƒ­ +.B %_repackage_dir +(デフォルト㯠+.IR /var/spool/repackage ; +訳注: /usr/lib/rpm/macros ã§ã¯ /var/spool/repackage ã«è¨­å®šã•ã‚Œã¦ã„ã‚‹) +ã§æŒ‡å®šã•ã‚ŒãŸãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã«ä½œæˆã•ã‚Œã‚‹ã€‚ +.TP +.B \-\-test +実際ã«ã¯ä½•ã‚‚アンインストールã›ãšæŒ™å‹•ã ã‘を見ã›ã‚‹ã€‚ +オプション +.B \-vv +ã¨å…±ã«ä½¿ãˆã°ãƒ‡ãƒãƒƒã‚°ã«æœ‰åŠ¹ã§ã‚る。 +.\"TSEKINE ã“ã“ã®è¨³ãŒã¤ã‚‰ã„ã§ã™ +.SS 検索オプション +rpm 検索ã®ä¸€èˆ¬çš„ãªå½¢å¼ã¯: +.PP +.BR rpm " {" \-q|\-\-query "} [" select-options "] [" query-options ] +.PP +表示ã•ã‚Œã‚‹ãƒ‘ッケージ情報ã®æ›¸å¼ã‚’指定ã™ã‚‹ã“ã¨ãŒã§ãる。 +ãã†ã™ã‚‹ãŸã‚ã«ã¯ã€ +.RS 0.2i +.PP +.BI "\-\-qf|\-\-queryformat " QUERYFMT +.RE +.PP +オプションを使ã†ã€‚ +.I QUERYFMT +ãŒæ›¸å¼æ–‡å­—列ã§ã‚る。検索ã®æ›¸å¼ã¯ã€æ¨™æº–的㪠+.B printf(3) +ã®æ›¸å¼ã®ä¿®æ­£ã§ã‚る。書å¼ã¯é™çš„ãªæ–‡å­—列 +(改行・タブ・ãã®ä»–ã®ç‰¹æ®Šæ–‡å­—ã®ã€C 言語ã®æ¨™æº–çš„ãªæ–‡å­—エスケープをå«ã‚€)ã¨ã€ +.B printf(3) +åž‹ã®æ›¸å¼æ–‡å­—列ã‹ã‚‰ãªã‚‹ã€‚ +ã—ã‹ã— +.B rpm +ã¯è¡¨ç¤ºã™ã‚‹åž‹ã‚’æ—¢ã«çŸ¥ã£ã¦ã„ã‚‹ã®ã§ã€åž‹æŒ‡å®šã¯çœç•¥ã•ã‚Œã‚‹ã¹ãã§ã‚る。 +代ã‚ã‚Šã« +.B {} +ã§å›²ã¾ã‚ŒãŸã€è¡¨ç¤ºã•ã‚Œã‚‹ã¸ãƒƒãƒ€ãƒ¼ã®ã‚¿ã‚°åãŒä½¿ç”¨ã•ã‚Œã‚‹ã€‚ +ã‚¿ã‚°åã«å¤§æ–‡å­—/å°æ–‡å­—ã®åŒºåˆ¥ã¯ãªãã€ã‚¿ã‚°åã®å…ˆé ­ã® +.B RPMTAG_ +部分もçœç•¥ã™ã‚‹ã“ã¨ãŒã§ãる。 +.PP +以下㮠+.BI : typetag +を付加ã—ãŸã‚¿ã‚°ã«ã‚ˆã£ã¦ã€ä»£æ›¿ã®å‡ºåŠ›æ›¸å¼ã‚’è¦æ±‚ã§ãる。 +ç¾åœ¨ã€ä»¥ä¸‹ã®ç¨®åˆ¥ãŒã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã‚‹: +.TP +.B :armor +公開éµã‚’ASCII文字ã§è¡¨ç¤ºã™ã‚‹ã€‚ +.\"TSEKINE PGP ç­‰ã§ã® armor ã£ã¦ã©ã†è¨³ã™ã®ãŒã„ã„ã‚“ã§ã—ょã†? +.TP +.B :base64 +ãƒã‚¤ãƒŠãƒªãƒ‡ãƒ¼ã‚¿ã‚’ base64 ã§ç¬¦å·åŒ–ã™ã‚‹ã€‚ +.TP +.B :date +strftime(3)ã® "%c" 書å¼ã‚’使ã†ã€‚ +.TP +.B :day +strftime(3)ã® "%a %b %d %Y" 書å¼ã‚’使ã†ã€‚ +.TP +.B :depflags +ä¾å­˜ãƒ•ãƒ©ã‚°ã§è¡¨ç¤ºã€‚ +.TP +.B :fflags +ファイルフラグã§è¡¨ç¤ºã€‚ +.TP +.B :hex +16進数ã§è¡¨ç¤ºã€‚ +.TP +.B :octal +8進数ã§è¡¨ç¤ºã€‚ +.TP +.B :perms +ファイルã®è¨±å¯å±žæ€§ã§è¡¨ç¤ºã€‚ +.TP +.B :shescape +スクリプト内ã§ä½¿ãˆã‚‹ã‚ˆã†ã«ã‚·ãƒ³ã‚°ãƒ«ã‚¯ã‚©ãƒ¼ãƒˆ(')ã§ã‚¨ã‚¹ã‚±ãƒ¼ãƒ—ã™ã‚‹ã€‚ +.TP +.B :triggertype +トリガーã®ç¨®é¡žã‚’表示。 +.PP +例ãˆã°ã€æ¤œç´¢çµæžœã®ãƒ‘ッケージåã ã‘を表示ã—ãŸã‘ã‚Œã°ã€æ›¸å¼æ–‡å­—列ã¨ã—㦠+.B %{NAME} +を使ãˆã°ã‚ˆã„。 +2 カラムã§ãƒ‘ッケージåã¨ãƒ‡ã‚£ã‚¹ãƒˆãƒªãƒ“ューション情報を表示ã—ãŸã‘れ㰠+.B %-30{NAME}%{DISTRIBUTUIN} +を使ãˆã°ã‚ˆã„。 +(訳注: 端末ã«ã‚ˆã£ã¦ã¯æœ«å°¾ã« \\n ãŒå¿…è¦ã§ã‚ã‚‹)。 +引数 +.B \-\-querytags +ã‚’ã¤ã‘㦠+.B rpm +を実行ã™ã‚Œã°ã€ä½¿ç”¨ã§ãã‚‹ã‚¿ã‚°ã™ã¹ã¦ã‚’表示ã™ã‚‹ã“ã¨ãŒã§ãる。 +.PP +検索ã®ãŸã‚ã®ã‚ªãƒ—ションã¯2種類ã«åˆ†ã‘られる。 +パッケージã®é¸æŠžã¨ã€(訳注: 表示ã™ã‚‹ãŸã‚ã®)情報ã®é¸æŠžã§ã‚る。 +.SSS "パッケージé¸æŠžã‚ªãƒ—ション:" +.TP +.I PACKAGE_NAME +インストールã•ã‚Œã¦ã„ã‚‹ +.I PACKAGE_NAME +ã¨ã„ã†åå‰ã®ãƒ‘ッケージを検索ã™ã‚‹ã€‚ +.TP +.BR \-a ", " \-\-all +インストールã•ã‚Œã¦ã„ã‚‹ã™ã¹ã¦ã®ãƒ‘ッケージを検索ã™ã‚‹ã€‚ +.TP +.BR \-f ", " \-\-file " \fIFILE" +.I FILE +を所有ã™ã‚‹ãƒ‘ッケージを検索ã™ã‚‹ã€‚ +.TP +.BI "\-\-fileid " MD5 +与ãˆã‚‰ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«è­˜åˆ¥å­ã€ +ã™ãªã‚ã¡ +.I MD5 +ダイジェストをæŒã¤ãƒ•ã‚¡ã‚¤ãƒ«ã‚’å«ã‚€ãƒ‘ッケージを検索ã™ã‚‹ã€‚ +.TP +.BR \-g ", " \-\-group " \fIGROUP" +グループ㌠+.I GROUP +ã§ã‚るパッケージを検索ã™ã‚‹ã€‚ +.TP +.BI \-\-hdrid " SHA1" +与ãˆã‚‰ã‚ŒãŸã¸ãƒƒãƒ€ãƒ¼è­˜åˆ¥å­ã€ +ã™ãªã‚ã¡æ›¸ãæ›ãˆä¸å¯èƒ½ãªã¸ãƒƒãƒ€é ˜åŸŸã« +.I SHA1 +ダイジェストををもã¤ãƒ‘ッケージを検索ã™ã‚‹ã€‚ +.TP +.BR \-p ", " \-\-package " \fIPACKAGE_FILE" +(インストールã•ã‚Œã¦ã„ãªã„)パッケージ +.I PACKAGE_FILE +を検索ã™ã‚‹ã€‚ +.I PACKAGE_FILE +ã«ã¯ +.B ftp +ã¾ãŸã¯ +.B http +ã® URL å½¢å¼ã§æŒ‡å®šã™ã‚‹ã“ã¨ãŒã§ã〠+ãã®å ´åˆã«ã¯ãƒ‘ッケージã¸ãƒƒãƒ€ãƒ¼ãŒãƒ€ã‚¦ãƒ³ãƒ­ãƒ¼ãƒ‰ã•ã‚Œã¦æ¤œç´¢ã•ã‚Œã‚‹ã€‚ +.B ftp +㨠+.B http +ã®ã‚¯ãƒ©ã‚¤ã‚¢ãƒ³ãƒˆã«é–¢ã™ã‚‹ +.B rpm +内部ã§ã®ã‚µãƒãƒ¼ãƒˆã«ã¤ã„ã¦ã¯ +.B "FTP/HTTP OPTIONS" +ã‚’å‚ç…§ã®ã“ã¨ã€‚ +.I PACKAGE_FILE +引数(群)ãŒãƒã‚¤ãƒŠãƒªãƒ‘ッケージã§ãªã‘ã‚Œã°ã€ãれ㌠ASCII å½¢å¼ã® +パッケージã®ãƒªã‚¹ãƒˆã‚’表ã‚ã™ã‚‚ã®ã¨è§£é‡ˆã•ã‚Œã‚‹ã€‚ +パッケージã®ãƒªã‚¹ãƒˆãƒ•ã‚¡ã‚¤ãƒ«ã§ã¯ã€'#' ã§å§‹ã¾ã‚‹è¡Œã¯ã‚³ãƒ¡ãƒ³ãƒˆã§ã‚る。 +å„è¡Œã«ã¯ç©ºç™½ã§åŒºåˆ‡ã£ãŸãƒ‘スå展開å¼ãŒæŒ‡å®šå¯èƒ½ã§ã€ +展開ã•ã‚ŒãŸãƒ‘スã¯ã€æ¤œç´¢ã™ã‚‹ +.I PACKAGE_FILE +引数ã¸ã®è¿½åŠ ã¨ã—ã¦ç½®æ›ã•ã‚Œã‚‹ã€‚ +パスå展開å¼ã«ã¯ URL ã®ãƒªãƒ¢ãƒ¼ãƒˆã®ãƒ‘スå展開も使ã†ã“ã¨ãŒã§ãる。 +.\"TSEKINE よãã‚ã‹ã‚Šã¾ã›ã‚“。フォロー求む +.TP +.BI \-\-pkgid " \fIMD5" +与ãˆã‚‰ã‚ŒãŸãƒ‘ッケージ識別å­ã€ +ã™ãªã‚ã¡ã¸ãƒƒãƒ€ãƒ¼ã¨å†…容物ã¨ã®çµ„ã¿åˆã‚ã›ãŒ +.I MD5 +ダイジェストををもã¤ãƒ‘ッケージを検索ã™ã‚‹ã€‚ +.TP +.BI \-\-querybynumber " \fIHDRNUM" +データベース㮠+.I HDRNUM +番目ã®ã‚¨ãƒ³ãƒˆãƒªã‚’直接検索ã™ã‚‹ã€‚ +デãƒãƒƒã‚°ã«ã®ã¿æœ‰åŠ¹ã§ã‚る。 +.TP +.BI \-\-specfile " \fISPECFILE" +.I SPECFILE +ã‚’ãã‚ŒãŒãƒ‘ッケージã§ã‚ã‚‹ã‹ã®ã‚ˆã†ã«è§£æžã—ã€æ¤œç´¢ã™ã‚‹ã€‚ +ã™ã¹ã¦ã®æƒ…å ±ãŒåˆ©ç”¨ã§ãã‚‹ã‚ã‘ã§ã¯ãªã„(ãŸã¨ãˆã°ãƒ•ã‚¡ã‚¤ãƒ«ä¸€è¦§)ã«ã‚‚ã‹ã‹ã‚らãšã€ +spec ファイルã®è§£æžå™¨ã‚’書ãã“ã¨ç„¡ã—ã« spec ファイルã‹ã‚‰æƒ…報をå–り出ã™ã“ã¨ãŒ +ã“ã®ç¨®ã®æ¤œç´¢ã§å¯èƒ½ã§ã‚る。 +.TP +.BI \-\-tid " \fITID" +与ãˆã‚‰ã‚ŒãŸãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³è­˜åˆ¥å­ +.I TID +ã‚’æŒã¤ãƒ‘ッケージ(群)を検索ã™ã‚‹ã€‚ +ç¾åœ¨ã®ã¨ã“ã‚ã€unix 時間ãŒãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³è­˜åˆ¥å­ã¨ã—ã¦ä½¿ã‚ã‚Œã¦ã„る。 +一ã¤ã®ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ã§ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ãƒ»å‰Šé™¤ã•ã‚ŒãŸãƒ‘ッケージ(群)ã¯ã€ +ã™ã¹ã¦å…±é€šã®è­˜åˆ¥å­ã‚’æŒã¤ã€‚ +.TP +.BI \-\-triggerdby " \fIPACKAGE_NAME" +パッケージ(群) +.I PACKAGE_NAME +ã«ã‚ˆã£ã¦ãƒˆãƒªã‚¬ãƒ¼ã•ã‚Œã‚‹ãƒ‘ッケージを検索ã™ã‚‹ã€‚ +.TP +.BI \-\-whatprovides " \fICAPABILITY" +.I CAPABILITY +能力をæä¾›ã™ã‚‹ãƒ‘ッケージを検索ã™ã‚‹ã€‚ +.TP +.BI \-\-whatrequires " \fICAPABILITY" +é©åˆ‡ã«æ©Ÿèƒ½ã™ã‚‹ãŸã‚ã« +.I CAPABILITY +ã‚’å¿…è¦ã¨ã™ã‚‹ãƒ‘ッケージを検索ã™ã‚‹ã€‚ +.SSS "パッケージ検索オプション:" +.TP +.B \-\-changelog +パッケージã®æ›´æ–°æƒ…報を表示ã™ã‚‹ã€‚ +.TP +.BR \-c ", " \-\-configfiles +設定ファイルã®ã¿ã‚’表示ã™ã‚‹ +.RB ( \-l +を指定ã—ãŸã‚‚ã®ã¨ã¿ãªã™)。 +.TP +.BR \-d ", " \-\-docfiles +文書ファイルã®ã¿ã‚’表示ã™ã‚‹ +.RB ( \-l +を指定ã—ãŸã‚‚ã®ã¨ã¿ãªã™)。 +.TP +.B \-\-dump +以下ã®å½¢å¼ã§ãƒ•ã‚¡ã‚¤ãƒ«æƒ…報をダンプã™ã‚‹ã€‚ +.sp +.nf +パス サイズ 修正時刻 md5ダイジェスト モード \\ +所有者 グループ 設定ファイル 文書ファイル \\ +ルートデãƒã‚¤ã‚¹ シンボリックリンク +.fi + +ã“ã®ã‚ªãƒ—ション㯠+.BR \-l , +.BR \-c , +.B \-d +ã®ã†ã¡ã®å°‘ãªãã¨ã‚‚一ã¤ã¨å…±ã«ä½¿ç”¨ã•ã‚Œãªã‘ã‚Œã°ãªã‚‰ãªã„。 +.TP +.B \-\-filesbypkg +é¸æŠžã•ã‚ŒãŸãƒ‘ッケージã”ã¨ã«ãƒ•ã‚¡ã‚¤ãƒ«ã‚’表示ã™ã‚‹ã€‚ +.TP +.BR \-i ", " \-\-info +åå‰ã€ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã€èª¬æ˜Žã‚’å«ã‚ãŸãƒ‘ッケージ情報を表示ã™ã‚‹ã€‚ +ã“れ㯠+.B \-\-queryformat +を内部ã§ä½¿ç”¨ã—ã¦ã„る。 +.\"TSEKINE 言ã„ãŸã„ã“ã¨ãŒã‚ˆã分ã‹ã‚Šã¾ã›ã‚“。実際㯠popt 㧠aliasing +.\"TSEKINE ã•ã‚Œã¦ã‚‹ã®ã§ã€ãã®ã“ã¨ãŒè¨€ã„ãŸã„ã®ã§ã—ょã†ã‹? +.TP +.B \-\-last +パッケージをインストール時刻順ã«ã€ +最新ã®ãƒ‘ッケージãŒå…ˆé ­ã«ãªã‚‹ã‚ˆã†ãªé †ã§ä¸¦ã¹ã‚‹ã€‚ +.TP +.BR \-l ", " \-\-list +パッケージ内ã«ã‚るファイルを表示ã™ã‚‹ã€‚ +.TP +.B \-\-provides +ãã®ãƒ‘ッケージãŒæä¾›ã™ã‚‹èƒ½åŠ›ã‚’表示ã™ã‚‹ã€‚ +.TP +.BR \-R ", " \-\-requires +ãã®ãƒ‘ッケージãŒä¾å­˜ã™ã‚‹ãƒ‘ッケージを表示ã™ã‚‹ã€‚ +.TP +.B \-\-scripts +インストール・アンインストールã®éŽç¨‹ã§ä½¿ç”¨ã•ã‚Œã‚‹ã€ +パッケージ固有ã®ã‚¹ã‚¯ãƒªãƒ—トを表示ã™ã‚‹ã€‚ +.TP +.B \-s ", " \-\-state +パッケージ内ã®ãƒ•ã‚¡ã‚¤ãƒ«ã® +.I 状態 +を表示ã™ã‚‹ +.RB ( \-l +を指定ã—ãŸã‚‚ã®ã¨ã¿ãªã™)。 +å„ファイルã®çŠ¶æ…‹ã¯ +.IR "normal(正常)" , +.IR "not installed(インストールã•ã‚Œã¦ã„ãªã„)" , +.I "replaced(ç½®ãæ›ãˆã‚‰ã‚ŒãŸ)" +ã®ã„ãšã‚Œã‹ã§ã‚る。 +.TP +.BR \-\-triggers ", " \-\-triggerscripts +パッケージã«ãƒˆãƒªã‚¬ãƒ¼ã‚¹ã‚¯ãƒªãƒ—トãŒå«ã¾ã‚Œã‚Œã°è¡¨ç¤ºã™ã‚‹ã€‚ +.SS 検査オプション +rpm を検査ã™ã‚‹ã‚³ãƒžãƒ³ãƒ‰ã®ä¸€èˆ¬çš„ãªå½¢å¼ã¯: +.PP +.BR rpm " {" \-V|\-\-verify "} [" select-options "] [" verify-options ] +.PP +パッケージã®æ¤œæŸ»ã§ã¯ã€ +パッケージ内ã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã«é–¢ã™ã‚‹æƒ…å ±ã¨ã€ +rpm データベースã«æ ¼ç´ã•ã‚Œã¦ã„るパッケージã®ãƒ¡ã‚¿ãƒ‡ãƒ¼ã‚¿ã‹ã‚‰å¾—られ㟠+ファイルã«é–¢ã™ã‚‹æƒ…å ±ã¨ã‚’比較ã™ã‚‹ã€‚ +ã¨ã‚Šã‚ã‘ã€ãƒ•ã‚¡ã‚¤ãƒ«ã®ã‚µã‚¤ã‚ºã€MD5 ãƒã‚§ãƒƒã‚¯ã‚µãƒ ã€è¨±å¯å±žæ€§ã€ã‚¿ã‚¤ãƒ—〠+所有者ã€ã‚°ãƒ«ãƒ¼ãƒ—を比較ã™ã‚‹ã€‚ +インストール時㫠+.B \-\-excludedocs +オプションを使ã£ãŸãŸã‚ã«é™¤å¤–ã•ã‚ŒãŸæ–‡æ›¸ãƒ•ã‚¡ã‚¤ãƒ«ã®ã‚ˆã†ã«ã€ +パッケージã‹ã‚‰ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚Œã¦ã„ãªã„ファイルã¯é™ã‹ã«ç„¡è¦–ã•ã‚Œã‚‹ã€‚ +.PP +パッケージé¸æŠžã‚ªãƒ—ションã¯ã€ãƒ‘ッケージ検索ã®ãŸã‚ã®ã‚‚ã®ã¨ +(パッケージã®ãƒªã‚¹ãƒˆãƒ•ã‚¡ã‚¤ãƒ«ã‚’引数ã«æŒ‡å®šã§ãã‚‹ã“ã¨ã‚‚å«ã‚) +一緒ã§ã‚る。 +ãã®ä»–ã®ã€æ¤œæŸ»ãƒ¢ãƒ¼ãƒ‰å›ºæœ‰ã®ã‚ªãƒ—ションã¯: +.TP +.B \-\-nodeps +パッケージã®ä¾å­˜æ€§ã«ã¤ã„ã¦æ¤œæŸ»ã—ãªã„。 +.TP +.B \-\-nodigest +読ã¿è¾¼ã¿æ™‚ã«ãƒ‘ッケージやã¸ãƒƒãƒ€ãƒ¼ã®ãƒ€ã‚¤ã‚¸ã‚§ã‚¹ãƒˆå€¤ã‚’検査ã—ãªã„。 +.TP +.B \-\-nofiles +パッケージ内ã®ãƒ•ã‚¡ã‚¤ãƒ«ã®ã„ã‹ãªã‚‹å±žæ€§ã‚‚検査ã—ãªã„。 +.TP +.B \-\-noscripts +.B %verifyscript +ãŒã‚‚ã—存在ã—ã¦ã‚‚実行ã—ãªã„。 +.TP +.B \-\-nosignature +読ã¿è¾¼ã¿æ™‚ã«ãƒ‘ッケージやã¸ãƒƒãƒ€ãƒ¼ã®ç½²åを検査ã—ãªã„。 +.TP +.B \-\-nolinkto +.PD 0 +.TP +.B \-\-nomd5 +.TP +.B \-\-nosize +.TP +.B \-\-nouser +.TP +.B \-\-nogroup +.TP +.B \-\-nomtime +.TP +.B \-\-nomode +.TP +.B \-\-nordev +.PD +ãã‚Œãžã‚Œé–¢é€£ã™ã‚‹ãƒ•ã‚¡ã‚¤ãƒ«å±žæ€§ã‚’検査ã—ãªã„。 +.PP +出力ã®å½¢å¼ã¯ 8 個ã®æ–‡å­—ã¨å±žæ€§ãƒžãƒ¼ã‚¯ã€ãã®å¾Œã‚ã«ãƒ•ã‚¡ã‚¤ãƒ«åã§ã‚る。 +パッケージã®ã¸ãƒƒãƒ€ãƒ¼ã‹ã‚‰å¾—られる属性マークã¯: + +.PD 0 +.TP .2i +.B c +.B %config +設定ファイル。 +.TP +.B d +.B %doc +文書ファイル。 +.TP +.B g +.B %ghost +ファイル(ã™ãªã‚ã¡ã€ãƒ‘ッケージã®å†…容物ã¨ã—ã¦ã¯å«ã¾ã‚Œã¦ã„ãªã„ファイル)。 +.TP +.B l +.B %license +ライセンスファイル。 +.TP +.B r +.B %readme +readme ファイル。 +.PD +.PP +å„ 8 個ã®æ–‡å­—ã¯ã€ãƒ•ã‚¡ã‚¤ãƒ«ã®å±žæ€§ã¨ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã«è¨˜éŒ²ã•ã‚Œã¦ã„ã‚‹ãã®å±žæ€§ã® +値ã¨ã®æ¯”較ã®çµæžœã‚’æ„味ã—ã¦ã„る。 +一ã¤ã® +.B "." +(ピリオド) ã¯ãƒ†ã‚¹ãƒˆã‚’通éŽã—ãŸã“ã¨æ„味ã—ã€ä¸€ã¤ã® +.B "?" +(クエスãƒãƒ§ãƒ³ãƒžãƒ¼ã‚¯) ã¯ãƒ†ã‚¹ãƒˆãŒå®Ÿæ–½ã•ã‚Œãªã‹ã£ãŸ +(ã™ãªã‚ã¡ã€ãƒ•ã‚¡ã‚¤ãƒ«ãƒ‘ーミッションã«ã‚ˆã‚Šèª­ã¿è¾¼ã‚ãªã‹ã£ãŸ) +ã“ã¨ã‚’æ„味ã™ã‚‹ã€‚ã§ãªã‹ã‚Œã°ã€ +(記憶を助ã‘ã‚‹ãŸã‚ã«ã€ãƒœãƒ¼ãƒ«ãƒ‰åŒ– +.RB (em "B" oldened) +ã•ã‚Œã¦ã„ã‚‹)文字ã¯é–¢é€£ã™ã‚‹ +.B \-\-verify +テストã«å¤±æ•—ã—ãŸã“ã¨ã‚’æ„味ã™ã‚‹: +.PP +.PD 0 +.TP 0.2i +.B S +ファイルã®ã‚µã‚¤ã‚º +.RB ( S ize) +ãŒç•°ãªã‚‹ +.TP +.B M +モード +.RB ( M ode; +許å¯å±žæ€§ã¨ãƒ•ã‚¡ã‚¤ãƒ«ã®ç¨®é¡ž) +ãŒç•°ãªã‚‹ +.TP +.B 5 +.RB MD 5 +ãƒã‚§ãƒƒã‚¯ã‚µãƒ ãŒç•°ãªã‚‹ +.TP +.B D +デãƒã‚¤ã‚¹ +.RB ( D evice) +ã®ãƒ¡ã‚¸ãƒ£ãƒ¼/マイナー番å·ãŒä¸€è‡´ã—ãªã„ +.TP +.B L +.RB read L ink(2) +ã—ãŸãƒ‘スãŒä¸€è‡´ã—ãªã„ +.TP +.B U +所有者 +.RB ( U ser) +ãŒç•°ãªã‚‹ +.TP +.B G +グループ +.RB ( G roup) +ãŒç•°ãªã‚‹ +.TP +.B T +修正時刻 +.RB (m T ime) +ãŒç•°ãªã‚‹ +.PD +.SS é›»å­ç½²åã¨ãƒ€ã‚¤ã‚¸ã‚§ã‚¹ãƒˆã®æ¤œæŸ» +rpm ã®é›»å­æ›¸åã®ä¸€èˆ¬çš„ãªå½¢å¼ã¯: +.PP +.BI "rpm \-\-import " "PUBKEY ..." + +.BR rpm " {" \-K|\-\-checksig "} [" \-\-nogpg "] [" \-\-nopgp "] [" \-\-nomd5 "]" +.br +.I " PACKAGE_FILE ..." +.PP +.B \-\-checksig +オプションã¯ã€ +パッケージã®å®Œå…¨æ€§ã¨å‡ºæ‰€ã‚’確èªã™ã‚‹ãŸã‚ã« +.I PACKAGE_FILE +ã«å«ã¾ã‚Œã‚‹ã™ã¹ã¦ã®ãƒ€ã‚¤ã‚¸ã‚§ã‚¹ãƒˆå€¤ã¨ç½²åã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ã€‚ +ç¾åœ¨ã§ã¯ãƒ‘ッケージãŒèª­ã¿è¾¼ã¾ã‚ŒãŸã¨ãã¯ã„ã¤ã§ã‚‚ç½²åãŒæ¤œæŸ»ã•ã‚Œã‚‹ã€‚ +.B \-\-checksig +ã®æ–¹ã¯ãƒ‘ッケージã«ä»˜éšã™ã‚‹ã™ã¹ã¦ã®ãƒ€ã‚¤ã‚¸ã‚§ã‚¹ãƒˆå€¤ã¨ç½²åã‚’ +検査ã™ã‚‹ã®ã«æœ‰åŠ¹ã§ã‚る。 +.PP +公開éµãŒãªã‘ã‚Œã°é›»å­ç½²åã®æ¤œæŸ»ã¯ã§ããªã„。 +.B \-\-import +を使ãˆã° +.B rpm +データベース㫠ASCII å½¢å¼ã§ã®å…¬é–‹éµã‚’追加ã§ãる。 +å–ã‚Šè¾¼ã¾ã‚ŒãŸå…¬é–‹éµã¯ã‚ã‚‹ã¸ãƒƒãƒ€ãƒ¼ã¸ã¨é‹ã°ã‚Œã€ +パッケージ管ç†ã®ã‚ˆã†ã«åŽ³å¯†ãªéµãƒªãƒ³ã‚°ç®¡ç†ãŒå®Ÿè¡Œã•ã‚Œã‚‹ã€‚ +例ã¨ã—ã¦ã€ãã®æ™‚点ã§å–ã‚Šè¾¼ã¾ã‚Œã¦ã„ã‚‹ã™ã¹ã¦ã®å…¬é–‹éµã¯ä»¥ä¸‹ã‚’実行ã™ã‚‹ã“ã¨ã§ +表示ã§ãる。 +.PP +.nf +.B "rpm \-qa gpg-publey*" +.fi +(訳注: 多ãã®å ´åˆ "*" ã¯ã‚·ã‚§ãƒ«ã«ã‚ˆã£ã¦ãƒ¡ã‚¿æ–‡å­—ã¨ã—ã¦è§£é‡ˆã•ã‚Œã‚‹ã®ã§ã€ +実際ã«ã¯ rpm \-qa "gpg-publey*" ã®ã‚ˆã†ã«ã‚¯ã‚©ãƒ¼ãƒ†ã‚£ãƒ³ã‚°ã™ã‚‹å¿…è¦ãŒã‚ã‚‹) +.PP +å–り込んã ã€ç‰¹å®šã®å…¬é–‹éµã«é–¢ã™ã‚‹è©³ç´°ã¯æ¤œç´¢ã«ã‚ˆã£ã¦è¡¨ç¤ºã™ã‚‹ã“ã¨ãŒã§ãる。 +Red Hat ã® GPG/DSA éµã«é–¢ã™ã‚‹æƒ…å ±ã¯: +.PP +.B "rpm \-qi gpg-publey-db42a60e" +.PP +最後ã«ã€ãƒ‘ッケージã§ãã†ã§ãるよã†ã«ã€å–り込んã å…¬é–‹éµã‚’削除ã™ã‚‹ã“ã¨ãŒã§ãる。 +以下㯠Red Hat ã® GPG/DSA éµã‚’削除ã™ã‚‹ã€‚ +.PP +.B "rpm \-e gpg-pubkey-db42a60e" +.SS パッケージã¸ã®ç½²å +.BR rpm " {" \-\-addsign|\-\-resign } +.I PACKAGE_FILE ... +.PP +オプション +.B \-\-addsign +㨠+.B \-\-resign +ã®ä¸¡æ–¹ã¨ã‚‚ã€ä¸Žãˆã‚‰ã‚ŒãŸå„パッケージ +.I PACKAGE_FILE +ã«å¯¾ã™ã‚‹æ–°ãŸãªç½²åを生æˆãƒ»æŒ¿å…¥ã—ã€æ—¢ã«å­˜åœ¨ã™ã‚‹ç½²åãŒã‚ã‚Œã°ç½®ãæ›ãˆã‚‹ã€‚ +æ­´å²çš„ãªç†ç”±ã«ã‚ˆã‚ŠäºŒã¤ã®ã‚ªãƒ—ションãŒå­˜åœ¨ã™ã‚‹ãŒã€ +ç¾åœ¨ã§ã¯ãã®å‹•ä½œã«é•ã„ã¯ãªã„。 +.SS "パッケージã¸ã®ç½²åã« GPG を使用ã™ã‚‹" +GPG を使ã£ã¦ãƒ‘ッケージã«ç½²åã™ã‚‹ãŸã‚ã«ã¯ã€ +.B rpm +㌠GPG を実行ã™ã‚‹ã‚ˆã†ã«è¨­å®šã•ã‚Œã¦ã„ãªã‘ã‚Œã°ãªã‚‰ãšã€ã¾ãŸã€ +é©åˆ‡ãªéµã§éµãƒªãƒ³ã‚°ã‚’探ã™ã“ã¨ãŒã§ããªã‘ã‚Œã°ãªã‚‰ãªã„。 +.B rpm +ã¯ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã§ã€ +GPG ãŒéµã®ç’°ã‚’探ã™ã®ã¨åŒã˜è¦å‰‡ã€ã™ãªã‚ã¡ç’°å¢ƒå¤‰æ•° +.B $GPGPATH +を使用ã™ã‚‹ã€‚ +GPG ãŒæœŸå¾…ã™ã‚‹å ´æ‰€ã«éµãƒªãƒ³ã‚°ãŒç„¡ã„å ´åˆã«ã¯ã€ +使用ã™ã‚‹ GPG éµãƒªãƒ³ã‚°ã®å ´æ‰€ã‚’ +.B %_gpg_path +マクロã«è¨­å®šã™ã‚‹å¿…è¦ãŒã‚る。 +.PP +éŽåŽ»ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® GPG, PGP, rpm ã¨ã®äº’æ›æ€§ã®ãŸã‚ã«ã€ +V3 OpenPGP ç½²åパケットã®ã¿ãŒè¨­å®šã•ã‚Œãªã‘ã‚Œã°ãªã‚‰ãªã„。 +.\"TSEKINE 何ã«å¯¾ã—㦠configured ã•ã‚Œãªã‘ã‚Œã°ãªã‚‰ãªã„ã®ã§ã—ょã†? +DSA 㨠RSA ã®æ¤œæŸ»ã‚¢ãƒ«ã‚´ãƒªã‚ºãƒ ã®ã©ã¡ã‚‰ã‚‚使ã†ã“ã¨ãŒã§ãã‚‹ãŒã€ +DSA ã®æ–¹ãŒå¥½ã¾ã—ã„。 +.PP +作æˆã—ãŸãƒ‘ッケージã«è‡ªåˆ†è‡ªèº«ã§ç½²åã§ãるよã†ã«ã—ãŸã‘ã‚Œã°ã€ +公開éµã¨ç§˜å¯†éµã®ãƒšã‚¢ã‚’作æˆã—ã¦ãŠãã“ã¨ã‚‚å¿…è¦ã§ã‚ã‚‹ +(GPG ã®ãƒžãƒ‹ãƒ¥ã‚¢ãƒ«ã‚’見るã“ã¨)。 +ã¾ãŸã€ä»¥ä¸‹ã® +.B rpm +マクロを設定ã™ã‚‹ã“ã¨ã‚‚å¿…è¦ã§ã‚ã‚ã†ã€‚ +.TP +\fB%_signature\fR +ç½²åã®å½¢å¼ã€‚ +ç¾åœ¨ã®ã¨ã“ã‚ gpg 㨠pgp ã®ã¿ãŒã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„る。 +.TP +\fB%_gpg_name\fR +パッケージã«ç½²åã™ã‚‹ã®ã«ä½¿ç”¨ã—ãŸã„éµã®ãƒ¦ãƒ¼ã‚¶å。 +.PP +例ãˆã°ã€å®Ÿè¡Œãƒ•ã‚¡ã‚¤ãƒ«ãŒ +.I /usr/bin/gpg +ã§ã€éµãƒªãƒ³ã‚°ãŒ +.I /etc/rpm/.gpg +ã«ã‚ã‚Šã€ãã®ä¸­ã®ãƒ¦ãƒ¼ã‚¶ +.I """John Doe """ +ã¨ã—ã¦ãƒ‘ッケージ㫠GPG を使ã£ã¦ç½²åã™ã‚‹å ´åˆã«ã¯ +.PP +.nf +%_signature gpg +%_gpg_path /etc/rpm/.gpg +%_gpg_name John Doe +%_gpgbin /usr/bin/gpg +.fi +.PP +をマクロã®è¨­å®šãƒ•ã‚¡ã‚¤ãƒ«ã«å«ã‚ã‚Œã°è‰¯ã„。 +システム全体ã®è¨­å®šã«ã¯ +.I /etc/rpm/macros +ã‚’ã€ãƒ¦ãƒ¼ã‚¶ã”ã¨ã®è¨­å®šã«ã¯ +.I ~/.rpmmacros +を使用ã™ã‚‹ã€‚ +.SS データベースå†ä½œæˆã‚ªãƒ—ション +データベースをå†ä½œæˆã™ã‚‹ã‚³ãƒžãƒ³ãƒ‰ã®ä¸€èˆ¬çš„ãªå½¢å¼ã¯: +.PP +.BR rpm " {" \-\-initdb|\-\-rebuilddb "} [" \-v "] [" "\-\-dbpath \fIDIRECTORY" ] +.br +.RB " [" "\-\-root \fIDIRECTORY" ] +.PP +æ–°ãŸãªãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã‚’作æˆã™ã‚‹å ´åˆã«ã¯ +.B \-\-initdb +を使ã„ã€ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚Œã¦ã„るパッケージã®ã¸ãƒƒãƒ€ãƒ¼ã‹ã‚‰ +データベースã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ã‚’å†ä½œæˆã™ã‚‹ã«ã¯ +.B \-\-rebuilddb +を使用ã™ã‚‹ã€‚ +.SS "SHOWRC" +コマンド +.PP +.B "rpm \-\-showrc" +.PP +ã¯ã€ +.B rpm +ãŒä½¿ç”¨ã™ã‚‹ã™ã¹ã¦ã®ã‚ªãƒ—ションã®å€¤ã‚’表示ã™ã‚‹ã€‚ +値ã¯ãƒ•ã‚¡ã‚¤ãƒ« +.I rpmrc +㨠+.I macros +ã§è¨­å®šã•ã‚Œã‚‹ã€‚ +.SS "FTP/HTTP オプション" +インターãƒãƒƒãƒˆã‹ã‚‰ãƒ‘ッケージを検索ã—ãŸã‚Šã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã§ãるよã†ã«ã™ã‚‹ãŸã‚ã«ã€ +.B rpm +㯠FTP 㨠HTTP ã®ã‚¯ãƒ©ã‚¤ã‚¢ãƒ³ãƒˆã¨ã—ã¦å‹•ä½œã™ã‚‹ã“ã¨ãŒã§ãる。 +インストールã€ã‚¢ãƒƒãƒ—グレードã€æ¤œç´¢ã™ã‚‹ãƒ‘ッケージファイル㯠+以下㮠ftp ã¾ãŸã¯ http スタイル㮠URL ã§æŒ‡å®šã™ã‚‹ã“ã¨ãŒã§ãる。 +.PP +ftp://USER:PASSWORD@HOST:PORT/path/to/package.rpm +.PP +ã‚‚ã— +.B :PASSWORD +ã®éƒ¨åˆ†ãŒçœç•¥ã•ã‚ŒãŸå ´åˆã«ã¯ã€ãƒ‘スワード㌠+(ユーザ/ホストåã®çµ„åˆã‚ã›ã”ã¨ã«)å°‹ã­ã‚‰ã‚Œã‚‹ã€‚ +ユーザã¨ãƒ‘スワードã®ä¸¡æ–¹ãŒçœç•¥ã•ã‚ŒãŸå ´åˆã«ã¯ã€ +anonymous(匿å) +.B ftp +ãŒä½¿ç”¨ã•ã‚Œã‚‹ã€‚ã™ã¹ã¦ã®å ´åˆã«ãŠã„㦠+パッシブ (PASV) +.B ftp +転é€ãŒåˆ©ç”¨ã•ã‚Œã‚‹ã€‚ +.PP +ftp URL ã«ãŠã„ã¦ã€ +.B rpm +ã§ã¯æ¬¡ã®ã‚ªãƒ—ションãŒå¯èƒ½ã§ã‚る。 +.TP +.BI \-\-ftpproxy " HOST" +プロキシを用ã„ãŸãƒ•ã‚¡ã‚¤ã‚¢ã‚¦ã‚©ãƒ¼ãƒ«ã‚’通ã—ã¦ãƒ¦ãƒ¼ã‚¶ãŒ ftp ã§ãるよã†ã«ã€ +ã™ã¹ã¦ã® ftp 転é€ã«ãƒ›ã‚¹ãƒˆ +.I HOST +ã¯ãƒ—ロキシサーãƒãƒ¼ã¨ã—ã¦ä½¿ç”¨ã•ã‚Œã‚‹ã€‚ +マクロ +.B %_ftpproxy +ã®è¨­å®šã§ã‚‚ã€ã“ã®ã‚ªãƒ—ションを指定ã™ã‚‹ã“ã¨ãŒã§ãる。 +.TP +.BI \-\-ftpport " PORT" +.\"TSEKINE 多分ã€åŽŸæ–‡ã®æ–¹ãŒé–“é•ã£ã¦ã‚‹ +デフォルトã®ãƒãƒ¼ãƒˆã®ä»£ã‚ã‚Šã«ã€ãƒ—ロキシ ftp サーãƒã® ftp 接続ã«ä½¿ç”¨ã™ã‚‹ +TCP +.I PORT +(ãƒãƒ¼ãƒˆ)番å·ã€‚ +マクロ +.B %_ftpport +ã®è¨­å®šã§ã‚‚ã€ã“ã®ã‚ªãƒ—ションを指定ã™ã‚‹ã“ã¨ãŒã§ãる。 +.PP +.B http +URL ã«ãŠã„ã¦ã€ +.B rpm +ã§ã¯æ¬¡ã®ã‚ªãƒ—ションãŒå¯èƒ½ã§ã‚る。 +.TP +.BI \-\-httpproxy " HOST" +ã™ã¹ã¦ã® http 転é€ã«ãƒ›ã‚¹ãƒˆ +.I HOST +ã¯ãƒ—ロキシサーãƒãƒ¼ã¨ã—ã¦ä½¿ç”¨ã•ã‚Œã‚‹ã€‚ +マクロ +.B %_httpproxy +ã®è¨­å®šã§ã‚‚ã€ã“ã®ã‚ªãƒ—ションを指定ã™ã‚‹ã“ã¨ãŒã§ãる。 +.TP +.BI \-\-httpport " PORT" +デフォルトã®ãƒãƒ¼ãƒˆã®ä»£ã‚ã‚Šã«ã€http プロキシサーãƒã®æŽ¥ç¶šã§ä½¿ç”¨ã™ã‚‹ +TCP +.B PORT +(ãƒãƒ¼ãƒˆ)番å·ã€‚ +.SH éŽåŽ»ã®éºç”£ +.SS "rpmbuild ã®å®Ÿè¡Œ" +rpm ã®ãƒ“ルドモードã¯ã€ç¾åœ¨ã§ã¯ +.I /usr/bin/rpmbuild +ã«å«ã¾ã‚Œã‚‹ã€‚ +éŽåŽ»ã¨ã®äº’æ›æ€§ã¯ä»¥ä¸‹ã® popt ã«ã‚ˆã‚‹ã‚¨ã‚¤ãƒªã‚¢ã‚¹ã«ã‚ˆã£ã¦æä¾›ã•ã‚Œã€ +ãã‚Œã¯ã¾ãšã¾ãšã§ã¯ã‚ã‚‹ãŒå®Œå…¨ã§ã¯ãªã„。 +よã£ã¦ popt ã®ã‚¨ã‚¤ãƒªã‚¢ã‚¹ã‚’使ã£ãŸãƒ“ルドモードã®äº’æ›æ€§ã¯ã€ +rpm ã‹ã‚‰å–り除ã‹ã‚Œã¤ã¤ã‚る。 +以å‰ã® +.BR rpm (8) +ã«è¨˜è¿°ã•ã‚Œã¦ã„㟠+.B rpm +ビルドモードã«ã¤ã„ã¦ã®ã™ã¹ã¦ã®æ–‡æ›¸ã¯ã€ +.B rpmbuld +パッケージをインストール㗠+.BR rpmbuild (8) +ã‚’å‚ç…§ã™ã‚‹ã“ã¨ã€‚ +.PP +ã“ã‚Œã‹ã‚‰ã‚‚ +.B rpm +ã®ã‚³ãƒžãƒ³ãƒ‰ãƒ©ã‚¤ãƒ³ã‹ã‚‰ +.B rpmbuild +を呼ã³å‡ºã—ãŸã‘ã‚Œã°ã€ä»¥ä¸‹ã®è¡Œã‚’ +.I /etc/popt +ã«åŠ ãˆã‚Œã°ã‚ˆã„。 +.PP +.nf +rpm exec \-\-bp rpmb \-bp +rpm exec \-\-bc rpmb \-bc +rpm exec \-\-bi rpmb \-bi +rpm exec \-\-bl rpmb \-bl +rpm exec \-\-ba rpmb \-ba +rpm exec \-\-bb rpmb \-bb +rpm exec \-\-bs rpmb \-bs +rpm exec \-\-tp rpmb \-tp +rpm exec \-\-tc rpmb \-tc +rpm exec \-\-ti rpmb \-ti +rpm exec \-\-tl rpmb \-tl +rpm exec \-\-ta rpmb \-ta +rpm exec \-\-tb rpmb \-tb +rpm exec \-\-ts rpmb \-ts +rpm exec \-\-rebuild rpmb \-\-rebuild +rpm exec \-\-recompile rpmb \-\-recompile +rpm exec \-\-clean rpmb \-\-clean +rpm exec \-\-rmsource rpmb \-\-rmsource +rpm exec \-\-rmspec rpmb \-\-rmspec +rpm exec \-\-target rpmb \-\-target +rpm exec \-\-short\-circuit rpmb \-\-short\-circuit +.fi +.SH ファイル +.SS "rpmrc 設定" +.PP +.nf +\fI/usr/lib/rpm/rpmrc\fR +\fI/usr/lib/rpm/redhat/rpmrc\fR +\fI/etc/rpmrc\fR +\fI~/.rpmrc\fR +.fi +.SS マクロ設定 +.nf +\fI/usr/lib/rpm/macros\fR +\fI/usr/lib/rpm/redhat/macros\fR +\fI/etc/rpm/macros\fR +\fI~/.rpmmacros\fR +.fi +.SS データベース +.nf +\fI/var/lib/rpm/Basenames\fR +\fI/var/lib/rpm/Conflictname\fR +\fI/var/lib/rpm/Dirnames\fR +\fI/var/lib/rpm/Filemd5s\fR +\fI/var/lib/rpm/Group\fR +\fI/var/lib/rpm/Installtid\fR +\fI/var/lib/rpm/Name\fR +\fI/var/lib/rpm/Packages\fR +\fI/var/lib/rpm/Providename\fR +\fI/var/lib/rpm/Provideversion\fR +\fI/var/lib/rpm/Pubkeys\fR +\fI/var/lib/rpm/Removed\fR +\fI/var/lib/rpm/Requirename\fR +\fI/var/lib/rpm/Requireversion\fR +\fI/var/lib/rpm/Sha1header\fR +\fI/var/lib/rpm/Sigmd5\fR +\fI/var/lib/rpm/Triggername\fR +.fi +.SS 一時ファイル +\fI/var/tmp/rpm*\fR +.SH 関連項目 +.BR popt (3), +.BR rpm2cpio (8), +.BR rpmbuild (8), +.nf +.UR http://www.rpm.org/ +.B http://www.rpm.org/ +.UE +.fi +.SH 著者 +.nf +Marc Ewing +Jeff Johnson +Erik Troan +.fi diff --git a/rpm-5.4.9/doc/ja/rpm2cpio.8 b/rpm-5.4.9/doc/ja/rpm2cpio.8 new file mode 100644 index 0000000..49d9a7c --- /dev/null +++ b/rpm-5.4.9/doc/ja/rpm2cpio.8 @@ -0,0 +1,45 @@ +.\" rpm2cpio - Converts Red Hat Package (RPM) to cpio archive +.\" +.\" This program is free software; you can redistribute it and/or modify +.\" it under the terms of the GNU General Public License as published by +.\" the Free Software Foundation; either version 2, or (at your option) +.\" any later version. +.\" +.\" This program is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with this program; if not, write to the Free Software +.\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +.\" USA. +.\" +.\" Japanese Version Copyright (C) 2003 System Design and Research +.\" Institute Co.,Ltd. All rights reserved. +.\" +.\" Translated 14 March 2003 by +.\" System Design and Research Institute Co.,Ltd. +.\" +.TH rpm2cpio 8 "11 January 2001" "Red Hat, Inc." "Red Hat Linux" +.SH åå‰ +rpm2cpio \- RPM (RPM Package Manager)パッケージã‹ã‚‰ cpio アーカイブを +抽出ã™ã‚‹ +.SH æ›¸å¼ +\fBrpm2cpio\fP [filename] +.SH 説明 +.B rpm2cpio +ã¯å¼•æ•°ã§æŒ‡å®šã•ã‚Œã‚‹ä¸€ã¤ã® .rpm ファイルを cpio アーカイブ形å¼ã«å¤‰æ›ã—〠+標準出力ã«å‡ºåŠ›ã™ã‚‹ã€‚ +引数㫠'\-' ãŒæŒ‡å®šã•ã‚ŒãŸå ´åˆã«ã¯ã€æ¨™æº–入力ã‹ã‚‰ rpm を読ã¿è¾¼ã‚€ã€‚ +.PP +.br +.B "rpm2cpio rpm-1.1-1.i386.rpm" +.br +.B "rpm2cpio \- < glint-1.0-1.i386.rpm" +.SH 関連項目 +.IR rpm (8) +.SH 著者 +.nf +Erik Troan +.fi diff --git a/rpm-5.4.9/doc/ja/rpmbuild.8 b/rpm-5.4.9/doc/ja/rpmbuild.8 new file mode 100644 index 0000000..4f7a7e6 --- /dev/null +++ b/rpm-5.4.9/doc/ja/rpmbuild.8 @@ -0,0 +1,315 @@ +.\" This manpage has been automatically generated by docbook2man +.\" from a DocBook document. This tool can be found at: +.\" +.\" Please send any bug reports, improvements, comments, patches, +.\" etc. to Steve Cheng . +.\" +.\" This program is free software; you can redistribute it and/or modify +.\" it under the terms of the GNU General Public License as published by +.\" the Free Software Foundation; either version 2, or (at your option) +.\" any later version. +.\" +.\" This program is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with this program; if not, write to the Free Software +.\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +.\" USA. +.\" +.\" Japanese Version Copyright (C) 2003 System Design and Research +.\" Institute Co.,Ltd. All rights reserved. +.\" +.\" Translated 14 March 2003 by +.\" System Design and Research Institute Co.,Ltd. +.\" +.TH "RPMBUILD" "8" "09 June 2002" "Red Hat, Inc." "Red Hat Linux" +.SH åå‰ +rpmbuils \- RPM パッケージã®ãƒ“ルド +.SH æ›¸å¼ +.SS パッケージã®ãƒ“ルド: +\fBrpmbuild\fR {\fB-ba|-bb|-bp|-bc|-bi|-bl|-bs\fR} [\fBrpmbuild-options\fR] \fB\fISPECFILE\fB\fR\fI ...\fR + +\fBrpmbuild\fR {\fB-ta|-tb|-tp|-tc|-ti|-tl|-ts\fR} [\fBrpmbuild-options\fR] \fB\fITARBALL\fB\fR\fI ...\fR + +\fBrpmbuild\fR {\fB--rebuild|--recompile\fR} \fB\fISOURCEPKG\fB\fR\fI ...\fR +.SS ãã®ä»–: +\fBrpmbuild\fR \fB--showrc\fR +.SS rpmbuild ã®ã‚ªãƒ—ション + [\fB--buildroot \fIDIRECTORY\fB\fR] [\fB--clean\fR] [\fB--nobuild\fR] + [\fB--rmsource\fR] [\fB--rmspec\fR] [\fB--short-circuit\fR] [\fB--sign\fR] + [\fB--target \fIPLATFORM\fB\fR] +.SH 説明 +.B rpmbuild +ã¯ã€ãƒã‚¤ãƒŠãƒªãƒ‘ッケージã¨ã‚½ãƒ¼ã‚¹ãƒ‘ッケージã®ä¸¡æ–¹ã®ãƒ“ルド(作æˆ)ã«åˆ©ç”¨ã•ã‚Œã‚‹ã€‚ +.B パッケージ +ã¯ãƒ•ã‚¡ã‚¤ãƒ«ã®ã‚¢ãƒ¼ã‚«ã‚¤ãƒ–ã¨ã€ã‚¢ãƒ¼ã‚«ã‚¤ãƒ–ã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã® +インストール・アンインストールã«ä½¿ã‚れるメタデータã‹ã‚‰æ§‹æˆã•ã‚Œã‚‹ã€‚ +メタデータã¯è£œåŠ©ã‚¹ã‚¯ãƒªãƒ—トã€ãƒ•ã‚¡ã‚¤ãƒ«å±žæ€§ã€ +パッケージã®èª¬æ˜Žã«é–¢ã™ã‚‹æƒ…å ±ã‹ã‚‰ãªã‚‹ã€‚ +.B パッケージ +ã«ã¯ 2 種類ã‚り〠+インストールã™ã‚‹ãŸã‚ã®ã‚½ãƒ•ãƒˆã‚¦ã‚§ã‚¢ã‚’カプセル化ã™ã‚‹ã®ã«ä½¿ã‚れるãƒã‚¤ãƒŠãƒª +パッケージã¨ã€ãƒã‚¤ãƒŠãƒªãƒ‘ッケージを作æˆã™ã‚‹ã®ã«å¿…è¦ãªãƒ¬ã‚·ãƒ”ã¨ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ +ã‹ã‚‰ãªã‚‹ã‚½ãƒ¼ã‚¹ãƒ‘ッケージã¨ãŒã‚る。 +.PP +次ã®åŸºæœ¬ãƒ¢ãƒ¼ãƒ‰ã‹ã‚‰ã„ãšã‚Œã‹ä¸€ã¤ã‚’é¸æŠžã—ãªã‘ã‚Œã°ãªã‚‰ãªã„: +.BR パッケージã®ãƒ“ルド 〠"tar アーカイブã‹ã‚‰ã®ãƒ‘ッケージã®ãƒ“ルド" 〠+.BR パッケージã®å†ã‚³ãƒ³ãƒ‘イル 〠設定ã®è¡¨ç¤º 。 +.SS 一般的ãªã‚ªãƒ—ション +以下ã®ã‚ªãƒ—ションã¯ã™ã¹ã¦ã®ãƒ¢ãƒ¼ãƒ‰ã§ä½¿ç”¨å¯èƒ½ã§ã‚る。 +.TP +.BR \-? ", " \-\-help +使ã„方を通常よりも詳ã—ã表示ã™ã‚‹ã€‚ +.TP +\fB\-\-version\fR +使用中㮠+.B rpm +ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ç•ªå·ã‚’ 1 è¡Œã§è¡¨ç¤ºã™ã‚‹ã€‚ +.TP +\fB\-\-quiet\fR +表示をã§ãã‚‹ã ã‘å°‘ãªãã™ã‚‹ã€‚ +通常ã¯ã€ã‚¨ãƒ©ãƒ¼ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã ã‘ãŒè¡¨ç¤ºã•ã‚Œã‚‹ã€‚ +.TP +\fB\-v\fR +より多ãã®æƒ…報を表示ã™ã‚‹ã€‚ +通常ã¯ã€ãƒ«ãƒ¼ãƒãƒ³ã®é€²æ—メッセージãŒè¡¨ç¤ºã•ã‚Œã‚‹ã€‚ +.TP +\fB\-vv\fR +沢山ã®æ±šã„デãƒãƒƒã‚°æƒ…報を表示ã™ã‚‹ã€‚ +.TP +.BI \-\-rcfile " FILELIST" +.B rpm +ã¯ã€ã‚³ãƒ­ãƒ³(`:')ã§åŒºåˆ‡ã‚‰ã‚ŒãŸ +.I FILELIST +ã®å„ファイルを設定情報ã¨ã—ã¦èª­ã¿è¾¼ã‚€ã€‚ +読ã¿è¾¼ã¿ã¯ +.I FILELIST +ã«æŒ‡å®šã•ã‚ŒãŸé †ç•ªã§è¡Œã‚れる。 +.I FILELIST +ã®ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã¯ +.IR /usr/lib/rpm/rpmrc : /usr/lib/rpm/redhat/rpmrc : ~/.rpmrc +ã§ã‚る。 +.TP +.BI \-\-pipe " CMD" +.B rpm +コマンドã®å‡ºåŠ›ã‚’ +.I CMD +ã¸ãƒ‘イプã™ã‚‹ã€‚ +.TP +.BI \-\-dbpath " DIRECTORY" +データベースã®ãƒ‘スã¨ã—ã¦ã€ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã® +.I /var/lib/rpm +ã§ã¯ãªã +.I DIRECTORY +を使ã†ã€‚ +.TP +.BI \-\-root " DIRECTORY" +.\" motoki: after 以下㌠will be used for 〜 ã«ã‹ã‹ã‚‹ã®ã‹ãŒä¸æ˜Žã€‚ +.\" motoki: will be run ã«ã ã‘ã‹ã‹ã‚‹ã®ã ã¨æ€ã„ã¾ã™ãŒãƒ»ãƒ»ãƒ» +ã™ã¹ã¦ã®æ“作ã«ãŠã„ã¦ã€ +.I DIRECTORY +をルートã¨ã—ãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚·ã‚¹ãƒ†ãƒ ã‚’使ã†ã€‚ +ã¤ã¾ã‚Šã€ +.I DIRECTORY +内ã«ã‚るデータベースãŒä¾å­˜æ€§ã®ãƒã‚§ãƒƒã‚¯ã«ä½¿ç”¨ã•ã‚Œã€ +.I DIRECTORY +ã« chroot(2) ã—ãŸå¾Œã§ã€ã™ã¹ã¦ã®ã‚¹ã‚¯ãƒªãƒ—ト +(例ãˆã°ã€ãƒ‘ッケージインストール時㮠+.B %post +ã‚„ã€ãƒ‘ッケージビルド時㮠+.B %prep +ãªã©) ãŒå®Ÿè¡Œã•ã‚Œã‚‹ã€‚ +.SS ビルドオプション +rpm ã®ãƒ“ルド・コマンドã®ä¸€èˆ¬çš„ãªå½¢å¼ã¯ä»¥ä¸‹ã®é€šã‚Šã§ã‚ã‚‹: +.RS 0.2i +.PP +.B rpmbuild +.BI \-b STAGE |\-t STAGE +.RB "[ " rpmbuild\-options " ]" +.I "FILE ..." +.RE +.PP +パッケージã®ãƒ“ルド㫠spec ファイルを使用ã™ã‚‹ã®ã§ã‚れ㰠+.B \-b +を〠+.B rpmbuild +㌠spec ファイルを使ã†ãŸã‚ã« (圧縮ã•ã‚Œã¦ã„ã‚‹ã“ã¨ã‚‚ã‚ã‚‹) tar ファイル㮠+内部ã‹ã‚‰ä½¿ç”¨ã™ã‚‹ spec ファイルを探ã™ã®ã§ã‚れ㰠+.B \-t +ã‚’ã€ãã‚Œãžã‚Œå¼•æ•°ã«æŒ‡å®šã™ã‚‹ã€‚ +最åˆã®å¼•æ•°ã®å¾Œã‚ã«ã‚ã‚‹ã€æ¬¡ã®æ–‡å­— +.RI ( STAGE ) +ã¯ãƒ“ルドã¨ãƒ‘ッケージ化ã®æ®µéšŽã‚’指定ã™ã‚‹ã®ã«ä½¿ã‚れ〠+以下ã®ã„ãšã‚Œã‹ãŒæŒ‡å®šã•ã‚Œã‚‹ +(訳注: 以下ã®ã‚‚ã®ã¯ spec ファイルã€ã™ãªã‚ã¡ \-b ãŒæŒ‡å®šã•ã‚ŒãŸå ´åˆã§ã‚り〠+tar ファイルã‹ã‚‰ãƒ“ルドã™ã‚‹å ´åˆã¯ \-ta, \-tb, ... ã¨ãªã‚‹)。 +.TP +\fB\-ba\fR +(%prep, %build, %install を実行ã—ãŸå¾Œã«) +ãƒã‚¤ãƒŠãƒªãƒ‘ッケージã¨ã‚½ãƒ¼ã‚¹ãƒ‘ッケージをビルドã™ã‚‹ã€‚ +.TP +\fB\-bb\fR +(%prep, %build, %install を実行ã—ãŸå¾Œã«) +ãƒã‚¤ãƒŠãƒªãƒ‘ッケージをビルドã™ã‚‹ã€‚ +.TP +\fB\-bp\fR +spec ファイルã‹ã‚‰ "%prep" 段階を実行ã™ã‚‹ã€‚ +通常ã€ã‚½ãƒ¼ã‚¹ã‚’展開ã—パッãƒã‚’é©ç”¨ã™ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ã€‚ +.TP +\fB\-bc\fR +(%prep を実行ã—ãŸå¾Œã«) +spec ファイルã‹ã‚‰ "%build" 段階を実行ã™ã‚‹ã€‚ +一般的ã«ã¯ "make" ã¨ç­‰ä¾¡ã§ã‚る。 +.TP +\fB\-bi\fR +(%prep, %build を実行ã—ãŸå¾Œã«) +spec ファイルã‹ã‚‰ "%install" 段階を実行ã™ã‚‹ã€‚ +一般的ã«ã¯ "make install" ã¨ç­‰ä¾¡ã§ã‚る。 +.TP +\fB\-bl\fR +"list check" を実行ã™ã‚‹ã€‚ +spec ファイル㮠"%files" セクションã®ãƒžã‚¯ãƒ­ãŒå±•é–‹ã•ã‚Œã€ +å„ファイルãŒå­˜åœ¨ã™ã‚‹ã‹ã®æ¤œè¨¼ã‚’ã™ã‚‹ãŸã‚ã®ãƒã‚§ãƒƒã‚¯ãŒè¡Œã‚れる。 +.TP +\fB\-bs\fR +ソースパッケージã ã‘をビルドã™ã‚‹ã€‚ +.PP +ã•ã‚‰ã«ã€ä»¥ä¸‹ã®ã‚ªãƒ—ションãŒåˆ©ç”¨å¯èƒ½ã§ã‚ã‚‹: +.TP +.BI \-\-buildroot " DIRECTORY" +パッケージビルド時㫠BuildRoot ã‚¿ã‚°ã‚’ +.I DIRECTORY +ディレクトリã«ä¸Šæ›¸ãã™ã‚‹ã€‚ +.TP +\fB\-\-clean\fR +パッケージãŒä½œæˆã•ã‚ŒãŸå¾Œã«ãƒ“ルドツリーを削除ã™ã‚‹ã€‚ +.TP +\fB\-\-nobuild\fR +何ã®ãƒ“ルドも実行ã—ãªã„。spec ファイルã®æ¤œæŸ»ã‚’è¡Œã†å ´åˆã«ä¾¿åˆ©ã§ã‚る。 +.TP +\fB\-\-rmsource\fR +ビルド後ã«ã‚½ãƒ¼ã‚¹ã‚’削除ã™ã‚‹ +(å˜ç‹¬ã§ä½¿ç”¨ã—ã¦ã‚‚よã„。例: "\fBrpmbuild \-\-rmsource foo.spec\fR")。 +.TP +\fB\-\-rmspec\fR +ビルド後㫠spec ファイルを削除ã™ã‚‹ã€‚ +(å˜ç‹¬ã§ä½¿ç”¨ã—ã¦ã‚‚よã„。例: "\fBrpmbuild \-\-rmspec foo.spec\fR")。 +.TP +\fB\-\-short\-circuit\fR +指定ã•ã‚ŒãŸæ®µéšŽã¸ç›´æŽ¥ã™ã™ã‚€(ã™ãªã‚ã¡ã€æŒ‡å®šã•ã‚ŒãŸæ®µéšŽã¾ã§ã®å…¨ã¦ã®æ®µéšŽãŒ +飛ã°ã•ã‚Œã‚‹)。 +.B \-bc +㨠+.B \-bi +(訳注: +.B \-tc +㨠+.BR \-ti ã‚‚) +ã§ã®ã¿ä½¿ç”¨ã§ãる。 +.TP +\fB\-\-sign\fR +パッケージ㫠GPG ç½²åを埋ã‚込む。 +ã“ã®ç½²åã¯ã€ãƒ‘ッケージã®å‡ºæ‰€ã¨å®Œå…¨æ€§ã‚’検証ã™ã‚‹ã®ã«ç”¨ã„ã‚‹ã“ã¨ãŒã§ãる。 +設定ã®è©³ç´°ã«ã¤ã„ã¦ã¯ +.BR rpm (8) +ã®ã€ŒGPG ç½²åã€ã®ç¯€ã‚’å‚ç…§ã®ã“ã¨ã€‚ +.TP +.BI \-\-target " PLATFORM" +パッケージビルド時㫠+.I PLATFORM +ã‚’ +.B arch-vendor-os +ã¨è§£é‡ˆã—ã€ãã‚Œã«å¿œã˜ã¦ãƒžã‚¯ãƒ­ +.BR %_target , +.BR %_target_arch , +.B %_target_os +を設定ã™ã‚‹ã€‚ +.SS ビルドã¨å†ã‚³ãƒ³ãƒ‘イルã®ã‚ªãƒ—ション +rpm を使ã£ã¦ãƒ“ルドã™ã‚‹ã«ã¯ã€ä»–ã«ã‚‚ 2 ã¤ã®ã‚„ã‚Šæ–¹ãŒã‚る。 +.RS 0.2i +.PP +.BI "rpmbuild \-\-rebuild|\-\-recompile" " SOURCEPKG ..." +.RE +.PP +ã“ã®æ–¹æ³•ã§èµ·å‹•ã•ã‚ŒãŸå ´åˆã€ +.B rpmbuild +ã¯æŒ‡å®šã•ã‚ŒãŸã‚½ãƒ¼ã‚¹ãƒ‘ッケージをインストールã—〠+準備ã€ã‚³ãƒ³ãƒ‘イルã€ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã‚’è¡Œã†ã€‚ +ã•ã‚‰ã«ã€ +.B \-\-rebuild +ã®å ´åˆã€æ–°ãŸãªãƒã‚¤ãƒŠãƒªãƒ‘ッケージをビルドã™ã‚‹ã€‚ビルドã‹å®Œäº†ã—ãŸã‚‰ +ビルドディレクトリ㯠+.RB ( \-\-clean +を指定ã—ãŸå ´åˆã¨åŒæ§˜ã«)削除ã•ã‚Œã€ +パッケージã®ã‚½ãƒ¼ã‚¹ã¨ spec ファイルも削除ã•ã‚Œã‚‹ã€‚ +.SS "SHOWRC" +コマンド +.RS .02i +.PP +.B "rpmbuild \-\-showrc" +.RE +.PP +㯠+.B rpmbuild +ãŒä½¿ã†è¨­å®šãƒ•ã‚¡ã‚¤ãƒ«ã€ +.I rpmrc +㨠+.I macros +ã§ç¾åœ¨ã‚»ãƒƒãƒˆã•ã‚Œã¦ã„るオプションã™ã¹ã¦ã®å€¤ã‚’表示ã™ã‚‹ã€‚ +.SH ファイル +.SS "rpmrc ã®è¨­å®š" +.nf +\fI/usr/lib/rpm/rpmrc\fR +\fI/usr/lib/rpm/redhat/rpmrc\fR +\fI/etc/rpmrc\fR +\fI~/.rpmrc\fR +.fi +.SS マクロã®è¨­å®š +.nf +\fI/usr/lib/rpm/macros\fR +\fI/usr/lib/rpm/redhat/macros\fR +\fI/etc/rpm/macros\fR +\fI~/.rpmmacros\fR +.fi +.SS データベース +.nf +\fI/var/lib/rpm/Basenames\fR +\fI/var/lib/rpm/Conflictname\fR +\fI/var/lib/rpm/Dirnames\fR +\fI/var/lib/rpm/Filemd5s\fR +\fI/var/lib/rpm/Group\fR +\fI/var/lib/rpm/Installtid\fR +\fI/var/lib/rpm/Name\fR +\fI/var/lib/rpm/Packages\fR +\fI/var/lib/rpm/Providename\fR +\fI/var/lib/rpm/Provideversion\fR +\fI/var/lib/rpm/Pubkeys\fR +\fI/var/lib/rpm/Removed\fR +\fI/var/lib/rpm/Requirename\fR +\fI/var/lib/rpm/Requireversion\fR +\fI/var/lib/rpm/Sha1header\fR +\fI/var/lib/rpm/Sigmd5\fR +\fI/var/lib/rpm/Triggername\fR +.fi +.SS 一時ファイル +\fI/var/tmp/rpm*\fR +.SH 関連項目 +.BR popt (3), +.BR rpm2cpio (8), +.BR gendiff (1), +.BR rpm (8), +.nf + +.UR http://www.rpm.org/ +.B http://www.rpm.org/ +.UE +.fi +.SH 著者 +.nf +Marc Ewing +Jeff Johnson +Erik Troan +.fi diff --git a/rpm-5.4.9/doc/ja/rpmcache.8 b/rpm-5.4.9/doc/ja/rpmcache.8 new file mode 100644 index 0000000..1d590d8 --- /dev/null +++ b/rpm-5.4.9/doc/ja/rpmcache.8 @@ -0,0 +1,153 @@ +.\" This manpage has been automatically generated by docbook2man +.\" from a DocBook document. This tool can be found at: +.\" +.\" Please send any bug reports, improvements, comments, patches, +.\" etc. to Steve Cheng . +.\" +.\" This program is free software; you can redistribute it and/or modify +.\" it under the terms of the GNU General Public License as published by +.\" the Free Software Foundation; either version 2, or (at your option) +.\" any later version. +.\" +.\" This program is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with this program; if not, write to the Free Software +.\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +.\" USA. +.\" +.\" Japanese Version Copyright (C) 2003 System Design and Research +.\" Institute Co.,Ltd. All rights reserved. +.\" +.\" Translated 14 March 2003 by +.\" System Design and Research Institute Co.,Ltd. +.\" +.\"WORD: RFE 改善è¦æ±‚ (Request For Enhancement) +.\" +.TH "RPMCACHE" "8" "05 July 2002" "Red Hat, Inc." "Red Hat Linux" +.SH åå‰ +rpmcache \- RPM パッケージã®ã¸ãƒƒãƒ€æƒ…報をキャッシュã™ã‚‹ +.SH æ›¸å¼ +\fBrpmcache\fR [ \fB\fIPACKAGE_NAME\fB\fR\fI ...\fR ] +.SH 説明 +.B rpmcache +ã¯ãƒ•ã‚¡ã‚¤ãƒ«ãƒ„リーを歩ãã¾ã‚ã‚Š(リモートã®\fBFTP\fRã‹ã‚‚ã—ã‚Œãªã„)〠+.BR glob (7) +ã®å¼ã‚’使ã£ã¦ãƒ‘スをフィルタリングã—ã€rpm パッケージã®ã¸ãƒƒãƒ€ã‚’読ã¿è¾¼ã‚€ã€‚ +最新ã®(ã™ãªã‚ã¡åŒã˜ãƒ‘ッケージåã®ã‚‚ã®ã«å¯¾ã—〠+パッケージã®ã‚¨ãƒãƒƒã‚¯ãƒ»ãƒãƒ¼ã‚¸ãƒ§ãƒ³ãƒ»ãƒªãƒªãƒ¼ã‚¹ã‚’比較ã—〠+ãã‚ŒãŒåŒã˜ã§ã‚ã‚Œã°ãƒ“ルド日付を使ã£ã¦æ¯”較ã—ãŸ)パッケージã®ã¸ãƒƒãƒ€ãƒ¼ãŒ +ä»–ã®ã‚‚ã®ã¨é‡è¤‡ã—ãªã‘ã‚Œã°ã€rpm データベースã«ã‚­ãƒ£ãƒƒã‚·ãƒ¥ã•ã‚Œã‚‹ã€‚ +ä¸æ˜Žãªä¾å­˜æ€§ã‚’解消ã™ã‚‹ãƒ‘ッケージã®å ´æ‰€ã‚’æ案ã™ã‚‹ãŸã‚ã«ã€rpm データベース㮠+キャッシュを利用ã™ã‚‹ã“ã¨ãŒã§ãる。 +.PP +.B rpmcache +固有ã®ã‚ªãƒ—ションã¯ãªã〠+.B rpm +関連ã®ãƒ„ールã§å…±é€šã®ã‚ªãƒ—ションã ã‘ã§ã‚る。 +ç¾æ™‚点ã§ä½•ãŒå®Ÿè£…ã•ã‚Œã¦ã„ã‚‹ã‹ã«ã¤ã„ã¦ã¯ã€ +.B rpmcache +ã®ä½¿ç”¨æ–¹æ³•ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸(訳注: "rpmcache \-\-help")ã‚’å‚ç…§ã®ã“ã¨ã€‚ +.PP +検索対象ã®ãƒ•ã‚¡ã‚¤ãƒ«ãƒ„リーã®å ´æ‰€ã¯ rpm マクロを使ã£ã¦è¨­å®šã•ã‚Œã‚‹ã€‚ +最終的ãªå ´æ‰€ã¯ã€ç‹¬ç«‹ã—㟠5 ã¤ã®è¦ç´ ã‚’çµåˆã—ãŸã‚‚ã®ã§ã‚る。 +.B rpmcache +を設定ã™ã‚‹ã®ã«ä½¿ç”¨ã•ã‚Œã‚‹ãƒžã‚¯ãƒ­åを以下ã«ç¤ºã™ã€‚ +下記ã®è¡¨ç¤ºé †ã¨åŒã˜é †ç•ªã§å„è¦ç´ ãŒçµåˆã•ã‚Œã¦ã€ +検索ã•ã‚Œã‚‹ãƒ•ã‚¡ã‚¤ãƒ«ãƒ„リーã®å ´æ‰€ãŒç”Ÿæˆã•ã‚Œã‚‹ã€‚ +.TP +\fB%_bhpath\fR +"path"レベル。 +検索ã•ã‚Œã‚‹ãƒ•ã‚¡ã‚¤ãƒ«ãƒ„リーã®ãƒ‘ス(ã¾ãŸã¯ URL)ã®å…ˆé ­éƒ¨åˆ†ã€‚ +.BR glob (7) +ã®å¼ã¯ã“ã“ã§ã¯ä½¿ãˆãªã„。 +.TP +\fB%_bhcoll\fR +"collection" レベル。 +\fB%_bhpath\fR ã®ã‚µãƒ–ディレクトリーã«ãƒžãƒƒãƒã™ã‚‹æ–‡å­—列(ã¾ãŸã¯ +.BR glob (7) +å¼)。 +.TP +\fB%_bhN\fR +"name" レベル。 +\fB%_bhcoll\fR ã®ã‚µãƒ–ディレクトリーã«ãƒžãƒƒãƒã™ã‚‹æ–‡å­—列(ã¾ãŸã¯ +.BR glob (7) +å¼)。 +Red Hat ビルドシステム内ã§ã®ã„ãšã‚Œã‹ã®ç‰¹å®šã®ãƒ‘ッケージåã«ãƒžãƒƒãƒã™ã‚‹ã‚ˆ +ã†ãª +.BR glob (7) +å¼ã‚’構æˆã™ã‚‹ãŸã‚ã« +.I PACKAGE_NAME +引数ãŒä½¿ç”¨ã•ã‚Œã‚‹ã€‚ +ã»ã¼ç¢ºå®Ÿã«ã€Red Hat 以外ã®äººé–“ãŒä½¿ç”¨ã™ã‚‹ã“ã¨ã¯ãªã„ã ã‚ã†ã€‚ +.TP +\fB%_bhVR\fR +"version-release" レベル。 +\fB%_bhN\fR ã®ã‚µãƒ–ディレクトリーã«ãƒžãƒƒãƒã™ã‚‹æ–‡å­—列(ã¾ãŸã¯ +.BR glob (7) +å¼)。 +.TP +\fB%_bhA\fR +"arch" レベル。 +\fB%_bhVR\fR ã®ã‚µãƒ–ディレクトリーã«ãƒžãƒƒãƒã™ã‚‹æ–‡å­—列(ã¾ãŸã¯ +.BR glob (7) +å¼)。 +.PP +キャッシュデータベースã®å ´æ‰€ã‚‚ã¾ãŸã€ä»¥ä¸‹ã®ãƒžã‚¯ãƒ­ã‚’使用ã—ã¦è¨­å®šã•ã‚Œã‚‹ã€‚ +.TP +\fB%_cache_dbpath\fR +キャッシュデータベースã®å ´æ‰€ã€‚デフォルト㯠+.IR /var/spool/up2date/cache 。 +.PP +キャッシュデータベースã®ãƒ•ã‚©ãƒ¼ãƒžãƒƒãƒˆã¯ rpm データベースã®ã‚‚ã®ã¨ç­‰ã—ã〠+コマンドライン㮠+.B rpm +ã‹ã‚‰åˆ©ç”¨ã™ã‚‹ã“ã¨ãŒã§ãる。 +例ãˆã°ã€ãƒ‘ッケージã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã«å¿…è¦ãªä¾å­˜æ€§ã‚’満ãŸã™ãƒ‘ッケージを +æ案ã™ã‚‹ãŸã‚ã«ã‚­ãƒ£ãƒƒã‚·ãƒ¥ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã‚’利用ã™ã‚‹ã«ã¯ã€ä»¥ä¸‹ã®è¨­å®šãŒ +.I /etc/rpm/macros +ã¾ãŸã¯ +.I ~/.rpmmacros +ã«å¿…è¦ã§ã‚る。 +.TP +\fB%_solve_dbpath\fR +ä¾å­˜æ€§ã‚’解決ã™ã‚‹æ案ã®ãŸã‚ã«ä½¿ç”¨ã•ã‚Œã‚‹ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã®å ´æ‰€ã€‚ +.SS Red Hat beehive ツリーã®ãŸã‚ã®(最低é™ã®)設定例 +訳注: beehive ã¯å¤šåˆ†ã€Red Hat 内部ã®ä½•ã‚‰ã‹ã®åå‰ã€‚ +.PP +.nf +%_cache_dbpath /var/spool/up2date/cache +%_solve_dbpath %{_cache_dbpath} +%_bhpath file://localhost/mnt/redhat/beehive/comps/dist +%_bhcoll 7.3 +%_bhN @(basesystem|bash|filesystem|glibc-common|glibc|ldconfig|libtermcap|mktemp|setup|termcap) +%_bhVR * +%_bhA @(i[3456]86|noarch) +.fi +.SS Red Hat ã® FTP ツリーã®ãŸã‚ã®(最å°)設定例 +.nf +%_cache_dbpath /var/spool/up2date/cache +%_solve_dbpath %{_cache_dbpath} +%_bhpath ftp://localhost/mnt/dist +%_bhcoll @(7.3|7.2|7.1|7.0|6.2|6.1|6.0|5.2|5.1|5.0) +%_bhN @(%{_arch}) +%_bhVR * +%_bhA @(i[3456]86|noarch) +.fi +.SH ãƒã‚° +rpm-devel パッケージã«å¯¾ã™ã‚‹ãƒã‚°å ±å‘Šã‚„改善è¦æ±‚ã¯ã€bugzilla +.UR http://bugzilla.redhat.com/ +http://bugzilla.redhat.com/ +.UE +を使ã£ã¦æ¬²ã—ã„。 +.SH 関連項目 +.BR rpm (8), +.BR glob (7), +.UR http://www.rpm.org/ +.B http://www.rpm.org/ +.UE +.SH 著者 +Jeff Johnson diff --git a/rpm-5.4.9/doc/ja/rpmgraph.8 b/rpm-5.4.9/doc/ja/rpmgraph.8 new file mode 100644 index 0000000..e1d6a15 --- /dev/null +++ b/rpm-5.4.9/doc/ja/rpmgraph.8 @@ -0,0 +1,74 @@ +.\" This manpage has been automatically generated by docbook2man +.\" from a DocBook document. This tool can be found at: +.\" +.\" Please send any bug reports, improvements, comments, patches, +.\" etc. to Steve Cheng . +.\" +.\" This program is free software; you can redistribute it and/or modify +.\" it under the terms of the GNU General Public License as published by +.\" the Free Software Foundation; either version 2, or (at your option) +.\" any later version. +.\" +.\" This program is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with this program; if not, write to the Free Software +.\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +.\" USA. +.\" +.\" Japanese Version Copyright (C) 2003 System Design and Research +.\" Institute Co.,Ltd. All rights reserved. +.\" +.\" Translated 14 March 2003 by +.\" System Design and Research Institute Co.,Ltd. +.\" +.\"WORD: directed graph 有å‘グラフ +.\"WORD: patrial order åŠé †åº +.\"WORD: topological sort トãƒãƒ­ã‚¸ã‚«ãƒ«ãƒ»ã‚½ãƒ¼ãƒˆ +.\" +.TH "RPMGRAPH" "8" "30 June 2002" "Red Hat, Inc." "Red Hat Linux" +.SH åå‰ +rpmgraph \- RPM パッケージã®ä¾å­˜ã‚°ãƒ©ãƒ•ã®è¡¨ç¤º +.SH æ›¸å¼ +.B rpmgraph +.I "PACKAGE_FILE ..." +.SH 説明 +.B rpmgraph +ã¯ãƒ‘ッケージã®ä¾å­˜ã‚°ãƒ©ãƒ•ã‚’生æˆã™ã‚‹ãŸã‚ã« +.I PACKAGE_FILE +を使用ã™ã‚‹ã€‚引数 +.I PACKAGE_FILE +ã®ãã‚Œãžã‚ŒãŒèª­ã¿è¾¼ã¾ã‚Œã€rpm ã®ãƒˆãƒ©ãƒ³ã‚¶ã‚¯ã‚·ãƒ§ãƒ³ã¸ã¨è¿½åŠ ã•ã‚Œã‚‹ã€‚ +トランザクションã®è¦ç´ ã¯ãƒˆãƒãƒ­ã‚¸ã‚«ãƒ«ãƒ»ã‚½ãƒ¼ãƒˆã‚’使ã£ã¦åŠé †åºé–¢ä¿‚ã‚’æŒã¤ã€‚ +åŠé †åºã§é †åºä»˜ã‘ã•ã‚ŒãŸè¦ç´ ã¯æ¨™æº–出力ã«è¡¨ç¤ºã•ã‚Œã‚‹ã€‚ +.PP +ä¾å­˜ã‚°ãƒ©ãƒ•ã®ãƒŽãƒ¼ãƒ‰ã¯ãƒ‘ッケージåã§ã€æœ‰å‘グラフã®è¾ºã¯å„ノードã®è¦ªã‚’示ã™ã€‚ +親ノードã®å®šç¾©ã¯ã€ãƒ‘ッケージã®ä¾å­˜é–¢ä¿‚を使ã£ã¦åŠé †åºé–¢ä¿‚ã§é †åºä»˜ã‘ã•ã‚ŒãŸ +パッケージã®æœ€å¾Œã®å…ˆç¥–ã§ã‚る。 +ã“ã‚Œã¯ã€ä¸Žãˆã‚‰ã‚ŒãŸãƒ‘ッケージã®è¦ªãŒã€ãã®ãƒ‘ッケージã®æœ€å¾Œã®å¿…è¦æ¡ä»¶ã¨ãªã‚‹ +ã“ã¨ã‚’æ„味ã™ã‚‹ã€‚ +.PP +出力㯠+.BR dot (1) +ã®æœ‰å‘グラフフォーマットã§ã€ +.B graphviz +パッケージã«å«ã¾ã‚Œã‚‹ã‚°ãƒ©ãƒ•ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ +.B dotty +を使ã£ã¦è¡¨ç¤ºã—ãŸã‚Šå°åˆ·ã—ãŸã‚Šã§ãる。 +.B rpmgraph +固有ã®ã‚ªãƒ—ションã¯ãªã〠+.B rpm +関連ツールã§å…±é€šã®ã‚ªãƒ—ションã ã‘ã§ã‚る。 +ç¾æ™‚点ã§ä½•ãŒå®Ÿè£…ã•ã‚Œã¦ã„ã‚‹ã‹ã«ã¤ã„ã¦ã¯ã€ +.B rpmgraph +ã®ä½¿ç”¨æ–¹æ³•ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸(訳注: "rpmgraph \-\-help")ã‚’å‚ç…§ã®ã“ã¨ã€‚ +.SH 関連項目 +.BR dot "(1), " dotty "(1)," +.UR http://www.graphviz.org/ +.B http://www.graphviz.org/ +.UE +.SH 著者 +Jeff Johnson diff --git a/rpm-5.4.9/doc/ko/Makefile.am b/rpm-5.4.9/doc/ko/Makefile.am new file mode 100644 index 0000000..a9e9025 --- /dev/null +++ b/rpm-5.4.9/doc/ko/Makefile.am @@ -0,0 +1,21 @@ +## Process this file with automake to produce Makefile.in + +@SET_MAKE@ + +man_MANS = rpm.8 rpm2cpio.8 +mandir = @mandir@/ko + +EXTRA_DIST = $(man_MANS) + +install-data-hook: +if WITH_PATH_VERSIONED + -for p in $(man_MANS); do \ + case "$$p" in \ + *.1 ) mv $(DESTDIR)$(man1dir)/$${p} \ + `echo "$(DESTDIR)$(man1dir)/$${p}" | sed 's/\.1$$/-$(VERSION).1/'` ;; \ + *.8 ) mv $(DESTDIR)$(man8dir)/$${p} \ + `echo "$(DESTDIR)$(man8dir)/$${p}" | sed 's/\.8$$/-$(VERSION).8/'` ;; \ + esac; \ + done +endif + diff --git a/rpm-5.4.9/doc/ko/Makefile.in b/rpm-5.4.9/doc/ko/Makefile.in new file mode 100644 index 0000000..7212b8b --- /dev/null +++ b/rpm-5.4.9/doc/ko/Makefile.in @@ -0,0 +1,820 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +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@ +target_triplet = @target@ +subdir = doc/ko +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +man8dir = $(mandir)/man8 +am__installdirs = "$(DESTDIR)$(man8dir)" +NROFF = nroff +MANS = $(man_MANS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDROOTDIR_MACRO = @BUILDROOTDIR_MACRO@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBAPI = @DBAPI@ +DBLIBOBJS = @DBLIBOBJS@ +DBLIBSRCS = @DBLIBSRCS@ +DBPATH = @DBPATH@ +DBPATH_MACRO = @DBPATH_MACRO@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTRO_MACROS = @DISTRO_MACROS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIXPERMS = @FIXPERMS@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GPSEE_MODULES_PATH = @GPSEE_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_STATIC = @LDFLAGS_STATIC@ +LD_VERSION_SCRIPT_FLAG = @LD_VERSION_SCRIPT_FLAG@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOLIZE = @LIBTOOLIZE@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MACROFILES = @MACROFILES@ +MAGIC_MACRO = @MAGIC_MACRO@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR = @MKDIR@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NCPUS_COMMAND = @NCPUS_COMMAND@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENMP_CFLAGS = @OPENMP_CFLAGS@ +OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_INSTALLDIRS = @PERL_INSTALLDIRS@ +PERL_URPM_INSTALLDIRS = @PERL_URPM_INSTALLDIRS@ +PKGSRCDIR = @PKGSRCDIR@ +PKGSRCDIR_MACRO = @PKGSRCDIR_MACRO@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +ROOT_GROUP = @ROOT_GROUP@ +RPMCANONARCH = @RPMCANONARCH@ +RPMCANONCOLOR = @RPMCANONCOLOR@ +RPMCANONGNU = @RPMCANONGNU@ +RPMCANONOS = @RPMCANONOS@ +RPMCANONVENDOR = @RPMCANONVENDOR@ +RPMGID = @RPMGID@ +RPMGROUP = @RPMGROUP@ +RPMLUAFILES = @RPMLUAFILES@ +RPMPOPTFILES = @RPMPOPTFILES@ +RPMUID = @RPMUID@ +RPMUSER = @RPMUSER@ +RPM_TIMESTAMP = @RPM_TIMESTAMP@ +RPM_VENDOR = @RPM_VENDOR@ +RPM_VERSION = @RPM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFIGDIR = @SYSCONFIGDIR@ +USE_NLS = @USE_NLS@ +USRLIBRPM = @USRLIBRPM@ +VERSION = @VERSION@ +WITH_ACL = @WITH_ACL@ +WITH_APIDOCS = @WITH_APIDOCS@ +WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ +WITH_APR = @WITH_APR@ +WITH_ATERM = @WITH_ATERM@ +WITH_ATTR = @WITH_ATTR@ +WITH_AUGEAS = @WITH_AUGEAS@ +WITH_AUGEAS_AUGTOOL = @WITH_AUGEAS_AUGTOOL@ +WITH_BASH = @WITH_BASH@ +WITH_BASH_CPPFLAGS = @WITH_BASH_CPPFLAGS@ +WITH_BASH_LDFLAGS = @WITH_BASH_LDFLAGS@ +WITH_BASH_LIBS = @WITH_BASH_LIBS@ +WITH_BASH_SUBDIR = @WITH_BASH_SUBDIR@ +WITH_BEECRYPT = @WITH_BEECRYPT@ +WITH_BEECRYPT_CPPFLAGS = @WITH_BEECRYPT_CPPFLAGS@ +WITH_BEECRYPT_LDFLAGS = @WITH_BEECRYPT_LDFLAGS@ +WITH_BEECRYPT_LIBS = @WITH_BEECRYPT_LIBS@ +WITH_BEECRYPT_SUBDIR = @WITH_BEECRYPT_SUBDIR@ +WITH_BZIP2 = @WITH_BZIP2@ +WITH_CPUINFO = @WITH_CPUINFO@ +WITH_CUDF = @WITH_CUDF@ +WITH_CUDF_CUDFTOOL = @WITH_CUDF_CUDFTOOL@ +WITH_DB = @WITH_DB@ +WITH_DBSQL = @WITH_DBSQL@ +WITH_DBSQL_CPPFLAGS = @WITH_DBSQL_CPPFLAGS@ +WITH_DBSQL_LDFLAGS = @WITH_DBSQL_LDFLAGS@ +WITH_DBSQL_LIBS = @WITH_DBSQL_LIBS@ +WITH_DBSQL_SUBDIR = @WITH_DBSQL_SUBDIR@ +WITH_DB_CPPFLAGS = @WITH_DB_CPPFLAGS@ +WITH_DB_LDFLAGS = @WITH_DB_LDFLAGS@ +WITH_DB_LIBS = @WITH_DB_LIBS@ +WITH_DB_SUBDIR = @WITH_DB_SUBDIR@ +WITH_DMALLOC = @WITH_DMALLOC@ +WITH_EFENCE = @WITH_EFENCE@ +WITH_EXPAT = @WITH_EXPAT@ +WITH_FICL = @WITH_FICL@ +WITH_FICL_CPPFLAGS = @WITH_FICL_CPPFLAGS@ +WITH_FICL_LDFLAGS = @WITH_FICL_LDFLAGS@ +WITH_FICL_LIBS = @WITH_FICL_LIBS@ +WITH_FICL_SUBDIR = @WITH_FICL_SUBDIR@ +WITH_FILE = @WITH_FILE@ +WITH_FILE_CPPFLAGS = @WITH_FILE_CPPFLAGS@ +WITH_FILE_LDFLAGS = @WITH_FILE_LDFLAGS@ +WITH_FILE_LIBS = @WITH_FILE_LIBS@ +WITH_FILE_SUBDIR = @WITH_FILE_SUBDIR@ +WITH_GCRYPT = @WITH_GCRYPT@ +WITH_GNUTLS = @WITH_GNUTLS@ +WITH_GPSEE = @WITH_GPSEE@ +WITH_GPSEE_CPPFLAGS = @WITH_GPSEE_CPPFLAGS@ +WITH_GPSEE_LDFLAGS = @WITH_GPSEE_LDFLAGS@ +WITH_GPSEE_LIBS = @WITH_GPSEE_LIBS@ +WITH_GPSEE_SUBDIR = @WITH_GPSEE_SUBDIR@ +WITH_JS_SUBDIR = @WITH_JS_SUBDIR@ +WITH_KEYUTILS = @WITH_KEYUTILS@ +WITH_KEYUTILS_RPMKEY = @WITH_KEYUTILS_RPMKEY@ +WITH_LIBELF_DEBUGEDIT = @WITH_LIBELF_DEBUGEDIT@ +WITH_LIBGIT2 = @WITH_LIBGIT2@ +WITH_LIBGIT2_CPPFLAGS = @WITH_LIBGIT2_CPPFLAGS@ +WITH_LIBGIT2_LDFLAGS = @WITH_LIBGIT2_LDFLAGS@ +WITH_LIBGIT2_LIBS = @WITH_LIBGIT2_LIBS@ +WITH_LIBGIT2_SUBDIR = @WITH_LIBGIT2_SUBDIR@ +WITH_LIBTASN1 = @WITH_LIBTASN1@ +WITH_LUA = @WITH_LUA@ +WITH_LUA_CPPFLAGS = @WITH_LUA_CPPFLAGS@ +WITH_LUA_LDFLAGS = @WITH_LUA_LDFLAGS@ +WITH_LUA_LIBS = @WITH_LUA_LIBS@ +WITH_LUA_SUBDIR = @WITH_LUA_SUBDIR@ +WITH_LUA_SUBDIR_DEF = @WITH_LUA_SUBDIR_DEF@ +WITH_LUA_SUBDIR_LIB = @WITH_LUA_SUBDIR_LIB@ +WITH_MOZJS185 = @WITH_MOZJS185@ +WITH_MOZJS185_CPPFLAGS = @WITH_MOZJS185_CPPFLAGS@ +WITH_MOZJS185_LDFLAGS = @WITH_MOZJS185_LDFLAGS@ +WITH_MOZJS185_LIBS = @WITH_MOZJS185_LIBS@ +WITH_MOZJS185_SUBDIR = @WITH_MOZJS185_SUBDIR@ +WITH_NEON = @WITH_NEON@ +WITH_NEON_CPPFLAGS = @WITH_NEON_CPPFLAGS@ +WITH_NEON_LDFLAGS = @WITH_NEON_LDFLAGS@ +WITH_NEON_LIBS = @WITH_NEON_LIBS@ +WITH_NEON_SUBDIR = @WITH_NEON_SUBDIR@ +WITH_NIX = @WITH_NIX@ +WITH_NSS = @WITH_NSS@ +WITH_OPENSSL = @WITH_OPENSSL@ +WITH_PAKCHOIS = @WITH_PAKCHOIS@ +WITH_PATH_VERSIONED = @WITH_PATH_VERSIONED@ +WITH_PATH_VERSIONED_SUFFIX = @WITH_PATH_VERSIONED_SUFFIX@ +WITH_PCRE = @WITH_PCRE@ +WITH_PCRE_CPPFLAGS = @WITH_PCRE_CPPFLAGS@ +WITH_PCRE_LDFLAGS = @WITH_PCRE_LDFLAGS@ +WITH_PCRE_LIBS = @WITH_PCRE_LIBS@ +WITH_PCRE_SUBDIR = @WITH_PCRE_SUBDIR@ +WITH_PERLEMBED = @WITH_PERLEMBED@ +WITH_PERL_LIBS = @WITH_PERL_LIBS@ +WITH_PERL_SUBDIR = @WITH_PERL_SUBDIR@ +WITH_PERL_SUBPACKAGE = @WITH_PERL_SUBPACKAGE@ +WITH_PERL_URPM_LIBS = @WITH_PERL_URPM_LIBS@ +WITH_PERL_URPM_SUBDIR = @WITH_PERL_URPM_SUBDIR@ +WITH_PERL_URPM_SUBPACKAGE = @WITH_PERL_URPM_SUBPACKAGE@ +WITH_POPT = @WITH_POPT@ +WITH_POPT_CPPFLAGS = @WITH_POPT_CPPFLAGS@ +WITH_POPT_LDFLAGS = @WITH_POPT_LDFLAGS@ +WITH_POPT_LIBS = @WITH_POPT_LIBS@ +WITH_POPT_SUBDIR = @WITH_POPT_SUBDIR@ +WITH_PYTHONEMBED = @WITH_PYTHONEMBED@ +WITH_PYTHON_INCDIR = @WITH_PYTHON_INCDIR@ +WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ +WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ +WITH_RC = @WITH_RC@ +WITH_RC_CPPFLAGS = @WITH_RC_CPPFLAGS@ +WITH_RC_LDFLAGS = @WITH_RC_LDFLAGS@ +WITH_RC_LIBS = @WITH_RC_LIBS@ +WITH_RC_SUBDIR = @WITH_RC_SUBDIR@ +WITH_READLINE = @WITH_READLINE@ +WITH_RUBY = @WITH_RUBY@ +WITH_RUBY_CPPFLAGS = @WITH_RUBY_CPPFLAGS@ +WITH_RUBY_SUBDIR = @WITH_RUBY_SUBDIR@ +WITH_RUBY_VENDORARCHDIR = @WITH_RUBY_VENDORARCHDIR@ +WITH_SELINUX = @WITH_SELINUX@ +WITH_SEMANAGE = @WITH_SEMANAGE@ +WITH_SEMANAGE_SEMODULE = @WITH_SEMANAGE_SEMODULE@ +WITH_SEPOL = @WITH_SEPOL@ +WITH_SPIDERMONKEY_SUBDIR = @WITH_SPIDERMONKEY_SUBDIR@ +WITH_SQLITE = @WITH_SQLITE@ +WITH_SQLITE_CPPFLAGS = @WITH_SQLITE_CPPFLAGS@ +WITH_SQLITE_LDFLAGS = @WITH_SQLITE_LDFLAGS@ +WITH_SQLITE_LIBS = @WITH_SQLITE_LIBS@ +WITH_SQLITE_SUBDIR = @WITH_SQLITE_SUBDIR@ +WITH_SQUIRREL = @WITH_SQUIRREL@ +WITH_SUBVERSION = @WITH_SUBVERSION@ +WITH_SYCK = @WITH_SYCK@ +WITH_SYCK_CPPFLAGS = @WITH_SYCK_CPPFLAGS@ +WITH_SYCK_LDFLAGS = @WITH_SYCK_LDFLAGS@ +WITH_SYCK_LIBS = @WITH_SYCK_LIBS@ +WITH_SYCK_SUBDIR = @WITH_SYCK_SUBDIR@ +WITH_TCL = @WITH_TCL@ +WITH_TCL_SUBDIR = @WITH_TCL_SUBDIR@ +WITH_TOMCRYPT = @WITH_TOMCRYPT@ +WITH_TPM = @WITH_TPM@ +WITH_UNIXODBC = @WITH_UNIXODBC@ +WITH_UUID = @WITH_UUID@ +WITH_XAR = @WITH_XAR@ +WITH_XAR_CPPFLAGS = @WITH_XAR_CPPFLAGS@ +WITH_XAR_LDFLAGS = @WITH_XAR_LDFLAGS@ +WITH_XAR_LIBS = @WITH_XAR_LIBS@ +WITH_XAR_SUBDIR = @WITH_XAR_SUBDIR@ +WITH_XZ = @WITH_XZ@ +WITH_XZ_CPPFLAGS = @WITH_XZ_CPPFLAGS@ +WITH_XZ_LDFLAGS = @WITH_XZ_LDFLAGS@ +WITH_XZ_LIBS = @WITH_XZ_LIBS@ +WITH_XZ_SUBDIR = @WITH_XZ_SUBDIR@ +WITH_ZLIB = @WITH_ZLIB@ +WITH_ZLIB_CPPFLAGS = @WITH_ZLIB_CPPFLAGS@ +WITH_ZLIB_LDFLAGS = @WITH_ZLIB_LDFLAGS@ +WITH_ZLIB_LIBS = @WITH_ZLIB_LIBS@ +WITH_ZLIB_SUBDIR = @WITH_ZLIB_SUBDIR@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__BASH = @__BASH@ +__BZIP2 = @__BZIP2@ +__CAT = @__CAT@ +__CHATTR = @__CHATTR@ +__CHGRP = @__CHGRP@ +__CHGRP_RHF = @__CHGRP_RHF@ +__CHMOD = @__CHMOD@ +__CHOWN = @__CHOWN@ +__CHOWN_RHF = @__CHOWN_RHF@ +__CMAKE = @__CMAKE@ +__CPIO = @__CPIO@ +__CURL = @__CURL@ +__CVS = @__CVS@ +__DBSQL = @__DBSQL@ +__DB_ARCHIVE = @__DB_ARCHIVE@ +__DB_CHECKPOINT = @__DB_CHECKPOINT@ +__DB_DEADLOCK = @__DB_DEADLOCK@ +__DB_DUMP = @__DB_DUMP@ +__DB_HOTBACKUP = @__DB_HOTBACKUP@ +__DB_LOAD = @__DB_LOAD@ +__DB_LOG_VERIFY = @__DB_LOG_VERIFY@ +__DB_PRINTLOG = @__DB_PRINTLOG@ +__DB_RECOVER = @__DB_RECOVER@ +__DB_REPLICATE = @__DB_REPLICATE@ +__DB_SQL_CODEGEN = @__DB_SQL_CODEGEN@ +__DB_STAT = @__DB_STAT@ +__DB_TUNER = @__DB_TUNER@ +__DB_UPGRADE = @__DB_UPGRADE@ +__DB_VERIFY = @__DB_VERIFY@ +__DIFF = @__DIFF@ +__DITTO = @__DITTO@ +__DOXYGEN = @__DOXYGEN@ +__FILE = @__FILE@ +__GIT = @__GIT@ +__GPG = @__GPG@ +__GSR = @__GSR@ +__GST_INSPECT = @__GST_INSPECT@ +__GZIP = @__GZIP@ +__HG = @__HG@ +__ID = @__ID@ +__ID_U = @__ID_U@ +__INSTALL = @__INSTALL@ +__INSTALL_INFO = @__INSTALL_INFO@ +__LD = @__LD@ +__LDCONFIG = @__LDCONFIG@ +__LN = @__LN@ +__LRZIP = @__LRZIP@ +__LSATTR = @__LSATTR@ +__LZIP = @__LZIP@ +__LZMA = @__LZMA@ +__LZOP = @__LZOP@ +__MAKE = @__MAKE@ +__MKDIR = @__MKDIR@ +__MKDIR_P = @__MKDIR_P@ +__MODINFO = @__MODINFO@ +__MONGO = @__MONGO@ +__MV = @__MV@ +__NM = @__NM@ +__OBJCOPY = @__OBJCOPY@ +__OBJDUMP = @__OBJDUMP@ +__PATCH = @__PATCH@ +__PAX = @__PAX@ +__PERL = @__PERL@ +__PGP = @__PGP@ +__PHP = @__PHP@ +__PYTHON = @__PYTHON@ +__RM = @__RM@ +__RMDIR = @__RMDIR@ +__RSH = @__RSH@ +__RUBY = @__RUBY@ +__SED = @__SED@ +__SH = @__SH@ +__SQLITE3 = @__SQLITE3@ +__SSH = @__SSH@ +__STRIP = @__STRIP@ +__SVN = @__SVN@ +__TAR = @__TAR@ +__TCLSH = @__TCLSH@ +__UNZIP = @__UNZIP@ +__XZ = @__XZ@ +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_CXX = @ac_ct_CXX@ +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@ +autorelocate_dcolor = @autorelocate_dcolor@ +autorelocate_path = @autorelocate_path@ +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@ +exeext = @exeext@ +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@ +libext = @libext@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@/ko +mkdir_p = @mkdir_p@ +objext = @objext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +shlibext = @shlibext@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +testdir = @testdir@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrprefix = @usrprefix@ +varprefix = @varprefix@ +man_MANS = rpm.8 rpm2cpio.8 +EXTRA_DIST = $(man_MANS) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 doc/ko/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign doc/ko/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man8: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(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='$(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) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically \`make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi + @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 $(MANS) +installdirs: + for dir in "$(DESTDIR)$(man8dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-man + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +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-man8 + +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-man + +uninstall-man: uninstall-man8 + +.MAKE: install-am install-data-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + 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-hook install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man8 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 uninstall uninstall-am uninstall-man uninstall-man8 + + +@SET_MAKE@ + +install-data-hook: +@WITH_PATH_VERSIONED_TRUE@ -for p in $(man_MANS); do \ +@WITH_PATH_VERSIONED_TRUE@ case "$$p" in \ +@WITH_PATH_VERSIONED_TRUE@ *.1 ) mv $(DESTDIR)$(man1dir)/$${p} \ +@WITH_PATH_VERSIONED_TRUE@ `echo "$(DESTDIR)$(man1dir)/$${p}" | sed 's/\.1$$/-$(VERSION).1/'` ;; \ +@WITH_PATH_VERSIONED_TRUE@ *.8 ) mv $(DESTDIR)$(man8dir)/$${p} \ +@WITH_PATH_VERSIONED_TRUE@ `echo "$(DESTDIR)$(man8dir)/$${p}" | sed 's/\.8$$/-$(VERSION).8/'` ;; \ +@WITH_PATH_VERSIONED_TRUE@ esac; \ +@WITH_PATH_VERSIONED_TRUE@ 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/rpm-5.4.9/doc/ko/rpm.8 b/rpm-5.4.9/doc/ko/rpm.8 new file mode 100644 index 0000000..2872209 --- /dev/null +++ b/rpm-5.4.9/doc/ko/rpm.8 @@ -0,0 +1,356 @@ +.\" rpm - Red Hat Package Manager +.TH rpm 8 "1996é° 7æ‰ 15æž" "傾çƒåª’ 社覗闘裾嬢" "傾çƒåª’ 軒勘什" +.SH 戚硯 +rpm \- 傾çƒåª’ 鳶徹走 淫軒切 +.SH 鯵推 +\fBrpm\fP [è¾›èŠç´š] +.SH 竺誤 +\fBrpm\fP ç²¾ 悪径廃 \fI鳶徹走 淫軒切\fP 稽辞 +唖唖税 社覗闘裾嬢 鳶徹走研 幻級壱 竺帖馬壱 霜庚馬壱 伊装馬壱 飴é‡é¦¬æ‚Ÿ +è–¦æš—æ‹ å‘ª 赤陥. +\fI鳶徹走\fP 空 ç«ºå¸–æ‹ é‰¢æžç´šå¼• 戚硯, ç„ç©¿, 竺誤 åŽ»è– +匂敗馬澗 鳶徹走 舛左研 走観 煽舌 鉢æžæˆšé™¥. + +奄沙旋昔 7 亜走 ç–‘æ‹™ 乞çƒäºœ 赤生悟 å”–å”– 陥献 è¾›èŠç´šè– æ¡æ¾—陥. +\fI竺帖\fP, \fI霜庚\fP, +\fI伊装\fP, \fI辞誤 溌昔\fP, \fI薦暗\fP, \fI薦拙\fP, +益軒壱 \fI汽戚斗今戚什 仙闇竺\fP 戚 郊稽 益ä¾æˆšé™¥. + +竺帖 乞çƒ: +.br +.I "\fB rpm \-i [竺帖辛èŠ] <鳶徹走 鉢æž>+\fP" +.br +霜庚 乞çƒ: +.br +.I "\fB rpm \-q [霜庚辛èŠ]\fP" +.br +伊装 乞çƒ: +.br +.I "\fB rpm \-V|\-y|\-\-verify [伊装辛èŠ]\fP" +.br +辞誤 溌昔 乞çƒ: +.br +.I "\fB rpm \-\-checksig <鳶徹走鉢æž>+\fP" +.br +薦暗 乞çƒ: +.br +.I "\fB rpm \-e <鳶徹走誤>+\fP" +.br +薦拙 乞çƒ: +.br +.I "\fB rpm \-b\fIO\fB [薦拙辛èŠ] <鳶徹走什薙>+\fP" +.br + +.SH æžé‹¼æ—‹ è¾›èŠ +陥製 è¾›èŠç´šç²¾ 唖奄 陥献 乞çƒæ‹­è¾žäº€ ç´«é‚亜管馬陥. +.IP "\fB\-vv\fP" +焼爽 切室馬惟 å·¨ç„ç„” 舛左研 窒径廃陥. +.IP "\fB\-\-keep\-temps\fP" +ç¸¾ç£ é‰¢æžè– 走酔走 çœæ¾—陥. (/tmp/rpm\-*). rpm è– å·¨ç„ç„”æ‹ å‡¶å¹» +爽稽 ç´«é‚廃陥. +.IP "\fB\-\-quiet\fP" +ç½®ä¼å»ƒ çª’å¾„è– åˆ‡è–¦é¦¬æ‚Ÿ 神稽走 æ‹­å› äº”å®¤èµ°å¹» 窒径廃陥. +.IP "\fB\-\-help\fP" +岨 希 延 ç´«é‚ç‹› 竺誤辞研 窒径廃陥. +.IP "\fB\-\-version\fP" +ç´«é‚ æŽ»æ˜” rpm 税 ç„ç©¿è– å»ƒ åŒç¨½ 妊ç£å»ƒé™¥. +.IP "\fB\-\-rcfile <鉢æž>\fP" +\fB/etc/rpmrc\fP æšæ¾— \fB$HOME/.rpmrc\fP è– ç´«é‚馬走 çœå£± +\fB\fP è– ç´«é‚馬亀系 廃陥. +.IP "\fB\-\-root \fP" +乞窮 疑拙拭 ä¼é¦¬é£Ÿ 置雌是 巨刑塘軒研 çˆ½å¬¢é­ å·¨åˆ‘å¡˜è»’ç¨½ 竺舛馬壱 拙穣廃陥. +森研 級嬢 ç«ºå¸–ç£ çˆ½å¬¢é­ å·¨åˆ‘å¡˜è»’ç ” / 虞壱 æŒå”–馬壱 益ä¾è– 奄層生稽 +竺帖背蟹娃陥. + +.SH 竺帖 è¾›èŠ +rpm 竺帖 誤敬税 æžé‹¼æ—‹æ˜” 莫殿澗 陥製引 旭陥. +.PP + \fBrpm \-i [竺帖辛èŠç´š] <鳶徹走鉢æž>+\fP +.PP +.IP "\fB\-\-force\fP" +\-\-replacepkgs, \-\-replacefiles, \-\-oldpackage ç ” 乞砧 ç´«é‚廃 ä¾å¼• +旭陥. +.IP "\fB\-h, \-\-hash\fP" +鳶徹走研 熱 凶 背習原滴(#)ç ” 妊ç£å»ƒé™¥. æ¥ å§å‘ªæ¾— 50 鯵戚陥. +岨 希 蟹精 çª’å¾„è– æ˜¯èƒŒè¾žæ¾— \fB\-v\fP ç ” 敗臆 ç´«é‚馬虞. +.IP "\fB\-\-oldpackage\fP" +歯稽錘 鳶徹走研 走酔壱 希 森穿 鳶徹走稽 å˜˜ç«¯æ‹ å‡¶ ç´«é‚廃陥. +.IP "\fB\-\-percent\fP" +鳶徹走 鉢æžè– 熱 凶 é湿闘 妊ç£ç ” 廃陥. 陥献 亀姥稽採斗 rpm è– æˆšé‚æ‹ å‡¶ +ç´«é‚æ‹ é¯‰æ—‹ç”Ÿç¨½ 幻級嬢然陥. +.IP "\fB\-\-replacefiles\fP" +戚耕 ç«ºå¸–å‰ é™¥çŒ® 鳶徹走税 鉢æžè– 気嬢床檎辞虞亀 鳶徹走研 悪薦稽 竺帖廃陥. +.IP "\fB\-\-replacepkgs\fP" +鳶徹走亜 戚耕 竺帖鞠嬢 赤陥 馬希虞亀 é™¥ç£ ç«ºå¸–å»ƒé™¥. +.IP "\fB\-\-root \fI<巨刑塘軒>\fP" +\fI<巨刑塘軒>\fPç ” 欠闘稽 馬澗 ç£ä»€å¥´æ‹­ 竺帖研 呪楳廃陥. +汽戚斗今戚什澗 \fI<巨刑塘軒>\fP 購拭辞 飴é‡éž å£± \fIpre\fP æšæ¾— \fIpost\fP +什滴験闘澗 \fI<巨刑塘軒>\fP稽 chroot() 廃 æ¿ å”æ¥³å–«è– ç¨Žè€•å»ƒé™¥. +.IP "\fB\-\-noscripts\fP" +preinstall, postinstall 什滴験闘研 å”楳馬走 çœæ¾—陥. +.IP "\fB\-\-excludedocs\fP" +庚辞虞壱 妊ç£éž å¬¢ 赤澗 鉢æž(固凪戚走人 texinfo 庚辞)ç²¾ 竺帖馬走 çœæ¾—陥. +.IP "\fB\-\-includedocs\fP" +庚辞 鉢æžè– 匂敗廃陥. 戚 è¾›èŠç²¾ rpmrc 鉢æžæ‹­ \fIexcludedocs: 1\fP 戚虞澗 +ä¾æˆš 誤ç£éž å¬¢ èµ¤è– å‡¶å¹» ç¶æŽ¨é¦¬é™¥. +.IP "\fB\-\-nodeps\fP" +鳶徹走研 竺帖馬奄 ç©¿æ‹­ ç¨Žç³Žå¤±è– ä¼Šç´«é¦¬èµ° çœæ¾—陥. +.IP "\fB\-\-test\fP" +鳶徹走研 å”薦稽 竺帖馬走澗 çœå£± 中宜 紫牌戚 赤澗走 繊伊馬壱 左壱廃陥. +.IP "\fB\-U, \-\-upgrade\fP" +è–„ä»™ 竺帖鞠嬢 赤澗 鳶徹走研 歯稽錘 ç„穿税 RPM生稽 穣益傾戚çƒé¦¬è™ž. +昔什島引 æ—­èµ°å¹» 森穿 ç„穿税 ä¾æˆš 切疑生稽 走趨é­é™¥æ¾— ä¾æˆš 陥牽陥. + + + +.SH 霜庚 è¾›èŠ +rpm 霜庚 è¾›èŠç¨Ž æžé‹¼æ—‹æ˜” 莫縦精 陥製引 旭陥. +.PP + \fBrpm \-q [霜庚辛èŠ]\fP +.PP +食å›æ­³ç²¾ 鳶徹走 舛左亜 妊ç£åƒ èŽ«ç¸¦è– è¡£èˆ›èƒŒçˆ½å¬¢é†¤ 廃陥. +\fB\-\-queryformat\fP è¾›èŠ åŠæ‹­ 莫縦 åºšåˆ‡ä¼¸è– æ—‹å¬¢çˆ½æªŽ å‰é™¥. + +霜庚 莫縦精 妊層 \fBprintf(3)\fP èŽ«ç¸¦è– é‰¦å¨ƒ 痕莫廃 ä¾æˆšé™¥. +莫縦精 舛旋 庚切伸引( 鯵楳庚切, å, 益軒壱 陥献 åƒå‘ªåºšåˆ‡æ‹­ +ä¼å»ƒ 妊層 C 庚切 戚什追戚覗 妊奄) \fBprintf(3)\fP 莫縦走舛切稽 姥失鞠嬢 +赤陥. +\fBrpm\fPç²¾ 戚耕 窒径 莫殿研 ç¡å£± 赤生糠稽 展脊 走舛切澗 æŒç¹°é¦¬å£± +\fB{}\fP 庚切稽 広嬢辞 伯希 殿益税 戚硯生稽 郊è·å¬¢ 爽嬢醤 廃陥. +殿益誤 掻 \fBRPMTAG_\fP 採歳精 æŒç¹°èƒŒé†¤ 馬悟 殿益誤 è’‹æ‹­æ¾— \fB\-\fP 庚切研 +旋嬢爽嬢醤 廃陥. + +森研 級嬢 霜庚 ä¼é›Œ 鳶徹走税 戚硯幻 窒径馬壱切 馬澗 井酔 食å›æ­³ç²¾ +\fB%{NAME}\fP è– èŽ«ç¸¦ 庚切伸稽 ç´«é‚背醤 廃陥. 鳶徹走誤引 壕匂毒 舛左研 +ç § 鯵税 町è»ç”Ÿç¨½ 妊ç£é¦¬å£±åˆ‡ æ‹ å‡¶æ¾— \fB%\-30{NAME}%{DISTRIBUTION}\fP 虞壱 +旋澗陥. + +\fBrpm\fP ç²¾ \fB\-\-querytags\fP è¾›èŠè– 爽檎 昔縦馬壱 赤澗 乞窮 殿益税 +é¯‰ç³»è– å·¦é£Ÿå±¤é™¥. + +霜庚 è¾›èŠæ‹­æ¾— 2 亜走 室闘亜 赤陥: 鳶徹走 識澱引 舛左 識澱 + +鳶徹走 識澱 è¾›èŠ: +.br +.IP "\fB\fI<鳶徹走誤>\fP" +\fB\fI\fP虞澗 戚硯税 鳶徹走拭 ä¼å»ƒ 霜庚研 呪楳廃陥. +.IP "\fB\-a\fP" +乞窮 鳶徹走拭 ä¼é¦¬é£Ÿ 霜庚研 呪楳廃陥. +.IP "\fB\-whatrequires \fI<奄管>\fP" +è–¦ä¼ç¨½ 拙疑馬奄 是背辞澗 \fI<奄管>\fP è– ç¶æŽ¨ç¨½ 馬澗 乞窮 鳶徹走拭 ä¼é¦¬é£Ÿ +éœœåºšè– å‘ªæ¥³å»ƒé™¥. +.IP "\fB\-whatprovides \fI<亜雌>\fP" +\fI\fP å¥„ç®¡è– è–¦å› é¦¬æ¾— 乞窮 鳶徹走拭 ä¼é¦¬é£Ÿ éœœåºšè– å‘ªæ¥³å»ƒé™¥. +.IP "\fB\-f \fI<鉢æž>\fP" +\fI<鉢æž>\fPç ” 匂敗馬澗 鳶徹走拭 ä¼é¦¬é£Ÿ éœœåºšè– å‘ªæ¥³å»ƒé™¥. +.IP "\fB\-F\fP" +\fB\-f\fP 人 æ—­èµ°å¹» 鉢æžèª¤è– 妊層 脊径拭辞 石澗陥. +.IP "\fB\-p \fI<鳶徹走鉢æž>\fP" +ç«ºå¸–å‰ æšæ¾— 竺帖鞠走 çœç²¾ \fI<鳶徹走鉢æž>\fP æ‹­ ä¼é¦¬é£Ÿ éœœåºšè– å‘ªæ¥³å»ƒé™¥. +.IP "\fB\-P\fP" +\fB\-p\fP 人 æ—­èµ°å¹» 鳶徹走 鉢æžèª¤è– 妊層 脊径拭辞 石澗陥. + +.P +舛左 識澱 è¾›èŠ: +.br +.IP "\fB\-i\fP" +鳶徹走 戚硯, ç„ç©¿, 竺誤 去税 舛左研 窒径廃陥. +幻鉦 \fB\-\-queryformat\fP 戚 爽嬢閃 赤陥檎 益ä¾è– 戚é‚馬食 窒径廃陥. +.IP "\fB\-R\fP" +è–„ä»™ 鳶徹走走亜 税糎馬壱 赤澗 鳶徹走 é¯‰ç³»è– å·¦é£Ÿå±¤é™¥. +(\fB\-\-requires\fP 引 旭製) +.IP "\fB\-\-provides\fP" +鳶徹走亜 薦因馬澗 å¥„ç®¡è– å·¦é£Ÿå±¤é™¥. +.IP "\fB\-l\fP" +鳶徹走 照税 鉢æžè– 左食層陥. +.IP "\fB\-s\fP" +鳶徹走 照拭 窮 鉢æžç¨Ž \fI雌殿\fPç ” 左食層陥.(\fB\-l\fPç²¾ 匂敗) +å”– 鉢æžç¨Ž 雌殿澗 \fInormal\fP(舛雌), \fInot installed\fP(竺帖鞠走 çœè£½), +\fIreplaced\f(陥献 ä¾ç”Ÿç¨½ 嘘端喫)税 è‘µè– æ¡æ¾—陥. +.IP "\fB\-d\fP" +庚辞 鉢æžå¹» 左食層陥.(\fB\-l\fPç²¾ 匂敗) +.IP "\fB\-c\fP" +竺舛 鉢æžå¹» 左食層陥.(\fB\-l\fPç²¾ 匂敗) +.IP "\fB\-\-scripts\fP" +竺帖, 薦暗 引舛拭 ç´«é‚éž æ¾— 秋 什滴験闘亜 赤陥檎 益 鎧é‚è– çª’å¾„å»ƒé™¥. +.IP "\fB\-\-dump\fP" +陥製引 æ—­ç²¾ é‰¢æž èˆ›å·¦ç ” 棋覗廃陥: 井稽 滴奄 呪舛æž, MD5 端滴雫, 乞çƒ, +社政切, 益血, 竺舛 é‰¢æž é£ŸæŽ¡, 庚辞 é‰¢æž é£ŸæŽ¡, rdev, å®¿ç‘³é£ å…ƒæ»´ 食採. +置社廃 \fB\-l\fP, \fB\-c\fP, \fB\-d\fP 戚級 è¾›èŠ æŽ» 馬蟹亜 ç´«é‚鞠嬢醤 +廃陥. + +.SH 伊装 è¾›èŠ +rpm 伊装 è¾›èŠç¨Ž æžé‹¼æ—‹æ˜” 莫殿澗 陥製引 旭陥. +.PP + \fBrpm \-V|\-y|\-\-verify [伊装辛èŠ]\fP +.PP +竺帖鞠嬢 赤澗 鉢æžç´šæ‹­ ä¼é¦¬é£Ÿ rpm 汽戚斗今戚什拭 ç…½èˆŒå‰ éŽ§é‚引 神軒走確 +鳶徹走税 鎧é‚è– æ¾å˜˜å»ƒé™¥. 伊装 鎧é‚ç²¾ 滴奄, MD5 端滴雫, é耕èŠ, 展脊, 社政切, +益血 去戚陥. 託戚繊戚 é™èƒƒéž æªŽ 窒径廃陥. 鳶徹走 èµ°ç£ è¾›èŠç²¾ 鳶徹走 霜庚 +è¾›èŠæ‹­è¾žäºº 旭陥. + +窒径 莫縦精 8 切税 庚切伸戚陥. "\fBc\fP"ç²¾ 竺舛 鉢æžè– 税耕馬悟 益軒壱 +鉢æžèª¤æˆš 蟹展è²é™¥. 唖唖税 8 鯵 庚切澗 RPM 汽戚斗今戚什拭 ç…½èˆŒå‰ ç´—å¤±å¼• æ¾å˜˜å»ƒ +衣引研 蟹展浬陥. "." (æ·è»’嬢çƒ) 庚切澗 æˆšé›Œè’¸è£½è– èŸ¹å±•æµ¬é™¥. æ¾å˜˜ 衣引 庚薦繊戚 +é™èƒƒéž æªŽ 陥製引 æ—­ç²¾ 庚切亜 蟹展è²é™¥. + +.IP "\fB5\fP" +MD5 端滴雫 +.IP "\fBS\fP" +é‰¢æž æ»´å¥„ +.IP "\fBL\fP" +å®¿ç‘³é£ å…ƒæ»´ +.IP "\fBT\fP" +飴é‡æž +.IP "\fBD\fP" +舌帖 +.IP "\fBU\fP" +ç´«é‚切 +.IP "\fBG\fP" +益血 +.IP "\fBM\fP" +é耕èŠå¼• é‰¢æž å±•è„Šè– åŒ‚æ•—å»ƒ ä¹žçƒ + +.SH 辞誤 溌昔 +rpm 辞誤 溌昔 誤敬精 陥製引 旭陥. +.PP + \fBrpm \-\-checksig <鳶徹走鉢æž>+\fP +.PP +鳶徹走税 神軒走確 食採研 亜形鎧奄 是馬食 鳶徹走 照拭 窮 PGP è¾žèª¤è– ç¹Šä¼Šå»ƒé™¥. +PGP 竺舛 舛左澗 /etc/rpmrc 拭辞 石嬢紳陥. +室採紫牌精 "PGP 辞誤" 悉èŠè– 左奄 郊空陥. + +.SH 薦暗 è¾›èŠ +rpm 薦暗 誤敬税 æžé‹¼æ—‹æ˜” 莫殿澗 陥製引 旭陥. +.PP + \fB rpm \-e <鳶徹走鉢æž>+\fP +.PP +.IP "\fB\-\-noscripts\fP" +preunistall, postuninstall 什滴験闘研 å”楳馬走 çœæ¾—陥. +.IP "\fB\-\-nodeps\fP" +鳶徹走 è–¦æš—ç£ ç¨Žç³Žå¤±è– ä¼Šç´«é¦¬èµ° çœæ¾—陥. +.IP "\fB\-\-test\fP" +å”薦稽 鳶徹走研 薦暗馬澗 ä¾ç²¾ 焼艦壱 砺什闘背沙陥. +\fB\-vv\fP è¾›èŠ. + +.SH 薦拙 è¾›èŠ +rpm 薦拙 誤敬税 æžé‹¼æ—‹ 莫縦精 陥製引 旭陥. +.PP + \fBrpm \-b\fIO\fP [薦拙辛èŠ] <鳶徹走 什薙>+\fP +.PP +\fB\-b\fIO\fR ç²¾ 薦拙 舘域人 è–¦æ‹™æ‹ é³¶å¾¹èµ°ç ” 蟹展鎧澗 ä¾ç”Ÿç¨½è¾ž 陥製 掻 +馬蟹税 è‘µè– æ¡æ¾—陥: + +.IP "\fB\-bp\fP" +什薙 鉢æžç¨Ž "%prep" 舘域研 å”楳廃陥. å·¦æ­ ç¤¾ä»€ç ” 熱壱 鳶帖研 亜馬澗 拙穣戚陥. +.IP "\fB\-bl\fP" +"鯉系 繊伊"è– å»ƒé™¥. "%files" 悉èŠç²¾ 溌舌 å¤æ»´ç¨½æˆšé™¥. 戚 鉢æžç´šæˆš 糎仙馬澗走 +食採研 ç¡ç„¼æ²™é™¥. +.IP "\fB\-bc\fP" +"%build" 舘域研 呪楳廃陥.( prep 舘域研 廃 æ¿ ) +å·¦æ­ make æ‹­ 背é›é¦¬æ¾— æžè– 背浬陥. +.IP "\fB\-bi\fP" +"%install" 舘域研 呪楳廃陥.( prep, build 舘域研 æš—åº æ¿ ) +å·¦æ­ make install æ‹­ 背é›é¦¬æ¾— æžè– 廃陥. +.IP "\fB\-bb\fP" +郊戚格軒 鳶徹走研 幻窮陥.( prep, build, install 舘域研 呪楳廃 æ¿ ) +.IP "\fB\-ba\fP" +郊戚格軒人 社什 鳶徹走研 幻窮陥.( prep, build, install 舘域研 呪楳廃 æ¿ ) +.PP +陥製 è¾›èŠäº€ ç´«é‚亜管馬陥: +.IP "\fB\-\-short\-circuit\fP" +掻娃 舘域研 暗帖走 çœå£± 走舛廃 舘域稽 é€ç¾¨ 戚疑廃陥. +\fB\-bc\fP 人 \fB\-bi\fP馬壱幻 承 呪 赤陥. +.IP "\fB\-\-timecheck\fP" +"ç£å¨ƒç¹Šä¼Š"è– 0 ( ç½äºœç®¡ )生稽 竺舛廃陥. 戚 葵精 rpmrc 拭辞 "timecheck:" 稽 +ç«ºèˆ›æ‹ å‘ª 赤陥. ç£å¨ƒç¹Šä¼Šè‘µç²¾ 段稽 妊ç£éž æ¾—æ±½ 鉢æžæˆš 鳶徹臓鞠澗 æè»’æ¾— ç½®ä¼ +ç£å¨ƒè– 舛廃陥. ç£å¨ƒè– 段引馬澗 鉢æžç´šæ‹­ ä¼é¦¬é£Ÿ 井壱 五ç£èµ°äºœ 窒径å‰é™¥. +.IP "\fB\-\-clean\fP" +鳶徹走研 幻窮 æ¿ build 巨刑塘軒研 走錘陥. +.IP "\fB\-\-test\fP" +嬢彊廃 build 舘域研 暗帖走 çœæ¾—陥. +什薙 鉢æžè– ç ºä»€é—˜æ‹ å‡¶ 政é‚馬陥. +.IP "\fB\-\-sign\fP" +鳶徹走 照拭 PGP è¾žèª¤è– éš”æ¾—é™¥. 鳶徹走研 刊亜 幻級醸澗走 æºŒæ˜”æ‹ å‘ª 赤陥. +/etc/rpmrc æ‹­ ä¼å»ƒ 竺誤精 PGP 辞誤 悉èŠè– 石嬢左虞. + +.SH 仙薦拙, 仙陳ç£æž è¾›èŠ + +舘 ç § 亜走幻 èµ¤è– å±æˆšé™¥: + +.I "\fBrpm \-\-recompile <社什鳶徹走鉢æž>+\fP" + +.I "\fBrpm \-\-rebuild <社什鳶徹走鉢æž>+\fP" + +rpm ç²¾ çˆ½å¬¢é­ ç¤¾ä»€ 鳶徹走研 竺帖馬壱 prep, 陳ç£æž, 竺帖研 背層陥. +\fB\-\-rebuild\fPæ¾— 歯稽錘 郊戚格軒 鳶徹走亀 幻級嬢層陥. +è–¦æ‹™è– åŽŸå¸–æªŽ build 巨刑塘軒澗 \fB\-\-clean\fP è¾›èŠæ‹­è¾žäºº 原æ¿äºœèµ°ç¨½ +走趨é­é™¥. 鳶徹走稽採斗 蟹紳 社什人 什薙鉢æžç²¾ 肢薦å‰é™¥. + +.SH 奄糎税 RPMæ‹­ 辞誤馬奄 + +.I "\fBrpm \-\-resign <郊戚格軒鳶徹走鉢æž>+\fP" + +鳶徹走 鉢æžæ‹­ 歯稽錘 è¾žèª¤è– å»ƒé™¥. 奄糎税 辞誤精 肢薦å‰é™¥. + +.SH PGP 辞誤 + +辞誤 å¥„ç®¡è– ç´«é‚馬奄 是背辞澗 PGP ç ” ç´«é‚æ‹ å‘ª 赤嬢醤 廃陥.( 食å›æ­³ç¨Ž 鳶什 +æéµ å·¨åˆ‘å¡˜è»’ 竺帖鞠嬢 赤嬢醤 廃陥 ) 益軒壱 RPM 因鯵徹研 匂敗馬澗 因鯵徹 å…ƒè– +é”è– å‘ª 赤嬢醤 廃陥. 奄沙旋生稽 RPMç²¾ PGPPATH拭辞 èµ°ç£é¦¬æ¾— PGP 奄沙 ç«ºèˆ›è– +ç´«é‚廃陥. PGP亜 奄沙旋生稽 ç´«é‚馬澗 å¾¹å…ƒè– æ¡å£± 赤走 çœè– 凶澗 /etc/rpmrc +鉢æžæ‹­ 陥製引 旭戚 竺舛背砧嬢醤 廃陥. + +.IP "\fBpgp_path\fP" +/usr/lib/rpm ä¼é‡ åºŠæž äº•ç¨½èª¤. 食å›æ­³ç¨Ž å¾¹å…ƒè– åŒ‚æ•—èƒŒé†¤ 廃陥. +.PP + +食å›æ­³æˆš 幻窮 鳶徹走拭 è¾žèª¤è– é¦¬å½¢æªŽ, 食å›æ­³ç²¾ 切é‡ç¨Ž 因鯵徹人 æ¾è…”å¾¹ 廃 çž¬è– +幻級嬢砧嬢醤 廃陥.( PGP å¤æ•¢æ– 凧壱 ) +/etc/rpmrc æ‹­ æ—‹æ¾— ä¾ æºå£±äº€ 陥製 ç´«ç‰Œè– è“„äºœèƒŒé†¤ 廃陥: + +.IP "\fBsignature\fP" +辞誤 政莫. 薄仙稽辞澗 pgp å¹» èµ°æ®å‰é™¥. +.IP "\fBpgp_name\fP" +食å›æ­³ç¨Ž 鳶徹走拭 è¾žèª¤æ‹ user èª¤è– æ—‹æ¾—é™¥. +.PP + +鳶徹走 è–¦æ‹™ç£ \-\-sign è¾›èŠè– 蓄亜廃陥. +食å›æ­³ç¨Ž è„Šå¾„è– é–¤å£± 蟹檎 鳶徹走亜 幻級嬢走壱 ç–‘ç£æ‹­ 辞誤å‰é™¥. + +.SH 汽戚斗今戚什 ä»™æŒå¤± è¾›èŠ + +rpm 汽戚斗今戚什研 é™¥ç£ å¹»çƒæ¾— 誤敬精 陥製引 旭陥. +.PP + \fBrpm \-\-rebuilddb\fP +.PP + +戚 乞çƒäºº ç´«é‚éž æ¾— è¾›èŠç”Ÿç¨½æ¾— \fB-\-dbpath\fP 人 \fB-\-root\fP å´ å±æˆšé™¥. + +.SH æ·«æµ é‰¢æž +.nf +/etc/rpmrc +~/.rpmrc +/var/lib/rpm/packages +/var/lib/rpm/pathidx +/var/lib/rpm/nameidx +/tmp/rpm* +.fi +.El +.SH 凧壱 +.IR glint (8) , +.IR rpm2cpio (8) , +.B http://www.redhat.com/rpm +.nf +.SH 煽切 +.nf +Marc Ewing +Erik Troan +.fi +.SH è…°è•åˆ‡ +.br +戚 å¹» é‚ +.B +.br +.B " " + diff --git a/rpm-5.4.9/doc/ko/rpm2cpio.8 b/rpm-5.4.9/doc/ko/rpm2cpio.8 new file mode 100644 index 0000000..1e707e4 --- /dev/null +++ b/rpm-5.4.9/doc/ko/rpm2cpio.8 @@ -0,0 +1,31 @@ +.\" rpm2cpio - Converts Red Hat Package (RPM) to cpio archive +.TH rpm 8 "1995é° 9æ‰ 15æž" "傾çƒåª’ 社覗闘裾嬢" "傾çƒåª’ é›Œé‚ è»’å‹˜ä»€" +.SH 戚硯 +rpm2cpio \- 傾çƒåª’ (RPM) 鳶徹走研 cpio 鉢æžç¨½ 痕発 +.SH 鯵推 +\fBrpm2cpio\fP [filename] +.SH 竺誤 +\fBrpm2cpio\fP æ¾— .rpm 鉢æžèª¤è– 馬蟹 閤焼級食辞 妊層窒径生稽 cpio 煽舌鉢æžè– +窒径廃陥. 幻鉦 焼巷訓 ç©¿å«æ˜”呪亜 蒸陥檎 妊層脊径生稽採斗 rpm 鉢æžè– +閤焼級昔陥. + +.br +.I "\fBrpm2cpio rpm-1.1-1.i386.rpm\fP" +.br +.I "\fBrpm2cpio < glint-1.0-1.i386.rpm\fP" + +.SH 凧壱 +.IR glint (8) , +.IR rpm (8) +.SH 煽切 +.nf +Erik Troan +.fi + +.SH è…°è•åˆ‡ +.br +戚 å¹» é‚ +.B +.br +.B " " + diff --git a/rpm-5.4.9/doc/manual/Makefile.am b/rpm-5.4.9/doc/manual/Makefile.am new file mode 100644 index 0000000..3acf2d1 --- /dev/null +++ b/rpm-5.4.9/doc/manual/Makefile.am @@ -0,0 +1,21 @@ +## Process this file with automake to produce Makefile.in + +EXTRA_DIST = \ + builddependencies \ + buildroot \ + conditionalbuilds \ + dependencies \ + filetriggers \ + format \ + hregions \ + macros \ + multiplebuilds \ + queryformat \ + relocatable \ + rollbacks \ + signatures \ + spec \ + triggers \ + tsort \ + newrpmdb.howto \ + autosignature diff --git a/rpm-5.4.9/doc/manual/Makefile.in b/rpm-5.4.9/doc/manual/Makefile.in new file mode 100644 index 0000000..f1655a2 --- /dev/null +++ b/rpm-5.4.9/doc/manual/Makefile.in @@ -0,0 +1,732 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +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@ +target_triplet = @target@ +subdir = doc/manual +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +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 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDROOTDIR_MACRO = @BUILDROOTDIR_MACRO@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBAPI = @DBAPI@ +DBLIBOBJS = @DBLIBOBJS@ +DBLIBSRCS = @DBLIBSRCS@ +DBPATH = @DBPATH@ +DBPATH_MACRO = @DBPATH_MACRO@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTRO_MACROS = @DISTRO_MACROS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIXPERMS = @FIXPERMS@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GPSEE_MODULES_PATH = @GPSEE_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_STATIC = @LDFLAGS_STATIC@ +LD_VERSION_SCRIPT_FLAG = @LD_VERSION_SCRIPT_FLAG@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOLIZE = @LIBTOOLIZE@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MACROFILES = @MACROFILES@ +MAGIC_MACRO = @MAGIC_MACRO@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR = @MKDIR@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NCPUS_COMMAND = @NCPUS_COMMAND@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENMP_CFLAGS = @OPENMP_CFLAGS@ +OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_INSTALLDIRS = @PERL_INSTALLDIRS@ +PERL_URPM_INSTALLDIRS = @PERL_URPM_INSTALLDIRS@ +PKGSRCDIR = @PKGSRCDIR@ +PKGSRCDIR_MACRO = @PKGSRCDIR_MACRO@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +ROOT_GROUP = @ROOT_GROUP@ +RPMCANONARCH = @RPMCANONARCH@ +RPMCANONCOLOR = @RPMCANONCOLOR@ +RPMCANONGNU = @RPMCANONGNU@ +RPMCANONOS = @RPMCANONOS@ +RPMCANONVENDOR = @RPMCANONVENDOR@ +RPMGID = @RPMGID@ +RPMGROUP = @RPMGROUP@ +RPMLUAFILES = @RPMLUAFILES@ +RPMPOPTFILES = @RPMPOPTFILES@ +RPMUID = @RPMUID@ +RPMUSER = @RPMUSER@ +RPM_TIMESTAMP = @RPM_TIMESTAMP@ +RPM_VENDOR = @RPM_VENDOR@ +RPM_VERSION = @RPM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFIGDIR = @SYSCONFIGDIR@ +USE_NLS = @USE_NLS@ +USRLIBRPM = @USRLIBRPM@ +VERSION = @VERSION@ +WITH_ACL = @WITH_ACL@ +WITH_APIDOCS = @WITH_APIDOCS@ +WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ +WITH_APR = @WITH_APR@ +WITH_ATERM = @WITH_ATERM@ +WITH_ATTR = @WITH_ATTR@ +WITH_AUGEAS = @WITH_AUGEAS@ +WITH_AUGEAS_AUGTOOL = @WITH_AUGEAS_AUGTOOL@ +WITH_BASH = @WITH_BASH@ +WITH_BASH_CPPFLAGS = @WITH_BASH_CPPFLAGS@ +WITH_BASH_LDFLAGS = @WITH_BASH_LDFLAGS@ +WITH_BASH_LIBS = @WITH_BASH_LIBS@ +WITH_BASH_SUBDIR = @WITH_BASH_SUBDIR@ +WITH_BEECRYPT = @WITH_BEECRYPT@ +WITH_BEECRYPT_CPPFLAGS = @WITH_BEECRYPT_CPPFLAGS@ +WITH_BEECRYPT_LDFLAGS = @WITH_BEECRYPT_LDFLAGS@ +WITH_BEECRYPT_LIBS = @WITH_BEECRYPT_LIBS@ +WITH_BEECRYPT_SUBDIR = @WITH_BEECRYPT_SUBDIR@ +WITH_BZIP2 = @WITH_BZIP2@ +WITH_CPUINFO = @WITH_CPUINFO@ +WITH_CUDF = @WITH_CUDF@ +WITH_CUDF_CUDFTOOL = @WITH_CUDF_CUDFTOOL@ +WITH_DB = @WITH_DB@ +WITH_DBSQL = @WITH_DBSQL@ +WITH_DBSQL_CPPFLAGS = @WITH_DBSQL_CPPFLAGS@ +WITH_DBSQL_LDFLAGS = @WITH_DBSQL_LDFLAGS@ +WITH_DBSQL_LIBS = @WITH_DBSQL_LIBS@ +WITH_DBSQL_SUBDIR = @WITH_DBSQL_SUBDIR@ +WITH_DB_CPPFLAGS = @WITH_DB_CPPFLAGS@ +WITH_DB_LDFLAGS = @WITH_DB_LDFLAGS@ +WITH_DB_LIBS = @WITH_DB_LIBS@ +WITH_DB_SUBDIR = @WITH_DB_SUBDIR@ +WITH_DMALLOC = @WITH_DMALLOC@ +WITH_EFENCE = @WITH_EFENCE@ +WITH_EXPAT = @WITH_EXPAT@ +WITH_FICL = @WITH_FICL@ +WITH_FICL_CPPFLAGS = @WITH_FICL_CPPFLAGS@ +WITH_FICL_LDFLAGS = @WITH_FICL_LDFLAGS@ +WITH_FICL_LIBS = @WITH_FICL_LIBS@ +WITH_FICL_SUBDIR = @WITH_FICL_SUBDIR@ +WITH_FILE = @WITH_FILE@ +WITH_FILE_CPPFLAGS = @WITH_FILE_CPPFLAGS@ +WITH_FILE_LDFLAGS = @WITH_FILE_LDFLAGS@ +WITH_FILE_LIBS = @WITH_FILE_LIBS@ +WITH_FILE_SUBDIR = @WITH_FILE_SUBDIR@ +WITH_GCRYPT = @WITH_GCRYPT@ +WITH_GNUTLS = @WITH_GNUTLS@ +WITH_GPSEE = @WITH_GPSEE@ +WITH_GPSEE_CPPFLAGS = @WITH_GPSEE_CPPFLAGS@ +WITH_GPSEE_LDFLAGS = @WITH_GPSEE_LDFLAGS@ +WITH_GPSEE_LIBS = @WITH_GPSEE_LIBS@ +WITH_GPSEE_SUBDIR = @WITH_GPSEE_SUBDIR@ +WITH_JS_SUBDIR = @WITH_JS_SUBDIR@ +WITH_KEYUTILS = @WITH_KEYUTILS@ +WITH_KEYUTILS_RPMKEY = @WITH_KEYUTILS_RPMKEY@ +WITH_LIBELF_DEBUGEDIT = @WITH_LIBELF_DEBUGEDIT@ +WITH_LIBGIT2 = @WITH_LIBGIT2@ +WITH_LIBGIT2_CPPFLAGS = @WITH_LIBGIT2_CPPFLAGS@ +WITH_LIBGIT2_LDFLAGS = @WITH_LIBGIT2_LDFLAGS@ +WITH_LIBGIT2_LIBS = @WITH_LIBGIT2_LIBS@ +WITH_LIBGIT2_SUBDIR = @WITH_LIBGIT2_SUBDIR@ +WITH_LIBTASN1 = @WITH_LIBTASN1@ +WITH_LUA = @WITH_LUA@ +WITH_LUA_CPPFLAGS = @WITH_LUA_CPPFLAGS@ +WITH_LUA_LDFLAGS = @WITH_LUA_LDFLAGS@ +WITH_LUA_LIBS = @WITH_LUA_LIBS@ +WITH_LUA_SUBDIR = @WITH_LUA_SUBDIR@ +WITH_LUA_SUBDIR_DEF = @WITH_LUA_SUBDIR_DEF@ +WITH_LUA_SUBDIR_LIB = @WITH_LUA_SUBDIR_LIB@ +WITH_MOZJS185 = @WITH_MOZJS185@ +WITH_MOZJS185_CPPFLAGS = @WITH_MOZJS185_CPPFLAGS@ +WITH_MOZJS185_LDFLAGS = @WITH_MOZJS185_LDFLAGS@ +WITH_MOZJS185_LIBS = @WITH_MOZJS185_LIBS@ +WITH_MOZJS185_SUBDIR = @WITH_MOZJS185_SUBDIR@ +WITH_NEON = @WITH_NEON@ +WITH_NEON_CPPFLAGS = @WITH_NEON_CPPFLAGS@ +WITH_NEON_LDFLAGS = @WITH_NEON_LDFLAGS@ +WITH_NEON_LIBS = @WITH_NEON_LIBS@ +WITH_NEON_SUBDIR = @WITH_NEON_SUBDIR@ +WITH_NIX = @WITH_NIX@ +WITH_NSS = @WITH_NSS@ +WITH_OPENSSL = @WITH_OPENSSL@ +WITH_PAKCHOIS = @WITH_PAKCHOIS@ +WITH_PATH_VERSIONED = @WITH_PATH_VERSIONED@ +WITH_PATH_VERSIONED_SUFFIX = @WITH_PATH_VERSIONED_SUFFIX@ +WITH_PCRE = @WITH_PCRE@ +WITH_PCRE_CPPFLAGS = @WITH_PCRE_CPPFLAGS@ +WITH_PCRE_LDFLAGS = @WITH_PCRE_LDFLAGS@ +WITH_PCRE_LIBS = @WITH_PCRE_LIBS@ +WITH_PCRE_SUBDIR = @WITH_PCRE_SUBDIR@ +WITH_PERLEMBED = @WITH_PERLEMBED@ +WITH_PERL_LIBS = @WITH_PERL_LIBS@ +WITH_PERL_SUBDIR = @WITH_PERL_SUBDIR@ +WITH_PERL_SUBPACKAGE = @WITH_PERL_SUBPACKAGE@ +WITH_PERL_URPM_LIBS = @WITH_PERL_URPM_LIBS@ +WITH_PERL_URPM_SUBDIR = @WITH_PERL_URPM_SUBDIR@ +WITH_PERL_URPM_SUBPACKAGE = @WITH_PERL_URPM_SUBPACKAGE@ +WITH_POPT = @WITH_POPT@ +WITH_POPT_CPPFLAGS = @WITH_POPT_CPPFLAGS@ +WITH_POPT_LDFLAGS = @WITH_POPT_LDFLAGS@ +WITH_POPT_LIBS = @WITH_POPT_LIBS@ +WITH_POPT_SUBDIR = @WITH_POPT_SUBDIR@ +WITH_PYTHONEMBED = @WITH_PYTHONEMBED@ +WITH_PYTHON_INCDIR = @WITH_PYTHON_INCDIR@ +WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ +WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ +WITH_RC = @WITH_RC@ +WITH_RC_CPPFLAGS = @WITH_RC_CPPFLAGS@ +WITH_RC_LDFLAGS = @WITH_RC_LDFLAGS@ +WITH_RC_LIBS = @WITH_RC_LIBS@ +WITH_RC_SUBDIR = @WITH_RC_SUBDIR@ +WITH_READLINE = @WITH_READLINE@ +WITH_RUBY = @WITH_RUBY@ +WITH_RUBY_CPPFLAGS = @WITH_RUBY_CPPFLAGS@ +WITH_RUBY_SUBDIR = @WITH_RUBY_SUBDIR@ +WITH_RUBY_VENDORARCHDIR = @WITH_RUBY_VENDORARCHDIR@ +WITH_SELINUX = @WITH_SELINUX@ +WITH_SEMANAGE = @WITH_SEMANAGE@ +WITH_SEMANAGE_SEMODULE = @WITH_SEMANAGE_SEMODULE@ +WITH_SEPOL = @WITH_SEPOL@ +WITH_SPIDERMONKEY_SUBDIR = @WITH_SPIDERMONKEY_SUBDIR@ +WITH_SQLITE = @WITH_SQLITE@ +WITH_SQLITE_CPPFLAGS = @WITH_SQLITE_CPPFLAGS@ +WITH_SQLITE_LDFLAGS = @WITH_SQLITE_LDFLAGS@ +WITH_SQLITE_LIBS = @WITH_SQLITE_LIBS@ +WITH_SQLITE_SUBDIR = @WITH_SQLITE_SUBDIR@ +WITH_SQUIRREL = @WITH_SQUIRREL@ +WITH_SUBVERSION = @WITH_SUBVERSION@ +WITH_SYCK = @WITH_SYCK@ +WITH_SYCK_CPPFLAGS = @WITH_SYCK_CPPFLAGS@ +WITH_SYCK_LDFLAGS = @WITH_SYCK_LDFLAGS@ +WITH_SYCK_LIBS = @WITH_SYCK_LIBS@ +WITH_SYCK_SUBDIR = @WITH_SYCK_SUBDIR@ +WITH_TCL = @WITH_TCL@ +WITH_TCL_SUBDIR = @WITH_TCL_SUBDIR@ +WITH_TOMCRYPT = @WITH_TOMCRYPT@ +WITH_TPM = @WITH_TPM@ +WITH_UNIXODBC = @WITH_UNIXODBC@ +WITH_UUID = @WITH_UUID@ +WITH_XAR = @WITH_XAR@ +WITH_XAR_CPPFLAGS = @WITH_XAR_CPPFLAGS@ +WITH_XAR_LDFLAGS = @WITH_XAR_LDFLAGS@ +WITH_XAR_LIBS = @WITH_XAR_LIBS@ +WITH_XAR_SUBDIR = @WITH_XAR_SUBDIR@ +WITH_XZ = @WITH_XZ@ +WITH_XZ_CPPFLAGS = @WITH_XZ_CPPFLAGS@ +WITH_XZ_LDFLAGS = @WITH_XZ_LDFLAGS@ +WITH_XZ_LIBS = @WITH_XZ_LIBS@ +WITH_XZ_SUBDIR = @WITH_XZ_SUBDIR@ +WITH_ZLIB = @WITH_ZLIB@ +WITH_ZLIB_CPPFLAGS = @WITH_ZLIB_CPPFLAGS@ +WITH_ZLIB_LDFLAGS = @WITH_ZLIB_LDFLAGS@ +WITH_ZLIB_LIBS = @WITH_ZLIB_LIBS@ +WITH_ZLIB_SUBDIR = @WITH_ZLIB_SUBDIR@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__BASH = @__BASH@ +__BZIP2 = @__BZIP2@ +__CAT = @__CAT@ +__CHATTR = @__CHATTR@ +__CHGRP = @__CHGRP@ +__CHGRP_RHF = @__CHGRP_RHF@ +__CHMOD = @__CHMOD@ +__CHOWN = @__CHOWN@ +__CHOWN_RHF = @__CHOWN_RHF@ +__CMAKE = @__CMAKE@ +__CPIO = @__CPIO@ +__CURL = @__CURL@ +__CVS = @__CVS@ +__DBSQL = @__DBSQL@ +__DB_ARCHIVE = @__DB_ARCHIVE@ +__DB_CHECKPOINT = @__DB_CHECKPOINT@ +__DB_DEADLOCK = @__DB_DEADLOCK@ +__DB_DUMP = @__DB_DUMP@ +__DB_HOTBACKUP = @__DB_HOTBACKUP@ +__DB_LOAD = @__DB_LOAD@ +__DB_LOG_VERIFY = @__DB_LOG_VERIFY@ +__DB_PRINTLOG = @__DB_PRINTLOG@ +__DB_RECOVER = @__DB_RECOVER@ +__DB_REPLICATE = @__DB_REPLICATE@ +__DB_SQL_CODEGEN = @__DB_SQL_CODEGEN@ +__DB_STAT = @__DB_STAT@ +__DB_TUNER = @__DB_TUNER@ +__DB_UPGRADE = @__DB_UPGRADE@ +__DB_VERIFY = @__DB_VERIFY@ +__DIFF = @__DIFF@ +__DITTO = @__DITTO@ +__DOXYGEN = @__DOXYGEN@ +__FILE = @__FILE@ +__GIT = @__GIT@ +__GPG = @__GPG@ +__GSR = @__GSR@ +__GST_INSPECT = @__GST_INSPECT@ +__GZIP = @__GZIP@ +__HG = @__HG@ +__ID = @__ID@ +__ID_U = @__ID_U@ +__INSTALL = @__INSTALL@ +__INSTALL_INFO = @__INSTALL_INFO@ +__LD = @__LD@ +__LDCONFIG = @__LDCONFIG@ +__LN = @__LN@ +__LRZIP = @__LRZIP@ +__LSATTR = @__LSATTR@ +__LZIP = @__LZIP@ +__LZMA = @__LZMA@ +__LZOP = @__LZOP@ +__MAKE = @__MAKE@ +__MKDIR = @__MKDIR@ +__MKDIR_P = @__MKDIR_P@ +__MODINFO = @__MODINFO@ +__MONGO = @__MONGO@ +__MV = @__MV@ +__NM = @__NM@ +__OBJCOPY = @__OBJCOPY@ +__OBJDUMP = @__OBJDUMP@ +__PATCH = @__PATCH@ +__PAX = @__PAX@ +__PERL = @__PERL@ +__PGP = @__PGP@ +__PHP = @__PHP@ +__PYTHON = @__PYTHON@ +__RM = @__RM@ +__RMDIR = @__RMDIR@ +__RSH = @__RSH@ +__RUBY = @__RUBY@ +__SED = @__SED@ +__SH = @__SH@ +__SQLITE3 = @__SQLITE3@ +__SSH = @__SSH@ +__STRIP = @__STRIP@ +__SVN = @__SVN@ +__TAR = @__TAR@ +__TCLSH = @__TCLSH@ +__UNZIP = @__UNZIP@ +__XZ = @__XZ@ +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_CXX = @ac_ct_CXX@ +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@ +autorelocate_dcolor = @autorelocate_dcolor@ +autorelocate_path = @autorelocate_path@ +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@ +exeext = @exeext@ +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@ +libext = @libext@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +objext = @objext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +shlibext = @shlibext@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +testdir = @testdir@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrprefix = @usrprefix@ +varprefix = @varprefix@ +EXTRA_DIST = \ + builddependencies \ + buildroot \ + conditionalbuilds \ + dependencies \ + filetriggers \ + format \ + hregions \ + macros \ + multiplebuilds \ + queryformat \ + relocatable \ + rollbacks \ + signatures \ + spec \ + triggers \ + tsort \ + newrpmdb.howto \ + autosignature + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 doc/manual/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign doc/manual/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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 +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# 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/rpm-5.4.9/doc/manual/autosignature b/rpm-5.4.9/doc/manual/autosignature new file mode 100644 index 0000000..d5ea48f --- /dev/null +++ b/rpm-5.4.9/doc/manual/autosignature @@ -0,0 +1,88 @@ +All packages produced by rpmbuild now have a DSA pubkey/signature. + +The reason for automagically signing all packages should be obvious: + + All software distributed through "packages" is subject to + malicious tampering. + +Adding a signature to _ALL_ packages produced by rpmbuild is the first step +towards a MANDATORY policy of: + + All packages installed by rpm MUST be signed. + +Clearly rpmbuild is forced to GUARANTEE that _SOME_ signature exists before +an enforcing MANDATORY policy that all packages must be signed can be attempted. + +(aside) +Vendors might well understand the need for software package integrity checks +enforced by digital signatures. Unfortunately the issues of "branding" +(signified by signing with the "official" vendor key) have gotten convolved +with security isssues because of common practice in RPM based distros. +Absolutely one shouldn't signify "official" release of software without due +diligence and attention to the myriad "business" details of QA testing and +release notes and marketing and ... +... but that's no reason _NOT_ to attempt signing *.rpm packages _ALWAYS_. + +(another aside) +And yes, many vendors _ARE_ signing _ALL_ packages routinely. Unfortunately, +the process of making gigabyes of *.rpm plaintext available for public +distribution on very short time scales (like within 24 hours of being built) +is quite complex, and so mistakes (like unsigned packages) occur too frequently. + +That should make the reasoning for attempting automagic signing of all *.rpm +packages produced by rpmbuild clearer. If not, well, "Have it your own way!" +and do whatever you wish. + +The mechanism for the automagic signing is based on a "non-repudiable" +signature, technical details described in the "Handbook of Applied Crytography" +section 13.8.2 p 582 which can be read online here: + + http://www.cacr.math.uwaterloo.ca/hac/about/chap13.pdf + +In plain speak here's what rpmbuild does (in rpm-5.3.2): + + 1) At the beginning of every invocation, rpmbuild generates a DSA keypair + (using BeeCrypt, the highest performing and only MANDATORY crypto + implementation available @rpm5.org). + + 2) When producing packages, the pubkey parameters are converted to + RFC 2440/4880 OpenPGP format and added to _ALL_ package headers + using a (pre-existing) RPMTAG_PUBKEYS tag. + The pubkey is exactly an armored pubkey as produced by gnupg with no + additional signatures or "user id" identifiers. + + 3) The header (containing the pubkey) is signed and the signature is added to + the detached signature header using RPMSIGTAG_DSA. This is identical + to what would be done if rpmbuild had been invoked with --sign, + the only difference is that the automagically generated keypair is + substituted for what --sign would have done. + + 4) The private key (of the automagically generated keypair) is discarded. + +In plain speak here's what rpm-5.3.2 does with the pubkey while installing: + + 1) In order to verify a signature, rpm undertakes looking up the + associated pubkey. This is just the concept of a "keyring", + nothing more. + The following "keyrings" for pubkeys are checked (in this order): + a) (linux only) keyutils kernel cache + b) rpmdb Pubkeys table + c) the automagically included non-repudiable pubkey (added in rpm-5.3.2) + d) SKS keys servers with hkp:// transport (added in rpm-5.3.1) + + 2) (for SKS retrieved pubkeys) The self-signature binding the userid to + the key is verified, and revocations/expiry are checked, rejecting + pubkeys that do not have a userid bound through a self-signature, or + whose signatures/pubkeys are expired/revoked. + + 3) (linux only) Acceptable pubkeys are saved in the keyutils cache. + + 4) The package signature is verified. + + 5) The pubkey (contained in the header tag RPMTAG_PUBKEYS) is indexed into + the secondary /var/lib/rpm/Pubkeys index. Note that there will be + multiple entries for the pubkey of any build that produced more than + a single sub-package. + +I hope the above clarifies the new behavior in rpm-5.3.2 to automagically +add a DSA signature to all packages produced by rpmbuild. diff --git a/rpm-5.4.9/doc/manual/builddependencies b/rpm-5.4.9/doc/manual/builddependencies new file mode 100644 index 0000000..ac52b33 --- /dev/null +++ b/rpm-5.4.9/doc/manual/builddependencies @@ -0,0 +1,178 @@ +/*! \page builddependencies Generating build dependencies automatically + +As we start updating packages for the next Red Hat distro, I'd like to see +packages start to make use of build dependencies. Basically build +dependencies are just like install dependencies, but they are resolved +against the build system just after parsing the spec file. Syntactically, +build dependencies look just like install dependencies in a spec file with +"Build" prefixed: + +\verbatim + BuildPrereqs: + BuildRequires: + BuildConflicts: +\endverbatim + +All the above dependencies include versions, files, existence/range tests, etc. +The build dependency checking can also be turned off with --nodeps if necessary +just like install dependency checking can. Eventually, build dependencies will +be automated in rpm, but the major impediment to that effort is the engineering +required to maintain the pretense that src rpm's are "noarch". + +Meanwhile, I've added a package called "InDependence-1.0" to powertools-6.2 +that may be of use in detecting build dependencies that can be added to +spec files as part of rebuilding packages for Red Hat 6.2. + +Here's a short example of how to generate the package/file names that were used +while building gnorpm using InDependence: + +\verbatim + rpm -U /mnt/rpm/comps/powertools/6.2/i386/InDependence-1.0-3.i386.rpm + rpm -i /mnt/rpm/comps/dist/6.2/SRPMS/gnorpm-0.9-11.src.rpm + cd /usr/src/rpm/SPECS + dep -detail rpmbuild -ba gnorpm.spec >& xxx + ... + (the build will take longer since both dep and strace are pigs) + ... + grep -- '::' xxx > yyy +\endverbatim + +\verbatim +Aside: The dep perl wrapper is a "pig" only because it's exec'ing + rpm -qf FILE + in order to turn filenames into package names. There are easier/faster + ways to get this information... + + There's no way to speed up the + /sbin/strace -q -etrace=open,execve -o ... + command itself. The eventual implementation in rpm will snatch the + same open/execve syscalls using LD_PRELOAD. + + Patches cheerfully accepted :-) +\endverbatim + +Here's what's in yyy (PACKAGE::FILE format): + +\verbatim + ORBit-devel-0.4.95-2::/usr/bin/orbit-config + XFree86-libs-3.3.5-6::/usr/X11R6/lib/libICE.so.6 + XFree86-libs-3.3.5-6::/usr/X11R6/lib/libSM.so.6 + XFree86-libs-3.3.5-6::/usr/X11R6/lib/libX11.so.6 + XFree86-libs-3.3.5-6::/usr/X11R6/lib/libXext.so.6 + audiofile-0.1.9-1::/usr/lib/libaudiofile.so.0 + autoconf-2.13-5::/usr/bin/autoconf + autoconf-2.13-5::/usr/bin/autoheader + autoconf-2.13-5::/usr/share/autoconf/acgeneral.m4 + autoconf-2.13-5::/usr/share/autoconf/autoconf.m4f + automake-1.4-5::/usr/bin/aclocal + automake-1.4-5::/usr/bin/automake + bash-1.14.7-16::/bin/sh + bash-1.14.7-16::/etc/bashrc + binutils-2.9.1.0.23-7::/usr/bin/strip + binutils-2.9.1.0.23-7::/usr/lib/libbfd-2.9.1.0.24.so + binutils-2.9.1.0.23-7::/usr/lib/libopcodes-2.9.1.0.24.so + bzip2-0.9.5c-1::/usr/lib/libbz2.so.0 + dev-2.7.10-2::/dev/null + diffutils-2.7-16::/usr/bin/cmp + egcs-1.1.2-25::/usr/bin/gcc + egcs-1.1.2-25::/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs + esound-0.2.14-1::/usr/lib/libesd.so.0 + file-3.27-3::/usr/bin/file + file-3.27-3::/usr/share/magic + fileutils-4.0-8::/bin/chgrp + fileutils-4.0-8::/bin/chmod + fileutils-4.0-8::/bin/chown + fileutils-4.0-8::/bin/cp + fileutils-4.0-8::/bin/ln + fileutils-4.0-8::/bin/ls + fileutils-4.0-8::/bin/mkdir + fileutils-4.0-8::/bin/mv + fileutils-4.0-8::/bin/rm + fileutils-4.0-8::/usr/bin/install + findutils-4.1-32::/usr/bin/xargs + gawk-3.0.4-1::/bin/awk + gawk-3.0.4-1::/bin/gawk + gettext-0.10.35-13::/usr/bin/xgettext + glib-1.2.5-1::/usr/lib/libglib-1.2.so.0 + glib-1.2.5-1::/usr/lib/libgmodule-1.2.so.0 + glib-devel-1.2.5-1::/usr/bin/glib-config + glibc-2.1.2-13::/etc/localtime + glibc-2.1.2-13::/etc/nsswitch.conf + glibc-2.1.2-13::/lib/ld-linux.so.2 + glibc-2.1.2-13::/lib/libc.so.6 + glibc-2.1.2-13::/lib/libcrypt.so.1 + glibc-2.1.2-13::/lib/libdb.so.2 + glibc-2.1.2-13::/lib/libdl.so.2 + glibc-2.1.2-13::/lib/libm.so.6 + glibc-2.1.2-13::/lib/libnsl.so.1 + glibc-2.1.2-13::/lib/libnss_dns.so.2 + glibc-2.1.2-13::/lib/libnss_files.so.2 + glibc-2.1.2-13::/lib/libnss_nis.so.2 + glibc-2.1.2-13::/lib/libnss_nisplus.so.2 + glibc-2.1.2-13::/lib/libresolv.so.2 + glibc-2.1.2-13::/usr/bin/ldd + gnome-libs-1.0.54-1::/usr/lib/libart_lgpl.so.2 + gnome-libs-1.0.54-1::/usr/lib/libgnome.so.32 + gnome-libs-1.0.54-1::/usr/lib/libgnomesupport.so.0 + gnome-libs-1.0.54-1::/usr/lib/libgnomeui.so.32 + gnome-libs-devel-1.0.54-1::/usr/bin/gnome-config + grep-2.3-2::/bin/egrep + grep-2.3-2::/bin/fgrep + grep-2.3-2::/bin/grep + gtk+-1.2.5-2::/usr/lib/libgdk-1.2.so.0 + gtk+-1.2.5-2::/usr/lib/libgtk-1.2.so.0 + imlib-1.9.7-1::/usr/lib/libgdk_imlib.so.1 + libghttp-1.0.4-1::/usr/lib/libghttp.so.1 + libtool-1.3.3-1::/usr/bin/libtoolize + libtool-1.3.3-1::/usr/share/libtool/config.guess + libtool-1.3.3-1::/usr/share/libtool/config.sub + libtool-1.3.3-1::/usr/share/libtool/ltconfig + libtool-1.3.3-1::/usr/share/libtool/ltmain.sh + libxml-1.4.0-1::/usr/lib/libxml.so.1 + libxml-devel-1.4.0-1::/usr/bin/xml-config + m4-1.4-12::/usr/bin/m4 + make-3.77-6::/usr/bin/make + mktemp-1.5-1::/bin/mktemp + net-tools-1.53-1::/bin/hostname + patch-2.5-9::/usr/bin/patch + rootfiles-5.2-5::/root/.bashrc + rpm-3.0.4-0.16::/bin/rpm + rpm-3.0.4-0.16::/usr/lib/librpm.so.0 + rpm-3.0.4-0.16::/usr/lib/rpm/find-provides + rpm-3.0.4-0.16::/usr/lib/rpm/find-requires + rpm-3.0.4-0.16::/usr/lib/rpm/macros + rpm-3.0.4-0.16::/usr/lib/rpm/rpmpopt + rpm-3.0.4-0.16::/usr/lib/rpm/rpmrc + sed-3.02-4::/bin/sed + setup-2.0.5-1::/etc/group + setup-2.0.5-1::/etc/host.conf + setup-2.0.5-1::/etc/passwd + sh-utils-2.0-1::/bin/basename + sh-utils-2.0-1::/bin/false + sh-utils-2.0-1::/bin/sleep + sh-utils-2.0-1::/bin/true + sh-utils-2.0-1::/usr/bin/expr + sh-utils-2.0-1::/usr/bin/id + texinfo-3.12h-2::/usr/bin/makeinfo + textutils-2.0-2::/bin/cat + textutils-2.0-2::/bin/sort + textutils-2.0-2::/usr/bin/cut + textutils-2.0-2::/usr/bin/tr + zlib-1.1.3-5::/usr/lib/libz.so.1 +\endverbatim + +The information can be used to generate build prerequisites. What is still +needed is a sensible approach on + +\verbatim + 1) eliminating obvious common dependencies (e.g. libtool, egcs). + 2) identifying (and removing for now) per-platform build dependencies. + 3) deciding on whether to add the build dependency on a file or on the + package that contains the file. + 4) if adding a dependency on a package, choosing version ranges as + appropriate. +\endverbatim + +but that's up to individual packagers. + +*/ diff --git a/rpm-5.4.9/doc/manual/buildroot b/rpm-5.4.9/doc/manual/buildroot new file mode 100644 index 0000000..a369142 --- /dev/null +++ b/rpm-5.4.9/doc/manual/buildroot @@ -0,0 +1,122 @@ +/*! \page buildroot Using a build root + +The build root is very similar to Root: (which is now legacy). +By using Buildroot: in your spec file you are indicating +that your package can be built (installed into and packaged from) +a user-definable directory. This helps package building by normal +users. + +\subsection buildroot_specfile The Spec File + +Simply use +\verbatim + Buildroot: +\endverbatim + +in your spec file. The actual buildroot used by RPM during the +build will be available to you (and your %prep, %build, and %install +sections) as the environment variable RPM_BUILD_ROOT. You must +make sure that the files for the package are installed into the +proper buildroot. As with Root:, the files listed in the %files +section should *not* contain the buildroot. For example, the +following hypothetical spec file: + +\verbatim + Name: foo + ... + Root: /tmp + + %prep + ... + + %build + ... + + %install + install -m755 fooprog /tmp/usr/bin/fooprog + + %files + /usr/bin/fooprog +\endverbatim + +would be changed to: + +\verbatim + Name: foo + ... + BuildRoot: /tmp + + %prep + ... + + %build + ... + + %install + install -m755 fooprog $RPM_BUILD_ROOT/usr/bin/fooprog + + %files + /usr/bin/fooprog +\endverbatim + +\subsection buildroot_building Building With a Build Root + +RPM will use the buildroot listed in the spec file as the default +buildroot. There are two ways to override this. First, you can +have "buildroot: " in your rpmrc. Second, you can override +the default, and any entry in an rpmrc by using "--buildroot " +on the RPM command line. + +\subsection buildroot_caveats Caveats using Build Roots + +Care should be taken when using buildroots that the install directory +is owned by the correct package. For example the file + +\verbatim + /usr/lib/perl5/site_perl/MD5.pm +\endverbatim + +is installed by the package perl-MD5. If we were to use a buildroot +and specified + +\verbatim + %files + /usr/lib/perl5/site_perl +\endverbatim + +we would end up with the directory /usr/lib/perl5/site_perl being +owned by the library package. This directory is in fact used by ALL +perl libraries and should be owned by the package for perl not any of +its libraries. It is important that the %files command specifies all +the known directories explicitly. So this would be preferable: + +\verbatim + /usr/lib/perl5/site_perl/* +\endverbatim + +Since we only want the files and directories that the package perl-MD5 +installed into /usr/lib/perl5/site_perl/ to be owned by the package. +The directory /usr/lib/perl5/site_perl/ is created when perl is +installed. + +If we were to use the bad %files line shown above, then when the MD5 +package is removed, RPM will try to remove each of the perl-MD5 files and +then try to remove the dir itself. If there's still files in the +site_perl directory (e.g. from other packages) then the Unix rmdir(2) +will fail and you will get a non-zero return code from RPM. If the +rmdir succeeds then you will no longer have a site_perl directory on +your machine even though this directory was created when Perl was +installed. + +The other common problem is that two packages could install two files +with the the same name into the same directory. This would lead to +other collision problems when removing the file. Care should be taken +by the packager to ensure that all packages install unique files. +Explicit use of %files can help make the packager aware of potential +problems before they happen. When you try to install a package which +contains file names already used by other packages on the system then +RPM will warn you of the problem and give a fatal error. This error can +be overridden with --force and the installed file will be replaced by the +new file and when the new package is removed the file will be removed as well. + +*/ diff --git a/rpm-5.4.9/doc/manual/conditionalbuilds b/rpm-5.4.9/doc/manual/conditionalbuilds new file mode 100644 index 0000000..cdff2c4 --- /dev/null +++ b/rpm-5.4.9/doc/manual/conditionalbuilds @@ -0,0 +1,104 @@ +/*! \page conditionalbuilds Passing conditional parameters into a rpm build + +Source code is often built with optional features enabled or disabled. +When source code is packaged using rpm, the various features can be +chosen, added to a spec file, and a package will be produced with +binaries compiled with that feature set. This mechanism works fine +for packages with small feature sets, but does not work so well +for large, complicated, packages like the Linux kernel and/or +the Pine mailer which have a large number of features, as a given +feature set may not "work" for everyone. + +RPM now has a supported mechanism to pass information from the rpm +command line to enable/disable features during a build. Two options have +been added to pass feature names from the rpm command line: +\verbatim + --with Enable + --without Disable +\endverbatim +The new options are implemented using popt to add aliases to the existing rpm +options --define to specify macros from the command line. The magic necessary +to add the new options is (from the file /usr/lib/rpm/rpmpopt*) +\verbatim + rpmb alias --with --define "_with_!#:+ --with-!#:+" + rpmb alias --without --define "_without_!#:+ --without-!#:+" +\endverbatim +(Note: The obscure "!#:+" popt token above says "substitute the next command +line argument found here, and, additionally, mark the argument as used.") + +For example, when rpm is invoked as +\verbatim + rpm ... --with ldap ... +\endverbatim +then the popt aliases will cause the options to be rewritten as +\verbatim + rpm ... --define "_with_ldap --with-ldap" ... +\endverbatim +which causes a "%_with_ldap" macro to be defined with value "--with-ldap" +during a build. + +The macro defined on the rpm command line can be used to conditionalize +portions of the spec file for the package. For example, let's say you +are trying to build the pine package using "--with ldap" to enable the +LDAP support in the pine mailer (i.e. configuring with "--with-ldap"). +So the spec file should be written +\verbatim + ... + ./configure \ + %{?_with_ldap} \ + ... +\endverbatim +so that, if "--with ldap" was used as a build option, then configure +will be invoked (after macro expansion) as +\verbatim + ./configure --with-ldap ... +\endverbatim +(Note: The obscure "%{?_with_ldap: ...}" rpm macro syntax above says "if the +macro "_with_ldap" exists, then expand "...", else ignore.") + +The spec file should include a default value for the "_with_ldap" macro, +and should support "--without ldap" as well. Here's a more complete example +for pine: +\verbatim + # Default values are --without-ldap --with-ssl. + # + # Read: If neither macro exists, then add the default definition. + %{!?_with_ldap: %{!?_without_ldap: %define _without_ldap --without-ldap}} + %{!?_with_ssl: %{!?_without_ssl: %define _with_ssl --with-ssl}} + ... + + # You might want to make sure that one and only one of required and + # mutually exclusive options exists. + # + # Read: It's an error if both or neither required options exist. + %{?_with_ssl: %{?_without_ssl: %{error: both _with_ssl and _without_ssl}}} + %{!?_with_ssl: %{!?_without_ssl: %{error: neither _with_ssl nor _without_ssl}}} + + # Add build dependencies for ssl and ldap features if enabled. + # Note: Tag tokens must start at beginning-of-line. + # + # Read: If feature is enabled, then add the build dependency. + %{?_with_ssl:BuildRequires: openssl-devel} + %{?_with_ldap:BuildRequires: openldap-devel} + ... + + # Configure with desired features. + # + # Read: Add any defined feature values to the configure invocation. + %configure \ + %{?_with_ssl} \ + %{?_without_ssl} \ + %{?_with_ldap} \ + %{?_without_ldap} + ... + + # Conditional tests for desired features. + # + # Read: true if _with_ssl is defined, false if not defined. + %if %{?_with_ssl:1}%{!?_with_ssl:0} + ... + %endif + +\endverbatim + +*/ diff --git a/rpm-5.4.9/doc/manual/dependencies b/rpm-5.4.9/doc/manual/dependencies new file mode 100644 index 0000000..92ad0dc --- /dev/null +++ b/rpm-5.4.9/doc/manual/dependencies @@ -0,0 +1,370 @@ +/*! \page dependencies Dependencies + +Dependencies provide a way for a package builder to require other +packages or capabilities to be installed before or simultaneously +with one another. These can be used to require a python interpretor +for a python based application for example. RPM ensures dependencies +are satisfied whenever packages are installed, erased, or upgraded. + +\subsection dependencies_package Requiring Packages + +To require the packages python and perl, use: + +\verbatim + Requires: python perl +\endverbatim + +in the spec file. Note that "Requires python, perl" would work as well. If you +needed to have a very recent version of python but any version of perl, + +\verbatim + Requires: python >= 1.3, perl +\endverbatim + +would do the trick. Again, the ',' in the line is optional. Instead of +'>=', you may also use '<', '>', '<=', or '='. Spaces are required +around the numeric operator to separate the operator from the package name. + +The full syntax for specifying a dependency on an epoch, version and release +is +\verbatim + [epoch:]version[-release] +\endverbatim +where +\verbatim + epoch (optional) number, with assumed default of 0 if not supplied + version (required) can contain any character except '-' + release (optional) can contain any character except '-' +\endverbatim + +For example, + +\verbatim + Requires: perl >= 9:5.00502-3 +\endverbatim + +specifies + +\verbatim + epoch=9 + version=5.00502 + release=3 +\endverbatim + +The epoch (if present) is a monotonically increasing integer, neither the +version or the release can contain the '-' hyphen character, and the dependency +parser does not permit white space within a definition. Unspecified epoch +and releases are assumed to be zero, and are interpreted as "providing all" +or "requiring any" value. + +The release tag is usually incremented every time a package is rebuilt for +any reason, even if the source code does not change. For example, changes +to the specfile, compiler(s) used to build the package, and/or dependency +changes should all be tracked by incrementing the release. The version number, +on the other hand, is usually set by the developer or upstream maintainer, +and should not be casually modified by the packager. + +Version numbering should be kept simple so that it is easy to determine the +version ordering for any set of packages. If the packager needs to separate +a release from all other releases that came before it, then the epoch, the +most significant part of package ordering, can be changed. + +The algorithm that RPM uses to determine the version ordering of +packages is simple and developers are encouraged not to rely on the +details of its working. Developers should keep their numbering scheme +simple so any reasonable ordering algorithm would work. The version +comparison algorithm is in the routine rpmvercmp() and it is just a segmented +strcmp(3). First, the boundaries of the segments are found using +isdigit(3)/isalpha(3). Each segment is then compared in order with the +right most segment being the least significant. The alphabetical +portions are compared using a lexical graphical ascii ordering, the +digit segments strip leading zeroes and compare the strlen before +doing a strcmp. If both numerical strings are equal, the longer string +is larger. Notice that the algorithm has no knowledge of decimal fractions, +and perl-5.6 is "older" than perl-5.00503 because the number 6 is less than +the number 503. + +The concept of "newer" used by rpm to determine when a package should be +upgraded can be broken if version format changes oddly, such as when the +version segments cannot be meaningfully compared. + +Example of a bad format change: 2.1.7Ax to 19980531 +\verbatim + The date may be the older version, but it is numerically greater + 2 so it is considered newer :( +\endverbatim + +Example of a bad increment: 2.1.7a to 2.1.7A +\verbatim + The 'a' (ASCII 97) is compared against 'A' (ASCII 65), making 2.1.7a + the newer version. +\endverbatim + +Stick to major.minor.patchlevel using numbers for each if you can. +Keeps life simple :-) + +If a Requires: line needs to include an epoch in the comparison, then +the line should be written like + +\verbatim + Requires: somepackage = 23:version +\endverbatim + +You can't continue a "Requires: " line. If you have multiple +"Requires: " lines then the package requires all packages mentioned on +all of the lines to be installed. + +\subsection dependencies_prereqs Prereqs + +Prereqs are different from requires only in that a PreReq is guaranteed +to be installed before the package that contains the PreReq. PreReq's +are used only to order packages, otherwise PreReq's are exactly the same +as a Requires: dependency. + +\subsection dependencies_virtual Virtual Packages + +Sometimes you need to make sure the system your package is being installed +on has a package which provides a certain capability, even though you don't +care what specific package provides it. For example, sendmail won't work +properly unless a local delivery agent (lda) is present. You can ensure that +one is installed like this: + +\verbatim + Requires: lda +\endverbatim + +This will match either a package called lda (as mentioned above), or any +package which contains: + +\verbatim + Provides: lda +\endverbatim + +in its .spec file. No version numbers may be used with virtual packages. + +Virtual packages are often used to supply file dependencies such as /bin/sh +on machines that are only partly managed by rpm. A virtual package with +\verbatim + Provides: /bin/sh +\endverbatim +differs from a package that has /bin/sh in the %files list in that the +package can be safely removed without removing /bin/sh. + +\subsection dependencies_automatic Automatic Dependencies + +To reduce the amount of work required by the package builder, RPM scans +the file list of a package when it is being built. Any files in the file +list which require shared libraries to work (as determined by ldd) cause +that package to require the shared library. + +For example, if your package contains /bin/vi, RPM will add dependencies +for both libtermcap.so.2 and libc.so.5. These are treated as virtual +packages, so no version numbers are used. + +A similar process allows RPM to add Provides information automatically. Any +shared library in the file list is examined for its soname (the part of +the name which must match for two shared libraries to be considered +equivalent) and that soname is automatically provided by the package. For +example, the libc-5.3.12 package has provides information added for +libm.so.5 and libc.so.5. We expect this automatic dependency generation +to eliminate the need for most packages to use explicit Requires: lines. + +\subsection dependencies_custom Custom Automatic Dependency + +The automatic dependency programs are found via macro expansion. Thus +sites can very the amount of dependency processing that are performed +locally, by changing the executable/script which is run. Dependency +processing can even be changed on a per-package basis if the macros are +defined in the spec file. To allow for maximum configurability the +dependency programs are shell scripts which can be duplicated and edited +for site specific needs. + +The macros: %__find_provides, %__find_prereq, %__find_requires, +%__find_conflicts, %__find_obsoletes, if they exist, are expanded to +the name of a program to exec. For each package, the program receives +the glob'ed %files manifest on stdin and returns dependencies on stdout. The +discovered dependencies are parsed exactly as if they were found after + +\verbatim + Provides: + PreReq: + Requires: + Conflicts: + Obsoletes: +\endverbatim +tokens in a spec file (i.e. the same parser is used), so items look like +(comments added) +\verbatim + /bin/sh # file existence + libc.so.6 # soname existence + foo <= 1:2.3-4 # versioned package + perl5(Apache) <= 1.2 # versioned namespace +\endverbatim + +The default rpm configuration has only + %__find_provides /usr/lib/rpm/find-provides + %__find_requires /usr/lib/rpm/find-requires +which can be overridden (or even undefined) within a spec file. + +\subsection dependencies_interpreters Interpreters and Shells + +Modules for interpreted languages like perl and tcl impose additional +dependency requirements on packages. A script written for an interpreter +often requires language specific modules to be installed in order to execute +correctly. In order to automatically detect language specific modules, each +interpreter may have its own find-provides and find-requires. To prevent +module name collisions between interpreters, module names are enclosed within +parentheses and a conventional interpreter specific identifier is prepended: + + +\verbatim + Provides: perl(MIME-Base64), perl(Mail-Header)-1-09 + + Requires: perl(Carp), perl(IO-Wrap) = 4.5 +\endverbatim + + +The output of a per-interpreter find-requires (notice in this example the +first requirement is a package and the rest are language specific modules) + +\verbatim + Mail-Header >= 1.01 + perl(Carp) >= 3.2 + perl(IO-Wrap) == 4.5 or perl(IO-Wrap)-4.5 +\endverbatim + +the output from find-provides is +\verbatim + Foo-0.9 + perl(Widget)-0-1 +\endverbatim + +The per-interpreter automatic module detectors will normally be located in +\verbatim + /usr/lib/rpm/{perl,tcl}/find-{provides,requires} +with appropriate per-interpreter hooks into +\verbatim + /usr/lib/rpm/find-{provides,requires} +\endverbatim + +@todo per-interpreter dependency generators are not located in subdirectories. + +Notice that shell dependencies will require that all %post et al scriptlets +be processed by the find-requires. Since a shell script depends on all the +programs which it runs. + + +\subsection dependencies_installing Installing and Erasing Packages with Dependencies + +For the most part, dependencies should be transparent to the user. However, +a few things will change. + +First, when packages are added or upgraded, all of their dependencies +must be satisfied. If they are not, an error message like this appears: + +\verbatim + failed dependencies: + libICE.so.6 is needed by somepackage-2.11-1 + libSM.so.6 is needed by somepackage-2.11-1 + libc.so.5 is needed by somepackage-2.11-1 +\endverbatim + +Similarly, when packages are removed, a check is made to ensure that +no installed packages will have their dependency conditions break due to +the packages being removed. If you wish to turn off dependency checking for +a particular command, use the --nodeps flag. + +\subsection dependencies_conflicts Conflicts + +While conflicts were implemented in earlier versions of RPM they never +worked properly until RPM 2.3.4 (well, we hope they work properly now +anyway). + +Conflicts allow a package to say it won't work with another package (or +virtual package) installed on the system. For example, qmail doesn't work +(w/o custom setup) on machines with sendmail installed. The qmail spec file +may codify this with a line like: + +\verbatim + Conflicts: sendmail +\endverbatim + +The syntax of the "Conflicts" tag is identical to the syntax of the Requires +tag and conflict checking may be overridden by using the --nodeps flag. + +\subsection dependencies_querying Querying for Dependencies + +Two new query information selection options are now available. The first, +--provides, prints a list of all of the capabilities a package provides. +The second, --requires, shows the other packages that a package requires +to be installed, along with any version number checking. + +There are also two new ways to search for packages. Running a query with +--whatrequires ITEM queries all of the packages that require ITEM. +Similarly, running --whatprovides ITEM queries all of the packages that +provide the ITEM virtual package. Note that querying for package that +provides "python" will not return anything, as python is a package, not +a virtual package. + +\subsection dependencies_verifying Verifying Dependencies + +As of RPM 2.2.2, -V (aka --verify) verifies package dependencies +by default. You can tell rpm to ignore dependencies during system +verification with the --nodeps. If you want RPM to verify just dependencies +and not file attributes (including file existence), use the --nofiles +flag. Note that "rpm -Va --nofiles --nodeps" will not verify anything at +all, nor generate an error message. + +\subsection dependencies_branching Branching Version + +It is quite common to need to branch a set of sources in version +control. It is not so obvious how those branches should be represented +in the package version numbers. Here is one solution. + +You have a bag of features that are injected into a package in a +non-ordered fashion, and you want to have the package +name-version-release be able to: + +\verbatim + 1) identify the "root version" of the source code. + 2) identify the handful of features that are in that + branch of the package. + 3) preserve sufficient ordering so that packages upgrade + without the use of --oldpackage. +\endverbatim + +A simple (but possibly not adequate) scheme to achieve this is: + +\verbatim + Name: foo + Version: VERSION # i.e. the upstream version + Release: RELEASE.BRANCH +\endverbatim + +where the release instance is something like YYYMMMDD or some linear +record of the number of builds with the current tar file, it is used +to preserve ordering when necessary. + +Another alternative scheme might be: + +\verbatim + Name: foo + Epoch: BRANCH + Version: VERSION + Release: RELEASE +\endverbatim + +\subsection dependencies_build Build dependencies + +The following dependencies are available at build time. These are +similar to the install time version but these apply only during +package creation and are specified in the specfile not in the binary +package. + +\verbatim + BuildRequires: + BuildConflicts: + BuildPreReq: +\endverbatim + +*/ diff --git a/rpm-5.4.9/doc/manual/filetriggers b/rpm-5.4.9/doc/manual/filetriggers new file mode 100644 index 0000000..5876afb --- /dev/null +++ b/rpm-5.4.9/doc/manual/filetriggers @@ -0,0 +1,88 @@ +== Introduction == + +Filetriggers allow to run some scripts when some file has been added or removed. + +The typical use cases are: + +* updating /etc/ld.so.cache when some libraries have been added/removed in /usr/lib or /lib +* running update-menus to update menus of non-XDG compliant desktops when some *.desktop have been added/removed in /usr/share/applications + +== Usage == + +Add the following to your macros to enable filetriggers: + +
+%_filetriggers_dir /var/lib/rpm/filetriggers
+
+ +Then install your watchers: + +
+% cat /var/lib/rpm/filetriggers/ldconfig.filter
+^.(/lib|/usr/lib)/[^/]*\.so\.
+% cat /var/lib/rpm/filetriggers/ldconfig.script
+#!/bin/sh
+ldconfig -X
+% cat /var/lib/rpm/filetriggers/gtk-icon-cache-hicolor.filter
+^./usr/share/icons/hicolor/
+% cat /var/lib/rpm/filetriggers/gtk-icon-cache-hicolor.script
+#!/bin/sh
+/usr/bin/gtk-update-icon-cache --force --quiet /usr/share/icons/hicolor
+
+ +== Implementation == + +=== files-awaiting-filetriggers === + +When a package is successfully installed (or removed), rpm will append the +installed (resp. removed) files to {{file|/var/lib/rpm/files-awaiting-filetriggers}}. + +The format is quite simple: + +where ::= "+" | "-" + +For example, after installing hexedit: + +
++/usr/bin/hexedit
++/usr/share/doc/hexedit
++/usr/share/doc/hexedit/COPYING
++/usr/share/doc/hexedit/TODO
++/usr/share/doc/hexedit/hexedit-1.2.12.lsm
++/usr/share/man/man1/hexedit.1.lzma
+
+ +=== rpmRunFileTriggers === + +This function is called before running {{macro|%posttrans}} scriptlets. It can be +disabled using --noscripts or --notriggers (no special command line option +introduced for now). + +For each {{file|%_filetriggers_dir/*.filter}}, the regexp (POSIX Extended Regular +Expression) on the first line is applied on {{file|files-awaiting-filetriggers}}. If +some files match, the corresponding {{prog|%_filetriggers_dir/.script}} is +called, with matching lines passed in stdin. + +Note that this is done in parallel, so multiple {{prog|.script}} may be running +at the same time. + +When it's done, {{file|/var/lib/rpm/files-awaiting-filetriggers}} is removed. + +== Comments == + +Characteristics of this implementation : +* if the transaction is aborted, the next successful transaction will run on every succesful package installation/removal. This is due to files-awaiting-filetriggers which allows to keep state of what is done or not. +* it needs only a light patch in rpm +* files-awaiting-filetriggers may be getting big (eg: 5MB on a big transaction of 1000 packages) +* not fully integrated in rpm: +** --nofiletriggers and RPMTRANS_FLAG_NOFILETRIGGERS should be added +** a new command {{cmd|rpm --run-filetriggers}} would be useful to force running filetriggers, and only them. + +Some links about filetriggers: +* triggers in dpkg: +** http://www.dpkg.org/dpkg/Triggers +** http://lists.debian.org/debian-devel/2008/03/msg00931.html +** http://lists.debian.org/debian-dpkg/2007/04/msg00076.html +* what may get in rpm.org: +** http://www.mail-archive.com/rpm-maint@lists.rpm.org/msg00789.html +** http://www.mail-archive.com/rpm-maint@lists.rpm.org/msg00788.html diff --git a/rpm-5.4.9/doc/manual/format b/rpm-5.4.9/doc/manual/format new file mode 100644 index 0000000..5eb494b --- /dev/null +++ b/rpm-5.4.9/doc/manual/format @@ -0,0 +1,273 @@ +/*! \page pkgformat Package format + +This document describes the RPM file format version 3.0, which is used +by RPM versions 2.1 and greater. The format is subject to change, and +you should not assume that this document is kept up to date with the +latest RPM code. That said, the 3.0 format should not change for +quite a while, and when it does, it will not be 3.0 anymore :-). + +\warning In any case, THE PROPER WAY TO ACCESS THESE STRUCTURES IS THROUGH +THE RPM LIBRARY!! + +The RPM file format covers both source and binary packages. An RPM +package file is divided in 4 logical sections: + +\verbatim +. Lead -- 96 bytes of "magic" and other info +. Signature -- collection of "digital signatures" +. Header -- holding area for all the package information (aka "metadata") +. Payload -- compressed archive of the file(s) in the package (aka "payload") +\endverbatim + +All 2 and 4 byte "integer" quantities (int16 and int32) are stored in +network byte order. When data is presented, the first number is the +byte number, or address, in hex, followed by the byte values in hex, +followed by character "translations" (where appropriate). + +\subsection pkgformat_lead Lead + +The Lead is basically for file(1). All the information contained in +the Lead is duplicated or superceded by information in the Header. +Much of the info in the Lead was used in old versions of RPM but is +now ignored. The Lead is stored as a C structure: + +\code +struct rpmlead { + unsigned char magic[4]; + unsigned char major, minor; + short type; + short archnum; + char name[66]; + short osnum; + short signature_type; + char reserved[16]; +}; +\endcode + +and is illustrated with one pulled from the rpm-2.1.2-1.i386.rpm +package: + +\verbatim +00000000: ed ab ee db 03 00 00 00 +\endverbatim + +The first 4 bytes (0-3) are "magic" used to uniquely identify an RPM +package. It is used by RPM and file(1). The next two bytes (4, 5) +are int8 quantities denoting the "major" and "minor" RPM file format +version. This package is in 3.0 format. The following 2 bytes (6-7) +form an int16 which indicates the package type. As of this writing +there are only two types: 0 == binary, 1 == source. + +\verbatim +00000008: 00 01 72 70 6d 2d 32 2e ..rpm-2. +\endverbatim + +The next two bytes (8-9) form an int16 that indicates the architecture +the package was built for. While this is used by file(1), the true +architecture is stored as a string in the Header. See, lib/misc.c for +a list of architecture->int16 translations. In this case, 1 == i386. +Starting with byte 10 and extending to byte 75, are 65 characters and +a null byte which contain the familiar "name-version-release" of the +package, padded with null (0) bytes. + +\verbatim +00000010: 31 2e 32 2d 31 00 00 00 1.2-1... +00000018: 00 00 00 00 00 00 00 00 ........ +00000020: 00 00 00 00 00 00 00 00 ........ +00000028: 00 00 00 00 00 00 00 00 ........ +00000030: 00 00 00 00 00 00 00 00 ........ +00000038: 00 00 00 00 00 00 00 00 ........ +00000040: 00 00 00 00 00 00 00 00 ........ +00000048: 00 00 00 00 00 01 00 05 ........ +\endverbatim + +Bytes 76-77 ("00 01" above) form an int16 that indicates the OS the +package was built for. In this case, 1 == Linux. The next 2 bytes +(78-79) form an int16 that indicates the signature type. This tells +RPM what to expect in the Signature. For version 3.0 packages, this +is 5, which indicates the new "Header-style" signatures. + +\verbatim +00000050: 04 00 00 00 68 e6 ff bf ........ +00000058: ab ad 00 08 3c eb ff bf ........ +\endverbatim + +The remaining 16 bytes (80-95) are currently unused and are reserved +for future expansion. + +\subsection pkgformat_signature Signature + +A 3.0 format signature (denoted by signature type 5 in the Lead), uses +the same structure as the Header. For historical reasons, this +structure is called a "header structure", which can be confusing since +it is used for both the Header and the Signature. The details of the +header structure are given below, and you'll want to read them so the +rest of this makes sense. The tags for the Signature are defined in +lib/signature.h. + +The Signature can contain multiple signatures, of different types. +There are currently only three types, each with its own tag in the +header structure: + +\verbatim + Name Tag Header Type + ---- ---- ----------- + SIZE 1000 INT_32 + MD5 1001 BIN + PGP 1002 BIN +\endverbatim + +The MD5 signature is 16 bytes, and the PGP signature varies with +the size of the PGP key used to sign the package. + +As of RPM 2.1, all packages carry at least SIZE and MD5 signatures, +and the Signature section is padded to a multiple of 8 bytes. + +\subsection pkgformat_header Header + +The Header contains all the information about a package: name, +version, file list, etc. It uses the same "header structure" as the +Signature, which is described in detail below. A complete list of the +tags for the Header would take too much space to list here, and the +list grows fairly frequently. For the complete list see lib/rpmlib.h +in the RPM sources. + +\subsection pkgformat_payload Payload + +The Payload is currently a gzipped cpio archive. The cpio +archive type used is SVR4 with a CRC checksum. + +\subsection pkgformat_header_structure The Header Structure + +The header structure is a little complicated, but actually performs a +very simple function. It acts almost like a small database in that it +allows you to store and retrieve arbitrary data with a key called a +"tag". When a header structure is written to disk, the data is +written in network byte order, and when it is read from disk, is is +converted to host byte order. + +Along with the tag and the data, a data "type" is stored, which indicates, +obviously, the type of the data associated with the tag. There are +currently 9 types: + +\verbatim + Type Number + ---- ------ + NULL 0 + CHAR 1 + INT8 2 + INT16 3 + INT32 4 + INT64 5 + STRING 6 + BIN 7 + STRING_ARRAY 8 + I18NSTRING_TYPE 9 +\endverbatim + +One final piece of information is a "count" which is stored with each +tag, and indicates the number of items of the associated type that are +stored. As a special case, the STRING type is not allowed to have a +count greater than 1. To store more than one string you must use a +STRING_ARRAY. + +Altogether, the tag, type, count, and data are called an "Entry" or +"Header Entry". + +\verbatim +00000000: 8e ad e8 01 00 00 00 00 ........ +\endverbatim + +A header begins with 3 bytes of magic "8e ad e8" and a single byte to +indicate the header version. The next four bytes (4-7) are reserved. + +\verbatim +00000008: 00 00 00 20 00 00 07 77 ........ +\endverbatim + +The next four bytes (8-11) form an int32 that is a count of the number +of entries stored (in this case, 32). Bytes 12-15 form an int32 that +is a count of the number of bytes of data stored (that is, the number +of bytes made up by the data portion of each entry). In this case it +is 1911 bytes. + +\verbatim +00000010: 00 00 03 e8 00 00 00 06 00 00 00 00 00 00 00 01 ................ +\endverbatim + +Following the first 16 bytes is the part of the header called the +"index". The index is made of up "index entries", one for each entry +in the header. Each index entry contains four int32 quantities. In +order, they are: tag, type, offset, count. In the above example, we +have tag=1000, type=6, offset=0, count=1. By looking up the the tag +in lib/rpmlib.h we can see that this entry is for the package name. +The type of the entry is a STRING. The offset is an offset from the +start of the data part of the header to the data associated with this +entry. The count indicates that there is only one string associated +with the entry (which we really already knew since STRING types are +not allowed to have a count greater than 1). + +In our example there would be 32 such 16-byte index entries, followed +by the data section: + +\verbatim +00000210: 72 70 6d 00 32 2e 31 2e 32 00 31 00 52 65 64 20 rpm.2.1.2.1.Red +00000220: 48 61 74 20 50 61 63 6b 61 67 65 20 4d 61 6e 61 Hat Package Mana +00000230: 67 65 72 00 31 e7 cb b4 73 63 68 72 6f 65 64 65 ger.1...schroede +00000240: 72 2e 72 65 64 68 61 74 2e 63 6f 6d 00 00 00 00 r.redhat.com.... +... +00000970: 6c 69 62 63 2e 73 6f 2e 35 00 6c 69 62 64 62 2e libc.so.5.libdb. +00000980: 73 6f 2e 32 00 00 so.2.. +\endverbatim + +The data section begins at byte 528 (4 magic, 4 reserved, 4 index +entry count, 4 data byte count, 16 * 32 index entries). At offset 0, +bytes 528-531 are "rpm" plus a null byte, which is the data for the +first index entry (the package name). Following is is the data for +each of the other entries. Each string is null terminated, the strings +in a STRING_ARRAY are also null terminated and are place one after +another. The integer types are aligned to appropriate byte boundaries, +so that the data of INT64 type starts on an 8 byte boundary, INT32 +type starts on a 4 byte boundary, and an INT16 type starts on a 2 byte +boundary. For example: + +\verbatim +00000060: 00 00 03 ef 00 00 00 06 00 00 00 28 00 00 00 01 ................ +00000070: 00 00 03 f1 00 00 00 04 00 00 00 40 00 00 00 01 ................ +... +00000240: 72 2e 72 65 64 68 61 74 2e 63 6f 6d 00 00 00 00 r.redhat.com.... +00000250: 00 09 9b 31 52 65 64 20 48 61 74 20 4c 69 6e 75 ....Red Hat Linu +\endverbatim + +Index entry number 6 is the BUILDHOST, of type STRING. Index entry +number 7 is the SIZE, of type INT32. The corresponding data for entry +6 end at byte 588 with "....redhat.com\0". The next piece of data +could start at byte 589, byte that is an improper boundary for an INT32. +As a result, 3 null bytes are inserted and the date for the SIZE actually +starts at byte 592: "00 09 9b 31", which is 629553). + +\subsection pkgformat_tools Tools + +The tools directory in the RPM sources contains a number of small +programs that use the RPM library to pick apart packages. These +tools are mostly used for debugging, but can also be used to help +you understand the internals of the RPM package format. + +\verbatim + rpmlead - extracts the Lead from a package + rpmsignature - extracts the Signature from a package + rpmheader - extracts the Header from a package + rpmarchive - extracts the Archive from a package + dump - displays a header structure in readable format +\endverbatim + +Given a package foo.rpm you might try: + +\verbatim + rpmlead foo.rpm | od -x + rpmsignature foo.rpm | dump + rpmheader foo.rpm | dump + rpmarchive foo.rpm | zcat | cpio --list +\endverbatim + +*/ diff --git a/rpm-5.4.9/doc/manual/hregions b/rpm-5.4.9/doc/manual/hregions new file mode 100644 index 0000000..1bdb4f1 --- /dev/null +++ b/rpm-5.4.9/doc/manual/hregions @@ -0,0 +1,89 @@ +/*! \page hregions Immutable header regions in rpm-4.0.1 and later + +The header data structure has changed in rpm-4.0.[12] to preserve the +original header from a package. The goal is to keep the original +header intact so that metadata can be verified separately from the +payload by the RHN up2date client and by the rpm command line verify +mode using signatures saved in the rpm database. I believe the change +is entirely forward and backward compatible, and will not require +any artifacts like changing the version number of packaging or +adding an "rpmlib(...)" tracking dependency. We'll see ... + +Here's a short description of the change. An rpm header has three sections: +\verbatim + 1) intro (# entries in index, # bytes of data) + 2) index 16 byte entries, one per tag, big endian + 3) data tag values, properly aligned, big endian +\endverbatim + +Representing sections in the header (ignoring the intro) with +\verbatim + A,B,C index entries sorted by tag number + a,b,c variable length entry data + | boundary between index/data +\endverbatim +a header with 3 tag/value pairs (A,a) can be represented something like +\verbatim + ABC|abc +\endverbatim + +The change is to introduce a new tag that keeps track of a contiguous +region (i.e. the original header). Representing the boundaries with +square/angle brackets, an "immutable region" in the header thus becomes +\verbatim + [ABC|abc] +\endverbatim +or more generally (spaces added for clarity) +\verbatim + [ABC> QRS | [DEF> QRS | > QRS | < QRS XYZ | QRS D | older versions of RPM, +remove everything from /var/lib/rpm _EXCEPT_ Packages, install +rpm-5.1.9, and do a --rebuildb -vv. If that fails, restore +from the saved tarball. + +Now for a terse description of some things to watch out for. + +1) DB_CONFIG is used to configure Berkeley DB rather than macros. + + There's a rpmdb/DB_CONFIG file that is installed. There are + 3 lines that are important atm: + + set_thread_count 64 + set_cachesize 0 1048576 0 + set_mp_mmapsize 16777216 + + The above captures all the Berkeley DB tunables that RPM has been using. + + (aside) + It turns out that there are some significant performance advantages + if you increase the last 2 lines to + set_cachesize 0 67108864 4 + set_mp_mmapsize 268435456 + See details at + https://bugzilla.redhat.com/show_bug.cgi?id=536818 + The configuration should apply to any recent version of Berkeley DB + used by RPM, with expected performance increases from using mmap(2) + rather than pread(2) for I/O. + +2) You can't just do "rm -rf /var/lib/rpm/__db*" to fix problems anymore. + + There's additional state in /var/lib/rpm that is needed for transactionally + protected ACID behavior, including: + Seqno this a database/table with a persistent header instance counter + log.* these are the transactional log files + One cannot remove Seqno without doing --rebuilddb, or the h# instances will go awry. + If you remove the log.* files, then you cannot open Packages. The simple + (to explain) fix is to install rpm-5.1.9, do --rebuilddb, then return to + HEAD to continue. + + There's another (more difficult to explain) fix to change from the transactional logging + model back to the concurrent access model and then doing --rebuilddb. + + Here is the older macro settings + %__dbi_cdb create cdb mpool mp_mmapsize=16Mb mp_size=1Mb thread_count=64 + and the newer + %__dbi_txn create lock log mpool txn auto_commit thread thread_count=64 + Note that the macro name has changed, and that mp_mmapsize mp_size are now set from + DB_CONFIG (the thread_count will end up in DB_CONFIG, but db-4.7.25 needs a patch) + + Other Berkeley DB configuration changes + 1) permitting duplicate keys + 2) attaching secondary indices to Packages + that is largely handled by these macros atm + %_bt_dupsort bt_dupsort index + %_h_dupsort h_dupsort index + I wouldn't advise changing those values, you will likely not be happy. + + But other than new state in Seqno and log.* files, well you can do + rm -f /var/lib/rpm/__db* + files whenever you want. + +3) Join keys are now network order, not native order. + + Previously, rpm itself used to handle join keys, and + the join keys were in host order. Most of that code + is now in the bit bucket. + + In order for DB_BTREE to be used with memcmp(), and so that + duplicates can be sorted with memcmp, integer fields need to + be saved in network order always. This is a change from previous + rpmdb behavior, which used to save integers in native order. + + You can see the join keys (or header instances) by doing + rpm -qavv + If the numbers aren't small integer values, then something is wrong. + + When moving to HEAD or back to 5.1.9, --rebuilddb just iterates using DB_NEXT + so the endianness will not matter. + + Note that the old convention of renumbering instances doing --rebuilddb, and + saving the counter in Packages with a key of 0 is now history. What is done + instead is to assign h #'s persistently (i.e. the value is preserved across + --rebuilddb) using the counter stored in Seqno. + +4) There's debugging messages that are displayed while installing. + + I'll rework the "syscall ACID" and "scriptlet ACID" logging tomorrow + to turn off the debugging messages and to add a disabler for adding + the (not yet finalized) syscall/scriptlet records to the transactional + log. + + (aside) + I've been waiting to see how much of syscall/scriptlet logging could + be shared with what Mancoosi WP3 is going to do. But they appear + to be headed for a different --rollback implementation not based + on Berkeley DB, so I will finalize syscall/scriptlet log records + @rpm5.org over the next 2 weeks without additional input. + +If you run into issues or problems, please report here on . + +You can also often find me on #rpm through freenode. But please note that +I will be traveling next week, and so e-mail is likely the best reporting +mechanism. + +Again, I will have a proper HOWTO/FAQ written up as experience is gained. +I personally have been using some variant of the above "database ACID" +for about a month in development. I believe I'm close to being able +to finalize the "database ACID" changes, but one never knows until one tries. diff --git a/rpm-5.4.9/doc/manual/queryformat b/rpm-5.4.9/doc/manual/queryformat new file mode 100644 index 0000000..b6f6e25 --- /dev/null +++ b/rpm-5.4.9/doc/manual/queryformat @@ -0,0 +1,173 @@ +/*! \page queryformat Query formats + +As it is impossible to please everyone with one style of query output, RPM +allows you to specify what information should be printed during a query +operation and how it should be formatted. + +\subsection queryformat_tags Tags + +All of the information a package contains, apart from signatures and the +actual files, is in a part of the package called the header. Each piece +of information in the header has a tag associated with it which allows +RPM to to tell the difference between the name and description of a +package. + +To get a list of all of the tags your version of RPM knows about, run the +command 'rpm --querytags'. It will print out a list like (but much longer +then) this: + +\verbatim + RPMTAG_NAME + RPMTAG_VERSION + RPMTAG_RELEASE + RPMTAG_SERIAL + RPMTAG_SUMMARY + RPMTAG_DESCRIPTION + RPMTAG_BUILDTIME + RPMTAG_BUILDHOST + RPMTAG_INSTALLTIME + RPMTAG_SIZE +\endverbatim + +As all of these tags begin with RPMTAG_, you may omit it from query format +specifiers and it will be omitted from the rest of this documentation for +the same reason. + +A tag can consist of one element or an array of elements. Each element can +be a string or number only. + +\subsection queryformat_format Query Formats + +A query format is passed to RPM after the --queryformat argument, and normally +should be enclosed in single quotes. This query format is then used to print +the information section of a query. This means that when both -i and +--queryformat are used in a command, the -i is essentially ignored. +Additionally, using --queryformat implies -q, so you may omit the -q as well. + +The query format is similar to a C style printf string, which the printf(2) +man page provides a good introduction to. However, as RPM already knows the +type of data that is being printed, you must omit the type specifier. In +its place put the tag name you wish to print enclosed in curly braces +({}). For example, the following RPM command prints the names and sizes +of all of the packages installed on a system: + +\verbatim + rpm -qa --queryformat "%{NAME} %{SIZE}\n" +\endverbatim + +If you want to use printf formatters, they go between the % and {. To +change the above command to print the NAME in the first 30 bytes and +right align the size to, use: + +\verbatim + rpm -qa --queryformat "%-30{NAME} %10{SIZE}\n" +\endverbatim + +\subsection queryformat_arrays Arrays + +RPM uses many parallel arrays internally. For example, file sizes and +file names are kept as an array of numbers and an array of strings +respectively, with the first element in the size array corresponding +to the first element in the name array. + +To iterate over a set of parallel arrays, enclose the format to be used +to print each item in the array within square brackets ([]). For example, +to print all of the files and their sizes in the slang-devel package +followed by their sizes, with one file per line, use this command: + +\verbatim + rpm -q --queryformat "[%-50{FILENAMES} %10{FILESIZES}\n]" slang-devel +\endverbatim + +Note that since the trailing newline is inside of the square brackets, one +newline is printed for each filename. + +A popular query format to try to construct is one that prints the +name of a package and the name of a file it contains on one line, +repeated for every file in the package. This query can be very useful +for passing information to any program that's line oriented (such as +grep or awk). If you try the obvious, + +\verbatim + rpm --queryformat "[%{NAME} %{FILENAMES}\n]" cdp +\endverbatim + +If you try this, you'll see RPM complain about a "parallel array size +mismatch". Internally, all items in RPM are actually arrays, so the NAME +is a string array containing one element. When you tell RPM to iterate +over the NAME and FILENAMES elements, RPM notices the two tags have +different numbers of elements and complains. + +To make this work properly, you need to tell RPM to always print the first +item in the NAME element. You do this by placing a '=' before the tag +name, like this: + +\verbatim + rpm --queryformat "[%{=NAME} %{FILENAMES}\n]" cdp +\endverbatim + +which will give you the expected output. + +\verbatim + cdp /usr/bin/cdp + cdp /usr/bin/cdplay + cdp /usr/man/man1/cdp.1 +\endverbatim + +\subsection queryformat_formatting Formatting Tags + +One of the weaknesses with query formats is that it doesn't recognize +that the INSTALLTIME tag (for example) should be printed as a date instead +of as a number. To compensate, you can specify one of a few different +formats to use when printing tags by placing a colon followed the formatting +name after the tag name. Here are some examples: + +\verbatim + rpm -q --queryformat "%{NAME} %{INSTALLTIME:date}\n" fileutils + rpm -q --queryformat "[%{FILEMODES:perms} %{FILENAMES}\n]" rpm + rpm -q --queryformat \ + "[%{REQUIRENAME} %{REQUIREFLAGS:depflags} %{REQUIREVERSION}\n]" \ + vlock +\endverbatim + +The :shescape may be used on plain strings to get a string which can pass +through a single level of shell and give the original string. + +\subsection queryformat_expressions Query Expressions + +Simple conditionals may be evaluated through query expressions. Expressions +are delimited by %|...|. The only type of expression currently supported +is a C-like ternary conditional, which provides simple if/then/else +conditions. For example, the following query format display "present" if +the SOMETAG tag is present, and "missing" otherwise: + +\verbatim + %|SOMETAG?{present}:{missing}| +\endverbatim + +Notice that the subformats "present" and "missing" must be inside of curly +braces. + +\subsection queryformat_example Example: Viewing the Verify Flags + +The following example query is run against dev because I know %verify +is used there. +\verbatim + rpm -q --qf '[%{filenames} %{fileverifyflags}\n]' dev +\endverbatim + +The flags are defined in rpmlib.h (check there for changes): +\verbatim + #define RPMVERIFY_MD5 (1 << 0) + #define RPMVERIFY_FILESIZE (1 << 1) + #define RPMVERIFY_LINKTO (1 << 2) + #define RPMVERIFY_USER (1 << 3) + #define RPMVERIFY_GROUP (1 << 4) + #define RPMVERIFY_MTIME (1 << 5) + #define RPMVERIFY_MODE (1 << 6) + #define RPMVERIFY_RDEV (1 << 7) +\endverbatim + +A 1 bit in the output of the query means the check is enabled. + +*/ diff --git a/rpm-5.4.9/doc/manual/relocatable b/rpm-5.4.9/doc/manual/relocatable new file mode 100644 index 0000000..d070072 --- /dev/null +++ b/rpm-5.4.9/doc/manual/relocatable @@ -0,0 +1,57 @@ +/*! \page relocatable Relocatable packages + +Relocatable packages are a way to give the user a little control +over the installation location of a package. For example, a vendor +may distribute their software to install in "/opt" but you'd like +it to install in "/usr/opt". If the vendor were distributing a +relocatable RPM package, it would be easy. + +\subsection relocatable_building Building a Relocatable Package + +Not all software can be "relocatable". Before continuing you should +think about how the program works, what files it accesses, what other +programs access *it* (and expect it to be in a certain place), etc. +If you determine that the location of the package doesn't matter, +then it can probably be built as "relocatable". + +All you need to do to build a relocatable package is put one or more: + +\verbatim + Prefix: +\endverbatim + +in your spec file. The "" will usually be something like "/usr", +"/usr/local", or "/opt". Every file in your %files list must start +with that prefix. For example, if you have "Prefix: /usr" and your +%files list contains "/etc/foo.conf", the build will fail. The fix for +this is to put + +\verbatim + Prefix: /usr + Prefix: /etc +\endverbatim + +into the spec file so that the /usr and /etc directories may be +relocated separately when this package is installed. + + +\subsection relocatable_installing Installing Relocatable Packages + +By default, RPM will install a relocatable package in the prefix +directory listed in the spec file. You can override this on the +RPM install command line with "--prefix ". For example, if +the package in question were going to be installed in "/opt" but +you don't have enough disk space there (and it is a relocatable +package), you could install it "--prefix /usr/opt". + +If there is more then one Prefix you may relocate each prefix +separately by using syntax like: + +\verbatim + rpm ... --relocate /opt=/usr/opt --relocate /etc=/usr/etc ... +\endverbatim + +If any of the Prefixes is not being relocated they can be skipped on +the command line + +*/ diff --git a/rpm-5.4.9/doc/manual/rollbacks b/rpm-5.4.9/doc/manual/rollbacks new file mode 100644 index 0000000..0b075b8 --- /dev/null +++ b/rpm-5.4.9/doc/manual/rollbacks @@ -0,0 +1,49 @@ +The term "transaction rollback" is jargon for a method of maintaining +sets of packages that are applied to boxen sequentially. In a nutshell, +packages that are to be installed/removed are aggregated into something +called a "transaction set". Each transaction set is then assigned a unique +identifier so that the packages in the set can be distinguished, Finally, +since the transaction set identifier (TID) can be ordered, transaction sets +can be managed just like packages, since each TID will identify the sets +of packages to be installed/removed at each stage in a software life +maintenance cycle. The approach is very similar to what rpm already does +when encapsulating sets of files in packages which are then ordered +according to the package epoch, version and release. + +The current release of rpm (rpm-4.0.2) has added TID's to every package +installed. In addition, an image of the header is preserved in the rpm +database that is identical to what was in the original package file. +This permits rpm to reconstruct the original package from the installed +components at any time. + +The next version of rpm (rpm-4.0.3, now in a release cycle now) has added the +ability to repackage all the components to construct a copy of the original +package as part of a software upgrade. The reconstituted package as well +as the newly installed packages in the transaction set are all marked with +a TID that identifies the software upgrade uniquely. Thus software +replaced on a boxen is repackaged, and the packages can be archived +(or otherwise saved) as part of normal software management. + +What remains to be done is to use the ordering property of TID's so that +transactions can be "rolled back" to any point in the past for which +the old packages are available. This will require a B-tree database +index for the currently installed transaction sets, and saving the names +of the packages that were removed. For the commonest case, a software +upgrade, each installed package can carry the names of replaced +(and repackaged) packages that were performed as a side effect of the +package upgrade. Other means will be needed to keep track of transaction +sets that only removed packages, however. Finally, a "transaction rollback" +loop still needs to be written that will walk backwards through the ordered +TID's, reconstructing the transaction set but reversing what packages +are removed and/or installed. + +In addition to "transaction rollbacks", rpm will soon have the ability +to apply/commit/undo software transactions atomically. The next version of +rpm (rpm-4.0.3) already has the ability to apply/commit/undo file changes. +The term "apply" means that the file is installed with a temporary name +(currently just the original file name with the TID appended), "commit" +is the operation of renaming the file and setting it's mode and ownership, +while an "undo" is just a removal of the temporary file. The concepts +of apply/commit/undo are being extended to packages as a set of +file operations, and will need to be extended yet further to transaction +sets as well. diff --git a/rpm-5.4.9/doc/manual/signatures b/rpm-5.4.9/doc/manual/signatures new file mode 100644 index 0000000..9cad9aa --- /dev/null +++ b/rpm-5.4.9/doc/manual/signatures @@ -0,0 +1,83 @@ +/*! \page signatures Signature header + +The 2.1 release of RPM had a few improvements in the area of +digital package signatures. The usage of PGP has been cleaned +up and extended, the signature section in the RPM file format +has been made easily extensible with new signature types, and +packages can have multiple signatures. + +\subsection signatures_pgp PGP + +Legacy usage of PGP in rpm-2.0 was cumbersome, and only supported +1024 bit keys. Both of these problems have been corrected in rpm-2.1. + +Whereas previously you needed many rpmrc entries to clue in +RPM about keyring locations and such, RPM now behaves as PGP +users would expect. The PGPPATH environment variable can be +used to specify keyring locations. You can also use a +"%_pgpbin" line in your macros file to specify a different value +for RPM to use for PGPPATH. If neither of these are used PGP +uses its default ($HOME/.pgp). + +If you just want to verify packages, you need to supply values +for the macros +\verbatim + %_pgpbin the path to the pgp executable + %_signature the type of signature to use +\endverbatim + +In order to be able to sign packages, you may also have to +supply values for +\verbatim + %_pgp_name the pgp signature to use for signing + %_pgp_path the path to the key ring +\endverbatim + +\subsection signatures_signing Signing Packages + +Signature creation is the same as previous releases: just add +a --sign to your build command line. You can sign a package +after the package is built with: + +\verbatim + rpm --resign +\endverbatim + +Using --resign removes any previous signature in the package. +To *add* a signature to a package, leaving all existing +signatures use: + +\verbatim + rpm --addsign +\endverbatim + +RPM always creates MD5 and SIZE signatures when it build +packages, which means that packages built without --sign can +be "verified" to some extent. The MD5 signature should catch +problems like corrupt packages, faulty downloads, etc. + +\subsection signatures_verifying Verifying Package Signatures + +Package signature verification is the same as previous releases: + +\verbatim + rpm -K +\endverbatim + +RPM will verify every signature in the package, which may include +more than one PGP signature. The output indicates what types of +signatures are being checked. If any checks fail you'll see a +"NOT OK" message, and you should be worried. + +If you have a package with PGP signatures, but don't have PGP +installed, but still want to verify it as much as possible, you +can do: + +\verbatim + rpm -K --nopgp +\endverbatim + +That will cause RPM to skip any PGP signatures, but still check +any others (currently only MD5 and SIZE). + +*/ diff --git a/rpm-5.4.9/doc/manual/spec b/rpm-5.4.9/doc/manual/spec new file mode 100644 index 0000000..2fa1502 --- /dev/null +++ b/rpm-5.4.9/doc/manual/spec @@ -0,0 +1,226 @@ +/*! \page specfile Spec file tags + +A few additions have been made to the spec file format. + +Name + +The Name tag contains the proper name of the package. Names must not +include whitespace and may include a hyphen '-' (unlike version and release +tags). Names should not include any numeric operators ('<', '>','=') as +future versions of rpm may need to reserve characters other than '-'. + +By default subpackages are named by prepending `MAIN-' to +the subpackages name(s). If you wish to change the name of a +subpackage (most commonly this is to change the '-' to '.'), then you +must specify the full name with the -n argument in the %package +definition: + +\verbatim + %package -n newname +\endverbatim + +\subsection specfile_summary Summary: and Description: Tags + +The Summary: tag should be use to give a short (50 char or so) summary +of the package. Most package's Description: line should be changed to +a Summary: line. The Description: tag is still supported but should +be changed to a "%description" entry similar to %package and %files. +At some point in the future support will be removed for "Description:". +As an example, this spec file fragment: + +\verbatim + Description: Screen drawing library + Name: screenlib + Version: 1.0 + + %package devel + Description: Screen drawing library headers and static libs +\endverbatim + +might be changed to: + +\verbatim + Summary: Screen drawing library + Name: screenlib + Version: 1.0 + + %description + The screen drawing library + is a handy development tool + + %package devel + Summary: Screen drawing library headers and static libs + + %description devel + This package contains all of the + headers and the static libraries for + screenlib. + + You'll only need this package if you + are doing development. +\endverbatim + +The description is free form text, but there are two things to note. +The first regards reformatting. Lines that begin with white space +are considered "pre-formatted" and will be left alone. Adjacent +lines without leading whitespace are considered a single paragraph +and may be subject to formatting by glint or another RPM tool. + +\subsection specfile_url URL: and Packager: Tags + +Two new tags are "URL:" and "Packager:". "URL:" is a place to put a +URL for more information and/or documentation on the software +contained in the package. Some future RPM package tool may make use +of this. The Packager: tag is meant to contain the name and email +address of the person who "maintains" the RPM package (which may be +different from the person who actually maintains the program the +package contains). + +\subsection specfile_buildarchitectures BuildArchitectures: Tag + +This tag specifies the architecture which the resulting binary package +will run on. Typically this is a CPU architecture like sparc, +i386. The string 'noarch' is reserved for specifying that the +resulting binary package is platform independent. Typical platform +independent packages are html, perl, python, java, and ps packages. + +\subsection specfile_virtual Virtual File Attribute(s) in %files Section + +A %ghost tag on a file indicates that this file is not to be included +in the package. It is typically used when the attributes of the file +are important while the contents is not (e.g. a log file). + +The %config(missingok) indicates that the file need not exist on the +installed machine. The %config(missingok) is frequently used for files +like /etc/rc.d/rc2.d/S55named where the (non-)existence of the symlink +is part of the configuration in %post, and the file may need to be +removed when this package is removed. This file is not required to +exist at either install or uninstall time. + +The %exclude subdirective permit to exclude files and directories +from inclusion in a package (i.e. "everything but"). Its primary use +is to simplify the writing the list of objects in %files when +using subpackage. Note that %exclude is different from a ipotetical +%ignore subattribute: it is always required that the file(s) excluded +but present in buildroot are referenced in some else subpackage %files +section: if this is not what you want then they should be eliminated +from the buildroot in %install. + +The %config(noreplace) indicates that the file in the package should +be installed with extension .rpmnew if there is already a modified file +with the same name on the installed machine. + +The virtual file attribute token %verify tells `-V/--verify' to ignore +certain features on files which may be modified by (say) a postinstall +script so that false problems are not displayed during package verification. +\verbatim + %verify(not size md5 mtime) %{prefix}/bin/javaswarm +\endverbatim + +\subsection specfile_globbing Shell Globbing of %files Section + +The usual rules for shell globbing apply. Most special characters can +be escaped by prefixing them with a '\'. Spaces are used to separate +file names and so must be escaped by enclosing the file name with quotes. +For example: + +\verbatim + /tmp/are\.you\|bob\? + /tmp/bob\'s\*htdocs\* + "/tmp/bob\'s htdocs" +\endverbatim + +Names containing "%%" will be rpm macro expanded into "%". When +trying to escape large number of file names, it is often best to +create a file with the complete list of escaped file names. This is +easiest to do with a shell script like this: + +\verbatim + rm -f $RPM_BUILD_DIR/filelist.rpm + echo '%defattr(-,root,root)' >> $RPM_BUILD_DIR/filelist.rpm + find $RPM_BUILD_ROOT/%{_prefix} -type f -print | \ + sed "s!$RPM_BUILD_ROOT!!" | perl -pe 's/([?|*.\'"])/\\$1/g' \ + >> $RPM_BUILD_DIR/filelist.rpm + + %files -f filelist.rpm +\endverbatim + +\subsection specfile_automatic Fine Adjustment of Automatic Dependencies + +Rpm currently supports separate "Autoreq:" and "Autoprov:" tags in a +spec file to independently control the running of find-requires and +find-provides. A common problem occurs when packaging a large third +party binary which has interfaces to other third party libraries you +do not own. RPM will require all the third party libraries be +installed on the target machine even though their intended use was +optional. To rectify the situation you may turn off requirements when +building the package by putting + +\verbatim + Autoreq: 0 +\endverbatim + +in your spec file. Any and all requirements should be added manually using the + +\verbatim + Requires: depend1, ..., dependN +\endverbatim + +in this case. + +Similarly there is an Autoprov tag to turn off the automatic provision +generation and a Autoreqprov to turn off both the automatic provides and +the automatic requires generation. + +\subsection specfile_nosrc NoSource: Tag + +Files ending in .nosrc.rpm are generally source RPM packages whose spec +files have one or more NoSource: or NoPatch: directives in them. Both +directives use the named source or patch file to build the resulting +binary RPM package as usual, but they are not included in the source +RPM package. + +The original intent of this ability of RPM was to allow proprietary or +non-distributable software to be built using RPM, but to keep the +proprietary or non-distributable parts out of the resulting source RPM +package, so that they would not get distributed. + +They also have utility if you are building RPM packages for software +which is archived at a well-known location and does not require that +you distribute the source with the binary, for example, for an +organization's internal use, where storing large quantities of source +is not as meaningful. + +The end result of all this, though, is that you can't rebuild +``no-source'' RPM packages using `rpm --rebuild' unless you also have +the sources or patches which are not included in the .nosrc.rpm. + +\subsection specfile_buildrequires BuildRequires: Tag + +Build dependencies are identical to install dependencies except: + +\verbatim + 1) they are prefixed with build (e.g. BuildRequires: rather than Requires:) + 2) they are resolved before building rather than before installing. +\endverbatim + +So, if you were to write a specfile for a package that requires egcs to build, +you would add +\verbatim + BuildRequires: egcs +\endverbatim +to your spec file. + +If your package was like dump and could not be built w/o a specific version of +the libraries to access an ext2 file system, you could express this as +\verbatim + BuildRequires: e2fsprofs-devel = 1.17-1 +\endverbatim + +Finally, if your package used C++ and could not be built with gcc-2.7.2.1, you +can express this as +\verbatim + BuildConflicts: gcc <= 2.7.2.1 +\endverbatim + +*/ diff --git a/rpm-5.4.9/doc/manual/triggers b/rpm-5.4.9/doc/manual/triggers new file mode 100644 index 0000000..43e2ddf --- /dev/null +++ b/rpm-5.4.9/doc/manual/triggers @@ -0,0 +1,165 @@ +/*! \page triggers Trigger scriptlets + +Triggers provide a well-defined method for packages to interact with one +another at package install and uninstall time. They are an extension +of the normal installation scripts (i.e. %pre) which allows one package +(the "source" of the trigger package [which I often think of as the +"triggered package"]) to execute an action when the installation status +of another package (the "target" of the trigger) changes. + +\subsection triggers_example A Simple Example + +Say the package "mymailer" needs an /etc/mymailer/mailer symlink which points +to the mail transport agent to use. If sendmail is installed, the link should +point to /usr/bin/sendmail, but it vmail is installed, the link should +instead point to /usr/bin/vmail. If both packages are present, we don't care +where the link points (realistically, sendmail and vmail should conflict +with one another), while if neither package is installed the link should +not exist at all. + +This can be accomplished by mymailer providing trigger scripts which +move the symlink when any of the following occurs: + +\verbatim + 1) sendmail is installed + 2) vmail is installed + 3) sendmail is removed + 4) vmail is removed +\endverbatim + +The first two of these scripts would look like this: + +\verbatim + %triggerin -- sendmail + ln -sf /usr/bin/sendmail /etc/mymailer/mailer + + %triggerin -- vmail + ln -sf /usr/bin/vmail /etc/mymailer/mailer +\endverbatim + +These are two installation triggers, triggered by one of sendmail or vmail. +They are run when: + +\verbatim + 1) mymailer is already installed, and sendmail is installed or + upgraded + 2) mymailer is already installed, and vmail is installed or + upgraded + 3) sendmail is already installed, and mymailer is installed or + upgraded + 4) vmail is already installed, and mymailer is installed or + upgraded +\endverbatim + +For the upgrading, the strategy is a little different. Rather then +setting the link to point to the trigger, the link is set to point to +the *other* mailer (if it exists), as follows: + +\verbatim + %triggerun -- sendmail + [ $2 = 0 ] || exit 0 + if [ -f /usr/bin/vmail ]; then + ln -sf /usr/bin/vmail /etc/mymailer/mailer + else + rm -f /etc/mymailer/mailer + + fi + + %triggerun -- vmail + [ $2 = 0 ] || exit 0 + if [ -f /usr/bin/sendmail ]; then + ln -sf /usr/bin/sendmail /etc/mymailer/mailer + else + rm -f /etc/mymailer/mailer + + fi + + %postun + [ $1 = 0 ] && rm -f /etc/mymailer/mailer +\endverbatim + +These trigger scripts get run when: + +\verbatim + 1) sendmail is installed, and mymailer is removed + 2) vmail is installed, and mymailer is removed + 3) mymailer is installed, and sendmail gets removed + 4) mymailer is installed, and vmail gets removed +\endverbatim + +The %postun insures that /etc/mymailer/mailer is removed when mymailer +is removed (triggers get run at the same time as %preun scripts, so +doing this in the %postun is safe). Note that the triggers are testing +$2 to see if any action should occur. Recall that the $1 passed to regular +scripts contains the number of instances of the package which will be +installed when the operation has completed. $1 for triggers is exactly +the same -- it is the number of instances of the source (or triggered) +package which will remain when the trigger has completed. Similarly, $2 +is the number of instances of the target package which will remain. In +this case, if any of the targets will remain after the uninstall, the +trigger doesn't do anything (as it's probably being triggered by an +upgrade). + +\subsection triggers_syntax Trigger Syntax + +Trigger specifications are of the form: + +\verbatim + %trigger{un|in|postun} [[-n] SUBPKGSUFFIX] [-p PROGRAM] -- TRIGGER +\endverbatim + +The -n and -p arguments are the same as for %post scripts. The +TRIGGER portion is syntactically equivalent to a "Requires" +specification (version numbers may be used). If multiple items are +given (comma separated), the trigger is run when *any* of those +conditions becomes true (the , can be read as "or"). For example: + +\verbatim + %triggerin -n package -p /usr/bin/perl -- fileutils > 3.0, perl < 1.2 + print "I'm in my trigger!\n"; +\endverbatim + +Will put a trigger in package 'package' which runs when the installation +status of either fileutils > 3.0 or perl < 1.2 is changed. The script will +be run through /usr/bin/perl rather then /bin/sh (which is the default). + +\subsection triggers_unusual An Unusual Case + +There is one other type of trigger available -- %triggerpostun. These are +triggers that are run after their target package has been removed; they will +never be run when the package containing the trigger is removed. + +While this type of trigger is almost never useful, they allow a package to +fix errors introduced by the %postun of another package (or by an earlier +version of that package). + +\subsection triggers_order Order of Script Execution + +For reference, here's the order in which scripts are executed on a single +package upgrade: + +\verbatim + all-%pretrans + ... + any-%triggerprein (%triggerprein from other packages set off by new install) + new-%triggerprein + new-%pre for new version of package being installed + ... (all new files are installed) + new-%post for new version of package being installed + + any-%triggerin (%triggerin from other packages set off by new install) + new-%triggerin + old-%triggerun + any-%triggerun (%triggerun from other packages set off by old uninstall) + + old-%preun for old version of package being removed + ... (all old files are removed) + old-%postun for old version of package being removed + + old-%triggerpostun + any-%triggerpostun (%triggerpostun from other packages set off by old un + install) + ... + all-%posttrans +\endverbatim +*/ diff --git a/rpm-5.4.9/doc/manual/tsort b/rpm-5.4.9/doc/manual/tsort new file mode 100644 index 0000000..eb87e21 --- /dev/null +++ b/rpm-5.4.9/doc/manual/tsort @@ -0,0 +1,159 @@ +/*! \page tsort Package ordering in rpm-4.0.1 and later + +The package ordering algorithm in rpm-4.0.1 has changed. + +\subsection tsort_problem The Problem + +Here's a simple test to illustrate the need for the change (from +bugzilla #12327): + +Assume the minimal 7.0 package manifest in /tmp/list +\verbatim + /mnt/rpm/comps/dist/7.0/sparc/bash-2.04-11.sparc.rpm + /mnt/rpm/comps/dist/7.0.2/sparc/glibc-2.1.94-1.sparc.rpm + /mnt/rpm/comps/dist/7.0/sparc/mktemp-1.5-5.sparc.rpm + /mnt/rpm/comps/dist/7.0/noarch/basesystem-7.0-2.noarch.rpm + /mnt/rpm/comps/dist/7.0/noarch/setup-2.3.4-1.noarch.rpm + /mnt/rpm/comps/dist/7.0/noarch/filesystem-2.0.7-1.noarch.rpm + /mnt/rpm/comps/dist/7.0/sparc/libtermcap-2.0.8-25.sparc.rpm + /mnt/rpm/comps/dist/7.0/noarch/termcap-11.0.1-3.noarch.rpm +\endverbatim + +with database initialization as +\verbatim + mkdir -p /tmp/ROOT/var/lib/rpm + rpm --initdb /tmp/ROOT/var/lib/rpm +\endverbatim + +This command "works" +\verbatim + rpm -Uvh -r /tmp/ROOT `cat /tmp/list` +\endverbatim +while this command +\verbatim + rpm -Uvh -r /tmp/ROOT `tac /tmp/list` +\endverbatim +fails with +\verbatim + loop in prerequisite chain: libtermcap bash libtermcap +\endverbatim + +\note The 2nd upgrade reverse orders the packages in the manifest. + +The problem is that the previous ordering algorithm, basically a very clever +implementation of tsort, was sensitive to initial conditions, and the first +command "happens" to snip a loop, while the second does not. + +\subsection tsort_solution The Solution + +The current ordering algorithm is exactly tsort from Knuth V1, with one further +twist. Since the only way out of a dependency loop is to snip the loop +somewhere, rpm uses hints from Requires: dependencies to distinguish +co-requisite (these are not needed to install, only to use, a package) from +pre-requisite (these are guaranteed to be installed before the package that +includes the dependency) relations. + +There is now syntax in spec files to explicitly specify the source of a +Requires: dependency. If, for example, you use grep in %post, then you +as a packager would normally add +\verbatim + PreReq: grep +\endverbatim +in order to insure that grep was installed before attempted use by the +%postun scriptlet. + +Now the same dependency can be expressed more precisely as +\verbatim + Requires(post): grep +\endverbatim + +For completeness, here's the complete set of tokens that may be +added to Requires: as in the example above: +\verbatim + "interp", RPMSENSE_INTERP + "prereq", RPMSENSE_PREREQ + "preun", RPMSENSE_SCRIPT_PREUN + "pre", RPMSENSE_SCRIPT_PRE + "postun", RPMSENSE_SCRIPT_POSTUN + "post", RPMSENSE_SCRIPT_POST + "rpmlib", RPMSENSE_RPMLIB + "verify", RPMSENSE_SCRIPT_VERIFY +\endverbatim + +Ditto BuildRequires: +\verbatim + "prep", RPMSENSE_SCRIPT_PREP + "build", RPMSENSE_SCRIPT_BUILD + "install", RPMSENSE_SCRIPT_INSTALL + "clean", RPMSENSE_SCRIPT_CLEAN +\endverbatim +but let's not go there (yet). + +For giggles, you can also do stuff like +\verbatim + Requires(pre,post): /bin/sh +\endverbatim + +By marking dependencies more precisely, rpm can distinguish between +an upgrade context (like the use of grep in %post above) and an installed +context (like the autogenerated Requires: in a package that includes a +script with #!/bin/sh), and that permits rpm to differentiate pre-requisites +from co-requisites while doing package ordering. + +Here's what cures the libtermcap <-> bash loop: +\verbatim + Requires(postun): /bin/sh +\endverbatim +which, since the dependency is clearly not useful or necessary in determining +install ordering, is safely ignored. + +\subsection tsort_sideeffects Side Effects + +One of the side effects of changing the package install ordering, is that +there are a handful of new loops that are detected. Here's what I found +looking at supported Red Hat releases: + +\verbatim + ghostscript-fonts ghostscript + /* 7.0 only */ + pango-gtkbeta-devel pango-gtkbeta + XFree86 Mesa + compat-glibc db2 + compat-glibc db1 + pam initscripts + kernel initscripts + initscripts sysklogd + /* 6.2 */ + egcs-c++ libstdc++ + /* 6.1 */ + pilot-link-devel pilot-link + /* 5.2 */ + pam pamconfig +\endverbatim + +Why are there new loops? Because tsort is trying to use all of the +dependency relations for ordering, while the previous tsort ignored all +Requires: from added packages. + +Except for the "well known" libtermcap <-> bash loop (which is just wrong), +all of the other dependencies are simply not needed in an upgrade context +to perform package ordering. Please note that all of the known to cause +loop dependencies listed above are, for now, explicitly ignored when +determining package install ordering. + +\subsection tsort_summary Summary + +So what does this all mean? Basically not much, unless you find yourself +trying to specify dependencies amongst a set of packages correctly and +happen to create a dependency loop. + +And, before you start adding the new-fangled syntax to packages, please +remember that rpm will almost certainly be auto-generating fine-grained +dependencies for %post et al scriptlets pretty soon. Truly, rpm needs to +make packaging easier, not provide Yet More Complicated Syntax in spec files. + +With thanks to Ken Estes for doing the implementation in bash2 that makes +it possible to auto-generate scriptlet dependencies, blame me for the long, +slow deployment. + +*/ diff --git a/rpm-5.4.9/doc/pl/Makefile.am b/rpm-5.4.9/doc/pl/Makefile.am new file mode 100644 index 0000000..28c6ebf --- /dev/null +++ b/rpm-5.4.9/doc/pl/Makefile.am @@ -0,0 +1,21 @@ +## Process this file with automake to produce Makefile.in + +@SET_MAKE@ + +man_MANS = gendiff.1 rpm.8 rpm2cpio.8 rpmbuild.8 rpmcache.8 rpmdeps.8 rpmgraph.8 +mandir = @mandir@/pl + +EXTRA_DIST = $(man_MANS) + +install-data-hook: +if WITH_PATH_VERSIONED + -for p in $(man_MANS); do \ + case "$$p" in \ + *.1 ) mv $(DESTDIR)$(man1dir)/$${p} \ + `echo "$(DESTDIR)$(man1dir)/$${p}" | sed 's/\.1$$/-$(VERSION).1/'` ;; \ + *.8 ) mv $(DESTDIR)$(man8dir)/$${p} \ + `echo "$(DESTDIR)$(man8dir)/$${p}" | sed 's/\.8$$/-$(VERSION).8/'` ;; \ + esac; \ + done +endif + diff --git a/rpm-5.4.9/doc/pl/Makefile.in b/rpm-5.4.9/doc/pl/Makefile.in new file mode 100644 index 0000000..971416c --- /dev/null +++ b/rpm-5.4.9/doc/pl/Makefile.in @@ -0,0 +1,865 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +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@ +target_triplet = @target@ +subdir = doc/pl +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +man1dir = $(mandir)/man1 +am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" +man8dir = $(mandir)/man8 +NROFF = nroff +MANS = $(man_MANS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDROOTDIR_MACRO = @BUILDROOTDIR_MACRO@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBAPI = @DBAPI@ +DBLIBOBJS = @DBLIBOBJS@ +DBLIBSRCS = @DBLIBSRCS@ +DBPATH = @DBPATH@ +DBPATH_MACRO = @DBPATH_MACRO@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTRO_MACROS = @DISTRO_MACROS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIXPERMS = @FIXPERMS@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GPSEE_MODULES_PATH = @GPSEE_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_STATIC = @LDFLAGS_STATIC@ +LD_VERSION_SCRIPT_FLAG = @LD_VERSION_SCRIPT_FLAG@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOLIZE = @LIBTOOLIZE@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MACROFILES = @MACROFILES@ +MAGIC_MACRO = @MAGIC_MACRO@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR = @MKDIR@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NCPUS_COMMAND = @NCPUS_COMMAND@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENMP_CFLAGS = @OPENMP_CFLAGS@ +OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_INSTALLDIRS = @PERL_INSTALLDIRS@ +PERL_URPM_INSTALLDIRS = @PERL_URPM_INSTALLDIRS@ +PKGSRCDIR = @PKGSRCDIR@ +PKGSRCDIR_MACRO = @PKGSRCDIR_MACRO@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +ROOT_GROUP = @ROOT_GROUP@ +RPMCANONARCH = @RPMCANONARCH@ +RPMCANONCOLOR = @RPMCANONCOLOR@ +RPMCANONGNU = @RPMCANONGNU@ +RPMCANONOS = @RPMCANONOS@ +RPMCANONVENDOR = @RPMCANONVENDOR@ +RPMGID = @RPMGID@ +RPMGROUP = @RPMGROUP@ +RPMLUAFILES = @RPMLUAFILES@ +RPMPOPTFILES = @RPMPOPTFILES@ +RPMUID = @RPMUID@ +RPMUSER = @RPMUSER@ +RPM_TIMESTAMP = @RPM_TIMESTAMP@ +RPM_VENDOR = @RPM_VENDOR@ +RPM_VERSION = @RPM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFIGDIR = @SYSCONFIGDIR@ +USE_NLS = @USE_NLS@ +USRLIBRPM = @USRLIBRPM@ +VERSION = @VERSION@ +WITH_ACL = @WITH_ACL@ +WITH_APIDOCS = @WITH_APIDOCS@ +WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ +WITH_APR = @WITH_APR@ +WITH_ATERM = @WITH_ATERM@ +WITH_ATTR = @WITH_ATTR@ +WITH_AUGEAS = @WITH_AUGEAS@ +WITH_AUGEAS_AUGTOOL = @WITH_AUGEAS_AUGTOOL@ +WITH_BASH = @WITH_BASH@ +WITH_BASH_CPPFLAGS = @WITH_BASH_CPPFLAGS@ +WITH_BASH_LDFLAGS = @WITH_BASH_LDFLAGS@ +WITH_BASH_LIBS = @WITH_BASH_LIBS@ +WITH_BASH_SUBDIR = @WITH_BASH_SUBDIR@ +WITH_BEECRYPT = @WITH_BEECRYPT@ +WITH_BEECRYPT_CPPFLAGS = @WITH_BEECRYPT_CPPFLAGS@ +WITH_BEECRYPT_LDFLAGS = @WITH_BEECRYPT_LDFLAGS@ +WITH_BEECRYPT_LIBS = @WITH_BEECRYPT_LIBS@ +WITH_BEECRYPT_SUBDIR = @WITH_BEECRYPT_SUBDIR@ +WITH_BZIP2 = @WITH_BZIP2@ +WITH_CPUINFO = @WITH_CPUINFO@ +WITH_CUDF = @WITH_CUDF@ +WITH_CUDF_CUDFTOOL = @WITH_CUDF_CUDFTOOL@ +WITH_DB = @WITH_DB@ +WITH_DBSQL = @WITH_DBSQL@ +WITH_DBSQL_CPPFLAGS = @WITH_DBSQL_CPPFLAGS@ +WITH_DBSQL_LDFLAGS = @WITH_DBSQL_LDFLAGS@ +WITH_DBSQL_LIBS = @WITH_DBSQL_LIBS@ +WITH_DBSQL_SUBDIR = @WITH_DBSQL_SUBDIR@ +WITH_DB_CPPFLAGS = @WITH_DB_CPPFLAGS@ +WITH_DB_LDFLAGS = @WITH_DB_LDFLAGS@ +WITH_DB_LIBS = @WITH_DB_LIBS@ +WITH_DB_SUBDIR = @WITH_DB_SUBDIR@ +WITH_DMALLOC = @WITH_DMALLOC@ +WITH_EFENCE = @WITH_EFENCE@ +WITH_EXPAT = @WITH_EXPAT@ +WITH_FICL = @WITH_FICL@ +WITH_FICL_CPPFLAGS = @WITH_FICL_CPPFLAGS@ +WITH_FICL_LDFLAGS = @WITH_FICL_LDFLAGS@ +WITH_FICL_LIBS = @WITH_FICL_LIBS@ +WITH_FICL_SUBDIR = @WITH_FICL_SUBDIR@ +WITH_FILE = @WITH_FILE@ +WITH_FILE_CPPFLAGS = @WITH_FILE_CPPFLAGS@ +WITH_FILE_LDFLAGS = @WITH_FILE_LDFLAGS@ +WITH_FILE_LIBS = @WITH_FILE_LIBS@ +WITH_FILE_SUBDIR = @WITH_FILE_SUBDIR@ +WITH_GCRYPT = @WITH_GCRYPT@ +WITH_GNUTLS = @WITH_GNUTLS@ +WITH_GPSEE = @WITH_GPSEE@ +WITH_GPSEE_CPPFLAGS = @WITH_GPSEE_CPPFLAGS@ +WITH_GPSEE_LDFLAGS = @WITH_GPSEE_LDFLAGS@ +WITH_GPSEE_LIBS = @WITH_GPSEE_LIBS@ +WITH_GPSEE_SUBDIR = @WITH_GPSEE_SUBDIR@ +WITH_JS_SUBDIR = @WITH_JS_SUBDIR@ +WITH_KEYUTILS = @WITH_KEYUTILS@ +WITH_KEYUTILS_RPMKEY = @WITH_KEYUTILS_RPMKEY@ +WITH_LIBELF_DEBUGEDIT = @WITH_LIBELF_DEBUGEDIT@ +WITH_LIBGIT2 = @WITH_LIBGIT2@ +WITH_LIBGIT2_CPPFLAGS = @WITH_LIBGIT2_CPPFLAGS@ +WITH_LIBGIT2_LDFLAGS = @WITH_LIBGIT2_LDFLAGS@ +WITH_LIBGIT2_LIBS = @WITH_LIBGIT2_LIBS@ +WITH_LIBGIT2_SUBDIR = @WITH_LIBGIT2_SUBDIR@ +WITH_LIBTASN1 = @WITH_LIBTASN1@ +WITH_LUA = @WITH_LUA@ +WITH_LUA_CPPFLAGS = @WITH_LUA_CPPFLAGS@ +WITH_LUA_LDFLAGS = @WITH_LUA_LDFLAGS@ +WITH_LUA_LIBS = @WITH_LUA_LIBS@ +WITH_LUA_SUBDIR = @WITH_LUA_SUBDIR@ +WITH_LUA_SUBDIR_DEF = @WITH_LUA_SUBDIR_DEF@ +WITH_LUA_SUBDIR_LIB = @WITH_LUA_SUBDIR_LIB@ +WITH_MOZJS185 = @WITH_MOZJS185@ +WITH_MOZJS185_CPPFLAGS = @WITH_MOZJS185_CPPFLAGS@ +WITH_MOZJS185_LDFLAGS = @WITH_MOZJS185_LDFLAGS@ +WITH_MOZJS185_LIBS = @WITH_MOZJS185_LIBS@ +WITH_MOZJS185_SUBDIR = @WITH_MOZJS185_SUBDIR@ +WITH_NEON = @WITH_NEON@ +WITH_NEON_CPPFLAGS = @WITH_NEON_CPPFLAGS@ +WITH_NEON_LDFLAGS = @WITH_NEON_LDFLAGS@ +WITH_NEON_LIBS = @WITH_NEON_LIBS@ +WITH_NEON_SUBDIR = @WITH_NEON_SUBDIR@ +WITH_NIX = @WITH_NIX@ +WITH_NSS = @WITH_NSS@ +WITH_OPENSSL = @WITH_OPENSSL@ +WITH_PAKCHOIS = @WITH_PAKCHOIS@ +WITH_PATH_VERSIONED = @WITH_PATH_VERSIONED@ +WITH_PATH_VERSIONED_SUFFIX = @WITH_PATH_VERSIONED_SUFFIX@ +WITH_PCRE = @WITH_PCRE@ +WITH_PCRE_CPPFLAGS = @WITH_PCRE_CPPFLAGS@ +WITH_PCRE_LDFLAGS = @WITH_PCRE_LDFLAGS@ +WITH_PCRE_LIBS = @WITH_PCRE_LIBS@ +WITH_PCRE_SUBDIR = @WITH_PCRE_SUBDIR@ +WITH_PERLEMBED = @WITH_PERLEMBED@ +WITH_PERL_LIBS = @WITH_PERL_LIBS@ +WITH_PERL_SUBDIR = @WITH_PERL_SUBDIR@ +WITH_PERL_SUBPACKAGE = @WITH_PERL_SUBPACKAGE@ +WITH_PERL_URPM_LIBS = @WITH_PERL_URPM_LIBS@ +WITH_PERL_URPM_SUBDIR = @WITH_PERL_URPM_SUBDIR@ +WITH_PERL_URPM_SUBPACKAGE = @WITH_PERL_URPM_SUBPACKAGE@ +WITH_POPT = @WITH_POPT@ +WITH_POPT_CPPFLAGS = @WITH_POPT_CPPFLAGS@ +WITH_POPT_LDFLAGS = @WITH_POPT_LDFLAGS@ +WITH_POPT_LIBS = @WITH_POPT_LIBS@ +WITH_POPT_SUBDIR = @WITH_POPT_SUBDIR@ +WITH_PYTHONEMBED = @WITH_PYTHONEMBED@ +WITH_PYTHON_INCDIR = @WITH_PYTHON_INCDIR@ +WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ +WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ +WITH_RC = @WITH_RC@ +WITH_RC_CPPFLAGS = @WITH_RC_CPPFLAGS@ +WITH_RC_LDFLAGS = @WITH_RC_LDFLAGS@ +WITH_RC_LIBS = @WITH_RC_LIBS@ +WITH_RC_SUBDIR = @WITH_RC_SUBDIR@ +WITH_READLINE = @WITH_READLINE@ +WITH_RUBY = @WITH_RUBY@ +WITH_RUBY_CPPFLAGS = @WITH_RUBY_CPPFLAGS@ +WITH_RUBY_SUBDIR = @WITH_RUBY_SUBDIR@ +WITH_RUBY_VENDORARCHDIR = @WITH_RUBY_VENDORARCHDIR@ +WITH_SELINUX = @WITH_SELINUX@ +WITH_SEMANAGE = @WITH_SEMANAGE@ +WITH_SEMANAGE_SEMODULE = @WITH_SEMANAGE_SEMODULE@ +WITH_SEPOL = @WITH_SEPOL@ +WITH_SPIDERMONKEY_SUBDIR = @WITH_SPIDERMONKEY_SUBDIR@ +WITH_SQLITE = @WITH_SQLITE@ +WITH_SQLITE_CPPFLAGS = @WITH_SQLITE_CPPFLAGS@ +WITH_SQLITE_LDFLAGS = @WITH_SQLITE_LDFLAGS@ +WITH_SQLITE_LIBS = @WITH_SQLITE_LIBS@ +WITH_SQLITE_SUBDIR = @WITH_SQLITE_SUBDIR@ +WITH_SQUIRREL = @WITH_SQUIRREL@ +WITH_SUBVERSION = @WITH_SUBVERSION@ +WITH_SYCK = @WITH_SYCK@ +WITH_SYCK_CPPFLAGS = @WITH_SYCK_CPPFLAGS@ +WITH_SYCK_LDFLAGS = @WITH_SYCK_LDFLAGS@ +WITH_SYCK_LIBS = @WITH_SYCK_LIBS@ +WITH_SYCK_SUBDIR = @WITH_SYCK_SUBDIR@ +WITH_TCL = @WITH_TCL@ +WITH_TCL_SUBDIR = @WITH_TCL_SUBDIR@ +WITH_TOMCRYPT = @WITH_TOMCRYPT@ +WITH_TPM = @WITH_TPM@ +WITH_UNIXODBC = @WITH_UNIXODBC@ +WITH_UUID = @WITH_UUID@ +WITH_XAR = @WITH_XAR@ +WITH_XAR_CPPFLAGS = @WITH_XAR_CPPFLAGS@ +WITH_XAR_LDFLAGS = @WITH_XAR_LDFLAGS@ +WITH_XAR_LIBS = @WITH_XAR_LIBS@ +WITH_XAR_SUBDIR = @WITH_XAR_SUBDIR@ +WITH_XZ = @WITH_XZ@ +WITH_XZ_CPPFLAGS = @WITH_XZ_CPPFLAGS@ +WITH_XZ_LDFLAGS = @WITH_XZ_LDFLAGS@ +WITH_XZ_LIBS = @WITH_XZ_LIBS@ +WITH_XZ_SUBDIR = @WITH_XZ_SUBDIR@ +WITH_ZLIB = @WITH_ZLIB@ +WITH_ZLIB_CPPFLAGS = @WITH_ZLIB_CPPFLAGS@ +WITH_ZLIB_LDFLAGS = @WITH_ZLIB_LDFLAGS@ +WITH_ZLIB_LIBS = @WITH_ZLIB_LIBS@ +WITH_ZLIB_SUBDIR = @WITH_ZLIB_SUBDIR@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__BASH = @__BASH@ +__BZIP2 = @__BZIP2@ +__CAT = @__CAT@ +__CHATTR = @__CHATTR@ +__CHGRP = @__CHGRP@ +__CHGRP_RHF = @__CHGRP_RHF@ +__CHMOD = @__CHMOD@ +__CHOWN = @__CHOWN@ +__CHOWN_RHF = @__CHOWN_RHF@ +__CMAKE = @__CMAKE@ +__CPIO = @__CPIO@ +__CURL = @__CURL@ +__CVS = @__CVS@ +__DBSQL = @__DBSQL@ +__DB_ARCHIVE = @__DB_ARCHIVE@ +__DB_CHECKPOINT = @__DB_CHECKPOINT@ +__DB_DEADLOCK = @__DB_DEADLOCK@ +__DB_DUMP = @__DB_DUMP@ +__DB_HOTBACKUP = @__DB_HOTBACKUP@ +__DB_LOAD = @__DB_LOAD@ +__DB_LOG_VERIFY = @__DB_LOG_VERIFY@ +__DB_PRINTLOG = @__DB_PRINTLOG@ +__DB_RECOVER = @__DB_RECOVER@ +__DB_REPLICATE = @__DB_REPLICATE@ +__DB_SQL_CODEGEN = @__DB_SQL_CODEGEN@ +__DB_STAT = @__DB_STAT@ +__DB_TUNER = @__DB_TUNER@ +__DB_UPGRADE = @__DB_UPGRADE@ +__DB_VERIFY = @__DB_VERIFY@ +__DIFF = @__DIFF@ +__DITTO = @__DITTO@ +__DOXYGEN = @__DOXYGEN@ +__FILE = @__FILE@ +__GIT = @__GIT@ +__GPG = @__GPG@ +__GSR = @__GSR@ +__GST_INSPECT = @__GST_INSPECT@ +__GZIP = @__GZIP@ +__HG = @__HG@ +__ID = @__ID@ +__ID_U = @__ID_U@ +__INSTALL = @__INSTALL@ +__INSTALL_INFO = @__INSTALL_INFO@ +__LD = @__LD@ +__LDCONFIG = @__LDCONFIG@ +__LN = @__LN@ +__LRZIP = @__LRZIP@ +__LSATTR = @__LSATTR@ +__LZIP = @__LZIP@ +__LZMA = @__LZMA@ +__LZOP = @__LZOP@ +__MAKE = @__MAKE@ +__MKDIR = @__MKDIR@ +__MKDIR_P = @__MKDIR_P@ +__MODINFO = @__MODINFO@ +__MONGO = @__MONGO@ +__MV = @__MV@ +__NM = @__NM@ +__OBJCOPY = @__OBJCOPY@ +__OBJDUMP = @__OBJDUMP@ +__PATCH = @__PATCH@ +__PAX = @__PAX@ +__PERL = @__PERL@ +__PGP = @__PGP@ +__PHP = @__PHP@ +__PYTHON = @__PYTHON@ +__RM = @__RM@ +__RMDIR = @__RMDIR@ +__RSH = @__RSH@ +__RUBY = @__RUBY@ +__SED = @__SED@ +__SH = @__SH@ +__SQLITE3 = @__SQLITE3@ +__SSH = @__SSH@ +__STRIP = @__STRIP@ +__SVN = @__SVN@ +__TAR = @__TAR@ +__TCLSH = @__TCLSH@ +__UNZIP = @__UNZIP@ +__XZ = @__XZ@ +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_CXX = @ac_ct_CXX@ +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@ +autorelocate_dcolor = @autorelocate_dcolor@ +autorelocate_path = @autorelocate_path@ +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@ +exeext = @exeext@ +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@ +libext = @libext@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@/pl +mkdir_p = @mkdir_p@ +objext = @objext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +shlibext = @shlibext@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +testdir = @testdir@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrprefix = @usrprefix@ +varprefix = @varprefix@ +man_MANS = gendiff.1 rpm.8 rpm2cpio.8 rpmbuild.8 rpmcache.8 rpmdeps.8 rpmgraph.8 +EXTRA_DIST = $(man_MANS) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 doc/pl/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign doc/pl/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man1: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(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='$(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-man8: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(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='$(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) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically \`make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi + @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 $(MANS) +installdirs: + for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-man + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +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-man1 install-man8 + +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-man + +uninstall-man: uninstall-man1 uninstall-man8 + +.MAKE: install-am install-data-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + 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-hook install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man1 install-man8 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 uninstall uninstall-am \ + uninstall-man uninstall-man1 uninstall-man8 + + +@SET_MAKE@ + +install-data-hook: +@WITH_PATH_VERSIONED_TRUE@ -for p in $(man_MANS); do \ +@WITH_PATH_VERSIONED_TRUE@ case "$$p" in \ +@WITH_PATH_VERSIONED_TRUE@ *.1 ) mv $(DESTDIR)$(man1dir)/$${p} \ +@WITH_PATH_VERSIONED_TRUE@ `echo "$(DESTDIR)$(man1dir)/$${p}" | sed 's/\.1$$/-$(VERSION).1/'` ;; \ +@WITH_PATH_VERSIONED_TRUE@ *.8 ) mv $(DESTDIR)$(man8dir)/$${p} \ +@WITH_PATH_VERSIONED_TRUE@ `echo "$(DESTDIR)$(man8dir)/$${p}" | sed 's/\.8$$/-$(VERSION).8/'` ;; \ +@WITH_PATH_VERSIONED_TRUE@ esac; \ +@WITH_PATH_VERSIONED_TRUE@ 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/rpm-5.4.9/doc/pl/gendiff.1 b/rpm-5.4.9/doc/pl/gendiff.1 new file mode 100644 index 0000000..be71b85 --- /dev/null +++ b/rpm-5.4.9/doc/pl/gendiff.1 @@ -0,0 +1,47 @@ +.\" Jakub Bogusz , 2003 +.\" rpm 4.3-20030610 +.TH GENDIFF 1 "10 stycznia 2000" +.UC 4 +.SH NAZWA +gendiff \- narzêdzie pomagaj±ce przy generowaniu bezb³êdnych plików diff +.SH SK£ADNIA +\fBgendiff\fR +.SH OPIS +\fBgendiff\fR jest do¶æ prostym skryptem pomagaj±cym przy generowaniu +pliku diff z pojedynczego katalogu. Jako jedyne argumenty przyjmuje nazwê +katalogu i "rozszerzenie-diff". Rozszerzenie diff powinno byæ unikaln± +sekwencj± znaków dodan± na koñcu wszystkich oryginalnych, nie +zmodyfikowanych plików. Wyj¶ciem programu jest plik diff, który mo¿na +na³o¿yæ przy u¿yciu programu \fBpatch\fR, aby odtworzyæ zmiany. +.PP +Zwykle sekwencja czynno¶ci do stworzenia pliku diff to utworzenie dwóch +identycznych katalogów, dokonanie zmian w jednym katalogu i u¿ycie +narzêdzia \fBdiff\fR do utworzenia listy ró¿nic miêdzy nimi. +U¿ycie gendiff eliminuje potrzebê dodatkowej kopii oryginalnego, nie +zmodyfikowanego katalogu. Zamiast tego trzeba zachowaæ tylko pojedyncze +pliki przed zmodyfikowaniem. +.PP +Przed edycj± pliku skopiuj go, do³±czaj±c do nazwy wybrane rozszerzenie. +Tzn. je¶li zamierzasz zmodyfikowaæ plik somefile.cpp i wybra³e¶ rozszerzenie +"fix", skopiuj go do somefile.cpp.fix przed edycj±. Nastêpnie modyfikuj +pierwsz± kopiê (somefile.cpp). +.PP +Po edycji wszystkich potrzebnych plików w ten sposób wejd¼ do katalogu +jeden poziom wy¿ej ni¿ jest obecny kod ¼ród³owy i napisz: +.sp +.nf + $ gendiff tenkatalog .fix > mydiff-fix.patch +.fi +.PP +Powiniene¶ przekierowaæ wyj¶cie do pliku (jak na przyk³adzie), chyba ¿e +chcesz zobaczyæ wynik na standardowym wyj¶ciu. + +.PD +.SH "ZOBACZ TAK¯E" +.BR diff (1), +.BR patch (1) + +.SH AUTOR +.nf +Marc Ewing +.fi diff --git a/rpm-5.4.9/doc/pl/rpm.8 b/rpm-5.4.9/doc/pl/rpm.8 new file mode 100644 index 0000000..234e8fe --- /dev/null +++ b/rpm-5.4.9/doc/pl/rpm.8 @@ -0,0 +1,914 @@ +.\" 1999 PTM Przemek Borys :-Q +.\" Jakub Bogusz , 2003 +.\" rpm - Red Hat Package Manager +.\" rpm 4.3-20030610 +.TH rpm 8 "9 czerwca 2002" "Red Hat, Inc." "Red Hat Linux" +.SH NAZWA +rpm \- Mened¿er pakietów RPM +.SH SK£ADNIA +.SS "ODPYTYWANIE I WERYFIKACJA PAKIETÓW:" +.PP + +\fBrpm\fR {\fB-q|-\-query\fR} [\fBopcje-wyboru\fR] [\fBopcje-zapytañ\fR] + +\fBrpm\fR {\fB-V|-\-verify\fR} [\fBopcje-wyboru\fR] [\fBopcje-weryfikacji\fR] + +\fBrpm\fR \fB-\-import\fR \fB\fIKLUCZ_PUBLICZNY\fB\fR\fI ...\fR + +\fBrpm\fR {\fB-K|-\-checksig\fR} [\fB-\-nosignature\fR] [\fB-\-nodigest\fR] + \fB\fIPLIK_PAKIETU\fB\fR\fI ...\fR + +.SS "INSTALOWANIE, UAKTUALNIANIE I USUWANIE PAKIETÓW:" +.PP + +\fBrpm\fR {\fB-i|-\-install\fR} [\fBopcje-instalacji\fR] \fB\fIPLIK_PAKIETU\fB\fR\fI ...\fR + +\fBrpm\fR {\fB-U|-\-upgrade\fR} [\fBopcje-instalacji\fR] \fB\fIPLIK_PAKIETU\fB\fR\fI ...\fR + +\fBrpm\fR {\fB-F|-\-freshen\fR} [\fBopcje-instalacji\fR] \fB\fIPLIK_PAKIETU\fB\fR\fI ...\fR + +\fBrpm\fR {\fB-e|-\-erase\fR} [\fB-\-allmatches\fR] [\fB-\-nodeps\fR] [\fB-\-noscripts\fR] + [\fB-\-notriggers\fR] [\fB-\-repackage\fR] [\fB-\-test\fR] \fB\fINAZWA_PAKIETU\fB\fR\fI\ ...\fR + +.SS "RÓ¯NE:" +.PP + +\fBrpm\fR {\fB-\-initdb|-\-rebuilddb\fR} + +\fBrpm\fR {\fB-\-addsign|-\-resign\fR} \fB\fIPLIK_PAKIETU\fB\fR\fI ...\fR + +\fBrpm\fR {\fB-\-querytags|-\-showrc\fR} + +\fBrpm\fR {\fB-\-setperms|-\-setugids\fR} \fB\fINAZWA_PAKIETU\fB\fR\fI ...\fR + +.SS "opcje-wyboru" +.PP + + [\fB\fINAZWA_PAKIETU\fB\fR] [\fB-a,-\-all\fR] [\fB-f,-\-file \fIPLIK\fB\fR] + [\fB-g,-\-group \fIGRUPA\fB\fR] {\fB-p,-\-package \fIPLIK_PAKIETU\fB\fR] + [\fB-\-fileid \fIMD5\fB\fR] [\fB-\-hdrid \fISHA1\fB\fR] [\fB-\-pkgid \fIMD5\fB\fR] [\fB-\-tid \fITID\fB\fR] + [\fB-\-querybynumber \fINUMER_NAG£ÓWKA\fB\fR] [\fB-\-triggeredby \fINAZWA_PAKIETU\fB\fR] + [\fB-\-whatprovides \fIW£ASNO¦Æ\fB\fR] [\fB-\-whatrequires \fIW£ASNO¦Æ\fB\fR] + +.SS "opcje-zapytañ" +.PP + + [\fB-\-changelog\fR] [\fB-c|-\-configfiles\fR] [\fB-d|-\-docfiles\fR] [\fB-\-dump\fR] + [\fB-\-filesbypkg\fR] [\fB-i|-\-info\fR] [\fB-\-last\fR] [\fB-l|-\-list\fR] + [\fB-\-provides\fR] [\fB-\-qf|-\-queryformat \fIFORMAT_ZAPYTANIA\fB\fR] + [\fB-R|-\-requires\fR] [\fB-\-scripts\fR] [\fB-s|-\-state\fR] + [\fB-\-triggers|-\-triggerscripts\fR] + +.SS "opcje-weryfikacji" +.PP + + [\fB-\-nodeps\fR] [\fB-\-nofiles\fR] [\fB-\-noscripts\fR] + [\fB-\-nodigest\fR] [\fB-\-nosignature\fR] + [\fB-\-nolinkto\fR] [\fB-\-nomd5\fR] [\fB-\-nosize\fR] [\fB-\-nouser\fR] + [\fB-\-nogroup\fR] [\fB-\-nomtime\fR] [\fB-\-nomode\fR] [\fB-\-nordev\fR] + +.SS "opcje-instalacji" +.PP + + [\fB-\-aid\fR] [\fB-\-allfiles\fR] [\fB-\-badreloc\fR] [\fB-\-excludepath \fISTARA_¦CIE¯KA\fB\fR] + [\fB-\-excludedocs\fR] [\fB-\-force\fR] [\fB-h,-\-hash\fR] + [\fB-\-ignoresize\fR] [\fB-\-ignorearch\fR] [\fB-\-ignoreos\fR] + [\fB-\-includedocs\fR] [\fB-\-justdb\fR] [\fB-\-nodeps\fR] + [\fB-\-nodigest\fR] [\fB-\-nosignature\fR] [\fB-\-nosuggest\fR] + [\fB-\-noorder\fR] [\fB-\-noscripts\fR] [\fB-\-notriggers\fR] + [\fB-\-oldpackage\fR] [\fB-\-percent\fR] [\fB-\-prefix \fINOWA_¦CIE¯KA\fB\fR] + [\fB-\-relocate \fISTARA_¦CIE¯KA\fB=\fINOWA_¦CIE¯KA\fB\fR] + [\fB-\-repackage\fR] [\fB-\-replacefiles\fR] [\fB-\-replacepkgs\fR] + [\fB-\-test\fR] + +.SH OPIS +.PP +\fBrpm\fP jest potê¿nym \fBmened¿erem pakietów\fR, który mo¿e byæ u¿ywany do +budowania, instalowania, odpytywania, weryfikowania, uaktualniania i +usuwania pakietów oprogramowania. \fBPakiet\fR sk³ada siê z archiwum +plików oraz metadanych u¿ywanych do instalowania i usuwania plików. +Metadane zawieraj± pomocnicze skrypty, atrybuty plików oraz informacje +opisuj±ce pakiet. +\fBPakiety\fR wystêpuj± w dwóch wersjach: pakietach binarnych, s³u¿±cych +do opakowania oprogramowania do instalacji oraz pakietach ¼ród³owych, +zawieraj±cych kod ¼ród³owy i przepis na zbudowanie pakietów binarnych. +.PP +Nale¿y wybraæ jeden z nastêpuj±cych podstawowych trybów: +\fBOdpytywania\fR, +\fBWeryfikowania\fR, +\fBSprawdzania sygnatury\fR, +\fBInstalowania/Uaktualniania/Od¶wie¿ania\fR, +\fBOdinstalowywania\fR, +\fBInicjalizowania bazy danych\fR, +\fBPrzebudowywania bazy danych\fR, +\fBPonownego podpisywania\fR, +\fBDodawania sygnatury\fR, +\fBustawiania w³a¶cicieli i grup\fR, +\fBPokazywania etykiet zapytañ\fR, oraz +\fBPokazywania konfiguracji\fR. +.SS "OPCJE OGÓLNE" +.PP +Opcje te mog± byæ u¿ywane we wszystkich trybach. +.TP +\fB-?\fR, \fB-\-help\fR +Wypisuje informacjê o u¿yciu d³u¿sz± ni¿ zwykle. +.TP +\fB-\-version\fR +Wypisuje pojedyncz± liniê, zawieraj±c± numer wersji u¿ywanego \fBrpm\fR-a. +.TP +\fB-\-quiet\fP +Wypisuje jak najmniej - zazwyczaj tylko komunikaty o b³êdach. +.TP +\fB-v\fR +Wypisuje szczegó³owe informacje - zwykle komunikaty o przebiegu procesu. +.TP +\fB-vv\fR +Wypisuje du¿o brzydkich informacji diagnostycznych. +.TP +\fB-\-rcfile \fILISTA_PLIKÓW\fB\fR +Ka¿dy z plików w oddzielonej dwukropkami \fILI¦CIE_PLIKÓW\fP jest +odczytywany kolejno przez \fBrpm\fR-a w poszukiwaniu informacji o +konfiguracji. +Istnieæ musi tylko pierwszy plik z listy, a tyldy s± zamieniane na +warto¶æ \fB$HOME\fR. +Domy¶ln± \fILIST¡_PLIKÓW\fR jest +\fI/usr/lib/rpm/rpmrc\fR:\fI/usr/lib/rpm/redhat/rpmrc\fR:\fI/etc/rpmrc\fR:\fI~/.rpmrc\fR. +.TP +\fB-\-pipe \fIKOMENDA\fB\fR +Przekazuje potokiem wyj¶cie \fBrpm\fP-a do \fIKOMENDY\fR. +.TP +\fB-\-dbpath \fIKATALOG\fB\fR +U¿ywa bazy danych z \fIKATALOGU\fR zamiast domy¶lnego \fI/var/lib/rpm\fR. +.TP +\fB-\-root \fIKATALOG\fB\fR +U¿ywa do wszystkich operacji systemu zakorzenionego w \fIKATALOGU\fR. +Zauwa¿, ¿e oznacza to, ¿e baza danych w \fIKATALOGU\fP +bêdzie u¿ywana przy sprawdzaniu zale¿no¶ci, a wszystkie skrypty (np. +\fB%post\fR przy instalacji pakietu lub +\fB%prep\fR przy budowaniu pakietu) +bêd± uruchamiane po chroot(2) na +\fIKATALOG\fR. +.SS "OPCJE INSTALOWANIA I UAKTUALNIANIA" +.PP +Ogóln± postaci± komendy instalowania rpm-a jest +.PP + +\fBrpm\fR {\fB-i|-\-install\fR} [\fBinstall-options\fR] \fB\fIPLIK_PAKIETU\fB\fR\fI ...\fR + +.PP +Instaluje to nowy pakiet. +.PP +Ogóln± postaci± komendy uaktualniania rpm-a jest +.PP + +\fBrpm\fR {\fB-U|-\-upgrade\fR} [\fBinstall-options\fR] \fB\fIPLIK_PAKIETU\fB\fR\fI ...\fR + +.PP +Uaktualnia to aktualnie zainstalowany lub instaluje pakiet w nowej wersji. +Jest to to samo co install, lecz wszystkie inne wersje pakietu bêd± +usuniête po zainstalowaniu nowego pakietu. +.PP + +\fBrpm\fR {\fB-F|-\-freshen\fR} [\fBinstall-options\fR] \fB\fIPLIK_PAKIETU\fB\fR\fI ...\fR + +.PP +Od¶wie¿y to pakiety, lecz tylko je¶li wcze¶niejsza wersja ju¿ istnieje. +\fIPLIK_PAKIETU\fR mo¿e byæ podany jako URL +\fBftp\fR lub +\fBhttp\fR. +W tym wypadku pakiet zostanie pobrany przed zainstalowaniem. +W sekcji \fBOPCJE FTP/HTTP\fR znajduje siê wiêcej informacji o wewnêtrznej +obs³udze klienckiej +\fBftp\fR i +\fBhttp\fR w \fBrpm\fR. +.PP +.TP +\fB-\-aid\fR +Dodaje w razie potrzeby sugerowane pliki do zbioru transakcji. +.TP +\fB-\-allfiles\fR +Instaluje lub od¶wie¿a wszystkie pliki missingok (takie, których mo¿e +brakowaæ) z pakietu, niezale¿nie czy istniej±. +.TP +\fB-\-badreloc\fR +Do u¿ytku w po³±czeniu z \fB-\-relocate\fR. Pozwala na relokowanie ¶cie¿ek +wszystkich plików, nie tylko tych, których \fISTARA_¦CIE¯KA\fR jest na +li¶cie podpowiedzi dla relokacji w pakiecie binarnym. +.TP +\fB-\-excludepath \fISTARA_¦CIE¯KA\fB\fR +Nie instaluje plików, których nazwy rozpoczynaj± siê od +\fISTARA_¦CIE¯KA\fR. +.TP +\fB-\-excludedocs\fR +Nie instaluje ¿adnych plików, które s± zaznaczone jako dokumentacja +(co tyczy siê tak¿e podrêczników man i texinfo). +.TP +\fB-\-force\fR +To samo, co u¿ycie: +\fB-\-replacepkgs\fR, +\fB-\-replacefiles\fR i +\fB-\-oldpackage\fR. +.TP +\fB-h\fR, \fB-\-hash\fR +Wypisuje 50 znaków krzy¿yka, pokazuj±c proces rozpakowywania archiwum. +U¿ywaj±c z \fB-v|-\-verbose\fR, uzyskasz ³adny obraz. +.TP +\fB-\-ignoresize\fR +Nie sprawdza, czy na zamontowanych systemach plików jest do¶æ miejsca na +zainstalowanie tego pakietu. +.TP +\fB-\-ignorearch\fR +Umo¿liwia instalacjê lub uaktualnienie nawet w wypadku, gdy +architektury binarnego pakietu i hosta nie odpowiadaj± sobie. +.TP +\fB-\-ignoreos\fR +Umo¿liwia instalacjê lub uaktualnienie nawet w wypadku, gdy +systemy operacyjne binarnego pakietu i hosta nie odpowiadaj± sobie. +.TP +\fB-\-includedocs\fR +Instaluje pliki dokumentacji. Tak jest domy¶lnie. +.TP +\fB-\-justdb\fR +Od¶wie¿a tylko bazê danych, a nie system plików. +.TP +\fB-\-nodigest\fR +Nie weryfikuje skrótów kryptograficznych pakietu ani nag³ówka przy odczycie. +.TP +\fB-\-nosignature\fR +Nie weryfikuje sygnatur pakietu ani nag³ówka przy odczycie. +.TP +\fB-\-nodeps\fR +Nie dokonuje sprawdzenia zale¿no¶ci przed instalowaniem, lub +uaktualnieniem pakietu. +.TP +\fB-\-nosuggest\fR +Nie sugeruje pakietu(ów), które dostarczaj± brakuj±c± zale¿no¶æ. +.TP +\fB-\-noorder\fR +Nie porz±dkuje pakietów do instalacji. Lista pakietów w normalnych +wypadkach jest porz±dkowana na nowo, aby spe³niæ zale¿no¶ci. +.TP +\fB-\-noscripts\fR +.TP +\fB-\-nopre\fR +.TP +\fB-\-nopost\fR +.TP +\fB-\-nopreun\fR +.TP +\fB-\-nopostun\fR +Nie wywo³uje skryptów o podanej nazwie. +Opcja \fB-\-noscripts\fR jest równowa¿na + +\fB-\-nopre\fR +\fB-\-nopost\fR +\fB-\-nopreun\fR +\fB-\-nopostun\fR + +i wy³±cza wykonywanie odpowiadaj±cych im skryptów +\fB%pre\fR, +\fB%post\fR, +\fB%preun\fR oraz +\fB%postun\fR. +.TP +\fB-\-notriggers\fR +.TP +\fB-\-notriggerin\fR +.TP +\fB-\-notriggerun\fR +.TP +\fB-\-notriggerpostun\fR +Nie wywo³uje skryptów, które s± poci±gane przez instalacjê lub +usuwanie pakietu. +Opcja \fB-\-notriggers\fR jest równowa¿na + +\fB-\-notriggerin\fR +\fB-\-notriggerun\fR +\fB-\-notriggerpostun\fR + +i wy³±cza wykonywanie odpowiadaj±cych im skryptów +\fB%triggerin\fR, +\fB%triggerun\fR oraz +\fB%triggerpostun\fR. +.TP +\fB-\-oldpackage\fR +Zezwala uaktualnianiu na zast±pienie nowszego pakietu starszym. +.TP +\fB-\-percent\fR +Wypisuje procenty podczas rozpakowywania plików z archiwum. Jest to zrobione +w celu u³atwienia wywo³ywania \frpm\fR-a z innych narzêdzi. +.TP +\fB-\-prefix \fINOWA_¦CIE¯KA\fB\fR +Dla pakietów relokowalnych t³umaczy wszystkie ¶cie¿ki plików +zaczynaj±ce siê od prefiksu instalacji w podpowiedziach dla relokacji +na \fNOW¡_¦CIE¯KÊ\fR. +.TP +\fB-\-relocate \fISTARA_¦CIE¯KA\fB=\fINOWA_¦CIE¯KA\fB\fR +Dla pakietów relokowalnych t³umaczy wszystkie ¶cie¿ki plików +zaczynaj±ce siê od \fISTAREJ_¦CIE¯KI\fR w podpowiedziach dla relokacji +na \fINOW¡_¦CIE¯KÊ\fR. +Ta opcja mo¿e u¿ywana wiele razy, je¶li ma byæ zrelokowane kilka ró¿nych +\fISTARYCH_¦CIE¯EK\fR. +.TP +\fB-\-repackage\fR +Re-pakietuje pliki przed usuniêciem. Poprzednio zainstalowany pakiet +bêdzie nazwany zgodnie z makrem +\fB%_repackage_name_fmt\fR +i bêdzie utworzony w katalogu zapisanym w makrze +\fB%_repackage_dir\fR (domy¶ln± warto¶ci± jest \fI/var/spool/repackage\fR). +.TP +\fB-\-replacefiles\fR +Instaluje pakiety nawet je¶li zastêpuj± one pliki z innych, ju¿ +zainstalowanych pakietów. +.TP +\fB-\-replacepkgs\fR +Instaluje pakiety nawet je¶li niektóre z nich s± ju¿ zainstalowane na tym +systemie. +.TP +Nie instaluje pakietu, po prostu sprawdza i raportuje potencjalne +konflikty. +.SS "OPCJE USUWANIA" +.PP +Ogóln± postaci± komendy usuwania rpm-a jest +.PP + +\fBrpm\fR {\fB-e|-\-erase\fR} [\fB-\-allmatches\fR] [\fB-\-nodeps\fR] [\fB-\-noscripts\fR] [\fB--notriggers\fR] [\fB--repackage\fR] [\fB--test\fR] \fB\fINAZWA_PAKIETU\fB\fR\fI ...\fR + +.PP +Mo¿na u¿yæ nastêpuj±cych opcji: +.TP +\fB-\-allmatches\fR +Usunie wszystkie wersje pakietu, które odpowiadaj± +\fI"\fR z pier¶cieni kluczy zlokalizowanych +w \fB/etc/rpm/.pgp\fP, +przy u¿yciu programu \fI/usr/bin/gpg\fR, za³±czy³by¶ +.PP +.nf +%_signature gpg +%_gpg_path /etc/rpm/.gpg +%_gpg_name John Doe +%_gpgbin /usr/bin/gpg +.fi +.PP +w pliku konfiguracji makr. Do ogólnosystemowej konfiguracji u¿yj +\fI/etc/rpm/macros\fR, a dla lokalnej \fI~/.rpmmacros\fR. +.SS "OPCJE PRZEBUDOWYWANIA BAZY DANYCH" +.PP +Ogólna postaæ komendy przebudowywania bazy danych rpm-a to +.PP + +\fBrpm\fR {\fB-\-initdb|-\-rebuilddb\fR} [\fB-v\fR] [\fB-\-dbpath \fIKATALOG\fB\fR] [\fB-\-root \fIKATALOG\fB\fR] + +.PP +U¿yj \fB-\-initdb\fR aby utworzyæ now± bazê danych lub +\fB-\-rebuilddb\fR, aby przebudowaæ indeksy bazy danych +z nag³ówków zainstalowanych pakietów. +.SS "WY¦WIETLANIE KONFIGURACJI" +.PP +Polecenie +.PP +\fBrpm\fR \fB-\-showrc\fR +.PP +pokazuje warto¶ci, których \fBrpm\fR bêdzie u¿ywa³ dla wszystkich +opcji, które s± aktualnie ustawione w plikach konfiguracyjnych +\fIrpmrc\fR oraz +\fImacros\fR. +.SS "OPCJE FTP/HTTP" +.PP +\fBrpm\fR mo¿e dzia³aæ jako klient FTP i/lub HTTP, co pozwala na +odpytywanie lub instalowanie pakietów z Internetu. +Pliki pakietów do operacji instalacji, uaktualnienia lub odpytania +mog± byæ podane jako URL w stylu +\fBftp\fR lub +\fBhttp\fR: +.PP +ftp://U¯YTKOWNIK:HAS£O@HOST:PORT/¶cie¿ka/do/pakietu.rpm +.PP +Je¶li czê¶æ \fB:HAS£O\fR jest pominiêta, u¿ytkownik zostanie o nie +zapytany (jednokrotnie na parê u¿ytkownik/host). Je¶li pominiêto nazwê +u¿ytkownika i has³o, u¿ywany jest anonimowy \fBftp\fR. We wszystkich +przypadkach u¿ywane s± pasywne (PASV) transfery \fBftp\fR. +.PP +\fBrpm\fR zezwala na u¿ywanie z URL-ami \fBftp\fR nastêpuj±cych opcji: +.TP +\fB-\-ftpproxy \fIHOST\fB\fR +Podany \fIHOST\fR bêdzie u¿ywany jako proxy dla wszystkich transferów +ftp, co umo¿liwia u¿ytkownikom ¶ci±ganie danych przez zapory ogniowe, +które u¿ywaj± systemów proxy. Opcja ta mo¿e byæ te¿ podana przez +skonfigurowanie makra \fB%_ftpproxy\fP. +.TP +\fB-\-ftpport \fIPORT\fB\fR +Numer \fIPORTU\fR TCP, którego u¿yæ do po³±czenia ftp na serwerze proxy +zamiast portu domy¶lnego. Opcja ta mo¿e byæ te¿ podana przez +skonfigurowanie makra \fB%_ftpport\fP. +.PP +\fBrpm\fR zezwala na u¿ywanie z URL-ami \fBhttp\fR nastêpuj±cych opcji: +.TP +\fB-\-httpproxy \fIHOST\fB\fR +Podany \fIHOST\fR bêdzie u¿ywany jako proxy dla wszystkich transferów +\fBhttp\fR. Opcja ta mo¿e byæ te¿ podana przez skonfigurowanie makra +\fB%_httpproxy\fR. +.TP +\fB-\-httpport \fIPORT\fB\fR +Numer \fIPORTU\fR TCP, którego u¿yæ do po³±czenia \fBhttp\fR na serwerze +proxy zamiast portu domy¶lnego. Opcja ta mo¿e byæ te¿ podana przez +skonfigurowanie makra \fB%_httpport\fR. +.SH "SPRAWY SPADKOWE" +.SS "Uruchamianie rpmbuild" +.PP +Tryby budowania rpm-a znajduj± siê teraz w programie +\fI/usr/bin/rpmbuild\fR. +Mimo ¿e spadkowa kompatybilno¶æ zapewniona przez wymienione ni¿ej aliasy +popt jest wystarczaj±ca, kompatybilno¶æ nie jest doskona³a; dlatego +kompatybilno¶æ trybu budowania poprzez aliasy popt jest usuwana z rpm-a. +Zainstaluj pakiet \fBrpm-build\fR i zobacz +\fBrpmbuild\fR(8), gdzie znajduje siê dokumentacja wszystkich trybów budowania +\fBrpm\fR poprzednio udokumentowana w niniejszym +\fBrpm\fR(8). +.PP +Dodaj nastêpuj±ce linie do \fI/etc/popt\fR, je¶li chcesz nadal uruchamiaæ +\fBrpmbuild\fR z linii poleceñ \fBrpm\fR-a: +.PP +.nf +rpm exec -\-bp rpmb -bp +rpm exec -\-bc rpmb -bc +rpm exec -\-bi rpmb -bi +rpm exec -\-bl rpmb -bl +rpm exec -\-ba rpmb -ba +rpm exec -\-bb rpmb -bb +rpm exec -\-bs rpmb -bs +rpm exec -\-tp rpmb -tp +rpm exec -\-tc rpmb -tc +rpm exec -\-ti rpmb -ti +rpm exec -\-tl rpmb -tl +rpm exec -\-ta rpmb -ta +rpm exec -\-tb rpmb -tb +rpm exec -\-ts rpmb -ts +rpm exec -\-rebuild rpmb -\-rebuild +rpm exec -\-recompile rpmb -\-recompile +rpm exec -\-clean rpmb -\-clean +rpm exec -\-rmsource rpmb -\-rmsource +rpm exec -\-rmspec rpmb -\-rmspec +rpm exec -\-target rpmb -\-target +rpm exec -\-short-circuit rpmb -\-short-circuit +.fi +.SH "PLIKI" +.SS "Konfiguracja rpmrc" +.PP +.nf +\fI/usr/lib/rpm/rpmrc\fR +\fI/usr/lib/rpm/redhat/rpmrc\fR +\fI/etc/rpmrc\fR +\fI~/.rpmrc\fR +.fi +.SS "Konfiguracja makr" +.PP +.nf +\fI/usr/lib/rpm/macros\fR +\fI/usr/lib/rpm/redhat/macros\fR +\fI/etc/rpm/macros\fR +\fI~/.rpmmacros\fR +.fi +.SS "Baza danych" +.PP +.nf +\fI/var/lib/rpm/Basenames\fR +\fI/var/lib/rpm/Conflictname\fR +\fI/var/lib/rpm/Dirnames\fR +\fI/var/lib/rpm/Filemd5s\fR +\fI/var/lib/rpm/Group\fR +\fI/var/lib/rpm/Installtid\fR +\fI/var/lib/rpm/Name\fR +\fI/var/lib/rpm/Packages\fR +\fI/var/lib/rpm/Providename\fR +\fI/var/lib/rpm/Provideversion\fR +\fI/var/lib/rpm/Pubkeys\fR +\fI/var/lib/rpm/Removed\fR +\fI/var/lib/rpm/Requirename\fR +\fI/var/lib/rpm/Requireversion\fR +\fI/var/lib/rpm/Sha1header\fR +\fI/var/lib/rpm/Sigmd5\fR +\fI/var/lib/rpm/Triggername\fR +.fi +.SS "Tymczasowe" +.PP +\fI/var/tmp/rpm*\fR +.SH "ZOBACZ TAK¯E" + +.nf +\fBpopt\fR(3), +\fBrpm2cpio\fR(8), +\fBrpmbuild\fR(8), +.fi + +\fBhttp://www.rpm.org/ +\fR + +.SH "AUTORZY" + +.nf +Marc Ewing +Jeff Johnson +Erik Troan +.fi diff --git a/rpm-5.4.9/doc/pl/rpm2cpio.8 b/rpm-5.4.9/doc/pl/rpm2cpio.8 new file mode 100644 index 0000000..4c23092 --- /dev/null +++ b/rpm-5.4.9/doc/pl/rpm2cpio.8 @@ -0,0 +1,25 @@ +.\" {PTM/WK/1999-11-21} +.\" Jakub Bogusz , 2003 +.\" rpm2cpio - Converts RPM Package to cpio archive +.\" rpm 4.3-20030610 +.TH rpm2cpio 8 "11 stycznia 2001" "Red Hat, Inc." "Red Hat Linux" +.SH NAZWA +rpm2cpio \- konwersja pakietu RPM na archiwum cpio +.SH SK£ADNIA +\fBrpm2cpio\fP [ nazwa_pliku ] +.SH OPIS +\fBrpm2cpio\fP konwertuje podany, jako jedyny argument, plik .rpm +do postaci archiwum cpio na standardowym wyj¶ciu. Je¶li podano argument +'\-', to strumieñ rpm czytany jest ze standardowego wej¶cia. + +.br +.I "\fBrpm2cpio rpm-1.1-1.i386.rpm\fP" +.br +.I "\fBrpm2cpio < glint-1.0-1.i386.rpm\fP" + +.SH ZOBACZ TAK¯E +.IR rpm (8) +.SH AUTOR +.nf +Erik Troan +.fi diff --git a/rpm-5.4.9/doc/pl/rpmbuild.8 b/rpm-5.4.9/doc/pl/rpmbuild.8 new file mode 100644 index 0000000..9cef93c --- /dev/null +++ b/rpm-5.4.9/doc/pl/rpmbuild.8 @@ -0,0 +1,245 @@ +.\" Jakub Bogusz , 2003 +.\" (partially based on rpm.8 translation by Przemek Borys 1999) +.\" rpm 4.3-20030610 +.TH "RPMBUILD" "8" "9 czerwca 2002" "Red Hat, Inc." "Red Hat Linux" +.SH NAZWA +rpmbuild \- Budowanie pakietów RPM +.SH SK£ADNIA +.SS "BUDOWANIE PAKIETÓW:" +.PP + +\fBrpmbuild\fR {\fB-ba|-bb|-bp|-bc|-bi|-bl|-bs\fR} [\fBopcje-rpmbuild\fR] \fB\fIPLIK_SPEC\fB\fR\fI ...\fR + +\fBrpmbuild\fR {\fB-ta|-tb|-tp|-tc|-ti|-tl|-ts\fR} [\fBopcje-rpmbuild\fR] \fB\fITARBALL\fB\fR\fI ...\fR + +\fBrpmbuild\fR {\fB--rebuild|--recompile\fR} \fB\fIPAKIET_¬RÓD£OWY\fB\fR\fI ...\fR + +.SS "RÓ¯NE:" +.PP + +\fBrpmbuild\fR \fB--showrc\fR + +.SS "opcje-rpmbuild" +.PP + + [\fB--buildroot \fIKATALOG\fB\fR] [\fB--clean\fR] [\fB--nobuild\fR] + [\fB--rmsource\fR] [\fB--rmspec\fR] [\fB--short-circuit\fR] [\fB--sign\fR] + [\fB--target \fIPLATFORMA\fB\fR] + +.SH "OPIS" +.PP +\fBrpmbuild\fR s³u¿y do budowania binarnych i ¼ród³owych pakietów +oprogramowania. \fBPakiet\fR sk³ada siê z archiwum plików oraz metadanych +u¿ywanych do instalowania i usuwania plików. Metadane zawieraj± pomocnicze +skrypty, atrybuty plików oraz informacje opisuj±ce pakiet. +\fBPakiety\fR wystêpuj± w dwóch wersjach: pakietach binarnych, s³u¿±cych do +opakowania oprogramowania do instalacji oraz pakietach ¼ród³owych, +zawieraj±cych kod ¼ród³owy i przepis na zbudowanie pakietów binarnych. +.PP +Trzeba wybraæ jeden z nastêpuj±cych podstawowych trybów: +\fBBudowanie pakietu\fR, +\fBBudowanie pakietu z tarballa\fR, +\fBRekompilacja pakietu\fR, +\fBWy¶wietlenie konfiguracji\fR. +.SS "OPCJE OGÓLNE" +.PP +Opcje te mog± byæ u¿ywane we wszystkich trybach. +.TP +\fB-?\fR, \fB--help\fR +Wypisuje informacjê o u¿yciu d³u¿sz± ni¿ zwykle. +.TP +\fB--version\fR +Wypisuje pojedyncz± liniê, zawieraj±c± numer wersji u¿ywanego \fBrpm\fR-a. +.TP +\fB--quiet\fP +Wypisuje jak najmniej - zazwyczaj tylko komunikaty o b³êdach. +.TP +\fB-v\fR +Wypisuje szczegó³owe informacje - zwykle komunikaty o przebiegu procesu. +.TP +\fB-vv\fR +Wypisuje du¿o brzydkich informacji diagnostycznych. +.TP +\fB--rcfile \fILISTA_PLIKÓW\fB\fR +Ka¿dy z plików w oddzielonej dwukropkami \fILI¦CIE_PLIKÓW\fP jest +odczytywany kolejno przez \fBrpm\fR-a w poszukiwaniu informacji o +konfiguracji. +Istnieæ musi tylko pierwszy plik z listy, a tyldy s± zamieniane na +warto¶æ \fB$HOME\fR. +Domy¶ln± \fILIST¡_PLIKÓW\fR jest +\fI/usr/lib/rpm/rpmrc\fR:\fI/usr/lib/rpm/redhat/rpmrc\fR:\fI/etc/rpmrc\fR:\fI~/.rpmrc\fR. +.TP +\fB--pipe \fIKOMENDA\fB\fR +Przekazuje potokiem wyj¶cie \fBrpm\fP-a do \fIKOMENDY\fR. +.TP +\fB--dbpath \fIKATALOG\fB\fR +U¿ywa bazy danych z \fIKATALOGU\fR zamiast domy¶lnego \fI/var/lib/rpm\fR. +.TP +\fB--root \fIKATALOG\fB\fR +U¿ywa do wszystkich operacji systemu zakorzenionego w \fIKATALOGU\fR. +Zauwa¿, ¿e oznacza to, ¿e baza danych w \fIKATALOGU\fP +bêdzie u¿ywana przy sprawdzaniu zale¿no¶ci, a wszystkie skrypty (np. +\fB%post\fR przy instalacji pakietu lub +\fB%prep\fR przy budowaniu pakietu) +bêd± uruchamiane po chroot(2) na +\fIKATALOG\fR. +.SS "OPCJE BUDOWANIA" +.PP +Ogóln± postaci± komendy budowania rpm-a jest +.PP + +\fBrpmbuild\fR \fB-b\fIETAP\fB|-t\fIETAP\fB\fR [ \fB opcje-rpmbuild +\fR ] \fB\fIPLIK\fB\fR\fI ...\fR + +.PP +Je¶li do zbudowania pakietu u¿ywany jest plik spec, to argumentem powinno +byæ \fB-b\fR, a je¶li \fBrpmbuild\fR powinien zajrzeæ wewn±trz (byæ mo¿e +skompresowanego) pliku tar w poszukiwaniu speca, to powinna byæ u¿yta opcja +\fB-t\fR. Po pierwszym argumencie, drugi znak (\fIETAP\fR) okre¶la etapy +budowania i pakietowania, które nale¿y wykonaæ. Mo¿e byæ jednym z: +.TP +\fB-ba\fR +Buduje pakiety binarny i ¼ród³owy (po wykonaniu etapów %prep, %build +i %install). +.TP +\fB-bb\fR +Buduje pakiet binarny (po wykonaniu etapów %prep, %build i %install). +.TP +\fB-bp\fR +Wykonuje etap "%prep" z pliku spec. Zwykle obejmuje to rozpakowanie ¼róde³ +i zaaplikowanie wszelkich ³at. +.TP +\fB-bc\fR +Wykonuje etap "%build" z pliku spec (po wykonaniu etapu %prep). +Ogólnie obejmuje to odpowiednik "make". +.TP +\fB-bi\fR +Wykonuje etap "%install" z pliku spec (po wykonaniu etapów %prep i %build). +Ogólnie obejmuje to odpowiednik "make install". +.TP +\fB-bl\fR +Dokonuje sprawdzenia listy. W sekcji "%files" pliku spec rozwijane s± makra +i dokonywane s± sprawdzenia, by upewniæ siê, ¿e ka¿dy plik istnieje. +.TP +\fB-bs\fR +Buduje tylko pakiet ¼ród³owy. +.PP +Mog± byæ te¿ u¿yte nastêpuj±ce opcje: +.TP +\fB--buildroot \fIKATALOG\fB\fR +Na czas budowania pakietu zastêpuje warto¶æ BuildRoot \fIKATALOGIEM\fR. +.TP +\fB--clean\fR +Usuwa drzewo budowania po stworzeniu pakietów. +.TP +\fB--nobuild\fR +Nie wykonuje ¿adnych etapów budowania. Przydatne do testowania plików spec. +.TP +\fB--rmsource\fR +Usuwa ¼ród³a po budowaniu (mo¿e byæ te¿ u¿ywane samodzielnie, np. +"\fBrpmbuild\fR \fB--rmsource foo.spec\fR"). +.TP +\fB--rmspec\fR +Usuwa plik spec po budowaniu (mo¿e byæ te¿ u¿ywane samodzielnie, np. +"\fBrpmbuild\fR \fB--rmspec foo.spec\fR"). +.TP +\fB--short-circuit\fR +Przechodzi wprost do podanego etapu (tzn. pomija wszystkie etapy +prowadz±ce do podanego). Prawid³owe tylko z \fB-bc\fR i \fB-bi\fR. +.TP +\fB--sign\fR +Osadza w pakiecie sygnaturê GPG. Sygnatura ta mo¿e byæ u¿ywana do +weryfikowania integralno¶ci i pochodzenia pakietu. Zobacz sekcjê o +SYGNATURACH GPG w +\fBrpm\fR(8), gdzie znajduj± siê szczegó³y dotycz±ce konfiguracji. +.TP +\fB--target \fIPLATFORMA\fB\fR +Podczas budowania pakietu interpretuje \fIPLATFORMÊ\fR jako +\fBarch-vendor-os\fR i ustawia odpowiednio makra +\fB%_target\fR, +\fB%_target_cpu\fR oraz +\fB%_target_os\fP. +.SS "OPCJE PRZEBUDOWYWANIA I REKOMPILACJI" +.PP +Istniej± dwa inne sposoby na wywo³anie budowania przy u¿yciu rpm-a: +.PP + +\fBrpmbuild\fR \fB--rebuild|--recompile\fR \fB\fIPAKIET_¬RÓD£OWY\fB\fR\fI ...\fR + +.PP +Po takim wywo³aniu, \fBrpmbuild\fR instaluje podany pakiet ¼ród³owy oraz +wykonuje etapy prep, kompilacji i instalacji. Dodatkowo, \fB--rebuild\fR +buduje nowy pakiet binarny. Po tym jak budowanie jest zakoñczone, katalog +budowania jest usuwany (jak przy \fB--clean\fR), a potem ¼ród³a i plik spec +dla pakietu s± usuwane. +.SS "WY¦WIETLANIE KONFIGURACJI" +.PP +Polecenie +.PP + +\fBrpmbuild\fR \fB--showrc\fR + +.PP +pokazuje warto¶ci, których \fBrpmbuild\fR bêdzie u¿ywa³ dla wszystkich +opcji, które s± aktualnie ustawione w plikach konfiguracyjnych +\fIrpmrc\fR oraz +\fImacros\fR. +.SH "PLIKI" +.SS "Konfiguracja rpmrc" +.PP +.nf +\fI/usr/lib/rpm/rpmrc\fR +\fI/usr/lib/rpm/redhat/rpmrc\fR +\fI/etc/rpmrc\fR +\fI~/.rpmrc\fR +.fi +.SS "Konfiguracja makr" +.PP +.nf +\fI/usr/lib/rpm/macros\fR +\fI/usr/lib/rpm/redhat/macros\fR +\fI/etc/rpm/macros\fR +\fI~/.rpmmacros\fR +.fi +.SS "Baza danych" +.PP +.nf +\fI/var/lib/rpm/Basenames\fR +\fI/var/lib/rpm/Conflictname\fR +\fI/var/lib/rpm/Dirnames\fR +\fI/var/lib/rpm/Filemd5s\fR +\fI/var/lib/rpm/Group\fR +\fI/var/lib/rpm/Installtid\fR +\fI/var/lib/rpm/Name\fR +\fI/var/lib/rpm/Packages\fR +\fI/var/lib/rpm/Providename\fR +\fI/var/lib/rpm/Provideversion\fR +\fI/var/lib/rpm/Pubkeys\fR +\fI/var/lib/rpm/Removed\fR +\fI/var/lib/rpm/Requirename\fR +\fI/var/lib/rpm/Requireversion\fR +\fI/var/lib/rpm/Sha1header\fR +\fI/var/lib/rpm/Sigmd5\fR +\fI/var/lib/rpm/Triggername\fR +.fi +.SS "Tymczasowe" +.PP +\fI/var/tmp/rpm*\fR +.SH "ZOBACZ TAK¯E" + +.nf +\fBpopt\fR(3), +\fBrpm2cpio\fR(8), +\fBgendiff\fR(1), +\fBrpm\fR(8), +.fi + +\fBhttp://www.rpm.org/ +\fR +.SH "AUTORZY" + +.nf +Marc Ewing +Jeff Johnson +Erik Troan +.fi diff --git a/rpm-5.4.9/doc/pl/rpmcache.8 b/rpm-5.4.9/doc/pl/rpmcache.8 new file mode 100644 index 0000000..8510242 --- /dev/null +++ b/rpm-5.4.9/doc/pl/rpmcache.8 @@ -0,0 +1,112 @@ +.\" Jakub Bogusz , 2003 +.\" rpm 4.3-20030610 +.TH "RPMCACHE" "8" "5 lipca 2002" "Red Hat, Inc." "Red Hat Linux" +.SH NAZWA +rpmcache \- Zapamiêtywanie nag³ówków pakietów RPM +.SH SK£ADNIA +.PP + +\fBrpmcache\fR [ \fB\fINAZWA_PAKIETU\fB\fR\fI ...\fR ] + +.SH "OPIS" +.PP +\fBrpmcache\fR chodzi po drzewie plików (byæ mo¿e tak¿e zdalnych +przy u¿yciu \fBFTP\fR), filtruj±c ¶cie¿ki przy u¿yciu wyra¿eñ +\fBglob\fR(7), czytaj±c nag³ówki pakietów rpm. Ostatnie (porównuj±c +pola epoch/version/release pakietów w przypadku identycznych nazw +i u¿ywaj±c czasu budowania w przypadkach nierozstrzygniêtych) +nag³ówki pakietów, je¶li s± unikalne, s± zapamiêtywane w bazie danych +rpm-a. Zapamiêtane w bazie nag³ówki mog± byæ u¿ywane do udostêpniania +sugerowanych ¶cie¿ek do pakietów rozwi±zuj±cych nieznane zale¿no¶ci. +.PP +Nie ma opcji specyficznych dla \fBrpmcache\fR, tylko wspólne opcje +\fBrpm\fR-a. Aktualnie zaimplementowane opcje mo¿na zobaczyæ w komunikacie +o sk³adni komendy \fBrpmcache\fR. +.PP +¦cie¿ka drzewa plików do przeszukiwania jest konfigurowana przy u¿yciu +makr rpm-a. Ostateczna ¶cie¿ka jest po³±czeniem 5 oddzielnych elementów. +Oto nazwy makr u¿ywanych do skonfigurowania \fBrpmcache\fR w tej samej +kolejno¶ci, w jakiej s± ³±czone w celu stworzenia ¶cie¿ki drzewa plików +do przeszukania: +.PP +.TP +\fB%_bhpath\fR +Poziom "path" (¶cie¿ka) zawiera pocz±tkow± czê¶æ ¶cie¿ki drzewa plików +(lub URL). Proszê tu nie u¿ywaæ wyra¿eñ \fBglob\fR(7). +.TP +\fB%_bhcoll\fR +Poziom "collection" (kolekcja) zawiera ³añcuch (lub wyra¿enie +\fBglob\fR(7)) okre¶laj±cy podkatalogi \fB%_bhpath\fR. +.TP +\fB%_bhN\fR +Poziom "name" (nazwa) zawiera ³añcuch (lub wyra¿enie \fBglob\fR(7)) +okre¶laj±cy podkatalogi \fB%_bhcoll\fR. +Argumenty \fINAZWA_PAKIETU\fR s± u¿ywane do stworzenia wyra¿enia +\fBglob\fR(7), które bêdzie pasowa³o do okre¶lonych nazw pakietu +w systemie budowania Red hata, i s± raczej bezu¿ytecznie poza Red +Hatem. +.TP +\fB%_bhVR\fR +Poziom "version-release" (wersja-wydanie) zawiera ³añcuch (lub wyra¿enie +\fBglob\fR(7)) okre¶laj±cy podkatalogi \fB%_bhN\fR. +.TP +\fB%_bhA\fR +Poziom "arch" (architektura) zawiera ³añcuch (lub wyra¿enie +\fBglob\fR(7)) okre¶laj±cy podkatalogi \fB%_bhVR\fR. +.PP +Po³o¿enie bazy danych pamiêtaj±cej nag³ówki jest konfigurowalne poprzez +makro rpm-a: +.TP +\fB%_cache_dbpath\fR +Po³o¿enie bazy danych pamiêtaj±cej nag³ówki. Domy¶lna warto¶æ to +\fI/var/spool/up2date/cache\fR. +.PP +Baza danych nag³ówków ma identyczny format do bazy danych rpm-a +i mo¿e byæ u¿ywana z linii poleceñ \fBrpm\fR-a. Na przyk³ad aby +u¿yæ bazy danych nag³ówków do udostêpnienia sugestii dla pakietów +dostarczaj±cych zale¿no¶ci potrzebne do zainstalowania pakietu, +nastêpuj±ce makro musi byæ skonfigurowane w +\fI/etc/rpm/macros\fR lub +\fI~/.rpmmacros\fR: +.TP +\fB%_solve_dbpath\fR +Po³o¿enie bazy danych u¿ywanej do udostêpniania sugestii do +rozwi±zywania zale¿no¶ci. +.PP +.SS "Przyk³adowa (minimalna) konfiguracja dla drzewa beehive Red Hata:" +.PP +.nf +%_cache_dbpath /var/spool/up2date/cache +%_solve_dbpath %{_cache_dbpath} +%_bhpath file://localhost/mnt/redhat/beehive/comps/dist +%_bhcoll 7.3 +%_bhN @(basesystem|bash|filesystem|glibc-common|glibc|ldconfig|libtermcap|mktemp|setup|termcap) +%_bhVR * +%_bhA @(i[3456]86|noarch) +.fi +.SS "Przyk³adowa (minimalna) konfiguracja dla drzewa FTP Red Hata:" +.PP +.nf +%_cache_dbpath /var/spool/up2date/cache +%_solve_dbpath %{_cache_dbpath} +%_bhpath ftp://localhost/mnt/dist +%_bhcoll @(7.3|7.2|7.1|7.0|6.2|6.1|6.0|5.2|5.1|5.0) +%_bhN @(%{_arch}) +%_bhVR * +%_bhA @(i[3456]86|noarch) +.fi +.SH "B£ÊDY" +.PP +Uhm. Proszê wype³niaæ raporty o b³êdach i ¿yczeniach dla pakietu rpm-devel +przy u¿yciu bugzilli (w jêzyku angielskim): +http://bugzilla.redhat.com/ +.SH "ZOBACZ TAK¯E" + +\fBrpm\fR(8), +\fBglob\fR(7), + +\fB http://www.rpm.org/ +\fR +.SH "AUTORZY" + +Jeff Johnson diff --git a/rpm-5.4.9/doc/pl/rpmdeps.8 b/rpm-5.4.9/doc/pl/rpmdeps.8 new file mode 100644 index 0000000..9a49408 --- /dev/null +++ b/rpm-5.4.9/doc/pl/rpmdeps.8 @@ -0,0 +1,24 @@ +.\" Jakub Bogusz , 2003 +.\" rpm 4.3-20030610 +.TH "RPMDEPS" "8" "24 pa¼dziernika 2002" "Red Hat, Inc." "Red Hat Linux" +.SH NAZWA +rpmdeps \- Generowanie zale¿no¶ci pakietów RPM +.SH SK£ADNIA +.PP + +\fBrpmdeps\fR \fB{-P|--provides}\fR \fB{-R|--requires}\fR \fB\fIPLIK\fB\fR\fI ...\fR + +.SH "OPIS" +.PP +\fBrpmdeps\fR generuje zale¿no¶ci pakietu dla zbioru argumentów +\fBPLIKOWYCH\fR. Ka¿dy argument \fBPLIKOWY\fR jest przeszukiwany pod +k±tem Elf32/Elf64, interpretera skryptów lub zale¿no¶ci dla skryptu, +a zale¿no¶ci s± wypisywane na standardowe wyj¶cie. +.SH "ZOBACZ TAK¯E" + +\fBrpm\fR(8), + +\fBrpmbuild\fR(8), +.SH "AUTORZY" + +Jeff Johnson diff --git a/rpm-5.4.9/doc/pl/rpmgraph.8 b/rpm-5.4.9/doc/pl/rpmgraph.8 new file mode 100644 index 0000000..0ab7e57 --- /dev/null +++ b/rpm-5.4.9/doc/pl/rpmgraph.8 @@ -0,0 +1,42 @@ +.\" Jakub Bogusz , 2003 +.\" rpm 4.3-20030610 +.TH "RPMGRAPH" "8" "30 czerwca 2002" "Red Hat, Inc." "Red Hat Linux" +.SH NAZWA +rpmgraph \- Wy¶wietlanie grafu zale¿no¶ci pakietu RPM +.SH SK£ADNIA +.PP + +\fBrpmgraph\fR \fB\fIPLIK_PAKIETU\fB\fR\fI ...\fR + +.SH "OPIS" +.PP +\fBrpmgraph\fR u¿ywa argumentów \fIPLIK_PAKIETU\fR do wygenerowania +grafu zale¿no¶ci pakietów. Ka¿dy argument \fIPLIK_PAKIETU\fR jest +czytany i dodawany do zbioru transakcji rpm-a. Elementy zbioru +transakcji s± czê¶ciowo porz±dkowane przy u¿yciu sortowania +topologicznego. Nastêpnie czê¶ciowo uporz±dkowane elementy s± +wypisywane na standardowe wyj¶cie. +.PP +Wierzcho³ki w grafie zale¿no¶ci to nazwy pakietów, krawêdzie w grafie +skierowanym wskazuj± na rodzica ka¿dego wierzcho³ka. Rodzic jest +zdefiniowany jako ostatni poprzednik pakietu w czê¶ciowym porz±dku +przy u¿yciu gdzie zale¿no¶ci pakietu jako relacji. Oznacza to, ¿e +rodzic danego pakietu jest ostatni± zale¿no¶ci± pakietu. +.PP +Wyj¶cie jest w formacie grafu skierowanego \fBdot\fR(1) i mo¿e byæ +wy¶wietlone lub wydrukowane przy u¿yciu edytora grafów \fBdotty\fR +z pakietu \fBgraphviz\fR. +Nie ma opcji specyficznych dla programu \fBrpmgraph\fR, tylko wspólne +opcje \fBrpm\fR-a. Aktualnie zaimplementowane opcje mo¿na zobaczyæ +w komunikacie o sk³adni komendy \fBrpmgraph\fR. +.SH "ZOBACZ TAK¯E" + +\fBdot\fR(1), + +\fBdotty\fR(1), + +\fB http://www.graphviz.org/ +\fR +.SH "AUTORZY" + +Jeff Johnson diff --git a/rpm-5.4.9/doc/rpm.8 b/rpm-5.4.9/doc/rpm.8 new file mode 100644 index 0000000..65cde18 --- /dev/null +++ b/rpm-5.4.9/doc/rpm.8 @@ -0,0 +1,951 @@ +.\" This manpage has been automatically generated by docbook2man +.\" from a DocBook document. This tool can be found at: +.\" +.\" Please send any bug reports, improvements, comments, patches, +.\" etc. to Steve Cheng . +.TH "RPM" "8" "09 June 2002" "rpm5.org" "RPM Package Manager" +.SH NAME +rpm \- RPM Package Manager +.SH SYNOPSIS +.SS "QUERYING AND VERIFYING PACKAGES:" +.PP + +\fBrpm\fR {\fB-q|-\-query\fR} [\fBselect-options\fR] [\fBquery-options\fR] + +\fBrpm\fR {\fB-V|-\-verify\fR} [\fBselect-options\fR] [\fBverify-options\fR] + +\fBrpm\fR \fB-\-import\fR \fB\fIPUBKEY\fB\fR\fI ...\fR + +\fBrpm\fR {\fB-K|-\-checksig\fR} [\fB-\-nosignature\fR] [\fB-\-nodigest\fR] + \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR + +.SS "INSTALLING, UPGRADING, AND REMOVING PACKAGES:" +.PP + +\fBrpm\fR {\fB-i|-\-install\fR} [\fBinstall-options\fR] \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR + +\fBrpm\fR {\fB-U|-\-upgrade\fR} [\fBinstall-options\fR] \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR + +\fBrpm\fR {\fB-F|-\-freshen\fR} [\fBinstall-options\fR] \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR + +\fBrpm\fR {\fB-e|-\-erase\fR} [\fB-\-allmatches\fR] [\fB-\-nodeps\fR] [\fB-\-noscripts\fR] + [\fB-\-notriggers\fR] [\fB-\-repackage\fR] [\fB-\-test\fR] \fB\fIPACKAGE_NAME\fB\fR\fI\ ...\fR + +.SS "MISCELLANEOUS:" +.PP + +\fBrpm\fR {\fB-\-rebuilddb\fR} + +\fBrpm\fR {\fB-\-addsign|-\-resign\fR} \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR + +\fBrpm\fR {\fB-\-querytags|-\-showrc\fR} + +\fBrpm\fR {\fB-\-setperms|-\-setugids\fR} \fB\fIPACKAGE_NAME\fB\fR\fI ...\fR + +.SS "select-options" +.PP + + [\fB\fIPACKAGE_NAME\fB\fR] [\fB-a,-\-all\fR] [\fB-f,-\-file \fIFILE\fB\fR] + [\fB-g,-\-group \fIGROUP\fB\fR] {\fB-p,-\-package \fIPACKAGE_FILE\fB\fR] + [\fB-\-fileid \fIMD5\fB\fR] [\fB-\-hdrid \fISHA1\fB\fR] [\fB-\-pkgid \fIMD5\fB\fR] [\fB-\-tid \fITID\fB\fR] + [\fB-\-querybynumber \fIHDRNUM\fB\fR] [\fB-\-triggeredby \fIPACKAGE_NAME\fB\fR] + [\fB-\-whatprovides \fICAPABILITY\fB\fR] [\fB-\-whatrequires \fICAPABILITY\fB\fR] + +.SS "query-options" +.PP + + [\fB-\-changelog\fR] [\fB-c|-\-configfiles\fR] [\fB-d|-\-docfiles\fR] [\fB-\-dump\fR] + [\fB-\-filesbypkg\fR] [\fB-i|-\-info\fR] [\fB-\-last\fR] [\fB-l|-\-list\fR] + [\fB-\-provides\fR] [\fB-\-qf,-\-queryformat \fIQUERYFMT\fB\fR] + [\fB-R|-\-requires\fR] [\fB-\-scripts\fR] [\fB-s|-\-state\fR] + [\fB-\-triggers,-\-triggerscripts\fR] + +.SS "verify-options" +.PP + + [\fB-\-nodeps\fR] [\fB-\-nofiles\fR] [\fB-\-noscripts\fR] + [\fB-\-nodigest\fR] [\fB-\-nosignature\fR] + [\fB-\-nolinkto\fR] [\fB-\-nomd5\fR] [\fB-\-nosize\fR] [\fB-\-nouser\fR] + [\fB-\-nogroup\fR] [\fB-\-nomtime\fR] [\fB-\-nomode\fR] [\fB-\-nordev\fR] + +.SS "install-options" +.PP + + [\fB-\-aid\fR] [\fB-\-allfiles\fR] [\fB-\-badreloc\fR] [\fB-\-excludepath \fIOLDPATH\fB\fR] + [\fB-\-excludedocs\fR] [\fB-\-force\fR] [\fB-h,-\-hash\fR] + [\fB-\-ignoresize\fR] [\fB-\-ignorearch\fR] [\fB-\-ignoreos\fR] + [\fB-\-includedocs\fR] [\fB-\-justdb\fR] [\fB-\-nodeps\fR] + [\fB-\-nodigest\fR] [\fB-\-nosignature\fR] [\fB-\-nosuggest\fR] + [\fB-\-noorder\fR] [\fB-\-noscripts\fR] [\fB-\-notriggers\fR] + [\fB-\-oldpackage\fR] [\fB-\-percent\fR] [\fB-\-prefix \fINEWPATH\fB\fR] + [\fB-\-relocate \fIOLDPATH\fB=\fINEWPATH\fB\fR] + [\fB-\-repackage\fR] [\fB-\-replacefiles\fR] [\fB-\-replacepkgs\fR] + [\fB-\-test\fR] + +.SH "DESCRIPTION" +.PP +\fBrpm\fR is a powerful \fBPackage Manager\fR, +which can be used to build, install, query, verify, update, and +erase individual software packages. +A \fBpackage\fR consists of an archive of files and +meta-data used to install and erase the archive files. The meta-data +includes helper scripts, file attributes, and descriptive information +about the package. +\fBPackages\fR come in two varieties: binary packages, +used to encapsulate software to be installed, and source packages, +containing the source code and recipe necessary to produce binary +packages. +.PP +One of the following basic modes must be selected: +\fBQuery\fR, +\fBVerify\fR, +\fBSignature Check\fR, +\fBInstall/Upgrade/Freshen\fR, +\fBUninstall\fR, +\fBInitialize Database\fR, +\fBRebuild Database\fR, +\fBResign\fR, +\fBAdd Signature\fR, +\fBSet Owners/Groups\fR, +\fBShow Querytags\fR, and +\fBShow Configuration\fR. +.SS "GENERAL OPTIONS" +.PP +These options can be used in all the different modes. +.TP +\fB-?, -\-help\fR +Print a longer usage message then normal. +.TP +\fB-\-version\fR +Print a single line containing the version number of \fBrpm\fR +being used. +.TP +\fB-\-quiet\fR +Print as little as possible - normally only error messages will +be displayed. +.TP +\fB-v\fR +Print verbose information - normally routine progress messages will be +displayed. +.TP +\fB-vv\fR +Print lots of ugly debugging information. +.TP +\fB-\-rcfile \fIFILELIST\fB\fR +Each of the files in the colon separated +\fIFILELIST\fR +is read sequentially by \fBrpm\fR for configuration +information. +Only the first file in the list must exist, and tildes will be +expanded to the value of \fB$HOME\fR. +The default \fIFILELIST\fR is +\fI/usr/lib/rpm/rpmrc\fR:\fI/usr/lib/rpm/vendor/rpmrc\fR:\fI/etc/rpmrc\fR:\fI~/.rpmrc\fR. +.TP +\fB-\-pipe \fICMD\fB\fR +Pipes the output of \fBrpm\fR to the command \fICMD\fR. +.TP +\fB-\-dbpath \fIDIRECTORY\fB\fR +Use the database in \fIDIRECTORY\fR rather +than the default path \fI/var/lib/rpm\fR +.TP +\fB-\-root \fIDIRECTORY\fB\fR +Use the file system tree rooted at \fIDIRECTORY\fR for all operations. +Note that this means the database within +\fIDIRECTORY\fR +will be used for dependency checks and any scriptlet(s) (e.g. +\fB%post\fR if installing, or +\fB%prep\fR if building, a package) +will be run after a chroot(2) to +\fIDIRECTORY\fR. +.SS "INSTALL AND UPGRADE OPTIONS" +.PP +The general form of an rpm install command is +.PP +\fBrpm\fR {\fB-i|-\-install\fR} [\fBinstall-options\fR] \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR +.PP +This installs a new package. +.PP +The general form of an rpm upgrade command is +.PP +\fBrpm\fR {\fB-U|-\-upgrade\fR} [\fBinstall-options\fR] \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR +.PP +This upgrades or installs the package currently installed +to a newer version. This is the same as install, except +all other version(s) of the package are removed after the +new package is installed. +.PP +\fBrpm\fR {\fB-F|-\-freshen\fR} [\fBinstall-options\fR] \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR +.PP +This will upgrade packages, but only if an earlier version +currently exists. The \fIPACKAGE_FILE\fR +may be specified as an +\fBftp\fR or +\fBhttp\fR URL, +in which case the package will be downloaded before being +installed. See \fBFTP/HTTP OPTIONS\fR +for information on \fBrpm\fR's internal +\fBftp\fR and +\fBhttp\fR +client support. +.PP +.TP +\fB-\-aid\fR +Add suggested packages to the transaction set when needed. +.TP +\fB-\-allfiles\fR +Installs or upgrades all the missingok files in the package, +regardless if they exist. +.TP +\fB-\-badreloc\fR +Used with \fB-\-relocate\fR, permit relocations on +all file paths, not just those \fIOLDPATH\fR's +included in the binary package relocation hint(s). +.TP +\fB-\-excludepath \fIOLDPATH\fB\fR +Don't install files whose name begins with +\fIOLDPATH\fR. +.TP +\fB-\-excludedocs\fR +Don't install any files which are marked as documentation +(which includes man pages and texinfo documents). +.TP +\fB-\-force\fR +Same as using +\fB-\-replacepkgs\fR, +\fB-\-replacefiles\fR, and +\fB-\-oldpackage\fR. +.TP +\fB-h, -\-hash\fR +Print 50 hash marks as the package archive is unpacked. +Use with \fB-v|-\-verbose\fR for a nicer display. +.TP +\fB-\-ignoresize\fR +Don't check mount file systems for sufficient disk space before +installing this package. +.TP +\fB-\-ignorearch\fR +Allow installation or upgrading even if the architectures +of the binary package and host don't match. +.TP +\fB-\-ignoreos\fR +Allow installation or upgrading even if the operating +systems of the binary package and host don't match. +.TP +\fB-\-includedocs\fR +Install documentation files. This is the default behavior. +.TP +\fB-\-justdb\fR +Update only the database, not the filesystem. +.TP +\fB-\-nodigest\fR +Don't verify package or header digests when reading. +.TP +\fB-\-nosignature\fR +Don't verify package or header signatures when reading. +.TP +\fB-\-nodeps\fR +Don't do a dependency check before installing or upgrading +a package. +.TP +\fB-\-nosuggest\fR +Don't suggest package(s) that provide a missing dependency. +.TP +\fB-\-noorder\fR +Don't reorder the packages for an install. The list of +packages would normally be reordered to satisfy dependencies. +.TP +\fB-\-noscripts\fR +.TP +\fB-\-nopre\fR +.TP +\fB-\-nopost\fR +.TP +\fB-\-nopreun\fR +.TP +\fB-\-nopostun\fR +Don't execute the scriptlet of the same name. +The \fB-\-noscripts\fR option is equivalent to + +\fB-\-nopre\fR +\fB-\-nopost\fR +\fB-\-nopreun\fR +\fB-\-nopostun\fR + +and turns off the execution of the corresponding +\fB%pre\fR, +\fB%post\fR, +\fB%preun\fR, and +\fB%postun\fR +scriptlet(s). +.TP +\fB-\-notriggers\fR +.TP +\fB-\-notriggerin\fR +.TP +\fB-\-notriggerun\fR +.TP +\fB-\-notriggerpostun\fR +Don't execute any trigger scriptlet of the named type. +The \fB-\-notriggers\fR option is equivalent to + +\fB-\-notriggerin\fR +\fB-\-notriggerun\fR +\fB-\-notriggerpostun\fR + +and turns off execution of the corresponding +\fB%triggerin\fR, +\fB%triggerun\fR, and +\fB%triggerpostun\fR +scriptlet(s). +.TP +\fB-\-oldpackage\fR +Allow an upgrade to replace a newer package with an older one. +.TP +\fB-\-percent\fR +Print percentages as files are unpacked from the package archive. +This is intended to make \fBrpm\fR easy to run from +other tools. +.TP +\fB-\-prefix \fINEWPATH\fB\fR +For relocatable binary packages, translate all file paths that +start with the installation prefix in the package relocation hint(s) +to \fINEWPATH\fR. +.TP +\fB-\-relocate \fIOLDPATH\fB=\fINEWPATH\fB\fR +For relocatable binary packages, translate all file paths +that start with \fIOLDPATH\fR in the +package relocation hint(s) to \fINEWPATH\fR. +This option can be used repeatedly if several +\fIOLDPATH\fR's in the package are to +be relocated. +.TP +\fB-\-repackage\fR +Re-package the files before erasing. The previously installed +package will be named according to the macro +\fB%_repackage_name_fmt\fR +and will be created in the directory named by +the macro \fB%_repackage_dir\fR (default value +is \fI/var/spool/repackage\fR). +.TP +\fB-\-replacefiles\fR +Install the packages even if they replace files from other, +already installed, packages. +.TP +\fB-\-replacepkgs\fR +Install the packages even if some of them are already installed +on this system. +.TP +\fB-\-test\fR +Do not install the package, simply check for and report +potential conflicts. +.SS "ERASE OPTIONS" +.PP +The general form of an rpm erase command is +.PP +\fBrpm\fR {\fB-e|-\-erase\fR} [\fB-\-allmatches\fR] [\fB-\-nodeps\fR] [\fB-\-noscripts\fR] [\fB--notriggers\fR] [\fB--repackage\fR] [\fB--test\fR] \fB\fIPACKAGE_NAME\fB\fR\fI ...\fR +.PP +The following options may also be used: +.TP +\fB-\-allmatches\fR +Remove all versions of the package which match +\fIPACKAGE_NAME\fR. Normally an +error is issued if \fIPACKAGE_NAME\fR +matches multiple packages. +.TP +\fB-\-nodeps\fR +Don't check dependencies before uninstalling the packages. +.TP +\fB-\-noscripts\fR +.TP +\fB-\-nopreun\fR +.TP +\fB-\-nopostun\fR +Don't execute the scriptlet of the same name. +The \fB-\-noscripts\fR option during package erase is +equivalent to + +\fB-\-nopreun\fR +\fB-\-nopostun\fR + +and turns off the execution of the corresponding +\fB%preun\fR, and +\fB%postun\fR +scriptlet(s). +.TP +\fB-\-notriggers\fR +.TP +\fB-\-notriggerun\fR +.TP +\fB-\-notriggerpostun\fR +Don't execute any trigger scriptlet of the named type. +The \fB-\-notriggers\fR option is equivalent to + +\fB-\-notriggerun\fR +\fB-\-notriggerpostun\fR + +and turns off execution of the corresponding +\fB%triggerun\fR, and +\fB%triggerpostun\fR +scriptlet(s). +.TP +\fB-\-repackage\fR +Re-package the files before erasing. The previously installed +package will be named according to the macro +\fB%_repackage_name_fmt\fR +and will be created in the directory named by +the macro \fB%_repackage_dir\fR (default value +is \fI/var/spool/repackage\fR). +.TP +\fB-\-test\fR +Don't really uninstall anything, just go through the motions. +Useful in conjunction with the \fB-vv\fR option +for debugging. +.SS "QUERY OPTIONS" +.PP +The general form of an rpm query command is +.PP +\fBrpm\fR {\fB-q|-\-query\fR} [\fBselect-options\fR] [\fBquery-options\fR] +.PP +You may specify the format that package information should be +printed in. To do this, you use the + + \fB-\-qf|-\-queryformat\fR \fB\fIQUERYFMT\fB\fR + +option, followed by the \fIQUERYFMT\fR +format string. Query formats are modified versions of the +standard \fBprintf(3)\fR formatting. The format +is made up of static strings (which may include standard C +character escapes for newlines, tabs, and other special +characters) and \fBprintf(3)\fR type formatters. +As \fBrpm\fR already knows the type to print, the +type specifier must be omitted however, and replaced by the name +of the header tag to be printed, enclosed by \fB{}\fR +characters. Tag names are case insensitive, and the leading +\fBRPMTAG_\fR portion of the tag name may be omitted +as well. +.PP +Alternate output formats may be requested by following +the tag with \fB:\fItypetag\fB\fR. +Currently, the following types are supported: +.TP +\fB:armor\fR + +Wrap a public key in ASCII armor. +.TP +\fB:base64\fR +Encode binary data using base64. +.TP +\fB:date\fR +Use strftime(3) "%c" format. +.TP +\fB:day\fR +Use strftime(3) "%a %b %d %Y" format. +.TP +\fB:depflags\fR +Format dependency flags. +.TP +\fB:fflags\fR +Format file flags. +.TP +\fB:hex\fR +Format in hexadecimal. +.TP +\fB:octal\fR +Format in octal. +.TP +\fB:perms\fR +Format file permissions. +.TP +\fB:shescape\fR +Escape single quotes for use in a script. +.TP +\fB:triggertype\fR +Display trigger suffix. +.PP +For example, to print only the names of the packages queried, +you could use \fB%{NAME}\fR as the format string. +To print the packages name and distribution information in +two columns, you could use \fB%-30{NAME}%{DISTRIBUTION}\fR. +\fBrpm\fR will print a list of all of the tags it knows about when it +is invoked with the \fB-\-querytags\fR argument. +.PP +There are two subsets of options for querying: package selection, +and information selection. +.SS "PACKAGE SELECTION OPTIONS:" +.PP +.TP +\fB\fIPACKAGE_NAME\fB\fR +Query installed package named \fIPACKAGE_NAME\fR. +.TP +\fB-a, -\-all\fR +Query all installed packages. +.TP +\fB-f, -\-file \fIFILE\fB\fR +Query package owning \fIFILE\fR. +.TP +\fB-\-fileid \fIMD5\fB\fR +Query package that contains a given file identifier, i.e. the +\fIMD5\fR digest of the file contents. +.TP +\fB-g, -\-group \fIGROUP\fB\fR +Query packages with the group of \fIGROUP\fR. +.TP +\fB-\-hdrid \fISHA1\fB\fR +Query package that contains a given header identifier, i.e. the +\fISHA1\fR digest of the immutable header region. +.TP +\fB-p, -\-package \fIPACKAGE_FILE\fB\fR +Query an (uninstalled) package \fIPACKAGE_FILE\fR. +The \fIPACKAGE_FILE\fR may be specified +as an \fBftp\fR or \fBhttp\fR style URL, in +which case the package header will be downloaded and queried. +See \fBFTP/HTTP OPTIONS\fR for information on +\fBrpm\fR's internal +\fBftp\fR and +\fBhttp\fR +client support. /--rqThe \fIPACKAGE_FILE\fR argument(s), +if not a binary package, will be interpreted as an ASCII package +manifest. Comments are permitted, starting with a '#', and each +line of a package manifest file may include white space separated +glob expressions, including URL's with remote glob expressions, +that will be expanded to paths that are substituted in place of +the package manifest as additional \fIPACKAGE_FILE\fR +arguments to the query. +.TP +\fB-\-pkgid \fIMD5\fB\fR +Query package that contains a given package identifier, i.e. the +\fIMD5\fR digest of the combined header and +payload contents. +.TP +\fB-\-querybynumber \fIHDRNUM\fB\fR +Query the \fIHDRNUM\fRth database entry +directly; this is useful only for debugging. +.TP +\fB-\-specfile \fISPECFILE\fB\fR +Parse and query \fISPECFILE\fR as if +it were a package. Although not all the information (e.g. file lists) +is available, this type of query permits rpm to be used to extract +information from spec files without having to write a specfile +parser. +.TP +\fB-\-tid \fITID\fB\fR +Query package(s) that have a given \fITID\fR +transaction identifier. A unix time stamp is currently used as a +transaction identifier. All package(s) installed or erased within +a single transaction have a common identifier. +.TP +\fB-\-triggeredby \fIPACKAGE_NAME\fB\fR +Query packages that are triggered by package(s) +\fIPACKAGE_NAME\fR. +.TP +\fB-\-needswhat \fIPACKAGE_NAME\fB\fR +List prerequisite packages of package(s) +\fIPACKAGE_NAME\fR. +.TP +\fB-\-whatprovides \fICAPABILITY\fB\fR +Query all packages that provide the \fICAPABILITY\fR capability. +.TP +\fB-\-whatrequires \fICAPABILITY\fB\fR +Query all packages that require \fICAPABILITY\fR for proper functioning. +.br +Note that this does not return what requires a given package. +A package usually provides multiple capabilities and file-names on which +other packages may depend. To see the complete dependencies +for a capability, use \fB--whatneeds \fICAPABILITY\fB\fR +.SS "PACKAGE QUERY OPTIONS:" +.PP +.TP +\fB-\-changelog\fR +Display change information for the package. +.TP +\fB-c, -\-configfiles\fR +List only configuration files (implies \fB-l\fR). +.TP +\fB-d, -\-docfiles\fR +List only documentation files (implies \fB-l\fR). +.TP +\fB-\-dump\fR +Dump file information as follows: +.sp +.RS + +.nf +path size mtime md5sum mode owner group isconfig isdoc rdev symlink + +.fi +.RE + +This option must be used with at least one of +\fB-l\fR, +\fB-c\fR, +\fB-d\fR. +.TP +\fB-\-filesbypkg\fR +List all the files in each selected package. +.TP +\fB-i, -\-info\fR +Display package information, including name, version, and description. +This uses the \fB-\-queryformat\fR if one was specified. +.TP +\fB-\-last\fR +Orders the package listing by install time such that the latest +packages are at the top. +.TP +\fB-l, -\-list\fR +List files in package. +.TP +\fB-\-provides\fR +List capabilities this package provides. +.TP +\fB-R, -\-requires\fR +List capabilities on which this package depends. +.TP +\fB-\-scripts\fR +List the package specific scriptlet(s) that are used as part +of the installation and uninstallation processes. +.TP +\fB-s, -\-state\fR +Display the \fIstates\fR of files in the package +(implies \fB-l\fR). The state of each file is one of +\fInormal\fR, +\fInot installed\fR, or +\fIreplaced\fR. +.TP +\fB-\-triggers, -\-triggerscripts\fR +Display the trigger scripts, if any, which are contained in +the package. +.SS "VERIFY OPTIONS" +.PP +The general form of an rpm verify command is +.PP +\fBrpm\fR {\fB-V|-\-verify\fR} [\fBselect-options\fR] [\fBverify-options\fR] +.PP +Verifying a package compares information about the installed files in +the package with information about the files taken from the package +metadata stored in the rpm database. Among other things, verifying +compares the size, MD5 sum, permissions, type, owner and group of +each file. Any discrepancies are displayed. +Files that were not installed from the package, for example, +documentation files excluded on installation using the +"\fB-\-excludedocs\fR" option, +will be silently ignored. +.PP +The package selection options are the same as for package +querying (including package manifest files as arguments). +Other options unique to verify mode are: +.TP +\fB-\-nodeps\fR +Don't verify dependencies of packages. +.TP +\fB-\-nodigest\fR +Don't verify package or header digests when reading. +.TP +\fB-\-nofiles\fR +Don't verify any attributes of package files. +.TP +\fB-\-noscripts\fR +Don't execute the \fB%verifyscript\fR scriptlet (if any). +.TP +\fB-\-nosignature\fR +Don't verify package or header signatures when reading. +.TP +\fB-\-nolinkto\fR +.TP +\fB-\-nomd5\fR +.TP +\fB-\-nosize\fR +.TP +\fB-\-nouser\fR +.TP +\fB-\-nogroup\fR +.TP +\fB-\-nomtime\fR +.TP +\fB-\-nomode\fR +.TP +\fB-\-nordev\fR +Don't verify the corresponding file attribute. +.PP +The format of the output is a string of 8 characters, a possible +attribute marker: + +.nf +\fBc\fR \fB%config\fR configuration file. +\fBd\fR \fB%doc\fR documentation file. +\fBg\fR \fB%ghost\fR file (i.e. the file contents are not included in the package payload). +\fBl\fR \fB%license\fR license file. +\fBr\fR \fB%readme\fR readme file. +.fi + +from the package header, followed by the file name. +Each of the 8 characters denotes the result of a comparison of +attribute(s) of the file to the value of those attribute(s) recorded +in the database. A single +"\fB.\fR" (period) +means the test passed, while a single +"\fB?\fR" (question mark) +indicates the test could not be performed (e.g. file permissions +prevent reading). Otherwise, the (mnemonically +em\fBB\fRoldened) character denotes failure of +the corresponding \fB-\-verify\fR test: + +.nf +\fBS\fR file \fBS\fRize differs +\fBM\fR \fBM\fRode differs (includes permissions and file type) +\fB5\fR MD\fB5\fR sum differs +\fBD\fR \fBD\fRevice major/minor number mismatch +\fBL\fR read\fBL\fRink(2) path mismatch +\fBU\fR \fBU\fRser ownership differs +\fBG\fR \fBG\fRroup ownership differs +\fBT\fR m\fBT\fRime differs +.fi + +.SS "DIGITAL SIGNATURE AND DIGEST VERIFICATION" +.PP +The general forms of rpm digital signature commands are +.PP +\fBrpm\fR \fB-\-import\fR \fB\fIPUBKEY\fB\fR\fI ...\fR + +\fBrpm\fR {\fB-\-checksig\fR} [\fB-\-nosignature\fR] [\fB-\-nodigest\fR] + \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR +.PP +The \fB-\-checksig\fR option checks all the digests and signatures contained in +\fIPACKAGE_FILE\fR to ensure +the integrity and origin of the package. Note that +signatures are now verified whenever a package is read, +and \fB-\-checksig\fR is useful to verify +all of the digests and signatures associated with a package. +.PP +Digital signatures cannot be verified without a public key. +An ASCII armored public key can be added to the \fBrpm\fR database +using \fB-\-import\fR. An imported public key is +carried in a header, and key ring management is performed +exactly like package management. For example, all currently imported +public keys can be displayed by: +.PP +\fBrpm -qa gpg-pubkey*\fR +.PP +Details about a specific public key, when imported, can be displayed +by querying. Here's information about the Red Hat GPG/DSA key: +.PP +\fBrpm -qi gpg-pubkey-db42a60e\fR +.PP +Finally, public keys can be erased after importing just like +packages. Here's how to remove the Red Hat GPG/DSA key +.PP +\fBrpm -e gpg-pubkey-db42a60e\fR +.SS "SIGNING A PACKAGE" +.PP +\fBrpm\fR \fB-\-addsign|-\-resign\fR \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR +.PP +Both of the \fB-\-addsign\fR and \fB-\-resign\fR +options generate and insert new signatures for each package +\fIPACKAGE_FILE\fR given, replacing any +existing signatures. There are two options for historical reasons, +there is no difference in behavior currently. +.SS "USING GPG TO SIGN PACKAGES" +.PP +In order to sign packages using GPG, \fBrpm\fR +must be configured to run GPG and be able to find a key +ring with the appropriate keys. By default, +\fBrpm\fR uses the same conventions as GPG +to find key rings, namely the \fB$GNUPGHOME\fR environment +variable. If your key rings are not located where GPG expects +them to be, you will need to configure the macro +\fB%_gpg_path\fR +to be the location of the GPG key rings to use. +.PP +For compatibility with older versions of GPG, PGP, and rpm, +only V3 OpenPGP signature packets should be configured. +Either DSA or RSA verification algorithms can be used, but DSA +is preferred. +.PP +If you want to be able to sign packages you create yourself, you +also need to create your own public and secret key pair (see the +GPG manual). You will also need to configure the \fBrpm\fR macros +.TP +\fB%_signature\fR +The signature type. Right now only gpg and pgp are supported. +.TP +\fB%_gpg_name\fR +The name of the "user" whose key you wish to use to sign your packages. +.PP +For example, to be able to use GPG to sign packages as the user +\fI"John Doe "\fR +from the key rings located in \fI/etc/rpm/.gpg\fR +using the executable \fI/usr/bin/gpg\fR you would include +.PP +.nf +%_signature gpg +%_gpg_path /etc/rpm/.gpg +%_gpg_name John Doe +%_gpgbin /usr/bin/gpg +.fi +.PP +in a macro configuration file. Use \fI/etc/rpm/macros\fR +for per-system configuration and \fI~/.rpmmacros\fR +for per-user configuration. +.SS "REBUILD DATABASE OPTIONS" +.PP +The general form of an rpm rebuild database command is +.PP +\fBrpm\fR {\fB-\-rebuilddb\fR} [\fB-v\fR] [\fB-\-dbpath \fIDIRECTORY\fB\fR] [\fB-\-root \fIDIRECTORY\fB\fR] +.PP +Use \fB-\-rebuilddb\fR to rebuild the database indices from +the installed package headers. +.SS "SHOWRC" +.PP +The command +.PP +\fBrpm\fR \fB-\-showrc\fR +.PP +shows the values \fBrpm\fR will use for all of the +options are currently set in +\fIrpmrc\fR and +\fImacros\fR +configuration file(s). +.SS "FTP/HTTP OPTIONS" +.PP +\fBrpm\fR can act as an FTP and/or HTTP client so +that packages can be queried or installed from the internet. +Package files for install, upgrade, and query operations may be +specified as an +\fBftp\fR or +\fBhttp\fR +style URL: +.PP +ftp://USER:PASSWORD@HOST:PORT/path/to/package.rpm +.PP +If the \fB:PASSWORD\fR portion is omitted, the password will be +prompted for (once per user/hostname pair). If both the user and +password are omitted, anonymous \fBftp\fR is used. +In all cases, passive (PASV) \fBftp\fR transfers are +performed. +.PP +\fBrpm\fR allows the following options to be used with +ftp URLs: +.TP +\fB-\-ftpproxy \fIHOST\fB\fR +The host \fIHOST\fR will be used as a proxy server +for all ftp transfers, which allows users to ftp through firewall +machines which use proxy systems. This option may also be specified +by configuring the macro \fB%_ftpproxy\fR. +.TP +\fB-\-ftpport \fIPORT\fB\fR +The TCP \fIPORT\fR number to use for +the ftp connection on the proxy ftp server instead of the default +port. This option may also be specified by configuring the macro +\fB%_ftpport\fR. +.PP +\fBrpm\fR allows the following options to be used with +\fBhttp\fR URLs: +.TP +\fB-\-httpproxy \fIHOST\fB\fR +The host \fIHOST\fR will be used as +a proxy server for all \fBhttp\fR transfers. This +option may also be specified by configuring the macro +\fB%_httpproxy\fR. +.TP +\fB-\-httpport \fIPORT\fB\fR +The TCP \fIPORT\fR number to use for the +\fBhttp\fR connection on the proxy http server instead +of the default port. This option may also be specified by configuring +the macro \fB%_httpport\fR. +.SH "LEGACY ISSUES" +.SS "Executing rpmbuild" +.PP +The build modes of rpm are now resident in the +\fI/usr/bin/rpmbuild\fR +executable. Although legacy compatibility provided by the popt aliases +below has been adequate, the compatibility is not perfect; hence build +mode compatibility through popt aliases is being removed from rpm. +Install the package containing \fBrpmbuild\fR (usually \fBrpm-build\fR) and see +\fBrpmbuild\fR(8) for documentation of all the +\fBrpm\fR build modes previously documented here in +\fBrpm\fR(8). +.PP +Add the following lines to \fI/etc/popt\fR +if you wish to continue invoking \fBrpmbuild\fR from +the \fBrpm\fR command line: +.PP +.nf +rpm exec -\-bp rpmb \-bp +rpm exec -\-bc rpmb \-bc +rpm exec -\-bi rpmb \-bi +rpm exec -\-bl rpmb \-bl +rpm exec -\-ba rpmb \-ba +rpm exec -\-bb rpmb \-bb +rpm exec -\-bs rpmb \-bs +rpm exec -\-tp rpmb \-tp +rpm exec -\-tc rpmb \-tc +rpm exec -\-ti rpmb \-ti +rpm exec -\-tl rpmb \-tl +rpm exec -\-ta rpmb \-ta +rpm exec -\-tb rpmb \-tb +rpm exec -\-ts rpmb \-ts +rpm exec -\-rebuild rpmb -\-rebuild +rpm exec -\-recompile rpmb -\-recompile +rpm exec -\-clean rpmb -\-clean +rpm exec -\-rmsource rpmb -\-rmsource +rpm exec -\-rmspec rpmb -\-rmspec +rpm exec -\-target rpmb -\-target +rpm exec -\-short-circuit rpmb -\-short-circuit +.fi +.SH "FILES" +.SS "rpmrc Configuration" +.PP +.nf +\fI/usr/lib/rpm/rpmrc\fR +\fI/usr/lib/rpm/vendor/rpmrc\fR +\fI/etc/rpmrc\fR +\fI~/.rpmrc\fR +.fi +.SS "Macro Configuration" +.PP +.nf +\fI/usr/lib/rpm/macros\fR +\fI/usr/lib/rpm/vendor/macros\fR +\fI/etc/rpm/macros\fR +\fI~/.rpmmacros\fR +.fi +.SS "Database" +.PP +.nf +\fI/var/lib/rpm/Basenames\fR +\fI/var/lib/rpm/Conflictname\fR +\fI/var/lib/rpm/Dirnames\fR +\fI/var/lib/rpm/Filemd5s\fR +\fI/var/lib/rpm/Group\fR +\fI/var/lib/rpm/Installtid\fR +\fI/var/lib/rpm/Name\fR +\fI/var/lib/rpm/Packages\fR +\fI/var/lib/rpm/Providename\fR +\fI/var/lib/rpm/Provideversion\fR +\fI/var/lib/rpm/Pubkeys\fR +\fI/var/lib/rpm/Removed\fR +\fI/var/lib/rpm/Requirename\fR +\fI/var/lib/rpm/Requireversion\fR +\fI/var/lib/rpm/Sha1header\fR +\fI/var/lib/rpm/Sigmd5\fR +\fI/var/lib/rpm/Triggername\fR +.fi +.SS "Temporary" +.PP +\fI/var/tmp/rpm*\fR +.SH "SEE ALSO" + +.nf +\fBpopt\fR(3), +\fBrpm2cpio\fR(8), +\fBrpmbuild\fR(8), +.fi + +\fBhttp://rpm5.org/ +\fR +.SH "AUTHORS" + +.nf +Jeff Johnson +Marc Ewing +Erik Troan +.fi diff --git a/rpm-5.4.9/doc/rpm2cpio.8 b/rpm-5.4.9/doc/rpm2cpio.8 new file mode 100644 index 0000000..4d6a408 --- /dev/null +++ b/rpm-5.4.9/doc/rpm2cpio.8 @@ -0,0 +1,21 @@ +.\" rpm2cpio - Converts Red Hat Package (RPM) to cpio archive +.TH rpm2cpio 8 "11 January 2001" "rpm5.org" "RPM Package Manager" +.SH NAME +rpm2cpio \- Extract cpio archive from RPM Package Manager (RPM) package. +.SH SYNOPSIS +\fBrpm2cpio\fP [filename] +.SH DESCRIPTION +\fBrpm2cpio\fP converts the .rpm file specified as a single argument +to a cpio archive on standard out. If a '\-' argument is given, an rpm stream +is read from standard in. + +.br +.I "\fBrpm2cpio rpm-1.1-1.i386.rpm | cpio -dim\fP" +.br +.I "\fBrpm2cpio - < glint-1.0-1.i386.rpm | cpio -dim\fP" +.SH SEE ALSO +.IR rpm (8) +.SH AUTHOR +.nf +Erik Troan +.fi diff --git a/rpm-5.4.9/doc/rpmbuild.8 b/rpm-5.4.9/doc/rpmbuild.8 new file mode 100644 index 0000000..d99a173 --- /dev/null +++ b/rpm-5.4.9/doc/rpmbuild.8 @@ -0,0 +1,252 @@ +.\" This manpage has been automatically generated by docbook2man +.\" from a DocBook document. This tool can be found at: +.\" +.\" Please send any bug reports, improvements, comments, patches, +.\" etc. to Steve Cheng . +.TH "RPMBUILD" "8" "09 June 2002" "rpm5.org" "RPM Package Manager" +.SH NAME +rpmbuild \- Build RPM Package(s) +.SH SYNOPSIS +.SS "BUILDING PACKAGES:" +.PP +\fBrpmbuild\fR {\fB-ba|-bb|-bp|-bc|-bi|-bl|-bs\fR} [\fBrpmbuild-options\fR] \fB\fISPECFILE\fB\fR\fI ...\fR + +\fBrpmbuild\fR {\fB-ta|-tb|-tp|-tc|-ti|-tl|-ts\fR} [\fBrpmbuild-options\fR] \fB\fITARBALL\fB\fR\fI ...\fR + +\fBrpmbuild\fR {\fB--rebuild|--recompile\fR} \fB\fISOURCEPKG\fB\fR\fI ...\fR +.SS "MISCELLANEOUS:" +.PP +\fBrpmbuild\fR \fB--showrc\fR +.SS "rpmbuild-options" +.PP + [\fB--buildroot \fIDIRECTORY\fB\fR] [\fB--clean\fR] [\fB--nobuild\fR] + [\fB--rmsource\fR] [\fB--rmspec\fR] [\fB--short-circuit\fR] [\fB--sign\fR] + [\fB--target \fIPLATFORM\fB\fR] +.SH "DESCRIPTION" +.PP +\fBrpmbuild\fR is used to build both binary and source software packages. +A \fBpackage\fR consists of an archive of files and +meta-data used to install and erase the archive files. The meta-data +includes helper scripts, file attributes, and descriptive information +about the package. +\fBPackages\fR come in two varieties: binary packages, +used to encapsulate software to be installed, and source packages, +containing the source code and recipe necessary to produce binary +packages. +.PP +One of the following basic modes must be selected: +\fBBuild Package\fR, +\fBBuild Package from Tarball\fR, +\fBRecompile Package\fR, +\fBShow Configuration\fR. +.SS "GENERAL OPTIONS" +.PP +These options can be used in all the different modes. +.TP +\fB-?, --help\fR +Print a longer usage message then normal. +.TP +\fB--version\fR +Print a single line containing the version number of \fBrpm\fR +being used. +.TP +\fB--quiet\fR +Print as little as possible - normally only error messages will +be displayed. +.TP +\fB-v\fR +Print verbose information - normally routine progress messages will be +displayed. +.TP +\fB-vv\fR +Print lots of ugly debugging information. +.TP +\fB--rcfile \fIFILELIST\fB\fR +Each of the files in the colon separated +\fIFILELIST\fR +is read sequentially by \fBrpm\fR for configuration +information. +Only the first file in the list must exist, and tildes will be +expanded to the value of \fB$HOME\fR. +The default \fIFILELIST\fR is +\fI/usr/lib/rpm/rpmrc\fR:\fI/usr/lib/rpm/vendor/rpmrc\fR:\fI/etc/rpmrc\fR:\fI~/.rpmrc\fR. +.TP +\fB--pipe \fICMD\fB\fR +Pipes the output of \fBrpm\fR to the command \fICMD\fR. +.TP +\fB--dbpath \fIDIRECTORY\fB\fR +Use the database in \fIDIRECTORY\fR rather +than the default path \fI/var/lib/rpm\fR +.TP +\fB--root \fIDIRECTORY\fB\fR +Use the file system tree rooted at \fIDIRECTORY\fR for all operations. +Note that this means the database within +\fIDIRECTORY\fR +will be used for dependency checks and any scriptlet(s) (e.g. +\fB%post\fR if installing, or +\fB%prep\fR if building, a package) +will be run after a chroot(2) to +\fIDIRECTORY\fR. +.SS "BUILD OPTIONS" +.PP +The general form of an rpm build command is +.PP +\fBrpmbuild\fR \fB-b\fISTAGE\fB|-t\fISTAGE\fB\fR [\fBrpmbuild-options\fR] \fB\fIFILE\fB\fR\fI ...\fR +.PP +The argument used is \fB-b\fR if a spec file is being +used to build the package and \fB-t\fR if \fBrpmbuild\fR +should look inside of a (possibly compressed) tar file for +the spec file to use. After the first argument, the next +character (\fISTAGE\fR) specifies the stages +of building and packaging to be done and is one of: +.TP +\fB-ba\fR +Build binary and source packages (after doing the %prep, %build, and +%install stages). +.TP +\fB-bb\fR +Build a binary package (after doing the %prep, %build, and %install +stages). +.TP +\fB-bp\fR +Executes the "%prep" stage from the spec file. Normally this +involves unpacking the sources and applying any patches. +.TP +\fB-bc\fR +Do the "%build" stage from the spec file (after doing the %prep stage). +This generally involves the equivalent of a "make". +.TP +\fB-bi\fR +Do the "%install" stage from the spec file (after doing the %prep and +%build stages). This generally involves the equivalent of a +"make install". +.TP +\fB-bl\fR +Do a "list check". The "%files" section from the spec file is +macro expanded, and checks are made to verify that each file +exists. +.TP +\fB-bs\fR +Build just the source package. +.PP +The following options may also be used: +.TP +\fB--buildroot \fIDIRECTORY\fB\fR +When building a package, override the BuildRoot tag with directory +\fIDIRECTORY\fR. +.TP +\fB--clean\fR +Remove the build tree after the packages are made. +.TP +\fB--nobuild\fR +Do not execute any build stages. Useful for testing out spec files. +.TP +\fB--rmsource\fR +Remove the sources after the build (may also be +used standalone, e.g. "\fBrpmbuild\fR \fB--rmsource foo.spec\fR"). +.TP +\fB--rmspec\fR +Remove the spec file after the build (may also be +used standalone, eg. "\fBrpmbuild\fR \fB--rmspec foo.spec\fR"). +.TP +\fB--short-circuit\fR +Skip straight to specified stage (i.e., skip all stages leading +up to the specified stage). Only valid with \fB-bc\fR +and \fB-bi\fR. +.TP +\fB--sign\fR +Embed a GPG signature in the package. This signature can be used +to verify the integrity and the origin of the package. See the +section on GPG SIGNATURES in +\fBrpm\fR(8) +for configuration details. +.TP +\fB--target \fIPLATFORM\fB\fR +When building the package, interpret \fIPLATFORM\fR +as \fBarch-vendor-os\fR and set the macros +\fB%_target\fR, +\fB%_target_cpu\fR, and +\fB%_target_os\fR +accordingly. +.SS "REBUILD AND RECOMPILE OPTIONS" +.PP +There are two other ways to invoke building with rpm: +.PP +\fBrpmbuild\fR \fB--rebuild|--recompile\fR \fB\fISOURCEPKG\fB\fR\fI ...\fR +.PP +When invoked this way, \fBrpmbuild\fR installs the named source +package, and does a prep, compile and install. In addition, +\fB--rebuild\fR builds a new binary package. When the build +has completed, the build directory is removed (as in +\fB--clean\fR) and the the sources and spec file for +the package are removed. +.SS "SHOWRC" +.PP +The command +.PP +\fBrpmbuild\fR \fB--showrc\fR +.PP +shows the values \fBrpmbuild\fR will use for all of the +options are currently set in +\fIrpmrc\fR and +\fImacros\fR +configuration file(s). +.SH "FILES" +.SS "rpmrc Configuration" +.PP +.nf +\fI/usr/lib/rpm/rpmrc\fR +\fI/usr/lib/rpm/vendor/rpmrc\fR +\fI/etc/rpmrc\fR +\fI~/.rpmrc\fR +.fi +.SS "Macro Configuration" +.PP +.nf +\fI/usr/lib/rpm/macros\fR +\fI/usr/lib/rpm/vendor/macros\fR +\fI/etc/rpm/macros\fR +\fI~/.rpmmacros\fR +.fi +.SS "Database" +.PP +.nf +\fI/var/lib/rpm/Basenames\fR +\fI/var/lib/rpm/Conflictname\fR +\fI/var/lib/rpm/Dirnames\fR +\fI/var/lib/rpm/Filemd5s\fR +\fI/var/lib/rpm/Group\fR +\fI/var/lib/rpm/Installtid\fR +\fI/var/lib/rpm/Name\fR +\fI/var/lib/rpm/Packages\fR +\fI/var/lib/rpm/Providename\fR +\fI/var/lib/rpm/Provideversion\fR +\fI/var/lib/rpm/Pubkeys\fR +\fI/var/lib/rpm/Removed\fR +\fI/var/lib/rpm/Requirename\fR +\fI/var/lib/rpm/Requireversion\fR +\fI/var/lib/rpm/Sha1header\fR +\fI/var/lib/rpm/Sigmd5\fR +\fI/var/lib/rpm/Triggername\fR +.fi +.SS "Temporary" +.PP +\fI/var/tmp/rpm*\fR +.SH "SEE ALSO" + +.nf +\fBpopt\fR(3), +\fBrpm2cpio\fR(8), +\fBgendiff\fR(1), +\fBrpm\fR(8), +.fi + +\fBhttp://rpm5.org/ +\fR +.SH "AUTHORS" + +.nf +Jeff Johnson +Marc Ewing +Erik Troan +.fi diff --git a/rpm-5.4.9/doc/rpmcache.8 b/rpm-5.4.9/doc/rpmcache.8 new file mode 100644 index 0000000..00f0b37 --- /dev/null +++ b/rpm-5.4.9/doc/rpmcache.8 @@ -0,0 +1,117 @@ +.\" This manpage has been automatically generated by docbook2man +.\" from a DocBook document. This tool can be found at: +.\" +.\" Please send any bug reports, improvements, comments, patches, +.\" etc. to Steve Cheng . +.TH "RPMCACHE" "8" "05 July 2002" "rpm5.org" "RPM Package Manager" +.SH NAME +rpmcache \- Cache RPM Package Headers +.SH SYNOPSIS +.PP +\fBrpmcache\fR [ \fB\fIPACKAGE_NAME\fB\fR\fI ...\fR ] +.SH "DESCRIPTION" +.PP +\fBrpmcache\fR walks a file tree, possibly remotely using +\fBFTP\fR, filtering paths using +\fBglob\fR(7) expressions, reading +rpm package headers. The latest (i.e. comparing +package epoch/version/release for identical package +names and using the build time as a tie breaker) package +headers, if they are unique, are cached in an rpm database. +The rpm database cache can be used to provide suggested +paths to packages that resolve unknown dependencies. +.PP +There are no \fBrpmcache\fR specific options, only common \fBrpm\fR options. +See the \fBrpmcache\fR usage message for what is currently implemented. +.PP +The file tree path to be searched is configured using rpm +macros. The final path is the concatenation of 5 individual +elements. Here are the macro names used to configure \fBrpmcache\fR, in +the same order that they will be concatenated to build the +file tree path that will be walked: +.PP +.TP +\fB%_bhpath\fR +The "path" level contains the leading part of the file tree path +(or URL) for the file tree to be walked. +No \fBglob\fR(7) expressions, here, please. +.TP +\fB%_bhcoll\fR +The "collection" level contains a string (or +\fBglob\fR(7) expression) to match sub-directories of +\fB%_bhpath\fR. +.TP +\fB%_bhN\fR +The "name" level contains a string (or +\fBglob\fR(7) expression) to match sub-directories of +\fB%_bhcoll\fR. +The \fIPACKAGE_NAME\fR +arguments are used to construct a \fBglob\fR(7) +expression that will match any of specific package names within +the Red Hat build system, and are almost certainly not of use to +anyone outside of Red Hat. +.TP +\fB%_bhVR\fR +The "version-release" level contains a string (or +\fBglob\fR(7) expression) to match sub-directories of +\fB%_bhN\fR. +.TP +\fB%_bhA\fR +The "arch" level contains a string (or +\fBglob\fR(7) expression) to match sub-directories of +\fB%_bhVR\fR. +.PP +The location of the cache database is also configured using +an rpm macro: +.TP +\fB%_cache_dbpath\fR +The location of the cache database. The default value is +\fI/var/spool/up2date/cache\fR. +.PP +The cache database is identical in format to an rpm database, +and can be used with \fBrpm\fR from the command line. For example, +to use the cache database to provide suggestions for packages +that provide dependencies needed by a package install, the following +macro should be configured in either +\fI/etc/rpm/macros\fR or +\fI~/.rpmmacros\fR: +.TP +\fB%_solve_dbpath\fR +The location of the database that is used to provide +suggested dependency resolutions. +.PP +.SS "Example (minimal) configuration for a Red Hat beehive tree:" +.PP +.nf +%_cache_dbpath /var/spool/up2date/cache +%_solve_dbpath %{_cache_dbpath} +%_bhpath file://localhost/mnt/rpm/beehive/comps/dist +%_bhcoll 7.3 +%_bhN @(basesystem|bash|filesystem|glibc-common|glibc|ldconfig|libtermcap|mktemp|setup|termcap) +%_bhVR * +%_bhA @(i[3456]86|noarch) +.fi +.SS "Example (minimal) configuration for a Red Hat FTP tree:" +.PP +.nf +%_cache_dbpath /var/spool/up2date/cache +%_solve_dbpath %{_cache_dbpath} +%_bhpath ftp://localhost/mnt/dist +%_bhcoll @(7.3|7.2|7.1|7.0|6.2|6.1|6.0|5.2|5.1|5.0) +%_bhN @(%{_arch}) +%_bhVR * +%_bhA @(i[3456]86|noarch) +.fi +.SH "BUGS" +.PP +Yup. Please file bug reports and RFE's against the rpm-devel package +using bugzilla: +http://bugzilla.redhat.com/ +.SH "SEE ALSO" +\fBrpm\fR(8), +\fBglob\fR(7), + +\fBhttp://rpm5.org/ +\fR +.SH "AUTHORS" +Jeff Johnson diff --git a/rpm-5.4.9/doc/rpmconstant.8 b/rpm-5.4.9/doc/rpmconstant.8 new file mode 100644 index 0000000..c34804d --- /dev/null +++ b/rpm-5.4.9/doc/rpmconstant.8 @@ -0,0 +1,14 @@ +.\" rpmconstant - provides RPM API constants +.TH rpmconstant 8 "21 July 2007" "rpm5.org" "RPM Package Manager" +.SH NAME +rpmconstant \- Provides RPM API constants. +.SH SYNOPSIS +\fBrpmconstant\fP [OPTION...] +.SH DESCRIPTION +\fBrpmconstant\fP provides RPM API constants (usually to language bindings). +.SH SEE ALSO +.IR rpm (8) +.SH AUTHOR +.nf +Nanar +.fi diff --git a/rpm-5.4.9/doc/rpmdeps.8 b/rpm-5.4.9/doc/rpmdeps.8 new file mode 100644 index 0000000..6f5ae4d --- /dev/null +++ b/rpm-5.4.9/doc/rpmdeps.8 @@ -0,0 +1,24 @@ +.\" This manpage has been automatically generated by docbook2man +.\" from a DocBook document. This tool can be found at: +.\" +.\" Please send any bug reports, improvements, comments, patches, +.\" etc. to Steve Cheng . +.TH "RPMDEPS" "8" "24 October 2002" "Red Hat, Inc." "Red Hat Linux" +.SH NAME +rpmdeps \- Generate RPM Package Dependencies +.SH SYNOPSIS +.PP +\fBrpmdeps\fR \fB{-P|--provides}\fR \fB{-R|--requires}\fR \fB\fIFILE\fB\fR\fI ...\fR +.SH "DESCRIPTION" +.PP +\fBrpmdeps\fR generates package dependencies +for the set of \fIFILE\fR arguments. +Each \fIFILE\fR argument is searched for +Elf32/Elf64, script interpreter, or per-script dependencies, +and the dependencies are printed to stdout. +.SH "SEE ALSO" + +\fBrpm\fR(8), +\fBrpmbuild\fR(8), +.SH "AUTHORS" +Jeff Johnson diff --git a/rpm-5.4.9/doc/rpmmtree.8 b/rpm-5.4.9/doc/rpmmtree.8 new file mode 100644 index 0000000..1cfcec5 --- /dev/null +++ b/rpm-5.4.9/doc/rpmmtree.8 @@ -0,0 +1,359 @@ +.\" $OpenBSD: mtree.8,v 1.20 2002/03/09 18:54:19 millert Exp $ +.\" $NetBSD: mtree.8,v 1.4 1995/03/07 21:26:25 cgd Exp $ +.\" +.\" Copyright (c) 1989, 1990, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)mtree.8 8.2 (Berkeley) 12/11/93 +.\" +.Dd December 11, 1993 +.Dt MTREE 8 +.Os +.Sh NAME +.Nm rpmmtree +.Nd map a directory hierarchy +.Sh SYNOPSIS +.Nm rpmmtree +.Op Fl cdeilnqrUux +.Op Fl f Ar spec +.Op Fl K Ar keywords +.Op Fl k Ar keywords +.Op Fl p Ar path +.Op Fl s Ar seed +.Sh DESCRIPTION +The utility +.Nm rpmmtree +compares the file hierarchy rooted in the current directory against a +specification read from the standard input. +Messages are written to the standard output for any files whose +characteristics do not match the specification, or which are +missing from either the file hierarchy or the specification. +.Pp +The options are as follows: +.Bl -tag -width Ds +.It Fl c +Print a specification for the file hierarchy to the standard output. +.It Fl d +Ignore everything except directory type files. +.It Fl e +Don't complain about files that are in the file hierarchy, but not in the +specification. +.It Fl f Ar spec +Read the specification from file +.Ar spec , +instead of from the standard input. +.It Fl i +Indents the output 4 spaces each time a directory level is descended when +create a specification with the +.Fl c +option. +This does not effect either the /set statements or the comment before each +directory. +It does however effect the comment before the close of each directory. +.It Fl K Ar keywords +Add the specified (whitespace or comma separated) keywords to the current +set of keywords. +.It Fl k Ar keywords +Use the +.Dq type +keyword plus the specified (whitespace or comma separated) +keywords instead of the current set of keywords. +.It Fl l +Do +.Dq loose +permissions checks, in which more stringent permissions +will match less stringent ones. +For example, a file marked mode 0444 will pass a check for mode 0644. +.Dq Loose +checks apply only to read, write and execute permissions -- in +particular, if other bits like the sticky bit or suid/sgid bits are +set either in the specification or the file, exact checking will be +performed. +This flag may not be set at the same time as the +.Fl u +or +.Fl U +flags. +.It Fl n +Do not emit pathname comments when creating a specification. +Normally +a comment is emitted before each directory and before the close of that +directory when using the +.Fl c +option. +.It Fl p Ar path +Use the file hierarchy rooted in +.Ar path , +instead of the current directory. +.It Fl q +Quiet mode. +Do not complain when a +.Dq missing +directory can not be created because it is already exists. +This occurs when the directory is a symbolic link. +.It Fl r +Remove any files in the file hierarchy that are not described in the +specification. +.It Fl s Ar seed +Display a single checksum to the standard error output that represents all +of the files for which the keyword +.Cm cksum +was specified. +The checksum is seeded with the specified value. +.It Fl t +If a file's timestamp is different from the specification, +.Dq touch +it to match the specification (and list as modified). +.It Fl U +Modify the owner, group, and permissions of existing files to match +the specification and create any missing directories. +User, group, and permissions must all be specified for missing directories +to be created. +Exit with a status of 0 on success, 1 if any error occurred, +a mismatch is not considered an error if it was corrected. +.It Fl u +Same as the +.Fl U +option except a status of 2 is returned if the file hierarchy +did not match the specification. +.It Fl x +Don't descend below mount points in the file hierarchy. +.El +.Pp +Specifications are mostly composed of +.Dq keywords , +(i.e., strings that specify values relating to files). +No keywords have default values, and if a keyword has no value set, no +checks based on it are performed. +.Pp +Currently supported keywords are as follows: +.Bl -tag -width Cm +.It Cm cksum +The checksum of the file using the default algorithm specified by +the +.Xr cksum 1 +utility. +.It Cm flags +The current file's flags (whitespace or comma separated) in symbolic form +as specified by +.Xr chflags 1 . +The string +.Dq none +may be used to indicate that no flags should be set on the file. +.It Cm gid +The file group as a numeric value. +.It Cm gname +The file group as a symbolic name. +.It Cm ignore +Ignore any file hierarchy below this file. +.It Cm md5digest +The MD5 message digest of the file. +.It Cm mode +The current file's permissions as a numeric (octal) or symbolic +value. +.It Cm nlink +The number of hard links the file is expected to have. +.It Cm nochange +Do not change the attributes (owner, group, mode, etc) on a file or directory. +.It Cm optional +The file is optional; don't complain about the file if it's +not in the file hierarchy. +.It Cm rmd160digest +The RIPEMD-160 message digest of the file. +.It Cm sha1digest +The SHA-1 message digest of the file. +.It Cm uid +The file owner as a numeric value. +.It Cm uname +The file owner as a symbolic name. +.It Cm size +The size, in bytes, of the file. +.It Cm link +The file the symbolic link is expected to reference. +.It Cm time +The last modification time of the file. +.It Cm type +The type of the file; may be set to any one of the following: +.Pp +.Bl -tag -width Cm -compact +.It Cm block +block special device +.It Cm char +character special device +.It Cm dir +directory +.It Cm fifo +fifo +.It Cm file +regular file +.It Cm link +symbolic link +.It Cm socket +socket +.El +.El +.Pp +The default set of keywords are +.Cm gid , +.Cm mode , +.Cm nlink , +.Cm size , +.Cm link , +.Cm time , +and +.Cm uid . +.Pp +There are four types of lines in a specification. +.Pp +The first type of line sets a global value for a keyword, and consists of +the string +.Dq /set +followed by whitespace, followed by sets of keyword/value +pairs, separated by whitespace. +Keyword/value pairs consist of a keyword, followed by an equals sign +.Pq Sq = , +followed by a value, without whitespace characters. +Once a keyword has been set, its value remains unchanged until either +reset or unset. +.Pp +The second type of line unsets keywords and consists of the string +.Dq /unset , +followed by whitespace, followed by one or more keywords, +separated by whitespace. +.Pp +The third type of line is a file specification and consists of a file +name, followed by whitespace, followed by zero or more whitespace +separated keyword/value pairs. +The file name may be preceded by whitespace characters. +The file name may contain any of the standard file name matching +characters +.Po +.Dq [ , +.Dq \&] , +.Dq ? , +or +.Dq \&* +.Pc , +in which case files in the hierarchy will be associated with the first +pattern that they match. +.Pp +Each of the keyword/value pairs consist of a keyword, followed by an +equals sign, followed by the keyword's value, without +whitespace characters. +These values override, without changing, the global value of the +corresponding keyword. +.Pp +All paths are relative. +Specifying a directory will cause subsequent files to be searched +for in that directory hierarchy. +Which brings us to the last type of line in a specification: a line +containing only the string +.Dq Nm \&.. +causes the current directory +path to ascend one level. +.Pp +Empty lines and lines whose first non-whitespace character is a hash +mark +.Pq Sq # +are ignored. +.Pp +The +.Nm rpmmtree +utility exits with a status of 0 on success, 1 if any error occurred, +and 2 if the file hierarchy did not match the specification. +A status of 2 is converted to a status of 0 if the +.Fl U +option is used. +.Sh EXAMPLES +To detect system binaries that have been +.Dq trojan horsed , +it is recommended +that +.Nm rpmmtree +.Fl K +.Cm sha1digest +be run on the file systems, and a copy of the results stored on a different +machine, or, at least, in encrypted form. +The output file itself should be digested using the +.Xr sha1 1 +utility. +Then, periodically, +.Nm rpmmtree +and +.Xr sha1 1 +should be run against the on-line specifications. +While it is possible for the bad guys to change the on-line specifications +to conform to their modified binaries, it is believed to be +impractical for them to create a modified specification which has +the same SHA1 digest as the original. +.Pp +The +.Fl d +and +.Fl u +options can be used in combination to create directory hierarchies +for distributions and other such things; the files in +.Pa /etc/mtree +were used to create almost all directories in a normal binary +distribution. +.Sh FILES +.Bl -tag -width /etc/mtree -compact +.It Pa /etc/mtree +system specification directory +.El +.Sh SEE ALSO +.Xr chgrp 1 , +.Xr chmod 1 , +.Xr cksum 1 , +.Xr md5 1 , +.Xr rmd160 1 , +.Xr sha1 1 , +.Xr stat 2 , +.Xr fts 3 , +.Xr md5 3 , +.Xr rmd160 3 , +.Xr sha1 3 , +.Xr chown 8 +.Sh HISTORY +The +.Nm mtree +utility appeared in +.Bx 4.3 Reno . +The +.Nm rpmmtree +port is based on the OpenBSD +.Nm mtree-2.7 +version, using +.Xr popt 3 +for option processing, and +.Xr rpmio 3 +for digests and remote transport. + diff --git a/rpm-5.4.9/doc/ru/Makefile.am b/rpm-5.4.9/doc/ru/Makefile.am new file mode 100644 index 0000000..b248472 --- /dev/null +++ b/rpm-5.4.9/doc/ru/Makefile.am @@ -0,0 +1,21 @@ +## Process this file with automake to produce Makefile.in + +@SET_MAKE@ + +man_MANS = rpm.8 rpm2cpio.8 +mandir = @mandir@/ru + +EXTRA_DIST = $(man_MANS) + +install-data-hook: +if WITH_PATH_VERSIONED + -for p in $(man_MANS); do \ + case "$$p" in \ + *.1 ) mv $(DESTDIR)$(man1dir)/$${p} \ + `echo "$(DESTDIR)$(man1dir)/$${p}" | sed 's/\.1$$/-$(VERSION).1/'` ;; \ + *.8 ) mv $(DESTDIR)$(man8dir)/$${p} \ + `echo "$(DESTDIR)$(man8dir)/$${p}" | sed 's/\.8$$/-$(VERSION).8/'` ;; \ + esac; \ + done +endif + diff --git a/rpm-5.4.9/doc/ru/Makefile.in b/rpm-5.4.9/doc/ru/Makefile.in new file mode 100644 index 0000000..2cc9d97 --- /dev/null +++ b/rpm-5.4.9/doc/ru/Makefile.in @@ -0,0 +1,820 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +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@ +target_triplet = @target@ +subdir = doc/ru +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +man8dir = $(mandir)/man8 +am__installdirs = "$(DESTDIR)$(man8dir)" +NROFF = nroff +MANS = $(man_MANS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDROOTDIR_MACRO = @BUILDROOTDIR_MACRO@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBAPI = @DBAPI@ +DBLIBOBJS = @DBLIBOBJS@ +DBLIBSRCS = @DBLIBSRCS@ +DBPATH = @DBPATH@ +DBPATH_MACRO = @DBPATH_MACRO@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTRO_MACROS = @DISTRO_MACROS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIXPERMS = @FIXPERMS@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GPSEE_MODULES_PATH = @GPSEE_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_STATIC = @LDFLAGS_STATIC@ +LD_VERSION_SCRIPT_FLAG = @LD_VERSION_SCRIPT_FLAG@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOLIZE = @LIBTOOLIZE@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MACROFILES = @MACROFILES@ +MAGIC_MACRO = @MAGIC_MACRO@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR = @MKDIR@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NCPUS_COMMAND = @NCPUS_COMMAND@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENMP_CFLAGS = @OPENMP_CFLAGS@ +OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_INSTALLDIRS = @PERL_INSTALLDIRS@ +PERL_URPM_INSTALLDIRS = @PERL_URPM_INSTALLDIRS@ +PKGSRCDIR = @PKGSRCDIR@ +PKGSRCDIR_MACRO = @PKGSRCDIR_MACRO@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +ROOT_GROUP = @ROOT_GROUP@ +RPMCANONARCH = @RPMCANONARCH@ +RPMCANONCOLOR = @RPMCANONCOLOR@ +RPMCANONGNU = @RPMCANONGNU@ +RPMCANONOS = @RPMCANONOS@ +RPMCANONVENDOR = @RPMCANONVENDOR@ +RPMGID = @RPMGID@ +RPMGROUP = @RPMGROUP@ +RPMLUAFILES = @RPMLUAFILES@ +RPMPOPTFILES = @RPMPOPTFILES@ +RPMUID = @RPMUID@ +RPMUSER = @RPMUSER@ +RPM_TIMESTAMP = @RPM_TIMESTAMP@ +RPM_VENDOR = @RPM_VENDOR@ +RPM_VERSION = @RPM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFIGDIR = @SYSCONFIGDIR@ +USE_NLS = @USE_NLS@ +USRLIBRPM = @USRLIBRPM@ +VERSION = @VERSION@ +WITH_ACL = @WITH_ACL@ +WITH_APIDOCS = @WITH_APIDOCS@ +WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ +WITH_APR = @WITH_APR@ +WITH_ATERM = @WITH_ATERM@ +WITH_ATTR = @WITH_ATTR@ +WITH_AUGEAS = @WITH_AUGEAS@ +WITH_AUGEAS_AUGTOOL = @WITH_AUGEAS_AUGTOOL@ +WITH_BASH = @WITH_BASH@ +WITH_BASH_CPPFLAGS = @WITH_BASH_CPPFLAGS@ +WITH_BASH_LDFLAGS = @WITH_BASH_LDFLAGS@ +WITH_BASH_LIBS = @WITH_BASH_LIBS@ +WITH_BASH_SUBDIR = @WITH_BASH_SUBDIR@ +WITH_BEECRYPT = @WITH_BEECRYPT@ +WITH_BEECRYPT_CPPFLAGS = @WITH_BEECRYPT_CPPFLAGS@ +WITH_BEECRYPT_LDFLAGS = @WITH_BEECRYPT_LDFLAGS@ +WITH_BEECRYPT_LIBS = @WITH_BEECRYPT_LIBS@ +WITH_BEECRYPT_SUBDIR = @WITH_BEECRYPT_SUBDIR@ +WITH_BZIP2 = @WITH_BZIP2@ +WITH_CPUINFO = @WITH_CPUINFO@ +WITH_CUDF = @WITH_CUDF@ +WITH_CUDF_CUDFTOOL = @WITH_CUDF_CUDFTOOL@ +WITH_DB = @WITH_DB@ +WITH_DBSQL = @WITH_DBSQL@ +WITH_DBSQL_CPPFLAGS = @WITH_DBSQL_CPPFLAGS@ +WITH_DBSQL_LDFLAGS = @WITH_DBSQL_LDFLAGS@ +WITH_DBSQL_LIBS = @WITH_DBSQL_LIBS@ +WITH_DBSQL_SUBDIR = @WITH_DBSQL_SUBDIR@ +WITH_DB_CPPFLAGS = @WITH_DB_CPPFLAGS@ +WITH_DB_LDFLAGS = @WITH_DB_LDFLAGS@ +WITH_DB_LIBS = @WITH_DB_LIBS@ +WITH_DB_SUBDIR = @WITH_DB_SUBDIR@ +WITH_DMALLOC = @WITH_DMALLOC@ +WITH_EFENCE = @WITH_EFENCE@ +WITH_EXPAT = @WITH_EXPAT@ +WITH_FICL = @WITH_FICL@ +WITH_FICL_CPPFLAGS = @WITH_FICL_CPPFLAGS@ +WITH_FICL_LDFLAGS = @WITH_FICL_LDFLAGS@ +WITH_FICL_LIBS = @WITH_FICL_LIBS@ +WITH_FICL_SUBDIR = @WITH_FICL_SUBDIR@ +WITH_FILE = @WITH_FILE@ +WITH_FILE_CPPFLAGS = @WITH_FILE_CPPFLAGS@ +WITH_FILE_LDFLAGS = @WITH_FILE_LDFLAGS@ +WITH_FILE_LIBS = @WITH_FILE_LIBS@ +WITH_FILE_SUBDIR = @WITH_FILE_SUBDIR@ +WITH_GCRYPT = @WITH_GCRYPT@ +WITH_GNUTLS = @WITH_GNUTLS@ +WITH_GPSEE = @WITH_GPSEE@ +WITH_GPSEE_CPPFLAGS = @WITH_GPSEE_CPPFLAGS@ +WITH_GPSEE_LDFLAGS = @WITH_GPSEE_LDFLAGS@ +WITH_GPSEE_LIBS = @WITH_GPSEE_LIBS@ +WITH_GPSEE_SUBDIR = @WITH_GPSEE_SUBDIR@ +WITH_JS_SUBDIR = @WITH_JS_SUBDIR@ +WITH_KEYUTILS = @WITH_KEYUTILS@ +WITH_KEYUTILS_RPMKEY = @WITH_KEYUTILS_RPMKEY@ +WITH_LIBELF_DEBUGEDIT = @WITH_LIBELF_DEBUGEDIT@ +WITH_LIBGIT2 = @WITH_LIBGIT2@ +WITH_LIBGIT2_CPPFLAGS = @WITH_LIBGIT2_CPPFLAGS@ +WITH_LIBGIT2_LDFLAGS = @WITH_LIBGIT2_LDFLAGS@ +WITH_LIBGIT2_LIBS = @WITH_LIBGIT2_LIBS@ +WITH_LIBGIT2_SUBDIR = @WITH_LIBGIT2_SUBDIR@ +WITH_LIBTASN1 = @WITH_LIBTASN1@ +WITH_LUA = @WITH_LUA@ +WITH_LUA_CPPFLAGS = @WITH_LUA_CPPFLAGS@ +WITH_LUA_LDFLAGS = @WITH_LUA_LDFLAGS@ +WITH_LUA_LIBS = @WITH_LUA_LIBS@ +WITH_LUA_SUBDIR = @WITH_LUA_SUBDIR@ +WITH_LUA_SUBDIR_DEF = @WITH_LUA_SUBDIR_DEF@ +WITH_LUA_SUBDIR_LIB = @WITH_LUA_SUBDIR_LIB@ +WITH_MOZJS185 = @WITH_MOZJS185@ +WITH_MOZJS185_CPPFLAGS = @WITH_MOZJS185_CPPFLAGS@ +WITH_MOZJS185_LDFLAGS = @WITH_MOZJS185_LDFLAGS@ +WITH_MOZJS185_LIBS = @WITH_MOZJS185_LIBS@ +WITH_MOZJS185_SUBDIR = @WITH_MOZJS185_SUBDIR@ +WITH_NEON = @WITH_NEON@ +WITH_NEON_CPPFLAGS = @WITH_NEON_CPPFLAGS@ +WITH_NEON_LDFLAGS = @WITH_NEON_LDFLAGS@ +WITH_NEON_LIBS = @WITH_NEON_LIBS@ +WITH_NEON_SUBDIR = @WITH_NEON_SUBDIR@ +WITH_NIX = @WITH_NIX@ +WITH_NSS = @WITH_NSS@ +WITH_OPENSSL = @WITH_OPENSSL@ +WITH_PAKCHOIS = @WITH_PAKCHOIS@ +WITH_PATH_VERSIONED = @WITH_PATH_VERSIONED@ +WITH_PATH_VERSIONED_SUFFIX = @WITH_PATH_VERSIONED_SUFFIX@ +WITH_PCRE = @WITH_PCRE@ +WITH_PCRE_CPPFLAGS = @WITH_PCRE_CPPFLAGS@ +WITH_PCRE_LDFLAGS = @WITH_PCRE_LDFLAGS@ +WITH_PCRE_LIBS = @WITH_PCRE_LIBS@ +WITH_PCRE_SUBDIR = @WITH_PCRE_SUBDIR@ +WITH_PERLEMBED = @WITH_PERLEMBED@ +WITH_PERL_LIBS = @WITH_PERL_LIBS@ +WITH_PERL_SUBDIR = @WITH_PERL_SUBDIR@ +WITH_PERL_SUBPACKAGE = @WITH_PERL_SUBPACKAGE@ +WITH_PERL_URPM_LIBS = @WITH_PERL_URPM_LIBS@ +WITH_PERL_URPM_SUBDIR = @WITH_PERL_URPM_SUBDIR@ +WITH_PERL_URPM_SUBPACKAGE = @WITH_PERL_URPM_SUBPACKAGE@ +WITH_POPT = @WITH_POPT@ +WITH_POPT_CPPFLAGS = @WITH_POPT_CPPFLAGS@ +WITH_POPT_LDFLAGS = @WITH_POPT_LDFLAGS@ +WITH_POPT_LIBS = @WITH_POPT_LIBS@ +WITH_POPT_SUBDIR = @WITH_POPT_SUBDIR@ +WITH_PYTHONEMBED = @WITH_PYTHONEMBED@ +WITH_PYTHON_INCDIR = @WITH_PYTHON_INCDIR@ +WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ +WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ +WITH_RC = @WITH_RC@ +WITH_RC_CPPFLAGS = @WITH_RC_CPPFLAGS@ +WITH_RC_LDFLAGS = @WITH_RC_LDFLAGS@ +WITH_RC_LIBS = @WITH_RC_LIBS@ +WITH_RC_SUBDIR = @WITH_RC_SUBDIR@ +WITH_READLINE = @WITH_READLINE@ +WITH_RUBY = @WITH_RUBY@ +WITH_RUBY_CPPFLAGS = @WITH_RUBY_CPPFLAGS@ +WITH_RUBY_SUBDIR = @WITH_RUBY_SUBDIR@ +WITH_RUBY_VENDORARCHDIR = @WITH_RUBY_VENDORARCHDIR@ +WITH_SELINUX = @WITH_SELINUX@ +WITH_SEMANAGE = @WITH_SEMANAGE@ +WITH_SEMANAGE_SEMODULE = @WITH_SEMANAGE_SEMODULE@ +WITH_SEPOL = @WITH_SEPOL@ +WITH_SPIDERMONKEY_SUBDIR = @WITH_SPIDERMONKEY_SUBDIR@ +WITH_SQLITE = @WITH_SQLITE@ +WITH_SQLITE_CPPFLAGS = @WITH_SQLITE_CPPFLAGS@ +WITH_SQLITE_LDFLAGS = @WITH_SQLITE_LDFLAGS@ +WITH_SQLITE_LIBS = @WITH_SQLITE_LIBS@ +WITH_SQLITE_SUBDIR = @WITH_SQLITE_SUBDIR@ +WITH_SQUIRREL = @WITH_SQUIRREL@ +WITH_SUBVERSION = @WITH_SUBVERSION@ +WITH_SYCK = @WITH_SYCK@ +WITH_SYCK_CPPFLAGS = @WITH_SYCK_CPPFLAGS@ +WITH_SYCK_LDFLAGS = @WITH_SYCK_LDFLAGS@ +WITH_SYCK_LIBS = @WITH_SYCK_LIBS@ +WITH_SYCK_SUBDIR = @WITH_SYCK_SUBDIR@ +WITH_TCL = @WITH_TCL@ +WITH_TCL_SUBDIR = @WITH_TCL_SUBDIR@ +WITH_TOMCRYPT = @WITH_TOMCRYPT@ +WITH_TPM = @WITH_TPM@ +WITH_UNIXODBC = @WITH_UNIXODBC@ +WITH_UUID = @WITH_UUID@ +WITH_XAR = @WITH_XAR@ +WITH_XAR_CPPFLAGS = @WITH_XAR_CPPFLAGS@ +WITH_XAR_LDFLAGS = @WITH_XAR_LDFLAGS@ +WITH_XAR_LIBS = @WITH_XAR_LIBS@ +WITH_XAR_SUBDIR = @WITH_XAR_SUBDIR@ +WITH_XZ = @WITH_XZ@ +WITH_XZ_CPPFLAGS = @WITH_XZ_CPPFLAGS@ +WITH_XZ_LDFLAGS = @WITH_XZ_LDFLAGS@ +WITH_XZ_LIBS = @WITH_XZ_LIBS@ +WITH_XZ_SUBDIR = @WITH_XZ_SUBDIR@ +WITH_ZLIB = @WITH_ZLIB@ +WITH_ZLIB_CPPFLAGS = @WITH_ZLIB_CPPFLAGS@ +WITH_ZLIB_LDFLAGS = @WITH_ZLIB_LDFLAGS@ +WITH_ZLIB_LIBS = @WITH_ZLIB_LIBS@ +WITH_ZLIB_SUBDIR = @WITH_ZLIB_SUBDIR@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__BASH = @__BASH@ +__BZIP2 = @__BZIP2@ +__CAT = @__CAT@ +__CHATTR = @__CHATTR@ +__CHGRP = @__CHGRP@ +__CHGRP_RHF = @__CHGRP_RHF@ +__CHMOD = @__CHMOD@ +__CHOWN = @__CHOWN@ +__CHOWN_RHF = @__CHOWN_RHF@ +__CMAKE = @__CMAKE@ +__CPIO = @__CPIO@ +__CURL = @__CURL@ +__CVS = @__CVS@ +__DBSQL = @__DBSQL@ +__DB_ARCHIVE = @__DB_ARCHIVE@ +__DB_CHECKPOINT = @__DB_CHECKPOINT@ +__DB_DEADLOCK = @__DB_DEADLOCK@ +__DB_DUMP = @__DB_DUMP@ +__DB_HOTBACKUP = @__DB_HOTBACKUP@ +__DB_LOAD = @__DB_LOAD@ +__DB_LOG_VERIFY = @__DB_LOG_VERIFY@ +__DB_PRINTLOG = @__DB_PRINTLOG@ +__DB_RECOVER = @__DB_RECOVER@ +__DB_REPLICATE = @__DB_REPLICATE@ +__DB_SQL_CODEGEN = @__DB_SQL_CODEGEN@ +__DB_STAT = @__DB_STAT@ +__DB_TUNER = @__DB_TUNER@ +__DB_UPGRADE = @__DB_UPGRADE@ +__DB_VERIFY = @__DB_VERIFY@ +__DIFF = @__DIFF@ +__DITTO = @__DITTO@ +__DOXYGEN = @__DOXYGEN@ +__FILE = @__FILE@ +__GIT = @__GIT@ +__GPG = @__GPG@ +__GSR = @__GSR@ +__GST_INSPECT = @__GST_INSPECT@ +__GZIP = @__GZIP@ +__HG = @__HG@ +__ID = @__ID@ +__ID_U = @__ID_U@ +__INSTALL = @__INSTALL@ +__INSTALL_INFO = @__INSTALL_INFO@ +__LD = @__LD@ +__LDCONFIG = @__LDCONFIG@ +__LN = @__LN@ +__LRZIP = @__LRZIP@ +__LSATTR = @__LSATTR@ +__LZIP = @__LZIP@ +__LZMA = @__LZMA@ +__LZOP = @__LZOP@ +__MAKE = @__MAKE@ +__MKDIR = @__MKDIR@ +__MKDIR_P = @__MKDIR_P@ +__MODINFO = @__MODINFO@ +__MONGO = @__MONGO@ +__MV = @__MV@ +__NM = @__NM@ +__OBJCOPY = @__OBJCOPY@ +__OBJDUMP = @__OBJDUMP@ +__PATCH = @__PATCH@ +__PAX = @__PAX@ +__PERL = @__PERL@ +__PGP = @__PGP@ +__PHP = @__PHP@ +__PYTHON = @__PYTHON@ +__RM = @__RM@ +__RMDIR = @__RMDIR@ +__RSH = @__RSH@ +__RUBY = @__RUBY@ +__SED = @__SED@ +__SH = @__SH@ +__SQLITE3 = @__SQLITE3@ +__SSH = @__SSH@ +__STRIP = @__STRIP@ +__SVN = @__SVN@ +__TAR = @__TAR@ +__TCLSH = @__TCLSH@ +__UNZIP = @__UNZIP@ +__XZ = @__XZ@ +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_CXX = @ac_ct_CXX@ +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@ +autorelocate_dcolor = @autorelocate_dcolor@ +autorelocate_path = @autorelocate_path@ +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@ +exeext = @exeext@ +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@ +libext = @libext@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@/ru +mkdir_p = @mkdir_p@ +objext = @objext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +shlibext = @shlibext@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +testdir = @testdir@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrprefix = @usrprefix@ +varprefix = @varprefix@ +man_MANS = rpm.8 rpm2cpio.8 +EXTRA_DIST = $(man_MANS) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 doc/ru/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign doc/ru/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man8: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(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='$(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) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically \`make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi + @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 $(MANS) +installdirs: + for dir in "$(DESTDIR)$(man8dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-man + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +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-man8 + +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-man + +uninstall-man: uninstall-man8 + +.MAKE: install-am install-data-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + 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-hook install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man8 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 uninstall uninstall-am uninstall-man uninstall-man8 + + +@SET_MAKE@ + +install-data-hook: +@WITH_PATH_VERSIONED_TRUE@ -for p in $(man_MANS); do \ +@WITH_PATH_VERSIONED_TRUE@ case "$$p" in \ +@WITH_PATH_VERSIONED_TRUE@ *.1 ) mv $(DESTDIR)$(man1dir)/$${p} \ +@WITH_PATH_VERSIONED_TRUE@ `echo "$(DESTDIR)$(man1dir)/$${p}" | sed 's/\.1$$/-$(VERSION).1/'` ;; \ +@WITH_PATH_VERSIONED_TRUE@ *.8 ) mv $(DESTDIR)$(man8dir)/$${p} \ +@WITH_PATH_VERSIONED_TRUE@ `echo "$(DESTDIR)$(man8dir)/$${p}" | sed 's/\.8$$/-$(VERSION).8/'` ;; \ +@WITH_PATH_VERSIONED_TRUE@ esac; \ +@WITH_PATH_VERSIONED_TRUE@ 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/rpm-5.4.9/doc/ru/rpm.8 b/rpm-5.4.9/doc/ru/rpm.8 new file mode 100644 index 0000000..05cc642 --- /dev/null +++ b/rpm-5.4.9/doc/ru/rpm.8 @@ -0,0 +1,967 @@ +.\" This manpage has been automatically generated by docbook2man +.\" from a DocBook document. This tool can be found at: +.\" +.\" Please send any bug reports, improvements, comments, patches, +.\" etc. to Steve Cheng . +.TH "RPM" "8" "25 Ñ„ÐµÐ²Ñ€Ð°Ð»Ñ 2006" "Инвента" "Red Hat Linux" +.SH ÐÐЗВÐÐИЕ +rpm \- Менеджер пакетов RPM +.SH ОБЗОР +.SS "ЗÐПРОС И ПРОВЕРКРПÐКЕТОВ:" +.PP + + +\fBrpm\fR {\fB-q|-\-query\fR} [\fBопции-выбора\fR] [\fBопции-запроÑа\fR] + + + +\fBrpm\fR {\fB-V|-\-verify\fR} [\fBопции-выбора\fR] [\fBопции-проверки\fR] + + + +\fBrpm\fR \fB-\-import\fR \fB\fIPUBKEY\fB\fR\fI ...\fR + + + +\fBrpm\fR {\fB-K|-\-checksig\fR} [\fB-\-nosignature\fR] [\fB-\-nodigest\fR] + \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR + +.SS "УСТÐÐОВКÐ, ОБÐОВЛЕÐИЕ И УДÐЛЕÐИЕ ПÐКЕТОВ:" +.PP + + +\fBrpm\fR {\fB-i|-\-install\fR} [\fBопции-уÑтановки\fR] \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR + + + +\fBrpm\fR {\fB-U|-\-upgrade\fR} [\fBопции-уÑтановки\fR] \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR + + + +\fBrpm\fR {\fB-F|-\-freshen\fR} [\fBопции-уÑтановки\fR] \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR + + + +\fBrpm\fR {\fB-e|-\-erase\fR} [\fB-\-allmatches\fR] [\fB-\-nodeps\fR] [\fB-\-noscripts\fR] + [\fB-\-notriggers\fR] [\fB-\-repackage\fR] [\fB-\-test\fR] \fB\fIPACKAGE_NAME\fB\fR\fI\ ...\fR + +.SS "РÐЗÐОЕ:" +.PP + + +\fBrpm\fR {\fB-\-initdb|-\-rebuilddb\fR} + + + +\fBrpm\fR {\fB-\-addsign|-\-resign\fR} \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR + + + +\fBrpm\fR {\fB-\-querytags|-\-showrc\fR} + + + +\fBrpm\fR {\fB-\-setperms|-\-setugids\fR} \fB\fIPACKAGE_NAME\fB\fR\fI ...\fR + +.SS "опции-выбора" +.PP + + + [\fB\fIPACKAGE_NAME\fB\fR] [\fB-a,-\-all\fR] [\fB-f,-\-file \fIFILE\fB\fR] + [\fB-g,-\-group \fIGROUP\fB\fR] {\fB-p,-\-package \fIPACKAGE_FILE\fB\fR] + [\fB-\-fileid \fIMD5\fB\fR] [\fB-\-hdrid \fISHA1\fB\fR] [\fB-\-pkgid \fIMD5\fB\fR] [\fB-\-tid \fITID\fB\fR] + [\fB-\-querybynumber \fIHDRNUM\fB\fR] [\fB-\-triggeredby \fIPACKAGE_NAME\fB\fR] + [\fB-\-whatprovides \fICAPABILITY\fB\fR] [\fB-\-whatrequires \fICAPABILITY\fB\fR] + +.SS "опции-запроÑа" +.PP + + + [\fB-\-changelog\fR] [\fB-c,-\-configfiles\fR] [\fB-d,-\-docfiles\fR] [\fB-\-dump\fR] + [\fB-\-filesbypkg\fR] [\fB-i,-\-info\fR] [\fB-\-last\fR] [\fB-l,-\-list\fR] + [\fB-\-provides\fR] [\fB-\-qf,-\-queryformat \fIQUERYFMT\fB\fR] + [\fB-R,-\-requires\fR] [\fB-\-scripts\fR] [\fB-s,-\-state\fR] + [\fB-\-triggers,-\-triggerscripts\fR] + +.SS "опции-проверки" +.PP + + + [\fB-\-nodeps\fR] [\fB-\-nofiles\fR] [\fB-\-noscripts\fR] + [\fB-\-nodigest\fR] [\fB-\-nosignature\fR] + [\fB-\-nolinkto\fR] [\fB-\-nomd5\fR] [\fB-\-nosize\fR] [\fB-\-nouser\fR] + [\fB-\-nogroup\fR] [\fB-\-nomtime\fR] [\fB-\-nomode\fR] [\fB-\-nordev\fR] + +.SS "опции-уÑтановки" +.PP + + + [\fB-\-aid\fR] [\fB-\-allfiles\fR] [\fB-\-badreloc\fR] [\fB-\-excludepath \fIOLDPATH\fB\fR] + [\fB-\-excludedocs\fR] [\fB-\-force\fR] [\fB-h,-\-hash\fR] + [\fB-\-ignoresize\fR] [\fB-\-ignorearch\fR] [\fB-\-ignoreos\fR] + [\fB-\-includedocs\fR] [\fB-\-justdb\fR] [\fB-\-nodeps\fR] + [\fB-\-nodigest\fR] [\fB-\-nosignature\fR] [\fB-\-nosuggest\fR] + [\fB-\-noorder\fR] [\fB-\-noscripts\fR] [\fB-\-notriggers\fR] + [\fB-\-oldpackage\fR] [\fB-\-percent\fR] [\fB-\-prefix \fINEWPATH\fB\fR] + [\fB-\-relocate \fIOLDPATH\fB=\fINEWPATH\fB\fR] + [\fB-\-repackage\fR] [\fB-\-replacefiles\fR] [\fB-\-replacepkgs\fR] + [\fB-\-test\fR] + +.SH "ОПИСÐÐИЕ" +.PP +\fBrpm\fR - Ñто мощный \fBМенеджер Пакетов\fR, +который может быть иÑпользован Ð´Ð»Ñ Ñборки, уÑтановки, запроÑа, проверки, +Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð¸ ÑƒÐ´Ð°Ð»ÐµÐ½Ð¸Ñ Ð¾Ñ‚Ð´ÐµÐ»ÑŒÐ½Ñ‹Ñ… программных пакетов. +\fBПакет\fR Ñодержит архив Ñ Ñ„Ð°Ð¹Ð»Ð°Ð¼Ð¸ и метаданные, иÑпользуемые Ð´Ð»Ñ +уÑтановки и ÑƒÐ´Ð°Ð»ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð² архива. Метаданные включают Ñценарии, +атрибуты файлов и информацию Ñ Ð¾Ð¿Ð¸Ñанием пакета. +\fBПакеты\fR бывают двух типов: двоичные пакеты, иÑпользуемые Ð´Ð»Ñ +Ð¾Ð±ÑŠÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ ÑƒÑтанавливаемых программ, и пакеты Ñ Ð¸Ñходными кодами, +включающие иÑходные коды и опиÑание ÑпоÑоба Ñ„Ð¾Ñ€Ð¼Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð´Ð²Ð¾Ð¸Ñ‡Ð½Ð¾Ð³Ð¾ пакета. +.PP +Ðеобходимо указать один из Ñледующих оÑновных режимов работы: +\fBЗапроÑ\fR, +\fBПроверка\fR, +\fBПроверка подпиÑи\fR, +\fBУÑтановка/Обновление/ОÑвежение\fR, +\fBУдаление\fR, +\fBÐ˜Ð½Ð¸Ñ†Ð¸Ð°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ Ð‘Ð°Ð·Ñ‹ данных\fR, +\fBПереÑтройка Базы данных\fR, +\fBÐŸÐ¾Ð²Ñ‚Ð¾Ñ€Ð½Ð°Ñ Ð¿Ð¾Ð´Ð¿Ð¸ÑÑŒ\fR, +\fBДобавление подпиÑи\fR, +\fBЗадание Владельцев/Групп\fR, +\fBОтображение тегов запроÑа\fR и +\fBОтображение конфигурации\fR. +.SS "ОБЩИЕ ОПЦИИ" +.PP +Эти опции могут быть иÑпользованы во вÑех режимах. +.TP +\fB-?, -\-help\fR +ВывеÑти более детальную, чем обычно, Ñправку об иÑпользовании. +.TP +\fB-\-version\fR +ВывеÑти одну Ñтроку, Ñодержащую номер верÑии \fBrpm\fR. +.TP +\fB-\-quiet\fR +Выводить как можно меньше Ñообщений - как правило, отображаютÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ +ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ Ð¾Ð± ошибках. +.TP +\fB-v\fR +Выводить подробную информацию - как правило, отображаютÑÑ ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ Ð¾ +выполнении вÑех шагов. +.TP +\fB-vv\fR +Выводить много отладочной информации. +.TP +\fB-\-rcfile \fIFILELIST\fB\fR +Каждый из файлов разделенного двоеточиÑми ÑпиÑка файлов \fIFILELIST\fR поÑледовательно +прочитываетÑÑ \fIrpm\fR на предмет конфигурационной информации. +Ð’ Ñтом ÑпиÑке обÑзан ÑущеÑтвовать только первый файл; +вÑе знаки тильда будут заменены значением \fB$HOME\fR. +По умолчанию ÑпиÑок файлов \fIFILELIST\fR выглÑдит как +\fI/usr/lib/rpm/rpmrc\fR:\fI/usr/lib/rpm/redhat/rpmrc\fR:\fI/etc/rpmrc\fR:\fI~/.rpmrc\fR. +.TP +\fB-\-pipe \fICMD\fB\fR +ПеренаправлÑет вывод \fBrpm\fR на вход команды \fICMD\fR. +.TP +\fB-\-dbpath \fIDIRECTORY\fB\fR +ИÑпользовать базу данных RPM в каталоге \fIDIRECTORY\fR вмеÑто пути по умолчанию +\fI/var/lib/rpm\fR +.TP +\fB-\-root \fIDIRECTORY\fB\fR +ИÑпользовать Ð´Ð»Ñ Ð²Ñех операций файловую ÑиÑтему Ñ ÐºÐ¾Ñ€Ð½ÐµÐ¼ в \fIDIRECTORY\fR. +Обратите внимание, что Ñто значит, что база данных внутри \fIDIRECTORY\fR +будет иÑпользоватьÑÑ Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð²ÐµÑ€ÐºÐ¸ завиÑимоÑтей, и вÑе Ñценарии \fB%post\fR и \fB%prep\fR +будут иÑполнÑÑ‚ÑŒÑÑ Ð¿Ð¾Ñле chroot(2) в \fIDIRECTORY\fR. +.SS "ОПЦИИ УСТÐÐОВКИ И ОБÐОВЛЕÐИЯ" +.PP +ÐžÐ±Ñ‰Ð°Ñ Ñ„Ð¾Ñ€Ð¼Ð° команды уÑтановки rpm приведена ниже +.PP + +\fBrpm\fR {\fB-i|-\-install\fR} [\fBопции-уÑтановки\fR] \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR + +.PP +Так выполнÑетÑÑ ÑƒÑтановка нового пакета. +.PP +ÐžÐ±Ñ‰Ð°Ñ Ñ„Ð¾Ñ€Ð¼Ð° команды Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ rpm приведена ниже +.PP + +\fBrpm\fR {\fB-U|-\-upgrade\fR} [\fBопции-уÑтановки\fR] \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR + +.PP +Так выполнÑетÑÑ ÑƒÑтановка или обновление уже уÑтановленного +пакета до новой верÑии. Эта Ð¾Ð¿ÐµÑ€Ð°Ñ†Ð¸Ñ Ð°Ð½Ð°Ð»Ð¾Ð³Ð¸Ñ‡Ð½Ð° уÑтановке, +при Ñтом вÑе другие верÑии удалÑÑŽÑ‚ÑÑ Ð¿Ð¾Ñле уÑтановки +нового пакета. +.PP + +\fBrpm\fR {\fB-F|-\-freshen\fR} [\fBопции-уÑтановки\fR] \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR + +.PP +Так выполнÑетÑÑ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ðµ пакетов, но только еÑли Ð¿Ñ€ÐµÐ´Ñ‹Ð´ÑƒÑ‰Ð°Ñ +верÑÐ¸Ñ ÑƒÐ¶Ðµ уÑтановлена. Параметр \fIPACKAGE_FILE\fR может быть +указан как Ð°Ð´Ñ€ÐµÑ +\fBftp\fR или +\fBhttp\fR URL, +в таком Ñлучае пакет будет Ñкачан перед уÑтановкой. См. +\fBОПЦИИ FTP/HTTP\fR +Ð´Ð»Ñ Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ð¸ о работе \fBrpm\fR Ñ Ð¿Ð¾Ð´Ð´ÐµÑ€Ð¶ÐºÐ¾Ð¹ +\fBftp\fR или +\fBhttp\fR. + +.PP +.TP +\fB-\-aid\fR +ДобавлÑет при необходимоÑти предложенные пакеты в набор транзакции. +.TP +\fB-\-allfiles\fR +УÑтанавливает или обновлÑет вÑе файлы Ñ Ñ„Ð»Ð°Ð³Ð¾Ð¼ missingok в пакете, +незавиÑимо от их ÑущеÑтвованиÑ. +.TP +\fB-\-badreloc\fR +ИÑпользуетÑÑ Ð²Ð¼ÐµÑте Ñ \fB-\-relocate\fR, разрешает перемещение +вÑех путей файлов, не только тех, Ð´Ð»Ñ ÐºÐ¾Ñ‚Ð¾Ñ€Ñ‹Ñ… Ñтарые пути \fIOLDPATH\fR +включены в заметки по перемещению (relocation hint) в бинарном пакете. +.TP +\fB-\-excludepath \fIOLDPATH\fB\fR +Ðе уÑтанавливать файлы названиÑ, которых начинаютÑÑ Ñ +\fIOLDPATH\fR. +.TP +\fB-\-excludedocs\fR +Ðе уÑтанавливать файлы помеченные как Ð´Ð¾ÐºÑƒÐ¼ÐµÐ½Ñ‚Ð°Ñ†Ð¸Ñ +(включающие man Ñтраницы и документы texinfo). +.TP +\fB-\-force\fR +Эквивалентно иÑпользованию +\fB-\-replacepkgs\fR, +\fB-\-replacefiles\fR и +\fB-\-oldpackage\fR. +.TP +\fB-h, -\-hash\fR +Выводит 50 отметок при раÑпаковке архива. +ИÑпользуетÑÑ Ñ \fB-v|-\-verbose\fR Ð´Ð»Ñ ÑƒÐ´Ð¾Ð±Ñтва отображениÑ. +.TP +\fB-\-ignoresize\fR +Ðе проверÑÑ‚ÑŒ подключенные файловые ÑиÑтемы на наличие необходимого +меÑта на диÑке перед уÑтановкой данного пакета. +.TP +\fB-\-ignorearch\fR +Разрешить уÑтановку или обновление, даже еÑли архитектуры +бинарного пакета и узла не Ñовпадают. +.TP +\fB-\-ignoreos\fR +Разрешить уÑтановку или обновление, даже еÑли операционные ÑиÑтемы +бинарного пакета и узла не Ñовпадают. +.TP +\fB-\-includedocs\fR +УÑтанавливать файлы Ñ Ð´Ð¾ÐºÑƒÐ¼ÐµÐ½Ñ‚Ð°Ñ†Ð¸ÐµÐ¹. Это поведение задано по умолчанию. +.TP +\fB-\-justdb\fR +Обновить только информацию в базе, но не файловые ÑиÑтемы. +.TP +\fB-\-nodigest\fR +Ðе проверÑÑ‚ÑŒ при чтении дайджеÑÑ‚ пакета или заголовка. +.TP +\fB-\-nosignature\fR +Ðе проверÑÑ‚ÑŒ при чтении подпиÑÑŒ пакета или заголовка. +.TP +\fB-\-nodeps\fR +Ðе выполнÑÑ‚ÑŒ проверку завиÑимоÑтей перед уÑтановкой или обновлением пакета. +.TP +\fB-\-nosuggest\fR +Ðе предлагать пакет(Ñ‹) Ð´Ð»Ñ Ñ€Ð°Ð·Ñ€ÐµÑˆÐµÐ½Ð¸Ñ Ð¾Ñ‚ÑутÑтвующих завиÑимоÑтей. +.TP +\fB-\-noorder\fR +Ðе выполнÑÑ‚ÑŒ переупорÑдочивание пакетов Ð´Ð»Ñ ÑƒÑтановки. СпиÑок пакетов +обычно переупорÑдочиваетÑÑ Ð´Ð»Ñ ÑƒÐ´Ð¾Ð²Ð»ÐµÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð¸Ñ Ð·Ð°Ð²Ð¸ÑимоÑтей. +.TP +\fB-\-noscripts\fR +.TP +\fB-\-nopre\fR +.TP +\fB-\-nopost\fR +.TP +\fB-\-nopreun\fR +.TP +\fB-\-nopostun\fR +Ðе выполнÑÑ‚ÑŒ Ñкриптлеты Ñ ÑƒÐºÐ°Ð·Ð°Ð½Ð½Ñ‹Ð¼ именем. +ÐžÐ¿Ñ†Ð¸Ñ \fB-\-noscripts\fR Ñквивалентна + +\fB-\-nopre\fR +\fB-\-nopost\fR +\fB-\-nopreun\fR +\fB-\-nopostun\fR + +и выключает иÑполнение ÑоответÑтвующих +\fB%pre\fR, +\fB%post\fR, +\fB%preun\fR и +\fB%postun\fR +Ñкриптлетов. +.TP +\fB-\-notriggers\fR +.TP +\fB-\-notriggerin\fR +.TP +\fB-\-notriggerun\fR +.TP +\fB-\-notriggerpostun\fR + +Ðе выполнÑÑ‚ÑŒ ни какие триггерные Ñкриптлеты Ñ ÑƒÐºÐ°Ð·Ð°Ð½Ð½Ñ‹Ð¼ именем. +ÐžÐ¿Ñ†Ð¸Ñ \fB-\-notriggers\fR Ñквивалентна + +\fB-\-notriggerin\fR +\fB-\-notriggerun\fR +\fB-\-notriggerpostun\fR + +и выключает иÑполнение ÑоответÑтвующих +\fB%triggerin\fR, +\fB%triggerun\fR и +\fB%triggerpostun\fR +Ñкриптлетов. +.TP +\fB-\-oldpackage\fR +Разрешает обновить или заменить новый пакет более Ñтарой верÑией. +.TP +\fB-\-percent\fR +ВывеÑти информацию в процентах по мере раÑпаковки файлов из архива пакета. +Она предназначена Ð´Ð»Ñ ÑƒÐ¿Ñ€Ð¾Ñ‰ÐµÐ½Ð¸Ñ Ð²Ñ‹Ð·Ð¾Ð²Ð° \fBrpm\fR из других утилит. +.TP +\fB-\-prefix \fINEWPATH\fB\fR +Ð”Ð»Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÑ‰Ð°ÐµÐ¼Ñ‹Ñ… бинарных пакетов, преобразовать вÑе пути файлов, +которые начинаютÑÑ Ñ Ð¸Ð½ÑталлÑционного префикÑа в заметках по +перемещению (relocation hint) на \fINEWPATH\fR. +.TP +\fB-\-relocate \fIOLDPATH\fB=\fINEWPATH\fB\fR +Ð”Ð»Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÑ‰Ð°ÐµÐ¼Ñ‹Ñ… бинарных пакетов, преобразовать вÑе пути файлов, +которые начинаютÑÑ Ñ \fIOLDPATH\fR в заметках по +перемещению (relocation hint) на \fINEWPATH\fR. +Ð”Ð°Ð½Ð½Ð°Ñ Ð¾Ð¿Ñ†Ð¸Ñ Ð¼Ð¾Ð¶ÐµÑ‚ быть иÑпользована неÑколько раз, +еÑли требуетÑÑ Ð¿ÐµÑ€ÐµÐ¼ÐµÑтить неÑколько путей \fIOLDPATH\fR +в пакете. +.TP +\fB-\-repackage\fR +Переупаковать файлы перед удалением. Ранее уÑтановленный пакет +будет назван в ÑоответÑтвии Ñ Ð¼Ð°ÐºÑ€Ð¾Ñом +\fB%_repackage_name_fmt\fR +и будет Ñоздан в каталоге, названном по значению макроÑа +\fB%_repackage_dir\fR (значение по умолчанию - +\fI/var/spool/repackage\fR). +.TP +\fB-\-replacefiles\fR +УÑтановить пакеты, даже еÑли они заменÑÑŽÑ‚ файлы от других +уÑтановленных пакетов. +.TP +\fB-\-replacepkgs\fR +УÑтановить пакеты, даже еÑли они уже уÑтановлены в ÑиÑтеме. +.TP +\fB-\-test\fR +Ðе уÑтанавливать пакеты, проÑто выполнить проверку и Ñообщить +о потенциальных конфликтах. +.SS "ОПЦИИ УДÐЛЕÐИЯ" +.PP +ÐžÐ±Ñ‰Ð°Ñ Ñ„Ð¾Ñ€Ð¼Ð° команды ÑƒÐ´Ð°Ð»ÐµÐ½Ð¸Ñ rpm приведена ниже +.PP + +\fBrpm\fR {\fB-e|-\-erase\fR} [\fB-\-allmatches\fR] [\fB-\-nodeps\fR] [\fB-\-noscripts\fR] [\fB--notriggers\fR] [\fB--repackage\fR] [\fB--test\fR] \fB\fIPACKAGE_NAME\fB\fR\fI ...\fR + +.PP +Следующие опции могут быть также иÑпользованы: +.TP +\fB-\-allmatches\fR +Удалить вÑе верÑии пакета Ñовпадающие Ñ +\fIPACKAGE_NAME\fR. Обычно при наличии неÑкольких +пакетов Ñовпадающих Ñ \fIPACKAGE_NAME\fR +возникает ошибка. +.TP +\fB-\-nodeps\fR +Ðе проверÑÑ‚ÑŒ завиÑимоÑти перед удалением пакетов. +.TP +\fB-\-noscripts\fR +.TP +\fB-\-nopreun\fR +.TP +\fB-\-nopostun\fR +Ðе выполнÑÑ‚ÑŒ Ñкриптлеты Ñ ÑƒÐºÐ°Ð·Ð°Ð½Ð½Ñ‹Ð¼Ð¸ именами. +Ðаличие параметра \fB-\-noscripts\fR при удалении пакетов +Ñквивалентно + +\fB-\-nopreun\fR +\fB-\-nopostun\fR + +и выключает иÑполнение ÑоответÑтвующих Ñкриптлетов +\fB%preun\fR и +\fB%postun\fR. +.TP +\fB-\-notriggers\fR +.TP +\fB-\-notriggerun\fR +.TP +\fB-\-notriggerpostun\fR +Ðе выполнÑÑ‚ÑŒ ни какие триггерные Ñкриптлеты Ñ ÑƒÐºÐ°Ð·Ð°Ð½Ð½Ñ‹Ð¼ именем. +ÐžÐ¿Ñ†Ð¸Ñ \fB-\-notriggers\fR Ñквивалентна + +\fB-\-notriggerun\fR +\fB-\-notriggerpostun\fR + +и выключает иÑполнение ÑоответÑтвующих +\fB%triggerun\fR и +\fB%triggerpostun\fR +Ñкриптлетов. +.TP +\fB-\-repackage\fR +Переупаковать файлы перед удалением. Ранее уÑтановленный пакет +будет назван в ÑоответÑтвии Ñ Ð¼Ð°ÐºÑ€Ð¾Ñом +\fB%_repackage_name_fmt\fR +и будет Ñоздан в каталоге, названном по значению макроÑа +\fB%_repackage_dir\fR (значение по умолчанию +- \fI/var/spool/repackage\fR). +.TP +\fB-\-test\fR +Ðе удалÑÑ‚ÑŒ пакеты, проÑто выполнить проверку. +Удобно иÑпользовать Ñтот параметр при отладке ÑовмеÑтно +Ñ Ð¾Ð¿Ñ†Ð¸ÐµÐ¹ \fB-vv\fR. +.SS "ОПЦИИ ЗÐПРОСÐ" +.PP +ÐžÐ±Ñ‰Ð°Ñ Ñ„Ð¾Ñ€Ð¼Ð° команды запроÑа rpm приведена ниже +.PP + +\fBrpm\fR {\fB-q|-\-query\fR} [\fBselect-options\fR] [\fBquery-options\fR] + +.PP +СущеÑтвует возможноÑÑ‚ÑŒ задать формат вывода информации о пакете. +Ð”Ð»Ñ Ñтого необходимо иÑпользовать параметр + + \fB-\-qf|-\-queryformat\fR \fB\fIQUERYFMT\fB\fR + +вÑлед за которым указываетÑÑ Ñтрока формата \fIQUERYFMT\fR. +Форматирование запроÑа - Ñто Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð½Ð°Ñ Ð²ÐµÑ€ÑÐ¸Ñ Ñтандартного +механизма \fBprintf(3)\fR. Форматирование формируетÑÑ Ð¸Ð· +ÑтатичеÑких Ñтрок (которые могут включать Ñтандартные Ð´Ð»Ñ +Ñзыка C escape-поÑледовательноÑти Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ²Ð¾Ð´Ð° Ñтроки, табулÑции +и других Ñпец. Ñимволов) и меток Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ \fBprintf(3)\fR. +Т.к. \fBrpm\fR заранее знает тип выводимой информации, указатель +формата может быть опущен и заменен на Ð¸Ð¼Ñ Ð²Ñ‹Ð²Ð¾Ð´Ð¸Ð¼Ð¾Ð³Ð¾ тега заголовка, +заключенного в фигурные Ñкобки \fB{}\fR. Имена тегов не чувÑтвительны +к региÑтру и Ð¿Ñ€ÐµÑ„Ð¸ÐºÑ \fBRPMTAG_\fR в имени тега можно опуÑкать. +.PP +Ðльтернативные форматы вывода могут быть заданы при помощи +Ð·Ð°Ð´Ð°Ð½Ð¸Ñ Ñ‚Ð¸Ð¿Ð° вывода \fB:\fItypetag\fB\fR поÑле имени тега. +Ð’ данный момент поддерживаютÑÑ Ñледующие типы: +.TP +\fB:armor\fR +Упаковать публичный ключ в ASCII вид. +.TP +\fB:base64\fR +Закодировать двоичные данные в формат base64. +.TP +\fB:date\fR +ИÑпользовать формат strftime(3) "%c". +.TP +\fB:day\fR +ИÑпользовать формат strftime(3) "%a %b %d %Y". +.TP +\fB:depflags\fR +Форматировать флаги завиÑимоÑтей. +.TP +\fB:fflags\fR +Форматировать флаги файлов. +.TP +\fB:hex\fR +Ð’ шеÑтнадцатеричном виде. +.TP +\fB:octal\fR +Ð’ воÑьмеричном виде. +.TP +\fB:perms\fR +Форматировать права доÑтупа файлов. +.TP +\fB:shescape\fR +Экранировать одиночные кавычки Ð´Ð»Ñ Ð¿Ñ€Ð¸Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² ÑценариÑÑ…. +.TP +\fB:triggertype\fR +ВывеÑти ÑÑƒÑ„Ñ„Ð¸ÐºÑ Ñ‚Ñ€Ð¸Ð³Ð³ÐµÑ€Ð°. +.PP +Ðапример, Ð´Ð»Ñ Ð²Ñ‹Ð²Ð¾Ð´Ð° только имени пакета при запроÑе, вы можете +иÑпользовать Ñтроку формата \fB%{NAME}\fR. +Ð”Ð»Ñ Ð²Ñ‹Ð²Ð¾Ð´Ð° имени пакетов и информации о диÑтрибутиве в две колонки +вы можете иÑпользовать \fB%-30{NAME}%{DISTRIBUTION}\fR. +Команда \fBrpm\fR отобразит Ñпиков вÑех тегов, Ñ ÐºÐ¾Ñ‚Ð¾Ñ€Ñ‹Ð¼Ð¸ она может работать +при ее вызове Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ \fB-\-querytags\fR. +.PP +СущеÑтвуют два набора параметров Ð´Ð»Ñ Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñов: Ð´Ð»Ñ Ð²Ñ‹Ð±Ð¾Ñ€Ð° пакетов +и Ð´Ð»Ñ ÑƒÐºÐ°Ð·Ð°Ð½Ð¸Ñ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ð¸. +.SS "ОПЦИИ ВЫБОРРПÐКЕТОВ:" +.PP +.TP +\fB\fIPACKAGE_NAME\fB\fR +ВыполнÑет Ð·Ð°Ð¿Ñ€Ð¾Ñ Ðº уÑтановленному пакету Ñ Ð¸Ð¼ÐµÐ½ÐµÐ¼ \fIPACKAGE_NAME\fR. +.TP +\fB-a, -\-all\fR +ВыполнÑет Ð·Ð°Ð¿Ñ€Ð¾Ñ ÐºÐ¾ вÑем уÑтановленным пакетам. +.TP +\fB-f, -\-file \fIFILE\fB\fR +ВыполнÑет Ð·Ð°Ð¿Ñ€Ð¾Ñ Ðº пакету, владельцу файла \fIFILE\fR. +.TP +\fB-\-fileid \fIMD5\fB\fR +ВыполнÑет Ð·Ð°Ð¿Ñ€Ð¾Ñ Ðº пакету, который Ñодержит указанный идентификатор файла, +Ñ‚.е. \fIMD5\fR дайджеÑÑ‚ Ñодержимого файла. +.TP +\fB-g, -\-group \fIGROUP\fB\fR +ВыполнÑет Ð·Ð°Ð¿Ñ€Ð¾Ñ Ðº пакету Ñ Ð³Ñ€ÑƒÐ¿Ð¿Ð¾Ð¹ \fIGROUP\fR. +.TP +\fB-\-hdrid \fISHA1\fB\fR +ВыполнÑет Ð·Ð°Ð¿Ñ€Ð¾Ñ Ðº пакету, Ñодержащему указанный идентификатор заголовка, +Ñ‚.е. \fISHA1\fR дайджеÑÑ‚ неизменной чаÑти заголовка. +.TP +\fB-p, -\-package \fIPACKAGE_FILE\fB\fR +ВыполнÑет Ð·Ð°Ð¿Ñ€Ð¾Ñ Ðº (неуÑтановленному) пакету в файле \fIPACKAGE_FILE\fR. +Параметр \fIPACKAGE_FILE\fR может быть указан в виде адреÑа \fBftp\fR или +\fBhttp\fR URL, в результате чего заголовок пакета будет Ñкачан и опрошен. +ОбратитеÑÑŒ к \fBОПЦИЯМ FTP/HTTP\fR за информацией о поддержке в +\fBrpm\fR работы Ñ +\fBftp\fR и +\fBhttp\fR. +ЕÑли аргумент(Ñ‹) \fIPACKAGE_FILE\fR не ÑвлÑетÑÑ Ð±Ð¸Ð½Ð°Ñ€Ð½Ñ‹Ð¼ пакетом, то он +будет интерпретирован как ASCII манифеÑÑ‚ пакета. +Ð’ нем разрешено применение комментариев начинающихÑÑ Ñ '#', ÐºÐ°Ð¶Ð´Ð°Ñ Ð¸Ð· Ñтрок файла +манифеÑта пакета может включать разделенные запÑтыми glob выражениÑ, +Ð²ÐºÐ»ÑŽÑ‡Ð°Ñ Ð°Ð´Ñ€ÐµÑа URL Ñ Ð²Ð½ÐµÑˆÐ½Ð¸Ð¼Ð¸ glob выражениÑми, они будут развернуты в +пути, которые будут подÑтавлены вмеÑто манифеÑта пакета как дополнительный +аргумент \fIPACKAGE_FILE\fR в запроÑе. +.TP +\fB-\-pkgid \fIMD5\fB\fR +ВыполнÑет Ð·Ð°Ð¿Ñ€Ð¾Ñ Ðº пакету, который Ñодержит указанный идентификатор пакета, +Ñ‚.е. \fIMD5\fR дайджеÑÑ‚ объединенного Ñодержимого заголовка и тела пакета. +.TP +\fB-\-querybynumber \fIHDRNUM\fB\fR +ВыполнÑет Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð½Ð°Ð¿Ñ€Ñмую \fIHDRNUM\fR'ой запиÑи в базе данных; иÑпользуетÑÑ +только Ð´Ð»Ñ Ð¾Ñ‚Ð»Ð°Ð´ÐºÐ¸. +.TP +\fB-\-specfile \fISPECFILE\fB\fR +Обработать и выполнить Ð·Ð°Ð¿Ñ€Ð¾Ñ Ðº \fISPECFILE\fR файлу, как еÑли бы Ñто был +пакет. Ð¥Ð¾Ñ‚Ñ Ð½Ðµ вÑÑ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð´Ð¾Ñтупна (например, ÑпиÑок файлов), +Ñтот тип запроÑов позволÑет иÑпользовать rpm Ð´Ð»Ñ Ð¸Ð·Ð²Ð»ÐµÑ‡ÐµÐ½Ð¸Ñ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ð¸ из +spec файлов без напиÑÐ°Ð½Ð¸Ñ Ñпециализированного анализатора таких файлов. +.TP +\fB-\-tid \fITID\fB\fR +ВыполнÑет Ð·Ð°Ð¿Ñ€Ð¾Ñ Ðº пакету(ам), который Ñодержит указанный идентификатор +транзакции \fITID\fR. Ð’ данный момент иÑпользуетÑÑ Ð²Ñ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ Ð¼ÐµÑ‚ÐºÐ° unix +в качеÑтве идентификатора. Ð’Ñе пакеты уÑтановленные или удаленные в ÑоÑтаве +одной транзакции будут иметь один и тот же идентификатор. +.TP +\fB-\-triggeredby \fIPACKAGE_NAME\fB\fR +ВыполнÑет Ð·Ð°Ð¿Ñ€Ð¾Ñ Ðº пакетам, которые вызывают Ñрабатывание триггера пакета(ов) +\fIPACKAGE_NAME\fR. +.TP +\fB-\-whatprovides \fICAPABILITY\fB\fR +ВыполнÑет Ð·Ð°Ð¿Ñ€Ð¾Ñ ÐºÐ¾ вÑем пакетам, которые предоÑтавлÑÑŽÑ‚ функциональноÑÑ‚ÑŒ +\fICAPABILITY\fR. +.TP +\fB-\-whatrequires \fICAPABILITY\fB\fR +ВыполнÑет Ð·Ð°Ð¿Ñ€Ð¾Ñ ÐºÐ¾ вÑем пакетам, которые требуют \fICAPABILITY\fR Ð´Ð»Ñ +корректной работы. +.SS "ОПЦИИ ЗÐПРОСРПÐКЕТОВ:" +.PP +.TP +\fB-\-changelog\fR +ВывеÑти информацию об изменениÑÑ… в пакете. +.TP +\fB-c, -\-configfiles\fR +ВывеÑти только конфигурационные файлы (подразумевает \fB-l\fR). +.TP +\fB-d, -\-docfiles\fR +ВывеÑти только файлы документации (подразумевает \fB-l\fR). +.TP +\fB-\-dump\fR +РаÑпечатать информацию о файле в виде: +.sp +.RS + +.nf +path size mtime md5sum mode owner group isconfig isdoc rdev symlink + +.fi +.RE + +Эта Ð¾Ð¿Ñ†Ð¸Ñ Ð´Ð¾Ð»Ð¶Ð½Ð° быть иÑпользована ÑовмеÑтно Ñ Ð¾Ð´Ð½Ð¾Ð¹ из +\fB-l\fR, +\fB-c\fR, +\fB-d\fR. +.TP +\fB-\-filesbypkg\fR +ВывеÑти вÑе файлы во вÑех выбранных пакетах. +.TP +\fB-i, -\-info\fR +ВывеÑти информацию о пакете, Ð²ÐºÐ»ÑŽÑ‡Ð°Ñ Ð¸Ð¼Ñ, верÑию и опиÑание. +Будет иÑпользована \fB-\-queryformat\fR еÑли указана. +.TP +\fB-\-last\fR +УпорÑдочивает вывод пакетов по времени уÑтановки так, чтобы поÑледние +пакеты были выведены в начале. +.TP +\fB-l, -\-list\fR +ВывеÑти ÑпиÑок файлов в пакете. +.TP +\fB-\-provides\fR +ВывеÑти функциональноÑÑ‚ÑŒ (capabilities) предоÑтавлÑемую пакетом. +.TP +\fB-R, -\-requires\fR +ВывеÑти пакеты, от которых завиÑит Ñтот пакет. +.TP +\fB-\-scripts\fR +ВывеÑти Ñкриптлет(Ñ‹) пакета, которые иÑпользуютÑÑ ÐºÐ°Ðº чаÑÑ‚ÑŒ процеÑÑа +уÑтановки или ÑƒÐ´Ð°Ð»ÐµÐ½Ð¸Ñ Ð¿Ð°ÐºÐµÑ‚Ð¾Ð². +.TP +\fB-s, -\-state\fR +ВывеÑти ÑоÑтоÑние (\fIstate\fR) файлов в пакете (подразумеваетÑÑ \fB-l\fR). +СоÑтоÑние каждого файла в пакете ÑвлÑетÑÑ Ð¾Ð´Ð½Ð¸Ð¼ из +\fIнормальное (normal)\fR, +\fIне уÑтановлен (not installed)\fR или +\fIзаменен (replaced)\fR. +.TP +\fB-\-triggers, -\-triggerscripts\fR +Показать Ñценарии триггеров (еÑли ÑущеÑтвуют), входÑщие в ÑоÑтав пакета. + +.SS "ОПЦИИ ПРОВЕРКИ" +.PP +ÐžÐ±Ñ‰Ð°Ñ Ñ„Ð¾Ñ€Ð¼Ð° команды проверки rpm приведена ниже +.PP + +\fBrpm\fR {\fB-V|-\-verify\fR} [\fBопции-выбора\fR] [\fBопции-проверки\fR] + +.PP +ÐžÐ¿ÐµÑ€Ð°Ñ†Ð¸Ñ Ð¿Ñ€Ð¾Ð²ÐµÑ€ÐºÐ¸ пакета Ñравнивает информацию о файлах уÑтановленных из +пакета Ñ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸ÐµÐ¹ о них из метаданных пакета, хранимых в базе данных rpm. +Среди прочего при проверке ÑравниваютÑÑ Ñ€Ð°Ð·Ð¼ÐµÑ€, MD5 Ñумма, права доÑтупа +тип, владельца и группу каждого файла. Любые раÑÑ…Ð¾Ð¶Ð´ÐµÐ½Ð¸Ñ Ð±ÑƒÐ´ÑƒÑ‚ отображены. +Файлы, которые не были уÑтановлены вмеÑте Ñ Ð¿Ð°ÐºÐµÑ‚Ð¾Ð¼, например, файлы +документации, иÑключенные при помощи опции "\fB-\-excludedocs\fR", +будут проигнорированы без предупреждениÑ. +.PP +Опции выбора пакетов ÑвлÑÑŽÑ‚ÑÑ Ð°Ð½Ð°Ð»Ð¾Ð³Ð¸Ñ‡Ð½Ñ‹Ð¼Ð¸ запроÑу пакетов (Ð²ÐºÐ»ÑŽÑ‡Ð°Ñ +файлы манифеÑта пакета в качеÑтве аргумента). +Опции, уникальные Ð´Ð»Ñ Ñ€ÐµÐ¶Ð¸Ð¼Ð° проверки, приведены ниже: +.TP +\fB-\-nodeps\fR +Ðе выполнÑÑ‚ÑŒ проверку завиÑимоÑтей пакетов. +.TP +\fB-\-nodigest\fR +Ðе проверÑÑ‚ÑŒ при чтении дайджеÑÑ‚ пакета или заголовка. +.TP +\fB-\-nofiles\fR +Ðе проверÑÑ‚ÑŒ атрибуты файлов пакетов. +.TP +\fB-\-noscripts\fR +Ðе выполнÑÑ‚ÑŒ Ñкриптлет \fB%verifyscript\fR (еÑли ÑущеÑтвует). +.TP +\fB-\-nosignature\fR +Ðе проверÑÑ‚ÑŒ при чтении подпиÑÑŒ пакета или заголовка при чтении. +.TP +\fB-\-nolinkto\fR +.TP +\fB-\-nomd5\fR +.TP +\fB-\-nosize\fR +.TP +\fB-\-nouser\fR +.TP +\fB-\-nogroup\fR +.TP +\fB-\-nomtime\fR +.TP +\fB-\-nomode\fR +.TP +\fB-\-nordev\fR +Ðе проверÑÑ‚ÑŒ ÑоответÑтвующие атрибуты файлов. +.PP +Формат вывода предÑтавлÑет Ñобой Ñтроку из 8 Ñимволов и маркера из заголовка пакета, +за которыми Ñледует Ð¸Ð¼Ñ Ñ„Ð°Ð¹Ð»Ð°. Возможные маркеры атрибутов приведены ниже: + +.nf +\fBc\fR \fB%config\fR конфигурационный файл. +\fBd\fR \fB%doc\fR файл документации. +\fBg\fR \fB%ghost\fR файл (Ñ‚.е. Ñодержимое файла не включено в ÑоÑтав пакета). +\fBl\fR \fB%license\fR файл Ñ Ð»Ð¸Ñ†ÐµÐ½Ð·Ð¸ÐµÐ¹. +\fBr\fR \fB%readme\fR файл readme. +.fi + +Каждый из 8 Ñимволов отражает результат проверки атрибута(ов) файлов Ñ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸ÐµÐ¼ +того же атрибута, запиÑанного в базе данных. Символ +"\fB.\fR" (точка) +означает, что проверка прошла, а Ñимвол +"\fB?\fR" (вопроÑительный знак) +означает, что проверка не может быть выполнена (например, права доÑтупа к файлу не +позволÑÑŽÑ‚ провеÑти чтение). Ð’ противном Ñлучае будут отображены Ñимволы (Ð´Ð»Ñ Ð¿Ñ€Ð¸Ð²Ð»ÐµÑ‡ÐµÐ½Ð¸Ñ +Ð²Ð½Ð¸Ð¼Ð°Ð½Ð¸Ñ Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ñ‹ жирным), показывающие Ñбой проверки ÑоответÑтвующего \fB-\-verify\fR теÑта: + +.nf +\fBS\fR размер (\fBS\fRize) файла отличаетÑÑ +\fBM\fR режим (\fBM\fRode) доÑтупа отличаетÑÑ (Ð²ÐºÐ»ÑŽÑ‡Ð°Ñ Ð¿Ñ€Ð°Ð²Ð° доÑтупа и тип файла) +\fB5\fR отличаетÑÑ ÐºÐ¾Ð½Ñ‚Ñ€Ð¾Ð»ÑŒÐ½Ð°Ñ MD\fB5\fR Ñумма +\fBD\fR отличаетÑÑ Ñтарший/младший номер файла уÑтройÑтва (\fBD\fRevice) +\fBL\fR отличаетÑÑ Ð¿ÑƒÑ‚ÑŒ ÑÑылки при read\fBL\fRink(2) +\fBU\fR отличаетÑÑ Ð²Ð»Ð°Ð´ÐµÐ»ÐµÑ† (\fBU\fRser) +\fBG\fR отличаетÑÑ Ð³Ñ€ÑƒÐ¿Ð¿Ð¾Ð²Ð¾Ðµ владение (\fBG\fRroup) +\fBT\fR отличаетÑÑ Ð²Ñ€ÐµÐ¼Ñ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ (m\fBT\fRime) +.fi + +.SS "ПРОВЕРКРЦИФРОВОЙ ПОДПИСИ И ДÐЙДЖЕСТÐ" +.PP +ÐžÐ±Ñ‰Ð°Ñ Ñ„Ð¾Ñ€Ð¼Ð° команд rpm по работе Ñ Ñ†Ð¸Ñ„Ñ€Ð¾Ð²Ð¾Ð¹ подпиÑью приведена ниже +.PP + + +\fBrpm\fR \fB-\-import\fR \fB\fIPUBKEY\fB\fR\fI ...\fR + + +\fBrpm\fR {\fB-\-checksig\fR} [\fB-\-nosignature\fR] [\fB-\-nodigest\fR] + \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR + +.PP +ÐžÐ¿Ñ†Ð¸Ñ \fB-\-checksig\fR проверÑет вÑе дайджеÑÑ‚Ñ‹ и подпиÑи, ÑодержащиеÑÑ Ð² +\fIPACKAGE_FILE\fR Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð²ÐµÑ€ÐºÐ¸ целоÑтноÑти и проиÑÑ…Ð¾Ð¶Ð´ÐµÐ½Ð¸Ñ Ð¿Ð°ÐºÐµÑ‚Ð°. +Обратите внимание, что подпиÑи теперь проверÑÑŽÑ‚ÑÑ Ð¿Ñ€Ð¸ каждом +чтении пакета и Ð¾Ð¿Ñ†Ð¸Ñ \fB-\-checksig\fR полезна Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð²ÐµÑ€ÐºÐ¸ +вÑех дайджеÑтов и подпиÑей, аÑÑоциированных Ñ Ð¿Ð°ÐºÐµÑ‚Ð¾Ð¼. +.PP +Цифровые подпиÑи не могут быть проверены без публичных ключей. +Публичный ключ в ASCII формате может быть добавлен в базу +данных \fBrpm\fR при иÑпользовании команды \fB-\-import\fR. +Импортированный публичный ключ заноÑитÑÑ Ð² заголовок и +управление ключами проводитÑÑ Ð°Ð½Ð°Ð»Ð¾Ð³Ð¸Ñ‡Ð½Ð¾ управлению пакетами. +Ðапример, вÑе импортированные ключи можно проÑмотреть при помощи: +.PP +\fBrpm -qa gpg-pubkey*\fR +.PP +ÐŸÐ¾Ð´Ñ€Ð¾Ð±Ð½Ð°Ñ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾ конкретном публичном ключе поÑле импорта +может быть отображена при запроÑе. Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾ ключе +Red Hat GPG/DSA: +.PP +\fBrpm -qi gpg-pubkey-db42a60e\fR +.PP +Ðаконец, публичный ключ может быть удален поÑле его импорта +также как пакет. Удаление ключа Red Hat GPG/DSA: +.PP +\fBrpm -e gpg-pubkey-db42a60e\fR +.SS "ПОДПИСЬ ПÐКЕТÐ" +.PP + +\fBrpm\fR \fB-\-addsign|-\-resign\fR \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR + +.PP +Обе опции \fB-\-addsign\fR и \fB-\-resign\fR +Ñоздают и вÑтавлÑÑŽÑ‚ новую подпиÑÑŒ Ð´Ð»Ñ ÐºÐ°Ð¶Ð´Ð¾Ð³Ð¾ указанного +файла \fIPACKAGE_FILE\fR, заменÑÑ ÑущеÑтвующие подпиÑи. +Эти две опции ÑущеÑтвуют по иÑторичеÑким причинам, +и разницы в поведении между ними ÑÐµÐ¹Ñ‡Ð°Ñ Ð½ÐµÑ‚. +.SS "ИСПОЛЬЗОВÐÐИЕ GPG ДЛЯ ПОДПИСИ ПÐКЕТОВ" +.PP +Ð”Ð»Ñ Ñ‚Ð¾Ð³Ð¾, чтобы подпиÑывать пакеты при помощи GPG, \fBrpm\fR +должен быть наÑтроен на запуÑк GPG и иметь возможноÑÑ‚ÑŒ +находить хранилище ключей Ñ Ñ‚Ñ€ÐµÐ±ÑƒÐµÐ¼Ñ‹Ð¼Ð¸ ключами. По умолчанию +\fBrpm\fR иÑпользует те же ÑоглашениÑ, что и GPG Ð´Ð»Ñ Ð¾Ð±Ð½Ð°Ñ€ÑƒÐ¶ÐµÐ½Ð¸Ñ +хранилища ключей, а именно переменную Ñреды \fB$GNUPGHOME\fR. +ЕÑли ваше хранилище ключей раÑполагаетÑÑ Ð½Ðµ там, где его +ожидает найти GPG, вам потребуетÑÑ Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»Ð¸Ñ‚ÑŒ в макроÑе +\fB%_gpg_path\fR +раÑположение хранилища ключей GPG. +.PP +Ð”Ð»Ñ ÑовмеÑтимоÑти Ñо Ñтарыми верÑиÑми GPG, PGP и rpm +Ñледует наÑтраивать только подпиÑÑŒ пакетов V3 OpenPGP. +Могут быть иÑпользованы алгоритмы проверки DSA и RSA, Ñ…Ð¾Ñ‚Ñ +предпочитаетÑÑ DSA. +.PP +ЕÑли вам требуетÑÑ Ð¿Ð¾Ð´Ð¿Ð¸Ñывать ÑобÑтвенные пакеты, вам также +потребуетÑÑ Ñоздать ÑобÑтвенную пару из публичного и приватного +ключа (Ñм. руководÑтво по GPG). Вам также потребуетÑÑ Ð½Ð°Ñтроить +\fBrpm\fR Ð¼Ð°ÐºÑ€Ð¾Ñ +.TP +\fB%_signature\fR +Типы подпиÑи. Ðа данный момент поддерживаютÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ gpg и pgp. +.TP +\fB%_gpg_name\fR +Ð˜Ð¼Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ, ключом которого будут подпиÑыватьÑÑ Ð²Ð°ÑˆÐ¸ пакеты. +.PP +Ðапример, Ð´Ð»Ñ Ð¸ÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ GPG Ð´Ð»Ñ Ð¿Ð¾Ð´Ð¿Ð¸Ñи пакетов от имени +\fI"John Doe "\fR +из хранилища ключей раÑположенного в \fI/etc/rpm/.gpg\fR, +иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÑ Ð¿Ñ€Ð¾Ð³Ñ€Ð°Ð¼Ð¼Ñƒ \fI/usr/bin/gpg\fR, вам потребуетÑÑ Ð²ÐºÐ»ÑŽÑ‡Ð¸Ñ‚ÑŒ Ñтроки +.PP +.nf +%_signature gpg +%_gpg_path /etc/rpm/.gpg +%_gpg_name John Doe +%_gpgbin /usr/bin/gpg +.fi +.PP +в файл наÑтройки макроÑов. Ð”Ð»Ñ Ð¾Ð±Ñ‰ÐµÑиÑтемной наÑтройки иÑпользуетÑÑ +\fI/etc/rpm/macros\fR и \fI~/.rpmmacros\fR Ð´Ð»Ñ ÐºÐ¾Ð½ÐºÑ€ÐµÑ‚Ð½Ð¾Ð³Ð¾ пользователÑ. +.SS "ОПЦИИ ПЕРЕСТРОЙКИ БÐЗЫ ДÐÐÐЫХ" +.PP +ÐžÐ±Ñ‰Ð°Ñ Ñ„Ð¾Ñ€Ð¼Ð° команды переÑтройки базы данных rpm приведена ниже +.PP + +\fBrpm\fR {\fB-\-initdb|-\-rebuilddb\fR} [\fB-v\fR] [\fB-\-dbpath \fIDIRECTORY\fB\fR] [\fB-\-root \fIDIRECTORY\fB\fR] + +.PP +ИÑпользуйте \fB-\-initdb\fR Ð´Ð»Ñ ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ Ð½Ð¾Ð²Ð¾Ð¹ базы данных и +\fB-\-rebuilddb\fR Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÑтройки индекÑов базы данных на оÑновании +заголовков уÑтановленных пакетов. +.SS "SHOWRC" +.PP +Команда +.PP +\fBrpm\fR \fB-\-showrc\fR +.PP +показывает значениÑ, которые \fBrpm\fR будет иÑпользовать +Ð´Ð»Ñ Ð²Ñех опций, уÑтановленные в конфигурационных файлах +\fIrpmrc\fR и +\fImacros\fR. +.SS "ОПЦИИ FTP/HTTP" +.PP +\fBrpm\fR может выÑтупать в качеÑтве клиента FTP и/или HTTP, +таким образом пакеты могут быть опрошены или уÑтановлены из Интернет. +Пакеты Ð´Ð»Ñ Ð¾Ð¿ÐµÑ€Ð°Ñ†Ð¸Ð¹ уÑтановки, Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð¸Ð»Ð¸ запроÑа могут +быть указаны в виде адреÑа +\fBftp\fR или +\fBhttp\fR +URL: +.PP +ftp://USER:PASSWORD@HOST:PORT/path/to/package.rpm +.PP +ЕÑли параметр \fB:PASSWORD\fR будет опущен, пароль будет запрошен +(один раз Ð´Ð»Ñ Ð¿Ð°Ñ€Ñ‹ пользователь/узел). ЕÑли опущены оба параметра +(user и password), будет выполнено анонимное подключение \fBftp\fR. +Во вÑех ÑлучаÑÑ… иÑпользуетÑÑ Ð¿Ð°ÑÑивный (PASV) режим передачи +файлов \fBftp\fR. +.PP +\fBrpm\fR допуÑкает Ñледующие опции Ð´Ð»Ñ Ð°Ð´Ñ€ÐµÑов +ftp URL: +.TP +\fB-\-ftpproxy \fIHOST\fB\fR +Узел \fIHOST\fR будет иÑпользован как прокÑи-Ñервер +Ð´Ð»Ñ Ð²Ñех операций передачи данных ftp, что позволÑет работать +Ñ ftp через межÑетевые Ñкраны, на которых запущена Ñлужба прокÑи. +Эта Ð¾Ð¿Ñ†Ð¸Ñ Ð¼Ð¾Ð¶ÐµÑ‚ быть также указана при +наÑтройке макроÑа \fB%_ftpproxy\fR. +.TP +\fB-\-ftpport \fIPORT\fB\fR +Ðомер TCP порта \fIPORT\fR будет иÑпользован Ð´Ð»Ñ ftp Ð¿Ð¾Ð´ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ +к ftp прокÑи-Ñерверу вмеÑто порта по умолчанию. Эта Ð¾Ð¿Ñ†Ð¸Ñ +может быть также указана при наÑтройке макроÑа \fB%_ftpport\fR. +.PP +\fBrpm\fR допуÑкает Ñледующие опции Ð´Ð»Ñ Ð°Ð´Ñ€ÐµÑов +\fBhttp\fR URL: +.TP +\fB-\-httpproxy \fIHOST\fB\fR +Узел \fIHOST\fR будет иÑпользован как прокÑи-Ñервер Ð´Ð»Ñ +вÑех операций передачи данных \fBhttp\fR. Эта Ð¾Ð¿Ñ†Ð¸Ñ +может быть также указана при наÑтройке макроÑа +\fB%_httpproxy\fR. +.TP +\fB-\-httpport \fIPORT\fB\fR +Ðомер TCP порта \fIPORT\fR будет иÑпользован Ð´Ð»Ñ \fBhttp\fR Ð¿Ð¾Ð´ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ +к http прокÑи-Ñерверу вмеÑто порта по умолчанию. Эта Ð¾Ð¿Ñ†Ð¸Ñ +может быть также указана при наÑтройке макроÑа \fB%_httpport\fR. +.SH "ВОПРОСЫ СОВМЕСТИМОСТИ" +.SS "Выполнение rpmbuild" +.PP +Режимы Ñборки rpm теперь вынеÑены в программу +\fI/usr/bin/rpmbuild\fR. +Ðе ÑÐ¼Ð¾Ñ‚Ñ€Ñ Ð½Ð° Ñто, ÑовмеÑтимоÑÑ‚ÑŒ, обеÑÐ¿ÐµÑ‡Ð¸Ð²Ð°ÐµÐ¼Ð°Ñ Ð¿Ñ€Ð¸ помощи popt +пÑевдонимов, указанных ниже, ÑвлÑетÑÑ Ð°Ð´ÐµÐºÐ²Ð°Ñ‚Ð½Ð¾Ð¹, но не Ñовершенной. +ПоÑтому ÑовмеÑтимоÑÑ‚ÑŒ режимов Ñборки через пÑевдонимы popt +удалена из rpm. УÑтановите пакет \fBrpmbuild\fR и проÑмотрите +документацию в \fBrpmbuild\fR(8) по вÑем режимам Ñборки \fBrpm\fR, +ранее приведенную здеÑÑŒ в \fBrpm\fR(8). +.PP +Добавьте Ñледующие Ñтроки в \fI/etc/popt\fR, +еÑли вы желаете вызывать \fBrpmbuild\fR из +командной Ñтроки \fBrpm\fR: +.PP +.nf +rpm exec -\-bp rpmb \-bp +rpm exec -\-bc rpmb \-bc +rpm exec -\-bi rpmb \-bi +rpm exec -\-bl rpmb \-bl +rpm exec -\-ba rpmb \-ba +rpm exec -\-bb rpmb \-bb +rpm exec -\-bs rpmb \-bs +rpm exec -\-tp rpmb \-tp +rpm exec -\-tc rpmb \-tc +rpm exec -\-ti rpmb \-ti +rpm exec -\-tl rpmb \-tl +rpm exec -\-ta rpmb \-ta +rpm exec -\-tb rpmb \-tb +rpm exec -\-ts rpmb \-ts +rpm exec -\-rebuild rpmb -\-rebuild +rpm exec -\-recompile rpmb -\-recompile +rpm exec -\-clean rpmb -\-clean +rpm exec -\-rmsource rpmb -\-rmsource +rpm exec -\-rmspec rpmb -\-rmspec +rpm exec -\-target rpmb -\-target +rpm exec -\-short-circuit rpmb -\-short-circuit +.fi +.SH "ФÐЙЛЫ" +.SS "ÐšÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ rpmrc" +.PP +.nf +\fI/usr/lib/rpm/rpmrc\fR +\fI/usr/lib/rpm/redhat/rpmrc\fR +\fI/etc/rpmrc\fR +\fI~/.rpmrc\fR +.fi +.SS "ÐšÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ Ð¼Ð°ÐºÑ€Ð¾Ñов" +.PP +.nf +\fI/usr/lib/rpm/macros\fR +\fI/usr/lib/rpm/redhat/macros\fR +\fI/etc/rpm/macros\fR +\fI~/.rpmmacros\fR +.fi +.SS "База данных" +.PP +.nf +\fI/var/lib/rpm/Basenames\fR +\fI/var/lib/rpm/Conflictname\fR +\fI/var/lib/rpm/Dirnames\fR +\fI/var/lib/rpm/Filemd5s\fR +\fI/var/lib/rpm/Group\fR +\fI/var/lib/rpm/Installtid\fR +\fI/var/lib/rpm/Name\fR +\fI/var/lib/rpm/Packages\fR +\fI/var/lib/rpm/Providename\fR +\fI/var/lib/rpm/Provideversion\fR +\fI/var/lib/rpm/Pubkeys\fR +\fI/var/lib/rpm/Removed\fR +\fI/var/lib/rpm/Requirename\fR +\fI/var/lib/rpm/Requireversion\fR +\fI/var/lib/rpm/Sha1header\fR +\fI/var/lib/rpm/Sigmd5\fR +\fI/var/lib/rpm/Triggername\fR +.fi +.SS "Временные файлы" +.PP +\fI/var/tmp/rpm*\fR +.SH "СМОТРИ ТÐКЖЕ" + +.nf +\fBpopt\fR(3), +\fBrpm2cpio\fR(8), +\fBrpmbuild\fR(8), +.fi + +\fBhttp://www.rpm.org/ +\fR +.SH "ÐВТОРЫ" + +.nf +Marc Ewing +Jeff Johnson +Erik Troan +.fi +.SH ПЕРЕВОД +.nf +Ðндрей Мартынов +.fi diff --git a/rpm-5.4.9/doc/ru/rpm2cpio.8 b/rpm-5.4.9/doc/ru/rpm2cpio.8 new file mode 100644 index 0000000..e10bc8a --- /dev/null +++ b/rpm-5.4.9/doc/ru/rpm2cpio.8 @@ -0,0 +1,26 @@ +.\" rpm2cpio - конвертирует пакет RPM в архив cpio +.TH rpm2cpio 8 "25 Ñ„ÐµÐ²Ñ€Ð°Ð»Ñ 2006" "Инвента" "Red Hat Linux" +.SH ÐÐЗВÐÐИЕ +rpm2cpio \- Извлекает архив cpio из RPM пакета +.SH ОБЗОР +\fBrpm2cpio\fP [Ð¸Ð¼Ñ Ñ„Ð°Ð¹Ð»Ð°] +.SH ОПИСÐÐИЕ +\fBrpm2cpio\fP конвертирует файл .rpm, заданный как его единÑтвенный аргумент, +в архив cpio на Ñтандартном выводе. ЕÑли в качеÑтве аргумента указано '\-', +RPM пакет ÑчитываетÑÑ Ñо Ñтандартного ввода. + +.br +.I "\fBrpm2cpio rpm-1.1-1.i386.rpm\fP" +.br +.I "\fBrpm2cpio - < glint-1.0-1.i386.rpm\fP" + +.SH СМОТРИ ТÐКЖЕ +.IR rpm (8) +.SH ÐВТОР +.nf +Erik Troan +.fi +.SH ПЕРЕВОД +.nf +Ðндрей Мартынов +.fi diff --git a/rpm-5.4.9/doc/sk/Makefile.am b/rpm-5.4.9/doc/sk/Makefile.am new file mode 100644 index 0000000..9c7a187 --- /dev/null +++ b/rpm-5.4.9/doc/sk/Makefile.am @@ -0,0 +1,21 @@ +## Process this file with automake to produce Makefile.in + +@SET_MAKE@ + +man_MANS = rpm.8 +mandir = @mandir@/sk + +EXTRA_DIST = $(man_MANS) + +install-data-hook: +if WITH_PATH_VERSIONED + -for p in $(man_MANS); do \ + case "$$p" in \ + *.1 ) mv $(DESTDIR)$(man1dir)/$${p} \ + `echo "$(DESTDIR)$(man1dir)/$${p}" | sed 's/\.1$$/-$(VERSION).1/'` ;; \ + *.8 ) mv $(DESTDIR)$(man8dir)/$${p} \ + `echo "$(DESTDIR)$(man8dir)/$${p}" | sed 's/\.8$$/-$(VERSION).8/'` ;; \ + esac; \ + done +endif + diff --git a/rpm-5.4.9/doc/sk/Makefile.in b/rpm-5.4.9/doc/sk/Makefile.in new file mode 100644 index 0000000..fcb36a6 --- /dev/null +++ b/rpm-5.4.9/doc/sk/Makefile.in @@ -0,0 +1,820 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +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@ +target_triplet = @target@ +subdir = doc/sk +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +man8dir = $(mandir)/man8 +am__installdirs = "$(DESTDIR)$(man8dir)" +NROFF = nroff +MANS = $(man_MANS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDROOTDIR_MACRO = @BUILDROOTDIR_MACRO@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBAPI = @DBAPI@ +DBLIBOBJS = @DBLIBOBJS@ +DBLIBSRCS = @DBLIBSRCS@ +DBPATH = @DBPATH@ +DBPATH_MACRO = @DBPATH_MACRO@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTRO_MACROS = @DISTRO_MACROS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIXPERMS = @FIXPERMS@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GPSEE_MODULES_PATH = @GPSEE_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_STATIC = @LDFLAGS_STATIC@ +LD_VERSION_SCRIPT_FLAG = @LD_VERSION_SCRIPT_FLAG@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOLIZE = @LIBTOOLIZE@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MACROFILES = @MACROFILES@ +MAGIC_MACRO = @MAGIC_MACRO@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR = @MKDIR@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NCPUS_COMMAND = @NCPUS_COMMAND@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENMP_CFLAGS = @OPENMP_CFLAGS@ +OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_INSTALLDIRS = @PERL_INSTALLDIRS@ +PERL_URPM_INSTALLDIRS = @PERL_URPM_INSTALLDIRS@ +PKGSRCDIR = @PKGSRCDIR@ +PKGSRCDIR_MACRO = @PKGSRCDIR_MACRO@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +ROOT_GROUP = @ROOT_GROUP@ +RPMCANONARCH = @RPMCANONARCH@ +RPMCANONCOLOR = @RPMCANONCOLOR@ +RPMCANONGNU = @RPMCANONGNU@ +RPMCANONOS = @RPMCANONOS@ +RPMCANONVENDOR = @RPMCANONVENDOR@ +RPMGID = @RPMGID@ +RPMGROUP = @RPMGROUP@ +RPMLUAFILES = @RPMLUAFILES@ +RPMPOPTFILES = @RPMPOPTFILES@ +RPMUID = @RPMUID@ +RPMUSER = @RPMUSER@ +RPM_TIMESTAMP = @RPM_TIMESTAMP@ +RPM_VENDOR = @RPM_VENDOR@ +RPM_VERSION = @RPM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFIGDIR = @SYSCONFIGDIR@ +USE_NLS = @USE_NLS@ +USRLIBRPM = @USRLIBRPM@ +VERSION = @VERSION@ +WITH_ACL = @WITH_ACL@ +WITH_APIDOCS = @WITH_APIDOCS@ +WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ +WITH_APR = @WITH_APR@ +WITH_ATERM = @WITH_ATERM@ +WITH_ATTR = @WITH_ATTR@ +WITH_AUGEAS = @WITH_AUGEAS@ +WITH_AUGEAS_AUGTOOL = @WITH_AUGEAS_AUGTOOL@ +WITH_BASH = @WITH_BASH@ +WITH_BASH_CPPFLAGS = @WITH_BASH_CPPFLAGS@ +WITH_BASH_LDFLAGS = @WITH_BASH_LDFLAGS@ +WITH_BASH_LIBS = @WITH_BASH_LIBS@ +WITH_BASH_SUBDIR = @WITH_BASH_SUBDIR@ +WITH_BEECRYPT = @WITH_BEECRYPT@ +WITH_BEECRYPT_CPPFLAGS = @WITH_BEECRYPT_CPPFLAGS@ +WITH_BEECRYPT_LDFLAGS = @WITH_BEECRYPT_LDFLAGS@ +WITH_BEECRYPT_LIBS = @WITH_BEECRYPT_LIBS@ +WITH_BEECRYPT_SUBDIR = @WITH_BEECRYPT_SUBDIR@ +WITH_BZIP2 = @WITH_BZIP2@ +WITH_CPUINFO = @WITH_CPUINFO@ +WITH_CUDF = @WITH_CUDF@ +WITH_CUDF_CUDFTOOL = @WITH_CUDF_CUDFTOOL@ +WITH_DB = @WITH_DB@ +WITH_DBSQL = @WITH_DBSQL@ +WITH_DBSQL_CPPFLAGS = @WITH_DBSQL_CPPFLAGS@ +WITH_DBSQL_LDFLAGS = @WITH_DBSQL_LDFLAGS@ +WITH_DBSQL_LIBS = @WITH_DBSQL_LIBS@ +WITH_DBSQL_SUBDIR = @WITH_DBSQL_SUBDIR@ +WITH_DB_CPPFLAGS = @WITH_DB_CPPFLAGS@ +WITH_DB_LDFLAGS = @WITH_DB_LDFLAGS@ +WITH_DB_LIBS = @WITH_DB_LIBS@ +WITH_DB_SUBDIR = @WITH_DB_SUBDIR@ +WITH_DMALLOC = @WITH_DMALLOC@ +WITH_EFENCE = @WITH_EFENCE@ +WITH_EXPAT = @WITH_EXPAT@ +WITH_FICL = @WITH_FICL@ +WITH_FICL_CPPFLAGS = @WITH_FICL_CPPFLAGS@ +WITH_FICL_LDFLAGS = @WITH_FICL_LDFLAGS@ +WITH_FICL_LIBS = @WITH_FICL_LIBS@ +WITH_FICL_SUBDIR = @WITH_FICL_SUBDIR@ +WITH_FILE = @WITH_FILE@ +WITH_FILE_CPPFLAGS = @WITH_FILE_CPPFLAGS@ +WITH_FILE_LDFLAGS = @WITH_FILE_LDFLAGS@ +WITH_FILE_LIBS = @WITH_FILE_LIBS@ +WITH_FILE_SUBDIR = @WITH_FILE_SUBDIR@ +WITH_GCRYPT = @WITH_GCRYPT@ +WITH_GNUTLS = @WITH_GNUTLS@ +WITH_GPSEE = @WITH_GPSEE@ +WITH_GPSEE_CPPFLAGS = @WITH_GPSEE_CPPFLAGS@ +WITH_GPSEE_LDFLAGS = @WITH_GPSEE_LDFLAGS@ +WITH_GPSEE_LIBS = @WITH_GPSEE_LIBS@ +WITH_GPSEE_SUBDIR = @WITH_GPSEE_SUBDIR@ +WITH_JS_SUBDIR = @WITH_JS_SUBDIR@ +WITH_KEYUTILS = @WITH_KEYUTILS@ +WITH_KEYUTILS_RPMKEY = @WITH_KEYUTILS_RPMKEY@ +WITH_LIBELF_DEBUGEDIT = @WITH_LIBELF_DEBUGEDIT@ +WITH_LIBGIT2 = @WITH_LIBGIT2@ +WITH_LIBGIT2_CPPFLAGS = @WITH_LIBGIT2_CPPFLAGS@ +WITH_LIBGIT2_LDFLAGS = @WITH_LIBGIT2_LDFLAGS@ +WITH_LIBGIT2_LIBS = @WITH_LIBGIT2_LIBS@ +WITH_LIBGIT2_SUBDIR = @WITH_LIBGIT2_SUBDIR@ +WITH_LIBTASN1 = @WITH_LIBTASN1@ +WITH_LUA = @WITH_LUA@ +WITH_LUA_CPPFLAGS = @WITH_LUA_CPPFLAGS@ +WITH_LUA_LDFLAGS = @WITH_LUA_LDFLAGS@ +WITH_LUA_LIBS = @WITH_LUA_LIBS@ +WITH_LUA_SUBDIR = @WITH_LUA_SUBDIR@ +WITH_LUA_SUBDIR_DEF = @WITH_LUA_SUBDIR_DEF@ +WITH_LUA_SUBDIR_LIB = @WITH_LUA_SUBDIR_LIB@ +WITH_MOZJS185 = @WITH_MOZJS185@ +WITH_MOZJS185_CPPFLAGS = @WITH_MOZJS185_CPPFLAGS@ +WITH_MOZJS185_LDFLAGS = @WITH_MOZJS185_LDFLAGS@ +WITH_MOZJS185_LIBS = @WITH_MOZJS185_LIBS@ +WITH_MOZJS185_SUBDIR = @WITH_MOZJS185_SUBDIR@ +WITH_NEON = @WITH_NEON@ +WITH_NEON_CPPFLAGS = @WITH_NEON_CPPFLAGS@ +WITH_NEON_LDFLAGS = @WITH_NEON_LDFLAGS@ +WITH_NEON_LIBS = @WITH_NEON_LIBS@ +WITH_NEON_SUBDIR = @WITH_NEON_SUBDIR@ +WITH_NIX = @WITH_NIX@ +WITH_NSS = @WITH_NSS@ +WITH_OPENSSL = @WITH_OPENSSL@ +WITH_PAKCHOIS = @WITH_PAKCHOIS@ +WITH_PATH_VERSIONED = @WITH_PATH_VERSIONED@ +WITH_PATH_VERSIONED_SUFFIX = @WITH_PATH_VERSIONED_SUFFIX@ +WITH_PCRE = @WITH_PCRE@ +WITH_PCRE_CPPFLAGS = @WITH_PCRE_CPPFLAGS@ +WITH_PCRE_LDFLAGS = @WITH_PCRE_LDFLAGS@ +WITH_PCRE_LIBS = @WITH_PCRE_LIBS@ +WITH_PCRE_SUBDIR = @WITH_PCRE_SUBDIR@ +WITH_PERLEMBED = @WITH_PERLEMBED@ +WITH_PERL_LIBS = @WITH_PERL_LIBS@ +WITH_PERL_SUBDIR = @WITH_PERL_SUBDIR@ +WITH_PERL_SUBPACKAGE = @WITH_PERL_SUBPACKAGE@ +WITH_PERL_URPM_LIBS = @WITH_PERL_URPM_LIBS@ +WITH_PERL_URPM_SUBDIR = @WITH_PERL_URPM_SUBDIR@ +WITH_PERL_URPM_SUBPACKAGE = @WITH_PERL_URPM_SUBPACKAGE@ +WITH_POPT = @WITH_POPT@ +WITH_POPT_CPPFLAGS = @WITH_POPT_CPPFLAGS@ +WITH_POPT_LDFLAGS = @WITH_POPT_LDFLAGS@ +WITH_POPT_LIBS = @WITH_POPT_LIBS@ +WITH_POPT_SUBDIR = @WITH_POPT_SUBDIR@ +WITH_PYTHONEMBED = @WITH_PYTHONEMBED@ +WITH_PYTHON_INCDIR = @WITH_PYTHON_INCDIR@ +WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ +WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ +WITH_RC = @WITH_RC@ +WITH_RC_CPPFLAGS = @WITH_RC_CPPFLAGS@ +WITH_RC_LDFLAGS = @WITH_RC_LDFLAGS@ +WITH_RC_LIBS = @WITH_RC_LIBS@ +WITH_RC_SUBDIR = @WITH_RC_SUBDIR@ +WITH_READLINE = @WITH_READLINE@ +WITH_RUBY = @WITH_RUBY@ +WITH_RUBY_CPPFLAGS = @WITH_RUBY_CPPFLAGS@ +WITH_RUBY_SUBDIR = @WITH_RUBY_SUBDIR@ +WITH_RUBY_VENDORARCHDIR = @WITH_RUBY_VENDORARCHDIR@ +WITH_SELINUX = @WITH_SELINUX@ +WITH_SEMANAGE = @WITH_SEMANAGE@ +WITH_SEMANAGE_SEMODULE = @WITH_SEMANAGE_SEMODULE@ +WITH_SEPOL = @WITH_SEPOL@ +WITH_SPIDERMONKEY_SUBDIR = @WITH_SPIDERMONKEY_SUBDIR@ +WITH_SQLITE = @WITH_SQLITE@ +WITH_SQLITE_CPPFLAGS = @WITH_SQLITE_CPPFLAGS@ +WITH_SQLITE_LDFLAGS = @WITH_SQLITE_LDFLAGS@ +WITH_SQLITE_LIBS = @WITH_SQLITE_LIBS@ +WITH_SQLITE_SUBDIR = @WITH_SQLITE_SUBDIR@ +WITH_SQUIRREL = @WITH_SQUIRREL@ +WITH_SUBVERSION = @WITH_SUBVERSION@ +WITH_SYCK = @WITH_SYCK@ +WITH_SYCK_CPPFLAGS = @WITH_SYCK_CPPFLAGS@ +WITH_SYCK_LDFLAGS = @WITH_SYCK_LDFLAGS@ +WITH_SYCK_LIBS = @WITH_SYCK_LIBS@ +WITH_SYCK_SUBDIR = @WITH_SYCK_SUBDIR@ +WITH_TCL = @WITH_TCL@ +WITH_TCL_SUBDIR = @WITH_TCL_SUBDIR@ +WITH_TOMCRYPT = @WITH_TOMCRYPT@ +WITH_TPM = @WITH_TPM@ +WITH_UNIXODBC = @WITH_UNIXODBC@ +WITH_UUID = @WITH_UUID@ +WITH_XAR = @WITH_XAR@ +WITH_XAR_CPPFLAGS = @WITH_XAR_CPPFLAGS@ +WITH_XAR_LDFLAGS = @WITH_XAR_LDFLAGS@ +WITH_XAR_LIBS = @WITH_XAR_LIBS@ +WITH_XAR_SUBDIR = @WITH_XAR_SUBDIR@ +WITH_XZ = @WITH_XZ@ +WITH_XZ_CPPFLAGS = @WITH_XZ_CPPFLAGS@ +WITH_XZ_LDFLAGS = @WITH_XZ_LDFLAGS@ +WITH_XZ_LIBS = @WITH_XZ_LIBS@ +WITH_XZ_SUBDIR = @WITH_XZ_SUBDIR@ +WITH_ZLIB = @WITH_ZLIB@ +WITH_ZLIB_CPPFLAGS = @WITH_ZLIB_CPPFLAGS@ +WITH_ZLIB_LDFLAGS = @WITH_ZLIB_LDFLAGS@ +WITH_ZLIB_LIBS = @WITH_ZLIB_LIBS@ +WITH_ZLIB_SUBDIR = @WITH_ZLIB_SUBDIR@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__BASH = @__BASH@ +__BZIP2 = @__BZIP2@ +__CAT = @__CAT@ +__CHATTR = @__CHATTR@ +__CHGRP = @__CHGRP@ +__CHGRP_RHF = @__CHGRP_RHF@ +__CHMOD = @__CHMOD@ +__CHOWN = @__CHOWN@ +__CHOWN_RHF = @__CHOWN_RHF@ +__CMAKE = @__CMAKE@ +__CPIO = @__CPIO@ +__CURL = @__CURL@ +__CVS = @__CVS@ +__DBSQL = @__DBSQL@ +__DB_ARCHIVE = @__DB_ARCHIVE@ +__DB_CHECKPOINT = @__DB_CHECKPOINT@ +__DB_DEADLOCK = @__DB_DEADLOCK@ +__DB_DUMP = @__DB_DUMP@ +__DB_HOTBACKUP = @__DB_HOTBACKUP@ +__DB_LOAD = @__DB_LOAD@ +__DB_LOG_VERIFY = @__DB_LOG_VERIFY@ +__DB_PRINTLOG = @__DB_PRINTLOG@ +__DB_RECOVER = @__DB_RECOVER@ +__DB_REPLICATE = @__DB_REPLICATE@ +__DB_SQL_CODEGEN = @__DB_SQL_CODEGEN@ +__DB_STAT = @__DB_STAT@ +__DB_TUNER = @__DB_TUNER@ +__DB_UPGRADE = @__DB_UPGRADE@ +__DB_VERIFY = @__DB_VERIFY@ +__DIFF = @__DIFF@ +__DITTO = @__DITTO@ +__DOXYGEN = @__DOXYGEN@ +__FILE = @__FILE@ +__GIT = @__GIT@ +__GPG = @__GPG@ +__GSR = @__GSR@ +__GST_INSPECT = @__GST_INSPECT@ +__GZIP = @__GZIP@ +__HG = @__HG@ +__ID = @__ID@ +__ID_U = @__ID_U@ +__INSTALL = @__INSTALL@ +__INSTALL_INFO = @__INSTALL_INFO@ +__LD = @__LD@ +__LDCONFIG = @__LDCONFIG@ +__LN = @__LN@ +__LRZIP = @__LRZIP@ +__LSATTR = @__LSATTR@ +__LZIP = @__LZIP@ +__LZMA = @__LZMA@ +__LZOP = @__LZOP@ +__MAKE = @__MAKE@ +__MKDIR = @__MKDIR@ +__MKDIR_P = @__MKDIR_P@ +__MODINFO = @__MODINFO@ +__MONGO = @__MONGO@ +__MV = @__MV@ +__NM = @__NM@ +__OBJCOPY = @__OBJCOPY@ +__OBJDUMP = @__OBJDUMP@ +__PATCH = @__PATCH@ +__PAX = @__PAX@ +__PERL = @__PERL@ +__PGP = @__PGP@ +__PHP = @__PHP@ +__PYTHON = @__PYTHON@ +__RM = @__RM@ +__RMDIR = @__RMDIR@ +__RSH = @__RSH@ +__RUBY = @__RUBY@ +__SED = @__SED@ +__SH = @__SH@ +__SQLITE3 = @__SQLITE3@ +__SSH = @__SSH@ +__STRIP = @__STRIP@ +__SVN = @__SVN@ +__TAR = @__TAR@ +__TCLSH = @__TCLSH@ +__UNZIP = @__UNZIP@ +__XZ = @__XZ@ +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_CXX = @ac_ct_CXX@ +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@ +autorelocate_dcolor = @autorelocate_dcolor@ +autorelocate_path = @autorelocate_path@ +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@ +exeext = @exeext@ +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@ +libext = @libext@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@/sk +mkdir_p = @mkdir_p@ +objext = @objext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +shlibext = @shlibext@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +testdir = @testdir@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrprefix = @usrprefix@ +varprefix = @varprefix@ +man_MANS = rpm.8 +EXTRA_DIST = $(man_MANS) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 doc/sk/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign doc/sk/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man8: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(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='$(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) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically \`make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi + @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 $(MANS) +installdirs: + for dir in "$(DESTDIR)$(man8dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-man + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +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-man8 + +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-man + +uninstall-man: uninstall-man8 + +.MAKE: install-am install-data-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + 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-hook install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man8 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 uninstall uninstall-am uninstall-man uninstall-man8 + + +@SET_MAKE@ + +install-data-hook: +@WITH_PATH_VERSIONED_TRUE@ -for p in $(man_MANS); do \ +@WITH_PATH_VERSIONED_TRUE@ case "$$p" in \ +@WITH_PATH_VERSIONED_TRUE@ *.1 ) mv $(DESTDIR)$(man1dir)/$${p} \ +@WITH_PATH_VERSIONED_TRUE@ `echo "$(DESTDIR)$(man1dir)/$${p}" | sed 's/\.1$$/-$(VERSION).1/'` ;; \ +@WITH_PATH_VERSIONED_TRUE@ *.8 ) mv $(DESTDIR)$(man8dir)/$${p} \ +@WITH_PATH_VERSIONED_TRUE@ `echo "$(DESTDIR)$(man8dir)/$${p}" | sed 's/\.8$$/-$(VERSION).8/'` ;; \ +@WITH_PATH_VERSIONED_TRUE@ esac; \ +@WITH_PATH_VERSIONED_TRUE@ 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/rpm-5.4.9/doc/sk/rpm.8 b/rpm-5.4.9/doc/sk/rpm.8 new file mode 100644 index 0000000..ff597c3 --- /dev/null +++ b/rpm-5.4.9/doc/sk/rpm.8 @@ -0,0 +1,636 @@ +.\" rpm - Red Hat Package Manager +.\" +.\" translated into slovak by Peter Ivanyi +.\" for rpm version 3.0.5-9.6x +.\" +.TH rpm 8 "22 December 1998" "Red Hat Software" "Red Hat Linux" + +.SH MENO +rpm \- Red Hat správca balíkov + +.SH POU®ITIE +\fBrpm\fP [voµby] + +.SH POPIS +\fBrpm\fP je veµmi výkonný \fIsprávca balíkov\fP, ktorý mô¾e by» +pou¾itý na zostavenie, in¹taláciu, výpis informácií, kontrolu, +aktualizáciu a odin¹talovanie jednotlivých softverových balíkov. +\fIBalík\fP obsahuje archív súborov a informácií o balíku vrátane +mena, verzie a popisu. + +Musí by» pou¾itý v niektorom z nasledujúcich re¾imov: +\fIinicializácia databázy\fP, \fIprebudovanie databázy\fP, +\fIzostavenie balíka\fP, \fIrekompilácia balíka\fP, +\fIzostavenie balíka z tar archívu\fP, \fIzistenie informácií\fP, +\fIvýpis informaèných tagov\fP, \fIin¹talácia\fP, \fIobèerstvenie\fP, +\fIodin¹talovanie\fP, \fIkontrola a overenie\fP, \fIoverenie podpisu\fP, +\fIopätovný podpis\fP, \fIpridanie podpisu\fP, +\fInastavenie vlastníkov a skupín\fP a \fIvýpis konfigurácie\fP. + +Spravovanie databázy: +.br +.I "\fB rpm \-i [\-\-initdb]\fP" +.br +.I "\fB rpm \-i [\-\-rebuilddb]\fP" + +Zostavenie: +.br +.I "\fB rpm [\-b|t] [balík_spec]+\fP" +.br +.I "\fB rpm [\-\-rebuild] [zdrojové_rpm]+\fP" +.br +.I "\fB rpm [\-\-tarbuild] [tarovaný_zdroj]+\fP" +.br + +Zistenie informácií: +.br +.I "\fB rpm [\-\-query] [zis»ovacie\-voµby]\fP" +.br +.I "\fB rpm [\-\-querytags]\fP" +.br + +Spravovanie in¹talovaných balíkov: +.br +.I "\fB rpm [\-\-install] [in¹talaèné\-voµby] [súbor_balíka]+\fP" +.br +.I "\fB rpm [\-\-freshen|\-F] [in¹talaèné\-voµby] [súbor_balíka]+\fP" +.br +.I "\fB rpm [\-\-uninstall|\-e] [odin¹talaèné\-voµby] [balík]+\fP" +.br +.I "\fB rpm [\-\-verify|\-V] [overovacie\-voµby] [balík]+\fP" +.br + +Podpisy (signatúry): +.br +.I "\fB rpm [\-\-verify|\-V] [overovacie\-voµby] [balík]+\fP" +.br +.I "\fB rpm [\-\-resign] [súbor_balíka]+\fP" +.br +.I "\fB rpm [\-\-addsign] [súbor_balíka]+\fP" +.br + +Rozlièné: +.br +.I "\fB rpm [\-\-showrc]\fP" +.br +.I "\fB rpm [\-\-setperms] [balík]+\fP" +.br +.I "\fB rpm [\-\-setgids] [balík]+\fP" +.br + + +.SH V©EOBECNÉ VO¥BY +Tieto voµby mô¾u by» pou¾ité vo v¹etkých re¾imoch. +.IP "\fB\-vv\fP" +Vypí¹e mno¾stvo o¹klivých ladiacich informácií. +.IP "\fB\-\-quiet\fP" +Vypí¹e èo najmenej informácií \- normálne sa zobrazia iba chybové hlá¹ky. +.IP "\fB\-\-help\fP" +Vypí¹e o nieèo dlh¹iu informáciu o pou¾ití ako je be¾ný výpis. +.IP "\fB\-\-version\fP" +Vypí¹e jednoriadkovú informáciu pozostávajúcu z èísla pou¾ívanej verzie +\fBrpm\fP. +.IP "\fB\-\-rcfile \fI\fP" +Ka¾dý zo súborov v \fI\fP oddelených dvojbodkami je +postupne èítaný cez \fBrpm\fP za úèelom získania konfiguraèných informácií. +Implicitný \fI\fP je +\fB/usr/lib/rpm/rpmrc:/etc/rpmrc:~/.rpmrc\fP. +Iba prvý súbor zo zoznamu súborov musí existova», a vlnovky (~) sú +expandované na hodnotu \fB$HOME\fP. +.IP "\fB\-\-root \fI\fP" +Pou¾ije adresár \fI\fP ako koreòový adresár systému pre v¹etky operácie. +Uvedomte si, ¾e toto znamená, ¾e databáza sa sa bude èíta» alebo modifikova» +pod adresárom \fI\fP a v¹etky predin¹talaèné a poin¹talaèné skripty +budú be¾a» po prevedení chroot() na adresár \fI\fP. +.IP "\fB\-\-dbpath \fI\fP" +Pou¾ije databázu RPM v ceste \fI\fP. +.IP "\fB\-\-justdb\fP" +Aktualizuje iba databázu a nie súborový systém. +.IP "\fB\-\-ftpproxy \fI\fP, \fB\-\-httpproxy \fI\fP" +Pou¾ije \fI\fP ako poèítaè s FTP alebo HTTP proxy serverom. +Bli¾¹ie podrobnosti sú uvedené v sekcii \fBVO¥BY FTP/HTTP\fP. +.IP "\fB\-\-ftpport \fI\fP, \fB\-\-httpport \fI\fP" +Pou¾ije \fI\fP ako FTP alebo HTTP port na poèítaèi s proxy serverom. +Bli¾¹ie podrobnosti sú uvedené v sekcii \fBVO¥BY FTP/HTTP\fP. +.IP "\fB\-\-pipe \fI\fP" +Presmeruje výstup \fBrpm\fP na príkaz \fI\fP. + + +.SH VO¥BY PRI IN©TALÁCII A AKTUALIZÁCII (UPGRADE) +V¹eobecná forma in¹talaèného príkazu je +.PP + \fBrpm \-i [in¹talaèné\-voµby] \fI+\fP +.PP +Táto voµba nain¹taluje nový balíèek. +V¹eobecná forma aktualizaèného príkazu je +.PP + \fBrpm \-U [in¹talaèné\-voµby] \fI+\fP +.PP +Táto voµba aktualizuje existujúci nain¹talovaný balíèek alebo nain¹taluje +nový balíèek. Podobá sa in¹talaènému príkazu, rozdiel je iba v tom, ¾e +v¹etky ïaµ¹ie verzie balíka sa odstránia zo systému. +.PP + \fBrpm [\-F|-\-freshen] [in¹talaèné\-voµby] \fI+\fP +.PP +Táto voµba aktualizuje balíky, ale iba za predpokladu, ¾e predchádzajúce +verzie sú nain¹talované. + +\fI\fP mô¾e by» ¹pecifikovaný ako ftp alebo http URL, +v tomto prípade sa najprv balíèek stiahne a nain¹taluje a¾ potom. +Bli¾¹ie podrobnosti o vstavanej podpore ftp a http sú uvedené v sekcii +\fBVO¥BY FTP/HTTP\fP. +.PP +.IP "\fB\-\-force\fP" +Rovnaký efekt ako súèasné pou¾itie \fB\-\-replacepkgs\fP, \fB\-\-replacefiles\fP a +\fB\-\-oldpackage\fP. +.IP "\fB\-h\fP, \fB\-\-hash\fP" +Vypí¹e 50 znakov #, keï je celý archív balíka rozbalený. Pre lep¹í +vzhµad je vhodné pou¾íva» s voµbou \fB\-v\fP. +.IP "\fB\-\-oldpackage\fP" +Povolí aktualizáciu prepísaním nov¹ieho balíka star¹ím. +.IP "\fB\-\-percent\fP" +Vypí¹e stav rozbalovania súborov z balíkového archívu v percentách. +Toto je praktické pri behu RPM z iných nástrojov. +.IP "\fB\-\-replacefiles\fP" +Nain¹taluje balík aj v prípade, ¾e nahradí súbory z iných, u¾ +nain¹talovaných balíkov. +.IP "\fB\-\-replacepkgs\fP" +Nain¹taluje balíky aj v prípade, ¾e niektoré z nich u¾ sú nain¹talované +v systéme. +.IP "\fB\-\-allfiles\fP" +Nain¹taluje alebo aktualizuje v¹etky missingok súbory (súbory, ktoré nemusia +nutne existova») z balíka bez ohµadu na to, èi existujú. +.IP "\fB\-\-nodeps\fP" +Nevykoná kontrolu závislostí pred in¹talovaním alebo aktualizovaním +balíka. +.IP "\fB\-\-noscripts\fP" +Nevykoná predin¹talaèné a poin¹talaèné skripty. +.IP "\fB\-\-notriggers\fP" +Nevykoná skripty, ktorých spú¹»ou je in¹talácia balíka. +.IP "\fB\-\-ignoresize\fP" +Nevykoná kontrolu pripojeného súborového systému na dostatok voµného miesta +pred in¹taláciou balíka. +.IP "\fB\-\-excludepath \fI\fP" +Nenain¹taluje súbory, ktorých mená zaèínajú na \fI\fP. +.IP "\fB\-\-excludedocs\fP" +Nenain¹taluje ¾iadne súbory, ktoré sú oznaèené ako dokumentácia (ktoré +zahàòajú najmä manuálové stránky a texinfo dokumenty). +.IP "\fB\-\-includedocs\fP" +Nain¹taluje súbory, ktoré sú oznaèené ako dokumentácia. Toto je implicitné +nastavenie. +.IP "\fB\-\-test\fP" +Nenain¹taluje balík, iba jednoducho otestuje, èo by sa vykonalo pri +in¹talácii a vypí¹e potenciálne konflikty. +.IP "\fB\-\-ignorearch\fP" +Toto umo¾ní in¹taláciu alebo aktualizáciu aj v prípade, ¾e sa nezhoduje +architektúra popísaná v binárnom RPM a poèítaèa, na ktorý sa má balík +in¹talova». +.IP "\fB\-\-ignoreos\fP" +Toto umo¾ní in¹taláciu alebo aktualizáciu aj v prípade, ¾e sa nezhoduje +operaèný systém popísaný v binárnom RPM a poèítaèi, na ktorý sa má balík +in¹talova». +.IP "\fB\-\-prefix \fI\fP" +Toto nastaví in¹talaèný prefix na \fI\fP pre relokovateµné +(premiestniteµné) balíky. +.IP "\fB\-\-relocate \fI\fB=\fI\fP" +Pre relokovateµné balíky, prelo¾í cestu súborov, ktoré sa mali umiestni» +na miesto \fI\fP do \fI\fP. +.IP "\fB\-\-badreloc\fP" +Vnúti relokáciu aj v prípade, ¾e balík nie je relokovateµný. Pou¾íva sa +spolu s voµbou \-\-relocate. +.IP "\fB\-\-noorder\fP" +Nezmení poradie balíkov na in¹taláciu. V opaènomom prípade by mohlo by» +zmenené poradie v zozname balíkov, aby sa zachovali závislosti. + + +.SH VO¥BY PRI ZISTENÍ INFORMÁCIÍ (QUERY) +V¹eobecná forma príkazu zistenia informácií je +.PP + \fBrpm \-q [zis»ovacie\-voµby]\fP +.PP +Je mo¾né ¹pecifikova», v akom formáte majú by» vypísané výstupné údaje. +Na takýto úèel slú¾i voµba \fB[\-\-queryformat|\-\-qf]\fP, nasledovaná +formátovacím re»azcom. + +Informaèné výstupy sú modifikovanou verziou ¹tandardného \fBprintf(3)\fP +formátovania. Formát je vytvorený zo statických re»azcov (ktoré mô¾u zahàòa» +¹tandardné C znakové escape sekvencie pre nový riadok, tabelátor a ïaµ¹ie +¹peciálne znaky a \fBprintf(3)\fP typové formátovaèe). Keï¾e \fBrpm\fP u¾ +vie, aky typ má vytlaèi», ¹pecifikátor typu musí by» vynechaný a nahradený +menom tagu hlavièky, ktorá má by» vytlaèená, uzavretý znakmi {}. RPMTAG_ +èas» mena tagu mô¾e by» vynechaná. + +Alternatívny výstup formátovania mô¾e by» po¾adovaný, ak je nasledovaný +tagom s \fB:\fItypetag\fR. Momentálne sú podporované nasledujúce typy: +\fBoctal\fR, \fBdate\fR, \fBshescape\fR, \fBperms\fR, \fBfflags\fR, a +\fBdepflags\fR. + +Napríklad na vytlaèenie informácie o mene balíka je mo¾né pou¾i» +formátovací re»azec \fB%{NAME}\fP. Na vytlaèenie informácie o mene +a distribúcii v dvoch ståpcoch je mo¾né pou¾i» +\fB%\-30{NAME}%{DISTRIBUTION}\fP. + +\fBrpm\fP zobrazí zoznam v¹etkých tagov, ktoré pozná, keï je spustené +s argumentom \fB\-\-querytags\fP. + +Existujú dve podmno¾iny volieb pre zistenie informácií: výber balíka a +výber informácií. + +Voµby výberu balíka: +.br +.IP "\fB\fI\fP" +Zis»uje u in¹talovaných balíkov s menom \fI\fP. +.IP "\fB\-a\fP, \fB\-\-all\fP" +Zis»uje u v¹etkých nain¹talovaných balíkov. +.IP "\fB\-\-whatrequires \fI\fP" +Zis»uje u v¹etkých in¹talovaných balíkov, ktoré vy¾adujú \fI\fP +pre správnu funkènos». +.IP "\fB\-\-whatprovides \fI\fP" +Zis»uje u v¹etkých in¹talovaných balíkov, ktoré poskytujú vlastnos» +\fI\fP. +.IP "\fB\-f \fI\fP, \fB\-\-file \fI\fP" +Zis»uje u balíka, ktorý vlastní súbor \fI\fP. +.IP "\fB\-g \fI\fP, \fB\-\-group \fI\fP" +Zis»uje u balíkov, ktoré majú skupinu \fI\fP. +.IP "\fB\-p \fI\fP" +Zis»uje u (nenain¹talovaného) balíka \fI\fP. +\fI\fP mô¾e by» ¹pecifikovaný v ftp alebo http ¹týle URL, +v takomto prípade bude stiahnutá hlavièka balíka, a z nej èítané po¾adované +informácie. Bli¾¹ie informácie o vstavanej podpore ftp a http klienta sú +v sekcii \fBFTP/HTTP VO¥BY\fP. +.IP "\fB\-\-specfile \fI\fP" +Rozanalyzuje \fI\fP a zis»uje informácie z tohto súboru, ako keby +to bol balík rpm. Aj napriek neprítomnosti v¹etkých informácií (napr. zoznam +súborov), tento druh zis»ovania umo¾òuje rpm získa» informácie zo spec súboru +bez nutnosti napísa» ¹peciálny analyzátor spec súborov. +.IP "\fB\-\-querybynumber \fI<èíslo>\fP" +Zis»uje u záznamu èíslo \fI<èíslo>\fP databázy priamo, toto je u¾itoèné pre +ladiace úèely. +.IP "\fB\-\-triggeredby \fI\fP" +Vypí¹e balíky, ktorých spú¹tou je existencia balíka \fI\fP. + +.P +Voµba výberu informácií: +.br +.IP "\fB\-i\fP" +Vypí¹e informácie o balíku, vrátane mena, verzie a popisu. Táto voµba +vyu¾íva \fB\-\-queryformat\fP, ak je ¹pecifikovaný. +.IP "\fB\-R\fP, \fB\-\-requires\fP" +Vypí¹e zoznam balíkov, na ktorých daný balík závisí. +.IP "\fB\-\-provides\fP" +Vypí¹e zoznam vlastností/schopností, ktoré poskytuje tento balík. +.IP "\fB\-\-changelog\fP" +Vypí¹e históriu zmien pre balík. +.IP "\fB\-l\fP, \fB\-\-list\fP" +Vypí¹e zoznam súborov v balíku. +.IP "\fB\-s\fP, \fB\-\-state\fP" +Vypí¹e \fIstavy\fP jednotlivých súborov v balíku (aplikuje voµbu +\fB\-l\fP). Stav jednotlivých súborov mô¾e by» \fInormal\fP (normálny), +\fInot installed\fP (nenain¹talovaný) alebo \fIreplaced\fP (nahradený). +.IP "\fB\-d\fP, \fB\-\-docfiles\fP" +Vypí¹e zoznam súborov oznaèených ako dokumentácia (aplikuje \fB\-l\fP). +.IP "\fB\-c\fP, \fB\-\-configfiles\fP" +Vypí¹e iba zoznam konfiguraèných súborov (aplikuje \fB\-l\fP). +.IP "\fB\-\-scripts\fP" +Vypí¹e balíkovo ¹pecifický shellový skript, ktorý je pou¾itý +v in¹talaènom alebo odin¹talaènom procese, ak nejaký vôbec existuje. +.IP "\fB\-\-triggers\fP, \fB\-\-triggerscripts\fP" +Vypí¹e skripty, ktoré sú spú¹»ané spú¹»ou, ak nejaká existuje a je +obsiahnutá v balíku. +.IP "\fB\-\-dump\fP" +Vypí¹e zoznam podrobných vlastností súborov pozostoávajúci z: +cesta veµkos» mtime md5sum mód vlastník skupina je_konfiguraèný_súbor +je_dokumentaèný_súbor rdev symlink. Táto voµba musí by» pou¾itá +minimálne s jednou z nasledujúcich volieb \fB\-l\fP, \fB\-c\fP, \fB\-d\fP. +.IP "\fB\-\-last\fP" +Usporiada zoznam balíkov podµa èasu in¹talácie takým spôsobom, ¾e posledný +in¹talovaný balík bude na vrchu. +.IP "\fB\-\-filesbypkg\fP" +Vypí¹e zoznam v¹etkých súborov v ka¾dom balíku. +.IP "\fB\-\-triggerscripts\fP" +Vypí¹e v¹etky skripty, ktoré sú spú¹»ané spú¹»ou vo vybranom balíku. + + +.SH VO¥BY PRI KONTROLE A OVEROVANÍ +V¹eobecná forma príkazu kontroly je +.PP + \fBrpm \-V|\-y|\-\-verify [overovacie\-voµby]\fP +.PP +Kontrola balíka prebieha z porovnania informácií z in¹talovaných súborov +z balíkov v systéme s informáciami o súboroch, ktoré obsahoval pôvodný balík +(tieto su ulo¾ené v rpm databáze). Okrem iných údajov, kontrola porovnáva +veµkos», MD5 kontrolný súèet, oprávnenia, typ, vlastníka a skupinu ka¾dého +súboru. V¹etky odchýµky sú zobrazené. Specifikaèné voµby balíka sú rovnaké +ako re¾ime výpisu informácii balíkov. + +Súbory, ktoré neboli in¹talované z balíka, týkajúce sa napr. dokumentaèných +súborov pri pou¾ití voµby "\fB\-\-excludedocs\fP" pri in¹talácii, sú v +tichosti ignorované. + +Voµby, ktoré mô¾u by» pou¾ité v kontrolnom re¾ime: + +.IP "\fB\-\-nofiles\fP" +Ignoruje chýbajúce súbory v systéme poèas kontroly. +.IP "\fB\-\-nomd5\fP" +Ignoruje chyby kontrolných súètov MD5 poèas kontroly. +.IP "\fB\-\-nopgp\fP" +Ignoruje chyby PGP podpisov poèas kontroly. + +Výstup má formát 8 znakového re»azca, s prípadným roz¹írením výskytu +"\fBc\fP", ktoré charakterizuje konfiguraèný súbor a mena súboru. +Ka¾dý z ôsmych znakov popisuje výsledok porovnania jedného konkrétneho +atribútu súboru s údajmi zaznamenanými v RPM databáze. Jednoduchá "\fB.\fP" +(bodka) znamená, ¾e test pre¹iel (neobjavené ¾iadne odchýµky). +Nasledujúce znaky oznamujú dôvod neúspechu urèitého testu: + +.IP "\fB5\fP" +MD5 kontrolný súèet +.IP "\fBS\fP" +Veµkos» súboru +.IP "\fBL\fP" +Symbolický link +.IP "\fBT\fP" +Mtime (posledný èas modifikácie) +.IP "\fBD\fP" +Zariadenie +.IP "\fBU\fP" +U¾ívateµ +.IP "\fBG\fP" +Skupina +.IP "\fBM\fP" +Mód (vrátane oprávnení a typu súborov) + + +.SH KONTROLA PODPISOV (SIGNATURE) +V¹eobecná forma príkazu kontroly rpm podpisu je +.PP + \fBrpm \-\-checksig \fI+\fP +.PP +Takto sa overuje PGP podpis balíka \fI\fP na uistenie +sa o jeho integrite a pôvode. +Konfiguraèné informácie PGP sú èítané z konfiguraèných súborov. +Bli¾¹ie údaje sa nachádzajú v sekcii PGP POPDPISY. + + +.SH VO¥BY PRI ODIN©TALÁCII +V¹eobecná forma príkazu na odin¹talovanie je +.PP + \fB rpm \-e \fI+\fP +.PP +.IP "\fB\-\-allmatches\fP" +Odstráni v¹etky verzie balíka, ktoré súhlasia s menom \fI\fR. +Normálne sa vyvolá chyba, ak viac balíkov súhlasí s menom +\fI\fR. +.IP "\fB\-\-noscripts\fP" +Nevykoná pred a po odin¹talaèné skripty. +.IP "\fB\-\-notriggers\fP" +Nevykoná skripty, ktorých spú¹»ou je odin¹talovanie balíka. +.IP "\fB\-\-nodeps\fP" +Nebude skúma» závislosti pri odin¹talovaní balíkov. +.IP "\fB\-\-test\fP" +Niè sa v skutoènosti neodin¹taluje, len sa preverí, èo by sa malo sta». +Veµmi u¾itoèné s voµbou \fB\-vv\fP. + + +.SH VO¥BY PRI ZOSTAVOVANÍ +V¹eobecná forma príkazu na zostavenie rpm je +.PP + \fBrpm \-[b|t]\fIO\fP [zostavovacie\-voµby] \fI+\fP +.PP +Argumentom je \fB-b\fR, ak sa na zostavenie balíka pou¾ije spec súbor +(súbor ¹pecifikácií balíka) alebo \fB-t\fR, ak \fBRPM\fR má vyhµada» +spec súbor vnútri gzipovaného (alebo komprimovaného) tar archívu, a tento +pou¾i» na zostavenie balíka. Po prvom argumente ïaµ¹í argument (\fIO\fR) +¹pecifikuje fázu ¹tádia zostavenia a zabalenia, ktorá sa má vykona», a +ktorá je jedna z: + +.IP "\fB\-bp\fP" +Vykoná "%prep" fázu pre spec súbor. Normálne toto vyvolá rozbalenie +zdrojových archívov a aplikovanie záplat. +.IP "\fB\-bl\fP" +Vykoná "kontrolu zoznamu". Sekcia "%files" z spec súboru je makrom +expandovaná, a je vykonaná kontrola, ¾e ka¾dý súbor existuje. +.IP "\fB\-bc\fP" +Vykoná fázu "%build" pre spec súbor (po vykonaní prep fázy). Toto +normálne vyvolá ekvivalent príkazu "make". +.IP "\fB\-bi\fP" +Vykoná fázu "%install" zo spec súboru (po vykonaní prep a build fázy). +Toto vo v¹eobecnosti vyvolá ekvivalent príkazu "make install". +.IP "\fB\-bb\fP" +Zostaví binárny balík (po vykonaní prep, build a install fázy). +.IP "\fB\-bs\fP" +Zostaví iba zdrojový balík (po vykonaní prep, build a install fázy). +.IP "\fB\-ba\fP" +Zostaví binárny a zdrojový balík (po vykonaní prep, build a install fázy). +.PP +Mô¾u by» pou¾ité aj nasledujúce voµby: +.IP "\fB\-\-short\-circuit\fP" +Preskoèí priamo na po¾adovanú fázu (t. zn. preskoèí v¹etky fázy ¹tádia +zostavenia, ktoré predchádzajú ¹pecifikovanej fáze). Táto voµba je platná +iba s prepínaèmi \fB\-bc\fP and \fB\-bi\fP. +.IP "\fB\-\-timecheck\fP" +Nastavuje "kontrolu èasu" (0 zaká¾e). Táto voµba mô¾e by» nastavená +definovaním makra "_timecheck". Hodnota "kontroly èasu" vyjadruje +(v sekundách) maximálny vek súborov, ktoré budú zabalené. Varovania +sú vypisované pre v¹etky súbory, ktorých vek je za hranicou takto +definovanej hodnoty. +.IP "\fB\-\-clean\fP" +Odstrání zostavovací strom (adresár) potom, èo sa vytvorí balík. +.IP "\fB\-\-rmsource\fP" +Odstrání zdrojové súbory a spec súbor po zostavení (mô¾e sa pou¾íva» aj +samostatne, napr. "\fBrpm \-\-rmsource foo.spec\fP"). +.IP "\fB\-\-test\fP" +Nevykoná ¾iadnu zo zostavovacej fázy. +U¾itoèné pre otestovanie spec súboru. +.IP "\fB\-\-sign\fP" +Vlo¾í PGP podpis do balíka. Tento podpis mô¾e by» vyu¾itý na overenie +integrity a pôvodu balíka. Bli¾¹ie informácie na nastavenie sú uvedené +v sekcii PGP PODPISY. +.IP "\fB\-\-buildroot \fI\fP" +Pri zostavovaní balíka prepí¹e tag BuildRoot adresárom \fI\fP. +.IP "\fB\-\-target \fI\fP" +Pri zostavovaní balíka sa interpretuje \fI\fP ako +\fBarch-vendor-os\fP a makrá \fB_target\fP, \fB_target_arch\fP a +\fB_target_os\fP sa nastavia podµa tejto hodnoty. +.IP "\fB\-\-buildarch \fI\fP" +Pri zostavovaní balíka nastaví architektúru na \fI\fP. Táto +voµba sa stala zastaralou pou¾itím \fB\-\-target\fI v RPM 3.0. +.IP "\fB\-\-buildos \fI\fP" +Pri zostavovaní balíka nastaví architektúru na \fI\fP.Táto +voµba sa stala zastaralou pou¾itím \fB\-\-target\fI v RPM 3.0. + + +.SH VO¥BY PRI ZNOVUZOSTAVOVANÍ A REKOMPILOVANÍ + +Existujú dve voµby, ako spusti» zostavenie balíka s rpm: + +.I "\fBrpm \-\-recompile \fI+\fP" + +.I "\fBrpm \-\-rebuild \fI+\fP" + +Keï je rpm spustené týmto spôsobom, \fBrpm\fP nain¹taluje zdrojový balík a +vykoná postupne fázy prípravy (prep), kompilácie a in¹talácie. Prídavne +s voµbou \fB\-\-rebuild\fP zostaví nový binárny balík. Keï sa zostavenie +dokonèí, adresár zostavovania (ako pri \fB\-\-clean\fP), zdrojové súbory, +ako aj spec súbor sa sa odstránia. + + +.SH PODPISOVANIE EXISTUJÚCEHO RPM + +.I "\fBrpm \-\-resign \fI+\fP" + +Táto voµba vygeneruje a vlo¾í nový podpis pre zoznam balíkov. +V¹etky prípadne existujúce podpisy sa odstránia. + +.I "\fBrpm \-\-addsign \fI+\fP" + +Táto voµba vygeneruje a pridá nový podpis pre zoznam balíkov u ktorých +u¾ podpis existuje. + + +.SH PGP PODPISY + +Aby bolo mo¾né pou¾íva» vlastnosti podpisovania, RPM je potrebné nastavi» +spôsobom, aby mohlo spú¹»a» PGP, a aby bolo schopné nájs» zväzok verejných +kµúèov s RPM verejnými kµúèmi v òom. Implicitne RPM pou¾íva implicitné +hodnoty PGP na nájdenie zväzkov kµúèov (honorujúc PGPPATH). +Ak je zväzok kµúèov umiestnený na inom mieste, ako PGP oèakáva, je potrebné +nastavi» makro + +.IP "\fB_pgp_path\fP" +na definovanie umiestnenia zväzkov kµúèov PGP, ktoré sa majú pou¾i». +.PP + +Ak si ¾eláte podpisova» balíky, ktoré si sami vytvoríte, potrebujete +podobným spôsobom vytvori» vá¹ verejný a tajný kµúèový pár (bli¾¹ie informácie +sú v dokumentácii ku PGP). +Taktie¾ potrebujete konfigurova» makrá: + +.IP "\fB_signature\fP" +Typ podpisu. Momentálne je podporované iba pgp. +.IP "\fB_pgp_name\fP" +Meno "u¾ívateµa", ktorého kµúèom sa má podpísa» balík. +.PP + +Pri zostavovaní balíka je potrebné prida» \-\-sign do príkazového +riadku. Nasledovne sa objaví výzva na heslo, a po správnom zadadaní +sa balík zostaví a podpí¹e. + +Napríkad pre pou¾itie PGP na podpísanie balíka ako u¾ívateµ +\fB"John Doe "\fP zo zväzku kµúèov umiestnených +v \fB/etc/rpm/.pgp\fP pou¾itím \fB/usr/bin/pgp\fP zápis bude +obsahova» + +.I "\fB%_signature pgp\fP" + +.I "\fB%_pgp_path /etc/rpm/.pgp\fP" + +.I "\fB%_pgp_name John Doe \fP" + +.I "\fB%_pgpbin /usr/bin/pgp\fP" + +v konfiguraènom súbore makier: \fB/etc/rpm/macros\fP je urèený na +per-systém nastavenie a \fB~/.rpmmacros\fP na per-u¾ívateµ nastavenie. + + +.SH VO¥BY PRI PREBUDOVANÍ DATABÁZY +V¹eobecná forma príkazu prebudovania databázy je +.PP + \fBrpm \-\-rebuilddb\fP +.PP + +Na vybudovanie novej databázy treba vykona» +.PP + \fBrpm \-\-initdb\fP +.PP + +Jedinými voµbami pre tento re¾im sú \fB-\-dbpath\fP a \fB-\-root\fP. + + +.SH SHOWRC + +Spustením + +.PP + \fBrpm \-\-showrc\fP + +.PP +sa vypí¹u hodnoty, ktoré bude RPM pou¾íva» pri v¹etkých voµbách, a +ktoré mô¾u by» nastavené v \fIrpmrc\fP súboroch. + + +.SH FTP/HTTP VO¥BY + +RPM obsahuje jednoduchého FTP a HTTP klienta na zjednodu¹enie in¹talácie +a jednoduch¹ieho získania informácií balíkov, ktoré sú umiestenené na sieti. +Súbory balíkov urèené pre in¹talovanie, aktualizáciu a výpis informácií je +mo¾né ¹pecifikova» v ftp alebo http ¹týle URL: + +.PP + \fBftp://:@poèítaè:/path/to/package.rpm\fP +.PP +Ak èas» \fB:heslo\fP chýba, objaví sa výzva na heslo (v¾dy len jeden krát +pre pár u¾ívateµ/poèítaè). Ak chýbajú obe èasti - u¾ívateµ aj heslo, pou¾itý +je anonymný ftp. Vo v¹etkých prípadoch je pou¾itý pasívny (PASV) ftp prenos. + +RPM povoluje pou¾i» nasledujúce voµby s ftp URL: + +.IP "\fB\-\-ftpproxy \fI\fP" +Poèítaè \fI\fP sa pou¾ije ako proxy server pre v¹etky ftp +prenosy, èo umo¾ní u¾ívateµom pou¾i» ftp slu¾by za firewallom, ktorý +pou¾íva proxy systémy. +Táto voµba mô¾e by» tak isto ¹pecifikovaná nastavením makra \fB_ftpproxy\fP. + +.IP "\fB\-\-ftpport \fI\fP" +Pou¾ije sa èíslo TCP portu \fI\fP pre ftp spojenie s ftp proxy +serverom namiesto implicitného portu. Táto voµba mô¾e by» tak isto +¹pecifikovaná nastavením makra \fB_ftpport\fP. +.PP + +RPM umo¾òuje nasledujúce voµby pri pou¾ití http URL: + +.IP "\fB\-\-httpproxy \fI\fP" +Poèítaè \fI\fP bude pou¾itý ako proxy server pre v¹etky http +prenosy. +Táto voµba mô¾e by» tak isto ¹pecifikovaná konfigurovaním makra +\fB_httpproxy\fP. + +.IP "\fB\-\-httpport \fI\fP" +Pou¾ije sa èíslo TCP portu \fI\fP pre http spojenie s http proxy +serverom namiesto implicitného portu. +Táto voµba mô¾e by» tie¾ ¹pecifikovaná konfigurovaním makra +\fB_httpport\fP. +.PP + + +.SH SÚBORY +.nf +/usr/lib/rpm/rpmrc +/etc/rpmrc +~/.rpmrc +/usr/lib/rpm/macros +/etc/rpm/macros +~/.rpmmacros +/var/lib/rpm/conflictsindex.rpm +/var/lib/rpm/fileindex.rpm +/var/lib/rpm/groupindex.rpm +/var/lib/rpm/nameindex.rpm +/var/lib/rpm/packages.rpm +/var/lib/rpm/providesindex.rpm +/var/lib/rpm/requiredby.rpm +/var/lib/rpm/triggerindex.rpm +/tmp/rpm* +.fi +.El + +.SH PRÍBUZNÁ DOKUMENTÁCIA +.IR glint (8) , +.IR rpm2cpio (8) , +.B http://www.rpm.org/ +.nf +.SH AUTORI +.nf +Marc Ewing +Jeff Johnson +Erik Troan +.fi diff --git a/rpm-5.4.9/install-sh b/rpm-5.4.9/install-sh new file mode 100755 index 0000000..a9244eb --- /dev/null +++ b/rpm-5.4.9/install-sh @@ -0,0 +1,527 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2011-01-19.21; # 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. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +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 + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for `test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# 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/rpm-5.4.9/js/.cvsignore b/rpm-5.4.9/js/.cvsignore new file mode 100644 index 0000000..f43ad68 --- /dev/null +++ b/rpm-5.4.9/js/.cvsignore @@ -0,0 +1,13 @@ +.deps +Makefile +Makefile.in +.libs +*.gcda +*.gcno +*.la +*.lo +README +gsr +jsd +rpmdb +src diff --git a/rpm-5.4.9/js/Makefile b/rpm-5.4.9/js/Makefile new file mode 100644 index 0000000..294f901 --- /dev/null +++ b/rpm-5.4.9/js/Makefile @@ -0,0 +1,2207 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# js/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. + + + +# Makefile for rpm library. + + + + +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/rpm +pkgincludedir = $(includedir)/rpm +pkglibexecdir = $(libexecdir)/rpm +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 = x86_64-unknown-linux-gnu +host_triplet = x86_64-unknown-linux-gnu +target_triplet = x86_64-unknown-linux-gnu +EXTRA_PROGRAMS = +pkgbin_PROGRAMS = ngsr$(EXEEXT) +subdir = js +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(pkgbindir)" +LTLIBRARIES = $(module_LTLIBRARIES) $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = $(top_builddir)/misc/librpmmisc.la +am__DEPENDENCIES_2 = $(top_builddir)/rpmio/librpmio.la \ + $(am__DEPENDENCIES_1) +am__DEPENDENCIES_3 = $(top_builddir)/rpmdb/librpmdb.la \ + $(am__DEPENDENCIES_2) +am__DEPENDENCIES_4 = $(top_builddir)/lib/librpm.la \ + $(am__DEPENDENCIES_3) +librpmjsm_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_librpmjsm_la_OBJECTS = librpmjsm_la-rpmaug-js.lo \ + librpmjsm_la-rpmbc-js.lo librpmjsm_la-rpmbf-js.lo \ + librpmjsm_la-rpmcudf-js.lo librpmjsm_la-rpmdb-js.lo \ + librpmjsm_la-rpmdbc-js.lo librpmjsm_la-rpmdbe-js.lo \ + librpmjsm_la-rpmdc-js.lo librpmjsm_la-rpmdig-js.lo \ + librpmjsm_la-rpmdir-js.lo librpmjsm_la-rpmds-js.lo \ + librpmjsm_la-rpmfc-js.lo librpmjsm_la-rpmfi-js.lo \ + librpmjsm_la-rpmfts-js.lo librpmjsm_la-rpmgi-js.lo \ + librpmjsm_la-rpmhdr-js.lo librpmjsm_la-rpmio-js.lo \ + librpmjsm_la-rpmiob-js.lo librpmjsm_la-rpmmc-js.lo \ + librpmjsm_la-rpmmg-js.lo librpmjsm_la-rpmmi-js.lo \ + librpmjsm_la-rpmmpf-js.lo librpmjsm_la-rpmmpw-js.lo \ + librpmjsm_la-rpmps-js.lo librpmjsm_la-rpmseq-js.lo \ + librpmjsm_la-rpmsm-js.lo librpmjsm_la-rpmsp-js.lo \ + librpmjsm_la-rpmst-js.lo librpmjsm_la-rpmsw-js.lo \ + librpmjsm_la-rpmsx-js.lo librpmjsm_la-rpmsys-js.lo \ + librpmjsm_la-rpmte-js.lo librpmjsm_la-rpmts-js.lo \ + librpmjsm_la-rpmtxn-js.lo librpmjsm_la-rpmxar-js.lo \ + librpmjsm_la-syck-js.lo librpmjsm_la-uuid-js.lo +librpmjsm_la_OBJECTS = $(am_librpmjsm_la_OBJECTS) +librpmjsm_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(librpmjsm_la_CFLAGS) \ + $(CFLAGS) $(librpmjsm_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmaug_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmaug_module_la_OBJECTS = rpmaug_module_la-rpmaug-js.lo +rpmaug_module_la_OBJECTS = $(am_rpmaug_module_la_OBJECTS) +rpmaug_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmaug_module_la_CFLAGS) \ + $(CFLAGS) $(rpmaug_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmbc_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmbc_module_la_OBJECTS = rpmbc_module_la-rpmbc-js.lo +rpmbc_module_la_OBJECTS = $(am_rpmbc_module_la_OBJECTS) +rpmbc_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmbc_module_la_CFLAGS) \ + $(CFLAGS) $(rpmbc_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmbf_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmbf_module_la_OBJECTS = rpmbf_module_la-rpmbf-js.lo +rpmbf_module_la_OBJECTS = $(am_rpmbf_module_la_OBJECTS) +rpmbf_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmbf_module_la_CFLAGS) \ + $(CFLAGS) $(rpmbf_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmcudf_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmcudf_module_la_OBJECTS = rpmcudf_module_la-rpmcudf-js.lo +rpmcudf_module_la_OBJECTS = $(am_rpmcudf_module_la_OBJECTS) +rpmcudf_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(rpmcudf_module_la_CFLAGS) $(CFLAGS) \ + $(rpmcudf_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmdb_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmdb_module_la_OBJECTS = rpmdb_module_la-rpmdb-js.lo +rpmdb_module_la_OBJECTS = $(am_rpmdb_module_la_OBJECTS) +rpmdb_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmdb_module_la_CFLAGS) \ + $(CFLAGS) $(rpmdb_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmdbc_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmdbc_module_la_OBJECTS = rpmdbc_module_la-rpmdbc-js.lo +rpmdbc_module_la_OBJECTS = $(am_rpmdbc_module_la_OBJECTS) +rpmdbc_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmdbc_module_la_CFLAGS) \ + $(CFLAGS) $(rpmdbc_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmdbe_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmdbe_module_la_OBJECTS = rpmdbe_module_la-rpmdbe-js.lo +rpmdbe_module_la_OBJECTS = $(am_rpmdbe_module_la_OBJECTS) +rpmdbe_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmdbe_module_la_CFLAGS) \ + $(CFLAGS) $(rpmdbe_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmdc_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmdc_module_la_OBJECTS = rpmdc_module_la-rpmdc-js.lo +rpmdc_module_la_OBJECTS = $(am_rpmdc_module_la_OBJECTS) +rpmdc_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmdc_module_la_CFLAGS) \ + $(CFLAGS) $(rpmdc_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmdig_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmdig_module_la_OBJECTS = rpmdig_module_la-rpmdig-js.lo +rpmdig_module_la_OBJECTS = $(am_rpmdig_module_la_OBJECTS) +rpmdig_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmdig_module_la_CFLAGS) \ + $(CFLAGS) $(rpmdig_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmdir_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmdir_module_la_OBJECTS = rpmdir_module_la-rpmdir-js.lo +rpmdir_module_la_OBJECTS = $(am_rpmdir_module_la_OBJECTS) +rpmdir_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmdir_module_la_CFLAGS) \ + $(CFLAGS) $(rpmdir_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmds_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmds_module_la_OBJECTS = rpmds_module_la-rpmds-js.lo +rpmds_module_la_OBJECTS = $(am_rpmds_module_la_OBJECTS) +rpmds_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmds_module_la_CFLAGS) \ + $(CFLAGS) $(rpmds_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmfc_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmfc_module_la_OBJECTS = rpmfc_module_la-rpmfc-js.lo +rpmfc_module_la_OBJECTS = $(am_rpmfc_module_la_OBJECTS) +rpmfc_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmfc_module_la_CFLAGS) \ + $(CFLAGS) $(rpmfc_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmfi_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmfi_module_la_OBJECTS = rpmfi_module_la-rpmfi-js.lo +rpmfi_module_la_OBJECTS = $(am_rpmfi_module_la_OBJECTS) +rpmfi_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmfi_module_la_CFLAGS) \ + $(CFLAGS) $(rpmfi_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmfts_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmfts_module_la_OBJECTS = rpmfts_module_la-rpmfts-js.lo +rpmfts_module_la_OBJECTS = $(am_rpmfts_module_la_OBJECTS) +rpmfts_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmfts_module_la_CFLAGS) \ + $(CFLAGS) $(rpmfts_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmgi_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmgi_module_la_OBJECTS = rpmgi_module_la-rpmgi-js.lo +rpmgi_module_la_OBJECTS = $(am_rpmgi_module_la_OBJECTS) +rpmgi_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmgi_module_la_CFLAGS) \ + $(CFLAGS) $(rpmgi_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmhdr_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmhdr_module_la_OBJECTS = rpmhdr_module_la-rpmhdr-js.lo +rpmhdr_module_la_OBJECTS = $(am_rpmhdr_module_la_OBJECTS) +rpmhdr_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmhdr_module_la_CFLAGS) \ + $(CFLAGS) $(rpmhdr_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmio_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmio_module_la_OBJECTS = rpmio_module_la-rpmio-js.lo +rpmio_module_la_OBJECTS = $(am_rpmio_module_la_OBJECTS) +rpmio_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmio_module_la_CFLAGS) \ + $(CFLAGS) $(rpmio_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmiob_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmiob_module_la_OBJECTS = rpmiob_module_la-rpmiob-js.lo +rpmiob_module_la_OBJECTS = $(am_rpmiob_module_la_OBJECTS) +rpmiob_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmiob_module_la_CFLAGS) \ + $(CFLAGS) $(rpmiob_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmmc_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmmc_module_la_OBJECTS = rpmmc_module_la-rpmmc-js.lo +rpmmc_module_la_OBJECTS = $(am_rpmmc_module_la_OBJECTS) +rpmmc_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmmc_module_la_CFLAGS) \ + $(CFLAGS) $(rpmmc_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmmg_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmmg_module_la_OBJECTS = rpmmg_module_la-rpmmg-js.lo +rpmmg_module_la_OBJECTS = $(am_rpmmg_module_la_OBJECTS) +rpmmg_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmmg_module_la_CFLAGS) \ + $(CFLAGS) $(rpmmg_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmmi_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmmi_module_la_OBJECTS = rpmmi_module_la-rpmmi-js.lo +rpmmi_module_la_OBJECTS = $(am_rpmmi_module_la_OBJECTS) +rpmmi_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmmi_module_la_CFLAGS) \ + $(CFLAGS) $(rpmmi_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmmpf_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmmpf_module_la_OBJECTS = rpmmpf_module_la-rpmmpf-js.lo +rpmmpf_module_la_OBJECTS = $(am_rpmmpf_module_la_OBJECTS) +rpmmpf_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmmpf_module_la_CFLAGS) \ + $(CFLAGS) $(rpmmpf_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmmpw_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmmpw_module_la_OBJECTS = rpmmpw_module_la-rpmmpw-js.lo +rpmmpw_module_la_OBJECTS = $(am_rpmmpw_module_la_OBJECTS) +rpmmpw_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmmpw_module_la_CFLAGS) \ + $(CFLAGS) $(rpmmpw_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmps_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmps_module_la_OBJECTS = rpmps_module_la-rpmps-js.lo +rpmps_module_la_OBJECTS = $(am_rpmps_module_la_OBJECTS) +rpmps_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmps_module_la_CFLAGS) \ + $(CFLAGS) $(rpmps_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmseq_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmseq_module_la_OBJECTS = rpmseq_module_la-rpmseq-js.lo +rpmseq_module_la_OBJECTS = $(am_rpmseq_module_la_OBJECTS) +rpmseq_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmseq_module_la_CFLAGS) \ + $(CFLAGS) $(rpmseq_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmsm_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmsm_module_la_OBJECTS = rpmsm_module_la-rpmsm-js.lo +rpmsm_module_la_OBJECTS = $(am_rpmsm_module_la_OBJECTS) +rpmsm_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmsm_module_la_CFLAGS) \ + $(CFLAGS) $(rpmsm_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmsp_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmsp_module_la_OBJECTS = rpmsp_module_la-rpmsp-js.lo +rpmsp_module_la_OBJECTS = $(am_rpmsp_module_la_OBJECTS) +rpmsp_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmsp_module_la_CFLAGS) \ + $(CFLAGS) $(rpmsp_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmst_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmst_module_la_OBJECTS = rpmst_module_la-rpmst-js.lo +rpmst_module_la_OBJECTS = $(am_rpmst_module_la_OBJECTS) +rpmst_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmst_module_la_CFLAGS) \ + $(CFLAGS) $(rpmst_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmsw_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmsw_module_la_OBJECTS = rpmsw_module_la-rpmsw-js.lo +rpmsw_module_la_OBJECTS = $(am_rpmsw_module_la_OBJECTS) +rpmsw_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmsw_module_la_CFLAGS) \ + $(CFLAGS) $(rpmsw_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmsx_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmsx_module_la_OBJECTS = rpmsx_module_la-rpmsx-js.lo +rpmsx_module_la_OBJECTS = $(am_rpmsx_module_la_OBJECTS) +rpmsx_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmsx_module_la_CFLAGS) \ + $(CFLAGS) $(rpmsx_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmsys_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmsys_module_la_OBJECTS = rpmsys_module_la-rpmsys-js.lo +rpmsys_module_la_OBJECTS = $(am_rpmsys_module_la_OBJECTS) +rpmsys_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmsys_module_la_CFLAGS) \ + $(CFLAGS) $(rpmsys_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmte_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmte_module_la_OBJECTS = rpmte_module_la-rpmte-js.lo +rpmte_module_la_OBJECTS = $(am_rpmte_module_la_OBJECTS) +rpmte_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmte_module_la_CFLAGS) \ + $(CFLAGS) $(rpmte_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmts_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmts_module_la_OBJECTS = rpmts_module_la-rpmts-js.lo +rpmts_module_la_OBJECTS = $(am_rpmts_module_la_OBJECTS) +rpmts_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmts_module_la_CFLAGS) \ + $(CFLAGS) $(rpmts_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmtxn_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmtxn_module_la_OBJECTS = rpmtxn_module_la-rpmtxn-js.lo +rpmtxn_module_la_OBJECTS = $(am_rpmtxn_module_la_OBJECTS) +rpmtxn_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmtxn_module_la_CFLAGS) \ + $(CFLAGS) $(rpmtxn_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmxar_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmxar_module_la_OBJECTS = rpmxar_module_la-rpmxar-js.lo +rpmxar_module_la_OBJECTS = $(am_rpmxar_module_la_OBJECTS) +rpmxar_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmxar_module_la_CFLAGS) \ + $(CFLAGS) $(rpmxar_module_la_LDFLAGS) $(LDFLAGS) -o $@ +syck_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_syck_module_la_OBJECTS = syck_module_la-syck-js.lo +syck_module_la_OBJECTS = $(am_syck_module_la_OBJECTS) +syck_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(syck_module_la_CFLAGS) \ + $(CFLAGS) $(syck_module_la_LDFLAGS) $(LDFLAGS) -o $@ +uuid_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_uuid_module_la_OBJECTS = uuid_module_la-uuid-js.lo +uuid_module_la_OBJECTS = $(am_uuid_module_la_OBJECTS) +uuid_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(uuid_module_la_CFLAGS) \ + $(CFLAGS) $(uuid_module_la_LDFLAGS) $(LDFLAGS) -o $@ +PROGRAMS = $(pkgbin_PROGRAMS) +am_ngsr_OBJECTS = ngsr.$(OBJEXT) +ngsr_OBJECTS = $(am_ngsr_OBJECTS) +ngsr_DEPENDENCIES = $(am__DEPENDENCIES_4) +DEFAULT_INCLUDES = -I. -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(librpmjsm_la_SOURCES) $(rpmaug_module_la_SOURCES) \ + $(rpmbc_module_la_SOURCES) $(rpmbf_module_la_SOURCES) \ + $(rpmcudf_module_la_SOURCES) $(rpmdb_module_la_SOURCES) \ + $(rpmdbc_module_la_SOURCES) $(rpmdbe_module_la_SOURCES) \ + $(rpmdc_module_la_SOURCES) $(rpmdig_module_la_SOURCES) \ + $(rpmdir_module_la_SOURCES) $(rpmds_module_la_SOURCES) \ + $(rpmfc_module_la_SOURCES) $(rpmfi_module_la_SOURCES) \ + $(rpmfts_module_la_SOURCES) $(rpmgi_module_la_SOURCES) \ + $(rpmhdr_module_la_SOURCES) $(rpmio_module_la_SOURCES) \ + $(rpmiob_module_la_SOURCES) $(rpmmc_module_la_SOURCES) \ + $(rpmmg_module_la_SOURCES) $(rpmmi_module_la_SOURCES) \ + $(rpmmpf_module_la_SOURCES) $(rpmmpw_module_la_SOURCES) \ + $(rpmps_module_la_SOURCES) $(rpmseq_module_la_SOURCES) \ + $(rpmsm_module_la_SOURCES) $(rpmsp_module_la_SOURCES) \ + $(rpmst_module_la_SOURCES) $(rpmsw_module_la_SOURCES) \ + $(rpmsx_module_la_SOURCES) $(rpmsys_module_la_SOURCES) \ + $(rpmte_module_la_SOURCES) $(rpmts_module_la_SOURCES) \ + $(rpmtxn_module_la_SOURCES) $(rpmxar_module_la_SOURCES) \ + $(syck_module_la_SOURCES) $(uuid_module_la_SOURCES) \ + $(ngsr_SOURCES) +DIST_SOURCES = $(librpmjsm_la_SOURCES) $(rpmaug_module_la_SOURCES) \ + $(rpmbc_module_la_SOURCES) $(rpmbf_module_la_SOURCES) \ + $(rpmcudf_module_la_SOURCES) $(rpmdb_module_la_SOURCES) \ + $(rpmdbc_module_la_SOURCES) $(rpmdbe_module_la_SOURCES) \ + $(rpmdc_module_la_SOURCES) $(rpmdig_module_la_SOURCES) \ + $(rpmdir_module_la_SOURCES) $(rpmds_module_la_SOURCES) \ + $(rpmfc_module_la_SOURCES) $(rpmfi_module_la_SOURCES) \ + $(rpmfts_module_la_SOURCES) $(rpmgi_module_la_SOURCES) \ + $(rpmhdr_module_la_SOURCES) $(rpmio_module_la_SOURCES) \ + $(rpmiob_module_la_SOURCES) $(rpmmc_module_la_SOURCES) \ + $(rpmmg_module_la_SOURCES) $(rpmmi_module_la_SOURCES) \ + $(rpmmpf_module_la_SOURCES) $(rpmmpw_module_la_SOURCES) \ + $(rpmps_module_la_SOURCES) $(rpmseq_module_la_SOURCES) \ + $(rpmsm_module_la_SOURCES) $(rpmsp_module_la_SOURCES) \ + $(rpmst_module_la_SOURCES) $(rpmsw_module_la_SOURCES) \ + $(rpmsx_module_la_SOURCES) $(rpmsys_module_la_SOURCES) \ + $(rpmte_module_la_SOURCES) $(rpmts_module_la_SOURCES) \ + $(rpmtxn_module_la_SOURCES) $(rpmxar_module_la_SOURCES) \ + $(syck_module_la_SOURCES) $(uuid_module_la_SOURCES) \ + $(ngsr_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkglibdir = /usr/lib/rpm/lib +ACLOCAL = ${SHELL} /home/mdawkins/wdj54/missing --run aclocal-1.11 +ALLOCA = +AMTAR = $${TAR-tar} +AR = ar +AS = /usr/bin/as +AUTOCONF = ${SHELL} /home/mdawkins/wdj54/missing --run autoconf +AUTOHEADER = ${SHELL} /home/mdawkins/wdj54/missing --run autoheader +AUTOMAKE = ${SHELL} /home/mdawkins/wdj54/missing --run automake-1.11 +AWK = gawk +BUILDROOTDIR_MACRO = %{_tmppath} +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -O2 -g -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC -DPIC -Wall -W -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -Wno-unused-parameter -Wformat-security -g3 -fno-delete-null-pointer-checks -D_FORTIFY_SOURCE=2 -fstack-protector -fexceptions -fexceptions -Wno-missing-field-initializers -D_GNU_SOURCE -D_REENTRANT +CPP = gcc -E +CPPFLAGS = -DRPM_OS_LINUX=030300 -I/usr/include/p11-kit-1 -I/usr/include/neon -I/usr/include/db53 -I/usr/include/libxml2 -I/usr/include/ossp-uuid -I/usr/include/ossp-uuid +CXX = g++ +CXXCPP = g++ -E +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -O2 -g -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 +CYGPATH_W = echo +DBAPI = 3 +DBLIBOBJS = db3.lo sqlite.lo +DBLIBSRCS = db3.c sqlite.c +DBPATH = /var/lib/rpm +DBPATH_MACRO = %{_var}/lib/rpm +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DISTRO_MACROS = +DLLTOOL = false +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = +FGREP = /bin/grep -F +FIXPERMS = a+rX,u+w,g-w,o-w +GETTEXT_MACRO_VERSION = 0.18 +GMSGFMT = /usr/bin/msgfmt +GMSGFMT_015 = /usr/bin/msgfmt +GPSEE_MODULES_PATH = +GREP = /bin/grep +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +INTLLIBS = +INTL_MACOSX_LIBS = +LD = /usr/bin/ld -m elf_x86_64 +LDFLAGS = -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -L/usr/lib64/ +LDFLAGS_STATIC = +LD_VERSION_SCRIPT_FLAG = --version-script +LIBICONV = -liconv +LIBINTL = +LIBOBJS = +LIBS = -lcpuinfo -lkeyutils -lacl -lattr -lsyck -luuid -lossp-uuid -lpcreposix -lpcre -ldl -lm -ltcl -ltcl8.6 -laugeas -lreadline -lsqlite3 -ldb-5.3 -lmagic -lneon -lgnutls -ltasn1 -lcrypto -lgcrypt -lbeecrypt -llzma -lbz2 -lz -lpopt -lpthread -lrt -lelf -lpopt -lz -lgcrypt -lgpg-error -lssl -lcrypto -ltasn1 -lgnutls -lneon -laugeas -lxml2 -lpcre -lcpuinfo +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIBTOOLIZE = libtoolize +LIPO = +LN_S = ln -s +LOCALEDIR = /usr/share/locale +LTLIBICONV = -liconv +LTLIBINTL = +LTLIBOBJS = +LT_AGE = 0 +LT_CURRENT = 5 +LT_REVISION = 4 +MACROFILES = /usr/lib/rpm/macros:/usr/lib/rpm/%{_target}/macros:/etc/rpm/macros.*:/etc/rpm/macros:/etc/rpm/%{_target}/macros:/usr/lib/rpm/platform/%{_target}/macros:/usr/lib/rpm/mandriva/platform/%{_target}/macros:/etc/rpm/macros.d/*.macros:/usr/lib/rpm/macros.d/mandriva:~/.rpmmacros +MAGIC_MACRO = /usr/share/misc/magic +MAINT = +MAKEINFO = ${SHELL} /home/mdawkins/wdj54/missing --run makeinfo +MANIFEST_TOOL = : +MKDIR = /bin/mkdir +MKDIR_P = /bin/mkdir -p +MSGFMT = /usr/bin/msgfmt +MSGFMT_015 = /usr/bin/msgfmt +MSGMERGE = /usr/bin/msgmerge +NCPUS_COMMAND = /usr/bin/getconf _NPROCESSORS_ONLN +NM = /usr/bin/nm -B +NMEDIT = +OBJDUMP = objdump +OBJEXT = o +OPENMP_CFLAGS = -fopenmp +OPENMP_CXXFLAGS = -fopenmp +OTOOL = +OTOOL64 = +PACKAGE = rpm +PACKAGE_BUGREPORT = rpm-devel@rpm5.org +PACKAGE_NAME = rpm +PACKAGE_STRING = rpm 5.4.9 +PACKAGE_TARNAME = rpm +PACKAGE_URL = +PACKAGE_VERSION = 5.4.9 +PATH_SEPARATOR = : +PERL = /usr/bin/perl +PERL_INSTALLDIRS = 'INSTALLDIRS' => 'vendor', +PERL_URPM_INSTALLDIRS = +PKGSRCDIR = /usr/src/rpm +PKGSRCDIR_MACRO = %{_usr}/src/rpm +POSUB = po +PYTHON = /usr/bin/python +PYTHON_EXEC_PREFIX = ${exec_prefix} +PYTHON_PREFIX = ${prefix} +PYTHON_VERSION = 2.7 +RANLIB = ranlib +ROOT_GROUP = root +RPMCANONARCH = x86_64 +RPMCANONCOLOR = 3 +RPMCANONGNU = -gnu +RPMCANONOS = linux +RPMCANONVENDOR = mandriva +RPMGID = 37 +RPMGROUP = rpm +RPMLUAFILES = /usr/lib/rpm/init.lua:/usr/lib/rpm/rpmlua:/usr/lib/rpm/%{_target}/rpmlua:/etc/rpm/rpmlua.*:/etc/rpm/rpmlua:/etc/rpm/%{_target}/rpmlua:~/.rpmlua +RPMPOPTFILES = /usr/lib/rpm/rpmpopt:/usr/lib/rpm/%{_target}/rpmpopt:/etc/rpm/rpmpopt.*:/etc/rpm/rpmpopt:/etc/rpm/%{_target}/rpmpopt:~/.rpmpopt +RPMUID = 37 +RPMUSER = rpm +RPM_TIMESTAMP = 2012,4,2,0,0 +RPM_VENDOR = 'R','P','M','5' +RPM_VERSION = 5,4,r,9,0,_ +SED = /bin/sed +SET_MAKE = +SHELL = /bin/sh +STRIP = strip +SYSCONFIGDIR = /etc/rpm +USE_NLS = yes +USRLIBRPM = /usr/lib/rpm +VERSION = 5.4.9 +WITH_ACL = yes +WITH_APIDOCS = 1 +WITH_APIDOCS_TARGET = apidocs +WITH_APR = no +WITH_ATERM = no +WITH_ATTR = yes +WITH_AUGEAS = yes +WITH_AUGEAS_AUGTOOL = augtool +WITH_BASH = no +WITH_BASH_CPPFLAGS = +WITH_BASH_LDFLAGS = +WITH_BASH_LIBS = +WITH_BASH_SUBDIR = +WITH_BEECRYPT = yes +WITH_BEECRYPT_CPPFLAGS = +WITH_BEECRYPT_LDFLAGS = +WITH_BEECRYPT_LIBS = +WITH_BEECRYPT_SUBDIR = +WITH_BZIP2 = yes +WITH_CPUINFO = yes +WITH_CUDF = no +WITH_CUDF_CUDFTOOL = +WITH_DB = yes +WITH_DBSQL = no +WITH_DBSQL_CPPFLAGS = +WITH_DBSQL_LDFLAGS = +WITH_DBSQL_LIBS = +WITH_DBSQL_SUBDIR = +WITH_DB_CPPFLAGS = +WITH_DB_LDFLAGS = +WITH_DB_LIBS = +WITH_DB_SUBDIR = +WITH_DMALLOC = no +WITH_EFENCE = no +WITH_EXPAT = no +WITH_FICL = no +WITH_FICL_CPPFLAGS = +WITH_FICL_LDFLAGS = +WITH_FICL_LIBS = +WITH_FICL_SUBDIR = +WITH_FILE = yes +WITH_FILE_CPPFLAGS = +WITH_FILE_LDFLAGS = +WITH_FILE_LIBS = +WITH_FILE_SUBDIR = +WITH_GCRYPT = yes +WITH_GNUTLS = yes +WITH_GPSEE = no +WITH_GPSEE_CPPFLAGS = +WITH_GPSEE_LDFLAGS = +WITH_GPSEE_LIBS = +WITH_GPSEE_SUBDIR = +WITH_JS_SUBDIR = +WITH_KEYUTILS = yes +WITH_KEYUTILS_RPMKEY = rpmkey +WITH_LIBELF_DEBUGEDIT = debugedit +WITH_LIBGIT2 = no +WITH_LIBGIT2_CPPFLAGS = +WITH_LIBGIT2_LDFLAGS = +WITH_LIBGIT2_LIBS = +WITH_LIBGIT2_SUBDIR = +WITH_LIBTASN1 = yes +WITH_LUA = yes +WITH_LUA_CPPFLAGS = -I$(top_srcdir)/$(WITH_LUA_SUBDIR)/local -I$(top_builddir)/$(WITH_LUA_SUBDIR)/local -I$(top_srcdir)/$(WITH_LUA_SUBDIR) -I$(top_builddir)/$(WITH_LUA_SUBDIR) +WITH_LUA_LDFLAGS = -L$(top_builddir)/$(WITH_LUA_SUBDIR) +WITH_LUA_LIBS = -llua +WITH_LUA_SUBDIR = lua +WITH_LUA_SUBDIR_DEF = -DLUA_USE_DLOPEN -DLUA_USE_POSIX -DREX_POSIX_INCLUDE="" -DLUA_USE_PCRE -DLUA_USE_UUID +WITH_LUA_SUBDIR_LIB = +WITH_MOZJS185 = no +WITH_MOZJS185_CPPFLAGS = +WITH_MOZJS185_LDFLAGS = +WITH_MOZJS185_LIBS = +WITH_MOZJS185_SUBDIR = +WITH_NEON = yes +WITH_NEON_CPPFLAGS = +WITH_NEON_LDFLAGS = +WITH_NEON_LIBS = +WITH_NEON_SUBDIR = +WITH_NIX = no +WITH_NSS = no +WITH_OPENSSL = yes +WITH_PAKCHOIS = no +WITH_PATH_VERSIONED = no +WITH_PATH_VERSIONED_SUFFIX = +WITH_PCRE = yes +WITH_PCRE_CPPFLAGS = +WITH_PCRE_LDFLAGS = +WITH_PCRE_LIBS = +WITH_PCRE_SUBDIR = +WITH_PERLEMBED = no +WITH_PERL_LIBS = -lpthread -lrt -lelf +WITH_PERL_SUBDIR = perl +WITH_PERL_SUBPACKAGE = 1 +WITH_PERL_URPM_LIBS = -lpthread -lrt -lelf +WITH_PERL_URPM_SUBDIR = +WITH_PERL_URPM_SUBPACKAGE = 0 +WITH_POPT = yes +WITH_POPT_CPPFLAGS = +WITH_POPT_LDFLAGS = +WITH_POPT_LIBS = +WITH_POPT_SUBDIR = +WITH_PYTHONEMBED = no +WITH_PYTHON_INCDIR = /usr/include/python2.7 +WITH_PYTHON_SUBDIR = python +WITH_PYTHON_SUBPACKAGE = 1 +WITH_RC = no +WITH_RC_CPPFLAGS = +WITH_RC_LDFLAGS = +WITH_RC_LIBS = +WITH_RC_SUBDIR = +WITH_READLINE = yes +WITH_RUBY = no +WITH_RUBY_CPPFLAGS = +WITH_RUBY_SUBDIR = +WITH_RUBY_VENDORARCHDIR = +WITH_SELINUX = no +WITH_SEMANAGE = no +WITH_SEMANAGE_SEMODULE = +WITH_SEPOL = no +WITH_SPIDERMONKEY_SUBDIR = +WITH_SQLITE = yes +WITH_SQLITE_CPPFLAGS = +WITH_SQLITE_LDFLAGS = +WITH_SQLITE_LIBS = +WITH_SQLITE_SUBDIR = +WITH_SQUIRREL = no +WITH_SUBVERSION = no +WITH_SYCK = yes +WITH_SYCK_CPPFLAGS = +WITH_SYCK_LDFLAGS = +WITH_SYCK_LIBS = +WITH_SYCK_SUBDIR = +WITH_TCL = yes +WITH_TCL_SUBDIR = +WITH_TOMCRYPT = no +WITH_TPM = no +WITH_UNIXODBC = no +WITH_UUID = yes +WITH_XAR = no +WITH_XAR_CPPFLAGS = +WITH_XAR_LDFLAGS = +WITH_XAR_LIBS = +WITH_XAR_SUBDIR = +WITH_XZ = yes +WITH_XZ_CPPFLAGS = +WITH_XZ_LDFLAGS = +WITH_XZ_LIBS = +WITH_XZ_SUBDIR = +WITH_ZLIB = yes +WITH_ZLIB_CPPFLAGS = +WITH_ZLIB_LDFLAGS = +WITH_ZLIB_LIBS = +WITH_ZLIB_SUBDIR = +XGETTEXT = /usr/bin/xgettext +XGETTEXT_015 = /usr/bin/xgettext +XGETTEXT_EXTRA_OPTIONS = +YACC = bison -y +YFLAGS = +__BASH = /bin/bash +__BZIP2 = /usr/bin/bzip2 +__CAT = /bin/cat +__CHATTR = /usr/bin/chattr +__CHGRP = /bin/chgrp +__CHGRP_RHF = %{__chgrp} -Rhf +__CHMOD = /bin/chmod +__CHOWN = /bin/chown +__CHOWN_RHF = %{__chown} -Rhf +__CMAKE = %{_bindir}/cmake +__CPIO = /bin/cpio +__CURL = /usr/bin/curl +__CVS = /usr/bin/cvs +__DBSQL = %{_bindir}/db53sql +__DB_ARCHIVE = /usr/bin/db53_archive +__DB_CHECKPOINT = /usr/bin/db53_checkpoint +__DB_DEADLOCK = /usr/bin/db53_deadlock +__DB_DUMP = /usr/bin/db53_dump +__DB_HOTBACKUP = /usr/bin/db53_hotbackup +__DB_LOAD = /usr/bin/db53_load +__DB_LOG_VERIFY = /usr/bin/db53_log_verify +__DB_PRINTLOG = /usr/bin/db53_printlog +__DB_RECOVER = /usr/bin/db53_recover +__DB_REPLICATE = /usr/bin/db53_replicate +__DB_SQL_CODEGEN = /usr/bin/db53_sql_codegen +__DB_STAT = /usr/bin/db53_stat +__DB_TUNER = /usr/bin/db53_tuner +__DB_UPGRADE = /usr/bin/db53_upgrade +__DB_VERIFY = /usr/bin/db53_verify +__DIFF = /usr/bin/diff +__DITTO = %{_bindir}/ditto +__DOXYGEN = /usr/bin/doxygen +__FILE = /usr/bin/file +__GIT = /usr/bin/git +__GPG = /usr/bin/gpg2 +__GSR = %{_bindir}/gsr +__GST_INSPECT = %{_bindir}/gst-inspect-0.10 +__GZIP = /bin/gzip +__HG = /usr/bin/hg +__ID = /bin/id +__ID_U = %{__id} -u +__INSTALL = /usr/bin/install +__INSTALL_INFO = /sbin/install-info +__LD = /usr/bin/ld +__LDCONFIG = /sbin/ldconfig +__LN = /bin/ln +__LRZIP = /usr/bin/lrzip +__LSATTR = /usr/bin/lsattr +__LZIP = /usr/bin/lzip +__LZMA = /usr/bin/lzma +__LZOP = /usr/bin/lzop +__MAKE = /usr/bin/make +__MKDIR = /bin/mkdir +__MKDIR_P = /bin/mkdir -p +__MODINFO = /sbin/modinfo +__MONGO = %{_bindir}/mongo +__MV = /bin/mv +__NM = /usr/bin/nm +__OBJCOPY = /usr/bin/objcopy +__OBJDUMP = /usr/bin/objdump +__PATCH = /usr/bin/patch +__PAX = %{_bindir}/pax +__PERL = /usr/bin/perl +__PGP = %{_bindir}/pgp +__PHP = %{_bindir}/php +__PYTHON = /usr/bin/python +__RM = /bin/rm +__RMDIR = /bin/rmdir +__RSH = %{_bindir}/rsh +__RUBY = /usr/bin/ruby +__SED = /bin/sed +__SH = /bin/sh +__SQLITE3 = %{_bindir}/sqlite3 +__SSH = /usr/bin/ssh +__STRIP = /usr/bin/strip +__SVN = /usr/bin/svn +__TAR = /bin/tar +__TCLSH = /usr/bin/tclsh +__UNZIP = /usr/bin/unzip +__XZ = /usr/bin/xz +abs_builddir = /home/mdawkins/wdj54/js +abs_srcdir = /home/mdawkins/wdj54/js +abs_top_builddir = /home/mdawkins/wdj54 +abs_top_srcdir = /home/mdawkins/wdj54 +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_CXX = g++ +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = tar --format=ustar -chf - "$$tardir" +am__untar = tar -xf - +autorelocate_dcolor = 0 +autorelocate_path = %{nil} +bindir = ${exec_prefix}/bin +build = x86_64-unknown-linux-gnu +build_alias = +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = unknown +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +exeext = +host = x86_64-unknown-linux-gnu +host_alias = +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = unknown +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /home/mdawkins/wdj54/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +libext = a +localedir = /usr/share/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +objext = o +oldincludedir = /usr/include +pdfdir = ${docdir} +pkgpyexecdir = ${pyexecdir}/${PACKAGE} +pkgpythondir = ${pythondir}/${PACKAGE} +prefix = /usr +program_transform_name = s,x,x, +psdir = ${docdir} +pyexecdir = ${pythondir} +pythondir = /usr/lib64/python2.7/site-packages +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +shlibext = so +srcdir = . +subdirs = +sysconfdir = ${prefix}/etc +target = x86_64-unknown-linux-gnu +target_alias = +target_cpu = x86_64 +target_os = linux +target_vendor = unknown +testdir = /home/mdawkins/wdj54/tests +top_build_prefix = ../ +top_builddir = .. +top_srcdir = .. +usrprefix = /usr +varprefix = /var +AUTOMAKE_OPTIONS = 1.4 foreign +LINT = splint +EXTRA_DIST = ngsr.c minimal.c \ + src \ + tscripts \ + words \ + legacy.cudf legacy-sol.cudf + +AM_CPPFLAGS = -I. \ + -I$(top_srcdir) \ + -I$(top_srcdir)/build \ + -I$(top_srcdir)/lib \ + -I$(top_builddir)/lib \ + -I$(top_srcdir)/rpmdb \ + -I$(top_srcdir)/rpmio \ + -I$(top_srcdir)/misc \ + \ + \ + \ + -I$(top_srcdir)/$(WITH_LUA_SUBDIR)/local -I$(top_builddir)/$(WITH_LUA_SUBDIR)/local -I$(top_srcdir)/$(WITH_LUA_SUBDIR) -I$(top_builddir)/$(WITH_LUA_SUBDIR) \ + \ + \ + \ + + +AM_CFLAGS = $(OPENMP_CFLAGS) +RPMMISC_LDADD_COMMON = \ + $(top_builddir)/misc/librpmmisc.la \ + + +RPMIO_LDADD_COMMON = \ + $(top_builddir)/rpmio/librpmio.la \ + $(RPMMISC_LDADD_COMMON) + +RPMDB_LDADD_COMMON = \ + $(top_builddir)/rpmdb/librpmdb.la \ + $(RPMIO_LDADD_COMMON) + +RPM_LDADD_COMMON = \ + $(top_builddir)/lib/librpm.la \ + $(RPMDB_LDADD_COMMON) + +RPMBUILD_LDADD_COMMON = \ + $(top_builddir)/build/librpmbuild.la \ + $(RPM_LDADD_COMMON) + +pkgbindir = /usr/lib/rpm/bin +moduledir = +module_LTLIBRARIES = \ + rpmbf_module.la + +noinst_LTLIBRARIES = \ + librpmjsm.la + +EXTRA_LTLIBRARIES = \ + rpmaug_module.la \ + rpmbc_module.la \ + rpmcudf_module.la \ + rpmdb_module.la \ + rpmdbc_module.la \ + rpmdbe_module.la \ + rpmmpf_module.la \ + rpmseq_module.la \ + rpmtxn_module.la \ + rpmdc_module.la \ + rpmdig_module.la \ + rpmdir_module.la \ + rpmds_module.la \ + rpmfc_module.la \ + rpmfi_module.la \ + rpmfts_module.la \ + rpmgi_module.la \ + rpmhdr_module.la \ + rpmio_module.la \ + rpmiob_module.la \ + rpmmc_module.la \ + rpmmg_module.la \ + rpmmi_module.la \ + rpmmpw_module.la \ + rpmps_module.la \ + rpmsm_module.la \ + rpmsp_module.la \ + rpmst_module.la \ + rpmsw_module.la \ + rpmsx_module.la \ + rpmsys_module.la \ + rpmte_module.la \ + rpmts_module.la \ + rpmxar_module.la \ + syck_module.la \ + uuid_module.la + +librpmjsm_la_CFLAGS = -fno-strict-aliasing +librpmjsm_la_LDFLAGS = -module -avoid-version +librpmjsm_la_LIBADD = $(RPM_LDADD_COMMON) +rpmaug_module_la_SOURCES = rpmaug-js.c +rpmaug_module_la_CFLAGS = -fno-strict-aliasing +rpmaug_module_la_LDFLAGS = -module -avoid-version +rpmaug_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmbc_module_la_SOURCES = rpmbc-js.c +rpmbc_module_la_CFLAGS = -fno-strict-aliasing +rpmbc_module_la_LDFLAGS = -module -avoid-version +rpmbc_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmbf_module_la_SOURCES = rpmbf-js.c +rpmbf_module_la_CFLAGS = -fno-strict-aliasing +rpmbf_module_la_LDFLAGS = -module -avoid-version +rpmbf_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmcudf_module_la_SOURCES = rpmcudf-js.c +rpmcudf_module_la_CFLAGS = -fno-strict-aliasing +rpmcudf_module_la_LDFLAGS = -module -avoid-version +rpmcudf_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmdb_module_la_SOURCES = rpmdb-js.c +rpmdb_module_la_CFLAGS = -fno-strict-aliasing +rpmdb_module_la_LDFLAGS = -module -avoid-version +rpmdb_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmdbc_module_la_SOURCES = rpmdbc-js.c +rpmdbc_module_la_CFLAGS = -fno-strict-aliasing +rpmdbc_module_la_LDFLAGS = -module -avoid-version +rpmdbc_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmdbe_module_la_SOURCES = rpmdbe-js.c +rpmdbe_module_la_CFLAGS = -fno-strict-aliasing +rpmdbe_module_la_LDFLAGS = -module -avoid-version +rpmdbe_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmmpf_module_la_SOURCES = rpmmpf-js.c +rpmmpf_module_la_CFLAGS = -fno-strict-aliasing +rpmmpf_module_la_LDFLAGS = -module -avoid-version +rpmmpf_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmseq_module_la_SOURCES = rpmseq-js.c +rpmseq_module_la_CFLAGS = -fno-strict-aliasing +rpmseq_module_la_LDFLAGS = -module -avoid-version +rpmseq_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmtxn_module_la_SOURCES = rpmtxn-js.c +rpmtxn_module_la_CFLAGS = -fno-strict-aliasing +rpmtxn_module_la_LDFLAGS = -module -avoid-version +rpmtxn_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmdc_module_la_SOURCES = rpmdc-js.c +rpmdc_module_la_CFLAGS = -fno-strict-aliasing +rpmdc_module_la_LDFLAGS = -module -avoid-version +rpmdc_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmdig_module_la_SOURCES = rpmdig-js.c +rpmdig_module_la_CFLAGS = -fno-strict-aliasing +rpmdig_module_la_LDFLAGS = -module -avoid-version +rpmdig_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmdir_module_la_SOURCES = rpmdir-js.c +rpmdir_module_la_CFLAGS = -fno-strict-aliasing +rpmdir_module_la_LDFLAGS = -module -avoid-version +rpmdir_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmds_module_la_SOURCES = rpmds-js.c +rpmds_module_la_CFLAGS = -fno-strict-aliasing +rpmds_module_la_LDFLAGS = -module -avoid-version +rpmds_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmfc_module_la_SOURCES = rpmfc-js.c +rpmfc_module_la_CFLAGS = -fno-strict-aliasing +rpmfc_module_la_LDFLAGS = -module -avoid-version +rpmfc_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmfi_module_la_SOURCES = rpmfi-js.c +rpmfi_module_la_CFLAGS = -fno-strict-aliasing +rpmfi_module_la_LDFLAGS = -module -avoid-version +rpmfi_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmfts_module_la_SOURCES = rpmfts-js.c +rpmfts_module_la_CFLAGS = -fno-strict-aliasing +rpmfts_module_la_LDFLAGS = -module -avoid-version +rpmfts_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmgi_module_la_SOURCES = rpmgi-js.c +rpmgi_module_la_CFLAGS = -fno-strict-aliasing +rpmgi_module_la_LDFLAGS = -module -avoid-version +rpmgi_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmhdr_module_la_SOURCES = rpmhdr-js.c +rpmhdr_module_la_CFLAGS = -fno-strict-aliasing +rpmhdr_module_la_LDFLAGS = -module -avoid-version +rpmhdr_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmio_module_la_SOURCES = rpmio-js.c +rpmio_module_la_CFLAGS = -fno-strict-aliasing +rpmio_module_la_LDFLAGS = -module -avoid-version +rpmio_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmiob_module_la_SOURCES = rpmiob-js.c +rpmiob_module_la_CFLAGS = -fno-strict-aliasing +rpmiob_module_la_LDFLAGS = -module -avoid-version +rpmiob_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmmc_module_la_SOURCES = rpmmc-js.c +rpmmc_module_la_CFLAGS = -fno-strict-aliasing +rpmmc_module_la_LDFLAGS = -module -avoid-versmcn +rpmmc_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmmg_module_la_SOURCES = rpmmg-js.c +rpmmg_module_la_CFLAGS = -fno-strict-aliasing +rpmmg_module_la_LDFLAGS = -module -avoid-versmgn +rpmmg_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmmi_module_la_SOURCES = rpmmi-js.c +rpmmi_module_la_CFLAGS = -fno-strict-aliasing +rpmmi_module_la_LDFLAGS = -module -avoid-versmin +rpmmi_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmmpw_module_la_SOURCES = rpmmpw-js.c +rpmmpw_module_la_CFLAGS = -fno-strict-aliasing +rpmmpw_module_la_LDFLAGS = -module -avoid-versmin +rpmmpw_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmps_module_la_SOURCES = rpmps-js.c +rpmps_module_la_CFLAGS = -fno-strict-aliasing +rpmps_module_la_LDFLAGS = -module -avoid-versmin +rpmps_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmsm_module_la_SOURCES = rpmsm-js.c +rpmsm_module_la_CFLAGS = -fno-strict-aliasing +rpmsm_module_la_LDFLAGS = -module -avoid-versmin +rpmsm_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmsp_module_la_SOURCES = rpmsp-js.c +rpmsp_module_la_CFLAGS = -fno-strict-aliasing +rpmsp_module_la_LDFLAGS = -module -avoid-versmin +rpmsp_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmst_module_la_SOURCES = rpmst-js.c +rpmst_module_la_CFLAGS = -fno-strict-aliasing +rpmst_module_la_LDFLAGS = -module -avoid-verssysn +rpmst_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmsw_module_la_SOURCES = rpmsw-js.c +rpmsw_module_la_CFLAGS = -fno-strict-aliasing +rpmsw_module_la_LDFLAGS = -module -avoid-versmin +rpmsw_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmsx_module_la_SOURCES = rpmsx-js.c +rpmsx_module_la_CFLAGS = -fno-strict-aliasing +rpmsx_module_la_LDFLAGS = -module -avoid-versmin +rpmsx_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmsys_module_la_SOURCES = rpmsys-js.c +rpmsys_module_la_CFLAGS = -fno-strict-aliasing +rpmsys_module_la_LDFLAGS = -module -avoid-verssysn +rpmsys_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmte_module_la_SOURCES = rpmte-js.c +rpmte_module_la_CFLAGS = -fno-strict-aliasing +rpmte_module_la_LDFLAGS = -module -avoid-verssysn +rpmte_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmts_module_la_SOURCES = rpmts-js.c +rpmts_module_la_CFLAGS = -fno-strict-aliasing +rpmts_module_la_LDFLAGS = -module -avoid-verssysn +rpmts_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmxar_module_la_SOURCES = rpmxar-js.c +rpmxar_module_la_CFLAGS = -fno-strict-aliasing +rpmxar_module_la_LDFLAGS = -module -avoid-verssysn +rpmxar_module_la_LIBADD = $(RPM_LDADD_COMMON) +syck_module_la_SOURCES = syck-js.c +syck_module_la_CFLAGS = -fno-strict-aliasing +syck_module_la_LDFLAGS = -module -avoid-version +syck_module_la_LIBADD = $(RPM_LDADD_COMMON) +uuid_module_la_SOURCES = uuid-js.c +uuid_module_la_CFLAGS = -fno-strict-aliasing +uuid_module_la_LDFLAGS = -module -avoid-version +uuid_module_la_LIBADD = $(RPM_LDADD_COMMON) +noinst_HEADERS = \ + rpmaug-js.h rpmbc-js.h rpmbf-js.h rpmcudf-js.h rpmdb-js.h rpmdbc-js.h rpmdbe-js.c rpmdc-js.h rpmdig-js.h \ + rpmdir-js.h rpmds-js.h rpmfc-js.h rpmfi-js.h rpmfts-js.h rpmgi-js.h \ + rpmhdr-js.h rpmio-js.h rpmiob-js.h rpmmc-js.h rpmmg-js.h rpmmi-js.h \ + rpmmpf-js.h rpmmpw-js.h rpmps-js.h rpmseq-js.h rpmsm-js.h rpmsp-js.h rpmst-js.h rpmsw-js.h \ + rpmsx-js.h rpmsys-js.h rpmte-js.h rpmts-js.h rpmtxn-js.h rpmxar-js.h \ + syck-js.h uuid-js.h + +librpmjsm_la_SOURCES = \ + rpmaug-js.c rpmbc-js.c rpmbf-js.c rpmcudf-js.c rpmdb-js.c rpmdbc-js.c rpmdbe-js.c rpmdc-js.c rpmdig-js.c \ + rpmdir-js.c rpmds-js.c rpmfc-js.c rpmfi-js.c rpmfts-js.c rpmgi-js.c \ + rpmhdr-js.c rpmio-js.c rpmiob-js.c rpmmc-js.c rpmmg-js.c rpmmi-js.c \ + rpmmpf-js.c rpmmpw-js.c rpmps-js.c rpmseq-js.c rpmsm-js.c rpmsp-js.c rpmst-js.c rpmsw-js.c \ + rpmsx-js.c rpmsys-js.c rpmte-js.c rpmts-js.c rpmtxn-js.c rpmxar-js.c \ + syck-js.c uuid-js.c + +ngsr_SOURCES = ngsr.c +ngsr_LDADD = $(RPM_LDADD_COMMON) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign js/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign js/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-moduleLTLIBRARIES: $(module_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || 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)$(moduledir)'"; \ + $(MKDIR_P) '$(DESTDIR)$(moduledir)' || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(moduledir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(moduledir)"; \ + } + +uninstall-moduleLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$f"; \ + done + +clean-moduleLTLIBRARIES: + -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) + @list='$(module_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +librpmjsm.la: $(librpmjsm_la_OBJECTS) $(librpmjsm_la_DEPENDENCIES) $(EXTRA_librpmjsm_la_DEPENDENCIES) + $(librpmjsm_la_LINK) $(librpmjsm_la_OBJECTS) $(librpmjsm_la_LIBADD) $(LIBS) +rpmaug_module.la: $(rpmaug_module_la_OBJECTS) $(rpmaug_module_la_DEPENDENCIES) $(EXTRA_rpmaug_module_la_DEPENDENCIES) + $(rpmaug_module_la_LINK) $(rpmaug_module_la_OBJECTS) $(rpmaug_module_la_LIBADD) $(LIBS) +rpmbc_module.la: $(rpmbc_module_la_OBJECTS) $(rpmbc_module_la_DEPENDENCIES) $(EXTRA_rpmbc_module_la_DEPENDENCIES) + $(rpmbc_module_la_LINK) $(rpmbc_module_la_OBJECTS) $(rpmbc_module_la_LIBADD) $(LIBS) +rpmbf_module.la: $(rpmbf_module_la_OBJECTS) $(rpmbf_module_la_DEPENDENCIES) $(EXTRA_rpmbf_module_la_DEPENDENCIES) + $(rpmbf_module_la_LINK) -rpath $(moduledir) $(rpmbf_module_la_OBJECTS) $(rpmbf_module_la_LIBADD) $(LIBS) +rpmcudf_module.la: $(rpmcudf_module_la_OBJECTS) $(rpmcudf_module_la_DEPENDENCIES) $(EXTRA_rpmcudf_module_la_DEPENDENCIES) + $(rpmcudf_module_la_LINK) $(rpmcudf_module_la_OBJECTS) $(rpmcudf_module_la_LIBADD) $(LIBS) +rpmdb_module.la: $(rpmdb_module_la_OBJECTS) $(rpmdb_module_la_DEPENDENCIES) $(EXTRA_rpmdb_module_la_DEPENDENCIES) + $(rpmdb_module_la_LINK) $(rpmdb_module_la_OBJECTS) $(rpmdb_module_la_LIBADD) $(LIBS) +rpmdbc_module.la: $(rpmdbc_module_la_OBJECTS) $(rpmdbc_module_la_DEPENDENCIES) $(EXTRA_rpmdbc_module_la_DEPENDENCIES) + $(rpmdbc_module_la_LINK) $(rpmdbc_module_la_OBJECTS) $(rpmdbc_module_la_LIBADD) $(LIBS) +rpmdbe_module.la: $(rpmdbe_module_la_OBJECTS) $(rpmdbe_module_la_DEPENDENCIES) $(EXTRA_rpmdbe_module_la_DEPENDENCIES) + $(rpmdbe_module_la_LINK) $(rpmdbe_module_la_OBJECTS) $(rpmdbe_module_la_LIBADD) $(LIBS) +rpmdc_module.la: $(rpmdc_module_la_OBJECTS) $(rpmdc_module_la_DEPENDENCIES) $(EXTRA_rpmdc_module_la_DEPENDENCIES) + $(rpmdc_module_la_LINK) $(rpmdc_module_la_OBJECTS) $(rpmdc_module_la_LIBADD) $(LIBS) +rpmdig_module.la: $(rpmdig_module_la_OBJECTS) $(rpmdig_module_la_DEPENDENCIES) $(EXTRA_rpmdig_module_la_DEPENDENCIES) + $(rpmdig_module_la_LINK) $(rpmdig_module_la_OBJECTS) $(rpmdig_module_la_LIBADD) $(LIBS) +rpmdir_module.la: $(rpmdir_module_la_OBJECTS) $(rpmdir_module_la_DEPENDENCIES) $(EXTRA_rpmdir_module_la_DEPENDENCIES) + $(rpmdir_module_la_LINK) $(rpmdir_module_la_OBJECTS) $(rpmdir_module_la_LIBADD) $(LIBS) +rpmds_module.la: $(rpmds_module_la_OBJECTS) $(rpmds_module_la_DEPENDENCIES) $(EXTRA_rpmds_module_la_DEPENDENCIES) + $(rpmds_module_la_LINK) $(rpmds_module_la_OBJECTS) $(rpmds_module_la_LIBADD) $(LIBS) +rpmfc_module.la: $(rpmfc_module_la_OBJECTS) $(rpmfc_module_la_DEPENDENCIES) $(EXTRA_rpmfc_module_la_DEPENDENCIES) + $(rpmfc_module_la_LINK) $(rpmfc_module_la_OBJECTS) $(rpmfc_module_la_LIBADD) $(LIBS) +rpmfi_module.la: $(rpmfi_module_la_OBJECTS) $(rpmfi_module_la_DEPENDENCIES) $(EXTRA_rpmfi_module_la_DEPENDENCIES) + $(rpmfi_module_la_LINK) $(rpmfi_module_la_OBJECTS) $(rpmfi_module_la_LIBADD) $(LIBS) +rpmfts_module.la: $(rpmfts_module_la_OBJECTS) $(rpmfts_module_la_DEPENDENCIES) $(EXTRA_rpmfts_module_la_DEPENDENCIES) + $(rpmfts_module_la_LINK) $(rpmfts_module_la_OBJECTS) $(rpmfts_module_la_LIBADD) $(LIBS) +rpmgi_module.la: $(rpmgi_module_la_OBJECTS) $(rpmgi_module_la_DEPENDENCIES) $(EXTRA_rpmgi_module_la_DEPENDENCIES) + $(rpmgi_module_la_LINK) $(rpmgi_module_la_OBJECTS) $(rpmgi_module_la_LIBADD) $(LIBS) +rpmhdr_module.la: $(rpmhdr_module_la_OBJECTS) $(rpmhdr_module_la_DEPENDENCIES) $(EXTRA_rpmhdr_module_la_DEPENDENCIES) + $(rpmhdr_module_la_LINK) $(rpmhdr_module_la_OBJECTS) $(rpmhdr_module_la_LIBADD) $(LIBS) +rpmio_module.la: $(rpmio_module_la_OBJECTS) $(rpmio_module_la_DEPENDENCIES) $(EXTRA_rpmio_module_la_DEPENDENCIES) + $(rpmio_module_la_LINK) $(rpmio_module_la_OBJECTS) $(rpmio_module_la_LIBADD) $(LIBS) +rpmiob_module.la: $(rpmiob_module_la_OBJECTS) $(rpmiob_module_la_DEPENDENCIES) $(EXTRA_rpmiob_module_la_DEPENDENCIES) + $(rpmiob_module_la_LINK) $(rpmiob_module_la_OBJECTS) $(rpmiob_module_la_LIBADD) $(LIBS) +rpmmc_module.la: $(rpmmc_module_la_OBJECTS) $(rpmmc_module_la_DEPENDENCIES) $(EXTRA_rpmmc_module_la_DEPENDENCIES) + $(rpmmc_module_la_LINK) $(rpmmc_module_la_OBJECTS) $(rpmmc_module_la_LIBADD) $(LIBS) +rpmmg_module.la: $(rpmmg_module_la_OBJECTS) $(rpmmg_module_la_DEPENDENCIES) $(EXTRA_rpmmg_module_la_DEPENDENCIES) + $(rpmmg_module_la_LINK) $(rpmmg_module_la_OBJECTS) $(rpmmg_module_la_LIBADD) $(LIBS) +rpmmi_module.la: $(rpmmi_module_la_OBJECTS) $(rpmmi_module_la_DEPENDENCIES) $(EXTRA_rpmmi_module_la_DEPENDENCIES) + $(rpmmi_module_la_LINK) $(rpmmi_module_la_OBJECTS) $(rpmmi_module_la_LIBADD) $(LIBS) +rpmmpf_module.la: $(rpmmpf_module_la_OBJECTS) $(rpmmpf_module_la_DEPENDENCIES) $(EXTRA_rpmmpf_module_la_DEPENDENCIES) + $(rpmmpf_module_la_LINK) $(rpmmpf_module_la_OBJECTS) $(rpmmpf_module_la_LIBADD) $(LIBS) +rpmmpw_module.la: $(rpmmpw_module_la_OBJECTS) $(rpmmpw_module_la_DEPENDENCIES) $(EXTRA_rpmmpw_module_la_DEPENDENCIES) + $(rpmmpw_module_la_LINK) $(rpmmpw_module_la_OBJECTS) $(rpmmpw_module_la_LIBADD) $(LIBS) +rpmps_module.la: $(rpmps_module_la_OBJECTS) $(rpmps_module_la_DEPENDENCIES) $(EXTRA_rpmps_module_la_DEPENDENCIES) + $(rpmps_module_la_LINK) $(rpmps_module_la_OBJECTS) $(rpmps_module_la_LIBADD) $(LIBS) +rpmseq_module.la: $(rpmseq_module_la_OBJECTS) $(rpmseq_module_la_DEPENDENCIES) $(EXTRA_rpmseq_module_la_DEPENDENCIES) + $(rpmseq_module_la_LINK) $(rpmseq_module_la_OBJECTS) $(rpmseq_module_la_LIBADD) $(LIBS) +rpmsm_module.la: $(rpmsm_module_la_OBJECTS) $(rpmsm_module_la_DEPENDENCIES) $(EXTRA_rpmsm_module_la_DEPENDENCIES) + $(rpmsm_module_la_LINK) $(rpmsm_module_la_OBJECTS) $(rpmsm_module_la_LIBADD) $(LIBS) +rpmsp_module.la: $(rpmsp_module_la_OBJECTS) $(rpmsp_module_la_DEPENDENCIES) $(EXTRA_rpmsp_module_la_DEPENDENCIES) + $(rpmsp_module_la_LINK) $(rpmsp_module_la_OBJECTS) $(rpmsp_module_la_LIBADD) $(LIBS) +rpmst_module.la: $(rpmst_module_la_OBJECTS) $(rpmst_module_la_DEPENDENCIES) $(EXTRA_rpmst_module_la_DEPENDENCIES) + $(rpmst_module_la_LINK) $(rpmst_module_la_OBJECTS) $(rpmst_module_la_LIBADD) $(LIBS) +rpmsw_module.la: $(rpmsw_module_la_OBJECTS) $(rpmsw_module_la_DEPENDENCIES) $(EXTRA_rpmsw_module_la_DEPENDENCIES) + $(rpmsw_module_la_LINK) $(rpmsw_module_la_OBJECTS) $(rpmsw_module_la_LIBADD) $(LIBS) +rpmsx_module.la: $(rpmsx_module_la_OBJECTS) $(rpmsx_module_la_DEPENDENCIES) $(EXTRA_rpmsx_module_la_DEPENDENCIES) + $(rpmsx_module_la_LINK) $(rpmsx_module_la_OBJECTS) $(rpmsx_module_la_LIBADD) $(LIBS) +rpmsys_module.la: $(rpmsys_module_la_OBJECTS) $(rpmsys_module_la_DEPENDENCIES) $(EXTRA_rpmsys_module_la_DEPENDENCIES) + $(rpmsys_module_la_LINK) $(rpmsys_module_la_OBJECTS) $(rpmsys_module_la_LIBADD) $(LIBS) +rpmte_module.la: $(rpmte_module_la_OBJECTS) $(rpmte_module_la_DEPENDENCIES) $(EXTRA_rpmte_module_la_DEPENDENCIES) + $(rpmte_module_la_LINK) $(rpmte_module_la_OBJECTS) $(rpmte_module_la_LIBADD) $(LIBS) +rpmts_module.la: $(rpmts_module_la_OBJECTS) $(rpmts_module_la_DEPENDENCIES) $(EXTRA_rpmts_module_la_DEPENDENCIES) + $(rpmts_module_la_LINK) $(rpmts_module_la_OBJECTS) $(rpmts_module_la_LIBADD) $(LIBS) +rpmtxn_module.la: $(rpmtxn_module_la_OBJECTS) $(rpmtxn_module_la_DEPENDENCIES) $(EXTRA_rpmtxn_module_la_DEPENDENCIES) + $(rpmtxn_module_la_LINK) $(rpmtxn_module_la_OBJECTS) $(rpmtxn_module_la_LIBADD) $(LIBS) +rpmxar_module.la: $(rpmxar_module_la_OBJECTS) $(rpmxar_module_la_DEPENDENCIES) $(EXTRA_rpmxar_module_la_DEPENDENCIES) + $(rpmxar_module_la_LINK) $(rpmxar_module_la_OBJECTS) $(rpmxar_module_la_LIBADD) $(LIBS) +syck_module.la: $(syck_module_la_OBJECTS) $(syck_module_la_DEPENDENCIES) $(EXTRA_syck_module_la_DEPENDENCIES) + $(syck_module_la_LINK) $(syck_module_la_OBJECTS) $(syck_module_la_LIBADD) $(LIBS) +uuid_module.la: $(uuid_module_la_OBJECTS) $(uuid_module_la_DEPENDENCIES) $(EXTRA_uuid_module_la_DEPENDENCIES) + $(uuid_module_la_LINK) $(uuid_module_la_OBJECTS) $(uuid_module_la_LIBADD) $(LIBS) +install-pkgbinPROGRAMS: $(pkgbin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(pkgbin_PROGRAMS)'; test -n "$(pkgbindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgbindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgbindir)" || 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)$(pkgbindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkgbindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-pkgbinPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(pkgbin_PROGRAMS)'; test -n "$(pkgbindir)" || 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)$(pkgbindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgbindir)" && rm -f $$files + +clean-pkgbinPROGRAMS: + @list='$(pkgbin_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 +ngsr$(EXEEXT): $(ngsr_OBJECTS) $(ngsr_DEPENDENCIES) $(EXTRA_ngsr_DEPENDENCIES) + @rm -f ngsr$(EXEEXT) + $(LINK) $(ngsr_OBJECTS) $(ngsr_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/librpmjsm_la-rpmaug-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmbc-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmbf-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmcudf-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmdb-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmdbc-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmdbe-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmdc-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmdig-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmdir-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmds-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmfc-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmfi-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmfts-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmgi-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmhdr-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmio-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmiob-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmmc-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmmg-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmmi-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmmpf-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmmpw-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmps-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmseq-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmsm-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmsp-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmst-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmsw-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmsx-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmsys-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmte-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmts-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmtxn-js.Plo +include ./$(DEPDIR)/librpmjsm_la-rpmxar-js.Plo +include ./$(DEPDIR)/librpmjsm_la-syck-js.Plo +include ./$(DEPDIR)/librpmjsm_la-uuid-js.Plo +include ./$(DEPDIR)/ngsr.Po +include ./$(DEPDIR)/rpmaug_module_la-rpmaug-js.Plo +include ./$(DEPDIR)/rpmbc_module_la-rpmbc-js.Plo +include ./$(DEPDIR)/rpmbf_module_la-rpmbf-js.Plo +include ./$(DEPDIR)/rpmcudf_module_la-rpmcudf-js.Plo +include ./$(DEPDIR)/rpmdb_module_la-rpmdb-js.Plo +include ./$(DEPDIR)/rpmdbc_module_la-rpmdbc-js.Plo +include ./$(DEPDIR)/rpmdbe_module_la-rpmdbe-js.Plo +include ./$(DEPDIR)/rpmdc_module_la-rpmdc-js.Plo +include ./$(DEPDIR)/rpmdig_module_la-rpmdig-js.Plo +include ./$(DEPDIR)/rpmdir_module_la-rpmdir-js.Plo +include ./$(DEPDIR)/rpmds_module_la-rpmds-js.Plo +include ./$(DEPDIR)/rpmfc_module_la-rpmfc-js.Plo +include ./$(DEPDIR)/rpmfi_module_la-rpmfi-js.Plo +include ./$(DEPDIR)/rpmfts_module_la-rpmfts-js.Plo +include ./$(DEPDIR)/rpmgi_module_la-rpmgi-js.Plo +include ./$(DEPDIR)/rpmhdr_module_la-rpmhdr-js.Plo +include ./$(DEPDIR)/rpmio_module_la-rpmio-js.Plo +include ./$(DEPDIR)/rpmiob_module_la-rpmiob-js.Plo +include ./$(DEPDIR)/rpmmc_module_la-rpmmc-js.Plo +include ./$(DEPDIR)/rpmmg_module_la-rpmmg-js.Plo +include ./$(DEPDIR)/rpmmi_module_la-rpmmi-js.Plo +include ./$(DEPDIR)/rpmmpf_module_la-rpmmpf-js.Plo +include ./$(DEPDIR)/rpmmpw_module_la-rpmmpw-js.Plo +include ./$(DEPDIR)/rpmps_module_la-rpmps-js.Plo +include ./$(DEPDIR)/rpmseq_module_la-rpmseq-js.Plo +include ./$(DEPDIR)/rpmsm_module_la-rpmsm-js.Plo +include ./$(DEPDIR)/rpmsp_module_la-rpmsp-js.Plo +include ./$(DEPDIR)/rpmst_module_la-rpmst-js.Plo +include ./$(DEPDIR)/rpmsw_module_la-rpmsw-js.Plo +include ./$(DEPDIR)/rpmsx_module_la-rpmsx-js.Plo +include ./$(DEPDIR)/rpmsys_module_la-rpmsys-js.Plo +include ./$(DEPDIR)/rpmte_module_la-rpmte-js.Plo +include ./$(DEPDIR)/rpmts_module_la-rpmts-js.Plo +include ./$(DEPDIR)/rpmtxn_module_la-rpmtxn-js.Plo +include ./$(DEPDIR)/rpmxar_module_la-rpmxar-js.Plo +include ./$(DEPDIR)/syck_module_la-syck-js.Plo +include ./$(DEPDIR)/uuid_module_la-uuid-js.Plo + +.c.o: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c $< + +.c.obj: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: + $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +# source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LTCOMPILE) -c -o $@ $< + +librpmjsm_la-rpmaug-js.lo: rpmaug-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmaug-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmaug-js.Tpo -c -o librpmjsm_la-rpmaug-js.lo `test -f 'rpmaug-js.c' || echo '$(srcdir)/'`rpmaug-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmaug-js.Tpo $(DEPDIR)/librpmjsm_la-rpmaug-js.Plo +# source='rpmaug-js.c' object='librpmjsm_la-rpmaug-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmaug-js.lo `test -f 'rpmaug-js.c' || echo '$(srcdir)/'`rpmaug-js.c + +librpmjsm_la-rpmbc-js.lo: rpmbc-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmbc-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmbc-js.Tpo -c -o librpmjsm_la-rpmbc-js.lo `test -f 'rpmbc-js.c' || echo '$(srcdir)/'`rpmbc-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmbc-js.Tpo $(DEPDIR)/librpmjsm_la-rpmbc-js.Plo +# source='rpmbc-js.c' object='librpmjsm_la-rpmbc-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmbc-js.lo `test -f 'rpmbc-js.c' || echo '$(srcdir)/'`rpmbc-js.c + +librpmjsm_la-rpmbf-js.lo: rpmbf-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmbf-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmbf-js.Tpo -c -o librpmjsm_la-rpmbf-js.lo `test -f 'rpmbf-js.c' || echo '$(srcdir)/'`rpmbf-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmbf-js.Tpo $(DEPDIR)/librpmjsm_la-rpmbf-js.Plo +# source='rpmbf-js.c' object='librpmjsm_la-rpmbf-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmbf-js.lo `test -f 'rpmbf-js.c' || echo '$(srcdir)/'`rpmbf-js.c + +librpmjsm_la-rpmcudf-js.lo: rpmcudf-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmcudf-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmcudf-js.Tpo -c -o librpmjsm_la-rpmcudf-js.lo `test -f 'rpmcudf-js.c' || echo '$(srcdir)/'`rpmcudf-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmcudf-js.Tpo $(DEPDIR)/librpmjsm_la-rpmcudf-js.Plo +# source='rpmcudf-js.c' object='librpmjsm_la-rpmcudf-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmcudf-js.lo `test -f 'rpmcudf-js.c' || echo '$(srcdir)/'`rpmcudf-js.c + +librpmjsm_la-rpmdb-js.lo: rpmdb-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmdb-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmdb-js.Tpo -c -o librpmjsm_la-rpmdb-js.lo `test -f 'rpmdb-js.c' || echo '$(srcdir)/'`rpmdb-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmdb-js.Tpo $(DEPDIR)/librpmjsm_la-rpmdb-js.Plo +# source='rpmdb-js.c' object='librpmjsm_la-rpmdb-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmdb-js.lo `test -f 'rpmdb-js.c' || echo '$(srcdir)/'`rpmdb-js.c + +librpmjsm_la-rpmdbc-js.lo: rpmdbc-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmdbc-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmdbc-js.Tpo -c -o librpmjsm_la-rpmdbc-js.lo `test -f 'rpmdbc-js.c' || echo '$(srcdir)/'`rpmdbc-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmdbc-js.Tpo $(DEPDIR)/librpmjsm_la-rpmdbc-js.Plo +# source='rpmdbc-js.c' object='librpmjsm_la-rpmdbc-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmdbc-js.lo `test -f 'rpmdbc-js.c' || echo '$(srcdir)/'`rpmdbc-js.c + +librpmjsm_la-rpmdbe-js.lo: rpmdbe-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmdbe-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmdbe-js.Tpo -c -o librpmjsm_la-rpmdbe-js.lo `test -f 'rpmdbe-js.c' || echo '$(srcdir)/'`rpmdbe-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmdbe-js.Tpo $(DEPDIR)/librpmjsm_la-rpmdbe-js.Plo +# source='rpmdbe-js.c' object='librpmjsm_la-rpmdbe-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmdbe-js.lo `test -f 'rpmdbe-js.c' || echo '$(srcdir)/'`rpmdbe-js.c + +librpmjsm_la-rpmdc-js.lo: rpmdc-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmdc-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmdc-js.Tpo -c -o librpmjsm_la-rpmdc-js.lo `test -f 'rpmdc-js.c' || echo '$(srcdir)/'`rpmdc-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmdc-js.Tpo $(DEPDIR)/librpmjsm_la-rpmdc-js.Plo +# source='rpmdc-js.c' object='librpmjsm_la-rpmdc-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmdc-js.lo `test -f 'rpmdc-js.c' || echo '$(srcdir)/'`rpmdc-js.c + +librpmjsm_la-rpmdig-js.lo: rpmdig-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmdig-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmdig-js.Tpo -c -o librpmjsm_la-rpmdig-js.lo `test -f 'rpmdig-js.c' || echo '$(srcdir)/'`rpmdig-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmdig-js.Tpo $(DEPDIR)/librpmjsm_la-rpmdig-js.Plo +# source='rpmdig-js.c' object='librpmjsm_la-rpmdig-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmdig-js.lo `test -f 'rpmdig-js.c' || echo '$(srcdir)/'`rpmdig-js.c + +librpmjsm_la-rpmdir-js.lo: rpmdir-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmdir-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmdir-js.Tpo -c -o librpmjsm_la-rpmdir-js.lo `test -f 'rpmdir-js.c' || echo '$(srcdir)/'`rpmdir-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmdir-js.Tpo $(DEPDIR)/librpmjsm_la-rpmdir-js.Plo +# source='rpmdir-js.c' object='librpmjsm_la-rpmdir-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmdir-js.lo `test -f 'rpmdir-js.c' || echo '$(srcdir)/'`rpmdir-js.c + +librpmjsm_la-rpmds-js.lo: rpmds-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmds-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmds-js.Tpo -c -o librpmjsm_la-rpmds-js.lo `test -f 'rpmds-js.c' || echo '$(srcdir)/'`rpmds-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmds-js.Tpo $(DEPDIR)/librpmjsm_la-rpmds-js.Plo +# source='rpmds-js.c' object='librpmjsm_la-rpmds-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmds-js.lo `test -f 'rpmds-js.c' || echo '$(srcdir)/'`rpmds-js.c + +librpmjsm_la-rpmfc-js.lo: rpmfc-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmfc-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmfc-js.Tpo -c -o librpmjsm_la-rpmfc-js.lo `test -f 'rpmfc-js.c' || echo '$(srcdir)/'`rpmfc-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmfc-js.Tpo $(DEPDIR)/librpmjsm_la-rpmfc-js.Plo +# source='rpmfc-js.c' object='librpmjsm_la-rpmfc-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmfc-js.lo `test -f 'rpmfc-js.c' || echo '$(srcdir)/'`rpmfc-js.c + +librpmjsm_la-rpmfi-js.lo: rpmfi-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmfi-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmfi-js.Tpo -c -o librpmjsm_la-rpmfi-js.lo `test -f 'rpmfi-js.c' || echo '$(srcdir)/'`rpmfi-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmfi-js.Tpo $(DEPDIR)/librpmjsm_la-rpmfi-js.Plo +# source='rpmfi-js.c' object='librpmjsm_la-rpmfi-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmfi-js.lo `test -f 'rpmfi-js.c' || echo '$(srcdir)/'`rpmfi-js.c + +librpmjsm_la-rpmfts-js.lo: rpmfts-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmfts-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmfts-js.Tpo -c -o librpmjsm_la-rpmfts-js.lo `test -f 'rpmfts-js.c' || echo '$(srcdir)/'`rpmfts-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmfts-js.Tpo $(DEPDIR)/librpmjsm_la-rpmfts-js.Plo +# source='rpmfts-js.c' object='librpmjsm_la-rpmfts-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmfts-js.lo `test -f 'rpmfts-js.c' || echo '$(srcdir)/'`rpmfts-js.c + +librpmjsm_la-rpmgi-js.lo: rpmgi-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmgi-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmgi-js.Tpo -c -o librpmjsm_la-rpmgi-js.lo `test -f 'rpmgi-js.c' || echo '$(srcdir)/'`rpmgi-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmgi-js.Tpo $(DEPDIR)/librpmjsm_la-rpmgi-js.Plo +# source='rpmgi-js.c' object='librpmjsm_la-rpmgi-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmgi-js.lo `test -f 'rpmgi-js.c' || echo '$(srcdir)/'`rpmgi-js.c + +librpmjsm_la-rpmhdr-js.lo: rpmhdr-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmhdr-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmhdr-js.Tpo -c -o librpmjsm_la-rpmhdr-js.lo `test -f 'rpmhdr-js.c' || echo '$(srcdir)/'`rpmhdr-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmhdr-js.Tpo $(DEPDIR)/librpmjsm_la-rpmhdr-js.Plo +# source='rpmhdr-js.c' object='librpmjsm_la-rpmhdr-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmhdr-js.lo `test -f 'rpmhdr-js.c' || echo '$(srcdir)/'`rpmhdr-js.c + +librpmjsm_la-rpmio-js.lo: rpmio-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmio-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmio-js.Tpo -c -o librpmjsm_la-rpmio-js.lo `test -f 'rpmio-js.c' || echo '$(srcdir)/'`rpmio-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmio-js.Tpo $(DEPDIR)/librpmjsm_la-rpmio-js.Plo +# source='rpmio-js.c' object='librpmjsm_la-rpmio-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmio-js.lo `test -f 'rpmio-js.c' || echo '$(srcdir)/'`rpmio-js.c + +librpmjsm_la-rpmiob-js.lo: rpmiob-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmiob-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmiob-js.Tpo -c -o librpmjsm_la-rpmiob-js.lo `test -f 'rpmiob-js.c' || echo '$(srcdir)/'`rpmiob-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmiob-js.Tpo $(DEPDIR)/librpmjsm_la-rpmiob-js.Plo +# source='rpmiob-js.c' object='librpmjsm_la-rpmiob-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmiob-js.lo `test -f 'rpmiob-js.c' || echo '$(srcdir)/'`rpmiob-js.c + +librpmjsm_la-rpmmc-js.lo: rpmmc-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmmc-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmmc-js.Tpo -c -o librpmjsm_la-rpmmc-js.lo `test -f 'rpmmc-js.c' || echo '$(srcdir)/'`rpmmc-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmmc-js.Tpo $(DEPDIR)/librpmjsm_la-rpmmc-js.Plo +# source='rpmmc-js.c' object='librpmjsm_la-rpmmc-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmmc-js.lo `test -f 'rpmmc-js.c' || echo '$(srcdir)/'`rpmmc-js.c + +librpmjsm_la-rpmmg-js.lo: rpmmg-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmmg-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmmg-js.Tpo -c -o librpmjsm_la-rpmmg-js.lo `test -f 'rpmmg-js.c' || echo '$(srcdir)/'`rpmmg-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmmg-js.Tpo $(DEPDIR)/librpmjsm_la-rpmmg-js.Plo +# source='rpmmg-js.c' object='librpmjsm_la-rpmmg-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmmg-js.lo `test -f 'rpmmg-js.c' || echo '$(srcdir)/'`rpmmg-js.c + +librpmjsm_la-rpmmi-js.lo: rpmmi-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmmi-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmmi-js.Tpo -c -o librpmjsm_la-rpmmi-js.lo `test -f 'rpmmi-js.c' || echo '$(srcdir)/'`rpmmi-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmmi-js.Tpo $(DEPDIR)/librpmjsm_la-rpmmi-js.Plo +# source='rpmmi-js.c' object='librpmjsm_la-rpmmi-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmmi-js.lo `test -f 'rpmmi-js.c' || echo '$(srcdir)/'`rpmmi-js.c + +librpmjsm_la-rpmmpf-js.lo: rpmmpf-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmmpf-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmmpf-js.Tpo -c -o librpmjsm_la-rpmmpf-js.lo `test -f 'rpmmpf-js.c' || echo '$(srcdir)/'`rpmmpf-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmmpf-js.Tpo $(DEPDIR)/librpmjsm_la-rpmmpf-js.Plo +# source='rpmmpf-js.c' object='librpmjsm_la-rpmmpf-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmmpf-js.lo `test -f 'rpmmpf-js.c' || echo '$(srcdir)/'`rpmmpf-js.c + +librpmjsm_la-rpmmpw-js.lo: rpmmpw-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmmpw-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmmpw-js.Tpo -c -o librpmjsm_la-rpmmpw-js.lo `test -f 'rpmmpw-js.c' || echo '$(srcdir)/'`rpmmpw-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmmpw-js.Tpo $(DEPDIR)/librpmjsm_la-rpmmpw-js.Plo +# source='rpmmpw-js.c' object='librpmjsm_la-rpmmpw-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmmpw-js.lo `test -f 'rpmmpw-js.c' || echo '$(srcdir)/'`rpmmpw-js.c + +librpmjsm_la-rpmps-js.lo: rpmps-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmps-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmps-js.Tpo -c -o librpmjsm_la-rpmps-js.lo `test -f 'rpmps-js.c' || echo '$(srcdir)/'`rpmps-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmps-js.Tpo $(DEPDIR)/librpmjsm_la-rpmps-js.Plo +# source='rpmps-js.c' object='librpmjsm_la-rpmps-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmps-js.lo `test -f 'rpmps-js.c' || echo '$(srcdir)/'`rpmps-js.c + +librpmjsm_la-rpmseq-js.lo: rpmseq-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmseq-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmseq-js.Tpo -c -o librpmjsm_la-rpmseq-js.lo `test -f 'rpmseq-js.c' || echo '$(srcdir)/'`rpmseq-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmseq-js.Tpo $(DEPDIR)/librpmjsm_la-rpmseq-js.Plo +# source='rpmseq-js.c' object='librpmjsm_la-rpmseq-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmseq-js.lo `test -f 'rpmseq-js.c' || echo '$(srcdir)/'`rpmseq-js.c + +librpmjsm_la-rpmsm-js.lo: rpmsm-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmsm-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmsm-js.Tpo -c -o librpmjsm_la-rpmsm-js.lo `test -f 'rpmsm-js.c' || echo '$(srcdir)/'`rpmsm-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmsm-js.Tpo $(DEPDIR)/librpmjsm_la-rpmsm-js.Plo +# source='rpmsm-js.c' object='librpmjsm_la-rpmsm-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmsm-js.lo `test -f 'rpmsm-js.c' || echo '$(srcdir)/'`rpmsm-js.c + +librpmjsm_la-rpmsp-js.lo: rpmsp-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmsp-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmsp-js.Tpo -c -o librpmjsm_la-rpmsp-js.lo `test -f 'rpmsp-js.c' || echo '$(srcdir)/'`rpmsp-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmsp-js.Tpo $(DEPDIR)/librpmjsm_la-rpmsp-js.Plo +# source='rpmsp-js.c' object='librpmjsm_la-rpmsp-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmsp-js.lo `test -f 'rpmsp-js.c' || echo '$(srcdir)/'`rpmsp-js.c + +librpmjsm_la-rpmst-js.lo: rpmst-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmst-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmst-js.Tpo -c -o librpmjsm_la-rpmst-js.lo `test -f 'rpmst-js.c' || echo '$(srcdir)/'`rpmst-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmst-js.Tpo $(DEPDIR)/librpmjsm_la-rpmst-js.Plo +# source='rpmst-js.c' object='librpmjsm_la-rpmst-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmst-js.lo `test -f 'rpmst-js.c' || echo '$(srcdir)/'`rpmst-js.c + +librpmjsm_la-rpmsw-js.lo: rpmsw-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmsw-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmsw-js.Tpo -c -o librpmjsm_la-rpmsw-js.lo `test -f 'rpmsw-js.c' || echo '$(srcdir)/'`rpmsw-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmsw-js.Tpo $(DEPDIR)/librpmjsm_la-rpmsw-js.Plo +# source='rpmsw-js.c' object='librpmjsm_la-rpmsw-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmsw-js.lo `test -f 'rpmsw-js.c' || echo '$(srcdir)/'`rpmsw-js.c + +librpmjsm_la-rpmsx-js.lo: rpmsx-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmsx-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmsx-js.Tpo -c -o librpmjsm_la-rpmsx-js.lo `test -f 'rpmsx-js.c' || echo '$(srcdir)/'`rpmsx-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmsx-js.Tpo $(DEPDIR)/librpmjsm_la-rpmsx-js.Plo +# source='rpmsx-js.c' object='librpmjsm_la-rpmsx-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmsx-js.lo `test -f 'rpmsx-js.c' || echo '$(srcdir)/'`rpmsx-js.c + +librpmjsm_la-rpmsys-js.lo: rpmsys-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmsys-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmsys-js.Tpo -c -o librpmjsm_la-rpmsys-js.lo `test -f 'rpmsys-js.c' || echo '$(srcdir)/'`rpmsys-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmsys-js.Tpo $(DEPDIR)/librpmjsm_la-rpmsys-js.Plo +# source='rpmsys-js.c' object='librpmjsm_la-rpmsys-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmsys-js.lo `test -f 'rpmsys-js.c' || echo '$(srcdir)/'`rpmsys-js.c + +librpmjsm_la-rpmte-js.lo: rpmte-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmte-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmte-js.Tpo -c -o librpmjsm_la-rpmte-js.lo `test -f 'rpmte-js.c' || echo '$(srcdir)/'`rpmte-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmte-js.Tpo $(DEPDIR)/librpmjsm_la-rpmte-js.Plo +# source='rpmte-js.c' object='librpmjsm_la-rpmte-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmte-js.lo `test -f 'rpmte-js.c' || echo '$(srcdir)/'`rpmte-js.c + +librpmjsm_la-rpmts-js.lo: rpmts-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmts-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmts-js.Tpo -c -o librpmjsm_la-rpmts-js.lo `test -f 'rpmts-js.c' || echo '$(srcdir)/'`rpmts-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmts-js.Tpo $(DEPDIR)/librpmjsm_la-rpmts-js.Plo +# source='rpmts-js.c' object='librpmjsm_la-rpmts-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmts-js.lo `test -f 'rpmts-js.c' || echo '$(srcdir)/'`rpmts-js.c + +librpmjsm_la-rpmtxn-js.lo: rpmtxn-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmtxn-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmtxn-js.Tpo -c -o librpmjsm_la-rpmtxn-js.lo `test -f 'rpmtxn-js.c' || echo '$(srcdir)/'`rpmtxn-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmtxn-js.Tpo $(DEPDIR)/librpmjsm_la-rpmtxn-js.Plo +# source='rpmtxn-js.c' object='librpmjsm_la-rpmtxn-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmtxn-js.lo `test -f 'rpmtxn-js.c' || echo '$(srcdir)/'`rpmtxn-js.c + +librpmjsm_la-rpmxar-js.lo: rpmxar-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmxar-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmxar-js.Tpo -c -o librpmjsm_la-rpmxar-js.lo `test -f 'rpmxar-js.c' || echo '$(srcdir)/'`rpmxar-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-rpmxar-js.Tpo $(DEPDIR)/librpmjsm_la-rpmxar-js.Plo +# source='rpmxar-js.c' object='librpmjsm_la-rpmxar-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmxar-js.lo `test -f 'rpmxar-js.c' || echo '$(srcdir)/'`rpmxar-js.c + +librpmjsm_la-syck-js.lo: syck-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-syck-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-syck-js.Tpo -c -o librpmjsm_la-syck-js.lo `test -f 'syck-js.c' || echo '$(srcdir)/'`syck-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-syck-js.Tpo $(DEPDIR)/librpmjsm_la-syck-js.Plo +# source='syck-js.c' object='librpmjsm_la-syck-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-syck-js.lo `test -f 'syck-js.c' || echo '$(srcdir)/'`syck-js.c + +librpmjsm_la-uuid-js.lo: uuid-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-uuid-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-uuid-js.Tpo -c -o librpmjsm_la-uuid-js.lo `test -f 'uuid-js.c' || echo '$(srcdir)/'`uuid-js.c + $(am__mv) $(DEPDIR)/librpmjsm_la-uuid-js.Tpo $(DEPDIR)/librpmjsm_la-uuid-js.Plo +# source='uuid-js.c' object='librpmjsm_la-uuid-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-uuid-js.lo `test -f 'uuid-js.c' || echo '$(srcdir)/'`uuid-js.c + +rpmaug_module_la-rpmaug-js.lo: rpmaug-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmaug_module_la_CFLAGS) $(CFLAGS) -MT rpmaug_module_la-rpmaug-js.lo -MD -MP -MF $(DEPDIR)/rpmaug_module_la-rpmaug-js.Tpo -c -o rpmaug_module_la-rpmaug-js.lo `test -f 'rpmaug-js.c' || echo '$(srcdir)/'`rpmaug-js.c + $(am__mv) $(DEPDIR)/rpmaug_module_la-rpmaug-js.Tpo $(DEPDIR)/rpmaug_module_la-rpmaug-js.Plo +# source='rpmaug-js.c' object='rpmaug_module_la-rpmaug-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmaug_module_la_CFLAGS) $(CFLAGS) -c -o rpmaug_module_la-rpmaug-js.lo `test -f 'rpmaug-js.c' || echo '$(srcdir)/'`rpmaug-js.c + +rpmbc_module_la-rpmbc-js.lo: rpmbc-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmbc_module_la_CFLAGS) $(CFLAGS) -MT rpmbc_module_la-rpmbc-js.lo -MD -MP -MF $(DEPDIR)/rpmbc_module_la-rpmbc-js.Tpo -c -o rpmbc_module_la-rpmbc-js.lo `test -f 'rpmbc-js.c' || echo '$(srcdir)/'`rpmbc-js.c + $(am__mv) $(DEPDIR)/rpmbc_module_la-rpmbc-js.Tpo $(DEPDIR)/rpmbc_module_la-rpmbc-js.Plo +# source='rpmbc-js.c' object='rpmbc_module_la-rpmbc-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmbc_module_la_CFLAGS) $(CFLAGS) -c -o rpmbc_module_la-rpmbc-js.lo `test -f 'rpmbc-js.c' || echo '$(srcdir)/'`rpmbc-js.c + +rpmbf_module_la-rpmbf-js.lo: rpmbf-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmbf_module_la_CFLAGS) $(CFLAGS) -MT rpmbf_module_la-rpmbf-js.lo -MD -MP -MF $(DEPDIR)/rpmbf_module_la-rpmbf-js.Tpo -c -o rpmbf_module_la-rpmbf-js.lo `test -f 'rpmbf-js.c' || echo '$(srcdir)/'`rpmbf-js.c + $(am__mv) $(DEPDIR)/rpmbf_module_la-rpmbf-js.Tpo $(DEPDIR)/rpmbf_module_la-rpmbf-js.Plo +# source='rpmbf-js.c' object='rpmbf_module_la-rpmbf-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmbf_module_la_CFLAGS) $(CFLAGS) -c -o rpmbf_module_la-rpmbf-js.lo `test -f 'rpmbf-js.c' || echo '$(srcdir)/'`rpmbf-js.c + +rpmcudf_module_la-rpmcudf-js.lo: rpmcudf-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmcudf_module_la_CFLAGS) $(CFLAGS) -MT rpmcudf_module_la-rpmcudf-js.lo -MD -MP -MF $(DEPDIR)/rpmcudf_module_la-rpmcudf-js.Tpo -c -o rpmcudf_module_la-rpmcudf-js.lo `test -f 'rpmcudf-js.c' || echo '$(srcdir)/'`rpmcudf-js.c + $(am__mv) $(DEPDIR)/rpmcudf_module_la-rpmcudf-js.Tpo $(DEPDIR)/rpmcudf_module_la-rpmcudf-js.Plo +# source='rpmcudf-js.c' object='rpmcudf_module_la-rpmcudf-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmcudf_module_la_CFLAGS) $(CFLAGS) -c -o rpmcudf_module_la-rpmcudf-js.lo `test -f 'rpmcudf-js.c' || echo '$(srcdir)/'`rpmcudf-js.c + +rpmdb_module_la-rpmdb-js.lo: rpmdb-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdb_module_la_CFLAGS) $(CFLAGS) -MT rpmdb_module_la-rpmdb-js.lo -MD -MP -MF $(DEPDIR)/rpmdb_module_la-rpmdb-js.Tpo -c -o rpmdb_module_la-rpmdb-js.lo `test -f 'rpmdb-js.c' || echo '$(srcdir)/'`rpmdb-js.c + $(am__mv) $(DEPDIR)/rpmdb_module_la-rpmdb-js.Tpo $(DEPDIR)/rpmdb_module_la-rpmdb-js.Plo +# source='rpmdb-js.c' object='rpmdb_module_la-rpmdb-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdb_module_la_CFLAGS) $(CFLAGS) -c -o rpmdb_module_la-rpmdb-js.lo `test -f 'rpmdb-js.c' || echo '$(srcdir)/'`rpmdb-js.c + +rpmdbc_module_la-rpmdbc-js.lo: rpmdbc-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdbc_module_la_CFLAGS) $(CFLAGS) -MT rpmdbc_module_la-rpmdbc-js.lo -MD -MP -MF $(DEPDIR)/rpmdbc_module_la-rpmdbc-js.Tpo -c -o rpmdbc_module_la-rpmdbc-js.lo `test -f 'rpmdbc-js.c' || echo '$(srcdir)/'`rpmdbc-js.c + $(am__mv) $(DEPDIR)/rpmdbc_module_la-rpmdbc-js.Tpo $(DEPDIR)/rpmdbc_module_la-rpmdbc-js.Plo +# source='rpmdbc-js.c' object='rpmdbc_module_la-rpmdbc-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdbc_module_la_CFLAGS) $(CFLAGS) -c -o rpmdbc_module_la-rpmdbc-js.lo `test -f 'rpmdbc-js.c' || echo '$(srcdir)/'`rpmdbc-js.c + +rpmdbe_module_la-rpmdbe-js.lo: rpmdbe-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdbe_module_la_CFLAGS) $(CFLAGS) -MT rpmdbe_module_la-rpmdbe-js.lo -MD -MP -MF $(DEPDIR)/rpmdbe_module_la-rpmdbe-js.Tpo -c -o rpmdbe_module_la-rpmdbe-js.lo `test -f 'rpmdbe-js.c' || echo '$(srcdir)/'`rpmdbe-js.c + $(am__mv) $(DEPDIR)/rpmdbe_module_la-rpmdbe-js.Tpo $(DEPDIR)/rpmdbe_module_la-rpmdbe-js.Plo +# source='rpmdbe-js.c' object='rpmdbe_module_la-rpmdbe-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdbe_module_la_CFLAGS) $(CFLAGS) -c -o rpmdbe_module_la-rpmdbe-js.lo `test -f 'rpmdbe-js.c' || echo '$(srcdir)/'`rpmdbe-js.c + +rpmdc_module_la-rpmdc-js.lo: rpmdc-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdc_module_la_CFLAGS) $(CFLAGS) -MT rpmdc_module_la-rpmdc-js.lo -MD -MP -MF $(DEPDIR)/rpmdc_module_la-rpmdc-js.Tpo -c -o rpmdc_module_la-rpmdc-js.lo `test -f 'rpmdc-js.c' || echo '$(srcdir)/'`rpmdc-js.c + $(am__mv) $(DEPDIR)/rpmdc_module_la-rpmdc-js.Tpo $(DEPDIR)/rpmdc_module_la-rpmdc-js.Plo +# source='rpmdc-js.c' object='rpmdc_module_la-rpmdc-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdc_module_la_CFLAGS) $(CFLAGS) -c -o rpmdc_module_la-rpmdc-js.lo `test -f 'rpmdc-js.c' || echo '$(srcdir)/'`rpmdc-js.c + +rpmdig_module_la-rpmdig-js.lo: rpmdig-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdig_module_la_CFLAGS) $(CFLAGS) -MT rpmdig_module_la-rpmdig-js.lo -MD -MP -MF $(DEPDIR)/rpmdig_module_la-rpmdig-js.Tpo -c -o rpmdig_module_la-rpmdig-js.lo `test -f 'rpmdig-js.c' || echo '$(srcdir)/'`rpmdig-js.c + $(am__mv) $(DEPDIR)/rpmdig_module_la-rpmdig-js.Tpo $(DEPDIR)/rpmdig_module_la-rpmdig-js.Plo +# source='rpmdig-js.c' object='rpmdig_module_la-rpmdig-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdig_module_la_CFLAGS) $(CFLAGS) -c -o rpmdig_module_la-rpmdig-js.lo `test -f 'rpmdig-js.c' || echo '$(srcdir)/'`rpmdig-js.c + +rpmdir_module_la-rpmdir-js.lo: rpmdir-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdir_module_la_CFLAGS) $(CFLAGS) -MT rpmdir_module_la-rpmdir-js.lo -MD -MP -MF $(DEPDIR)/rpmdir_module_la-rpmdir-js.Tpo -c -o rpmdir_module_la-rpmdir-js.lo `test -f 'rpmdir-js.c' || echo '$(srcdir)/'`rpmdir-js.c + $(am__mv) $(DEPDIR)/rpmdir_module_la-rpmdir-js.Tpo $(DEPDIR)/rpmdir_module_la-rpmdir-js.Plo +# source='rpmdir-js.c' object='rpmdir_module_la-rpmdir-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdir_module_la_CFLAGS) $(CFLAGS) -c -o rpmdir_module_la-rpmdir-js.lo `test -f 'rpmdir-js.c' || echo '$(srcdir)/'`rpmdir-js.c + +rpmds_module_la-rpmds-js.lo: rpmds-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmds_module_la_CFLAGS) $(CFLAGS) -MT rpmds_module_la-rpmds-js.lo -MD -MP -MF $(DEPDIR)/rpmds_module_la-rpmds-js.Tpo -c -o rpmds_module_la-rpmds-js.lo `test -f 'rpmds-js.c' || echo '$(srcdir)/'`rpmds-js.c + $(am__mv) $(DEPDIR)/rpmds_module_la-rpmds-js.Tpo $(DEPDIR)/rpmds_module_la-rpmds-js.Plo +# source='rpmds-js.c' object='rpmds_module_la-rpmds-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmds_module_la_CFLAGS) $(CFLAGS) -c -o rpmds_module_la-rpmds-js.lo `test -f 'rpmds-js.c' || echo '$(srcdir)/'`rpmds-js.c + +rpmfc_module_la-rpmfc-js.lo: rpmfc-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmfc_module_la_CFLAGS) $(CFLAGS) -MT rpmfc_module_la-rpmfc-js.lo -MD -MP -MF $(DEPDIR)/rpmfc_module_la-rpmfc-js.Tpo -c -o rpmfc_module_la-rpmfc-js.lo `test -f 'rpmfc-js.c' || echo '$(srcdir)/'`rpmfc-js.c + $(am__mv) $(DEPDIR)/rpmfc_module_la-rpmfc-js.Tpo $(DEPDIR)/rpmfc_module_la-rpmfc-js.Plo +# source='rpmfc-js.c' object='rpmfc_module_la-rpmfc-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmfc_module_la_CFLAGS) $(CFLAGS) -c -o rpmfc_module_la-rpmfc-js.lo `test -f 'rpmfc-js.c' || echo '$(srcdir)/'`rpmfc-js.c + +rpmfi_module_la-rpmfi-js.lo: rpmfi-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmfi_module_la_CFLAGS) $(CFLAGS) -MT rpmfi_module_la-rpmfi-js.lo -MD -MP -MF $(DEPDIR)/rpmfi_module_la-rpmfi-js.Tpo -c -o rpmfi_module_la-rpmfi-js.lo `test -f 'rpmfi-js.c' || echo '$(srcdir)/'`rpmfi-js.c + $(am__mv) $(DEPDIR)/rpmfi_module_la-rpmfi-js.Tpo $(DEPDIR)/rpmfi_module_la-rpmfi-js.Plo +# source='rpmfi-js.c' object='rpmfi_module_la-rpmfi-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmfi_module_la_CFLAGS) $(CFLAGS) -c -o rpmfi_module_la-rpmfi-js.lo `test -f 'rpmfi-js.c' || echo '$(srcdir)/'`rpmfi-js.c + +rpmfts_module_la-rpmfts-js.lo: rpmfts-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmfts_module_la_CFLAGS) $(CFLAGS) -MT rpmfts_module_la-rpmfts-js.lo -MD -MP -MF $(DEPDIR)/rpmfts_module_la-rpmfts-js.Tpo -c -o rpmfts_module_la-rpmfts-js.lo `test -f 'rpmfts-js.c' || echo '$(srcdir)/'`rpmfts-js.c + $(am__mv) $(DEPDIR)/rpmfts_module_la-rpmfts-js.Tpo $(DEPDIR)/rpmfts_module_la-rpmfts-js.Plo +# source='rpmfts-js.c' object='rpmfts_module_la-rpmfts-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmfts_module_la_CFLAGS) $(CFLAGS) -c -o rpmfts_module_la-rpmfts-js.lo `test -f 'rpmfts-js.c' || echo '$(srcdir)/'`rpmfts-js.c + +rpmgi_module_la-rpmgi-js.lo: rpmgi-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmgi_module_la_CFLAGS) $(CFLAGS) -MT rpmgi_module_la-rpmgi-js.lo -MD -MP -MF $(DEPDIR)/rpmgi_module_la-rpmgi-js.Tpo -c -o rpmgi_module_la-rpmgi-js.lo `test -f 'rpmgi-js.c' || echo '$(srcdir)/'`rpmgi-js.c + $(am__mv) $(DEPDIR)/rpmgi_module_la-rpmgi-js.Tpo $(DEPDIR)/rpmgi_module_la-rpmgi-js.Plo +# source='rpmgi-js.c' object='rpmgi_module_la-rpmgi-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmgi_module_la_CFLAGS) $(CFLAGS) -c -o rpmgi_module_la-rpmgi-js.lo `test -f 'rpmgi-js.c' || echo '$(srcdir)/'`rpmgi-js.c + +rpmhdr_module_la-rpmhdr-js.lo: rpmhdr-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmhdr_module_la_CFLAGS) $(CFLAGS) -MT rpmhdr_module_la-rpmhdr-js.lo -MD -MP -MF $(DEPDIR)/rpmhdr_module_la-rpmhdr-js.Tpo -c -o rpmhdr_module_la-rpmhdr-js.lo `test -f 'rpmhdr-js.c' || echo '$(srcdir)/'`rpmhdr-js.c + $(am__mv) $(DEPDIR)/rpmhdr_module_la-rpmhdr-js.Tpo $(DEPDIR)/rpmhdr_module_la-rpmhdr-js.Plo +# source='rpmhdr-js.c' object='rpmhdr_module_la-rpmhdr-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmhdr_module_la_CFLAGS) $(CFLAGS) -c -o rpmhdr_module_la-rpmhdr-js.lo `test -f 'rpmhdr-js.c' || echo '$(srcdir)/'`rpmhdr-js.c + +rpmio_module_la-rpmio-js.lo: rpmio-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmio_module_la_CFLAGS) $(CFLAGS) -MT rpmio_module_la-rpmio-js.lo -MD -MP -MF $(DEPDIR)/rpmio_module_la-rpmio-js.Tpo -c -o rpmio_module_la-rpmio-js.lo `test -f 'rpmio-js.c' || echo '$(srcdir)/'`rpmio-js.c + $(am__mv) $(DEPDIR)/rpmio_module_la-rpmio-js.Tpo $(DEPDIR)/rpmio_module_la-rpmio-js.Plo +# source='rpmio-js.c' object='rpmio_module_la-rpmio-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmio_module_la_CFLAGS) $(CFLAGS) -c -o rpmio_module_la-rpmio-js.lo `test -f 'rpmio-js.c' || echo '$(srcdir)/'`rpmio-js.c + +rpmiob_module_la-rpmiob-js.lo: rpmiob-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmiob_module_la_CFLAGS) $(CFLAGS) -MT rpmiob_module_la-rpmiob-js.lo -MD -MP -MF $(DEPDIR)/rpmiob_module_la-rpmiob-js.Tpo -c -o rpmiob_module_la-rpmiob-js.lo `test -f 'rpmiob-js.c' || echo '$(srcdir)/'`rpmiob-js.c + $(am__mv) $(DEPDIR)/rpmiob_module_la-rpmiob-js.Tpo $(DEPDIR)/rpmiob_module_la-rpmiob-js.Plo +# source='rpmiob-js.c' object='rpmiob_module_la-rpmiob-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmiob_module_la_CFLAGS) $(CFLAGS) -c -o rpmiob_module_la-rpmiob-js.lo `test -f 'rpmiob-js.c' || echo '$(srcdir)/'`rpmiob-js.c + +rpmmc_module_la-rpmmc-js.lo: rpmmc-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmc_module_la_CFLAGS) $(CFLAGS) -MT rpmmc_module_la-rpmmc-js.lo -MD -MP -MF $(DEPDIR)/rpmmc_module_la-rpmmc-js.Tpo -c -o rpmmc_module_la-rpmmc-js.lo `test -f 'rpmmc-js.c' || echo '$(srcdir)/'`rpmmc-js.c + $(am__mv) $(DEPDIR)/rpmmc_module_la-rpmmc-js.Tpo $(DEPDIR)/rpmmc_module_la-rpmmc-js.Plo +# source='rpmmc-js.c' object='rpmmc_module_la-rpmmc-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmc_module_la_CFLAGS) $(CFLAGS) -c -o rpmmc_module_la-rpmmc-js.lo `test -f 'rpmmc-js.c' || echo '$(srcdir)/'`rpmmc-js.c + +rpmmg_module_la-rpmmg-js.lo: rpmmg-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmg_module_la_CFLAGS) $(CFLAGS) -MT rpmmg_module_la-rpmmg-js.lo -MD -MP -MF $(DEPDIR)/rpmmg_module_la-rpmmg-js.Tpo -c -o rpmmg_module_la-rpmmg-js.lo `test -f 'rpmmg-js.c' || echo '$(srcdir)/'`rpmmg-js.c + $(am__mv) $(DEPDIR)/rpmmg_module_la-rpmmg-js.Tpo $(DEPDIR)/rpmmg_module_la-rpmmg-js.Plo +# source='rpmmg-js.c' object='rpmmg_module_la-rpmmg-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmg_module_la_CFLAGS) $(CFLAGS) -c -o rpmmg_module_la-rpmmg-js.lo `test -f 'rpmmg-js.c' || echo '$(srcdir)/'`rpmmg-js.c + +rpmmi_module_la-rpmmi-js.lo: rpmmi-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmi_module_la_CFLAGS) $(CFLAGS) -MT rpmmi_module_la-rpmmi-js.lo -MD -MP -MF $(DEPDIR)/rpmmi_module_la-rpmmi-js.Tpo -c -o rpmmi_module_la-rpmmi-js.lo `test -f 'rpmmi-js.c' || echo '$(srcdir)/'`rpmmi-js.c + $(am__mv) $(DEPDIR)/rpmmi_module_la-rpmmi-js.Tpo $(DEPDIR)/rpmmi_module_la-rpmmi-js.Plo +# source='rpmmi-js.c' object='rpmmi_module_la-rpmmi-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmi_module_la_CFLAGS) $(CFLAGS) -c -o rpmmi_module_la-rpmmi-js.lo `test -f 'rpmmi-js.c' || echo '$(srcdir)/'`rpmmi-js.c + +rpmmpf_module_la-rpmmpf-js.lo: rpmmpf-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmpf_module_la_CFLAGS) $(CFLAGS) -MT rpmmpf_module_la-rpmmpf-js.lo -MD -MP -MF $(DEPDIR)/rpmmpf_module_la-rpmmpf-js.Tpo -c -o rpmmpf_module_la-rpmmpf-js.lo `test -f 'rpmmpf-js.c' || echo '$(srcdir)/'`rpmmpf-js.c + $(am__mv) $(DEPDIR)/rpmmpf_module_la-rpmmpf-js.Tpo $(DEPDIR)/rpmmpf_module_la-rpmmpf-js.Plo +# source='rpmmpf-js.c' object='rpmmpf_module_la-rpmmpf-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmpf_module_la_CFLAGS) $(CFLAGS) -c -o rpmmpf_module_la-rpmmpf-js.lo `test -f 'rpmmpf-js.c' || echo '$(srcdir)/'`rpmmpf-js.c + +rpmmpw_module_la-rpmmpw-js.lo: rpmmpw-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmpw_module_la_CFLAGS) $(CFLAGS) -MT rpmmpw_module_la-rpmmpw-js.lo -MD -MP -MF $(DEPDIR)/rpmmpw_module_la-rpmmpw-js.Tpo -c -o rpmmpw_module_la-rpmmpw-js.lo `test -f 'rpmmpw-js.c' || echo '$(srcdir)/'`rpmmpw-js.c + $(am__mv) $(DEPDIR)/rpmmpw_module_la-rpmmpw-js.Tpo $(DEPDIR)/rpmmpw_module_la-rpmmpw-js.Plo +# source='rpmmpw-js.c' object='rpmmpw_module_la-rpmmpw-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmpw_module_la_CFLAGS) $(CFLAGS) -c -o rpmmpw_module_la-rpmmpw-js.lo `test -f 'rpmmpw-js.c' || echo '$(srcdir)/'`rpmmpw-js.c + +rpmps_module_la-rpmps-js.lo: rpmps-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmps_module_la_CFLAGS) $(CFLAGS) -MT rpmps_module_la-rpmps-js.lo -MD -MP -MF $(DEPDIR)/rpmps_module_la-rpmps-js.Tpo -c -o rpmps_module_la-rpmps-js.lo `test -f 'rpmps-js.c' || echo '$(srcdir)/'`rpmps-js.c + $(am__mv) $(DEPDIR)/rpmps_module_la-rpmps-js.Tpo $(DEPDIR)/rpmps_module_la-rpmps-js.Plo +# source='rpmps-js.c' object='rpmps_module_la-rpmps-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmps_module_la_CFLAGS) $(CFLAGS) -c -o rpmps_module_la-rpmps-js.lo `test -f 'rpmps-js.c' || echo '$(srcdir)/'`rpmps-js.c + +rpmseq_module_la-rpmseq-js.lo: rpmseq-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmseq_module_la_CFLAGS) $(CFLAGS) -MT rpmseq_module_la-rpmseq-js.lo -MD -MP -MF $(DEPDIR)/rpmseq_module_la-rpmseq-js.Tpo -c -o rpmseq_module_la-rpmseq-js.lo `test -f 'rpmseq-js.c' || echo '$(srcdir)/'`rpmseq-js.c + $(am__mv) $(DEPDIR)/rpmseq_module_la-rpmseq-js.Tpo $(DEPDIR)/rpmseq_module_la-rpmseq-js.Plo +# source='rpmseq-js.c' object='rpmseq_module_la-rpmseq-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmseq_module_la_CFLAGS) $(CFLAGS) -c -o rpmseq_module_la-rpmseq-js.lo `test -f 'rpmseq-js.c' || echo '$(srcdir)/'`rpmseq-js.c + +rpmsm_module_la-rpmsm-js.lo: rpmsm-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsm_module_la_CFLAGS) $(CFLAGS) -MT rpmsm_module_la-rpmsm-js.lo -MD -MP -MF $(DEPDIR)/rpmsm_module_la-rpmsm-js.Tpo -c -o rpmsm_module_la-rpmsm-js.lo `test -f 'rpmsm-js.c' || echo '$(srcdir)/'`rpmsm-js.c + $(am__mv) $(DEPDIR)/rpmsm_module_la-rpmsm-js.Tpo $(DEPDIR)/rpmsm_module_la-rpmsm-js.Plo +# source='rpmsm-js.c' object='rpmsm_module_la-rpmsm-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsm_module_la_CFLAGS) $(CFLAGS) -c -o rpmsm_module_la-rpmsm-js.lo `test -f 'rpmsm-js.c' || echo '$(srcdir)/'`rpmsm-js.c + +rpmsp_module_la-rpmsp-js.lo: rpmsp-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsp_module_la_CFLAGS) $(CFLAGS) -MT rpmsp_module_la-rpmsp-js.lo -MD -MP -MF $(DEPDIR)/rpmsp_module_la-rpmsp-js.Tpo -c -o rpmsp_module_la-rpmsp-js.lo `test -f 'rpmsp-js.c' || echo '$(srcdir)/'`rpmsp-js.c + $(am__mv) $(DEPDIR)/rpmsp_module_la-rpmsp-js.Tpo $(DEPDIR)/rpmsp_module_la-rpmsp-js.Plo +# source='rpmsp-js.c' object='rpmsp_module_la-rpmsp-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsp_module_la_CFLAGS) $(CFLAGS) -c -o rpmsp_module_la-rpmsp-js.lo `test -f 'rpmsp-js.c' || echo '$(srcdir)/'`rpmsp-js.c + +rpmst_module_la-rpmst-js.lo: rpmst-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmst_module_la_CFLAGS) $(CFLAGS) -MT rpmst_module_la-rpmst-js.lo -MD -MP -MF $(DEPDIR)/rpmst_module_la-rpmst-js.Tpo -c -o rpmst_module_la-rpmst-js.lo `test -f 'rpmst-js.c' || echo '$(srcdir)/'`rpmst-js.c + $(am__mv) $(DEPDIR)/rpmst_module_la-rpmst-js.Tpo $(DEPDIR)/rpmst_module_la-rpmst-js.Plo +# source='rpmst-js.c' object='rpmst_module_la-rpmst-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmst_module_la_CFLAGS) $(CFLAGS) -c -o rpmst_module_la-rpmst-js.lo `test -f 'rpmst-js.c' || echo '$(srcdir)/'`rpmst-js.c + +rpmsw_module_la-rpmsw-js.lo: rpmsw-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsw_module_la_CFLAGS) $(CFLAGS) -MT rpmsw_module_la-rpmsw-js.lo -MD -MP -MF $(DEPDIR)/rpmsw_module_la-rpmsw-js.Tpo -c -o rpmsw_module_la-rpmsw-js.lo `test -f 'rpmsw-js.c' || echo '$(srcdir)/'`rpmsw-js.c + $(am__mv) $(DEPDIR)/rpmsw_module_la-rpmsw-js.Tpo $(DEPDIR)/rpmsw_module_la-rpmsw-js.Plo +# source='rpmsw-js.c' object='rpmsw_module_la-rpmsw-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsw_module_la_CFLAGS) $(CFLAGS) -c -o rpmsw_module_la-rpmsw-js.lo `test -f 'rpmsw-js.c' || echo '$(srcdir)/'`rpmsw-js.c + +rpmsx_module_la-rpmsx-js.lo: rpmsx-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsx_module_la_CFLAGS) $(CFLAGS) -MT rpmsx_module_la-rpmsx-js.lo -MD -MP -MF $(DEPDIR)/rpmsx_module_la-rpmsx-js.Tpo -c -o rpmsx_module_la-rpmsx-js.lo `test -f 'rpmsx-js.c' || echo '$(srcdir)/'`rpmsx-js.c + $(am__mv) $(DEPDIR)/rpmsx_module_la-rpmsx-js.Tpo $(DEPDIR)/rpmsx_module_la-rpmsx-js.Plo +# source='rpmsx-js.c' object='rpmsx_module_la-rpmsx-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsx_module_la_CFLAGS) $(CFLAGS) -c -o rpmsx_module_la-rpmsx-js.lo `test -f 'rpmsx-js.c' || echo '$(srcdir)/'`rpmsx-js.c + +rpmsys_module_la-rpmsys-js.lo: rpmsys-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsys_module_la_CFLAGS) $(CFLAGS) -MT rpmsys_module_la-rpmsys-js.lo -MD -MP -MF $(DEPDIR)/rpmsys_module_la-rpmsys-js.Tpo -c -o rpmsys_module_la-rpmsys-js.lo `test -f 'rpmsys-js.c' || echo '$(srcdir)/'`rpmsys-js.c + $(am__mv) $(DEPDIR)/rpmsys_module_la-rpmsys-js.Tpo $(DEPDIR)/rpmsys_module_la-rpmsys-js.Plo +# source='rpmsys-js.c' object='rpmsys_module_la-rpmsys-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsys_module_la_CFLAGS) $(CFLAGS) -c -o rpmsys_module_la-rpmsys-js.lo `test -f 'rpmsys-js.c' || echo '$(srcdir)/'`rpmsys-js.c + +rpmte_module_la-rpmte-js.lo: rpmte-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmte_module_la_CFLAGS) $(CFLAGS) -MT rpmte_module_la-rpmte-js.lo -MD -MP -MF $(DEPDIR)/rpmte_module_la-rpmte-js.Tpo -c -o rpmte_module_la-rpmte-js.lo `test -f 'rpmte-js.c' || echo '$(srcdir)/'`rpmte-js.c + $(am__mv) $(DEPDIR)/rpmte_module_la-rpmte-js.Tpo $(DEPDIR)/rpmte_module_la-rpmte-js.Plo +# source='rpmte-js.c' object='rpmte_module_la-rpmte-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmte_module_la_CFLAGS) $(CFLAGS) -c -o rpmte_module_la-rpmte-js.lo `test -f 'rpmte-js.c' || echo '$(srcdir)/'`rpmte-js.c + +rpmts_module_la-rpmts-js.lo: rpmts-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmts_module_la_CFLAGS) $(CFLAGS) -MT rpmts_module_la-rpmts-js.lo -MD -MP -MF $(DEPDIR)/rpmts_module_la-rpmts-js.Tpo -c -o rpmts_module_la-rpmts-js.lo `test -f 'rpmts-js.c' || echo '$(srcdir)/'`rpmts-js.c + $(am__mv) $(DEPDIR)/rpmts_module_la-rpmts-js.Tpo $(DEPDIR)/rpmts_module_la-rpmts-js.Plo +# source='rpmts-js.c' object='rpmts_module_la-rpmts-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmts_module_la_CFLAGS) $(CFLAGS) -c -o rpmts_module_la-rpmts-js.lo `test -f 'rpmts-js.c' || echo '$(srcdir)/'`rpmts-js.c + +rpmtxn_module_la-rpmtxn-js.lo: rpmtxn-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmtxn_module_la_CFLAGS) $(CFLAGS) -MT rpmtxn_module_la-rpmtxn-js.lo -MD -MP -MF $(DEPDIR)/rpmtxn_module_la-rpmtxn-js.Tpo -c -o rpmtxn_module_la-rpmtxn-js.lo `test -f 'rpmtxn-js.c' || echo '$(srcdir)/'`rpmtxn-js.c + $(am__mv) $(DEPDIR)/rpmtxn_module_la-rpmtxn-js.Tpo $(DEPDIR)/rpmtxn_module_la-rpmtxn-js.Plo +# source='rpmtxn-js.c' object='rpmtxn_module_la-rpmtxn-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmtxn_module_la_CFLAGS) $(CFLAGS) -c -o rpmtxn_module_la-rpmtxn-js.lo `test -f 'rpmtxn-js.c' || echo '$(srcdir)/'`rpmtxn-js.c + +rpmxar_module_la-rpmxar-js.lo: rpmxar-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmxar_module_la_CFLAGS) $(CFLAGS) -MT rpmxar_module_la-rpmxar-js.lo -MD -MP -MF $(DEPDIR)/rpmxar_module_la-rpmxar-js.Tpo -c -o rpmxar_module_la-rpmxar-js.lo `test -f 'rpmxar-js.c' || echo '$(srcdir)/'`rpmxar-js.c + $(am__mv) $(DEPDIR)/rpmxar_module_la-rpmxar-js.Tpo $(DEPDIR)/rpmxar_module_la-rpmxar-js.Plo +# source='rpmxar-js.c' object='rpmxar_module_la-rpmxar-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmxar_module_la_CFLAGS) $(CFLAGS) -c -o rpmxar_module_la-rpmxar-js.lo `test -f 'rpmxar-js.c' || echo '$(srcdir)/'`rpmxar-js.c + +syck_module_la-syck-js.lo: syck-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(syck_module_la_CFLAGS) $(CFLAGS) -MT syck_module_la-syck-js.lo -MD -MP -MF $(DEPDIR)/syck_module_la-syck-js.Tpo -c -o syck_module_la-syck-js.lo `test -f 'syck-js.c' || echo '$(srcdir)/'`syck-js.c + $(am__mv) $(DEPDIR)/syck_module_la-syck-js.Tpo $(DEPDIR)/syck_module_la-syck-js.Plo +# source='syck-js.c' object='syck_module_la-syck-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(syck_module_la_CFLAGS) $(CFLAGS) -c -o syck_module_la-syck-js.lo `test -f 'syck-js.c' || echo '$(srcdir)/'`syck-js.c + +uuid_module_la-uuid-js.lo: uuid-js.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uuid_module_la_CFLAGS) $(CFLAGS) -MT uuid_module_la-uuid-js.lo -MD -MP -MF $(DEPDIR)/uuid_module_la-uuid-js.Tpo -c -o uuid_module_la-uuid-js.lo `test -f 'uuid-js.c' || echo '$(srcdir)/'`uuid-js.c + $(am__mv) $(DEPDIR)/uuid_module_la-uuid-js.Tpo $(DEPDIR)/uuid_module_la-uuid-js.Plo +# source='uuid-js.c' object='uuid_module_la-uuid-js.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uuid_module_la_CFLAGS) $(CFLAGS) -c -o uuid_module_la-uuid-js.lo `test -f 'uuid-js.c' || echo '$(srcdir)/'`uuid-js.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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 +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(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 + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(pkgbindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ + clean-noinstLTLIBRARIES clean-pkgbinPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-moduleLTLIBRARIES install-pkgbinPROGRAMS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-moduleLTLIBRARIES uninstall-pkgbinPROGRAMS + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ + clean-generic clean-libtool clean-moduleLTLIBRARIES \ + clean-noinstLTLIBRARIES clean-pkgbinPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-moduleLTLIBRARIES install-pdf install-pdf-am \ + install-pkgbinPROGRAMS install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-moduleLTLIBRARIES \ + uninstall-pkgbinPROGRAMS + + +.PHONY: lint +lint: + $(LINT) $(DEFS) $(INCLUDES) $(librpmjs_la_sources) + +check-local: ngsr + +.PHONY: lcov-reset # run lcov from scratch, always +lcov-reset: + make lcov-run + make lcov-report + +# run lcov from scratch if the dir is not there +lcov: + make lcov-reset + +.PHONY: lcov-run # reset run coverage tests +lcov-run: + @-rm -rf lcov + find .. -name "*.gcda" -exec rm {} \; + make check + +.PHONY: lcov-report # generate report based on current coverage data +lcov-report: + mkdir lcov + -lcov -d ./src -d . --capture --output-file lcov/lcov.info + lcov -l lcov/lcov.info | grep -v "`cd $(top_srcdir) && pwd`" | cut -d: -f1 > lcov/remove + lcov -r lcov/lcov.info `cat lcov/remove` > lcov/lcov.cleaned.info + rm lcov/remove + mv lcov/lcov.cleaned.info lcov/lcov.info + genhtml -t "$(PACKAGE_STRING)" -o lcov lcov/lcov.info + +.PHONY: lcov-upload +lcov-upload: lcov + mkdir -p /var/ftp/pub/jbj/rpm-$(VERSION)-lcov + tar -C lcov -cf - . | (cd /var/ftp/pub/jbj/rpm-$(VERSION)-lcov; tar xf -) +# rsync -rvz -e ssh --delete lcov/* ??? + +# 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/rpm-5.4.9/js/Makefile.am b/rpm-5.4.9/js/Makefile.am new file mode 100644 index 0000000..7937212 --- /dev/null +++ b/rpm-5.4.9/js/Makefile.am @@ -0,0 +1,347 @@ +# Makefile for rpm library. + +AUTOMAKE_OPTIONS = 1.4 foreign + +LINT = splint + +EXTRA_DIST = ngsr.c minimal.c \ + src \ + tscripts \ + words \ + legacy.cudf legacy-sol.cudf + +EXTRA_PROGRAMS = + +AM_CPPFLAGS = -I. \ + -I$(top_srcdir) \ + -I$(top_srcdir)/build \ + -I$(top_srcdir)/lib \ + -I$(top_builddir)/lib \ + -I$(top_srcdir)/rpmdb \ + -I$(top_srcdir)/rpmio \ + -I$(top_srcdir)/misc \ + @WITH_DB_CPPFLAGS@ \ + @WITH_FILE_CPPFLAGS@ \ + @WITH_MOZJS185_CPPFLAGS@ \ + @WITH_LUA_CPPFLAGS@ \ + @WITH_GPSEE_CPPFLAGS@ \ + @WITH_SYCK_CPPFLAGS@ \ + @WITH_XAR_CPPFLAGS@ \ + @WITH_ZLIB_CPPFLAGS@ + +AM_CFLAGS = $(OPENMP_CFLAGS) + +RPMMISC_LDADD_COMMON = \ + $(top_builddir)/misc/librpmmisc.la \ + @LTLIBINTL@ + +RPMIO_LDADD_COMMON = \ + $(top_builddir)/rpmio/librpmio.la \ + $(RPMMISC_LDADD_COMMON) + +RPMDB_LDADD_COMMON = \ + $(top_builddir)/rpmdb/librpmdb.la \ + $(RPMIO_LDADD_COMMON) + +RPM_LDADD_COMMON = \ + $(top_builddir)/lib/librpm.la \ + $(RPMDB_LDADD_COMMON) + +RPMBUILD_LDADD_COMMON = \ + $(top_builddir)/build/librpmbuild.la \ + $(RPM_LDADD_COMMON) + +pkglibdir = @USRLIBRPM@/lib +pkgbindir = @USRLIBRPM@/bin +moduledir = @GPSEE_MODULES_PATH@ + +pkgbin_PROGRAMS = ngsr + +module_LTLIBRARIES = \ + rpmbf_module.la + +noinst_LTLIBRARIES = \ + librpmjsm.la + +EXTRA_LTLIBRARIES = \ + rpmaug_module.la \ + rpmbc_module.la \ + rpmcudf_module.la \ + rpmdb_module.la \ + rpmdbc_module.la \ + rpmdbe_module.la \ + rpmmpf_module.la \ + rpmseq_module.la \ + rpmtxn_module.la \ + rpmdc_module.la \ + rpmdig_module.la \ + rpmdir_module.la \ + rpmds_module.la \ + rpmfc_module.la \ + rpmfi_module.la \ + rpmfts_module.la \ + rpmgi_module.la \ + rpmhdr_module.la \ + rpmio_module.la \ + rpmiob_module.la \ + rpmmc_module.la \ + rpmmg_module.la \ + rpmmi_module.la \ + rpmmpw_module.la \ + rpmps_module.la \ + rpmsm_module.la \ + rpmsp_module.la \ + rpmst_module.la \ + rpmsw_module.la \ + rpmsx_module.la \ + rpmsys_module.la \ + rpmte_module.la \ + rpmts_module.la \ + rpmxar_module.la \ + syck_module.la \ + uuid_module.la + +librpmjsm_la_CFLAGS = -fno-strict-aliasing +librpmjsm_la_LDFLAGS = -module -avoid-version +librpmjsm_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmaug_module_la_SOURCES = rpmaug-js.c +rpmaug_module_la_CFLAGS = -fno-strict-aliasing +rpmaug_module_la_LDFLAGS = -module -avoid-version +rpmaug_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmbc_module_la_SOURCES = rpmbc-js.c +rpmbc_module_la_CFLAGS = -fno-strict-aliasing +rpmbc_module_la_LDFLAGS = -module -avoid-version +rpmbc_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmbf_module_la_SOURCES = rpmbf-js.c +rpmbf_module_la_CFLAGS = -fno-strict-aliasing +rpmbf_module_la_LDFLAGS = -module -avoid-version +rpmbf_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmcudf_module_la_SOURCES = rpmcudf-js.c +rpmcudf_module_la_CFLAGS = -fno-strict-aliasing +rpmcudf_module_la_LDFLAGS = -module -avoid-version +rpmcudf_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmdb_module_la_SOURCES = rpmdb-js.c +rpmdb_module_la_CFLAGS = -fno-strict-aliasing +rpmdb_module_la_LDFLAGS = -module -avoid-version +rpmdb_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmdbc_module_la_SOURCES = rpmdbc-js.c +rpmdbc_module_la_CFLAGS = -fno-strict-aliasing +rpmdbc_module_la_LDFLAGS = -module -avoid-version +rpmdbc_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmdbe_module_la_SOURCES = rpmdbe-js.c +rpmdbe_module_la_CFLAGS = -fno-strict-aliasing +rpmdbe_module_la_LDFLAGS = -module -avoid-version +rpmdbe_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmmpf_module_la_SOURCES = rpmmpf-js.c +rpmmpf_module_la_CFLAGS = -fno-strict-aliasing +rpmmpf_module_la_LDFLAGS = -module -avoid-version +rpmmpf_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmseq_module_la_SOURCES = rpmseq-js.c +rpmseq_module_la_CFLAGS = -fno-strict-aliasing +rpmseq_module_la_LDFLAGS = -module -avoid-version +rpmseq_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmtxn_module_la_SOURCES = rpmtxn-js.c +rpmtxn_module_la_CFLAGS = -fno-strict-aliasing +rpmtxn_module_la_LDFLAGS = -module -avoid-version +rpmtxn_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmdc_module_la_SOURCES = rpmdc-js.c +rpmdc_module_la_CFLAGS = -fno-strict-aliasing +rpmdc_module_la_LDFLAGS = -module -avoid-version +rpmdc_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmdig_module_la_SOURCES = rpmdig-js.c +rpmdig_module_la_CFLAGS = -fno-strict-aliasing +rpmdig_module_la_LDFLAGS = -module -avoid-version +rpmdig_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmdir_module_la_SOURCES = rpmdir-js.c +rpmdir_module_la_CFLAGS = -fno-strict-aliasing +rpmdir_module_la_LDFLAGS = -module -avoid-version +rpmdir_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmds_module_la_SOURCES = rpmds-js.c +rpmds_module_la_CFLAGS = -fno-strict-aliasing +rpmds_module_la_LDFLAGS = -module -avoid-version +rpmds_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmfc_module_la_SOURCES = rpmfc-js.c +rpmfc_module_la_CFLAGS = -fno-strict-aliasing +rpmfc_module_la_LDFLAGS = -module -avoid-version +rpmfc_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmfi_module_la_SOURCES = rpmfi-js.c +rpmfi_module_la_CFLAGS = -fno-strict-aliasing +rpmfi_module_la_LDFLAGS = -module -avoid-version +rpmfi_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmfts_module_la_SOURCES = rpmfts-js.c +rpmfts_module_la_CFLAGS = -fno-strict-aliasing +rpmfts_module_la_LDFLAGS = -module -avoid-version +rpmfts_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmgi_module_la_SOURCES = rpmgi-js.c +rpmgi_module_la_CFLAGS = -fno-strict-aliasing +rpmgi_module_la_LDFLAGS = -module -avoid-version +rpmgi_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmhdr_module_la_SOURCES = rpmhdr-js.c +rpmhdr_module_la_CFLAGS = -fno-strict-aliasing +rpmhdr_module_la_LDFLAGS = -module -avoid-version +rpmhdr_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmio_module_la_SOURCES = rpmio-js.c +rpmio_module_la_CFLAGS = -fno-strict-aliasing +rpmio_module_la_LDFLAGS = -module -avoid-version +rpmio_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmiob_module_la_SOURCES = rpmiob-js.c +rpmiob_module_la_CFLAGS = -fno-strict-aliasing +rpmiob_module_la_LDFLAGS = -module -avoid-version +rpmiob_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmmc_module_la_SOURCES = rpmmc-js.c +rpmmc_module_la_CFLAGS = -fno-strict-aliasing +rpmmc_module_la_LDFLAGS = -module -avoid-versmcn +rpmmc_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmmg_module_la_SOURCES = rpmmg-js.c +rpmmg_module_la_CFLAGS = -fno-strict-aliasing +rpmmg_module_la_LDFLAGS = -module -avoid-versmgn +rpmmg_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmmi_module_la_SOURCES = rpmmi-js.c +rpmmi_module_la_CFLAGS = -fno-strict-aliasing +rpmmi_module_la_LDFLAGS = -module -avoid-versmin +rpmmi_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmmpw_module_la_SOURCES = rpmmpw-js.c +rpmmpw_module_la_CFLAGS = -fno-strict-aliasing +rpmmpw_module_la_LDFLAGS = -module -avoid-versmin +rpmmpw_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmps_module_la_SOURCES = rpmps-js.c +rpmps_module_la_CFLAGS = -fno-strict-aliasing +rpmps_module_la_LDFLAGS = -module -avoid-versmin +rpmps_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmsm_module_la_SOURCES = rpmsm-js.c +rpmsm_module_la_CFLAGS = -fno-strict-aliasing +rpmsm_module_la_LDFLAGS = -module -avoid-versmin +rpmsm_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmsp_module_la_SOURCES = rpmsp-js.c +rpmsp_module_la_CFLAGS = -fno-strict-aliasing +rpmsp_module_la_LDFLAGS = -module -avoid-versmin +rpmsp_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmst_module_la_SOURCES = rpmst-js.c +rpmst_module_la_CFLAGS = -fno-strict-aliasing +rpmst_module_la_LDFLAGS = -module -avoid-verssysn +rpmst_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmsw_module_la_SOURCES = rpmsw-js.c +rpmsw_module_la_CFLAGS = -fno-strict-aliasing +rpmsw_module_la_LDFLAGS = -module -avoid-versmin +rpmsw_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmsx_module_la_SOURCES = rpmsx-js.c +rpmsx_module_la_CFLAGS = -fno-strict-aliasing +rpmsx_module_la_LDFLAGS = -module -avoid-versmin +rpmsx_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmsys_module_la_SOURCES = rpmsys-js.c +rpmsys_module_la_CFLAGS = -fno-strict-aliasing +rpmsys_module_la_LDFLAGS = -module -avoid-verssysn +rpmsys_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmte_module_la_SOURCES = rpmte-js.c +rpmte_module_la_CFLAGS = -fno-strict-aliasing +rpmte_module_la_LDFLAGS = -module -avoid-verssysn +rpmte_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmts_module_la_SOURCES = rpmts-js.c +rpmts_module_la_CFLAGS = -fno-strict-aliasing +rpmts_module_la_LDFLAGS = -module -avoid-verssysn +rpmts_module_la_LIBADD = $(RPM_LDADD_COMMON) + +rpmxar_module_la_SOURCES = rpmxar-js.c +rpmxar_module_la_CFLAGS = -fno-strict-aliasing +rpmxar_module_la_LDFLAGS = -module -avoid-verssysn +rpmxar_module_la_LIBADD = $(RPM_LDADD_COMMON) + +syck_module_la_SOURCES = syck-js.c +syck_module_la_CFLAGS = -fno-strict-aliasing +syck_module_la_LDFLAGS = -module -avoid-version +syck_module_la_LIBADD = $(RPM_LDADD_COMMON) + +uuid_module_la_SOURCES = uuid-js.c +uuid_module_la_CFLAGS = -fno-strict-aliasing +uuid_module_la_LDFLAGS = -module -avoid-version +uuid_module_la_LIBADD = $(RPM_LDADD_COMMON) + +noinst_HEADERS = \ + rpmaug-js.h rpmbc-js.h rpmbf-js.h rpmcudf-js.h rpmdb-js.h rpmdbc-js.h rpmdbe-js.c rpmdc-js.h rpmdig-js.h \ + rpmdir-js.h rpmds-js.h rpmfc-js.h rpmfi-js.h rpmfts-js.h rpmgi-js.h \ + rpmhdr-js.h rpmio-js.h rpmiob-js.h rpmmc-js.h rpmmg-js.h rpmmi-js.h \ + rpmmpf-js.h rpmmpw-js.h rpmps-js.h rpmseq-js.h rpmsm-js.h rpmsp-js.h rpmst-js.h rpmsw-js.h \ + rpmsx-js.h rpmsys-js.h rpmte-js.h rpmts-js.h rpmtxn-js.h rpmxar-js.h \ + syck-js.h uuid-js.h + +librpmjsm_la_SOURCES = \ + rpmaug-js.c rpmbc-js.c rpmbf-js.c rpmcudf-js.c rpmdb-js.c rpmdbc-js.c rpmdbe-js.c rpmdc-js.c rpmdig-js.c \ + rpmdir-js.c rpmds-js.c rpmfc-js.c rpmfi-js.c rpmfts-js.c rpmgi-js.c \ + rpmhdr-js.c rpmio-js.c rpmiob-js.c rpmmc-js.c rpmmg-js.c rpmmi-js.c \ + rpmmpf-js.c rpmmpw-js.c rpmps-js.c rpmseq-js.c rpmsm-js.c rpmsp-js.c rpmst-js.c rpmsw-js.c \ + rpmsx-js.c rpmsys-js.c rpmte-js.c rpmts-js.c rpmtxn-js.c rpmxar-js.c \ + syck-js.c uuid-js.c + +ngsr_SOURCES = ngsr.c +ngsr_LDADD = $(RPM_LDADD_COMMON) + +.PHONY: lint +lint: + $(LINT) $(DEFS) $(INCLUDES) $(librpmjs_la_sources) + +check-local: ngsr + +.PHONY: lcov-reset # run lcov from scratch, always +lcov-reset: + make lcov-run + make lcov-report + +# run lcov from scratch if the dir is not there +lcov: + make lcov-reset + +.PHONY: lcov-run # reset run coverage tests +lcov-run: + @-rm -rf lcov + find .. -name "*.gcda" -exec rm {} \; + make check + +.PHONY: lcov-report # generate report based on current coverage data +lcov-report: + mkdir lcov + -lcov -d ./src -d . --capture --output-file lcov/lcov.info + lcov -l lcov/lcov.info | grep -v "`cd $(top_srcdir) && pwd`" | cut -d: -f1 > lcov/remove + lcov -r lcov/lcov.info `cat lcov/remove` > lcov/lcov.cleaned.info + rm lcov/remove + mv lcov/lcov.cleaned.info lcov/lcov.info + genhtml -t "$(PACKAGE_STRING)" -o lcov lcov/lcov.info + +.PHONY: lcov-upload +lcov-upload: lcov + mkdir -p /var/ftp/pub/jbj/rpm-$(VERSION)-lcov + tar -C lcov -cf - . | (cd /var/ftp/pub/jbj/rpm-$(VERSION)-lcov; tar xf -) +# rsync -rvz -e ssh --delete lcov/* ??? diff --git a/rpm-5.4.9/js/Makefile.in b/rpm-5.4.9/js/Makefile.in new file mode 100644 index 0000000..fb9cbe0 --- /dev/null +++ b/rpm-5.4.9/js/Makefile.in @@ -0,0 +1,2207 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ + +# Makefile for rpm library. + + + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@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@ +target_triplet = @target@ +EXTRA_PROGRAMS = +pkgbin_PROGRAMS = ngsr$(EXEEXT) +subdir = js +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(pkgbindir)" +LTLIBRARIES = $(module_LTLIBRARIES) $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = $(top_builddir)/misc/librpmmisc.la +am__DEPENDENCIES_2 = $(top_builddir)/rpmio/librpmio.la \ + $(am__DEPENDENCIES_1) +am__DEPENDENCIES_3 = $(top_builddir)/rpmdb/librpmdb.la \ + $(am__DEPENDENCIES_2) +am__DEPENDENCIES_4 = $(top_builddir)/lib/librpm.la \ + $(am__DEPENDENCIES_3) +librpmjsm_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_librpmjsm_la_OBJECTS = librpmjsm_la-rpmaug-js.lo \ + librpmjsm_la-rpmbc-js.lo librpmjsm_la-rpmbf-js.lo \ + librpmjsm_la-rpmcudf-js.lo librpmjsm_la-rpmdb-js.lo \ + librpmjsm_la-rpmdbc-js.lo librpmjsm_la-rpmdbe-js.lo \ + librpmjsm_la-rpmdc-js.lo librpmjsm_la-rpmdig-js.lo \ + librpmjsm_la-rpmdir-js.lo librpmjsm_la-rpmds-js.lo \ + librpmjsm_la-rpmfc-js.lo librpmjsm_la-rpmfi-js.lo \ + librpmjsm_la-rpmfts-js.lo librpmjsm_la-rpmgi-js.lo \ + librpmjsm_la-rpmhdr-js.lo librpmjsm_la-rpmio-js.lo \ + librpmjsm_la-rpmiob-js.lo librpmjsm_la-rpmmc-js.lo \ + librpmjsm_la-rpmmg-js.lo librpmjsm_la-rpmmi-js.lo \ + librpmjsm_la-rpmmpf-js.lo librpmjsm_la-rpmmpw-js.lo \ + librpmjsm_la-rpmps-js.lo librpmjsm_la-rpmseq-js.lo \ + librpmjsm_la-rpmsm-js.lo librpmjsm_la-rpmsp-js.lo \ + librpmjsm_la-rpmst-js.lo librpmjsm_la-rpmsw-js.lo \ + librpmjsm_la-rpmsx-js.lo librpmjsm_la-rpmsys-js.lo \ + librpmjsm_la-rpmte-js.lo librpmjsm_la-rpmts-js.lo \ + librpmjsm_la-rpmtxn-js.lo librpmjsm_la-rpmxar-js.lo \ + librpmjsm_la-syck-js.lo librpmjsm_la-uuid-js.lo +librpmjsm_la_OBJECTS = $(am_librpmjsm_la_OBJECTS) +librpmjsm_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(librpmjsm_la_CFLAGS) \ + $(CFLAGS) $(librpmjsm_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmaug_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmaug_module_la_OBJECTS = rpmaug_module_la-rpmaug-js.lo +rpmaug_module_la_OBJECTS = $(am_rpmaug_module_la_OBJECTS) +rpmaug_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmaug_module_la_CFLAGS) \ + $(CFLAGS) $(rpmaug_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmbc_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmbc_module_la_OBJECTS = rpmbc_module_la-rpmbc-js.lo +rpmbc_module_la_OBJECTS = $(am_rpmbc_module_la_OBJECTS) +rpmbc_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmbc_module_la_CFLAGS) \ + $(CFLAGS) $(rpmbc_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmbf_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmbf_module_la_OBJECTS = rpmbf_module_la-rpmbf-js.lo +rpmbf_module_la_OBJECTS = $(am_rpmbf_module_la_OBJECTS) +rpmbf_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmbf_module_la_CFLAGS) \ + $(CFLAGS) $(rpmbf_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmcudf_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmcudf_module_la_OBJECTS = rpmcudf_module_la-rpmcudf-js.lo +rpmcudf_module_la_OBJECTS = $(am_rpmcudf_module_la_OBJECTS) +rpmcudf_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(rpmcudf_module_la_CFLAGS) $(CFLAGS) \ + $(rpmcudf_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmdb_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmdb_module_la_OBJECTS = rpmdb_module_la-rpmdb-js.lo +rpmdb_module_la_OBJECTS = $(am_rpmdb_module_la_OBJECTS) +rpmdb_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmdb_module_la_CFLAGS) \ + $(CFLAGS) $(rpmdb_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmdbc_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmdbc_module_la_OBJECTS = rpmdbc_module_la-rpmdbc-js.lo +rpmdbc_module_la_OBJECTS = $(am_rpmdbc_module_la_OBJECTS) +rpmdbc_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmdbc_module_la_CFLAGS) \ + $(CFLAGS) $(rpmdbc_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmdbe_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmdbe_module_la_OBJECTS = rpmdbe_module_la-rpmdbe-js.lo +rpmdbe_module_la_OBJECTS = $(am_rpmdbe_module_la_OBJECTS) +rpmdbe_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmdbe_module_la_CFLAGS) \ + $(CFLAGS) $(rpmdbe_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmdc_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmdc_module_la_OBJECTS = rpmdc_module_la-rpmdc-js.lo +rpmdc_module_la_OBJECTS = $(am_rpmdc_module_la_OBJECTS) +rpmdc_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmdc_module_la_CFLAGS) \ + $(CFLAGS) $(rpmdc_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmdig_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmdig_module_la_OBJECTS = rpmdig_module_la-rpmdig-js.lo +rpmdig_module_la_OBJECTS = $(am_rpmdig_module_la_OBJECTS) +rpmdig_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmdig_module_la_CFLAGS) \ + $(CFLAGS) $(rpmdig_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmdir_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmdir_module_la_OBJECTS = rpmdir_module_la-rpmdir-js.lo +rpmdir_module_la_OBJECTS = $(am_rpmdir_module_la_OBJECTS) +rpmdir_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmdir_module_la_CFLAGS) \ + $(CFLAGS) $(rpmdir_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmds_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmds_module_la_OBJECTS = rpmds_module_la-rpmds-js.lo +rpmds_module_la_OBJECTS = $(am_rpmds_module_la_OBJECTS) +rpmds_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmds_module_la_CFLAGS) \ + $(CFLAGS) $(rpmds_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmfc_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmfc_module_la_OBJECTS = rpmfc_module_la-rpmfc-js.lo +rpmfc_module_la_OBJECTS = $(am_rpmfc_module_la_OBJECTS) +rpmfc_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmfc_module_la_CFLAGS) \ + $(CFLAGS) $(rpmfc_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmfi_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmfi_module_la_OBJECTS = rpmfi_module_la-rpmfi-js.lo +rpmfi_module_la_OBJECTS = $(am_rpmfi_module_la_OBJECTS) +rpmfi_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmfi_module_la_CFLAGS) \ + $(CFLAGS) $(rpmfi_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmfts_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmfts_module_la_OBJECTS = rpmfts_module_la-rpmfts-js.lo +rpmfts_module_la_OBJECTS = $(am_rpmfts_module_la_OBJECTS) +rpmfts_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmfts_module_la_CFLAGS) \ + $(CFLAGS) $(rpmfts_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmgi_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmgi_module_la_OBJECTS = rpmgi_module_la-rpmgi-js.lo +rpmgi_module_la_OBJECTS = $(am_rpmgi_module_la_OBJECTS) +rpmgi_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmgi_module_la_CFLAGS) \ + $(CFLAGS) $(rpmgi_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmhdr_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmhdr_module_la_OBJECTS = rpmhdr_module_la-rpmhdr-js.lo +rpmhdr_module_la_OBJECTS = $(am_rpmhdr_module_la_OBJECTS) +rpmhdr_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmhdr_module_la_CFLAGS) \ + $(CFLAGS) $(rpmhdr_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmio_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmio_module_la_OBJECTS = rpmio_module_la-rpmio-js.lo +rpmio_module_la_OBJECTS = $(am_rpmio_module_la_OBJECTS) +rpmio_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmio_module_la_CFLAGS) \ + $(CFLAGS) $(rpmio_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmiob_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmiob_module_la_OBJECTS = rpmiob_module_la-rpmiob-js.lo +rpmiob_module_la_OBJECTS = $(am_rpmiob_module_la_OBJECTS) +rpmiob_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmiob_module_la_CFLAGS) \ + $(CFLAGS) $(rpmiob_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmmc_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmmc_module_la_OBJECTS = rpmmc_module_la-rpmmc-js.lo +rpmmc_module_la_OBJECTS = $(am_rpmmc_module_la_OBJECTS) +rpmmc_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmmc_module_la_CFLAGS) \ + $(CFLAGS) $(rpmmc_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmmg_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmmg_module_la_OBJECTS = rpmmg_module_la-rpmmg-js.lo +rpmmg_module_la_OBJECTS = $(am_rpmmg_module_la_OBJECTS) +rpmmg_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmmg_module_la_CFLAGS) \ + $(CFLAGS) $(rpmmg_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmmi_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmmi_module_la_OBJECTS = rpmmi_module_la-rpmmi-js.lo +rpmmi_module_la_OBJECTS = $(am_rpmmi_module_la_OBJECTS) +rpmmi_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmmi_module_la_CFLAGS) \ + $(CFLAGS) $(rpmmi_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmmpf_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmmpf_module_la_OBJECTS = rpmmpf_module_la-rpmmpf-js.lo +rpmmpf_module_la_OBJECTS = $(am_rpmmpf_module_la_OBJECTS) +rpmmpf_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmmpf_module_la_CFLAGS) \ + $(CFLAGS) $(rpmmpf_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmmpw_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmmpw_module_la_OBJECTS = rpmmpw_module_la-rpmmpw-js.lo +rpmmpw_module_la_OBJECTS = $(am_rpmmpw_module_la_OBJECTS) +rpmmpw_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmmpw_module_la_CFLAGS) \ + $(CFLAGS) $(rpmmpw_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmps_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmps_module_la_OBJECTS = rpmps_module_la-rpmps-js.lo +rpmps_module_la_OBJECTS = $(am_rpmps_module_la_OBJECTS) +rpmps_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmps_module_la_CFLAGS) \ + $(CFLAGS) $(rpmps_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmseq_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmseq_module_la_OBJECTS = rpmseq_module_la-rpmseq-js.lo +rpmseq_module_la_OBJECTS = $(am_rpmseq_module_la_OBJECTS) +rpmseq_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmseq_module_la_CFLAGS) \ + $(CFLAGS) $(rpmseq_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmsm_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmsm_module_la_OBJECTS = rpmsm_module_la-rpmsm-js.lo +rpmsm_module_la_OBJECTS = $(am_rpmsm_module_la_OBJECTS) +rpmsm_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmsm_module_la_CFLAGS) \ + $(CFLAGS) $(rpmsm_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmsp_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmsp_module_la_OBJECTS = rpmsp_module_la-rpmsp-js.lo +rpmsp_module_la_OBJECTS = $(am_rpmsp_module_la_OBJECTS) +rpmsp_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmsp_module_la_CFLAGS) \ + $(CFLAGS) $(rpmsp_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmst_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmst_module_la_OBJECTS = rpmst_module_la-rpmst-js.lo +rpmst_module_la_OBJECTS = $(am_rpmst_module_la_OBJECTS) +rpmst_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmst_module_la_CFLAGS) \ + $(CFLAGS) $(rpmst_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmsw_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmsw_module_la_OBJECTS = rpmsw_module_la-rpmsw-js.lo +rpmsw_module_la_OBJECTS = $(am_rpmsw_module_la_OBJECTS) +rpmsw_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmsw_module_la_CFLAGS) \ + $(CFLAGS) $(rpmsw_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmsx_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmsx_module_la_OBJECTS = rpmsx_module_la-rpmsx-js.lo +rpmsx_module_la_OBJECTS = $(am_rpmsx_module_la_OBJECTS) +rpmsx_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmsx_module_la_CFLAGS) \ + $(CFLAGS) $(rpmsx_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmsys_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmsys_module_la_OBJECTS = rpmsys_module_la-rpmsys-js.lo +rpmsys_module_la_OBJECTS = $(am_rpmsys_module_la_OBJECTS) +rpmsys_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmsys_module_la_CFLAGS) \ + $(CFLAGS) $(rpmsys_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmte_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmte_module_la_OBJECTS = rpmte_module_la-rpmte-js.lo +rpmte_module_la_OBJECTS = $(am_rpmte_module_la_OBJECTS) +rpmte_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmte_module_la_CFLAGS) \ + $(CFLAGS) $(rpmte_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmts_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmts_module_la_OBJECTS = rpmts_module_la-rpmts-js.lo +rpmts_module_la_OBJECTS = $(am_rpmts_module_la_OBJECTS) +rpmts_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmts_module_la_CFLAGS) \ + $(CFLAGS) $(rpmts_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmtxn_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmtxn_module_la_OBJECTS = rpmtxn_module_la-rpmtxn-js.lo +rpmtxn_module_la_OBJECTS = $(am_rpmtxn_module_la_OBJECTS) +rpmtxn_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmtxn_module_la_CFLAGS) \ + $(CFLAGS) $(rpmtxn_module_la_LDFLAGS) $(LDFLAGS) -o $@ +rpmxar_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_rpmxar_module_la_OBJECTS = rpmxar_module_la-rpmxar-js.lo +rpmxar_module_la_OBJECTS = $(am_rpmxar_module_la_OBJECTS) +rpmxar_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rpmxar_module_la_CFLAGS) \ + $(CFLAGS) $(rpmxar_module_la_LDFLAGS) $(LDFLAGS) -o $@ +syck_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_syck_module_la_OBJECTS = syck_module_la-syck-js.lo +syck_module_la_OBJECTS = $(am_syck_module_la_OBJECTS) +syck_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(syck_module_la_CFLAGS) \ + $(CFLAGS) $(syck_module_la_LDFLAGS) $(LDFLAGS) -o $@ +uuid_module_la_DEPENDENCIES = $(am__DEPENDENCIES_4) +am_uuid_module_la_OBJECTS = uuid_module_la-uuid-js.lo +uuid_module_la_OBJECTS = $(am_uuid_module_la_OBJECTS) +uuid_module_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(uuid_module_la_CFLAGS) \ + $(CFLAGS) $(uuid_module_la_LDFLAGS) $(LDFLAGS) -o $@ +PROGRAMS = $(pkgbin_PROGRAMS) +am_ngsr_OBJECTS = ngsr.$(OBJEXT) +ngsr_OBJECTS = $(am_ngsr_OBJECTS) +ngsr_DEPENDENCIES = $(am__DEPENDENCIES_4) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(librpmjsm_la_SOURCES) $(rpmaug_module_la_SOURCES) \ + $(rpmbc_module_la_SOURCES) $(rpmbf_module_la_SOURCES) \ + $(rpmcudf_module_la_SOURCES) $(rpmdb_module_la_SOURCES) \ + $(rpmdbc_module_la_SOURCES) $(rpmdbe_module_la_SOURCES) \ + $(rpmdc_module_la_SOURCES) $(rpmdig_module_la_SOURCES) \ + $(rpmdir_module_la_SOURCES) $(rpmds_module_la_SOURCES) \ + $(rpmfc_module_la_SOURCES) $(rpmfi_module_la_SOURCES) \ + $(rpmfts_module_la_SOURCES) $(rpmgi_module_la_SOURCES) \ + $(rpmhdr_module_la_SOURCES) $(rpmio_module_la_SOURCES) \ + $(rpmiob_module_la_SOURCES) $(rpmmc_module_la_SOURCES) \ + $(rpmmg_module_la_SOURCES) $(rpmmi_module_la_SOURCES) \ + $(rpmmpf_module_la_SOURCES) $(rpmmpw_module_la_SOURCES) \ + $(rpmps_module_la_SOURCES) $(rpmseq_module_la_SOURCES) \ + $(rpmsm_module_la_SOURCES) $(rpmsp_module_la_SOURCES) \ + $(rpmst_module_la_SOURCES) $(rpmsw_module_la_SOURCES) \ + $(rpmsx_module_la_SOURCES) $(rpmsys_module_la_SOURCES) \ + $(rpmte_module_la_SOURCES) $(rpmts_module_la_SOURCES) \ + $(rpmtxn_module_la_SOURCES) $(rpmxar_module_la_SOURCES) \ + $(syck_module_la_SOURCES) $(uuid_module_la_SOURCES) \ + $(ngsr_SOURCES) +DIST_SOURCES = $(librpmjsm_la_SOURCES) $(rpmaug_module_la_SOURCES) \ + $(rpmbc_module_la_SOURCES) $(rpmbf_module_la_SOURCES) \ + $(rpmcudf_module_la_SOURCES) $(rpmdb_module_la_SOURCES) \ + $(rpmdbc_module_la_SOURCES) $(rpmdbe_module_la_SOURCES) \ + $(rpmdc_module_la_SOURCES) $(rpmdig_module_la_SOURCES) \ + $(rpmdir_module_la_SOURCES) $(rpmds_module_la_SOURCES) \ + $(rpmfc_module_la_SOURCES) $(rpmfi_module_la_SOURCES) \ + $(rpmfts_module_la_SOURCES) $(rpmgi_module_la_SOURCES) \ + $(rpmhdr_module_la_SOURCES) $(rpmio_module_la_SOURCES) \ + $(rpmiob_module_la_SOURCES) $(rpmmc_module_la_SOURCES) \ + $(rpmmg_module_la_SOURCES) $(rpmmi_module_la_SOURCES) \ + $(rpmmpf_module_la_SOURCES) $(rpmmpw_module_la_SOURCES) \ + $(rpmps_module_la_SOURCES) $(rpmseq_module_la_SOURCES) \ + $(rpmsm_module_la_SOURCES) $(rpmsp_module_la_SOURCES) \ + $(rpmst_module_la_SOURCES) $(rpmsw_module_la_SOURCES) \ + $(rpmsx_module_la_SOURCES) $(rpmsys_module_la_SOURCES) \ + $(rpmte_module_la_SOURCES) $(rpmts_module_la_SOURCES) \ + $(rpmtxn_module_la_SOURCES) $(rpmxar_module_la_SOURCES) \ + $(syck_module_la_SOURCES) $(uuid_module_la_SOURCES) \ + $(ngsr_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkglibdir = @USRLIBRPM@/lib +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDROOTDIR_MACRO = @BUILDROOTDIR_MACRO@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBAPI = @DBAPI@ +DBLIBOBJS = @DBLIBOBJS@ +DBLIBSRCS = @DBLIBSRCS@ +DBPATH = @DBPATH@ +DBPATH_MACRO = @DBPATH_MACRO@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTRO_MACROS = @DISTRO_MACROS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIXPERMS = @FIXPERMS@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GPSEE_MODULES_PATH = @GPSEE_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_STATIC = @LDFLAGS_STATIC@ +LD_VERSION_SCRIPT_FLAG = @LD_VERSION_SCRIPT_FLAG@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOLIZE = @LIBTOOLIZE@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MACROFILES = @MACROFILES@ +MAGIC_MACRO = @MAGIC_MACRO@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR = @MKDIR@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NCPUS_COMMAND = @NCPUS_COMMAND@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENMP_CFLAGS = @OPENMP_CFLAGS@ +OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_INSTALLDIRS = @PERL_INSTALLDIRS@ +PERL_URPM_INSTALLDIRS = @PERL_URPM_INSTALLDIRS@ +PKGSRCDIR = @PKGSRCDIR@ +PKGSRCDIR_MACRO = @PKGSRCDIR_MACRO@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +ROOT_GROUP = @ROOT_GROUP@ +RPMCANONARCH = @RPMCANONARCH@ +RPMCANONCOLOR = @RPMCANONCOLOR@ +RPMCANONGNU = @RPMCANONGNU@ +RPMCANONOS = @RPMCANONOS@ +RPMCANONVENDOR = @RPMCANONVENDOR@ +RPMGID = @RPMGID@ +RPMGROUP = @RPMGROUP@ +RPMLUAFILES = @RPMLUAFILES@ +RPMPOPTFILES = @RPMPOPTFILES@ +RPMUID = @RPMUID@ +RPMUSER = @RPMUSER@ +RPM_TIMESTAMP = @RPM_TIMESTAMP@ +RPM_VENDOR = @RPM_VENDOR@ +RPM_VERSION = @RPM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFIGDIR = @SYSCONFIGDIR@ +USE_NLS = @USE_NLS@ +USRLIBRPM = @USRLIBRPM@ +VERSION = @VERSION@ +WITH_ACL = @WITH_ACL@ +WITH_APIDOCS = @WITH_APIDOCS@ +WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ +WITH_APR = @WITH_APR@ +WITH_ATERM = @WITH_ATERM@ +WITH_ATTR = @WITH_ATTR@ +WITH_AUGEAS = @WITH_AUGEAS@ +WITH_AUGEAS_AUGTOOL = @WITH_AUGEAS_AUGTOOL@ +WITH_BASH = @WITH_BASH@ +WITH_BASH_CPPFLAGS = @WITH_BASH_CPPFLAGS@ +WITH_BASH_LDFLAGS = @WITH_BASH_LDFLAGS@ +WITH_BASH_LIBS = @WITH_BASH_LIBS@ +WITH_BASH_SUBDIR = @WITH_BASH_SUBDIR@ +WITH_BEECRYPT = @WITH_BEECRYPT@ +WITH_BEECRYPT_CPPFLAGS = @WITH_BEECRYPT_CPPFLAGS@ +WITH_BEECRYPT_LDFLAGS = @WITH_BEECRYPT_LDFLAGS@ +WITH_BEECRYPT_LIBS = @WITH_BEECRYPT_LIBS@ +WITH_BEECRYPT_SUBDIR = @WITH_BEECRYPT_SUBDIR@ +WITH_BZIP2 = @WITH_BZIP2@ +WITH_CPUINFO = @WITH_CPUINFO@ +WITH_CUDF = @WITH_CUDF@ +WITH_CUDF_CUDFTOOL = @WITH_CUDF_CUDFTOOL@ +WITH_DB = @WITH_DB@ +WITH_DBSQL = @WITH_DBSQL@ +WITH_DBSQL_CPPFLAGS = @WITH_DBSQL_CPPFLAGS@ +WITH_DBSQL_LDFLAGS = @WITH_DBSQL_LDFLAGS@ +WITH_DBSQL_LIBS = @WITH_DBSQL_LIBS@ +WITH_DBSQL_SUBDIR = @WITH_DBSQL_SUBDIR@ +WITH_DB_CPPFLAGS = @WITH_DB_CPPFLAGS@ +WITH_DB_LDFLAGS = @WITH_DB_LDFLAGS@ +WITH_DB_LIBS = @WITH_DB_LIBS@ +WITH_DB_SUBDIR = @WITH_DB_SUBDIR@ +WITH_DMALLOC = @WITH_DMALLOC@ +WITH_EFENCE = @WITH_EFENCE@ +WITH_EXPAT = @WITH_EXPAT@ +WITH_FICL = @WITH_FICL@ +WITH_FICL_CPPFLAGS = @WITH_FICL_CPPFLAGS@ +WITH_FICL_LDFLAGS = @WITH_FICL_LDFLAGS@ +WITH_FICL_LIBS = @WITH_FICL_LIBS@ +WITH_FICL_SUBDIR = @WITH_FICL_SUBDIR@ +WITH_FILE = @WITH_FILE@ +WITH_FILE_CPPFLAGS = @WITH_FILE_CPPFLAGS@ +WITH_FILE_LDFLAGS = @WITH_FILE_LDFLAGS@ +WITH_FILE_LIBS = @WITH_FILE_LIBS@ +WITH_FILE_SUBDIR = @WITH_FILE_SUBDIR@ +WITH_GCRYPT = @WITH_GCRYPT@ +WITH_GNUTLS = @WITH_GNUTLS@ +WITH_GPSEE = @WITH_GPSEE@ +WITH_GPSEE_CPPFLAGS = @WITH_GPSEE_CPPFLAGS@ +WITH_GPSEE_LDFLAGS = @WITH_GPSEE_LDFLAGS@ +WITH_GPSEE_LIBS = @WITH_GPSEE_LIBS@ +WITH_GPSEE_SUBDIR = @WITH_GPSEE_SUBDIR@ +WITH_JS_SUBDIR = @WITH_JS_SUBDIR@ +WITH_KEYUTILS = @WITH_KEYUTILS@ +WITH_KEYUTILS_RPMKEY = @WITH_KEYUTILS_RPMKEY@ +WITH_LIBELF_DEBUGEDIT = @WITH_LIBELF_DEBUGEDIT@ +WITH_LIBGIT2 = @WITH_LIBGIT2@ +WITH_LIBGIT2_CPPFLAGS = @WITH_LIBGIT2_CPPFLAGS@ +WITH_LIBGIT2_LDFLAGS = @WITH_LIBGIT2_LDFLAGS@ +WITH_LIBGIT2_LIBS = @WITH_LIBGIT2_LIBS@ +WITH_LIBGIT2_SUBDIR = @WITH_LIBGIT2_SUBDIR@ +WITH_LIBTASN1 = @WITH_LIBTASN1@ +WITH_LUA = @WITH_LUA@ +WITH_LUA_CPPFLAGS = @WITH_LUA_CPPFLAGS@ +WITH_LUA_LDFLAGS = @WITH_LUA_LDFLAGS@ +WITH_LUA_LIBS = @WITH_LUA_LIBS@ +WITH_LUA_SUBDIR = @WITH_LUA_SUBDIR@ +WITH_LUA_SUBDIR_DEF = @WITH_LUA_SUBDIR_DEF@ +WITH_LUA_SUBDIR_LIB = @WITH_LUA_SUBDIR_LIB@ +WITH_MOZJS185 = @WITH_MOZJS185@ +WITH_MOZJS185_CPPFLAGS = @WITH_MOZJS185_CPPFLAGS@ +WITH_MOZJS185_LDFLAGS = @WITH_MOZJS185_LDFLAGS@ +WITH_MOZJS185_LIBS = @WITH_MOZJS185_LIBS@ +WITH_MOZJS185_SUBDIR = @WITH_MOZJS185_SUBDIR@ +WITH_NEON = @WITH_NEON@ +WITH_NEON_CPPFLAGS = @WITH_NEON_CPPFLAGS@ +WITH_NEON_LDFLAGS = @WITH_NEON_LDFLAGS@ +WITH_NEON_LIBS = @WITH_NEON_LIBS@ +WITH_NEON_SUBDIR = @WITH_NEON_SUBDIR@ +WITH_NIX = @WITH_NIX@ +WITH_NSS = @WITH_NSS@ +WITH_OPENSSL = @WITH_OPENSSL@ +WITH_PAKCHOIS = @WITH_PAKCHOIS@ +WITH_PATH_VERSIONED = @WITH_PATH_VERSIONED@ +WITH_PATH_VERSIONED_SUFFIX = @WITH_PATH_VERSIONED_SUFFIX@ +WITH_PCRE = @WITH_PCRE@ +WITH_PCRE_CPPFLAGS = @WITH_PCRE_CPPFLAGS@ +WITH_PCRE_LDFLAGS = @WITH_PCRE_LDFLAGS@ +WITH_PCRE_LIBS = @WITH_PCRE_LIBS@ +WITH_PCRE_SUBDIR = @WITH_PCRE_SUBDIR@ +WITH_PERLEMBED = @WITH_PERLEMBED@ +WITH_PERL_LIBS = @WITH_PERL_LIBS@ +WITH_PERL_SUBDIR = @WITH_PERL_SUBDIR@ +WITH_PERL_SUBPACKAGE = @WITH_PERL_SUBPACKAGE@ +WITH_PERL_URPM_LIBS = @WITH_PERL_URPM_LIBS@ +WITH_PERL_URPM_SUBDIR = @WITH_PERL_URPM_SUBDIR@ +WITH_PERL_URPM_SUBPACKAGE = @WITH_PERL_URPM_SUBPACKAGE@ +WITH_POPT = @WITH_POPT@ +WITH_POPT_CPPFLAGS = @WITH_POPT_CPPFLAGS@ +WITH_POPT_LDFLAGS = @WITH_POPT_LDFLAGS@ +WITH_POPT_LIBS = @WITH_POPT_LIBS@ +WITH_POPT_SUBDIR = @WITH_POPT_SUBDIR@ +WITH_PYTHONEMBED = @WITH_PYTHONEMBED@ +WITH_PYTHON_INCDIR = @WITH_PYTHON_INCDIR@ +WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ +WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ +WITH_RC = @WITH_RC@ +WITH_RC_CPPFLAGS = @WITH_RC_CPPFLAGS@ +WITH_RC_LDFLAGS = @WITH_RC_LDFLAGS@ +WITH_RC_LIBS = @WITH_RC_LIBS@ +WITH_RC_SUBDIR = @WITH_RC_SUBDIR@ +WITH_READLINE = @WITH_READLINE@ +WITH_RUBY = @WITH_RUBY@ +WITH_RUBY_CPPFLAGS = @WITH_RUBY_CPPFLAGS@ +WITH_RUBY_SUBDIR = @WITH_RUBY_SUBDIR@ +WITH_RUBY_VENDORARCHDIR = @WITH_RUBY_VENDORARCHDIR@ +WITH_SELINUX = @WITH_SELINUX@ +WITH_SEMANAGE = @WITH_SEMANAGE@ +WITH_SEMANAGE_SEMODULE = @WITH_SEMANAGE_SEMODULE@ +WITH_SEPOL = @WITH_SEPOL@ +WITH_SPIDERMONKEY_SUBDIR = @WITH_SPIDERMONKEY_SUBDIR@ +WITH_SQLITE = @WITH_SQLITE@ +WITH_SQLITE_CPPFLAGS = @WITH_SQLITE_CPPFLAGS@ +WITH_SQLITE_LDFLAGS = @WITH_SQLITE_LDFLAGS@ +WITH_SQLITE_LIBS = @WITH_SQLITE_LIBS@ +WITH_SQLITE_SUBDIR = @WITH_SQLITE_SUBDIR@ +WITH_SQUIRREL = @WITH_SQUIRREL@ +WITH_SUBVERSION = @WITH_SUBVERSION@ +WITH_SYCK = @WITH_SYCK@ +WITH_SYCK_CPPFLAGS = @WITH_SYCK_CPPFLAGS@ +WITH_SYCK_LDFLAGS = @WITH_SYCK_LDFLAGS@ +WITH_SYCK_LIBS = @WITH_SYCK_LIBS@ +WITH_SYCK_SUBDIR = @WITH_SYCK_SUBDIR@ +WITH_TCL = @WITH_TCL@ +WITH_TCL_SUBDIR = @WITH_TCL_SUBDIR@ +WITH_TOMCRYPT = @WITH_TOMCRYPT@ +WITH_TPM = @WITH_TPM@ +WITH_UNIXODBC = @WITH_UNIXODBC@ +WITH_UUID = @WITH_UUID@ +WITH_XAR = @WITH_XAR@ +WITH_XAR_CPPFLAGS = @WITH_XAR_CPPFLAGS@ +WITH_XAR_LDFLAGS = @WITH_XAR_LDFLAGS@ +WITH_XAR_LIBS = @WITH_XAR_LIBS@ +WITH_XAR_SUBDIR = @WITH_XAR_SUBDIR@ +WITH_XZ = @WITH_XZ@ +WITH_XZ_CPPFLAGS = @WITH_XZ_CPPFLAGS@ +WITH_XZ_LDFLAGS = @WITH_XZ_LDFLAGS@ +WITH_XZ_LIBS = @WITH_XZ_LIBS@ +WITH_XZ_SUBDIR = @WITH_XZ_SUBDIR@ +WITH_ZLIB = @WITH_ZLIB@ +WITH_ZLIB_CPPFLAGS = @WITH_ZLIB_CPPFLAGS@ +WITH_ZLIB_LDFLAGS = @WITH_ZLIB_LDFLAGS@ +WITH_ZLIB_LIBS = @WITH_ZLIB_LIBS@ +WITH_ZLIB_SUBDIR = @WITH_ZLIB_SUBDIR@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__BASH = @__BASH@ +__BZIP2 = @__BZIP2@ +__CAT = @__CAT@ +__CHATTR = @__CHATTR@ +__CHGRP = @__CHGRP@ +__CHGRP_RHF = @__CHGRP_RHF@ +__CHMOD = @__CHMOD@ +__CHOWN = @__CHOWN@ +__CHOWN_RHF = @__CHOWN_RHF@ +__CMAKE = @__CMAKE@ +__CPIO = @__CPIO@ +__CURL = @__CURL@ +__CVS = @__CVS@ +__DBSQL = @__DBSQL@ +__DB_ARCHIVE = @__DB_ARCHIVE@ +__DB_CHECKPOINT = @__DB_CHECKPOINT@ +__DB_DEADLOCK = @__DB_DEADLOCK@ +__DB_DUMP = @__DB_DUMP@ +__DB_HOTBACKUP = @__DB_HOTBACKUP@ +__DB_LOAD = @__DB_LOAD@ +__DB_LOG_VERIFY = @__DB_LOG_VERIFY@ +__DB_PRINTLOG = @__DB_PRINTLOG@ +__DB_RECOVER = @__DB_RECOVER@ +__DB_REPLICATE = @__DB_REPLICATE@ +__DB_SQL_CODEGEN = @__DB_SQL_CODEGEN@ +__DB_STAT = @__DB_STAT@ +__DB_TUNER = @__DB_TUNER@ +__DB_UPGRADE = @__DB_UPGRADE@ +__DB_VERIFY = @__DB_VERIFY@ +__DIFF = @__DIFF@ +__DITTO = @__DITTO@ +__DOXYGEN = @__DOXYGEN@ +__FILE = @__FILE@ +__GIT = @__GIT@ +__GPG = @__GPG@ +__GSR = @__GSR@ +__GST_INSPECT = @__GST_INSPECT@ +__GZIP = @__GZIP@ +__HG = @__HG@ +__ID = @__ID@ +__ID_U = @__ID_U@ +__INSTALL = @__INSTALL@ +__INSTALL_INFO = @__INSTALL_INFO@ +__LD = @__LD@ +__LDCONFIG = @__LDCONFIG@ +__LN = @__LN@ +__LRZIP = @__LRZIP@ +__LSATTR = @__LSATTR@ +__LZIP = @__LZIP@ +__LZMA = @__LZMA@ +__LZOP = @__LZOP@ +__MAKE = @__MAKE@ +__MKDIR = @__MKDIR@ +__MKDIR_P = @__MKDIR_P@ +__MODINFO = @__MODINFO@ +__MONGO = @__MONGO@ +__MV = @__MV@ +__NM = @__NM@ +__OBJCOPY = @__OBJCOPY@ +__OBJDUMP = @__OBJDUMP@ +__PATCH = @__PATCH@ +__PAX = @__PAX@ +__PERL = @__PERL@ +__PGP = @__PGP@ +__PHP = @__PHP@ +__PYTHON = @__PYTHON@ +__RM = @__RM@ +__RMDIR = @__RMDIR@ +__RSH = @__RSH@ +__RUBY = @__RUBY@ +__SED = @__SED@ +__SH = @__SH@ +__SQLITE3 = @__SQLITE3@ +__SSH = @__SSH@ +__STRIP = @__STRIP@ +__SVN = @__SVN@ +__TAR = @__TAR@ +__TCLSH = @__TCLSH@ +__UNZIP = @__UNZIP@ +__XZ = @__XZ@ +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_CXX = @ac_ct_CXX@ +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@ +autorelocate_dcolor = @autorelocate_dcolor@ +autorelocate_path = @autorelocate_path@ +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@ +exeext = @exeext@ +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@ +libext = @libext@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +objext = @objext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +shlibext = @shlibext@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +testdir = @testdir@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrprefix = @usrprefix@ +varprefix = @varprefix@ +AUTOMAKE_OPTIONS = 1.4 foreign +LINT = splint +EXTRA_DIST = ngsr.c minimal.c \ + src \ + tscripts \ + words \ + legacy.cudf legacy-sol.cudf + +AM_CPPFLAGS = -I. \ + -I$(top_srcdir) \ + -I$(top_srcdir)/build \ + -I$(top_srcdir)/lib \ + -I$(top_builddir)/lib \ + -I$(top_srcdir)/rpmdb \ + -I$(top_srcdir)/rpmio \ + -I$(top_srcdir)/misc \ + @WITH_DB_CPPFLAGS@ \ + @WITH_FILE_CPPFLAGS@ \ + @WITH_MOZJS185_CPPFLAGS@ \ + @WITH_LUA_CPPFLAGS@ \ + @WITH_GPSEE_CPPFLAGS@ \ + @WITH_SYCK_CPPFLAGS@ \ + @WITH_XAR_CPPFLAGS@ \ + @WITH_ZLIB_CPPFLAGS@ + +AM_CFLAGS = $(OPENMP_CFLAGS) +RPMMISC_LDADD_COMMON = \ + $(top_builddir)/misc/librpmmisc.la \ + @LTLIBINTL@ + +RPMIO_LDADD_COMMON = \ + $(top_builddir)/rpmio/librpmio.la \ + $(RPMMISC_LDADD_COMMON) + +RPMDB_LDADD_COMMON = \ + $(top_builddir)/rpmdb/librpmdb.la \ + $(RPMIO_LDADD_COMMON) + +RPM_LDADD_COMMON = \ + $(top_builddir)/lib/librpm.la \ + $(RPMDB_LDADD_COMMON) + +RPMBUILD_LDADD_COMMON = \ + $(top_builddir)/build/librpmbuild.la \ + $(RPM_LDADD_COMMON) + +pkgbindir = @USRLIBRPM@/bin +moduledir = @GPSEE_MODULES_PATH@ +module_LTLIBRARIES = \ + rpmbf_module.la + +noinst_LTLIBRARIES = \ + librpmjsm.la + +EXTRA_LTLIBRARIES = \ + rpmaug_module.la \ + rpmbc_module.la \ + rpmcudf_module.la \ + rpmdb_module.la \ + rpmdbc_module.la \ + rpmdbe_module.la \ + rpmmpf_module.la \ + rpmseq_module.la \ + rpmtxn_module.la \ + rpmdc_module.la \ + rpmdig_module.la \ + rpmdir_module.la \ + rpmds_module.la \ + rpmfc_module.la \ + rpmfi_module.la \ + rpmfts_module.la \ + rpmgi_module.la \ + rpmhdr_module.la \ + rpmio_module.la \ + rpmiob_module.la \ + rpmmc_module.la \ + rpmmg_module.la \ + rpmmi_module.la \ + rpmmpw_module.la \ + rpmps_module.la \ + rpmsm_module.la \ + rpmsp_module.la \ + rpmst_module.la \ + rpmsw_module.la \ + rpmsx_module.la \ + rpmsys_module.la \ + rpmte_module.la \ + rpmts_module.la \ + rpmxar_module.la \ + syck_module.la \ + uuid_module.la + +librpmjsm_la_CFLAGS = -fno-strict-aliasing +librpmjsm_la_LDFLAGS = -module -avoid-version +librpmjsm_la_LIBADD = $(RPM_LDADD_COMMON) +rpmaug_module_la_SOURCES = rpmaug-js.c +rpmaug_module_la_CFLAGS = -fno-strict-aliasing +rpmaug_module_la_LDFLAGS = -module -avoid-version +rpmaug_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmbc_module_la_SOURCES = rpmbc-js.c +rpmbc_module_la_CFLAGS = -fno-strict-aliasing +rpmbc_module_la_LDFLAGS = -module -avoid-version +rpmbc_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmbf_module_la_SOURCES = rpmbf-js.c +rpmbf_module_la_CFLAGS = -fno-strict-aliasing +rpmbf_module_la_LDFLAGS = -module -avoid-version +rpmbf_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmcudf_module_la_SOURCES = rpmcudf-js.c +rpmcudf_module_la_CFLAGS = -fno-strict-aliasing +rpmcudf_module_la_LDFLAGS = -module -avoid-version +rpmcudf_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmdb_module_la_SOURCES = rpmdb-js.c +rpmdb_module_la_CFLAGS = -fno-strict-aliasing +rpmdb_module_la_LDFLAGS = -module -avoid-version +rpmdb_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmdbc_module_la_SOURCES = rpmdbc-js.c +rpmdbc_module_la_CFLAGS = -fno-strict-aliasing +rpmdbc_module_la_LDFLAGS = -module -avoid-version +rpmdbc_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmdbe_module_la_SOURCES = rpmdbe-js.c +rpmdbe_module_la_CFLAGS = -fno-strict-aliasing +rpmdbe_module_la_LDFLAGS = -module -avoid-version +rpmdbe_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmmpf_module_la_SOURCES = rpmmpf-js.c +rpmmpf_module_la_CFLAGS = -fno-strict-aliasing +rpmmpf_module_la_LDFLAGS = -module -avoid-version +rpmmpf_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmseq_module_la_SOURCES = rpmseq-js.c +rpmseq_module_la_CFLAGS = -fno-strict-aliasing +rpmseq_module_la_LDFLAGS = -module -avoid-version +rpmseq_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmtxn_module_la_SOURCES = rpmtxn-js.c +rpmtxn_module_la_CFLAGS = -fno-strict-aliasing +rpmtxn_module_la_LDFLAGS = -module -avoid-version +rpmtxn_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmdc_module_la_SOURCES = rpmdc-js.c +rpmdc_module_la_CFLAGS = -fno-strict-aliasing +rpmdc_module_la_LDFLAGS = -module -avoid-version +rpmdc_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmdig_module_la_SOURCES = rpmdig-js.c +rpmdig_module_la_CFLAGS = -fno-strict-aliasing +rpmdig_module_la_LDFLAGS = -module -avoid-version +rpmdig_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmdir_module_la_SOURCES = rpmdir-js.c +rpmdir_module_la_CFLAGS = -fno-strict-aliasing +rpmdir_module_la_LDFLAGS = -module -avoid-version +rpmdir_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmds_module_la_SOURCES = rpmds-js.c +rpmds_module_la_CFLAGS = -fno-strict-aliasing +rpmds_module_la_LDFLAGS = -module -avoid-version +rpmds_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmfc_module_la_SOURCES = rpmfc-js.c +rpmfc_module_la_CFLAGS = -fno-strict-aliasing +rpmfc_module_la_LDFLAGS = -module -avoid-version +rpmfc_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmfi_module_la_SOURCES = rpmfi-js.c +rpmfi_module_la_CFLAGS = -fno-strict-aliasing +rpmfi_module_la_LDFLAGS = -module -avoid-version +rpmfi_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmfts_module_la_SOURCES = rpmfts-js.c +rpmfts_module_la_CFLAGS = -fno-strict-aliasing +rpmfts_module_la_LDFLAGS = -module -avoid-version +rpmfts_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmgi_module_la_SOURCES = rpmgi-js.c +rpmgi_module_la_CFLAGS = -fno-strict-aliasing +rpmgi_module_la_LDFLAGS = -module -avoid-version +rpmgi_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmhdr_module_la_SOURCES = rpmhdr-js.c +rpmhdr_module_la_CFLAGS = -fno-strict-aliasing +rpmhdr_module_la_LDFLAGS = -module -avoid-version +rpmhdr_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmio_module_la_SOURCES = rpmio-js.c +rpmio_module_la_CFLAGS = -fno-strict-aliasing +rpmio_module_la_LDFLAGS = -module -avoid-version +rpmio_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmiob_module_la_SOURCES = rpmiob-js.c +rpmiob_module_la_CFLAGS = -fno-strict-aliasing +rpmiob_module_la_LDFLAGS = -module -avoid-version +rpmiob_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmmc_module_la_SOURCES = rpmmc-js.c +rpmmc_module_la_CFLAGS = -fno-strict-aliasing +rpmmc_module_la_LDFLAGS = -module -avoid-versmcn +rpmmc_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmmg_module_la_SOURCES = rpmmg-js.c +rpmmg_module_la_CFLAGS = -fno-strict-aliasing +rpmmg_module_la_LDFLAGS = -module -avoid-versmgn +rpmmg_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmmi_module_la_SOURCES = rpmmi-js.c +rpmmi_module_la_CFLAGS = -fno-strict-aliasing +rpmmi_module_la_LDFLAGS = -module -avoid-versmin +rpmmi_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmmpw_module_la_SOURCES = rpmmpw-js.c +rpmmpw_module_la_CFLAGS = -fno-strict-aliasing +rpmmpw_module_la_LDFLAGS = -module -avoid-versmin +rpmmpw_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmps_module_la_SOURCES = rpmps-js.c +rpmps_module_la_CFLAGS = -fno-strict-aliasing +rpmps_module_la_LDFLAGS = -module -avoid-versmin +rpmps_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmsm_module_la_SOURCES = rpmsm-js.c +rpmsm_module_la_CFLAGS = -fno-strict-aliasing +rpmsm_module_la_LDFLAGS = -module -avoid-versmin +rpmsm_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmsp_module_la_SOURCES = rpmsp-js.c +rpmsp_module_la_CFLAGS = -fno-strict-aliasing +rpmsp_module_la_LDFLAGS = -module -avoid-versmin +rpmsp_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmst_module_la_SOURCES = rpmst-js.c +rpmst_module_la_CFLAGS = -fno-strict-aliasing +rpmst_module_la_LDFLAGS = -module -avoid-verssysn +rpmst_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmsw_module_la_SOURCES = rpmsw-js.c +rpmsw_module_la_CFLAGS = -fno-strict-aliasing +rpmsw_module_la_LDFLAGS = -module -avoid-versmin +rpmsw_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmsx_module_la_SOURCES = rpmsx-js.c +rpmsx_module_la_CFLAGS = -fno-strict-aliasing +rpmsx_module_la_LDFLAGS = -module -avoid-versmin +rpmsx_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmsys_module_la_SOURCES = rpmsys-js.c +rpmsys_module_la_CFLAGS = -fno-strict-aliasing +rpmsys_module_la_LDFLAGS = -module -avoid-verssysn +rpmsys_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmte_module_la_SOURCES = rpmte-js.c +rpmte_module_la_CFLAGS = -fno-strict-aliasing +rpmte_module_la_LDFLAGS = -module -avoid-verssysn +rpmte_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmts_module_la_SOURCES = rpmts-js.c +rpmts_module_la_CFLAGS = -fno-strict-aliasing +rpmts_module_la_LDFLAGS = -module -avoid-verssysn +rpmts_module_la_LIBADD = $(RPM_LDADD_COMMON) +rpmxar_module_la_SOURCES = rpmxar-js.c +rpmxar_module_la_CFLAGS = -fno-strict-aliasing +rpmxar_module_la_LDFLAGS = -module -avoid-verssysn +rpmxar_module_la_LIBADD = $(RPM_LDADD_COMMON) +syck_module_la_SOURCES = syck-js.c +syck_module_la_CFLAGS = -fno-strict-aliasing +syck_module_la_LDFLAGS = -module -avoid-version +syck_module_la_LIBADD = $(RPM_LDADD_COMMON) +uuid_module_la_SOURCES = uuid-js.c +uuid_module_la_CFLAGS = -fno-strict-aliasing +uuid_module_la_LDFLAGS = -module -avoid-version +uuid_module_la_LIBADD = $(RPM_LDADD_COMMON) +noinst_HEADERS = \ + rpmaug-js.h rpmbc-js.h rpmbf-js.h rpmcudf-js.h rpmdb-js.h rpmdbc-js.h rpmdbe-js.c rpmdc-js.h rpmdig-js.h \ + rpmdir-js.h rpmds-js.h rpmfc-js.h rpmfi-js.h rpmfts-js.h rpmgi-js.h \ + rpmhdr-js.h rpmio-js.h rpmiob-js.h rpmmc-js.h rpmmg-js.h rpmmi-js.h \ + rpmmpf-js.h rpmmpw-js.h rpmps-js.h rpmseq-js.h rpmsm-js.h rpmsp-js.h rpmst-js.h rpmsw-js.h \ + rpmsx-js.h rpmsys-js.h rpmte-js.h rpmts-js.h rpmtxn-js.h rpmxar-js.h \ + syck-js.h uuid-js.h + +librpmjsm_la_SOURCES = \ + rpmaug-js.c rpmbc-js.c rpmbf-js.c rpmcudf-js.c rpmdb-js.c rpmdbc-js.c rpmdbe-js.c rpmdc-js.c rpmdig-js.c \ + rpmdir-js.c rpmds-js.c rpmfc-js.c rpmfi-js.c rpmfts-js.c rpmgi-js.c \ + rpmhdr-js.c rpmio-js.c rpmiob-js.c rpmmc-js.c rpmmg-js.c rpmmi-js.c \ + rpmmpf-js.c rpmmpw-js.c rpmps-js.c rpmseq-js.c rpmsm-js.c rpmsp-js.c rpmst-js.c rpmsw-js.c \ + rpmsx-js.c rpmsys-js.c rpmte-js.c rpmts-js.c rpmtxn-js.c rpmxar-js.c \ + syck-js.c uuid-js.c + +ngsr_SOURCES = ngsr.c +ngsr_LDADD = $(RPM_LDADD_COMMON) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 js/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign js/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-moduleLTLIBRARIES: $(module_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || 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)$(moduledir)'"; \ + $(MKDIR_P) '$(DESTDIR)$(moduledir)' || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(moduledir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(moduledir)"; \ + } + +uninstall-moduleLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$f"; \ + done + +clean-moduleLTLIBRARIES: + -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) + @list='$(module_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +librpmjsm.la: $(librpmjsm_la_OBJECTS) $(librpmjsm_la_DEPENDENCIES) $(EXTRA_librpmjsm_la_DEPENDENCIES) + $(librpmjsm_la_LINK) $(librpmjsm_la_OBJECTS) $(librpmjsm_la_LIBADD) $(LIBS) +rpmaug_module.la: $(rpmaug_module_la_OBJECTS) $(rpmaug_module_la_DEPENDENCIES) $(EXTRA_rpmaug_module_la_DEPENDENCIES) + $(rpmaug_module_la_LINK) $(rpmaug_module_la_OBJECTS) $(rpmaug_module_la_LIBADD) $(LIBS) +rpmbc_module.la: $(rpmbc_module_la_OBJECTS) $(rpmbc_module_la_DEPENDENCIES) $(EXTRA_rpmbc_module_la_DEPENDENCIES) + $(rpmbc_module_la_LINK) $(rpmbc_module_la_OBJECTS) $(rpmbc_module_la_LIBADD) $(LIBS) +rpmbf_module.la: $(rpmbf_module_la_OBJECTS) $(rpmbf_module_la_DEPENDENCIES) $(EXTRA_rpmbf_module_la_DEPENDENCIES) + $(rpmbf_module_la_LINK) -rpath $(moduledir) $(rpmbf_module_la_OBJECTS) $(rpmbf_module_la_LIBADD) $(LIBS) +rpmcudf_module.la: $(rpmcudf_module_la_OBJECTS) $(rpmcudf_module_la_DEPENDENCIES) $(EXTRA_rpmcudf_module_la_DEPENDENCIES) + $(rpmcudf_module_la_LINK) $(rpmcudf_module_la_OBJECTS) $(rpmcudf_module_la_LIBADD) $(LIBS) +rpmdb_module.la: $(rpmdb_module_la_OBJECTS) $(rpmdb_module_la_DEPENDENCIES) $(EXTRA_rpmdb_module_la_DEPENDENCIES) + $(rpmdb_module_la_LINK) $(rpmdb_module_la_OBJECTS) $(rpmdb_module_la_LIBADD) $(LIBS) +rpmdbc_module.la: $(rpmdbc_module_la_OBJECTS) $(rpmdbc_module_la_DEPENDENCIES) $(EXTRA_rpmdbc_module_la_DEPENDENCIES) + $(rpmdbc_module_la_LINK) $(rpmdbc_module_la_OBJECTS) $(rpmdbc_module_la_LIBADD) $(LIBS) +rpmdbe_module.la: $(rpmdbe_module_la_OBJECTS) $(rpmdbe_module_la_DEPENDENCIES) $(EXTRA_rpmdbe_module_la_DEPENDENCIES) + $(rpmdbe_module_la_LINK) $(rpmdbe_module_la_OBJECTS) $(rpmdbe_module_la_LIBADD) $(LIBS) +rpmdc_module.la: $(rpmdc_module_la_OBJECTS) $(rpmdc_module_la_DEPENDENCIES) $(EXTRA_rpmdc_module_la_DEPENDENCIES) + $(rpmdc_module_la_LINK) $(rpmdc_module_la_OBJECTS) $(rpmdc_module_la_LIBADD) $(LIBS) +rpmdig_module.la: $(rpmdig_module_la_OBJECTS) $(rpmdig_module_la_DEPENDENCIES) $(EXTRA_rpmdig_module_la_DEPENDENCIES) + $(rpmdig_module_la_LINK) $(rpmdig_module_la_OBJECTS) $(rpmdig_module_la_LIBADD) $(LIBS) +rpmdir_module.la: $(rpmdir_module_la_OBJECTS) $(rpmdir_module_la_DEPENDENCIES) $(EXTRA_rpmdir_module_la_DEPENDENCIES) + $(rpmdir_module_la_LINK) $(rpmdir_module_la_OBJECTS) $(rpmdir_module_la_LIBADD) $(LIBS) +rpmds_module.la: $(rpmds_module_la_OBJECTS) $(rpmds_module_la_DEPENDENCIES) $(EXTRA_rpmds_module_la_DEPENDENCIES) + $(rpmds_module_la_LINK) $(rpmds_module_la_OBJECTS) $(rpmds_module_la_LIBADD) $(LIBS) +rpmfc_module.la: $(rpmfc_module_la_OBJECTS) $(rpmfc_module_la_DEPENDENCIES) $(EXTRA_rpmfc_module_la_DEPENDENCIES) + $(rpmfc_module_la_LINK) $(rpmfc_module_la_OBJECTS) $(rpmfc_module_la_LIBADD) $(LIBS) +rpmfi_module.la: $(rpmfi_module_la_OBJECTS) $(rpmfi_module_la_DEPENDENCIES) $(EXTRA_rpmfi_module_la_DEPENDENCIES) + $(rpmfi_module_la_LINK) $(rpmfi_module_la_OBJECTS) $(rpmfi_module_la_LIBADD) $(LIBS) +rpmfts_module.la: $(rpmfts_module_la_OBJECTS) $(rpmfts_module_la_DEPENDENCIES) $(EXTRA_rpmfts_module_la_DEPENDENCIES) + $(rpmfts_module_la_LINK) $(rpmfts_module_la_OBJECTS) $(rpmfts_module_la_LIBADD) $(LIBS) +rpmgi_module.la: $(rpmgi_module_la_OBJECTS) $(rpmgi_module_la_DEPENDENCIES) $(EXTRA_rpmgi_module_la_DEPENDENCIES) + $(rpmgi_module_la_LINK) $(rpmgi_module_la_OBJECTS) $(rpmgi_module_la_LIBADD) $(LIBS) +rpmhdr_module.la: $(rpmhdr_module_la_OBJECTS) $(rpmhdr_module_la_DEPENDENCIES) $(EXTRA_rpmhdr_module_la_DEPENDENCIES) + $(rpmhdr_module_la_LINK) $(rpmhdr_module_la_OBJECTS) $(rpmhdr_module_la_LIBADD) $(LIBS) +rpmio_module.la: $(rpmio_module_la_OBJECTS) $(rpmio_module_la_DEPENDENCIES) $(EXTRA_rpmio_module_la_DEPENDENCIES) + $(rpmio_module_la_LINK) $(rpmio_module_la_OBJECTS) $(rpmio_module_la_LIBADD) $(LIBS) +rpmiob_module.la: $(rpmiob_module_la_OBJECTS) $(rpmiob_module_la_DEPENDENCIES) $(EXTRA_rpmiob_module_la_DEPENDENCIES) + $(rpmiob_module_la_LINK) $(rpmiob_module_la_OBJECTS) $(rpmiob_module_la_LIBADD) $(LIBS) +rpmmc_module.la: $(rpmmc_module_la_OBJECTS) $(rpmmc_module_la_DEPENDENCIES) $(EXTRA_rpmmc_module_la_DEPENDENCIES) + $(rpmmc_module_la_LINK) $(rpmmc_module_la_OBJECTS) $(rpmmc_module_la_LIBADD) $(LIBS) +rpmmg_module.la: $(rpmmg_module_la_OBJECTS) $(rpmmg_module_la_DEPENDENCIES) $(EXTRA_rpmmg_module_la_DEPENDENCIES) + $(rpmmg_module_la_LINK) $(rpmmg_module_la_OBJECTS) $(rpmmg_module_la_LIBADD) $(LIBS) +rpmmi_module.la: $(rpmmi_module_la_OBJECTS) $(rpmmi_module_la_DEPENDENCIES) $(EXTRA_rpmmi_module_la_DEPENDENCIES) + $(rpmmi_module_la_LINK) $(rpmmi_module_la_OBJECTS) $(rpmmi_module_la_LIBADD) $(LIBS) +rpmmpf_module.la: $(rpmmpf_module_la_OBJECTS) $(rpmmpf_module_la_DEPENDENCIES) $(EXTRA_rpmmpf_module_la_DEPENDENCIES) + $(rpmmpf_module_la_LINK) $(rpmmpf_module_la_OBJECTS) $(rpmmpf_module_la_LIBADD) $(LIBS) +rpmmpw_module.la: $(rpmmpw_module_la_OBJECTS) $(rpmmpw_module_la_DEPENDENCIES) $(EXTRA_rpmmpw_module_la_DEPENDENCIES) + $(rpmmpw_module_la_LINK) $(rpmmpw_module_la_OBJECTS) $(rpmmpw_module_la_LIBADD) $(LIBS) +rpmps_module.la: $(rpmps_module_la_OBJECTS) $(rpmps_module_la_DEPENDENCIES) $(EXTRA_rpmps_module_la_DEPENDENCIES) + $(rpmps_module_la_LINK) $(rpmps_module_la_OBJECTS) $(rpmps_module_la_LIBADD) $(LIBS) +rpmseq_module.la: $(rpmseq_module_la_OBJECTS) $(rpmseq_module_la_DEPENDENCIES) $(EXTRA_rpmseq_module_la_DEPENDENCIES) + $(rpmseq_module_la_LINK) $(rpmseq_module_la_OBJECTS) $(rpmseq_module_la_LIBADD) $(LIBS) +rpmsm_module.la: $(rpmsm_module_la_OBJECTS) $(rpmsm_module_la_DEPENDENCIES) $(EXTRA_rpmsm_module_la_DEPENDENCIES) + $(rpmsm_module_la_LINK) $(rpmsm_module_la_OBJECTS) $(rpmsm_module_la_LIBADD) $(LIBS) +rpmsp_module.la: $(rpmsp_module_la_OBJECTS) $(rpmsp_module_la_DEPENDENCIES) $(EXTRA_rpmsp_module_la_DEPENDENCIES) + $(rpmsp_module_la_LINK) $(rpmsp_module_la_OBJECTS) $(rpmsp_module_la_LIBADD) $(LIBS) +rpmst_module.la: $(rpmst_module_la_OBJECTS) $(rpmst_module_la_DEPENDENCIES) $(EXTRA_rpmst_module_la_DEPENDENCIES) + $(rpmst_module_la_LINK) $(rpmst_module_la_OBJECTS) $(rpmst_module_la_LIBADD) $(LIBS) +rpmsw_module.la: $(rpmsw_module_la_OBJECTS) $(rpmsw_module_la_DEPENDENCIES) $(EXTRA_rpmsw_module_la_DEPENDENCIES) + $(rpmsw_module_la_LINK) $(rpmsw_module_la_OBJECTS) $(rpmsw_module_la_LIBADD) $(LIBS) +rpmsx_module.la: $(rpmsx_module_la_OBJECTS) $(rpmsx_module_la_DEPENDENCIES) $(EXTRA_rpmsx_module_la_DEPENDENCIES) + $(rpmsx_module_la_LINK) $(rpmsx_module_la_OBJECTS) $(rpmsx_module_la_LIBADD) $(LIBS) +rpmsys_module.la: $(rpmsys_module_la_OBJECTS) $(rpmsys_module_la_DEPENDENCIES) $(EXTRA_rpmsys_module_la_DEPENDENCIES) + $(rpmsys_module_la_LINK) $(rpmsys_module_la_OBJECTS) $(rpmsys_module_la_LIBADD) $(LIBS) +rpmte_module.la: $(rpmte_module_la_OBJECTS) $(rpmte_module_la_DEPENDENCIES) $(EXTRA_rpmte_module_la_DEPENDENCIES) + $(rpmte_module_la_LINK) $(rpmte_module_la_OBJECTS) $(rpmte_module_la_LIBADD) $(LIBS) +rpmts_module.la: $(rpmts_module_la_OBJECTS) $(rpmts_module_la_DEPENDENCIES) $(EXTRA_rpmts_module_la_DEPENDENCIES) + $(rpmts_module_la_LINK) $(rpmts_module_la_OBJECTS) $(rpmts_module_la_LIBADD) $(LIBS) +rpmtxn_module.la: $(rpmtxn_module_la_OBJECTS) $(rpmtxn_module_la_DEPENDENCIES) $(EXTRA_rpmtxn_module_la_DEPENDENCIES) + $(rpmtxn_module_la_LINK) $(rpmtxn_module_la_OBJECTS) $(rpmtxn_module_la_LIBADD) $(LIBS) +rpmxar_module.la: $(rpmxar_module_la_OBJECTS) $(rpmxar_module_la_DEPENDENCIES) $(EXTRA_rpmxar_module_la_DEPENDENCIES) + $(rpmxar_module_la_LINK) $(rpmxar_module_la_OBJECTS) $(rpmxar_module_la_LIBADD) $(LIBS) +syck_module.la: $(syck_module_la_OBJECTS) $(syck_module_la_DEPENDENCIES) $(EXTRA_syck_module_la_DEPENDENCIES) + $(syck_module_la_LINK) $(syck_module_la_OBJECTS) $(syck_module_la_LIBADD) $(LIBS) +uuid_module.la: $(uuid_module_la_OBJECTS) $(uuid_module_la_DEPENDENCIES) $(EXTRA_uuid_module_la_DEPENDENCIES) + $(uuid_module_la_LINK) $(uuid_module_la_OBJECTS) $(uuid_module_la_LIBADD) $(LIBS) +install-pkgbinPROGRAMS: $(pkgbin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(pkgbin_PROGRAMS)'; test -n "$(pkgbindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgbindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgbindir)" || 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)$(pkgbindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkgbindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-pkgbinPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(pkgbin_PROGRAMS)'; test -n "$(pkgbindir)" || 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)$(pkgbindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgbindir)" && rm -f $$files + +clean-pkgbinPROGRAMS: + @list='$(pkgbin_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 +ngsr$(EXEEXT): $(ngsr_OBJECTS) $(ngsr_DEPENDENCIES) $(EXTRA_ngsr_DEPENDENCIES) + @rm -f ngsr$(EXEEXT) + $(LINK) $(ngsr_OBJECTS) $(ngsr_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmaug-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmbc-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmbf-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmcudf-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmdb-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmdbc-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmdbe-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmdc-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmdig-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmdir-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmds-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmfc-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmfi-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmfts-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmgi-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmhdr-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmio-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmiob-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmmc-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmmg-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmmi-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmmpf-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmmpw-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmps-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmseq-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmsm-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmsp-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmst-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmsw-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmsx-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmsys-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmte-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmts-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmtxn-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-rpmxar-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-syck-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmjsm_la-uuid-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ngsr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmaug_module_la-rpmaug-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmbc_module_la-rpmbc-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmbf_module_la-rpmbf-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmcudf_module_la-rpmcudf-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmdb_module_la-rpmdb-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmdbc_module_la-rpmdbc-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmdbe_module_la-rpmdbe-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmdc_module_la-rpmdc-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmdig_module_la-rpmdig-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmdir_module_la-rpmdir-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmds_module_la-rpmds-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmfc_module_la-rpmfc-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmfi_module_la-rpmfi-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmfts_module_la-rpmfts-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmgi_module_la-rpmgi-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmhdr_module_la-rpmhdr-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmio_module_la-rpmio-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmiob_module_la-rpmiob-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmmc_module_la-rpmmc-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmmg_module_la-rpmmg-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmmi_module_la-rpmmi-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmmpf_module_la-rpmmpf-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmmpw_module_la-rpmmpw-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmps_module_la-rpmps-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmseq_module_la-rpmseq-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmsm_module_la-rpmsm-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmsp_module_la-rpmsp-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmst_module_la-rpmst-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmsw_module_la-rpmsw-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmsx_module_la-rpmsx-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmsys_module_la-rpmsys-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmte_module_la-rpmte-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmts_module_la-rpmts-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmtxn_module_la-rpmtxn-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmxar_module_la-rpmxar-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syck_module_la-syck-js.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uuid_module_la-uuid-js.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +librpmjsm_la-rpmaug-js.lo: rpmaug-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmaug-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmaug-js.Tpo -c -o librpmjsm_la-rpmaug-js.lo `test -f 'rpmaug-js.c' || echo '$(srcdir)/'`rpmaug-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmaug-js.Tpo $(DEPDIR)/librpmjsm_la-rpmaug-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmaug-js.c' object='librpmjsm_la-rpmaug-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmaug-js.lo `test -f 'rpmaug-js.c' || echo '$(srcdir)/'`rpmaug-js.c + +librpmjsm_la-rpmbc-js.lo: rpmbc-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmbc-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmbc-js.Tpo -c -o librpmjsm_la-rpmbc-js.lo `test -f 'rpmbc-js.c' || echo '$(srcdir)/'`rpmbc-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmbc-js.Tpo $(DEPDIR)/librpmjsm_la-rpmbc-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmbc-js.c' object='librpmjsm_la-rpmbc-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmbc-js.lo `test -f 'rpmbc-js.c' || echo '$(srcdir)/'`rpmbc-js.c + +librpmjsm_la-rpmbf-js.lo: rpmbf-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmbf-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmbf-js.Tpo -c -o librpmjsm_la-rpmbf-js.lo `test -f 'rpmbf-js.c' || echo '$(srcdir)/'`rpmbf-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmbf-js.Tpo $(DEPDIR)/librpmjsm_la-rpmbf-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmbf-js.c' object='librpmjsm_la-rpmbf-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmbf-js.lo `test -f 'rpmbf-js.c' || echo '$(srcdir)/'`rpmbf-js.c + +librpmjsm_la-rpmcudf-js.lo: rpmcudf-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmcudf-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmcudf-js.Tpo -c -o librpmjsm_la-rpmcudf-js.lo `test -f 'rpmcudf-js.c' || echo '$(srcdir)/'`rpmcudf-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmcudf-js.Tpo $(DEPDIR)/librpmjsm_la-rpmcudf-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmcudf-js.c' object='librpmjsm_la-rpmcudf-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmcudf-js.lo `test -f 'rpmcudf-js.c' || echo '$(srcdir)/'`rpmcudf-js.c + +librpmjsm_la-rpmdb-js.lo: rpmdb-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmdb-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmdb-js.Tpo -c -o librpmjsm_la-rpmdb-js.lo `test -f 'rpmdb-js.c' || echo '$(srcdir)/'`rpmdb-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmdb-js.Tpo $(DEPDIR)/librpmjsm_la-rpmdb-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmdb-js.c' object='librpmjsm_la-rpmdb-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmdb-js.lo `test -f 'rpmdb-js.c' || echo '$(srcdir)/'`rpmdb-js.c + +librpmjsm_la-rpmdbc-js.lo: rpmdbc-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmdbc-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmdbc-js.Tpo -c -o librpmjsm_la-rpmdbc-js.lo `test -f 'rpmdbc-js.c' || echo '$(srcdir)/'`rpmdbc-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmdbc-js.Tpo $(DEPDIR)/librpmjsm_la-rpmdbc-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmdbc-js.c' object='librpmjsm_la-rpmdbc-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmdbc-js.lo `test -f 'rpmdbc-js.c' || echo '$(srcdir)/'`rpmdbc-js.c + +librpmjsm_la-rpmdbe-js.lo: rpmdbe-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmdbe-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmdbe-js.Tpo -c -o librpmjsm_la-rpmdbe-js.lo `test -f 'rpmdbe-js.c' || echo '$(srcdir)/'`rpmdbe-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmdbe-js.Tpo $(DEPDIR)/librpmjsm_la-rpmdbe-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmdbe-js.c' object='librpmjsm_la-rpmdbe-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmdbe-js.lo `test -f 'rpmdbe-js.c' || echo '$(srcdir)/'`rpmdbe-js.c + +librpmjsm_la-rpmdc-js.lo: rpmdc-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmdc-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmdc-js.Tpo -c -o librpmjsm_la-rpmdc-js.lo `test -f 'rpmdc-js.c' || echo '$(srcdir)/'`rpmdc-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmdc-js.Tpo $(DEPDIR)/librpmjsm_la-rpmdc-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmdc-js.c' object='librpmjsm_la-rpmdc-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmdc-js.lo `test -f 'rpmdc-js.c' || echo '$(srcdir)/'`rpmdc-js.c + +librpmjsm_la-rpmdig-js.lo: rpmdig-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmdig-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmdig-js.Tpo -c -o librpmjsm_la-rpmdig-js.lo `test -f 'rpmdig-js.c' || echo '$(srcdir)/'`rpmdig-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmdig-js.Tpo $(DEPDIR)/librpmjsm_la-rpmdig-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmdig-js.c' object='librpmjsm_la-rpmdig-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmdig-js.lo `test -f 'rpmdig-js.c' || echo '$(srcdir)/'`rpmdig-js.c + +librpmjsm_la-rpmdir-js.lo: rpmdir-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmdir-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmdir-js.Tpo -c -o librpmjsm_la-rpmdir-js.lo `test -f 'rpmdir-js.c' || echo '$(srcdir)/'`rpmdir-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmdir-js.Tpo $(DEPDIR)/librpmjsm_la-rpmdir-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmdir-js.c' object='librpmjsm_la-rpmdir-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmdir-js.lo `test -f 'rpmdir-js.c' || echo '$(srcdir)/'`rpmdir-js.c + +librpmjsm_la-rpmds-js.lo: rpmds-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmds-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmds-js.Tpo -c -o librpmjsm_la-rpmds-js.lo `test -f 'rpmds-js.c' || echo '$(srcdir)/'`rpmds-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmds-js.Tpo $(DEPDIR)/librpmjsm_la-rpmds-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmds-js.c' object='librpmjsm_la-rpmds-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmds-js.lo `test -f 'rpmds-js.c' || echo '$(srcdir)/'`rpmds-js.c + +librpmjsm_la-rpmfc-js.lo: rpmfc-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmfc-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmfc-js.Tpo -c -o librpmjsm_la-rpmfc-js.lo `test -f 'rpmfc-js.c' || echo '$(srcdir)/'`rpmfc-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmfc-js.Tpo $(DEPDIR)/librpmjsm_la-rpmfc-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmfc-js.c' object='librpmjsm_la-rpmfc-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmfc-js.lo `test -f 'rpmfc-js.c' || echo '$(srcdir)/'`rpmfc-js.c + +librpmjsm_la-rpmfi-js.lo: rpmfi-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmfi-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmfi-js.Tpo -c -o librpmjsm_la-rpmfi-js.lo `test -f 'rpmfi-js.c' || echo '$(srcdir)/'`rpmfi-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmfi-js.Tpo $(DEPDIR)/librpmjsm_la-rpmfi-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmfi-js.c' object='librpmjsm_la-rpmfi-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmfi-js.lo `test -f 'rpmfi-js.c' || echo '$(srcdir)/'`rpmfi-js.c + +librpmjsm_la-rpmfts-js.lo: rpmfts-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmfts-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmfts-js.Tpo -c -o librpmjsm_la-rpmfts-js.lo `test -f 'rpmfts-js.c' || echo '$(srcdir)/'`rpmfts-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmfts-js.Tpo $(DEPDIR)/librpmjsm_la-rpmfts-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmfts-js.c' object='librpmjsm_la-rpmfts-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmfts-js.lo `test -f 'rpmfts-js.c' || echo '$(srcdir)/'`rpmfts-js.c + +librpmjsm_la-rpmgi-js.lo: rpmgi-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmgi-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmgi-js.Tpo -c -o librpmjsm_la-rpmgi-js.lo `test -f 'rpmgi-js.c' || echo '$(srcdir)/'`rpmgi-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmgi-js.Tpo $(DEPDIR)/librpmjsm_la-rpmgi-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmgi-js.c' object='librpmjsm_la-rpmgi-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmgi-js.lo `test -f 'rpmgi-js.c' || echo '$(srcdir)/'`rpmgi-js.c + +librpmjsm_la-rpmhdr-js.lo: rpmhdr-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmhdr-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmhdr-js.Tpo -c -o librpmjsm_la-rpmhdr-js.lo `test -f 'rpmhdr-js.c' || echo '$(srcdir)/'`rpmhdr-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmhdr-js.Tpo $(DEPDIR)/librpmjsm_la-rpmhdr-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmhdr-js.c' object='librpmjsm_la-rpmhdr-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmhdr-js.lo `test -f 'rpmhdr-js.c' || echo '$(srcdir)/'`rpmhdr-js.c + +librpmjsm_la-rpmio-js.lo: rpmio-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmio-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmio-js.Tpo -c -o librpmjsm_la-rpmio-js.lo `test -f 'rpmio-js.c' || echo '$(srcdir)/'`rpmio-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmio-js.Tpo $(DEPDIR)/librpmjsm_la-rpmio-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmio-js.c' object='librpmjsm_la-rpmio-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmio-js.lo `test -f 'rpmio-js.c' || echo '$(srcdir)/'`rpmio-js.c + +librpmjsm_la-rpmiob-js.lo: rpmiob-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmiob-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmiob-js.Tpo -c -o librpmjsm_la-rpmiob-js.lo `test -f 'rpmiob-js.c' || echo '$(srcdir)/'`rpmiob-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmiob-js.Tpo $(DEPDIR)/librpmjsm_la-rpmiob-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmiob-js.c' object='librpmjsm_la-rpmiob-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmiob-js.lo `test -f 'rpmiob-js.c' || echo '$(srcdir)/'`rpmiob-js.c + +librpmjsm_la-rpmmc-js.lo: rpmmc-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmmc-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmmc-js.Tpo -c -o librpmjsm_la-rpmmc-js.lo `test -f 'rpmmc-js.c' || echo '$(srcdir)/'`rpmmc-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmmc-js.Tpo $(DEPDIR)/librpmjsm_la-rpmmc-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmmc-js.c' object='librpmjsm_la-rpmmc-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmmc-js.lo `test -f 'rpmmc-js.c' || echo '$(srcdir)/'`rpmmc-js.c + +librpmjsm_la-rpmmg-js.lo: rpmmg-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmmg-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmmg-js.Tpo -c -o librpmjsm_la-rpmmg-js.lo `test -f 'rpmmg-js.c' || echo '$(srcdir)/'`rpmmg-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmmg-js.Tpo $(DEPDIR)/librpmjsm_la-rpmmg-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmmg-js.c' object='librpmjsm_la-rpmmg-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmmg-js.lo `test -f 'rpmmg-js.c' || echo '$(srcdir)/'`rpmmg-js.c + +librpmjsm_la-rpmmi-js.lo: rpmmi-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmmi-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmmi-js.Tpo -c -o librpmjsm_la-rpmmi-js.lo `test -f 'rpmmi-js.c' || echo '$(srcdir)/'`rpmmi-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmmi-js.Tpo $(DEPDIR)/librpmjsm_la-rpmmi-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmmi-js.c' object='librpmjsm_la-rpmmi-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmmi-js.lo `test -f 'rpmmi-js.c' || echo '$(srcdir)/'`rpmmi-js.c + +librpmjsm_la-rpmmpf-js.lo: rpmmpf-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmmpf-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmmpf-js.Tpo -c -o librpmjsm_la-rpmmpf-js.lo `test -f 'rpmmpf-js.c' || echo '$(srcdir)/'`rpmmpf-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmmpf-js.Tpo $(DEPDIR)/librpmjsm_la-rpmmpf-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmmpf-js.c' object='librpmjsm_la-rpmmpf-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmmpf-js.lo `test -f 'rpmmpf-js.c' || echo '$(srcdir)/'`rpmmpf-js.c + +librpmjsm_la-rpmmpw-js.lo: rpmmpw-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmmpw-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmmpw-js.Tpo -c -o librpmjsm_la-rpmmpw-js.lo `test -f 'rpmmpw-js.c' || echo '$(srcdir)/'`rpmmpw-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmmpw-js.Tpo $(DEPDIR)/librpmjsm_la-rpmmpw-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmmpw-js.c' object='librpmjsm_la-rpmmpw-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmmpw-js.lo `test -f 'rpmmpw-js.c' || echo '$(srcdir)/'`rpmmpw-js.c + +librpmjsm_la-rpmps-js.lo: rpmps-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmps-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmps-js.Tpo -c -o librpmjsm_la-rpmps-js.lo `test -f 'rpmps-js.c' || echo '$(srcdir)/'`rpmps-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmps-js.Tpo $(DEPDIR)/librpmjsm_la-rpmps-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmps-js.c' object='librpmjsm_la-rpmps-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmps-js.lo `test -f 'rpmps-js.c' || echo '$(srcdir)/'`rpmps-js.c + +librpmjsm_la-rpmseq-js.lo: rpmseq-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmseq-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmseq-js.Tpo -c -o librpmjsm_la-rpmseq-js.lo `test -f 'rpmseq-js.c' || echo '$(srcdir)/'`rpmseq-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmseq-js.Tpo $(DEPDIR)/librpmjsm_la-rpmseq-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmseq-js.c' object='librpmjsm_la-rpmseq-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmseq-js.lo `test -f 'rpmseq-js.c' || echo '$(srcdir)/'`rpmseq-js.c + +librpmjsm_la-rpmsm-js.lo: rpmsm-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmsm-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmsm-js.Tpo -c -o librpmjsm_la-rpmsm-js.lo `test -f 'rpmsm-js.c' || echo '$(srcdir)/'`rpmsm-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmsm-js.Tpo $(DEPDIR)/librpmjsm_la-rpmsm-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmsm-js.c' object='librpmjsm_la-rpmsm-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmsm-js.lo `test -f 'rpmsm-js.c' || echo '$(srcdir)/'`rpmsm-js.c + +librpmjsm_la-rpmsp-js.lo: rpmsp-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmsp-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmsp-js.Tpo -c -o librpmjsm_la-rpmsp-js.lo `test -f 'rpmsp-js.c' || echo '$(srcdir)/'`rpmsp-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmsp-js.Tpo $(DEPDIR)/librpmjsm_la-rpmsp-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmsp-js.c' object='librpmjsm_la-rpmsp-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmsp-js.lo `test -f 'rpmsp-js.c' || echo '$(srcdir)/'`rpmsp-js.c + +librpmjsm_la-rpmst-js.lo: rpmst-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmst-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmst-js.Tpo -c -o librpmjsm_la-rpmst-js.lo `test -f 'rpmst-js.c' || echo '$(srcdir)/'`rpmst-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmst-js.Tpo $(DEPDIR)/librpmjsm_la-rpmst-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmst-js.c' object='librpmjsm_la-rpmst-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmst-js.lo `test -f 'rpmst-js.c' || echo '$(srcdir)/'`rpmst-js.c + +librpmjsm_la-rpmsw-js.lo: rpmsw-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmsw-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmsw-js.Tpo -c -o librpmjsm_la-rpmsw-js.lo `test -f 'rpmsw-js.c' || echo '$(srcdir)/'`rpmsw-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmsw-js.Tpo $(DEPDIR)/librpmjsm_la-rpmsw-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmsw-js.c' object='librpmjsm_la-rpmsw-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmsw-js.lo `test -f 'rpmsw-js.c' || echo '$(srcdir)/'`rpmsw-js.c + +librpmjsm_la-rpmsx-js.lo: rpmsx-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmsx-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmsx-js.Tpo -c -o librpmjsm_la-rpmsx-js.lo `test -f 'rpmsx-js.c' || echo '$(srcdir)/'`rpmsx-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmsx-js.Tpo $(DEPDIR)/librpmjsm_la-rpmsx-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmsx-js.c' object='librpmjsm_la-rpmsx-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmsx-js.lo `test -f 'rpmsx-js.c' || echo '$(srcdir)/'`rpmsx-js.c + +librpmjsm_la-rpmsys-js.lo: rpmsys-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmsys-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmsys-js.Tpo -c -o librpmjsm_la-rpmsys-js.lo `test -f 'rpmsys-js.c' || echo '$(srcdir)/'`rpmsys-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmsys-js.Tpo $(DEPDIR)/librpmjsm_la-rpmsys-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmsys-js.c' object='librpmjsm_la-rpmsys-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmsys-js.lo `test -f 'rpmsys-js.c' || echo '$(srcdir)/'`rpmsys-js.c + +librpmjsm_la-rpmte-js.lo: rpmte-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmte-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmte-js.Tpo -c -o librpmjsm_la-rpmte-js.lo `test -f 'rpmte-js.c' || echo '$(srcdir)/'`rpmte-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmte-js.Tpo $(DEPDIR)/librpmjsm_la-rpmte-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmte-js.c' object='librpmjsm_la-rpmte-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmte-js.lo `test -f 'rpmte-js.c' || echo '$(srcdir)/'`rpmte-js.c + +librpmjsm_la-rpmts-js.lo: rpmts-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmts-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmts-js.Tpo -c -o librpmjsm_la-rpmts-js.lo `test -f 'rpmts-js.c' || echo '$(srcdir)/'`rpmts-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmts-js.Tpo $(DEPDIR)/librpmjsm_la-rpmts-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmts-js.c' object='librpmjsm_la-rpmts-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmts-js.lo `test -f 'rpmts-js.c' || echo '$(srcdir)/'`rpmts-js.c + +librpmjsm_la-rpmtxn-js.lo: rpmtxn-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmtxn-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmtxn-js.Tpo -c -o librpmjsm_la-rpmtxn-js.lo `test -f 'rpmtxn-js.c' || echo '$(srcdir)/'`rpmtxn-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmtxn-js.Tpo $(DEPDIR)/librpmjsm_la-rpmtxn-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmtxn-js.c' object='librpmjsm_la-rpmtxn-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmtxn-js.lo `test -f 'rpmtxn-js.c' || echo '$(srcdir)/'`rpmtxn-js.c + +librpmjsm_la-rpmxar-js.lo: rpmxar-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-rpmxar-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-rpmxar-js.Tpo -c -o librpmjsm_la-rpmxar-js.lo `test -f 'rpmxar-js.c' || echo '$(srcdir)/'`rpmxar-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-rpmxar-js.Tpo $(DEPDIR)/librpmjsm_la-rpmxar-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmxar-js.c' object='librpmjsm_la-rpmxar-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-rpmxar-js.lo `test -f 'rpmxar-js.c' || echo '$(srcdir)/'`rpmxar-js.c + +librpmjsm_la-syck-js.lo: syck-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-syck-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-syck-js.Tpo -c -o librpmjsm_la-syck-js.lo `test -f 'syck-js.c' || echo '$(srcdir)/'`syck-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-syck-js.Tpo $(DEPDIR)/librpmjsm_la-syck-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='syck-js.c' object='librpmjsm_la-syck-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-syck-js.lo `test -f 'syck-js.c' || echo '$(srcdir)/'`syck-js.c + +librpmjsm_la-uuid-js.lo: uuid-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -MT librpmjsm_la-uuid-js.lo -MD -MP -MF $(DEPDIR)/librpmjsm_la-uuid-js.Tpo -c -o librpmjsm_la-uuid-js.lo `test -f 'uuid-js.c' || echo '$(srcdir)/'`uuid-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librpmjsm_la-uuid-js.Tpo $(DEPDIR)/librpmjsm_la-uuid-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uuid-js.c' object='librpmjsm_la-uuid-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librpmjsm_la_CFLAGS) $(CFLAGS) -c -o librpmjsm_la-uuid-js.lo `test -f 'uuid-js.c' || echo '$(srcdir)/'`uuid-js.c + +rpmaug_module_la-rpmaug-js.lo: rpmaug-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmaug_module_la_CFLAGS) $(CFLAGS) -MT rpmaug_module_la-rpmaug-js.lo -MD -MP -MF $(DEPDIR)/rpmaug_module_la-rpmaug-js.Tpo -c -o rpmaug_module_la-rpmaug-js.lo `test -f 'rpmaug-js.c' || echo '$(srcdir)/'`rpmaug-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmaug_module_la-rpmaug-js.Tpo $(DEPDIR)/rpmaug_module_la-rpmaug-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmaug-js.c' object='rpmaug_module_la-rpmaug-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmaug_module_la_CFLAGS) $(CFLAGS) -c -o rpmaug_module_la-rpmaug-js.lo `test -f 'rpmaug-js.c' || echo '$(srcdir)/'`rpmaug-js.c + +rpmbc_module_la-rpmbc-js.lo: rpmbc-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmbc_module_la_CFLAGS) $(CFLAGS) -MT rpmbc_module_la-rpmbc-js.lo -MD -MP -MF $(DEPDIR)/rpmbc_module_la-rpmbc-js.Tpo -c -o rpmbc_module_la-rpmbc-js.lo `test -f 'rpmbc-js.c' || echo '$(srcdir)/'`rpmbc-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmbc_module_la-rpmbc-js.Tpo $(DEPDIR)/rpmbc_module_la-rpmbc-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmbc-js.c' object='rpmbc_module_la-rpmbc-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmbc_module_la_CFLAGS) $(CFLAGS) -c -o rpmbc_module_la-rpmbc-js.lo `test -f 'rpmbc-js.c' || echo '$(srcdir)/'`rpmbc-js.c + +rpmbf_module_la-rpmbf-js.lo: rpmbf-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmbf_module_la_CFLAGS) $(CFLAGS) -MT rpmbf_module_la-rpmbf-js.lo -MD -MP -MF $(DEPDIR)/rpmbf_module_la-rpmbf-js.Tpo -c -o rpmbf_module_la-rpmbf-js.lo `test -f 'rpmbf-js.c' || echo '$(srcdir)/'`rpmbf-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmbf_module_la-rpmbf-js.Tpo $(DEPDIR)/rpmbf_module_la-rpmbf-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmbf-js.c' object='rpmbf_module_la-rpmbf-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmbf_module_la_CFLAGS) $(CFLAGS) -c -o rpmbf_module_la-rpmbf-js.lo `test -f 'rpmbf-js.c' || echo '$(srcdir)/'`rpmbf-js.c + +rpmcudf_module_la-rpmcudf-js.lo: rpmcudf-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmcudf_module_la_CFLAGS) $(CFLAGS) -MT rpmcudf_module_la-rpmcudf-js.lo -MD -MP -MF $(DEPDIR)/rpmcudf_module_la-rpmcudf-js.Tpo -c -o rpmcudf_module_la-rpmcudf-js.lo `test -f 'rpmcudf-js.c' || echo '$(srcdir)/'`rpmcudf-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmcudf_module_la-rpmcudf-js.Tpo $(DEPDIR)/rpmcudf_module_la-rpmcudf-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmcudf-js.c' object='rpmcudf_module_la-rpmcudf-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmcudf_module_la_CFLAGS) $(CFLAGS) -c -o rpmcudf_module_la-rpmcudf-js.lo `test -f 'rpmcudf-js.c' || echo '$(srcdir)/'`rpmcudf-js.c + +rpmdb_module_la-rpmdb-js.lo: rpmdb-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdb_module_la_CFLAGS) $(CFLAGS) -MT rpmdb_module_la-rpmdb-js.lo -MD -MP -MF $(DEPDIR)/rpmdb_module_la-rpmdb-js.Tpo -c -o rpmdb_module_la-rpmdb-js.lo `test -f 'rpmdb-js.c' || echo '$(srcdir)/'`rpmdb-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmdb_module_la-rpmdb-js.Tpo $(DEPDIR)/rpmdb_module_la-rpmdb-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmdb-js.c' object='rpmdb_module_la-rpmdb-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdb_module_la_CFLAGS) $(CFLAGS) -c -o rpmdb_module_la-rpmdb-js.lo `test -f 'rpmdb-js.c' || echo '$(srcdir)/'`rpmdb-js.c + +rpmdbc_module_la-rpmdbc-js.lo: rpmdbc-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdbc_module_la_CFLAGS) $(CFLAGS) -MT rpmdbc_module_la-rpmdbc-js.lo -MD -MP -MF $(DEPDIR)/rpmdbc_module_la-rpmdbc-js.Tpo -c -o rpmdbc_module_la-rpmdbc-js.lo `test -f 'rpmdbc-js.c' || echo '$(srcdir)/'`rpmdbc-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmdbc_module_la-rpmdbc-js.Tpo $(DEPDIR)/rpmdbc_module_la-rpmdbc-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmdbc-js.c' object='rpmdbc_module_la-rpmdbc-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdbc_module_la_CFLAGS) $(CFLAGS) -c -o rpmdbc_module_la-rpmdbc-js.lo `test -f 'rpmdbc-js.c' || echo '$(srcdir)/'`rpmdbc-js.c + +rpmdbe_module_la-rpmdbe-js.lo: rpmdbe-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdbe_module_la_CFLAGS) $(CFLAGS) -MT rpmdbe_module_la-rpmdbe-js.lo -MD -MP -MF $(DEPDIR)/rpmdbe_module_la-rpmdbe-js.Tpo -c -o rpmdbe_module_la-rpmdbe-js.lo `test -f 'rpmdbe-js.c' || echo '$(srcdir)/'`rpmdbe-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmdbe_module_la-rpmdbe-js.Tpo $(DEPDIR)/rpmdbe_module_la-rpmdbe-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmdbe-js.c' object='rpmdbe_module_la-rpmdbe-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdbe_module_la_CFLAGS) $(CFLAGS) -c -o rpmdbe_module_la-rpmdbe-js.lo `test -f 'rpmdbe-js.c' || echo '$(srcdir)/'`rpmdbe-js.c + +rpmdc_module_la-rpmdc-js.lo: rpmdc-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdc_module_la_CFLAGS) $(CFLAGS) -MT rpmdc_module_la-rpmdc-js.lo -MD -MP -MF $(DEPDIR)/rpmdc_module_la-rpmdc-js.Tpo -c -o rpmdc_module_la-rpmdc-js.lo `test -f 'rpmdc-js.c' || echo '$(srcdir)/'`rpmdc-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmdc_module_la-rpmdc-js.Tpo $(DEPDIR)/rpmdc_module_la-rpmdc-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmdc-js.c' object='rpmdc_module_la-rpmdc-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdc_module_la_CFLAGS) $(CFLAGS) -c -o rpmdc_module_la-rpmdc-js.lo `test -f 'rpmdc-js.c' || echo '$(srcdir)/'`rpmdc-js.c + +rpmdig_module_la-rpmdig-js.lo: rpmdig-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdig_module_la_CFLAGS) $(CFLAGS) -MT rpmdig_module_la-rpmdig-js.lo -MD -MP -MF $(DEPDIR)/rpmdig_module_la-rpmdig-js.Tpo -c -o rpmdig_module_la-rpmdig-js.lo `test -f 'rpmdig-js.c' || echo '$(srcdir)/'`rpmdig-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmdig_module_la-rpmdig-js.Tpo $(DEPDIR)/rpmdig_module_la-rpmdig-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmdig-js.c' object='rpmdig_module_la-rpmdig-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdig_module_la_CFLAGS) $(CFLAGS) -c -o rpmdig_module_la-rpmdig-js.lo `test -f 'rpmdig-js.c' || echo '$(srcdir)/'`rpmdig-js.c + +rpmdir_module_la-rpmdir-js.lo: rpmdir-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdir_module_la_CFLAGS) $(CFLAGS) -MT rpmdir_module_la-rpmdir-js.lo -MD -MP -MF $(DEPDIR)/rpmdir_module_la-rpmdir-js.Tpo -c -o rpmdir_module_la-rpmdir-js.lo `test -f 'rpmdir-js.c' || echo '$(srcdir)/'`rpmdir-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmdir_module_la-rpmdir-js.Tpo $(DEPDIR)/rpmdir_module_la-rpmdir-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmdir-js.c' object='rpmdir_module_la-rpmdir-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmdir_module_la_CFLAGS) $(CFLAGS) -c -o rpmdir_module_la-rpmdir-js.lo `test -f 'rpmdir-js.c' || echo '$(srcdir)/'`rpmdir-js.c + +rpmds_module_la-rpmds-js.lo: rpmds-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmds_module_la_CFLAGS) $(CFLAGS) -MT rpmds_module_la-rpmds-js.lo -MD -MP -MF $(DEPDIR)/rpmds_module_la-rpmds-js.Tpo -c -o rpmds_module_la-rpmds-js.lo `test -f 'rpmds-js.c' || echo '$(srcdir)/'`rpmds-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmds_module_la-rpmds-js.Tpo $(DEPDIR)/rpmds_module_la-rpmds-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmds-js.c' object='rpmds_module_la-rpmds-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmds_module_la_CFLAGS) $(CFLAGS) -c -o rpmds_module_la-rpmds-js.lo `test -f 'rpmds-js.c' || echo '$(srcdir)/'`rpmds-js.c + +rpmfc_module_la-rpmfc-js.lo: rpmfc-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmfc_module_la_CFLAGS) $(CFLAGS) -MT rpmfc_module_la-rpmfc-js.lo -MD -MP -MF $(DEPDIR)/rpmfc_module_la-rpmfc-js.Tpo -c -o rpmfc_module_la-rpmfc-js.lo `test -f 'rpmfc-js.c' || echo '$(srcdir)/'`rpmfc-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmfc_module_la-rpmfc-js.Tpo $(DEPDIR)/rpmfc_module_la-rpmfc-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmfc-js.c' object='rpmfc_module_la-rpmfc-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmfc_module_la_CFLAGS) $(CFLAGS) -c -o rpmfc_module_la-rpmfc-js.lo `test -f 'rpmfc-js.c' || echo '$(srcdir)/'`rpmfc-js.c + +rpmfi_module_la-rpmfi-js.lo: rpmfi-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmfi_module_la_CFLAGS) $(CFLAGS) -MT rpmfi_module_la-rpmfi-js.lo -MD -MP -MF $(DEPDIR)/rpmfi_module_la-rpmfi-js.Tpo -c -o rpmfi_module_la-rpmfi-js.lo `test -f 'rpmfi-js.c' || echo '$(srcdir)/'`rpmfi-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmfi_module_la-rpmfi-js.Tpo $(DEPDIR)/rpmfi_module_la-rpmfi-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmfi-js.c' object='rpmfi_module_la-rpmfi-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmfi_module_la_CFLAGS) $(CFLAGS) -c -o rpmfi_module_la-rpmfi-js.lo `test -f 'rpmfi-js.c' || echo '$(srcdir)/'`rpmfi-js.c + +rpmfts_module_la-rpmfts-js.lo: rpmfts-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmfts_module_la_CFLAGS) $(CFLAGS) -MT rpmfts_module_la-rpmfts-js.lo -MD -MP -MF $(DEPDIR)/rpmfts_module_la-rpmfts-js.Tpo -c -o rpmfts_module_la-rpmfts-js.lo `test -f 'rpmfts-js.c' || echo '$(srcdir)/'`rpmfts-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmfts_module_la-rpmfts-js.Tpo $(DEPDIR)/rpmfts_module_la-rpmfts-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmfts-js.c' object='rpmfts_module_la-rpmfts-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmfts_module_la_CFLAGS) $(CFLAGS) -c -o rpmfts_module_la-rpmfts-js.lo `test -f 'rpmfts-js.c' || echo '$(srcdir)/'`rpmfts-js.c + +rpmgi_module_la-rpmgi-js.lo: rpmgi-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmgi_module_la_CFLAGS) $(CFLAGS) -MT rpmgi_module_la-rpmgi-js.lo -MD -MP -MF $(DEPDIR)/rpmgi_module_la-rpmgi-js.Tpo -c -o rpmgi_module_la-rpmgi-js.lo `test -f 'rpmgi-js.c' || echo '$(srcdir)/'`rpmgi-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmgi_module_la-rpmgi-js.Tpo $(DEPDIR)/rpmgi_module_la-rpmgi-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmgi-js.c' object='rpmgi_module_la-rpmgi-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmgi_module_la_CFLAGS) $(CFLAGS) -c -o rpmgi_module_la-rpmgi-js.lo `test -f 'rpmgi-js.c' || echo '$(srcdir)/'`rpmgi-js.c + +rpmhdr_module_la-rpmhdr-js.lo: rpmhdr-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmhdr_module_la_CFLAGS) $(CFLAGS) -MT rpmhdr_module_la-rpmhdr-js.lo -MD -MP -MF $(DEPDIR)/rpmhdr_module_la-rpmhdr-js.Tpo -c -o rpmhdr_module_la-rpmhdr-js.lo `test -f 'rpmhdr-js.c' || echo '$(srcdir)/'`rpmhdr-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmhdr_module_la-rpmhdr-js.Tpo $(DEPDIR)/rpmhdr_module_la-rpmhdr-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmhdr-js.c' object='rpmhdr_module_la-rpmhdr-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmhdr_module_la_CFLAGS) $(CFLAGS) -c -o rpmhdr_module_la-rpmhdr-js.lo `test -f 'rpmhdr-js.c' || echo '$(srcdir)/'`rpmhdr-js.c + +rpmio_module_la-rpmio-js.lo: rpmio-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmio_module_la_CFLAGS) $(CFLAGS) -MT rpmio_module_la-rpmio-js.lo -MD -MP -MF $(DEPDIR)/rpmio_module_la-rpmio-js.Tpo -c -o rpmio_module_la-rpmio-js.lo `test -f 'rpmio-js.c' || echo '$(srcdir)/'`rpmio-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmio_module_la-rpmio-js.Tpo $(DEPDIR)/rpmio_module_la-rpmio-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmio-js.c' object='rpmio_module_la-rpmio-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmio_module_la_CFLAGS) $(CFLAGS) -c -o rpmio_module_la-rpmio-js.lo `test -f 'rpmio-js.c' || echo '$(srcdir)/'`rpmio-js.c + +rpmiob_module_la-rpmiob-js.lo: rpmiob-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmiob_module_la_CFLAGS) $(CFLAGS) -MT rpmiob_module_la-rpmiob-js.lo -MD -MP -MF $(DEPDIR)/rpmiob_module_la-rpmiob-js.Tpo -c -o rpmiob_module_la-rpmiob-js.lo `test -f 'rpmiob-js.c' || echo '$(srcdir)/'`rpmiob-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmiob_module_la-rpmiob-js.Tpo $(DEPDIR)/rpmiob_module_la-rpmiob-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmiob-js.c' object='rpmiob_module_la-rpmiob-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmiob_module_la_CFLAGS) $(CFLAGS) -c -o rpmiob_module_la-rpmiob-js.lo `test -f 'rpmiob-js.c' || echo '$(srcdir)/'`rpmiob-js.c + +rpmmc_module_la-rpmmc-js.lo: rpmmc-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmc_module_la_CFLAGS) $(CFLAGS) -MT rpmmc_module_la-rpmmc-js.lo -MD -MP -MF $(DEPDIR)/rpmmc_module_la-rpmmc-js.Tpo -c -o rpmmc_module_la-rpmmc-js.lo `test -f 'rpmmc-js.c' || echo '$(srcdir)/'`rpmmc-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmmc_module_la-rpmmc-js.Tpo $(DEPDIR)/rpmmc_module_la-rpmmc-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmmc-js.c' object='rpmmc_module_la-rpmmc-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmc_module_la_CFLAGS) $(CFLAGS) -c -o rpmmc_module_la-rpmmc-js.lo `test -f 'rpmmc-js.c' || echo '$(srcdir)/'`rpmmc-js.c + +rpmmg_module_la-rpmmg-js.lo: rpmmg-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmg_module_la_CFLAGS) $(CFLAGS) -MT rpmmg_module_la-rpmmg-js.lo -MD -MP -MF $(DEPDIR)/rpmmg_module_la-rpmmg-js.Tpo -c -o rpmmg_module_la-rpmmg-js.lo `test -f 'rpmmg-js.c' || echo '$(srcdir)/'`rpmmg-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmmg_module_la-rpmmg-js.Tpo $(DEPDIR)/rpmmg_module_la-rpmmg-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmmg-js.c' object='rpmmg_module_la-rpmmg-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmg_module_la_CFLAGS) $(CFLAGS) -c -o rpmmg_module_la-rpmmg-js.lo `test -f 'rpmmg-js.c' || echo '$(srcdir)/'`rpmmg-js.c + +rpmmi_module_la-rpmmi-js.lo: rpmmi-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmi_module_la_CFLAGS) $(CFLAGS) -MT rpmmi_module_la-rpmmi-js.lo -MD -MP -MF $(DEPDIR)/rpmmi_module_la-rpmmi-js.Tpo -c -o rpmmi_module_la-rpmmi-js.lo `test -f 'rpmmi-js.c' || echo '$(srcdir)/'`rpmmi-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmmi_module_la-rpmmi-js.Tpo $(DEPDIR)/rpmmi_module_la-rpmmi-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmmi-js.c' object='rpmmi_module_la-rpmmi-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmi_module_la_CFLAGS) $(CFLAGS) -c -o rpmmi_module_la-rpmmi-js.lo `test -f 'rpmmi-js.c' || echo '$(srcdir)/'`rpmmi-js.c + +rpmmpf_module_la-rpmmpf-js.lo: rpmmpf-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmpf_module_la_CFLAGS) $(CFLAGS) -MT rpmmpf_module_la-rpmmpf-js.lo -MD -MP -MF $(DEPDIR)/rpmmpf_module_la-rpmmpf-js.Tpo -c -o rpmmpf_module_la-rpmmpf-js.lo `test -f 'rpmmpf-js.c' || echo '$(srcdir)/'`rpmmpf-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmmpf_module_la-rpmmpf-js.Tpo $(DEPDIR)/rpmmpf_module_la-rpmmpf-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmmpf-js.c' object='rpmmpf_module_la-rpmmpf-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmpf_module_la_CFLAGS) $(CFLAGS) -c -o rpmmpf_module_la-rpmmpf-js.lo `test -f 'rpmmpf-js.c' || echo '$(srcdir)/'`rpmmpf-js.c + +rpmmpw_module_la-rpmmpw-js.lo: rpmmpw-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmpw_module_la_CFLAGS) $(CFLAGS) -MT rpmmpw_module_la-rpmmpw-js.lo -MD -MP -MF $(DEPDIR)/rpmmpw_module_la-rpmmpw-js.Tpo -c -o rpmmpw_module_la-rpmmpw-js.lo `test -f 'rpmmpw-js.c' || echo '$(srcdir)/'`rpmmpw-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmmpw_module_la-rpmmpw-js.Tpo $(DEPDIR)/rpmmpw_module_la-rpmmpw-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmmpw-js.c' object='rpmmpw_module_la-rpmmpw-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmmpw_module_la_CFLAGS) $(CFLAGS) -c -o rpmmpw_module_la-rpmmpw-js.lo `test -f 'rpmmpw-js.c' || echo '$(srcdir)/'`rpmmpw-js.c + +rpmps_module_la-rpmps-js.lo: rpmps-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmps_module_la_CFLAGS) $(CFLAGS) -MT rpmps_module_la-rpmps-js.lo -MD -MP -MF $(DEPDIR)/rpmps_module_la-rpmps-js.Tpo -c -o rpmps_module_la-rpmps-js.lo `test -f 'rpmps-js.c' || echo '$(srcdir)/'`rpmps-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmps_module_la-rpmps-js.Tpo $(DEPDIR)/rpmps_module_la-rpmps-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmps-js.c' object='rpmps_module_la-rpmps-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmps_module_la_CFLAGS) $(CFLAGS) -c -o rpmps_module_la-rpmps-js.lo `test -f 'rpmps-js.c' || echo '$(srcdir)/'`rpmps-js.c + +rpmseq_module_la-rpmseq-js.lo: rpmseq-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmseq_module_la_CFLAGS) $(CFLAGS) -MT rpmseq_module_la-rpmseq-js.lo -MD -MP -MF $(DEPDIR)/rpmseq_module_la-rpmseq-js.Tpo -c -o rpmseq_module_la-rpmseq-js.lo `test -f 'rpmseq-js.c' || echo '$(srcdir)/'`rpmseq-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmseq_module_la-rpmseq-js.Tpo $(DEPDIR)/rpmseq_module_la-rpmseq-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmseq-js.c' object='rpmseq_module_la-rpmseq-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmseq_module_la_CFLAGS) $(CFLAGS) -c -o rpmseq_module_la-rpmseq-js.lo `test -f 'rpmseq-js.c' || echo '$(srcdir)/'`rpmseq-js.c + +rpmsm_module_la-rpmsm-js.lo: rpmsm-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsm_module_la_CFLAGS) $(CFLAGS) -MT rpmsm_module_la-rpmsm-js.lo -MD -MP -MF $(DEPDIR)/rpmsm_module_la-rpmsm-js.Tpo -c -o rpmsm_module_la-rpmsm-js.lo `test -f 'rpmsm-js.c' || echo '$(srcdir)/'`rpmsm-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmsm_module_la-rpmsm-js.Tpo $(DEPDIR)/rpmsm_module_la-rpmsm-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmsm-js.c' object='rpmsm_module_la-rpmsm-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsm_module_la_CFLAGS) $(CFLAGS) -c -o rpmsm_module_la-rpmsm-js.lo `test -f 'rpmsm-js.c' || echo '$(srcdir)/'`rpmsm-js.c + +rpmsp_module_la-rpmsp-js.lo: rpmsp-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsp_module_la_CFLAGS) $(CFLAGS) -MT rpmsp_module_la-rpmsp-js.lo -MD -MP -MF $(DEPDIR)/rpmsp_module_la-rpmsp-js.Tpo -c -o rpmsp_module_la-rpmsp-js.lo `test -f 'rpmsp-js.c' || echo '$(srcdir)/'`rpmsp-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmsp_module_la-rpmsp-js.Tpo $(DEPDIR)/rpmsp_module_la-rpmsp-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmsp-js.c' object='rpmsp_module_la-rpmsp-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsp_module_la_CFLAGS) $(CFLAGS) -c -o rpmsp_module_la-rpmsp-js.lo `test -f 'rpmsp-js.c' || echo '$(srcdir)/'`rpmsp-js.c + +rpmst_module_la-rpmst-js.lo: rpmst-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmst_module_la_CFLAGS) $(CFLAGS) -MT rpmst_module_la-rpmst-js.lo -MD -MP -MF $(DEPDIR)/rpmst_module_la-rpmst-js.Tpo -c -o rpmst_module_la-rpmst-js.lo `test -f 'rpmst-js.c' || echo '$(srcdir)/'`rpmst-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmst_module_la-rpmst-js.Tpo $(DEPDIR)/rpmst_module_la-rpmst-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmst-js.c' object='rpmst_module_la-rpmst-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmst_module_la_CFLAGS) $(CFLAGS) -c -o rpmst_module_la-rpmst-js.lo `test -f 'rpmst-js.c' || echo '$(srcdir)/'`rpmst-js.c + +rpmsw_module_la-rpmsw-js.lo: rpmsw-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsw_module_la_CFLAGS) $(CFLAGS) -MT rpmsw_module_la-rpmsw-js.lo -MD -MP -MF $(DEPDIR)/rpmsw_module_la-rpmsw-js.Tpo -c -o rpmsw_module_la-rpmsw-js.lo `test -f 'rpmsw-js.c' || echo '$(srcdir)/'`rpmsw-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmsw_module_la-rpmsw-js.Tpo $(DEPDIR)/rpmsw_module_la-rpmsw-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmsw-js.c' object='rpmsw_module_la-rpmsw-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsw_module_la_CFLAGS) $(CFLAGS) -c -o rpmsw_module_la-rpmsw-js.lo `test -f 'rpmsw-js.c' || echo '$(srcdir)/'`rpmsw-js.c + +rpmsx_module_la-rpmsx-js.lo: rpmsx-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsx_module_la_CFLAGS) $(CFLAGS) -MT rpmsx_module_la-rpmsx-js.lo -MD -MP -MF $(DEPDIR)/rpmsx_module_la-rpmsx-js.Tpo -c -o rpmsx_module_la-rpmsx-js.lo `test -f 'rpmsx-js.c' || echo '$(srcdir)/'`rpmsx-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmsx_module_la-rpmsx-js.Tpo $(DEPDIR)/rpmsx_module_la-rpmsx-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmsx-js.c' object='rpmsx_module_la-rpmsx-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsx_module_la_CFLAGS) $(CFLAGS) -c -o rpmsx_module_la-rpmsx-js.lo `test -f 'rpmsx-js.c' || echo '$(srcdir)/'`rpmsx-js.c + +rpmsys_module_la-rpmsys-js.lo: rpmsys-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsys_module_la_CFLAGS) $(CFLAGS) -MT rpmsys_module_la-rpmsys-js.lo -MD -MP -MF $(DEPDIR)/rpmsys_module_la-rpmsys-js.Tpo -c -o rpmsys_module_la-rpmsys-js.lo `test -f 'rpmsys-js.c' || echo '$(srcdir)/'`rpmsys-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmsys_module_la-rpmsys-js.Tpo $(DEPDIR)/rpmsys_module_la-rpmsys-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmsys-js.c' object='rpmsys_module_la-rpmsys-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmsys_module_la_CFLAGS) $(CFLAGS) -c -o rpmsys_module_la-rpmsys-js.lo `test -f 'rpmsys-js.c' || echo '$(srcdir)/'`rpmsys-js.c + +rpmte_module_la-rpmte-js.lo: rpmte-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmte_module_la_CFLAGS) $(CFLAGS) -MT rpmte_module_la-rpmte-js.lo -MD -MP -MF $(DEPDIR)/rpmte_module_la-rpmte-js.Tpo -c -o rpmte_module_la-rpmte-js.lo `test -f 'rpmte-js.c' || echo '$(srcdir)/'`rpmte-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmte_module_la-rpmte-js.Tpo $(DEPDIR)/rpmte_module_la-rpmte-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmte-js.c' object='rpmte_module_la-rpmte-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmte_module_la_CFLAGS) $(CFLAGS) -c -o rpmte_module_la-rpmte-js.lo `test -f 'rpmte-js.c' || echo '$(srcdir)/'`rpmte-js.c + +rpmts_module_la-rpmts-js.lo: rpmts-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmts_module_la_CFLAGS) $(CFLAGS) -MT rpmts_module_la-rpmts-js.lo -MD -MP -MF $(DEPDIR)/rpmts_module_la-rpmts-js.Tpo -c -o rpmts_module_la-rpmts-js.lo `test -f 'rpmts-js.c' || echo '$(srcdir)/'`rpmts-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmts_module_la-rpmts-js.Tpo $(DEPDIR)/rpmts_module_la-rpmts-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmts-js.c' object='rpmts_module_la-rpmts-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmts_module_la_CFLAGS) $(CFLAGS) -c -o rpmts_module_la-rpmts-js.lo `test -f 'rpmts-js.c' || echo '$(srcdir)/'`rpmts-js.c + +rpmtxn_module_la-rpmtxn-js.lo: rpmtxn-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmtxn_module_la_CFLAGS) $(CFLAGS) -MT rpmtxn_module_la-rpmtxn-js.lo -MD -MP -MF $(DEPDIR)/rpmtxn_module_la-rpmtxn-js.Tpo -c -o rpmtxn_module_la-rpmtxn-js.lo `test -f 'rpmtxn-js.c' || echo '$(srcdir)/'`rpmtxn-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmtxn_module_la-rpmtxn-js.Tpo $(DEPDIR)/rpmtxn_module_la-rpmtxn-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmtxn-js.c' object='rpmtxn_module_la-rpmtxn-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmtxn_module_la_CFLAGS) $(CFLAGS) -c -o rpmtxn_module_la-rpmtxn-js.lo `test -f 'rpmtxn-js.c' || echo '$(srcdir)/'`rpmtxn-js.c + +rpmxar_module_la-rpmxar-js.lo: rpmxar-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmxar_module_la_CFLAGS) $(CFLAGS) -MT rpmxar_module_la-rpmxar-js.lo -MD -MP -MF $(DEPDIR)/rpmxar_module_la-rpmxar-js.Tpo -c -o rpmxar_module_la-rpmxar-js.lo `test -f 'rpmxar-js.c' || echo '$(srcdir)/'`rpmxar-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmxar_module_la-rpmxar-js.Tpo $(DEPDIR)/rpmxar_module_la-rpmxar-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rpmxar-js.c' object='rpmxar_module_la-rpmxar-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmxar_module_la_CFLAGS) $(CFLAGS) -c -o rpmxar_module_la-rpmxar-js.lo `test -f 'rpmxar-js.c' || echo '$(srcdir)/'`rpmxar-js.c + +syck_module_la-syck-js.lo: syck-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(syck_module_la_CFLAGS) $(CFLAGS) -MT syck_module_la-syck-js.lo -MD -MP -MF $(DEPDIR)/syck_module_la-syck-js.Tpo -c -o syck_module_la-syck-js.lo `test -f 'syck-js.c' || echo '$(srcdir)/'`syck-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/syck_module_la-syck-js.Tpo $(DEPDIR)/syck_module_la-syck-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='syck-js.c' object='syck_module_la-syck-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(syck_module_la_CFLAGS) $(CFLAGS) -c -o syck_module_la-syck-js.lo `test -f 'syck-js.c' || echo '$(srcdir)/'`syck-js.c + +uuid_module_la-uuid-js.lo: uuid-js.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uuid_module_la_CFLAGS) $(CFLAGS) -MT uuid_module_la-uuid-js.lo -MD -MP -MF $(DEPDIR)/uuid_module_la-uuid-js.Tpo -c -o uuid_module_la-uuid-js.lo `test -f 'uuid-js.c' || echo '$(srcdir)/'`uuid-js.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/uuid_module_la-uuid-js.Tpo $(DEPDIR)/uuid_module_la-uuid-js.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uuid-js.c' object='uuid_module_la-uuid-js.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uuid_module_la_CFLAGS) $(CFLAGS) -c -o uuid_module_la-uuid-js.lo `test -f 'uuid-js.c' || echo '$(srcdir)/'`uuid-js.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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 +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(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 + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(pkgbindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ + clean-noinstLTLIBRARIES clean-pkgbinPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-moduleLTLIBRARIES install-pkgbinPROGRAMS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-moduleLTLIBRARIES uninstall-pkgbinPROGRAMS + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ + clean-generic clean-libtool clean-moduleLTLIBRARIES \ + clean-noinstLTLIBRARIES clean-pkgbinPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-moduleLTLIBRARIES install-pdf install-pdf-am \ + install-pkgbinPROGRAMS install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-moduleLTLIBRARIES \ + uninstall-pkgbinPROGRAMS + + +.PHONY: lint +lint: + $(LINT) $(DEFS) $(INCLUDES) $(librpmjs_la_sources) + +check-local: ngsr + +.PHONY: lcov-reset # run lcov from scratch, always +lcov-reset: + make lcov-run + make lcov-report + +# run lcov from scratch if the dir is not there +lcov: + make lcov-reset + +.PHONY: lcov-run # reset run coverage tests +lcov-run: + @-rm -rf lcov + find .. -name "*.gcda" -exec rm {} \; + make check + +.PHONY: lcov-report # generate report based on current coverage data +lcov-report: + mkdir lcov + -lcov -d ./src -d . --capture --output-file lcov/lcov.info + lcov -l lcov/lcov.info | grep -v "`cd $(top_srcdir) && pwd`" | cut -d: -f1 > lcov/remove + lcov -r lcov/lcov.info `cat lcov/remove` > lcov/lcov.cleaned.info + rm lcov/remove + mv lcov/lcov.cleaned.info lcov/lcov.info + genhtml -t "$(PACKAGE_STRING)" -o lcov lcov/lcov.info + +.PHONY: lcov-upload +lcov-upload: lcov + mkdir -p /var/ftp/pub/jbj/rpm-$(VERSION)-lcov + tar -C lcov -cf - . | (cd /var/ftp/pub/jbj/rpm-$(VERSION)-lcov; tar xf -) +# rsync -rvz -e ssh --delete lcov/* ??? + +# 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/rpm-5.4.9/js/gsr.c b/rpm-5.4.9/js/gsr.c new file mode 100644 index 0000000..bc9ae82 --- /dev/null +++ b/rpm-5.4.9/js/gsr.c @@ -0,0 +1,260 @@ + +#include "system.h" + +#include +#include +#include +#include + +#define _RPMJS_INTERNAL +#include + +#include + +#include "debug.h" + +extern const char * __progname; + +/*==============================================================*/ + +#define F_ISSET(_js, _FLAG) ((_js)->flags & RPMJS_FLAGS_##_FLAG) + +#define _RPMJS_OPTIONS \ + (RPMJS_FLAGS_STRICT | RPMJS_FLAGS_RELIMIT | RPMJS_FLAGS_ANONFUNFIX | RPMJS_FLAGS_JIT) + +extern struct rpmjs_s _rpmgsr; + +static const char * Icode; /* String with JavaScript program in it */ +static const char * Ifn; /* Filename with JavaScript program in it */ +static int _debug; /* 0 = no debug, bigger = more debug */ +static int _loglvl; + +/*@unchecked@*/ +static const char * _acknack = "\ +function ack(cmd, expected) {\n\ + try {\n\ + actual = eval(cmd);\n\ + } catch(e) {\n\ + print(\"NACK: ack(\"+cmd+\")\tcaught '\"+e+\"'\");\n\ + return;\n\ + }\n\ + if (actual != expected && expected != undefined)\n\ + print(\"NACK: ack(\"+cmd+\")\tgot '\"+actual+\"' not '\"+expected+\"'\");\n\ + else if (loglvl)\n\ + print(\" ack(\"+cmd+\")\tgot '\"+actual+\"'\");\n\ +}\n\ +function nack(cmd, expected) {\n\ + try {\n\ + actual = eval(cmd);\n\ + } catch(e) {\n\ + print(\" ACK: nack(\"+cmd+\")\tcaught '\"+e+\"'\");\n\ + return;\n\ + }\n\ + if (actual == expected)\n\ + print(\" ACK: nack(\"+cmd+\")\tgot '\"+actual+\"' not '\"+expected+\"'\");\n\ + else if (loglvl)\n\ + print(\" nack(\"+cmd+\")\tgot '\"+actual+\"'\");\n\ +}\n\ +"; + +/*==============================================================*/ + +/** GPSEE uses panic() to panic, expects embedder to provide */ +void __attribute__ ((noreturn)) panic(const char *message); +void __attribute__ ((noreturn)) panic(const char *message) +{ + rpmlog(RPMLOG_EMERG, "%s: Fatal Error: %s\n", __progname, message); + exit(1); +} + +static void +rpmjsAppendTest(const char * fn) +{ + char * str; + + if (Icode == NULL) { + char dstr[32]; + char lstr[32]; + + sprintf(dstr, "%d", _debug); + sprintf(lstr, "%d", _loglvl); + Icode = rpmExpand( + "var debug = ", dstr, ";\n" + "var loglvl = ", lstr, ";\n", + _acknack, NULL); + } + + str = rpmExpand(Icode, + "\ntry { require('system').include('", fn, + "'); } catch(e) { print(e); print(e.stack); throw e; }", NULL); + Icode = _free(Icode); + Icode = str; + +} + +static void rpmgsrArgCallback(poptContext con, + /*@unused@*/ enum poptCallbackReason reason, + const struct poptOption * opt, /*@unused@*/ const char * arg, + /*@unused@*/ void * data) + /*@globals fileSystem @*/ + /*@modifies fileSystem @*/ +{ + rpmjs js = &_rpmgsr; + + /* XXX avoid accidental collisions with POPT_BIT_SET for flags */ + if (opt->arg == NULL) + switch (opt->val) { + case 'F': + js->flags |= RPMJS_FLAGS_SKIPSHEBANG; + Ifn = xstrdup(arg); + break; + case 'T': + rpmjsAppendTest(arg); + break; + case 'd': + _debug++; + _loglvl = 1; /* XXX -d imlies loglvl = 1 */ + _rpmjs_zeal = 2; /* XXX -d implies GCzeal = 2 */ + break; + case 'z': + _rpmjs_zeal++; + break; + default: + fprintf(stderr, _("%s: Unknown option -%c\n"), __progname, opt->val); + poptPrintUsage(con, stderr, 0); +/*@-exitarg@*/ + exit(2); +/*@=exitarg@*/ + /*@notreached@*/ break; + } +} + +static struct poptOption _gsrOptionsTable[] = { +/*@-type@*/ /* FIX: cast? */ + { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, + rpmgsrArgCallback, 0, NULL, NULL }, +/*@=type@*/ + + { NULL, 'c', POPT_ARG_STRING, &Icode, 0, + N_("Specifies literal JavaScript code to execute"), N_(" code") }, + { NULL, 'f', POPT_ARG_STRING, &Ifn, 0, + N_("Specifies the filename containing code to run"), N_(" filename") }, + { NULL, 'F', POPT_ARG_STRING, NULL, 'F', + N_("Like -f, but skip shebang if present"), N_(" filename") }, + { "test", 'T', POPT_ARG_STRING, NULL, 'T', + N_("Like -f, but prepend ack() when including"), N_(" filename") }, + + /* XXX non-functional in GPSEE gsr atm */ + { "noexec", 'n', POPT_BIT_SET, &_rpmgsr.flags, RPMJS_FLAGS_NOEXEC, + N_("Engine will load and parse, but not run, the script"), NULL }, + + { "debug", 'd', POPT_ARG_NONE|POPT_ARGFLAG_DOC_HIDDEN, NULL, 'd', + N_("Increase debugging"), NULL }, + { "zeal", 'z', POPT_ARG_NONE, NULL, 'z', + N_("Increase GC Zealousness"), NULL }, + + POPT_TABLEEND +}; + +extern struct poptOption rpmjsIPoptTable[]; + +static struct poptOption _optionsTable[] = { +/*@-type@*/ /* FIX: cast? */ + { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, + rpmgsrArgCallback, 0, NULL, NULL }, +/*@=type@*/ + + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, _gsrOptionsTable, 0, + N_("Command options:"), NULL }, + + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmjsIPoptTable, 0, + N_("JS interpreter options:"), NULL }, + + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0, + N_("Common options for all rpm executables:"), NULL }, + + POPT_AUTOALIAS + POPT_AUTOHELP + + POPT_TABLEEND +}; + +static struct poptOption *optionsTable = &_optionsTable[0]; + +/*==============================================================*/ + +int main(int argc, char *argv[]) +{ + poptContext optCon; + rpmjs js = &_rpmgsr; + char *const * Iargv; /* Becomes arguments array in JS program */ + const char * result = NULL; + rpmRC rc; + int ac = 0; + int ec = 1; /* assume failure */ + + js->flags = _rpmjs_options | _RPMJS_OPTIONS; + +#ifdef NOTYET + _rpmcli_popt_context_flags = POPT_CONTEXT_POSIXMEHARDER; +#endif + optCon = rpmcliInit(argc, argv, optionsTable); + + /* Add files from CLI. */ + Iargv = (char *const *)poptGetArgs(optCon); + ac = argvCount((ARGV_t)Iargv); + + switch (ac) { + case 0: + if (Icode || Ifn) + break; + /*@fallthrough@*/ + default: + poptPrintUsage(optCon, stderr, 0); + goto exit; + /*@notreached@*/ break; + } + + js = rpmjsNew((const char **)Iargv, js->flags); + + /* Run JavaScript specified with -c */ + if (Icode) { + rc = rpmjsRun(js, Icode, &result); + + if (result != NULL && *result != '\0') { + fprintf(stdout, "%s\n", result); + fflush(stdout); + } + + ec = (rc == RPMRC_OK ? 0 : 1); + goto finish; + } + + /* Run JavaScript specified with -f */ + if (ac != 0) /* XXX FIXME */ + js->flags |= RPMJS_FLAGS_SKIPSHEBANG; + + result = NULL; + switch ((rc = rpmjsRunFile(js, Ifn, &result))) { + case RPMRC_FAIL: + rpmlog(RPMLOG_ERR, "%s: Unable to open' script '%s'! (%s)\n", + __progname, Ifn, result); + result = _free(result); + ec = 1; + break; + default: + ec = -rc; /* XXX hack tp get I->exitCode into ec */ + break; + } + +finish: + js = rpmjsFree(js); + +exit: + Icode = _free(Icode); + Ifn = _free(Ifn); + + optCon = rpmcliFini(optCon); + + return ec; +} diff --git a/rpm-5.4.9/js/legacy-sol.cudf b/rpm-5.4.9/js/legacy-sol.cudf new file mode 100644 index 0000000..4bb6084 --- /dev/null +++ b/rpm-5.4.9/js/legacy-sol.cudf @@ -0,0 +1,30 @@ +package: car +version: 1 +depends: engine, wheel, door, battery +installed: true + +package: battery +version: 3 +provides: huge-battery +installed: true + +package: wheel +version: 3 +conflicts: wheel +installed: true + +package: door +version: 1 +conflicts: door +installed: true + +package: bicycle +version: 7 +installed: true + +package: electric-engine +version: 1 +depends: solar-collector | huge-battery +provides: engine +conflicts: engine, electric-engine +installed: true diff --git a/rpm-5.4.9/js/legacy.cudf b/rpm-5.4.9/js/legacy.cudf new file mode 100644 index 0000000..2cd03cf --- /dev/null +++ b/rpm-5.4.9/js/legacy.cudf @@ -0,0 +1,117 @@ +preamble: +property: suite: enum[stable,testing,unstable] = [stable], + bugs: int = [0], + description: string = ["no description"] +univ-checksum: 8c6d8b4d0cf7027cd523ad095d6408b4901ac31c +status-checksum: 6936ce910eb716ad97190393f80c14ab04d95b3d +req-checksum: 17259225eaf63642f9ab99a627b9857a5b27c5f7 + +package: car +version: 1 +depends: engine, wheel, door, battery +installed: true +description: 4-wheeled, motor-powered vehicle + +package: bicycle +version: 7 +description: 2-wheeled, "pedal-powered" vehicle + +package: gasoline-engine +version: 1 +depends: turbo +provides: engine +conflicts: engine, gasoline-engine +installed: true + +package: gasoline-engine +version: 2 +provides: engine +conflicts: engine, gasoline-engine +suite: testing + +package: electric-engine +version: 1 +depends: solar-collector | huge-battery +provides: engine +conflicts: engine, electric-engine +bugs: 12 + +package: electric-engine +version: 2 +depends: solar-collector | huge-battery +provides: engine +conflicts: engine, electric-engine +suite: unstable +bugs: 180 + +package: solar-collector +version: 1 + +package: battery +version: 3 +provides: huge-battery +installed: true + +package: wheel +version: 2 +conflicts: wheel +installed: true +suite: stable + +package: wheel +version: 3 +conflicts: wheel +suite: testing + +package: door +version: 1 +conflicts: door +installed: true + +package: door +version: 2 +depends: window +conflicts: door +suite: unstable + +package: turbo +version: 1 +installed: true + +package: tire +version: 1 +conflicts: tire + +package: tire +version: 2 +conflicts: tire +suite: testing + +package: window +version: 1 +conflicts: window + +package: window +version: 2 +depends: glass = 1 +conflicts: window +suite: testing + +package: window +version: 3 +depends: glass = 2 +conflicts: window +suite: unstable + +package: glass +version: 1 +conflicts: glass + +package: glass +version: 2 +conflicts: glass, tire = 2 +suite: testing + +request: http://www.example.org/8f46e388-042f-415e-8aab-df4eeb974444.dudf +install: bicycle, electric-engine = 1 +upgrade: door, wheel > 2 diff --git a/rpm-5.4.9/js/ngsr.c b/rpm-5.4.9/js/ngsr.c new file mode 100644 index 0000000..45e3f9f --- /dev/null +++ b/rpm-5.4.9/js/ngsr.c @@ -0,0 +1,281 @@ +#include "system.h" + +#include +#include +#include +#include + +#define _RPMJS_INTERNAL +#include + +#include "gpsee.h" + +#define xstr(s) str(s) +#define str(s) #s + +#include "debug.h" + +extern const char * __progname; + +/*==============================================================*/ + +#define F_ISSET(_flags, _FLAG) ((_flags) & RPMJS_FLAGS_##_FLAG) + +static const char * Icode; /* String with JavaScript program in it */ +static const char * Ifn; /* Filename with JavaScript program in it */ +static int verbosity; /* 0 = no debug, bigger = more debug */ + +/*==============================================================*/ + +/** GPSEE uses panic() to panic, expects embedder to provide */ +void __attribute__ ((noreturn)) panic(const char *message) +{ + rpmlog(RPMLOG_EMERG, "Fatal Error: %s\n", message); + exit(EXIT_FAILURE); +} + +/*==============================================================*/ +static void rpmjsArgCallback(poptContext con, + /*@unused@*/ enum poptCallbackReason reason, + const struct poptOption * opt, /*@unused@*/ const char * arg, + /*@unused@*/ void * data) + /*@globals fileSystem @*/ + /*@modifies fileSystem @*/ +{ + rpmjs js = &_rpmjs; + + /* XXX avoid accidental collisions with POPT_BIT_SET for flags */ + if (opt->arg == NULL) + switch (opt->val) { + case 'F': + js->flags |= RPMJS_FLAGS_SKIPSHEBANG; + Ifn = xstrdup(arg); + break; + default: + fprintf(stderr, _("%s: Unknown option -%c\n"), __progname, opt->val); + poptPrintUsage(con, stderr, 0); + exit(EXIT_FAILURE); + /*@notreached@*/ break; + } +} + +static struct poptOption _gsrOptionsTable[] = { +/*@-type@*/ /* FIX: cast? */ + { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, + rpmjsArgCallback, 0, NULL, NULL }, +/*@=type@*/ + + { NULL, 'c', POPT_ARG_STRING, &Icode, 0, + N_("Specifies literal JavaScript code to execute"), N_("code") }, + { NULL, 'f', POPT_ARG_STRING, &Ifn, 0, + N_("Specifies the filename containing code to run"), N_("filename") }, + { NULL, 'F', POPT_ARG_STRING, NULL, 'F', + N_("Like -f, but skip shebang if present"), N_("filename") }, + { NULL, 'h', POPT_ARG_NONE, NULL, 'h', + N_("Display this help"), NULL }, + { "noexec", 'n', POPT_BIT_SET, &_rpmjs.flags, RPMJS_FLAGS_NOEXEC, + N_("Engine will load and parse, but not run, the script"), NULL }, + + POPT_TABLEEND +}; + +extern struct poptOption rpmjsIPoptTable[]; /* XXX in rpmjs.h? */ + +static struct poptOption _optionsTable[] = { +/*@-type@*/ /* FIX: cast? */ + { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, + rpmjsArgCallback, 0, NULL, NULL }, +/*@=type@*/ + + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, _gsrOptionsTable, 0, + N_("Command options:"), NULL }, + + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmjsIPoptTable, 0, + N_("JS interpreter options:"), NULL }, + + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioAllPoptTable, 0, + N_("Common options for all rpmio executables:"), NULL }, + + POPT_AUTOALIAS + POPT_AUTOHELP + POPT_TABLEEND +}; + +static struct poptOption *optionsTable = &_optionsTable[0]; +/*==============================================================*/ + +int main(int argc, char *argv[]) +{ + poptContext optCon; + rpmjs js; + char *const * Iargv = NULL; /* Becomes arguments array in JS program */ + const char * result = NULL; + int ac = 0; + int ec = 1; /* assume failure */ +rpmRC ret; + + void *stackBasePtr = NULL; + gpsee_interpreter_t * I = NULL; +#ifdef GPSEE_DEBUGGER +JSDContext *jsdc; +#endif + + _rpmjs.flags = _rpmjs_options; /* XXX necessary? */ + + gpsee_setVerbosity(isatty(STDERR_FILENO) ? GSR_PREPROGRAM_TTY_VERBOSITY + : GSR_PREPROGRAM_NOTTY_VERBOSITY); + +#ifdef NOTYET /* XXX original gsr is solaris -> *BSDish */ + _rpmio_popt_context_flags = POPT_CONTEXT_POSIXMEHARDER; +#endif + optCon = rpmioInit(argc, argv, optionsTable); + + /* Add files from CLI. */ + Iargv = (char *const *)poptGetArgs(optCon); + ac = argvCount((ARGV_t)Iargv); + + switch (ac) { + case 0: + if (Icode || Ifn) + break; + /*@fallthrough@*/ + default: + poptPrintUsage(optCon, stderr, 0); + goto exit; + /*@notreached@*/ break; + } + + if (F_ISSET(_rpmjs.flags, NOUTF8) || getenv("GPSEE_NO_UTF8_C_STRINGS")) { + JS_DestroyRuntime(JS_NewRuntime(1024)); + putenv((char *) "GPSEE_NO_UTF8_C_STRINGS=1"); + } + + js = rpmjsNew((char **)Iargv, _rpmjs.flags); + I = js->I; + +#if defined(GPSEE_DEBUGGER) + jsdc = gpsee_initDebugger(I->cx, I->realm, DEBUGGER_JS); +#endif + /* XXX set from macro? */ + gpsee_setThreadStackLimit(I->cx, &stackBasePtr, strtol("0x80000", NULL, 0)); + + if (verbosity < GSR_MIN_TTY_VERBOSITY && isatty(STDERR_FILENO)) + verbosity = GSR_MIN_TTY_VERBOSITY; + + if (gpsee_verbosity(0) < verbosity) + gpsee_setVerbosity(verbosity); + + /* Run JavaScript specified with -c */ + if (Icode) { + const char * result = NULL; + rpmRC rc = rpmjsRun(js, Icode, &result); + ec = (rc == RPMRC_OK ? 0 : 1); + goto finish; + } + + /* Pre-compile JavaScript specified with -f */ +#if !defined(SYSTEM_GSR) +#define SYSTEM_GSR "/usr/bin/gsr" +#endif + if (argv[0][0] == '/' && strcmp(argv[0], SYSTEM_GSR)) { + const char * preloadfn = rpmGetPath(dirname(argv[0]), + "/.", basename(argv[0]), "_preload", NULL); + + /* XXX assert? */ + if (!(preloadfn && *preloadfn)) { + rpmlog(RPMLOG_EMERG, + "%s: Unable to create preload script filename!\n", __progname); + preloadfn = _free(preloadfn); + goto finish; + } + + errno = 0; + if (Access(preloadfn, F_OK) == 0) { + jsval v; + JSScript *script; + JSObject *scrobj; + + if (!gpsee_compileScript(I->cx, preloadfn, + NULL, NULL, &script, I->realm->globalObject, &scrobj)) + { + rpmlog(RPMLOG_EMERG, + "%s: Unable to compile preload script '%s'\n", + __progname, preloadfn); + preloadfn = _free(preloadfn); + goto finish; + } + preloadfn = _free(preloadfn); + + if (!script || !scrobj) + goto finish; + + if (!F_ISSET(js->flags, NOEXEC)) { + JS_AddNamedObjectRoot(I->cx, &scrobj, "preload_scrobj"); + if (JS_ExecuteScript(I->cx, I->realm->globalObject, script, &v) == JS_FALSE) + { + if (JS_IsExceptionPending(I->cx)) + I->grt->exitType = et_exception; + JS_ReportPendingException(I->cx); + } + JS_RemoveObjectRoot(I->cx, &scrobj); + v = JSVAL_NULL; + } + } + + if (I->grt->exitType & et_exception) + goto finish; + } + + /* Setup for main-script running -- cancel preprogram verbosity and use our own error reporting system in gsr that does not use error reporter */ + gpsee_setVerbosity(verbosity); + JS_SetOptions(I->cx, JS_GetOptions(I->cx) | JSOPTION_DONT_REPORT_UNCAUGHT); + + if (Ifn == NULL) { + ec = Icode ? 0 : 1; + goto finish; + } + + /* Run (pre-compiled) JavaScript specified with -f */ + if (ac != 0) /* XXX FIXME */ + js->flags |= RPMJS_FLAGS_SKIPSHEBANG; + + ret = rpmjsRunFile(js, Ifn, Iargv, &result); + switch (ret) { + default: + rpmlog(RPMLOG_NOTICE, "%s: Unable to open' script '%s'! (%s)\n", + __progname, Ifn, result); + result = _free(result); + ec = ((int)ret < 0 ? -ret : ret); + break; + case RPMRC_OK: + /* XXX print result? */ + ec = ret; + break; + } + +finish: +#ifdef GPSEE_DEBUGGER + gpsee_finiDebugger(jsdc); +#endif + js = rpmjsFree(js); + +exit: + Icode = _free(Icode); + Ifn = _free(Ifn); + + optCon = rpmioFini(optCon); + + return ec; +} + +#ifdef GPSEE_DEBUGGER +/** + * Entry point for native-debugger debugging. Set this function as a break point + * in your native-language debugger debugging gsrdb, and you can set breakpoints + * on JSNative (and JSFastNative) functions from the gsrdb user interface. + */ +extern void __attribute__ ((noinline)) gpsee_breakpoint(void) +{ + return; +} +#endif diff --git a/rpm-5.4.9/js/rpm-js.h b/rpm-5.4.9/js/rpm-js.h new file mode 100644 index 0000000..b3d2736 --- /dev/null +++ b/rpm-5.4.9/js/rpm-js.h @@ -0,0 +1,47 @@ +#ifndef H_RPM_JS +#define H_RPM_JS + +/** + * \file js/rpm-js.h + */ + +#include +#include + +#include +#include + +#define XP_UNIX 1 +#include "jsapi.h" + +/* XXX wartlets */ +JSObject * +js_NewDateObject(JSContext* cx, int year, int mon, int mday, + int hour, int min, int sec); + +#ifndef JS_FS +#define JS_FS(name,call,nargs,flags,extra) \ + {name, call, nargs, flags, extra} +#endif +#ifndef JS_FS_END +#define JS_FS_END JS_FS(NULL,NULL,0,0) +#endif + +#if defined(WITH_GPSEE) +#define GPSEE_MODULE_WRAP(_rpmfoo_, _Class_, _unloadok) \ +const char * _rpmfoo_##_InitModule(JSContext *cx, JSObject *moduleObject); \ +const char * _rpmfoo_##_InitModule(JSContext *cx, JSObject *moduleObject) \ +{ \ + return(rpmjs_Init##_Class_##Class(cx, moduleObject) \ + ? "gpsee.module.org.rpm5."#_Class_ : NULL); \ +} \ +JSBool _rpmfoo_##_FiniModule(JSContext *cx, JSObject *moduleObject); \ +JSBool _rpmfoo_##_FiniModule(JSContext *cx, JSObject *moduleObject) \ +{ \ + return _unloadok; /* Safe to unload? */ \ +} +#else +#define GPSEE_MODULE_WRAP(_rpmfoo_, _Class_, _unloadok) +#endif + +#endif /* H_RPM_JS */ diff --git a/rpm-5.4.9/js/rpmaug-js.c b/rpm-5.4.9/js/rpmaug-js.c new file mode 100644 index 0000000..bf9a2bf --- /dev/null +++ b/rpm-5.4.9/js/rpmaug-js.c @@ -0,0 +1,617 @@ +/** \ingroup js_c + * \file js/rpmaug-js.c + */ + +#include "system.h" + +#include "rpmaug-js.h" +#include "rpmjs-debug.h" + +#include +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +#define rpmaug_addprop JS_PropertyStub +#define rpmaug_delprop JS_PropertyStub +#define rpmaug_convert JS_ConvertStub + +#define AUGEAS_META_TREE "/augeas" +/*@unchecked@*/ +static const char _defvar[] = AUGEAS_META_TREE "/version/defvar"; + +/* --- helpers */ + +/* --- Object methods */ +/* XXX does aug_defnode() need binding? */ +/* XXX unclear whether aug.defvar("foo", "bar") or aug.foo = "bar" is better */ +static JSBool +rpmaug_defvar(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmaugClass, NULL); + rpmaug aug = ptr; + JSBool ok = JS_FALSE; + const char * _name = NULL; + const char * _expr = NULL; + +_METHOD_DEBUG_ENTRY(_debug); + + /* XXX note optional EXPR. If EXPR is NULL, then NAME is deleted. */ + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s/s", &_name, &_expr))) + goto exit; + + switch (rpmaugDefvar(aug, _name, _expr)) { + default: + case 0: /* failure (but success if EXPR was NULL?) */ + case 1: /* success */ + /* XXX return NAME or EXPR on success? or bool for success/failure? */ + /* XXX hmmm, bool and string mixed returns. */ + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _name)); + break; + } + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmaug_get(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmaugClass, NULL); + rpmaug aug = ptr; + JSBool ok = JS_FALSE; + const char * _path = NULL; + const char * _value = NULL; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_path))) + goto exit; + + switch (rpmaugGet(aug, _path, &_value)) { + case 1: /* found */ + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _value)); +#ifdef NOTYET + _value = _free(_value); +#endif + break; + default: + case 0: /* not found */ + case -1: /* multiply defined */ + *vp = JSVAL_VOID; + break; + } + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmaug_set(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmaugClass, NULL); + rpmaug aug = ptr; + JSBool ok = JS_FALSE; + const char * _path = NULL; + const char * _value = NULL; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "ss", &_path, &_value))) + goto exit; + + switch (rpmaugSet(aug, _path, _value)) { + case 0: /* found */ + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _value)); + break; + default: + case -1: /* multiply defined */ + *vp = JSVAL_VOID; + break; + } + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmaug_insert(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmaugClass, NULL); + rpmaug aug = ptr; + JSBool ok = JS_FALSE; + const char * _path = NULL; + const char * _label = NULL; + int _before; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "ssi", &_path, &_label, &_before))) + goto exit; + + switch (rpmaugInsert(aug, _path, _label, _before)) { + case 0: /* success */ + *vp = JSVAL_TRUE; + break; + default: + case -1: /* failure */ + *vp = JSVAL_FALSE; + break; + } + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmaug_rm(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmaugClass, NULL); + rpmaug aug = ptr; + JSBool ok = JS_FALSE; + const char * _path = NULL; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_path))) + goto exit; + + /* XXX rpmaug_rm() returns number of deleted nodes. */ + *vp = INT_TO_JSVAL(rpmaugRm(aug, _path)); + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmaug_mv(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmaugClass, NULL); + rpmaug aug = ptr; + JSBool ok = JS_FALSE; + const char * _src = NULL; + const char * _dst = NULL; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "ss", &_src, &_dst))) + goto exit; + + switch (rpmaugMv(aug, _src, _dst)) { + case 0: /* success */ + *vp = JSVAL_TRUE; + break; + default: + case -1: /* failure */ + *vp = JSVAL_FALSE; + break; + } + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmaug_match(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmaugClass, NULL); + rpmaug aug = ptr; + JSBool ok = JS_FALSE; + const char * _path = NULL; + char ** _matches = NULL; + int nmatches; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_path))) + goto exit; + + nmatches = rpmaugMatch(aug, _path, &_matches); + if (nmatches <= 0) { /* not found */ + *vp = JSVAL_VOID; + goto exit; + } else { + JSObject *o; + jsval v; + int i; + *vp = OBJECT_TO_JSVAL(o=JS_NewArrayObject(cx, 0, NULL)); + for (i = 0; i < nmatches; i++) { + v = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _matches[i])); + ok = JS_SetElement(cx, o, i, &v); + _matches[i] = _free(_matches[i]); + } + _matches = _free(_matches); + } + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmaug_save(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmaugClass, NULL); + rpmaug aug = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + switch (rpmaugSave(aug)) { + case 0: /* success */ + *vp = JSVAL_TRUE; + break; + default: + case -1: /* failure */ + *vp = JSVAL_FALSE; + break; + } + ok = JS_TRUE; + return ok; +} + +static JSBool +rpmaug_load(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmaugClass, NULL); + rpmaug aug = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + switch (rpmaugLoad(aug)) { + case 0: /* success */ + *vp = JSVAL_TRUE; + break; + default: + case -1: /* failure */ + *vp = JSVAL_FALSE; + break; + } + ok = JS_TRUE; + return ok; +} + +/* XXX print is uselss method because of FILE * in Augeas API. */ +static JSBool +rpmaug_print(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmaugClass, NULL); + rpmaug aug = ptr; + JSBool ok = JS_FALSE; + const char * _path = NULL; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_path))) + goto exit; + + switch (rpmaugPrint(aug, NULL, _path)) { + case 0: /* success */ + *vp = JSVAL_TRUE; + break; + default: + case -1: /* failure */ + *vp = JSVAL_FALSE; + break; + } + ok = JS_TRUE; +exit: + return ok; +} + +static JSFunctionSpec rpmaug_funcs[] = { + JS_FS("defvar", rpmaug_defvar, 0,0), + JS_FS("get", rpmaug_get, 0,0), + JS_FS("set", rpmaug_set, 0,0), + JS_FS("insert", rpmaug_insert, 0,0), + JS_FS("rm", rpmaug_rm, 0,0), + JS_FS("remove", rpmaug_rm, 0,0), + JS_FS("mv", rpmaug_mv, 0,0), + JS_FS("move", rpmaug_mv, 0,0), + JS_FS("match", rpmaug_match, 0,0), + JS_FS("save", rpmaug_save, 0,0), + JS_FS("load", rpmaug_load, 0,0), + JS_FS("print", rpmaug_print, 0,0), + JS_FS_END +}; + +/* --- Object properties */ +enum rpmaug_tinyid { + _DEBUG = -2, + _LENGTH = -3, +}; + +static JSPropertySpec rpmaug_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmaug_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmaugClass, NULL); + rpmaug aug = ptr; + jsint tiny = JSVAL_TO_INT(id); + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + default: + if (JSVAL_IS_STRING(id) && *vp == JSVAL_VOID) { + const char * name = JS_EncodeString(cx, JS_ValueToString(cx, id)); + const char * _path = rpmGetPath(_defvar, "/", name, NULL); + const char * _value = NULL; + if (rpmaugGet(aug, _path, &_value) >= 0 && _value != NULL) + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _value)); + _value = _free(_value); + _path = _free(_path); + name = _free(name); + break; + } + break; + } + + return JS_TRUE; +} + +static JSBool +rpmaug_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmaugClass, NULL); + rpmaug aug = ptr; + jsint tiny = JSVAL_TO_INT(id); + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + /* XXX expr = undefined same as deleting? */ + if (JSVAL_IS_STRING(id)) { + const char * name = JS_EncodeString(cx, JS_ValueToString(cx, id)); + const char * expr = JS_EncodeString(cx, JS_ValueToString(cx, *vp)); + /* XXX should *setprop be permitted to delete NAME?!? */ + /* XXX return is no. nodes in EXPR match. */ + (void) rpmaugDefvar(aug, name, expr); + expr = _free(expr); + name = _free(name); + break; + } + break; + } + + return JS_TRUE; +} + +static JSBool +rpmaug_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmaugClass, NULL); + rpmaug aug = ptr; + +_RESOLVE_DEBUG_ENTRY(_debug); + + if (ptr == NULL) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + /* Lazily resolve new strings, with duplication to Augeas defvar too. */ + if ((flags & JSRESOLVE_ASSIGNING) && JSVAL_IS_STRING(id)) { + const char *name = JS_EncodeString(cx, JS_ValueToString(cx, id)); + const char * _path; + const char * _value; + int xx; + JSFunctionSpec *fsp; + + /* XXX avoid "aug.print" method namess duped into defvar space? */ + for (fsp = rpmaug_funcs; fsp->name != NULL; fsp++) { + if (!strcmp(fsp->name, name)) { + *objp = obj; /* XXX always resolve in this object. */ + goto exit; + } + } + + /* See if NAME exists in DEFVAR path. */ + _path = rpmGetPath(_defvar, "/", name, NULL); + _value = NULL; + + switch (rpmaugGet(aug, _path, &_value)) { + /* XXX For now, force all defvar's to be single valued strings. */ + case -1:/* multiply defined */ + case 0: /* not found */ + /* Create an empty Augeas defvar for NAME */ + xx = rpmaugDefvar(aug, name, ""); + /*@fallthrough@*/ + case 1: /* found */ + /* Reflect the Augeas defvar NAME into JS Aug properties. */ + if (JS_DefineProperty(cx, obj, name, + (_value != NULL + ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _value)) + : JSVAL_VOID), + NULL, NULL, JSPROP_ENUMERATE)) + break; + /*@fallthrough@*/ + default: +assert(0); + break; + } + + _path = _free(_path); + _value = _free(_value); + name = _free(name); + } + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmaug_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static rpmaug +rpmaug_init(JSContext *cx, JSObject *obj, const char *_root, + const char *_loadpath, unsigned int _flags) +{ + rpmaug aug; + + if ((aug = rpmaugNew(_root, _loadpath, _flags)) == NULL) + return NULL; + if (!JS_SetPrivate(cx, obj, aug)) { + /* XXX error msg */ + (void) rpmaugFree(aug); + return NULL; + } + return aug; +} + +static void +rpmaug_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmaugClass, NULL); + rpmaug aug = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + aug = rpmaugFree(aug); +} + +static JSBool +rpmaug_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + const char * _root = _rpmaugRoot; + const char * _loadpath = _rpmaugLoadpath; + unsigned int _flags = _rpmaugFlags; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/ssu", &_root, &_loadpath, &_flags))) + goto exit; + + if (JS_IsConstructing(cx, vp)) { + if (rpmaug_init(cx, obj, _root, _loadpath, _flags) == NULL) + goto exit; + } else { + if ((obj = JS_NewObject(cx, &rpmaugClass, NULL, NULL)) == NULL) + goto exit; + JS_SET_RVAL( cx , vp , OBJECT_TO_JSVAL( obj ) ); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass rpmaugClass = { + /* XXX class should be "Augeas" eventually, avoid name conflicts for now */ + "Aug", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmaug_addprop, rpmaug_delprop, rpmaug_getprop, rpmaug_setprop, + (JSEnumerateOp)rpmaug_enumerate, (JSResolveOp)rpmaug_resolve, + rpmaug_convert, rpmaug_dtor, + JSCLASS_NO_OPTIONAL_MEMBERS +}; + +JSObject * +rpmjs_InitAugClass(JSContext *cx, JSObject* obj) +{ + JSObject * o; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + o = JS_InitClass(cx, obj, NULL, &rpmaugClass, rpmaug_ctor, 1, + rpmaug_props, rpmaug_funcs, NULL, NULL); +assert(o != NULL); + return o; +} + +JSObject * +rpmjs_NewAugObject(JSContext *cx, const char * _root, + const char * _loadpath, unsigned int _flags) +{ + JSObject *obj; + rpmaug aug; + if( ! obj ) { + JS_ReportError( cx , "Failed to create 'this' object" ); + return JS_FALSE; + } + + if ((obj = JS_NewObject(cx, &rpmaugClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((aug = rpmaug_init(cx, obj, _root, _loadpath, _flags)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmaug, Aug, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmaug-js.h b/rpm-5.4.9/js/rpmaug-js.h new file mode 100644 index 0000000..a93b843 --- /dev/null +++ b/rpm-5.4.9/js/rpmaug-js.h @@ -0,0 +1,27 @@ +#ifndef H_RPMAUG_JS +#define H_RPMAUG_JS + +/** + * \file js/rpmaug-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmaugClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitAugClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewAugObject(JSContext *cx, const char *_root, + const char *_loadpath, unsigned int _flags); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMAUG_JS */ diff --git a/rpm-5.4.9/js/rpmbc-js.c b/rpm-5.4.9/js/rpmbc-js.c new file mode 100644 index 0000000..de68cea --- /dev/null +++ b/rpm-5.4.9/js/rpmbc-js.c @@ -0,0 +1,244 @@ +/** \ingroup js_c + * \file js/rpmbc-js.c + */ + +#include "system.h" + +#include "rpmbc-js.h" +#include "rpmjs-debug.h" + +#define _RPMBC_INTERNAL +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmbc_addprop JS_PropertyStub +#define rpmbc_delprop JS_PropertyStub +#define rpmbc_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmbc_getobjectops NULL +#define rpmbc_checkaccess NULL +#define rpmbc_call NULL +#define rpmbc_construct rpmbc_ctor +#define rpmbc_xdrobject NULL +#define rpmbc_hasinstance NULL +#define rpmbc_mark NULL +#define rpmbc_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmbc_equality NULL +#define rpmbc_outerobject NULL +#define rpmbc_innerobject NULL +#define rpmbc_iteratorobject NULL +#define rpmbc_wrappedobject NULL + +#define rpmbcNew() xcalloc(1, sizeof(struct rpmbc_s)) +#define rpmbcFree(_bc) _free(_bc) + +/* --- helpers */ + +/* --- Object methods */ + +static JSFunctionSpec rpmbc_funcs[] = { + JS_FS_END +}; + +/* --- Object properties */ +enum rpmbc_tinyid { + _DEBUG = -2, +}; + +static JSPropertySpec rpmbc_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmbc_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmbcClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmbc_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmbcClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmbc_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmbcClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmbc_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static rpmbc +rpmbc_init(JSContext *cx, JSObject *obj) +{ + rpmbc bc = rpmbcNew(); + +if (_debug) +fprintf(stderr, "==> %s(%p,%p) bc %p\n", __FUNCTION__, cx, obj, bc); + + if (!JS_SetPrivate(cx, obj, (void *)bc)) { + /* XXX error msg */ + return NULL; + } + return bc; +} + +static void +rpmbc_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmbcClass, NULL); + rpmbc bc = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + bc = rpmbcFree(bc); +} + +static JSBool +rpmbc_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (JS_IsConstructing(cx, vp)) { + (void) rpmbc_init(cx, obj); + } else { + if ((obj = JS_NewObject(cx, &rpmbcClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass rpmbcClass = { + /* XXX class should be "BeeCrypt" eventually, avoid name conflicts for now */ + "Bc", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmbc_addprop, rpmbc_delprop, rpmbc_getprop, rpmbc_setprop, + (JSEnumerateOp)rpmbc_enumerate, (JSResolveOp)rpmbc_resolve, + rpmbc_convert, rpmbc_dtor, + + rpmbc_getobjectops, rpmbc_checkaccess, + rpmbc_call, rpmbc_construct, + rpmbc_xdrobject, rpmbc_hasinstance, + rpmbc_mark, rpmbc_reserveslots, +}; + +JSObject * +rpmjs_InitBcClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmbcClass, rpmbc_ctor, 1, + rpmbc_props, rpmbc_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewBcObject(JSContext *cx) +{ + JSObject *obj; + rpmbc bc; + + if ((obj = JS_NewObject(cx, &rpmbcClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((bc = rpmbc_init(cx, obj)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmbc, Bc, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmbc-js.h b/rpm-5.4.9/js/rpmbc-js.h new file mode 100644 index 0000000..87e871a --- /dev/null +++ b/rpm-5.4.9/js/rpmbc-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMBC_JS +#define H_RPMBC_JS + +/** + * \file js/rpmbc-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmbcClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitBcClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewBcObject(JSContext *cx); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMBC_JS */ diff --git a/rpm-5.4.9/js/rpmbf-js.c b/rpm-5.4.9/js/rpmbf-js.c new file mode 100644 index 0000000..58d46d0 --- /dev/null +++ b/rpm-5.4.9/js/rpmbf-js.c @@ -0,0 +1,448 @@ +/** \ingroup js_c + * \file js/rpmbf-js.c + */ + +#include "system.h" + +#include "rpmbf-js.h" +#include "rpmjs-debug.h" + +#include +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +#define rpmbf_addprop JS_PropertyStub +#define rpmbf_delprop JS_PropertyStub +#define rpmbf_convert JS_ConvertStub + +static JSBool +rpmbf_add(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmbfClass, NULL); + rpmbf bf = ptr; + JSBool ok = JS_FALSE; + const char * _s = NULL; + +_METHOD_DEBUG_ENTRY(_debug); + + *vp = JSVAL_FALSE; + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_s))) + goto exit; + + *vp = (rpmbfAdd(bf, _s, 0) == 0 ? JSVAL_TRUE : JSVAL_FALSE); + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmbf_chk(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmbfClass, NULL); + rpmbf bf = ptr; + JSBool ok = JS_FALSE; + const char * _s = NULL; + +_METHOD_DEBUG_ENTRY(_debug); + + *vp = JSVAL_FALSE; + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_s))) + goto exit; + + *vp = (rpmbfChk(bf, _s, 0) > 0 ? JSVAL_TRUE : JSVAL_FALSE); + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmbf_clr(JSContext *cx, uintN argc, jsval *vp) +{ + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmbfClass, NULL); + rpmbf bf = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + *vp = (rpmbfClr(bf) == 0 ? JSVAL_TRUE : JSVAL_FALSE); + ok = JS_TRUE; + return ok; +} + +static JSBool +rpmbf_del(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmbfClass, NULL); + rpmbf bf = ptr; + JSBool ok = JS_FALSE; + const char * _s = NULL; + +_METHOD_DEBUG_ENTRY(_debug); + + *vp = JSVAL_FALSE; + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_s))) + goto exit; + + *vp = (rpmbfDel(bf, _s, 0) == 0 ? JSVAL_TRUE : JSVAL_FALSE); + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmbf_intersect(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmbfClass, NULL); + rpmbf _a = ptr; + JSObject * o = NULL; + rpmbf _b = NULL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + *vp = JSVAL_FALSE; + if (!(ok = JS_ConvertArguments(cx, argc, argv, "o", &o)) + || (_b = JS_GetInstancePrivate(cx, o, &rpmbfClass, NULL)) == NULL) + goto exit; + + if (!rpmbfIntersect(_a, _b)) + *vp = JSVAL_TRUE; + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmbf_union(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmbfClass, NULL); + rpmbf _a = ptr; + JSObject * o = NULL; + rpmbf _b = NULL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + *vp = JSVAL_FALSE; + if (!(ok = JS_ConvertArguments(cx, argc, argv, "o", &o)) + || (_b = JS_GetInstancePrivate(cx, o, &rpmbfClass, NULL)) == NULL) + goto exit; + + if (!rpmbfUnion(_a, _b)) + *vp = JSVAL_TRUE; + ok = JS_TRUE; +exit: + return ok; +} + +static JSFunctionSpec rpmbf_funcs[] = { + JS_FS("add", rpmbf_add, 0,0), + JS_FS("chk", rpmbf_chk, 0,0), + JS_FS("clr", rpmbf_clr, 0,0), + JS_FS("del", rpmbf_del, 0,0), + JS_FS("intersect", rpmbf_intersect, 0,0), + JS_FS("union", rpmbf_union, 0,0), + JS_FS_END +}; + +/* --- Object properties */ +enum rpmbf_tinyid { + _DEBUG = -2, + _LENGTH = -3, +}; + +static JSPropertySpec rpmbf_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmbf_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmbfClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + +#ifdef NOTYET + rpmbf bf = ptr; +_PROP_DEBUG_ENTRY(_debug < 0); +#endif + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + default: +#ifdef NOTYET + if (JSVAL_IS_STRING(id) && *vp == JSVAL_VOID) { + const char * name = JS_EncodeString(cx, JS_ValueToString(cx, id)); + const char * _path = rpmGetPath(_defvar, "/", name, NULL); + const char * _value = NULL; + if (rpmbfGet(bf, _path, &_value) >= 0 && _value != NULL) + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _value)); + _value = _free(_value); + _path = _free(_path); + name = _free(name); + break; + } +#endif + break; + } + + return JS_TRUE; +} + +static JSBool +rpmbf_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmbfClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + +#ifdef NOTYET + rpmbf bf = ptr; +_PROP_DEBUG_ENTRY(_debug < 0); +#endif + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: +#ifdef NOTYET + /* XXX expr = undefined same as deleting? */ + if (JSVAL_IS_STRING(id)) { + const char * name = JS_EncodeString(cx, JS_ValueToString(cx, id)); + const char * expr = JS_EncodeString(cx, JS_ValueToString(cx, *vp)); + /* XXX should *setprop be permitted to delete NAME?!? */ + /* XXX return is no. nodes in EXPR match. */ + (void) rpmbfDefvar(bf, name, expr); + expr = _free(expr); + name = _free(name); + break; + } +#endif + break; + } + + return JS_TRUE; +} + +static JSBool +rpmbf_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmbfClass, NULL); +#ifdef NOTYET + rpmbf bf = ptr; + +_RESOLVE_DEBUG_ENTRY(_debug); +#endif + + if (ptr == NULL) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + +#ifdef NOTYET + /* Lazily resolve new strings, with duplication to Augeas defvar too. */ + if ((flags & JSRESOLVE_ASSIGNING) && JSVAL_IS_STRING(id)) { + const char *name = JS_EncodeString(cx, JS_ValueToString(cx, id)); + const char * _path; + const char * _value; + int xx; + JSFunctionSpec *fsp; + + /* XXX avoid "bf.print" method namess duped into defvar space? */ + for (fsp = rpmbf_funcs; fsp->name != NULL; fsp++) { + if (!strcmp(fsp->name, name)) { + *objp = obj; /* XXX always resolve in this object. */ + goto exit; + } + } + + /* See if NAME exists in DEFVAR path. */ + _path = rpmGetPath(_defvar, "/", name, NULL); + _value = NULL; + + switch (rpmbfGet(bf, _path, &_value)) { + /* XXX For now, force all defvar's to be single valued strings. */ + case -1:/* multiply defined */ + case 0: /* not found */ + /* Create an empty Augeas defvar for NAME */ + xx = rpmbfDefvar(bf, name, ""); + /*@fallthrough@*/ + case 1: /* found */ + /* Reflect the Augeas defvar NAME into JS Aug properties. */ + if (JS_DefineProperty(cx, obj, name, + (_value != NULL + ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _value)) + : JSVAL_VOID), + NULL, NULL, JSPROP_ENUMERATE)) + break; + /*@fallthrough@*/ + default: +assert(0); + break; + } + + _value = _free(_value); + _path = _free(_path); + name = _free(_name); + } +#endif + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmbf_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (*idp != (jsid)JSVAL_VOID) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static rpmbf +rpmbf_init(JSContext *cx, JSObject *obj, size_t _m, size_t _k, + unsigned int _flags) +{ + rpmbf bf; + + if ((bf = rpmbfNew(_m, _k, _flags)) == NULL) + return NULL; + if (!JS_SetPrivate(cx, obj, bf)) { + /* XXX error msg */ + (void) rpmbfFree(bf); + return NULL; + } + return bf; +} + +static void +rpmbf_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmbfClass, NULL); + rpmbf bf = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + bf = rpmbfFree(bf); +} + +static JSBool +rpmbf_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + unsigned int _m = 0; + unsigned int _k = 0; + unsigned int _flags = 0; + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/uuu", &_m, &_k, &_flags))) + goto exit; + ok = JS_FALSE; /* XXX reset */ + + if (JS_IsConstructing(cx, vp)) { + if ((obj = JS_NewObject(cx, &rpmbfClass, NULL, NULL)) == NULL) + goto exit; + if (rpmbf_init(cx, obj, _m, _k, _flags) == NULL) + goto exit; + } else { + obj = JS_THIS_OBJECT(cx, vp); + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass rpmbfClass = { + /* XXX class should be "Bloom" eventually, avoid name conflicts for now */ + "Bf", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmbf_addprop, rpmbf_delprop, rpmbf_getprop, rpmbf_setprop, + (JSEnumerateOp)rpmbf_enumerate, (JSResolveOp)rpmbf_resolve, + rpmbf_convert, rpmbf_dtor, + JSCLASS_NO_OPTIONAL_MEMBERS +}; + +JSObject * +rpmjs_InitBfClass(JSContext *cx, JSObject* obj) +{ + JSObject * o; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + o = JS_InitClass(cx, obj, NULL, &rpmbfClass, rpmbf_ctor, 1, + rpmbf_props, rpmbf_funcs, NULL, NULL); +assert(o != NULL); + return o; +} + +JSObject * +rpmjs_NewBfObject(JSContext *cx, size_t _m, size_t _k, unsigned int _flags) +{ + JSObject *obj; + rpmbf bf; + + if ((obj = JS_NewObject(cx, &rpmbfClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((bf = rpmbf_init(cx, obj, _m, _k, _flags)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmbf, Bf, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmbf-js.h b/rpm-5.4.9/js/rpmbf-js.h new file mode 100644 index 0000000..128eac7 --- /dev/null +++ b/rpm-5.4.9/js/rpmbf-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMBF_JS +#define H_RPMBF_JS + +/** + * \file js/rpmbf-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmbfClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitBfClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewBfObject(JSContext *cx, size_t _m, size_t _k, unsigned int _flags); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMBF_JS */ diff --git a/rpm-5.4.9/js/rpmcudf-js.c b/rpm-5.4.9/js/rpmcudf-js.c new file mode 100644 index 0000000..911b7db --- /dev/null +++ b/rpm-5.4.9/js/rpmcudf-js.c @@ -0,0 +1,376 @@ +/** \ingroup js_c + * \file js/rpmcudf-js.c + */ + +#include "system.h" + +#include "rpmcudf-js.h" +#include "rpmjs-debug.h" + +#define _RPMCUDF_INTERNAL +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmcudf_addprop JS_PropertyStub +#define rpmcudf_delprop JS_PropertyStub +#define rpmcudf_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmcudf_getobjectops NULL +#define rpmcudf_checkaccess NULL +#define rpmcudf_call NULL +#define rpmcudf_construct rpmcudf_ctor +#define rpmcudf_xdrobject NULL +#define rpmcudf_hasinstance NULL +#define rpmcudf_mark NULL +#define rpmcudf_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmcudf_equality NULL +#define rpmcudf_outerobject NULL +#define rpmcudf_innerobject NULL +#define rpmcudf_iteratorobject NULL +#define rpmcudf_wrappedobject NULL + +/* --- helpers */ + +/* --- Object methods */ +static JSBool +rpmcudf_issolution(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmcudfClass, NULL); + rpmcudf cudf = ptr; + JSObject *fno = NULL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "o", &fno))) + goto exit; + + if (fno && JSVAL_IS_STRING(OBJECT_TO_JSVAL(fno))) { + const char * _fn = + JS_EncodeString(cx, JS_ValueToString(cx, OBJECT_TO_JSVAL(fno))); + int _flags = RPMCUDV_CUDF; /* XXX FIXME */ + const char * _av[] = { _fn, NULL }; + rpmcudf Y = rpmcudfNew((char **)_av, _flags); + *vp = (rpmcudfIsSolution(cudf, Y) ? JSVAL_TRUE : JSVAL_FALSE); + Y = rpmcudfFree(Y); + _fn = _free(_fn); + } else + *vp = JSVAL_VOID; + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmcudf_print(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmcudfClass, NULL); + rpmcudf cudf = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (cudf && cudf->V.typ == RPMCUDV_CUDFDOC) { + rpmcudfPrintPreamble(cudf); + rpmcudfPrintRequest(cudf); + rpmcudfPrintUniverse(cudf); + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmiobStr(cudf->iob))); + (void) rpmiobEmpty(cudf->iob); + } else + *vp = JSVAL_VOID; + ok = JS_TRUE; + + return ok; +} + +static JSFunctionSpec rpmcudf_funcs[] = { + JS_FS("issolution", rpmcudf_issolution, 0,0), + JS_FS("print", rpmcudf_print, 0,0), + JS_FS_END +}; + +/* --- Object properties */ +enum rpmcudf_tinyid { + _DEBUG = -2, + _HASPREAMBLE = -3, + _HASREQUEST = -4, + _ISCONSISTENT = -5, + _INSTALLEDSIZE = -6, + _UNIVERSESIZE = -7, + _PREAMBLE = -8, + _REQUEST = -9, + _UNIVERSE = -10, +}; + +static JSPropertySpec rpmcudf_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {"haspreamble", _HASPREAMBLE, JSPROP_ENUMERATE, NULL, NULL}, + {"hasrequest", _HASREQUEST, JSPROP_ENUMERATE, NULL, NULL}, + {"isconsistent", _ISCONSISTENT, JSPROP_ENUMERATE, NULL, NULL}, + {"installedsize", _INSTALLEDSIZE, JSPROP_ENUMERATE, NULL, NULL}, + {"universesize", _UNIVERSESIZE, JSPROP_ENUMERATE, NULL, NULL}, + {"preamble", _PREAMBLE, JSPROP_ENUMERATE, NULL, NULL}, + {"request", _REQUEST, JSPROP_ENUMERATE, NULL, NULL}, + {"universe", _UNIVERSE, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmcudf_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmcudfClass, NULL); + rpmcudf cudf = ptr; + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + case _HASPREAMBLE: + *vp = (cudf && rpmcudfHasPreamble(cudf) ? JSVAL_TRUE : JSVAL_FALSE); + break; + case _HASREQUEST: + *vp = (cudf && rpmcudfHasRequest(cudf) ? JSVAL_TRUE : JSVAL_FALSE); + break; + case _ISCONSISTENT: + *vp = (cudf && rpmcudfIsConsistent(cudf) ? JSVAL_TRUE : JSVAL_FALSE); + break; + case _INSTALLEDSIZE: + *vp = (cudf ? INT_TO_JSVAL(rpmcudfInstalledSize(cudf)) : JSVAL_VOID); + break; + case _UNIVERSESIZE: + *vp = (cudf ? INT_TO_JSVAL(rpmcudfUniverseSize(cudf)) : JSVAL_VOID); + break; + case _PREAMBLE: + if (cudf && cudf->V.typ == RPMCUDV_CUDFDOC) { + rpmcudfPrintPreamble(cudf); + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmiobStr(cudf->iob))); + (void) rpmiobEmpty(cudf->iob); + } else + *vp = JSVAL_VOID; + break; + case _REQUEST: + if (cudf && cudf->V.typ == RPMCUDV_CUDFDOC) { + rpmcudfPrintRequest(cudf); + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmiobStr(cudf->iob))); + (void) rpmiobEmpty(cudf->iob); + } else + *vp = JSVAL_VOID; + break; + case _UNIVERSE: + if (cudf && cudf->V.typ == RPMCUDV_CUDFDOC) { + rpmcudfPrintUniverse(cudf); + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmiobStr(cudf->iob))); + (void) rpmiobEmpty(cudf->iob); + } else + *vp = JSVAL_VOID; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmcudf_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmcudfClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmcudf_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmcudfClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmcudf_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static rpmcudf +rpmcudf_init(JSContext *cx, JSObject *obj, JSObject *fno, int _flags) +{ + const char * fn = NULL; + rpmcudf cudf = NULL; + + if (fno && JSVAL_IS_STRING(OBJECT_TO_JSVAL(fno))) + fn = JS_EncodeString(cx, JS_ValueToString(cx, OBJECT_TO_JSVAL(fno))); + + switch (_flags) { + default: _flags = RPMCUDV_CUDF; break; + case RPMCUDV_CUDFDOC: + case RPMCUDV_CUDF: + break; + } + + { const char *_av[] = { fn, NULL }; + cudf = rpmcudfNew((char **)_av, _flags); + } + + if (!JS_SetPrivate(cx, obj, (void *)cudf)) { + /* XXX error msg */ + cudf = rpmcudfFree(cudf); + } + +if (_debug) +fprintf(stderr, "<== %s(%p,%p, %p, %d) cudf %p fn %s\n", __FUNCTION__, cx, obj, fno, _flags, cudf, fn); + + fn = _free(fn); + + return cudf; +} + +static void +rpmcudf_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmcudfClass, NULL); + rpmcudf cudf = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + cudf = rpmcudfFree(cudf); +} + +static JSBool +rpmcudf_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + JSObject *fno = NULL; + int _flags = 0; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/oi", &fno, &_flags))) + goto exit; + + if (JS_IsConstructing(cx, vp)) { + (void) rpmcudf_init(cx, obj, fno, _flags); + } else { + if ((obj = JS_NewObject(cx, &rpmcudfClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass rpmcudfClass = { + "Cudf", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmcudf_addprop, rpmcudf_delprop, rpmcudf_getprop, rpmcudf_setprop, + (JSEnumerateOp)rpmcudf_enumerate, (JSResolveOp)rpmcudf_resolve, + rpmcudf_convert, rpmcudf_dtor, + + rpmcudf_getobjectops, rpmcudf_checkaccess, + rpmcudf_call, rpmcudf_construct, + rpmcudf_xdrobject, rpmcudf_hasinstance, + rpmcudf_mark, rpmcudf_reserveslots, +}; + +JSObject * +rpmjs_InitCudfClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmcudfClass, rpmcudf_ctor, 1, + rpmcudf_props, rpmcudf_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewCudfObject(JSContext *cx, JSObject *fno, int _flags) +{ + JSObject *obj; + rpmcudf cudf; + + if ((obj = JS_NewObject(cx, &rpmcudfClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((cudf = rpmcudf_init(cx, obj, fno, _flags)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmcudf, Cudf, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmcudf-js.h b/rpm-5.4.9/js/rpmcudf-js.h new file mode 100644 index 0000000..b277a00 --- /dev/null +++ b/rpm-5.4.9/js/rpmcudf-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMCUDF_JS +#define H_RPMCUDF_JS + +/** + * \file js/rpmcudf-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmcudfClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitCudfClass(JSContext *cx, JSObject *obj); + +extern JSObject * +rpmjs_NewCudfObject(JSContext *cx, JSObject *fno, int _flags); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMCUDF_JS */ diff --git a/rpm-5.4.9/js/rpmdb-js.c b/rpm-5.4.9/js/rpmdb-js.c new file mode 100644 index 0000000..af1ec6d --- /dev/null +++ b/rpm-5.4.9/js/rpmdb-js.c @@ -0,0 +1,1819 @@ +/** \ingroup js_c + * \file js/rpmdb-js.c + */ + +#include "system.h" + +#define _RPMDB_JS_INTERNAL +#include "rpmdb-js.h" + +#include "rpmdbc-js.h" +#include "rpmdbe-js.h" +#include "rpmmpf-js.h" +#include "rpmtxn-js.h" +#include "rpmjs-debug.h" + +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmdb_addprop JS_PropertyStub +#define rpmdb_delprop JS_PropertyStub +#define rpmdb_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmdb_getobjectops NULL +#define rpmdb_checkaccess NULL +#define rpmdb_call rpmdb_call +#define rpmdb_construct rpmdb_ctor +#define rpmdb_xdrobject NULL +#define rpmdb_hasinstance NULL +#define rpmdb_mark NULL +#define rpmdb_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmdb_equality NULL +#define rpmdb_outerobject NULL +#define rpmdb_innerobject NULL +#define rpmdb_iteratorobject NULL +#define rpmdb_wrappedobject NULL + +/* --- helpers */ + +#ifdef UNUSED +static int +rpmdb_DBTcompare(DB * db, const DBT * A, const DBT * B) +{ + size_t nb = (A->size < B->size ? A->size : B->size); + int ret = (nb > 0 ? memcmp(A->data, B->data, nb) : 0); + if (ret) + return ret; + return (int)((long)A->size - (long)B->size); +} +#endif + +static void +rpmdb_feedback(DB * db, int opcode, int percent) +{ +#ifdef NOTNOW + JSObject * o = (db ? db->app_private : NULL); +if (_debug) +fprintf(stderr, "==> %s(%p, %d, %d) o %p\n", __FUNCTION__, db, opcode, percent, o); +#endif +} + +int +rpmdb_v2dbt(JSContext *cx, jsval v, _RPMDBT * p) +{ + int rc = 0; + + if (v == JSVAL_NULL || v == JSVAL_VOID) { + p->dbt.size = 0; + p->dbt.data = NULL; + } else + if (JSVAL_IS_INT(v)) { + JS_ValueToInt32(cx, v, &p->_u._i); + p->dbt.size = sizeof(p->_u._i); + p->dbt.data = &p->_u._i; + } else + if (JSVAL_IS_DOUBLE(v)) { + jsdouble d = 0; + JS_ValueToNumber(cx, v, &d); + p->_u._ll = d; + p->dbt.size = sizeof(p->_u._ll); + p->dbt.data = &p->_u._ll; + } else + if (JSVAL_IS_STRING(v)) { + p->dbt.data = JS_EncodeString(cx, JSVAL_TO_STRING(v)); + p->dbt.size = strlen(p->dbt.data) + 1; + } else + if (JSVAL_IS_OBJECT(v)) { +#ifdef NOTYET + JSObject *o = JSVAL_TO_OBJECT(v); + if (OBJ_IS_FOO(cx, o)) + foo = JS_GetInstancePrivate(cx, o, &rpmfooClass, NULL); +#else + p->dbt.size = 0; + p->dbt.data = NULL; +#endif + } else + { +#ifdef NOTNOW +if (_debug) +fprintf(stderr, "*** %s(%p, 0x%x, %p) FIXME\n", __FUNCTION__, cx, (unsigned)v, p); +#endif + rc = 0; + } + return rc; +} + +static int +rpmdb_Acallback(DB * db, const DBT * _k, const DBT * _d, DBT * _r) +{ +if (_debug) +fprintf(stderr, "==> %s(%p, %p, %p, %p) k %p[%u] d %p[%u]\n", __FUNCTION__, db, _k, _d, _r, _k->data, (unsigned)_k->size, _d->data, (unsigned)_d->size); + _r->data = _d->data; + _r->size = _d->size; + return 0; +} + +static int +rpmdb_AFcallback(DB * db, const DBT * _k, DBT * _d, const DBT * _fk, + int * _changed) +{ +#ifdef NOTNOW +if (_debug) +fprintf(stderr, "==> %s(%p, %p, %p, %p, %p) k %p[%u] fk %p[%u] changed %d\n", __FUNCTION__, db, _k, _d, _fk, _changed, _k->data, (unsigned)_k->size, _fk->data, (unsigned)_fk->size, *_changed); +#endif + return 0; +} + +/* --- Object methods */ + +static JSBool +rpmdb_Associate(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + JSObject * o_txn = NULL; + DB_TXN * _txn = NULL; + JSObject * o_db = NULL; + DB * _secondary = NULL; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "oo/u", &o_txn, &o_db, &_flags))) + goto exit; + + if (o_db && OBJ_IS_RPMDB(cx, o_db)) + _secondary = JS_GetInstancePrivate(cx, o_db, &rpmdbClass, NULL); + else goto exit; + if (o_txn && OBJ_IS_RPMTXN(cx, o_txn)) + _txn = JS_GetInstancePrivate(cx, o_txn, &rpmtxnClass, NULL); + + if (db->app_private != NULL) { + /* XXX todo++ */ + int (*_callback) (DB *, const DBT *, const DBT *, DBT *) + = rpmdb_Acallback; + int ret = db->associate(db, _txn, _secondary, _callback, _flags); +#ifdef NOTNOW +if (_debug) +fprintf(stderr, "==> %s: ret %d = db->associate(%p, %p, %p %p, 0x%x)\n", __FUNCTION__, ret, db, _txn, _secondary, _callback, _flags); +#endif + switch (ret) { + default: + db->err(db, ret, "DB->associate"); + goto exit; + break; + case 0: + *vp = JSVAL_TRUE; + break; + } + } + + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmdb_AssociateForeign(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + JSObject * o_db = NULL; + DB * _secondary = NULL; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + if (!(ok = JS_ConvertArguments(cx, argc, argv, "o/u", &o_db, &_flags))) + goto exit; + + if (o_db && OBJ_IS_RPMDB(cx, o_db)) + _secondary = JS_GetInstancePrivate(cx, o_db, &rpmdbClass, NULL); + else goto exit; + + if (db->app_private != NULL) { + /* XXX todo++ */ + int (*_callback) (DB *, const DBT *, DBT *, const DBT *, int *) + = (_flags & (DB_FOREIGN_ABORT | DB_FOREIGN_CASCADE)) + ? NULL : rpmdb_AFcallback; + int ret = db->associate_foreign(db, _secondary, _callback, _flags); +#ifdef NOTNOW +if (_debug) +fprintf(stderr, "==> %s: ret %d = db->associate_foreign(%p, %p, %p, 0x%x)\n", __FUNCTION__, ret, db, _secondary, _callback, _flags); +#endif + switch (ret) { + default: + db->err(db, ret, "DB->associate_foreign"); + goto exit; + break; + case 0: + *vp = JSVAL_TRUE; + break; + } + } + + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmdb_Close(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + { int ret = db->close(db, _flags); + if (ret) + db->err(db, ret, "DB->close"); + else + *vp = JSVAL_TRUE; + db = ptr = NULL; + (void) JS_SetPrivate(cx, obj, ptr); + } + + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmdb_Compact(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + JSObject * o = NULL; + DB_TXN * _txn = NULL; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "o/u", &o, &_flags))) + goto exit; + + if (o && OBJ_IS_RPMTXN(cx, o)) + _txn = JS_GetInstancePrivate(cx, o, &rpmtxnClass, NULL); + + if (db->app_private != NULL) { + DBT * _start = NULL; /* XXX todo++ */ + DBT * _stop = NULL; /* XXX todo++ */ + DB_COMPACT * _c_data = NULL; /* XXX todo++ */ + DBT * _end = NULL; /* XXX todo++ */ + int ret = db->compact(db, _txn, _start, _stop, _c_data, _flags, _end); + if (ret) + db->err(db, ret, "DB->compact"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdb_Cursor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + JSObject * o = NULL; + DB_TXN * _txn = NULL; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/ou", &o, &_flags))) + goto exit; + + if (o && OBJ_IS_RPMTXN(cx, o)) + _txn = JS_GetInstancePrivate(cx, o, &rpmtxnClass, NULL); + + if (db->app_private != NULL) { + DBC * _dbc = NULL; + int ret = db->cursor(db, _txn, &_dbc, _flags); + switch (ret) { + default: + db->err(db, ret, "DB->cursor"); + goto exit; + break; + case 0: + if ((o = JS_NewObject(cx, &rpmdbcClass, NULL, NULL)) == NULL + || !JS_SetPrivate(cx, o, (void *)_dbc)) + { + if (_dbc) _dbc->close(_dbc); + /* XXX error msg */ + goto exit; + } + *vp = OBJECT_TO_JSVAL(o); + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdb_Del(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + JSObject * o = NULL; + DB_TXN * _txn = NULL; + jsval _kv = JSVAL_NULL; + _RPMDBT _k = _RPMDBT_INIT; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "ov/u", &o, &_kv, &_flags))) + goto exit; + + if (o && OBJ_IS_RPMTXN(cx, o)) + _txn = JS_GetInstancePrivate(cx, o, &rpmtxnClass, NULL); + if (rpmdb_v2dbt(cx, _kv, &_k)) + goto exit; + + if (db->app_private != NULL) { + int ret = db->del(db, _txn, _RPMDBT_PTR(_k), _flags); + switch (ret) { + default: + db->err(db, ret, "DB->del"); + goto exit; + break; + case 0: + *vp = JSVAL_TRUE; + break; + case DB_NOTFOUND: + *vp = JSVAL_VOID; + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdb_Exists(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + JSObject * o = NULL; + DB_TXN * _txn = NULL; + jsval _kv = JSVAL_NULL; + _RPMDBT _k = _RPMDBT_INIT; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "ov/u", &o, &_kv, &_flags))) + goto exit; + + if (o && OBJ_IS_RPMTXN(cx, o)) + _txn = JS_GetInstancePrivate(cx, o, &rpmtxnClass, NULL); + if (rpmdb_v2dbt(cx, _kv, &_k)) + goto exit; + + if (db->app_private != NULL) { + int ret = db->exists(db, _txn, _RPMDBT_PTR(_k), _flags); + switch (ret) { + default: + *vp = JSVAL_FALSE; + db->err(db, ret, "DB->exists"); + goto exit; + break; + case 0: + *vp = JSVAL_TRUE; + break; + case DB_NOTFOUND: + *vp = JSVAL_VOID; + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdb_Get(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + JSObject * o = NULL; + DB_TXN * _txn = NULL; + jsval _kv = JSVAL_NULL; + _RPMDBT _k = _RPMDBT_INIT; + jsval _dv = JSVAL_NULL; + _RPMDBT _d = _RPMDBT_INIT; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "ov/vu", &o, &_kv, &_dv, &_flags))) + goto exit; + + if (o && OBJ_IS_RPMTXN(cx, o)) + _txn = JS_GetInstancePrivate(cx, o, &rpmtxnClass, NULL); + if (rpmdb_v2dbt(cx, _kv, &_k)) + goto exit; + if (rpmdb_v2dbt(cx, _dv, &_d)) + goto exit; + + if (db->app_private != NULL) { + int ret = db->get(db, _txn, _RPMDBT_PTR(_k), _RPMDBT_PTR(_d), _flags); +#ifdef NOTNOW +if (_debug) +fprintf(stderr, "==> %s: ret %d = db->get(%p, %p, %p[%u], %p[%u], 0x%x)\n", +__FUNCTION__, ret, db, _txn, +_RPMDBT_PTR(_k)->data, (unsigned)_RPMDBT_PTR(_k)->size, +_RPMDBT_PTR(_d)->data, (unsigned)_RPMDBT_PTR(_d)->size, +_flags); +#endif + switch (ret) { + default: + *vp = JSVAL_FALSE; + db->err(db, ret, "DB->get"); + goto exit; + break; + case 0: + *vp = STRING_TO_JSVAL(JS_NewStringCopyN(cx, _RPMDBT_PTR(_d)->data, _RPMDBT_PTR(_d)->size)); + break; + case DB_NOTFOUND: + *vp = JSVAL_VOID; + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdb_Join(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + JSObject * o = NULL; + DBC * _dbc = NULL; + size_t nb = (argc + 1) * sizeof(_dbc); + DBC ** _list = memset(alloca(nb), 0, nb); + uint32_t _flags = 0; + uint32_t i; + jsval v; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* Build the cursor list. */ + for (i = 0; i < argc; i++) { + v = argv[i]; + if (!JSVAL_IS_OBJECT(v)) + break; + o = JSVAL_TO_OBJECT(v); + if (!(o && OBJ_IS_RPMDBC(cx, o))) + break; + if ((_list[i] = JS_GetInstancePrivate(cx, o, &rpmdbcClass, NULL)) == NULL) + break; + } + _list[i] = NULL; + + /* Set _flags from optional last int in args */ + if (i+1 == argc && JSVAL_IS_INT(argv[i])) + _flags = JSVAL_TO_INT(argv[i++]); + if (i < argc) + goto exit; + + if (db->app_private != NULL) { + int ret = db->join(db, _list, &_dbc, _flags); +#ifdef NOTNOW +if (_debug) +fprintf(stderr, "==> %s: ret %d = db->join(%p, %p, %p 0x%x) dbc %p\n", __FUNCTION__, ret, db, _list, &_dbc, _flags, _dbc); +#endif + switch (ret) { + default: + db->err(db, ret, "DB->join"); + goto exit; + break; + case 0: + *vp = JSVAL_TRUE; + if ((o = JS_NewObject(cx, &rpmdbcClass, NULL, NULL)) == NULL + || !JS_SetPrivate(cx, o, (void *)_dbc)) + { + if (_dbc) _dbc->close(_dbc); + goto exit; + } + *vp = OBJECT_TO_JSVAL(o); + break; + } + } + + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmdb_KeyRange(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + JSObject * o = NULL; + DB_TXN * _txn = NULL; + jsval _kv = JSVAL_NULL; + _RPMDBT _k = _RPMDBT_INIT; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "ov/u", &o, &_kv, &_flags))) + goto exit; + + if (o && OBJ_IS_RPMTXN(cx, o)) + _txn = JS_GetInstancePrivate(cx, o, &rpmtxnClass, NULL); + if (rpmdb_v2dbt(cx, _kv, &_k)) + goto exit; + + if (db->app_private != NULL) { + DB_KEY_RANGE _key_range = {0}; + int ret = db->key_range(db, _txn, _RPMDBT_PTR(_k), &_key_range, _flags); +#ifdef NOTNOW +if (_debug) +fprintf(stderr, "==> %s: ret %d = db->key_range(%p, %p, %p, %p, 0x%x) <%g =%g >%g\n", __FUNCTION__, ret, db, _txn, _RPMDBT_PTR(_k), &_key_range, _flags, _key_range.less, _key_range.equal, _key_range.greater); +#endif + switch (ret) { + default: + db->err(db, ret, "DB->key_range"); + goto exit; + break; + case 0: + { void * mark = NULL; + *vp = OBJECT_TO_JSVAL(JS_NewArrayObject(cx, 3, + JS_PushArguments(cx, &mark, "ddd", + _key_range.less, + _key_range.equal, + _key_range.greater))); + JS_PopArguments(cx, mark); + } break; + } + } + + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmdb_Open(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + JSObject * o = NULL; + DB_TXN * _txn = NULL; + const char * _file = NULL; + const char * _database = NULL; + DBTYPE _type = DB_HASH; + uint32_t _oflags = DB_CREATE; + int _mode = 0644; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "os/suui", &o, &_file, &_database, &_type, &_oflags, &_mode))) + goto exit; + + if (o && OBJ_IS_RPMTXN(cx, o)) + _txn = JS_GetInstancePrivate(cx, o, &rpmtxnClass, NULL); + + /* XXX hmm, "null" is getting passed somehow. */ + if (_database && (*_database == '\0' || !strcmp(_database, "null"))) + _database = NULL; + if (_type == DB_QUEUE) + _database = NULL; + + if (db->app_private == NULL) { + int ret = db->open(db, _txn, _file, _database, _type, _oflags, _mode); +#ifdef NOTNOW +if (_debug) +fprintf(stderr, "==> %s: ret %d = db->open(%p, %p, \"%s\", \"%s\", %d, 0x%x, 0%o)\n", __FUNCTION__, ret, db, _txn, _file, _database, _type, _oflags, _mode); +#endif + if (ret) { + db->err(db, ret, "DB->open"); + goto exit; + } else { + db->app_private = obj; + /* XXX only DB_UPGRADE/DB_VERIFY are currently implemented */ + ret = db->set_feedback(db, rpmdb_feedback); + if (ret) db->err(db, ret, "DB->set_feedback"); + *vp = JSVAL_TRUE; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdb_Pget(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + JSObject * o = NULL; + DB_TXN * _txn = NULL; + jsval _kv = JSVAL_NULL; + _RPMDBT _k = _RPMDBT_INIT; + jsval _dv = JSVAL_NULL; + _RPMDBT _d = _RPMDBT_INIT; + _RPMDBT _p = _RPMDBT_INIT; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "ov/vu", &o, &_kv, &_dv, &_flags))) + goto exit; + + if (o && OBJ_IS_RPMTXN(cx, o)) + _txn = JS_GetInstancePrivate(cx, o, &rpmtxnClass, NULL); + if (rpmdb_v2dbt(cx, _kv, &_k)) + goto exit; + if (rpmdb_v2dbt(cx, _dv, &_d)) + goto exit; + + if (db->app_private != NULL) { + int ret = db->pget(db, _txn, _RPMDBT_PTR(_k), _RPMDBT_PTR(_p), _RPMDBT_PTR(_d), _flags); + switch (ret) { + default: + *vp = JSVAL_FALSE; + db->err(db, ret, "DB->pget"); + goto exit; + break; + case 0: + *vp = STRING_TO_JSVAL(JS_NewStringCopyN(cx, _RPMDBT_PTR(_d)->data, _RPMDBT_PTR(_d)->size)); + break; + case DB_NOTFOUND: + *vp = JSVAL_VOID; + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdb_Put(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + JSObject * o = NULL; + DB_TXN * _txn = NULL; + jsval _kv = JSVAL_NULL; + _RPMDBT _k = _RPMDBT_INIT; + jsval _dv = JSVAL_NULL; + _RPMDBT _d = _RPMDBT_INIT; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "ovv/u", &o, &_kv, &_dv, &_flags))) + goto exit; + + if (o && OBJ_IS_RPMTXN(cx, o)) + _txn = JS_GetInstancePrivate(cx, o, &rpmtxnClass, NULL); + if (rpmdb_v2dbt(cx, _kv, &_k)) + goto exit; + if (rpmdb_v2dbt(cx, _dv, &_d)) + goto exit; + + if (db->app_private != NULL) { + int ret = db->put(db, _txn, _RPMDBT_PTR(_k), _RPMDBT_PTR(_d), _flags); + switch (ret) { + default: + *vp = JSVAL_FALSE; + db->err(db, ret, "DB->put"); + goto exit; + break; + case 0: + *vp = JSVAL_TRUE; + break; + case DB_NOTFOUND: + *vp = JSVAL_VOID; + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdb_Remove(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + const char * _file = NULL; + const char * _database = NULL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s/s", &_file, &_database))) + goto exit; + + if (db->app_private == NULL) { + uint32_t _flags = 0; + int ret = db->remove(db, _file, _database, _flags); + if (ret) + fprintf(stderr, "db->remove: %s\n", db_strerror(ret)); + else + *vp = JSVAL_TRUE; + db = ptr = NULL; + (void) JS_SetPrivate(cx, obj, ptr); + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdb_Rename(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + const char * _file = NULL; + const char * _database = NULL; + const char * _newname = NULL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "sss", &_file, &_database, &_newname))) + goto exit; + + /* XXX lazy reopen in order to rename? */ + + if (db->app_private == NULL) { + uint32_t _flags = 0; + int ret = db->rename(db, _file, _database, _newname, _flags); + if (ret) + db->err(db, ret, "DB->rename"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdb_Stat(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + JSObject * o = NULL; + DB_TXN * _txn = NULL; + uint32_t _flags = DB_STAT_ALL; /* XXX DB_FAST_STAT is saner default */ + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "o/u", &o, &_flags))) + goto exit; + + if (o && OBJ_IS_RPMTXN(cx, o)) + _txn = JS_GetInstancePrivate(cx, o, &rpmtxnClass, NULL); + + if (db->app_private != NULL) { + void * _sp = NULL; + int ret = db->stat(db, _txn, &_sp, _flags); + if (ret) + db->err(db, ret, "DB->stat"); + else + *vp = JSVAL_TRUE; + /* XXX FIXME: format for return. ugh */ + _sp = _free(_sp); + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdb_StatPrint(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + uint32_t _flags = DB_STAT_ALL; /* XXX DB_FAST_STAT is saner default */ + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + if (db->app_private != NULL) { + int ret = db->stat_print(db, _flags); + if (ret) + db->err(db, ret, "DB->stat_print"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdb_Sync(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* XXX check argc? */ + + { uint32_t _flags = 0; + int ret = db->sync(db, _flags); + if (ret) + db->err(db, ret, "DB->sync"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdb_Truncate(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + JSObject * o = NULL; + DB_TXN * _txn = NULL; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* XXX check argc? */ + if (!(ok = JS_ConvertArguments(cx, argc, argv, "o/u", &o, &_flags))) + goto exit; + + if (o && OBJ_IS_RPMTXN(cx, o)) + _txn = JS_GetInstancePrivate(cx, o, &rpmtxnClass, NULL); + + { uint32_t _count = 0; + int ret = db->truncate(db, _txn, &_count, _flags); + if (ret) { + db->err(db, ret, "DB->truncate"); + goto exit; + } + *vp = INT_TO_JSVAL(_count); + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdb_Upgrade(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + const char * _file = NULL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_file))) + goto exit; + + /* XXX check db->lorder, same endianness is required. */ + { uint32_t _flags = 0; /* XXX DB_DUPSORT prior to db-3.1 */ + int ret = db->upgrade(db, _file, _flags); + if (ret) { + db->err(db, ret, "DB->upgrade"); + goto exit; + } + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdb_Verify(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + const char * _file = NULL; + const char * _database = NULL; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (db == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "ssu", &_file, &_database, &_flags))) + goto exit; + + if (db->app_private == NULL) { + FILE * _outfile = NULL; /* XXX optional key/val dump */ + int ret = db->verify(db, _file, _database, _outfile, _flags); + if (ret) + fprintf(stderr, "db->verify: %s\n", db_strerror(ret)); + else + *vp = JSVAL_TRUE; + db = ptr = NULL; + (void) JS_SetPrivate(cx, obj, ptr); + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSFunctionSpec rpmdb_funcs[] = { + JS_FS("associate", rpmdb_Associate, 0,0), + JS_FS("associate_foreign", rpmdb_AssociateForeign, 0,0), + JS_FS("close", rpmdb_Close, 0,0), + JS_FS("compact", rpmdb_Compact, 0,0), + JS_FS("cursor", rpmdb_Cursor, 0,0), + JS_FS("del", rpmdb_Del, 0,0), + JS_FS("exists", rpmdb_Exists, 0,0), + JS_FS("get", rpmdb_Get, 0,0), + JS_FS("join", rpmdb_Join, 0,0), + JS_FS("key_range", rpmdb_KeyRange, 0,0), + JS_FS("open", rpmdb_Open, 0,0), + JS_FS("pget", rpmdb_Pget, 0,0), + JS_FS("put", rpmdb_Put, 0,0), + JS_FS("remove", rpmdb_Remove, 0,0), + JS_FS("rename", rpmdb_Rename, 0,0), + JS_FS("stat", rpmdb_Stat, 0,0), + JS_FS("stat_print", rpmdb_StatPrint, 0,0), + JS_FS("sync", rpmdb_Sync, 0,0), + JS_FS("truncate", rpmdb_Truncate, 0,0), + JS_FS("upgrade", rpmdb_Upgrade, 0,0), + JS_FS("verify", rpmdb_Verify, 0,0), + JS_FS_END +}; + +/* --- Object properties */ + +#define _TABLE(_v) #_v, _##_v, JSPROP_ENUMERATE, NULL, NULL + +enum rpmdb_tinyid { + _DEBUG = -2, + _BYTESWAPPED = -3, + _DBFILE = -4, + _DBNAME = -5, + _MULTIPLE = -6, + _OPEN_FLAGS = -7, + _TYPE = -8, + _BT_MINKEY = -9, + _CACHESIZE = -10, + _CREATE_DIR = -11, + _ENCRYPT = -12, + _ERRFILE = -13, + _ERRPFX = -14, + _FLAGS = -15, + _H_FFACTOR = -16, + _H_NELEM = -17, + _LORDER = -18, + _MPF = -19, + _MSGFILE = -20, + _PAGESIZE = -21, + _PARTITION_DIRS = -22, + _PRIORITY = -23, + _Q_EXTENTSIZE = -24, + _RE_DELIM = -25, + _RE_LEN = -26, + _RE_PAD = -27, + _RE_SOURCE = -28, + + _ST_BUCKETS = -29, + _ST_CUR_RECNO = -30, + _ST_EXTENTSIZE = -31, + _ST_FFACTOR = -32, + _ST_FIRST_RECNO = -33, + _ST_MAGIC = -34, + _ST_MINKEY = -35, + _ST_NDATA = -36, + _ST_NKEYS = -37, + _ST_PAGECNT = -38, + _ST_PAGESIZE = -39, + _ST_RE_LEN = -40, + _ST_RE_PAD = -41, + _ST_VERSION = -42, + +#ifndef NOTFAST + _ST_BFREE = -43, + _ST_BIG_BFREE = -44, + _ST_BIGPAGES = -45, + _ST_BT_DUP_PG = -46, + _ST_BT_DUP_PGFREE = -47, + _ST_BT_EMPTY_PG = -48, + _ST_BT_FREE = -49, + _ST_BT_INT_PG = -50, + _ST_BT_INT_PGFREE = -51, + _ST_BT_LEAF_PG = -52, + _ST_BT_LEAF_PGFREE = -53, + _ST_BT_LEVELS = -54, + _ST_BT_OVER_PG = -55, + _ST_BT_OVER_PGFREE = -56, + _ST_DUP = -57, + _ST_DUP_FREE = -58, + _ST_FREE = -59, + _ST_OVERFLOWS = -60, + _ST_OVFL_FREE = -61, + _ST_PAGES = -62, + _ST_PGFREE = -63, +#endif +}; + +static JSPropertySpec rpmdb_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {"byteswapped", _BYTESWAPPED, JSPROP_ENUMERATE, NULL, NULL}, + {"dbfile", _DBFILE, JSPROP_ENUMERATE, NULL, NULL}, + {"dbname", _DBNAME, JSPROP_ENUMERATE, NULL, NULL}, + {"multiple", _MULTIPLE, JSPROP_ENUMERATE, NULL, NULL}, + {"open_flags", _OPEN_FLAGS, JSPROP_ENUMERATE, NULL, NULL}, + {"type", _TYPE, JSPROP_ENUMERATE, NULL, NULL}, + {"bt_minkey", _BT_MINKEY, JSPROP_ENUMERATE, NULL, NULL}, + {"cachesize", _CACHESIZE, JSPROP_ENUMERATE, NULL, NULL}, + {"create_dir", _CREATE_DIR, JSPROP_ENUMERATE, NULL, NULL}, + {"encrypt", _ENCRYPT, JSPROP_ENUMERATE, NULL, NULL}, + {"errfile", _ERRFILE, JSPROP_ENUMERATE, NULL, NULL}, + {"errpfx", _ERRPFX, JSPROP_ENUMERATE, NULL, NULL}, + {"flags", _FLAGS, JSPROP_ENUMERATE, NULL, NULL}, + {"h_ffactor", _H_FFACTOR, JSPROP_ENUMERATE, NULL, NULL}, + {"h_nelem", _H_NELEM, JSPROP_ENUMERATE, NULL, NULL}, + {"lorder", _LORDER, JSPROP_ENUMERATE, NULL, NULL}, + {"mpf", _MPF, JSPROP_ENUMERATE, NULL, NULL}, + {"msgfile", _MSGFILE, JSPROP_ENUMERATE, NULL, NULL}, + {"pagesize", _PAGESIZE, JSPROP_ENUMERATE, NULL, NULL}, + {"partition_dirs", _PARTITION_DIRS, JSPROP_ENUMERATE, NULL, NULL}, + {"priority", _PRIORITY, JSPROP_ENUMERATE, NULL, NULL}, + {"q_extentsize", _Q_EXTENTSIZE, JSPROP_ENUMERATE, NULL, NULL}, + {"re_delim", _RE_DELIM, JSPROP_ENUMERATE, NULL, NULL}, + {"re_len", _RE_LEN, JSPROP_ENUMERATE, NULL, NULL}, + {"re_pad", _RE_PAD, JSPROP_ENUMERATE, NULL, NULL}, + {"re_source", _RE_SOURCE, JSPROP_ENUMERATE, NULL, NULL}, + + {"st_buckets", _ST_BUCKETS, JSPROP_ENUMERATE, NULL, NULL}, + {"st_cur_recno", _ST_CUR_RECNO, JSPROP_ENUMERATE, NULL, NULL}, + {"st_extentsize", _ST_EXTENTSIZE, JSPROP_ENUMERATE, NULL, NULL}, + {"st_ffactor", _ST_FFACTOR, JSPROP_ENUMERATE, NULL, NULL}, + {"st_first_recno", _ST_FIRST_RECNO, JSPROP_ENUMERATE, NULL, NULL}, + {"st_magic", _ST_MAGIC, JSPROP_ENUMERATE, NULL, NULL}, + {"st_minkey", _ST_MINKEY, JSPROP_ENUMERATE, NULL, NULL}, + {"st_ndata", _ST_NDATA, JSPROP_ENUMERATE, NULL, NULL}, + {"st_nkeys", _ST_NKEYS, JSPROP_ENUMERATE, NULL, NULL}, + {"st_pagcnt", _ST_PAGECNT, JSPROP_ENUMERATE, NULL, NULL}, + {"st_pagesize", _ST_PAGESIZE, JSPROP_ENUMERATE, NULL, NULL}, + {"st_re_len", _ST_RE_LEN, JSPROP_ENUMERATE, NULL, NULL}, + {"st_re_pad", _ST_RE_PAD, JSPROP_ENUMERATE, NULL, NULL}, + {"st_version", _ST_VERSION, JSPROP_ENUMERATE, NULL, NULL}, + +#ifndef NOTFAST + {"st_bfree", _ST_BFREE, JSPROP_ENUMERATE, NULL, NULL}, + {"st_big_bfree", _ST_BIG_BFREE, JSPROP_ENUMERATE, NULL, NULL}, + {"st_bigpages", _ST_BIGPAGES, JSPROP_ENUMERATE, NULL, NULL}, + {"st_bt_dup_pg", _ST_BT_DUP_PG, JSPROP_ENUMERATE, NULL, NULL}, + {"st_bt_dup_pgfree",_ST_BT_DUP_PGFREE, JSPROP_ENUMERATE, NULL, NULL}, + {"st_bt_empty_pg", _ST_BT_EMPTY_PG, JSPROP_ENUMERATE, NULL, NULL}, + {"st_bt_free", _ST_BT_FREE, JSPROP_ENUMERATE, NULL, NULL}, + {"st_bt_int_pg", _ST_BT_INT_PG, JSPROP_ENUMERATE, NULL, NULL}, + {"st_bt_int_pgfree",_ST_BT_INT_PGFREE, JSPROP_ENUMERATE, NULL, NULL}, + {"st_bt_leaf_pg", _ST_BT_LEAF_PG, JSPROP_ENUMERATE, NULL, NULL}, + {"st_bt_leaf_pgfree", _ST_BT_LEAF_PGFREE, JSPROP_ENUMERATE, NULL, NULL}, + {"st_bt_levels", _ST_BT_LEVELS, JSPROP_ENUMERATE, NULL, NULL}, + {"st_bt_over_pg", _ST_BT_OVER_PG, JSPROP_ENUMERATE, NULL, NULL}, + {"st_bt_over_pgfree", _ST_BT_OVER_PGFREE, JSPROP_ENUMERATE, NULL, NULL}, + {"st_dup", _ST_DUP, JSPROP_ENUMERATE, NULL, NULL}, + {"st_dup_free", _ST_DUP_FREE, JSPROP_ENUMERATE, NULL, NULL}, + {"st_free", _ST_FREE, JSPROP_ENUMERATE, NULL, NULL}, + {"st_overflows", _ST_OVERFLOWS, JSPROP_ENUMERATE, NULL, NULL}, + {"st_ovfl_free", _ST_OVFL_FREE, JSPROP_ENUMERATE, NULL, NULL}, + {"st_pages", _ST_PAGES, JSPROP_ENUMERATE, NULL, NULL}, + {"st_pgfree", _ST_PGFREE, JSPROP_ENUMERATE, NULL, NULL}, +#endif + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmdb_getFastStats(JSContext *cx, JSObject *obj, jsval id, jsval *vp, + void * _txn, uint32_t flags) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + jsint tiny = JSVAL_TO_INT(id); + + DBTYPE _type = DB_UNKNOWN; + DB_TXN * txn = _txn; + void * _sp = NULL; + int ret = db->stat(db, txn, &_sp, flags); + DB_BTREE_STAT *bsp = _sp; + DB_HASH_STAT *hsp = _sp; + DB_QUEUE_STAT *qsp = _sp; + jsdouble dorig = 0.0123456789; + jsdouble d = dorig; + + ret = db->get_type(db, &_type); + switch (_type) { + case DB_RECNO: + case DB_BTREE: + switch (tiny) { + case _ST_MAGIC: d = bsp->bt_magic; break; + case _ST_VERSION: d = bsp->bt_version; break; + case _ST_NKEYS: d = bsp->bt_nkeys; break; + case _ST_NDATA: d = bsp->bt_ndata; break; + case _ST_MINKEY: d = bsp->bt_minkey; break; + case _ST_RE_LEN: d = bsp->bt_re_len; break; + case _ST_RE_PAD: d = bsp->bt_re_pad; break; + case _ST_PAGESIZE: d = bsp->bt_pagesize; break; + case _ST_PAGECNT: d = bsp->bt_pagecnt; break; +#ifndef NOTFAST + case _ST_BT_LEVELS: d = bsp->bt_levels; break; + case _ST_BT_INT_PG: d = bsp->bt_int_pg; break; + case _ST_BT_LEAF_PG: d = bsp->bt_leaf_pg; break; + case _ST_BT_DUP_PG: d = bsp->bt_dup_pg; break; + case _ST_BT_OVER_PG: d = bsp->bt_over_pg; break; + case _ST_BT_EMPTY_PG: d = bsp->bt_empty_pg; break; + case _ST_BT_FREE: d = bsp->bt_free; break; + case _ST_BT_INT_PGFREE: d = bsp->bt_int_pgfree; break; + case _ST_BT_LEAF_PGFREE: d = bsp->bt_leaf_pgfree; break; + case _ST_BT_DUP_PGFREE: d = bsp->bt_dup_pgfree; break; + case _ST_BT_OVER_PGFREE: d = bsp->bt_over_pgfree; break; +#endif + } break; + case DB_HASH: + switch (tiny) { + case _ST_MAGIC: d = hsp->hash_magic; break; + case _ST_VERSION: d = hsp->hash_version; break; + case _ST_PAGESIZE: d = hsp->hash_pagesize; break; + case _ST_PAGECNT: d = hsp->hash_pagecnt; break; + case _ST_NKEYS: d = hsp->hash_nkeys; break; + case _ST_NDATA: d = hsp->hash_ndata; break; + case _ST_FFACTOR: d = hsp->hash_ffactor; break; + case _ST_BUCKETS: d = hsp->hash_buckets; break; +#ifndef NOTFAST + case _ST_FREE: d = hsp->hash_free; break; + case _ST_BFREE: d = hsp->hash_bfree; break; + case _ST_BIGPAGES: d = hsp->hash_bigpages; break; + case _ST_BIG_BFREE: d = hsp->hash_big_bfree; break; + case _ST_OVERFLOWS: d = hsp->hash_overflows; break; + case _ST_OVFL_FREE: d = hsp->hash_ovfl_free; break; + case _ST_DUP: d = hsp->hash_dup; break; + case _ST_DUP_FREE: d = hsp->hash_dup_free; break; +#endif + } break; + case DB_QUEUE: + switch (tiny) { + case _ST_MAGIC: d = qsp->qs_magic; break; + case _ST_VERSION: d = qsp->qs_version; break; + case _ST_PAGESIZE: d = qsp->qs_pagesize; break; + case _ST_EXTENTSIZE: d = qsp->qs_extentsize; break; + case _ST_NKEYS: d = qsp->qs_nkeys; break; + case _ST_NDATA: d = qsp->qs_ndata; break; + case _ST_RE_LEN: d = qsp->qs_re_len; break; + case _ST_RE_PAD: d = qsp->qs_re_pad; break; + case _ST_FIRST_RECNO: d = qsp->qs_first_recno; break; + case _ST_CUR_RECNO: d = qsp->qs_cur_recno; break; +#ifndef NOTFAST + case _ST_PAGES: d = qsp->qs_pages; break; + case _ST_PGFREE: d = qsp->qs_pgfree; break; +#endif + } break; + case DB_UNKNOWN: + break; + } + + _sp = _free(_sp); + + if (d != dorig) { + if (!JS_NewNumberValue(cx, d, vp)) + *vp = JSVAL_FALSE; + } else + *vp = JSVAL_VOID; + + return JS_TRUE; +} + +#define _RET_B(_bool) ((_bool) > 0 ? JSVAL_TRUE: JSVAL_FALSE) +#define _RET_S(_str) \ + ((_str) ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, (_str))) : JSVAL_NULL) +#define _GET_S(_test) ((_test) ? _RET_S(_s) : JSVAL_VOID) +#define _GET_U(_test) ((_test) ? INT_TO_JSVAL(_u) : JSVAL_VOID) +#define _GET_I(_test) ((_test) ? INT_TO_JSVAL(_i) : JSVAL_VOID) +#define _GET_B(_test) ((_test) ? _RET_B(_i) : JSVAL_VOID) + +static JSBool +rpmdb_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + const char ** _av = NULL; + int _ac = 0; + const char * _s = NULL; + const char * _t = NULL; + uint32_t _gb = 0; + uint32_t _u = 0; + int _i = 0; + FILE * _fp = NULL; + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + + case _BYTESWAPPED: *vp = _GET_I(!db->get_byteswapped(db, &_i)); break; + case _DBFILE: *vp = _GET_S(!db->get_dbname(db, &_s, &_t)); break; + case _DBNAME: *vp = _GET_S(!db->get_dbname(db, &_t, &_s)); break; + case _MULTIPLE: *vp = _RET_B(db->get_multiple(db)); break; + case _OPEN_FLAGS: *vp = _GET_U(!db->get_open_flags(db, &_u)); break; + case _TYPE: *vp = _GET_U(!db->get_type(db, &_u)); break; + case _BT_MINKEY: *vp = _GET_U(!db->get_bt_minkey(db, &_u)); break; + case _CACHESIZE: *vp = _GET_U(!db->get_cachesize(db, &_gb, &_u, &_i)); break; + case _CREATE_DIR: +#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8) + *vp = _GET_S(!db->get_create_dir(db, &_s)); +#else + *vp = JSVAL_VOID; +#endif + break; + case _ENCRYPT: *vp = _GET_U(!db->get_encrypt_flags(db, &_u)); break; + case _ERRFILE: + db->get_errfile(db, &_fp); + _s = (_fp ? "other" : NULL); + if (_fp == stdin) _s = "stdin"; + if (_fp == stdout) _s = "stdout"; + if (_fp == stderr) _s = "stderr"; + *vp = _RET_S(_s); + break; + case _ERRPFX: + db->get_errpfx(db, &_s); + *vp = _RET_S(_s); + break; + case _FLAGS: *vp = _GET_U(!db->get_flags(db, &_u)); break; + case _H_FFACTOR: *vp = _GET_U(!db->get_h_ffactor(db, &_u)); break; + case _H_NELEM: *vp = _GET_U(!db->get_h_nelem(db, &_u)); break; + case _LORDER: *vp = _GET_I(!db->get_lorder(db, &_i)); break; + case _MPF: + { DB_MPOOLFILE * _mpf = db->get_mpf(db); + if (_mpf) { + JSObject * o = JS_NewObject(cx, &rpmmpfClass, NULL, NULL); + *vp = (o && JS_SetPrivate(cx, o, (void *)_mpf) + ? OBJECT_TO_JSVAL(o) : JSVAL_VOID); + } else + *vp = JSVAL_NULL; + } break; + case _MSGFILE: + db->get_msgfile(db, &_fp); + _s = (_fp ? "other" : NULL); + if (_fp == stdin) _s = "stdin"; + if (_fp == stdout) _s = "stdout"; + if (_fp == stderr) _s = "stderr"; + *vp = _RET_S(_s); + break; + case _PAGESIZE: *vp = _GET_U(!db->get_pagesize(db, &_u)); break; + case _PARTITION_DIRS: break; +#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8) + if (!db->get_partition_dirs(db, &_av) + && (_ac = argvCount(_av)) > 0) + { + _s = _av[0]; /* XXX FIXME: return array */ + *vp = _RET_S(_s); + } else +#endif + *vp = JSVAL_VOID; + break; + case _PRIORITY: *vp = _GET_U(!db->get_priority(db, &_u)); break; + case _Q_EXTENTSIZE: *vp = _GET_U(!db->get_q_extentsize(db, &_u)); break; + case _RE_DELIM: *vp = _GET_I(!db->get_re_delim(db, &_i)); break; + case _RE_LEN: *vp = _GET_U(!db->get_re_len(db, &_u)); break; + case _RE_PAD: *vp = _GET_I(!db->get_re_pad(db, &_i)); break; + case _RE_SOURCE: *vp = _GET_S(!db->get_re_source(db, &_s)); break; + case _ST_BUCKETS: + case _ST_CUR_RECNO: + case _ST_EXTENTSIZE: + case _ST_FFACTOR: + case _ST_FIRST_RECNO: + case _ST_MAGIC: + case _ST_MINKEY: + case _ST_NDATA: + case _ST_NKEYS: + case _ST_PAGECNT: + case _ST_PAGESIZE: + case _ST_RE_LEN: + case _ST_RE_PAD: + case _ST_VERSION: + { void * _txn = NULL; + uint32_t _flags = DB_READ_UNCOMMITTED | DB_FAST_STAT; + (void) rpmdb_getFastStats(cx, obj, id, vp, _txn, _flags); + } break; + +#ifndef NOTFAST + case _ST_BFREE: + case _ST_BIG_BFREE: + case _ST_BIGPAGES: + case _ST_BT_DUP_PG: + case _ST_BT_DUP_PGFREE: + case _ST_BT_EMPTY_PG: + case _ST_BT_FREE: + case _ST_BT_INT_PG: + case _ST_BT_INT_PGFREE: + case _ST_BT_LEAF_PG: + case _ST_BT_LEAF_PGFREE: + case _ST_BT_LEVELS: + case _ST_BT_OVER_PG: + case _ST_BT_OVER_PGFREE: + case _ST_DUP: + case _ST_DUP_FREE: + case _ST_FREE: + case _ST_OVERFLOWS: + case _ST_OVFL_FREE: + case _ST_PAGES: + case _ST_PGFREE: + { void * _txn = NULL; + uint32_t _flags = DB_READ_UNCOMMITTED; + (void) rpmdb_getFastStats(cx, obj, id, vp, _txn, _flags); + } break; +#endif + + default: + break; + } + + return JS_TRUE; +} + +#define _PUT_S(_put) (JSVAL_IS_STRING(*vp) && !(_put) \ + ? JSVAL_TRUE : JSVAL_FALSE) +#define _PUT_U(_put) (JSVAL_IS_NUMBER(*vp) && !(_put) \ + ? JSVAL_TRUE : JSVAL_FALSE) +#define _PUT_I(_put) (JSVAL_IS_NUMBER(*vp) && !(_put) \ + ? JSVAL_TRUE : JSVAL_FALSE) + +static JSBool +rpmdb_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + const char * _s = NULL; + uint32_t _gb = 0; + uint32_t _b = 0; + uint32_t _u = 0; + int _i = 0; + int _nc = 0; + FILE * _fp = NULL; + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + if (JSVAL_IS_STRING(*vp)) + _s = JS_EncodeString(cx, JS_ValueToString(cx, *vp)); + if (JSVAL_IS_INT(*vp)) + _u = _i = JSVAL_TO_INT(*vp); + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + +#ifdef NOTYET + case _DBFILE: break; + case _DBNAME: break; +#endif + + case _BT_MINKEY: *vp = _PUT_U(db->set_bt_minkey(db, _u)); break; + case _CACHESIZE: + if (!db->get_cachesize(db, &_gb, &_b, &_nc)) { + _b = _u; + *vp = !db->set_cachesize(db, _gb, _b, _nc) + ? JSVAL_TRUE : JSVAL_FALSE; + } else + *vp = JSVAL_FALSE; + break; + case _CREATE_DIR: +#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8) + *vp = _PUT_S(db->set_create_dir(db, _s)); +#else + *vp = JSVAL_VOID; +#endif + break; + case _ENCRYPT: *vp = _PUT_S(db->set_encrypt(db, _s, DB_ENCRYPT_AES)); break; + case _ERRFILE: + /* XXX FIXME: cleaner typing */ + _fp = NULL; + if (!strcmp(_s, "stdout")) _fp = stdout; + if (!strcmp(_s, "stderr")) _fp = stderr; + db->set_errfile(db, _fp); + *vp = JSVAL_TRUE; + break; + case _ERRPFX: + db->set_errpfx(db, _s); + *vp = JSVAL_TRUE; + break; + case _FLAGS: *vp = _PUT_U(db->set_flags(db, _u)); break; + case _H_FFACTOR: *vp = _PUT_U(db->set_h_ffactor(db, _u)); break; + case _H_NELEM: *vp = _PUT_U(db->set_h_nelem(db, _u)); break; + case _LORDER: *vp = _PUT_I(db->set_h_nelem(db, _i)); break; + case _MSGFILE: + /* XXX FIXME: cleaner typing */ + _fp = NULL; + if (_s != NULL) { + if (!strcmp(_s, "stdout")) _fp = stdout; + else if (!strcmp(_s, "stderr")) _fp = stderr; + /* XXX FIXME: fp = fopen(_s, O_RDWR); with error checking */ + } + db->set_errfile(db, _fp); + *vp = JSVAL_TRUE; + break; + case _PAGESIZE: *vp = _PUT_U(db->set_pagesize(db, _u)); break; + case _PARTITION_DIRS: break; /* XXX FIXME */ + case _PRIORITY: *vp = _PUT_U(db->set_priority(db, _u)); break; + case _Q_EXTENTSIZE: *vp = _PUT_U(db->set_q_extentsize(db, _u)); break; + case _RE_DELIM: *vp = _PUT_I(db->set_re_delim(db, _i)); break; + case _RE_LEN: *vp = _PUT_U(db->set_re_len(db, _u)); break; + case _RE_PAD: *vp = _PUT_I(db->set_re_pad(db, _i)); break; + case _RE_SOURCE: *vp = _PUT_S(db->set_re_source(db, _s)); break; + + default: + break; + } + + _s = _free(_s); + + return JS_TRUE; +} + +static JSBool +rpmdb_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmdb_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static DB * +rpmdb_init(JSContext *cx, JSObject *obj, DB_ENV * dbenv, uint32_t flags) +{ + DB * db = NULL; + int ret = db_create(&db, dbenv, flags); + + if (ret || db == NULL || !JS_SetPrivate(cx, obj, (void *)db)) { + if (dbenv) + dbenv->err(dbenv, ret, "db_create"); + else + fprintf(stderr, "db_create: %s\n", db_strerror(ret)); + + if (db) + ret = db->close(db, 0); + db = NULL; + } else { + FILE * _errfile = stderr; + if (dbenv) + dbenv->get_errfile(dbenv, &_errfile); + if (_errfile) + db->set_errfile(db, _errfile); + db->app_private = NULL; + } + +if (_debug) +fprintf(stderr, "<== %s(%p,%p) db %p\n", __FUNCTION__, cx, obj, db); + return db; +} + +static void +rpmdb_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbClass, NULL); + DB * db = ptr; + uint32_t _flags = 0; + +_DTOR_DEBUG_ENTRY(_debug); + + if (db) + (void) db->close(db, _flags); +} + +static JSBool +rpmdb_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSObject * o = NULL; + DB_ENV * _dbenv = NULL; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/ou", &o, &_flags))) + goto exit; + + if (OBJ_IS_RPMDBE(cx, o)) + _dbenv = JS_GetInstancePrivate(cx, o, &rpmdbeClass, NULL); + + if (JS_IsConstructing(cx, vp)) { + (void) rpmdb_init(cx, obj, _dbenv, _flags); + } else { + if ((obj = JS_NewObject(cx, &rpmdbClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdb_call(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + /* XXX obj is the global object so lookup "this" object. */ + JSObject * o = JSVAL_TO_OBJECT(argv[-2]); + void * ptr = JS_GetInstancePrivate(cx, o, &rpmdbClass, NULL); +#ifdef NOTYET + DB * db = ptr; + const char *_fn = NULL; + const char * _con = NULL; +#endif + JSBool ok = JS_FALSE; + +#ifdef NOTYET + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_fn))) + goto exit; + + *vp = (db && _fn && (_con = rpmdbLgetfilecon(db, _fn)) != NULL) + ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _con)) : JSVAL_VOID; + _con = _free(_con); + + ok = JS_TRUE; + +exit: +#endif + +if (_debug) +fprintf(stderr, "<== %s(%p,%p[%u],%p) o %p ptr %p\n", __FUNCTION__, cx, argv, (unsigned)argc, vp, o, ptr); + + return ok; +} + +/* --- Class initialization */ +JSClass rpmdbClass = { + "Db", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmdb_addprop, rpmdb_delprop, rpmdb_getprop, rpmdb_setprop, + (JSEnumerateOp)rpmdb_enumerate, (JSResolveOp)rpmdb_resolve, + rpmdb_convert, rpmdb_dtor, + + rpmdb_getobjectops, rpmdb_checkaccess, + rpmdb_call, rpmdb_construct, + rpmdb_xdrobject, rpmdb_hasinstance, + rpmdb_mark, rpmdb_reserveslots, +}; + +JSObject * +rpmjs_InitDbClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmdbClass, rpmdb_ctor, 1, + rpmdb_props, rpmdb_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewDbObject(JSContext *cx, void * _dbenv, uint32_t _flags) +{ + JSObject *obj; + DB_ENV * dbenv = _dbenv; + DB * db; + + if ((obj = JS_NewObject(cx, &rpmdbClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((db = rpmdb_init(cx, obj, dbenv, _flags)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmdb, Db, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmdb-js.h b/rpm-5.4.9/js/rpmdb-js.h new file mode 100644 index 0000000..d6a16c5 --- /dev/null +++ b/rpm-5.4.9/js/rpmdb-js.h @@ -0,0 +1,49 @@ +#ifndef H_RPMDB_JS +#define H_RPMDB_JS + + +/** + * \file js/rpmdb-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmdbClass; +#define OBJ_IS_RPMDB(_cx, _o) (JS_GET_CLASS(_cx, _o) == &rpmdbClass) + +#if defined(_RPMDB_JS_INTERNAL) +#include + +/** + * A type punned data structure to avoid allocating int32/int64 keys/values. + */ +typedef struct _RPMDBT_s { + DBT dbt; + union { + int32_t _i; + int64_t _ll; + } _u; +} _RPMDBT; +#define _RPMDBT_INIT {{0}} +#define _RPMDBT_PTR(_p) (&(_p).dbt) +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitDbClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewDbObject(JSContext *cx, void * _dbenv, uint32_t _flags); + +#if defined(_RPMDB_JS_INTERNAL) +extern int rpmdb_v2dbt(JSContext *cx, jsval v, _RPMDBT * p); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMDB_JS */ diff --git a/rpm-5.4.9/js/rpmdbc-js.c b/rpm-5.4.9/js/rpmdbc-js.c new file mode 100644 index 0000000..58e1004 --- /dev/null +++ b/rpm-5.4.9/js/rpmdbc-js.c @@ -0,0 +1,703 @@ +/** \ingroup js_c + * \file js/rpmdbc-js.c + */ + +#include "system.h" + +#define _RPMDB_JS_INTERNAL +#include "rpmdb-js.h" +#include "rpmdbc-js.h" +#include "rpmjs-debug.h" + +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmdbc_addprop JS_PropertyStub +#define rpmdbc_delprop JS_PropertyStub +#define rpmdbc_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmdbc_getobjectops NULL +#define rpmdbc_checkaccess NULL +#define rpmdbc_call rpmdbc_call +#define rpmdbc_construct rpmdbc_ctor +#define rpmdbc_xdrobject NULL +#define rpmdbc_hasinstance NULL +#define rpmdbc_mark NULL +#define rpmdbc_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmdbc_equality NULL +#define rpmdbc_outerobject NULL +#define rpmdbc_innerobject NULL +#define rpmdbc_iteratorobject NULL +#define rpmdbc_wrappedobject NULL + +/* --- helpers */ + +/* --- Object methods */ + +static JSBool +rpmdbc_Close(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbcClass, NULL); + DBC * dbc = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbc == NULL) goto exit; + *vp = JSVAL_FALSE; + + { int ret = dbc->close(dbc); + if (ret) + fprintf(stderr, "DBC->close: %s\n", db_strerror(ret)); + else + *vp = JSVAL_TRUE; + dbc = ptr = NULL; + (void) JS_SetPrivate(cx, obj, ptr); + } + + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmdbc_Cmp(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbcClass, NULL); + DBC * dbc = ptr; + JSObject * _o = NULL; + DBC * _otherdbc = NULL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbc == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "o", &_o)) + || (_otherdbc = JS_GetInstancePrivate(cx, _o, &rpmdbcClass, NULL)) == NULL) + goto exit; + + { int _result = 0; + uint32_t _flags = 0; + int ret = ENOTSUP; +#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8) + ret = dbc->cmp(dbc, _otherdbc, &_result, _flags); +#endif + switch (ret) { + default: + fprintf(stderr, "DBC->cmp: %s\n", db_strerror(ret)); + goto exit; + break; + case 0: + *vp = (!_result ? JSVAL_TRUE : JSVAL_FALSE); + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbc_Count(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbcClass, NULL); + DBC * dbc = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbc == NULL) goto exit; + *vp = JSVAL_FALSE; + + { db_recno_t _count = 0; + uint32_t _flags = 0; + int ret = dbc->count(dbc, &_count, _flags); + switch (ret) { + default: + fprintf(stderr, "DBC->count: %s\n", db_strerror(ret)); + goto exit; + break; + case 0: + if (!JS_NewNumberValue(cx, (jsdouble)_count, vp)) + *vp = JSVAL_VOID; + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbc_Del(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbcClass, NULL); + DBC * dbc = ptr; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbc == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + { int ret = dbc->del(dbc, _flags); + switch (ret) { + default: + fprintf(stderr, "DBC->del: %s\n", db_strerror(ret)); + goto exit; + break; + case 0: + *vp = JSVAL_TRUE; + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbc_Dup(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbcClass, NULL); + DBC * dbc = ptr; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbc == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + { JSObject * _o = NULL; + DBC * _cursor = NULL; + int ret = dbc->dup(dbc, &_cursor, _flags); + switch (ret) { + default: + fprintf(stderr, "DBC->dup: %s\n", db_strerror(ret)); + goto exit; + break; + case 0: + if ((_o = JS_NewObject(cx, &rpmdbcClass, NULL, NULL)) == NULL + || !JS_SetPrivate(cx, _o, (void *)_cursor)) + { + if (_cursor) _cursor->close(_cursor); + /* XXX error msg */ + goto exit; + } + *vp = OBJECT_TO_JSVAL(_o); + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbc_Get(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbcClass, NULL); + DBC * dbc = ptr; + jsval _kv = JSVAL_NULL; + _RPMDBT _k = _RPMDBT_INIT; + jsval _dv = JSVAL_NULL; + _RPMDBT _d = _RPMDBT_INIT; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbc == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "v/vu", &_kv, &_dv, &_flags))) + goto exit; + if (rpmdb_v2dbt(cx, _kv, &_k)) + goto exit; + if (rpmdb_v2dbt(cx, _dv, &_d)) + goto exit; + + { int ret = dbc->get(dbc, _RPMDBT_PTR(_k), _RPMDBT_PTR(_d), _flags); +#ifdef NOTNOW +fprintf(stderr, "==> %s: ret %d = dbc->get(%p, %p[%u], %p[%u], 0x%x)\n", +__FUNCTION__, ret, dbc, +_RPMDBT_PTR(_k)->data, (unsigned)_RPMDBT_PTR(_k)->size, +_RPMDBT_PTR(_d)->data, (unsigned)_RPMDBT_PTR(_d)->size, +_flags); +#endif + switch (ret) { + default: + fprintf(stderr, "DBC->get: %s\n", db_strerror(ret)); + goto exit; + break; + case 0: + *vp = STRING_TO_JSVAL(JS_NewStringCopyN(cx, _RPMDBT_PTR(_d)->data, _RPMDBT_PTR(_d)->size)); + break; + case DB_NOTFOUND: + *vp = JSVAL_VOID; + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbc_Pget(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbcClass, NULL); + DBC * dbc = ptr; + jsval _kv = JSVAL_NULL; + _RPMDBT _k = _RPMDBT_INIT; + jsval _dv = JSVAL_NULL; + _RPMDBT _d = _RPMDBT_INIT; + _RPMDBT _p = _RPMDBT_INIT; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbc == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "v/vu", &_kv, &_dv, &_flags))) + goto exit; + if (rpmdb_v2dbt(cx, _kv, &_k)) + goto exit; + if (rpmdb_v2dbt(cx, _dv, &_d)) + goto exit; + + { int ret = dbc->pget(dbc, _RPMDBT_PTR(_k), _RPMDBT_PTR(_p), _RPMDBT_PTR(_d), _flags); + switch (ret) { + default: + fprintf(stderr, "DBC->pget: %s\n", db_strerror(ret)); + goto exit; + break; + case 0: + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _RPMDBT_PTR(_d)->data)); + break; + case DB_NOTFOUND: + *vp = JSVAL_VOID; + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbc_Put(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbcClass, NULL); + DBC * dbc = ptr; + jsval _kv = JSVAL_NULL; + _RPMDBT _k = _RPMDBT_INIT; + jsval _dv = JSVAL_NULL; + _RPMDBT _d = _RPMDBT_INIT; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbc == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "vv/u", &_kv, &_dv, &_flags))) + goto exit; + if (rpmdb_v2dbt(cx, _kv, &_k)) + goto exit; + if (rpmdb_v2dbt(cx, _dv, &_d)) + goto exit; + + { int ret = dbc->put(dbc, _RPMDBT_PTR(_k), _RPMDBT_PTR(_d), _flags); + switch (ret) { + default: + fprintf(stderr, "DBC->put: %s\n", db_strerror(ret)); + *vp = JSVAL_FALSE; + goto exit; + break; + case 0: + *vp = JSVAL_TRUE; + break; + case DB_NOTFOUND: + *vp = JSVAL_VOID; + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSFunctionSpec rpmdbc_funcs[] = { + JS_FS("close", rpmdbc_Close, 0,0), + JS_FS("cmp", rpmdbc_Cmp, 0,0), + JS_FS("count", rpmdbc_Count, 0,0), + JS_FS("del", rpmdbc_Del, 0,0), + JS_FS("dup", rpmdbc_Dup, 0,0), + JS_FS("get", rpmdbc_Get, 0,0), + JS_FS("pget", rpmdbc_Pget, 0,0), + JS_FS("put", rpmdbc_Put, 0,0), + JS_FS_END +}; + +/* --- Object properties */ + +#define _TABLE(_v) #_v, _##_v, JSPROP_ENUMERATE, NULL, NULL + +enum rpmdbc_tinyid { + _DEBUG = -2, + _LENGTH = -3, + _PRIORITY = -4, +}; + +static JSPropertySpec rpmdbc_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {"length", _LENGTH, JSPROP_ENUMERATE, NULL, NULL}, + {"priority",_PRIORITY, JSPROP_ENUMERATE, NULL, NULL}, + + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmdbc_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbcClass, NULL); + DBC * dbc = ptr; + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_NewNumberValue(cx, (jsdouble)_debug, vp)) + *vp = JSVAL_VOID; + break; + case _LENGTH: + { db_recno_t _count = 0; + if (!dbc->count(dbc, &_count, 0)) { + if (!JS_NewNumberValue(cx, (jsdouble)_count, vp)) + *vp = JSVAL_VOID; + } else + *vp = JSVAL_VOID; + } break; + case _PRIORITY: + { DB_CACHE_PRIORITY _priority = DB_PRIORITY_UNCHANGED; + if (!dbc->get_priority(dbc, &_priority)) { + if (!JS_NewNumberValue(cx, (jsdouble)_priority, vp)) + *vp = JSVAL_VOID; + } else + *vp = JSVAL_VOID; + } break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmdbc_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbcClass, NULL); + DBC * dbc = ptr; + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + *vp = JSVAL_VOID; + break; + case _PRIORITY: + { uint32_t _u = 0; + if (JS_ValueToECMAUint32(cx, *vp, &_u)) { + DB_CACHE_PRIORITY _priority = _u; + *vp = !dbc->set_priority(dbc, _priority) + ? JSVAL_TRUE : JSVAL_FALSE; + } else + *vp = JSVAL_VOID; + } break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmdbc_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbcClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmdbc_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbcClass, NULL); + DBC * dbc = ptr; + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_ZERO; + if (idp) { + db_recno_t _count = 0; + uint32_t _flags = 0; + int ret = dbc->count(dbc, &_count, _flags); + switch (ret) { + default: + *idp = JSVAL_ZERO; + break; + case 0: + *idp = INT_TO_JSVAL(_count); + break; + } + } + break; + case JSENUMERATE_NEXT: + { DBT _k = {0}; + DBT _d = {0}; + uint32_t _flags = 0; + int ret = dbc->get(dbc, &_k, &_d, _flags); + int ix = JSVAL_TO_INT(*statep); + *statep = INT_TO_JSVAL(ix + 1); +#ifdef NOTNOW +fprintf(stderr, "==> %s: ret %d = dbc->get(%p, %p[%u], %p[%u], 0x%x)\n", +__FUNCTION__, ret, dbc, +_k.data, (unsigned)_k.size, +_d.data, (unsigned)_d.size, +_flags); +#endif + switch (ret) { + default: + *idp = JSVAL_VOID; + break; + case 0: + *idp = STRING_TO_JSVAL(JS_NewStringCopyN(cx, _d.data, _d.size)); + break; + case DB_NOTFOUND: + *idp = JSVAL_VOID; + break; + } + } + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static DBC * +rpmdbc_init(JSContext *cx, JSObject *obj) +{ + DBC * dbc = NULL; +#ifdef NOTYET + uint32_t _flags = 0; + + if (rpmdbc_env_create(&db, _flags) || dbc == NULL + || !JS_SetPrivate(cx, obj, (void *)dbc)) +#else + if (!JS_SetPrivate(cx, obj, (void *)dbc)) +#endif + { + if (dbc) + (void) dbc->close(dbc); + /* XXX error msg */ + dbc = NULL; + } + +if (_debug) +fprintf(stderr, "<== %s(%p,%p) dbc %p\n", __FUNCTION__, cx, obj, dbc); + + return dbc; +} + +static void +rpmdbc_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbcClass, NULL); + DBC * dbc = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + if (dbc) + (void) dbc->close(dbc); +} + +static JSBool +rpmdbc_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (JS_IsConstructing(cx, vp)) { + (void) rpmdbc_init(cx, obj); + } else { + if ((obj = JS_NewObject(cx, &rpmdbcClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbc_call(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + /* XXX obj is the global object so lookup "this" object. */ + JSObject * o = JSVAL_TO_OBJECT(argv[-2]); + void * ptr = JS_GetInstancePrivate(cx, o, &rpmdbcClass, NULL); +#ifdef NOTYET + DBC * dbc = ptr; + const char *_fn = NULL; + const char * _con = NULL; +#endif + JSBool ok = JS_FALSE; + +#ifdef NOTYET + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_fn))) + goto exit; + + *vp = (dbc && _fn && (_con = rpmdbcLgetfilecon(dbc, _fn)) != NULL) + ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _con)) : JSVAL_VOID; + _con = _free(_con); + + ok = JS_TRUE; + +exit: +#endif + +if (_debug) +fprintf(stderr, "<== %s(%p,%p[%u],%p) o %p ptr %p\n", __FUNCTION__, cx, argv, (unsigned)argc, vp, o, ptr); + + return ok; +} + +/* --- Class initialization */ +JSClass rpmdbcClass = { + "Dbc", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmdbc_addprop, rpmdbc_delprop, rpmdbc_getprop, rpmdbc_setprop, + (JSEnumerateOp)rpmdbc_enumerate, (JSResolveOp)rpmdbc_resolve, + rpmdbc_convert, rpmdbc_dtor, + + rpmdbc_getobjectops, rpmdbc_checkaccess, + rpmdbc_call, rpmdbc_construct, + rpmdbc_xdrobject, rpmdbc_hasinstance, + rpmdbc_mark, rpmdbc_reserveslots, +}; + +JSObject * +rpmjs_InitDbcClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmdbcClass, rpmdbc_ctor, 1, + rpmdbc_props, rpmdbc_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewDbcObject(JSContext *cx) +{ + JSObject *obj; + DBC * dbc; + + if ((obj = JS_NewObject(cx, &rpmdbcClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((dbc = rpmdbc_init(cx, obj)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmdbc, Dbc, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmdbc-js.h b/rpm-5.4.9/js/rpmdbc-js.h new file mode 100644 index 0000000..ef189a7 --- /dev/null +++ b/rpm-5.4.9/js/rpmdbc-js.h @@ -0,0 +1,27 @@ +#ifndef H_RPMDBC_JS +#define H_RPMDBC_JS + +/** + * \file js/rpmdbc-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmdbcClass; +#define OBJ_IS_RPMDBC(_cx, _o) (JS_GET_CLASS(_cx, _o) == &rpmdbcClass) + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitDbcClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewDbcObject(JSContext *cx); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMDBC_JS */ diff --git a/rpm-5.4.9/js/rpmdbe-js.c b/rpm-5.4.9/js/rpmdbe-js.c new file mode 100644 index 0000000..c80e5f9 --- /dev/null +++ b/rpm-5.4.9/js/rpmdbe-js.c @@ -0,0 +1,2521 @@ +/** \ingroup js_c + * \file js/rpmdbe-js.c + */ + +#include "system.h" +#if defined(HAVE_FTOK) +#include /* XXX ftok(3) */ +#endif + +#define _RPMDB_JS_INTERNAL +#include "rpmdb-js.h" +#include "rpmdbe-js.h" +#include "rpmtxn-js.h" +#include "rpmjs-debug.h" + +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmdbe_addprop JS_PropertyStub +#define rpmdbe_delprop JS_PropertyStub +#define rpmdbe_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmdbe_getobjectops NULL +#define rpmdbe_checkaccess NULL +#define rpmdbe_call rpmdbe_call +#define rpmdbe_construct rpmdbe_ctor +#define rpmdbe_xdrobject NULL +#define rpmdbe_hasinstance NULL +#define rpmdbe_mark NULL +#define rpmdbe_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmdbe_equality NULL +#define rpmdbe_outerobject NULL +#define rpmdbe_innerobject NULL +#define rpmdbe_iteratorobject NULL +#define rpmdbe_wrappedobject NULL + +/* --- helpers */ +#define _TABLE(_v) { #_v, DB_EVENT_##_v } +static struct _events_s { + const char * n; + uint32_t v; +} _events[] = { + _TABLE(NO_SUCH_EVENT), /* 0 */ + _TABLE(PANIC), /* 1 */ +#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8) + _TABLE(REG_ALIVE), /* 2 */ + _TABLE(REG_PANIC), /* 3 */ +#else + _TABLE(NO_SUCH_EVENT), /* 2 */ + _TABLE(NO_SUCH_EVENT), /* 3 */ +#endif + _TABLE(REP_CLIENT), /* 4 */ + _TABLE(REP_ELECTED), /* 5 */ + _TABLE(REP_MASTER), /* 6 */ + _TABLE(REP_NEWMASTER), /* 7 */ + _TABLE(REP_PERM_FAILED), /* 8 */ + _TABLE(REP_STARTUPDONE), /* 9 */ + _TABLE(WRITE_FAILED), /* 10 */ + _TABLE(NO_SUCH_EVENT), /* 11 */ + _TABLE(NO_SUCH_EVENT), /* 12 */ + _TABLE(NO_SUCH_EVENT), /* 13 */ + _TABLE(NO_SUCH_EVENT), /* 14 */ + _TABLE(NO_SUCH_EVENT), /* 15 */ +}; +#undef _TABLE + +static void +rpmdbe_event_notify(DB_ENV * dbenv, u_int32_t event, void * event_info) +{ + JSObject * o = (dbenv ? dbenv->app_private : NULL); +fprintf(stderr, "==> %s(%p, %s(%u), %p) o %p\n", __FUNCTION__, dbenv, _events[event & 0xf].n, event, event_info, o); +} + +static void +rpmdbe_feedback(DB_ENV * dbenv, int opcode, int percent) +{ + JSObject * o = (dbenv ? dbenv->app_private : NULL); +fprintf(stderr, "==> %s(%p, %d, %d) o %p\n", __FUNCTION__, dbenv, opcode, percent, o); +} + +#define _TABLE(_v) { #_v, DB_TXN_##_v } +static struct _appops_s { + const char * n; + uint32_t v; +} _appops[] = { + _TABLE(ABORT), /* 0 */ + _TABLE(APPLY), /* 1 */ + { "UNKNOWN", 2 }, + _TABLE(BACKWARD_ROLL), /* 3 */ + _TABLE(FORWARD_ROLL), /* 4 */ + _TABLE(OPENFILES), /* 5 */ + _TABLE(POPENFILES), /* 6 */ + _TABLE(PRINT), /* 7 */ +}; +#undef _TABLE + +static int +rpmdbe_app_dispatch(DB_ENV * dbenv, DBT * log_rec, DB_LSN * lsn, db_recops op) +{ + JSObject * o = (dbenv ? dbenv->app_private : NULL); +fprintf(stderr, "==> %s(%p, %p, %p, %s(%d)) o %p\n", __FUNCTION__, dbenv, log_rec, lsn, _appops[op & 0x7].n, op, o); + return 0; +} + +static void +rpmdbe_errcall(const DB_ENV * dbenv, const char * errpfx, const char * msg) +{ + JSObject * o = (dbenv ? dbenv->app_private : NULL); +fprintf(stderr, "==> %s(%p, %s, %s) o %p\n", __FUNCTION__, dbenv, errpfx, msg, o); +} + +static void +rpmdbe_msgcall(const DB_ENV * dbenv, const char * msg) +{ + JSObject * o = (dbenv ? dbenv->app_private : NULL); +fprintf(stderr, "==> %s(%p, %s) o %p\n", __FUNCTION__, dbenv, msg, o); +} + +static int +rpmdbe_isalive(DB_ENV *dbenv, pid_t pid, db_threadid_t tid, u_int32_t flags) + /*@*/ +{ + int alive = 1; /* assume all processes are alive */ + + switch (flags) { + case 0: + default: + /* XXX FIXME: check thread ID's */ + /*@fallthrough@*/ + case DB_MUTEX_PROCESS_ONLY: + alive = (!(kill(pid, 0) < 0 && errno == ESRCH)); + break; + } + return alive; +} + +/* --- Object methods */ + +static JSBool +rpmdbe_CdsgroupBegin(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (dbenv->app_private != NULL) { + JSObject * _o = NULL; + DB_TXN * _txn = NULL; + int ret = dbenv->cdsgroup_begin(dbenv, &_txn); + switch (ret) { + default: + dbenv->err(dbenv, ret, "DB_ENV->cdsgroup_begin"); + goto exit; + break; + case 0: + if ((_o = JS_NewObject(cx, &rpmtxnClass, NULL, NULL)) == NULL + || !JS_SetPrivate(cx, _o, (void *)_txn)) + { + if (_txn) _txn->discard(_txn, 0); + /* XXX error msg */ + goto exit; + } + *vp = OBJECT_TO_JSVAL(_o); + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_Close(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + { int ret = dbenv->close(dbenv, _flags); + if (ret) + fprintf(stderr, "DB_ENV->close: %s", db_strerror(ret)); + else + *vp = JSVAL_TRUE; + dbenv = ptr = NULL; + (void) JS_SetPrivate(cx, obj, ptr); + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_Dbremove(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + const char * _file = NULL; + const char * _database = NULL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s/s", &_file, &_database))) + goto exit; + + if (dbenv) { + DB_TXN * _txnid = NULL; + uint32_t _flags = 0; + int ret = dbenv->dbremove(dbenv, _txnid, _file, _database, _flags); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->dbremove(%s,%s)", _file, _database); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_Dbrename(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + const char * _file = NULL; + const char * _database = NULL; + const char * _newname = NULL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "sss", &_file, &_database, &_newname))) + goto exit; + + if (dbenv) { + DB_TXN * _txnid = NULL; + uint32_t _flags = 0; + int ret = dbenv->dbrename(dbenv, _txnid, _file, _database, _newname, _flags); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->dbrename(%s,%s,%s)", _file, _database, _newname); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_Failchk(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_VOID; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + if (dbenv->app_private != NULL) { + int ret = dbenv->failchk(dbenv, _flags); + switch (ret) { + default: + dbenv->err(dbenv, ret, "DB_ENV->failchk"); + break; + case DB_RUNRECOVERY: + *vp = JSVAL_FALSE; + break; + case 0: + *vp = JSVAL_TRUE; + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_FileidReset(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + const char * _file = NULL; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s/u", &_file, &_flags))) + goto exit; + + if (dbenv->app_private != NULL) { + int ret = dbenv->fileid_reset(dbenv, _file, _flags); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->fileid_reset"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_LockDetect(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_LockGet(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_LockId(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_LockIdFree(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_LockPut(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_LockStat(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_LockStatPrint(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_LockVec(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_LogArchive(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + if (dbenv->app_private != NULL) { + const char ** _av = NULL; + int ret = dbenv->log_archive(dbenv, (char ***) &_av, _flags); + + switch (ret) { + default: + dbenv->err(dbenv, ret, "DB_ENV->log_archive"); + break; + case DB_RUNRECOVERY: + *vp = JSVAL_FALSE; + break; + case 0: +argvPrint("log_archive", _av, NULL); + if (_av == NULL) { + *vp = JSVAL_NULL; + } else { + int _ac = argvCount(_av); + JSObject * o = JS_NewArrayObject(cx, 0, NULL); + int i; + *vp = OBJECT_TO_JSVAL(o); + for (i = 0; i < _ac; i++) { + jsval v = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _av[i])); + (void) JS_SetElement(cx, o, i, &v); + } + } + break; + } + } + + ok = JS_TRUE; + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_LogCursor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_LogFile(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_LogFlush(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_LogPrintf(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_LogPut(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_LogStat(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_LogStatPrint(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_LsnReset(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + const char * _file = NULL; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s/u", &_file, &_flags))) + goto exit; + + if (dbenv->app_private != NULL) { + int ret = dbenv->lsn_reset(dbenv, _file, _flags); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->lsn_reset"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_MempFcreate(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_MempRegister(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_MempStat(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + uint32_t _flags = DB_STAT_ALL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + if (dbenv->app_private != NULL) { + DB_MPOOL_STAT ** _gsp = NULL; /* XXX todo++ */ +#ifdef NOTYET + DB_MPOOL_FSTAT *(*_fsp)[] = NULL; +#endif + + int ret = dbenv->memp_stat(dbenv, _gsp, NULL, _flags); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->memp_stat"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_MempStatPrint(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + uint32_t _flags = DB_STAT_ALL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + if (dbenv->app_private != NULL) { + int ret = dbenv->memp_stat_print(dbenv, _flags); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->memp_stat_print"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_MempSync(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (dbenv->app_private != NULL) { + DB_LSN * _lsn = NULL; + int ret = dbenv->memp_sync(dbenv, _lsn); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->memp_sync"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_MempTrickle(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + int _percent = 20; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_VOID; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/i", &_percent))) + goto exit; + + if (dbenv->app_private != NULL) { + int nwrote = 0; + int ret = dbenv->memp_trickle(dbenv, _percent, &nwrote); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->memp_sync"); + else + *vp = INT_TO_JSVAL(nwrote); + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_MutexAlloc(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_MutexFree(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_MutexLock(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_MutexStat(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + uint32_t _flags = DB_STAT_ALL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + if (dbenv->app_private != NULL) { + DB_MUTEX_STAT * _stat = NULL; + int ret = dbenv->mutex_stat(dbenv, &_stat, _flags); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->mutex_stat"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_MutexStatPrint(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + uint32_t _flags = DB_STAT_ALL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + if (dbenv->app_private != NULL) { + int ret = dbenv->mutex_stat_print(dbenv, _flags); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->mutex_stat_print"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_MutexUnlock(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_Open(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + const char * _home = NULL; + uint32_t _eflags = 0; + int _mode = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "su/i", &_home, &_eflags, &_mode))) + goto exit; + + if (dbenv->app_private == NULL) { + int ret = dbenv->open(dbenv, _home, _eflags, _mode); + + if (ret) { + dbenv->err(dbenv, ret, "DB_ENV->open: %s", _home); + goto exit; + } else { + dbenv->app_private = obj; + ret = dbenv->set_event_notify(dbenv, rpmdbe_event_notify); + if (ret) dbenv->err(dbenv, ret, "DB_ENV->set_event_notify"); + /* XXX only DB_RECOVER is currently implemented */ + ret = dbenv->set_feedback(dbenv, rpmdbe_feedback); + if (ret) dbenv->err(dbenv, ret, "DB_ENV->set_feedback"); + *vp = JSVAL_TRUE; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_Remove(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + const char * _home = NULL; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s/u", &_home, &_flags))) + goto exit; + + if (dbenv->app_private == NULL) { + int ret = dbenv->remove(dbenv, _home, _flags); + if (ret) { + dbenv->err(dbenv, ret, "DB_ENV->remove: %s", _home); + goto exit; + } else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_RepElect(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + uint32_t _nsites = 0; + uint32_t _nvotes = 0; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/uu", &_nsites, &_nvotes))) + goto exit; + + if (dbenv->app_private != NULL) { + int ret = dbenv->rep_elect(dbenv, _nsites, _nvotes, _flags); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->rep_elect"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_RepProcessMessage(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_RepStart(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_RepStat(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + uint32_t _flags = DB_STAT_ALL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + if (dbenv->app_private != NULL) { + DB_REP_STAT * _stat = NULL; + int ret = dbenv->rep_stat(dbenv, &_stat, _flags); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->rep_stat"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_RepStatPrint(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + uint32_t _flags = DB_STAT_ALL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + if (dbenv->app_private != NULL) { + int ret = dbenv->rep_stat_print(dbenv, _flags); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->rep_stat_print"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_RepSync(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + if (dbenv->app_private != NULL) { + int ret = dbenv->rep_sync(dbenv, _flags); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->rep_sync"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_RepmgrStart(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + /* FIXME todo++ */ + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_RepmgrStat(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + uint32_t _flags = DB_STAT_ALL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + if (dbenv->app_private != NULL) { + DB_REPMGR_STAT * _stat = NULL; + int ret = dbenv->repmgr_stat(dbenv, &_stat, _flags); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->repmgr_stat"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_RepmgrStatPrint(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + uint32_t _flags = DB_STAT_ALL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + if (dbenv->app_private != NULL) { + int ret = dbenv->repmgr_stat_print(dbenv, _flags); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->repmgr_stat_print"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_StatPrint(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + uint32_t _flags = DB_STAT_ALL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + if (dbenv->app_private != NULL) { + int ret = dbenv->stat_print(dbenv, _flags); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->stat_print"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +#define OBJ_IS_RPMTXN(_cx, _o) (JS_GET_CLASS(_cx, _o) == &rpmtxnClass) + +static JSBool +rpmdbe_TxnBegin(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSObject * o = NULL; + DB_TXN * _parent = NULL; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "o/u", &o, &_flags))) + goto exit; + + if (o && OBJ_IS_RPMTXN(cx, o)) + _parent = JS_GetInstancePrivate(cx, o, &rpmtxnClass, NULL); + + if (dbenv->app_private != NULL) { + DB_TXN * _txn = NULL; + int ret = dbenv->txn_begin(dbenv, _parent, &_txn, _flags); + switch (ret) { + default: + dbenv->err(dbenv, ret, "DB_ENV->txn_begin"); + goto exit; + break; + case 0: + if ((o = JS_NewObject(cx, &rpmtxnClass, NULL, NULL)) == NULL + || !JS_SetPrivate(cx, o, (void *)_txn)) + { + if (_txn) _txn->discard(_txn, 0); + /* XXX error msg */ + goto exit; + } + *vp = OBJECT_TO_JSVAL(o); + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_TxnCheckpoint(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + uint32_t _kb = 0; + uint32_t _minutes = 0; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/uuu", &_kb, &_minutes, &_flags))) + goto exit; + + if (dbenv->app_private != NULL) { + int ret = dbenv->txn_checkpoint(dbenv, _kb, _minutes, _flags); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->txn_checkpoint"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_TxnRecover(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + +#ifdef NOTYET + if (dbenv->app_private != NULL) { + DB_PREPLIST _preplist[32]; + long _count = (sizeof(_preplist) / sizeof(_preplist[0])); + long _got = 0; + uint32_t _flags = DB_FIRST; + int ret = 0; + int i; + + while (1) { + ret = dbenv->txn_recover(dbenv, _preplist, _count, &_count, _flags); + if (ret) { + dbenv->err(dbenv, ret, "DB_ENV->txn_recover"); + goto exit; + } + if (_got == 0) + break; + for (i = 0; i < _got; i++) { + DB_TXN * _txn = _preplist[i].txn; + uint32_t _tflags = 0; + (void) _txn->discard(_txn, _tflags); + } + _flags = DB_NEXT; + } + *vp = JSVAL_TRUE; + } +#endif + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_TxnStat(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + uint32_t _flags = DB_STAT_ALL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + if (dbenv->app_private != NULL) { + DB_TXN_STAT * _stat = NULL; + int ret = dbenv->txn_stat(dbenv, &_stat, _flags); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->txn_stat"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_TxnStatPrint(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + uint32_t _flags = DB_STAT_ALL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (dbenv == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + if (dbenv->app_private != NULL) { + int ret = dbenv->txn_stat_print(dbenv, _flags); + if (ret) + dbenv->err(dbenv, ret, "DB_ENV->txn_stat_print"); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSFunctionSpec rpmdbe_funcs[] = { + JS_FS("cdsgroup_begin", rpmdbe_CdsgroupBegin, 0,0), + JS_FS("close", rpmdbe_Close, 0,0), + JS_FS("dbremove", rpmdbe_Dbremove, 0,0), + JS_FS("dbrename", rpmdbe_Dbrename, 0,0), + JS_FS("failchk", rpmdbe_Failchk, 0,0), + JS_FS("fileid_reset", rpmdbe_FileidReset, 0,0), + JS_FS("lock_detect", rpmdbe_LockDetect, 0,0), + JS_FS("lock_get", rpmdbe_LockGet, 0,0), + JS_FS("lock_id", rpmdbe_LockId, 0,0), + JS_FS("lock_id_free", rpmdbe_LockIdFree, 0,0), + JS_FS("lock_put", rpmdbe_LockPut, 0,0), + JS_FS("lock_stat", rpmdbe_LockStat, 0,0), + JS_FS("lock_stat_print", rpmdbe_LockStatPrint, 0,0), + JS_FS("lock_vec", rpmdbe_LockVec, 0,0), + JS_FS("log_archive", rpmdbe_LogArchive, 0,0), + JS_FS("log_cursor", rpmdbe_LogCursor, 0,0), + JS_FS("log_file", rpmdbe_LogFile, 0,0), + JS_FS("log_flush", rpmdbe_LogFlush, 0,0), + JS_FS("log_printf", rpmdbe_LogPrintf, 0,0), + JS_FS("log_put", rpmdbe_LogPut, 0,0), + JS_FS("log_stat", rpmdbe_LogStat, 0,0), + JS_FS("log_stat_print", rpmdbe_LogStatPrint, 0,0), + JS_FS("lsn_reset", rpmdbe_LsnReset, 0,0), + JS_FS("memp_fcreate", rpmdbe_MempFcreate, 0,0), + JS_FS("memp_register", rpmdbe_MempRegister, 0,0), + JS_FS("memp_stat", rpmdbe_MempStat, 0,0), + JS_FS("memp_stat_print", rpmdbe_MempStatPrint, 0,0), + JS_FS("memp_sync", rpmdbe_MempSync, 0,0), + JS_FS("memp_trickle", rpmdbe_MempTrickle, 0,0), + JS_FS("mutex_alloc", rpmdbe_MutexAlloc, 0,0), + JS_FS("mutex_free", rpmdbe_MutexFree, 0,0), + JS_FS("mutex_lock", rpmdbe_MutexLock, 0,0), + JS_FS("mutex_stat", rpmdbe_MutexStat, 0,0), + JS_FS("mutex_stat_print", rpmdbe_MutexStatPrint, 0,0), + JS_FS("mutex_unlock", rpmdbe_MutexUnlock, 0,0), + JS_FS("open", rpmdbe_Open, 0,0), + JS_FS("remove", rpmdbe_Remove, 0,0), + JS_FS("rep_elect", rpmdbe_RepElect, 0,0), + JS_FS("rep_process_message",rpmdbe_RepProcessMessage, 0,0), + JS_FS("rep_start", rpmdbe_RepStart, 0,0), + JS_FS("rep_stat", rpmdbe_RepStat, 0,0), + JS_FS("rep_stat_print", rpmdbe_RepStatPrint, 0,0), + JS_FS("rep_sync", rpmdbe_RepSync, 0,0), + JS_FS("repmgr_start", rpmdbe_RepmgrStart, 0,0), + JS_FS("repmgr_stat", rpmdbe_RepmgrStat, 0,0), + JS_FS("repmgr_stat_print", rpmdbe_RepmgrStatPrint, 0,0), + JS_FS("stat_print", rpmdbe_StatPrint, 0,0), + JS_FS("txn_begin", rpmdbe_TxnBegin, 0,0), + JS_FS("txn_checkpoint", rpmdbe_TxnCheckpoint, 0,0), + JS_FS("txn_recover", rpmdbe_TxnRecover, 0,0), + JS_FS("txn_stat", rpmdbe_TxnStat, 0,0), + JS_FS("txn_stat_print", rpmdbe_TxnStatPrint, 0,0), + JS_FS_END +}; + +/* --- Object properties */ + +#define _TABLE(_v) #_v, _##_v, JSPROP_ENUMERATE, NULL, NULL + +enum rpmdbe_tinyid { + _DEBUG = -2, + _HOME = -3, + _OPEN_FLAGS = -4, + _DATADIRS = -5, + _CREATE_DIR = -6, + _ENCRYPT = -7, + _ERRFILE = -8, + _ERRPFX = -9, + _FLAGS = -10, + _IDIRMODE = -11, + _MSGFILE = -12, + _SHMKEY = -13, + _THREADCNT = -14, + + _DB_SET_LOCK_TIMEOUT = -15, + + _TMPDIR = -16, + _VERBOSE = -17, + _LKCONFLICTS = -18, + _LKDETECT = -19, + _LKMAXLOCKERS = -20, + _LKMAXLOCKS = -21, + _LKMAXOBJS = -22, + _LKPARTITIONS = -23, + + _LOGDIRECT = -24, + _LOGDSYNC = -25, + _LOGAUTORM = -26, + _LOGINMEM = -27, + _LOGZERO = -28, + + _LGBSIZE = -29, + _LGDIR = -30, + _LGFILEMODE = -31, + _LGMAX = -32, + _LGREGIONMAX = -33, + + _DB_SET_TXN_TIMEOUT = -34, + + _VERSION = -35, + _MAJOR = -36, + _MINOR = -37, + _PATCH = -38, + + _CACHESIZE = -39, + _NCACHES = -40, + _REGTIMEOUT = -41, + _CACHEMAX = -42, + _MAXOPENFD = -43, + _MMAPSIZE = -44, + + _MXALIGN = -45, + _MXINC = -46, + _MXMAX = -47, + _MXSPINS = -48, + + _TXMAX = -49, + _TXTSTAMP = -50, + + _DB_REP_CONF_BULK = -51, + _DB_REP_CONF_DELAYCLIENT = -52, + _DB_REP_CONF_INMEM = -53, + _DB_REP_CONF_LEASE = -54, + _DB_REP_CONF_NOAUTOINIT = -55, + _DB_REP_CONF_NOWAIT = -56, + _DB_REPMGR_CONF_2SITE_STRICT= -57, + + _REPLIMIT = -58, + _REPNSITES = -59, + _REPPRIORITY = -60, + + _DB_REP_ACK_TIMEOUT = -61, + _DB_REP_CHECKPOINT_DELAY = -62, + _DB_REP_CONNECTION_RETRY = -63, + _DB_REP_ELECTION_TIMEOUT = -64, + _DB_REP_ELECTION_RETRY = -65, + _DB_REP_FULL_ELECTION_TIMEOUT = -66, + _DB_REP_HEARTBEAT_MONITOR = -67, + _DB_REP_HEARTBEAT_SEND = -68, + _DB_REP_LEASE_TIMEOUT = -69, +}; + +static JSPropertySpec rpmdbe_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + + {"version", _VERSION, JSPROP_ENUMERATE, NULL, NULL}, + {"major", _MAJOR, JSPROP_ENUMERATE, NULL, NULL}, + {"minor", _MINOR, JSPROP_ENUMERATE, NULL, NULL}, + {"patch", _PATCH, JSPROP_ENUMERATE, NULL, NULL}, + + {"home", _HOME, JSPROP_ENUMERATE, NULL, NULL}, + {"open_flags", _OPEN_FLAGS, JSPROP_ENUMERATE, NULL, NULL}, + {"data_dirs", _DATADIRS, JSPROP_ENUMERATE, NULL, NULL}, + {"create_dir", _CREATE_DIR, JSPROP_ENUMERATE, NULL, NULL}, + {"encrypt", _ENCRYPT, JSPROP_ENUMERATE, NULL, NULL}, + {"errfile", _ERRFILE, JSPROP_ENUMERATE, NULL, NULL}, + {"errpfx", _ERRPFX, JSPROP_ENUMERATE, NULL, NULL}, + {"flags", _FLAGS, JSPROP_ENUMERATE, NULL, NULL}, + {"idirmode", _IDIRMODE, JSPROP_ENUMERATE, NULL, NULL}, + {"msgfile", _MSGFILE, JSPROP_ENUMERATE, NULL, NULL}, + {"shm_key", _SHMKEY, JSPROP_ENUMERATE, NULL, NULL}, + {"thread_count", _THREADCNT, JSPROP_ENUMERATE, NULL, NULL}, + + {"tmp_dir", _TMPDIR, JSPROP_ENUMERATE, NULL, NULL}, + {"verbose", _VERBOSE, JSPROP_ENUMERATE, NULL, NULL}, + {"lk_conflicts", _LKCONFLICTS, JSPROP_ENUMERATE, NULL, NULL}, + {"lk_detect", _LKDETECT, JSPROP_ENUMERATE, NULL, NULL}, + {"lk_max_lockers", _LKMAXLOCKERS, JSPROP_ENUMERATE, NULL, NULL}, + {"lk_max_locks", _LKMAXLOCKS, JSPROP_ENUMERATE, NULL, NULL}, + {"lk_max_objects", _LKMAXOBJS, JSPROP_ENUMERATE, NULL, NULL}, + {"lk_partitions", _LKPARTITIONS, JSPROP_ENUMERATE, NULL, NULL}, + + {"log_direct", _LOGDIRECT, JSPROP_ENUMERATE, NULL, NULL}, + {"log_dsync", _LOGDSYNC, JSPROP_ENUMERATE, NULL, NULL}, + {"log_autorm", _LOGAUTORM, JSPROP_ENUMERATE, NULL, NULL}, + {"log_inmemory", _LOGINMEM, JSPROP_ENUMERATE, NULL, NULL}, + {"log_zero", _LOGZERO, JSPROP_ENUMERATE, NULL, NULL}, + + {"lg_bsize", _LGBSIZE, JSPROP_ENUMERATE, NULL, NULL}, + {"lg_dir", _LGDIR, JSPROP_ENUMERATE, NULL, NULL}, + {"lg_filemode", _LGFILEMODE, JSPROP_ENUMERATE, NULL, NULL}, + {"lg_max", _LGMAX, JSPROP_ENUMERATE, NULL, NULL}, + {"lg_regionmax", _LGREGIONMAX, JSPROP_ENUMERATE, NULL, NULL}, + + { _TABLE(DB_SET_LOCK_TIMEOUT) }, + { _TABLE(DB_SET_TXN_TIMEOUT) }, + {"reg_timeout", _REGTIMEOUT, JSPROP_ENUMERATE, NULL, NULL}, + + {"cachemax", _CACHEMAX, JSPROP_ENUMERATE, NULL, NULL}, + {"cachesize", _CACHESIZE, JSPROP_ENUMERATE, NULL, NULL}, + {"ncaches", _NCACHES, JSPROP_ENUMERATE, NULL, NULL}, + + {"max_openfd", _MAXOPENFD, JSPROP_ENUMERATE, NULL, NULL}, + {"mmapsize", _MMAPSIZE, JSPROP_ENUMERATE, NULL, NULL}, + + {"mutex_align", _MXALIGN, JSPROP_ENUMERATE, NULL, NULL}, + {"mutex_inc", _MXINC, JSPROP_ENUMERATE, NULL, NULL}, + {"mutex_max", _MXMAX, JSPROP_ENUMERATE, NULL, NULL}, + {"mutex_spins", _MXSPINS, JSPROP_ENUMERATE, NULL, NULL}, + + {"tx_max", _TXMAX, JSPROP_ENUMERATE, NULL, NULL}, + {"tx_timestamp", _TXTSTAMP, JSPROP_ENUMERATE, NULL, NULL}, + + { _TABLE(DB_REP_CONF_BULK) }, + { _TABLE(DB_REP_CONF_DELAYCLIENT) }, + { _TABLE(DB_REP_CONF_INMEM) }, + { _TABLE(DB_REP_CONF_LEASE) }, + { _TABLE(DB_REP_CONF_NOAUTOINIT) }, + { _TABLE(DB_REP_CONF_NOWAIT) }, + { _TABLE(DB_REPMGR_CONF_2SITE_STRICT) }, + + {"rep_limit", _REPLIMIT, JSPROP_ENUMERATE, NULL, NULL}, + {"rep_nsites", _REPNSITES, JSPROP_ENUMERATE, NULL, NULL}, + {"rep_priority", _REPPRIORITY, JSPROP_ENUMERATE, NULL, NULL}, + + { _TABLE(DB_REP_ACK_TIMEOUT) }, + { _TABLE(DB_REP_CHECKPOINT_DELAY) }, + { _TABLE(DB_REP_CONNECTION_RETRY) }, + { _TABLE(DB_REP_ELECTION_TIMEOUT) }, + { _TABLE(DB_REP_ELECTION_RETRY) }, + { _TABLE(DB_REP_FULL_ELECTION_TIMEOUT) }, + { _TABLE(DB_REP_HEARTBEAT_MONITOR) }, + { _TABLE(DB_REP_HEARTBEAT_SEND) }, + { _TABLE(DB_REP_LEASE_TIMEOUT) }, + + {NULL, 0, 0, NULL, NULL} +}; + +#define _RET_B(_bool) ((_bool) > 0 ? JSVAL_TRUE: JSVAL_FALSE) +#define _RET_S(_str) \ + ((_str) ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, (_str))) : JSVAL_NULL) +#define _GET_S(_test) ((_test) ? _RET_S(_s) : JSVAL_VOID) +#define _GET_U(_test) ((_test) ? INT_TO_JSVAL(_u) : JSVAL_VOID) +#define _GET_I(_test) ((_test) ? INT_TO_JSVAL(_i) : JSVAL_VOID) +#define _GET_B(_test) ((_test) ? _RET_B(_i) : JSVAL_VOID) + +static JSBool +rpmdbe_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + const char ** _av = NULL; + int _ac = 0; + const char * _s = NULL; + uint32_t _gb = 0; + uint32_t _u = 0; + int _i = 0; + long _l = 0; + FILE * _fp = NULL; + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + + case _VERSION: *vp = _RET_S(DB_VERSION_STRING); break; + case _MAJOR: *vp = INT_TO_JSVAL(DB_VERSION_MAJOR); break; + case _MINOR: *vp = INT_TO_JSVAL(DB_VERSION_MINOR); break; + case _PATCH: *vp = INT_TO_JSVAL(DB_VERSION_PATCH); break; + + case _HOME: *vp = _GET_S(!dbenv->get_home(dbenv, &_s)); break; + case _OPEN_FLAGS: *vp = _GET_U(!dbenv->get_open_flags(dbenv, &_u)); break; + case _DATADIRS: + if (!dbenv->get_data_dirs(dbenv, &_av) + && (_ac = argvCount(_av)) > 0) + { + JSObject * o = JS_NewArrayObject(cx, 0, NULL); + int i; + + *vp = OBJECT_TO_JSVAL(o); + for (i = 0; i < _ac; i++) { + jsval v = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _av[i])); + (void) JS_SetElement(cx, o, i, &v); + } + } else + *vp = JSVAL_VOID; + break; + case _CREATE_DIR: +#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8) + *vp = _GET_S(!dbenv->get_create_dir(dbenv, &_s)); +#else + *vp = JSVAL_VOID; +#endif + break; + case _ENCRYPT: *vp = _GET_U(!dbenv->get_encrypt_flags(dbenv, &_u)); break; + case _ERRFILE: + dbenv->get_errfile(dbenv, &_fp); + _s = (_fp ? "other" : NULL); + if (_fp == stdin) _s = "stdin"; + if (_fp == stdout) _s = "stdout"; + if (_fp == stderr) _s = "stderr"; + *vp = _RET_S(_s); + break; + case _ERRPFX: + dbenv->get_errpfx(dbenv, &_s); + *vp = _RET_S(_s); + break; + case _FLAGS: *vp = _GET_U(!dbenv->get_flags(dbenv, &_u)); break; + case _IDIRMODE: *vp = _GET_S(!dbenv->get_intermediate_dir_mode(dbenv, &_s)); break; + case _MSGFILE: + dbenv->get_msgfile(dbenv, &_fp); + _s = (_fp ? "other" : NULL); + if (_fp == stdin) _s = "stdin"; + if (_fp == stdout) _s = "stdout"; + if (_fp == stderr) _s = "stderr"; + *vp = _RET_S(_s); + break; + case _SHMKEY: + if (!dbenv->get_shm_key(dbenv, &_l)) { + jsdouble d = _l; + if (!JS_NewNumberValue(cx, d, vp)) + *vp = JSVAL_VOID; + } else + *vp = JSVAL_VOID; + break; + case _THREADCNT: *vp = _GET_U(!dbenv->get_thread_count(dbenv, &_u)); break; + + /* XXX FIXME assumes typedef uint32_t db_timeout_t; */ +#define _JUMP(_v, _lbl) _##_v: _u = _v; goto _lbl + case _JUMP(DB_SET_LOCK_TIMEOUT, _get_timeout); + case _JUMP(DB_SET_TXN_TIMEOUT, _get_timeout); +#undef _JUMP + _get_timeout: + *vp = _GET_U(!dbenv->get_timeout(dbenv, (db_timeout_t *)&_u, _u)); + break; + + case _REGTIMEOUT: *vp = JSVAL_NULL; break; /* XXX FIXME */ + + case _TMPDIR: *vp = _GET_S(!dbenv->get_tmp_dir(dbenv, &_s)); break; + case _VERBOSE: *vp = JSVAL_VOID; break; /* XXX FIXME enum */ + case _LKCONFLICTS: *vp = JSVAL_VOID; break; /* XXX FIXME */ + case _LKDETECT: *vp = _GET_U(!dbenv->get_lk_detect(dbenv, &_u)); break; + case _LKMAXLOCKERS: *vp = _GET_U(!dbenv->get_lk_max_lockers(dbenv, &_u)); break; + case _LKMAXLOCKS: *vp = _GET_U(!dbenv->get_lk_max_locks(dbenv, &_u)); break; + case _LKMAXOBJS: *vp = _GET_U(!dbenv->get_lk_max_objects(dbenv, &_u)); break; + case _LKPARTITIONS: *vp = _GET_U(!dbenv->get_lk_partitions(dbenv, &_u)); break; + + case _LOGDIRECT: *vp = _GET_B(!dbenv->log_get_config(dbenv, DB_LOG_DIRECT, &_i)); break; + case _LOGDSYNC: *vp = _GET_B(!dbenv->log_get_config(dbenv, DB_LOG_DSYNC, &_i)); break; + case _LOGAUTORM: *vp = _GET_B(!dbenv->log_get_config(dbenv, DB_LOG_AUTO_REMOVE, &_i)); break; + case _LOGINMEM: *vp = _GET_B(!dbenv->log_get_config(dbenv, DB_LOG_IN_MEMORY, &_i)); break; + case _LOGZERO: *vp = _GET_B(!dbenv->log_get_config(dbenv, DB_LOG_ZERO, &_i)); break; + + case _LGBSIZE: *vp = _GET_U(!dbenv->get_lg_bsize(dbenv, &_u)); break; + case _LGDIR: *vp = _GET_S(!dbenv->get_lg_dir(dbenv, &_s)); break; + case _LGFILEMODE: *vp = _GET_I(!dbenv->get_lg_filemode(dbenv, &_i)); break; + case _LGMAX: *vp = _GET_U(!dbenv->get_lg_max(dbenv, &_u)); break; + case _LGREGIONMAX: *vp = _GET_U(!dbenv->get_lg_regionmax(dbenv, &_u)); break; + + /* XXX FIXME: return uint64_t */ + case _CACHEMAX: *vp = _GET_U(!dbenv->get_cache_max(dbenv, &_gb, &_u)); break; + case _CACHESIZE: *vp = _GET_U(!dbenv->get_cachesize(dbenv, &_gb, &_u, &_i)); break; + case _NCACHES: *vp = _GET_I(!dbenv->get_cachesize(dbenv, &_gb, &_u, &_i)); break; + case _MAXOPENFD: *vp = _GET_I(!dbenv->get_mp_max_openfd(dbenv, &_i)); break; + /* XXX FIXME dbenv->get_mp_max_write(dbenv, &maxwrite, &timeout); */ + case _MMAPSIZE: + { size_t _sz = 0; + *vp = (!dbenv->get_mp_mmapsize(dbenv, &_sz) + ? INT_TO_JSVAL((int)_sz) : JSVAL_VOID); + } break; + case _MXALIGN: *vp = _GET_U(!dbenv->mutex_get_align(dbenv, &_u)); break; + case _MXINC: *vp = _GET_U(!dbenv->mutex_get_increment(dbenv, &_u)); break; + case _MXMAX: *vp = _GET_U(!dbenv->mutex_get_increment(dbenv, &_u)); break; + case _MXSPINS: *vp = _GET_U(!dbenv->mutex_get_tas_spins(dbenv, &_u)); break; + /* XXX FIXME: dbenv->rep_get_clockskew(dbenv, u &fast, u &slow) */ +#define _JUMP(_v, _lbl) _##_v: _i = _v; goto _lbl + case _JUMP(DB_REP_CONF_BULK, _get_config); + case _JUMP(DB_REP_CONF_DELAYCLIENT, _get_config); +#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8) + case _JUMP(DB_REP_CONF_INMEM, _get_config); +#endif + case _JUMP(DB_REP_CONF_LEASE, _get_config); +#if defined(DB_REP_CONF_NOAUTOINIT) /* XXX db version? */ + case _JUMP(DB_REP_CONF_NOAUTOINIT, _get_config); +#endif + case _JUMP(DB_REP_CONF_NOWAIT, _get_config); + case _JUMP(DB_REPMGR_CONF_2SITE_STRICT, _get_config); +#undef _JUMP + _get_config: + *vp = _GET_B(!dbenv->rep_get_config(dbenv, _i, &_i)); + break; + case _REPLIMIT: _GET_U(!dbenv->rep_get_limit(dbenv, &_gb, &_u)); break; + case _REPNSITES: _GET_U(!dbenv->rep_get_nsites(dbenv, &_u)); break; + case _REPPRIORITY: _GET_U(!dbenv->rep_get_priority(dbenv, &_u)); break; + /* XXX FIXME: dbenv->rep_get_request(dbenv, u &min, u &max) */ + +#define _JUMP(_v, _lbl) _##_v: _i = _v; goto _lbl + case _JUMP(DB_REP_ACK_TIMEOUT, _rep_get_timeout); + case _JUMP(DB_REP_CHECKPOINT_DELAY, _rep_get_timeout); + case _JUMP(DB_REP_CONNECTION_RETRY, _rep_get_timeout); + case _JUMP(DB_REP_ELECTION_TIMEOUT, _rep_get_timeout); + case _JUMP(DB_REP_ELECTION_RETRY, _rep_get_timeout); + case _JUMP(DB_REP_FULL_ELECTION_TIMEOUT, _rep_get_timeout); + case _JUMP(DB_REP_HEARTBEAT_MONITOR, _rep_get_timeout); + case _JUMP(DB_REP_HEARTBEAT_SEND, _rep_get_timeout); + case _JUMP(DB_REP_LEASE_TIMEOUT, _rep_get_timeout); +#undef _JUMP + _rep_get_timeout: + *vp = _GET_U(!dbenv->rep_get_timeout(dbenv, _i, &_u)); + break; + + /* XXX FIXME: dbenv->repmgr_get_ack_policy(dbenv, &_i) */ + + case _TXMAX: *vp = _GET_U(!dbenv->get_tx_max(dbenv, &_u)); break; + case _TXTSTAMP: + { time_t tstamp = 0; + if (!dbenv->get_tx_timestamp(dbenv, &tstamp)) { + _u = tstamp; + *vp = INT_TO_JSVAL(_u); /* XXX FIXME */ + } else + *vp = JSVAL_VOID; + } break; + + default: + break; + } + + return JS_TRUE; +} + +#define _PUT_S(_put) (JSVAL_IS_STRING(*vp) && !(_put) \ + ? JSVAL_TRUE : JSVAL_FALSE) +#define _PUT_U(_put) (JSVAL_IS_INT(*vp) && !(_put) \ + ? JSVAL_TRUE : JSVAL_FALSE) +#define _PUT_I(_put) (JSVAL_IS_INT(*vp) && !(_put) \ + ? JSVAL_TRUE : JSVAL_FALSE) + +static JSBool +rpmdbe_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; +#ifdef NOTYET + const char ** _av = NULL; + int _ac = 0; +#endif + const char * _s = NULL; + uint32_t _gb = 0; + uint32_t _b = 0; + uint32_t _u = 0; + int _i = 0; + int _nc = 0; + long _l = 0; + FILE * _fp = NULL; + jsint tiny = JSVAL_TO_INT(id); + jsdouble d; + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + if (JSVAL_IS_STRING(*vp)) + _s = JS_EncodeString(cx, JS_ValueToString(cx, *vp)); + if (JSVAL_IS_NUMBER(*vp)) { + (void) JS_ValueToNumber(cx, *vp, &d); + _u = _i = _l = d; + } + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + /* dbenv->add_data_dir() */ + case _DATADIRS: + /* XXX duplicates? */ +#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8) + *vp = _PUT_S(dbenv->add_data_dir(dbenv, _s)); +#else + *vp = JSVAL_VOID; +#endif + break; + case _CREATE_DIR: + /* XXX check datadirs to prevent failure? */ +#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8) + *vp = _PUT_S(dbenv->set_create_dir(dbenv, _s)); +#else + *vp = JSVAL_VOID; +#endif + break; + case _ENCRYPT: + *vp = _PUT_S(dbenv->set_encrypt(dbenv, _s, DB_ENCRYPT_AES)); + break; + case _ERRFILE: + /* XXX FIXME: cleaner typing */ + _fp = NULL; + if (!strcmp(_s, "stdout")) _fp = stdout; + if (!strcmp(_s, "stderr")) _fp = stderr; + dbenv->set_errfile(dbenv, _fp); + *vp = JSVAL_TRUE; + break; + case _ERRPFX: + dbenv->set_errpfx(dbenv, _s); + *vp = JSVAL_TRUE; + break; + case _FLAGS: break; /* XXX FIXME */ + case _IDIRMODE: *vp = _PUT_S(dbenv->set_intermediate_dir_mode(dbenv, _s)); break; + case _MSGFILE: + /* XXX FIXME: cleaner typing */ + _fp = NULL; + if (_s != NULL) { + if (!strcmp(_s, "stdout")) _fp = stdout; + else if (!strcmp(_s, "stderr")) _fp = stderr; + /* XXX FIXME: fp = fopen(_s, O_RDWR); with error checking */ + } + dbenv->set_errfile(dbenv, _fp); + *vp = JSVAL_TRUE; + break; + case _SHMKEY: +#if defined(HAVE_FTOK) + if (JSVAL_IS_STRING(*vp) && _s != NULL) + _l = ftok(_s, 0); +#endif + + *vp = (!dbenv->set_shm_key(dbenv, _l) ? JSVAL_TRUE : JSVAL_FALSE); + break; + case _THREADCNT: + if (JSVAL_IS_INT(*vp) && _u >= 8 && !dbenv->set_thread_count(dbenv, _u)) + { + int ret = dbenv->set_isalive(dbenv, (_u ? rpmdbe_isalive : NULL)); + *vp = (!ret ? JSVAL_TRUE : JSVAL_FALSE); + } else + *vp = JSVAL_FALSE; + break; + +#define _JUMP(_v, _lbl) _##_v: _nc = _v; goto _lbl + case _JUMP(DB_SET_LOCK_TIMEOUT, _set_timeout); + case _JUMP(DB_SET_TXN_TIMEOUT, _set_timeout); +#undef _JUMP + _set_timeout: + *vp = _PUT_U(dbenv->set_timeout(dbenv, (db_timeout_t)_u, _nc)); + break; + case _REGTIMEOUT: +#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8) + *vp = _PUT_U(dbenv->set_timeout(dbenv, (db_timeout_t)_u, DB_SET_REG_TIMEOUT)); +#endif + break; + + case _TMPDIR: *vp = _PUT_S(dbenv->set_tmp_dir(dbenv, _s)); break; + case _VERBOSE: break; /* XXX FIXME */ + case _LKCONFLICTS: break; /* XXX FIXME */ + /* XXX FIXME: explicit enum check needed */ + case _LKDETECT: *vp = _PUT_U(dbenv->set_lk_detect(dbenv, _u)); break; + case _LKMAXLOCKERS: *vp = _PUT_U(dbenv->set_lk_max_lockers(dbenv, _u)); break; + case _LKMAXLOCKS: *vp = _PUT_U(dbenv->set_lk_max_locks(dbenv, _u)); break; + case _LKMAXOBJS: *vp = _PUT_U(dbenv->set_lk_max_objects(dbenv, _u)); break; + case _LKPARTITIONS: *vp = _PUT_U(dbenv->set_lk_partitions(dbenv, _u)); break; + + case _LOGDIRECT: *vp = _PUT_I(dbenv->log_set_config(dbenv, DB_LOG_DIRECT, (_i ? 1 : 0))); break; + case _LOGDSYNC: *vp = _PUT_I(dbenv->log_set_config(dbenv, DB_LOG_DSYNC, (_i ? 1 : 0))); break; + case _LOGAUTORM: *vp = _PUT_I(dbenv->log_set_config(dbenv, DB_LOG_AUTO_REMOVE, (_i ? 1 : 0))); break; + case _LOGINMEM: *vp = _PUT_I(dbenv->log_set_config(dbenv, DB_LOG_IN_MEMORY, (_i ? 1 : 0))); break; + case _LOGZERO: *vp = _PUT_I(dbenv->log_set_config(dbenv, DB_LOG_ZERO, (_i ? 1 : 0))); break; + + + case _LGBSIZE: *vp = _PUT_U(dbenv->set_lg_bsize(dbenv, _u)); break; + case _LGDIR: *vp = _PUT_S(dbenv->set_lg_dir(dbenv, _s)); break; + case _LGFILEMODE: *vp = _PUT_I(dbenv->set_lg_filemode(dbenv, _i)); break; + case _LGMAX: *vp = _PUT_U(dbenv->set_lg_max(dbenv, _u)); break; + case _LGREGIONMAX: *vp = _PUT_U(dbenv->set_lg_regionmax(dbenv, _u)); break; + + case _CACHEMAX: + if (!dbenv->get_cache_max(dbenv, &_gb, &_b)) { + _b = _u; + *vp = !dbenv->set_cache_max(dbenv, _gb, _b) + ? JSVAL_TRUE : JSVAL_FALSE; + } else + *vp = JSVAL_FALSE; + break; + case _CACHESIZE: + if (!dbenv->get_cachesize(dbenv, &_gb, &_b, &_nc)) { + _b = _u; + *vp = !dbenv->set_cachesize(dbenv, _gb, _b, _nc) + ? JSVAL_TRUE : JSVAL_FALSE; + } else + *vp = JSVAL_FALSE; + break; + case _NCACHES: + if (!dbenv->get_cachesize(dbenv, &_gb, &_b, &_nc)) { + _nc = _i; + *vp = !dbenv->set_cachesize(dbenv, _gb, _b, _nc) + ? JSVAL_TRUE : JSVAL_FALSE; + } else + *vp = JSVAL_FALSE; + break; + case _MAXOPENFD: *vp = _PUT_I(!dbenv->set_mp_max_openfd(dbenv, _i)); break; + /* XXX FIXME dbenv->set_mp_max_write(dbenv, maxwrite, timeout); */ + case _MMAPSIZE: *vp = _PUT_U(dbenv->set_mp_mmapsize(dbenv, _u)); break; + case _MXALIGN: break; /* XXX FIXME */ + case _MXINC: break; /* XXX FIXME */ + case _MXMAX: break; /* XXX FIXME */ + case _MXSPINS: break; /* XXX FIXME */ + /* XXX FIXME: dbenv->rep_set_clockskew(dbenv, u fast, u slow) */ + case _TXMAX: *vp = _PUT_U(!dbenv->set_tx_max(dbenv, _u)); break; + case _TXTSTAMP: + { time_t tstamp = _u; + *vp = (JSVAL_IS_INT(*vp) && !dbenv->set_tx_timestamp(dbenv, &tstamp) + ? JSVAL_TRUE : JSVAL_FALSE); + } break; + +#define _JUMP(_v, _lbl) _##_v: _i = _v; goto _lbl + case _JUMP(DB_REP_CONF_BULK, _set_config); + case _JUMP(DB_REP_CONF_DELAYCLIENT, _set_config); +#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8) + case _JUMP(DB_REP_CONF_INMEM, _set_config); +#endif + case _JUMP(DB_REP_CONF_LEASE, _set_config); +#if defined(DB_REP_CONF_NOAUTOINIT) /* XXX db version? */ + case _JUMP(DB_REP_CONF_NOAUTOINIT, _set_config); +#endif + case _JUMP(DB_REP_CONF_NOWAIT, _set_config); + case _JUMP(DB_REPMGR_CONF_2SITE_STRICT, _set_config); +#undef _JUMP + _set_config: + *vp = _PUT_I(!dbenv->rep_set_config(dbenv, _i, (_u ? 1 : 0))); + break; + /* XXX FIXME _gb always 0 */ + + case _REPLIMIT: _PUT_U(!dbenv->rep_set_limit(dbenv, _gb, _u)); break; + case _REPNSITES: _PUT_U(!dbenv->rep_set_nsites(dbenv, _u)); break; + case _REPPRIORITY: _PUT_U(!dbenv->rep_set_priority(dbenv, _u)); break; + /* XXX FIXME: dbenv->rep_set_request(dbenv, u min, u max) */ + +#define _JUMP(_v, _lbl) _##_v: _i = _v; goto _lbl + case _JUMP(DB_REP_ACK_TIMEOUT, _rep_set_timeout); + case _JUMP(DB_REP_CHECKPOINT_DELAY, _rep_set_timeout); + case _JUMP(DB_REP_CONNECTION_RETRY, _rep_set_timeout); + case _JUMP(DB_REP_ELECTION_TIMEOUT, _rep_set_timeout); + case _JUMP(DB_REP_ELECTION_RETRY, _rep_set_timeout); + case _JUMP(DB_REP_FULL_ELECTION_TIMEOUT, _rep_set_timeout); + case _JUMP(DB_REP_HEARTBEAT_MONITOR, _rep_set_timeout); + case _JUMP(DB_REP_HEARTBEAT_SEND, _rep_set_timeout); + case _JUMP(DB_REP_LEASE_TIMEOUT, _rep_set_timeout); +#undef _JUMP + _rep_set_timeout: + *vp = _PUT_U(!dbenv->rep_set_timeout(dbenv, _i, _u)); + break; + + /* XXX FIXME: dbenv->repmgr_set_ack_policy(dbenv, _i) */ + + default: + break; + } + + _s = _free(_s); + + return JS_TRUE; +} + +static JSBool +rpmdbe_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmdbe_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static DB_ENV * +rpmdbe_init(JSContext *cx, JSObject *obj) +{ + DB_ENV * dbenv = NULL; + uint32_t _flags = 0; + int ret = db_env_create(&dbenv, _flags); + + if (ret || dbenv == NULL || !JS_SetPrivate(cx, obj, (void *)dbenv)) { + if (dbenv) + ret = dbenv->close(dbenv, _flags); + + /* XXX error msg */ + dbenv = NULL; + } else { + dbenv->set_errcall(dbenv, rpmdbe_errcall); + dbenv->set_msgcall(dbenv, rpmdbe_msgcall); + ret = dbenv->set_app_dispatch(dbenv, rpmdbe_app_dispatch); + if (ret) dbenv->err(dbenv, ret, "DB_ENV->set_app_dispatch"); + } + +if (_debug) +fprintf(stderr, "<== %s(%p,%p) dbenv %p\n", __FUNCTION__, cx, obj, dbenv); + + return dbenv; +} + +static void +rpmdbe_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdbeClass, NULL); + DB_ENV * dbenv = ptr; + uint32_t _flags = 0; + +_DTOR_DEBUG_ENTRY(_debug); + + if (dbenv) + (void) dbenv->close(dbenv, _flags); + +} + +static JSBool +rpmdbe_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (JS_IsConstructing(cx, vp)) { + (void) rpmdbe_init(cx, obj); + } else { + if ((obj = JS_NewObject(cx, &rpmdbeClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdbe_call(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + /* XXX obj is the global object so lookup "this" object. */ + JSObject * o = JSVAL_TO_OBJECT(argv[-2]); + void * ptr = JS_GetInstancePrivate(cx, o, &rpmdbeClass, NULL); +#ifdef NOTYET + DB_ENV * dbenv = ptr; + const char *_fn = NULL; + const char * _con = NULL; +#endif + JSBool ok = JS_FALSE; + +#ifdef NOTYET + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_fn))) + goto exit; + + *vp = (db && _fn && (_con = rpmdbeLgetfilecon(db, _fn)) != NULL) + ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _con)) : JSVAL_VOID; + _con = _free(_con); + + ok = JS_TRUE; + +exit: +#endif + +if (_debug) +fprintf(stderr, "<== %s(%p,%p[%u],%p) o %p ptr %p\n", __FUNCTION__, cx, argv, (unsigned)argc, vp, o, ptr); + + return ok; +} + +/* --- Class initialization */ +JSClass rpmdbeClass = { + "Dbe", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmdbe_addprop, rpmdbe_delprop, rpmdbe_getprop, rpmdbe_setprop, + (JSEnumerateOp)rpmdbe_enumerate, (JSResolveOp)rpmdbe_resolve, + rpmdbe_convert, rpmdbe_dtor, + + rpmdbe_getobjectops, rpmdbe_checkaccess, + rpmdbe_call, rpmdbe_construct, + rpmdbe_xdrobject, rpmdbe_hasinstance, + rpmdbe_mark, rpmdbe_reserveslots, +}; + +JSObject * +rpmjs_InitDbeClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmdbeClass, rpmdbe_ctor, 1, + rpmdbe_props, rpmdbe_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewDbeObject(JSContext *cx) +{ + JSObject *obj; + DB_ENV * dbenv; + + if ((obj = JS_NewObject(cx, &rpmdbeClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((dbenv = rpmdbe_init(cx, obj)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmdbe, Dbe, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmdbe-js.h b/rpm-5.4.9/js/rpmdbe-js.h new file mode 100644 index 0000000..2fbddda --- /dev/null +++ b/rpm-5.4.9/js/rpmdbe-js.h @@ -0,0 +1,27 @@ +#ifndef H_RPMDBE_JS +#define H_RPMDBE_JS + +/** + * \file js/rpmdbe-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmdbeClass; +#define OBJ_IS_RPMDBE(_cx, _o) (JS_GET_CLASS(_cx, _o) == &rpmdbeClass) + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitDbeClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewDbeObject(JSContext *cx); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMDBE_JS */ diff --git a/rpm-5.4.9/js/rpmdc-js.c b/rpm-5.4.9/js/rpmdc-js.c new file mode 100644 index 0000000..1f192cd --- /dev/null +++ b/rpm-5.4.9/js/rpmdc-js.c @@ -0,0 +1,421 @@ +/** \ingroup js_c + * \file js/rpmdc-js.c + */ + +#include "system.h" + +#include "rpmdc-js.h" +#include "rpmjs-debug.h" + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmdc_addprop JS_PropertyStub +#define rpmdc_delprop JS_PropertyStub +#define rpmdc_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmdc_getobjectops NULL +#define rpmdc_checkaccess NULL +#define rpmdc_call rpmdc_call +#define rpmdc_construct rpmdc_ctor +#define rpmdc_xdrobject NULL +#define rpmdc_hasinstance NULL +#define rpmdc_mark NULL +#define rpmdc_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmdc_equality NULL +#define rpmdc_outerobject NULL +#define rpmdc_innerobject NULL +#define rpmdc_iteratorobject NULL +#define rpmdc_wrappedobject NULL + +typedef DIGEST_CTX rpmdc; /* XXX use rpmdc from tools/digest.c instead */ + +/*@uncehcked@*/ +static pgpHashAlgo _dalgo_default = PGPHASHALGO_MD5; + +/* --- helpers */ + +/* --- Object methods */ +static JSBool +rpmdc_Init(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdcClass, NULL); + rpmdc dc = ptr; + JSBool ok = JS_FALSE; + unsigned int _dalgo = PGPHASHALGO_NONE; + unsigned int _flags = RPMDIGEST_NONE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/uu", &_dalgo, &_flags))) + goto exit; + + if (dc) { + if (_dalgo == PGPHASHALGO_NONE) _dalgo = rpmDigestAlgo(dc); + (void) rpmDigestFinal(dc, NULL, NULL, 0); + (void) JS_SetPrivate(cx, obj, (void *)NULL); + } + if (_dalgo == PGPHASHALGO_NONE) _dalgo = _dalgo_default; + dc = rpmDigestInit(_dalgo, _flags); + (void) JS_SetPrivate(cx, obj, (void *)dc); + + *vp = JSVAL_TRUE; + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmdc_Update(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdcClass, NULL); + rpmdc dc = ptr; + JSBool ok = JS_FALSE; + const char * s = NULL; + size_t ns = 0; + +_METHOD_DEBUG_ENTRY(_debug); + + *vp = JSVAL_FALSE; + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &s))) + goto exit; + if (dc == NULL) + goto exit; + + if (s && (ns = strlen(s)) > 0) + (void) rpmDigestUpdate(dc, s, ns); + *vp = JSVAL_TRUE; + + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmdc_Fini(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdcClass, NULL); + rpmdc dc = ptr; + JSBool ok = JS_FALSE; + const char * s = NULL; + size_t ns = 0; + +_METHOD_DEBUG_ENTRY(_debug); + + *vp = JSVAL_FALSE; + if (dc == NULL) + goto exit; + + (void) rpmDigestFinal(dc, &s, &ns, 1); + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, s)); + + (void) JS_SetPrivate(cx, obj, (void *)NULL); + + ok = JS_TRUE; +exit: + s = _free(s); + return ok; +} + +static JSFunctionSpec rpmdc_funcs[] = { + JS_FS("init", rpmdc_Init, 0,0), + JS_FS("update", rpmdc_Update, 0,0), + JS_FS("fini", rpmdc_Fini, 0,0), + JS_FS_END +}; + +/* --- Object properties */ +enum rpmdc_tinyid { + _DEBUG = -2, + _ALGO = -3, + _ASN1 = -4, + _NAME = -5, +}; + +static JSPropertySpec rpmdc_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {"algo", _ALGO, JSPROP_ENUMERATE, NULL, NULL}, + {"asn1", _ASN1, JSPROP_ENUMERATE, NULL, NULL}, + {"name", _NAME, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +/* XXX rpm digest getters handle NULL already */ +#define _GET_I(_p, _f) ((_p) ? INT_TO_JSVAL((int)(_f)) : JSVAL_VOID) +#define _GET_S(_p, _f) \ + ((_p) ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, (_f))) : JSVAL_VOID) + +static JSBool +rpmdc_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdcClass, NULL); + rpmdc dc = ptr; + jsint tiny = JSVAL_TO_INT(id); + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: *vp = INT_TO_JSVAL(_debug); break; + case _ALGO: *vp = _GET_I(dc, rpmDigestAlgo(dc)); break; + case _ASN1: *vp = _GET_S(dc, rpmDigestASN1(dc)); break; + case _NAME: *vp = _GET_S(dc, rpmDigestName(dc)); break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmdc_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdcClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +#ifdef NOTYET +static JSBool +rpmdc_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdcClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmdc_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} +#else +#define rpmdc_resolve JS_ResolveStub +#define rpmdc_enumerate JS_EnumerateStub +#endif + +/* --- Object ctors/dtors */ +static rpmdc +rpmdc_init(JSContext *cx, JSObject *obj, unsigned int _dalgo, + unsigned int _flags) +{ + rpmdc dc = (_dalgo > 0 ? rpmDigestInit(_dalgo, _flags) : NULL); + +if (_debug) +fprintf(stderr, "==> %s(%p,%p,%u,%u) dc %p\n", __FUNCTION__, cx, obj, _dalgo, _flags, dc); + + if (!JS_SetPrivate(cx, obj, (void *)dc)) { + /* XXX error msg */ + return NULL; + } + return dc; +} + +static void +rpmdc_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdcClass, NULL); + rpmdc dc = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + if (dc) + (void) rpmDigestFinal(dc, NULL, NULL, 0); +} + +static JSBool +rpmdc_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + unsigned int _dalgo = PGPHASHALGO_NONE; + unsigned int _flags = RPMDIGEST_NONE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/uu", &_dalgo, &_flags))) + goto exit; + + if (JS_IsConstructing(cx, vp)) { + (void) rpmdc_init(cx, obj, _dalgo, _flags); + } else { + if ((obj = JS_NewObject(cx, &rpmdcClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdc_call(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + /* XXX obj is the global object so lookup "this" object. */ + JSObject * o = JSVAL_TO_OBJECT(argv[-2]); + void * ptr = JS_GetInstancePrivate(cx, o, &rpmdcClass, NULL); + rpmdc dc = ptr; + JSBool ok = JS_FALSE; + const char * s = NULL; + unsigned int _dalgo = PGPHASHALGO_NONE; + unsigned int _flags = RPMDIGEST_NONE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/s", &s))) + goto exit; + + if (dc) { + /* XXX retrieve current settings for persistence. */ + _dalgo = rpmDigestAlgo(dc); + _flags = rpmDigestF(dc); + (void) rpmDigestFinal(dc, NULL, NULL, 0); + /* XXX error msg */ + dc = ptr = NULL; + (void) JS_SetPrivate(cx, o, (void *)dc); + } + + if (_dalgo == PGPHASHALGO_NONE) _dalgo = _dalgo_default; + dc = ptr = rpmdc_init(cx, o, _dalgo, _flags); + + if (dc && s != NULL) { + size_t ns = strlen(s); + (void) rpmDigestUpdate(dc, s, ns); + s = NULL; + ns = 0; + if (!rpmDigestFinal(dc, &s, &ns, 1)) { + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, s)); + } else + *vp = JSVAL_VOID; + s = _free(s); + + /* XXX reinitialize so that _dalgo is persistent */ + dc = ptr = NULL; + (void) JS_SetPrivate(cx, o, (void *)dc); + dc = ptr = rpmdc_init(cx, o, _dalgo, _flags); + } else + *vp = JSVAL_VOID; + + ok = JS_TRUE; + +exit: +if (_debug) +fprintf(stderr, "<== %s(%p,%p[%u],%p) o %p ptr %p\n", __FUNCTION__, cx, argv, (unsigned)argc, vp, o, ptr); + + return ok; +} + +/* --- Class initialization */ +JSClass rpmdcClass = { + /* XXX class should be "Digest" eventually, avoid name conflicts for now */ +#ifdef NOTYET + "Dc", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, +#else + "Dc", JSCLASS_HAS_PRIVATE, +#endif + rpmdc_addprop, rpmdc_delprop, rpmdc_getprop, rpmdc_setprop, + (JSEnumerateOp)rpmdc_enumerate, (JSResolveOp)rpmdc_resolve, + rpmdc_convert, rpmdc_dtor, + + rpmdc_getobjectops, rpmdc_checkaccess, + rpmdc_call, rpmdc_construct, + rpmdc_xdrobject, rpmdc_hasinstance, + rpmdc_mark, rpmdc_reserveslots, +}; + +JSObject * +rpmjs_InitDcClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmdcClass, rpmdc_ctor, 1, + rpmdc_props, rpmdc_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewDcObject(JSContext *cx, unsigned int _dalgo, unsigned int _flags) +{ + JSObject *obj; + rpmdc dc; + + if ((obj = JS_NewObject(cx, &rpmdcClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((dc = rpmdc_init(cx, obj, _dalgo, _flags)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmdc, Dc, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmdc-js.h b/rpm-5.4.9/js/rpmdc-js.h new file mode 100644 index 0000000..ff74887 --- /dev/null +++ b/rpm-5.4.9/js/rpmdc-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMDC_JS +#define H_RPMDC_JS + +/** + * \file js/rpmdc-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmdcClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitDcClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewDcObject(JSContext *cx, unsigned int _dalgo, unsigned int _flags); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMDC_JS */ diff --git a/rpm-5.4.9/js/rpmdig-js.c b/rpm-5.4.9/js/rpmdig-js.c new file mode 100644 index 0000000..2c424ae --- /dev/null +++ b/rpm-5.4.9/js/rpmdig-js.c @@ -0,0 +1,240 @@ +/** \ingroup js_c + * \file js/rpmdig-js.c + */ + +#include "system.h" + +#include "rpmdig-js.h" +#include "rpmjs-debug.h" + +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmdig_addprop JS_PropertyStub +#define rpmdig_delprop JS_PropertyStub +#define rpmdig_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmdig_getobjectops NULL +#define rpmdig_checkaccess NULL +#define rpmdig_call NULL +#define rpmdig_construct rpmdig_ctor +#define rpmdig_xdrobject NULL +#define rpmdig_hasinstance NULL +#define rpmdig_mark NULL +#define rpmdig_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmdig_equality NULL +#define rpmdig_outerobject NULL +#define rpmdig_innerobject NULL +#define rpmdig_iteratorobject NULL +#define rpmdig_wrappedobject NULL + +/* --- helpers */ + +/* --- Object methods */ + +static JSFunctionSpec rpmdig_funcs[] = { + JS_FS_END +}; + +/* --- Object properties */ +enum rpmdig_tinyid { + _DEBUG = -2, +}; + +static JSPropertySpec rpmdig_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmdig_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdigClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmdig_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdigClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmdig_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdigClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmdig_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static pgpDig +rpmdig_init(JSContext *cx, JSObject *obj) +{ + pgpDig dig = pgpDigNew(RPMVSF_DEFAULT, 0); + +if (_debug) +fprintf(stderr, "==> %s(%p,%p) dig %p\n", __FUNCTION__, cx, obj, dig); + + if (!JS_SetPrivate(cx, obj, (void *)dig)) { + /* XXX error msg */ + return NULL; + } + return dig; +} + +static void +rpmdig_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdigClass, NULL); + pgpDig dig = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + if (dig) + dig = pgpDigFree(dig); +} + +static JSBool +rpmdig_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (JS_IsConstructing(cx, vp)) { + (void) rpmdig_init(cx, obj); + } else { + if ((obj = JS_NewObject(cx, &rpmdigClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass rpmdigClass = { + "Dig", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmdig_addprop, rpmdig_delprop, rpmdig_getprop, rpmdig_setprop, + (JSEnumerateOp)rpmdig_enumerate, (JSResolveOp)rpmdig_resolve, + rpmdig_convert, rpmdig_dtor, + + rpmdig_getobjectops, rpmdig_checkaccess, + rpmdig_call, rpmdig_construct, + rpmdig_xdrobject, rpmdig_hasinstance, + rpmdig_mark, rpmdig_reserveslots, +}; + +JSObject * +rpmjs_InitDigClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmdigClass, rpmdig_ctor, 1, + rpmdig_props, rpmdig_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewDigObject(JSContext *cx) +{ + JSObject *obj; + pgpDig dig; + + if ((obj = JS_NewObject(cx, &rpmdigClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((dig = rpmdig_init(cx, obj)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmdig, Dig, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmdig-js.h b/rpm-5.4.9/js/rpmdig-js.h new file mode 100644 index 0000000..bfefb36 --- /dev/null +++ b/rpm-5.4.9/js/rpmdig-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMDIG_JS +#define H_RPMDIG_JS + +/** + * \file js/rpmdig-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmdigClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitDigClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewDigObject(JSContext *cx); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMDIG_JS */ diff --git a/rpm-5.4.9/js/rpmdir-js.c b/rpm-5.4.9/js/rpmdir-js.c new file mode 100644 index 0000000..bb1b11e --- /dev/null +++ b/rpm-5.4.9/js/rpmdir-js.c @@ -0,0 +1,311 @@ +/** \ingroup js_c + * \file js/rpmdir-js.c + */ + +#include "system.h" + +#include "rpmdir-js.h" +#include "rpmjs-debug.h" +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmdir_addprop JS_PropertyStub +#define rpmdir_delprop JS_PropertyStub +#define rpmdir_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmdir_getobjectops NULL +#define rpmdir_checkaccess NULL +#define rpmdir_call rpmdir_call +#define rpmdir_construct rpmdir_ctor +#define rpmdir_xdrobject NULL +#define rpmdir_hasinstance NULL +#define rpmdir_mark NULL +#define rpmdir_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmdir_equality NULL +#define rpmdir_outerobject NULL +#define rpmdir_innerobject NULL +#define rpmdir_iteratorobject NULL +#define rpmdir_wrappedobject NULL + +/* --- helpers */ + +/* --- Object methods */ + +static JSFunctionSpec rpmdir_funcs[] = { + JS_FS_END +}; + +/* --- Object properties */ +enum rpmdir_tinyid { + _DEBUG = -2, +}; + +static JSPropertySpec rpmdir_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmdir_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdirClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: *vp = INT_TO_JSVAL(_debug); break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmdir_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdirClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmdir_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdirClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmdir_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdirClass, NULL); + DIR * dir = ptr; + struct dirent * dp; + unsigned int ix = 0; + + /* XXX VG: JS_Enumerate (jsobj.c:4211) doesn't initialize some fields. */ +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + if (idp) + *idp = JSVAL_ZERO; + *statep = INT_TO_JSVAL(ix); +if (_debug) +fprintf(stderr, "\tINIT dir %p\n", dir); + break; + case JSENUMERATE_NEXT: + ix = JSVAL_TO_INT(*statep); + if ((dp = Readdir(dir)) != NULL) { + (void) JS_DefineElement(cx, obj, + ix, STRING_TO_JSVAL(JS_NewStringCopyZ(cx, dp->d_name)), + NULL, NULL, JSPROP_ENUMERATE); + JS_ValueToId(cx, *statep, idp); +if (_debug) +fprintf(stderr, "\tNEXT dir %p[%u] dirent %p \"%s\"\n", dir, ix, dp, dp->d_name); + *statep = INT_TO_JSVAL(ix+1); + } else + *idp = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + ix = JSVAL_TO_INT(*statep); + (void) JS_DefineProperty(cx, obj, "length", INT_TO_JSVAL(ix), + NULL, NULL, JSPROP_ENUMERATE); +if (_debug) +fprintf(stderr, "\tFINI dir %p[%u]\n", dir, ix); + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static DIR * +rpmdir_init(JSContext *cx, JSObject *obj, const char * _dn) +{ + DIR * dir = NULL; + + if (_dn) { + dir = Opendir(_dn); + /* XXX error msg */ + if (!JS_SetPrivate(cx, obj, (void *)dir)) { + /* XXX error msg */ + if (dir) { + (void) Closedir(dir); + /* XXX error msg */ + } + dir = NULL; + } + } + +if (_debug) +fprintf(stderr, "<== %s(%p,%p,\"%s\") dir %p\n", __FUNCTION__, cx, obj, _dn, dir); + + return dir; +} + +static void +rpmdir_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdirClass, NULL); + DIR * dir = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + if (dir) + (void) Closedir(dir); +} + +static JSBool +rpmdir_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + const char * _dn = NULL; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/s", &_dn))) + goto exit; + + if (JS_IsConstructing(cx, vp)) { + (void) rpmdir_init(cx, obj, _dn); + } else { + if ((obj = JS_NewObject(cx, &rpmdirClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmdir_call(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + /* XXX obj is the global object so lookup "this" object. */ + JSObject * o = JSVAL_TO_OBJECT(argv[-2]); + void * ptr = JS_GetInstancePrivate(cx, o, &rpmdirClass, NULL); + DIR * dir = ptr; + JSBool ok = JS_FALSE; + const char * _dn = NULL; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p[%u],%p) o %p ptr %p\n", __FUNCTION__, cx, argv, (unsigned)argc, vp, o, ptr); + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/s", &_dn))) + goto exit; + + if (dir) { + (void) Closedir(dir); + /* XXX error msg */ + dir = ptr = NULL; + (void) JS_SetPrivate(cx, o, (void *)dir); + } + + dir = ptr = rpmdir_init(cx, o, _dn); + + *vp = OBJECT_TO_JSVAL(o); + + ok = JS_TRUE; + +exit: +if (_debug) +fprintf(stderr, "<== %s(%p,%p[%u],%p) o %p ptr %p\n", __FUNCTION__, cx, argv, (unsigned)argc, vp, o, ptr); + + return ok; +} + +/* --- Class initialization */ +JSClass rpmdirClass = { + "Dir", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmdir_addprop, rpmdir_delprop, rpmdir_getprop, rpmdir_setprop, + (JSEnumerateOp)rpmdir_enumerate, (JSResolveOp)rpmdir_resolve, + rpmdir_convert, rpmdir_dtor, + + rpmdir_getobjectops,rpmdir_checkaccess, + rpmdir_call, rpmdir_construct, + rpmdir_xdrobject, rpmdir_hasinstance, + rpmdir_mark, rpmdir_reserveslots, +}; + +JSObject * +rpmjs_InitDirClass(JSContext *cx, JSObject* obj) +{ + JSObject * proto = JS_InitClass(cx, obj, NULL, &rpmdirClass, rpmdir_ctor, 1, + rpmdir_props, rpmdir_funcs, NULL, NULL); + +if (_debug) +fprintf(stderr, "<== %s(%p,%p) proto %p\n", __FUNCTION__, cx, obj, proto); + +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewDirObject(JSContext *cx, const char * _dn) +{ + JSObject *obj; + DIR * dir; + + if ((obj = JS_NewObject(cx, &rpmdirClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((dir = rpmdir_init(cx, obj, _dn)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmdir, Dir, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmdir-js.h b/rpm-5.4.9/js/rpmdir-js.h new file mode 100644 index 0000000..94fbd3e --- /dev/null +++ b/rpm-5.4.9/js/rpmdir-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMDIR_JS +#define H_RPMDIR_JS + +/** + * \file js/rpmdir-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmdirClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitDirClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewDirObject(JSContext *cx, const char * _dn); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMDIR_JS */ diff --git a/rpm-5.4.9/js/rpmds-js.c b/rpm-5.4.9/js/rpmds-js.c new file mode 100644 index 0000000..306af43 --- /dev/null +++ b/rpm-5.4.9/js/rpmds-js.c @@ -0,0 +1,492 @@ +/** \ingroup js_c + * \file js/rpmds-js.c + */ + +#include "system.h" + +#include "rpmds-js.h" +#include "rpmhdr-js.h" +#include "rpmjs-debug.h" + +#include +#include + +#include + +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +#define rpmds_addprop JS_PropertyStub +#define rpmds_delprop JS_PropertyStub +#define rpmds_convert JS_ConvertStub + +/* --- helpers */ + +/* --- Object methods */ +static JSFunctionSpec rpmds_funcs[] = { + JS_FS_END +}; + +/* --- Object properties */ +enum rpmds_tinyid { + _DEBUG = -2, + _LENGTH = -3, + _TYPE = -4, + _IX = -5, + _A = -6, + _BUILDTIME = -7, + _COLOR = -8, + _NOPROMOTE = -9, + _N = -11, + _EVR = -12, + _F = -13, + _DNEVR = -14, + _NS = -15, + _REFS = -16, + _RESULT = -17, +}; + +static JSPropertySpec rpmds_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {"length", _LENGTH, JSPROP_ENUMERATE, NULL, NULL}, + {"type", _TYPE, JSPROP_ENUMERATE, NULL, NULL}, + {"ix", _IX, JSPROP_ENUMERATE, NULL, NULL}, + {"buildtime",_BUILDTIME, JSPROP_ENUMERATE, NULL, NULL}, + {"color", _COLOR, JSPROP_ENUMERATE, NULL, NULL}, + {"nopromote",_NOPROMOTE, JSPROP_ENUMERATE, NULL, NULL}, + {"A", _A, JSPROP_ENUMERATE, NULL, NULL}, + {"N", _N, JSPROP_ENUMERATE, NULL, NULL}, + {"EVR", _EVR, JSPROP_ENUMERATE, NULL, NULL}, + {"F", _F, JSPROP_ENUMERATE, NULL, NULL}, + {"DNEVR", _DNEVR, JSPROP_ENUMERATE, NULL, NULL}, + {"NS", _NS, JSPROP_ENUMERATE, NULL, NULL}, + {"refs", _REFS, JSPROP_ENUMERATE, NULL, NULL}, + {"result", _RESULT, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmds_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdsClass, NULL); + rpmds ds = ptr; + jsint tiny = JSVAL_TO_INT(id); + int ix; + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + case _LENGTH: + *vp = INT_TO_JSVAL(rpmdsCount(ds)); + break; + case _TYPE: + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmdsType(ds))); + break; + case _IX: + *vp = INT_TO_JSVAL(rpmdsIx(ds)); + break; + case _A: + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmdsA(ds))); + break; + case _BUILDTIME: + *vp = INT_TO_JSVAL(rpmdsBT(ds)); + break; + case _COLOR: + *vp = INT_TO_JSVAL(rpmdsColor(ds)); + break; + case _NOPROMOTE: + *vp = INT_TO_JSVAL(rpmdsNoPromote(ds)); + break; + case _N: + if ((ix = rpmdsIx(ds)) >= 0 && ix < rpmdsCount(ds)) + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmdsN(ds))); + break; + case _EVR: + if ((ix = rpmdsIx(ds)) >= 0 && ix < rpmdsCount(ds)) + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmdsEVR(ds))); + break; + case _F: + if ((ix = rpmdsIx(ds)) >= 0 && ix < rpmdsCount(ds)) + *vp = INT_TO_JSVAL(rpmdsFlags(ds)); + break; + case _DNEVR: + if ((ix = rpmdsIx(ds)) >= 0 && ix < rpmdsCount(ds)) + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmdsDNEVR(ds))); + break; + case _NS: + if ((ix = rpmdsIx(ds)) >= 0 && ix < rpmdsCount(ds)) + *vp = INT_TO_JSVAL(rpmdsNSType(ds)); + break; + case _REFS: + if ((ix = rpmdsIx(ds)) >= 0 && ix < rpmdsCount(ds)) + *vp = INT_TO_JSVAL(rpmdsRefs(ds)); + break; + case _RESULT: + if ((ix = rpmdsIx(ds)) >= 0 && ix < rpmdsCount(ds)) + *vp = INT_TO_JSVAL(rpmdsResult(ds)); + break; + default: + if (!(tiny >= 0 && tiny < rpmdsCount(ds))) + break; + break; + } + + return JS_TRUE; +} + +static JSBool +rpmds_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdsClass, NULL); + rpmds ds = (rpmds)ptr; + jsint tiny = JSVAL_TO_INT(id); + int myint; + int ix; + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + case _IX: + if (!JS_ValueToInt32(cx, *vp, &myint)) + break; + if (myint < 0 || myint >= rpmdsCount(ds)) + (void)rpmdsInit(ds); + else { +if (_debug < 0) +fprintf(stderr, "\trpmdsSetIx(%p, %d)\n", ds, myint); + if ((myint-1) != rpmdsIx(ds)) + (void) rpmdsSetIx(ds, myint-1); + /* XXX flush and recreate N and DNEVR with a rpmdsNext() step */ + (void) rpmdsNext(ds); + } + break; + case _BUILDTIME: + if (!JS_ValueToInt32(cx, *vp, &myint)) + break; + (void) rpmdsSetBT(ds, myint); + break; + case _COLOR: + if (!JS_ValueToInt32(cx, *vp, &myint)) + break; + (void) rpmdsSetColor(ds, myint); + break; + case _NOPROMOTE: + if (!JS_ValueToInt32(cx, *vp, &myint)) + break; + (void) rpmdsSetNoPromote(ds, myint); + break; + case _REFS: + if (!JS_ValueToInt32(cx, *vp, &myint)) + break; + if ((ix = rpmdsIx(ds)) >= 0 && ix < rpmdsCount(ds)) + (void) rpmdsSetRefs(ds, myint); + break; + case _RESULT: + if (!JS_ValueToInt32(cx, *vp, &myint)) + break; + if ((ix = rpmdsIx(ds)) >= 0 && ix < rpmdsCount(ds)) + (void) rpmdsSetResult(ds, myint); + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmds_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdsClass, NULL); + rpmds ds = ptr; + jsint ix; + JSBool ok = JS_FALSE; + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ds == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + ok = JS_TRUE; + goto exit; + } + + if (JSVAL_IS_INT(id) + && (ix = JSVAL_TO_INT(id)) >= 0 && ix < rpmdsCount(ds)) + { + JSObject * arr = JS_NewArrayObject(cx, 3, NULL); + JSString *valstr; + const char *N = rpmdsN(ds); + const char *EVR = rpmdsEVR(ds); + unsigned Flags = rpmdsFlags(ds); + + if (ix != rpmdsIx(ds)) { +if (_debug < 0) +fprintf(stderr, "\trpmdsSetIx(%p, %d)\n", ds, ix); + (void) rpmdsSetIx(ds, ix-1); + (void) rpmdsNext(ds); + } + + if (!JS_DefineElement(cx, obj, ix, OBJECT_TO_JSVAL(arr), + NULL, NULL, JSPROP_ENUMERATE)) + goto exit; + if ((valstr = JS_NewStringCopyZ(cx, N)) == NULL + || !JS_DefineElement(cx, arr, 0, STRING_TO_JSVAL(valstr), + NULL, NULL, JSPROP_ENUMERATE)) + goto exit; + if ((valstr = JS_NewStringCopyZ(cx, EVR)) == NULL + || !JS_DefineElement(cx, arr, 1, STRING_TO_JSVAL(valstr), + NULL, NULL, JSPROP_ENUMERATE)) + goto exit; + if (!JS_DefineElement(cx, arr, 2, INT_TO_JSVAL(Flags), + NULL, NULL, JSPROP_ENUMERATE)) + goto exit; + *objp = obj; + } else + *objp = NULL; + + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmds_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdsClass, NULL); + rpmds ds = (rpmds)ptr; + int ix; + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + (void) rpmdsInit(ds); + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; /* XXX needed? */ + if ((ix = rpmdsNext(ds)) >= 0) { + JS_ValueToId(cx, INT_TO_JSVAL(ix), idp); + } else + *idp = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + /* XXX Allow our iterator object to be GC'd. */ + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static rpmds +rpmds_init(JSContext *cx, JSObject *obj, jsval v, uint32_t _tagN) +{ + rpmds ds = NULL; + JSObject * o = (JSVAL_IS_OBJECT(v) ? JSVAL_TO_OBJECT(v) : NULL); + int xx; + + if (o && OBJ_IS_RPMHDR(cx, o)) { + Header h = JS_GetPrivate(cx, o); + int flags = 0; + if (_tagN == RPMTAG_NAME) { + flags = RPMSENSE_EQUAL; + _tagN = RPMTAG_PROVIDENAME; + ds = rpmdsThis(h, _tagN, flags); +if (_debug) +fprintf(stderr, "\trpmdsThis(%p, %s(%d), 0x%x) ds %p\n", h, tagName(_tagN), _tagN, flags, ds); + } else { + ds = rpmdsNew(h, _tagN, flags); +if (_debug) +fprintf(stderr, "\trpmdsNew(%p, %s(%d), 0x%x) ds %p\n", h, tagName(_tagN), _tagN, flags, ds); + } + if (ds == NULL) + return NULL; + } else + if (JSVAL_IS_STRING(v)) { + const char * s = JS_EncodeString(cx, JS_ValueToString(cx, v)); + if (!strcmp(s, "cpuinfo")) { + xx = rpmdsCpuinfo(&ds, NULL); +if (_debug) +fprintf(stderr, "\trpmdsCpuinfo() ret %d ds %p\n", xx, ds); + } else + if (!strcmp(s, "rpmlib")) { + xx = rpmdsRpmlib(&ds, NULL); +if (_debug) +fprintf(stderr, "\trpmdsRpmlib() ret %d ds %p\n", xx, ds); + } else + if (!strcmp(s, "getconf")) { + xx = rpmdsGetconf(&ds, NULL); +if (_debug) +fprintf(stderr, "\trpmdsGetconf() ret %d ds %p\n", xx, ds); + } else + if (!strcmp(s, "uname")) { + xx = rpmdsUname(&ds, NULL); +if (_debug) +fprintf(stderr, "\trpmdsUname() ret %d ds %p\n", xx, ds); + } else + { +if (_debug) +fprintf(stderr, "\tstring \"%s\" is unknown. ds %p\n", s, ds); + s = _free(s); + return NULL; + } + s = _free(s); + } else + if (o && JS_IsArrayObject(cx, o)) { + jsuint length = 0; + JSBool ok = JS_GetArrayLength(cx, o, &length); + const char * N = NULL; + const char * EVR = NULL; + uint32_t F = 0; + jsuint i; + + if (!ok) + return NULL; + if (length != 3) + return NULL; + for (i = 0; i < length; i++) { + jsval v; + if (!(ok = JS_GetElement(cx, o, (jsint)i, &v))) + return NULL; + switch (i) { + default: + return NULL; + /*@notreached@*/ break; + case 0: + N = JS_EncodeString(cx, JSVAL_TO_STRING(v)); + break; + case 1: + EVR = JS_EncodeString(cx, JSVAL_TO_STRING(v)); + break; + case 2: + F = JSVAL_TO_INT(v); + break; + } + } + ds = rpmdsSingle(_tagN, N, EVR, F); +if (_debug) +fprintf(stderr, "\trpmdsSingle(%s(%d), %s, %s, 0x%x) ds %p\n", tagName(_tagN), _tagN, N, EVR, F, ds); + EVR = _free(EVR); + N = _free(N); + return NULL; + } else { +if (_debug) +fprintf(stderr, "\tobject class %p is unknown. ds %p\n", JS_GET_CLASS(cx, o), ds); + return NULL; + } + if (!JS_SetPrivate(cx, obj, (void *)ds)) { + /* XXX error msg */ + (void) rpmdsFree(ds); + return NULL; + } + return ds; +} + +static void +rpmds_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmdsClass, NULL); + rpmds ds = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + (void) rpmdsFree(ds); +} + +static JSBool +rpmds_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + jsval v = JSVAL_VOID; + uint32_t tagN = RPMTAG_REQUIRENAME; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "v/u", &v, &tagN))) + goto exit; + + if (JS_IsConstructing(cx, vp)) { + if (rpmds_init(cx, obj, v, tagN) == NULL) + goto exit; + } else { + if ((obj = JS_NewObject(cx, &rpmdsClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass rpmdsClass = { + "Ds", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmds_addprop, rpmds_delprop, rpmds_getprop, rpmds_setprop, + (JSEnumerateOp)rpmds_enumerate, (JSResolveOp)rpmds_resolve, + rpmds_convert, rpmds_dtor, + JSCLASS_NO_OPTIONAL_MEMBERS +}; + +JSObject * +rpmjs_InitDsClass(JSContext *cx, JSObject* obj) +{ + JSObject * o; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + o = JS_InitClass(cx, obj, NULL, &rpmdsClass, rpmds_ctor, 1, + rpmds_props, rpmds_funcs, NULL, NULL); +assert(o != NULL); + return o; +} + +JSObject * +rpmjs_NewDsObject(JSContext *cx, jsval v, uint32_t _tagN) +{ + JSObject *obj; + rpmds ds; + + if ((obj = JS_NewObject(cx, &rpmdsClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((ds = rpmds_init(cx, obj, v, _tagN)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmds, Ds, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmds-js.h b/rpm-5.4.9/js/rpmds-js.h new file mode 100644 index 0000000..351cdfc --- /dev/null +++ b/rpm-5.4.9/js/rpmds-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMDS_JS +#define H_RPMDS_JS + +/** + * \file js/rpmds-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmdsClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitDsClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewDsObject(JSContext *cx, jsval v, uint32_t _tagN); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMDS_JS */ diff --git a/rpm-5.4.9/js/rpmfc-js.c b/rpm-5.4.9/js/rpmfc-js.c new file mode 100644 index 0000000..79986f5 --- /dev/null +++ b/rpm-5.4.9/js/rpmfc-js.c @@ -0,0 +1,242 @@ +/** \ingroup js_c + * \file js/rpmfc-js.c + */ + +#include "system.h" + +#include "rpmfc-js.h" +#include "rpmjs-debug.h" + +#include +#define _RPMFC_INTERNAL +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmfc_addprop JS_PropertyStub +#define rpmfc_delprop JS_PropertyStub +#define rpmfc_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmfc_getobjectops NULL +#define rpmfc_checkaccess NULL +#define rpmfc_call NULL +#define rpmfc_construct rpmfc_ctor +#define rpmfc_xdrobject NULL +#define rpmfc_hasinstance NULL +#define rpmfc_mark NULL +#define rpmfc_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmfc_equality NULL +#define rpmfc_outerobject NULL +#define rpmfc_innerobject NULL +#define rpmfc_iteratorobject NULL +#define rpmfc_wrappedobject NULL + +/* --- helpers */ + +/* --- Object methods */ + +static JSFunctionSpec rpmfc_funcs[] = { + JS_FS_END +}; + +/* --- Object properties */ +enum rpmfc_tinyid { + _DEBUG = -2, +}; + +static JSPropertySpec rpmfc_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmfc_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmfcClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmfc_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmfcClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmfc_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmfcClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmfc_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static rpmfc +rpmfc_init(JSContext *cx, JSObject *obj) +{ + rpmfc fc = rpmfcNew(); + +if (_debug) +fprintf(stderr, "==> %s(%p,%p) fc %p\n", __FUNCTION__, cx, obj, fc); + + if (!JS_SetPrivate(cx, obj, (void *)fc)) { + /* XXX error msg */ + return NULL; + } + return fc; +} + +static void +rpmfc_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmfcClass, NULL); + rpmfc fc = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + if (fc) + (void) rpmfcFree(fc); +} + +static JSBool +rpmfc_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (JS_IsConstructing(cx, vp)) { + (void) rpmfc_init(cx, obj); + } else { + if ((obj = JS_NewObject(cx, &rpmfcClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass rpmfcClass = { + "Fc", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmfc_addprop, rpmfc_delprop, rpmfc_getprop, rpmfc_setprop, + (JSEnumerateOp)rpmfc_enumerate, (JSResolveOp)rpmfc_resolve, + rpmfc_convert, rpmfc_dtor, + + rpmfc_getobjectops, rpmfc_checkaccess, + rpmfc_call, rpmfc_construct, + rpmfc_xdrobject, rpmfc_hasinstance, + rpmfc_mark, rpmfc_reserveslots, +}; + +JSObject * +rpmjs_InitFcClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmfcClass, rpmfc_ctor, 1, + rpmfc_props, rpmfc_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewFcObject(JSContext *cx) +{ + JSObject *obj; + rpmfc fc; + + if ((obj = JS_NewObject(cx, &rpmfcClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((fc = rpmfc_init(cx, obj)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmfc, Fc, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmfc-js.h b/rpm-5.4.9/js/rpmfc-js.h new file mode 100644 index 0000000..8b749c4 --- /dev/null +++ b/rpm-5.4.9/js/rpmfc-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMFC_JS +#define H_RPMFC_JS + +/** + * \file js/rpmfc-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmfcClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitFcClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewFcObject(JSContext *cx); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMFC_JS */ diff --git a/rpm-5.4.9/js/rpmfi-js.c b/rpm-5.4.9/js/rpmfi-js.c new file mode 100644 index 0000000..686287d --- /dev/null +++ b/rpm-5.4.9/js/rpmfi-js.c @@ -0,0 +1,451 @@ +/** \ingroup js_c + * \file js/rpmfi-js.c + */ + +#include "system.h" + +#include "rpmfi-js.h" +#include "rpmbf-js.h" +#include "rpmhdr-js.h" +#include "rpmjs-debug.h" + +#include +#include +#include + +#include + +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +#define rpmfi_addprop JS_PropertyStub +#define rpmfi_delprop JS_PropertyStub +#define rpmfi_convert JS_ConvertStub + +/* --- helpers */ + +/* --- Object methods */ + +static JSFunctionSpec rpmfi_funcs[] = { + JS_FS_END +}; + +/* --- Object properties */ +enum rpmfi_tinyid { + _DEBUG = -2, + _LENGTH = -3, + _FC = -4, + _FX = -5, + _DC = -6, + _DX = -7, + _BN = -8, + _DN = -9, + _FN = -10, + _VFLAGS = -11, + _FFLAGS = -12, + _FMODE = -13, + _FSTATE = -14, + _FDIGEST = -15, + _FLINK = -16, + _FSIZE = -17, + _FRDEV = -18, + _FMTIME = -19, + _FUSER = -20, + _FGROUP = -21, + _FCOLOR = -22, + _FCLASS = -23, + _FNBF = -24, +}; + +static JSPropertySpec rpmfi_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {"length", _LENGTH, JSPROP_ENUMERATE, NULL, NULL}, + {"fc", _FC, JSPROP_ENUMERATE, NULL, NULL}, + {"fx", _FX, JSPROP_ENUMERATE, NULL, NULL}, + {"dc", _DC, JSPROP_ENUMERATE, NULL, NULL}, + {"dx", _DX, JSPROP_ENUMERATE, NULL, NULL}, + {"bn", _BN, JSPROP_ENUMERATE, NULL, NULL}, + {"dn", _DN, JSPROP_ENUMERATE, NULL, NULL}, + {"fn", _FN, JSPROP_ENUMERATE, NULL, NULL}, + {"vflags", _VFLAGS, JSPROP_ENUMERATE, NULL, NULL}, + {"fflags", _FFLAGS, JSPROP_ENUMERATE, NULL, NULL}, + {"fmode", _FMODE, JSPROP_ENUMERATE, NULL, NULL}, + {"fstate", _FSTATE, JSPROP_ENUMERATE, NULL, NULL}, + {"fdigest", _FDIGEST, JSPROP_ENUMERATE, NULL, NULL}, + {"flink", _FLINK, JSPROP_ENUMERATE, NULL, NULL}, + {"fsize", _FSIZE, JSPROP_ENUMERATE, NULL, NULL}, + {"frdev", _FRDEV, JSPROP_ENUMERATE, NULL, NULL}, + {"fmtime", _FMTIME, JSPROP_ENUMERATE, NULL, NULL}, + {"fuser", _FUSER, JSPROP_ENUMERATE, NULL, NULL}, + {"fgroup", _FGROUP, JSPROP_ENUMERATE, NULL, NULL}, + {"fcolor", _FCOLOR, JSPROP_ENUMERATE, NULL, NULL}, + {"fclass", _FCLASS, JSPROP_ENUMERATE, NULL, NULL}, + {"fnbf", _FNBF, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmfi_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmfiClass, NULL); + rpmfi fi = ptr; + jsint tiny = JSVAL_TO_INT(id); + int ix; + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + case _LENGTH: + case _FC: + *vp = INT_TO_JSVAL(rpmfiFC(fi)); + break; + case _FX: + *vp = INT_TO_JSVAL(rpmfiFX(fi)); + break; + case _DC: + *vp = INT_TO_JSVAL(rpmfiDC(fi)); + break; + case _DX: + *vp = INT_TO_JSVAL(rpmfiDX(fi)); + break; + case _BN: + if ((ix = rpmfiFX(fi)) < 0 || ix >= rpmfiFC(fi)) break; + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmfiBN(fi))); + break; + case _DN: + if ((ix = rpmfiFX(fi)) < 0 || ix >= rpmfiFC(fi)) break; + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmfiDN(fi))); + break; + case _FN: + if ((ix = rpmfiFX(fi)) < 0 || ix >= rpmfiFC(fi)) break; + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmfiFN(fi))); + break; + case _VFLAGS: + if ((ix = rpmfiFX(fi)) < 0 || ix >= rpmfiFC(fi)) break; + *vp = INT_TO_JSVAL(rpmfiVFlags(fi)); + break; + case _FFLAGS: + if ((ix = rpmfiFX(fi)) < 0 || ix >= rpmfiFC(fi)) break; + *vp = INT_TO_JSVAL(rpmfiFFlags(fi)); + break; + case _FMODE: + if ((ix = rpmfiFX(fi)) < 0 || ix >= rpmfiFC(fi)) break; + *vp = INT_TO_JSVAL(rpmfiFMode(fi)); + break; + case _FSTATE: + if ((ix = rpmfiFX(fi)) < 0 || ix >= rpmfiFC(fi)) break; + *vp = INT_TO_JSVAL(rpmfiFState(fi)); + break; + case _FDIGEST: + if ((ix = rpmfiFX(fi)) < 0 || ix >= rpmfiFC(fi)) break; + { int dalgo = 0; + size_t dlen = 0; + const unsigned char * digest = rpmfiDigest(fi, &dalgo, &dlen); + const unsigned char * s = digest; + size_t nb = 2 * dlen; + char * fdigest = memset(alloca(nb+1), 0, nb+1); + char *t = fdigest; + int i; + + for (i = 0, s = digest, t = fdigest; i < (int)dlen; i++, s++, t+= 2) { + static const char hex[] = "0123456789abcdef"; + t[0] = hex[(s[0] >> 4) & 0xf]; + t[1] = hex[(s[0] ) & 0xf]; + } + *t = '\0'; + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, fdigest)); + } break; + case _FLINK: + if ((ix = rpmfiFX(fi)) < 0 || ix >= rpmfiFC(fi)) break; + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmfiFLink(fi))); + break; + case _FSIZE: + if ((ix = rpmfiFX(fi)) < 0 || ix >= rpmfiFC(fi)) break; + *vp = INT_TO_JSVAL(rpmfiFSize(fi)); + break; + case _FRDEV: + if ((ix = rpmfiFX(fi)) < 0 || ix >= rpmfiFC(fi)) break; + *vp = INT_TO_JSVAL(rpmfiFRdev(fi)); + break; + case _FMTIME: + if ((ix = rpmfiFX(fi)) < 0 || ix >= rpmfiFC(fi)) break; + *vp = INT_TO_JSVAL(rpmfiFMtime(fi)); + break; + case _FUSER: + if ((ix = rpmfiFX(fi)) < 0 || ix >= rpmfiFC(fi)) break; + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmfiFUser(fi))); + break; + case _FGROUP: + if ((ix = rpmfiFX(fi)) < 0 || ix >= rpmfiFC(fi)) break; + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmfiFGroup(fi))); + break; + case _FCOLOR: + if ((ix = rpmfiFX(fi)) < 0 || ix >= rpmfiFC(fi)) break; + *vp = INT_TO_JSVAL(rpmfiFColor(fi)); + break; + case _FCLASS: + if ((ix = rpmfiFX(fi)) < 0 || ix >= rpmfiFC(fi)) break; + { const char * FClass = rpmfiFClass(fi); + char * t; + if (FClass == NULL) FClass = ""; + /* XXX spot fix for known embedded single quotes. */ + t = xstrdup(FClass); + if (!strncmp(t, "symbolic link to `", sizeof("symbolic link to `")-1)) + t[sizeof("symbolic link")-1] = '\0'; + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, t)); + t = _free(t); + } break; + case _FNBF: + { rpmbf bf = NULL; + JSObject *bfo = NULL; + if ((bf = rpmfiFNBF(fi)) == NULL) + *vp = JSVAL_NULL; + else + if ((bfo = JS_NewObject(cx, &rpmbfClass, NULL, NULL)) != NULL + && JS_SetPrivate(cx, bfo, rpmbfLink(bf))) + *vp = OBJECT_TO_JSVAL(bfo); + else { + bf = rpmbfFree(bf); + *vp = JSVAL_VOID; + } + } break; + default: + if (tiny < 0 || tiny >= rpmfiFC(fi)) break; + break; + } + + return JS_TRUE; +} + +static JSBool +rpmfi_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmfiClass, NULL); + rpmfi fi = (rpmfi)ptr; + jsint tiny = JSVAL_TO_INT(id); + int myint; + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + case _FX: + if (!JS_ValueToInt32(cx, *vp, &myint)) + break; + if (myint != rpmfiFX(fi)) { + (void) rpmfiSetFX(fi, myint-1); + /* XXX flush and recreate {BN,DN,FN} with a rpmfiNext() step */ + (void) rpmfiNext(fi); + } + break; + case _DX: + if (!JS_ValueToInt32(cx, *vp, &myint)) + break; + if (myint != rpmfiDX(fi)) { + (void) rpmfiSetDX(fi, myint-1); + /* XXX flush and recreate {BN,DN,FN} with a rpmfiNextD() step */ + (void) rpmfiNextD(fi); + } + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmfi_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmfiClass, NULL); + rpmfi fi = ptr; + JSBool ok = JS_FALSE; + int ix; + +_RESOLVE_DEBUG_ENTRY(_debug); + + if ((flags & JSRESOLVE_ASSIGNING) + || (fi == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + ok = JS_TRUE; + goto exit; + } + + if (JSVAL_IS_INT(id) + && (ix = JSVAL_TO_INT(id)) >= 0 && ix < rpmfiFC(fi)) + { + JSObject * arr = JS_NewArrayObject(cx, 1, NULL); + JSString *valstr; + + if (ix != rpmfiFX(fi)) { +if (_debug < 0) +fprintf(stderr, "\trpmfiSetFX(%p, %d)\n", fi, ix); + (void) rpmfiSetFX(fi, ix-1); + (void) rpmfiNext(fi); + } + + if (!JS_DefineElement(cx, obj, ix, OBJECT_TO_JSVAL(arr), + NULL, NULL, JSPROP_ENUMERATE)) + goto exit; + if ((valstr = JS_NewStringCopyZ(cx, rpmfiFN(fi))) == NULL + || !JS_DefineElement(cx, arr, 0, STRING_TO_JSVAL(valstr), + NULL, NULL, JSPROP_ENUMERATE)) + goto exit; + *objp = obj; + } else + *objp = NULL; + + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmfi_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmfiClass, NULL); + rpmfi fi = ptr; + int ix; + +_ENUMERATE_DEBUG_ENTRY(_debug); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + (void) rpmfiInit(fi, 0); + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if ((ix = rpmfiNext(fi)) >= 0) { + JS_ValueToId(cx, INT_TO_JSVAL(ix), idp); + } else + *idp = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static rpmfi +rpmfi_init(JSContext *cx, JSObject *obj, rpmts ts, Header h, int _tagN) +{ + rpmfi fi; + int flags = 0; + + if ((fi = rpmfiNew(ts, h, _tagN, flags)) == NULL) + return NULL; + if (!JS_SetPrivate(cx, obj, (void *)fi)) { + /* XXX error msg */ + (void) rpmfiFree(fi); + return NULL; + } + return fi; +} + +static void +rpmfi_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmfiClass, NULL); + rpmfi fi = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + (void) rpmfiFree(fi); +} + +static JSBool +rpmfi_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + rpmts ts = NULL; /* XXX FIXME: should be a ts method? */ + JSObject *hdro = NULL; + int tagN = RPMTAG_BASENAMES; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "o/i", &hdro, &tagN))) + goto exit; + + if (JS_IsConstructing(cx, vp)) { + Header h = JS_GetInstancePrivate(cx, hdro, &rpmhdrClass, NULL); + if (rpmfi_init(cx, obj, ts, h, tagN) == NULL) + goto exit; + } else { + if ((obj = JS_NewObject(cx, &rpmfiClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass rpmfiClass = { + "Fi", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmfi_addprop, rpmfi_delprop, rpmfi_getprop, rpmfi_setprop, + (JSEnumerateOp)rpmfi_enumerate, (JSResolveOp)rpmfi_resolve, + rpmfi_convert, rpmfi_dtor, + JSCLASS_NO_OPTIONAL_MEMBERS +}; + +JSObject * +rpmjs_InitFiClass(JSContext *cx, JSObject* obj) +{ + JSObject * o; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + o = JS_InitClass(cx, obj, NULL, &rpmfiClass, rpmfi_ctor, 1, + rpmfi_props, rpmfi_funcs, NULL, NULL); +assert(o != NULL); + return o; +} + +JSObject * +rpmjs_NewFiObject(JSContext *cx, void * _h, int _tagN) +{ + JSObject *obj; + rpmts ts = NULL; /* XXX FIXME: should be a ts method? */ + rpmfi fi; + + if ((obj = JS_NewObject(cx, &rpmfiClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((fi = rpmfi_init(cx, obj, ts, _h, _tagN)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmfi, Fi, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmfi-js.h b/rpm-5.4.9/js/rpmfi-js.h new file mode 100644 index 0000000..d2f49df --- /dev/null +++ b/rpm-5.4.9/js/rpmfi-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMFI_JS +#define H_RPMFI_JS + +/** + * \file js/rpmfi-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmfiClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitFiClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewFiObject(JSContext *cx, void * _h, int _tagN); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMFI_JS */ diff --git a/rpm-5.4.9/js/rpmfts-js.c b/rpm-5.4.9/js/rpmfts-js.c new file mode 100644 index 0000000..d89d915 --- /dev/null +++ b/rpm-5.4.9/js/rpmfts-js.c @@ -0,0 +1,618 @@ +/** \ingroup js_c + * \file js/rpmfts-js.c + */ + +#include "system.h" + +#include "rpmfts-js.h" +#include "rpmst-js.h" +#include "rpmjs-debug.h" + +#include +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmfts_addprop JS_PropertyStub +#define rpmfts_delprop JS_PropertyStub +#define rpmfts_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmfts_getobjectops NULL +#define rpmfts_checkaccess NULL +#define rpmfts_call rpmfts_call +#define rpmfts_construct rpmfts_ctor +#define rpmfts_xdrobject NULL +#define rpmfts_hasinstance NULL +#define rpmfts_mark NULL +#define rpmfts_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmfts_equality NULL +#define rpmfts_outerobject NULL +#define rpmfts_innerobject NULL +#define rpmfts_iteratorobject NULL +#define rpmfts_wrappedobject NULL + +/* --- helpers */ +static FTS * +rpmfts_init(JSContext *cx, JSObject *obj, JSObject *dno, int _options) +{ + FTS * fts = NULL; + + if (dno) { + ARGV_t av = NULL; + const char * s = NULL; + if (JS_IsArrayObject(cx, dno)) { + jsuint length = 0; + jsuint i; + + if (JS_GetArrayLength(cx, dno, &length)) + for (i = 0; i < length; i++) { + jsval v; + if (JS_GetElement(cx, dno, (jsint)i, &v)) { + s = JS_EncodeString(cx, JSVAL_TO_STRING(v)); + argvAdd(&av, s); + s = _free(s); + } + } + } else { + s = JS_EncodeString(cx, JS_ValueToString(cx, OBJECT_TO_JSVAL(dno))); + argvAdd(&av, s); + s = _free(s); + } + + if (_options == -1) _options = 0; + _options &= FTS_OPTIONMASK; + /* XXX FIXME: validate _options */ + if (av) + fts = Fts_open((char *const *)av, _options, NULL); + /* XXX error msg */ + av = argvFree(av); + if (!JS_SetPrivate(cx, obj, (void *)fts)) { + /* XXX error msg */ + if (fts) { + (void) Fts_close(fts); + /* XXX error msg */ + } + fts = NULL; + } + } + +if (_debug) +fprintf(stderr, "<== %s(%p,%p,%p) fts %p\n", __FUNCTION__, cx, obj, dno, fts); + + return fts; +} + +/* --- Object methods */ +static JSBool +rpmfts_children(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmftsClass, NULL); + FTS * fts = ptr; + FTSENT * p; + int _instr = FTS_NOINSTR; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_instr))) + goto exit; + + /* XXX FIXME: FTS_children() return? */ + *vp = (fts && (p = Fts_children(fts, _instr)) != NULL + ? OBJECT_TO_JSVAL(obj) : JSVAL_FALSE); + + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmfts_close(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmftsClass, NULL); + FTS * fts = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + /* XXX FIXME: _options are not persistent across fts.close() */ + if (fts) { + (void) Fts_close(fts); + /* XXX error msg */ + fts = ptr = NULL; + (void) JS_SetPrivate(cx, obj, (void *)fts); + } + *vp = OBJECT_TO_JSVAL(obj); + + ok = JS_TRUE; + return ok; +} + +static JSBool +rpmfts_open(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmftsClass, NULL); + FTS * fts = ptr; + JSObject *dno = NULL; + int _options = -1; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "o/u", &dno, &_options))) + goto exit; + + if (fts) { + if (_options == -1) _options = fts->fts_options; + (void) Fts_close(fts); + /* XXX error msg */ + fts = ptr = NULL; + (void) JS_SetPrivate(cx, obj, (void *)fts); + } + + fts = ptr = rpmfts_init(cx, obj, dno, _options); + + *vp = OBJECT_TO_JSVAL(obj); + + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmfts_read(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmftsClass, NULL); + FTS * fts = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + *vp = (fts && Fts_read(fts) ? OBJECT_TO_JSVAL(obj) : JSVAL_FALSE); + + ok = JS_TRUE; + return ok; +} + +static JSBool +rpmfts_set(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmftsClass, NULL); + FTS * fts = ptr; + FTSENT * p = (fts ? fts->fts_cur : NULL); + int _instr = FTS_NOINSTR; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_instr))) + goto exit; + + *vp = (fts && p && !Fts_set(fts, p, _instr) + ? OBJECT_TO_JSVAL(obj) : JSVAL_FALSE); + + ok = JS_TRUE; +exit: + return ok; +} + +static JSFunctionSpec rpmfts_funcs[] = { + JS_FS("children", rpmfts_children, 0,0), + JS_FS("close", rpmfts_close, 0,0), + JS_FS("open", rpmfts_open, 0,0), + JS_FS("read", rpmfts_read, 0,0), + JS_FS("set", rpmfts_set, 0,0), + JS_FS_END +}; + +/* --- Object properties */ +enum rpmfts_tinyid { + _DEBUG = -2, + + /* FTS fields */ + _CURRENT = -10, + _CHILD = -11, + _ARRAY = -12, + _ROOTDEV = -13, + _ROOT = -14, + _ROOTLEN = -15, + _NITEMS = -16, + _OPTIONS = -17, + + /* FTSENT fields */ + _CYCLE = -20, + _PARENT = -21, + _LINK = -22, + _NUMBER = -23, + _POINTER = -24, + _ACCPATH = -25, + _PATH = -26, + _ERRNO = -27, + _PATHLEN = -28, + _NAMELEN = -29, + _INO = -30, + _DEV = -31, + _NLINK = -32, + _LEVEL = -33, + _INFO = -34, + _FLAGS = -35, + _INSTR = -36, + _STATP = -37, + _NAME = -38, +}; + +static JSPropertySpec rpmfts_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + + /* FTS fields */ + {"current", _CURRENT, JSPROP_ENUMERATE, NULL, NULL}, + {"child", _CHILD, JSPROP_ENUMERATE, NULL, NULL}, + {"array", _ARRAY, JSPROP_ENUMERATE, NULL, NULL}, + {"rootdev", _ROOTDEV, JSPROP_ENUMERATE, NULL, NULL}, + {"root", _ROOT, JSPROP_ENUMERATE, NULL, NULL}, + {"rootlen", _ROOTLEN, JSPROP_ENUMERATE, NULL, NULL}, + {"nitems", _NITEMS, JSPROP_ENUMERATE, NULL, NULL}, + {"options", _OPTIONS, JSPROP_ENUMERATE, NULL, NULL}, + + /* FTSENT fields */ + {"cycle", _CYCLE, JSPROP_ENUMERATE, NULL, NULL}, + {"parent", _PARENT, JSPROP_ENUMERATE, NULL, NULL}, + {"link", _LINK, JSPROP_ENUMERATE, NULL, NULL}, + {"number", _NUMBER, JSPROP_ENUMERATE, NULL, NULL}, + {"pointer", _POINTER, JSPROP_ENUMERATE, NULL, NULL}, + {"accpath", _ACCPATH, JSPROP_ENUMERATE, NULL, NULL}, + {"path", _PATH, JSPROP_ENUMERATE, NULL, NULL}, + {"errno", _ERRNO, JSPROP_ENUMERATE, NULL, NULL}, + {"pathlen", _PATHLEN, JSPROP_ENUMERATE, NULL, NULL}, + {"namelen", _NAMELEN, JSPROP_ENUMERATE, NULL, NULL}, + {"ino", _INO, JSPROP_ENUMERATE, NULL, NULL}, + {"dev", _DEV, JSPROP_ENUMERATE, NULL, NULL}, + {"nlink", _NLINK, JSPROP_ENUMERATE, NULL, NULL}, + {"level", _LEVEL, JSPROP_ENUMERATE, NULL, NULL}, + {"info", _INFO, JSPROP_ENUMERATE, NULL, NULL}, + {"flags", _FLAGS, JSPROP_ENUMERATE, NULL, NULL}, + {"instr", _INSTR, JSPROP_ENUMERATE, NULL, NULL}, + {"st", _STATP, JSPROP_ENUMERATE, NULL, NULL}, + {"name", _NAME, JSPROP_ENUMERATE, NULL, NULL}, + + {NULL, 0, 0, NULL, NULL} +}; + +#define _GET_I(_p, _f) ((_p) ? INT_TO_JSVAL((int)(_p)->_f) : JSVAL_VOID) +#define _GET_S(_p, _f) \ + ((_p) ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, (_p)->_f)) : JSVAL_VOID) + +static JSBool +rpmfts_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmftsClass, NULL); + FTS * fts = ptr; + FTSENT * p = (fts ? fts->fts_cur : NULL); + jsint tiny = JSVAL_TO_INT(id); + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: *vp = INT_TO_JSVAL(_debug); break; + + /* FTS fields */ + case _CURRENT: break; /* unimplemented */ + case _CHILD: break; /* unimplemented */ + case _ARRAY: break; /* unimplemented */ + case _ROOTDEV: *vp = _GET_I(fts, fts_dev); break; + case _ROOT: *vp = _GET_S(fts, fts_path); break; + case _ROOTLEN: *vp = _GET_I(fts, fts_pathlen); break; + case _NITEMS: *vp = _GET_I(fts, fts_nitems); break; + case _OPTIONS: *vp = _GET_I(fts, fts_options); break; + + /* FTSENT fields */ + case _CYCLE: break; /* unimplemented */ + case _PARENT: break; /* unimplemented */ + case _LINK: break; /* unimplemented */ + case _NUMBER: *vp = _GET_I(p, fts_number); break; + case _POINTER: break; /* unimplemented */ + case _ACCPATH: *vp = _GET_S(p, fts_accpath); break; + case _PATH: *vp = _GET_S(p, fts_path); break; + case _ERRNO: *vp = _GET_I(p, fts_errno); break; + case _PATHLEN: *vp = _GET_I(p, fts_pathlen); break; + case _NAMELEN: *vp = _GET_I(p, fts_namelen); break; + case _INO: *vp = _GET_I(p, fts_ino); break; + case _DEV: *vp = _GET_I(p, fts_dev); break; + case _NLINK: *vp = _GET_I(p, fts_nlink); break; + case _LEVEL: *vp = _GET_I(p, fts_level); break; + case _INFO: *vp = _GET_I(p, fts_info); break; + case _FLAGS: *vp = _GET_I(p, fts_flags); break; + case _INSTR: *vp = _GET_I(p, fts_instr); break; + case _STATP: + if (fts && p && p->fts_statp) { + JSObject *o; + struct stat *st; + size_t nb = sizeof(*st); + if ((st = memcpy(xmalloc(nb), p->fts_statp, nb)) != NULL + && (o = JS_NewObject(cx, &rpmstClass, NULL, obj)) != NULL + && JS_SetPrivate(cx, o, (void *)st)) + *vp = OBJECT_TO_JSVAL(o); + else + *vp = JSVAL_VOID; + } else + *vp = JSVAL_VOID; + break; + case _NAME: *vp = _GET_S(p, fts_name); break; + + default: + break; + } + + return JS_TRUE; +} + +#define _SET_I(_p, _f) \ + if ((_p) && JS_ValueToInt32(cx, *vp, &myint)) (_p)->_f = myint + +static JSBool +rpmfts_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmftsClass, NULL); + FTS * fts = ptr; + FTSENT * p = (fts ? fts->fts_cur : NULL); + jsint tiny = JSVAL_TO_INT(id); + int myint = 0; + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + + /* FTS fields */ + case _CURRENT: break; /* unimplemented */ + case _CHILD: break; /* unimplemented */ + case _ARRAY: break; /* unimplemented */ + case _ROOTDEV: break; /* unimplemented */ + case _ROOT: break; /* unimplemented */ + case _ROOTLEN: break; /* unimplemented */ + case _NITEMS: break; /* unimplemented */ + case _OPTIONS: break; /* unimplemented */ + + /* FTSENT fields */ + case _CYCLE: break; /* unimplemented */ + case _PARENT: break; /* unimplemented */ + case _LINK: break; /* unimplemented */ + case _NUMBER: _SET_I(p, fts_number); break; + case _POINTER: break; /* unimplemented */ + case _ACCPATH: break; /* unimplemented */ + case _PATH: break; /* unimplemented */ + case _ERRNO: break; /* unimplemented */ + case _PATHLEN: break; /* unimplemented */ + case _NAMELEN: break; /* unimplemented */ + case _INO: break; /* unimplemented */ + case _DEV: break; /* unimplemented */ + case _NLINK: break; /* unimplemented */ + case _LEVEL: break; /* unimplemented */ + case _INFO: break; /* unimplemented */ + case _FLAGS: break; /* unimplemented */ + case _INSTR: break; /* unimplemented */ + case _STATP: break; /* unimplemented */ + case _NAME: break; /* unimplemented */ + + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmfts_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmftsClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmfts_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmftsClass, NULL); + FTS * fts = ptr; + FTSENT * p; + unsigned int ix = 0; + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + if (idp) + *idp = JSVAL_ZERO; + *statep = INT_TO_JSVAL(ix); +if (_debug) +fprintf(stderr, "\tINIT fts %p\n", fts); + break; + case JSENUMERATE_NEXT: + ix = JSVAL_TO_INT(*statep); + if ((p = Fts_read(fts)) != NULL) { + (void) JS_DefineElement(cx, obj, + ix, STRING_TO_JSVAL(JS_NewStringCopyZ(cx, p->fts_path)), + NULL, NULL, JSPROP_ENUMERATE); + JS_ValueToId(cx, *statep, idp); +if (_debug) +fprintf(stderr, "\tNEXT fts %p[%u] ftsent %p \"%s\"\n", fts, ix, p, p->fts_path); + *statep = INT_TO_JSVAL(ix+1); + } else + *idp = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + ix = JSVAL_TO_INT(*statep); + (void) JS_DefineProperty(cx, obj, "length", INT_TO_JSVAL(ix), + NULL, NULL, JSPROP_ENUMERATE); +if (_debug) +fprintf(stderr, "\tFINI fts %p[%u]\n", fts, ix); + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static void +rpmfts_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmftsClass, NULL); + FTS * fts = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + if (fts) + (void) Fts_close(fts); +} + +static JSBool +rpmfts_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + JSObject *dno = NULL; + int _options = 0; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/ou", &dno, &_options))) + goto exit; + + if (JS_IsConstructing(cx, vp)) { + (void) rpmfts_init(cx, obj, dno, _options); + } else { + if ((obj = JS_NewObject(cx, &rpmftsClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmfts_call(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + /* XXX obj is the global object so lookup "this" object. */ + JSObject * o = JSVAL_TO_OBJECT(argv[-2]); + void * ptr = JS_GetInstancePrivate(cx, o, &rpmftsClass, NULL); + FTS * fts = ptr; + JSBool ok = JS_FALSE; + JSObject *dno = NULL; + int _options = -1; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/ou", &dno, &_options))) + goto exit; + + if (fts) { + if (_options == -1) _options = fts->fts_options; + (void) Fts_close(fts); + /* XXX error msg */ + fts = ptr = NULL; + (void) JS_SetPrivate(cx, o, (void *)fts); + } + + fts = ptr = rpmfts_init(cx, o, dno, _options); + + *vp = OBJECT_TO_JSVAL(o); + + ok = JS_TRUE; + +exit: +if (_debug) +fprintf(stderr, "<== %s(%p,%p[%u],%p) o %p ptr %p\n", __FUNCTION__, cx, argv, (unsigned)argc, vp, o, ptr); + + return ok; +} + +/* --- Class initialization */ +JSClass rpmftsClass = { + "Fts", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmfts_addprop, rpmfts_delprop, rpmfts_getprop, rpmfts_setprop, + (JSEnumerateOp)rpmfts_enumerate, (JSResolveOp)rpmfts_resolve, + rpmfts_convert, rpmfts_dtor, + + rpmfts_getobjectops,rpmfts_checkaccess, + rpmfts_call, rpmfts_construct, + rpmfts_xdrobject, rpmfts_hasinstance, + rpmfts_mark, rpmfts_reserveslots, +}; + +JSObject * +rpmjs_InitFtsClass(JSContext *cx, JSObject* obj) +{ + JSObject * proto = JS_InitClass(cx, obj, NULL, &rpmftsClass, rpmfts_ctor, 1, + rpmfts_props, rpmfts_funcs, NULL, NULL); + +if (_debug) +fprintf(stderr, "==> %s(%p,%p) proto %p\n", __FUNCTION__, cx, obj, proto); + +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewFtsObject(JSContext *cx, JSObject * dno, int _options) +{ + JSObject *obj; + FTS * fts; + + if ((obj = JS_NewObject(cx, &rpmftsClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((fts = rpmfts_init(cx, obj, dno, _options)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmfts, Fts, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmfts-js.h b/rpm-5.4.9/js/rpmfts-js.h new file mode 100644 index 0000000..ac70a7c --- /dev/null +++ b/rpm-5.4.9/js/rpmfts-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMFTS_JS +#define H_RPMFTS_JS + +/** + * \file js/rpmfts-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmftsClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitFtsClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewFtsObject(JSContext *cx, JSObject *dno, int _options); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMFTS_JS */ diff --git a/rpm-5.4.9/js/rpmgi-js.c b/rpm-5.4.9/js/rpmgi-js.c new file mode 100644 index 0000000..97ae7cb --- /dev/null +++ b/rpm-5.4.9/js/rpmgi-js.c @@ -0,0 +1,246 @@ +/** \ingroup js_c + * \file js/rpmgi-js.c + */ + +#include "system.h" + +#include "rpmgi-js.h" +#include "rpmjs-debug.h" + +#include +#define _RPMGI_INTERNAL +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmgi_addprop JS_PropertyStub +#define rpmgi_delprop JS_PropertyStub +#define rpmgi_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmgi_getobjectops NULL +#define rpmgi_checkaccess NULL +#define rpmgi_call NULL +#define rpmgi_construct rpmgi_ctor +#define rpmgi_xdrobject NULL +#define rpmgi_hasinstance NULL +#define rpmgi_mark NULL +#define rpmgi_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmgi_equality NULL +#define rpmgi_outerobject NULL +#define rpmgi_innerobject NULL +#define rpmgi_iteratorobject NULL +#define rpmgi_wrappedobject NULL + +/* --- helpers */ + +/* --- Object methods */ + +static JSFunctionSpec rpmgi_funcs[] = { + JS_FS_END +}; + +/* --- Object properties */ +enum rpmgi_tinyid { + _DEBUG = -2, +}; + +static JSPropertySpec rpmgi_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmgi_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmgiClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmgi_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmgiClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmgi_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmgiClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmgi_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static rpmgi +rpmgi_init(JSContext *cx, JSObject *obj) +{ + void * _ts = NULL; + int _tag = 0; + const void * _keyp = NULL; + size_t _keylen = 0; + rpmgi gi = rpmgiNew(_ts, _tag, _keyp, _keylen); + +if (_debug) +fprintf(stderr, "==> %s(%p,%p) gi %p\n", __FUNCTION__, cx, obj, gi); + + if (!JS_SetPrivate(cx, obj, (void *)gi)) { + /* XXX error msg */ + return NULL; + } + return gi; +} + +static void +rpmgi_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmgiClass, NULL); + rpmgi gi = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + if (gi) + (void) rpmgiFree(gi); +} + +static JSBool +rpmgi_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (JS_IsConstructing(cx, vp)) { + (void) rpmgi_init(cx, obj); + } else { + if ((obj = JS_NewObject(cx, &rpmgiClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass rpmgiClass = { + "Gi", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmgi_addprop, rpmgi_delprop, rpmgi_getprop, rpmgi_setprop, + (JSEnumerateOp)rpmgi_enumerate, (JSResolveOp)rpmgi_resolve, + rpmgi_convert, rpmgi_dtor, + + rpmgi_getobjectops, rpmgi_checkaccess, + rpmgi_call, rpmgi_construct, + rpmgi_xdrobject, rpmgi_hasinstance, + rpmgi_mark, rpmgi_reserveslots, +}; + +JSObject * +rpmjs_InitGiClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmgiClass, rpmgi_ctor, 1, + rpmgi_props, rpmgi_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewGiObject(JSContext *cx) +{ + JSObject *obj; + rpmgi gi; + + if ((obj = JS_NewObject(cx, &rpmgiClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((gi = rpmgi_init(cx, obj)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmgi, Gi, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmgi-js.h b/rpm-5.4.9/js/rpmgi-js.h new file mode 100644 index 0000000..1f18eb4 --- /dev/null +++ b/rpm-5.4.9/js/rpmgi-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMGI_JS +#define H_RPMGI_JS + +/** + * \file js/rpmgi-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmgiClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitGiClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewGiObject(JSContext *cx); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMGI_JS */ diff --git a/rpm-5.4.9/js/rpmhdr-js.c b/rpm-5.4.9/js/rpmhdr-js.c new file mode 100644 index 0000000..099af2a --- /dev/null +++ b/rpm-5.4.9/js/rpmhdr-js.c @@ -0,0 +1,534 @@ +/** \ingroup js_c + * \file js/rpmhdr-js.c + */ + +#include "system.h" + +#include "rpmhdr-js.h" +#include "rpmds-js.h" +#include "rpmfi-js.h" +#include "rpmjs-debug.h" + +#include /* XXX rpmHeaderFormats */ + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +#define rpmhdr_addprop JS_PropertyStub +#define rpmhdr_delprop JS_PropertyStub +#define rpmhdr_convert JS_ConvertStub + +/* --- helpers */ +static JSObject * +rpmhdrLoadTag(JSContext *cx, JSObject *obj, Header h, rpmTag tag, jsval *vp) +{ + HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he)); + JSObject * arr; + jsval v; + JSObject * retobj = NULL; + JSBool ok; +const char * name = tagName(tag); + int i; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p,%p,%s)\n", __FUNCTION__, cx, obj, h, name); + + he->tag = tag; + if (headerGet(h, he, 0)) { +if (_debug < 0) +fprintf(stderr, "\t%s(%u) %u %p[%u]\n", name, (unsigned)he->tag, (unsigned)he->t, he->p.ptr, (unsigned)he->c); + switch (he->t) { + default: + goto exit; + /*@notreached@*/ break; + case RPM_BIN_TYPE: /* XXX return as array of octets for now. */ + case RPM_UINT8_TYPE: + arr = JS_NewArrayObject(cx, 0, NULL); + ok = JS_AddObjectRoot(cx, &arr); + for (i = 0; i < (int)he->c; i++) { + v = INT_TO_JSVAL(he->p.ui8p[i]); + ok = JS_SetElement(cx, arr, i, &v); + } + ok = JS_DefineProperty(cx, obj, name, (v=OBJECT_TO_JSVAL(arr)), + NULL, NULL, JSPROP_ENUMERATE); + (void) JS_RemoveObjectRoot(cx, &arr); + if (!ok) + goto exit; + retobj = obj; + if (vp) *vp = v; + break; + case RPM_UINT16_TYPE: + arr = JS_NewArrayObject(cx, 0, NULL); + ok = JS_AddObjectRoot(cx, &arr); + for (i = 0; i < (int)he->c; i++) { + v = INT_TO_JSVAL(he->p.ui16p[i]); + ok = JS_SetElement(cx, arr, i, &v); + } + ok = JS_DefineProperty(cx, obj, name, (v=OBJECT_TO_JSVAL(arr)), + NULL, NULL, JSPROP_ENUMERATE); + (void) JS_RemoveObjectRoot(cx, &arr); + if (!ok) + goto exit; + retobj = obj; + if (vp) *vp = v; + break; + case RPM_UINT32_TYPE: + arr = JS_NewArrayObject(cx, 0, NULL); + ok = JS_AddObjectRoot(cx, &arr); + for (i = 0; i < (int)he->c; i++) { + if (!JS_NewNumberValue(cx, he->p.ui32p[i], &v)) + v = JSVAL_VOID; + ok = JS_SetElement(cx, arr, i, &v); + } + ok = JS_DefineProperty(cx, obj, name, (v=OBJECT_TO_JSVAL(arr)), + NULL, NULL, JSPROP_ENUMERATE); + (void) JS_RemoveObjectRoot(cx, &arr); + if (!ok) + goto exit; + retobj = obj; + if (vp) *vp = v; + break; + case RPM_UINT64_TYPE: + arr = JS_NewArrayObject(cx, 0, NULL); + ok = JS_AddObjectRoot(cx, &arr); + for (i = 0; i < (int)he->c; i++) { + if (!JS_NewNumberValue(cx, he->p.ui64p[i], &v)) + v = JSVAL_VOID; + ok = JS_SetElement(cx, arr, i, &v); + } + ok = JS_DefineProperty(cx, obj, name, (v=OBJECT_TO_JSVAL(arr)), + NULL, NULL, JSPROP_ENUMERATE); + (void) JS_RemoveObjectRoot(cx, &arr); + if (!ok) + goto exit; + retobj = obj; + if (vp) *vp = v; + break; + case RPM_STRING_ARRAY_TYPE: + arr = JS_NewArrayObject(cx, 0, NULL); + ok = JS_AddObjectRoot(cx, &arr); + for (i = 0; i < (int)he->c; i++) { + v = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, he->p.argv[i])); + ok = JS_SetElement(cx, arr, i, &v); + } + ok = JS_DefineProperty(cx, obj, name, (v=OBJECT_TO_JSVAL(arr)), + NULL, NULL, JSPROP_ENUMERATE); + (void) JS_RemoveObjectRoot(cx, &arr); + if (!ok) + goto exit; + retobj = obj; + if (vp) *vp = v; + break; + case RPM_I18NSTRING_TYPE: /* XXX FIXME: is this ever seen? */ +fprintf(stderr, "==> FIXME: %s(%d) t %d %p[%u]\n", tagName(he->tag), he->tag, he->t, he->p.ptr, he->c); + /*@fallthrough@*/ + case RPM_STRING_TYPE: + ok = JS_DefineProperty(cx, obj, name, + (v=STRING_TO_JSVAL(JS_NewStringCopyZ(cx, he->p.str))), + NULL, NULL, JSPROP_ENUMERATE); + if (!ok) + goto exit; + retobj = obj; + if (vp) *vp = v; + break; + } + } + +exit: +if (_debug < 0) +fprintf(stderr, "\tretobj %p vp %p *vp 0x%lx\n", retobj, vp, (unsigned long)(vp ? *vp : 0)); + return retobj; +} + +/* --- Object methods */ +static JSBool +rpmhdr_ds(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmhdrClass, NULL); + rpmTag tagN = RPMTAG_NAME; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &tagN))) + goto exit; + *vp = OBJECT_TO_JSVAL(rpmjs_NewDsObject(cx, OBJECT_TO_JSVAL(obj), tagN)); + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmhdr_fi(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmhdrClass, NULL); + Header h = ptr; + rpmTag tagN = RPMTAG_BASENAMES; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &tagN))) + goto exit; + *vp = OBJECT_TO_JSVAL(rpmjs_NewFiObject(cx, h, tagN)); + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmhdr_sprintf(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmhdrClass, NULL); + Header h = ptr; + char * qfmt = NULL; + const char * s = NULL; + const char * errstr = NULL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &qfmt))) + goto exit; + + if ((s = headerSprintf(h, qfmt, NULL, rpmHeaderFormats, &errstr)) == NULL) + s = errstr; /* XXX FIXME: returning errstr in-band. */ + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, s)); + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmhdr_getorigin(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmhdrClass, NULL); + Header h = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, headerGetOrigin(h))); + ok = JS_TRUE; + return ok; +} + +static JSBool +rpmhdr_setorigin(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmhdrClass, NULL); + Header h = ptr; + char * s = NULL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &s))) + goto exit; + + (void) headerSetOrigin(h, s); + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, headerGetOrigin(h))); + ok = JS_TRUE; +exit: + return ok; +} + +static JSFunctionSpec rpmhdr_funcs[] = { + JS_FS("ds", rpmhdr_ds, 0,0), + JS_FS("fi", rpmhdr_fi, 0,0), + JS_FS("sprintf", rpmhdr_sprintf, 0,0), + JS_FS("getorigin", rpmhdr_getorigin, 0,0), + JS_FS("setorigin", rpmhdr_setorigin, 0,0), + JS_FS_END +}; + +/* --- Object properties */ +enum rpmhdr_tinyid { + _DEBUG = -2, +}; + +static JSPropertySpec rpmhdr_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmhdr_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmhdrClass, NULL); + Header h = ptr; + jsint tiny = JSVAL_TO_INT(id); + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + default: { + const char * s = JS_EncodeString(cx, JS_ValueToString(cx, id)); + rpmTag tag = JSVAL_IS_INT(id) + ? (rpmTag) JSVAL_TO_INT(id) + : tagValue(s); + s = _free(s); + if (rpmhdrLoadTag(cx, obj, h, tag, vp) == NULL) + break; + } break; + } + + return JS_TRUE; +} + +static JSBool +rpmhdr_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmhdrClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmhdr_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmhdrClass, NULL); + Header h = ptr; + JSBool ok = JS_FALSE; + +_RESOLVE_DEBUG_ENTRY(_debug); + + if ((flags & JSRESOLVE_ASSIGNING) + || (h == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + ok = JS_TRUE; + goto exit; + } + + if (JSVAL_IS_INT(id) || JSVAL_IS_STRING(id)) { + const char * s = JS_EncodeString(cx, JS_ValueToString(cx, id)); + rpmTag tag = JSVAL_IS_INT(id) + ? (rpmTag) JSVAL_TO_INT(id) + : tagValue(s); + JSObject * arr = rpmhdrLoadTag(cx, obj, h, tag, NULL); + + s = _free(s); + if (!JS_DefineElement(cx, obj, tag, OBJECT_TO_JSVAL(arr), + NULL, NULL, JSPROP_ENUMERATE)) { + *objp = NULL; + goto exit; + } + *objp = obj; + } else + *objp = NULL; + ok = JS_TRUE; +exit: + return ok; +} + +static void +rpmhi_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmhiClass, NULL); + HeaderIterator hi = ptr; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p) ptr %p\n", __FUNCTION__, cx, obj, ptr); + + hi = headerFini(hi); +} + +JSClass rpmhiClass = { + "Hi", + JSCLASS_HAS_PRIVATE, + JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, rpmhi_dtor, + JSCLASS_NO_OPTIONAL_MEMBERS +}; + +static JSBool +rpmhdr_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmhdrClass, NULL); + Header h = ptr; + HeaderIterator hi = NULL; + HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he)); + JSObject *ho = NULL; + JSBool ok = JS_FALSE; + +_ENUMERATE_DEBUG_ENTRY(_debug); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + if ((ho = JS_NewObject(cx, &rpmhiClass, NULL, obj)) == NULL) + goto exit; + if ((hi = headerInit(h)) == NULL) + goto exit; + if (!JS_SetPrivate(cx, ho, (void *)hi)) { + hi = headerFini(hi); + goto exit; + } + *statep = OBJECT_TO_JSVAL(ho); + if (idp) + *idp = JSVAL_ZERO; +if (_debug) +fprintf(stderr, "\tINIT ho %p hi %p\n", ho, hi); + break; + case JSENUMERATE_NEXT: + ho = (JSObject *) JSVAL_TO_OBJECT(*statep); + hi = JS_GetInstancePrivate(cx, ho, &rpmhiClass, NULL); +if (_debug) +fprintf(stderr, "\tNEXT ho %p hi %p\n", ho, hi); + if (headerNext(hi, he, 0)) { + JS_ValueToId(cx, INT_TO_JSVAL(he->tag), idp); + he->p.ptr = _free(he->p.ptr); + } else + *idp = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + ho = (JSObject *) JSVAL_TO_OBJECT(*statep); + hi = JS_GetInstancePrivate(cx, ho, &rpmhiClass, NULL); +if (_debug) +fprintf(stderr, "\tFINI ho %p hi %p\n", ho, hi); + /* Allow our iterator object to be GC'd. */ + *statep = JSVAL_NULL; + break; + } + ok = JS_TRUE; +exit: + return ok; +} + +/* --- Object ctors/dtors */ +static Header +rpmhdr_init(JSContext *cx, JSObject *obj, void * _h) +{ + Header h = (_h ? _h : headerNew()); + + if (h == NULL) + return NULL; + if (!JS_SetPrivate(cx, obj, (void *)h)) { + /* XXX error msg */ + h = headerFree(h); + return NULL; + } + return h; +} + +static void +rpmhdr_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmhdrClass, NULL); + Header h = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + (void) headerFree(h); +} + +static JSBool +rpmhdr_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + JSObject *tso = NULL; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/o", &tso))) + goto exit; + + if (JS_IsConstructing(cx, vp)) { + if (rpmhdr_init(cx, obj, NULL)) + goto exit; + } else { + if ((obj = JS_NewObject(cx, &rpmhdrClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass rpmhdrClass = { + "Hdr", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmhdr_addprop, rpmhdr_delprop, rpmhdr_getprop, rpmhdr_setprop, + (JSEnumerateOp)rpmhdr_enumerate, (JSResolveOp)rpmhdr_resolve, + rpmhdr_convert, rpmhdr_dtor, + JSCLASS_NO_OPTIONAL_MEMBERS +}; + +JSObject * +rpmjs_InitHdrClass(JSContext *cx, JSObject* obj) +{ + JSObject * o; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + o = JS_InitClass(cx, obj, NULL, &rpmhdrClass, rpmhdr_ctor, 1, + rpmhdr_props, rpmhdr_funcs, NULL, NULL); +assert(o != NULL); + return o; +} + +JSObject * +rpmjs_NewHdrObject(JSContext *cx, void * _h) +{ + JSObject *obj; + Header h; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, _h); + + if ((obj = JS_NewObject(cx, &rpmhdrClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((h = rpmhdr_init(cx, obj, _h)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmhdr, Hdr, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmhdr-js.h b/rpm-5.4.9/js/rpmhdr-js.h new file mode 100644 index 0000000..799367f --- /dev/null +++ b/rpm-5.4.9/js/rpmhdr-js.h @@ -0,0 +1,27 @@ +#ifndef H_RPMHDR_JS +#define H_RPMHDR_JS + +/** + * \file js/rpmhdr-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmhdrClass; +extern JSClass rpmhiClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject* +rpmjs_InitHdrClass(JSContext *cx, JSObject* obj); + +extern JSObject* +rpmjs_NewHdrObject(JSContext *cx, void * _h); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMHDR_JS */ diff --git a/rpm-5.4.9/js/rpmio-js.c b/rpm-5.4.9/js/rpmio-js.c new file mode 100644 index 0000000..cbf6952 --- /dev/null +++ b/rpm-5.4.9/js/rpmio-js.c @@ -0,0 +1,772 @@ +/** \ingroup js_c + * \file js/rpmio-js.c + */ + +#include "system.h" + +#include "rpmio-js.h" +#include "rpmst-js.h" +#include "rpmjs-debug.h" + +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmio_addprop JS_PropertyStub +#define rpmio_delprop JS_PropertyStub +#define rpmio_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmio_getobjectops NULL +#define rpmio_checkaccess NULL +#define rpmio_call rpmio_call +#define rpmio_construct rpmio_ctor +#define rpmio_xdrobject NULL +#define rpmio_hasinstance NULL +#define rpmio_mark NULL +#define rpmio_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmio_equality NULL +#define rpmio_outerobject NULL +#define rpmio_innerobject NULL +#define rpmio_iteratorobject NULL +#define rpmio_wrappedobject NULL + +/* --- helpers */ +static FD_t +rpmio_init(JSContext *cx, JSObject *obj, const char * _fn, const char * _fmode) +{ + FD_t fd = NULL; + + if (_fn) { + fd = Fopen(_fn, _fmode); + /* XXX error msg */ + } + if (!JS_SetPrivate(cx, obj, (void *)fd)) { + /* XXX error msg */ + if (fd) { + (void) Fclose(fd); + /* XXX error msg */ + } + fd = NULL; + } + +if (_debug) +fprintf(stderr, "<== %s(%p,%p) Fopen(%s,%s) fd %p\n", __FUNCTION__, cx, obj, _fn, _fmode, fd); + + return fd; +} + +/* --- Object methods */ +static JSBool +rpmio_digestinit(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + jsuint _dalgo = PGPHASHALGO_MD5; + jsuint _flags = 0; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + + if ((ok = JS_ConvertArguments(cx, argc, argv, "/uu", &_dalgo, &_flags))) { + if (fd) + fdInitDigest(fd, _dalgo, _flags); + *vp = OBJECT_TO_JSVAL(obj); + } + return ok; +} + +static JSBool +rpmio_digestfini(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + jsuint _dalgo = PGPHASHALGO_MD5; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + + if ((ok = JS_ConvertArguments(cx, argc, argv, "/u", &_dalgo))) { + if (fd) { + const char * s = NULL; + size_t ns = 0; + fdFiniDigest(fd, _dalgo, &s, &ns, 1); + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, s)); + } else + *vp = JSVAL_VOID; + } + return ok; +} + +static JSBool +rpmio_fchown(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + jsint _uid = -1; + jsint _gid = -1; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + + if ((ok = JS_ConvertArguments(cx, argc, argv, "/ii", &_uid, &_gid))) { + uid_t uid = _uid; + uid_t gid = _gid; + *vp = (fd && !Fchown(fd, uid, gid) + ? JSVAL_ZERO : INT_TO_JSVAL(errno)); + } + return ok; +} + +static JSBool +rpmio_fclose(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + /* XXX FIXME: _fmode is not persistent across io.fclose() */ + if (fd) { + (void) Fclose(fd); + /* XXX error msg */ + fd = ptr = NULL; + (void) JS_SetPrivate(cx, obj, (void *)fd); + } + *vp = OBJECT_TO_JSVAL(obj); + + ok = JS_TRUE; + return ok; +} + +static JSBool +rpmio_fdopen(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + const char * _fmode = "r.ufdio"; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_fmode))) + goto exit; + + /* XXX needs checking */ + if (fd && (fd = Fdopen(fd, _fmode)) != NULL) { + JSObject *o; + if ((o = JS_NewObject(cx, &rpmioClass, NULL, NULL)) != NULL + && JS_SetPrivate(cx, o, (void *)fd)) + *vp = OBJECT_TO_JSVAL(obj); + else + *vp = JSVAL_VOID; + } else + *vp = JSVAL_VOID; + + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmio_ferror(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + +_METHOD_DEBUG_ENTRY(_debug); + *vp = (fd && !Ferror(fd) ? JSVAL_TRUE : JSVAL_FALSE); + return JS_TRUE; +} + +static JSBool +rpmio_fflush(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + +_METHOD_DEBUG_ENTRY(_debug); + *vp = (fd && !Fflush(fd) ? JSVAL_TRUE : JSVAL_FALSE); + return JS_TRUE; +} + +#ifdef NOTYET +static JSBool +rpmio_fgetpos(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + JSBool ok = JSVAL_TRUE; + int rc = -3; + +_METHOD_DEBUG_ENTRY(_debug); + +_rpmio_debug = -1; + if (fd) { + fpos_t pos = 0; + if (!Fgetpos(fd, &pos)) + rc = pos; + } +_rpmio_debug = 0; + *vp = INT_TO_JSVAL(rc); + return ok; +} +#endif + +static JSBool +rpmio_fileno(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + int fdno; + +_METHOD_DEBUG_ENTRY(_debug); + *vp = (fd && (fdno = Fileno(fd)) >= 0 + ? INT_TO_JSVAL(fdno) : INT_TO_JSVAL(-1)); + return JS_TRUE; +} + +static JSBool +rpmio_fopen(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + const char * _fn = NULL; + const char * _fmode = "r.ufdio"; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s/s", &_fn, &_fmode))) + goto exit; + + if (fd) { + (void) Fclose(fd); + /* XXX error msg */ + fd = ptr = NULL; + (void) JS_SetPrivate(cx, obj, (void *)fd); + } + + fd = ptr = rpmio_init(cx, obj, _fn, _fmode); + + *vp = OBJECT_TO_JSVAL(obj); + + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmio_fread(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + JSBool ok = JS_FALSE; + static jsuint _nbmax = 16 * BUFSIZ; + jsuint _nb = BUFSIZ; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_nb))) + goto exit; + + if (_nb > _nbmax) _nb = _nbmax; + + if (fd) { + size_t nb = _nb; + char * b = alloca(nb); + size_t nr = Fread(b, 1, nb, fd); + if (nr == 0) + *vp = JSVAL_VOID; /* XXX goofy? */ + else + if (Ferror(fd)) + *vp = JSVAL_FALSE; /* XXX goofy? */ + else { + b[nr] = '\0'; + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, b)); + } + } else + *vp = JSVAL_VOID; + + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmio_fseek(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + JSBool ok; + jsint _offset = 0; + jsint _whence = SEEK_CUR; + int rc = -3; + +_METHOD_DEBUG_ENTRY(_debug); + if ((ok = JS_ConvertArguments(cx, argc, argv, "/ii", &_offset, _whence))) + rc = (fd ? Fseek(fd, _offset, _whence) : -3); + *vp = INT_TO_JSVAL(rc); + return ok; +} + +#ifdef NOTYET +static JSBool +rpmio_fsetpos(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + JSBool ok; + jsint _offset = 0; + int rc = -3; + +_METHOD_DEBUG_ENTRY(_debug); + if ((ok = JS_ConvertArguments(cx, argc, argv, "i", &_offset))) { + fpos_t pos = _offset; + rc = (fd ? Fsetpos(fd, &pos) : -3); + } + *vp = INT_TO_JSVAL(rc); + return ok; +} +#endif + +static JSBool +rpmio_fstat(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + JSBool ok = JS_FALSE; + struct stat sb; + +_METHOD_DEBUG_ENTRY(_debug); + + if (fd && !Fstat(fd, &sb)) { + JSObject *o; + struct stat *st = NULL; + size_t nb = sizeof(*st); + if ((st = memcpy(xmalloc(nb), &sb, nb)) != NULL + && (o = JS_NewObject(cx, &rpmstClass, NULL, NULL)) != NULL + && JS_SetPrivate(cx, o, (void *)st)) + *vp = OBJECT_TO_JSVAL(o); + else { + st = _free(st); + *vp = JSVAL_VOID; /* XXX goofy? */ + } + } else + *vp = JSVAL_VOID; /* XXX goofy? */ + + ok = JS_TRUE; + return ok; +} + +static JSBool +rpmio_ftell(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + JSBool ok = JSVAL_TRUE; + int rc = -3; + +_METHOD_DEBUG_ENTRY(_debug); + rc = (int)(fd ? Ftell(fd) : -3); + *vp = INT_TO_JSVAL(rc); + return ok; +} + +static JSBool +rpmio_fwrite(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + JSBool ok = JS_FALSE; + const char * b = NULL; + size_t nb; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &b))) + goto exit; +assert(b != NULL); + nb = strlen(b); + + if (fd) { + size_t nw = Fwrite(b, 1, nb, fd); + if (nw == 0) + *vp = JSVAL_VOID; /* XXX goofy? */ + else + *vp = (nw != nb || Ferror(fd) ? JSVAL_FALSE : JSVAL_TRUE); + } else + *vp = JSVAL_FALSE; + + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmio_rewind(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + JSBool ok = JSVAL_TRUE; + +_METHOD_DEBUG_ENTRY(_debug); + /* XXX should return fd object */ + if (fd) { + Rewind(fd); + *vp = JSVAL_TRUE; + } else + *vp = JSVAL_FALSE; + return ok; +} + +static JSFunctionSpec rpmio_funcs[] = { + JS_FS("digestinit", rpmio_digestinit, 0,0), + JS_FS("digestfini", rpmio_digestfini, 0,0), + JS_FS("fchown", rpmio_fchown, 0,0), + JS_FS("fclose", rpmio_fclose, 0,0), + JS_FS("fdopen", rpmio_fdopen, 0,0), + JS_FS("ferror", rpmio_ferror, 0,0), + JS_FS("fflush", rpmio_fflush, 0,0), +#ifdef NOTYET + JS_FS("fgetpos", rpmio_fgetpos, 0,0), +#endif + JS_FS("fileno", rpmio_fileno, 0,0), + JS_FS("fopen", rpmio_fopen, 0,0), + JS_FS("fread", rpmio_fread, 0,0), + JS_FS("fseek", rpmio_fseek, 0,0), +#ifdef NOTYET + JS_FS("fsetpos", rpmio_fsetpos, 0,0), +#endif + JS_FS("fstat", rpmio_fstat, 0,0), + JS_FS("ftell", rpmio_ftell, 0,0), + JS_FS("fwrite", rpmio_fwrite, 0,0), + JS_FS("rewind", rpmio_rewind, 0,0), + JS_FS_END +}; + +/* --- Object properties */ +enum rpmio_tinyid { + _DEBUG = -2, + _PATH = -3, + _FLAGS = -4, + _MODE = -5, + _NDIGESTS = -6, + _RDTIMEOUT = -7, + _CPIOPOS = -8, + _BYTESREMAIN= -9, + _LASTMODIFIED= -10, + _CONTENTTYPE= -11, + _CONTENTLENGTH= -12, + _CONTENTDISPOSITION= -13, +}; + +static JSPropertySpec rpmio_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {"path", _PATH, JSPROP_ENUMERATE, NULL, NULL}, + {"flags", _FLAGS, JSPROP_ENUMERATE, NULL, NULL}, + {"mode", _MODE, JSPROP_ENUMERATE, NULL, NULL}, + {"ndigests",_NDIGESTS, JSPROP_ENUMERATE, NULL, NULL}, + {"rdtimeout",_RDTIMEOUT, JSPROP_ENUMERATE, NULL, NULL}, + {"cpioPos", _CPIOPOS, JSPROP_ENUMERATE, NULL, NULL}, + {"bytesRemain",_BYTESREMAIN,JSPROP_ENUMERATE, NULL, NULL}, + {"lastModified",_LASTMODIFIED,JSPROP_ENUMERATE, NULL, NULL}, + {"contentType",_CONTENTTYPE,JSPROP_ENUMERATE, NULL, NULL}, + {"contentLength",_CONTENTLENGTH,JSPROP_ENUMERATE, NULL, NULL}, + {"contentDisposition",_CONTENTDISPOSITION,JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +#define _GET_I(_p, _f) ((_p) ? INT_TO_JSVAL((int)(_p)->_f) : JSVAL_VOID) +#define _GET_S(_p, _f) ((_p) && (_p)->_f \ + ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, (_p)->_f)) : JSVAL_VOID) + +static JSBool +rpmio_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + jsint tiny = JSVAL_TO_INT(id); + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: *vp = INT_TO_JSVAL(_debug); break; + case _PATH: *vp = _GET_S(fd, opath); break; + case _FLAGS: *vp = _GET_I(fd, oflags); break; + case _MODE: *vp = _GET_I(fd, omode); break; + case _NDIGESTS: *vp = _GET_I(fd, ndigests); break; + case _RDTIMEOUT: *vp = _GET_I(fd, rd_timeoutsecs); break; + case _CPIOPOS: *vp = _GET_I(fd, fd_cpioPos); break; + case _BYTESREMAIN: *vp = _GET_I(fd, bytesRemain); break; + case _LASTMODIFIED: *vp = _GET_I(fd, lastModified); break; + case _CONTENTTYPE: *vp = _GET_S(fd, contentType); break; + case _CONTENTLENGTH:*vp = _GET_I(fd, contentLength); break; + case _CONTENTDISPOSITION: *vp = _GET_S(fd, contentDisposition); break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmio_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmio_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmio_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ +#ifdef NOTYET + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + unsigned int ix = 0; +#endif + + /* XXX VG: JS_Enumerate (jsobj.c:4211) doesn't initialize some fields. */ +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + +#ifdef NOTYET + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + if (idp) + *idp = JSVAL_ZERO; + *statep = INT_TO_JSVAL(ix); +if (_debug) +fprintf(stderr, "\tINIT fd %p\n", fd); + break; + case JSENUMERATE_NEXT: + ix = JSVAL_TO_INT(*statep); + if ((dp = Readdir(dir)) != NULL) { + (void) JS_DefineElement(cx, obj, + ix, STRING_TO_JSVAL(JS_NewStringCopyZ(cx, dp->d_name)), + NULL, NULL, JSPROP_ENUMERATE); + JS_ValueToId(cx, *statep, idp); +if (_debug) +fprintf(stderr, "\tNEXT fd %p[%u] dirent %p \"%s\"\n", fd, ix, dp, dp->d_name); + *statep = INT_TO_JSVAL(ix+1); + } else + *idp = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + ix = JSVAL_TO_INT(*statep); + (void) JS_DefineProperty(cx, obj, "length", INT_TO_JSVAL(ix), + NULL, NULL, JSPROP_ENUMERATE); +if (_debug) +fprintf(stderr, "\tFINI fd %p[%u]\n", fd, ix); + *statep = JSVAL_NULL; + break; + } +#endif + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static void +rpmio_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmioClass, NULL); + FD_t fd = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + if (fd) + (void) Fclose(fd); +} + +static JSBool +rpmio_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + const char * _fn = NULL; + const char * _fmode = "r.ufdio"; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/ss", &_fn, &_fmode))) + goto exit; + + if (JS_IsConstructing(cx, vp)) { + (void) rpmio_init(cx, obj, _fn, _fmode); + } else { + if ((obj = JS_NewObject(cx, &rpmioClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmio_call(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + /* XXX obj is the global object so lookup "this" object. */ + JSObject * o = JSVAL_TO_OBJECT(argv[-2]); + void * ptr = JS_GetInstancePrivate(cx, o, &rpmioClass, NULL); + FD_t fd = ptr; + JSBool ok = JS_FALSE; + const char * _fn = NULL; + const char * _fmode = "r.ufdio"; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p[%u],%p) o %p ptr %p\n", __FUNCTION__, cx, argv, (unsigned)argc, vp, o, ptr); + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/ss", &_fn, &_fmode))) + goto exit; + + if (fd) { + (void) Fclose(fd); + /* XXX error msg */ + fd = ptr = NULL; + (void) JS_SetPrivate(cx, o, (void *)fd); + } + + fd = ptr = rpmio_init(cx, o, _fn, _fmode); + + *vp = OBJECT_TO_JSVAL(o); + + ok = JS_TRUE; + +exit: +if (_debug) +fprintf(stderr, "<== %s(%p,%p[%u],%p) o %p ptr %p\n", __FUNCTION__, cx, argv, (unsigned)argc, vp, o, ptr); + + return ok; +} + +/* --- Class initialization */ +JSClass rpmioClass = { + "Io", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmio_addprop, rpmio_delprop, rpmio_getprop, rpmio_setprop, + (JSEnumerateOp)rpmio_enumerate, (JSResolveOp)rpmio_resolve, + rpmio_convert, rpmio_dtor, + + rpmio_getobjectops, rpmio_checkaccess, + rpmio_call, rpmio_construct, + rpmio_xdrobject, rpmio_hasinstance, + rpmio_mark, rpmio_reserveslots, +}; + +JSObject * +rpmjs_InitIoClass(JSContext *cx, JSObject* obj) +{ + JSObject * proto = JS_InitClass(cx, obj, NULL, &rpmioClass, rpmio_ctor, 1, + rpmio_props, rpmio_funcs, NULL, NULL); + +if (_debug) +fprintf(stderr, "<== %s(%p,%p) proto %p\n", __FUNCTION__, cx, obj, proto); + +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewIoObject(JSContext *cx, const char * _fn, const char * _fmode) +{ + JSObject *obj; + FD_t fd; + + if ((obj = JS_NewObject(cx, &rpmioClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((fd = rpmio_init(cx, obj, _fn, _fmode)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmio, Io, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmio-js.h b/rpm-5.4.9/js/rpmio-js.h new file mode 100644 index 0000000..cd53511 --- /dev/null +++ b/rpm-5.4.9/js/rpmio-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMIO_JS +#define H_RPMIO_JS + +/** + * \file js/rpmio-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmioClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitIoClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewIoObject(JSContext *cx, const char * _fn, const char * _fmode); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMIO_JS */ diff --git a/rpm-5.4.9/js/rpmiob-js.c b/rpm-5.4.9/js/rpmiob-js.c new file mode 100644 index 0000000..435d32c --- /dev/null +++ b/rpm-5.4.9/js/rpmiob-js.c @@ -0,0 +1,240 @@ +/** \ingroup js_c + * \file js/rpmiob-js.c + */ + +#include "system.h" + +#define _RPMIOB_INTERNAL +#include "rpmiob-js.h" +#include "rpmjs-debug.h" + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmiob_addprop JS_PropertyStub +#define rpmiob_delprop JS_PropertyStub +#define rpmiob_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmiob_getobjectops NULL +#define rpmiob_checkaccess NULL +#define rpmiob_call NULL +#define rpmiob_construct rpmiob_ctor +#define rpmiob_xdrobject NULL +#define rpmiob_hasinstance NULL +#define rpmiob_mark NULL +#define rpmiob_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmiob_equality NULL +#define rpmiob_outerobject NULL +#define rpmiob_innerobject NULL +#define rpmiob_iteratorobject NULL +#define rpmiob_wrappedobject NULL + +/* --- helpers */ + +/* --- Object methods */ + +static JSFunctionSpec rpmiob_funcs[] = { + JS_FS_END +}; + +/* --- Object properties */ +enum rpmiob_tinyid { + _DEBUG = -2, +}; + +static JSPropertySpec rpmiob_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmiob_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmiobClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmiob_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmiobClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmiob_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmiobClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmiob_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static rpmiob +rpmiob_init(JSContext *cx, JSObject *obj) +{ + rpmiob iob = rpmiobNew(0); + +if (_debug) +fprintf(stderr, "==> %s(%p,%p) iob %p\n", __FUNCTION__, cx, obj, iob); + + if (!JS_SetPrivate(cx, obj, (void *)iob)) { + /* XXX error msg */ + return NULL; + } + return iob; +} + +static void +rpmiob_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmiobClass, NULL); + rpmiob iob = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + if (iob) + (void) rpmiobFree(iob); +} + +static JSBool +rpmiob_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (JS_IsConstructing(cx, vp)) { + (void) rpmiob_init(cx, obj); + } else { + if ((obj = JS_NewObject(cx, &rpmiobClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass rpmiobClass = { + /* XXX class should be "Buf" eventually, avoid name conflicts for now */ + "Iob", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmiob_addprop, rpmiob_delprop, rpmiob_getprop, rpmiob_setprop, + (JSEnumerateOp)rpmiob_enumerate, (JSResolveOp)rpmiob_resolve, + rpmiob_convert, rpmiob_dtor, + + rpmiob_getobjectops, rpmiob_checkaccess, + rpmiob_call, rpmiob_construct, + rpmiob_xdrobject, rpmiob_hasinstance, + rpmiob_mark, rpmiob_reserveslots, +}; + +JSObject * +rpmjs_InitIobClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmiobClass, rpmiob_ctor, 1, + rpmiob_props, rpmiob_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewIobObject(JSContext *cx) +{ + JSObject *obj; + rpmiob iob; + + if ((obj = JS_NewObject(cx, &rpmiobClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((iob = rpmiob_init(cx, obj)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmiob, Iob, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmiob-js.h b/rpm-5.4.9/js/rpmiob-js.h new file mode 100644 index 0000000..78957d8 --- /dev/null +++ b/rpm-5.4.9/js/rpmiob-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMIOB_JS +#define H_RPMIOB_JS + +/** + * \file js/rpmiob-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmiobClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitIobClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewIobObject(JSContext *cx); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMIOB_JS */ diff --git a/rpm-5.4.9/js/rpmjs-debug.h b/rpm-5.4.9/js/rpmjs-debug.h new file mode 100644 index 0000000..dd3c89f --- /dev/null +++ b/rpm-5.4.9/js/rpmjs-debug.h @@ -0,0 +1,94 @@ +#ifndef H_RPMJS_DEBUG +#define H_RPMJS_DEBUG + +/** + * \file js/rpmjs-debug.h + */ +#include + +#define OBJ_IS_RPMHDR(_cx, _o) (JS_GET_CLASS(_cx, _o) == &rpmhdrClass) + +static inline +const char * v2s(JSContext *cx, jsval v) +{ + if (JSVAL_IS_NULL(v)) return "null"; + if (JSVAL_IS_VOID(v)) return "void"; + if (JSVAL_IS_INT(v)) return "integer"; + if (JSVAL_IS_DOUBLE(v)) return "double"; + if (JSVAL_IS_STRING(v)) return "string"; + if (JSVAL_IS_BOOLEAN(v)) return "boolean"; + if (JSVAL_IS_OBJECT(v)) + return JS_GET_CLASS(cx, JSVAL_TO_OBJECT(v))->name; + return "other"; +} + +#define _METHOD_DEBUG_ENTRY(_test) \ + if (_test) \ + fprintf(stderr, "==> %s(%p,%u,%p) ptr %p\n", \ + __FUNCTION__, cx, (unsigned)argc, vp, ptr) + +#define _PROP_DEBUG_ENTRY(_test)\ + if (_test) { \ + const char * _kstr = JS_EncodeString(cx, JS_ValueToString(cx, id)); \ + const char * _vstr = JS_EncodeString(cx, JS_ValueToString(cx, *vp)); \ + fprintf(stderr, "==> %s(%p,%p,0x%lx[%s],%p) ptr %p %s = %s\n", \ + __FUNCTION__, cx, obj, (unsigned long)id, v2s(cx, id), vp, ptr, \ + _kstr, _vstr); \ + _vstr = _free(_vstr); \ + _kstr = _free(_kstr); \ + } + +#define _PROP_DEBUG_EXIT(_test) \ + if (_test) { \ + const char * _kstr = JS_EncodeString(cx, JS_ValueToString(cx, id)); \ + const char * _vstr = JS_EncodeString(cx, JS_ValueToString(cx, *vp)); \ + fprintf(stderr, "==> %s(%p,%p,0x%lx[%s],%p) ptr %p %s = %s\n", \ + __FUNCTION__, cx, obj, (unsigned long)id, v2s(cx, id), vp, ptr, \ + _kstr, _vstr); \ + _vstr = _free(_vstr); \ + _kstr = _free(_kstr); \ + ok = JS_TRUE; /* XXX return JS_TRUE iff ... ? */ \ + } + +#define _RESOLVE_DEBUG_ENTRY(_test) \ + if (_test) { \ + const char * _kstr = JS_EncodeString(cx, JS_ValueToString(cx, id)); \ + fprintf(stderr, "==> %s(%p,%p,0x%lx[%s],0x%x,%p) ptr %p property %s flags 0x%x{%s,%s,%s,%s,%s}\n", \ + __FUNCTION__, cx, obj, (unsigned long)id, v2s(cx, id), \ + (unsigned)flags, objp, ptr, \ + _kstr, \ + flags, \ + (flags & JSRESOLVE_QUALIFIED) ? "qualified" : "", \ + (flags & JSRESOLVE_ASSIGNING) ? "assigning" : "", \ + (flags & JSRESOLVE_DETECTING) ? "detecting" : "", \ + (flags & JSRESOLVE_DECLARING) ? "declaring" : "", \ + (flags & JSRESOLVE_CLASSNAME) ? "classname" : ""); \ + _kstr = _free(_kstr); \ + } + +#define _ENUMERATE_DEBUG_ENTRY(_test) \ + if (_test) \ + fprintf(stderr, "==> %s(%p,%p,%d,%p,%p) *statep 0x%lx *idp 0x%lx\n", \ + __FUNCTION__, cx, obj, op, statep, idp, \ + (statep ? (unsigned long)*statep : 0xfeedfaceUL), \ + (idp ? (unsigned long)*idp : 0xdeadbeefUL)) + +#define _CONVERT_DEBUG_ENTRY(_test) \ + if (_test) \ + fprintf(stderr, "==> %s(%p,%p,%d,%p) ptr %p convert to %s\n", \ + __FUNCTION__, cx, obj, type, vp, ptr, JS_GetTypeName(cx, type)) + +#define _DTOR_DEBUG_ENTRY(_test) \ + if (_test) \ + fprintf(stderr, "==> %s(%p,%p) ptr %p\n", __FUNCTION__, cx, obj, ptr) + +#define _CTOR_DEBUG_ENTRY(_test) \ + if (_test) \ + fprintf(stderr, "==> %s(%p,%p,%p[%u],%p)\n", \ + __FUNCTION__, cx, obj, argv, (unsigned)argc, \ + (JS_IsConstructing(cx, vp) ? " constructing" : "")) + +/*@unchecked@*/ +extern int _rpmjs_debug; + +#endif /* H_RPMJS_DEBUG */ diff --git a/rpm-5.4.9/js/rpmjsfile.c b/rpm-5.4.9/js/rpmjsfile.c new file mode 100644 index 0000000..4c0d049 --- /dev/null +++ b/rpm-5.4.9/js/rpmjsfile.c @@ -0,0 +1,2970 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=78: + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla Communicator client code, released + * March 31, 1998. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either of the GNU General Public License Version 2 or later (the "GPL"), + * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +/* + * JS File object + */ +#include "system.h" + +#include +#include +#include + +#ifdef WITH_JS +#define XP_UNIX 1 +#define JS_HAS_FILE_OBJECT 1 + +#if JS_HAS_FILE_OBJECT + +#include "jsstddef.h" +#include "rpmjsio.h" + +/* ----------------- Platform-specific includes and defines ----------------- */ +#if defined(XP_WIN) || defined(XP_OS2) +# include +# include +# include +# include +#include +# define FILESEPARATOR '\\' +# define FILESEPARATOR2 '/' +# define CURRENT_DIR "c:\\" +# define POPEN _popen +# define PCLOSE _pclose +#elif defined(XP_UNIX) || defined(XP_BEOS) +# define FILESEPARATOR '/' +# define FILESEPARATOR2 '\0' +# define CURRENT_DIR "/" +# define POPEN popen +# define PCLOSE pclose +#endif + +/* --------------- Platform-independent includes and defines ---------------- */ +#include "jsapi.h" +#include "jsatom.h" +#include "jscntxt.h" +#include "jsdate.h" +#include "jsdbgapi.h" +#include "jsemit.h" +#include "jsfun.h" +#include "jslock.h" +#include "jsobj.h" +#include "jsparse.h" +#include "jsscan.h" +#include "jsscope.h" +#include "jsscript.h" +#include "jsstr.h" +#include "jsutil.h" /* Added by JSIFY */ + +/* NSPR dependencies */ +#if defined(WITH_NSPR) +#include "prio.h" +#include "prerror.h" +#define d_name name /* XXX retrofit dirent d_name into PRDirEntry */ +#else + +typedef DIR PRDir; +#define PR_OpenDir(_name) Opendir(_name) +#define PR_CloseDir(_dir) Closedir(_dir) +typedef struct dirent PRDirEntry; +#define PR_ReadDir(_dir, _foo) Readdir(_dir) + +#define PR_MkDir(_path, _mode) Mkdir((_path), (_mode)) +#define PR_RmDir(_path) Rmdir(_path) + +#define PR_Rename(_from, _to) Rename((_from), (_to)) +#define PR_Delete(_path) Unlink(_path) + +typedef enum PRDirFlags { + PR_SKIP_NONE = 0x0, + PR_SKIP_DOT = 0x1, + PR_SKIP_DOT_DOT = 0x2, + PR_SKIP_BOTH = 0x3, + PR_SKIP_HIDDEN = 0x4 +} PRDirFlags; + +#define PR_SUCCESS 0 + +/* Open flags */ +#define PR_RDONLY 0x01 +#define PR_WRONLY 0x02 +#define PR_RDWR 0x04 +#define PR_CREATE_FILE 0x08 +#define PR_APPEND 0x10 +#define PR_TRUNCATE 0x20 +#define PR_SYNC 0x40 +#define PR_EXCL 0x80 + +/* File mode bits */ +#define PR_IRWXU 00700 /* read, write, execute/search by owner */ +#define PR_IRUSR 00400 /* read permission, owner */ +#define PR_IWUSR 00200 /* write permission, owner */ +#define PR_IXUSR 00100 /* execute/search permission, owner */ +#define PR_IRWXG 00070 /* read, write, execute/search by group */ +#define PR_IRGRP 00040 /* read permission, group */ +#define PR_IWGRP 00020 /* write permission, group */ +#define PR_IXGRP 00010 /* execute/search permission, group */ +#define PR_IRWXO 00007 /* read, write, execute/search by others */ +#define PR_IROTH 00004 /* read permission, others */ +#define PR_IWOTH 00002 /* write permission, others */ +#define PR_IXOTH 00001 /* execute/search permission, others */ + +static inline +FD_t PR_Open(const char * name, int flags, int mode) +{ + char fmode[8], *t = fmode; + FD_t fd = NULL; + + /* XXX stub in the basics */ + if (flags & PR_RDWR) + t = stpcpy(t, "w+"); + else if (flags & PR_WRONLY) + t = stpcpy(t, "w"); + else + t = stpcpy(t, "r"); + fd = Fopen(name, fmode); + return fd; +} + +static inline +int32_t PR_Read(FD_t fd, void *buf, int32_t amount) +{ + size_t nr = Fread(buf, 1, amount, fd); + return (Ferror(fd) ? -1 : (int)nr); +} + +static inline +int32_t PR_Write(FD_t fd, const void *buf, int32_t amount) +{ + size_t nw = Fwrite(buf, 1, amount, fd); + return (Ferror(fd) ? -1 : (int)nw); +} + +static inline +int32_t PR_Close(FD_t fd) +{ + return Fclose(fd); +} + +#endif + +#include "debug.h" + +#define SPECIAL_FILE_STRING "Special File" +#define CURRENTDIR_PROPERTY "currentDir" +#define SEPARATOR_PROPERTY "separator" +#define FILE_CONSTRUCTOR "File" +#define PIPE_SYMBOL '|' + +#define ASCII 0 +#define UTF8 1 +#define UCS2 2 + +#define asciistring "text" +#define utfstring "binary" +#define unicodestring "unicode" + +#define MAX_PATH_LENGTH 1024 +#define MODE_SIZE 256 +#define NUMBER_SIZE 32 +#define MAX_LINE_LENGTH 256 +#define URL_PREFIX "file://" + +#define STDINPUT_NAME "Standard input stream" +#define STDOUTPUT_NAME "Standard output stream" +#define STDERROR_NAME "Standard error stream" + +#define RESOLVE_PATH js_canonicalPath /* js_absolutePath */ + +/* Error handling */ +typedef enum JSFileErrNum { +#define MSG_DEF(name, number, count, exception, format) \ + name = number, +#include "rpmjsio.msg" +#undef MSG_DEF + JSFileErr_Limit +#undef MSGDEF +} JSFileErrNum; + +#define JSFILE_HAS_DFLT_MSG_STRINGS 1 + +JSErrorFormatString JSFile_ErrorFormatString[JSFileErr_Limit] = { +#if JSFILE_HAS_DFLT_MSG_STRINGS +#define MSG_DEF(name, number, count, exception, format) \ + { format, count }, +#else +#define MSG_DEF(name, number, count, exception, format) \ + { NULL, count }, +#endif +#include "rpmjsio.msg" +#undef MSG_DEF +}; + +static const JSErrorFormatString * +JSFile_GetErrorMessage(void *userRef, const char *locale, + const uintN errorNumber) +{ + if ((errorNumber > 0) && (errorNumber < JSFileErr_Limit)) + return &JSFile_ErrorFormatString[errorNumber]; + else + return NULL; +} + +#define JSFILE_CHECK_NATIVE(op) \ + if (file->isNative) { \ + JS_ReportWarning(cx, "Cannot call or access \"%s\" on native file %s",\ + op, file->path); \ + goto out; \ + } + +#define JSFILE_CHECK_WRITE \ + if (!file->isOpen) { \ + JS_ReportWarning(cx, \ + "File %s is closed, will open it for writing, proceeding", \ + file->path); \ + js_FileOpen(cx, obj, file, "write,append,create"); \ + } \ + if (!js_canWrite(cx, file)) { \ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, \ + JSFILEMSG_CANNOT_WRITE, file->path); \ + goto out; \ + } + +#define JSFILE_CHECK_READ \ + if (!file->isOpen) { \ + JS_ReportWarning(cx, \ + "File %s is closed, will open it for reading, proceeding", \ + file->path); \ + js_FileOpen(cx, obj, file, "read"); \ + } \ + if (!js_canRead(cx, file)) { \ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, \ + JSFILEMSG_CANNOT_READ, file->path); \ + goto out; \ + } + +#define JSFILE_CHECK_OPEN(op) \ + if (!file->isOpen) { \ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, \ + JSFILEMSG_FILE_MUST_BE_OPEN, op); \ + goto out; \ + } + +#define JSFILE_CHECK_CLOSED(op) \ + if (file->isOpen) { \ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, \ + JSFILEMSG_FILE_MUST_BE_CLOSED, op); \ + goto out; \ + } + +#define JSFILE_CHECK_ONE_ARG(op) \ + if (argc != 1) { \ + char str[NUMBER_SIZE]; \ + sprintf(str, "%d", argc); \ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, \ + JSFILEMSG_EXPECTS_ONE_ARG_ERROR, op, str); \ + goto out; \ + } + + +/* + Security mechanism, should define a callback for this. + The parameters are as follows: + SECURITY_CHECK(JSContext *cx, JSPrincipals *ps, char *op_name, JSFile *file) + XXX Should this be a real function returning a JSBool result (and getting + some typesafety help from the compiler?). +*/ +#define SECURITY_CHECK(cx, ps, op, file) \ + /* Define a callback here... */ + + +/* Structure representing the file internally */ +typedef struct JSFile { + char *path; /* the path to the file. */ + JSBool isOpen; + int32 mode; /* mode used to open the file: read, write, append, create, etc.. */ + int32 type; /* Asciiz, utf, unicode */ + char byteBuffer[3]; /* bytes read in advance by js_FileRead ( UTF8 encoding ) */ + jsint nbBytesInBuf; /* number of bytes stored in the buffer above */ + jschar charBuffer; /* character read in advance by readln ( mac files only ) */ + JSBool charBufferUsed; /* flag indicating if the buffer above is being used */ + JSBool hasRandomAccess;/* can the file be randomly accessed? false for stdin, and + UTF-encoded files. */ + JSBool hasAutoflush; /* should we force a flush for each line break? */ + JSBool isNative; /* if the file is using OS-specific file FILE type */ + /* We can actually put the following two in a union since they should never be used at the same time */ +#if defined(WITH_NSPR) + PRFileDesc *handle; /* the handle for the file, if open. */ +#else + FD_t handle; +#endif + FILE *nativehandle; /* native handle, for stuff NSPR doesn't do. */ + JSBool isPipe; /* if the file is really an OS pipe */ +} JSFile; + +/* a few forward declarations... */ +JS_PUBLIC_API(JSObject*) js_NewFileObject(JSContext *cx, char *filename); +static JSBool file_open(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval); +static JSBool file_close(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval); + +/* New filename manipulation procesures */ +/* assumes we don't have leading/trailing spaces */ +static JSBool +js_filenameHasAPipe(const char *filename) +{ + if (!filename) + return JS_FALSE; + + return filename[0] == PIPE_SYMBOL || + filename[strlen(filename) - 1] == PIPE_SYMBOL; +} + +static JSBool +js_isAbsolute(const char *name) +{ +#if defined(XP_WIN) || defined(XP_OS2) + return *name && name[1] == ':'; +#else + return (name[0] +# if defined(XP_UNIX) || defined(XP_BEOS) + == +# else + != +# endif + FILESEPARATOR); +#endif +} + +/* + * Concatenates base and name to produce a valid filename. + * Returned string must be freed. +*/ +static char* +js_combinePath(JSContext *cx, const char *base, const char *name) +{ + int len = strlen(base); + char* result = JS_malloc(cx, len + strlen(name) + 2); + + if (!result) + return NULL; + + strcpy(result, base); + + if (base[len - 1] != FILESEPARATOR && base[len - 1] != FILESEPARATOR2) { + result[len] = FILESEPARATOR; + result[len + 1] = '\0'; + } + strcat(result, name); + return result; +} + +/* Extract the last component from a path name. Returned string must be freed */ +static char * +js_fileBaseName(JSContext *cx, const char *pathname) +{ + jsint index, aux; + char *result; + + index = strlen(pathname)-1; + + /* Chop off trailing seperators. */ + while (index > 0 && (pathname[index]==FILESEPARATOR || + pathname[index]==FILESEPARATOR2)) { + --index; + } + + aux = index; + + /* Now find the next separator. */ + while (index >= 0 && pathname[index] != FILESEPARATOR && + pathname[index] != FILESEPARATOR2) { + --index; + } + + /* Allocate and copy. */ + result = JS_malloc(cx, aux - index + 1); + if (!result) + return NULL; + strncpy(result, pathname + index + 1, aux - index); + result[aux - index] = '\0'; + return result; +} + +/* + * Returns everything but the last component from a path name. + * Returned string must be freed. + */ +static char * +js_fileDirectoryName(JSContext *cx, const char *pathname) +{ + char *result; + const char *cp, *end; + size_t pathsize; + + end = pathname + strlen(pathname); + cp = end - 1; + + /* If this is already a directory, chop off the trailing /s. */ + while (cp >= pathname) { + if (*cp != FILESEPARATOR && *cp != FILESEPARATOR2) + break; + --cp; + } + + if (cp < pathname && end != pathname) { + /* There were just /s, return the root. */ + result = JS_malloc(cx, 1 + 1); /* The separator + trailing NUL. */ + result[0] = FILESEPARATOR; + result[1] = '\0'; + return result; + } + + /* Now chop off the last portion. */ + while (cp >= pathname) { + if (*cp == FILESEPARATOR || *cp == FILESEPARATOR2) + break; + --cp; + } + + /* Check if this is a leaf. */ + if (cp < pathname) { + /* It is, return "pathname/". */ + if (end[-1] == FILESEPARATOR || end[-1] == FILESEPARATOR2) { + /* Already has its terminating /. */ + return JS_strdup(cx, pathname); + } + + pathsize = end - pathname + 1; + result = JS_malloc(cx, pathsize + 1); + if (!result) + return NULL; + + strcpy(result, pathname); + result[pathsize - 1] = FILESEPARATOR; + result[pathsize] = '\0'; + + return result; + } + + /* Return everything up to and including the seperator. */ + pathsize = cp - pathname + 1; + result = JS_malloc(cx, pathsize + 1); + if (!result) + return NULL; + + strncpy(result, pathname, pathsize); + result[pathsize] = '\0'; + + return result; +} + +static char * +js_absolutePath(JSContext *cx, const char * path) +{ + JSObject *obj; + JSString *str; + jsval prop; + + if (js_isAbsolute(path)) { + return JS_strdup(cx, path); + } else { + obj = JS_GetGlobalObject(cx); + if (!JS_GetProperty(cx, obj, FILE_CONSTRUCTOR, &prop)) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_FILE_CONSTRUCTOR_UNDEFINED_ERROR); + return JS_strdup(cx, path); + } + + obj = JSVAL_TO_OBJECT(prop); + if (!JS_GetProperty(cx, obj, CURRENTDIR_PROPERTY, &prop)) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_FILE_CURRENTDIR_UNDEFINED_ERROR); + return JS_strdup(cx, path); + } + + str = JS_ValueToString(cx, prop); + if (!str) + return JS_strdup(cx, path); + + /* should we have an array of curr dirs indexed by drive for windows? */ + return js_combinePath(cx, JS_GetStringBytes(str), path); + } +} + +/* Side effect: will remove spaces in the beginning/end of the filename */ +static char * +js_canonicalPath(JSContext *cx, char *oldpath) +{ + char *tmp; + char *path = oldpath; + char *base, *dir, *current, *result; + jsint c; + jsint back = 0; + unsigned int i = 0, j = strlen(path)-1; + + /* This is probably optional */ + /* Remove possible spaces in the beginning and end */ + while (i < j && path[i] == ' ') + i++; + while (j >= 0 && path[j] == ' ') + j--; + + tmp = JS_malloc(cx, j-i+2); + if (!tmp) + return NULL; + + strncpy(tmp, path + i, j - i + 1); + tmp[j - i + 1] = '\0'; + + path = tmp; + + /* Pipe support. */ + if (js_filenameHasAPipe(path)) + return path; + + /* file:// support. */ + if (!strncmp(path, URL_PREFIX, strlen(URL_PREFIX))) { + tmp = js_canonicalPath(cx, path + strlen(URL_PREFIX)); + JS_free(cx, path); + return tmp; + } + + if (!js_isAbsolute(path)) { + tmp = js_absolutePath(cx, path); + if (!tmp) + return NULL; + JS_free(cx, path); + path = tmp; + } + + result = JS_strdup(cx, ""); + + current = path; + + base = js_fileBaseName(cx, current); + dir = js_fileDirectoryName(cx, current); + + while (strcmp(dir, current)) { + if (!strcmp(base, "..")) { + back++; + } else { + if (back > 0) { + back--; + } else { + tmp = result; + result = JS_malloc(cx, strlen(base) + 1 + strlen(tmp) + 1); + if (!result) + goto out; + + strcpy(result, base); + c = strlen(result); + if (*tmp) { + result[c] = FILESEPARATOR; + result[c + 1] = '\0'; + strcat(result, tmp); + } + JS_free(cx, tmp); + } + } + JS_free(cx, current); + JS_free(cx, base); + current = dir; + base = js_fileBaseName(cx, current); + dir = js_fileDirectoryName(cx, current); + } + + tmp = result; + result = JS_malloc(cx, strlen(dir)+1+strlen(tmp)+1); + if (!result) + goto out; + + strcpy(result, dir); + c = strlen(result); + if (tmp[0]!='\0') { + if ((result[c-1]!=FILESEPARATOR)&&(result[c-1]!=FILESEPARATOR2)) { + result[c] = FILESEPARATOR; + result[c+1] = '\0'; + } + strcat(result, tmp); + } + +out: + if (tmp) + JS_free(cx, tmp); + if (dir) + JS_free(cx, dir); + if (base) + JS_free(cx, base); + if (current) + JS_free(cx, current); + + return result; +} + +/* -------------------------- Text conversion ------------------------------- */ +/* The following is ripped from libi18n/unicvt.c and include files.. */ + +/* + * UTF8 defines and macros + */ +#define ONE_OCTET_BASE 0x00 /* 0xxxxxxx */ +#define ONE_OCTET_MASK 0x7F /* x1111111 */ +#define CONTINUING_OCTET_BASE 0x80 /* 10xxxxxx */ +#define CONTINUING_OCTET_MASK 0x3F /* 00111111 */ +#define TWO_OCTET_BASE 0xC0 /* 110xxxxx */ +#define TWO_OCTET_MASK 0x1F /* 00011111 */ +#define THREE_OCTET_BASE 0xE0 /* 1110xxxx */ +#define THREE_OCTET_MASK 0x0F /* 00001111 */ +#define FOUR_OCTET_BASE 0xF0 /* 11110xxx */ +#define FOUR_OCTET_MASK 0x07 /* 00000111 */ +#define FIVE_OCTET_BASE 0xF8 /* 111110xx */ +#define FIVE_OCTET_MASK 0x03 /* 00000011 */ +#define SIX_OCTET_BASE 0xFC /* 1111110x */ +#define SIX_OCTET_MASK 0x01 /* 00000001 */ + +#define IS_UTF8_1ST_OF_1(x) (( (x)&~ONE_OCTET_MASK ) == ONE_OCTET_BASE) +#define IS_UTF8_1ST_OF_2(x) (( (x)&~TWO_OCTET_MASK ) == TWO_OCTET_BASE) +#define IS_UTF8_1ST_OF_3(x) (( (x)&~THREE_OCTET_MASK) == THREE_OCTET_BASE) +#define IS_UTF8_1ST_OF_4(x) (( (x)&~FOUR_OCTET_MASK ) == FOUR_OCTET_BASE) +#define IS_UTF8_1ST_OF_5(x) (( (x)&~FIVE_OCTET_MASK ) == FIVE_OCTET_BASE) +#define IS_UTF8_1ST_OF_6(x) (( (x)&~SIX_OCTET_MASK ) == SIX_OCTET_BASE) +#define IS_UTF8_2ND_THRU_6TH(x) \ + (( (x)&~CONTINUING_OCTET_MASK ) == CONTINUING_OCTET_BASE) +#define IS_UTF8_1ST_OF_UCS2(x) \ + IS_UTF8_1ST_OF_1(x) \ + || IS_UTF8_1ST_OF_2(x) \ + || IS_UTF8_1ST_OF_3(x) + + +#define MAX_UCS2 0xFFFF +#define DEFAULT_CHAR 0x003F /* Default char is "?" */ +#define BYTE_MASK 0xBF +#define BYTE_MARK 0x80 + + +/* Function: one_ucs2_to_utf8_char + * + * Function takes one UCS-2 char and writes it to a UTF-8 buffer. + * We need a UTF-8 buffer because we don't know before this + * function how many bytes of utf-8 data will be written. It also + * takes a pointer to the end of the UTF-8 buffer so that we don't + * overwrite data. This function returns the number of UTF-8 bytes + * of data written, or -1 if the buffer would have been overrun. + */ + +#define LINE_SEPARATOR 0x2028 +#define PARAGRAPH_SEPARATOR 0x2029 +static int16 one_ucs2_to_utf8_char(unsigned char *tobufp, + unsigned char *tobufendp, + uint16 onechar) +{ + int16 numUTF8bytes = 0; + + if (onechar == LINE_SEPARATOR || onechar == PARAGRAPH_SEPARATOR) { + strcpy((char*)tobufp, "\n"); + return strlen((char*)tobufp); + } + + if (onechar < 0x80) { + numUTF8bytes = 1; + } else if (onechar < 0x800) { + numUTF8bytes = 2; + } else { + /* 0x800 >= onechar <= MAX_UCS2 */ + numUTF8bytes = 3; + } + + tobufp += numUTF8bytes; + + /* return error if we don't have space for the whole character */ + if (tobufp > tobufendp) { + return(-1); + } + + switch(numUTF8bytes) { + case 3: *--tobufp = (onechar | BYTE_MARK) & BYTE_MASK; onechar >>=6; + *--tobufp = (onechar | BYTE_MARK) & BYTE_MASK; onechar >>=6; + *--tobufp = onechar | THREE_OCTET_BASE; + break; + + case 2: *--tobufp = (onechar | BYTE_MARK) & BYTE_MASK; onechar >>=6; + *--tobufp = onechar | TWO_OCTET_BASE; + break; + + case 1: *--tobufp = (unsigned char)onechar; + break; + } + + return numUTF8bytes; +} + +/* + * utf8_to_ucs2_char + * + * Convert a utf8 multibyte character to ucs2 + * + * inputs: pointer to utf8 character(s) + * length of utf8 buffer ("read" length limit) + * pointer to return ucs2 character + * + * outputs: number of bytes in the utf8 character + * -1 if not a valid utf8 character sequence + * -2 if the buffer is too short + */ +static int16 +utf8_to_ucs2_char(const unsigned char *utf8p, int16 buflen, uint16 *ucs2p) +{ + uint16 lead, cont1, cont2; + + /* + * Check for minimum buffer length + */ + if ((buflen < 1) || (utf8p == NULL)) { + return -2; + } + lead = (uint16) (*utf8p); + + /* + * Check for a one octet sequence + */ + if (IS_UTF8_1ST_OF_1(lead)) { + *ucs2p = lead & ONE_OCTET_MASK; + return 1; + } + + /* + * Check for a two octet sequence + */ + if (IS_UTF8_1ST_OF_2(*utf8p)) { + if (buflen < 2) + return -2; + cont1 = (uint16) *(utf8p+1); + if (!IS_UTF8_2ND_THRU_6TH(cont1)) + return -1; + *ucs2p = (lead & TWO_OCTET_MASK) << 6; + *ucs2p |= cont1 & CONTINUING_OCTET_MASK; + return 2; + } + + /* + * Check for a three octet sequence + */ + else if (IS_UTF8_1ST_OF_3(lead)) { + if (buflen < 3) + return -2; + cont1 = (uint16) *(utf8p+1); + cont2 = (uint16) *(utf8p+2); + if ( (!IS_UTF8_2ND_THRU_6TH(cont1)) + || (!IS_UTF8_2ND_THRU_6TH(cont2))) + return -1; + *ucs2p = (lead & THREE_OCTET_MASK) << 12; + *ucs2p |= (cont1 & CONTINUING_OCTET_MASK) << 6; + *ucs2p |= cont2 & CONTINUING_OCTET_MASK; + return 3; + } + else { /* not a valid utf8/ucs2 character */ + return -1; + } +} + +/* ----------------------------- Helper functions --------------------------- */ +/* Ripped off from lm_win.c .. */ +/* where is strcasecmp?.. for now, it's case sensitive.. + * + * strcasecmp is in strings.h, but on windows it's called _stricmp... + * will need to #ifdef this +*/ + +static int32 +js_FileHasOption(JSContext *cx, const char *oldoptions, const char *name) +{ + char *comma, *equal, *current; + char *options = JS_strdup(cx, oldoptions); + int32 found = 0; + + current = options; + for (;;) { + comma = strchr(current, ','); + if (comma) *comma = '\0'; + equal = strchr(current, '='); + if (equal) *equal = '\0'; + if (strcmp(current, name) == 0) { + if (!equal || strcmp(equal + 1, "yes") == 0) + found = 1; + else + found = atoi(equal + 1); + } + if (equal) *equal = '='; + if (comma) *comma = ','; + if (found || !comma) + break; + current = comma + 1; + } + JS_free(cx, options); + return found; +} + +/* empty the buffer */ +static void +js_ResetBuffers(JSFile * file) +{ + file->charBufferUsed = JS_FALSE; + file->nbBytesInBuf = 0; +} + +/* Reset file attributes */ +static void +js_ResetAttributes(JSFile * file) +{ + file->mode = file->type = 0; + file->isOpen = JS_FALSE; + file->handle = NULL; + file->nativehandle = NULL; + file->hasRandomAccess = JS_TRUE; /* Innocent until proven guilty. */ + file->hasAutoflush = JS_FALSE; + file->isNative = JS_FALSE; + file->isPipe = JS_FALSE; + + js_ResetBuffers(file); +} + +static JSBool +js_FileOpen(JSContext *cx, JSObject *obj, JSFile *file, char *mode){ + JSString *type, *mask; + jsval v[2]; + jsval rval; + + type = JS_InternString(cx, asciistring); + mask = JS_NewStringCopyZ(cx, mode); + v[0] = STRING_TO_JSVAL(mask); + v[1] = STRING_TO_JSVAL(type); + + if (!file_open(cx, obj, 2, v, &rval)) + return JS_FALSE; + return JS_TRUE; +} + +/* Buffered version of PR_Read. Used by js_FileRead */ +static int32 +js_BufferedRead(JSFile *f, unsigned char *buf, int32 len) +{ + int32 count = 0; + + while (f->nbBytesInBuf>0&&len>0) { + buf[0] = f->byteBuffer[0]; + f->byteBuffer[0] = f->byteBuffer[1]; + f->byteBuffer[1] = f->byteBuffer[2]; + f->nbBytesInBuf--; + len--; + buf+=1; + count++; + } + + if (len > 0) { + count += (!f->isNative) + ? PR_Read(f->handle, buf, len) + : (int)fread(buf, 1, len, f->nativehandle); + } + return count; +} + +static int32 +js_FileRead(JSContext *cx, JSFile *file, jschar *buf, int32 len, int32 mode) +{ + unsigned char *aux; + int32 count = 0, i; + jsint remainder; + unsigned char utfbuf[3]; + + if (file->charBufferUsed) { + buf[0] = file->charBuffer; + buf++; + len--; + file->charBufferUsed = JS_FALSE; + } + + switch (mode) { + case ASCII: + aux = (unsigned char*)JS_malloc(cx, len); + if (!aux) + return 0; + + count = js_BufferedRead(file, aux, len); + if (count == -1) { + JS_free(cx, aux); + return 0; + } + + for (i = 0; i < len; i++) + buf[i] = (jschar)aux[i]; + + JS_free(cx, aux); + break; + + case UTF8: + remainder = 0; + for (count = 0;count0) { + file->byteBuffer[file->nbBytesInBuf] = utfbuf[0]; + file->nbBytesInBuf++; + utfbuf[0] = utfbuf[1]; + utfbuf[1] = utfbuf[2]; + remainder--; + } + break; + + case UCS2: + count = js_BufferedRead(file, (unsigned char *)buf, len * 2) >> 1; + if (count == -1) + return 0; + + break; + + default: + /* Not reached. */ + JS_ASSERT(0); + } + + if(count == -1) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_OP_FAILED, "read", file->path); + } + + return count; +} + +static int32 +js_FileSeek(JSContext *cx, JSFile *file, int32 len, int32 mode) +{ + int32 count = 0, i; + jsint remainder; + unsigned char utfbuf[3]; + jschar tmp; + + switch (mode) { + case ASCII: +#if defined(WITH_NSPR) + count = PR_Seek(file->handle, len, PR_SEEK_CUR); +#else + count = lseek(Fileno(file->handle), len, SEEK_CUR); +#endif + break; + + case UTF8: + remainder = 0; + for (count = 0;count0) { + file->byteBuffer[file->nbBytesInBuf] = utfbuf[0]; + file->nbBytesInBuf++; + utfbuf[0] = utfbuf[1]; + utfbuf[1] = utfbuf[2]; + remainder--; + } + break; + + case UCS2: +#if defined(WITH_NSPR) + count = PR_Seek(file->handle, len*2, PR_SEEK_CUR)/2; +#else + count = lseek(Fileno(file->handle), len*2, SEEK_CUR)/2; +#endif + break; + + default: + /* Not reached. */ + JS_ASSERT(0); + } + + if(count == -1) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_OP_FAILED, "seek", file->path); + } + + return count; +} + +static int32 +js_FileWrite(JSContext *cx, JSFile *file, jschar *buf, int32 len, int32 mode) +{ + unsigned char *aux; + int32 count = 0, i, j; + unsigned char *utfbuf; + + switch (mode) { + case ASCII: + aux = (unsigned char*)JS_malloc(cx, len); + if (!aux) + return 0; + + for (i = 0; iisNative) + ? PR_Write(file->handle, aux, len) + : (int)fwrite(aux, 1, len, file->nativehandle); + + if (count==-1) { + JS_free(cx, aux); + return 0; + } + + JS_free(cx, aux); + break; + + case UTF8: + utfbuf = (unsigned char*)JS_malloc(cx, len*3); + if (!utfbuf) return 0; + i = 0; + for (count = 0;countisNative) + ? PR_Write(file->handle, utfbuf, i) + : (int)fwrite(utfbuf, 1, i, file->nativehandle); + + if (jisNative) + ? PR_Write(file->handle, buf, len*2) >> 1 + : (int)fwrite(buf, 1, len*2, file->nativehandle) >> 1; + + if (count == -1) + return 0; + break; + + default: + /* Not reached. */ + JS_ASSERT(0); + } + + if(count == -1) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_OP_FAILED, "write", file->path); + } + + return count; +} + +/* ----------------------------- Property checkers -------------------------- */ +static JSBool +js_exists(JSContext *cx, JSFile *file) +{ + if (file->isNative) { + /* It doesn't make sense for a pipe of stdstream. */ + return JS_FALSE; + } + +#if defined(WITH_NSPR) + return PR_Access(file->path, PR_ACCESS_EXISTS) == PR_SUCCESS; +#else + return Access(file->path, F_OK) == 0; +#endif +} + +static JSBool +js_canRead(JSContext *cx, JSFile *file) +{ + if (!file->isNative) { + if (file->isOpen && !(file->mode & PR_RDONLY)) + return JS_FALSE; +#if defined(WITH_NSPR) + return PR_Access(file->path, PR_ACCESS_READ_OK) == PR_SUCCESS; +#else + return Access(file->path, R_OK) == 0; +#endif + } + + if (file->isPipe) { + /* Is this pipe open for reading? */ + return file->path[0] == PIPE_SYMBOL; + } + + return !strcmp(file->path, STDINPUT_NAME); +} + +static JSBool +js_canWrite(JSContext *cx, JSFile *file) +{ + if (!file->isNative) { + if (file->isOpen && !(file->mode & PR_WRONLY)) + return JS_FALSE; +#if defined(WITH_NSPR) + return PR_Access(file->path, PR_ACCESS_WRITE_OK) == PR_SUCCESS; +#else + return Access(file->path, W_OK) == 0; +#endif + } + + if(file->isPipe) { + /* Is this pipe open for writing? */ + return file->path[strlen(file->path)-1] == PIPE_SYMBOL; + } + + return !strcmp(file->path, STDOUTPUT_NAME) || + !strcmp(file->path, STDERROR_NAME); +} + +static JSBool +js_isFile(JSContext *cx, JSFile *file) +{ + if (!file->isNative) { +#if defined(WITH_NSPR) + PRFileInfo info; + + if (file->isOpen + ? PR_GetOpenFileInfo(file->handle, &info) + : PR_GetFileInfo(file->path, &info) != PR_SUCCESS) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_CANNOT_ACCESS_FILE_STATUS, file->path); + return JS_FALSE; + } + + return info.type == PR_FILE_FILE; +#else + struct stat sb; + int rc = file->isOpen + ? Fstat(file->handle, &sb) : Stat(file->path, &sb); + if (rc < 0) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_CANNOT_ACCESS_FILE_STATUS, file->path); + return JS_FALSE; + } + return S_ISREG(sb.st_mode); +#endif + } + + /* This doesn't make sense for a pipe of stdstream. */ + return JS_FALSE; +} + +static JSBool +js_isDirectory(JSContext *cx, JSFile *file) +{ + if(!file->isNative){ +#if defined(WITH_NSPR) + PRFileInfo info; + + /* Hack needed to get get_property to work. */ + if (!js_exists(cx, file)) + return JS_FALSE; + + if (file->isOpen + ? PR_GetOpenFileInfo(file->handle, &info) + : PR_GetFileInfo(file->path, &info) != PR_SUCCESS) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_CANNOT_ACCESS_FILE_STATUS, file->path); + return JS_FALSE; + } + + return info.type == PR_FILE_DIRECTORY; +#else + struct stat sb; + int rc = file->isOpen + ? Fstat(file->handle, &sb) : Stat(file->path, &sb); + if (rc < 0) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_CANNOT_ACCESS_FILE_STATUS, file->path); + return JS_FALSE; + } + return S_ISDIR(sb.st_mode); +#endif + } + + /* This doesn't make sense for a pipe of stdstream. */ + return JS_FALSE; +} + +static jsval +js_size(JSContext *cx, JSFile *file) +{ +#if defined(WITH_NSPR) + PRFileInfo info; + + JSFILE_CHECK_NATIVE("size"); + + if (file->isOpen + ? PR_GetOpenFileInfo(file->handle, &info) + : PR_GetFileInfo(file->path, &info) != PR_SUCCESS) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_CANNOT_ACCESS_FILE_STATUS, file->path); + return JSVAL_VOID; + } + + return INT_TO_JSVAL(info.size); +#else + struct stat sb; + int rc; + + JSFILE_CHECK_NATIVE("size"); + + rc = file->isOpen ? Fstat(file->handle, &sb) : Stat(file->path, &sb); + if (rc < 0) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_CANNOT_ACCESS_FILE_STATUS, file->path); + return JSVAL_VOID; + } + return INT_TO_JSVAL((int)sb.st_size); +#endif + +out: + return JSVAL_VOID; +} + +/* + * Return the parent object + */ +static JSBool +js_parent(JSContext *cx, JSFile *file, jsval *resultp) +{ + char *str; + + /* Since we only care about pipes and native files, return NULL. */ + if (file->isNative) { + *resultp = JSVAL_VOID; + return JS_TRUE; + } + + str = js_fileDirectoryName(cx, file->path); + if (!str) + return JS_FALSE; + + /* If the directory is equal to the original path, we're at the root. */ + if (!strcmp(file->path, str)) { + *resultp = JSVAL_NULL; + } else { + JSObject *obj = js_NewFileObject(cx, str); + if (!obj) { + JS_free(cx, str); + return JS_FALSE; + } + *resultp = OBJECT_TO_JSVAL(obj); + } + + JS_free(cx, str); + return JS_TRUE; +} + +static JSBool +js_name(JSContext *cx, JSFile *file, jsval *vp) +{ + char *name; + JSString *str; + + if (file->isPipe) { + *vp = JSVAL_VOID; + return JS_TRUE; + } + + name = js_fileBaseName(cx, file->path); + if (!name) + return JS_FALSE; + + str = JS_NewString(cx, name, strlen(name)); + if (!str) { + JS_free(cx, name); + return JS_FALSE; + } + + *vp = STRING_TO_JSVAL(str); + return JS_TRUE; +} + +/* ------------------------------ File object methods ---------------------------- */ +static JSBool +file_open(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + JSFile *file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + JSString *strmode, *strtype; + char *ctype, *mode; + int32 mask, type; + int len; + + mode = NULL; + + SECURITY_CHECK(cx, NULL, "open", file); + + /* A native file that is already open */ + if(file->isOpen && file->isNative) { + JS_ReportWarning(cx, "Native file %s is already open, proceeding", + file->path); + goto good; + } + + /* Close before proceeding */ + if (file->isOpen) { + JS_ReportWarning(cx, "File %s is already open, we will close it and " + "reopen, proceeding", file->path); + if(!file_close(cx, obj, 0, NULL, rval)) + goto out; + } + + if (js_isDirectory(cx, file)) { + JS_ReportWarning(cx, "%s seems to be a directory, there is no point in " + "trying to open it, proceeding", file->path); + goto good; + } + + /* Path must be defined at this point */ + len = strlen(file->path); + + /* Mode */ + if (argc >= 1) { + strmode = JS_ValueToString(cx, argv[0]); + if (!strmode) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_FIRST_ARGUMENT_OPEN_NOT_STRING_ERROR, + argv[0]); + goto out; + } + mode = JS_strdup(cx, JS_GetStringBytes(strmode)); + } else { + if(file->path[0]==PIPE_SYMBOL) { + /* pipe default mode */ + mode = JS_strdup(cx, "read"); + } else if(file->path[len-1]==PIPE_SYMBOL) { + /* pipe default mode */ + mode = JS_strdup(cx, "write"); + } else { + /* non-destructive, permissive defaults. */ + mode = JS_strdup(cx, "readWrite,append,create"); + } + } + + /* Process the mode */ + mask = 0; + /* TODO: this is pretty ugly, we walk thru the string too many times */ + mask |= js_FileHasOption(cx, mode, "read") ? PR_RDONLY : 0; + mask |= js_FileHasOption(cx, mode, "write") ? PR_WRONLY : 0; + mask |= js_FileHasOption(cx, mode, "readWrite")? PR_RDWR : 0; + mask |= js_FileHasOption(cx, mode, "append") ? PR_APPEND : 0; + mask |= js_FileHasOption(cx, mode, "create") ? PR_CREATE_FILE : 0; + mask |= js_FileHasOption(cx, mode, "replace") ? PR_TRUNCATE : 0; + + if (mask & PR_RDWR) + mask |= (PR_RDONLY | PR_WRONLY); + if ((mask & PR_RDONLY) && (mask & PR_WRONLY)) + mask |= PR_RDWR; + + file->hasAutoflush |= js_FileHasOption(cx, mode, "autoflush"); + + /* Type */ + if (argc > 1) { + strtype = JS_ValueToString(cx, argv[1]); + if (!strtype) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_SECOND_ARGUMENT_OPEN_NOT_STRING_ERROR, + argv[1]); + goto out; + } + ctype = JS_GetStringBytes(strtype); + + if(!strcmp(ctype, utfstring)) { + type = UTF8; + } else if (!strcmp(ctype, unicodestring)) { + type = UCS2; + } else { + if (strcmp(ctype, asciistring)) { + JS_ReportWarning(cx, "File type %s is not supported, using " + "'text' instead, proceeding", ctype); + } + type = ASCII; + } + } else { + type = ASCII; + } + + /* Save the relevant fields */ + file->type = type; + file->mode = mask; + file->nativehandle = NULL; + file->hasRandomAccess = (type != UTF8); + + /* + * Deal with pipes here. We can't use NSPR for pipes, so we have to use + * POPEN. + */ + if (file->path[0]==PIPE_SYMBOL || file->path[len-1]==PIPE_SYMBOL) { + if (file->path[0] == PIPE_SYMBOL && file->path[len-1] == PIPE_SYMBOL) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_BIDIRECTIONAL_PIPE_NOT_SUPPORTED); + goto out; + } else { + int i = 0; + char pipemode[3]; + SECURITY_CHECK(cx, NULL, "pipe_open", file); + + if(file->path[0] == PIPE_SYMBOL){ + if(mask & (PR_WRONLY | PR_APPEND | PR_CREATE_FILE | PR_TRUNCATE)){ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_OPEN_MODE_NOT_SUPPORTED_WITH_PIPES, + mode, file->path); + goto out; + } + /* open(SPOOLER, "| cat -v | lpr -h 2>/dev/null") -- pipe for writing */ + pipemode[i++] = 'r'; +#ifndef XP_UNIX + pipemode[i++] = file->type==UTF8 ? 'b' : 't'; +#endif + pipemode[i++] = '\0'; + file->nativehandle = POPEN(&file->path[1], pipemode); + } else if(file->path[len-1] == PIPE_SYMBOL) { + char *command = JS_malloc(cx, len); + + strncpy(command, file->path, len-1); + command[len-1] = '\0'; + /* open(STATUS, "netstat -an 2>&1 |") */ + pipemode[i++] = 'w'; +#ifndef XP_UNIX + pipemode[i++] = file->type==UTF8 ? 'b' : 't'; +#endif + pipemode[i++] = '\0'; + file->nativehandle = POPEN(command, pipemode); + JS_free(cx, command); + } + /* set the flags */ + file->isNative = JS_TRUE; + file->isPipe = JS_TRUE; + file->hasRandomAccess = JS_FALSE; + } + } else { + /* TODO: what about the permissions?? Java ignores the problem... */ + file->handle = PR_Open(file->path, mask, 0644); + } + + js_ResetBuffers(file); + JS_free(cx, mode); + mode = NULL; + + /* Set the open flag and return result */ + if (file->handle == NULL && file->nativehandle == NULL) { + file->isOpen = JS_FALSE; + + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_OP_FAILED, "open", file->path); + goto out; + } + +good: + file->isOpen = JS_TRUE; + *rval = JSVAL_TRUE; + return JS_TRUE; + +out: + if(mode) + JS_free(cx, mode); + return JS_FALSE; +} + +static JSBool +file_close(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + JSFile *file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + + SECURITY_CHECK(cx, NULL, "close", file); + + if(!file->isOpen){ + JS_ReportWarning(cx, "File %s is not open, can't close it, proceeding", + file->path); + goto out; + } + + if(!file->isPipe){ + if(file->isNative){ + JS_ReportWarning(cx, "Unable to close a native file, proceeding", file->path); + goto out; + }else{ + if(file->handle && PR_Close(file->handle)){ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_OP_FAILED, "close", file->path); + + goto out; + } + } + }else{ + if(PCLOSE(file->nativehandle)==-1){ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_OP_FAILED, "pclose", file->path); + goto out; + } + } + + js_ResetAttributes(file); + *rval = JSVAL_TRUE; + return JS_TRUE; + +out: + return JS_FALSE; +} + + +static JSBool +file_remove(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + JSFile *file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + + SECURITY_CHECK(cx, NULL, "remove", file); + JSFILE_CHECK_NATIVE("remove"); + JSFILE_CHECK_CLOSED("remove"); + + if ((js_isDirectory(cx, file) ? + PR_RmDir(file->path) : PR_Delete(file->path))==PR_SUCCESS) { + js_ResetAttributes(file); + *rval = JSVAL_TRUE; + return JS_TRUE; + } else { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_OP_FAILED, "remove", file->path); + goto out; + } +out: + *rval = JSVAL_FALSE; + return JS_FALSE; +} + +/* Raw PR-based function. No text processing. Just raw data copying. */ +static JSBool +file_copyTo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + JSFile *file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + char *dest = NULL; +#if defined(WITH_NSPR) + PRFileDesc *handle = NULL; +#else + FD_t handle = NULL; +#endif + char *buffer; + jsval count, size; + JSBool fileInitiallyOpen=JS_FALSE; + + SECURITY_CHECK(cx, NULL, "copyTo", file); /* may need a second argument!*/ + JSFILE_CHECK_ONE_ARG("copyTo"); + JSFILE_CHECK_NATIVE("copyTo"); + /* remeber the state */ + fileInitiallyOpen = file->isOpen; + JSFILE_CHECK_READ; + + dest = JS_GetStringBytes(JS_ValueToString(cx, argv[0])); + + /* make sure we are not reading a file open for writing */ + if (file->isOpen && !js_canRead(cx, file)) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_CANNOT_COPY_FILE_OPEN_FOR_WRITING_ERROR, file->path); + goto out; + } + + if (file->handle==NULL){ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_OP_FAILED, "open", file->path); + goto out; + } + + handle = PR_Open(dest, PR_WRONLY|PR_CREATE_FILE|PR_TRUNCATE, 0644); + + if(!handle){ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_OP_FAILED, "open", dest); + goto out; + } + + if ((size=js_size(cx, file))==JSVAL_VOID) { + goto out; + } + + buffer = JS_malloc(cx, size); + + count = INT_TO_JSVAL(PR_Read(file->handle, buffer, size)); + + /* reading panic */ + if (count!=size) { + JS_free(cx, buffer); + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_COPY_READ_ERROR, file->path); + goto out; + } + + count = INT_TO_JSVAL(PR_Write(handle, buffer, JSVAL_TO_INT(size))); + + /* writing panic */ + if (count!=size) { + JS_free(cx, buffer); + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_COPY_WRITE_ERROR, file->path); + goto out; + } + + JS_free(cx, buffer); + + if(!fileInitiallyOpen){ + if(!file_close(cx, obj, 0, NULL, rval)) goto out; + } + + if(PR_Close(handle)!=PR_SUCCESS){ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_OP_FAILED, "close", dest); + goto out; + } + + *rval = JSVAL_TRUE; + return JS_TRUE; +out: + if(file->isOpen && !fileInitiallyOpen){ + if(PR_Close(file->handle)!=PR_SUCCESS){ + JS_ReportWarning(cx, "Can't close %s, proceeding", file->path); + } + } + + if(handle && PR_Close(handle)!=PR_SUCCESS){ + JS_ReportWarning(cx, "Can't close %s, proceeding", dest); + } + + *rval = JSVAL_FALSE; + return JS_FALSE; +} + +static JSBool +file_renameTo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + JSFile *file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + char *dest; + + SECURITY_CHECK(cx, NULL, "renameTo", file); /* may need a second argument!*/ + JSFILE_CHECK_ONE_ARG("renameTo"); + JSFILE_CHECK_NATIVE("renameTo"); + JSFILE_CHECK_CLOSED("renameTo"); + + dest = RESOLVE_PATH(cx, JS_GetStringBytes(JS_ValueToString(cx, argv[0]))); + + if (PR_Rename(file->path, dest)==PR_SUCCESS){ + /* copy the new filename */ + JS_free(cx, file->path); + file->path = dest; + *rval = JSVAL_TRUE; + return JS_TRUE; + }else{ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_RENAME_FAILED, file->path, dest); + goto out; + } +out: + *rval = JSVAL_FALSE; + return JS_FALSE; +} + +static JSBool +file_flush(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + JSFile *file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + + SECURITY_CHECK(cx, NULL, "flush", file); + JSFILE_CHECK_NATIVE("flush"); + JSFILE_CHECK_OPEN("flush"); + +#if defined(WITH_NSPR) + if (PR_Sync(file->handle)==PR_SUCCESS) +#else + if (fsync(Fileno(file->handle)) == 0) +#endif + { + *rval = JSVAL_TRUE; + return JS_TRUE; + }else{ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_OP_FAILED, "flush", file->path); + goto out; + } +out: + *rval = JSVAL_FALSE; + return JS_FALSE; +} + +static JSBool +file_write(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + JSFile *file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + JSString *str; + int32 count; + uintN i; + + SECURITY_CHECK(cx, NULL, "write", file); + JSFILE_CHECK_WRITE; + + for (i = 0; itype); + if (count==-1){ + *rval = JSVAL_FALSE; + return JS_FALSE; + } + } + + *rval = JSVAL_TRUE; + return JS_TRUE; +out: + *rval = JSVAL_FALSE; + return JS_FALSE; +} + +static JSBool +file_writeln(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + JSFile *file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + JSString *str; + + SECURITY_CHECK(cx, NULL, "writeln", file); + JSFILE_CHECK_WRITE; + + /* don't report an error here */ + if(!file_write(cx, obj, argc, argv, rval)) return JS_FALSE; + /* don't do security here -- we passed the check in file_write */ + str = JS_NewStringCopyZ(cx, "\n"); + + if (js_FileWrite(cx, file, JS_GetStringChars(str), JS_GetStringLength(str), + file->type)==-1){ + *rval = JSVAL_FALSE; + return JS_FALSE; + } + + /* eol causes flush if hasAutoflush is turned on */ + if (file->hasAutoflush) + file_flush(cx, obj, 0, NULL, rval); + + *rval = JSVAL_TRUE; + return JS_TRUE; +out: + *rval = JSVAL_FALSE; + return JS_FALSE; +} + +static JSBool +file_writeAll(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + JSFile *file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + jsuint i; + jsuint limit; + JSObject *array; + JSObject *elem; + jsval elemval; + + SECURITY_CHECK(cx, NULL, "writeAll", file); + JSFILE_CHECK_ONE_ARG("writeAll"); + JSFILE_CHECK_WRITE; + + if (!JS_IsArrayObject(cx, JSVAL_TO_OBJECT(argv[0]))) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_FIRST_ARGUMENT_WRITEALL_NOT_ARRAY_ERROR); + goto out; + } + + array = JSVAL_TO_OBJECT(argv[0]); + + JS_GetArrayLength(cx, array, &limit); + + for (i = 0; i262144)?262144:want; * arbitrary size limitation */ + + buf = JS_malloc(cx, want*sizeof buf[0]); + if (!buf) goto out; + + count = js_FileRead(cx, file, buf, want, file->type); + if (count>0) { + str = JS_NewUCStringCopyN(cx, buf, count); + *rval = STRING_TO_JSVAL(str); + JS_free(cx, buf); + return JS_TRUE; + } else { + JS_free(cx, buf); + goto out; + } +out: + *rval = JSVAL_FALSE; + return JS_FALSE; +} + +static JSBool +file_readln(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + JSFile *file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + JSString *str; + jschar *buf = NULL, *tmp; + int32 offset, read; + intN room; + jschar data, data2; + + SECURITY_CHECK(cx, NULL, "readln", file); + JSFILE_CHECK_READ; + + buf = JS_malloc(cx, MAX_LINE_LENGTH * sizeof data); + if (!buf) + return JS_FALSE; + + room = MAX_LINE_LENGTH - 1; + offset = 0; + + for (;;) { + read = js_FileRead(cx, file, &data, 1, file->type); + if (read < 0) + goto out; + if (read == 0) + goto eof; + + switch (data) { + case '\r': + read = js_FileRead(cx, file, &data2, 1, file->type); + if (read < 0) + goto out; + + if (read == 1 && data2 != '\n') { + /* We read one char too far. Buffer it. */ + file->charBuffer = data2; + file->charBufferUsed = JS_TRUE; + } + + /* Fall through. */ + case '\n': + goto done; + + default: + if (--room < 0) { + tmp = JS_realloc(cx, buf, + (offset + MAX_LINE_LENGTH) * sizeof data); + if (!tmp) + goto out; + + room = MAX_LINE_LENGTH - 1; + buf = tmp; + } + + buf[offset++] = data; + break; + } + } + +eof: + if (offset == 0) { + *rval = JSVAL_NULL; + return JS_TRUE; + } + +done: + buf[offset] = 0; + tmp = JS_realloc(cx, buf, (offset + 1) * sizeof data); + if (!tmp) + goto out; + + str = JS_NewUCString(cx, tmp, offset); + if (!str) + goto out; + + *rval = STRING_TO_JSVAL(str); + return JS_TRUE; + +out: + if (buf) + JS_free(cx, buf); + + return JS_FALSE; +} + +static JSBool +file_readAll(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + JSFile *file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + JSObject *array; + jsint len; + jsval line; + JSBool lineok = JS_FALSE; + + SECURITY_CHECK(cx, NULL, "readAll", file); + JSFILE_CHECK_READ; + + array = JS_NewArrayObject(cx, 0, NULL); + if (!array) + return JS_FALSE; + *rval = OBJECT_TO_JSVAL(array); + + len = 0; + + lineok = file_readln(cx, obj, 0, NULL, &line); + while (lineok && !JSVAL_IS_NULL(line)) { + JS_SetElement(cx, array, len++, &line); + lineok = file_readln(cx, obj, 0, NULL, &line); + } + +out: + return lineok; +} + +static JSBool +file_seek(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + JSFile *file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + int32 toskip; + int32 pos; + + SECURITY_CHECK(cx, NULL, "seek", file); + JSFILE_CHECK_ONE_ARG("seek"); + JSFILE_CHECK_NATIVE("seek"); + JSFILE_CHECK_READ; + + if (!JS_ValueToInt32(cx, argv[0], &toskip)){ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_FIRST_ARGUMENT_MUST_BE_A_NUMBER, "seek", argv[0]); + goto out; + } + + if(!file->hasRandomAccess){ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_NO_RANDOM_ACCESS, file->path); + goto out; + } + + if(js_isDirectory(cx, file)){ + JS_ReportWarning(cx,"Seek on directories is not supported, proceeding"); + goto out; + } + + pos = js_FileSeek(cx, file, toskip, file->type); + + if (pos!=-1) { + *rval = INT_TO_JSVAL(pos); + return JS_TRUE; + } +out: + *rval = JSVAL_VOID; + return JS_FALSE; +} + +static JSBool +file_list(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + PRDir *dir; + PRDirEntry *entry; + JSFile *file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + JSObject *array; + JSObject *eachFile; + jsint len; + jsval v; + JSRegExp *re = NULL; + JSFunction *func = NULL; + JSString *str; + jsval args[1]; + char *filePath; + + SECURITY_CHECK(cx, NULL, "list", file); + JSFILE_CHECK_NATIVE("list"); + + if (argc==1) { + if (JSVAL_IS_REGEXP(cx, argv[0])) { + re = JS_GetPrivate(cx, JSVAL_TO_OBJECT(argv[0])); + }else + if (VALUE_IS_FUNCTION(cx, argv[0])) { + func = JS_GetPrivate(cx, JSVAL_TO_OBJECT(argv[0])); + }else{ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_FIRST_ARGUMENT_MUST_BE_A_FUNCTION_OR_REGEX, argv[0]); + goto out; + } + } + + if (!js_isDirectory(cx, file)) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_CANNOT_DO_LIST_ON_A_FILE, file->path); + goto out; + } + + dir = PR_OpenDir(file->path); + if(!dir){ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_OP_FAILED, "open", file->path); + goto out; + } + + /* create JSArray here... */ + array = JS_NewArrayObject(cx, 0, NULL); + len = 0; + + while ((entry = PR_ReadDir(dir, PR_SKIP_BOTH))!=NULL) { +#if !defined(WITH_NPRS) + if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..")) + continue; +#endif + /* first, check if we have a regexp */ + if (re!=NULL) { + size_t index = 0; + + str = JS_NewStringCopyZ(cx, entry->d_name); + if(!js_ExecuteRegExp(cx, re, str, &index, JS_TRUE, &v)){ + /* don't report anything here */ + goto out; + } + /* not matched! */ + if (JSVAL_IS_NULL(v)) { + continue; + } + }else + if (func!=NULL) { + str = JS_NewStringCopyZ(cx, entry->d_name); + args[0] = STRING_TO_JSVAL(str); + if(!JS_CallFunction(cx, obj, func, 1, args, &v)){ + goto out; + } + + if (v==JSVAL_FALSE) { + continue; + } + } + + filePath = js_combinePath(cx, file->path, (char*)entry->d_name); + + eachFile = js_NewFileObject(cx, filePath); + JS_free(cx, filePath); + if (!eachFile){ + JS_ReportWarning(cx, "File %s cannot be retrieved", filePath); + continue; + } + v = OBJECT_TO_JSVAL(eachFile); + JS_SetElement(cx, array, len, &v); + JS_SetProperty(cx, array, entry->d_name, &v); + len++; + } + + if(PR_CloseDir(dir)!=PR_SUCCESS){ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_OP_FAILED, "close", file->path); + goto out; + } + *rval = OBJECT_TO_JSVAL(array); + return JS_TRUE; +out: + *rval = JSVAL_NULL; + return JS_FALSE; +} + +static JSBool +file_mkdir(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + JSFile *file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + + SECURITY_CHECK(cx, NULL, "mkdir", file); + JSFILE_CHECK_ONE_ARG("mkdir"); + JSFILE_CHECK_NATIVE("mkdir"); + + /* if the current file is not a directory, find out the directory name */ + if (!js_isDirectory(cx, file)) { + char *dir = js_fileDirectoryName(cx, file->path); + JSObject *dirObj = js_NewFileObject(cx, dir); + + JS_free(cx, dir); + + /* call file_mkdir with the right set of parameters if needed */ + if (file_mkdir(cx, dirObj, argc, argv, rval)) + return JS_TRUE; + else + goto out; + }else{ + char *dirName = JS_GetStringBytes(JS_ValueToString(cx, argv[0])); + char *fullName; + + fullName = js_combinePath(cx, file->path, dirName); + if (PR_MkDir(fullName, 0755)==PR_SUCCESS){ + *rval = JSVAL_TRUE; + JS_free(cx, fullName); + return JS_TRUE; + }else{ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_OP_FAILED, "mkdir", fullName); + JS_free(cx, fullName); + goto out; + } + } +out: + *rval = JSVAL_FALSE; + return JS_FALSE; +} + +static JSBool +file_toString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval*rval) +{ + JSFile *file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + JSString *str; + + str = JS_NewStringCopyZ(cx, file->path); + if (!str) + return JS_FALSE; + *rval = STRING_TO_JSVAL(str); + return JS_TRUE; +} + +static JSBool +file_toURL(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + JSFile *file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + char url[MAX_PATH_LENGTH]; + jschar *urlChars; + size_t len; + JSString *str; + + JSFILE_CHECK_NATIVE("toURL"); + + sprintf(url, "file://%s", file->path); + + len = strlen(url); + urlChars = js_InflateString(cx, url, &len); + if (!urlChars) + return JS_FALSE; +#if JS_VERSION < 180 + str = js_NewString(cx, urlChars, len, 0); +#else + str = js_NewString(cx, urlChars, len); +#endif + if (!str) { + JS_free(cx, urlChars); + return JS_FALSE; + } + *rval = STRING_TO_JSVAL(str); + + /* TODO: js_escape in jsstr.h may go away at some point */ + return js_str_escape(cx, obj, 0, rval, rval); + +out: + *rval = JSVAL_VOID; + return JS_FALSE; +} + + +static void +file_finalize(JSContext *cx, JSObject *obj) +{ + JSFile *file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + + if(file) { + /* Close the file before exiting. */ + if(file->isOpen && !file->isNative) { + jsval vp; + file_close(cx, obj, 0, NULL, &vp); + } + + if (file->path) + JS_free(cx, file->path); + + JS_free(cx, file); + } +} + +/* + Allocates memory for the file object, sets fields to defaults. +*/ +static JSFile* +file_init(JSContext *cx, JSObject *obj, char *bytes) +{ + JSFile *file; + + file = JS_malloc(cx, sizeof *file); + if (!file) + return NULL; + memset(file, 0 , sizeof *file); + + js_ResetAttributes(file); + + file->path = RESOLVE_PATH(cx, bytes); + + if (!JS_SetPrivate(cx, obj, file)) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_CANNOT_SET_PRIVATE_FILE, file->path); + JS_free(cx, file); + return NULL; + } + + return file; +} + +/* Returns a JSObject. This function is globally visible */ +JS_PUBLIC_API(JSObject*) +js_NewFileObject(JSContext *cx, char *filename) +{ + JSObject *obj; + JSFile *file; + + obj = JS_NewObject(cx, &js_FileClass, NULL, NULL); + if (!obj){ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_OBJECT_CREATION_FAILED, "js_NewFileObject"); + return NULL; + } + file = file_init(cx, obj, filename); + if(!file) return NULL; + return obj; +} + +/* Internal function, used for cases which NSPR file support doesn't cover */ +/*XXX keep gcc happy */ +JSObject* +js_NewFileObjectFromFILE(JSContext *cx, FILE *nativehandle, char *filename, + int32 mode, JSBool open, JSBool randomAccess); +JSObject* +js_NewFileObjectFromFILE(JSContext *cx, FILE *nativehandle, char *filename, + int32 mode, JSBool open, JSBool randomAccess) +{ + JSObject *obj; + JSFile *file; + + obj = JS_NewObject(cx, &js_FileClass, NULL, NULL); + if (!obj){ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_OBJECT_CREATION_FAILED, "js_NewFileObjectFromFILE"); + return NULL; + } + file = file_init(cx, obj, filename); + if(!file) return NULL; + + file->nativehandle = nativehandle; + + /* free result of RESOLVE_PATH from file_init. */ + JS_ASSERT(file->path != NULL); + JS_free(cx, file->path); + + file->path = strdup(filename); + file->isOpen = open; + file->mode = mode; + file->hasRandomAccess = randomAccess; + file->isNative = JS_TRUE; + return obj; +} + +/* + Real file constructor that is called from JavaScript. + Basically, does error processing and calls file_init. +*/ +static JSBool +file_constructor(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, + jsval *rval) +{ + JSString *str; + JSFile *file; + + if (!(cx->fp->flags & JSFRAME_CONSTRUCTING)) { + /* Replace obj with a new File object. */ + obj = JS_NewObject(cx, &js_FileClass, NULL, NULL); + if (!obj) + return JS_FALSE; + *rval = OBJECT_TO_JSVAL(obj); + } + + str = (argc == 0) + ? JS_InternString(cx, "") + : JS_ValueToString(cx, argv[0]); + + if (!str) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_FIRST_ARGUMENT_CONSTRUCTOR_NOT_STRING_ERROR, + argv[0]); + return JS_FALSE; + } + + file = file_init(cx, obj, JS_GetStringBytes(str)); + if (!file) + return JS_FALSE; + + SECURITY_CHECK(cx, NULL, "constructor", file); + + return JS_TRUE; +} + +/* -------------------- File methods and properties ------------------------- */ +static JSFunctionSpec file_functions[] = { + { "open", file_open, 0}, + { "close", file_close, 0}, + { "remove", file_remove, 0}, + { "copyTo", file_copyTo, 0}, + { "renameTo", file_renameTo, 0}, + { "flush", file_flush, 0}, + { "seek", file_seek, 0}, + { "read", file_read, 0}, + { "readln", file_readln, 0}, + { "readAll", file_readAll, 0}, + { "write", file_write, 0}, + { "writeln", file_writeln, 0}, + { "writeAll", file_writeAll, 0}, + { "list", file_list, 0}, + { "mkdir", file_mkdir, 0}, + { "toString", file_toString, 0}, + { "toURL", file_toURL, 0}, + {0} +}; + +enum file_tinyid { + FILE_LENGTH = -2, + FILE_PARENT = -3, + FILE_PATH = -4, + FILE_NAME = -5, + FILE_ISDIR = -6, + FILE_ISFILE = -7, + FILE_EXISTS = -8, + FILE_CANREAD = -9, + FILE_CANWRITE = -10, + FILE_OPEN = -11, + FILE_TYPE = -12, + FILE_MODE = -13, + FILE_CREATED = -14, + FILE_MODIFIED = -15, + FILE_SIZE = -16, + FILE_RANDOMACCESS = -17, + FILE_POSITION = -18, + FILE_APPEND = -19, + FILE_REPLACE = -20, + FILE_AUTOFLUSH = -21, + FILE_ISNATIVE = -22, +}; + +static JSPropertySpec file_props[] = { + {"length", FILE_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY }, + {"parent", FILE_PARENT, JSPROP_ENUMERATE | JSPROP_READONLY }, + {"path", FILE_PATH, JSPROP_ENUMERATE | JSPROP_READONLY }, + {"name", FILE_NAME, JSPROP_ENUMERATE | JSPROP_READONLY }, + {"isDirectory", FILE_ISDIR, JSPROP_ENUMERATE | JSPROP_READONLY }, + {"isFile", FILE_ISFILE, JSPROP_ENUMERATE | JSPROP_READONLY }, + {"exists", FILE_EXISTS, JSPROP_ENUMERATE | JSPROP_READONLY }, + {"canRead", FILE_CANREAD, JSPROP_ENUMERATE | JSPROP_READONLY }, + {"canWrite", FILE_CANWRITE, JSPROP_ENUMERATE | JSPROP_READONLY }, + {"canAppend", FILE_APPEND, JSPROP_ENUMERATE | JSPROP_READONLY }, + {"canReplace", FILE_REPLACE, JSPROP_ENUMERATE | JSPROP_READONLY }, + {"isOpen", FILE_OPEN, JSPROP_ENUMERATE | JSPROP_READONLY }, + {"type", FILE_TYPE, JSPROP_ENUMERATE | JSPROP_READONLY }, + {"mode", FILE_MODE, JSPROP_ENUMERATE | JSPROP_READONLY }, + {"creationTime", FILE_CREATED, JSPROP_ENUMERATE | JSPROP_READONLY }, + {"lastModified", FILE_MODIFIED, JSPROP_ENUMERATE | JSPROP_READONLY }, + {"size", FILE_SIZE, JSPROP_ENUMERATE | JSPROP_READONLY }, + {"hasRandomAccess", FILE_RANDOMACCESS, JSPROP_ENUMERATE | JSPROP_READONLY }, + {"hasAutoFlush", FILE_AUTOFLUSH, JSPROP_ENUMERATE | JSPROP_READONLY }, + {"position", FILE_POSITION, JSPROP_ENUMERATE }, + {"isNative", FILE_ISNATIVE, JSPROP_ENUMERATE | JSPROP_READONLY }, + {0} +}; + +/* ------------------------- Property getter/setter ------------------------- */ +static JSBool +file_getProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) +{ + JSFile *file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + char *bytes; + JSString *str; + jsint tiny; + JSBool flag; +#if defined(WITH_NSPR) + PRFileInfo info; + PRExplodedTime expandedTime; +#endif + + tiny = JSVAL_TO_INT(id); + if (!file) + return JS_TRUE; + + switch (tiny) { + case FILE_PARENT: + SECURITY_CHECK(cx, NULL, "parent", file); + if (!js_parent(cx, file, vp)) + return JS_FALSE; + break; + case FILE_PATH: + str = JS_NewStringCopyZ(cx, file->path); + if (!str) + return JS_FALSE; + *vp = STRING_TO_JSVAL(str); + break; + case FILE_NAME: + if (!js_name(cx, file, vp)) + return JS_FALSE; + break; + case FILE_ISDIR: + SECURITY_CHECK(cx, NULL, "isDirectory", file); + *vp = BOOLEAN_TO_JSVAL(js_isDirectory(cx, file)); + break; + case FILE_ISFILE: + SECURITY_CHECK(cx, NULL, "isFile", file); + *vp = BOOLEAN_TO_JSVAL(js_isFile(cx, file)); + break; + case FILE_EXISTS: + SECURITY_CHECK(cx, NULL, "exists", file); + *vp = BOOLEAN_TO_JSVAL(js_exists(cx, file)); + break; + case FILE_ISNATIVE: + SECURITY_CHECK(cx, NULL, "isNative", file); + *vp = BOOLEAN_TO_JSVAL(file->isNative); + break; + case FILE_CANREAD: + SECURITY_CHECK(cx, NULL, "canRead", file); + *vp = BOOLEAN_TO_JSVAL(js_canRead(cx, file)); + break; + case FILE_CANWRITE: + SECURITY_CHECK(cx, NULL, "canWrite", file); + *vp = BOOLEAN_TO_JSVAL(js_canWrite(cx, file)); + break; + case FILE_OPEN: + SECURITY_CHECK(cx, NULL, "isOpen", file); + *vp = BOOLEAN_TO_JSVAL(file->isOpen); + break; + case FILE_APPEND : + SECURITY_CHECK(cx, NULL, "canAppend", file); + JSFILE_CHECK_OPEN("canAppend"); + *vp = BOOLEAN_TO_JSVAL(!file->isNative && + (file->mode&PR_APPEND)==PR_APPEND); + break; + case FILE_REPLACE : + SECURITY_CHECK(cx, NULL, "canReplace", file); + JSFILE_CHECK_OPEN("canReplace"); + *vp = BOOLEAN_TO_JSVAL(!file->isNative && + (file->mode&PR_TRUNCATE)==PR_TRUNCATE); + break; + case FILE_AUTOFLUSH : + SECURITY_CHECK(cx, NULL, "hasAutoFlush", file); + JSFILE_CHECK_OPEN("hasAutoFlush"); + *vp = BOOLEAN_TO_JSVAL(!file->isNative && file->hasAutoflush); + break; + case FILE_TYPE: + SECURITY_CHECK(cx, NULL, "type", file); + JSFILE_CHECK_OPEN("type"); + if(js_isDirectory(cx, file)){ + *vp = JSVAL_VOID; + break; + } + + switch (file->type) { + case ASCII: + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, asciistring)); + break; + case UTF8: + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, utfstring)); + break; + case UCS2: + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, unicodestring)); + break; + default: + JS_ReportWarning(cx, "Unsupported file type %d, proceeding", + file->type); + } + break; + case FILE_MODE: + SECURITY_CHECK(cx, NULL, "mode", file); + JSFILE_CHECK_OPEN("mode"); + bytes = JS_malloc(cx, MODE_SIZE); + bytes[0] = '\0'; + flag = JS_FALSE; + + if ((file->mode&PR_RDONLY)==PR_RDONLY) { + if (flag) strcat(bytes, ","); + strcat(bytes, "read"); + flag = JS_TRUE; + } + if ((file->mode&PR_WRONLY)==PR_WRONLY) { + if (flag) strcat(bytes, ","); + strcat(bytes, "write"); + flag = JS_TRUE; + } + if ((file->mode&PR_RDWR)==PR_RDWR) { + if (flag) strcat(bytes, ","); + strcat(bytes, "readWrite"); + flag = JS_TRUE; + } + if ((file->mode&PR_APPEND)==PR_APPEND) { + if (flag) strcat(bytes, ","); + strcat(bytes, "append"); + flag = JS_TRUE; + } + if ((file->mode&PR_CREATE_FILE)==PR_CREATE_FILE) { + if (flag) strcat(bytes, ","); + strcat(bytes, "create"); + flag = JS_TRUE; + } + if ((file->mode&PR_TRUNCATE)==PR_TRUNCATE) { + if (flag) strcat(bytes, ","); + strcat(bytes, "replace"); + flag = JS_TRUE; + } + if (file->hasAutoflush) { + if (flag) strcat(bytes, ","); + strcat(bytes, "hasAutoFlush"); + flag = JS_TRUE; + } + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, bytes)); + JS_free(cx, bytes); + break; + case FILE_CREATED: + SECURITY_CHECK(cx, NULL, "creationTime", file); + JSFILE_CHECK_NATIVE("creationTime"); +#if defined(WITH_NSPR) + if(((file->isOpen)? + PR_GetOpenFileInfo(file->handle, &info): + PR_GetFileInfo(file->path, &info))!=PR_SUCCESS){ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_CANNOT_ACCESS_FILE_STATUS, file->path); + goto out; + } + + PR_ExplodeTime(info.creationTime, PR_LocalTimeParameters,&expandedTime); + *vp = OBJECT_TO_JSVAL(js_NewDateObject(cx, expandedTime.tm_year, + expandedTime.tm_month, + expandedTime.tm_mday, + expandedTime.tm_hour, + expandedTime.tm_min, + expandedTime.tm_sec)); +#else + { struct stat sb; + struct tm *tm; + int rc = file->isOpen + ? Fstat(file->handle, &sb) : Stat(file->path, &sb); + if (rc < 0) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_CANNOT_ACCESS_FILE_STATUS, file->path); + goto out; + } + tm = gmtime((time_t *)&sb.st_ctime); + *vp = OBJECT_TO_JSVAL(js_NewDateObject(cx, + tm->tm_year, + tm->tm_mon, + tm->tm_mday, + tm->tm_hour, + tm->tm_min, + tm->tm_sec)); + } +#endif + break; + case FILE_MODIFIED: + SECURITY_CHECK(cx, NULL, "lastModified", file); + JSFILE_CHECK_NATIVE("lastModified"); +#if defined(WITH_NSPR) + if(((file->isOpen)? + PR_GetOpenFileInfo(file->handle, &info): + PR_GetFileInfo(file->path, &info))!=PR_SUCCESS){ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_CANNOT_ACCESS_FILE_STATUS, file->path); + goto out; + } + + PR_ExplodeTime(info.modifyTime, PR_LocalTimeParameters, &expandedTime); + *vp = OBJECT_TO_JSVAL(js_NewDateObject(cx, expandedTime.tm_year, + expandedTime.tm_month, + expandedTime.tm_mday, + expandedTime.tm_hour, + expandedTime.tm_min, + expandedTime.tm_sec)); +#else + { struct stat sb; + struct tm *tm; + int rc = file->isOpen + ? Fstat(file->handle, &sb) : Stat(file->path, &sb); + if (rc < 0) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_CANNOT_ACCESS_FILE_STATUS, file->path); + goto out; + } + tm = gmtime((time_t *)&sb.st_mtime); + *vp = OBJECT_TO_JSVAL(js_NewDateObject(cx, + tm->tm_year, + tm->tm_mon, + tm->tm_mday, + tm->tm_hour, + tm->tm_min, + tm->tm_sec)); + } +#endif + break; + case FILE_SIZE: + SECURITY_CHECK(cx, NULL, "size", file); + *vp = js_size(cx, file); + break; + case FILE_LENGTH: + SECURITY_CHECK(cx, NULL, "length", file); + JSFILE_CHECK_NATIVE("length"); + + if (js_isDirectory(cx, file)) { /* XXX debug me */ + PRDir *dir; + PRDirEntry *entry; + jsint count = 0; + + if(!(dir = PR_OpenDir(file->path))){ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_CANNOT_OPEN_DIR, file->path); + goto out; + } + + while ((entry = PR_ReadDir(dir, PR_SKIP_BOTH))) { + count++; + } + + if(!PR_CloseDir(dir)){ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_OP_FAILED, "close", file->path); + + goto out; + } + + *vp = INT_TO_JSVAL(count); + break; + }else{ + /* return file size */ + *vp = js_size(cx, file); + } + break; + case FILE_RANDOMACCESS: + SECURITY_CHECK(cx, NULL, "hasRandomAccess", file); + JSFILE_CHECK_OPEN("hasRandomAccess"); + *vp = BOOLEAN_TO_JSVAL(file->hasRandomAccess); + break; + case FILE_POSITION: + SECURITY_CHECK(cx, NULL, "position", file); + JSFILE_CHECK_NATIVE("position"); + JSFILE_CHECK_OPEN("position"); + + if(!file->hasRandomAccess){ + JS_ReportWarning(cx, "File %s doesn't support random access, can't report the position, proceeding"); + *vp = JSVAL_VOID; + break; + } + + if (file->isOpen && js_isFile(cx, file)) { +#if defined(WITH_NSPR) + int pos = PR_Seek(file->handle, 0, PR_SEEK_CUR); +#else + int pos = lseek(Fileno(file->handle), 0, SEEK_CUR); +#endif + if(pos!=-1){ + *vp = INT_TO_JSVAL(pos); + }else{ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_CANNOT_REPORT_POSITION, file->path); + goto out; + } + }else { + JS_ReportWarning(cx, "File %s is closed or not a plain file," + " can't report position, proceeding"); + goto out; + } + break; + default: + SECURITY_CHECK(cx, NULL, "file_access", file); + + /* this is some other property -- try to use the dir["file"] syntax */ + if (js_isDirectory(cx, file)) { + PRDir *dir = NULL; + PRDirEntry *entry = NULL; + char *prop_name; + + str = JS_ValueToString(cx, id); + if (!str) + return JS_FALSE; + + prop_name = JS_GetStringBytes(str); + + /* no native files past this point */ + dir = PR_OpenDir(file->path); + if(!dir) { + /* This is probably not a directory */ + JS_ReportWarning(cx, "Can't open directory %s", file->path); + return JS_FALSE; + } + + while ((entry = PR_ReadDir(dir, PR_SKIP_NONE)) != NULL) { + if (!strcmp(entry->d_name, prop_name)){ + bytes = js_combinePath(cx, file->path, prop_name); + *vp = OBJECT_TO_JSVAL(js_NewFileObject(cx, bytes)); + PR_CloseDir(dir); + JS_free(cx, bytes); + return !JSVAL_IS_NULL(*vp); + } + } + PR_CloseDir(dir); + } + } + return JS_TRUE; + +out: + return JS_FALSE; +} + +static JSBool +file_setProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) +{ + JSFile *file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + jsint slot; + + if (JSVAL_IS_STRING(id)){ + return JS_TRUE; + } + + slot = JSVAL_TO_INT(id); + + switch (slot) { + /* File.position = 10 */ + case FILE_POSITION: + SECURITY_CHECK(cx, NULL, "set_position", file); + JSFILE_CHECK_NATIVE("set_position"); + + if(!file->hasRandomAccess){ + JS_ReportWarning(cx, "File %s doesn't support random access, can't " + "report the position, proceeding"); + goto out; + } + + if (file->isOpen && js_isFile(cx, file)) { + int32 pos; + int32 offset; + + if (!JS_ValueToInt32(cx, *vp, &offset)){ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_FIRST_ARGUMENT_MUST_BE_A_NUMBER, "position", *vp); + goto out; + } + +#if defined(WITH_NSPR) + pos = PR_Seek(file->handle, offset, PR_SEEK_SET); +#else + pos = lseek(Fileno(file->handle), offset, SEEK_SET); +#endif + + if(pos!=-1){ + *vp = INT_TO_JSVAL(pos); + }else{ + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_CANNOT_SET_POSITION, file->path); + goto out; + } + } else { + JS_ReportWarning(cx, "File %s is closed or not a file, can't set " + "position, proceeding", file->path); + goto out; + } + } + + return JS_TRUE; +out: + return JS_FALSE; +} + +/* + File.currentDir = new File("D:\") or File.currentDir = "D:\" +*/ +static JSBool +file_currentDirSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) +{ + JSFile *file; + int xx; + + file = JS_GetInstancePrivate(cx, obj, &js_FileClass, NULL); + + /* Look at the rhs and extract a file object from it */ + if (JSVAL_IS_OBJECT(*vp)) { + if (JS_InstanceOf(cx, obj, &js_FileClass, NULL)) { + /* Braindamaged rhs -- just return the old value */ + if (file && (!js_exists(cx, file) || !js_isDirectory(cx, file))) { + JS_GetProperty(cx, obj, CURRENTDIR_PROPERTY, vp); + return JS_FALSE; + } else { + xx = chdir(file->path); + return JS_TRUE; + } + } else { + return JS_FALSE; + } + } else { + JSObject *rhsObject; + char *path; + + path = JS_GetStringBytes(JS_ValueToString(cx, *vp)); + rhsObject = js_NewFileObject(cx, path); + if (!rhsObject) + return JS_FALSE; + + if (!file || !js_exists(cx, file) || !js_isDirectory(cx, file)){ + JS_GetProperty(cx, obj, CURRENTDIR_PROPERTY, vp); + } else { + *vp = OBJECT_TO_JSVAL(rhsObject); + xx = chdir(path); + } + } + + return JS_TRUE; +} + +/* Declare class */ +JSClass js_FileClass = { + "File", JSCLASS_HAS_PRIVATE | JSCLASS_HAS_CACHED_PROTO(JSProto_File), + JS_PropertyStub, JS_PropertyStub, file_getProperty, file_setProperty, + JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, file_finalize +}; + +/* -------------------- Functions exposed to the outside -------------------- */ +JS_PUBLIC_API(JSObject*) +js_InitFileClass(JSContext *cx, JSObject* obj) +{ + JSObject *file, *ctor, *afile; + jsval vp; + char *currentdir; + char separator[2]; + + file = JS_InitClass(cx, obj, NULL, &js_FileClass, file_constructor, 1, + file_props, file_functions, NULL, NULL); + if (!file) { + JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL, + JSFILEMSG_INIT_FAILED); + return NULL; + } + + ctor = JS_GetConstructor(cx, file); + if (!ctor) return NULL; + + /* Define CURRENTDIR property. We are doing this to get a + slash at the end of the current dir */ + afile = js_NewFileObject(cx, CURRENT_DIR); + currentdir = JS_malloc(cx, MAX_PATH_LENGTH); + currentdir = getcwd(currentdir, MAX_PATH_LENGTH); + afile = js_NewFileObject(cx, currentdir); + JS_free(cx, currentdir); + vp = OBJECT_TO_JSVAL(afile); + JS_DefinePropertyWithTinyId(cx, ctor, CURRENTDIR_PROPERTY, 0, vp, + JS_PropertyStub, file_currentDirSetter, + JSPROP_ENUMERATE | JSPROP_READONLY ); + + /* Define input */ + vp = OBJECT_TO_JSVAL(js_NewFileObjectFromFILE(cx, stdin, + STDINPUT_NAME, PR_RDONLY, JS_TRUE, JS_FALSE)); + JS_SetProperty(cx, ctor, "input", &vp); + + /* Define output */ + vp = OBJECT_TO_JSVAL(js_NewFileObjectFromFILE(cx, stdout, + STDOUTPUT_NAME, PR_WRONLY, JS_TRUE, JS_FALSE)); + JS_SetProperty(cx, ctor, "output", &vp); + + /* Define error */ + vp = OBJECT_TO_JSVAL(js_NewFileObjectFromFILE(cx, stderr, + STDERROR_NAME, PR_WRONLY, JS_TRUE, JS_FALSE)); + JS_SetProperty(cx, ctor, "error", &vp); + + separator[0] = FILESEPARATOR; + separator[1] = '\0'; + vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, separator)); + JS_DefinePropertyWithTinyId(cx, ctor, SEPARATOR_PROPERTY, 0, vp, + JS_PropertyStub, JS_PropertyStub, + JSPROP_ENUMERATE | JSPROP_READONLY ); + return file; +} +#endif /* JS_HAS_FILE_OBJECT */ +#endif diff --git a/rpm-5.4.9/js/rpmjsfile.h b/rpm-5.4.9/js/rpmjsfile.h new file mode 100644 index 0000000..fd60ace --- /dev/null +++ b/rpm-5.4.9/js/rpmjsfile.h @@ -0,0 +1,65 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla Communicator client code, released + * March 31, 1998. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either of the GNU General Public License Version 2 or later (the "GPL"), + * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef _jsfile_h__ +#define _jsfile_h__ + +extern JSClass js_FileClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JS_PUBLIC_API(JSObject*) +js_InitFileClass(JSContext *cx, JSObject* obj); + +extern JS_PUBLIC_API(JSObject*) +js_NewFileObject(JSContext *cx, char *bytes); + +#ifdef NOTYET +extern JS_PUBLIC(JSObject*) +js_NewFileObjectFromFILE(JSContext *cx, FILE *nativehandle, char *filename, + int32 mode, JSBool open, JSBool randomAccess); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _jsfile_h__ */ diff --git a/rpm-5.4.9/js/rpmjsfile.msg b/rpm-5.4.9/js/rpmjsfile.msg new file mode 100644 index 0000000..137b35d --- /dev/null +++ b/rpm-5.4.9/js/rpmjsfile.msg @@ -0,0 +1,90 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla Communicator client code, released + * March 31, 1998. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either of the GNU General Public License Version 2 or later (the "GPL"), + * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +/* + Error messages for jsfile.c. See js.msg for format specification. +*/ + +MSG_DEF(JSFILEMSG_NOT_AN_ERROR, 0, 0, JSEXN_NONE, "") +MSG_DEF(JSFILEMSG_FILE_CONSTRUCTOR_UNDEFINED_ERROR, 1, 0, JSEXN_NONE, "File constructor is undefined") +MSG_DEF(JSFILEMSG_FILE_CURRENTDIR_UNDEFINED_ERROR, 2, 0, JSEXN_NONE, "File.currentDir is undefined") +MSG_DEF(JSFILEMSG_FIRST_ARGUMENT_OPEN_NOT_STRING_ERROR, 3, 1, JSEXN_NONE, "The first argument {0} to file.open must be a string") +MSG_DEF(JSFILEMSG_SECOND_ARGUMENT_OPEN_NOT_STRING_ERROR, 4, 0, JSEXN_NONE, "The second argument to file.open must be a string") +MSG_DEF(JSFILEMSG_CANNOT_COPY_FILE_OPEN_FOR_WRITING_ERROR, 5, 1, JSEXN_NONE, "Cannot copy file {0} open for writing") +MSG_DEF(JSFILEMSG_CANNOT_ACCESS_FILE_INFO_ERROR, 6, 1, JSEXN_NONE, "Cannot access file information for {0}") +MSG_DEF(JSFILEMSG_COPY_READ_ERROR, 7, 1, JSEXN_NONE, "An error occured while attempting to read a file {0} to copy") +MSG_DEF(JSFILEMSG_COPY_WRITE_ERROR, 8, 1, JSEXN_NONE, "An error occured while attempting to copy into file {0}") +MSG_DEF(JSFILEMSG_EXPECTS_ONE_ARG_ERROR, 9, 0, JSEXN_NONE, "Operation {0} expects one argument, not {1}") +MSG_DEF(JSFILEMSG_CANNOT_FLUSH_CLOSE_FILE_ERROR, 10, 1, JSEXN_NONE, "Cannot flush closed file {0}") +MSG_DEF(JSFILEMSG_CANNOT_OPEN_WRITING_ERROR, 11, 1, JSEXN_NONE, "Cannot open file {0} for writing") +MSG_DEF(JSFILEMSG_WRITEALL_EXPECTS_ONE_ARG_ERROR, 12, 0, JSEXN_NONE, "writeAll expects one argument") +MSG_DEF(JSFILEMSG_FIRST_ARGUMENT_WRITEALL_NOT_ARRAY_ERROR, 13, 0, JSEXN_NONE, "writeAll expects an array as an argument") +MSG_DEF(JSFILEMSG_UNUSED0, 14, 0, JSEXN_NONE, "Unused error message slot") +MSG_DEF(JSFILEMSG_CANNOT_OPEN_FILE_ERROR, 15, 1, JSEXN_NONE, "Cannot open file {0}") +MSG_DEF(JSFILEMSG_FIRST_ARGUMENT_CONSTRUCTOR_NOT_STRING_ERROR, 16, 1, JSEXN_NONE, "The argument to the File constructor {0} must be a string") +MSG_DEF(JSFILEMSG_BIDIRECTIONAL_PIPE_NOT_SUPPORTED, 17, 0, JSEXN_NONE, "Bidirectional pipes are not supported") +MSG_DEF(JSFILEMSG_OPEN_MODE_NOT_SUPPORTED_WITH_PIPES, 18, 2, JSEXN_NONE, "The opening mode you have chosen {0} is not supported by the pipe you are trying to open: {1}") +MSG_DEF(JSFILEMSG_OPEN_FAILED, 19, 1, JSEXN_NONE, "open on file {0} failed") +MSG_DEF(JSFILEMSG_CLOSE_FAILED, 20, 1, JSEXN_NONE, "close on file {0} failed") +MSG_DEF(JSFILEMSG_PCLOSE_FAILED, 21, 1, JSEXN_NONE, "pclose on file {0} failed") +MSG_DEF(JSFILEMSG_REMOVE_FAILED, 22, 1, JSEXN_NONE, "remove on file {0} failed") +MSG_DEF(JSFILEMSG_CANNOT_ACCESS_FILE_STATUS, 23, 1, JSEXN_NONE, "Cannot access file status for {0}") +MSG_DEF(JSFILEMSG_RENAME_FAILED, 24, 2, JSEXN_NONE, "Cannot rename {0} to {1}") +MSG_DEF(JSFILEMSG_WRITE_FAILED, 25, 1, JSEXN_NONE, "Write failed on file {0}") +MSG_DEF(JSFILEMSG_READ_FAILED, 26, 1, JSEXN_NONE, "Read failed on file {0}") +MSG_DEF(JSFILEMSG_SKIP_FAILED, 27, 1, JSEXN_NONE, "Skip failed on file {0}") +MSG_DEF(JSFILEMSG_FIRST_ARGUMENT_MUST_BE_A_FUNCTION_OR_REGEX, 28, 1, JSEXN_NONE, "The first argument to file.list must be a function or a regex") +MSG_DEF(JSFILEMSG_CANNOT_DO_LIST_ON_A_FILE, 29, 1, JSEXN_NONE, "{0} must be a directory, cannot do list") +MSG_DEF(JSFILEMSG_NATIVE_OPERATION_IS_NOT_SUPPORTED, 30, 2, JSEXN_NONE, "Native operation {0} is not supported on {1}") +MSG_DEF(JSFILEMSG_CANNOT_SET_PRIVATE_FILE, 31, 1, JSEXN_NONE, "Cannot set private data for file {0}") +MSG_DEF(JSFILEMSG_FIRST_ARGUMENT_MUST_BE_A_NUMBER, 32, 2, JSEXN_NONE, "First argument to {0} must be a number, not {1}") +MSG_DEF(JSFILEMSG_CANNOT_WRITE, 33, 1, JSEXN_NONE, "Cannot write to {0}, file mode is different") +MSG_DEF(JSFILEMSG_CANNOT_READ, 34, 1, JSEXN_NONE, "Cannot read from {0}, file mode is different") +MSG_DEF(JSFILEMSG_CANNOT_FLUSH, 35, 1, JSEXN_NONE, "Flush failed on {0}") +MSG_DEF(JSFILEMSG_OP_FAILED, 36, 1, JSEXN_NONE, "File operation {0} failed") +MSG_DEF(JSFILEMSG_FILE_MUST_BE_OPEN, 37, 1, JSEXN_NONE, "File must be open for {0}") +MSG_DEF(JSFILEMSG_FILE_MUST_BE_CLOSED, 38, 1, JSEXN_NONE, "File must be closed for {0}") +MSG_DEF(JSFILEMSG_NO_RANDOM_ACCESS, 39, 1, JSEXN_NONE, "File {0} doesn't allow random access") +MSG_DEF(JSFILEMSG_OBJECT_CREATION_FAILED, 40, 1, JSEXN_NONE, "Couldn't create {0}") +MSG_DEF(JSFILEMSG_CANNOT_OPEN_DIR, 41, 1, JSEXN_NONE, "Couldn't open directory {0}") +MSG_DEF(JSFILEMSG_CANNOT_REPORT_POSITION, 42, 1, JSEXN_NONE, "Couldn't report position for {0}") +MSG_DEF(JSFILEMSG_CANNOT_SET_POSITION, 43, 1, JSEXN_NONE, "Couldn't set position for {0}") +MSG_DEF(JSFILEMSG_INIT_FAILED, 44, 0, JSEXN_NONE, "File class initialization failed") + + diff --git a/rpm-5.4.9/js/rpmmc-js.c b/rpm-5.4.9/js/rpmmc-js.c new file mode 100644 index 0000000..ead9a87 --- /dev/null +++ b/rpm-5.4.9/js/rpmmc-js.c @@ -0,0 +1,364 @@ +/** \ingroup js_c + * \file js/rpmmc-js.c + */ + +#include "system.h" + +#include "rpmmc-js.h" +#include "rpmjs-debug.h" + +#define _MACRO_INTERNAL +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +#define rpmmc_addprop JS_PropertyStub +#define rpmmc_delprop JS_PropertyStub +#define rpmmc_convert JS_ConvertStub + +typedef MacroContext rpmmc; + +/* --- helpers */ + +/* --- Object methods */ +static JSBool +rpmmc_add(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmcClass, NULL); + rpmmc mc = ptr; + char * s = NULL; + int lvl = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &s))) + goto exit; + + (void) rpmDefineMacro(mc, s, lvl); + ok = JS_TRUE; +exit: + *vp = BOOLEAN_TO_JSVAL(ok); + return ok; +} + +static JSBool +rpmmc_del(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmcClass, NULL); + rpmmc mc = ptr; + char * s = NULL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &s))) + goto exit; + + (void) rpmUndefineMacro(mc, s); + ok = JS_TRUE; +exit: + *vp = BOOLEAN_TO_JSVAL(ok); + return ok; +} + +static JSBool +rpmmc_list(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmcClass, NULL); + rpmmc mc = ptr; + void * _mire = NULL; + int used = -1; + const char ** av = NULL; + int ac = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + +/*@-globs@*/ + ac = rpmGetMacroEntries(mc, _mire, used, &av); +/*@=globs@*/ + if (ac > 0 && av != NULL && av[0] != NULL) { + jsval *vec = xmalloc(ac * sizeof(*vec)); + JSString *valstr; + int i; + for (i = 0; i < ac; i++) { + /* XXX lua splits into {name,opts,body} triple. */ + if ((valstr = JS_NewStringCopyZ(cx, av[i])) == NULL) + goto exit; + vec[i] = STRING_TO_JSVAL(valstr); + } + *vp = OBJECT_TO_JSVAL(JS_NewArrayObject(cx, ac, vec)); + vec = _free(vec); + } else + *vp = JSVAL_NULL; /* XXX JSVAL_VOID? */ + + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmmc_expand(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmcClass, NULL); + rpmmc mc = ptr; + char * s; + char * t; + JSString *valstr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &s))) + goto exit; + + t = rpmMCExpand(mc, s, NULL); + + if ((valstr = JS_NewStringCopyZ(cx, t)) == NULL) + goto exit; + t = _free(t); + *vp = STRING_TO_JSVAL(valstr); + + ok = JS_TRUE; +exit: + return ok; +} + +static JSFunctionSpec rpmmc_funcs[] = { + JS_FS("add", rpmmc_add, 0,0), + JS_FS("del", rpmmc_del, 0,0), + JS_FS("list", rpmmc_list, 0,0), + JS_FS("expand", rpmmc_expand, 0,0), + JS_FS_END +}; + +/* --- Object properties */ +enum rpmmc_tinyid { + _DEBUG = -2, +}; + +static JSPropertySpec rpmmc_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmmc_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmcClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmmc_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmcClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmmc_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmcClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmmc_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static rpmmc +rpmmc_init(JSContext *cx, JSObject *obj, jsval v) +{ + rpmmc mc = NULL; /* XXX FIXME: only global context for now. */ + JSObject * o = (JSVAL_IS_OBJECT(v) ? JSVAL_TO_OBJECT(v) : NULL); + +if (_debug) +fprintf(stderr, "==> %s(%p,%p,%p) mc %p\n", __FUNCTION__, cx, obj, o, mc); + + if (JSVAL_IS_STRING(v)) { + const char * s = JS_EncodeString(cx, JS_ValueToString(cx, v)); + if (!strcmp(s, "global")) + mc = rpmGlobalMacroContext; + else if (!strcmp(s, "cli")) + mc = rpmCLIMacroContext; + else { + mc = xcalloc(1, sizeof(*mc)); + if (s && *s) + rpmInitMacros(mc, s); + } +if (_debug) +fprintf(stderr, "\tinitMacros(\"%s\") mc %p\n", s, mc); + s = _free(s); + } else + if (o == NULL) { +if (_debug) +fprintf(stderr, "\tinitMacros() mc %p\n", mc); + } + + if (!JS_SetPrivate(cx, obj, (void *)mc)) { + /* XXX error msg */ + return NULL; + } + return mc; +} + +static void +rpmmc_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmcClass, NULL); + rpmmc mc = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + if (!(mc == rpmGlobalMacroContext || mc == rpmCLIMacroContext)) { + rpmFreeMacros(mc); + mc = _free(mc); + } +} + +static JSBool +rpmmc_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + jsval v = JSVAL_VOID; + JSObject *o = NULL; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/v", &v))) + goto exit; + + if (JS_IsConstructing(cx, vp)) { + (void) rpmmc_init(cx, obj, v); + } else { + if ((obj = JS_NewObject(cx, &rpmmcClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass rpmmcClass = { + "Mc", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmmc_addprop, rpmmc_delprop, rpmmc_getprop, rpmmc_setprop, + (JSEnumerateOp)rpmmc_enumerate, (JSResolveOp)rpmmc_resolve, + rpmmc_convert, rpmmc_dtor, + JSCLASS_NO_OPTIONAL_MEMBERS +}; + +JSObject * +rpmjs_InitMcClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmmcClass, rpmmc_ctor, 1, + rpmmc_props, rpmmc_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewMcObject(JSContext *cx, jsval v) +{ + JSObject *obj; + rpmmc mc; + + if ((obj = JS_NewObject(cx, &rpmmcClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((mc = rpmmc_init(cx, obj, v)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmmc, Mc, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmmc-js.h b/rpm-5.4.9/js/rpmmc-js.h new file mode 100644 index 0000000..c91b167 --- /dev/null +++ b/rpm-5.4.9/js/rpmmc-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMMC_JS +#define H_RPMMC_JS + +/** + * \file js/rpmmc-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmmcClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitMcClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewMcObject(JSContext *cx, jsval v); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMMC_JS */ diff --git a/rpm-5.4.9/js/rpmmg-js.c b/rpm-5.4.9/js/rpmmg-js.c new file mode 100644 index 0000000..1b55b24 --- /dev/null +++ b/rpm-5.4.9/js/rpmmg-js.c @@ -0,0 +1,304 @@ +/** \ingroup js_c + * \file js/rpmmg-js.c + */ + +#include "system.h" + +#include "rpmmg-js.h" +#include "rpmjs-debug.h" + +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmmg_addprop JS_PropertyStub +#define rpmmg_delprop JS_PropertyStub +#define rpmmg_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmmg_getobjectops NULL +#define rpmmg_checkaccess NULL +#define rpmmg_call rpmmg_call +#define rpmmg_construct rpmmg_ctor +#define rpmmg_xdrobject NULL +#define rpmmg_hasinstance NULL +#define rpmmg_mark NULL +#define rpmmg_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmmg_equality NULL +#define rpmmg_outerobject NULL +#define rpmmg_innerobject NULL +#define rpmmg_iteratorobject NULL +#define rpmmg_wrappedobject NULL + +/* --- helpers */ + +/* --- Object methods */ + +static JSFunctionSpec rpmmg_funcs[] = { + JS_FS_END +}; + +/* --- Object properties */ +enum rpmmg_tinyid { + _DEBUG = -2, +}; + +static JSPropertySpec rpmmg_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmmg_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmgClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: *vp = INT_TO_JSVAL(_debug); break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmmg_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmgClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmmg_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmgClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmmg_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ +#ifdef NOTYET + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmgClass, NULL); + rpmmg mg = ptr; + struct dirent * dp; + unsigned int ix = 0; +#endif + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + +#ifdef NOTYET + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + if (idp) + *idp = JSVAL_ZERO; + *statep = INT_TO_JSVAL(ix); +if (_debug) +fprintf(stderr, "\tINIT mg %p\n", mg); + break; + case JSENUMERATE_NEXT: + ix = JSVAL_TO_INT(*statep); + if ((dp = Readdir(dir)) != NULL) { + (void) JS_DefineElement(cx, obj, + ix, STRING_TO_JSVAL(JS_NewStringCopyZ(cx, dp->d_name)), + NULL, NULL, JSPROP_ENUMERATE); + JS_ValueToId(cx, *statep, idp); +if (_debug) +fprintf(stderr, "\tNEXT mg %p[%u] dirent %p \"%s\"\n", mg, ix, dp, dp->d_name); + *statep = INT_TO_JSVAL(ix+1); + } else + *idp = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + ix = JSVAL_TO_INT(*statep); + (void) JS_DefineProperty(cx, obj, "length", INT_TO_JSVAL(ix), + NULL, NULL, JSPROP_ENUMERATE); +if (_debug) +fprintf(stderr, "\tFINI mg %p[%u]\n", mg, ix); + *statep = JSVAL_NULL; + break; + } +#else + *statep = JSVAL_NULL; +#endif + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static rpmmg +rpmmg_init(JSContext *cx, JSObject *obj, const char * _magicfile, int _flags) +{ + rpmmg mg = rpmmgNew(_magicfile, _flags); + + /* XXX error msg */ + if (!JS_SetPrivate(cx, obj, (void *)mg)) { + /* XXX error msg */ + if (mg) + mg = rpmmgFree(mg); + } + +if (_debug) +fprintf(stderr, "<== %s(%p,%p,\"%s\",0x%x) mg %p\n", __FUNCTION__, cx, obj, _magicfile, _flags, mg); + + return mg; +} + +static void +rpmmg_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmgClass, NULL); + rpmmg mg = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + (void) rpmmgFree(mg); +} + +static JSBool +rpmmg_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + const char * _magicfile = NULL; + int _flags = 0; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/su", &_magicfile, &_flags))) + goto exit; + + if (JS_IsConstructing(cx, vp)) { + (void) rpmmg_init(cx, obj, _magicfile, _flags); + } else { + if ((obj = JS_NewObject(cx, &rpmmgClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmmg_call(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + /* XXX obj is the global object so lookup "this" object. */ + JSObject * o = JSVAL_TO_OBJECT(argv[-2]); + void * ptr = JS_GetInstancePrivate(cx, o, &rpmmgClass, NULL); + rpmmg mg = ptr; + JSBool ok = JS_FALSE; + const char * _fn = NULL; + const char * s = NULL; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/s", &_fn))) + goto exit; + + if (mg) + s = rpmmgFile(mg, _fn); + *vp = (s ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, s)) : JSVAL_NULL); + + ok = JS_TRUE; + +exit: +if (_debug) +fprintf(stderr, "<== %s(%p,%p[%u],%p) o %p ptr %p\n", __FUNCTION__, cx, argv, (unsigned)argc, vp, o, mg); + s = _free(s); + return ok; +} + +/* --- Class initialization */ +JSClass rpmmgClass = { + /* XXX class should be "Magic" eventually, avoid name conflicts for now */ + "Mg", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmmg_addprop, rpmmg_delprop, rpmmg_getprop, rpmmg_setprop, + (JSEnumerateOp)rpmmg_enumerate, (JSResolveOp)rpmmg_resolve, + rpmmg_convert, rpmmg_dtor, + + rpmmg_getobjectops, rpmmg_checkaccess, + rpmmg_call, rpmmg_construct, + rpmmg_xdrobject, rpmmg_hasinstance, + rpmmg_mark, rpmmg_reserveslots, +}; + +JSObject * +rpmjs_InitMgClass(JSContext *cx, JSObject* obj) +{ + JSObject * proto = JS_InitClass(cx, obj, NULL, &rpmmgClass, rpmmg_ctor, 1, + rpmmg_props, rpmmg_funcs, NULL, NULL); + +if (_debug) +fprintf(stderr, "<== %s(%p,%p) proto %p\n", __FUNCTION__, cx, obj, proto); + +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewMgObject(JSContext *cx, const char * _magicfile, int _flags) +{ + JSObject *obj; + rpmmg mg; + + if ((obj = JS_NewObject(cx, &rpmmgClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((mg = rpmmg_init(cx, obj, _magicfile, _flags)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmmg, Mg, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmmg-js.h b/rpm-5.4.9/js/rpmmg-js.h new file mode 100644 index 0000000..1b7cb5c --- /dev/null +++ b/rpm-5.4.9/js/rpmmg-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMMG_JS +#define H_RPMMG_JS + +/** + * \file js/rpmmg-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmmgClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitMgClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewMgObject(JSContext *cx, const char * _magicfile, int _flags); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMMG_JS */ diff --git a/rpm-5.4.9/js/rpmmi-js.c b/rpm-5.4.9/js/rpmmi-js.c new file mode 100644 index 0000000..caba895 --- /dev/null +++ b/rpm-5.4.9/js/rpmmi-js.c @@ -0,0 +1,440 @@ +/** \ingroup js_c + * \file js/rpmmi-js.c + */ + +#include "system.h" + +#include "rpmts-js.h" +#include "rpmmi-js.h" +#include "rpmhdr-js.h" +#include "rpmjs-debug.h" + +#include +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +#define rpmmi_addprop JS_PropertyStub +#define rpmmi_delprop JS_PropertyStub +#define rpmmi_convert JS_ConvertStub + +/* --- helpers */ + +/* --- Object methods */ +static JSBool +rpmmi_pattern(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmiClass, NULL); + rpmmi mi = ptr; + jsval tagid = JSVAL_VOID; + int tag = RPMTAG_NAME; + rpmMireMode type = RPMMIRE_PCRE; + char * pattern = NULL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "vs/u", &tagid, &pattern, &type))) + goto exit; + + switch (type) { + default: + ok = JS_FALSE; + break; + case RPMMIRE_DEFAULT: + case RPMMIRE_STRCMP: + case RPMMIRE_REGEX: + case RPMMIRE_GLOB: + case RPMMIRE_PCRE: + if (!JSVAL_IS_VOID(tagid)) { + const char * s = JS_EncodeString(cx, JS_ValueToString(cx, tagid)); + /* XXX TODO: make sure both tag and key were specified. */ + tag = JSVAL_IS_INT(tagid) + ? (rpmTag) JSVAL_TO_INT(tagid) + : tagValue(s); + s = _free(s); + } + rpmmiAddPattern(mi, tag, type, pattern); + ok = JS_TRUE; + break; + } + *vp = BOOLEAN_TO_JSVAL(ok); + +exit: + return ok; +} + +static JSBool +rpmmi_prune(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmiClass, NULL); + rpmmi mi = ptr; + uint32_t _u = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "u", &_u))) + goto exit; + /* XXX handle arrays */ + if (!rpmmiPrune(mi, &_u, 1, 1)) + ok = JS_TRUE; + *vp = BOOLEAN_TO_JSVAL(ok); + +exit: + return ok; +} + +static JSBool +rpmmi_grow(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmiClass, NULL); + rpmmi mi = ptr; + uint32_t _u = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "u", &_u))) + goto exit; + /* XXX handle arrays */ + if (!rpmmiGrow(mi, &_u, 1)) + ok = JS_TRUE; + *vp = BOOLEAN_TO_JSVAL(ok); + +exit: + return ok; +} + +static JSBool +rpmmi_growbn(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmiClass, NULL); + rpmmi mi = ptr; + const char * _bn = NULL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_bn))) + goto exit; + /* XXX handle arrays */ + if (!rpmmiGrowBasename(mi, _bn)) + ok = JS_TRUE; + *vp = BOOLEAN_TO_JSVAL(ok); + +exit: + return ok; +} + +static JSFunctionSpec rpmmi_funcs[] = { + JS_FS("pattern", rpmmi_pattern, 0,0), + JS_FS("prune", rpmmi_prune, 0,0), + JS_FS("grow", rpmmi_grow, 0,0), + JS_FS("growbn", rpmmi_growbn, 0,0), + JS_FS_END +}; + +/* --- Object properties */ +enum rpmmi_tinyid { + _DEBUG = -2, + _LENGTH = -3, + _COUNT = -4, /* XXX is _LENGTH enuf? */ + _INSTANCE = -5, +}; + +static JSPropertySpec rpmmi_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {"length", _LENGTH, JSPROP_ENUMERATE, NULL, NULL}, + {"count", _COUNT, JSPROP_ENUMERATE, NULL, NULL}, + {"instance",_INSTANCE, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmmi_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmiClass, NULL); + rpmmi mi = ptr; + jsint tiny = JSVAL_TO_INT(id); + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + case _LENGTH: + case _COUNT: /* XXX is _LENGTH enuf? */ + *vp = INT_TO_JSVAL(rpmmiCount(mi)); + break; + case _INSTANCE: + *vp = INT_TO_JSVAL(rpmmiInstance(mi)); + break; + default: + { JSObject *o = (JSVAL_IS_OBJECT(id) ? JSVAL_TO_OBJECT(id) : NULL); + Header h = JS_GetInstancePrivate(cx, o, &rpmhdrClass, NULL); + rpmuint32_t ix = headerGetInstance(h); + if (ix != 0) { + *vp = id; +if (_debug) +fprintf(stderr, "\tGET %p[%d] h %p\n", mi, ix, h); + } + } break; + } + + return JS_TRUE; +} + +static JSBool +rpmmi_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmiClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmmi_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmiClass, NULL); + rpmmi mi = ptr; + JSObject *o = (JSVAL_IS_OBJECT(id) ? JSVAL_TO_OBJECT(id) : NULL); + JSClass *c = (o ? JS_GET_CLASS(cx, o) : NULL); + +_RESOLVE_DEBUG_ENTRY(_debug); + + if ((flags & JSRESOLVE_ASSIGNING) + || (mi == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + if (c == &rpmhdrClass) { + Header h = JS_GetInstancePrivate(cx, o, &rpmhdrClass, NULL); + rpmuint32_t ix = headerGetInstance(h); + if (ix == 0 + || !JS_DefineElement(cx, obj, ix, id, NULL, NULL, JSPROP_ENUMERATE)) + { + *objp = NULL; + goto exit; + } +if (_debug) +fprintf(stderr, "\tRESOLVE %p[%d] h %p\n", mi, ix, h); + *objp = obj; + } else + *objp = NULL; + +exit: + return JS_TRUE; +} + +static JSBool +rpmmi_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmiClass, NULL); + rpmmi mi = ptr; + Header h; + +_ENUMERATE_DEBUG_ENTRY(_debug); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; +if (_debug) +fprintf(stderr, "\tINIT mi %p\n", mi); + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; /* XXX needed? */ + if ((h = rpmmiNext(mi)) != NULL) { + h = headerLink(h); + JS_ValueToId(cx, OBJECT_TO_JSVAL(rpmjs_NewHdrObject(cx, h)), idp); +if (_debug) +fprintf(stderr, "\tNEXT mi %p h# %u %p\n", mi, (unsigned)headerGetInstance(h), h); + } else + *idp = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: +if (_debug) +fprintf(stderr, "\tFINI mi %p\n", mi); + /* XXX Allow our iterator object to be GC'd. */ + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static rpmmi +rpmmi_init(JSContext *cx, JSObject *obj, rpmts ts, int _tag, jsval v) +{ + rpmmi mi = NULL; + uint32_t _u = 0; + const char * s = NULL; + void * _key = NULL; + int _keylen = 0; + + if (JSVAL_IS_NULL(v) || JSVAL_IS_VOID(v)) { + _keylen = 0; + _key = NULL; + } else + if (JSVAL_IS_NUMBER(v)) { + if (!JS_ValueToECMAUint32(cx, v, &_u)) + goto exit; + _keylen = sizeof(_u); + _key = (void *) &_u; + } else + if (JSVAL_IS_STRING(v)) { + s = JS_EncodeString(cx, JS_ValueToString(cx, v)); + _keylen = strlen(s); + _key = (void *)s; + } else + /* XXX TODO: handle key object as binary octet string. */ + goto exit; + + if ((mi = rpmtsInitIterator(ts, _tag, _key, _keylen)) == NULL) + goto exit; + if (!JS_SetPrivate(cx, obj, (void *)mi)) { + /* XXX error msg */ + mi = rpmmiFree(mi); + mi = NULL; + goto exit; + } + +exit: + s = _free(s); + return mi; +} + +static void +rpmmi_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmiClass, NULL); + rpmmi mi = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + (void) rpmmiFree(mi); +} + +static JSBool +rpmmi_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSObject *tso = NULL; + jsval tagid = JSVAL_VOID; + jsval kv = JSVAL_VOID; + rpmTag tag = RPMDBI_PACKAGES; + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "o/vv", &tso, &tagid, &kv))) + goto exit; + + if (JS_IsConstructing(cx, vp)) { + rpmts ts = JS_GetInstancePrivate(cx, tso, &rpmtsClass, NULL); + + if (!JSVAL_IS_VOID(tagid)) { + const char * s = JS_EncodeString(cx, JS_ValueToString(cx, tagid)); + /* XXX TODO: make sure both tag and key were specified. */ + tag = JSVAL_IS_INT(tagid) + ? (rpmTag) JSVAL_TO_INT(tagid) + : tagValue(s); + s = _free(s); + } + + if (ts == NULL || rpmmi_init(cx, obj, ts, tag, kv)) + goto exit; /* XXX error msg */ + } else { + if ((obj = JS_NewObject(cx, &rpmmiClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass rpmmiClass = { + "Mi", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmmi_addprop, rpmmi_delprop, rpmmi_getprop, rpmmi_setprop, + (JSEnumerateOp)rpmmi_enumerate, (JSResolveOp)rpmmi_resolve, + rpmmi_convert, rpmmi_dtor, + JSCLASS_NO_OPTIONAL_MEMBERS +}; + +JSObject * +rpmjs_InitMiClass(JSContext *cx, JSObject* obj) +{ + JSObject * o; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + o = JS_InitClass(cx, obj, NULL, &rpmmiClass, rpmmi_ctor, 1, + rpmmi_props, rpmmi_funcs, NULL, NULL); +assert(o != NULL); + return o; +} + +JSObject * +rpmjs_NewMiObject(JSContext *cx, void * _ts, int _tag, jsval kv) +{ + JSObject *obj; + rpmmi mi; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p,%u(%s),%u(%s))\n", __FUNCTION__, cx, _ts, (unsigned)_tag, tagName(_tag), (unsigned)kv, v2s(cx, kv)); + + if ((obj = JS_NewObject(cx, &rpmmiClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((mi = rpmmi_init(cx, obj, _ts, _tag, kv)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmmi, Mi, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmmi-js.h b/rpm-5.4.9/js/rpmmi-js.h new file mode 100644 index 0000000..c78e4c3 --- /dev/null +++ b/rpm-5.4.9/js/rpmmi-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMMI_JS +#define H_RPMMI_JS + +/** + * \file js/rpmmi-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmmiClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitMiClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewMiObject(JSContext *cx, void * _ts, int _tag, jsval kv); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMMI_JS */ diff --git a/rpm-5.4.9/js/rpmmpf-js.c b/rpm-5.4.9/js/rpmmpf-js.c new file mode 100644 index 0000000..b10432d --- /dev/null +++ b/rpm-5.4.9/js/rpmmpf-js.c @@ -0,0 +1,544 @@ +/** \ingroup js_c + * \file js/rpmmpf-js.c + */ + +#include "system.h" + +#include "rpmmpf-js.h" +#include "rpmtxn-js.h" +#include "rpmjs-debug.h" + +#include + +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmmpf_addprop JS_PropertyStub +#define rpmmpf_delprop JS_PropertyStub +#define rpmmpf_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmmpf_getobjectops NULL +#define rpmmpf_checkaccess NULL +#define rpmmpf_call rpmmpf_call +#define rpmmpf_construct rpmmpf_ctor +#define rpmmpf_xdrobject NULL +#define rpmmpf_hasinstance NULL +#define rpmmpf_mark NULL +#define rpmmpf_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmmpf_equality NULL +#define rpmmpf_outerobject NULL +#define rpmmpf_innerobject NULL +#define rpmmpf_iteratorobject NULL +#define rpmmpf_wrappedobject NULL + +/* --- helpers */ + +/* --- Object methods */ + +#define OBJ_IS_RPMTXN(_cx, _o) (JS_GET_CLASS(_cx, _o) == &rpmtxnClass) + +#define _RPMMPF_PAGESIZE (4 * BUFSIZ) + +static JSBool +rpmmpf_Close(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpfClass, NULL); + DB_MPOOLFILE * mpf = ptr; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (mpf == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + { int ret = mpf->close(mpf, _flags); + if (ret) + fprintf(stderr, "DB_MPOOLFILE->close: %s\n", db_strerror(ret)); + else + *vp = JSVAL_TRUE; + mpf = ptr = NULL; + (void) JS_SetPrivate(cx, obj, ptr); + } + + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmmpf_Get(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpfClass, NULL); + DB_MPOOLFILE * mpf = ptr; + JSObject * o = NULL; + DB_TXN * _txn = NULL; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (mpf == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "o/u", &o, &_flags))) + goto exit; + + if (o && OBJ_IS_RPMTXN(cx, o)) + _txn = JS_GetInstancePrivate(cx, o, &rpmtxnClass, NULL); + + { db_pgno_t _pgno = 0; + void * _page = NULL; + int ret = mpf->get(mpf, &_pgno, _txn, _flags, &_page); + switch (ret) { + default: + fprintf(stderr, "DB_MPOOLFILE->get: %s\n", db_strerror(ret)); + goto exit; + break; + case 0: + *vp = JSVAL_TRUE; + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmmpf_Open(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpfClass, NULL); + DB_MPOOLFILE * mpf = ptr; + char * _file = NULL; + uint32_t _flags = DB_CREATE; + int _mode = 0640; + uint32_t _pagesize = _RPMMPF_PAGESIZE; + + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (mpf == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/suiu", &_file, &_flags, &_mode, &_pagesize))) + goto exit; + + { size_t pagesize = _pagesize; + int ret = mpf->open(mpf, _file, _flags, _mode, pagesize); + switch (ret) { + default: + fprintf(stderr, "DB_MPOOLFILE->open: %s\n", db_strerror(ret)); + goto exit; + break; + case 0: + *vp = JSVAL_TRUE; + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmmpf_Put(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpfClass, NULL); + DB_MPOOLFILE * mpf = ptr; + DB_CACHE_PRIORITY _priority = DB_PRIORITY_UNCHANGED; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (mpf == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_priority))) + goto exit; + + { void * _pgaddr = NULL; + uint32_t _flags = 0; + int ret = mpf->put(mpf, _pgaddr, _priority, _flags); + switch (ret) { + default: + fprintf(stderr, "DB_MPOOLFILE->put: %s\n", db_strerror(ret)); + *vp = JSVAL_FALSE; + goto exit; + break; + case 0: + *vp = JSVAL_TRUE; + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmmpf_Sync(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpfClass, NULL); + DB_MPOOLFILE * mpf = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (mpf == NULL) goto exit; + *vp = JSVAL_FALSE; + + { int ret = mpf->sync(mpf); + if (ret) + fprintf(stderr, "DB_MPOOLFILE->sync: %s\n", db_strerror(ret)); + *vp = (!ret ? JSVAL_TRUE : JSVAL_FALSE); + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSFunctionSpec rpmmpf_funcs[] = { + JS_FS("close", rpmmpf_Close, 0,0), + JS_FS("get", rpmmpf_Get, 0,0), + JS_FS("open", rpmmpf_Open, 0,0), + JS_FS("put", rpmmpf_Put, 0,0), + JS_FS("sync", rpmmpf_Sync, 0,0), + JS_FS_END +}; + +/* --- Object properties */ + +#define _TABLE(_v) #_v, _##_v, JSPROP_ENUMERATE, NULL, NULL + +enum rpmmpf_tinyid { + _DEBUG = -2, + _CLEARLEN = -3, + _FILEID = -4, + _FLAGS = -5, + _FTYPE = -6, + _LSNOFFSET = -7, + _MAXSIZE = -8, + _PGCOOKIE = -9, + _PRIORITY = -10, +}; + +static JSPropertySpec rpmmpf_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {"clear_len",_CLEARLEN, JSPROP_ENUMERATE, NULL, NULL}, +#ifdef NOTNEEDED + {"fileid", _FILEID, JSPROP_ENUMERATE, NULL, NULL}, +#endif + {"flags", _FLAGS, JSPROP_ENUMERATE, NULL, NULL}, + {"ftype", _FTYPE, JSPROP_ENUMERATE, NULL, NULL}, + {"lsn_offset",_LSNOFFSET, JSPROP_ENUMERATE, NULL, NULL}, + {"maxsize", _MAXSIZE, JSPROP_ENUMERATE, NULL, NULL}, + {"pgcookie",_PGCOOKIE, JSPROP_ENUMERATE, NULL, NULL}, + {"priority",_PRIORITY, JSPROP_ENUMERATE, NULL, NULL}, + + {NULL, 0, 0, NULL, NULL} +}; + +#define _RET_B(_bool) ((_bool) > 0 ? JSVAL_TRUE: JSVAL_FALSE) +#define _RET_S(_str) \ + ((_str) ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, (_str))) : JSVAL_NULL) +#define _GET_S(_test) ((_test) ? _RET_S(_s) : JSVAL_VOID) +#define _GET_U(_test) ((_test) ? INT_TO_JSVAL(_u) : JSVAL_VOID) +#define _GET_I(_test) ((_test) ? INT_TO_JSVAL(_i) : JSVAL_VOID) +#define _GET_B(_test) ((_test) ? _RET_B(_i) : JSVAL_VOID) + +static JSBool +rpmmpf_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpfClass, NULL); + DB_MPOOLFILE * mpf = ptr; + int32_t _i = 0; + uint32_t _u = 0; + uint32_t _gb = 0; + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + case _CLEARLEN: *vp = _GET_U(!mpf->get_clear_len(mpf, &_u)); break; + case _FLAGS: *vp = _GET_U(!mpf->get_flags(mpf, &_u)); break; + case _FTYPE: *vp = _GET_I(!mpf->get_ftype(mpf, &_i)); break; + case _LSNOFFSET: *vp = _GET_I(!mpf->get_lsn_offset(mpf, &_i)); break; + case _MAXSIZE: *vp = _GET_U(!mpf->get_maxsize(mpf, &_gb, &_u)); break; + case _PGCOOKIE: *vp = JSVAL_VOID; break; /* XXX FIXME */ + case _PRIORITY: *vp = _GET_U(!mpf->get_priority(mpf, (DB_CACHE_PRIORITY *)&_u)); break; + + default: + break; + } + + return JS_TRUE; +} + +#define _PUT_S(_put) (JSVAL_IS_STRING(*vp) && !(_put) \ + ? JSVAL_TRUE : JSVAL_FALSE) +#define _PUT_U(_put) (JSVAL_IS_NUMBER(*vp) && !(_put) \ + ? JSVAL_TRUE : JSVAL_FALSE) +#define _PUT_I(_put) (JSVAL_IS_NUMBER(*vp) && !(_put) \ + ? JSVAL_TRUE : JSVAL_FALSE) + +static JSBool +rpmmpf_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpfClass, NULL); + DB_MPOOLFILE * mpf = ptr; + int32_t _i = 0; + uint32_t _u = 0; + uint32_t _gb = 0; + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + if (JSVAL_IS_INT(*vp)) + _i = _u = JSVAL_TO_INT(*vp); + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + case _CLEARLEN: *vp = _PUT_U(!mpf->set_clear_len(mpf, _u)); break; + case _FLAGS: *vp = JSVAL_FALSE; break; /* XXX FIXME */ + case _FTYPE: *vp = _PUT_I(!mpf->set_ftype(mpf, _i)); break; + case _LSNOFFSET: *vp = _PUT_I(!mpf->set_lsn_offset(mpf, _i)); break; + case _MAXSIZE: *vp = _PUT_U(!mpf->set_maxsize(mpf, _gb, _u)); break; + case _PGCOOKIE: *vp = JSVAL_FALSE; break; /* XXX FIXME */ + case _PRIORITY: *vp = _PUT_U(mpf->set_priority(mpf, (DB_CACHE_PRIORITY)_u)); break; + + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmmpf_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpfClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmmpf_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static DB_MPOOLFILE * +rpmmpf_init(JSContext *cx, JSObject *obj) +{ + DB_MPOOLFILE * mpf = NULL; +#ifdef NOTYET + uint32_t _flags = 0; + + if (rpmmpf_env_create(&db, _flags) || mpf == NULL + || !JS_SetPrivate(cx, obj, (void *)mpf)) +#else + if (!JS_SetPrivate(cx, obj, (void *)mpf)) +#endif + { + if (mpf) + (void) mpf->close(mpf, 0); + /* XXX error msg */ + mpf = NULL; + } + +if (_debug) +fprintf(stderr, "<== %s(%p,%p) mpf %p\n", __FUNCTION__, cx, obj, mpf); + + return mpf; +} + +static void +rpmmpf_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpfClass, NULL); +#ifdef NOTYET /* XXX let BDB handle DB_MPOOLFILE ptrs */ + DB_MPOOLFILE * mpf = ptr; +#endif + +_DTOR_DEBUG_ENTRY(_debug); + +#ifdef NOTYET /* XXX let BDB handle DB_MPOOLFILE ptrs */ + if (mpf) + (void) mpf->close(mpf, 0); +#endif +} + +static JSBool +rpmmpf_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (JS_IsConstructing(cx, vp)) { + (void) rpmmpf_init(cx, obj); + } else { + if ((obj = JS_NewObject(cx, &rpmmpfClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmmpf_call(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + /* XXX obj is the global object so lookup "this" object. */ + JSObject * o = JSVAL_TO_OBJECT(argv[-2]); + void * ptr = JS_GetInstancePrivate(cx, o, &rpmmpfClass, NULL); +#ifdef NOTYET + DB_MPOOLFILE * mpf = ptr; + const char *_fn = NULL; + const char * _con = NULL; +#endif + JSBool ok = JS_FALSE; + +#ifdef NOTYET + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_fn))) + goto exit; + + *vp = (mpf && _fn && (_con = rpmmpfLgetfilecon(mpf, _fn)) != NULL) + ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _con)) : JSVAL_VOID; + _con = _free(_con); + + ok = JS_TRUE; + +exit: +#endif + +if (_debug) +fprintf(stderr, "<== %s(%p,%p[%u],%p) o %p ptr %p\n", __FUNCTION__, cx, argv, (unsigned)argc, vp, o, ptr); + + return ok; +} + +/* --- Class initialization */ +JSClass rpmmpfClass = { + "Mpf", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmmpf_addprop, rpmmpf_delprop, rpmmpf_getprop, rpmmpf_setprop, + (JSEnumerateOp)rpmmpf_enumerate, (JSResolveOp)rpmmpf_resolve, + rpmmpf_convert, rpmmpf_dtor, + + rpmmpf_getobjectops, rpmmpf_checkaccess, + rpmmpf_call, rpmmpf_construct, + rpmmpf_xdrobject, rpmmpf_hasinstance, + rpmmpf_mark, rpmmpf_reserveslots, +}; + +JSObject * +rpmjs_InitMpfClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmmpfClass, rpmmpf_ctor, 1, + rpmmpf_props, rpmmpf_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewMpfObject(JSContext *cx) +{ + JSObject *obj; + DB_MPOOLFILE * mpf; + + if ((obj = JS_NewObject(cx, &rpmmpfClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((mpf = rpmmpf_init(cx, obj)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmmpf, Mpf, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmmpf-js.h b/rpm-5.4.9/js/rpmmpf-js.h new file mode 100644 index 0000000..3d60ed4 --- /dev/null +++ b/rpm-5.4.9/js/rpmmpf-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMMPF_JS +#define H_RPMMPF_JS + +/** + * \file js/rpmmpf-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmmpfClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitMpfClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewMpfObject(JSContext *cx); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMMPF_JS */ diff --git a/rpm-5.4.9/js/rpmmpw-js.c b/rpm-5.4.9/js/rpmmpw-js.c new file mode 100644 index 0000000..bfa43af --- /dev/null +++ b/rpm-5.4.9/js/rpmmpw-js.c @@ -0,0 +1,2508 @@ +/** + * \file js/rpmmpw-js.c + */ + +#include "system.h" +#include + +#include "rpmmpw-js.h" +#include "rpmjs-debug.h" + +#include +#include "beecrypt/mpprime.h" /* mpptrials() */ + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmmpw_addprop JS_PropertyStub +#define rpmmpw_delprop JS_PropertyStub +#define rpmmpw_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmmpw_getobjectops NULL +#define rpmmpw_checkaccess NULL +#define rpmmpw_call rpmmpw_call +#define rpmmpw_construct rpmmpw_ctor +#define rpmmpw_xdrobject NULL +#define rpmmpw_hasinstance NULL +#define rpmmpw_mark NULL +#define rpmmpw_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmmpw_equality NULL +#define rpmmpw_outerobject NULL +#define rpmmpw_innerobject NULL +#define rpmmpw_iteratorobject NULL +#define rpmmpw_wrappedobject NULL + +#define OBJ_IS_MPW(cx,obj) ((obj) && JS_GET_CLASS((cx), (obj)) == &rpmmpwClass) +#define JSVAL_IS_MPW(cx, v) (JSVAL_IS_OBJECT(v) && OBJ_IS_MPW(cx, JSVAL_TO_OBJECT(v))) + +/* --- helpers */ +typedef struct mpwObject_s { + int ob_size; + mpw data[1]; +} mpwObject; + +#define mpw_Check(_o) (1) /* XXX FIXME */ +#define mpw_CheckExact(_o) (1) /* XXX FIXME */ + +#define MP_ROUND_B2W(_b) MP_BITS_TO_WORDS((_b) + MP_WBITS - 1) + +#define MPW_SIZE(_a) (size_t)((_a)->ob_size < 0 ? -(_a)->ob_size : (_a)->ob_size) +#define MPW_DATA(_a) ((_a)->data) + +#define ABS(_x) ((_x) < 0 ? -(_x) : (_x)) +#if !defined(MAX) +#define MAX(x, y) ((x) < (y) ? (y) : (x)) +#endif +#if !defined(MIN) +#define MIN(x, y) ((x) > (y) ? (y) : (x)) +#endif + +#define MPBITCNT(_s, _d) (MP_WORDS_TO_BITS(_s) - mpmszcnt((_s), (_d))) + +#define BITS_TO_DIGITS(_b) (((_b) + SHIFT - 1)/SHIFT) +#define DIGITS_TO_BITS(_d) ((_d) * SHIFT) + +/*@unchecked@*/ +static int _ie = 0x44332211; +/*@unchecked@*/ +static union _dendian { +/*@unused@*/ + int i; + char b[4]; +} *_endian = (union _dendian *)&_ie; +#define _RPMBC_IS_BIG_ENDIAN() (_endian->b[0] == '\x44') +#define _RPMBC_IS_LITTLE_ENDIAN() (_endian->b[0] == '\x11') + +/*@unchecked@*/ /*@observer@*/ +static const char *initialiser_name = ""; + +/*@unchecked@*/ /*@observer@*/ +static const struct { + /* Number of digits in the conversion base that always fits in an mp_limb_t. + For example, for base 10 on a machine where a mp_limb_t has 32 bits this + is 9, since 10**9 is the largest number that fits into a mp_limb_t. */ + int chars_per_limb; + + /* log(2)/log(conversion_base) */ + double chars_per_bit_exactly; + + /* base**chars_per_limb, i.e. the biggest number that fits a word, built by + factors of base. Exception: For 2, 4, 8, etc, big_base is log2(base), + i.e. the number of bits used to represent each digit in the base. */ + unsigned int big_base; + + /* A BITS_PER_MP_LIMB bit approximation to 1/big_base, represented as a + fixed-point number. Instead of dividing by big_base an application can + choose to multiply by big_base_inverted. */ + unsigned int big_base_inverted; +} mp_bases[257] = { + /* 0 */ {0, 0.0, 0, 0}, + /* 1 */ {0, 1e37, 0, 0}, + /* 2 */ {32, 1.0000000000000000, 0x1, 0x0}, + /* 3 */ {20, 0.6309297535714574, 0xcfd41b91, 0x3b563c24}, + /* 4 */ {16, 0.5000000000000000, 0x2, 0x0}, + /* 5 */ {13, 0.4306765580733931, 0x48c27395, 0xc25c2684}, + /* 6 */ {12, 0.3868528072345416, 0x81bf1000, 0xf91bd1b6}, + /* 7 */ {11, 0.3562071871080222, 0x75db9c97, 0x1607a2cb}, + /* 8 */ {10, 0.3333333333333333, 0x3, 0x0}, + /* 9 */ {10, 0.3154648767857287, 0xcfd41b91, 0x3b563c24}, + /* 10 */ {9, 0.3010299956639812, 0x3b9aca00, 0x12e0be82}, + /* 11 */ {9, 0.2890648263178878, 0x8c8b6d2b, 0xd24cde04}, + /* 12 */ {8, 0.2789429456511298, 0x19a10000, 0x3fa39ab5}, + /* 13 */ {8, 0.2702381544273197, 0x309f1021, 0x50f8ac5f}, + /* 14 */ {8, 0.2626495350371935, 0x57f6c100, 0x74843b1e}, + /* 15 */ {8, 0.2559580248098155, 0x98c29b81, 0xad0326c2}, + /* 16 */ {8, 0.2500000000000000, 0x4, 0x0}, + /* 17 */ {7, 0.2446505421182260, 0x18754571, 0x4ef0b6bd}, + /* 18 */ {7, 0.2398124665681314, 0x247dbc80, 0xc0fc48a1}, + /* 19 */ {7, 0.2354089133666382, 0x3547667b, 0x33838942}, + /* 20 */ {7, 0.2313782131597592, 0x4c4b4000, 0xad7f29ab}, + /* 21 */ {7, 0.2276702486969530, 0x6b5a6e1d, 0x313c3d15}, + /* 22 */ {7, 0.2242438242175754, 0x94ace180, 0xb8cca9e0}, + /* 23 */ {7, 0.2210647294575037, 0xcaf18367, 0x42ed6de9}, + /* 24 */ {6, 0.2181042919855316, 0xb640000, 0x67980e0b}, + /* 25 */ {6, 0.2153382790366965, 0xe8d4a51, 0x19799812}, + /* 26 */ {6, 0.2127460535533632, 0x1269ae40, 0xbce85396}, + /* 27 */ {6, 0.2103099178571525, 0x17179149, 0x62c103a9}, + /* 28 */ {6, 0.2080145976765095, 0x1cb91000, 0x1d353d43}, + /* 29 */ {6, 0.2058468324604344, 0x23744899, 0xce1decea}, + /* 30 */ {6, 0.2037950470905062, 0x2b73a840, 0x790fc511}, + /* 31 */ {6, 0.2018490865820999, 0x34e63b41, 0x35b865a0}, + /* 32 */ {6, 0.2000000000000000, 0x5, 0x0}, + /* 33 */ {6, 0.1982398631705605, 0x4cfa3cc1, 0xa9aed1b3}, + /* 34 */ {6, 0.1965616322328226, 0x5c13d840, 0x63dfc229}, + /* 35 */ {6, 0.1949590218937863, 0x6d91b519, 0x2b0fee30}, + /* 36 */ {6, 0.1934264036172708, 0x81bf1000, 0xf91bd1b6}, + /* 37 */ {6, 0.1919587200065601, 0x98ede0c9, 0xac89c3a9}, + /* 38 */ {6, 0.1905514124267734, 0xb3773e40, 0x6d2c32fe}, + /* 39 */ {6, 0.1892003595168700, 0xd1bbc4d1, 0x387907c9}, + /* 40 */ {6, 0.1879018247091076, 0xf4240000, 0xc6f7a0b}, + /* 41 */ {5, 0.1866524112389434, 0x6e7d349, 0x28928154}, + /* 42 */ {5, 0.1854490234153689, 0x7ca30a0, 0x6e8629d}, + /* 43 */ {5, 0.1842888331487062, 0x8c32bbb, 0xd373dca0}, + /* 44 */ {5, 0.1831692509136336, 0x9d46c00, 0xa0b17895}, + /* 45 */ {5, 0.1820879004699383, 0xaffacfd, 0x746811a5}, + /* 46 */ {5, 0.1810425967800402, 0xc46bee0, 0x4da6500f}, + /* 47 */ {5, 0.1800313266566926, 0xdab86ef, 0x2ba23582}, + /* 48 */ {5, 0.1790522317510414, 0xf300000, 0xdb20a88}, + /* 49 */ {5, 0.1781035935540111, 0x10d63af1, 0xe68d5ce4}, + /* 50 */ {5, 0.1771838201355579, 0x12a05f20, 0xb7cdfd9d}, + /* 51 */ {5, 0.1762914343888821, 0x1490aae3, 0x8e583933}, + /* 52 */ {5, 0.1754250635819545, 0x16a97400, 0x697cc3ea}, + /* 53 */ {5, 0.1745834300480449, 0x18ed2825, 0x48a5ca6c}, + /* 54 */ {5, 0.1737653428714400, 0x1b5e4d60, 0x2b52db16}, + /* 55 */ {5, 0.1729696904450771, 0x1dff8297, 0x111586a6}, + /* 56 */ {5, 0.1721954337940981, 0x20d38000, 0xf31d2b36}, + /* 57 */ {5, 0.1714416005739134, 0x23dd1799, 0xc8d76d19}, + /* 58 */ {5, 0.1707072796637201, 0x271f35a0, 0xa2cb1eb4}, + /* 59 */ {5, 0.1699916162869140, 0x2a9ce10b, 0x807c3ec3}, + /* 60 */ {5, 0.1692938075987814, 0x2e593c00, 0x617ec8bf}, + /* 61 */ {5, 0.1686130986895011, 0x3257844d, 0x45746cbe}, + /* 62 */ {5, 0.1679487789570419, 0x369b13e0, 0x2c0aa273}, + /* 63 */ {5, 0.1673001788101741, 0x3b27613f, 0x14f90805}, + /* 64 */ {5, 0.1666666666666667, 0x6, 0x0}, + /* 65 */ {5, 0.1660476462159378, 0x4528a141, 0xd9cf0829}, + /* 66 */ {5, 0.1654425539190583, 0x4aa51420, 0xb6fc4841}, + /* 67 */ {5, 0.1648508567221603, 0x50794633, 0x973054cb}, + /* 68 */ {5, 0.1642720499620502, 0x56a94400, 0x7a1dbe4b}, + /* 69 */ {5, 0.1637056554452156, 0x5d393975, 0x5f7fcd7f}, + /* 70 */ {5, 0.1631512196835108, 0x642d7260, 0x47196c84}, + /* 71 */ {5, 0.1626083122716342, 0x6b8a5ae7, 0x30b43635}, + /* 72 */ {5, 0.1620765243931223, 0x73548000, 0x1c1fa5f6}, + /* 73 */ {5, 0.1615554674429964, 0x7b908fe9, 0x930634a}, + /* 74 */ {5, 0.1610447717564444, 0x84435aa0, 0xef7f4a3c}, + /* 75 */ {5, 0.1605440854340214, 0x8d71d25b, 0xcf5552d2}, + /* 76 */ {5, 0.1600530732548213, 0x97210c00, 0xb1a47c8e}, + /* 77 */ {5, 0.1595714156699382, 0xa1563f9d, 0x9634b43e}, + /* 78 */ {5, 0.1590988078692941, 0xac16c8e0, 0x7cd3817d}, + /* 79 */ {5, 0.1586349589155960, 0xb768278f, 0x65536761}, + /* 80 */ {5, 0.1581795909397823, 0xc3500000, 0x4f8b588e}, + /* 81 */ {5, 0.1577324383928644, 0xcfd41b91, 0x3b563c24}, + /* 82 */ {5, 0.1572932473495469, 0xdcfa6920, 0x28928154}, + /* 83 */ {5, 0.1568617748594410, 0xeac8fd83, 0x1721bfb0}, + /* 84 */ {5, 0.1564377883420715, 0xf9461400, 0x6e8629d}, + /* 85 */ {4, 0.1560210650222250, 0x31c84b1, 0x491cc17c}, + /* 86 */ {4, 0.1556113914024939, 0x342ab10, 0x3a11d83b}, + /* 87 */ {4, 0.1552085627701551, 0x36a2c21, 0x2be074cd}, + /* 88 */ {4, 0.1548123827357682, 0x3931000, 0x1e7a02e7}, + /* 89 */ {4, 0.1544226628011101, 0x3bd5ee1, 0x11d10edd}, + /* 90 */ {4, 0.1540392219542636, 0x3e92110, 0x5d92c68}, + /* 91 */ {4, 0.1536618862898642, 0x4165ef1, 0xf50dbfb2}, + /* 92 */ {4, 0.1532904886526781, 0x4452100, 0xdf9f1316}, + /* 93 */ {4, 0.1529248683028321, 0x4756fd1, 0xcb52a684}, + /* 94 */ {4, 0.1525648706011593, 0x4a75410, 0xb8163e97}, + /* 95 */ {4, 0.1522103467132434, 0x4dad681, 0xa5d8f269}, + /* 96 */ {4, 0.1518611533308632, 0x5100000, 0x948b0fcd}, + /* 97 */ {4, 0.1515171524096389, 0x546d981, 0x841e0215}, + /* 98 */ {4, 0.1511782109217764, 0x57f6c10, 0x74843b1e}, + /* 99 */ {4, 0.1508442006228941, 0x5b9c0d1, 0x65b11e6e}, + /* 100 */ {4, 0.1505149978319906, 0x5f5e100, 0x5798ee23}, + /* 101 */ {4, 0.1501904832236880, 0x633d5f1, 0x4a30b99b}, + /* 102 */ {4, 0.1498705416319474, 0x673a910, 0x3d6e4d94}, + /* 103 */ {4, 0.1495550618645152, 0x6b563e1, 0x314825b0}, + /* 104 */ {4, 0.1492439365274121, 0x6f91000, 0x25b55f2e}, + /* 105 */ {4, 0.1489370618588283, 0x73eb721, 0x1aadaccb}, + /* 106 */ {4, 0.1486343375718350, 0x7866310, 0x10294ba2}, + /* 107 */ {4, 0.1483356667053617, 0x7d01db1, 0x620f8f6}, + /* 108 */ {4, 0.1480409554829326, 0x81bf100, 0xf91bd1b6}, + /* 109 */ {4, 0.1477501131786861, 0x869e711, 0xe6d37b2a}, + /* 110 */ {4, 0.1474630519902391, 0x8ba0a10, 0xd55cff6e}, + /* 111 */ {4, 0.1471796869179852, 0x90c6441, 0xc4ad2db2}, + /* 112 */ {4, 0.1468999356504447, 0x9610000, 0xb4b985cf}, + /* 113 */ {4, 0.1466237184553111, 0x9b7e7c1, 0xa5782bef}, + /* 114 */ {4, 0.1463509580758620, 0xa112610, 0x96dfdd2a}, + /* 115 */ {4, 0.1460815796324244, 0xa6cc591, 0x88e7e509}, + /* 116 */ {4, 0.1458155105286054, 0xacad100, 0x7b8813d3}, + /* 117 */ {4, 0.1455526803620167, 0xb2b5331, 0x6eb8b595}, + /* 118 */ {4, 0.1452930208392429, 0xb8e5710, 0x627289db}, + /* 119 */ {4, 0.1450364656948130, 0xbf3e7a1, 0x56aebc07}, + /* 120 */ {4, 0.1447829506139581, 0xc5c1000, 0x4b66dc33}, + /* 121 */ {4, 0.1445324131589439, 0xcc6db61, 0x4094d8a3}, + /* 122 */ {4, 0.1442847926987864, 0xd345510, 0x3632f7a5}, + /* 123 */ {4, 0.1440400303421672, 0xda48871, 0x2c3bd1f0}, + /* 124 */ {4, 0.1437980688733776, 0xe178100, 0x22aa4d5f}, + /* 125 */ {4, 0.1435588526911310, 0xe8d4a51, 0x19799812}, + /* 126 */ {4, 0.1433223277500932, 0xf05f010, 0x10a523e5}, + /* 127 */ {4, 0.1430884415049874, 0xf817e01, 0x828a237}, + /* 128 */ {4, 0.1428571428571428, 0x7, 0x0}, + /* 129 */ {4, 0.1426283821033600, 0x10818201, 0xf04ec452}, + /* 130 */ {4, 0.1424021108869747, 0x11061010, 0xe136444a}, + /* 131 */ {4, 0.1421782821510107, 0x118db651, 0xd2af9589}, + /* 132 */ {4, 0.1419568500933153, 0x12188100, 0xc4b42a83}, + /* 133 */ {4, 0.1417377701235801, 0x12a67c71, 0xb73dccf5}, + /* 134 */ {4, 0.1415209988221527, 0x1337b510, 0xaa4698c5}, + /* 135 */ {4, 0.1413064939005528, 0x13cc3761, 0x9dc8f729}, + /* 136 */ {4, 0.1410942141636095, 0x14641000, 0x91bf9a30}, + /* 137 */ {4, 0.1408841194731412, 0x14ff4ba1, 0x86257887}, + /* 138 */ {4, 0.1406761707131039, 0x159df710, 0x7af5c98c}, + /* 139 */ {4, 0.1404703297561400, 0x16401f31, 0x702c01a0}, + /* 140 */ {4, 0.1402665594314587, 0x16e5d100, 0x65c3ceb1}, + /* 141 */ {4, 0.1400648234939879, 0x178f1991, 0x5bb91502}, + /* 142 */ {4, 0.1398650865947379, 0x183c0610, 0x5207ec23}, + /* 143 */ {4, 0.1396673142523192, 0x18eca3c1, 0x48ac9c19}, + /* 144 */ {4, 0.1394714728255649, 0x19a10000, 0x3fa39ab5}, + /* 145 */ {4, 0.1392775294872041, 0x1a592841, 0x36e98912}, + /* 146 */ {4, 0.1390854521985406, 0x1b152a10, 0x2e7b3140}, + /* 147 */ {4, 0.1388952096850913, 0x1bd51311, 0x2655840b}, + /* 148 */ {4, 0.1387067714131417, 0x1c98f100, 0x1e7596ea}, + /* 149 */ {4, 0.1385201075671774, 0x1d60d1b1, 0x16d8a20d}, + /* 150 */ {4, 0.1383351890281539, 0x1e2cc310, 0xf7bfe87}, + /* 151 */ {4, 0.1381519873525671, 0x1efcd321, 0x85d2492}, + /* 152 */ {4, 0.1379704747522905, 0x1fd11000, 0x179a9f4}, + /* 153 */ {4, 0.1377906240751463, 0x20a987e1, 0xf59e80eb}, + /* 154 */ {4, 0.1376124087861776, 0x21864910, 0xe8b768db}, + /* 155 */ {4, 0.1374358029495937, 0x226761f1, 0xdc39d6d5}, + /* 156 */ {4, 0.1372607812113589, 0x234ce100, 0xd021c5d1}, + /* 157 */ {4, 0.1370873187823978, 0x2436d4d1, 0xc46b5e37}, + /* 158 */ {4, 0.1369153914223921, 0x25254c10, 0xb912f39c}, + /* 159 */ {4, 0.1367449754241439, 0x26185581, 0xae150294}, + /* 160 */ {4, 0.1365760475984821, 0x27100000, 0xa36e2eb1}, + /* 161 */ {4, 0.1364085852596902, 0x280c5a81, 0x991b4094}, + /* 162 */ {4, 0.1362425662114337, 0x290d7410, 0x8f19241e}, + /* 163 */ {4, 0.1360779687331669, 0x2a135bd1, 0x8564e6b7}, + /* 164 */ {4, 0.1359147715670014, 0x2b1e2100, 0x7bfbb5b4}, + /* 165 */ {4, 0.1357529539050150, 0x2c2dd2f1, 0x72dadcc8}, + /* 166 */ {4, 0.1355924953769864, 0x2d428110, 0x69ffc498}, + /* 167 */ {4, 0.1354333760385373, 0x2e5c3ae1, 0x6167f154}, + /* 168 */ {4, 0.1352755763596663, 0x2f7b1000, 0x5911016e}, + /* 169 */ {4, 0.1351190772136599, 0x309f1021, 0x50f8ac5f}, + /* 170 */ {4, 0.1349638598663645, 0x31c84b10, 0x491cc17c}, + /* 171 */ {4, 0.1348099059658080, 0x32f6d0b1, 0x417b26d8}, + /* 172 */ {4, 0.1346571975321549, 0x342ab100, 0x3a11d83b}, + /* 173 */ {4, 0.1345057169479844, 0x3563fc11, 0x32dee622}, + /* 174 */ {4, 0.1343554469488779, 0x36a2c210, 0x2be074cd}, + /* 175 */ {4, 0.1342063706143054, 0x37e71341, 0x2514bb58}, + /* 176 */ {4, 0.1340584713587979, 0x39310000, 0x1e7a02e7}, + /* 177 */ {4, 0.1339117329233981, 0x3a8098c1, 0x180ea5d0}, + /* 178 */ {4, 0.1337661393673756, 0x3bd5ee10, 0x11d10edd}, + /* 179 */ {4, 0.1336216750601996, 0x3d311091, 0xbbfb88e}, + /* 180 */ {4, 0.1334783246737591, 0x3e921100, 0x5d92c68}, + /* 181 */ {4, 0.1333360731748201, 0x3ff90031, 0x1c024c}, + /* 182 */ {4, 0.1331949058177136, 0x4165ef10, 0xf50dbfb2}, + /* 183 */ {4, 0.1330548081372441, 0x42d8eea1, 0xea30efa3}, + /* 184 */ {4, 0.1329157659418126, 0x44521000, 0xdf9f1316}, + /* 185 */ {4, 0.1327777653067443, 0x45d16461, 0xd555c0c9}, + /* 186 */ {4, 0.1326407925678156, 0x4756fd10, 0xcb52a684}, + /* 187 */ {4, 0.1325048343149731, 0x48e2eb71, 0xc193881f}, + /* 188 */ {4, 0.1323698773862368, 0x4a754100, 0xb8163e97}, + /* 189 */ {4, 0.1322359088617821, 0x4c0e0f51, 0xaed8b724}, + /* 190 */ {4, 0.1321029160581950, 0x4dad6810, 0xa5d8f269}, + /* 191 */ {4, 0.1319708865228925, 0x4f535d01, 0x9d15039d}, + /* 192 */ {4, 0.1318398080287045, 0x51000000, 0x948b0fcd}, + /* 193 */ {4, 0.1317096685686114, 0x52b36301, 0x8c394d1d}, + /* 194 */ {4, 0.1315804563506306, 0x546d9810, 0x841e0215}, + /* 195 */ {4, 0.1314521597928493, 0x562eb151, 0x7c3784f8}, + /* 196 */ {4, 0.1313247675185968, 0x57f6c100, 0x74843b1e}, + /* 197 */ {4, 0.1311982683517524, 0x59c5d971, 0x6d02985d}, + /* 198 */ {4, 0.1310726513121843, 0x5b9c0d10, 0x65b11e6e}, + /* 199 */ {4, 0.1309479056113158, 0x5d796e61, 0x5e8e5c64}, + /* 200 */ {4, 0.1308240206478128, 0x5f5e1000, 0x5798ee23}, + /* 201 */ {4, 0.1307009860033912, 0x614a04a1, 0x50cf7bde}, + /* 202 */ {4, 0.1305787914387386, 0x633d5f10, 0x4a30b99b}, + /* 203 */ {4, 0.1304574268895465, 0x65383231, 0x43bb66bd}, + /* 204 */ {4, 0.1303368824626505, 0x673a9100, 0x3d6e4d94}, + /* 205 */ {4, 0.1302171484322746, 0x69448e91, 0x374842ee}, + /* 206 */ {4, 0.1300982152363760, 0x6b563e10, 0x314825b0}, + /* 207 */ {4, 0.1299800734730872, 0x6d6fb2c1, 0x2b6cde75}, + /* 208 */ {4, 0.1298627138972530, 0x6f910000, 0x25b55f2e}, + /* 209 */ {4, 0.1297461274170591, 0x71ba3941, 0x2020a2c5}, + /* 210 */ {4, 0.1296303050907487, 0x73eb7210, 0x1aadaccb}, + /* 211 */ {4, 0.1295152381234257, 0x7624be11, 0x155b891f}, + /* 212 */ {4, 0.1294009178639407, 0x78663100, 0x10294ba2}, + /* 213 */ {4, 0.1292873358018581, 0x7aafdeb1, 0xb160fe9}, + /* 214 */ {4, 0.1291744835645007, 0x7d01db10, 0x620f8f6}, + /* 215 */ {4, 0.1290623529140715, 0x7f5c3a21, 0x14930ef}, + /* 216 */ {4, 0.1289509357448472, 0x81bf1000, 0xf91bd1b6}, + /* 217 */ {4, 0.1288402240804449, 0x842a70e1, 0xefdcb0c7}, + /* 218 */ {4, 0.1287302100711566, 0x869e7110, 0xe6d37b2a}, + /* 219 */ {4, 0.1286208859913518, 0x891b24f1, 0xddfeb94a}, + /* 220 */ {4, 0.1285122442369443, 0x8ba0a100, 0xd55cff6e}, + /* 221 */ {4, 0.1284042773229231, 0x8e2ef9d1, 0xcceced50}, + /* 222 */ {4, 0.1282969778809442, 0x90c64410, 0xc4ad2db2}, + /* 223 */ {4, 0.1281903386569819, 0x93669481, 0xbc9c75f9}, + /* 224 */ {4, 0.1280843525090381, 0x96100000, 0xb4b985cf}, + /* 225 */ {4, 0.1279790124049077, 0x98c29b81, 0xad0326c2}, + /* 226 */ {4, 0.1278743114199984, 0x9b7e7c10, 0xa5782bef}, + /* 227 */ {4, 0.1277702427352035, 0x9e43b6d1, 0x9e1771a9}, + /* 228 */ {4, 0.1276667996348261, 0xa1126100, 0x96dfdd2a}, + /* 229 */ {4, 0.1275639755045533, 0xa3ea8ff1, 0x8fd05c41}, + /* 230 */ {4, 0.1274617638294791, 0xa6cc5910, 0x88e7e509}, + /* 231 */ {4, 0.1273601581921740, 0xa9b7d1e1, 0x8225759d}, + /* 232 */ {4, 0.1272591522708010, 0xacad1000, 0x7b8813d3}, + /* 233 */ {4, 0.1271587398372755, 0xafac2921, 0x750eccf9}, + /* 234 */ {4, 0.1270589147554692, 0xb2b53310, 0x6eb8b595}, + /* 235 */ {4, 0.1269596709794558, 0xb5c843b1, 0x6884e923}, + /* 236 */ {4, 0.1268610025517973, 0xb8e57100, 0x627289db}, + /* 237 */ {4, 0.1267629036018709, 0xbc0cd111, 0x5c80c07b}, + /* 238 */ {4, 0.1266653683442337, 0xbf3e7a10, 0x56aebc07}, + /* 239 */ {4, 0.1265683910770258, 0xc27a8241, 0x50fbb19b}, + /* 240 */ {4, 0.1264719661804097, 0xc5c10000, 0x4b66dc33}, + /* 241 */ {4, 0.1263760881150453, 0xc91209c1, 0x45ef7c7c}, + /* 242 */ {4, 0.1262807514205999, 0xcc6db610, 0x4094d8a3}, + /* 243 */ {4, 0.1261859507142915, 0xcfd41b91, 0x3b563c24}, + /* 244 */ {4, 0.1260916806894653, 0xd3455100, 0x3632f7a5}, + /* 245 */ {4, 0.1259979361142023, 0xd6c16d31, 0x312a60c3}, + /* 246 */ {4, 0.1259047118299582, 0xda488710, 0x2c3bd1f0}, + /* 247 */ {4, 0.1258120027502338, 0xdddab5a1, 0x2766aa45}, + /* 248 */ {4, 0.1257198038592741, 0xe1781000, 0x22aa4d5f}, + /* 249 */ {4, 0.1256281102107963, 0xe520ad61, 0x1e06233c}, + /* 250 */ {4, 0.1255369169267456, 0xe8d4a510, 0x19799812}, + /* 251 */ {4, 0.1254462191960791, 0xec940e71, 0x15041c33}, + /* 252 */ {4, 0.1253560122735751, 0xf05f0100, 0x10a523e5}, + /* 253 */ {4, 0.1252662914786691, 0xf4359451, 0xc5c2749}, + /* 254 */ {4, 0.1251770521943144, 0xf817e010, 0x828a237}, + /* 255 */ {4, 0.1250882898658681, 0xfc05fc01, 0x40a1423}, + /* 256 */ {4, 0.1250000000000000, 0x8, 0x0}, +}; + +static void prtmpw(const char * msg, mpwObject * x) + /*@global stderr, fileSystem @*/ + /*@modifies stderr, fileSystem @*/ +{ +fprintf(stderr, "%5.5s %p[%u]:\t", msg, MPW_DATA(x), (unsigned)MPW_SIZE(x)), mpfprintln(stderr, MPW_SIZE(x), MPW_DATA(x)); +} + +static size_t +mpsizeinbase(size_t xsize, mpw* xdata, size_t base) + /*@*/ +{ + size_t nbits; + size_t res; + + if (xsize == 0) + return 1; + + /* XXX assumes positive integer. */ + nbits = MP_WORDS_TO_BITS(xsize) - mpmszcnt(xsize, xdata); + if ((base & (base-1)) == 0) { /* exact power of 2 */ + size_t lbits = mp_bases[base].big_base; + res = (nbits + (lbits - 1)) / lbits; + } else { + res = (nbits * mp_bases[base].chars_per_bit_exactly) + 1; + } +if (_debug < -1) +fprintf(stderr, "<== mpsizeinbase(%p[%u], %u) res %u\n", xdata, (unsigned)xsize, (unsigned)base, (unsigned)res); + return res; +} + +#ifdef DYING +static void myndivmod(mpw* result, size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata, register mpw* workspace) +{ + /* result must be xsize+1 in length */ + /* workspace must be ysize+1 in length */ + /* expect ydata to be normalized */ + mpw q; + mpw msw = *ydata; + size_t qsize = xsize-ysize; + + *result = (mpge(ysize, xdata, ydata) ? 1 : 0); + mpcopy(xsize, result+1, xdata); + if (*result) + (void) mpsub(ysize, result+1, ydata); + result++; + + while (qsize--) + { + q = mppndiv(result[0], result[1], msw); + +/*@-evalorder@*/ + *workspace = mpsetmul(ysize, workspace+1, ydata, q); +/*@=evalorder@*/ + + while (mplt(ysize+1, result, workspace)) + { + (void) mpsubx(ysize+1, workspace, ysize, ydata); + q--; + } + (void) mpsub(ysize+1, result, workspace); + *(result++) = q; + } +} +#endif + +static char * +mpstr(char * t, size_t nt, size_t size, mpw* data, mpw base) + /*@modifies t @*/ +{ + static char bchars[] = "0123456789abcdefghijklmnopqrstuvwxyz"; + size_t asize = size + 1; + mpw* adata = alloca(asize * sizeof(*adata)); + size_t anorm; + mpw* zdata = alloca((asize+1) * sizeof(*zdata)); + mpw* wksp = alloca((1+1) * sizeof(*wksp)); + size_t result; + +if (_debug < -1) +fprintf(stderr, "*** mpstr(%p[%u], %p[%u], %u):\t", t, (unsigned)nt, data, (unsigned)size, (unsigned)base), mpfprintln(stderr, size, data); + + mpsetx(asize, adata, size, data); + + t[nt] = '\0'; + while (nt--) { + + mpndivmod(zdata, asize, adata, 1, &base, wksp); + +if (_debug < -1) { +fprintf(stderr, " a %p[%u]:\t", adata, (unsigned)asize), mpfprintln(stderr, asize, adata); +fprintf(stderr, " z %p[%u]:\t", zdata, (unsigned)asize+1), mpfprintln(stderr, asize+1, zdata); +} + result = zdata[asize]; + t[nt] = bchars[result]; + + if (mpz(asize, zdata)) + break; + + anorm = asize - mpsize(asize, zdata); + if (anorm < asize) + asize -= anorm; + mpsetx(asize+1, adata, asize, zdata+anorm); + asize++; + } + /* XXX Fill leading zeroes (if any). */ + while (nt--) + t[nt] = '0'; + return t; +} + +static jsval +mpw_format(JSContext *cx, mpwObject * z, size_t base, int addL) + /*@modifies t @*/ +{ + size_t zsize = MPW_SIZE(z); + mpw* zdata = MPW_DATA(z); + jsval v; + char * s; + size_t i; + size_t nt; + size_t size; + mpw* data; + char * t, * te; + char prefix[5]; + char * tcp = prefix; + int sign; + +#ifdef FIXME + if (z == NULL || !mpw_Check(z)) { + PyErr_BadInternalCall(); + return NULL; + } +#endif + +if (_debug < -1) +fprintf(stderr, "==> %s(%p,%u,%d):\t", __FUNCTION__, z, (unsigned)base, addL), mpfprintln(stderr, zsize, zdata); + + assert(base >= 2 && base <= 36); + + i = 0; + if (addL && initialiser_name != NULL) + i = strlen(initialiser_name) + 2; /* e.g. 'mpw(' + ')' */ + + sign = z->ob_size; + nt = MPBITCNT(zsize, zdata); + if (nt == 0) { + base = 10; /* '0' in every base, right */ + nt = 1; + size = 1; + data = alloca(size * sizeof(*data)); + *data = 0; + } else if (sign < 0) { + *tcp++ = '-'; + i += 1; /* space to hold '-' */ + size = MP_ROUND_B2W(nt); + data = zdata + (zsize - size); + } else { + size = MP_ROUND_B2W(nt); + data = zdata + (zsize - size); + } + + if (addL && size > 1) + i++; /* space for 'L' suffix */ + + nt = mpsizeinbase(size, data, base); + i += nt; + + if (base == 16) { + *tcp++ = '0'; + *tcp++ = 'x'; + i += 2; /* space to hold '0x' */ + } else if (base == 8) { + *tcp++ = '0'; + i += 1; /* space to hold the extra '0' */ + } else if (base > 10) { + *tcp++ = '0' + base / 10; + *tcp++ = '0' + base % 10; + *tcp++ = '#'; + i += 3; /* space to hold e.g. '12#' */ + } else if (base < 10) { + *tcp++ = '0' + base; + *tcp++ = '#'; + i += 2; /* space to hold e.g. '6#' */ + } + + s = xcalloc(1, i+1); + + /* get the beginning of the string memory and start copying things */ + te = s; + if (addL && initialiser_name != NULL && *initialiser_name != '\0') { + te = stpcpy(te, initialiser_name); + *te++ = '('; /*')'*/ + } + + /* copy the already prepared prefix; e.g. sign and base indicator */ + *tcp = '\0'; + t = te = stpcpy(te, prefix); + + (void) mpstr(te, nt, size, data, base); + + /* Nuke leading zeroes. */ + nt = 0; + while (t[nt] == '0') + nt++; + if (t[nt] == '\0') /* all zeroes special case. */ + nt--; + if (nt > 0) + do { + *t = t[nt]; + } while (*t++ != '\0'); + + te += strlen(te); + + if (addL) { + if (size > 1) + *te++ = 'L'; + if (initialiser_name != NULL && *initialiser_name != '\0') + *te++ = /*'('*/ ')'; + } + *te = '\0'; + +assert((te - s) <= (int)i); + + v = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, s)); + s = _free(s); + return v; +} + +/** + * Precomputes the sliding window table for computing powers of x. + * + * Sliding Window Exponentiation, Algorithm 14.85 in "Handbook of Applied Cryptography". + * + * First of all, the table with the powers of g can be reduced by + * about half; the even powers don't need to be accessed or stored. + * + * Get up to K bits starting with a one, if we have that many still available. + * + * Do the number of squarings of A in the first column, then multiply by + * the value in column two, and finally do the number of squarings in + * column three. + * + * This table can be used for K=2,3,4 and can be extended. + * + * +\verbatim + 0 : - | - | - + 1 : 1 | g1 @ 0 | 0 + 10 : 1 | g1 @ 0 | 1 + 11 : 2 | g3 @ 1 | 0 + 100 : 1 | g1 @ 0 | 2 + 101 : 3 | g5 @ 2 | 0 + 110 : 2 | g3 @ 1 | 1 + 111 : 3 | g7 @ 3 | 0 + 1000 : 1 | g1 @ 0 | 3 + 1001 : 4 | g9 @ 4 | 0 + 1010 : 3 | g5 @ 2 | 1 + 1011 : 4 | g11 @ 5 | 0 + 1100 : 2 | g3 @ 1 | 2 + 1101 : 4 | g13 @ 6 | 0 + 1110 : 3 | g7 @ 3 | 1 + 1111 : 4 | g15 @ 7 | 0 +\endverbatim + * + */ +static void mpslide(size_t xsize, const mpw* xdata, + size_t size, /*@out@*/ mpw* slide) + /*@modifies slide @*/ +{ + size_t rsize = (xsize > size ? xsize : size); + mpw* result = alloca(2 * rsize * sizeof(*result)); + + mpsqr(result, xsize, xdata); /* x^2 temp */ + mpsetx(size, slide, xsize+xsize, result); +if (_debug < 0) +fprintf(stderr, "\t x^2:\t"), mpfprintln(stderr, size, slide); + mpmul(result, xsize, xdata, size, slide); /* x^3 */ + mpsetx(size, slide+size, xsize+size, result); +if (_debug < 0) +fprintf(stderr, "\t x^3:\t"), mpfprintln(stderr, size, slide+size); + mpmul(result, size, slide, size, slide+size); /* x^5 */ + mpsetx(size, slide+2*size, size+size, result); +if (_debug < 0) +fprintf(stderr, "\t x^5:\t"), mpfprintln(stderr, size, slide+2*size); + mpmul(result, size, slide, size, slide+2*size); /* x^7 */ + mpsetx(size, slide+3*size, size+size, result); +if (_debug < 0) +fprintf(stderr, "\t x^7:\t"), mpfprintln(stderr, size, slide+3*size); + mpmul(result, size, slide, size, slide+3*size); /* x^9 */ + mpsetx(size, slide+4*size, size+size, result); +if (_debug < 0) +fprintf(stderr, "\t x^9:\t"), mpfprintln(stderr, size, slide+4*size); + mpmul(result, size, slide, size, slide+4*size); /* x^11 */ + mpsetx(size, slide+5*size, size+size, result); +if (_debug < 0) +fprintf(stderr, "\t x^11:\t"), mpfprintln(stderr, size, slide+5*size); + mpmul(result, size, slide, size, slide+5*size); /* x^13 */ + mpsetx(size, slide+6*size, size+size, result); +if (_debug < 0) +fprintf(stderr, "\t x^13:\t"), mpfprintln(stderr, size, slide+6*size); + mpmul(result, size, slide, size, slide+6*size); /* x^15 */ + mpsetx(size, slide+7*size, size+size, result); +if (_debug < 0) +fprintf(stderr, "\t x^15:\t"), mpfprintln(stderr, size, slide+7*size); + mpsetx(size, slide, xsize, xdata); /* x^1 */ +if (_debug < 0) +fprintf(stderr, "\t x^1:\t"), mpfprintln(stderr, size, slide); +} + +/*@observer@*/ /*@unchecked@*/ +static byte mpslide_presq[16] = +{ 0, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 4, 2, 4, 3, 4 }; + +/*@observer@*/ /*@unchecked@*/ +static byte mpslide_mulg[16] = +{ 0, 0, 0, 1, 0, 2, 1, 3, 0, 4, 2, 5, 1, 6, 3, 7 }; + +/*@observer@*/ /*@unchecked@*/ +static byte mpslide_postsq[16] = +{ 0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 }; + +/** + * Exponentiation with precomputed sliding window table. + */ +static void mpnpowsld_w(mpnumber* n, size_t size, const mpw* slide, + size_t psize, const mpw* pdata) + /*@modifies n @*/ +{ + size_t rsize = (n->size > size ? n->size : size); + mpw* rdata = alloca(2 * rsize * sizeof(*rdata)); + short lbits = 0; + short kbits = 0; + byte s; + mpw temp; + short count; + +if (_debug < 0) +fprintf(stderr, "npowsld: p\t"), mpfprintln(stderr, psize, pdata); + /* 2. A = 1, i = t. */ + mpzero(n->size, n->data); + n->data[n->size-1] = 1; + + /* Find first bit set in exponent. */ + temp = *pdata; + count = 8 * sizeof(temp); + while (count != 0) { + if (temp & MP_MSBMASK) + break; + temp <<= 1; + count--; + } + + while (psize) { + while (count != 0) { + + /* Shift next bit of exponent into sliding window. */ + kbits <<= 1; + if (temp & MP_MSBMASK) + kbits++; + + /* On 1st non-zero in window, try to collect K bits. */ + if (kbits != 0) { + if (lbits != 0) + lbits++; + else if (temp & MP_MSBMASK) + lbits = 1; + else + {}; + + /* If window is full, then compute and clear window. */ + if (lbits == 4) { +if (_debug < 0) +fprintf(stderr, "*** #1 lbits %d kbits %d\n", lbits, kbits); + for (s = mpslide_presq[kbits]; s > 0; s--) { + mpsqr(rdata, n->size, n->data); + mpsetx(n->size, n->data, 2*n->size, rdata); +if (_debug < 0) +fprintf(stderr, "\t pre1:\t"), mpfprintln(stderr, n->size, n->data); + } + + mpmul(rdata, n->size, n->data, + size, slide+mpslide_mulg[kbits]*size); + mpsetx(n->size, n->data, n->size+size, rdata); +if (_debug < 0) +fprintf(stderr, "\t mul1:\t"), mpfprintln(stderr, n->size, n->data); + + for (s = mpslide_postsq[kbits]; s > 0; s--) { + mpsqr(rdata, n->size, n->data); + mpsetx(n->size, n->data, 2*n->size, rdata); +if (_debug < 0) +fprintf(stderr, "\tpost1:\t"), mpfprintln(stderr, n->size, n->data); + } + + lbits = kbits = 0; + } + } else { + mpsqr(rdata, n->size, n->data); + mpsetx(n->size, n->data, 2*n->size, rdata); +if (_debug < 0) +fprintf(stderr, "\t sqr:\t"), mpfprintln(stderr, n->size, n->data); + } + + temp <<= 1; + count--; + } + if (--psize) { + count = 8 * sizeof(temp); + temp = *(pdata++); + } + } + + if (kbits != 0) { +if (_debug < 0) +fprintf(stderr, "*** #1 lbits %d kbits %d\n", lbits, kbits); + for (s = mpslide_presq[kbits]; s > 0; s--) { + mpsqr(rdata, n->size, n->data); + mpsetx(n->size, n->data, 2*n->size, rdata); +if (_debug < 0) +fprintf(stderr, "\t pre2:\t"), mpfprintln(stderr, n->size, n->data); + } + + mpmul(rdata, n->size, n->data, + size, slide+mpslide_mulg[kbits]*size); + mpsetx(n->size, n->data, n->size+size, rdata); +if (_debug < 0) +fprintf(stderr, "\t mul2:\t"), mpfprintln(stderr, n->size, n->data); + + for (s = mpslide_postsq[kbits]; s > 0; s--) { + mpsqr(rdata, n->size, n->data); + mpsetx(n->size, n->data, 2*n->size, rdata); +if (_debug < 0) +fprintf(stderr, "\tpost2:\t"), mpfprintln(stderr, n->size, n->data); + } + } +} + +/** + * mpnpow_w + * + * Uses sliding window exponentiation; needs extra storage: + * if K=3, needs 4*size, if K=4, needs 8*size + */ +static void mpnpow_w(mpnumber* n, size_t xsize, const mpw* xdata, + size_t psize, const mpw* pdata) + /*@modifies n @*/ +{ + size_t xbits = MPBITCNT(xsize, xdata); + size_t pbits = MPBITCNT(psize, pdata); + size_t nbits; + mpw *slide; + size_t nsize; + size_t size; + + /* Special case: 0**P and X**(-P) */ + if (xbits == 0 || (psize > 0 && mpmsbset(psize, pdata))) { + mpnsetw(n, 0); + return; + } + /* Special case: X**0 and 1**P */ + if (pbits == 0 || mpisone(xsize, xdata)) { + mpnsetw(n, 1); + return; + } + + /* Normalize (to mpw boundary) exponent. */ + pdata += psize - MP_ROUND_B2W(pbits); + psize -= MP_BITS_TO_WORDS(pbits); + + /* Calculate size of result. */ + if (xbits == 0) xbits = 1; + nbits = (*pdata) * xbits; + nsize = MP_ROUND_B2W(nbits); + + /* XXX Add 1 word to carry sign bit */ + if (!mpmsbset(xsize, xdata) && (nbits & (MP_WBITS - 1)) == 0) + nsize++; + + size = MP_ROUND_B2W(15 * xbits); + +if (_debug < 0) +fprintf(stderr, "*** pbits %u xbits %u nsize %u size %u\n", (unsigned)pbits, (unsigned)xbits, (unsigned)nsize, (unsigned)size); + mpnsize(n, nsize); + + /* 1. Precompute odd powers of x (up to 2**K). */ + slide = (mpw*) alloca( (8*size) * sizeof(mpw)); + + mpslide(xsize, xdata, size, slide); + + /*@-internalglobs -mods@*/ /* noisy */ + mpnpowsld_w(n, size, slide, psize, pdata); + /*@=internalglobs =mods@*/ + +} + +/** z = sqrt(x). */ +static void mpsqrt(mpw* zdata, size_t xsize, const mpw* xdata) +{ + size_t size = MP_BITS_TO_WORDS(mpbits(xsize, xdata) + MP_WBITS); + mpw * ydata = alloca(size * sizeof(*ydata)); + mpw * wdata = alloca(size * sizeof(*wdata)); + mpw * vdata = alloca(size * sizeof(*vdata)); + + /* XXX check x < 0 and raise exception */ + if (mpleone(xsize, xdata)) { + mpsetx(xsize, zdata, xsize, xdata); + return; + } + +// short op = num; + mpsetx(size, ydata, xsize, xdata); +// short res = 0; + mpzero(xsize, zdata); +// short one = 1 << 14; // The second-to-top bit is set: 1L<<30 for long + mpzero(size, wdata); + mpsetmsb(size, wdata); + mpdivtwo(size, wdata); + +// while (one > op) +// one >>= 2; + while (mpgt(size, wdata, ydata)) + mprshift(size, wdata, 2); + +// while (one != 0) + while (!mpz(size, wdata)) { +// if (op >= res + one) + mpsetx(size, vdata, xsize, zdata); + mpadd(size, vdata, wdata); + if (mpge(size, ydata, vdata)) { +// op -= res + one; + mpsubx(size, ydata, xsize, zdata); + mpsub(size, ydata, wdata); +// res = (res >> 1) + one; + mprshift(xsize, zdata, 1); + mpaddx(xsize, zdata, size, wdata); + } else { +// res >>= 1; + mprshift(xsize, zdata, 1); + } +// one >>= 2; + mprshift(size, wdata, 2); + } +} + +/* ---------- */ + +static mpwObject * +mpw_New(int ob_size) + /*@*/ +{ + size_t size = ABS(ob_size); + size_t nb; + mpwObject * z; + + /* XXX Make sure that 0 has allocated space. */ + if (size == 0) + size++; + nb = size * sizeof(*z->data); + z = xmalloc(sizeof(*z)+nb); /* XXX FIXME: JS class wrapping? */ + + z->ob_size = ob_size; + + if (size > 0) + memset(&z->data, 0, nb); + +if (_debug < -1) +fprintf(stderr, "<== %s(%d) z %p\n", __FUNCTION__, ob_size, z); + return z; +} + +static mpwObject * +mpw_FromMPW(size_t size, mpw* data, int normalize) +{ + mpwObject * z; + + if (normalize) { + size_t norm = size - MP_ROUND_B2W(MPBITCNT(size, data)); + if (norm > 0 && norm < size) { + size -= norm; + data += norm; + } + } + + z = mpw_New(size); + if (z == NULL) + return NULL; + + if (size > 0) + memcpy(&z->data, data, size * sizeof(*z->data)); + + return z; +} + +static mpwObject * +mpw_FromLong(long ival) + /*@*/ +{ + mpwObject * z = mpw_New(1); + + if (z == NULL) + return NULL; + + if (ival < 0) { + z->ob_size = -z->ob_size; + ival = -ival; + } + z->data[0] = (mpw) ival; + + return z; +} + +static mpwObject * +mpw_FromDouble(double dval) +{ + static int mbits = 52; + int exp = 0; + double frac = frexp(dval, &exp); + uint64_t flval; + uint64_t llval; +#if (MP_WBITS == 64) + size_t xsize = 1; + mpw xdata[1]; +#else + size_t xsize = 2; + mpw xdata[2]; +#endif + int bits = exp - MP_WBITS; + size_t zsize = 1; + mpwObject * z; + + if (bits > 0) + zsize += MP_BITS_TO_WORDS(bits + MP_WBITS-1); + + if (frac < 0.0) { + frac = -frac; + llval = -dval; + } else + llval = dval; + flval = ldexp(frac, mbits); + +#if (MP_WBITS == 64) + xdata[0] = (mpw)flval; +#else + xdata[0] = (mpw) ((flval >> 32) & 0xffffffff); + xdata[1] = (mpw) ((flval ) & 0xffffffff); +#endif + if (exp == mbits) + exp = 0; /* nothing to do */ + else if (exp < mbits) { + mprshift(xsize, xdata, (mbits - exp)); + exp = 0; + } else if (exp < 64) { + mplshift(xsize, xdata, (exp - mbits)); + exp = 0; + } else + exp -= mbits; + + z = mpw_New(zsize); + mpsetx(MPW_SIZE(z), MPW_DATA(z), xsize, xdata); + if (exp > 0) { + mplshift(MPW_SIZE(z), MPW_DATA(z), exp); + } + if (dval < 0.0) + z->ob_size = -z->ob_size; + + return z; +} + +#define _CHARMASK(_a) (_a) +static mpwObject * +mpw_FromString(const char * str, const char ** sep, int base) + /*@*/ +{ + const char * s = str, * se; + mpwObject * z = NULL; + mpw zbase, zval; + int sign = 1; + int ndigits; + + if ((base != 0 && base < 2) || base > 36) { +#ifdef FIXME + PyErr_SetString(PyExc_ValueError, "mpw() arg 2 must be >= 2 and <= 36"); +#else +assert(0); +#endif + return NULL; + } + while (*s != '\0' && isspace(_CHARMASK(*s))) + s++; + if (*s == '+') + ++s; + else if (*s == '-') { + ++s; + sign = -1; + } + while (*s != '\0' && isspace(_CHARMASK(*s))) + s++; + if (base == 0) { + if (s[0] != '0') + base = 10; + else if (s[1] == 'x' || s[1] == 'X') + base = 16; + else + base = 8; + } + if (base == 16 && s[0] == '0' && (s[1] == 'x' || s[1] == 'X')) + s += 2; + + /* Validate characters as digits of base. */ + for (se = s; *se != '\0'; se++) { + int k; + + if (*se <= '9') + k = *se - '0'; + else if (*se >= 'a') + k = *se - 'a' + 10; + else if (*se >= 'A') + k = *se - 'A' + 10; + else + k = -1; + if (k < 0 || k >= base) + break; + } + if (se == s) + goto onError; + + ndigits = (se - s); + + if (*se == 'L' || *se == 'l') + se++; + while (*se && isspace(_CHARMASK(*se))) + se++; + if (sep) + *sep = se; + if (*se != '\0') + goto onError; + + /* Allocate mpw. */ + + /* Convert digit string. */ + zbase = base; + for (se = s; *se != '\0'; se++) { + if (*se <= '9') + zval = *se - '0'; + else if (*se >= 'a') + zval = *se - 'a' + 10; + else if (*se >= 'A') + zval = *se - 'A' + 10; + } + + if (sign < 0 && z != NULL && z->ob_size != 0) + z->ob_size = -(z->ob_size); + + return z; + +onError: +#ifdef FIXME + PyErr_Format(PyExc_ValueError, "invalid literal for mpw(): %.200s", str); + Py_XDECREF(z); +#endif + return NULL; +} +#undef _CHARMASK + +static mpwObject * +mpw_FromHEX(const char * hex) + /*@*/ +{ + size_t len = strlen(hex); + size_t size = MP_NIBBLES_TO_WORDS(len + MP_WNIBBLES - 1); + mpwObject * z = mpw_New(size); + + if (z != NULL && size > 0) + hs2ip(MPW_DATA(z), size, hex, len); + +if (_debug < 0) +fprintf(stderr, "<== %s(%s) z %p\n\t", __FUNCTION__, hex, z), mpfprintln(stderr, MPW_SIZE(z), MPW_DATA(z)); + return z; +} + +#ifdef NOTYET +static mpwObject * +mpw_FromLongObject(PyLongObject *lo) + /*@*/ +{ + mpwObject * z; + int lsize = ABS(lo->ob_size); + int lbits = DIGITS_TO_BITS(lsize); + size_t zsize = MP_BITS_TO_WORDS(lbits) + 1; + mpw* zdata; + unsigned char * zb; + size_t nzb; + int is_littleendian = 0; + int is_signed = 0; + + lsize = zsize; + if (lo->ob_size < 0) + lsize = -lsize; + z = mpw_New(lsize); + if (z == NULL) + return NULL; + + zdata = MPW_DATA(z); + zb = (unsigned char *) zdata; + nzb = MP_WORDS_TO_BYTES(zsize); + + /* Grab long as big-endian unsigned octets. */ + if (_PyLong_AsByteArray(lo, zb, nzb, is_littleendian, is_signed)) { + Py_XDECREF(z); + return NULL; + } + + /* Endian swap zdata's mpw elements. */ + if (IS_LITTLE_ENDIAN()) { + mpw w = 0; + int zx = 0; + while (nzb) { + w <<= 8; + w |= *zb++; + nzb--; + if ((nzb % MP_WBYTES) == 0) { + zdata[zx++] = w; + w = 0; + } + } + } + + return z; +} +#endif /* NOTYET */ + +/* ---------- */ +#define _c2i(_a, _b) ((int)(((_a)<<8)+(_b))) +#define ADDM _c2i('M', '+') +#define SUBM _c2i('M', '-') +#define MULM _c2i('M', '*') +#define DIVM _c2i('M', '/') /* XXX unimplemented */ +#define MODM _c2i('M', '%') /* XXX unimplemented */ +#define POWM _c2i('M', '^') + +#define ADDP _c2i('P', '+') +#define SUBP _c2i('P', '-') +#define MULP _c2i('P', '*') +#define DIVP _c2i('P', '/') /* XXX unimplemented */ +#define MODP _c2i('P', '%') /* XXX unimplemented */ +#define POWP _c2i('P', '^') + +/** Compute 1 argument operations. */ +static mpwObject * +mpw_ops1(int op, mpwObject *x) + /*@*/ +{ + mpwObject * z = NULL; + +assert(x); + if (x == NULL) + goto exit; + +if (_debug < 0) { +fprintf(stderr, "==> %s(%c)\n", __FUNCTION__, (op & 0xff)); +prtmpw("a", x); +} + + z = mpw_FromMPW(MPW_SIZE(x), MPW_DATA(x), 0); + z->ob_size = x->ob_size; + + switch (op) { + default: + goto exit; + /*@notreached@*/ break; + case '_': + z->ob_size = -z->ob_size; + break; + case 's': /* sqrt(x) */ + mpsqrt(MPW_DATA(z), MPW_SIZE(x), MPW_DATA(x)); + break; + case '!': + if (z->ob_size < 0) + z->ob_size = -z->ob_size; + break; + case '~': +#ifdef DYING + /* Implement ~z as -(z+1) */ + (void) mpaddw(MPW_SIZE(z), MPW_DATA(z), 1); + if (x->ob_size > 0) + z->ob_size = -z->ob_size; +#else + (void) mpnot(MPW_SIZE(z), MPW_DATA(z)); +#endif + break; + } + +if (_debug < 0) +fprintf(stderr, "<== %s(%c) %p[%u]\t", __FUNCTION__, (op & 0xff), MPW_DATA(z), (unsigned)MPW_SIZE(z)), mpfprintln(stderr, MPW_SIZE(z), MPW_DATA(z)); + +exit: +assert(z); + return z; +} + +/** Compute 2 argument operations. */ +static mpwObject * +mpw_ops2(int op, mpwObject *x, mpwObject *m) + /*@*/ +{ + mpwObject * z = NULL; + size_t xsize; + mpw* xdata; + size_t msize; + mpw* mdata; + size_t mnorm; + size_t asize; + mpw* adata; + size_t bsize; + mpw* bdata; + size_t shift; + size_t zsize; + mpw* zdata; + mpw* wksp; + mpbarrett b; + int carry; + int zsign = 0; + + mpbzero(&b); +assert(x); +assert(m); + if (x == NULL || m == NULL) + goto exit; + + xsize = MPW_SIZE(x); + xdata = MPW_DATA(x); + msize = MPW_SIZE(m); + mdata = MPW_DATA(m); + mnorm = msize - mpsize(msize, mdata); + if (mnorm > 0 && mnorm < msize) { + msize -= mnorm; + mdata += mnorm; + } + +if (_debug < 0) { +fprintf(stderr, "==> %s(%c)\n", __FUNCTION__, (op & 0xff)); +prtmpw("a", x); +prtmpw("b", m); +} + + switch (op) { + default: + goto exit; + /*@notreached@*/ break; + case '+': + zsize = MAX(xsize, msize) + 1; + zdata = alloca(zsize * sizeof(*zdata)); + mpsetx(zsize, zdata, xsize, xdata); + if (x->ob_size < 0) { + zsign = 1; + if (m->ob_size < 0) { + carry = mpaddx(zsize-1, zdata+1, msize, mdata); + if (carry) { +if (_debug) +fprintf(stderr, "add --: carry\n"); + *zdata = 1; + } + } else { + carry = mpsubx(zsize-1, zdata+1, msize, mdata); + if (carry) { +if (_debug) +fprintf(stderr, "add -+: borrow\n"); + *zdata = MP_ALLMASK; + mpneg(zsize, zdata); + zsign = 0; + } + } + } else { + zsign = 0; + if (m->ob_size < 0) { + carry = mpsubx(zsize-1, zdata+1, msize, mdata); + if (carry) { +if (_debug) +fprintf(stderr, "add +-: borrow\n"); + *zdata = MP_ALLMASK; + mpneg(zsize, zdata); + zsign = 1; + } + } else { + carry = mpaddx(zsize-1, zdata+1, msize, mdata); + if (carry) { +if (_debug) +fprintf(stderr, "add ++: carry\n"); + *zdata = 1; + } + } + } + z = mpw_FromMPW(zsize, zdata, 1); + if (zsign) + z->ob_size = -z->ob_size; + break; + case '-': + zsize = MAX(xsize, msize) + 1; + zdata = alloca(zsize * sizeof(*zdata)); + mpsetx(zsize, zdata, xsize, xdata); + if (x->ob_size < 0) { + zsign = 1; + if (m->ob_size < 0) { + carry = mpsubx(zsize-1, zdata+1, msize, mdata); + if (carry) { +if (_debug) +fprintf(stderr, "sub --: borrow\n"); + *zdata = MP_ALLMASK; + mpneg(zsize, zdata); + zsign = 0; + } + } else { + carry = mpaddx(zsize-1, zdata+1, msize, mdata); + if (carry) { +if (_debug) +fprintf(stderr, "sub -+: carry\n"); + *zdata = 1; + } + } + } else { + zsign = 0; + if (m->ob_size < 0) { + carry = mpaddx(zsize-1, zdata+1, msize, mdata); + if (carry) { +if (_debug) +fprintf(stderr, "sub +-: carry\n"); + *zdata = 1; + } + } else { + carry = mpsubx(zsize-1, zdata+1, msize, mdata); + if (carry) { +if (_debug) +fprintf(stderr, "sub ++: borrow\n"); + *zdata = MP_ALLMASK; + mpneg(zsize, zdata); + zsign = 1; + } + } + } + z = mpw_FromMPW(zsize-1, zdata+1, 1); + if (zsign) + z->ob_size = -z->ob_size; + break; + case '*': + zsize = xsize + msize; + zdata = alloca(zsize * sizeof(*zdata)); + zsign = x->ob_size * m->ob_size; + mpmul(zdata, xsize, xdata, msize, mdata); + z = mpw_FromMPW(zsize, zdata, 1); + if (zsign < 0) + z->ob_size = -z->ob_size; + break; + case '/': + asize = xsize+1; + adata = alloca(asize * sizeof(*adata)); + mpsetx(asize, adata, xsize, xdata); + bsize = msize; + bdata = alloca(bsize * sizeof(*bdata)); + mpsetx(bsize, bdata, msize, mdata); + + zsize = asize + 1; + zdata = alloca(zsize * sizeof(*zdata)); + zsign = x->ob_size * m->ob_size; + wksp = alloca((bsize+1) * sizeof(*wksp)); + + shift = mpnorm(bsize, bdata); + mplshift(asize, adata, shift); + mpndivmod(zdata, asize, adata, bsize, bdata, wksp); + + zsize -= bsize; + + if (zsign < 0) + (void) mpaddw(zsize, zdata, (mpw)1); + + z = mpw_FromMPW(zsize, zdata, 1); + if (zsign < 0) + z->ob_size = -z->ob_size; + break; + case '%': + if (mpz(msize, mdata)) { + z = mpw_FromMPW(xsize, xdata, 1); + break; + } + asize = MAX(xsize, msize) + 1; + adata = alloca(asize * sizeof(*adata)); + mpsetx(asize, adata, xsize, xdata); + bsize = msize; + bdata = mdata; + + zsize = asize; + zdata = alloca(zsize * sizeof(*zdata)); + zsign = x->ob_size * m->ob_size; + wksp = alloca((2*bsize+1) * sizeof(*wksp)); + + mpmod(zdata, asize, adata, bsize, bdata, wksp); + +#ifdef NOTYET + if (zsign < 0) { + if (m->ob_size < 0) { + (void) mpsubx(zsize, zdata, bsize, bdata); + mpneg(zsize, zdata); + } else if (x->ob_size < 0) { + mpneg(zsize, zdata); + (void) mpaddx(zsize, zdata, bsize, bdata); + } + } +#endif + + z = mpw_FromMPW(zsize, zdata, 1); + +#ifdef NOTYET + if (zsign < 0) +#endif + { +#ifdef PYTHON_DIVISOR + if (m->ob_size < 0) /* divisor determines sign. */ +#else + if (x->ob_size < 0) /* dividend determines sign. */ +#endif + z->ob_size = -z->ob_size; + } + break; + case '<': + /* XXX FIXME: negative count? sign?. */ + shift = (size_t) (msize == 1 ? (mdata[0] & 0x00ffffff) : 0); + msize = MP_ROUND_B2W(shift - mpmszcnt(xsize, xdata)); + asize = MAX(xsize, msize); + adata = alloca(asize * sizeof(*adata)); + mpsetx(asize, adata, xsize, xdata); + if (shift > 0) + mplshift(asize, adata, shift); + z = mpw_FromMPW(asize, adata, 0); + break; + case '>': + /* XXX FIXME: negative count? sign?. */ + shift = (size_t) (msize == 1 ? mdata[0] : 0); + z = mpw_FromMPW(xsize, xdata, 0); + if (shift > 0) + mprshift(MPW_SIZE(z), MPW_DATA(z), shift); + break; + case '&': + /* XXX reset to original size for now. */ + msize = MPW_SIZE(m); + mdata = MPW_DATA(m); + if (xsize <= msize) { + z = mpw_FromMPW(xsize, xdata, 0); + mpand(MPW_SIZE(z), MPW_DATA(z), mdata + (msize - xsize)); + } else { + z = mpw_FromMPW(msize, mdata, 0); + mpand(MPW_SIZE(z), MPW_DATA(z), xdata + (xsize - msize)); + } + break; + case '|': + /* XXX reset to original size for now. */ + msize = MPW_SIZE(m); + mdata = MPW_DATA(m); + if (xsize <= msize) { + z = mpw_FromMPW(xsize, xdata, 0); + mpor(MPW_SIZE(z), MPW_DATA(z), mdata + (msize - xsize)); + } else { + z = mpw_FromMPW(msize, mdata, 0); + mpor(MPW_SIZE(z), MPW_DATA(z), xdata + (xsize - msize)); + } + break; + case '^': + /* XXX reset to original size for now. */ + msize = MPW_SIZE(m); + mdata = MPW_DATA(m); + if (xsize <= msize) { + z = mpw_FromMPW(xsize, xdata, 0); + mpxor(MPW_SIZE(z), MPW_DATA(z), mdata + (msize - xsize)); + } else { + z = mpw_FromMPW(msize, mdata, 0); + mpxor(MPW_SIZE(z), MPW_DATA(z), xdata + (xsize - msize)); + } + break; + case 'P': + { mpnumber zn; + + mpnzero(&zn); + if (msize == 0 || (msize == 1 && *mdata == 0)) + mpnsetw(&zn, 1); + else if (mpz(xsize, xdata) || m->ob_size < 0) + mpnsetw(&zn, 0); + else { + zsign = (x->ob_size > 0 || mpeven(msize, mdata)) ? 1 : -1; + mpnpow_w(&zn, xsize, xdata, msize, mdata); + } + z = mpw_FromMPW(zn.size, zn.data, 1); + mpnfree(&zn); + if (zsign < 0) + z->ob_size = -z->ob_size; + } break; + case 'G': + /* XXX this scaling is not correct. */ + wksp = alloca((xsize) * sizeof(*wksp)); + z = mpw_New(msize); + mpgcd_w(xsize, xdata, mdata, MPW_DATA(z), wksp); + break; + case 'I': + wksp = alloca(((1+1+6)*msize+6)*sizeof(*wksp)); + mpsetx(msize, wksp+msize, xsize, xdata); + (void) mpextgcd_w(msize, mdata, wksp+msize, wksp, wksp+2*msize); + z = mpw_FromMPW(msize, wksp, 0); + break; +#ifdef DYING + case 'R': + { rngObject * r = ((rngObject *)x); + + wksp = alloca(msize*sizeof(*wksp)); + mpbset(&b, msize, mdata); + z = mpw_New(msize); + mpbrnd_w(&b, &r->rngc, MPW_DATA(z), wksp); + } break; +#endif + case 'S': + /* XXX is scaling correct if xsize > msize? */ + wksp = alloca((4*msize+2)*sizeof(*wksp)); + mpbset(&b, msize, mdata); + z = mpw_New(msize); + mpbsqrmod_w(&b, xsize, xdata, MPW_DATA(z), wksp); + break; + } + +if (_debug) +fprintf(stderr, "<== %s(%c) %p[%u]\t", __FUNCTION__, (op & 0xff), MPW_DATA(z), (unsigned)MPW_SIZE(z)), mpfprintln(stderr, MPW_SIZE(z), MPW_DATA(z)); + +exit: + mpbfree(&b); +assert(z); + return z; +} + +/** Compute 3 argument operations. */ +static mpwObject * +mpw_ops3(int op, mpwObject *x, mpwObject *y, mpwObject *m) + /*@*/ +{ + mpwObject * z = NULL; + size_t xsize; + mpw* xdata; + size_t ysize; + mpw* ydata; + size_t msize; + mpw* mdata; + size_t zsize; + mpw* zdata; + mpbarrett b; + mpw* wksp; + + mpbzero(&b); +assert(x); +assert(y); +assert(m); + if (x == NULL || y == NULL || m == NULL) + goto exit; + +if (_debug < 0) { +fprintf(stderr, "==> %s(%c)\n", __FUNCTION__, (op & 0xff)); +prtmpw("a", x); +prtmpw("b", y); +prtmpw("c", m); +} + + xsize = MPW_SIZE(x); + xdata = MPW_DATA(x); + ysize = MPW_SIZE(y); + ydata = MPW_DATA(y); + msize = MPW_SIZE(m); + mdata = MPW_DATA(m); + + mpbset(&b, msize, mdata); + + zsize = b.size; + zdata = alloca(zsize * sizeof(*zdata)); + +#ifdef NOTYET /* XXX no known scaling problems (yet) */ + wksp = alloca(zsize * sizeof(*zdata)); + mpsetx(zsize, wksp, xsize, xdata); + xsize = zsize; + xdata = wksp; + wksp = alloca(zsize * sizeof(*zdata)); + mpsetx(zsize, wksp, ysize, ydata); + ysize = zsize; + ydata = wksp; +#endif + + wksp = alloca((4*zsize+2)*sizeof(*wksp)); + + switch (op) { + case DIVM: /* XXX unimplemented */ + case MODM: /* XXX unimplemented */ + default: + goto exit; + /*@notreached@*/ break; + case ADDM: + mpbaddmod_w(&b, xsize, xdata, ysize, ydata, zdata, wksp); + break; + case SUBM: + mpbsubmod_w(&b, xsize, xdata, ysize, ydata, zdata, wksp); + break; + case MULM: + mpbmulmod_w(&b, xsize, xdata, ysize, ydata, zdata, wksp); + break; + case POWM: + mpbpowmod_w(&b, xsize, xdata, ysize, ydata, zdata, wksp); + break; + } + + z = mpw_FromMPW(zsize, zdata, 1); + +exit: +if (_debug < 0) +fprintf(stderr, "<== %s(%c) %p[%u]\t", __FUNCTION__, (op & 0xff), MPW_DATA(z), (unsigned)MPW_SIZE(z)), mpfprintln(stderr, MPW_SIZE(z), MPW_DATA(z)); + + mpbfree(&b); +assert(z); + return z; +} + +#ifdef NOTYET +static uint32_t ceillog2(uint32_t v) +{ + v--; + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + v++; + return v; +} +#endif + +/** Compute 3 argument polynomial operations. */ +static mpwObject * +mpw_pops3(int op, mpwObject *x, mpwObject *y, mpwObject *m) + /*@*/ +{ + mpwObject * z = NULL; + +assert(x); +assert(y); +assert(m); + if (x == NULL || y == NULL || m == NULL) + goto exit; + + /* Handle GF(2^m) extension field polynomial arithmetic. */ + switch (op) { + case DIVP: /* XXX unimplemented */ + case MODP: /* XXX unimplemented */ + default: +assert(0); + /*@notreached@*/ break; + case ADDP: + z = mpw_ops2('^', x, y); + /* XXX reduce modulo p */ + break; + case SUBP: + z = mpw_ops2('^', x, y); + /* XXX reduce modulo p */ + break; + case MULP: + z = mpw_ops3(MULM, x, y, m); /* FIXME */ + /* XXX reduce modulo p */ + break; + case POWP: + z = mpw_ops3(POWM, x, y, m); /* FIXME */ + /* XXX reduce modulo p */ + break; + } + +exit: +if (_debug < 0) +fprintf(stderr, "<== %s(%c) %p[%u]\t", __FUNCTION__, (op & 0xff), MPW_DATA(z), (unsigned)MPW_SIZE(z)), mpfprintln(stderr, MPW_SIZE(z), MPW_DATA(z)); + +assert(z); + return z; +} + +static JSBool +mpw_wrap(JSContext * cx, jsval * vp, mpwObject * z) +{ + JSObject *o; + JSBool ok = JS_FALSE; + +assert(z != NULL); + if ((o = JS_NewObject(cx, &rpmmpwClass, NULL, NULL)) != NULL + && JS_SetPrivate(cx, o, (void *)z)) + { + *vp = OBJECT_TO_JSVAL(o); + ok = JS_TRUE; + } else + *vp = JSVAL_VOID; +if (_debug < 0) +fprintf(stderr, "<== %s(%p,%p,0x%x[%s])\t", __FUNCTION__, cx, z, (unsigned)*vp, v2s(cx, *vp)), mpfprintln(stderr, MPW_SIZE(z), MPW_DATA(z)); + return ok; +} + +static mpwObject * +mpw_j2mpw(JSContext *cx, jsval v) +{ + mpwObject * z = NULL; + if (JSVAL_IS_INT(v)) + z = mpw_FromLong(JSVAL_TO_INT(v)); + else if (JSVAL_IS_DOUBLE(v)) + z = mpw_FromDouble((double)JSVAL_TO_DOUBLE(v)); + else if (JSVAL_IS_STRING(v)) { + const char * s = JS_EncodeString(cx, JSVAL_TO_STRING(v)); + z = mpw_FromHEX(s); + s = _free(s); + } + else if (JSVAL_IS_OBJECT(v)) { + JSObject *o = JSVAL_TO_OBJECT(v); + if (OBJ_IS_MPW(cx, o)) + z = JS_GetInstancePrivate(cx, o, &rpmmpwClass, NULL); + } +if (z == NULL) { +fprintf(stderr, "*** %s: 0x%x[%s]\n", __FUNCTION__, (unsigned)v, v2s(cx, v)); +assert(z != NULL); +} + return z; +} + +/* --- Object methods */ + +/** Convert to string. */ +static JSBool +mpw_toString(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpwClass, NULL); + jsuint _base = 10; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + if ((ok = JS_ConvertArguments(cx, argc, argv, "/u", &_base))) { + /* XXX FIXME check _base is 0 or [2,36] */ + *vp = mpw_format(cx, ptr, _base, 0); + } else + *vp = JSVAL_VOID; + return ok; +} + +#ifdef NOTYET +/** Convert to string in base 10. */ +static JSBool +mpw_valueOf(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpwClass, NULL); + jsuint _base = 10; + JSBool ok = JS_TRUE; + +_METHOD_DEBUG_ENTRY(_debug); + *vp = mpw_format(cx, ptr, _base, 0); + return ok; +} +#endif + +/** Miller-Rabin prime test. */ +static JSBool +mpw_isPrime(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpwClass, NULL); + mpwObject * z = ptr; + size_t zsize = (z ? MPW_SIZE(z) : 0); + mpw * zdata = (z ? MPW_DATA(z) : NULL); + jsuint _trials = mpptrials(MP_WORDS_TO_BITS(zsize)); + JSBool ok = JS_TRUE; + +_METHOD_DEBUG_ENTRY(_debug); + if (z == NULL || zsize == 0 || zdata == NULL + || (ok = JS_ConvertArguments(cx, argc, argv, "/u", &_trials))) + { + /* XXX select "FIPS 186" or "Mersenne Twister" */ + const randomGenerator* rng = randomGeneratorDefault(); + randomGeneratorContext rngc; + + if (!randomGeneratorContextInit(&rngc, rng)) { + mpw * wksp = alloca((8*zsize+2) * sizeof(*wksp)); + mpbarrett b; + + mpbzero(&b); + mpbset(&b, zsize, zdata); + *vp = mpbpprime_w(&b, &rngc, _trials, wksp) + ? JSVAL_TRUE : JSVAL_FALSE; + mpbfree(&b); + } else + *vp = JSVAL_FALSE; + randomGeneratorContextFree(&rngc); + } else + *vp = JSVAL_FALSE; + return ok; +} + +/** Return random k invertible modulo q. */ +static JSBool +mpw_randomK(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpwClass, NULL); + mpwObject * q = ptr; + JSBool ok = JS_TRUE; + +_METHOD_DEBUG_ENTRY(_debug); + if (q) { + /* XXX select "FIPS 186" or "Mersenne Twister" */ + const randomGenerator* rng = randomGeneratorDefault(); + randomGeneratorContext rngc; + + if (!randomGeneratorContextInit(&rngc, rng)) { + size_t qsize = MPW_SIZE(q); + mpw *qdata = MPW_DATA(q); + mpw *wksp = alloca(((1+1+6)*qsize+6) * sizeof(*wksp)); + mpbarrett b; + + mpbzero(&b); + mpbset(&b, qsize, qdata); + mpbrndinv_w(&b, &rngc, wksp, wksp+qsize, wksp+2*qsize); + ok = mpw_wrap(cx, vp, mpw_FromMPW(qsize, wksp, 0)); + mpbfree(&b); + } else + *vp = JSVAL_NULL; + randomGeneratorContextFree(&rngc); + } else + *vp = JSVAL_NULL; + return ok; +} + +/** Return eq(x, y). */ +static JSBool +mpw_eq(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpwClass, NULL); + JSBool ok = JS_TRUE; + +_METHOD_DEBUG_ENTRY(_debug); + if (argc == 2) { + mpwObject * x = mpw_j2mpw(cx, argv[0]); + mpwObject * y = mpw_j2mpw(cx, argv[1]); + + *vp = ((x->ob_size * y->ob_size) > 0 && mpeqx(MPW_SIZE(x), MPW_DATA(x), MPW_SIZE(y), MPW_DATA(y))) + ? JSVAL_TRUE : JSVAL_FALSE; + + if (!JSVAL_IS_MPW(cx, argv[0])) x = _free(x); + if (!JSVAL_IS_MPW(cx, argv[1])) y = _free(y); + } else + ok = JS_FALSE; + return ok; +} + +/** Return ne(x, y). */ +static JSBool +mpw_ne(JSContext *cx, uintN argc, jsval *vp) +{ + JSBool ok = JS_TRUE; + if ((ok = mpw_eq(cx, argc, vp))) + *vp = (*vp == JSVAL_TRUE ? JSVAL_FALSE : JSVAL_TRUE); + return ok; +} + +/** Return lt(x, y). */ +static JSBool +mpw_lt(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpwClass, NULL); + JSBool ok = JS_TRUE; + +_METHOD_DEBUG_ENTRY(_debug); + if (argc == 2) { + mpwObject * x = mpw_j2mpw(cx, argv[0]); + mpwObject * y = mpw_j2mpw(cx, argv[1]); + + if (x->ob_size < 0 && y->ob_size > 0) + *vp = JSVAL_TRUE; + else + if (x->ob_size > 0 && y->ob_size < 0) + *vp = JSVAL_FALSE; + else + if (x->ob_size < 0 && y->ob_size < 0) + *vp = mpgtx(MPW_SIZE(x), MPW_DATA(x), MPW_SIZE(y), MPW_DATA(y)) + ? JSVAL_TRUE : JSVAL_FALSE; + if (x->ob_size > 0 && y->ob_size > 0) + *vp = mpltx(MPW_SIZE(x), MPW_DATA(x), MPW_SIZE(y), MPW_DATA(y)) + ? JSVAL_TRUE : JSVAL_FALSE; + + if (!JSVAL_IS_MPW(cx, argv[0])) x = _free(x); + if (!JSVAL_IS_MPW(cx, argv[1])) y = _free(y); + } else + ok = JS_FALSE; + return ok; +} + +/** Return ge(x, y). */ +static JSBool +mpw_ge(JSContext *cx, uintN argc, jsval *vp) +{ + JSBool ok = JS_TRUE; + if ((ok = mpw_lt(cx, argc, vp))) + *vp = (*vp == JSVAL_TRUE ? JSVAL_FALSE : JSVAL_TRUE); + return ok; +} + +/** Return gt(x, y). */ +static JSBool +mpw_gt(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpwClass, NULL); + JSBool ok = JS_TRUE; + +_METHOD_DEBUG_ENTRY(_debug); + if (argc == 2) { + mpwObject * x = mpw_j2mpw(cx, argv[0]); + mpwObject * y = mpw_j2mpw(cx, argv[1]); + + if (x->ob_size < 0 && y->ob_size > 0) + *vp = JSVAL_FALSE; + else + if (x->ob_size > 0 && y->ob_size < 0) + *vp = JSVAL_TRUE; + else + if (x->ob_size < 0 && y->ob_size < 0) + *vp = mpltx(MPW_SIZE(x), MPW_DATA(x), MPW_SIZE(y), MPW_DATA(y)) + ? JSVAL_TRUE : JSVAL_FALSE; + if (x->ob_size > 0 && y->ob_size > 0) + *vp = mpgtx(MPW_SIZE(x), MPW_DATA(x), MPW_SIZE(y), MPW_DATA(y)) + ? JSVAL_TRUE : JSVAL_FALSE; + + if (!JSVAL_IS_MPW(cx, argv[0])) x = _free(x); + if (!JSVAL_IS_MPW(cx, argv[1])) y = _free(y); + } else + ok = JS_FALSE; + return ok; +} + +/** Return le(x, y). */ +static JSBool +mpw_le(JSContext *cx, uintN argc, jsval *vp) +{ + JSBool ok = JS_TRUE; + if ((ok = mpw_gt(cx, argc, vp))) + *vp = (*vp == JSVAL_TRUE ? JSVAL_FALSE : JSVAL_TRUE); + return ok; +} + +/** Return min(x, y). */ +static JSBool +mpw_min(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpwClass, NULL); + JSBool ok = JS_TRUE; + +_METHOD_DEBUG_ENTRY(_debug); + /* XXX generalize to N values? */ + if (argc == 2) { + mpwObject * x = mpw_j2mpw(cx, argv[0]); + mpwObject * y = mpw_j2mpw(cx, argv[1]); + + if (x->ob_size < 0 && y->ob_size > 0) + *vp = argv[0]; + else + if (x->ob_size > 0 && y->ob_size < 0) + *vp = argv[1]; + else + if (x->ob_size < 0 && y->ob_size < 0) + *vp = mpgex(MPW_SIZE(x), MPW_DATA(x), MPW_SIZE(y), MPW_DATA(y)) + ? argv[0] : argv[1]; + else + if (x->ob_size > 0 && y->ob_size > 0) + *vp = mplex(MPW_SIZE(x), MPW_DATA(x), MPW_SIZE(y), MPW_DATA(y)) + ? argv[0] : argv[1]; + + if (!JSVAL_IS_MPW(cx, argv[0])) x = _free(x); + if (!JSVAL_IS_MPW(cx, argv[1])) y = _free(y); + } else + ok = JS_FALSE; + return ok; +} + +/** Return max(x, y). */ +static JSBool +mpw_max(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpwClass, NULL); + JSBool ok = JS_TRUE; + +_METHOD_DEBUG_ENTRY(_debug); + /* XXX generalize to N values? */ + if (argc == 2) { + mpwObject * x = mpw_j2mpw(cx, argv[0]); + mpwObject * y = mpw_j2mpw(cx, argv[1]); + + if (x->ob_size < 0 && y->ob_size > 0) + *vp = argv[1]; + else + if (x->ob_size > 0 && y->ob_size < 0) + *vp = argv[0]; + else + if (x->ob_size < 0 && y->ob_size < 0) + *vp = mpgex(MPW_SIZE(x), MPW_DATA(x), MPW_SIZE(y), MPW_DATA(y)) + ? argv[1] : argv[0]; + else + if (x->ob_size > 0 && y->ob_size > 0) + *vp = mplex(MPW_SIZE(x), MPW_DATA(x), MPW_SIZE(y), MPW_DATA(y)) + ? argv[1] : argv[0]; + + if (!JSVAL_IS_MPW(cx, argv[0])) x = _free(x); + if (!JSVAL_IS_MPW(cx, argv[1])) y = _free(y); + } else + ok = JS_FALSE; + return ok; +} + +#ifdef DYING +/** Return random number 1 < r < b-1. */ +static JSBool +mpw_Rndm(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpwClass, NULL); + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); +assert(argc == 2); + ok = mpw_wrap(cx, vp, + mpw_ops2('R', mpw_j2mpw(cx, argv[0]), mpw_j2mpw(cx, argv[1]))); + return ok; +} +#endif + +static JSFunctionSpec rpmmpw_funcs[] = { +#ifdef NOTYET + JS_FS("toExponential", mpw_toExponential, 0,0), + JS_FS("toFixed", mpw_toFixed, 0,0), + JS_FS("toLocaleString", mpw_toLocaleString, 0,0), + JS_FS("toSource", mpw_toSource, 0,0), + JS_FS("toJSON", mpw_toJSON, 0,0), + JS_FS("valueOf", mpw_valueOf, 0,0), +#endif + JS_FS("toString", mpw_toString, 0,0), + JS_FS("isPrime", mpw_isPrime, 0,0), + JS_FS("randomK", mpw_randomK, 0,0), + JS_FS("eq", mpw_eq, 0,0), + JS_FS("ne", mpw_ne, 0,0), + JS_FS("lt", mpw_lt, 0,0), + JS_FS("ge", mpw_ge, 0,0), + JS_FS("gt", mpw_gt, 0,0), + JS_FS("le", mpw_le, 0,0), + JS_FS("min", mpw_min, 0,0), + JS_FS("max", mpw_max, 0,0), + JS_FS_END +}; + +/* --- Object properties */ +enum rpmmpw_tinyid { + _DEBUG = -2, +}; + +static JSPropertySpec rpmmpw_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmmpw_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpwClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmmpw_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpwClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmmpw_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpwClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmmpw_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static mpwObject * +rpmmpw_init(JSContext *cx, JSObject *obj, jsval v) +{ + mpwObject * z = NULL; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p,0x%x[%s])\n", __FUNCTION__, cx, obj, (unsigned)v, v2s(cx, v)); + + if (JSVAL_IS_INT(v)) { + z = mpw_FromLong((long)JSVAL_TO_INT(v)); + } else + if (JSVAL_IS_DOUBLE(v)) { + z = mpw_FromDouble((double)JSVAL_TO_DOUBLE(v)); + } else + if (JSVAL_IS_STRING(v)) { + const char * s = JS_EncodeString(cx, JSVAL_TO_STRING(v)); + z = mpw_FromHEX(s); + s = _free(s); + } else { + z = mpw_New(1); + } + + if (!JS_SetPrivate(cx, obj, (void *)z)) + z = _free(z); +if (_debug) +fprintf(stderr, "<== %s(%p,%p,0x%x[%s]) z %p\n", __FUNCTION__, cx, obj, (unsigned)v, v2s(cx, v), z); + return z; +} + +static void +rpmmpw_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmmpwClass, NULL); + mpwObject * z = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + (void) _free(z); +} + +static JSBool +rpmmpw_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + jsval v = JSVAL_NULL; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/v", &v))) + goto exit; + + if (JS_IsConstructing(cx, vp)) { + (void) rpmmpw_init(cx, obj, v); + } else { + if ((obj = JS_NewObject(cx, &rpmmpwClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmmpw_call(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + /* XXX obj is the global object so lookup "this" object. */ + JSObject * o = NULL; + void * ptr = NULL; + mpwObject * z = ptr; + JSBool ok = JS_TRUE; + jsval v = JSVAL_NULL; + void ** stack = memset(alloca(argc*sizeof(*stack)), 0, (argc*sizeof(*stack))); + char * freeme = memset(alloca(argc*sizeof(*freeme)), 0, (argc*sizeof(*freeme))); + int ix = -1; + uintN i; + + switch (argc) { + case 0: + /* Return a new Mpw object. */ + if ((o = rpmjs_NewMpwObject(cx, v)) != NULL) + ptr = z = JS_GetInstancePrivate(cx, o, &rpmmpwClass, NULL); + *vp = OBJECT_TO_JSVAL(o); + ok = JS_TRUE; + break; + default: + *vp = JSVAL_NULL; + for (i = 0; i < argc; i++) { + v = argv[i]; + + /* Check for operations. */ + if (JSVAL_IS_STRING(v)) { + const char * s = JS_EncodeString(cx, JSVAL_TO_STRING(v)); + size_t ns = strlen(s); + int c = (ns == 1 ? *s : 0); + + if (ns == 0) { + s = _free(s); + continue; + } + + if (!strcmp(s, "**")) c = (int)'P'; + if (!strcmp(s, "<<")) c = (int)'<'; + if (!strcmp(s, ">>")) c = (int)'>'; + if (!strcmp(s, "sqrt")) c = (int)'s'; + if (!strcmp(s, "abs")) c = (int)'!'; + if (!strcmp(s, "not")) c = (int)'~'; + if (!strcmp(s, "neg")) c = (int)'_'; + if (!strcmp(s, "gcd")) c = (int)'G'; /* gcd(x, y). */ + if (!strcmp(s, "invm")) c = (int)'I'; /* inverse of x (modulo m). */ + if (!strcmp(s, "sqrm")) c = (int)'S'; /* x*x (modulo m). */ +#ifdef DYING + if (!strcmp(s, "rndm")) c = (int)'R'; /** random 1 < r < b-1. */ +#endif + + switch (c) { + case 's': /* sqrt(x) */ + case '!': /* abs(x) */ + case '_': /* -x */ + case '~': /* ~x */ +assert(ix >= 0); + z = stack[ix]; + stack[ix] = mpw_ops1(c, z); + if (freeme[ix]) z = _free(z); + freeme[ix] = 1; + break; + case '%': /* x % y */ + case '/': /* x / y */ + /* XXX divide-by-zero check. */ +assert(ix > 0); + z = stack[ix]; +assert(mpz(MPW_SIZE(z), MPW_DATA(z)) == 0); + /*@fallthrough@*/ + case '+': /* x + y */ + case '-': /* x - y */ + case '*': /* x * y */ + case 'P': /* x ** y */ + case 'G': /* gcd(x, y) */ + case 'I': /* inverse of x (modulo m) */ + case 'S': /* x * x (modulo m) */ + case '<': /* x << y */ + case '>': /* x >> y */ + case '&': /* x & y */ + case '^': /* x ^ y */ + case '|': /* x | y */ +assert(--ix >= 0); + z = stack[ix]; + stack[ix] = mpw_ops2(c, z, stack[ix+1]); + if (freeme[ix+1]) stack[ix+1] = _free(stack[ix+1]); freeme[ix+1] = 0; + if (freeme[ix]) z = _free(z); + freeme[ix] = 1; + break; + default: + case 0: + if (!strcmp(s, "addm")) c = ADDM; /* x+x (modulo m) */ + if (!strcmp(s, "subm")) c = SUBM; /* x-x (modulo m) */ + if (!strcmp(s, "mulm")) c = MULM; /* x*x (modulo m) */ + if (!strcmp(s, "powm")) c = POWM; /* x**x (modulo m) */ + if (!strcmp(s, "addp")) c = ADDP; /* x+x (modulo p) */ + if (!strcmp(s, "subp")) c = SUBP; /* x-x (modulo p) */ + if (!strcmp(s, "mulp")) c = MULP; /* x*x (modulo p) */ + if (!strcmp(s, "powp")) c = POWP; /* x**x (modulo p) */ + if (c) { +assert(--ix >= 0); +assert(--ix >= 0); + z = stack[ix]; + + switch (c) { + case ADDM: + case SUBM: + case MULM: + case POWM: + stack[ix] = mpw_ops3(c, z, stack[ix+1], stack[ix+2]); + break; + case ADDP: + case SUBP: + case MULP: + case POWP: + stack[ix] = mpw_pops3(c, z, stack[ix+1], stack[ix+2]); + break; + } + + if (freeme[ix+2]) stack[ix+2] = _free(stack[ix+2]); freeme[ix+2] = 0; + if (freeme[ix+1]) stack[ix+1] = _free(stack[ix+1]); freeme[ix+1] = 0; + if (freeme[ix]) z = _free(z); + freeme[ix] = 1; + } else { +assert(++ix < (int)argc); + stack[ix] = mpw_j2mpw(cx, v); + freeme[ix] = 1; + } + + break; + } + s = _free(s); + } else { +assert(++ix < (int)argc); + stack[ix] = mpw_j2mpw(cx, v); + freeme[ix] = (!JSVAL_IS_MPW(cx, v) ? 1 : 0); + } + } + if (ix < 0) { + ok = JS_TRUE; + *vp = JSVAL_NULL; + o = NULL; + ptr = z = NULL; + } else { + mpwObject * x = stack[ix]; + ptr = z = mpw_FromMPW(MPW_SIZE(x), MPW_DATA(x), 0); + if (x->ob_size < 0) + z->ob_size = -z->ob_size; + ok = mpw_wrap(cx, vp, z); + o = JSVAL_TO_OBJECT(*vp); + } + while (ix >= 0) { + if (freeme[ix]) stack[ix] = _free(stack[ix]); freeme[ix] = 0; + ix--; + } + break; + } + +if (_debug) +fprintf(stderr, "<== %s(%p,%p[%u],%p) o %p ptr %p\t", __FUNCTION__, cx, argv, (unsigned)argc, vp, o, ptr), mpfprintln(stderr, MPW_SIZE(z), MPW_DATA(z)); + + return ok; +} + +/* --- Class initialization */ +JSClass rpmmpwClass = { + /* XXX class should be "BeeCrypt" eventually, avoid name conflicts for now */ + "Mpw", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmmpw_addprop, rpmmpw_delprop, rpmmpw_getprop, rpmmpw_setprop, + (JSEnumerateOp)rpmmpw_enumerate, (JSResolveOp)rpmmpw_resolve, + rpmmpw_convert, rpmmpw_dtor, + + rpmmpw_getobjectops, rpmmpw_checkaccess, + rpmmpw_call, rpmmpw_construct, + rpmmpw_xdrobject, rpmmpw_hasinstance, + rpmmpw_mark, rpmmpw_reserveslots, +}; + +JSObject * +rpmjs_InitMpwClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmmpwClass, rpmmpw_ctor, 1, + rpmmpw_props, rpmmpw_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewMpwObject(JSContext *cx, jsval v) +{ + JSObject *obj; + mpwObject * z; + + if ((obj = JS_NewObject(cx, &rpmmpwClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((z = rpmmpw_init(cx, obj, v)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmmpw, Mpw, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmmpw-js.h b/rpm-5.4.9/js/rpmmpw-js.h new file mode 100644 index 0000000..cbfbec1 --- /dev/null +++ b/rpm-5.4.9/js/rpmmpw-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMMPW_JS +#define H_RPMMPW_JS + +/** + * \file js/rpmmpw-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmmpwClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitMpwClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewMpwObject(JSContext *cx, jsval v); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMMPW_JS */ diff --git a/rpm-5.4.9/js/rpmps-js.c b/rpm-5.4.9/js/rpmps-js.c new file mode 100644 index 0000000..4e5e856 --- /dev/null +++ b/rpm-5.4.9/js/rpmps-js.c @@ -0,0 +1,298 @@ +/** \ingroup js_c + * \file js/rpmps-js.c + */ + +#include "system.h" + +#include "rpmps-js.h" +#include "rpmjs-debug.h" + +#define _RPMPS_INTERNAL +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +#define rpmps_addprop JS_PropertyStub +#define rpmps_delprop JS_PropertyStub +#define rpmps_convert JS_ConvertStub + +/* --- helpers */ + +/* --- Object methods */ +static JSBool +rpmps_push(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmpsClass, NULL); + rpmps ps = ptr; + char *pkgNEVR; + char *altNEVR; + JSObject *o; + rpmProblemType type; + char *dn; + char *bn; + uint32 ui; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "ssoissu", + &pkgNEVR, &altNEVR, &o, &type, &dn, &bn, &ui))) + goto exit; + rpmpsAppend(ps, type, pkgNEVR, o, dn, bn, altNEVR, ui); + + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmps_print(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmpsClass, NULL); + rpmps ps = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + rpmpsPrint(NULL, ps); + + ok = JS_TRUE; + return ok; +} + +static JSFunctionSpec rpmps_funcs[] = { + JS_FS("push", rpmps_push, 0,0), + JS_FS("print", rpmps_print, 0,0), + JS_FS_END +}; + +/* --- Object properties */ +enum rpmps_tinyid { + _DEBUG = -2, + _LENGTH = -3, +}; + +static JSPropertySpec rpmps_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {"length", _LENGTH, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmps_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmpsClass, NULL); + rpmps ps = ptr; + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + case _LENGTH: + *vp = INT_TO_JSVAL(rpmpsNumProblems(ps)); + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmps_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmpsClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmps_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmpsClass, NULL); + rpmps ps = ptr; + +_RESOLVE_DEBUG_ENTRY(_debug); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ps == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmps_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug); + +#ifdef DYING + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + if ((iterator = JS_NewPropertyIterator(cx, obj)) == NULL) + goto exit; + *statep = OBJECT_TO_JSVAL(iterator); + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + iterator = (JSObject *) JSVAL_TO_OBJECT(*statep); + if (!JS_NextProperty(cx, iterator, idp)) + goto exit; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + /* Allow our iterator object to be GC'd. */ + *statep = JSVAL_NULL; + break; + } +#else + { static const char hex[] = "0123456789abcdef"; + const char * s; + char name[2]; + JSString * valstr; + char value[5]; + for (s = "AaBbCc"; *s != '\0'; s++) { + name[0] = s[0]; name[1] = '\0'; + value[0] = '0'; value[1] = 'x'; + value[2] = hex[(name[0] >> 4) & 0xf]; + value[3] = hex[(name[0] ) & 0xf]; + value[4] = '\0'; + if ((valstr = JS_NewStringCopyZ(cx, value)) == NULL + || !JS_DefineProperty(cx, obj, name, STRING_TO_JSVAL(valstr), + NULL, NULL, JSPROP_ENUMERATE)) + goto exit; + } + } +#endif +exit: + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static rpmps +rpmps_init(JSContext *cx, JSObject *obj) +{ + rpmps ps; + + if ((ps = rpmpsCreate()) == NULL) + return NULL; + if (!JS_SetPrivate(cx, obj, ps)) { + /* XXX error msg */ + (void) rpmpsFree(ps); + return NULL; + } + return ps; +} + +static void +rpmps_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmpsClass, NULL); + rpmps ps = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + (void) rpmpsFree(ps); +} + +static JSBool +rpmps_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (JS_IsConstructing(cx, vp)) { + if (rpmps_init(cx, obj) == NULL) + goto exit; + } else { + if ((obj = JS_NewObject(cx, &rpmpsClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass rpmpsClass = { + "Ps", JSCLASS_NEW_RESOLVE | JSCLASS_HAS_PRIVATE, + rpmps_addprop, rpmps_delprop, rpmps_getprop, rpmps_setprop, + (JSEnumerateOp)rpmps_enumerate, (JSResolveOp)rpmps_resolve, + rpmps_convert, rpmps_dtor, + JSCLASS_NO_OPTIONAL_MEMBERS +}; + +JSObject * +rpmjs_InitPsClass(JSContext *cx, JSObject* obj) +{ + JSObject * o; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + o = JS_InitClass(cx, obj, NULL, &rpmpsClass, rpmps_ctor, 1, + rpmps_props, rpmps_funcs, NULL, NULL); +assert(o != NULL); + return o; +} + +JSObject * +rpmjs_NewPsObject(JSContext *cx) +{ + JSObject *obj; + rpmps ps; + + if ((obj = JS_NewObject(cx, &rpmpsClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((ps = rpmps_init(cx, obj)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmps, Ps, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmps-js.h b/rpm-5.4.9/js/rpmps-js.h new file mode 100644 index 0000000..a3808f2 --- /dev/null +++ b/rpm-5.4.9/js/rpmps-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMPS_JS +#define H_RPMPS_JS + +/** + * \file js/rpmps-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmpsClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitPsClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewPsObject(JSContext *cx); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMPS_JS */ diff --git a/rpm-5.4.9/js/rpmseq-js.c b/rpm-5.4.9/js/rpmseq-js.c new file mode 100644 index 0000000..445bb06 --- /dev/null +++ b/rpm-5.4.9/js/rpmseq-js.c @@ -0,0 +1,709 @@ +/** \ingroup js_c + * \file js/rpmseq-js.c + */ + +#include "system.h" + +#define _RPMDB_JS_INTERNAL +#include "rpmdb-js.h" +#include "rpmseq-js.h" +#include "rpmtxn-js.h" +#include "rpmjs-debug.h" + +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmseq_addprop JS_PropertyStub +#define rpmseq_delprop JS_PropertyStub +#define rpmseq_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmseq_getobjectops NULL +#define rpmseq_checkaccess NULL +#define rpmseq_call rpmseq_call +#define rpmseq_construct rpmseq_ctor +#define rpmseq_xdrobject NULL +#define rpmseq_hasinstance NULL +#define rpmseq_mark NULL +#define rpmseq_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmseq_equality NULL +#define rpmseq_outerobject NULL +#define rpmseq_innerobject NULL +#define rpmseq_iteratorobject NULL +#define rpmseq_wrappedobject NULL + +/* --- helpers */ + +/* --- Object methods */ + +static JSBool +rpmseq_Close(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmseqClass, NULL); + DB_SEQUENCE * seq = ptr; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (seq == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + { int ret = seq->close(seq, _flags); + if (ret) + fprintf(stderr, "DB_SEQUENCE->close: %s\n", db_strerror(ret)); + else + *vp = JSVAL_TRUE; + seq = ptr = NULL; + (void) JS_SetPrivate(cx, obj, ptr); + } + + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmseq_Get(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmseqClass, NULL); + DB_SEQUENCE * seq = ptr; + JSObject * o = NULL; + DB_TXN * _txn = NULL; + int32_t _delta = 1; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (seq == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "o/iu", &o, &_delta, &_flags))) + goto exit; + + if (o && OBJ_IS_RPMTXN(cx, o)) + _txn = JS_GetInstancePrivate(cx, o, &rpmtxnClass, NULL); + if (_delta <= 0) + goto exit; + + { jsdouble d = 0; + db_seq_t _seqno = 0; + int ret = seq->get(seq, _txn, _delta, &_seqno, _flags); + switch (ret) { + default: + fprintf(stderr, "DB_SEQUENCE->get: %s\n", db_strerror(ret)); + goto exit; + break; + case 0: + d = _seqno; + if (!JS_NewNumberValue(cx, d, vp)) + *vp = JSVAL_FALSE; + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmseq_Open(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmseqClass, NULL); + DB_SEQUENCE * seq = ptr; + JSObject * o = NULL; + DB_TXN * _txn = NULL; + jsval _kv = JSVAL_NULL; + _RPMDBT _k = _RPMDBT_INIT; + uint32_t _flags = DB_CREATE; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (seq == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "ov/u", &o, &_kv, &_flags))) + goto exit; + + if (o && OBJ_IS_RPMTXN(cx, o)) + _txn = JS_GetInstancePrivate(cx, o, &rpmtxnClass, NULL); + if (rpmdb_v2dbt(cx, _kv, &_k)) + goto exit; + + { int ret = seq->open(seq, _txn, _RPMDBT_PTR(_k), _flags); + switch (ret) { + default: + fprintf(stderr, "DB_SEQUENCE->open: %s\n", db_strerror(ret)); + goto exit; + break; + case 0: + *vp = JSVAL_TRUE; + seq->api_internal = obj; + break; + } + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmseq_Remove(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmseqClass, NULL); + DB_SEQUENCE * seq = ptr; + JSObject * o = NULL; + DB_TXN * _txn = NULL; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (seq == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "o/u", &o, &_flags))) + goto exit; + + if (o && OBJ_IS_RPMTXN(cx, o)) + _txn = JS_GetInstancePrivate(cx, o, &rpmtxnClass, NULL); + + { int ret = seq->remove(seq, _txn, _flags); + switch (ret) { + default: + fprintf(stderr, "DB_SEQUENCE->remove: %s\n", db_strerror(ret)); + goto exit; + break; + case 0: + *vp = JSVAL_TRUE; + break; + } + seq = ptr = NULL; + (void) JS_SetPrivate(cx, obj, ptr); + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmseq_Stat(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmseqClass, NULL); + DB_SEQUENCE * seq = ptr; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (seq == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + { DB_SEQUENCE_STAT * sp = NULL; + int ret = seq->stat(seq, &sp, _flags); + if (ret) + fprintf(stderr, "DB_SEQUENCE->stat: %s\n", db_strerror(ret)); + else + *vp = JSVAL_TRUE; + sp = _free(sp); + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmseq_StatPrint(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmseqClass, NULL); + DB_SEQUENCE * seq = ptr; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (seq == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + { int ret = seq->stat_print(seq, _flags); + if (ret) + fprintf(stderr, "DB_SEQUENCE->stat_print: %s\n", db_strerror(ret)); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSFunctionSpec rpmseq_funcs[] = { + JS_FS("close", rpmseq_Close, 0,0), + JS_FS("get", rpmseq_Get, 0,0), + JS_FS("open", rpmseq_Open, 0,0), + JS_FS("remove", rpmseq_Remove, 0,0), + JS_FS("stat", rpmseq_Stat, 0,0), + JS_FS("stat_print", rpmseq_StatPrint, 0,0), + JS_FS_END +}; + +/* --- Object properties */ + +#define _TABLE(_v) #_v, _##_v, JSPROP_ENUMERATE, NULL, NULL + +enum rpmseq_tinyid { + _DEBUG = -2, + _DB = -3, + _KEY = -4, + _CACHESIZE = -5, + _FLAGS = -6, + _INITVAL = -7, + _RANGEMIN = -8, + _RANGEMAX = -9, + + _ST_WAIT = -10, + _ST_NOWAIT = -11, + _ST_CURRENT = -12, + _ST_VALUE = -13, + _ST_LAST_VALUE = -14, + _ST_MIN = -15, + _ST_MAX = -16, + _ST_CACHESIZE = -17, + _ST_FLAGS = -18, +}; + +static JSPropertySpec rpmseq_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {"db", _DB, JSPROP_ENUMERATE, NULL, NULL}, + {"key", _KEY, JSPROP_ENUMERATE, NULL, NULL}, + {"cachesize", _CACHESIZE, JSPROP_ENUMERATE, NULL, NULL}, + {"flags", _FLAGS, JSPROP_ENUMERATE, NULL, NULL}, + {"initval", _INITVAL, JSPROP_ENUMERATE, NULL, NULL}, + {"rangemin", _RANGEMIN, JSPROP_ENUMERATE, NULL, NULL}, + {"rangemax", _RANGEMAX, JSPROP_ENUMERATE, NULL, NULL}, + {"st_wait", _ST_WAIT, JSPROP_ENUMERATE, NULL, NULL}, + {"st_nowait", _ST_NOWAIT, JSPROP_ENUMERATE, NULL, NULL}, + {"st_current", _ST_CURRENT, JSPROP_ENUMERATE, NULL, NULL}, + {"st_value", _ST_VALUE, JSPROP_ENUMERATE, NULL, NULL}, + {"st_last_value", _ST_LAST_VALUE, JSPROP_ENUMERATE, NULL, NULL}, + {"st_min", _ST_MIN, JSPROP_ENUMERATE, NULL, NULL}, + {"st_max", _ST_MAX, JSPROP_ENUMERATE, NULL, NULL}, + {"st_cachesize", _ST_CACHESIZE, JSPROP_ENUMERATE, NULL, NULL}, + {"st_flags", _ST_FLAGS, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmseq_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmseqClass, NULL); + DB_SEQUENCE * seq = ptr; + jsint tiny = JSVAL_TO_INT(id); + jsdouble d = 0; + int ret; + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + case _DB: + { DB * _db = NULL; + if ((ret = seq->get_db(seq, &_db)) != 0) { + *vp = JSVAL_VOID; + break; + } + *vp = _db->app_private ? OBJECT_TO_JSVAL(_db->app_private) : JSVAL_NULL; + } break; + case _KEY: + { DBT _k = {0}; + if ((ret = seq->get_key(seq, &_k)) != 0) { + *vp = JSVAL_VOID; + break; + } + *vp = _k.data + ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _k.data)) : JSVAL_NULL; + } break; + case _CACHESIZE: + { int32_t _i = 0; + if ((ret = seq->get_cachesize(seq, &_i)) != 0) { + *vp = JSVAL_VOID; + break; + } + d = _i; + if (!JS_NewNumberValue(cx, d, vp)) + *vp = JSVAL_FALSE; + } break; + case _FLAGS: + { uint32_t _u = 0; + if ((ret = seq->get_flags(seq, &_u)) != 0) { + *vp = JSVAL_VOID; + break; + } + d = _u; + if (!JS_NewNumberValue(cx, d, vp)) + *vp = JSVAL_FALSE; + } break; + case _RANGEMIN: + case _RANGEMAX: + { db_seq_t _min = 0; + db_seq_t _max = 0; + + if ((ret = seq->get_range(seq, &_min, &_max)) != 0) { + *vp = JSVAL_VOID; + break; + } + switch (tiny) { + case _RANGEMIN: d = _min; break; + case _RANGEMAX: d = _max; break; + } + if (!JS_NewNumberValue(cx, d, vp)) + *vp = JSVAL_FALSE; + } break; + case _ST_WAIT: + case _ST_NOWAIT: + case _ST_CURRENT: + case _ST_VALUE: + case _ST_LAST_VALUE: + case _ST_MIN: + case _ST_MAX: + case _ST_CACHESIZE: + case _ST_FLAGS: + { DB_SEQUENCE_STAT * sp = NULL; + uint32_t _flags = 0; + + if ((ret = seq->stat(seq, &sp, _flags)) != 0) { + *vp = JSVAL_VOID; + break; + } + switch (tiny) { + case _ST_WAIT: d = sp->st_wait; break; + case _ST_NOWAIT: d = sp->st_nowait; break; + case _ST_CURRENT: d = sp->st_current; break; + case _ST_VALUE: d = sp->st_value; break; + case _ST_LAST_VALUE: d = sp->st_last_value; break; + case _ST_MIN: d = sp->st_min; break; + case _ST_MAX: d = sp->st_max; break; + case _ST_CACHESIZE: d = sp->st_cache_size; break; + case _ST_FLAGS: d = sp->st_flags; break; + } + sp = _free(sp); + if (!JS_NewNumberValue(cx, d, vp)) + *vp = JSVAL_FALSE; + } break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmseq_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmseqClass, NULL); + DB_SEQUENCE * seq = ptr; + jsint tiny = JSVAL_TO_INT(id); + jsdouble d = 0; + int ret; + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + case _CACHESIZE: + { int32_t _i = 0; + if (seq->api_internal != NULL || !JS_ValueToNumber(cx, *vp, &d)) { + *vp = JSVAL_FALSE; + break; + } + _i = d; + ret = seq->set_cachesize(seq, _i); + *vp = (!ret ? JSVAL_TRUE : JSVAL_FALSE); + } break; + case _FLAGS: + { uint32_t _u = 0; + if (seq->api_internal != NULL || !JS_ValueToNumber(cx, *vp, &d)) { + *vp = JSVAL_FALSE; + break; + } + _u = d; + ret = seq->set_flags(seq, _u); + *vp = (!ret ? JSVAL_TRUE : JSVAL_FALSE); + } break; + case _INITVAL: + { db_seq_t _ival = 0; + + if (seq->api_internal != NULL || !JS_ValueToNumber(cx, *vp, &d)) { + *vp = JSVAL_FALSE; + break; + } + _ival = d; + ret = seq->initial_value(seq, _ival); + *vp = (!ret ? JSVAL_TRUE : JSVAL_FALSE); + } break; + case _RANGEMIN: + case _RANGEMAX: + { db_seq_t _min = 0; + db_seq_t _max = 0; + + if (seq->api_internal != NULL || !JS_ValueToNumber(cx, *vp, &d)) { + *vp = JSVAL_FALSE; + break; + } + if ((ret = seq->get_range(seq, &_min, &_max)) != 0) { + *vp = JSVAL_VOID; + break; + } + switch (tiny) { + case _RANGEMIN: _min = d; break; + case _RANGEMAX: _max = d; break; + } + ret = seq->set_range(seq, _min, _max); + *vp = (!ret ? JSVAL_TRUE : JSVAL_FALSE); + } break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmseq_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmseqClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmseq_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static DB_SEQUENCE * +rpmseq_init(JSContext *cx, JSObject *obj, DB * db, uint32_t flags) +{ + DB_SEQUENCE * seq = NULL; + int ret = db_sequence_create(&seq, db, flags); + + if (ret || seq == NULL || !JS_SetPrivate(cx, obj, (void *)seq)) { + if (db) + db->err(db, ret, "db_sequence_create"); + else + fprintf(stderr, "db_sequence_create: %s\n", db_strerror(ret)); + if (seq) + ret = seq->close(seq, 0); + seq = NULL; + } + +if (_debug) +fprintf(stderr, "<== %s(%p,%p) seq %p\n", __FUNCTION__, cx, obj, seq); + + return seq; +} + +static void +rpmseq_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmseqClass, NULL); + DB_SEQUENCE * seq = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + if (seq) + (void) seq->close(seq, 0); +} + +static JSBool +rpmseq_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSObject * o = NULL; + DB * _db = NULL; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "o/u", &o, &_flags))) + goto exit; + + if (OBJ_IS_RPMDB(cx, o)) + _db = JS_GetInstancePrivate(cx, o, &rpmdbClass, NULL); + + if (JS_IsConstructing(cx, vp)) { + (void) rpmseq_init(cx, obj, _db, _flags); + } else { + if ((obj = JS_NewObject(cx, &rpmseqClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmseq_call(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + /* XXX obj is the global object so lookup "this" object. */ + JSObject * o = JSVAL_TO_OBJECT(argv[-2]); + void * ptr = JS_GetInstancePrivate(cx, o, &rpmseqClass, NULL); +#ifdef NOTYET + DB_SEQUENCE * seq = ptr; + const char *_fn = NULL; + const char * _con = NULL; +#endif + JSBool ok = JS_FALSE; + +#ifdef NOTYET + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_fn))) + goto exit; + + *vp = (seq && _fn && (_con = rpmseqLgetfilecon(seq, _fn)) != NULL) + ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _con)) : JSVAL_VOID; + _con = _free(_con); + + ok = JS_TRUE; + +exit: +#endif + +if (_debug) +fprintf(stderr, "<== %s(%p,%p[%u],%p) o %p ptr %p\n", __FUNCTION__, cx, argv, (unsigned)argc, vp, o, ptr); + + return ok; +} + +/* --- Class initialization */ +JSClass rpmseqClass = { + "Seq", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmseq_addprop, rpmseq_delprop, rpmseq_getprop, rpmseq_setprop, + (JSEnumerateOp)rpmseq_enumerate, (JSResolveOp)rpmseq_resolve, + rpmseq_convert, rpmseq_dtor, + + rpmseq_getobjectops, rpmseq_checkaccess, + rpmseq_call, rpmseq_construct, + rpmseq_xdrobject, rpmseq_hasinstance, + rpmseq_mark, rpmseq_reserveslots, +}; + +JSObject * +rpmjs_InitSeqClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmseqClass, rpmseq_ctor, 1, + rpmseq_props, rpmseq_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewSeqObject(JSContext *cx, void * _db, uint32_t _flags) +{ + JSObject *obj; + DB * db = _db; + DB_SEQUENCE * seq; + + if ((obj = JS_NewObject(cx, &rpmseqClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((seq = rpmseq_init(cx, obj, db, _flags)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmseq, Seq, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmseq-js.h b/rpm-5.4.9/js/rpmseq-js.h new file mode 100644 index 0000000..e87d501 --- /dev/null +++ b/rpm-5.4.9/js/rpmseq-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMSEQ_JS +#define H_RPMSEQ_JS + +/** + * \file js/rpmseq-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmseqClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitSeqClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewSeqObject(JSContext *cx, void * _db, uint32_t _flags); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMSEQ_JS */ diff --git a/rpm-5.4.9/js/rpmsm-js.c b/rpm-5.4.9/js/rpmsm-js.c new file mode 100644 index 0000000..1e37ded --- /dev/null +++ b/rpm-5.4.9/js/rpmsm-js.c @@ -0,0 +1,307 @@ +/** \ingroup js_c + * \file js/rpmsm-js.c + */ + +#include "system.h" + +#include "rpmsm-js.h" +#include "rpmjs-debug.h" + +#if defined(WITH_SEMANAGE) +#include +#endif +#define _RPMSM_INTERNAL +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmsm_addprop JS_PropertyStub +#define rpmsm_delprop JS_PropertyStub +#define rpmsm_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmsm_getobjectops NULL +#define rpmsm_checkaccess NULL +#define rpmsm_call rpmsm_call +#define rpmsm_construct rpmsm_ctor +#define rpmsm_xdrobject NULL +#define rpmsm_hasinstance NULL +#define rpmsm_mark NULL +#define rpmsm_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmsm_equality NULL +#define rpmsm_outerobject NULL +#define rpmsm_innerobject NULL +#define rpmsm_iteratorobject NULL +#define rpmsm_wrappedobject NULL + +/* --- helpers */ + +/* --- Object methods */ + +static JSFunctionSpec rpmsm_funcs[] = { + JS_FS_END +}; + +/* --- Object properties */ +enum rpmsm_tinyid { + _DEBUG = -2, + _FLAGS = -3, + _STATE = -4, + _ACCESS = -5, + _STORE = -6, +}; + +static JSPropertySpec rpmsm_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {"flags", _FLAGS, JSPROP_ENUMERATE, NULL, NULL}, + {"state", _STATE, JSPROP_ENUMERATE, NULL, NULL}, + {"access", _ACCESS, JSPROP_ENUMERATE, NULL, NULL}, + {"store", _STORE, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +#define _GET_STR(_str) \ + ((_str) ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, (_str))) : JSVAL_VOID) +#define _GET_CON(_test) ((_test) ? _GET_STR(con) : JSVAL_VOID) + +static JSBool +rpmsm_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsmClass, NULL); + rpmsm sm = ptr; + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + case _FLAGS: *vp = INT_TO_JSVAL(sm->flags); break; + case _STATE: *vp = INT_TO_JSVAL(sm->state); break; + case _ACCESS: *vp = INT_TO_JSVAL(sm->access); break; + case _STORE: *vp = _GET_STR(sm->fn); break; + default: + break; + } + + return JS_TRUE; +} + +#define _PUT_CON(_put) (JSVAL_IS_STRING(*vp) && !(_put) \ + ? JSVAL_TRUE : JSVAL_FALSE) +#define _PUT_INT(_put) (JSVAL_IS_INT(*vp) && !(_put) \ + ? JSVAL_TRUE : JSVAL_FALSE) + +static JSBool +rpmsm_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsmClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + break; + } + + return JS_TRUE; +} + +static JSBool +rpmsm_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsmClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmsm_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static rpmsm +rpmsm_init(JSContext *cx, JSObject *obj, const char * _fn, unsigned int _flags) +{ + rpmsm sm = rpmsmNew(_fn, _flags); + +if (_debug) +fprintf(stderr, "==> %s(%p,%p,%s,0x%x) sm %p\n", __FUNCTION__, cx, obj, _fn, _flags, sm); + + if (!JS_SetPrivate(cx, obj, (void *)sm)) { + /* XXX error msg */ + return NULL; + } + return sm; +} + +static void +rpmsm_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsmClass, NULL); + rpmsm sm = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + (void) rpmsmFree(sm); +} + +static JSBool +rpmsm_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + const char * _fn = NULL; + unsigned int _flags = 0; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/su", &_fn, &_flags))) + goto exit; + + if (JS_IsConstructing(cx, vp)) { + (void) rpmsm_init(cx, obj, _fn, _flags); + } else { + if ((obj = JS_NewObject(cx, &rpmsmClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmsm_call(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + /* XXX obj is the global object so lookup "this" object. */ + JSObject * o = JSVAL_TO_OBJECT(argv[-2]); + void * ptr = JS_GetInstancePrivate(cx, o, &rpmsmClass, NULL); + JSBool ok = JS_FALSE; + rpmsm sm = ptr; + const char *_cmd = NULL; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_cmd))) + goto exit; + + if (sm && _cmd) { + const char * av[2] = { _cmd, NULL }; + const char * result = NULL; + /* XXX FIXME: pin down rc value. list returns nitems? */ + int rc = rpmsmRun(sm, (char **)av, &result); + + if (rc < 0) + *vp = JSVAL_FALSE; + else if (rc == 0 || result == NULL) + *vp = JSVAL_TRUE; + else + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, result)); + } else + *vp = JSVAL_FALSE; + + ok = JS_TRUE; + +exit: +if (_debug) +fprintf(stderr, "<== %s(%p,%p[%u],%p) o %p ptr %p\n", __FUNCTION__, cx, argv, (unsigned)argc, vp, o, ptr); + + return ok; +} + +/* --- Class initialization */ +JSClass rpmsmClass = { + "Sm", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmsm_addprop, rpmsm_delprop, rpmsm_getprop, rpmsm_setprop, + (JSEnumerateOp)rpmsm_enumerate, (JSResolveOp)rpmsm_resolve, + rpmsm_convert, rpmsm_dtor, + + rpmsm_getobjectops, rpmsm_checkaccess, + rpmsm_call, rpmsm_construct, + rpmsm_xdrobject, rpmsm_hasinstance, + rpmsm_mark, rpmsm_reserveslots, +}; + +JSObject * +rpmjs_InitSmClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmsmClass, rpmsm_ctor, 1, + rpmsm_props, rpmsm_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewSmObject(JSContext *cx, const char * _fn, unsigned int _flags) +{ + JSObject *obj; + rpmsm sm; + + if ((obj = JS_NewObject(cx, &rpmsmClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((sm = rpmsm_init(cx, obj, _fn, _flags)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmsm, Sm, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmsm-js.h b/rpm-5.4.9/js/rpmsm-js.h new file mode 100644 index 0000000..77cdcfd --- /dev/null +++ b/rpm-5.4.9/js/rpmsm-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMSM_JS +#define H_RPMSM_JS + +/** + * \file js/rpmsm-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmsmClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitSmClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewSmObject(JSContext *cx, const char * _fn, unsigned int _flags); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMSM_JS */ diff --git a/rpm-5.4.9/js/rpmsp-js.c b/rpm-5.4.9/js/rpmsp-js.c new file mode 100644 index 0000000..04c8fe2 --- /dev/null +++ b/rpm-5.4.9/js/rpmsp-js.c @@ -0,0 +1,285 @@ +/** \ingroup js_c + * \file js/rpmsp-js.c + */ + +#include "system.h" + +#include "rpmsp-js.h" +#include "rpmjs-debug.h" + +#if defined(WITH_SEPOL) +#include +#endif +#define _RPMSP_INTERNAL +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmsp_addprop JS_PropertyStub +#define rpmsp_delprop JS_PropertyStub +#define rpmsp_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmsp_getobjectops NULL +#define rpmsp_checkaccess NULL +#define rpmsp_call rpmsp_call +#define rpmsp_construct rpmsp_ctor +#define rpmsp_xdrobject NULL +#define rpmsp_hasinstance NULL +#define rpmsp_mark NULL +#define rpmsp_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmsp_equality NULL +#define rpmsp_outerobject NULL +#define rpmsp_innerobject NULL +#define rpmsp_iteratorobject NULL +#define rpmsp_wrappedobject NULL + +/* --- helpers */ + +/* --- Object methods */ + +static JSFunctionSpec rpmsp_funcs[] = { + JS_FS_END +}; + +/* --- Object properties */ +enum rpmsp_tinyid { + _DEBUG = -2, +}; + +static JSPropertySpec rpmsp_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +#define _GET_STR(_str) \ + ((_str) ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, (_str))) : JSVAL_VOID) +#define _GET_CON(_test) ((_test) ? _GET_STR(con) : JSVAL_VOID) + +static JSBool +rpmsp_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmspClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + default: + break; + } + + return JS_TRUE; +} + +#define _PUT_CON(_put) (JSVAL_IS_STRING(*vp) && !(_put) \ + ? JSVAL_TRUE : JSVAL_FALSE) +#define _PUT_INT(_put) (JSVAL_IS_INT(*vp) && !(_put) \ + ? JSVAL_TRUE : JSVAL_FALSE) + +static JSBool +rpmsp_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmspClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmsp_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmspClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmsp_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static rpmsp +rpmsp_init(JSContext *cx, JSObject *obj) +{ + const char * _fn = NULL; + int _flags = 0; + rpmsp sp = rpmspNew(_fn, _flags); + +if (_debug) +fprintf(stderr, "==> %s(%p,%p) sp %p\n", __FUNCTION__, cx, obj, sp); + + if (!JS_SetPrivate(cx, obj, (void *)sp)) { + /* XXX error msg */ + return NULL; + } + return sp; +} + +static void +rpmsp_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmspClass, NULL); + rpmsp sp = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + (void) rpmspFree(sp); +} + +static JSBool +rpmsp_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (JS_IsConstructing(cx, vp)) { + (void) rpmsp_init(cx, obj); + } else { + if ((obj = JS_NewObject(cx, &rpmspClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmsp_call(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + /* XXX obj is the global object so lookup "this" object. */ + JSObject * o = JSVAL_TO_OBJECT(argv[-2]); + void * ptr = JS_GetInstancePrivate(cx, o, &rpmspClass, NULL); + JSBool ok = JS_FALSE; +#ifdef FIXME + rpmsp sp = ptr; + const char *_fn = NULL; + const char * _con = NULL; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_fn))) + goto exit; + + *vp = (sp && _fn && (_con = rpmspLgetfilecon(sp, _fn)) != NULL) + ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _con)) : JSVAL_VOID; + _con = _free(_con); + + ok = JS_TRUE; + +exit: +#endif + +if (_debug) +fprintf(stderr, "<== %s(%p,%p[%u],%p) o %p ptr %p\n", __FUNCTION__, cx, argv, (unsigned)argc, vp, o, ptr); + + return ok; +} + +/* --- Class initialization */ +JSClass rpmspClass = { + "Sp", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmsp_addprop, rpmsp_delprop, rpmsp_getprop, rpmsp_setprop, + (JSEnumerateOp)rpmsp_enumerate, (JSResolveOp)rpmsp_resolve, + rpmsp_convert, rpmsp_dtor, + + rpmsp_getobjectops, rpmsp_checkaccess, + rpmsp_call, rpmsp_construct, + rpmsp_xdrobject, rpmsp_hasinstance, + rpmsp_mark, rpmsp_reserveslots, +}; + +JSObject * +rpmjs_InitSpClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmspClass, rpmsp_ctor, 1, + rpmsp_props, rpmsp_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewSpObject(JSContext *cx) +{ + JSObject *obj; + rpmsp sp; + + if ((obj = JS_NewObject(cx, &rpmspClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((sp = rpmsp_init(cx, obj)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmsp, Sp, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmsp-js.h b/rpm-5.4.9/js/rpmsp-js.h new file mode 100644 index 0000000..de5163a --- /dev/null +++ b/rpm-5.4.9/js/rpmsp-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMSP_JS +#define H_RPMSP_JS + +/** + * \file js/rpmsp-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmspClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitSpClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewSpObject(JSContext *cx); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMSP_JS */ diff --git a/rpm-5.4.9/js/rpmst-js.c b/rpm-5.4.9/js/rpmst-js.c new file mode 100644 index 0000000..f628c2b --- /dev/null +++ b/rpm-5.4.9/js/rpmst-js.c @@ -0,0 +1,349 @@ +/** \ingroup js_c + * \file js/rpmst-js.c + */ + +#include "system.h" + +#include "rpmst-js.h" +#include "rpmjs-debug.h" + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmst_addprop JS_PropertyStub +#define rpmst_delprop JS_PropertyStub +#define rpmst_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmst_getobjectops NULL +#define rpmst_checkaccess NULL +#define rpmst_call rpmst_call +#define rpmst_construct rpmst_ctor +#define rpmst_xdrobject NULL +#define rpmst_hasinstance NULL +#define rpmst_mark NULL +#define rpmst_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmst_equality NULL +#define rpmst_outerobject NULL +#define rpmst_innerobject NULL +#define rpmst_iteratorobject NULL +#define rpmst_wrappedobject NULL + +/* --- helpers */ + +/* --- Object methods */ +static JSFunctionSpec rpmst_funcs[] = { + JS_FS_END +}; + +/* --- Object properties */ +enum rpmst_tinyid { + _DEBUG = -2, + _DEV = -3, + _INO = -4, + _MODE = -5, + _NLINK = -6, + _UID = -7, + _GID = -8, + _RDEV = -9, + _SIZE = -10, + _BLKSIZE = -11, + _BLOCKS = -12, + _ATIME = -13, + _MTIME = -14, + _CTIME = -15, +}; + +static JSPropertySpec rpmst_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {"dev", _DEV, JSPROP_ENUMERATE, NULL, NULL}, + {"ino", _INO, JSPROP_ENUMERATE, NULL, NULL}, + {"mode", _MODE, JSPROP_ENUMERATE, NULL, NULL}, + {"nlink", _NLINK, JSPROP_ENUMERATE, NULL, NULL}, + {"uid", _UID, JSPROP_ENUMERATE, NULL, NULL}, + {"gid", _GID, JSPROP_ENUMERATE, NULL, NULL}, + {"rdev", _RDEV, JSPROP_ENUMERATE, NULL, NULL}, + {"size", _SIZE, JSPROP_ENUMERATE, NULL, NULL}, + {"blksize", _BLKSIZE, JSPROP_ENUMERATE, NULL, NULL}, + {"blocks", _BLOCKS, JSPROP_ENUMERATE, NULL, NULL}, + {"atime", _ATIME, JSPROP_ENUMERATE, NULL, NULL}, + {"mtime", _MTIME, JSPROP_ENUMERATE, NULL, NULL}, + {"ctime", _CTIME, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +#define _GET_I(_p, _f) ((_p) ? INT_TO_JSVAL((int)(_p)->_f) : JSVAL_VOID) + +static JSBool +rpmst_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmstClass, NULL); + struct stat * st = ptr; + jsint tiny = JSVAL_TO_INT(id); + time_t mytime = (time_t)0xffffffff; + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: *vp = INT_TO_JSVAL(_debug); break; + case _DEV: *vp = _GET_I(st, st_dev); break; + case _INO: *vp = _GET_I(st, st_ino); break; + case _MODE: *vp = _GET_I(st, st_mode); break; + case _NLINK: *vp = _GET_I(st, st_nlink); break; + case _UID: *vp = _GET_I(st, st_uid); break; + case _GID: *vp = _GET_I(st, st_gid); break; + case _RDEV: *vp = _GET_I(st, st_rdev); break; + case _SIZE: *vp = _GET_I(st, st_size); break; + case _BLKSIZE: *vp = _GET_I(st, st_blksize); break; + case _BLOCKS: *vp = _GET_I(st, st_blocks); break; + case _ATIME: if (st) mytime = st->st_atime; break; + case _MTIME: if (st) mytime = st->st_mtime; break; + case _CTIME: if (st) mytime = st->st_ctime; break; + default: + break; + } + + if (mytime != (time_t)0xffffffff) { + struct tm *tm = gmtime(&mytime); + *vp = OBJECT_TO_JSVAL(js_NewDateObject(cx, + tm->tm_year + 1900, + tm->tm_mon, + tm->tm_mday, + tm->tm_hour, + tm->tm_min, + tm->tm_sec)); + } + + return JS_TRUE; +} + +static JSBool +rpmst_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmstClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmst_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmstClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmst_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + JSObject * iter; + JSBool ok = JS_FALSE; + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + if ((iter = JS_NewPropertyIterator(cx, obj)) == NULL) + goto exit; + *statep = OBJECT_TO_JSVAL(iter); + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + iter = (JSObject*)JSVAL_TO_OBJECT(*statep); + if (!JS_NextProperty(cx, iter, idp)) + goto exit; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Object ctors/dtors */ +static struct stat * +rpmst_init(JSContext *cx, JSObject *obj, jsval fnv) +{ + struct stat * st = xcalloc(1, sizeof(*st)); + +if (_debug) +fprintf(stderr, "==> %s(%p,%p,%u) st %p\n", __FUNCTION__, cx, obj, (unsigned)fnv, st); + + if (JSVAL_IS_STRING(fnv)) { + const char * fn = JS_EncodeString(cx, JS_ValueToString(cx, fnv)); + if (Stat(fn, st) < 0) { + /* XXX error msg */ + st = _free(st); + } + fn = _free(fn); + } else { + st = _free(st); + } + + if (!JS_SetPrivate(cx, obj, (void *)st)) { + /* XXX error msg */ + st = _free(st); + } + return st; +} + +static void +rpmst_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmstClass, NULL); + struct stat * st = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + st = _free(st); +} + +static JSBool +rpmst_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + jsval fnv = JSVAL_VOID; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/v", &fnv))) + goto exit; + + if (JS_IsConstructing(cx, vp)) { + (void) rpmst_init(cx, obj, fnv); + } else { + if ((obj = JS_NewObject(cx, &rpmstClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmst_call(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + /* XXX obj is the global object so lookup "this" object. */ + JSObject * o = JSVAL_TO_OBJECT(argv[-2]); + void * ptr = JS_GetInstancePrivate(cx, o, &rpmstClass, NULL); + struct stat * st = ptr; + JSBool ok = JS_FALSE; + jsval fnv = JSVAL_VOID; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/v", &fnv))) + goto exit; + + if (st) { + st = ptr = _free(st); + (void) JS_SetPrivate(cx, o, (void *)st); + } + + st = ptr = rpmst_init(cx, o, fnv); + + *vp = OBJECT_TO_JSVAL(o); + + ok = JS_TRUE; + +exit: +if (_debug) +fprintf(stderr, "<== %s(%p,%p[%u],%p) o %p ptr %p\n", __FUNCTION__, cx, argv, (unsigned)argc, vp, o, ptr); + + return ok; +} + +/* --- Class initialization */ +JSClass rpmstClass = { + /* XXX class should be "Stat" eventually, avoid name conflicts for now */ + "St", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmst_addprop, rpmst_delprop, rpmst_getprop, rpmst_setprop, + (JSEnumerateOp)rpmst_enumerate, (JSResolveOp)rpmst_resolve, + rpmst_convert, rpmst_dtor, + + rpmst_getobjectops, rpmst_checkaccess, + rpmst_call, rpmst_construct, + rpmst_xdrobject, rpmst_hasinstance, + rpmst_mark, rpmst_reserveslots, +}; + +JSObject * +rpmjs_InitStClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmstClass, rpmst_ctor, 1, + rpmst_props, rpmst_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewStObject(JSContext *cx, jsval fnv) +{ + JSObject *obj; + struct stat * st; + + if ((obj = JS_NewObject(cx, &rpmstClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((st = rpmst_init(cx, obj, fnv)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmst, St, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmst-js.h b/rpm-5.4.9/js/rpmst-js.h new file mode 100644 index 0000000..ea665f7 --- /dev/null +++ b/rpm-5.4.9/js/rpmst-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMST_JS +#define H_RPMST_JS + +/** + * \file js/rpmst-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmstClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitStClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewStObject(JSContext *cx, jsval fnv); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMST_JS */ diff --git a/rpm-5.4.9/js/rpmsw-js.c b/rpm-5.4.9/js/rpmsw-js.c new file mode 100644 index 0000000..61bdb87 --- /dev/null +++ b/rpm-5.4.9/js/rpmsw-js.c @@ -0,0 +1,242 @@ +/** \ingroup js_c + * \file js/rpmsw-js.c + */ + +#include "system.h" + +#include "rpmsw-js.h" +#include "rpmjs-debug.h" + +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmsw_addprop JS_PropertyStub +#define rpmsw_delprop JS_PropertyStub +#define rpmsw_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmsw_getobjectops NULL +#define rpmsw_checkaccess NULL +#define rpmsw_call NULL +#define rpmsw_construct rpmsw_ctor +#define rpmsw_xdrobject NULL +#define rpmsw_hasinstance NULL +#define rpmsw_mark NULL +#define rpmsw_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmsw_equality NULL +#define rpmsw_outerobject NULL +#define rpmsw_innerobject NULL +#define rpmsw_iteratorobject NULL +#define rpmsw_wrappedobject NULL + +#define rpmswNew() xcalloc(1, sizeof(struct rpmop_s)) +#define rpmswFree(_sw) _free(_sw) + +/* --- helpers */ + +/* --- Object methods */ + +static JSFunctionSpec rpmsw_funcs[] = { + JS_FS_END +}; + +/* --- Object properties */ +enum rpmsw_tinyid { + _DEBUG = -2, +}; + +static JSPropertySpec rpmsw_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmsw_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmswClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmsw_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmswClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmsw_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmswClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmsw_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static rpmsw +rpmsw_init(JSContext *cx, JSObject *obj) +{ + rpmsw sw = rpmswNew(); + +if (_debug) +fprintf(stderr, "==> %s(%p,%p) sw %p\n", __FUNCTION__, cx, obj, sw); + + if (!JS_SetPrivate(cx, obj, (void *)sw)) { + /* XXX error msg */ + return NULL; + } + return sw; +} + +static void +rpmsw_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmswClass, NULL); + rpmsw sw = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + (void) rpmswFree(sw); +} + +static JSBool +rpmsw_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (JS_IsConstructing(cx, vp)) { + (void) rpmsw_init(cx, obj); + } else { + if ((obj = JS_NewObject(cx, &rpmswClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass rpmswClass = { + "Sw", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmsw_addprop, rpmsw_delprop, rpmsw_getprop, rpmsw_setprop, + (JSEnumerateOp)rpmsw_enumerate, (JSResolveOp)rpmsw_resolve, + rpmsw_convert, rpmsw_dtor, + + rpmsw_getobjectops, rpmsw_checkaccess, + rpmsw_call, rpmsw_construct, + rpmsw_xdrobject, rpmsw_hasinstance, + rpmsw_mark, rpmsw_reserveslots, +}; + +JSObject * +rpmjs_InitSwClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmswClass, rpmsw_ctor, 1, + rpmsw_props, rpmsw_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewSwObject(JSContext *cx) +{ + JSObject *obj; + rpmsw sw; + + if ((obj = JS_NewObject(cx, &rpmswClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((sw = rpmsw_init(cx, obj)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmsw, Sw, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmsw-js.h b/rpm-5.4.9/js/rpmsw-js.h new file mode 100644 index 0000000..cba0806 --- /dev/null +++ b/rpm-5.4.9/js/rpmsw-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMSW_JS +#define H_RPMSW_JS + +/** + * \file js/rpmsw-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmswClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitSwClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewSwObject(JSContext *cx); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMSW_JS */ diff --git a/rpm-5.4.9/js/rpmsx-js.c b/rpm-5.4.9/js/rpmsx-js.c new file mode 100644 index 0000000..f670780 --- /dev/null +++ b/rpm-5.4.9/js/rpmsx-js.c @@ -0,0 +1,438 @@ +/** \ingroup js_c + * \file js/rpmsx-js.c + */ + +#include "system.h" + +#include "rpmsx-js.h" +#include "rpmjs-debug.h" + +#if defined(WITH_SELINUX) +#include +#else +typedef char * security_context_t; +#endif + +#define _RPMSX_INTERNAL +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmsx_addprop JS_PropertyStub +#define rpmsx_delprop JS_PropertyStub +#define rpmsx_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmsx_getobjectops NULL +#define rpmsx_checkaccess NULL +#define rpmsx_call rpmsx_call +#define rpmsx_construct rpmsx_ctor +#define rpmsx_xdrobject NULL +#define rpmsx_hasinstance NULL +#define rpmsx_mark NULL +#define rpmsx_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmsx_equality NULL +#define rpmsx_outerobject NULL +#define rpmsx_innerobject NULL +#define rpmsx_iteratorobject NULL +#define rpmsx_wrappedobject NULL + +/* --- helpers */ + +/* --- Object methods */ + +static JSFunctionSpec rpmsx_funcs[] = { + JS_FS_END +}; + +/* --- Object properties */ +enum rpmsx_tinyid { + _DEBUG = -2, + _CURRENT = -3, + _PID = -4, + _PPID = -5, + _PREV = -6, + _EXEC = -7, + _FSCREATE = -8, + _KEYCREATE = -9, + _SOCKCREATE = -10, + _ENFORCE = -11, + _DENY = -12, + _POLICYVERS = -13, + _ENABLED = -14, + _MLSENABLED = -15, + _BOOLS = -16, /* todo++ */ + + _ROOT = -30, + _BINARY = -31, + _FAILSAFE = -32, + _REMOVABLE = -33, + _DEFAULT = -34, + _USER = -35, + _FCON = -36, + _FCONHOME = -37, + _FCONLOCAL = -38, + _FCONSUBS = -39, + _HOMEDIR = -40, + _MEDIA = -41, + _VIRTDOMAIN = -42, + _VIRTIMAGE = -43, + _X = -44, + _CONTEXTS = -45, + _SECURETTY = -46, + _BOOLEANS = -47, + _CUSTOMTYPES= -48, + _USERS = -49, + _USERSCONF = -50, + _XLATIONS = -51, + _COLORS = -52, + _NETFILTER = -53, + _PATH = -54, +}; + +static JSPropertySpec rpmsx_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {"current", _CURRENT, JSPROP_ENUMERATE, NULL, NULL}, + {"pid", _PID, JSPROP_ENUMERATE, NULL, NULL}, + {"ppid", _PPID, JSPROP_ENUMERATE, NULL, NULL}, + {"prev", _PREV, JSPROP_ENUMERATE, NULL, NULL}, + {"exec", _EXEC, JSPROP_ENUMERATE, NULL, NULL}, + {"fscreate",_FSCREATE, JSPROP_ENUMERATE, NULL, NULL}, + {"keycreate",_KEYCREATE, JSPROP_ENUMERATE, NULL, NULL}, + {"sockcreate",_SOCKCREATE, JSPROP_ENUMERATE, NULL, NULL}, + {"enforce", _ENFORCE, JSPROP_ENUMERATE, NULL, NULL}, + {"deny", _DENY, JSPROP_ENUMERATE, NULL, NULL}, + {"policyvers",_POLICYVERS, JSPROP_ENUMERATE, NULL, NULL}, + {"enabled", _ENABLED, JSPROP_ENUMERATE, NULL, NULL}, + {"mlsenabled",_MLSENABLED, JSPROP_ENUMERATE, NULL, NULL}, +#ifdef NOTYET + {"bools", _BOOLS, JSPROP_ENUMERATE, NULL, NULL}, +#endif + + {"root", _ROOT, JSPROP_ENUMERATE, NULL, NULL}, + {"binary", _BINARY, JSPROP_ENUMERATE, NULL, NULL}, + {"failsafe",_FAILSAFE, JSPROP_ENUMERATE, NULL, NULL}, + {"removable",_REMOVABLE, JSPROP_ENUMERATE, NULL, NULL}, + {"default", _DEFAULT, JSPROP_ENUMERATE, NULL, NULL}, + {"user", _USER, JSPROP_ENUMERATE, NULL, NULL}, + {"fcon", _FCON, JSPROP_ENUMERATE, NULL, NULL}, + {"fconhome",_FCONHOME, JSPROP_ENUMERATE, NULL, NULL}, + {"fconlocal",_FCONLOCAL, JSPROP_ENUMERATE, NULL, NULL}, + {"fconsubs",_FCONSUBS, JSPROP_ENUMERATE, NULL, NULL}, + {"homedir", _HOMEDIR, JSPROP_ENUMERATE, NULL, NULL}, + {"media", _MEDIA, JSPROP_ENUMERATE, NULL, NULL}, + {"virtdomain",_VIRTDOMAIN, JSPROP_ENUMERATE, NULL, NULL}, + {"virtimage",_VIRTIMAGE, JSPROP_ENUMERATE, NULL, NULL}, + {"X", _X, JSPROP_ENUMERATE, NULL, NULL}, + {"contexts",_CONTEXTS, JSPROP_ENUMERATE, NULL, NULL}, + {"securetty",_SECURETTY, JSPROP_ENUMERATE, NULL, NULL}, + {"booleans",_BOOLEANS, JSPROP_ENUMERATE, NULL, NULL}, + {"customtypes",_CUSTOMTYPES,JSPROP_ENUMERATE, NULL, NULL}, + {"users", _USERS, JSPROP_ENUMERATE, NULL, NULL}, + {"usersconf",_USERSCONF, JSPROP_ENUMERATE, NULL, NULL}, + {"xlations",_XLATIONS, JSPROP_ENUMERATE, NULL, NULL}, + {"colors", _COLORS, JSPROP_ENUMERATE, NULL, NULL}, + {"netfilter",_NETFILTER, JSPROP_ENUMERATE, NULL, NULL}, + {"path", _PATH, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +#define _GET_STR(_str) \ + ((_str) ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, (_str))) : JSVAL_VOID) +#define _GET_CON(_test) ((_test) ? _GET_STR(con) : JSVAL_VOID) + +static JSBool +rpmsx_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsxClass, NULL); + jsint tiny = JSVAL_TO_INT(id); +#if defined(WITH_SELINUX) + security_context_t con = NULL; +#endif + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; +#if defined(WITH_SELINUX) + case _CURRENT: *vp = _GET_CON(!getcon(&con)); break; + case _PID: *vp = _GET_CON(!getpidcon(getpid(), &con)); break; + case _PPID: *vp = _GET_CON(!getpidcon(getppid(), &con)); break; + case _PREV: *vp = _GET_CON(!getprevcon(&con)); break; + case _EXEC: *vp = _GET_CON(!getexeccon(&con)); break; + case _FSCREATE: *vp = _GET_CON(!getfscreatecon(&con)); break; + case _KEYCREATE: *vp = _GET_CON(!getkeycreatecon(&con)); break; + case _SOCKCREATE: *vp = _GET_CON(!getsockcreatecon(&con)); break; + case _ENFORCE: *vp = INT_TO_JSVAL(security_getenforce()); break; + case _DENY: *vp = INT_TO_JSVAL(security_deny_unknown()); break; + case _POLICYVERS: *vp = INT_TO_JSVAL(security_policyvers()); break; + case _ENABLED: *vp = INT_TO_JSVAL(is_selinux_enabled()); break; + case _MLSENABLED: *vp = INT_TO_JSVAL(is_selinux_mls_enabled()); break; +#ifdef NOTYET + case _BOOLS: *vp = ; break; +#endif + case _ROOT: *vp = _GET_STR(selinux_policy_root()); break; + case _BINARY: *vp = _GET_STR(selinux_binary_policy_path()); break; + case _FAILSAFE: *vp = _GET_STR(selinux_failsafe_context_path());break; + case _REMOVABLE: *vp = _GET_STR(selinux_removable_context_path());break; + case _DEFAULT: *vp = _GET_STR(selinux_default_context_path()); break; + case _USER: *vp = _GET_STR(selinux_user_contexts_path()); break; + case _FCON: *vp = _GET_STR(selinux_file_context_path()); break; + case _FCONHOME: *vp = _GET_STR(selinux_file_context_homedir_path());break; + case _FCONLOCAL: *vp = _GET_STR(selinux_file_context_local_path());break; + case _FCONSUBS: *vp = _GET_STR(selinux_file_context_subs_path());break; + case _HOMEDIR: *vp = _GET_STR(selinux_homedir_context_path()); break; + case _MEDIA: *vp = _GET_STR(selinux_media_context_path()); break; + case _VIRTDOMAIN: *vp = _GET_STR(selinux_virtual_domain_context_path());break; + case _VIRTIMAGE: *vp = _GET_STR(selinux_virtual_image_context_path());break; + case _X: *vp = _GET_STR(selinux_x_context_path()); break; + case _CONTEXTS: *vp = _GET_STR(selinux_contexts_path()); break; + case _SECURETTY: *vp = _GET_STR(selinux_securetty_types_path()); break; + case _BOOLEANS: *vp = _GET_STR(selinux_booleans_path()); break; + case _CUSTOMTYPES: *vp = _GET_STR(selinux_customizable_types_path());break; + case _USERS: *vp = _GET_STR(selinux_users_path()); break; + case _USERSCONF: *vp = _GET_STR(selinux_usersconf_path()); break; + case _XLATIONS: *vp = _GET_STR(selinux_translations_path()); break; + case _COLORS: *vp = _GET_STR(selinux_colors_path()); break; + case _NETFILTER: *vp = _GET_STR(selinux_netfilter_context_path());break; + case _PATH: *vp = _GET_STR(selinux_path()); break; +#endif + default: + break; + } + +#if defined(WITH_SELINUX) + if (con) { + freecon(con); + con = NULL; + } +#endif + + return JS_TRUE; +} + +#define _PUT_CON(_put) (JSVAL_IS_STRING(*vp) && !(_put) \ + ? JSVAL_TRUE : JSVAL_FALSE) +#define _PUT_INT(_put) (JSVAL_IS_INT(*vp) && !(_put) \ + ? JSVAL_TRUE : JSVAL_FALSE) + +static JSBool +rpmsx_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ +#if defined(WITH_SELINUX) + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsxClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + security_context_t con = NULL; + int myint = 0xdeadbeef; + JSBool ok = JS_TRUE; + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + if (JSVAL_IS_STRING(*vp)) + con = (security_context_t) JS_EncodeString(cx, JS_ValueToString(cx, *vp)); + if (JSVAL_IS_INT(*vp)) + myint = JSVAL_TO_INT(*vp); + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + case _CURRENT: ok = _PUT_CON(setcon(con)); break; + case _EXEC: ok = _PUT_CON(setexeccon(con)); break; + case _FSCREATE: ok = _PUT_CON(setfscreatecon(con)); break; + case _KEYCREATE: ok = _PUT_CON(setkeycreatecon(con)); break; + case _SOCKCREATE: ok = _PUT_CON(setsockcreatecon(con)); break; + case _ENFORCE: ok = _PUT_INT(security_setenforce(myint)); break; + default: + break; + } +#endif + + con = _free(con); + + return JS_TRUE; +} + +static JSBool +rpmsx_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsxClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmsx_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static rpmsx +rpmsx_init(JSContext *cx, JSObject *obj) +{ + const char * _fn = NULL; + int _flags = 0; + rpmsx sx = rpmsxNew(_fn, _flags); + +if (_debug) +fprintf(stderr, "==> %s(%p,%p) sx %p\n", __FUNCTION__, cx, obj, sx); + + if (!JS_SetPrivate(cx, obj, (void *)sx)) { + /* XXX error msg */ + return NULL; + } + return sx; +} + +static void +rpmsx_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsxClass, NULL); + rpmsx sx = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + (void) rpmsxFree(sx); +} + +static JSBool +rpmsx_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (JS_IsConstructing(cx, vp)) { + (void) rpmsx_init(cx, obj); + } else { + if ((obj = JS_NewObject(cx, &rpmsxClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmsx_call(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + /* XXX obj is the global object so lookup "this" object. */ + JSObject * o = JSVAL_TO_OBJECT(argv[-2]); + void * ptr = JS_GetInstancePrivate(cx, o, &rpmsxClass, NULL); + rpmsx sx = ptr; + const char *_fn = NULL; + const char * _con = NULL; + JSBool ok = JS_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_fn))) + goto exit; + + *vp = (sx && _fn && (_con = rpmsxLgetfilecon(sx, _fn)) != NULL) + ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _con)) : JSVAL_VOID; + _con = _free(_con); + + ok = JS_TRUE; + +exit: +if (_debug) +fprintf(stderr, "<== %s(%p,%p[%u],%p) o %p ptr %p\n", __FUNCTION__, cx, argv, (unsigned)argc, vp, o, ptr); + + return ok; +} + +/* --- Class initialization */ +JSClass rpmsxClass = { + "Sx", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmsx_addprop, rpmsx_delprop, rpmsx_getprop, rpmsx_setprop, + (JSEnumerateOp)rpmsx_enumerate, (JSResolveOp)rpmsx_resolve, + rpmsx_convert, rpmsx_dtor, + + rpmsx_getobjectops, rpmsx_checkaccess, + rpmsx_call, rpmsx_construct, + rpmsx_xdrobject, rpmsx_hasinstance, + rpmsx_mark, rpmsx_reserveslots, +}; + +JSObject * +rpmjs_InitSxClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmsxClass, rpmsx_ctor, 1, + rpmsx_props, rpmsx_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewSxObject(JSContext *cx) +{ + JSObject *obj; + rpmsx sx; + + if ((obj = JS_NewObject(cx, &rpmsxClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((sx = rpmsx_init(cx, obj)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmsx, Sx, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmsx-js.h b/rpm-5.4.9/js/rpmsx-js.h new file mode 100644 index 0000000..2413c9b --- /dev/null +++ b/rpm-5.4.9/js/rpmsx-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMSX_JS +#define H_RPMSX_JS + +/** + * \file js/rpmsx-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmsxClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitSxClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewSxObject(JSContext *cx); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMSX_JS */ diff --git a/rpm-5.4.9/js/rpmsys-js.c b/rpm-5.4.9/js/rpmsys-js.c new file mode 100644 index 0000000..986f47e --- /dev/null +++ b/rpm-5.4.9/js/rpmsys-js.c @@ -0,0 +1,772 @@ +/** \ingroup js_c + * \file js/rpmsys-js.c + */ + +#include "system.h" + +#include "rpmsys-js.h" +#include "rpmst-js.h" +#include "rpmjs-debug.h" +#include +#if defined(HAVE_PTHREAD_H) +#include +#endif + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmsys_addprop JS_PropertyStub +#define rpmsys_delprop JS_PropertyStub +#define rpmsys_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmsys_getobjectops NULL +#define rpmsys_checkaccess NULL +#define rpmsys_call NULL +#define rpmsys_construct rpmsys_ctor +#define rpmsys_xdrobject NULL +#define rpmsys_hasinstance NULL +#define rpmsys_mark NULL +#define rpmsys_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmsys_equality NULL +#define rpmsys_outerobject NULL +#define rpmsys_innerobject NULL +#define rpmsys_iteratorobject NULL +#define rpmsys_wrappedobject NULL + +typedef void * rpmsys; + +/* --- helpers */ +static rpmsys +rpmsys_init(JSContext *cx, JSObject *obj) +{ + rpmsys sys = xcalloc(1, sizeof(sys)); /* XXX distinguish class/instance? */ + + if (!JS_SetPrivate(cx, obj, (void *)sys)) { + /* XXX error msg */ + sys = NULL; + } + +if (_debug) +fprintf(stderr, "<== %s(%p,%p) sys %p\n", __FUNCTION__, cx, obj, sys); + + return sys; +} + +/* --- Object methods */ +static JSBool +rpmsys_access(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + rpmsys sys = ptr; + const char * _path = NULL; + jsuint _mode = F_OK; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + if ((ok = JS_ConvertArguments(cx, argc, argv, "s/u", &_path, &_mode))) { + mode_t mode = _mode; + *vp = (sys && !Access(_path, mode) + ? JSVAL_ZERO : INT_TO_JSVAL(errno)); + } + return ok; +} + +static JSBool +rpmsys_chmod(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + rpmsys sys = ptr; + const char * _path = NULL; + jsuint _mode = F_OK; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + if ((ok = JS_ConvertArguments(cx, argc, argv, "su", &_path, &_mode))) { + mode_t mode = _mode; + *vp = (sys && !Chmod(_path, mode) + ? JSVAL_ZERO : INT_TO_JSVAL(errno)); + } + return ok; +} + +static JSBool +rpmsys_chown(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + rpmsys sys = ptr; + const char * _path = NULL; + jsint _uid = -1; + jsint _gid = -1; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + if ((ok = JS_ConvertArguments(cx, argc, argv, "s/ii", &_path, &_uid, &_gid))) { + uid_t uid = _uid; + gid_t gid = _gid; + *vp = (sys && !Chown(_path, uid, gid) + ? JSVAL_ZERO : INT_TO_JSVAL(errno)); + } + return ok; +} + +/* XXX Chdir */ +/* XXX Chroot */ + +static JSBool +rpmsys_creat(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + rpmsys sys = ptr; + const char * _path = NULL; + jsuint _mode = 0644; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + if ((ok = JS_ConvertArguments(cx, argc, argv, "s/u", &_path, &_mode))) { + mode_t mode = _mode; + int flags = O_CREAT|O_WRONLY|O_TRUNC; + int fdno = -1; + *vp = (sys && (fdno = open(_path, flags, mode)) >= 0 + ? JSVAL_ZERO : INT_TO_JSVAL(errno)); + if (fdno >= 0) close(fdno); + } + return ok; +} + +/* XXX Fallocate */ +/* XXX Fchmod */ +/* XXX Fchown */ +/* XXX Fstat */ + +static JSBool +rpmsys_lchown(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + rpmsys sys = ptr; + const char * _path = NULL; + jsint _uid = -1; + jsint _gid = -1; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + if ((ok = JS_ConvertArguments(cx, argc, argv, "s/ii", &_path, &_uid, &_gid))) { + uid_t uid = _uid; + uid_t gid = _gid; + *vp = (sys && !Lchown(_path, uid, gid) + ? JSVAL_ZERO : INT_TO_JSVAL(errno)); + } + return ok; +} + +static JSBool +rpmsys_link(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + rpmsys sys = ptr; + const char * _opath = NULL; + const char * _npath = NULL; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + if ((ok = JS_ConvertArguments(cx, argc, argv, "ss", &_opath, &_npath))) { + *vp = (sys && !Link(_opath, _npath) + ? JSVAL_ZERO : INT_TO_JSVAL(errno)); + } + return ok; +} + +static JSBool +rpmsys_lstat(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + rpmsys sys = ptr; + const char * _path = NULL; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + if ((ok = JS_ConvertArguments(cx, argc, argv, "s", &_path))) { + struct stat sb; + if (sys && !Lstat(_path, &sb)) { + JSObject *o; + struct stat *st = NULL; + size_t nb = sizeof(*st); + if ((st = memcpy(xmalloc(nb), &sb, nb)) != NULL + && (o = JS_NewObject(cx, &rpmstClass, NULL, NULL)) != NULL + && JS_SetPrivate(cx, o, (void *)st)) + *vp = OBJECT_TO_JSVAL(o); + else { + if (st) st = _free(st); + *vp = JSVAL_VOID; /* XXX goofy? */ + } + } else + *vp = INT_TO_JSVAL(errno); /* XXX goofy? */ + } + return ok; +} + +static JSBool +rpmsys_mkdir(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + rpmsys sys = ptr; + const char * _path = NULL; + jsuint _mode = 0755; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + if ((ok = JS_ConvertArguments(cx, argc, argv, "s/u", &_path, &_mode))) { + mode_t mode = _mode; + *vp = (sys && !Mkdir(_path, mode) + ? JSVAL_ZERO : INT_TO_JSVAL(errno)); + } + return ok; +} + +static JSBool +rpmsys_mkfifo(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + rpmsys sys = ptr; + const char * _path = NULL; + jsuint _mode = 0755; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + if ((ok = JS_ConvertArguments(cx, argc, argv, "su", &_path, &_mode))) { + mode_t mode = _mode; + *vp = (sys && !Mkfifo(_path, mode) + ? JSVAL_ZERO : INT_TO_JSVAL(errno)); + } + return ok; +} + +static JSBool +rpmsys_mknod(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + rpmsys sys = ptr; + const char * _path = NULL; + jsuint _mode = 0755; + jsuint _dev = 0; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + if ((ok = JS_ConvertArguments(cx, argc, argv, "suu", &_path, &_mode, &_dev))) { + mode_t mode = _mode; + dev_t dev = _dev; + *vp = (sys && !Mknod(_path, mode, dev) + ? JSVAL_ZERO : INT_TO_JSVAL(errno)); + } + return ok; +} + +static JSBool +rpmsys_readlink(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + rpmsys sys = ptr; + const char * _path = NULL; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + if ((ok = JS_ConvertArguments(cx, argc, argv, "s", &_path))) { + char b[BUFSIZ]; + size_t nb = sizeof(b); + ssize_t rc; + + if (sys && (rc = Readlink(_path, b, nb)) >= 0) { + b[rc] = '\0'; + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, b)); + } else + *vp = INT_TO_JSVAL(errno); + } + return ok; +} + +/* XXX Realpath */ + +static JSBool +rpmsys_rename(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + rpmsys sys = ptr; + const char * _opath = NULL; + const char * _npath = NULL; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + if ((ok = JS_ConvertArguments(cx, argc, argv, "ss", &_opath, &_npath))) { + *vp = (sys && !Rename(_opath, _npath) + ? JSVAL_ZERO : INT_TO_JSVAL(errno)); + } + return ok; +} + +static JSBool +rpmsys_rmdir(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + rpmsys sys = ptr; + const char * _path = NULL; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + if ((ok = JS_ConvertArguments(cx, argc, argv, "s", &_path))) { + *vp = (sys && !Rmdir(_path) + ? JSVAL_ZERO : INT_TO_JSVAL(errno)); + } + return ok; +} + +static JSBool +rpmsys_stat(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + rpmsys sys = ptr; + const char * _path = NULL; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + if ((ok = JS_ConvertArguments(cx, argc, argv, "s", &_path))) { + struct stat sb; + if (sys && !Stat(_path, &sb)) { + JSObject *o; + struct stat *st = NULL; + size_t nb = sizeof(*st); + if ((st = memcpy(xmalloc(nb), &sb, nb)) != NULL + && (o = JS_NewObject(cx, &rpmstClass, NULL, NULL)) != NULL + && JS_SetPrivate(cx, o, (void *)st)) + *vp = OBJECT_TO_JSVAL(o); + else { + if (st) st = _free(st); + *vp = JSVAL_VOID; /* XXX goofy? */ + } + } else + *vp = INT_TO_JSVAL(errno); /* XXX goofy? */ + } + return ok; +} + +static JSBool +rpmsys_symlink(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + rpmsys sys = ptr; + const char * _opath = NULL; + const char * _npath = NULL; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + if ((ok = JS_ConvertArguments(cx, argc, argv, "ss", &_opath, &_npath))) { + *vp = (sys && !Symlink(_opath, _npath) + ? JSVAL_ZERO : INT_TO_JSVAL(errno)); + } + return ok; +} + +static JSBool +rpmsys_unlink(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + rpmsys sys = ptr; + const char * _path = NULL; + JSBool ok; + +_METHOD_DEBUG_ENTRY(_debug); + if ((ok = JS_ConvertArguments(cx, argc, argv, "s", &_path))) { + *vp = (sys && !Unlink(_path) + ? JSVAL_ZERO : INT_TO_JSVAL(errno)); + } + return ok; +} + +/* XXX Utime */ +/* XXX Utimes */ + +static JSFunctionSpec rpmsys_funcs[] = { + JS_FS("access", rpmsys_access, 0,0), + JS_FS("chmod", rpmsys_chmod, 0,0), + JS_FS("chown", rpmsys_chown, 0,0), + JS_FS("creat", rpmsys_creat, 0,0), + JS_FS("lchown", rpmsys_lchown, 0,0), + JS_FS("link", rpmsys_link, 0,0), + JS_FS("lstat", rpmsys_lstat, 0,0), + JS_FS("mkdir", rpmsys_mkdir, 0,0), + JS_FS("mkfifo", rpmsys_mkfifo, 0,0), + JS_FS("mknod", rpmsys_mknod, 0,0), + JS_FS("readlink", rpmsys_readlink, 0,0), + JS_FS("rename", rpmsys_rename, 0,0), + JS_FS("rmdir", rpmsys_rmdir, 0,0), + JS_FS("stat", rpmsys_stat, 0,0), + JS_FS("symlink", rpmsys_symlink, 0,0), + JS_FS("unlink", rpmsys_unlink, 0,0), + JS_FS_END +}; + +/* --- Object properties */ +enum rpmsys_tinyid { + _DEBUG = -2, + _CTERMID = -3, + _CTIME = -4, + _CWD = -5, + _DOMAINNAME = -6, + _EGID = -7, + _EUID = -8, + _GID = -9, + _GROUPS = -10, + _HOSTID = -11, + _HOSTNAME = -12, + _PGID = -13, + _PID = -14, + _PPID = -15, + _SID = -16, + _TID = -17, + _TIME = -18, + _TIMEOFDAY = -19, + _UID = -20, + _UMASK = -21, + _UNAME = -22, + + _RLIMIT = -31, /* todo++ */ + _RUSAGE = -32, /* todo++ */ +}; + +static JSPropertySpec rpmsys_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {"ctermid", _CTERMID, JSPROP_ENUMERATE, NULL, NULL}, + {"ctime", _CTIME, JSPROP_ENUMERATE, NULL, NULL}, + {"cwd", _CWD, JSPROP_ENUMERATE, NULL, NULL}, + {"domainname",_DOMAINNAME, JSPROP_ENUMERATE, NULL, NULL}, + {"egid", _EGID, JSPROP_ENUMERATE, NULL, NULL}, + {"euid", _EUID, JSPROP_ENUMERATE, NULL, NULL}, + {"gid", _GID, JSPROP_ENUMERATE, NULL, NULL}, + {"groups", _GROUPS, JSPROP_ENUMERATE, NULL, NULL}, + {"hostid", _HOSTID, JSPROP_ENUMERATE, NULL, NULL}, + {"hostname",_HOSTNAME, JSPROP_ENUMERATE, NULL, NULL}, + {"pgid", _PGID, JSPROP_ENUMERATE, NULL, NULL}, + {"pid", _PID, JSPROP_ENUMERATE, NULL, NULL}, + {"ppid", _PPID, JSPROP_ENUMERATE, NULL, NULL}, + {"sid", _TID, JSPROP_ENUMERATE, NULL, NULL}, + {"tid", _TID, JSPROP_ENUMERATE, NULL, NULL}, + {"time", _TIME, JSPROP_ENUMERATE, NULL, NULL}, + {"timeofday",_TIMEOFDAY, JSPROP_ENUMERATE, NULL, NULL}, + {"uid", _UID, JSPROP_ENUMERATE, NULL, NULL}, + {"umask", _UMASK, JSPROP_ENUMERATE, NULL, NULL}, + {"uname", _UNAME, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmsys_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: *vp = INT_TO_JSVAL(_debug); break; + case _CTERMID: + { char b[L_ctermid+1]; + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, ctermid(b))); + } break; + case _CTIME: + { char b[128]; + time_t secs = time(NULL); + char * t = strchr(ctime_r(&secs, b), '\n'); + if (t) *t = '\0'; + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, b)); + } break; + case _CWD: + { char b[PATH_MAX+1]; + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, getcwd(b, sizeof(b)))); + } break; + case _DOMAINNAME: + { char b[PATH_MAX+1]; + *vp = (!getdomainname(b, sizeof(b)) + ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, b)) : JSVAL_NULL); + } break; + case _EGID: *vp = INT_TO_JSVAL((int)getegid()); break; + case _EUID: *vp = INT_TO_JSVAL((int)geteuid()); break; + case _GID: *vp = INT_TO_JSVAL((int)getgid()); break; + case _GROUPS: + { gid_t gids[NGROUPS_MAX]; + int ng = getgroups(NGROUPS_MAX, gids); + if (ng > 0) { + jsval jsvec[NGROUPS_MAX]; + int i; + for (i = 0; i < ng; i++) + jsvec[i] = INT_TO_JSVAL((int)gids[i]); + *vp = OBJECT_TO_JSVAL(JS_NewArrayObject(cx, ng, jsvec)); + } else + *vp = JSVAL_NULL; + } break; + case _HOSTID: *vp = INT_TO_JSVAL((int)gethostid()); break;/* XXX */ + case _HOSTNAME: + { char b[PATH_MAX+1]; + *vp = (!gethostname(b, sizeof(b)) + ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, b)) : JSVAL_NULL); + } break; + case _PGID: *vp = INT_TO_JSVAL((int)getpgid((pid_t)0)); break; + case _PID: *vp = INT_TO_JSVAL((int)getpid()); break; + case _PPID: *vp = INT_TO_JSVAL((int)getppid()); break; + case _SID: *vp = INT_TO_JSVAL((int)getsid((pid_t)0)); break; +#if defined(WITH_PTHREADS) + case _TID: *vp = INT_TO_JSVAL((int)((long)pthread_self())); break; +#endif + case _TIME: *vp = INT_TO_JSVAL((int)time(NULL)); break; + case _TIMEOFDAY: + { struct timeval tv; + if (!gettimeofday(&tv, NULL)) { + jsval jsvec[2]; + jsvec[0] = INT_TO_JSVAL((int)tv.tv_sec); + jsvec[1] = INT_TO_JSVAL((int)tv.tv_usec); + *vp = OBJECT_TO_JSVAL(JS_NewArrayObject(cx, 2, jsvec)); + } else + *vp = JSVAL_NULL; + } break; + case _UID: *vp = INT_TO_JSVAL((int)getuid()); break; + case _UMASK: + { mode_t mode = umask(0000); + (void) umask(mode); + *vp = INT_TO_JSVAL(mode); + } break; + case _UNAME: /* XXX FIXME */ + { struct utsname uts; + if (!uname(&uts)) { + jsval jsvec[5]; + jsvec[0] = STRING_TO_JSVAL( + JS_NewStringCopyN(cx, uts.sysname, sizeof(uts.sysname))); + jsvec[1] = STRING_TO_JSVAL( + JS_NewStringCopyN(cx, uts.nodename, sizeof(uts.nodename))); + jsvec[2] = STRING_TO_JSVAL( + JS_NewStringCopyN(cx, uts.release, sizeof(uts.release))); + jsvec[3] = STRING_TO_JSVAL( + JS_NewStringCopyN(cx, uts.version, sizeof(uts.version))); + jsvec[4] = STRING_TO_JSVAL( + JS_NewStringCopyN(cx, uts.machine, sizeof(uts.machine))); + *vp = OBJECT_TO_JSVAL(JS_NewArrayObject(cx, 5, jsvec)); + } else + *vp = JSVAL_NULL; + } break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmsys_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmsys_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmsys_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ +#ifdef NOTYET + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + rpmsys sys = ptr; +#endif + + /* XXX VG: JS_Enumerate (jsobj.c:4211) doesn't initialize some fields. */ +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + +#ifdef NOTYET + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + if (idp) + *idp = JSVAL_ZERO; + *statep = INT_TO_JSVAL(ix); +if (_debug) +fprintf(stderr, "\tINIT sys %p\n", sys); + break; + case JSENUMERATE_NEXT: + ix = JSVAL_TO_INT(*statep); + if ((dp = Readdir(dir)) != NULL) { + (void) JS_DefineElement(cx, obj, + ix, STRING_TO_JSVAL(JS_NewStringCopyZ(cx, dp->d_name)), + NULL, NULL, JSPROP_ENUMERATE); + JS_ValueToId(cx, *statep, idp); +if (_debug) +fprintf(stderr, "\tNEXT sys %p[%u] dirent %p \"%s\"\n", sys, ix, dp, dp->d_name); + *statep = INT_TO_JSVAL(ix+1); + } else + *idp = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + ix = JSVAL_TO_INT(*statep); + (void) JS_DefineProperty(cx, obj, "length", INT_TO_JSVAL(ix), + NULL, NULL, JSPROP_ENUMERATE); +if (_debug) +fprintf(stderr, "\tFINI sys %p[%u]\n", sys, ix); + *statep = JSVAL_NULL; + break; + } +#endif + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static void +rpmsys_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmsysClass, NULL); + rpmsys sys = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + sys = _free(sys); +} + +static JSBool +rpmsys_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (JS_IsConstructing(cx, vp)) { + (void) rpmsys_init(cx, obj); + } else { + if ((obj = JS_NewObject(cx, &rpmsysClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass rpmsysClass = { + "Sys", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmsys_addprop, rpmsys_delprop, rpmsys_getprop, rpmsys_setprop, + (JSEnumerateOp)rpmsys_enumerate, (JSResolveOp)rpmsys_resolve, + rpmsys_convert, rpmsys_dtor, + + rpmsys_getobjectops, rpmsys_checkaccess, + rpmsys_call, rpmsys_construct, + rpmsys_xdrobject, rpmsys_hasinstance, + rpmsys_mark, rpmsys_reserveslots, +}; + +JSObject * +rpmjs_InitSysClass(JSContext *cx, JSObject* obj) +{ + JSObject * proto = JS_InitClass(cx, obj, NULL, &rpmsysClass, rpmsys_ctor, 1, + rpmsys_props, rpmsys_funcs, NULL, NULL); + +if (_debug) +fprintf(stderr, "<== %s(%p,%p) proto %p\n", __FUNCTION__, cx, obj, proto); + +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewSysObject(JSContext *cx) +{ + JSObject *obj; + rpmsys sys; + + if ((obj = JS_NewObject(cx, &rpmsysClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((sys = rpmsys_init(cx, obj)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmsys, Sys, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmsys-js.h b/rpm-5.4.9/js/rpmsys-js.h new file mode 100644 index 0000000..11ff58d --- /dev/null +++ b/rpm-5.4.9/js/rpmsys-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMSYS_JS +#define H_RPMSYS_JS + +/** + * \file js/rpmsys-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmsysClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitSysClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewSysObject(JSContext *cx); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMSYS_JS */ diff --git a/rpm-5.4.9/js/rpmte-js.c b/rpm-5.4.9/js/rpmte-js.c new file mode 100644 index 0000000..901f72f --- /dev/null +++ b/rpm-5.4.9/js/rpmte-js.c @@ -0,0 +1,441 @@ +/** \ingroup js_c + * \file js/rpmte-js.c + */ + +#include "system.h" + +#include "rpmts-js.h" +#include "rpmte-js.h" +#include "rpmds-js.h" +#include "rpmfi-js.h" +#include "rpmhdr-js.h" +#include "rpmjs-debug.h" + +#include +#include + +#include + +#include +#include +#include +#include +#define _RPMTE_INTERNAL /* XXX for rpmteNew/rpmteFree */ +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +#define rpmte_addprop JS_PropertyStub +#define rpmte_delprop JS_PropertyStub +#define rpmte_convert JS_ConvertStub + +/* --- helpers */ + +/* --- Object methods */ +static JSBool +rpmte_ds(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmteClass, NULL); + rpmte te = ptr; + rpmTag tagN = RPMTAG_NAME; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/i", &tagN))) + goto exit; + { rpmds ds = NULL; + JSObject *dso = NULL; + if ((ds = rpmteDS(te, tagN)) == NULL) + *vp = JSVAL_NULL; + else + if ((dso = JS_NewObject(cx, &rpmdsClass, NULL, NULL)) != NULL + && JS_SetPrivate(cx, dso, rpmdsLink(ds, __FUNCTION__))) + *vp = OBJECT_TO_JSVAL(dso); + else { + ds = rpmdsFree(ds); + *vp = JSVAL_VOID; + } + } + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +rpmte_fi(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmteClass, NULL); + rpmte te = ptr; + rpmTag tagN = RPMTAG_BASENAMES; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/i", &tagN))) + goto exit; + { rpmfi fi = NULL; + JSObject *fio = NULL; + if ((fi = rpmteFI(te, tagN)) == NULL) + *vp = JSVAL_NULL; + else + if ((fio = JS_NewObject(cx, &rpmfiClass, NULL, NULL)) != NULL + && JS_SetPrivate(cx, fio, rpmfiLink(fi, __FUNCTION__))) + *vp = OBJECT_TO_JSVAL(fio); + else { + fi = rpmfiFree(fi); + *vp = JSVAL_VOID; + } + } + ok = JS_TRUE; +exit: + return ok; +} + +static JSFunctionSpec rpmte_funcs[] = { + JS_FS("ds", rpmte_ds, 0,0), + JS_FS("fi", rpmte_fi, 0,0), + JS_FS_END +}; + +/* --- Object properties */ +enum rpmte_tinyid { + _DEBUG = -2, + _TYPE = -3, + _N = -4, + _E = -5, + _V = -6, + _R = -7, + _A = -8, + _O = -9, + _NEVR = -10, + _NEVRA = -11, + _PKGID = -12, + _HDRID = -13, + _COLOR = -14, + _PKGFSIZE = -15, + _BREADTH = -16, + _DEPTH = -17, + _NPREDS = -18, + _DEGREE = -19, + _PARENT = -20, + _TREE = -21, + _ADDEDKEY = -22, + _DBOFFSET = -23, + _KEY = -24, + _SOURCERPM = -25, +}; + +static JSPropertySpec rpmte_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {"type", _TYPE, JSPROP_ENUMERATE, NULL, NULL}, + {"N", _N, JSPROP_ENUMERATE, NULL, NULL}, + {"E", _E, JSPROP_ENUMERATE, NULL, NULL}, + {"V", _V, JSPROP_ENUMERATE, NULL, NULL}, + {"R", _R, JSPROP_ENUMERATE, NULL, NULL}, + {"A", _A, JSPROP_ENUMERATE, NULL, NULL}, + {"O", _O, JSPROP_ENUMERATE, NULL, NULL}, + {"NEVR", _NEVR, JSPROP_ENUMERATE, NULL, NULL}, + {"NEVRA", _NEVRA, JSPROP_ENUMERATE, NULL, NULL}, + {"pkgid", _PKGID, JSPROP_ENUMERATE, NULL, NULL}, + {"hdrid", _HDRID, JSPROP_ENUMERATE, NULL, NULL}, + {"color", _COLOR, JSPROP_ENUMERATE, NULL, NULL}, + {"pkgfsize",_PKGFSIZE, JSPROP_ENUMERATE, NULL, NULL}, + {"breadth", _BREADTH, JSPROP_ENUMERATE, NULL, NULL}, + {"depth", _DEPTH, JSPROP_ENUMERATE, NULL, NULL}, + {"npreds", _NPREDS, JSPROP_ENUMERATE, NULL, NULL}, + {"degree", _DEGREE, JSPROP_ENUMERATE, NULL, NULL}, + {"parent", _PARENT, JSPROP_ENUMERATE, NULL, NULL}, + {"tree", _TREE, JSPROP_ENUMERATE, NULL, NULL}, + {"addedkey",_ADDEDKEY, JSPROP_ENUMERATE, NULL, NULL}, + {"dboffset",_DBOFFSET, JSPROP_ENUMERATE, NULL, NULL}, +#ifdef NOTYET + {"key", _KEY, JSPROP_ENUMERATE, NULL, NULL}, +#endif + {"sourcerpm",_SOURCERPM, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmte_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmteClass, NULL); + rpmte te = ptr; + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + case _TYPE: + *vp = INT_TO_JSVAL(rpmteType(te)); /* XXX should be string */ + break; + case _N: + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmteN(te))); + break; + case _E: + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmteE(te))); + break; + case _V: + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmteV(te))); + break; + case _R: + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmteR(te))); + break; + case _A: + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmteA(te))); + break; + case _O: + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmteO(te))); + break; + case _NEVR: + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmteNEVR(te))); + break; + case _NEVRA: + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmteNEVRA(te))); + break; + case _PKGID: + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmtePkgid(te))); + break; + case _HDRID: + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmteHdrid(te))); + break; + case _COLOR: + *vp = INT_TO_JSVAL(rpmteColor(te)); + break; + case _PKGFSIZE: + *vp = INT_TO_JSVAL(rpmtePkgFileSize(te)); + break; + case _BREADTH: + *vp = INT_TO_JSVAL(rpmteBreadth(te)); + break; + case _DEPTH: + *vp = INT_TO_JSVAL(rpmteDepth(te)); + break; + case _NPREDS: + *vp = INT_TO_JSVAL(rpmteNpreds(te)); + break; + case _DEGREE: + *vp = INT_TO_JSVAL(rpmteDegree(te)); + break; + case _PARENT: +#ifdef DYING + *vp = INT_TO_JSVAL(rpmteColor(te)); +#else + *vp = JSVAL_VOID; +#endif + break; + case _TREE: + *vp = INT_TO_JSVAL(rpmteTree(te)); + break; + case _ADDEDKEY: + /* XXX FIXME */ + *vp = INT_TO_JSVAL((int)((long)rpmteAddedKey(te))); + break; + case _DBOFFSET: + *vp = INT_TO_JSVAL(rpmteDBOffset(te)); + break; +#ifdef NOTYET + case _KEY: + *vp = INT_TO_JSVAL(rpmteColor(te)); + break; +#endif + case _SOURCERPM: + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmteSourcerpm(te))); + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmte_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmteClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmte_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmteClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug); + + if (flags & JSRESOLVE_ASSIGNING) { + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmte_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + *idp = JSVAL_VOID; /* XXX immediate terminate */ + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static rpmte +rpmte_init(JSContext *cx, JSObject *obj, rpmts ts, JSObject *hdro) +{ + rpmte te = NULL; + rpmElementType etype = TR_ADDED; + fnpyKey key = NULL; + rpmRelocation relocs = NULL; + uint32_t dboffset = 0; + alKey pkgKey = NULL; + + if (hdro != NULL) { + Header h = JS_GetInstancePrivate(cx, hdro, &rpmhdrClass, NULL); + if ((te = rpmteNew(ts, h, etype, key, relocs, dboffset, pkgKey)) == NULL) + return NULL; + } + if (!JS_SetPrivate(cx, obj, (void *)te)) { + /* XXX error msg */ + (void) rpmteFree(te); + return NULL; + } + return te; +} + +static void +rpmte_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmteClass, NULL); + +_DTOR_DEBUG_ENTRY(_debug); + +#ifdef BUGGY /* XXX the ts object holds an implicit reference currently. */ + { rpmte te = ptr; + if (te != NULL) + (void) rpmteFree(te); + } +#endif +} + +static JSBool +rpmte_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + JSObject *tso = NULL; + JSObject *hdro = NULL; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "o/o", &tso, &hdro))) + goto exit; + + if (JS_IsConstructing(cx, vp)) { + rpmts ts = JS_GetInstancePrivate(cx, tso, &rpmtsClass, NULL); + if (rpmte_init(cx, obj, ts, hdro) == NULL) + goto exit; + } else { + if ((obj = JS_NewObject(cx, &rpmteClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass rpmteClass = { + "Te", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmte_addprop, rpmte_delprop, rpmte_getprop, rpmte_setprop, + (JSEnumerateOp)rpmte_enumerate, (JSResolveOp)rpmte_resolve, + rpmte_convert, rpmte_dtor, + JSCLASS_NO_OPTIONAL_MEMBERS +}; + +JSObject * +rpmjs_InitTeClass(JSContext *cx, JSObject* obj) +{ + JSObject * o; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + o = JS_InitClass(cx, obj, NULL, &rpmteClass, rpmte_ctor, 1, + rpmte_props, rpmte_funcs, NULL, NULL); +assert(o != NULL); + return o; +} + +JSObject * +rpmjs_NewTeObject(JSContext *cx, void * _ts, void * _hdro) +{ + JSObject *obj; + rpmte te; + + if ((obj = JS_NewObject(cx, &rpmteClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((te = rpmte_init(cx, obj, _ts, _hdro)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmte, Te, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmte-js.h b/rpm-5.4.9/js/rpmte-js.h new file mode 100644 index 0000000..f5629b5 --- /dev/null +++ b/rpm-5.4.9/js/rpmte-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMTE_JS +#define H_RPMTE_JS + +/** + * \file js/rpmte-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmteClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitTeClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewTeObject(JSContext *cx, void * _ts, void * _hdro); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMDS_JS */ diff --git a/rpm-5.4.9/js/rpmts-js.c b/rpm-5.4.9/js/rpmts-js.c new file mode 100644 index 0000000..086ea48 --- /dev/null +++ b/rpm-5.4.9/js/rpmts-js.c @@ -0,0 +1,777 @@ +/** \ingroup js_c + * \file js/rpmts-js.c + */ + +#include "system.h" + +#include "rpmts-js.h" +#include "rpmte-js.h" +#include "rpmmi-js.h" +#include "rpmjs-debug.h" + +#include +#include +#include +#include + +#include + +#define _RPMTS_INTERNAL +#include +#include + +#ifdef NOTYET +/* XXX FIXME: deadlock if used. ts holds implcit reference currently. */ +#define rpmteLink(_te) \ + ((rpmte)rpmioLinkPoolItem((rpmioItem)(_te), __FUNCTION__, __FILE__, __LINE__)) +#define rpmteUnlink(_te) \ + ((rpmte)rpmioUnlinkPoolItem((rpmioItem)(_te), __FUNCTION__, __FILE__, __LINE__)) +#else +#define rpmteLink(_te) (_te) +#define rpmteUnlink(_te) (_te) +#endif + +#include /* XXX rpmcliInstall{Check,Order,Run} */ + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +#define rpmts_addprop JS_PropertyStub +#define rpmts_delprop JS_PropertyStub +#define rpmts_convert JS_ConvertStub + +/* --- helpers */ + +#ifdef DYING +static JSObject * +rpmtsLoadNVRA(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtsClass, NULL); + rpmts ts = ptr; + JSObject * NVRA = JS_NewArrayObject(cx, 0, NULL); + ARGV_t keys = NULL; + int nkeys; + int xx; + int i; + + if (ts->rdb == NULL) + (void) rpmtsOpenDB(ts, O_RDONLY); + + xx = rpmdbMireApply(rpmtsGetRdb(ts), RPMTAG_NVRA, + RPMMIRE_STRCMP, NULL, &keys); + nkeys = argvCount(keys); + + if (keys) + for (i = 0; i < nkeys; i++) { + JSString * valstr = JS_NewStringCopyZ(cx, keys[i]); + jsval id = STRING_TO_JSVAL(valstr); + JS_SetElement(cx, NVRA, i, &id); + } + + JS_DefineProperty(cx, obj, "NVRA", OBJECT_TO_JSVAL(NVRA), + NULL, NULL, JSPROP_ENUMERATE); + +if (_debug) +fprintf(stderr, "==> %s(%p,%p) ptr %p NVRA %p\n", __FUNCTION__, cx, obj, ptr, NVRA); + + return NVRA; +} +#endif + +/* --- Object methods */ +static JSBool +rpmts_add(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtsClass, NULL); + rpmts ts = ptr; + char * pkgN = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &pkgN))) + goto exit; + + if (pkgN != NULL) { + rpmmi mi; + Header h; + int upgrade = 0; + int xx; + + switch (*pkgN) { + case '-': pkgN++; upgrade = -1; break; + case '+': pkgN++; upgrade = 1; break; + default: upgrade = 1; break; + } + mi = rpmtsInitIterator(ts, RPMTAG_NVRA, pkgN, 0); + while ((h = rpmmiNext(mi)) != NULL) { + xx = (upgrade >= 0) + ? rpmtsAddInstallElement(ts, h, (fnpyKey)pkgN, upgrade, NULL) + : rpmtsAddEraseElement(ts, h, rpmmiInstance(mi)); + break; + } + mi = rpmmiFree(mi); + } + + ok = JS_TRUE; +exit: + *vp = BOOLEAN_TO_JSVAL(ok); /* XXX return error */ + return ok; +} + +static JSBool +rpmts_check(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtsClass, NULL); + rpmts ts = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (rpmtsNElements(ts) > 0) + (void) rpmcliInstallCheck(ts); /* XXX print ps for now */ + ok = JS_TRUE; + + *vp = BOOLEAN_TO_JSVAL(ok); /* XXX return error */ + return ok; +} + +static JSBool +rpmts_order(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtsClass, NULL); + rpmts ts = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (rpmtsNElements(ts) > 0) + (void) rpmcliInstallOrder(ts); /* XXX print ps for now */ + ok = JS_TRUE; + + *vp = BOOLEAN_TO_JSVAL(ok); /* XXX return error */ + return ok; +} + +static JSBool +rpmts_run(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtsClass, NULL); + rpmts ts = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + +#ifdef NOTYET + /* XXX force --test instead. */ + if (rpmtsNElements(ts) > 0) + (void) rpmcliInstallRun(ts, NULL, 0); +#else + rpmtsEmpty(ts); +#endif + ok = JS_TRUE; + + *vp = BOOLEAN_TO_JSVAL(ok); /* XXX return error */ + return ok; +} + +static JSBool +rpmts_mi(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtsClass, NULL); + rpmts ts = ptr; + jsval tagid = JSVAL_VOID; + jsval kv = JSVAL_VOID; + rpmTag tag = RPMDBI_PACKAGES; + JSObject *mio; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/vv", &tagid, &kv))) + goto exit; + + if (!JSVAL_IS_VOID(tagid)) { + const char * s = JS_EncodeString(cx, JS_ValueToString(cx, tagid)); + /* XXX TODO: make sure both tag and key were specified. */ + tag = JSVAL_IS_INT(tagid) + ? (rpmTag) JSVAL_TO_INT(tagid) + : tagValue(s); + s = _free(s); + } + + if ((mio = rpmjs_NewMiObject(cx, ts, tag, kv)) == NULL) + goto exit; + + *vp = OBJECT_TO_JSVAL(mio); + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmts_dbrebuild(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtsClass, NULL); + rpmts ts = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + /* XXX rebuild requires root. */ + if (getuid()) + *vp = JSVAL_VOID; + else + *vp = (ts && !rpmtsRebuildDB(ts)) ? JSVAL_TRUE : JSVAL_FALSE; + ok = JS_TRUE; + + return ok; +} + +static JSBool +rpmts_dbkeys(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtsClass, NULL); + rpmts ts = ptr; + jsval tagid = JSVAL_VOID; + jsval v = JSVAL_VOID; + rpmTag tag = RPMTAG_NVRA; + rpmMireMode _mode = RPMMIRE_PCRE; + const char * _pat = NULL; + ARGV_t _av = NULL; + JSBool ok = JS_FALSE; + int xx; + +_METHOD_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/vvu", &v, &tagid, &v, &_mode))) + goto exit; + + if (!JSVAL_IS_VOID(tagid)) { + const char * s = JS_EncodeString(cx, JS_ValueToString(cx, tagid)); + /* XXX TODO: make sure both tag and key were specified. */ + tag = JSVAL_IS_INT(tagid) + ? (rpmTag) JSVAL_TO_INT(tagid) + : tagValue(s); + s = _free(s); + } + + if (JSVAL_IS_VOID(v)) + _pat = xstrdup("^.*$"); + else if (JSVAL_IS_NULL(v)) + _pat = NULL; + else if (JSVAL_IS_STRING(v)) + _pat = JS_EncodeString(cx, JS_ValueToString(cx, v)); +#ifdef NOTYET + else if (JSVAL_IS_NUMBER(v)) { + uint32_t _u = 0; + if (!JS_ValueToECMAUint32(cx, v, &_u)) { + *vp = JSVAL_VOID; + goto exit; + } + } +#endif + else + _pat = xstrdup("^a.*$"); + + switch (_mode) { + default: + *vp = JSVAL_VOID; + goto exit; + break; + case RPMMIRE_DEFAULT: + case RPMMIRE_STRCMP: + case RPMMIRE_REGEX: + case RPMMIRE_GLOB: + case RPMMIRE_PCRE: + break; + } + + if (rpmtsGetRdb(ts) == NULL) + xx = rpmtsOpenDB(ts, O_RDONLY); + + if (rpmdbMireApply(rpmtsGetRdb(ts), tag, _mode, _pat, &_av)) + *vp = JSVAL_VOID; + else if (_av == NULL || _av[0] == NULL) + *vp = JSVAL_NULL; + else { + int _ac = argvCount(_av); + int i; + JSObject * arr = JS_NewArrayObject(cx, 0, NULL); + *vp = OBJECT_TO_JSVAL(arr); + + for (i = 0; i < _ac; i++) { + v = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _av[i])); + ok = JS_SetElement(cx, arr, i, &v); + } + } + +exit: + ok = JS_TRUE; + _av = argvFree(_av); + _pat = _free(_pat); + return ok; +} + +static JSFunctionSpec rpmts_funcs[] = { + JS_FS("add", rpmts_add, 0,0), + JS_FS("check", rpmts_check, 0,0), + JS_FS("order", rpmts_order, 0,0), + JS_FS("run", rpmts_run, 0,0), + JS_FS("mi", rpmts_mi, 0,0), + JS_FS("dbrebuild", rpmts_dbrebuild, 0,0), + JS_FS("dbkeys", rpmts_dbkeys, 0,0), + JS_FS_END +}; + +/* --- Object properties */ +enum rpmts_tinyid { + _DEBUG = -2, + _LENGTH = -3, + _VSFLAGS = -4, + _TYPE = -5, + _ARBGOAL = -6, + _ROOTDIR = -7, + _CURRDIR = -8, + _SELINUX = -9, + _CHROOTDONE = -10, + _TID = -11, + _NELEMENTS = -12, + _PROBFILTER = -13, + _FLAGS = -14, + _DFLAGS = -15, + _GOAL = -16, + _DBMODE = -17, + _COLOR = -18, + _PREFCOLOR = -19, +}; + +static JSPropertySpec rpmts_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {"length", _LENGTH, JSPROP_ENUMERATE, NULL, NULL}, + {"vsflags", _VSFLAGS, JSPROP_ENUMERATE, NULL, NULL}, + {"type", _TYPE, JSPROP_ENUMERATE, NULL, NULL}, + {"arbgoal", _ARBGOAL, JSPROP_ENUMERATE, NULL, NULL}, + {"rootdir", _ROOTDIR, JSPROP_ENUMERATE, NULL, NULL}, + {"currdir", _CURRDIR, JSPROP_ENUMERATE, NULL, NULL}, + {"selinux", _SELINUX, JSPROP_ENUMERATE, NULL, NULL}, + {"chrootdone",_CHROOTDONE, JSPROP_ENUMERATE, NULL, NULL}, + {"tid", _TID, JSPROP_ENUMERATE, NULL, NULL}, + {"nelements",_NELEMENTS, JSPROP_ENUMERATE, NULL, NULL}, + {"probfilter",_PROBFILTER, JSPROP_ENUMERATE, NULL, NULL}, + {"flags", _FLAGS, JSPROP_ENUMERATE, NULL, NULL}, + {"dflags", _DFLAGS, JSPROP_ENUMERATE, NULL, NULL}, + {"goal", _GOAL, JSPROP_ENUMERATE, NULL, NULL}, + {"dbmode", _DBMODE, JSPROP_ENUMERATE, NULL, NULL}, + {"color", _COLOR, JSPROP_ENUMERATE, NULL, NULL}, + {"prefcolor",_PREFCOLOR, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmts_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtsClass, NULL); + rpmts ts = ptr; + jsint tiny = JSVAL_TO_INT(id); + +_PROP_DEBUG_ENTRY(_debug < 0); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + case _LENGTH: + *vp = INT_TO_JSVAL(rpmtsNElements(ts)); + break; + case _VSFLAGS: + *vp = INT_TO_JSVAL((jsint)rpmtsVSFlags(ts)); + break; + case _TYPE: + *vp = INT_TO_JSVAL((jsint)rpmtsType(ts)); + break; + case _ARBGOAL: + *vp = INT_TO_JSVAL((jsint)rpmtsARBGoal(ts)); + break; + case _ROOTDIR: + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmtsRootDir(ts))); + break; + case _CURRDIR: + *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, rpmtsCurrDir(ts))); + break; + case _SELINUX: + *vp = INT_TO_JSVAL((jsint)rpmtsSELinuxEnabled(ts)); + break; + case _CHROOTDONE: + *vp = INT_TO_JSVAL((jsint)rpmtsChrootDone(ts)); + break; + case _TID: + *vp = INT_TO_JSVAL((jsint)rpmtsGetTid(ts)); + break; + case _NELEMENTS: + *vp = INT_TO_JSVAL((jsint)rpmtsNElements(ts)); + break; + case _PROBFILTER: + *vp = INT_TO_JSVAL((jsint)rpmtsFilterFlags(ts)); + break; + case _FLAGS: + *vp = INT_TO_JSVAL((jsint)rpmtsFlags(ts)); + break; + case _DFLAGS: + *vp = INT_TO_JSVAL((jsint)rpmtsDFlags(ts)); + break; + case _GOAL: + *vp = INT_TO_JSVAL((jsint)rpmtsGoal(ts)); + break; + case _DBMODE: + *vp = INT_TO_JSVAL((jsint)rpmtsDBMode(ts)); + break; + case _COLOR: + *vp = INT_TO_JSVAL((jsint)rpmtsColor(ts)); + break; + case _PREFCOLOR: + *vp = INT_TO_JSVAL((jsint)rpmtsPrefColor(ts)); + break; + default: + if (JSVAL_IS_INT(id)) { + int oc = JSVAL_TO_INT(id); + JSObject *teo = NULL; + rpmte te = NULL; + /* XXX rpmteLink/rpmteUnlink are no-ops */ + if ((te = rpmtsElement(ts, oc)) != NULL + && (teo = JS_NewObject(cx, &rpmteClass, NULL, NULL)) != NULL + && JS_SetPrivate(cx, teo, rpmteLink(te))) + { + *vp = OBJECT_TO_JSVAL(teo); + } + break; + } +#ifdef DYING + if (JSVAL_IS_STRING(id)) { + JSString * str = JS_ValueToString(cx, id); + const char * name = JS_GetStringBytes(str); + if (!strcmp(name, "NVRA")) { + JSObject * NVRA = rpmtsLoadNVRA(cx, obj); + *vp = OBJECT_TO_JSVAL(NVRA); + } + break; + } +#endif + break; + } + + return JS_TRUE; +} + +static JSBool +rpmts_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtsClass, NULL); + rpmts ts = (rpmts)ptr; + jsint tiny = JSVAL_TO_INT(id); + const char * s = NULL; + int myint; + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + case _VSFLAGS: + if (!JS_ValueToInt32(cx, *vp, &myint)) + break; + (void) rpmtsSetVSFlags(ts, (rpmVSFlags)myint); + break; + case _TYPE: + if (!JS_ValueToInt32(cx, *vp, &myint)) + break; + (void) rpmtsSetType(ts, (rpmTSType)myint); + break; + case _ARBGOAL: + if (!JS_ValueToInt32(cx, *vp, &myint)) + break; + (void) rpmtsSetARBGoal(ts, (uint32_t)myint); + break; + case _ROOTDIR: + s = JS_EncodeString(cx, JS_ValueToString(cx, *vp)); + (void) rpmtsSetRootDir(ts, s); + s = _free(s); + break; + case _CURRDIR: + s = JS_EncodeString(cx, JS_ValueToString(cx, *vp)); + (void) rpmtsSetCurrDir(ts, s); + s = _free(s); + break; + case _CHROOTDONE: + if (!JS_ValueToInt32(cx, *vp, &myint)) + break; + (void) rpmtsSetChrootDone(ts, myint); + break; + case _TID: + if (!JS_ValueToInt32(cx, *vp, &myint)) + break; + (void) rpmtsSetTid(ts, (uint32_t)myint); + break; + case _FLAGS: + if (!JS_ValueToInt32(cx, *vp, &myint)) + break; + (void) rpmtsSetFlags(ts, myint); + break; + case _DFLAGS: + if (!JS_ValueToInt32(cx, *vp, &myint)) + break; + (void) rpmtsSetDFlags(ts, (rpmdepFlags)myint); + break; + case _GOAL: + if (!JS_ValueToInt32(cx, *vp, &myint)) + break; + (void) rpmtsSetGoal(ts, (tsmStage)myint); + break; + case _DBMODE: + if (!JS_ValueToInt32(cx, *vp, &myint)) + break; + (void) rpmtsSetDBMode(ts, myint); + break; + case _COLOR: + if (!JS_ValueToInt32(cx, *vp, &myint)) + break; + (void) rpmtsSetColor(ts, (uint32_t)(myint & 0x0f)); + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmts_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtsClass, NULL); + rpmts ts = ptr; + JSBool ok = JS_FALSE; + int oc; + +_RESOLVE_DEBUG_ENTRY(_debug); + + if (flags & JSRESOLVE_ASSIGNING) { + ok = JS_TRUE; + goto exit; + } + if (JSVAL_IS_INT(id) + && (oc = JSVAL_TO_INT(id)) >= 0 && oc < rpmtsNElements(ts)) + { + JSObject *teo = NULL; + rpmte te = NULL; + /* XXX rpmteLink/rpmteUnlink are no-ops */ + if ((te = rpmtsElement(ts, oc)) == NULL + || (teo = JS_NewObject(cx, &rpmteClass, NULL, NULL)) == NULL + || !JS_SetPrivate(cx, teo, rpmteLink(te)) + || !JS_DefineElement(cx, obj, oc, OBJECT_TO_JSVAL(teo), + NULL, NULL, JSPROP_ENUMERATE)) + { + *objp = NULL; + goto exit; + } + *objp = obj; + } else + *objp = NULL; + + ok = JS_TRUE; +exit: + return ok; +} + +static void +rpmtsi_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtsiClass, NULL); + rpmtsi tsi = ptr; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p) ptr %p\n", __FUNCTION__, cx, obj, ptr); + + tsi = rpmtsiFree(tsi); +} + +JSClass rpmtsiClass = { + "Tsi", + JSCLASS_HAS_PRIVATE, + JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, + JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, rpmtsi_dtor, + JSCLASS_NO_OPTIONAL_MEMBERS +}; + +static JSBool +rpmts_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtsClass, NULL); + rpmts ts = ptr; + rpmtsi tsi; + JSObject *tsio = NULL; + JSBool ok = JS_FALSE; + +_ENUMERATE_DEBUG_ENTRY(_debug); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + if ((tsio = JS_NewObject(cx, &rpmtsiClass, NULL, obj)) == NULL) + goto exit; + if ((tsi = rpmtsiInit(ts)) == NULL) + goto exit; + if (!JS_SetPrivate(cx, tsio, (void *)tsi)) { + tsi = rpmtsiFree(tsi); + goto exit; + } + *statep = OBJECT_TO_JSVAL(tsio); + if (idp) + *idp = JSVAL_ZERO; +if (_debug) +fprintf(stderr, "\tINIT tsio %p tsi %p\n", tsio, tsi); + break; + case JSENUMERATE_NEXT: + tsio = (JSObject *) JSVAL_TO_OBJECT(*statep); + tsi = JS_GetInstancePrivate(cx, tsio, &rpmtsiClass, NULL); + if (rpmtsiNext(tsi, 0) != NULL) { + int oc = rpmtsiOc(tsi); +if (_debug) +fprintf(stderr, "\tNEXT tsio %p tsi %p[%d]\n", tsio, tsi, oc); + JS_ValueToId(cx, INT_TO_JSVAL(oc), idp); + } else + *idp = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + tsio = (JSObject *) JSVAL_TO_OBJECT(*statep); + tsi = JS_GetInstancePrivate(cx, tsio, &rpmtsiClass, NULL); +if (_debug) +fprintf(stderr, "\tFINI tsio %p tsi %p\n", tsio, tsi); + /* Allow our iterator object to be GC'd. */ + *statep = JSVAL_NULL; + break; + } + ok = JS_TRUE; +exit: + return ok; +} + +/* --- Object ctors/dtors */ +static rpmts +rpmts_init(JSContext *cx, JSObject *obj) +{ + rpmts ts; + + if ((ts = rpmtsCreate()) == NULL) + return NULL; + if (!JS_SetPrivate(cx, obj, (void *)ts)) { + /* XXX error msg */ + (void) rpmtsFree(ts); + return NULL; + } + return ts; +} + +static void +rpmts_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtsClass, NULL); + rpmts ts = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + (void) rpmtsFree(ts); +} + +static JSBool +rpmts_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (JS_IsConstructing(cx, vp)) { + if (rpmts_init(cx, obj) == NULL) + goto exit; + } else { + if ((obj = JS_NewObject(cx, &rpmtsClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass rpmtsClass = { + "Ts", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmts_addprop, rpmts_delprop, rpmts_getprop, rpmts_setprop, + (JSEnumerateOp)rpmts_enumerate, (JSResolveOp)rpmts_resolve, + rpmts_convert, rpmts_dtor, + JSCLASS_NO_OPTIONAL_MEMBERS +}; + +JSObject * +rpmjs_InitTsClass(JSContext *cx, JSObject* obj) +{ + JSObject * o; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + o = JS_InitClass(cx, obj, NULL, &rpmtsClass, rpmts_ctor, 1, + rpmts_props, rpmts_funcs, NULL, NULL); +assert(o != NULL); + return o; +} + +JSObject * +rpmjs_NewTsObject(JSContext *cx) +{ + JSObject *obj; + rpmts ts; + + if ((obj = JS_NewObject(cx, &rpmtsClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((ts = rpmts_init(cx, obj)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmts, Ts, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmts-js.h b/rpm-5.4.9/js/rpmts-js.h new file mode 100644 index 0000000..ab82788 --- /dev/null +++ b/rpm-5.4.9/js/rpmts-js.h @@ -0,0 +1,27 @@ +#ifndef H_RPMTS_JS +#define H_RPMTS_JS + +/** + * \file js/rpmts-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmtsClass; +extern JSClass rpmtsiClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitTsClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewTsObject(JSContext *cx); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMTS_JS */ diff --git a/rpm-5.4.9/js/rpmtxn-js.c b/rpm-5.4.9/js/rpmtxn-js.c new file mode 100644 index 0000000..6b05c9a --- /dev/null +++ b/rpm-5.4.9/js/rpmtxn-js.c @@ -0,0 +1,472 @@ +/** \ingroup js_c + * \file js/rpmtxn-js.c + */ + +#include "system.h" + +#include "rpmtxn-js.h" +#include "rpmjs-debug.h" + +#include + +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmtxn_addprop JS_PropertyStub +#define rpmtxn_delprop JS_PropertyStub +#define rpmtxn_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmtxn_getobjectops NULL +#define rpmtxn_checkaccess NULL +#define rpmtxn_call rpmtxn_call +#define rpmtxn_construct rpmtxn_ctor +#define rpmtxn_xdrobject NULL +#define rpmtxn_hasinstance NULL +#define rpmtxn_mark NULL +#define rpmtxn_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmtxn_equality NULL +#define rpmtxn_outerobject NULL +#define rpmtxn_innerobject NULL +#define rpmtxn_iteratorobject NULL +#define rpmtxn_wrappedobject NULL + +/* --- helpers */ + +/* --- Object methods */ + +static JSBool +rpmtxn_Abort(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtxnClass, NULL); + DB_TXN * txn = ptr; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (txn == NULL) goto exit; + *vp = JSVAL_FALSE; + + { int ret = txn->abort(txn); + if (ret) + fprintf(stderr, "DB_TXN->abort: %s", db_strerror(ret)); + else + *vp = JSVAL_TRUE; + txn = ptr = NULL; + (void) JS_SetPrivate(cx, obj, ptr); + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmtxn_Commit(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtxnClass, NULL); + DB_TXN * txn = ptr; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (txn == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/u", &_flags))) + goto exit; + + { int ret = txn->commit(txn, _flags); + if (ret) + fprintf(stderr, "DB_TXN->commit: %s", db_strerror(ret)); + else + *vp = JSVAL_TRUE; + txn = ptr = NULL; + (void) JS_SetPrivate(cx, obj, ptr); + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmtxn_Discard(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtxnClass, NULL); + DB_TXN * txn = ptr; + uint32_t _flags = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (txn == NULL) goto exit; + *vp = JSVAL_FALSE; + + { int ret = txn->discard(txn, _flags); + if (ret) + fprintf(stderr, "DB_TXN->discard: %s", db_strerror(ret)); + else + *vp = JSVAL_TRUE; + txn = ptr = NULL; + (void) JS_SetPrivate(cx, obj, ptr); + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmtxn_Prepare(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtxnClass, NULL); + DB_TXN * txn = ptr; +#if !defined(DB_GID_SIZE) +#define DB_GID_SIZE 128 +#endif + uint8_t _gid[DB_GID_SIZE] = {0}; + const char * _s = NULL; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + if (txn == NULL) goto exit; + *vp = JSVAL_FALSE; + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_s))) + goto exit; + /* XXX todo: hex convert for _gid string? */ + (void) strncpy((char *)_gid, _s, sizeof(_gid)); + + { int ret = txn->prepare(txn, _gid); + if (ret) + fprintf(stderr, "DB_TXN->prepare: %s", db_strerror(ret)); + else + *vp = JSVAL_TRUE; + } + + ok = JS_TRUE; + +exit: + return ok; +} + +static JSFunctionSpec rpmtxn_funcs[] = { + JS_FS("abort", rpmtxn_Abort, 0,0), + JS_FS("commit", rpmtxn_Commit, 0,0), + JS_FS("discard", rpmtxn_Discard, 0,0), + JS_FS("prepare", rpmtxn_Prepare, 0,0), + JS_FS_END +}; + +/* --- Object properties */ + +#define _TABLE(_v) #_v, _##_v, JSPROP_ENUMERATE, NULL, NULL + +enum rpmtxn_tinyid { + _DEBUG = -2, + _NAME = -3, + _ID = -4, + _DB_SET_LOCK_TIMEOUT = -5, + _DB_SET_TXN_TIMEOUT = -6, +}; + +static JSPropertySpec rpmtxn_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {"name", _NAME, JSPROP_ENUMERATE, NULL, NULL}, + {"id", _ID, JSPROP_ENUMERATE, NULL, NULL}, + { _TABLE(DB_SET_LOCK_TIMEOUT) }, + { _TABLE(DB_SET_TXN_TIMEOUT) }, + + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmtxn_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtxnClass, NULL); + DB_TXN * txn = ptr; + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_NewNumberValue(cx, (jsdouble)_debug, vp)) + *vp = JSVAL_VOID; + break; + case _NAME: + { const char * _s = NULL; + int ret = txn->get_name(txn, &_s); + *vp = !ret ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _s)) : JSVAL_VOID; + } break; + case _ID: + { uint32_t _u = txn->id(txn); + if (!JS_NewNumberValue(cx, (jsdouble)_u, vp)) + *vp = JSVAL_VOID; + } break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmtxn_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtxnClass, NULL); + DB_TXN * txn = ptr; + jsint tiny = JSVAL_TO_INT(id); + uint32_t _flags = 0; + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + *vp = JSVAL_VOID; + break; + case _NAME: + { const char * _s = JS_EncodeString(cx, JS_ValueToString(cx, *vp)); + *vp = !txn->set_name(txn, _s) ? JSVAL_TRUE : JSVAL_FALSE; + _s = _free(_s); + } break; +#define _JUMP(_v, _lbl) _##_v: _flags = _v; goto _lbl + case _JUMP(DB_SET_LOCK_TIMEOUT, _set_timeout); + case _JUMP(DB_SET_TXN_TIMEOUT, _set_timeout); +#undef _JUMP + _set_timeout: + { uint32_t _u = 0; + if (JS_ValueToECMAUint32(cx, *vp, &_u)) { + db_timeout_t _timeout = _u; + *vp = !txn->set_timeout(txn, _timeout, _flags) + ? JSVAL_TRUE : JSVAL_FALSE; + } else + *vp = JSVAL_VOID; + } break; + + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmtxn_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtxnClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmtxn_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + *statep = JSVAL_VOID; + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + *statep = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static DB_TXN * +rpmtxn_init(JSContext *cx, JSObject *obj) +{ + DB_TXN * txn = NULL; +#ifdef NOTYET + uint32_t _flags = 0; + + if (rpmtxn_env_create(&db, _flags) || txn == NULL + || !JS_SetPrivate(cx, obj, (void *)txn)) +#else + if (!JS_SetPrivate(cx, obj, (void *)txn)) +#endif + { +#ifdef NOTYET + if (txn) + (void) txn->close(txn, _flags); +#endif + + /* XXX error msg */ + txn = NULL; + } + +if (_debug) +fprintf(stderr, "<== %s(%p,%p) txn %p\n", __FUNCTION__, cx, obj, txn); + + return txn; +} + +static void +rpmtxn_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtxnClass, NULL); +#ifdef NOTYET + DB_TXN * txn = ptr; + uint32_t _flags = 0; +#endif + +_DTOR_DEBUG_ENTRY(_debug); + +#ifdef NOTYET + if (db) { + (void) db->close(db, _flags); + } +#endif +} + +static JSBool +rpmtxn_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (JS_IsConstructing(cx, vp)) { + (void) rpmtxn_init(cx, obj); + } else { + if ((obj = JS_NewObject(cx, &rpmtxnClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +static JSBool +rpmtxn_call(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + /* XXX obj is the global object so lookup "this" object. */ + JSObject * o = JSVAL_TO_OBJECT(argv[-2]); + void * ptr = JS_GetInstancePrivate(cx, o, &rpmtxnClass, NULL); +#ifdef NOTYET + DB_TXN * txn = ptr; + const char *_fn = NULL; + const char * _con = NULL; +#endif + JSBool ok = JS_FALSE; + +#ifdef NOTYET + if (!(ok = JS_ConvertArguments(cx, argc, argv, "s", &_fn))) + goto exit; + + *vp = (txn && _fn && (_con = rpmtxnLgetfilecon(txn, _fn)) != NULL) + ? STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _con)) : JSVAL_VOID; + _con = _free(_con); + + ok = JS_TRUE; + +exit: +#endif + +if (_debug) +fprintf(stderr, "<== %s(%p,%p[%u],%p) o %p ptr %p\n", __FUNCTION__, cx, argv, (unsigned)argc, vp, o, ptr); + + return ok; +} + +/* --- Class initialization */ +JSClass rpmtxnClass = { + "Txn", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmtxn_addprop, rpmtxn_delprop, rpmtxn_getprop, rpmtxn_setprop, + (JSEnumerateOp)rpmtxn_enumerate, (JSResolveOp)rpmtxn_resolve, + rpmtxn_convert, rpmtxn_dtor, + + rpmtxn_getobjectops, rpmtxn_checkaccess, + rpmtxn_call, rpmtxn_construct, + rpmtxn_xdrobject, rpmtxn_hasinstance, + rpmtxn_mark, rpmtxn_reserveslots, +}; + +JSObject * +rpmjs_InitTxnClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmtxnClass, rpmtxn_ctor, 1, + rpmtxn_props, rpmtxn_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewTxnObject(JSContext *cx) +{ + JSObject *obj; + DB_TXN * txn; + + if ((obj = JS_NewObject(cx, &rpmtxnClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((txn = rpmtxn_init(cx, obj)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmtxn, Txn, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmtxn-js.h b/rpm-5.4.9/js/rpmtxn-js.h new file mode 100644 index 0000000..354abae --- /dev/null +++ b/rpm-5.4.9/js/rpmtxn-js.h @@ -0,0 +1,27 @@ +#ifndef H_RPMTXN_JS +#define H_RPMTXN_JS + +/** + * \file js/rpmtxn-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmtxnClass; +#define OBJ_IS_RPMTXN(_cx, _o) (JS_GET_CLASS(_cx, _o) == &rpmtxnClass) + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitTxnClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewTxnObject(JSContext *cx); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMTXN_JS */ diff --git a/rpm-5.4.9/js/rpmxar-js.c b/rpm-5.4.9/js/rpmxar-js.c new file mode 100644 index 0000000..92b9ac4 --- /dev/null +++ b/rpm-5.4.9/js/rpmxar-js.c @@ -0,0 +1,292 @@ +/** \ingroup js_c + * \file js/rpmxar-js.c + */ + +#include "system.h" + +#include "rpmxar-js.h" +#include "rpmst-js.h" +#include "rpmjs-debug.h" + +#define _RPMXAR_INTERNAL +#include + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +/* Required JSClass vectors */ +#define rpmxar_addprop JS_PropertyStub +#define rpmxar_delprop JS_PropertyStub +#define rpmxar_convert JS_ConvertStub + +/* Optional JSClass vectors */ +#define rpmxar_getobjectops NULL +#define rpmxar_checkaccess NULL +#define rpmxar_call NULL +#define rpmxar_construct rpmxar_ctor +#define rpmxar_xdrobject NULL +#define rpmxar_hasinstance NULL +#define rpmxar_mark NULL +#define rpmxar_reserveslots NULL + +/* Extended JSClass vectors */ +#define rpmxar_equality NULL +#define rpmxar_outerobject NULL +#define rpmxar_innerobject NULL +#define rpmxar_iteratorobject NULL +#define rpmxar_wrappedobject NULL + +/* --- helpers */ + +/* --- Object methods */ + +static JSFunctionSpec rpmxar_funcs[] = { + JS_FS_END +}; + +/* --- Object properties */ +enum rpmxar_tinyid { + _DEBUG = -2, +}; + +static JSPropertySpec rpmxar_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +rpmxar_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmxarClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmxar_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmxarClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +rpmxar_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmxarClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug < 0); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +rpmxar_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmxarClass, NULL); + rpmxar xar = ptr; + int ix = 0; + +_ENUMERATE_DEBUG_ENTRY(_debug < 0); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + if (idp) + *idp = JSVAL_ZERO; + *statep = INT_TO_JSVAL(ix); +if (_debug) +fprintf(stderr, "\tINIT xar %p\n", xar); + break; + case JSENUMERATE_NEXT: + ix = JSVAL_TO_INT(*statep); + if (!rpmxarNext(xar)) { + const char * path = rpmxarPath(xar); + struct stat * st = xmalloc(sizeof(*st)); + JSObject * arr = JS_NewArrayObject(cx, 0, NULL); + JSBool ok = JS_AddRoot(cx, &arr); + JSObject * o; + jsval v; + + v = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, path)); + ok = JS_SetElement(cx, arr, 0, &v); + if (!rpmxarStat(xar, st) + && (o = JS_NewObject(cx, &rpmstClass, NULL, NULL)) != NULL + && JS_SetPrivate(cx, o, (void *)st)) + v = OBJECT_TO_JSVAL(o); + else { + st = _free(st); + v = JSVAL_NULL; + } + ok = JS_SetElement(cx, arr, 1, &v); + + v = OBJECT_TO_JSVAL(arr); + ok = JS_DefineElement(cx, obj, ix, v, NULL, NULL, JSPROP_ENUMERATE); + + (void) JS_RemoveRoot(cx, &arr); +if (_debug) +fprintf(stderr, "\tNEXT xar %p[%u] \"%s\"\n", xar, ix, path); + path = _free(path); + JS_ValueToId(cx, *statep, idp); + *statep = INT_TO_JSVAL(ix+1); + } else + *idp = JSVAL_VOID; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + ix = JSVAL_TO_INT(*statep); + (void) JS_DefineProperty(cx, obj, "length", INT_TO_JSVAL(ix), + NULL, NULL, JSPROP_ENUMERATE); +if (_debug) +fprintf(stderr, "\tFINI xar %p[%u]\n", xar, ix); + *statep = JSVAL_NULL; + break; + } + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static rpmxar +rpmxar_init(JSContext *cx, JSObject *obj, const char * _fn, const char * _fmode) +{ + rpmxar xar = NULL; + + if (_fn) { + if (_fmode == NULL) _fmode = "r"; + xar = rpmxarNew(_fn, _fmode); + } + + if (!JS_SetPrivate(cx, obj, (void *)xar)) { + /* XXX error msg */ + return NULL; + } + +if (_debug) +fprintf(stderr, "<== %s(%p,%p) xar(%s,%s) %p\n", __FUNCTION__, cx, obj, _fn, _fmode, xar); + return xar; +} + +static void +rpmxar_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &rpmxarClass, NULL); + rpmxar xar = ptr; + +_DTOR_DEBUG_ENTRY(_debug); + + (void) rpmxarFree(xar, __FUNCTION__); +} + +static JSBool +rpmxar_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + const char * _fn = "popt-1.14.xar"; + const char * _fmode = "r"; + +_CTOR_DEBUG_ENTRY(_debug); + + if (!(ok = JS_ConvertArguments(cx, argc, argv, "/ss", &_fn, &_fmode))) + goto exit; + + if (JS_IsConstructing(cx, vp)) { + (void) rpmxar_init(cx, obj, _fn, _fmode); + } else { + if ((obj = JS_NewObject(cx, &rpmxarClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass rpmxarClass = { + "Xar", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + rpmxar_addprop, rpmxar_delprop, rpmxar_getprop, rpmxar_setprop, + (JSEnumerateOp)rpmxar_enumerate, (JSResolveOp)rpmxar_resolve, + rpmxar_convert, rpmxar_dtor, + + rpmxar_getobjectops, rpmxar_checkaccess, + rpmxar_call, rpmxar_construct, + rpmxar_xdrobject, rpmxar_hasinstance, + rpmxar_mark, rpmxar_reserveslots, +}; + +JSObject * +rpmjs_InitXarClass(JSContext *cx, JSObject* obj) +{ + JSObject *proto; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + proto = JS_InitClass(cx, obj, NULL, &rpmxarClass, rpmxar_ctor, 1, + rpmxar_props, rpmxar_funcs, NULL, NULL); +assert(proto != NULL); + return proto; +} + +JSObject * +rpmjs_NewXarObject(JSContext *cx, const char * _fn, const char *_fmode) +{ + JSObject *obj; + rpmxar xar; + + if ((obj = JS_NewObject(cx, &rpmxarClass, NULL, NULL)) == NULL) { + /* XXX error msg */ + return NULL; + } + if ((xar = rpmxar_init(cx, obj, _fn, _fmode)) == NULL) { + /* XXX error msg */ + return NULL; + } + return obj; +} + +GPSEE_MODULE_WRAP(rpmxar, Xar, JS_TRUE) diff --git a/rpm-5.4.9/js/rpmxar-js.h b/rpm-5.4.9/js/rpmxar-js.h new file mode 100644 index 0000000..6490cc7 --- /dev/null +++ b/rpm-5.4.9/js/rpmxar-js.h @@ -0,0 +1,26 @@ +#ifndef H_RPMXAR_JS +#define H_RPMXAR_JS + +/** + * \file js/rpmxar-js.h + */ + +#include "rpm-js.h" + +extern JSClass rpmxarClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject * +rpmjs_InitXarClass(JSContext *cx, JSObject* obj); + +extern JSObject * +rpmjs_NewXarObject(JSContext *cx, const char * _fn, const char *_fmode); + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMXAR_JS */ diff --git a/rpm-5.4.9/js/syck-js.c b/rpm-5.4.9/js/syck-js.c new file mode 100644 index 0000000..d25c2b0 --- /dev/null +++ b/rpm-5.4.9/js/syck-js.c @@ -0,0 +1,469 @@ +/** \ingroup js_c + * \file js/syck-js.c + */ + +#include "system.h" + +#include "rpmjs-debug.h" + +#include + +#if defined(WITH_SYCK) +#include +#include "syck-js.h" + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +#define syck_addprop JS_PropertyStub +#define syck_delprop JS_PropertyStub +#define syck_convert JS_ConvertStub + +typedef struct syck_s { + void * P; +} * JSSyck; + +struct emitter_xtra { + void *L; + rpmiob iob; + int id; +}; + +struct parser_xtra { + void *L; +}; + +static SYMID +js_syck_parser_handler(SyckParser *p, SyckNode *n) +{ +#ifdef NOTYET + struct parser_xtra *bonus = (struct parser_xtra *)p->bonus; + int o2; + int o3 = -1; + int i; +#endif + int o = 0; + SYMID oid; + + switch (n->kind) { + case syck_str_kind: +#ifdef NOTYET + if (n->type_id == NULL || strcmp(n->type_id, "str") == 0) { + lua_pushlstring(bonus->L, n->data.str->ptr, n->data.str->len); + o = lua_gettop(bonus->L); + } else if (strcmp(n->type_id, "null") == 0) { + lua_pushnil(bonus->L); + o = lua_gettop(bonus->L); + } else if (strcmp(n->type_id, "bool#yes") == 0) { + lua_pushboolean(bonus->L, 1); + o = lua_gettop(bonus->L); + } else if (strcmp(n->type_id, "bool#no") == 0) { + lua_pushboolean(bonus->L, 0); + o = lua_gettop(bonus->L); + } else if (strcmp(n->type_id, "int#hex") == 0) { + long intVal = strtol(n->data.str->ptr, NULL, 16); + lua_pushnumber(bonus->L, intVal); + o = lua_gettop(bonus->L); + } else if (strcmp(n->type_id, "int") == 0) { + long intVal = strtol(n->data.str->ptr, NULL, 10); + lua_pushnumber(bonus->L, intVal); + o = lua_gettop(bonus->L); + } else { + lua_pushlstring(bonus->L, n->data.str->ptr, n->data.str->len); + o = lua_gettop(bonus->L); + } +#endif + break; + case syck_seq_kind: +#ifdef NOTYET + lua_newtable(bonus->L); + o = lua_gettop(bonus->L); + for (i = 0; i < n->data.list->idx; i++) { + oid = syck_seq_read(n, i); + syck_lookup_sym(p, oid, (char **)&o2); + lua_pushvalue(bonus->L, o2); + lua_rawseti(bonus->L, o, i+1); + } +#endif + break; + case syck_map_kind: +#ifdef NOTYET + lua_newtable(bonus->L); + o = lua_gettop(bonus->L); + for (i = 0; i < n->data.pairs->idx; i++) { + oid = syck_map_read(n, map_key, i); + syck_lookup_sym(p, oid, (char **)&o2); + oid = syck_map_read(n, map_value, i); + syck_lookup_sym(p, oid, (char **)&o3); + + lua_pushvalue(bonus->L, o2); + lua_pushvalue(bonus->L, o3); + lua_settable(bonus->L, o); + } +#endif + break; + } + oid = syck_add_sym(p, (char *)((long)o)); + return oid; +} + +static void js_syck_emitter_handler(SyckEmitter *e, st_data_t data) +{ + struct emitter_xtra *bonus = (struct emitter_xtra *)e->bonus; +#ifdef NOTYET + int type = lua_type(bonus->L, -1); + char buf[30]; /* find a better way, if possible */ + + switch (type) { + case LUA_TBOOLEAN: + if (lua_toboolean(bonus->L, -1)) + strcpy(buf, "true"); + else + strcpy(buf, "false"); + syck_emit_scalar(e, "boolean", scalar_none, 0, 0, 0, (char *)buf, strlen(buf)); + break; + case LUA_TSTRING: + syck_emit_scalar(e, "string", scalar_none, 0, 0, 0, (char *)lua_tostring(bonus->L, -1), lua_strlen(bonus->L, -1)); + break; + case LUA_TNUMBER: + /* should handle floats as well */ + snprintf(buf, sizeof(buf), "%i", (int)lua_tonumber(bonus->L, -1)); + syck_emit_scalar(e, "number", scalar_none, 0, 0, 0, buf, strlen(buf)); + break; + case LUA_TTABLE: + if (luaL_getn(bonus->L, -1) > 0) { /* treat it as an array */ + syck_emit_seq(e, "table", seq_none); + lua_pushnil(bonus->L); /* first key */ + while (lua_next(bonus->L, -2) != 0) { + /* `key' is at index -2 and `value' at index -1 */ + syck_emit_item(e, (st_data_t)bonus->id++); + lua_pop(bonus->L, 1); /* removes `value'; keeps `key' for next iteration */ + } + syck_emit_end(e); + } else { /* treat it as a map */ + syck_emit_map(e, "table", map_none); + lua_pushnil(bonus->L); + while (lua_next(bonus->L, -2) != 0) { + lua_pushvalue(bonus->L, -2); + syck_emit_item(e, (st_data_t)bonus->id++); + lua_pop(bonus->L, 1); + syck_emit_item(e, (st_data_t)bonus->id++); + lua_pop(bonus->L, 1); + } + syck_emit_end(e); + } + break; + } +#endif + bonus->id++; +} + +static void js_syck_mark_emitter(SyckEmitter *e, int idx) +{ +#ifdef NOTYET + struct emitter_xtra *bonus = (struct emitter_xtra *)e->bonus; + int type = lua_type(bonus->L, idx); + + switch (type) { + case LUA_TTABLE: + lua_pushnil(bonus->L); /* first key */ + while (lua_next(bonus->L, -2) != 0) { + /* `key' is at index -2 and `value' at index -1 */ + syck_emitter_mark_node(e, (st_data_t)bonus->id++); + lua_syck_mark_emitter(e, -1); + lua_pop(bonus->L, 1); + } + break; + default: + syck_emitter_mark_node(e, (st_data_t)bonus->id++); + break; + } +#endif +} + +static void js_syck_output_handler(SyckEmitter *e, char *str, long len) +{ + struct emitter_xtra *bonus = (struct emitter_xtra *)e->bonus; + (void) rpmiobAppend(bonus->iob, str, 0); +} + +/* --- Object methods */ + +static JSBool +syck_load(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + SyckParser *parser = syck_new_parser(); + struct parser_xtra *bonus = xcalloc(1, sizeof(*bonus)); + SYMID v; + int sobj; + char * s = NULL; + JSBool ok = JS_FALSE; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p,%p[%u],%p)\n", __FUNCTION__, cx, obj, argv, (unsigned)argc, vp); + + ok = JS_ConvertArguments(cx, argc, argv, "s", &s); + if (!ok) + goto exit; + +#ifdef NOTYET + bonus->L = lua_newthread(L); +#endif + parser->bonus = bonus; + + syck_parser_str(parser, s, strlen(s), NULL); + syck_parser_handler(parser, js_syck_parser_handler); + + v = syck_parse(parser); + syck_lookup_sym(parser, v, (char **)&sobj); + +#ifdef NOTYET + lua_xmove(bonus->L, L, 1); +#endif + + ok = JS_TRUE; + +exit: + syck_free_parser(parser); + return ok; +} + +static JSBool +syck_dump(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + SyckEmitter *emitter = syck_new_emitter(); + struct emitter_xtra * bonus = xcalloc(1, sizeof(*bonus)); + JSBool ok = JS_FALSE; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p,%p[%u],%p)\n", __FUNCTION__, cx, obj, argv, (unsigned)argc, vp); + +#ifdef NOTYET + ok = JS_ConvertArguments(cx, argc, argv, "", + &version, &syck_ns_str, &data); +#endif + if (!ok) + goto exit; + + bonus->iob = rpmiobNew(0); +#ifdef NOTYET + bonus->L = lua_newthread(L); + luaL_buffinit(L, &bonus->output); +#endif + emitter->bonus = bonus; + + syck_emitter_handler(emitter, js_syck_emitter_handler); + syck_output_handler(emitter, js_syck_output_handler); + +#ifdef NOTYET + lua_pushvalue(L, -2); + lua_xmove(L, bonus->L, 1); +#endif + + bonus->id = 1; + js_syck_mark_emitter(emitter, bonus->id); + + bonus->id = 1; + syck_emit(emitter, (st_data_t)((long)bonus->id)); + syck_emitter_flush(emitter, 0); + +#ifdef NOTYET + luaL_pushresult(&bonus->output); +#endif + + ok = JS_TRUE; + +exit: + bonus->iob = rpmiobFree(bonus->iob); + syck_free_emitter(emitter); + return ok; +} + +static JSFunctionSpec syck_funcs[] = { + JS_FS("load", syck_load, 0,0), + JS_FS("dump", syck_dump, 0,0), + JS_FS_END +}; + +/* --- Object properties */ +enum syck_tinyid { + _DEBUG = -2, +}; + +static JSPropertySpec syck_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +syck_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &syckClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + if (JSVAL_IS_STRING(id)) { + char * str = JS_EncodeString(cx, JSVAL_TO_STRING(id)); + const JSFunctionSpec *fsp; + for (fsp = syck_funcs; fsp->name != NULL; fsp++) { + if (strcmp(fsp->name, str)) + continue; + break; + } + str = _free(str); + goto exit; + } + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + default: + break; + } +exit: + return JS_TRUE; +} + +static JSBool +syck_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &syckClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +syck_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + JSObject *iterator; + JSBool ok = JS_FALSE; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p,%d,%p,%p)\n", __FUNCTION__, cx, obj, op, statep, idp); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + if ((iterator = JS_NewPropertyIterator(cx, obj)) == NULL) + goto exit; + *statep = OBJECT_TO_JSVAL(iterator); + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + iterator = (JSObject *) JSVAL_TO_OBJECT(*statep); + if (!JS_NextProperty(cx, iterator, idp)) + goto exit; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + /* Allow our iterator object to be GC'd. */ + *statep = JSVAL_NULL; + break; + } + ok = JS_TRUE; +exit: + return ok; +} + +static JSBool +syck_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &syckClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug); + + return JS_TRUE; +} + +/* --- Object ctors/dtors */ +static void +syck_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &syckClass, NULL); + +_DTOR_DEBUG_ENTRY(_debug); + + ptr = _free(ptr); +} + +static JSBool +syck_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (JS_IsConstructing(cx, vp)) { + JSSyck ptr = xcalloc(0, sizeof(*ptr)); + + if (ptr == NULL || !JS_SetPrivate(cx, obj, ptr)) { + ptr = _free(ptr); + goto exit; + } + } else { + if ((obj = JS_NewObject(cx, &syckClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass syckClass = { + "Syck", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE | JSCLASS_HAS_CACHED_PROTO(JSProto_Object), + syck_addprop, syck_delprop, syck_getprop, syck_setprop, + (JSEnumerateOp)syck_enumerate, (JSResolveOp)syck_resolve, + syck_convert, syck_dtor, + JSCLASS_NO_OPTIONAL_MEMBERS +}; + +JSObject * +rpmjs_InitSyckClass(JSContext *cx, JSObject* obj) +{ + JSObject * o; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + o = JS_InitClass(cx, obj, NULL, &syckClass, syck_ctor, 1, + syck_props, syck_funcs, NULL, NULL); +assert(o != NULL); + return o; +} + +GPSEE_MODULE_WRAP(syck, Syck, JS_TRUE) + +#endif /* WITH_SYCK */ diff --git a/rpm-5.4.9/js/syck-js.h b/rpm-5.4.9/js/syck-js.h new file mode 100644 index 0000000..8f09da8 --- /dev/null +++ b/rpm-5.4.9/js/syck-js.h @@ -0,0 +1,23 @@ +#ifndef H_SYCK_JS +#define H_SYCK_JS + +/** + * \file js/syck-js.h + */ + +#include "rpm-js.h" + +extern JSClass syckClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject* +rpmjs_InitSyckClass(JSContext *cx, JSObject* obj); + +#ifdef __cplusplus +} +#endif + +#endif /* H_SYCK_JS */ diff --git a/rpm-5.4.9/js/tscripts/.cvsignore b/rpm-5.4.9/js/tscripts/.cvsignore new file mode 100644 index 0000000..91c11d2 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/.cvsignore @@ -0,0 +1 @@ +*.jsc diff --git a/rpm-5.4.9/js/tscripts/Aug.js b/rpm-5.4.9/js/tscripts/Aug.js new file mode 100644 index 0000000..0afb54d --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Aug.js @@ -0,0 +1,58 @@ +if (loglvl) print("--> Aug.js"); + +const AUG_NONE = 0; +const AUG_SAVE_BACKUP = (1 << 0); /* Keep original file as *.augsave */ +const AUG_SAVE_NEWFILE = (1 << 1); /* Save new file as *.augnew */ +const AUG_TYPE_CHECK = (1 << 2); /* Typecheck lenses (expensive) */ +const AUG_NO_STDINC = (1 << 3); /* Do not use the builtin load path */ +const AUG_SAVE_NOOP = (1 << 4); /* Record (but don't perform) save */ +const AUG_NO_LOAD = (1 << 5); /* Do not load the tree from AUG_INIT */ +const AUG_NO_MODL_AUTOLOAD = (1 << 6); + +// var rpmaug = require("rpmaug"); + +var aug = new Aug("/", "", (AUG_NO_LOAD|AUG_SAVE_NEWFILE)); +ack("typeof aug;", "object"); +ack("aug instanceof Aug;", true); +ack("aug.debug = 1;", 1); +ack("aug.debug = 0;", 0); + +var _defvar = "/augeas/version/defvar"; +ack("aug.defvar('foo', 'bar')", "foo"); +ack("aug.defvar('foo')", "foo"); + +ack("aug.hosts = '/files/etc/hosts/*'", undefined); +aug.localhost = "127.0.0.1"; +ack('aug.localhost', '127.0.0.1'); + +ack("aug.load()", true); + +var passwd = "/files/etc/passwd"; +var rpc = passwd+"/rpc"; +var rpcname = rpc+"/name"; +ack("aug.print(rpc)", true); +ack("aug.get(rpcname)", "Rpcbind Daemon"); +ack("aug.set(rpcname, 'Yadda Yadda')", "Yadda Yadda"); +ack("aug.get(rpcname)", "Yadda Yadda"); + +var wild = passwd+"/rpc/*"; +ack("aug.match(wild)", '/files/etc/passwd/rpc/password,/files/etc/passwd/rpc/uid,/files/etc/passwd/rpc/gid,/files/etc/passwd/rpc/name,/files/etc/passwd/rpc/home,/files/etc/passwd/rpc/shell'); + +var newname = "newname"; +var rpcnewname = rpc+"/"+newname; +ack("aug.insert(rpcname, newname, 0)", true); +ack("aug.set(rpcnewname, 'George')", "George"); +ack("aug.get(rpcnewname)", "George"); + +var newrpc = passwd+"/newrpc"; +var newrpcnewname = newrpc+"/"+newname; +ack("aug.mv(rpc, newrpc)", true); +ack("aug.get(newrpcnewname)", "George"); +ack("aug.rm(newrpc)", 8); + +// XXX return depends on root in order to rewrite changed files. */ +ack("aug.save()", undefined); + +delete aug; + +if (loglvl) print("<-- Aug.js"); diff --git a/rpm-5.4.9/js/tscripts/Bc.js b/rpm-5.4.9/js/tscripts/Bc.js new file mode 100644 index 0000000..be8fe76 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Bc.js @@ -0,0 +1,11 @@ +if (loglvl) print("--> Bc.js"); + +var GPSEE = require('rpmbc'); + +var bc = new GPSEE.Bc(); +ack("typeof bc;", "object"); +ack("bc instanceof GPSEE.Bc;", true); +ack("bc.debug = 1;", 1); +ack("bc.debug = 0;", 0); + +if (loglvl) print("<-- Bc.js"); diff --git a/rpm-5.4.9/js/tscripts/Bf.js b/rpm-5.4.9/js/tscripts/Bf.js new file mode 100644 index 0000000..3058777 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Bf.js @@ -0,0 +1,55 @@ +if (loglvl) print("--> Bf.js"); + +var GPSEE = require("rpmbf"); + +var bf = new GPSEE.Bf(0,0); +ack("typeof bf;", "object"); +// ack("bf instanceof rpmbf.Bf;", true); +ack("bf.debug = 1;", 1); +ack("bf.debug = 0;", 0); + +ack("bf.clr();", true); +delete bf; + +var a = new GPSEE.Bf(3 * 1024, 8); +ack("a.add('foo');", true); +ack("a.chk('foo');", true); +ack("a.chk('bar');", false); +ack("a.chk('baz');", false); + +var b = new GPSEE.Bf(3 * 1024, 8); +ack("b.add('bar');", true); +ack("b.chk('foo');", false); +ack("b.chk('bar');", true); +ack("b.chk('baz');", false); + +var c = new GPSEE.Bf(3 * 1024, 8); +ack("c.chk('foo');", false); +ack("c.chk('bar');", false); +ack("c.chk('baz');", false); + +ack("c.union(a);", true); +ack("c.chk('foo');", true); +ack("c.chk('bar');", false); +ack("c.chk('baz');", false); + +ack("c.union(b);", true); +ack("c.chk('foo');", true); +ack("c.chk('bar');", true); +ack("c.chk('baz');", false); + +ack("c.del('foo');", true); +ack("c.chk('foo');", false); +ack("c.chk('bar');", true); +ack("c.chk('baz');", false); + +ack("c.del('bar');", true); +ack("c.chk('foo');", false); +ack("c.chk('bar');", false); +ack("c.chk('baz');", false); + +delete c; +delete b; +delete a; + +if (loglvl) print("<-- Bf.js"); diff --git a/rpm-5.4.9/js/tscripts/Cudf.js b/rpm-5.4.9/js/tscripts/Cudf.js new file mode 100644 index 0000000..974352b --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Cudf.js @@ -0,0 +1,59 @@ +if (loglvl) print("--> Cudf.js"); + +var RPMCUDV_CUDFDOC = 257; +var RPMCUDV_CUDF = 258; + +var GPSEE = require('rpmcudf'); + +var cudf = new GPSEE.Cudf(); +ack("typeof cudf;", "object"); +ack("cudf instanceof GPSEE.Cudf;", true); +ack("cudf.debug = 1;", 1); +ack("cudf.debug = 0;", 0); + +ack('cudf.haspreamble', false); +ack('cudf.hasrequest', false); +ack('cudf.isconsistent', false); +ack('cudf.installedsize', 0); +ack('cudf.universesize', 0); +ack('cudf.preamble', undefined); +ack('cudf.request', undefined); +ack('cudf.universe', undefined); +delete cudf + +var ufn = "legacy.cudf"; +cudf = new GPSEE.Cudf(ufn, RPMCUDV_CUDFDOC); +// print(cudf.preamble); +// print(cudf.request); +// print(cudf.universe); +delete cudf + +cudf = new GPSEE.Cudf(ufn); +ack('cudf.haspreamble', true); +ack('cudf.hasrequest', true); +ack('cudf.isconsistent', true); +ack('cudf.installedsize', 6); +ack('cudf.universesize', 20); +ack('cudf.preamble', undefined); +ack('cudf.request', undefined); +ack('cudf.universe', undefined); +delete cudf + +var sfn = "legacy-sol.cudf"; + +cudf = new GPSEE.Cudf(sfn); +ack('cudf.haspreamble', false); +ack('cudf.hasrequest', false); +ack('cudf.isconsistent', true); +ack('cudf.installedsize', 6); +ack('cudf.universesize', 6); +ack('cudf.preamble', undefined); +ack('cudf.request', undefined); +ack('cudf.universe', undefined); +delete cudf + +cudf = new GPSEE.Cudf(ufn); +ack('cudf.issolution(sfn)', true); +delete cudf + +if (loglvl) print("<-- Cudf.js"); diff --git a/rpm-5.4.9/js/tscripts/Db.js b/rpm-5.4.9/js/tscripts/Db.js new file mode 100644 index 0000000..f439735 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Db.js @@ -0,0 +1,1019 @@ +if (loglvl) print("--> Db.js"); + +// ---- access methods +var DB_BTREE = 1; +var DB_HASH = 2; +var DB_RECNO = 3; +var DB_QUEUE = 4; +var DB_UNKNOWN = 5; /* Figure it out on open. */ + +// ----- access flags +var DB_AFTER = 1; /* Dbc.put */ +var DB_APPEND = 2; /* Db.put */ +var DB_BEFORE = 3; /* Dbc.put */ +var DB_CONSUME = 4; /* Db.get */ +var DB_CONSUME_WAIT = 5; /* Db.get */ +var DB_CURRENT = 6; /* Dbc.get, Dbc.put, DbLogc.get */ +var DB_FIRST = 7; /* Dbc.get, DbLogc->get */ +var DB_GET_BOTH = 8; /* Db.get, Dbc.get */ +var DB_GET_BOTHC = 9; /* Dbc.get (internal) */ +var DB_GET_BOTH_RANGE = 10; /* Db.get, Dbc.get */ +var DB_GET_RECNO = 11; /* Dbc.get */ +var DB_JOIN_ITEM = 12; /* Dbc.get; don't do primary lookup */ +var DB_KEYFIRST = 13; /* Dbc.put */ +var DB_KEYLAST = 14; /* Dbc.put */ +var DB_LAST = 15; /* Dbc.get, DbLogc->get */ +var DB_NEXT = 16; /* Dbc.get, DbLogc->get */ +var DB_NEXT_DUP = 17; /* Dbc.get */ +var DB_NEXT_NODUP = 18; /* Dbc.get */ +var DB_NODUPDATA = 19; /* Db.put, Dbc.put */ +var DB_NOOVERWRITE = 20; /* Db.put */ +var DB_NOSYNC = 21; /* Db.close */ +var DB_OVERWRITE_DUP = 22; /* Dbc.put, Db.put; no DB_KEYEXIST */ +var DB_POSITION = 23; /* Dbc.dup */ +var DB_PREV = 24; /* Dbc.get, DbLogc->get */ +var DB_PREV_DUP = 25; /* Dbc.get */ +var DB_PREV_NODUP = 26; /* Dbc.get */ +var DB_SET = 27; /* Dbc.get, DbLogc->get */ +var DB_SET_RANGE = 28; /* Dbc.get */ +var DB_SET_RECNO = 29; /* Db.get, Dbc.get */ +var DB_UPDATE_SECONDARY = 30; /* Dbc.get, Dbc.del (internal) */ +var DB_SET_LTE = 31; /* Dbc.get (internal) */ +var DB_GET_BOTH_LTE = 32; /* Dbc.get (internal) */ + +// ------------------------- +var DB_AGGRESSIVE = 0x00000001; +var DB_ARCH_ABS = 0x00000001; +var DB_ARCH_DATA = 0x00000002; +var DB_ARCH_LOG = 0x00000004; +var DB_ARCH_REMOVE = 0x00000008; +var DB_AUTO_COMMIT = 0x00000100; +var DB_CDB_ALLDB = 0x00000040; +var DB_CHKSUM = 0x00000008; +var DB_CKP_INTERNAL = 0x00000002; +var DB_CREATE = 0x00000001; +var DB_CURSOR_BULK = 0x00000001; +var DB_CURSOR_TRANSIENT = 0x00000004; +var DB_CXX_NO_EXCEPTIONS = 0x00000002; +var DB_DIRECT = 0x00000010; +var DB_DIRECT_DB = 0x00000080; +var DB_DSYNC_DB = 0x00000200; +var DB_DUP = 0x00000010; +var DB_DUPSORT = 0x00000004; +var DB_DURABLE_UNKNOWN = 0x00000020; +var DB_ENCRYPT = 0x00000001; +var DB_ENCRYPT_AES = 0x00000001; +var DB_EXCL = 0x00000040; +var DB_EXTENT = 0x00000040; +var DB_FAILCHK = 0x00000020; +var DB_FAST_STAT = 0x00000001; +var DB_FCNTL_LOCKING = 0x00000800; +var DB_FLUSH = 0x00000001; +var DB_FORCE = 0x00000001; +var DB_FOREIGN_ABORT = 0x00000001; +var DB_FOREIGN_CASCADE = 0x00000002; +var DB_FOREIGN_NULLIFY = 0x00000004; +var DB_FREELIST_ONLY = 0x00000001; +var DB_FREE_SPACE = 0x00000002; +var DB_IGNORE_LEASE = 0x00002000; +var DB_IMMUTABLE_KEY = 0x00000002; +var DB_INIT_CDB = 0x00000040; +var DB_INIT_LOCK = 0x00000080; +var DB_INIT_LOG = 0x00000100; +var DB_INIT_MPOOL = 0x00000200; +var DB_INIT_REP = 0x00000400; +var DB_INIT_TXN = 0x00000800; +var DB_INORDER = 0x00000020; +var DB_JOIN_NOSORT = 0x00000001; +var DB_LOCKDOWN = 0x00001000; +var DB_LOCK_NOWAIT = 0x00000001; +var DB_LOCK_RECORD = 0x00000002; +var DB_LOCK_SET_TIMEOUT = 0x00000004; +var DB_LOCK_SWITCH = 0x00000008; +var DB_LOCK_UPGRADE = 0x00000010; +var DB_LOG_AUTO_REMOVE = 0x00000001; +var DB_LOG_CHKPNT = 0x00000002; +var DB_LOG_COMMIT = 0x00000004; +var DB_LOG_DIRECT = 0x00000002; +var DB_LOG_DSYNC = 0x00000004; +var DB_LOG_IN_MEMORY = 0x00000008; +var DB_LOG_NOCOPY = 0x00000008; +var DB_LOG_NOT_DURABLE = 0x00000010; +var DB_LOG_WRNOSYNC = 0x00000020; +var DB_LOG_ZERO = 0x00000010; +var DB_MPOOL_CREATE = 0x00000001; +var DB_MPOOL_DIRTY = 0x00000002; +var DB_MPOOL_DISCARD = 0x00000001; +var DB_MPOOL_EDIT = 0x00000004; +var DB_MPOOL_FREE = 0x00000008; +var DB_MPOOL_LAST = 0x00000010; +var DB_MPOOL_NEW = 0x00000020; +var DB_MPOOL_NOFILE = 0x00000001; +var DB_MPOOL_NOLOCK = 0x00000002; +var DB_MPOOL_TRY = 0x00000040; +var DB_MPOOL_UNLINK = 0x00000002; +var DB_MULTIPLE = 0x00000800; +var DB_MULTIPLE_KEY = 0x00004000; +var DB_MULTIVERSION = 0x00000004; +var DB_MUTEX_ALLOCATED = 0x00000001; +var DB_MUTEX_LOCKED = 0x00000002; +var DB_MUTEX_LOGICAL_LOCK = 0x00000004; +var DB_MUTEX_PROCESS_ONLY = 0x00000008; +var DB_MUTEX_SELF_BLOCK = 0x00000010; +var DB_MUTEX_SHARED = 0x00000020; +var DB_NOLOCKING = 0x00000400; +var DB_NOMMAP = 0x00000008; +var DB_NOORDERCHK = 0x00000002; +var DB_NOPANIC = 0x00000800; +var DB_NO_AUTO_COMMIT = 0x00001000; +var DB_ODDFILESIZE = 0x00000080; +var DB_ORDERCHKONLY = 0x00000004; +var DB_OVERWRITE = 0x00001000; +var DB_PANIC_ENVIRONMENT = 0x00002000; +var DB_PRINTABLE = 0x00000008; +var DB_PRIVATE = 0x00002000; +var DB_PR_PAGE = 0x00000010; +var DB_PR_RECOVERYTEST = 0x00000020; +var DB_RDONLY = 0x00000400; +var DB_RDWRMASTER = 0x00002000; +var DB_READ_COMMITTED = 0x00000400; +var DB_READ_UNCOMMITTED = 0x00000200; +var DB_RECNUM = 0x00000040; +var DB_RECOVER = 0x00000002; +var DB_RECOVER_FATAL = 0x00004000; +var DB_REGION_INIT = 0x00004000; +var DB_REGISTER = 0x00008000; +var DB_RENUMBER = 0x00000080; +var DB_REPMGR_CONF_2SITE_STRICT = 0x00000001; +var DB_REPMGR_PEER = 0x00000001; +var DB_REP_ANYWHERE = 0x00000001; +var DB_REP_CLIENT = 0x00000001; +var DB_REP_CONF_BULK = 0x00000002; +var DB_REP_CONF_DELAYCLIENT = 0x00000004; +var DB_REP_CONF_INMEM = 0x00000008; +var DB_REP_CONF_LEASE = 0x00000010; +var DB_REP_CONF_NOAUTOINIT = 0x00000020; +var DB_REP_CONF_NOWAIT = 0x00000040; +var DB_REP_ELECTION = 0x00000004; +var DB_REP_MASTER = 0x00000002; +var DB_REP_NOBUFFER = 0x00000002; +var DB_REP_PERMANENT = 0x00000004; +var DB_REP_REREQUEST = 0x00000008; +var DB_REVSPLITOFF = 0x00000100; +var DB_RMW = 0x00001000; +var DB_RPCCLIENT = 0x00000001; +var DB_SALVAGE = 0x00000040; +var DB_SA_SKIPFIRSTKEY = 0x00000080; +var DB_SA_UNKNOWNKEY = 0x00000100; +var DB_SEQ_DEC = 0x00000001; +var DB_SEQ_INC = 0x00000002; +var DB_SEQ_RANGE_SET = 0x00000004; +var DB_SEQ_WRAP = 0x00000008; +var DB_SEQ_WRAPPED = 0x00000010; +var DB_SET_LOCK_TIMEOUT = 0x00000001; +var DB_SET_REG_TIMEOUT = 0x00000004; +var DB_SET_TXN_NOW = 0x00000008; +var DB_SET_TXN_TIMEOUT = 0x00000002; +var DB_SHALLOW_DUP = 0x00000100; +var DB_SNAPSHOT = 0x00000200; +var DB_STAT_ALL = 0x00000004; +var DB_STAT_CLEAR = 0x00000001; +var DB_STAT_LOCK_CONF = 0x00000008; +var DB_STAT_LOCK_LOCKERS = 0x00000010; +var DB_STAT_LOCK_OBJECTS = 0x00000020; +var DB_STAT_LOCK_PARAMS = 0x00000040; +var DB_STAT_MEMP_HASH = 0x00000008; +var DB_STAT_MEMP_NOERROR = 0x00000010; +var DB_STAT_SUBSYSTEM = 0x00000002; +var DB_ST_DUPOK = 0x00000200; +var DB_ST_DUPSET = 0x00000400; +var DB_ST_DUPSORT = 0x00000800; +var DB_ST_IS_RECNO = 0x00001000; +var DB_ST_OVFL_LEAF = 0x00002000; +var DB_ST_RECNUM = 0x00004000; +var DB_ST_RELEN = 0x00008000; +var DB_ST_TOPLEVEL = 0x00010000; +var DB_SYSTEM_MEM = 0x00010000; +var DB_THREAD = 0x00000010; +var DB_TIME_NOTGRANTED = 0x00008000; +var DB_TRUNCATE = 0x00004000; +var DB_TXN_NOSYNC = 0x00000001; +var DB_TXN_NOT_DURABLE = 0x00000002; +var DB_TXN_NOWAIT = 0x00000010; +var DB_TXN_SNAPSHOT = 0x00000002; +var DB_TXN_SYNC = 0x00000004; +var DB_TXN_WAIT = 0x00000008; +var DB_TXN_WRITE_NOSYNC = 0x00000020; +var DB_UNREF = 0x00020000; +var DB_UPGRADE = 0x00000001; +var DB_USE_ENVIRON = 0x00000004; +var DB_USE_ENVIRON_ROOT = 0x00000008; +var DB_VERB_DEADLOCK = 0x00000001; +var DB_VERB_FILEOPS = 0x00000002; +var DB_VERB_FILEOPS_ALL = 0x00000004; +var DB_VERB_RECOVERY = 0x00000008; +var DB_VERB_REGISTER = 0x00000010; +var DB_VERB_REPLICATION = 0x00000020; +var DB_VERB_REPMGR_CONNFAIL = 0x00000040; +var DB_VERB_REPMGR_MISC = 0x00000080; +var DB_VERB_REP_ELECT = 0x00000100; +var DB_VERB_REP_LEASE = 0x00000200; +var DB_VERB_REP_MISC = 0x00000400; +var DB_VERB_REP_MSGS = 0x00000800; +var DB_VERB_REP_SYNC = 0x00001000; +var DB_VERB_REP_TEST = 0x00002000; +var DB_VERB_WAITSFOR = 0x00004000; +var DB_VERIFY = 0x00000002; +var DB_VERIFY_PARTITION = 0x00040000; +var DB_WRITECURSOR = 0x00000008; +var DB_WRITELOCK = 0x00000010; +var DB_WRITEOPEN = 0x00008000; +var DB_YIELDCPU = 0x00010000; +// ------------------------- + +var rpmdb = require('rpmdb'); +var rpmdbc = require('rpmdbc'); +var rpmdbe = require('rpmdbe'); +var rpmtxn = require('rpmtxn'); + +function BDB(dbenv, _name, _type, _re_source, _flags) { + this.dbenv = dbenv; + this.db = new rpmdb.Db(dbenv, 0); + this.txn = null; + this.dbfile = _name + ".db"; + this.dbname = null; + this.oflags = DB_CREATE | DB_AUTO_COMMIT; + this.dbtype = _type; + this.dbperms = 0644; + + this.re_source = _re_source; + this.flags = _flags; + + this.db.errfile = this.errfile ="stderr"; + this.db.errpfx = this.errpfx = this.dbfile; + this.db.pagesize = this.pagesize = 1024; +// this.db.cachesize = this.cachesize = 0; + + this.avg_keysize = 128; + this.avg_datasize = 1024; + + switch (this.dbtype) { + case DB_HASH: + this.db.h_ffactor = this.h_ffactor = + Math.floor(100 * (pagesize - 32) / (avg_keysize + avg_datasize + 8)); + this.db.h_nelem = this.h_nelem = 12345; + break; + case DB_BTREE: + this.bt_minkey = undefined; + break; + case DB_RECNO: +// this.re_delim = 0x0a; +// this.db.re_len = this.re_len = 40; +// this.re_pad = 0x20; + this.db.re_source = this.re_source; + break; + case DB_QUEUE: + this.q_extentsize = 0; + this.db.re_len = this.re_len = 40; + break; + } + + this.associate = + function (secondary) { return this.db.associate(this.txn, secondary, 0); }; + this.associate_foreign = + function (secondary, flags) { return this.db.associate_foreign(secondary, flags); }; + + this.close = + function () { return this.db.close(0); }; + + this.cursor = + function (key) { + var dbc = this.db.cursor(); + if (key != undefined) + dbc.get(key, null, (key != null ? DB_SET : DB_NEXT)); + return dbc; + }; + + this.del = + function (key) { return this.db.del(this.txn, key); }; + + this.exists = + function (key) { return this.db.exists(this.txn, key); }; + + this.get = + function (key) { return this.db.get(this.txn, key); }; + + this.join = + function (A, B) { return this.db.join(A, B); }; + + this.key_range = + function (key) { return this.db.key_range(this.txn, key); }; + + this.put = + function (key, val) { return this.db.put(this.txn, key, val); }; + + this.sync = + function () { return this.db.sync(); }; + + this.print = + function(msg, list) { + var i, w; + print ("-----", msg); + for ([i, w] in Iterator(list)) { + var key = w; + print('\t' + w + '\t<=>\t' + this.db.get(this.txn, key)); + } + return true; + }; + + this.loop = + function(msg, imin, imax) { + var i; + print ("-----", msg); + for (i = imin; i < imax; i++) + print('\t' + i + ': ' + this.get(i)); + return true; + }; + + if (this.flags) + this.db.flags |= this.flags; + + return this.db.open(this.txn, this.dbfile, this.dbname, this.dbtype, + this.oflags, this.dbperms); +} + +function Fill(A) { + var dbenv = A.dbenv; + var db = A.db; + var dbc = null; + var txn = null; + var putflags = 0; + var imin = 1; + var imax = 10; + + print('----> PUT ' + dbenv.home + '/' + db.dbfile); + + switch (db.dbtype) { + case DB_HASH: + case DB_BTREE: + putflags = DB_NOOVERWRITE; + break; + case DB_RECNO: + case DB_QUEUE: + putflags = DB_APPEND; + break; + } + +// txn = dbenv.txn_begin(null, 0); +// ack("typeof txn;", "object"); +// ack("txn instanceof rpmtxn.Txn;", true); + for (let i = imin; i < imax; i++) + db.put(txn, i, i.toString(2), putflags); + db.sync(); +// txn.commit(); + +// print('----> GET ' + dbenv.home + '/' + db.dbfile); +// txn = null; +// for (let i = imin; i < imax; i++) { +// if (db.exists(txn, i)) +// print('\t' + i + ': ' + db.get(txn, i)); +// } + +// db.stat_print(DB_FAST_STAT); +// print("st_buckets:\t" + db.st_buckets); +// print("st_cur_recno:\t" + db.st_cur_recno); +// print("st_extentsize:\t" + db.st_extentsize); +// print("st_ffactor:\t" + db.st_ffactor); +// print("st_first_recno:\t" + db.st_first_recno); +// print("st_magic:\t" + db.st_magic); +// print("st_minkey:\t" + db.st_minkey); +// print("st_ndata:\t" + db.st_ndata); +// print("st_nkeys:\t" + db.st_nkeys); +// print("st_pagcnt:\t" + db.st_pagcnt); +// print("st_pagesize:\t" + db.st_pagesize); +// print("st_re_len:\t" + db.st_re_len); +// print("st_re_pad:\t" + db.st_re_pad); +// print("st_version:\t" + db.st_version); + +// txn = dbenv.txn_begin(null, 0); +// for (let i = 0; i < imax; i++) +// db.del(txn, i.toString(10)); +// txn.commit(); +} + +// ----- +var home = "./rpmdb"; +var eflags = DB_CREATE | DB_INIT_LOCK | DB_INIT_MPOOL | DB_INIT_REP | DB_INIT_TXN | DB_INIT_LOG; +var emode = 0; + +var dbenv = new rpmdbe.Dbe(); +ack("typeof dbenv;", "object"); +ack("dbenv instanceof rpmdbe.Dbe;", true); +ack('dbenv.lg_dir = "./log"', './log'); + +ack('dbenv.open(home, eflags, emode)', true); +ack('dbenv.home', home); +ack('dbenv.open_flags', eflags); + +var errfile = "stderr"; +var pagesize = 1024; +var cachesize = 1024 * 1024; +var little_endian = 1234; +var big_endian = 4321; + +var dbname = null; +var oflags = DB_CREATE | DB_AUTO_COMMIT; +var dbperms = 0644; + +var dbfile = "H.db"; +var dbtype = DB_HASH; +var avg_keysize = 128; +var avg_datasize = 1024; +var h_ffactor = Math.floor(100 * (pagesize - 32) / (avg_keysize + avg_datasize + 8)); +var h_nelem = 12345; +var H = new BDB(dbenv, "H", DB_HASH, null, 0); +ack('typeof H.db', 'object'); +ack('H.db instanceof rpmdb.Db;', true); +ack('H.db.dbfile', dbfile); +ack('H.db.dbname', dbname); +ack('H.db.type', dbtype); +ack('H.db.open_flags', oflags); +ack('H.db.h_ffactor', h_ffactor); +ack('H.db.h_nelem', h_nelem); +Fill(H); +ack('H.db.sync()', true); +ack('H.db.close(0)', true); + +var dbfile = "Q.db"; +var dbtype = DB_QUEUE; +var q_extentsize = 0; +var Q = new BDB(dbenv, "Q", DB_QUEUE, null, 0); +ack('typeof Q.db', 'object'); +ack('Q.db instanceof rpmdb.Db;', true); +ack('Q.db.dbfile', dbfile); +ack('Q.db.dbname', dbname); +ack('Q.db.type', dbtype); +ack('Q.db.open_flags', oflags); +ack('Q.db.q_extentsize', q_extentsize); +Fill(Q); +ack('Q.db.sync()', true); +ack('Q.db.close(0)', true); + +var dbfile = "B.db"; +var dbtype = DB_BTREE; +var bt_minkey = undefined; +var B = new BDB(dbenv, "B", DB_BTREE, null, 0); +ack('typeof B.db', 'object'); +ack('B.db instanceof rpmdb.Db;', true); +ack('B.db.dbfile', dbfile); +ack('B.db.dbname', dbname); +ack('B.db.type', dbtype); +ack('B.db.open_flags', oflags); +ack('B.db.bt_minkey', bt_minkey); +Fill(B); +ack('B.db.sync()', true); +ack('B.db.close(0)', true); + +var dbfile = "R.db"; +var dbtype = DB_RECNO; +var re_delim = 0x0a; +var re_len = undefined; +var re_pad = 0x20; +var re_source = "Source"; +var R = new BDB(dbenv, "R", DB_RECNO, null, 0); +ack('typeof R.db', 'object'); +ack('R.db instanceof rpmdb.Db;', true); +ack('R.db.dbfile', dbfile); +ack('R.db.dbname', dbname); +ack('R.db.type', dbtype); +ack('R.db.open_flags', oflags); +ack('R.db.re_delim', re_delim); +ack('R.db.re_len', 0); +ack('R.db.re_pad', re_pad); +ack('R.db.re_source', null); +Fill(R); +ack('R.db.sync()', true); +ack('R.db.close(0)', true); + +if (1) { +print('====> WORDS'); +var W = new BDB(dbenv, "W", DB_RECNO, "words", DB_SNAPSHOT); +var X = new BDB(dbenv, "X", DB_BTREE, null, 0); + +// var i = 0; +// var k = ''; +// do { +// ++i; +// k = W.get(i); +// print('\t', i, k); +// if (!k) +// break; +// X.put(k, i); +// } while (1) ; + +// var krwords = [ "boomerang", "fedora", "mugwumps", "stifle", "zebras" ]; +// for (let [key,val] in Iterator(krwords)) { +// print(' key_range(' + val + '):') +// print('\t' + W.key_range(val)); +// } + +var i; +var w = "wdj"; +if (X.exists(w)) + ack('X.del(w)', true); +if (W.exists(w)) + ack('W.del(w)', true); + +ack('W.associate(X.db, 0)', true); +ack('W.db.put(W.txn, 0, w, DB_APPEND)', true); +// print('\t' + w + '\t<=>\t' + X.get(w)); + +var luwords = [ "rpm", "package", "monkey", "wdj" ]; +for ([i,w] in Iterator(luwords)) { + var got = X.get(w); + if (got != w) + print('\t' + w + '\t<=>\t' + got); +} + +ack('X.del("wdj")', true); + +ack('X.sync() && X.close(0)', true); +ack('W.sync() && W.close(0)', true); + +print('<==== WORDS'); +} + +if (0) { +print('====> FILES'); +var dbfile = "F.db"; +var F = new BDB(dbenv, "F", DB_RECNO, "files", DB_SNAPSHOT); +var FN = new BDB(dbenv, "FN", DB_BTREE, null); +var BN = new BDB(dbenv, "BN", DB_BTREE, null); +var DN = new BDB(dbenv, "DN", DB_BTREE, null, DB_DUPSORT); + +// var i = 0; +// var k = ''; +// do { +// ++i; +// k = F.get(i); +// print('\t', i, k); +// if (!k) +// break; +// FN.put(k, i); +// var ix = k.lastIndexOf("/") + 1; +// BN.put(k.substr(ix), i); +// DN.put(k.substr(0, ix), i); +// } while (1) ; + +var dnlist = [ "/bin/", "/sbin/" ]; +for (var [key, val] in Iterator(dnlist)) { + print(' key_range(' + val + '):') + print('\t' + DN.key_range(val) + '\t' + FN.key_range(val)); +}; + +ack('F.db.associate(F.txn, FN.db, 0)', true); +ack('F.db.associate(F.txn, BN.db, 0)', true); +ack('F.db.associate(F.txn, DN.db, 0)', true); + +var fnlist = [ "/bin/bash", "/bin/cp", "/bin/mv", "/bin/sh", "/sbin/rmt" ]; + + F.loop("F", 3, 8); + FN.print("FN", fnlist); + BN.print("BN", [ "bash", "sh" ]); + DN.print("DN", [ "/bin/", "/sbin/" ]); + +for (var [key, val] in Iterator(fnlist)) { + var fn = val; + var ix = fn.lastIndexOf("/") + 1; + var bn = fn.substr(ix); + var dn = fn.substr(0, ix); + + var fnc = FN.cursor(fn); + ack('fnc.count()', 1); + ack('fnc.length', 1); + var bnc = BN.cursor(bn); + ack('bnc.count()', 1); + ack('bnc.length', 1); + var dnc = DN.cursor(dn); + ack('dnc.count()', (dn == "/sbin/" ? 277 : 106)); + ack('dnc.length', (dn == "/sbin/" ? 277 : 106)); + + + var fc = F.join(fnc, bnc); + ack('fc.get(null)', fn); + ack('fc.close()', true); + + var fc = F.join(dnc, bnc); + ack('fc.get(null)', fn); + ack('fc.close()', true); + + ack('dnc.close()', true); + ack('bnc.close()', true); + ack('fnc.close()', true); +} + +ack('DN.sync() && DN.close()', true); +ack('BN.sync() && BN.close()', true); +ack('FN.sync() && FN.close()', true); +ack('F.sync() && F.close()', true); + +print('<==== FILES'); +} + +if (1) { +print('====> GROUPS'); +var G = new BDB(dbenv, "G", DB_RECNO, "groups", DB_SNAPSHOT); +var GF = new BDB(dbenv, "GF", DB_RECNO, "groups", DB_SNAPSHOT); +var GN = new BDB(dbenv, "GN", DB_BTREE, null, DB_DUP); + +var bad = "Illegal"; +var glist = [ "Amusements/Games", "Documentation", "Utilities" ]; + +var key = 0; +var val = ''; +for (key = 1; (val = G.get(key)); key++) { +print('\t', key, val); + ack('GN.put(val, key)', true); +} + +for (let [key,val] in Iterator(glist)) { + print(' key_range(' + val + '):') + print('\t' + GN.key_range(val)); +} + +ack('G.associate(GN.db, 0)', true); +ack('GF.associate_foreign(GN.db, DB_FOREIGN_ABORT)', true); + +for ([i,g] in Iterator(glist)) { + var got = GN.get(g); + if (got != g) + print('\t' + g + '\t<=>\t' + got); +} + +ack('G.db.put(G.txn, 0, glist[0], DB_APPEND)', true); + +ack('G.db.put(G.txn, 0, bad, DB_APPEND)', false); +ack('GN.del(bad)', undefined); // XXX false instead? + +ack('GN.sync() && GN.close(0)', true); +ack('GF.sync() && GF.close(0)', true); +ack('G.sync() && G.close(0)', true); + +print('<==== GROUPS'); +} + +if (0) { +print('====> DEPS'); +var Clist = [ + [ "alsa-utils", "1.0.18", "2" ], + [ "anaconda-images", "10", "10" ], + [ "aspell-ca", "0.50", "2" ], + [ "aspell-config", "0.27", "2" ], + [ "aspell-da", "0.50", "2" ], + [ "aspell-de", "0.50", "2" ], + [ "aspell-es", "0.50", "2" ], + [ "aspell-fr", "0.50", "2" ], + [ "aspell-it", "0.50", "2" ], + [ "aspell-nl", "0.50", "2" ], + [ "aspell-no", "0.50", "2" ], + [ "aspell-pt_BR", "2.5", "2" ], + [ "aspell-sv", "0.50", "2" ], + [ "audispd-plugins", "1.7.7-1", "10" ], + [ "automake", "1.5", "2" ], + [ "automake", "1.8", "2" ], + [ "bash", "2.0.4-21", "10" ], + [ "binutils", "2.17.50.0.3-4", "2" ], + [ "bluez-gnome", "1.8", "10" ], + [ "bonobo-devel", "1.0.8", "2" ], + [ "cracklib-dicts", "2.8", "2" ], + [ "crontabs", "1.5", "10" ], + [ "cups", "1:1.1.20-4", "2" ], + [ "dbus", "1.1.4-3.fc9", "2" ], + [ "dejavu-fonts", "2.26-3", "2" ], + [ "dejavu-fonts-experimental", "2.26-3", "2" ], + [ "desktop-backgrounds-basic", "2.0-27", "2" ], + [ "desktop-backgrounds-extended", "2.0-27", "2" ], + [ "dhclient", "3.0.3-7", "2" ], + [ "docbook-utils", "0.6.9-4", "2" ], + [ "e2fsprogs", "1.37-4", "2" ], + [ "elilo", "3.6-5", "10" ], + [ "evolution", "2.4.1-5", "10" ], + [ "fipscheck", "1.2.0-1", "2" ], + [ "firstboot", "1.3.26", "10" ], + [ "fonts-hebrew", "0.100", "2" ], + [ "fonts-xorg-base", "", "0" ], + [ "fonts-xorg-syriac", "", "0" ], + [ "gcc-c++", "4.0.0", "2" ], + [ "GConf2-dbus", "", "0" ], + [ "GConf2-dbus-devel", "", "0" ], + [ "gdb", "5.1-2", "2" ], + [ "gdb", "6.6-9", "2" ], + [ "gdk-pixbuf-devel", "0.11", "10" ], + [ "gdm", "1:2.6.0.8-5", "2" ], + [ "ghostscript", "7.05", "2" ], + [ "glib2", "2.11.1-2", "2" ], + [ "glibc", "2.2", "2" ], + [ "glibc-common", "2.3.2-63", "10" ], + [ "gnome-libs-devel", "1:1.4.1.2", "2" ], + [ "gnome-libs-devel", "1.4.1.2", "2" ], + [ "gnome-power-manager", "2.15.3", "2" ], + [ "gnome-themes", "2.9.0", "2" ], + [ "gnome-vfs-devel", "1.0.2", "2" ], + [ "groff-tools", "1.18.1.4", "8" ], + [ "gtk2-engines", "2.7.4-7", "2" ], + [ "gtk-nodoka-engine", "0.7.0-2", "2" ], + [ "hal", "0.5.10-3.fc11", "2" ], + [ "hotplug", "3:2002_01_14-2", "2" ], + [ "hpijs", "1.5", "2" ], + [ "hwdata", "0.169", "2" ], + [ "initscripts", "4.26", "2" ], + [ "initscripts", "5.30-1", "10" ], + [ "initscripts", "6.55", "2" ], + [ "initscripts", "7.23", "2" ], + [ "initscripts", "7.84", "2" ], + [ "iptables", "1.3.2-1", "2" ], + [ "ipw2200-firmware", "2.4", "2" ], + [ "isdn4k-utils", "3.2-32", "2" ], + [ "ispell", "3.1.21", "2" ], + [ "iwl4965-firmware", "228.57.2", "2" ], + [ "jfsutils", "1.1.7-2", "2" ], + [ "kbd", "1.06-19", "2" ], + [ "kbd", "1.12-21", "2" ], + [ "kdebase", "3.1.5", "10" ], + [ "kdelibs", "6:3.5.2-6", "2" ], + [ "kdepim", "6:4.2.90", "2" ], + [ "kernel", "0:2.6", "2" ], + [ "kernel", "2.2.12-7", "2" ], + [ "kernel", "2.4", "2" ], + [ "kernel", "2.4.20", "2" ], + [ "kernel", "2.6.12", "2" ], + [ "kernel", "2.6.17", "2" ], + [ "kernel", "2.6.26", "2" ], + [ "kudzu", "1.2.0", "2" ], + [ "liberation-fonts", "1.04.93-8", "2" ], + [ "libglade", "0.17", "2" ], + [ "libgnomeui", "2.15.1cvs20060505-2", "2" ], + [ "libpciaccess", "0.10.3-5", "2" ], + [ "lm1100", "", "0" ], + [ "lokkit", "0.50-14", "2" ], + [ "lvm", "", "0" ], + [ "man-pages", "2.43-12", "2" ], + [ "man-pages-fr", "0.9.7-14", "2" ], + [ "man-pages-it", "0.3.0-17", "2" ], + [ "man-pages-pl", "0.24-2", "2" ], + [ "mdadm", "2.6.4-3", "2" ], + [ "mkinitrd", "0:4.1.11-1", "10" ], + [ "mkinitrd", "4.0", "2" ], + [ "mutt", "5:1.5.16-2", "2" ], + [ "nautilus", "2.0.3-1", "10" ], + [ "nautilus", "2.2.0", "2" ], + [ "ncurses", "5.6-13", "2" ], + [ "NetworkManager-openconnect", "0:0.7.0.99-1", "2" ], + [ "NetworkManager-openvpn", "1:0.7.0.99-1", "2" ], + [ "NetworkManager-pptp", "1:0.7.0.99-1", "2" ], + [ "NetworkManager-vpnc", "1:0.7.0.99-1", "2" ], + [ "nfs-utils", "1.0.7-12", "2" ], + [ "nss", "3.12.2.99.3-5", "2" ], + [ "nss_ldap", "254", "2" ], + [ "nut", "2.2.0", "2" ], + [ "oprofile", "0.9.1-2", "2" ], + [ "ORBit-devel", "1:0.5.8", "10" ], + [ "pam_krb5", "1.49", "2" ], + [ "passivetex", "1.21", "2" ], + [ "pcmcia-cs", "", "0" ], + [ "pcre", "4.0", "2" ], + [ "pirut", "1.1.4", "2" ], + [ "plymouth", "0.7.0-0.2009.02.26", "2" ], + [ "pm-utils", "0.99.3-11", "10" ], + [ "ppp", "2.4.3-3", "2" ], + [ "procps", "3.2.5-6.3", "2" ], + [ "psacct", "6.3.2-12", "2" ], + [ "python", "2.6-9.fc11", "2" ], + [ "qt", "0:2.2.2", "2" ], + [ "redhat-artwork", "0.243-1", "2" ], + [ "redhat-artwork", "0.35", "2" ], + [ "redhat-artwork", "5.0.5", "10" ], + [ "reiserfs-utils", "3.6.19-2", "2" ], + [ "samba-client", "3.0", "2" ], + [ "samba-common", "3.0", "2" ], + [ "selinux-policy", "3.0.3-3", "2" ], + [ "selinux-policy-targeted", "1.25.3-14", "2" ], + [ "squashfs-tools", "4.0", "2" ], + [ "subversion", "0.22.2-4", "2" ], + [ "subversion-devel", "0.22.2-4", "2" ], + [ "sysklogd", "1.4.1", "2" ], + [ "sysklogd", "1.4.1-43", "2" ], + [ "system-config-date", "1.9.35", "2" ], + [ "system-config-display", "1.0.31", "2" ], + [ "system-config-printer", "0.6.132", "2" ], + [ "system-config-printer", "0.7.0", "2" ], + [ "system-config-services", "0.99.29", "2" ], + [ "system-config-users", "1.2.82", "2" ], + [ "tcsh", "6.13-5", "2" ], + [ "tetex", "1.0.7-66", "2" ], + [ "ttfonts-ja", "1.2-23", "2" ], + [ "ttfonts-ko", "1.0.11-27", "2" ], + [ "ttfonts-zh_CN", "2.12-2", "2" ], + [ "ttfonts-zh_TW", "2.11-20", "2" ], + [ "udev", "062", "2" ], + [ "udev", "063-6", "2" ], + [ "util-linux", "2.11r-9", "2" ], + [ "util-linux", "2.12", "2" ], + [ "wireless-tools", "28-0.pre8.5", "2" ], + [ "wireless-tools", "29-3", "2" ], + [ "Xconfigurator", "", "0" ], + [ "xfsdump", "2.0.0", "2" ], + [ "xfsdump", "3.0.1", "2" ], + [ "xfsprogs", "2.6.13-4", "2" ], + [ "xorg-x11", "", "0" ], + [ "xorg-x11-drivers", "7.3-11.fc11", "2" ], + [ "xorg-x11-proto-devel", "7.2-12", "10" ], + [ "xorg-x11-server-Xorg", "1.3.0.0-19.fc8", "2" ], + [ "xorg-x11-server-Xorg", "1.4.99.901-14", "2" ], + [ "xorg-x11-server-Xorg", "1.6.0-7", "2" ], + [ "xpdf", "1:3.01-8", "10" ], + [ "xscreensaver", "1:5.00-19", "2" ], + [ "yaboot", "1.3.14-8", "2" ], + [ "ypbind", "1.6-12", "2" ], + [ "yum", "3.2.0", "2" ], +]; + +var C = new BDB(dbenv, "C", DB_BTREE, null, 0); +var CN = new BDB(dbenv, "CN", DB_BTREE, null, DB_DUP); +var CEVR = new BDB(dbenv, "CEVR", DB_BTREE, null, DB_DUP); +var CF = new BDB(dbenv, "CF", DB_BTREE, null, DB_DUP); + +var ops = [ "","<",">","?3","=","<=",">=","?7" ]; +for (var [ ix, dep ] in Iterator(Clist)) { + var N = dep[0]; + var EVR = dep[1]; + var F = dep[2]; + var op = ops[(F >> 1) & 0x7]; + var val = (((F & 0xf) == 0) ? N : (N + ' ' + op + ' ' + EVR)); + print('\t' + ix + ':', val); + C.put(ix, val); + CN.put(N, ix); + CEVR.put(EVR, ix); + CF.put(op, ix); +} + +ack('C.db.associate(C.txn, CN.db, 0)', true); +ack('C.db.associate(C.txn, CEVR.db, 0)', true); +ack('C.db.associate(C.txn, CF.db, 0)', true); + +var cnlist = [ "udev", "tcsh", "wnh" ]; + + C.loop("C", 3, 8); + CN.print("CN", cnlist); + CEVR.print("CEVR", [ "3.2.0", "" ]); + CF.print("CF", [ "2", "" ]); + +for (var [ix, dep] in Iterator(Clist)) { + var N = dep[0]; + var EVR = dep[1]; + var F = dep[2]; + var op = ops[(F >> 1) & 0x7]; + var val = (((F & 0xf) == 0) ? N : (N + ' ' + op + ' ' + EVR)); + + var CNc = CN.cursor(N); + nack('CNc.count()', 0); + nack('CNc.length', 0); + var CEVRc = CEVR.cursor(EVR); + nack('CEVRc.count()', 0); + nack('CEVRc.length', 0); + var CFc = CF.cursor(op); + nack('CFc.count()', 0); + nack('CFc.length', 0); + + var Cc = C.join(CNc, CEVRc, CFc); +// ack('Cc.get(null)', val); + print('\t' + ix + ': "' + val + '"\t<=>\t"' + Cc.get(null) + '"'); + ack('Cc.close()', true); + + ack('CFc.close()', true); + ack('CEVRc.close()', true); + ack('CNc.close()', true); +} + +ack('CF.sync() && CF.close(0)', true); +ack('CEVR.sync() && CEVR.close(0)', true); +ack('CN.sync() && CN.close(0)', true); +ack('C.sync() && C.close(0)', true); + +print('<==== DEPS'); +} + +var db = H.db; +// ack("db.debug = 1;", 1); +// ack("db.debug = 0;", 0); + +ack('db.errfile', errfile); +// ack('db.errpfx', dbfile); +ack('db.pagesize', pagesize); +// ack('db.cachesize', 265564); + +ack('db.lorder', little_endian); +ack('db.byteswapped', 0); +ack('db.multiple', 0); +ack('db.create_dir', null); +// ack('db.create_dir = "."', true); + +// --- not permitted with dbenv +// ack('db.encrypt', 0); +// ack('db.encrypt = "xyzzy"', true); + +ack('db.flags', 0); +// ack('db.flags = DB_REGION_INIT', true); + +ack('db.msgfile', null); +// ack('db.msgfile = "stdout"', true); + +ack('db.priority', 0); + +var txn = dbenv.txn_begin(null, 0); +ack('typeof txn', "object"); +ack('txn instanceof rpmtxn.Txn', true); +ack('db.put(txn, "foo", "bar")', true); +ack('db.exists(txn, "foo")', true); +ack('db.get(txn, "foo")', 'bar'); +ack('db.del(txn, "foo")', true); +ack('txn.commit()', true); + +var txn = dbenv.txn_begin(null, 0); +ack('typeof txn', "object"); +ack('txn instanceof rpmtxn.Txn', true); +var dbc = db.cursor(txn); +ack('typeof dbc;', "object"); +ack('dbc instanceof rpmdbc.Dbc;', true); +ack('dbc.get("foo", "bar", DB_SET)', undefined); +ack('dbc.put("foo", "bar", DB_KEYLAST)', true); +ack('dbc.close()', true); +ack('txn.commit()', true); + +var txn = dbenv.txn_begin(null, 0); +ack('typeof txn', "object"); +ack('txn instanceof rpmtxn.Txn', true); +var dbc = db.cursor(txn); +ack('typeof dbc;', "object"); +ack('dbc instanceof rpmdbc.Dbc;', true); +ack('dbc.get("foo", "bar", DB_SET)', 'bar'); +ack('dbc.count()', 1); +ack('dbc.del()', true); +ack('dbc.close()', true); +ack('txn.commit()', true); + +var txn = dbenv.txn_begin(null, 0); +ack('typeof txn', "object"); +ack('txn instanceof rpmtxn.Txn', true); +ack('txn.name', undefined); +ack('txn.name = "john"', true); +ack('txn.name', 'john'); +nack('txn.id', 0); +ack('txn.DB_SET_LOCK_TIMEOUT', undefined); +ack('txn.DB_SET_TXN_TIMEOUT', undefined); +ack('txn.abort()', true); + +var txn = dbenv.txn_begin(null, 0); +ack('typeof txn', "object"); +ack('txn instanceof rpmtxn.Txn', true); +ack('txn.name', undefined); +ack('txn.name = "ringo"', true); +ack('txn.name', 'ringo'); +nack('txn.id', 0); +ack('txn.DB_SET_LOCK_TIMEOUT', undefined); +ack('txn.DB_SET_TXN_TIMEOUT', undefined); +ack('db.put(txn, "foo", "bar")', true); +ack('db.exists(txn, "foo")', true); +ack('db.get(txn, "foo")', 'bar'); +ack('db.del(txn, "foo")', true); +ack('txn.commit()', true); + +var mpf = db.mpf; +ack('mpf.clear_len', 32); +ack('mpf.flags', 0); // todo++ +ack('mpf.ftype', -1); +ack('mpf.lsn_offset', 0); +ack('mpf.maxsize', 0); +ack('mpf.pgcookie', undefined); // todo++ +ack('mpf.priority', 3); +ack('db.close(0)', true); +delete db; + +var db = new rpmdb.Db(dbenv, 0); +ack('typeof db;', 'object'); +ack('db instanceof rpmdb.Db;', true); +ack('db.upgrade(dbfile)', true); +ack('db.verify(dbfile, dbname,0)', true); +// ack('db.truncate()', true); +delete db; + +// var db = new rpmdb.Db(dbenv, 0); +// ack('typeof db;', 'object'); +// ack('db instanceof rpmdb.Db;', true); +// ack('db.remove(dbfile, dbname)', true); +// delete db; + +ack('dbenv.close(0)', true); +delete dbenv; + +if (loglvl) print("<-- Db.js"); diff --git a/rpm-5.4.9/js/tscripts/Dbc.js b/rpm-5.4.9/js/tscripts/Dbc.js new file mode 100644 index 0000000..ac6f78a --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Dbc.js @@ -0,0 +1,47 @@ +if (loglvl) print("--> Dbc.js"); + +// ----- access flags +var DB_AFTER = 1; /* Dbc.put */ +var DB_APPEND = 2; /* Db.put */ +var DB_BEFORE = 3; /* Dbc.put */ +var DB_CONSUME = 4; /* Db.get */ +var DB_CONSUME_WAIT = 5; /* Db.get */ +var DB_CURRENT = 6; /* Dbc.get, Dbc.put, DbLogc.get */ +var DB_FIRST = 7; /* Dbc.get, DbLogc->get */ +var DB_GET_BOTH = 8; /* Db.get, Dbc.get */ +var DB_GET_BOTHC = 9; /* Dbc.get (internal) */ +var DB_GET_BOTH_RANGE = 10; /* Db.get, Dbc.get */ +var DB_GET_RECNO = 11; /* Dbc.get */ +var DB_JOIN_ITEM = 12; /* Dbc.get; don't do primary lookup */ +var DB_KEYFIRST = 13; /* Dbc.put */ +var DB_KEYLAST = 14; /* Dbc.put */ +var DB_LAST = 15; /* Dbc.get, DbLogc->get */ +var DB_NEXT = 16; /* Dbc.get, DbLogc->get */ +var DB_NEXT_DUP = 17; /* Dbc.get */ +var DB_NEXT_NODUP = 18; /* Dbc.get */ +var DB_NODUPDATA = 19; /* Db.put, Dbc.put */ +var DB_NOOVERWRITE = 20; /* Db.put */ +var DB_NOSYNC = 21; /* Db.close */ +var DB_OVERWRITE_DUP = 22; /* Dbc.put, Db.put; no DB_KEYEXIST */ +var DB_POSITION = 23; /* Dbc.dup */ +var DB_PREV = 24; /* Dbc.get, DbLogc->get */ +var DB_PREV_DUP = 25; /* Dbc.get */ +var DB_PREV_NODUP = 26; /* Dbc.get */ +var DB_SET = 27; /* Dbc.get, DbLogc->get */ +var DB_SET_RANGE = 28; /* Dbc.get */ +var DB_SET_RECNO = 29; /* Db.get, Dbc.get */ +var DB_UPDATE_SECONDARY = 30; /* Dbc.get, Dbc.del (internal) */ +var DB_SET_LTE = 31; /* Dbc.get (internal) */ +var DB_GET_BOTH_LTE = 32; /* Dbc.get (internal) */ + +var rpmdbc = require('rpmdbc'); + +var dbc = new rpmdbc.Dbc(); +ack("typeof dbc;", "object"); +ack("dbc instanceof rpmdbc.Dbc;", true); +ack("dbc.debug = 1;", 1); +ack("dbc.debug = 0;", 0); + +dbc.close(); + +if (loglvl) print("<-- Dbc.js"); diff --git a/rpm-5.4.9/js/tscripts/Dbe.js b/rpm-5.4.9/js/tscripts/Dbe.js new file mode 100644 index 0000000..8e7b5c8 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Dbe.js @@ -0,0 +1,266 @@ +if (loglvl) print("--> Dbe.js"); + +// ----- eflags +var DB_INIT_CDB = 0x00000040; +var DB_INIT_LOCK = 0x00000080; +var DB_INIT_LOG = 0x00000100; +var DB_INIT_MPOOL = 0x00000200; +var DB_INIT_REP = 0x00000400; +var DB_INIT_TXN = 0x00000800; + +var DB_RECOVER = 0x00000002; +var DB_RECOVER_FATAL = 0x00004000; + +var DB_CREATE = 0x00000001; +var DB_LOCKDOWN = 0x00001000; +var DB_FAILCHK = 0x00000020; +var DB_PRIVATE = 0x00002000; +var DB_REGISTER = 0x00008000; +var DB_SYSTEM_MEM = 0x00010000; +var DB_THREAD = 0x00000010; + +// ----- flags +var DB_AUTO_COMMIT = 0x00000100; +var DB_CDB_ALLDB = 0x00000040; +var DB_DIRECT_DB = 0x00000080; +var DB_DSYNC_DB = 0x00000200; +var DB_MULTIVERSION = 0x00000004; +var DB_NOLOCKING = 0x00000400; +var DB_NOMMAP = 0x00000008; +var DB_NOPANIC = 0x00000800; +var DB_OVERWRITE = 0x00001000; +var DB_REGION_INIT = 0x00004000; +var DB_TXN_NOSYNC = 0x00000001; +var DB_TXN_NOWAIT = 0x00000010; +var DB_TXN_SNAPSHOT = 0x00000002; +var DB_TXN_WRITE_NOSYNC = 0x00000020; +var DB_YIELDCPU = 0x00010000; + +var DB_LOG_IN_MEMORY = 0x00000008; +var DB_LOG_AUTO_REMOVE = 0x00000001; + +// ----- locking +var DB_LOCK_NORUN = 0; +var DB_LOCK_DEFAULT = 1; /* Default policy. */ +var DB_LOCK_EXPIRE = 2; /* Only expire locks, no detection. */ +var DB_LOCK_MAXLOCKS = 3; /* Select locker with max locks. */ +var DB_LOCK_MAXWRITE = 4; /* Select locker with max writelocks. */ +var DB_LOCK_MINLOCKS = 5; /* Select locker with min locks. */ +var DB_LOCK_MINWRITE = 6; /* Select locker with min writelocks. */ +var DB_LOCK_OLDEST = 7; /* Select oldest locker. */ +var DB_LOCK_RANDOM = 8; /* Select random locker. */ +var DB_LOCK_YOUNGEST = 9; /* Select youngest locker. */ + +// ----- + +var rpmdbe = require('rpmdbe'); + +var home = "./rpmdb"; +var eflags = DB_CREATE | DB_INIT_LOCK | DB_INIT_MPOOL | DB_INIT_REP | DB_INIT_TXN; +var emode = 0; + +var dbenv = new rpmdbe.Dbe(); +ack("typeof dbenv;", "object"); +ack("dbenv instanceof rpmdbe.Dbe;", true); +ack("dbenv.debug = 1;", 1); +ack("dbenv.debug = 0;", 0); + +ack('dbenv.version', 'Berkeley DB 4.8.26: (December 18, 2009)'); +ack('dbenv.major', 4); +ack('dbenv.minor', 8); +ack('dbenv.patch', 26); + +ack('dbenv.errpfx', null); +ack('dbenv.errpfx = home', home); +ack('dbenv.errpfx', home); + +ack('dbenv.errfile', null); +ack('dbenv.errfile = "stderr"', 'stderr'); +ack('dbenv.errfile', 'stderr'); + +ack('dbenv.cachemax', 265564); +ack('dbenv.cachesize', 265564); +ack('dbenv.ncaches', 1); + +ack('dbenv.cachemax = 1318912', 1318912); +ack('dbenv.cachesize = 1312348', 1312348); +ack('dbenv.ncaches = 2', 2); + +ack('dbenv.cachemax', 1318912); +ack('dbenv.cachesize', 2054206); +ack('dbenv.ncaches', 2); + +ack('dbenv.lk_max_lockers = 1000', 1000); +ack('dbenv.lk_max_locks = 1000', 1000); +ack('dbenv.lk_max_objects = 1000', 1000); + +ack('dbenv.mmapsize', 0); +ack('dbenv.mmapsize = 16*1024*1024', 16*1024*1024); +ack('dbenv.mmapsize', 16*1024*1024); + +ack('dbenv.thread_count', 0); +ack('dbenv.thread_count = 64', 64); +ack('dbenv.thread_count', 64); + +ack('dbenv.max_openfd', 0); +ack('dbenv.max_openfd = 100', 100); +ack('dbenv.max_openfd', 100); + +ack('dbenv.shm_key', -1); +ack('dbenv.shm_key = 0x1234', 0x1234); +ack('dbenv.shm_key = home', home); + +ack('dbenv.data_dirs', undefined); +ack('dbenv.data_dirs = "./data"', './data'); +ack('dbenv.data_dirs', './data'); + +ack('dbenv.create_dir', null); +ack('dbenv.create_dir = "."', '.'); +ack('dbenv.create_dir', null); // FIXME + +ack('dbenv.idirmode', null); +ack('dbenv.idirmode = "rwxr-xr-x"', "rwxr-xr-x"); +ack('dbenv.idirmode', 'rwxr-xr-x'); + +ack('dbenv.tmp_dir', null); +ack('dbenv.tmp_dir = "./tmp"', './tmp'); +ack('dbenv.tmp_dir', './tmp'); + +ack('dbenv.lg_bsize', 0); +ack('dbenv.lg_bsize = 65536', 65536); +ack('dbenv.lg_bsize', 65536); + +ack('dbenv.lg_dir', null); +ack('dbenv.lg_dir = "./log"', './log'); +ack('dbenv.lg_dir', './log'); + +ack('dbenv.lg_filemode', 0); +ack('dbenv.lg_filemode = 0644', 420); +ack('dbenv.lg_filemode', 0644); + +ack('dbenv.lg_max', 0); +ack('dbenv.lg_max = 10485760', 10485760); +ack('dbenv.lg_max', 10485760); + +ack('dbenv.lg_regionmax', 130000); + +ack('dbenv.lk_partitions = 40', 40); + +ack('dbenv.log_inmemory = 0', 0); +// ack('dbenv.log_direct = 0', 0); + +ack('dbenv.tx_max', 100); +ack('dbenv.tx_max = 100', 100); + +ack('dbenv.tx_timestamp', 0); +ack('dbenv.tx_timestamp = 0x12345678', 305419896); +ack('dbenv.tx_timestamp', 0x12345678); + +ack('dbenv.encrypt', 0); +// ack('dbenv.encrypt = "xyzzy"', true); +// ack('dbenv.encrypt', 1); + + +// ----- +ack('dbenv.open(home, eflags, emode)', true); +ack('dbenv.home', home); +ack('dbenv.open_flags', eflags); + +ack('dbenv.failchk()', true); +// var dbfile = "Stuff"; +// ack('dbenv.fileid_reset(dbfile)', true); +// ack('dbenv.lsn_reset(dbfile)', true); + +ack('dbenv.data_dirs', './data'); +ack('dbenv.create_dir', null); // FIXME + +ack('dbenv.flags', 0); +ack('dbenv.flags = DB_REGION_INIT', DB_REGION_INIT); + +ack('dbenv.msgfile', null); +// ack('dbenv.msgfile = "stdout"', true); + +ack('dbenv.mmapsize', 16*1024*1024); +ack('dbenv.mmapsize = 32*1024*1024', 32*1024*1024); +ack('dbenv.mmapsize', 32*1024*1024); + +ack('dbenv.mutex_align', 4); +ack('dbenv.mutex_align = 4', 4); + +ack('dbenv.mutex_inc', 0); +ack('dbenv.mutex_inc = 0', 0); + +ack('dbenv.mutex_max', 0); +ack('dbenv.mutex_max = 0', 0); + +ack('dbenv.mutex_spins', 200); +ack('dbenv.mutex_spins = 200', 200); + +ack('dbenv.DB_SET_LOCK_TIMEOUT', 0); +ack('dbenv.DB_SET_LOCK_TIMEOUT = 0', 0); + +ack('dbenv.DB_SET_TXN_TIMEOUT', 0); +ack('dbenv.DB_SET_TXN_TIMEOUT = 0', 0); + +ack('dbenv.tmp_dir', './tmp'); + +ack('dbenv.verbose', undefined); // todo++ +ack('dbenv.lk_conflicts', undefined); // todo++ + +ack('dbenv.lk_detect', DB_LOCK_DEFAULT); +ack('dbenv.lk_detect = DB_LOCK_DEFAULT', true); + +ack('dbenv.lk_max_lockers', 1000); + +ack('dbenv.lk_max_locks', 1000); + +ack('dbenv.lk_max_objects', 1000); + +ack('dbenv.lk_partitions', 40); + +ack('dbenv.log_direct', false); + +ack('dbenv.log_dsync', false); +ack('dbenv.log_dsync = 0', 0); + +ack('dbenv.log_autorm', false); +ack('dbenv.log_autorm = 0', 0); + +ack('dbenv.log_inmemory', false); + +ack('dbenv.log_zero', false); +ack('dbenv.log_zero = 0', 0); + +ack('dbenv.lg_bsize', 65536); +ack('dbenv.lg_dir', './log'); +ack('dbenv.lg_filemode', 0644); // todo++ +ack('dbenv.lg_max', 10485760); +ack('dbenv.lg_regionmax', 130000); + +ack('dbenv.DB_REP_CONF_BULK', 0); +ack('dbenv.DB_REP_CONF_DELAYCLIENT', 0); +ack('dbenv.DB_REP_CONF_INMEM', 0); +ack('dbenv.DB_REP_CONF_LEASE', 0); +ack('dbenv.DB_REP_CONF_NOAUTOINIT', 0); +ack('dbenv.DB_REP_CONF_NOWAIT', 0); +ack('dbenv.DB_REPMGR_CONF_2SITE_STRICT', 0); + +ack('dbenv.rep_limit', undefined); +ack('dbenv.rep_nsites', undefined); +ack('dbenv.rep_priority', undefined); + +ack('dbenv.DB_REP_ACK_TIMEOUT', 1000000); +ack('dbenv.DB_REP_CHECKPOINT_DELAY', 30000000); +ack('dbenv.DB_REP_CONNECTION_RETRY', 30000000); +ack('dbenv.DB_REP_ELECTION_TIMEOUT', 2000000); +ack('dbenv.DB_REP_ELECTION_RETRY', 10000000); +ack('dbenv.DB_REP_FULL_ELECTION_TIMEOUT', 0); +ack('dbenv.DB_REP_HEARTBEAT_MONITOR', 0); +ack('dbenv.DB_REP_HEARTBEAT_SEND', 0); +ack('dbenv.DB_REP_LEASE_TIMEOUT', 0); + +ack('dbenv.close(0)', true); + +delete dbenv; + +if (loglvl) print("<-- Dbe.js"); diff --git a/rpm-5.4.9/js/tscripts/Dc.js b/rpm-5.4.9/js/tscripts/Dc.js new file mode 100644 index 0000000..f78fab0 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Dc.js @@ -0,0 +1,1050 @@ +if (loglvl) print("--> Dc.js"); + +const PGPHASHALGO_MD5 = 1; /*!< MD5 */ +const PGPHASHALGO_SHA1 = 2; /*!< SHA-1 */ +const PGPHASHALGO_RIPEMD160 = 3; /*!< RIPEMD-160 */ +const PGPHASHALGO_MD2 = 5; /*!< MD2 */ +const PGPHASHALGO_TIGER192 = 6; /*!< TIGER-192 */ +const PGPHASHALGO_HAVAL_5_160 = 7; /*!< HAVAL-5-160 */ +const PGPHASHALGO_SHA256 = 8; /*!< SHA-256 */ +const PGPHASHALGO_SHA384 = 9; /*!< SHA-384 */ +const PGPHASHALGO_SHA512 = 10; /*!< SHA-512 */ +const PGPHASHALGO_SHA224 = 11; /*!< SHA-224 */ + +const PGPHASHALGO_MD4 = 104; /*!< (private) MD4 */ +const PGPHASHALGO_RIPEMD128 = 105; /*!< (private) RIPEMD-128 */ +const PGPHASHALGO_CRC32 = 106; /*!< (private) CRC-32 */ +const PGPHASHALGO_ADLER32 = 107; /*!< (private) ADLER-32 */ +const PGPHASHALGO_CRC64 = 108; /*!< (private) CRC-64 */ +const PGPHASHALGO_JLU32 = 109; /*!< (private) Jenkins lookup3.c */ + +const PGPHASHALGO_RIPEMD256 = 111; /*!< (private) RIPEMD-256 */ +const PGPHASHALGO_RIPEMD320 = 112; /*!< (private) RIPEMD-320 */ +const PGPHASHALGO_SALSA10 = 113; /*!< (private) SALSA-10 */ +const PGPHASHALGO_SALSA20 = 114; /*!< (private) SALSA-20 */ + +const PGPHASHALGO_MD6_224 = 128+0; /*!< (private) MD6-224 */ +const PGPHASHALGO_MD6_256 = 128+1; /*!< (private) MD6-256 */ +const PGPHASHALGO_MD6_384 = 128+2; /*!< (private) MD6-384 */ +const PGPHASHALGO_MD6_512 = 128+3; /*!< (private) MD6-512 */ + +const PGPHASHALGO_CUBEHASH_224 = 136+0; /*!< (private) CUBEHASH-224 */ +const PGPHASHALGO_CUBEHASH_256 = 136+1; /*!< (private) CUBEHASH-256 */ +const PGPHASHALGO_CUBEHASH_384 = 136+2; /*!< (private) CUBEHASH-384 */ +const PGPHASHALGO_CUBEHASH_512 = 136+3; /*!< (private) CUBEHASH-512 */ + +const PGPHASHALGO_KECCAK_224 = 144+0; /*!< (private) KECCAK-224 */ +const PGPHASHALGO_KECCAK_256 = 144+1; /*!< (private) KECCAK-256 */ +const PGPHASHALGO_KECCAK_384 = 144+2; /*!< (private) KECCAK-384 */ +const PGPHASHALGO_KECCAK_512 = 144+3; /*!< (private) KECCAK-512 */ + +const PGPHASHALGO_ECHO_224 = 148+0; /*!< (private) ECHO-224 */ +const PGPHASHALGO_ECHO_256 = 148+1; /*!< (private) ECHO-256 */ +const PGPHASHALGO_ECHO_384 = 148+2; /*!< (private) ECHO-384 */ +const PGPHASHALGO_ECHO_512 = 148+3; /*!< (private) ECHO-512 */ + +const PGPHASHALGO_EDONR_224 = 152+0; /*!< (private) EDONR-224 */ +const PGPHASHALGO_EDONR_256 = 152+1; /*!< (private) EDONR-256 */ +const PGPHASHALGO_EDONR_384 = 152+2; /*!< (private) EDONR-384 */ +const PGPHASHALGO_EDONR_512 = 152+3; /*!< (private) EDONR-512 */ + +const PGPHASHALGO_FUGUE_224 = 156+0; /*!< (private) FUGUE-224 */ +const PGPHASHALGO_FUGUE_256 = 156+1; /*!< (private) FUGUE-256 */ +const PGPHASHALGO_FUGUE_384 = 156+2; /*!< (private) FUGUE-384 */ +const PGPHASHALGO_FUGUE_512 = 156+3; /*!< (private) FUGUE-512 */ + +const PGPHASHALGO_SKEIN_224 = 160+0; /*!< (private) SKEIN-224 */ +const PGPHASHALGO_SKEIN_256 = 160+1; /*!< (private) SKEIN-256 */ +const PGPHASHALGO_SKEIN_384 = 160+2; /*!< (private) SKEIN-384 */ +const PGPHASHALGO_SKEIN_512 = 160+3; /*!< (private) SKEIN-512 */ +const PGPHASHALGO_SKEIN_1024 = 160+4; /*!< (private) SKEIN-1024 */ + +const PGPHASHALGO_BMW_224 = 168+0; /*!< (private) BMW-224 */ +const PGPHASHALGO_BMW_256 = 168+1; /*!< (private) BMW-256 */ +const PGPHASHALGO_BMW_384 = 168+2; /*!< (private) BMW-384 */ +const PGPHASHALGO_BMW_512 = 168+3; /*!< (private) BMW-512 */ + +const PGPHASHALGO_SHABAL_224 = 176+0; /*!< (private) SHABAL-224 */ +const PGPHASHALGO_SHABAL_256 = 176+1; /*!< (private) SHABAL-256 */ +const PGPHASHALGO_SHABAL_384 = 176+2; /*!< (private) SHABAL-384 */ +const PGPHASHALGO_SHABAL_512 = 176+3; /*!< (private) SHABAL-512 */ + +const PGPHASHALGO_SHAVITE3_224 = 180+0; /*!< (private) SHAVITE3-224 */ +const PGPHASHALGO_SHAVITE3_256 = 180+1; /*!< (private) SHAVITE3-256 */ +const PGPHASHALGO_SHAVITE3_384 = 180+2; /*!< (private) SHAVITE3-384 */ +const PGPHASHALGO_SHAVITE3_512 = 180+3; /*!< (private) SHAVITE3-512 */ + +const PGPHASHALGO_BLAKE_224 = 184+0; /*!< (private) BLAKE-224 */ +const PGPHASHALGO_BLAKE_256 = 184+1; /*!< (private) BLAKE-256 */ +const PGPHASHALGO_BLAKE_384 = 184+2; /*!< (private) BLAKE-384 */ +const PGPHASHALGO_BLAKE_512 = 184+3; /*!< (private) BLAKE-512 */ + +const PGPHASHALGO_TIB3_224 = 192+0; /*!< (private) TIB3-224 */ +const PGPHASHALGO_TIB3_256 = 192+1; /*!< (private) TIB3-256 */ +const PGPHASHALGO_TIB3_384 = 192+2; /*!< (private) TIB3-384 */ +const PGPHASHALGO_TIB3_512 = 192+3; /*!< (private) TIB3-512 */ + +const PGPHASHALGO_SIMD_224 = 200+0; /*!< (private) SIMD-224 */ +const PGPHASHALGO_SIMD_256 = 200+1; /*!< (private) SIMD-256 */ +const PGPHASHALGO_SIMD_384 = 200+2; /*!< (private) SIMD-384 */ +const PGPHASHALGO_SIMD_512 = 200+3; /*!< (private) SIMD-512 */ + +const PGPHASHALGO_ARIRANG_224 = 208+0; /*!< (private) ARIRANG-224 */ +const PGPHASHALGO_ARIRANG_256 = 208+1; /*!< (private) ARIRANG-256 */ +const PGPHASHALGO_ARIRANG_384 = 208+2; /*!< (private) ARIRANG-384 */ +const PGPHASHALGO_ARIRANG_512 = 208+3; /*!< (private) ARIRANG-512 */ + +const PGPHASHALGO_LANE_224 = 212+0; /*!< (private) LANE-224 */ +const PGPHASHALGO_LANE_256 = 212+1; /*!< (private) LANE-256 */ +const PGPHASHALGO_LANE_384 = 212+2; /*!< (private) LANE-384 */ +const PGPHASHALGO_LANE_512 = 212+3; /*!< (private) LANE-512 */ + +const PGPHASHALGO_LUFFA_224 = 216+0; /*!< (private) LUFFA-224 */ +const PGPHASHALGO_LUFFA_256 = 216+1; /*!< (private) LUFFA-256 */ +const PGPHASHALGO_LUFFA_384 = 216+2; /*!< (private) LUFFA-384 */ +const PGPHASHALGO_LUFFA_512 = 216+3; /*!< (private) LUFFA-512 */ + +const PGPHASHALGO_CHI_224 = 224+0; /*!< (private) CHI-224 */ +const PGPHASHALGO_CHI_256 = 224+1; /*!< (private) CHI-256 */ +const PGPHASHALGO_CHI_384 = 224+2; /*!< (private) CHI-384 */ +const PGPHASHALGO_CHI_512 = 224+3; /*!< (private) CHI-512 */ + +const PGPHASHALGO_JH_224 = 232+0; /*!< (private) JH-224 */ +const PGPHASHALGO_JH_256 = 232+1; /*!< (private) JH-256 */ +const PGPHASHALGO_JH_384 = 232+2; /*!< (private) JH-384 */ +const PGPHASHALGO_JH_512 = 232+3; /*!< (private) JH-512 */ + +const PGPHASHALGO_GROESTL_224 = 240+0; /*!< (private) GROESTL-224 */ +const PGPHASHALGO_GROESTL_256 = 240+1; /*!< (private) GROESTL-256 */ +const PGPHASHALGO_GROESTL_384 = 240+2; /*!< (private) GROESTL-384 */ +const PGPHASHALGO_GROESTL_512 = 240+3; /*!< (private) GROESTL-512 */ + +const PGPHASHALGO_HAMSI_224 = 248+0; /*!< (private) HAMSI-224 */ +const PGPHASHALGO_HAMSI_256 = 248+1; /*!< (private) HAMSI-256 */ +const PGPHASHALGO_HAMSI_384 = 248+2; /*!< (private) HAMSI-384 */ +const PGPHASHALGO_HAMSI_512 = 248+3; /*!< (private) HAMSI-512 */ + +var GPSEE = require('rpmdc'); + +var dc = new GPSEE.Dc(); +ack("typeof dc;", "object"); +ack("dc instanceof GPSEE.Dc;", true); +ack("dc.debug = 1;", 1); +ack("dc.debug = 0;", 0); + +var str = 'abc'; + +var md2 = new GPSEE.Dc(PGPHASHALGO_MD2); +ack("md2(str);", 'da853b0d3f88d99b30283a69e6ded6bb'); +ack("md2.init(PGPHASHALGO_MD2);", true); +ack("md2.algo", PGPHASHALGO_MD2); +ack("md2.asn1", "3020300c06082a864886f70d020205000410"); +ack("md2.name", "MD2"); +ack("md2.update(str);", true); +ack("md2.fini();", 'da853b0d3f88d99b30283a69e6ded6bb'); + +var md4 = new GPSEE.Dc(PGPHASHALGO_MD4); +ack("md4(str);", 'a448017aaf21d8525fc10ae87aa6729d'); +ack("md4.init(PGPHASHALGO_MD4);", true); +ack("md4.algo", PGPHASHALGO_MD4); +ack("md4.asn1", null); +ack("md4.name", "MD4"); +ack("md4.update(str);", true); +ack("md4.fini();", 'a448017aaf21d8525fc10ae87aa6729d'); + +var md5 = new GPSEE.Dc(PGPHASHALGO_MD5); +ack("md5(str);", '900150983cd24fb0d6963f7d28e17f72'); +ack("md5.init(PGPHASHALGO_MD5);", true); +ack("md5.algo", PGPHASHALGO_MD5); +ack("md5.asn1", "3020300c06082a864886f70d020505000410"); +ack("md5.name", "MD5"); +ack("md5.update(str);", true); +ack("md5.fini();", '900150983cd24fb0d6963f7d28e17f72'); + +var sha1 = new GPSEE.Dc(PGPHASHALGO_SHA1); +ack("sha1(str);", 'a9993e364706816aba3e25717850c26c9cd0d89d'); +ack("sha1.init(PGPHASHALGO_SHA1);", true); +ack("sha1.algo", PGPHASHALGO_SHA1); +ack("sha1.asn1", "3021300906052b0e03021a05000414"); +ack("sha1.name", "SHA1"); +ack("sha1.update(str);", true); +ack("sha1.fini();", 'a9993e364706816aba3e25717850c26c9cd0d89d'); + +var sha224 = new GPSEE.Dc(PGPHASHALGO_SHA224); +ack("sha224(str);", '23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7'); +ack("sha224.init(PGPHASHALGO_SHA224);", true); +ack("sha224.algo", PGPHASHALGO_SHA224); +ack("sha224.asn1", "302d300d06096086480165030402040500041C"); +ack("sha224.name", "SHA224"); +ack("sha224.update(str);", true); +ack("sha224.fini();", '23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7'); + +var sha256 = new GPSEE.Dc(PGPHASHALGO_SHA256); +ack("sha256(str);", 'ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad'); +ack("sha256.init(PGPHASHALGO_SHA256);", true); +ack("sha256.algo", PGPHASHALGO_SHA256); +ack("sha256.asn1", "3031300d060960864801650304020105000420"); +ack("sha256.name", "SHA256"); +ack("sha256.update(str);", true); +ack("sha256.fini();", 'ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad'); + +var sha384 = new GPSEE.Dc(PGPHASHALGO_SHA384); +ack("sha384(str);", 'cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7'); +ack("sha384.init(PGPHASHALGO_SHA384);", true); +ack("sha384.algo", PGPHASHALGO_SHA384); +ack("sha384.asn1", "3041300d060960864801650304020205000430"); +ack("sha384.name", "SHA384"); +ack("sha384.update(str);", true); +ack("sha384.fini();", 'cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7'); + +var sha512 = new GPSEE.Dc(PGPHASHALGO_SHA512); +ack("sha512(str);", 'ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f'); +ack("sha512.init(PGPHASHALGO_SHA512);", true); +ack("sha512.algo", PGPHASHALGO_SHA512); +ack("sha512.asn1", "3051300d060960864801650304020305000440"); +ack("sha512.name", "SHA512"); +ack("sha512.update(str);", true); +ack("sha512.fini();", 'ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f'); + +var salsa10 = new GPSEE.Dc(PGPHASHALGO_SALSA10); +ack("salsa10(str);", '699d0db4d264ce8ba8a1bf74734a29372b689d64c985aa5a037c6e11cbdf328270d58c699523ffc2d10bcc6f9ce167fb63528ea4ef0681fe8172297f9c92d72f'); +ack("salsa10.init(PGPHASHALGO_SALSA10);", true); +ack("salsa10.algo", PGPHASHALGO_SALSA10); +ack("salsa10.asn1", null); +ack("salsa10.name", "SALSA10"); +ack("salsa10.update(str);", true); +ack("salsa10.fini();", '699d0db4d264ce8ba8a1bf74734a29372b689d64c985aa5a037c6e11cbdf328270d58c699523ffc2d10bcc6f9ce167fb63528ea4ef0681fe8172297f9c92d72f'); + +var salsa20 = new GPSEE.Dc(PGPHASHALGO_SALSA20); +ack("salsa20(str);", 'fc4f496bb7a2fbe942d170dd42ebaaf6aec7fd9d6563d0563f81ffed6e6ff5cb595237462577ab41efd8c3815f20205a905ad5fd647de1ce2d37894e6671d6a7'); +ack("salsa20.init(PGPHASHALGO_SALSA20);", true); +ack("salsa20.algo", PGPHASHALGO_SALSA20); +ack("salsa20.asn1", null); +ack("salsa20.name", "SALSA20"); +ack("salsa20.update(str);", true); +ack("salsa20.fini();", 'fc4f496bb7a2fbe942d170dd42ebaaf6aec7fd9d6563d0563f81ffed6e6ff5cb595237462577ab41efd8c3815f20205a905ad5fd647de1ce2d37894e6671d6a7'); + +var ripemd128 = new GPSEE.Dc(PGPHASHALGO_RIPEMD128); +ack("ripemd128(str);", 'c14a12199c66e4ba84636b0f69144c77'); +ack("ripemd128.init(PGPHASHALGO_RIPEMD128);", true); +ack("ripemd128.algo", PGPHASHALGO_RIPEMD128); +ack("ripemd128.asn1", null); +ack("ripemd128.name", "RIPEMD128"); +ack("ripemd128.update(str);", true); +ack("ripemd128.fini();", 'c14a12199c66e4ba84636b0f69144c77'); + +var ripemd160 = new GPSEE.Dc(PGPHASHALGO_RIPEMD160); +ack("ripemd160(str);", '8eb208f7e05d987a9b044a8e98c6b087f15a0bfc'); +ack("ripemd160.init(PGPHASHALGO_RIPEMD160);", true); +ack("ripemd160.algo", PGPHASHALGO_RIPEMD160); +ack("ripemd160.asn1", "3021300906052b2403020105000414"); +ack("ripemd160.name", "RIPEMD160"); +ack("ripemd160.update(str);", true); +ack("ripemd160.fini();", '8eb208f7e05d987a9b044a8e98c6b087f15a0bfc'); + +var ripemd256 = new GPSEE.Dc(PGPHASHALGO_RIPEMD256); +ack("ripemd256(str);", 'afbd6e228b9d8cbbcef5ca2d03e6dba10ac0bc7dcbe4680e1e42d2e975459b65'); +ack("ripemd256.init(PGPHASHALGO_RIPEMD256);", true); +ack("ripemd256.algo", PGPHASHALGO_RIPEMD256); +ack("ripemd256.asn1", null); +ack("ripemd256.name", "RIPEMD256"); +ack("ripemd256.update(str);", true); +ack("ripemd256.fini();", 'afbd6e228b9d8cbbcef5ca2d03e6dba10ac0bc7dcbe4680e1e42d2e975459b65'); + +var ripemd320 = new GPSEE.Dc(PGPHASHALGO_RIPEMD320); +ack("ripemd320(str);", 'de4c01b3054f8930a79d09ae738e92301e5a17085beffdc1b8d116713e74f82fa942d64cdbc4682d'); +ack("ripemd320.init(PGPHASHALGO_RIPEMD320);", true); +ack("ripemd320.algo", PGPHASHALGO_RIPEMD320); +ack("ripemd320.asn1", null); +ack("ripemd320.name", "RIPEMD320"); +ack("ripemd320.update(str);", true); +ack("ripemd320.fini();", 'de4c01b3054f8930a79d09ae738e92301e5a17085beffdc1b8d116713e74f82fa942d64cdbc4682d'); + +var skein224 = new GPSEE.Dc(PGPHASHALGO_SKEIN_224); +ack("skein224('');", '50462a6805b74017ac85237077fb122a507911b737c9a66ff056a823'); +ack("skein224.init(PGPHASHALGO_SKEIN_224);", true); +ack("skein224.algo", PGPHASHALGO_SKEIN_224); +ack("skein224.asn1", null); +ack("skein224.name", "SKEIN256"); +ack("skein224.update('');", true); +ack("skein224.fini();", '50462a6805b74017ac85237077fb122a507911b737c9a66ff056a823'); + +var skein256 = new GPSEE.Dc(PGPHASHALGO_SKEIN_256); +ack("skein256('');", 'bc2763f707e262b80e0313791543a7ab0a4b6cd083270afb2fce4272e1bb0aa9'); +ack("skein256.init(PGPHASHALGO_SKEIN_256);", true); +ack("skein256.algo", PGPHASHALGO_SKEIN_256); +ack("skein256.asn1", null); +ack("skein256.name", "SKEIN256"); +ack("skein256.update('');", true); +ack("skein256.fini();", 'bc2763f707e262b80e0313791543a7ab0a4b6cd083270afb2fce4272e1bb0aa9'); + +var skein384 = new GPSEE.Dc(PGPHASHALGO_SKEIN_384); +ack("skein384('');", 'fa35c62fad08435e2727361228a0da5a72b14c2d7da222dc1f5142ae91f5da6c85c441f96888fccf518be2084cc495f4'); +ack("skein384.init(PGPHASHALGO_SKEIN_384);", true); +ack("skein384.algo", PGPHASHALGO_SKEIN_384); +ack("skein384.asn1", null); +ack("skein384.name", "SKEIN512"); +ack("skein384.update('');", true); +ack("skein384.fini();", 'fa35c62fad08435e2727361228a0da5a72b14c2d7da222dc1f5142ae91f5da6c85c441f96888fccf518be2084cc495f4'); + +var skein512 = new GPSEE.Dc(PGPHASHALGO_SKEIN_512); +ack("skein512('');", 'd3f7263a09837f4ce5c8ef70a5ddffac7b92d6c2ace5a12265bd5b593260a3ff20d8b4b4c5494e945448b37abb1fc526f6b46089208fde938d7f23724c4bdfb7'); +ack("skein512.init(PGPHASHALGO_SKEIN_512);", true); +ack("skein512.algo", PGPHASHALGO_SKEIN_512); +ack("skein512.asn1", null); +ack("skein512.name", "SKEIN512"); +ack("skein512.update('');", true); +ack("skein512.fini();", 'd3f7263a09837f4ce5c8ef70a5ddffac7b92d6c2ace5a12265bd5b593260a3ff20d8b4b4c5494e945448b37abb1fc526f6b46089208fde938d7f23724c4bdfb7'); + +var skein1024 = new GPSEE.Dc(PGPHASHALGO_SKEIN_1024); +ack("skein1024('');", '7bc3ce31c035df3c7a7d559bc9d9454f879f48497cc39e6d14e8190498455f396f45590405c4a15bd0ab29f5467d9132802f4354376ee864ad9f200e39a3d09b9ad06e9d0f656cf91ed9deac13a7a67a82ab983f52133129cac2a4dc13fd29c36ca6c72d6dcc6c82c66797f6b7607cb0e0f9006a27b83b60c59e4ba18de233e0'); +ack("skein1024.init(PGPHASHALGO_SKEIN_1024);", true); +ack("skein1024.algo", PGPHASHALGO_SKEIN_1024); +ack("skein1024.asn1", null); +ack("skein1024.name", "SKEIN1024"); +ack("skein1024.update('');", true); +ack("skein1024.fini();", '7bc3ce31c035df3c7a7d559bc9d9454f879f48497cc39e6d14e8190498455f396f45590405c4a15bd0ab29f5467d9132802f4354376ee864ad9f200e39a3d09b9ad06e9d0f656cf91ed9deac13a7a67a82ab983f52133129cac2a4dc13fd29c36ca6c72d6dcc6c82c66797f6b7607cb0e0f9006a27b83b60c59e4ba18de233e0'); + +var arirang_224 = new GPSEE.Dc(PGPHASHALGO_ARIRANG_224); +ack("arirang_224('');", '1937aa37e0f3262a0d539de60f1a9c5947aea2ba8cc51b7b2d468c23'); +ack("arirang_224.init(PGPHASHALGO_ARIRANG_224);", true); +ack("arirang_224.algo", PGPHASHALGO_ARIRANG_224); +ack("arirang_224.asn1", null); +ack("arirang_224.name", "ARIRANG"); +ack("arirang_224.update(str);", true); +ack("arirang_224.fini();", '40ce8ec7bb6adac2714d84acb9c0bd027e2d5409c630cb8a3b190a2d'); + +var arirang_256 = new GPSEE.Dc(PGPHASHALGO_ARIRANG_256); +ack("arirang_256('');", 'aab605111e406a8103bed1495daef867bfa9b70289b50533b9c4817d08a8def2'); +ack("arirang_256.init(PGPHASHALGO_ARIRANG_256);", true); +ack("arirang_256.algo", PGPHASHALGO_ARIRANG_256); +ack("arirang_256.asn1", null); +ack("arirang_256.name", "ARIRANG"); +ack("arirang_256.update(str);", true); +ack("arirang_256.fini();", '379e5431242a47052681fd06135c9a12b63fd6ff85ef9ce4272cdc9eb78e4eaf'); + +var arirang_384 = new GPSEE.Dc(PGPHASHALGO_ARIRANG_384); +ack("arirang_384('');", 'e413208d8dfd0ceb37cccc149e5afc16c458fdffe6ee8213bc2f69c5f617da26d84aec6123a2f6549aa6441fba165f5f'); +ack("arirang_384.init(PGPHASHALGO_ARIRANG_384);", true); +ack("arirang_384.algo", PGPHASHALGO_ARIRANG_384); +ack("arirang_384.asn1", null); +ack("arirang_384.name", "ARIRANG"); +ack("arirang_384.update(str);", true); +ack("arirang_384.fini();", '98b3eef2413ddd853187b2ea5b40d92e6fd1fb61f343633f6070eae71212d264ef035bea780fa22ceae3d491c986bb5b'); + +var arirang_512 = new GPSEE.Dc(PGPHASHALGO_ARIRANG_512); +ack("arirang_512('');", '65d6e76d7cc4065eed05d0a825ca99de85f4cf275786b37f9ff5390ffefa0ffe463405df20f3fc5285c7511ca2df60400db636a0a370f36c487c0b54df8280c3'); +ack("arirang_512.init(PGPHASHALGO_ARIRANG_512);", true); +ack("arirang_512.algo", PGPHASHALGO_ARIRANG_512); +ack("arirang_512.asn1", null); +ack("arirang_512.name", "ARIRANG"); +ack("arirang_512.update(str);", true); +ack("arirang_512.fini();", '84a38a38f35344d34c4a94a551816b3f9075f7ec2f6415a87c75e8472da6490482e1d489a803b41c5ad74c9d8b7cb7e5a8cd5b73ad22ed24549985daa9007e0c'); + +var blake224 = new GPSEE.Dc(PGPHASHALGO_BLAKE_224); +ack("blake224('');", '53f6633363b0cf3d4253963628555b5e8961339d39f057fc3782471b'); +ack("blake224.init(PGPHASHALGO_BLAKE_224);", true); +ack("blake224.algo", PGPHASHALGO_BLAKE_224); +ack("blake224.asn1", null); +ack("blake224.name", "BLAKE"); +ack("blake224.update(str);", true); +ack("blake224.fini();", 'a94de9b941e6ba54696e2cc6831bcb8381158bed49d3311314fbd20e'); + +var blake256 = new GPSEE.Dc(PGPHASHALGO_BLAKE_256); +ack("blake256('');", '73be7e1e0a7d0a2f0035edae62d4412ec43c0308145b5046849a53756bcda44b'); +ack("blake256.init(PGPHASHALGO_BLAKE_256);", true); +ack("blake256.algo", PGPHASHALGO_BLAKE_256); +ack("blake256.asn1", null); +ack("blake256.name", "BLAKE"); +ack("blake256.update(str);", true); +ack("blake256.fini();", 'cca0f6deb4727e1677020c8cebf8f49434002d1a8a9d86970d73eb0ee709ff43'); + +var blake384 = new GPSEE.Dc(PGPHASHALGO_BLAKE_384); +ack("blake384('');", 'e0820c066f522138d5cb3a5773dea16db434afa95e1c48e060de466928bb7044391b3ee77e2bbff6c0cf1e07a8295100'); +ack("blake384.init(PGPHASHALGO_BLAKE_384);", true); +ack("blake384.algo", PGPHASHALGO_BLAKE_384); +ack("blake384.asn1", null); +ack("blake384.name", "BLAKE"); +ack("blake384.update(str);", true); +ack("blake384.fini();", 'e22ddc662dd6c55ca5928fc954f55d5a288dcd69afd67971b90a383f0e2ef5d086dbca48186b6696dc041c78a4dd202c'); + +var blake512 = new GPSEE.Dc(PGPHASHALGO_BLAKE_512); +ack("blake512('');", '223d88a8c8308c15d479d1668ba97b1b2737aad82debd7d05d32f77a13f820651c36fc9eb18e2101b8e992717e671400be6a7f158cdd64afed6f81e62bf15c37'); +ack("blake512.init(PGPHASHALGO_BLAKE_512);", true); +ack("blake512.algo", PGPHASHALGO_BLAKE_512); +ack("blake512.asn1", null); +ack("blake512.name", "BLAKE"); +ack("blake512.update(str);", true); +ack("blake512.fini();", '73d4b67de1bedd9f4c7864d5e8b388a0c317d032c3e82df534f614dc5e91ca5b8a2e8310d92845909193f47a73bb2205a996952abe1e89978e907cd4027c35bb'); + +var bmw224 = new GPSEE.Dc(PGPHASHALGO_BMW_224); +ack("bmw224('');", 'bdf29a829d3f42d50604acb5ad1a851a8ec684a86ff7c4e791aad501'); +ack("bmw224.init(PGPHASHALGO_BMW_224);", true); +ack("bmw224.algo", PGPHASHALGO_BMW_224); +ack("bmw224.asn1", null); +ack("bmw224.name", "BMW"); +ack("bmw224.update(str);", true); +ack("bmw224.fini();", '26088053c93cbc480ad53c34fc66fff0b4f1341adb855154fa15ee54'); + +var bmw256 = new GPSEE.Dc(PGPHASHALGO_BMW_256); +ack("bmw256('');", '4c10f8ad695fff1fb275d175b44cbe41c40a53a166d0470b45bab2d9afb6e5c5'); +ack("bmw256.init(PGPHASHALGO_BMW_256);", true); +ack("bmw256.algo", PGPHASHALGO_BMW_256); +ack("bmw256.asn1", null); +ack("bmw256.name", "BMW"); +ack("bmw256.update(str);", true); +ack("bmw256.fini();", '919905e2d111e6f57cb42e5e31c9240eb0670c1919718a5c1b10e61fc5124d25'); + +var bmw384 = new GPSEE.Dc(PGPHASHALGO_BMW_384); +ack("bmw384('');", '62f300cced944e44fdd4e51e809c09eeefd31ee58bf977f29b0f475cb16c2f557b723553b9ab563e01d21a11e9d728e2'); +ack("bmw384.init(PGPHASHALGO_BMW_384);", true); +ack("bmw384.algo", PGPHASHALGO_BMW_384); +ack("bmw384.asn1", null); +ack("bmw384.name", "BMW"); +ack("bmw384.update(str);", true); +ack("bmw384.fini();", '1ef8b57640c0419e1f8c0d7ebc4196ea31fdb5fb9d2350c80db002882f59d3d1005899cd98353751840e34f619ec7abc'); + +var bmw512 = new GPSEE.Dc(PGPHASHALGO_BMW_512); +ack("bmw512('');", '73db7b1dc6def4ddf2f94a22e1f6d2162b3123828369ff4fd750832aede94e52d4d5c8b866860424991527175b6f62dbe0f764ac18290b92a26812d641cd5287'); +ack("bmw512.init(PGPHASHALGO_BMW_512);", true); +ack("bmw512.algo", PGPHASHALGO_BMW_512); +ack("bmw512.asn1", null); +ack("bmw512.name", "BMW"); +ack("bmw512.update(str);", true); +ack("bmw512.fini();", 'ded83592522d34271257b338337559204949bc4dbd9a6e66148393575673bae87334b76a3a3fc2734138f3074985ac8af8ff71ce0ca31cd7645df30849936dcf'); + +var chi_224 = new GPSEE.Dc(PGPHASHALGO_CHI_224); +ack("chi_224('');", '532af150697beba8ac038c53fac985a367701991a34f5c6502cfb7f0'); +ack("chi_224.init(PGPHASHALGO_CHI_224);", true); +ack("chi_224.algo", PGPHASHALGO_CHI_224); +ack("chi_224.asn1", null); +ack("chi_224.name", "CHI"); +ack("chi_224.update(str);", true); +ack("chi_224.fini();", '2a09fb790d6817e825e37933fb5fdc74e05cd74df7a7f2d6cc903176'); + +var chi_256 = new GPSEE.Dc(PGPHASHALGO_CHI_256); +ack("chi_256('');", 'fa11172a4a65e8efe6ec9c5ddafac765935fab6be89604edb17902b507302270'); +ack("chi_256.init(PGPHASHALGO_CHI_256);", true); +ack("chi_256.algo", PGPHASHALGO_CHI_256); +ack("chi_256.asn1", null); +ack("chi_256.name", "CHI"); +ack("chi_256.update(str);", true); +ack("chi_256.fini();", 'cf01da4d76a83ccc4003805be462cd898e243fb36ada110209661aad7d19ed37'); + +var chi_384 = new GPSEE.Dc(PGPHASHALGO_CHI_384); +ack("chi_384('');", '841eae69ce0d7edc0ab1b3038eb7fd62bd3b73b8e3481798243cf14e258dee93e433e5202e806a18f44f4383b3168f59'); +ack("chi_384.init(PGPHASHALGO_CHI_384);", true); +ack("chi_384.algo", PGPHASHALGO_CHI_384); +ack("chi_384.asn1", null); +ack("chi_384.name", "CHI"); +ack("chi_384.update(str);", true); +ack("chi_384.fini();", '924ba150d5fcf6862d4570cff69f03c343c6dea3e6db429f1883534b19d06f60157f972063e6fa162ca3337b73872790'); + +var chi_512 = new GPSEE.Dc(PGPHASHALGO_CHI_512); +ack("chi_512('');", '5ee66ada5094be5d8b822716bb5bdad19f58a632be85a1643f535fca6e109467cd609f16f1f46de6afd16a41a2a4ab932e997e261a4bf71931d804ea8dabcd1a'); +ack("chi_512.init(PGPHASHALGO_CHI_512);", true); +ack("chi_512.algo", PGPHASHALGO_CHI_512); +ack("chi_512.asn1", null); +ack("chi_512.name", "CHI"); +ack("chi_512.update(str);", true); +ack("chi_512.fini();", '0a71c7e78234e628509d7737ba22e03eea2731ace5d9e3d219641d2b5e71fc957d4bb09e9d40925ebe3e69b7077a64825188662aaccd858d3a8c6e9b6b3af3e3'); + +var cubehash224 = new GPSEE.Dc(PGPHASHALGO_CUBEHASH_224, 0x0801); +ack("cubehash224('');", 'b5a6f6cb6d4100dcda8f575c694f15b2f7c8c5ed145608a42a89c7ca'); +ack("cubehash224.init(PGPHASHALGO_CUBEHASH_224, 0x0801);", true); +ack("cubehash224.algo", PGPHASHALGO_CUBEHASH_224); +ack("cubehash224.asn1", null); +ack("cubehash224.name", "CUBEHASH"); +ack("cubehash224.update(str);", true); +ack("cubehash224.fini();", '50151e3b6b2d13a9da38aa1422ab2dacc3500bebd4215d036fdcd5ce'); +ack("cubehash224.init(PGPHASHALGO_CUBEHASH_224);", true); +ack("cubehash224('');", 'f9802aa6955f4b7cf3b0f5a378fa0c9f138e0809d250966879c873ab'); +ack("cubehash224(str);", '6b45504b39316bfd48dc44638a363c16b3f0263d66561b09d7d21fd7'); + +var cubehash256 = new GPSEE.Dc(PGPHASHALGO_CUBEHASH_256, 0x0801); +ack("cubehash256('');", '38d1e8a22d7baac6fd5262d83de89cacf784a02caa866335299987722aeabc59'); +ack("cubehash256.init(PGPHASHALGO_CUBEHASH_256, 0x0801);", true); +ack("cubehash256.algo", PGPHASHALGO_CUBEHASH_256); +ack("cubehash256.asn1", null); +ack("cubehash256.name", "CUBEHASH"); +ack("cubehash256.update(str);", true); +ack("cubehash256.fini();", '8de2181ab5ae4365a506cdf748f3af4b52a7b838a2c82550b8329bb6339914d7'); +ack("cubehash256.init(PGPHASHALGO_CUBEHASH_256);", true); +ack("cubehash256('');", '44c6de3ac6c73c391bf0906cb7482600ec06b216c7c54a2a8688a6a42676577d'); +ack("cubehash256(str);", 'a220b4bf5023e750c2a34dcd5564a8523d32e17fab6fbe0f18a0b0bf5a65632b'); + +var cubehash384 = new GPSEE.Dc(PGPHASHALGO_CUBEHASH_384, 0x0801); +ack("cubehash384('');", '235e819ebb93af765f7d86df6c6ff283ab24e98a07858a7d1c72604bb10c794d4721ef9ddfccaa93072eee9b53fdc69c'); +ack("cubehash384.init(PGPHASHALGO_CUBEHASH_384, 0x0801);", true); +ack("cubehash384.algo", PGPHASHALGO_CUBEHASH_384); +ack("cubehash384.asn1", null); +ack("cubehash384.name", "CUBEHASH"); +ack("cubehash384.update(str);", true); +ack("cubehash384.fini();", 'a6cd4e9e01f83d75a3c5b30f7c9700216a453a2c9a9399181a0ad7c52a902f12f0a3301fec05428cda66abc16c5ca7e3'); +ack("cubehash384.init(PGPHASHALGO_CUBEHASH_384);", true); +ack("cubehash384('');", '98ae93ebf4e58958497f610a22c8cf60f2292319283ca6459daed1707be06e7591c5f2d84bd3339e66c770e485bfa1fb'); +ack("cubehash384(str);", '287cc1738bdb9575fd716bafbb02768ce5a57ae5c08ba12f5cf74fac27ab5707e577bc93539c07af9ab92c3b1b368997'); + +var cubehash512 = new GPSEE.Dc(PGPHASHALGO_CUBEHASH_512, 0x0801); +ack("cubehash512('');", '90bc3f2948f7374065a811f1e47a208a53b1a2f3be1c0072759ed49c9c6c7f28f26eb30d5b0658c563077d599da23f97df0c2c0ac6cce734ffe87b2e76ff7294'); +ack("cubehash512.init(PGPHASHALGO_CUBEHASH_512, 0x0801);", true); +ack("cubehash512.algo", PGPHASHALGO_CUBEHASH_512, 0x0801); +ack("cubehash512.asn1", null); +ack("cubehash512.name", "CUBEHASH"); +ack("cubehash512.update(str);", true); +ack("cubehash512.fini();", 'f83d39f3f4213dbe240aa14740b214741163f37be49750cc9bf64aaa58be8f8adee7874186475cec08f7993ca7e35839291816ccc377d6173987eb95e355ee73'); +ack("cubehash512.init(PGPHASHALGO_CUBEHASH_512);", true); +ack("cubehash512('');", '4a1d00bbcfcb5a9562fb981e7f7db3350fe2658639d948b9d57452c22328bb32f468b072208450bad5ee178271408be0b16e5633ac8a1e3cf9864cfbfc8e043a'); +ack("cubehash512(str);", 'f63d6fa89ca9fe7ab2e171be52cf193f0c8ac9f62bad297032c1e7571046791a7e8964e5c8d91880d6f9c2a54176b05198901047438e05ac4ef38d45c0282673'); + +var echo_224 = new GPSEE.Dc(PGPHASHALGO_ECHO_224); +ack("echo_224('');", '17da087595166f733fff7cdb0bca6438f303d0e00c48b5e7a3075905'); +ack("echo_224.init(PGPHASHALGO_ECHO_224);", true); +ack("echo_224.algo", PGPHASHALGO_ECHO_224); +ack("echo_224.asn1", null); +ack("echo_224.name", "ECHO"); +ack("echo_224.update(str);", true); +ack("echo_224.fini();", 'd4f3807187a07cb8e593485e311425e68aaa00a3715789bfa66f09cd'); + +var echo_256 = new GPSEE.Dc(PGPHASHALGO_ECHO_256); +ack("echo_256('');", '4496cd09d425999aefa75189ee7fd3c97362aa9e4ca898328002d20a4b519788'); +ack("echo_256.init(PGPHASHALGO_ECHO_256);", true); +ack("echo_256.algo", PGPHASHALGO_ECHO_256); +ack("echo_256.asn1", null); +ack("echo_256.name", "ECHO"); +ack("echo_256.update(str);", true); +ack("echo_256.fini();", '871b1fad479135c37e1aad71ac9a99def41730f3e5b3e0dc3f6b7cf072fa5649'); + +var echo_384 = new GPSEE.Dc(PGPHASHALGO_ECHO_384); +ack("echo_384('');", '134040763f840559b84b7a1ae5d6d64fc3659821a789cc64a7f1444c09ee7f81a54d72beee8273bae5ef18ec43aa5f34'); +ack("echo_384.init(PGPHASHALGO_ECHO_384);", true); +ack("echo_384.algo", PGPHASHALGO_ECHO_384); +ack("echo_384.asn1", null); +ack("echo_384.name", "ECHO"); +ack("echo_384.update(str);", true); +ack("echo_384.fini();", '94cbb881848c45b7f6649b7b36901d14973248d9bfa318bd830d1c14d749e7e9bf0a69ce738ac8a1fd361411a8dc9dae'); + +var echo_512 = new GPSEE.Dc(PGPHASHALGO_ECHO_512); +ack("echo_512('');", '158f58cc79d300a9aa292515049275d051a28ab931726d0ec44bdd9faef4a702c36db9e7922fff077402236465833c5cc76af4efc352b4b44c7fa15aa0ef234e'); +ack("echo_512.init(PGPHASHALGO_ECHO_512);", true); +ack("echo_512.algo", PGPHASHALGO_ECHO_512); +ack("echo_512.asn1", null); +ack("echo_512.name", "ECHO"); +ack("echo_512.update(str);", true); +ack("echo_512.fini();", '3bf04ec89d67e0dafd1b8ab26b176abaead6b3cdc706ff7198c3c6045e77d4eaf64cd90af9c5a7674919b90ff8c9b4a7554d6cfeffb334406ec233fb0b0dd6bc'); + +var edonr224 = new GPSEE.Dc(PGPHASHALGO_EDONR_224); +ack("edonr224('');", 'a9c2bc54208be171cdfd054d21d97c1f4c79e822d8d9fcdbcb1d602f'); +ack("edonr224.init(PGPHASHALGO_EDONR_224);", true); +ack("edonr224.algo", PGPHASHALGO_EDONR_224); +ack("edonr224.asn1", null); +ack("edonr224.name", "EDON-R"); +ack("edonr224.update(str);", true); +ack("edonr224.fini();", '5663c4939520faf6123165a466f25601952ea9e424ddc96befd04094'); + +var edonr256 = new GPSEE.Dc(PGPHASHALGO_EDONR_256); +ack("edonr256('');", '3b71fd43dade942c07842b181f4d987e78d2ac7e3a7e8bb06fec99a60b60eaba'); +ack("edonr256.init(PGPHASHALGO_EDONR_256);", true); +ack("edonr256.algo", PGPHASHALGO_EDONR_256); +ack("edonr256.asn1", null); +ack("edonr256.name", "EDON-R"); +ack("edonr256.update(str);", true); +ack("edonr256.fini();", '54d78b13c74eda5aedc271cc881fb22f8399afd3040b6a392d739405508dd851'); + +var edonr384 = new GPSEE.Dc(PGPHASHALGO_EDONR_384); +ack("edonr384('');", 'ccd8e612b93a3f8c24867eb204c1dc3f2de24bd54d92908c5f5a73c6a4da14c8742a5fc3a6b5428658e85f0175de95a7'); +ack("edonr384.init(PGPHASHALGO_EDONR_384);", true); +ack("edonr384.algo", PGPHASHALGO_EDONR_384); +ack("edonr384.asn1", null); +ack("edonr384.name", "EDON-R"); +ack("edonr384.update(str);", true); +ack("edonr384.fini();", '0e7cd7857877e0895b1cdf49f41d209c727d2e579b9b9adc60279782b99072ec7eced3165f477548fa60727e01c77cc6'); + +var edonr512 = new GPSEE.Dc(PGPHASHALGO_EDONR_512); +ack("edonr512('');", 'c57f7e17fdc1ce5074cc748c9bd38f9f51ebe88fbe6eda3190c4314cafb1abb2980fac582d6e4ba8c641947d944bc56b74fb15de5546ad4f77934fca00052719'); +ack("edonr512.init(PGPHASHALGO_EDONR_512);", true); +ack("edonr512.algo", PGPHASHALGO_EDONR_512); +ack("edonr512.asn1", null); +ack("edonr512.name", "EDON-R"); +ack("edonr512.update(str);", true); +ack("edonr512.fini();", '1b14db155f1d406594b8cef70a4362ec6b5de6a5daf50ec999e987c19d3049e2de5977bb05b1bb220050a1ea5b46a9f1740acafbf6b45032adc90c628372c22b'); + +var fugue_224 = new GPSEE.Dc(PGPHASHALGO_FUGUE_224); +ack("fugue_224('');", 'e2cd30d51a913c4ed2388a141f90caa4914de43010849e7b8a7a9ccd'); +ack("fugue_224.init(PGPHASHALGO_FUGUE_224);", true); +ack("fugue_224.algo", PGPHASHALGO_FUGUE_224); +ack("fugue_224.asn1", null); +ack("fugue_224.name", "FUGUE"); +ack("fugue_224.update(str);", true); +ack("fugue_224.fini();", '5e12f2cfb0b72d27c81a50d591741625138500a3151edea3d72813f8'); + +var fugue_256 = new GPSEE.Dc(PGPHASHALGO_FUGUE_256); +ack("fugue_256('');", 'd6ec528980c130aad1d1acd28b9dd8dbdeae0d79eded1fca72c2af9f37c2246f'); +ack("fugue_256.init(PGPHASHALGO_FUGUE_256);", true); +ack("fugue_256.algo", PGPHASHALGO_FUGUE_256); +ack("fugue_256.asn1", null); +ack("fugue_256.name", "FUGUE"); +ack("fugue_256.update(str);", true); +ack("fugue_256.fini();", '2b6cca67a397ecd4f27a0bed242b04f328b89ff5c51c61da1e69cc5a7419084c'); + +var fugue_384 = new GPSEE.Dc(PGPHASHALGO_FUGUE_384); +ack("fugue_384('');", '466d05f6812b58b8628e53816b2a99d173b804a964de971829159c3791ac8b524eebbf5fc73ba40ea8eea446d5424a30'); +ack("fugue_384.init(PGPHASHALGO_FUGUE_384);", true); +ack("fugue_384.algo", PGPHASHALGO_FUGUE_384); +ack("fugue_384.asn1", null); +ack("fugue_384.name", "FUGUE"); +ack("fugue_384.update(str);", true); +ack("fugue_384.fini();", '5e5e10e8b19c2895d406a998ca860cb5698ec950fb4c65bbc41b9f4f53737750e38ff896998df9968066899c3ad5431f'); + +var fugue_512 = new GPSEE.Dc(PGPHASHALGO_FUGUE_512); +ack("fugue_512('');", '3124f0cbb5a1c2fb3ce747ada63ed2ab3bcd74795cef2b0e805d5319fcc360b4617b6a7eb631d66f6d106ed0724b56fa8c1110f9b8df1c6898e7ca3c2dfccf79'); +ack("fugue_512.init(PGPHASHALGO_FUGUE_512);", true); +ack("fugue_512.algo", PGPHASHALGO_FUGUE_512); +ack("fugue_512.asn1", null); +ack("fugue_512.name", "FUGUE"); +ack("fugue_512.update(str);", true); +ack("fugue_512.fini();", '6d3c8217e4ddcb6ad1e651ff24be6a50b177c11e0df51ddcf7e90787274927bf1d77bf870d74551c00818fd1d049f384f8c56a8c2c040de2febef2637dc4b20f'); + +var groestl_224 = new GPSEE.Dc(PGPHASHALGO_GROESTL_224); +ack("groestl_224('');", '07f3750f4831d8ad1763cd46ab6b40c6c49f1cdcc78bb64f8d40c7df'); +ack("groestl_224.init(PGPHASHALGO_GROESTL_224);", true); +ack("groestl_224.algo", PGPHASHALGO_GROESTL_224); +ack("groestl_224.asn1", null); +ack("groestl_224.name", "GROESTL"); +ack("groestl_224.update(str);", true); +ack("groestl_224.fini();", '321c42cdba3fa677c3cb5dcf4dc3e2556060c8878eec84290b6b4155'); + +var groestl_256 = new GPSEE.Dc(PGPHASHALGO_GROESTL_256); +ack("groestl_256('');", '6c462dc6861c19dbc6fa818f3da84bccf6eab703db10a9781eec6633ea9e8b7b'); +ack("groestl_256.init(PGPHASHALGO_GROESTL_256);", true); +ack("groestl_256.algo", PGPHASHALGO_GROESTL_256); +ack("groestl_256.asn1", null); +ack("groestl_256.name", "GROESTL"); +ack("groestl_256.update(str);", true); +ack("groestl_256.fini();", '90f0b04123a30b8b1cd805624e1f64096e0462547f6eaa3145abcda822ec26ea'); + +var groestl_384 = new GPSEE.Dc(PGPHASHALGO_GROESTL_384); +ack("groestl_384('');", '7dbc0745fc81f89cf3ae0148c42fc5f0106af016d23de296364fa0b03befdebb284e87ac093132419db98d7e1d73fbfa'); +ack("groestl_384.init(PGPHASHALGO_GROESTL_384);", true); +ack("groestl_384.algo", PGPHASHALGO_GROESTL_384); +ack("groestl_384.asn1", null); +ack("groestl_384.name", "GROESTL"); +ack("groestl_384.update(str);", true); +ack("groestl_384.fini();", 'fe8dd63c8c51253e3a9d271e1fc496c6317ab2c868bc73456d68a560a8d1f758b864ec39f1be185cac7d8924392feeb0'); + +var groestl_512 = new GPSEE.Dc(PGPHASHALGO_GROESTL_512); +ack("groestl_512('');", 'a94b5251dc711c2813d70d58dd4f84648f90d2700d9417b4c58070069cf68fa86a720e7ee409d64d06adce285bfd60e09d5bcff5bbe7ca2922b96869ae6489be'); +ack("groestl_512.init(PGPHASHALGO_GROESTL_512);", true); +ack("groestl_512.algo", PGPHASHALGO_GROESTL_512); +ack("groestl_512.asn1", null); +ack("groestl_512.name", "GROESTL"); +ack("groestl_512.update(str);", true); +ack("groestl_512.fini();", '1f2dcaa986d01d212fb633886fcb11f8aaeea18ba7ddd5a251cfc490f9b2850b78ab5ca7870014d21f880dac4cce07e66ba125071a6a30a3b3e35f19cbd15a20'); + +var hamsi_224 = new GPSEE.Dc(PGPHASHALGO_HAMSI_224); +ack("hamsi_224('');", '6f5708887722a92764a4d55527feaeba32f297f05d35a8276301d508'); +ack("hamsi_224.init(PGPHASHALGO_HAMSI_224);", true); +ack("hamsi_224.algo", PGPHASHALGO_HAMSI_224); +ack("hamsi_224.asn1", null); +ack("hamsi_224.name", "HAMSI"); +ack("hamsi_224.update(str);", true); +ack("hamsi_224.fini();", 'f5942eef7b5f487e8bb94407e0cebcec853214440af688455786e806'); + +var hamsi_256 = new GPSEE.Dc(PGPHASHALGO_HAMSI_256); +ack("hamsi_256('');", '750e9ec469f4db626bee7e0c10ddaa1bd01fe194b94efbabebd24764dc2b13e9'); +ack("hamsi_256.init(PGPHASHALGO_HAMSI_256);", true); +ack("hamsi_256.algo", PGPHASHALGO_HAMSI_256); +ack("hamsi_256.asn1", null); +ack("hamsi_256.name", "HAMSI"); +ack("hamsi_256.update(str);", true); +ack("hamsi_256.fini();", '6b017b90971fdb646700dea0e50e7ac1f6a75a849b2809a55eedcde4c65daf1f'); + +var hamsi_384 = new GPSEE.Dc(PGPHASHALGO_HAMSI_384); +ack("hamsi_384('');", 'fb38fae25a490c57839c01b858a1f641a2d2c027cec26827d07c0685f7756721b952d9cf4ab1e196663be21b0bbc1b60'); +ack("hamsi_384.init(PGPHASHALGO_HAMSI_384);", true); +ack("hamsi_384.algo", PGPHASHALGO_HAMSI_384); +ack("hamsi_384.asn1", null); +ack("hamsi_384.name", "HAMSI"); +ack("hamsi_384.update(str);", true); +ack("hamsi_384.fini();", 'edc3513afd752245c93e26aa83ec95086b5f25cce61a0aa7a8522f5f263340011a631e8b7e4903ad926bdff7bcb19cfe'); + +var hamsi_512 = new GPSEE.Dc(PGPHASHALGO_HAMSI_512); +ack("hamsi_512('');", 'd9bd390844eab0e08ebc8e687fc09e2d22fbf023ebed5c667b6f760fd2e9164e03846ed3df52bd323ab0b748b57575c2d85fece5fc0e99a90f786d14f6d443b3'); +ack("hamsi_512.init(PGPHASHALGO_HAMSI_512);", true); +ack("hamsi_512.algo", PGPHASHALGO_HAMSI_512); +ack("hamsi_512.asn1", null); +ack("hamsi_512.name", "HAMSI"); +ack("hamsi_512.update(str);", true); +ack("hamsi_512.fini();", '74a3b36a4cdf908973db6ace5b680ea27f5a70bbf57ae5fb5683135a5b1c70a3929835b68af9aec61ffd0a964c552c2bf8cd62c90ea397411a50a3683b98ffc6'); + +var jh224 = new GPSEE.Dc(PGPHASHALGO_JH_224); +ack("jh224('');", '12c53596fb61ad2865c0a39b7efe88166f9eb1f5fc5b434b9c45057e'); +ack("jh224.init(PGPHASHALGO_JH_224);", true); +ack("jh224.algo", PGPHASHALGO_JH_224); +ack("jh224.asn1", null); +ack("jh224.name", "JH"); +ack("jh224.update(str);", true); +ack("jh224.fini();", '31fcf15a8e9bc7c4feae367e1bbd08c5861b389cbe369024f6024666'); + +var jh256 = new GPSEE.Dc(PGPHASHALGO_JH_256); +ack("jh256('');", '020cdd61951fdcadcc544096176332b213b4604ac42dfa82026b7cd750a0a90b'); +ack("jh256.init(PGPHASHALGO_JH_256);", true); +ack("jh256.algo", PGPHASHALGO_JH_256); +ack("jh256.asn1", null); +ack("jh256.name", "JH"); +ack("jh256.update(str);", true); +ack("jh256.fini();", '76804776ead1964566b1918f96deed2936d7648666660128820d73531e29aae6'); + +var jh384 = new GPSEE.Dc(PGPHASHALGO_JH_384); +ack("jh384('');", '604cb69a44994b89d8d25ade362d7e3304532862ecde225dfbff8c76dc9a236754e6c662463b19b7e8d034f3da0b4b41'); +ack("jh384.init(PGPHASHALGO_JH_384);", true); +ack("jh384.algo", PGPHASHALGO_JH_384); +ack("jh384.asn1", null); +ack("jh384.name", "JH"); +ack("jh384.update(str);", true); +ack("jh384.fini();", 'e936ff1633661dd71de4e59f46980893cdd13cce315cc633d6b9dd3b2411b6063662cf5c9cb52b37d385e3f6f5489b9c'); + +var jh512 = new GPSEE.Dc(PGPHASHALGO_JH_512); +ack("jh512('');", '96d728dd0c96091d228c962b5013a9e4248af4a6eee112d71ee02930a62c8a9a0adcd4f710e297c8f6c24342106ef276f8e4cf45d220e0cc39aed85bd071c31f'); +ack("jh512.init(PGPHASHALGO_JH_512);", true); +ack("jh512.algo", PGPHASHALGO_JH_512); +ack("jh512.asn1", null); +ack("jh512.name", "JH"); +ack("jh512.update(str);", true); +ack("jh512.fini();", '4d604cbc28a6c0e457baeec929a0fbfe750fd446d66c6353aba51940c49f98aae3ca95d08cf1acd96d348917f2fc37ab6a561e272e9566251873e293bbce2578'); + +var keccak224 = new GPSEE.Dc(PGPHASHALGO_KECCAK_224); +ack("keccak224('');", '6c60c1d4dc10aee01988c45a33b38bc3045971724ce7e83cdda61635'); +ack("keccak224.init(PGPHASHALGO_KECCAK_224);", true); +ack("keccak224.algo", PGPHASHALGO_KECCAK_224); +ack("keccak224.asn1", null); +ack("keccak224.name", "KECCAK"); +ack("keccak224.update(str);", true); +ack("keccak224.fini();", '78e64e68f6be46a65dfc1a255c3c5ad6e1ab24be22260ddf059d8dd7'); + +var keccak256 = new GPSEE.Dc(PGPHASHALGO_KECCAK_256); +ack("keccak256('');", 'bcde039a63f98b125e7fe5cb8999c05dab163f857bcae719fb09b8d5e1da6f0c'); +ack("keccak256.init(PGPHASHALGO_KECCAK_256);", true); +ack("keccak256.algo", PGPHASHALGO_KECCAK_256); +ack("keccak256.asn1", null); +ack("keccak256.name", "KECCAK"); +ack("keccak256.update(str);", true); +ack("keccak256.fini();", '4e51e1369fe550ba6daeba7068701a653c1216762f41427d976789345687f056'); + +var keccak384 = new GPSEE.Dc(PGPHASHALGO_KECCAK_384); +ack("keccak384('');", '3f65c0fbe79d43f11d844a448a61b8316db1b681c252f9f5f3fd4da255a655187cff6c0ef96c8c9e7df899a36aa783a9'); +ack("keccak384.init(PGPHASHALGO_KECCAK_384);", true); +ack("keccak384.algo", PGPHASHALGO_KECCAK_384); +ack("keccak384.asn1", null); +ack("keccak384.name", "KECCAK"); +ack("keccak384.update(str);", true); +ack("keccak384.fini();", 'bf1c5ae872a458211fbe9fd263da97341697003d36f315148d17f7d407caad126443581a2c7c86aa91f5de4ee6375963'); + +var keccak512 = new GPSEE.Dc(PGPHASHALGO_KECCAK_512); +ack("keccak512('');", '8596f8df2e856ec888823da8ccc914139f31baee6aa5c37dbe30bddbfd75c63cdc205f15f30faa348e27b5f90495b339a606e3c84bfcdcd55e88b0e178b56feb'); +ack("keccak512.init(PGPHASHALGO_KECCAK_512);", true); +ack("keccak512.algo", PGPHASHALGO_KECCAK_512); +ack("keccak512.asn1", null); +ack("keccak512.name", "KECCAK"); +ack("keccak512.update(str);", true); +ack("keccak512.fini();", '4a2e21878d2785dffb751bb0c635e1f5780152922ffe7ef5342f7442d877754a3f866cd5b2d9f2711b02b24f64e437e4484a8d24b7878d288e9c550729ff954e'); + +var lane_224 = new GPSEE.Dc(PGPHASHALGO_LANE_224); +ack("lane_224('');", '059b1d054b857bb991c68f42122b6871b3b36c4a3af2d50899a73cda'); +ack("lane_224.init(PGPHASHALGO_LANE_224);", true); +ack("lane_224.algo", PGPHASHALGO_LANE_224); +ack("lane_224.asn1", null); +ack("lane_224.name", "LANE"); +ack("lane_224.update(str);", true); +ack("lane_224.fini();", '2056437f23356c417f68e0b6827839361d052ed02250386bf2b1623f'); + +var lane_256 = new GPSEE.Dc(PGPHASHALGO_LANE_256); +ack("lane_256('');", '39d0a057848d3b41a1539a9d1fb843d95c7cac409bdd2597655542584eda637b'); +ack("lane_256.init(PGPHASHALGO_LANE_256);", true); +ack("lane_256.algo", PGPHASHALGO_LANE_256); +ack("lane_256.asn1", null); +ack("lane_256.name", "LANE"); +ack("lane_256.update(str);", true); +ack("lane_256.fini();", '7cc93b0901d29b0fdf354af65184bc7bc4af179b9270ddf3727cac33e398d0ec'); + +var lane_384 = new GPSEE.Dc(PGPHASHALGO_LANE_384); +ack("lane_384('');", 'a77d6bd42e74f21b9ec470ae0525c53f5b35d6b6c3241f8007f4cacc6aa496df663a90a35eef8d45703452742e33110c'); +ack("lane_384.init(PGPHASHALGO_LANE_384);", true); +ack("lane_384.algo", PGPHASHALGO_LANE_384); +ack("lane_384.asn1", null); +ack("lane_384.name", "LANE"); +ack("lane_384.update(str);", true); +ack("lane_384.fini();", '826d911054abe9b781ad60a6e9332fc816b377a3c4f63aa699cc2b4fb78a42fe8b06d9ad89b8e297ec7b6be6c9ac8d40'); + +var lane_512 = new GPSEE.Dc(PGPHASHALGO_LANE_512); +ack("lane_512('');", 'bdee2ca1f13ab522a3a9e045dc6f236deab315dc8c322ee20333837762a422ca43bcd6f79964cded6531011f3207b76a6859097eaa5fc6e865bedfa80d73ee91'); +ack("lane_512.init(PGPHASHALGO_LANE_512);", true); +ack("lane_512.algo", PGPHASHALGO_LANE_512); +ack("lane_512.asn1", null); +ack("lane_512.name", "LANE"); +ack("lane_512.update(str);", true); +ack("lane_512.fini();", 'f149df86c9a94c2fd100f68dee46bac886686ba512ec9e7aac3c997be204ce7b6fd583429fa0d281d80d4acd73751b2fd19fde98db07922b077dbe8b1f1dc932'); + +var luffa_224 = new GPSEE.Dc(PGPHASHALGO_LUFFA_224); +ack("luffa_224('');", 'd69dcfd468dc331d5159c5c40cd1877e9b8ea2a50e6a7245630286ed'); +ack("luffa_224.init(PGPHASHALGO_LUFFA_224);", true); +ack("luffa_224.algo", PGPHASHALGO_LUFFA_224); +ack("luffa_224.asn1", null); +ack("luffa_224.name", "LUFFA"); +ack("luffa_224.update(str);", true); +ack("luffa_224.fini();", 'f1d566a4b469a38ea31717dbb35d1bb9ac184ec2c08ee58c31bfcbc6'); + +var luffa_256 = new GPSEE.Dc(PGPHASHALGO_LUFFA_256); +ack("luffa_256('');", 'd69dcfd468dc331d5159c5c40cd1877e9b8ea2a50e6a7245630286edb5924b2e'); +ack("luffa_256.init(PGPHASHALGO_LUFFA_256);", true); +ack("luffa_256.algo", PGPHASHALGO_LUFFA_256); +ack("luffa_256.asn1", null); +ack("luffa_256.name", "LUFFA"); +ack("luffa_256.update(str);", true); +ack("luffa_256.fini();", 'f1d566a4b469a38ea31717dbb35d1bb9ac184ec2c08ee58c31bfcbc641645526'); + +var luffa_384 = new GPSEE.Dc(PGPHASHALGO_LUFFA_384); +ack("luffa_384('');", '7404fa448793341a9e0ef5361b7388136d44bbb65f7925d2a6600e4e2f2aca5ab5a7d6fead4f4762b2c60fea5f2d3779'); +ack("luffa_384.init(PGPHASHALGO_LUFFA_384);", true); +ack("luffa_384.algo", PGPHASHALGO_LUFFA_384); +ack("luffa_384.asn1", null); +ack("luffa_384.name", "LUFFA"); +ack("luffa_384.update(str);", true); +ack("luffa_384.fini();", 'b13b97f6739ad0d575972c1c81a242f747ac1029f19a87f35e1ce16568b4e73054a962fade288e43452395cf05737ff9'); + +var luffa_512 = new GPSEE.Dc(PGPHASHALGO_LUFFA_512); +ack("luffa_512('');", '2a490f6bb9c236cee38717e6d8655f78aaecf4ffe2fe29d06383d8d6151c4c81eed9064831825ffc0c5da6b6adb1ebdcfdd8ab7434cd2f27df5df58b8b958a7f'); +ack("luffa_512.init(PGPHASHALGO_LUFFA_512);", true); +ack("luffa_512.algo", PGPHASHALGO_LUFFA_512); +ack("luffa_512.asn1", null); +ack("luffa_512.name", "LUFFA"); +ack("luffa_512.update(str);", true); +ack("luffa_512.fini();", '4c1faae4bda064ee9c50b6952eb95c3e1026c6840b9e498c2514eb9378377fe9ef2d6d1e17bc395346982d1cbb8ce6855f4602c8bf2ed11bfcd3e453314b1feb'); + +// XXX md6sum, not NIST, values used as test vectors. +var md6_224 = new GPSEE.Dc(PGPHASHALGO_MD6_224); +ack("md6_224('');", 'd2091aa2ad17f38c51ade2697f24cafc3894c617c77ffe10fdc7abcb'); +ack("md6_224.init(PGPHASHALGO_MD6_224);", true); +ack("md6_224.algo", PGPHASHALGO_MD6_224); +ack("md6_224.asn1", null); +ack("md6_224.name", "MD6"); +ack("md6_224.update(str);", true); +ack("md6_224.fini();", '510c30e4202a5cdd8a4f2ae9beebb6f5988128897937615d52e6d228'); + +var md6_256 = new GPSEE.Dc(PGPHASHALGO_MD6_256); +ack("md6_256('');", 'bca38b24a804aa37d821d31af00f5598230122c5bbfc4c4ad5ed40e4258f04ca'); +ack("md6_256.init(PGPHASHALGO_MD6_256);", true); +ack("md6_256.algo", PGPHASHALGO_MD6_256); +ack("md6_256.asn1", null); +ack("md6_256.name", "MD6"); +ack("md6_256.update(str);", true); +ack("md6_256.fini();", '230637d4e6845cf0d092b558e87625f03881dd53a7439da34cf3b94ed0d8b2c5'); + +var md6_384 = new GPSEE.Dc(PGPHASHALGO_MD6_384); +ack("md6_384('');", 'b0bafffceebe856c1eff7e1ba2f539693f828b532ebf60ae9c16cbc3499020401b942ac25b310b2227b2954ccacc2f1f'); +ack("md6_384.init(PGPHASHALGO_MD6_384);", true); +ack("md6_384.algo", PGPHASHALGO_MD6_384); +ack("md6_384.asn1", null); +ack("md6_384.name", "MD6"); +ack("md6_384.update(str);", true); +ack("md6_384.fini();", 'e2c6d31dd8872cbd5a1207481cdac581054d13a4d4fe6854331cd8cf3e7cbafbaddd6e2517972b8ff57cdc4806d09190'); + +var md6_512 = new GPSEE.Dc(PGPHASHALGO_MD6_512); +ack("md6_512('');", '6b7f33821a2c060ecdd81aefddea2fd3c4720270e18654f4cb08ece49ccb469f8beeee7c831206bd577f9f2630d9177979203a9489e47e04df4e6deaa0f8e0c0'); +ack("md6_512.init(PGPHASHALGO_MD6_512);", true); +ack("md6_512.algo", PGPHASHALGO_MD6_512); +ack("md6_512.asn1", null); +ack("md6_512.name", "MD6"); +ack("md6_512.update(str);", true); +ack("md6_512.fini();", '00918245271e377a7ffb202b90f3bda5477d8feab12d8a3a8994ebc55fe6e74ca8341520032eeea3fdef892f2882378f636212af4b2683ccf80bf025b7d9b457'); + +var shabal224 = new GPSEE.Dc(PGPHASHALGO_SHABAL_224); +ack("shabal224('');", '562b4fdbe1706247552927f814b66a3d74b465a090af23e277bf8029'); +ack("shabal224.init(PGPHASHALGO_SHABAL_224);", true); +ack("shabal224.algo", PGPHASHALGO_SHABAL_224); +ack("shabal224.asn1", null); +ack("shabal224.name", "SHABAL"); +ack("shabal224.update(str);", true); +ack("shabal224.fini();", 'f47578239607af492d5f7df9241818adf6fba4180ddcbef6e39ac1e9'); + +var shabal256 = new GPSEE.Dc(PGPHASHALGO_SHABAL_256); +ack("shabal256('');", 'aec750d11feee9f16271922fbaf5a9be142f62019ef8d720f858940070889014'); +ack("shabal256.init(PGPHASHALGO_SHABAL_256);", true); +ack("shabal256.algo", PGPHASHALGO_SHABAL_256); +ack("shabal256.asn1", null); +ack("shabal256.name", "SHABAL"); +ack("shabal256.update(str);", true); +ack("shabal256.fini();", '07225fab83ca48fb480d22219410d5ca008359efbfd315829029afe2cb3f0404'); + +var shabal384 = new GPSEE.Dc(PGPHASHALGO_SHABAL_384); +ack("shabal384('');", 'ff093d67d22b06a674b5f384719150d617e0ff9c8923569a2ab60cda886df63c91a25f33cd71cc22c9eebc5cd6aee52a'); +ack("shabal384.init(PGPHASHALGO_SHABAL_384);", true); +ack("shabal384.algo", PGPHASHALGO_SHABAL_384); +ack("shabal384.asn1", null); +ack("shabal384.name", "SHABAL"); +ack("shabal384.update(str);", true); +ack("shabal384.fini();", '66613058865271722c0295774aa77258a5082bebbb5a02f9d6aee9ad303fc71cbf19e2f599ddfde88cf0bf30a028e530'); + +var shabal512 = new GPSEE.Dc(PGPHASHALGO_SHABAL_512); +ack("shabal512('');", 'fc2d5dff5d70b7f6b1f8c2fcc8c1f9fe9934e54257eded0cf2b539a2ef0a19ccffa84f8d9fa135e4bd3c09f590f3a927ebd603ac29eb729e6f2a9af031ad8dc6'); +ack("shabal512.init(PGPHASHALGO_SHABAL_512);", true); +ack("shabal512.algo", PGPHASHALGO_SHABAL_512); +ack("shabal512.asn1", null); +ack("shabal512.name", "SHABAL"); +ack("shabal512.update(str);", true); +ack("shabal512.fini();", '4a7f0f707c1b0c1d12ddcfa8aa0f9d2410dd9bab57c2d56705fc1acb02066f99678738cedb20a2aba94842a441e77bc02656fe5690f98b421d029bfc4df09f91'); + +var shavite3_224 = new GPSEE.Dc(PGPHASHALGO_SHAVITE3_224); +ack("shavite3_224('');", '401d9f7dda63265b7b0c1cfebc196c1ce0cbe994dc6595bd0bb07fb4'); +ack("shavite3_224.init(PGPHASHALGO_SHAVITE3_224);", true); +ack("shavite3_224.algo", PGPHASHALGO_SHAVITE3_224); +ack("shavite3_224.asn1", null); +ack("shavite3_224.name", "SHAVITE3"); +ack("shavite3_224.update(str);", true); +ack("shavite3_224.fini();", 'ab74fc01e9fe46826bafb4383b3374174aeac9dbd2bdd0b2d18cf90f'); + +var shavite3_256 = new GPSEE.Dc(PGPHASHALGO_SHAVITE3_256); +ack("shavite3_256('');", '6646a740fd2bf0d79752627538777f32be04e22c3849d6c79fbbbcc2e68f4500'); +ack("shavite3_256.init(PGPHASHALGO_SHAVITE3_256);", true); +ack("shavite3_256.algo", PGPHASHALGO_SHAVITE3_256); +ack("shavite3_256.asn1", null); +ack("shavite3_256.name", "SHAVITE3"); +ack("shavite3_256.update(str);", true); +ack("shavite3_256.fini();", 'b89f6ce5ef30aa6a2da80ef1767ed90ef2e169f9fdd7b2d07b05157e9a59b04f'); + +var shavite3_384 = new GPSEE.Dc(PGPHASHALGO_SHAVITE3_384); +ack("shavite3_384('');", 'ac40319f6ebdb57a820d2dbc29218f9c58a319df0651d2550cda83a6778a57620aeb53762a677d8df6fda419f1d9a349'); +ack("shavite3_384.init(PGPHASHALGO_SHAVITE3_384);", true); +ack("shavite3_384.algo", PGPHASHALGO_SHAVITE3_384); +ack("shavite3_384.asn1", null); +ack("shavite3_384.name", "SHAVITE3"); +ack("shavite3_384.update(str);", true); +ack("shavite3_384.fini();", '7951ee74b2c791b96ea23678f9e1202f04fa4a328c65199e896aba4b33e739957eeeef81b19f9d67b82b0846af40fe0c'); + +var shavite3_512 = new GPSEE.Dc(PGPHASHALGO_SHAVITE3_512); +ack("shavite3_512('');", 'c25c67d74d00d9c69468c6b9e23b2d8732f953bf097fd79de15a828907bc3cbd640b8ee7ed3a456e6a840887ede15df6f4ba8c9771f5422267df667e26156e55'); +ack("shavite3_512.init(PGPHASHALGO_SHAVITE3_512);", true); +ack("shavite3_512.algo", PGPHASHALGO_SHAVITE3_512); +ack("shavite3_512.asn1", null); +ack("shavite3_512.name", "SHAVITE3"); +ack("shavite3_512.update(str);", true); +ack("shavite3_512.fini();", '6c7d3d688ecccbd285d6e7bb3cf00b10d292a45ec90f2b85426ece62eb068748e3a293c787196a920550ea0ac4b8d00e77a6066fb1c5952610d356dc8d0f589d'); + +var simd_224 = new GPSEE.Dc(PGPHASHALGO_SIMD_224); +ack("simd_224('');", '3a6b867e2fb0c448370e2855f3794b557124c81077373311103d0c64'); +ack("simd_224.init(PGPHASHALGO_SIMD_224);", true); +ack("simd_224.algo", PGPHASHALGO_SIMD_224); +ack("simd_224.asn1", null); +ack("simd_224.name", "SIMD"); +ack("simd_224.update(str);", true); +ack("simd_224.fini();", '1b7ef70809f56f20d5584491ffbf422ec4526f283664a9cb58bcc687'); + +var simd_256 = new GPSEE.Dc(PGPHASHALGO_SIMD_256); +ack("simd_256('');", '1a53c82220377d3e9a783b106210995a0f3931b6d002f99c243accd15dac587d'); +ack("simd_256.init(PGPHASHALGO_SIMD_256);", true); +ack("simd_256.algo", PGPHASHALGO_SIMD_256); +ack("simd_256.asn1", null); +ack("simd_256.name", "SIMD"); +ack("simd_256.update(str);", true); +ack("simd_256.fini();", 'a9569ffe053db1533641b631ea2a589114992564ad106fbe67edb7abfbadd91b'); + +var simd_384 = new GPSEE.Dc(PGPHASHALGO_SIMD_384); +ack("simd_384('');", 'c5f08c18d50448edf6924ec71616a3626687db426a99c1606f36918913a83b59411b58a6033447f005dc5153d7af0482'); +ack("simd_384.init(PGPHASHALGO_SIMD_384);", true); +ack("simd_384.algo", PGPHASHALGO_SIMD_384); +ack("simd_384.asn1", null); +ack("simd_384.name", "SIMD"); +ack("simd_384.update(str);", true); +ack("simd_384.fini();", 'd725c6408e188f482209982ae6129df43a7c562e2f9b84fb0281730e9de6db4d83cf0606f1cdd5c066522e15d8253d4b'); + +var simd_512 = new GPSEE.Dc(PGPHASHALGO_SIMD_512); +ack("simd_512('');", '426ab39fe63816339e65d100e34ddd593038852edc60e5eb166f3173b35a5124587c1d8bcc29b0cbb0930cf6eccac44a40f21895bb1bb7dd89c67e1f77010243'); +ack("simd_512.init(PGPHASHALGO_SIMD_512);", true); +ack("simd_512.algo", PGPHASHALGO_SIMD_512); +ack("simd_512.asn1", null); +ack("simd_512.name", "SIMD"); +ack("simd_512.update(str);", true); +ack("simd_512.fini();", '1c42e151ab96e0c9e378b7e8c8140aedcc553a3744a081eab8fd9c16bf4557f242d4a5fd7bc26ca71d38339387cfc57fd4cc79411d5258d0427b7ef9cf355429'); + +var tib3_224 = new GPSEE.Dc(PGPHASHALGO_TIB3_224); +ack("tib3_224('');", '0bb081f80b8d738cea5fde2ca9975ba4a5ad83196731b2432d8b3a18'); +ack("tib3_224.init(PGPHASHALGO_TIB3_224);", true); +ack("tib3_224.algo", PGPHASHALGO_TIB3_224); +ack("tib3_224.asn1", null); +ack("tib3_224.name", "TIB3"); +ack("tib3_224.update(str);", true); +ack("tib3_224.fini();", '096169965ba26b60e075c40cb5666d289d142ba6b5eb5bfeaee07186'); + +var tib3_256 = new GPSEE.Dc(PGPHASHALGO_TIB3_256); +ack("tib3_256('');", '67fcdaea6c8af476fa5f46fbc6f74bb7c47d1989170855385114b88c7be73677'); +ack("tib3_256.init(PGPHASHALGO_TIB3_256);", true); +ack("tib3_256.algo", PGPHASHALGO_TIB3_256); +ack("tib3_256.asn1", null); +ack("tib3_256.name", "TIB3"); +ack("tib3_256.update(str);", true); +ack("tib3_256.fini();", 'd14c723a5e6676afc53a92ffdf9ae66fdcfaca1ecef72a60dfafbec316f266e4'); + +var tib3_384 = new GPSEE.Dc(PGPHASHALGO_TIB3_384); +ack("tib3_384('');", '6968b5191ba3ccad2dab7a7cc4cc8ab4ea27c71a5a9868ec3c987909c8385345813fa5ad4097d0df7decfbff178b6671'); +ack("tib3_384.init(PGPHASHALGO_TIB3_384);", true); +ack("tib3_384.algo", PGPHASHALGO_TIB3_384); +ack("tib3_384.asn1", null); +ack("tib3_384.name", "TIB3"); +ack("tib3_384.update(str);", true); +ack("tib3_384.fini();", 'c59874e7a57724266238e9841ddbec63d67af12399eed11fc598f485b5ba0e779f41d0b10aa9eb0a5bd91647d618675b'); + +var tib3_512 = new GPSEE.Dc(PGPHASHALGO_TIB3_512); +ack("tib3_512('');", 'ca9b25aee65a2effb5fc6946a0bbae32055dd8e2f108f8411b4d4ea5f891a58766d10d5ebfa7bfcafb16502a5fc557120e8130d32bd9d80b67c45bdaeea8de58'); +ack("tib3_512.init(PGPHASHALGO_TIB3_512);", true); +ack("tib3_512.algo", PGPHASHALGO_TIB3_512); +ack("tib3_512.asn1", null); +ack("tib3_512.name", "TIB3"); +ack("tib3_512.update(str);", true); +ack("tib3_512.fini();", '98b174141294cfa25463777e2f37299aa4584f6d1156c631146ac75a84d9c05a06b33cec49cd2900dec9ae961bc8f27dae566f2c9d6ebf3702d0ce8f173524e7'); + +var tiger192 = new GPSEE.Dc(PGPHASHALGO_TIGER192); +ack("tiger192(str);", '2aab1484e8c158f2bfb8c5ff41b57a525129131c957b5f93'); +ack("tiger192.init(PGPHASHALGO_TIGER192);", true); +ack("tiger192.algo", PGPHASHALGO_TIGER192); +ack("tiger192.asn1", "3029300d06092b06010401da470c0205000418"); +ack("tiger192.name", "TIGER192"); +ack("tiger192.update(str);", true); +ack("tiger192.fini();", '2aab1484e8c158f2bfb8c5ff41b57a525129131c957b5f93'); + +var crc32 = new GPSEE.Dc(PGPHASHALGO_CRC32); +ack("crc32(str);", '352441c2'); +ack("crc32.init(PGPHASHALGO_CRC32);", true); +ack("crc32.algo", PGPHASHALGO_CRC32); +ack("crc32.asn1", null); +ack("crc32.name", "CRC32"); +ack("crc32.update(str);", true); +ack("crc32.fini();", '352441c2'); + +var crc64 = new GPSEE.Dc(PGPHASHALGO_CRC64); +ack("crc64(str);", '2cd8094a1a277627'); +ack("crc64.init(PGPHASHALGO_CRC64);", true); +ack("crc64.algo", PGPHASHALGO_CRC64); +ack("crc64.asn1", null); +ack("crc64.name", "CRC64"); +ack("crc64.update(str);", true); +ack("crc64.fini();", '2cd8094a1a277627'); + +var adler32 = new GPSEE.Dc(PGPHASHALGO_ADLER32); +ack("adler32(str);", '024d0127'); +ack("adler32.init(PGPHASHALGO_ADLER32);", true); +ack("adler32.algo", PGPHASHALGO_ADLER32); +ack("adler32.asn1", null); +ack("adler32.name", "ADLER32"); +ack("adler32.update(str);", true); +ack("adler32.fini();", '024d0127'); + +var jlu32 = new GPSEE.Dc(PGPHASHALGO_JLU32); +ack("jlu32(str);", '110255fd'); +ack("jlu32.init(PGPHASHALGO_JLU32);", true); +ack("jlu32.algo", PGPHASHALGO_JLU32); +ack("jlu32.asn1", null); +ack("jlu32.name", "JLU32"); +ack("jlu32.update(str);", true); +ack("jlu32.fini();", '110255fd'); + +if (loglvl) print("<-- Dc.js"); diff --git a/rpm-5.4.9/js/tscripts/Dig.js b/rpm-5.4.9/js/tscripts/Dig.js new file mode 100644 index 0000000..088f9e5 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Dig.js @@ -0,0 +1,11 @@ +if (loglvl) print("--> Dig.js"); + +var GPSEE = require('rpmdig'); + +var dig = new GPSEE.Dig(); +ack("typeof dig;", "object"); +ack("dig instanceof GPSEE.Dig;", true); +ack("dig.debug = 1;", 1); +ack("dig.debug = 0;", 0); + +if (loglvl) print("<-- Dig.js"); diff --git a/rpm-5.4.9/js/tscripts/Dir.js b/rpm-5.4.9/js/tscripts/Dir.js new file mode 100644 index 0000000..376b5b0 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Dir.js @@ -0,0 +1,39 @@ +if (loglvl) print("--> Dir.js"); + +var dn = "./tscripts"; +var ix = 0; + +var GPSEE = require('rpmdir'); + +var dir = new GPSEE.Dir(dn); +ack("typeof dir;", "object"); +ack("dir instanceof GPSEE.Dir;", true); +ack("dir.debug = 1;", 1); +ack("dir.debug = 0;", 0); + +print(JSON.stringify(dir)); + +ack("dir();", dir); // XXX closedir if no arguments given +ack("dir(dn);", dir); + +ix = 0; +// ack("dir.length", ix); // XXX ensure undefined or 0 until iterated +for (var [key,val] in Iterator(dir)) { +// print("key: "+key, "val: "+val); + ix++; +} +ack("dir.length", ix); + +ack("dir(dn);", dir); + +ix = 0; +// ack("dir.length", ix); // XXX ensure undefined or 0 until iterated +for (var [key,val] in Iterator(dir)) { +// print("key: "+key, "val: "+val); + ix++; +} +ack("dir.length", ix); + +delete dir; + +if (loglvl) print("<-- Dir.js"); diff --git a/rpm-5.4.9/js/tscripts/Ds.js b/rpm-5.4.9/js/tscripts/Ds.js new file mode 100644 index 0000000..089e62a --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Ds.js @@ -0,0 +1,84 @@ +if (loglvl) print("--> Ds.js"); + +var RPMNS_TYPE_RPMLIB = (1 << 9); + +var GPSEE = require('rpmds'); + +var ds = new GPSEE.Ds('rpmlib'); +ack("typeof ds;", "object"); +ack("ds instanceof GPSEE.Ds;", true); +ack("ds.debug = 1;", 1); +ack("ds.debug = 0;", 0); + +ack("ds.length", 25); +ack("ds.type", "Provides"); +ack("ds.A", undefined); +ack("ds.buildtime = 1234;", 1234); +ack("ds.color = 4;", 4); +ack("ds.nopromote = 1;", 1); +ack("ds.nopromote = 0;", 0); + +var deps = new Array(); +var ix = 0; +for (let [key,val] in Iterator(ds)) { + deps[ix++] = val; +} +ack("ix == ds.length", true); + +ix = 0 +for (var [key,val] in Iterator(ds)) { + ack("key == ix", true); + ack("deps[ix] == val", true); + ack("ds[ix] == val", true); + ack("ds[ix] == deps[ix]", true); + ix++; +} +ack("ix == ds.length", true); + +ack("ds.ix = -1;", -1); +ack("ds[-1] == undefined", true); +ack("ds.N == undefined", true); +ack("ds.EVR == undefined", true); +ack("ds.F == undefined", true); +ack("ds.DNEVR == undefined", true); +ack("ds.NS == undefined", true); +ack("ds.refs == undefined", true); +ack("ds.result == undefined", true); + +ack("ds.ix += 1;", 0); +ack("ds[0] != undefined", true); +ack("ds.ix", 0); +ack("ds.N == ds[0][0]", true); +ack("ds.N", "BuiltinAugeasScripts"); +ack("ds.N == ds[0][0]", true); +ack("ds.EVR", "5.3-1"); +ack("ds.EVR == ds[0][1]", true); +ack("ds.F", 16777224); +ack("ds.F == ds[0][2]", true); +ack("ds.DNEVR", "P rpmlib(BuiltinAugeasScripts) = 5.3-1"); +ack("ds.NS == RPMNS_TYPE_RPMLIB", true); +ack("ds.refs += 1;", 1); +ack("ds.result = 1;", 1); + +ack("ds.ix += 1;", 1); +ack("ds[1] != undefined", true); +ack("ds.ix", 1); +ack("ds.N", "BuiltinFiclScripts"); +ack("ds.N == ds[1][0]", true); +ack("ds.EVR", "5.2-1"); +ack("ds.EVR == ds[1][1]", true); +ack("ds.F", 16777224); +ack("ds.F == ds[1][2]", true); +ack("ds.DNEVR", "P rpmlib(BuiltinFiclScripts) = 5.2-1"); +ack("ds.NS == RPMNS_TYPE_RPMLIB", true); +ack("ds.refs += 1;", 1); +ack("ds.result = 1;", 1); + +// for (var [key,val] in Iterator(ds)) +// print("\t"+key+": "+val); + +// print(JSON.stringify(ds)); + +delete ds; + +if (loglvl) print("<-- Ds.js"); diff --git a/rpm-5.4.9/js/tscripts/Fc.js b/rpm-5.4.9/js/tscripts/Fc.js new file mode 100644 index 0000000..f7eae52 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Fc.js @@ -0,0 +1,11 @@ +if (loglvl) print("--> Fc.js"); + +var GPSEE = require('rpmfc'); + +var fc = new GPSEE.Fc(); +ack("typeof fc;", "object"); +ack("fc instanceof GPSEE.Fc;", true); +ack("fc.debug = 1;", 1); +ack("fc.debug = 0;", 0); + +if (loglvl) print("<-- Fc.js"); diff --git a/rpm-5.4.9/js/tscripts/Fi.js b/rpm-5.4.9/js/tscripts/Fi.js new file mode 100644 index 0000000..edcdf14 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Fi.js @@ -0,0 +1,89 @@ +if (loglvl) print("--> Fi.js"); + +var RPMTAG_NAME = 1000; +var N = "popt"; + +var rpmts = require('rpmts'); +var rpmmi = require('rpmmi'); +var rpmfi = require('rpmfi'); +var rpmhdr = require('rpmhdr'); + +var ts = new rpmts.Ts(); +// var mi = ts.mi(RPMTAG_NAME, 'popt'); +var mi = new rpmmi.Mi(ts, RPMTAG_NAME, N); +ack("mi.length", 1); +ack("mi.count", 1); +ack("mi.instance", 0); // zero before iterating + +// var h = new rpmhdr.Hdr(); +var bingo = 0; +for (var [dbkey,h] in Iterator(mi)) { + ack("mi.instance", 0); // non-zero when iterating + ack("mi.instance", h.instance); + + var fi = new rpmfi.Fi(h); + ack("typeof fi;", "object"); + ack("fi instanceof rpmfi.Fi;", true); + ack("fi.debug = 1;", 1); + ack("fi.debug = 0;", 0); + + var files = new Array(); + var ix = 0; + for (let [fikey,fival] in Iterator(fi)) { + files[ix++] = fival; + } + ack("ix == fi.length", true); + + ix = 0 + for (var [key,val] in Iterator(fi)) { + ack("key == ix", true); + ack("files[key] == val", true); + ack("fi[key] == val", true); + ack("fi[key] == files[key]", true); + ix++; + } + ack("ix == fi.length", true); + + ack("fi.fc", undefined); + ack("fi.fx", undefined); + ack("fi.dc", undefined); + ack("fi.dx", undefined); + + ack("fi.dx = -1;", -1); + ack("++fi.dx;", 0); + ack("++fi.dx;", 1); + + ack("fi.fx = -1;", -1); + ack("fi.fx += 1;", 0); + ack("fi.fx += 1;", 1); + ack("fi.fx += 1;", 2); + + ack("fi.bn", undefined); + ack("fi.dn", undefined); + ack("fi.fn", undefined); + ack("fi.vflags", undefined); + ack("fi.fflags", undefined); + ack("fi.fmode", undefined); + ack("fi.fstate", undefined); + nack("fi.fdigest", "00000000000000000000000000000000"); + ack("fi.flink", undefined); + ack("fi.fsize", undefined); + ack("fi.frdev", undefined); + ack("fi.fmtime", undefined); + ack("fi.fuser", undefined); + ack("fi.fgroup", undefined); + ack("fi.fcolor", undefined); + nack("fi.fclass", "symbolic link to `libpopt.so.0.0.0'"); + bingo = 1; +} +ack('bingo', 1); + +delete mi; // GCZeal? +delete ts; // GCZeal? + +// for (var [key,val] in Iterator(fi)) +// print(key+": "+val); + +// print(JSON.stringify(fi)); + +if (loglvl) print("<-- Fi.js"); diff --git a/rpm-5.4.9/js/tscripts/File.js b/rpm-5.4.9/js/tscripts/File.js new file mode 100644 index 0000000..437fd65 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/File.js @@ -0,0 +1,47 @@ +if (loglvl) print("--> File.js"); + +var dn = "/tmp"; +var bn = "xyzzy"; +var fn = dn+"/"+bn; + +var f = new File(fn); +ack("typeof f", "object"); +ack("f instanceof File;", true); + +ack("f.path", fn); +ack("f.isOpen", false); +ack("File.currentDir", undefined); +ack("File.input", "Standard input stream"); +ack("File.output", "Standard output stream"); +ack("File.error", "Standard error stream"); +ack("File.separator", "/"); + +f.open(); +ack("f.isOpen", true); +ack("f.position", 0); +f.write("bing,", "bang,", "boom\n"); +ack("f.position", 15); + +ack("f.canAppend", true); +ack("f.canRead", true); +ack("f.canReplace", false); +ack("f.exists", true); +ack("f.hasAutoFlush", false); +ack("f.hasRandomAccess", true); +ack("f.isDirectory", false); +ack("f.isFile", true); +ack("f.isNative", false); +ack("f.isOpen", true); +ack("f.lastModified", undefined); +ack("f.length", 15); +ack("f.mode", "read,write,readWrite,append,create"); +ack("f.name", bn); +ack("f.parent", dn); +ack("f.path", fn); +ack("f.position", f.length); +ack("f.type", "text"); + +f.close() +ack("f.isOpen", false); + +if (loglvl) print("<-- File.js"); diff --git a/rpm-5.4.9/js/tscripts/Fts.js b/rpm-5.4.9/js/tscripts/Fts.js new file mode 100644 index 0000000..5950b8a --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Fts.js @@ -0,0 +1,197 @@ +if (loglvl) print("--> Fts.js"); + +/* fts_options */ +const FTS_COMFOLLOW = 0x0001; /* follow command line symlinks */ +const FTS_LOGICAL = 0x0002; /* logical walk */ +const FTS_NOCHDIR = 0x0004; /* don't change directories */ +const FTS_NOSTAT = 0x0008; /* don't get stat info */ +const FTS_PHYSICAL = 0x0010; /* physical walk */ +const FTS_SEEDOT = 0x0020; /* return dot and dot-dot */ +const FTS_XDEV = 0x0040; /* don't cross devices */ +const FTS_WHITEOUT = 0x0080; /* return whiteout information */ +const FTS_OPTIONMASK = 0x00ff; /* valid user option mask */ +const FTS_NAMEONLY = 0x0100; /* (private) child names only */ +const FTS_STOP = 0x0200; /* (private) unrecoverable error */ + +/* fts_level */ +const FTS_ROOTPARENTLEVEL = -1; +const FTS_ROOTLEVEL = 0; + +/* fts_info */ +const FTS_D = 1; /* preorder directory */ +const FTS_DC = 2; /* directory that causes cycles */ +const FTS_DEFAULT = 3; /* none of the above */ +const FTS_DNR = 4; /* unreadable directory */ +const FTS_DOT = 5; /* dot or dot-dot */ +const FTS_DP = 6; /* postorder directory */ +const FTS_ERR = 7; /* error; errno is set */ +const FTS_F = 8; /* regular file */ +const FTS_INIT = 9; /* initialized only */ +const FTS_NS = 10; /* stat(2) failed */ +const FTS_NSOK = 11; /* no stat(2) requested */ +const FTS_SL = 12; /* symbolic link */ +const FTS_SLNONE = 13; /* symbolic link without target */ +const FTS_W = 14; /* whiteout object */ +var ftsinfo = [ + 'UNKNOWN', 'D', 'DC', 'DEFAULT', 'DNR', 'DOT', 'DP', + 'ERR', 'F', 'INIT', 'NS', 'NSOK', 'SL', 'SLNONE', 'W' +]; + + +/* fts_flags */ +const FTS_DONTCHDIR = 0x01; /* don't chdir .. to the parent */ +const FTS_SYMFOLLOW = 0x02; /* followed a symlink to get here */ + +/* fts_instr */ +const FTS_AGAIN = 1; /* read node again */ +const FTS_FOLLOW = 2; /* follow symbolic link */ +const FTS_NOINSTR = 3; /* no instructions */ +const FTS_SKIP = 4; /* discard node */ + +var uri_dn = "http://rpm5.org/files/popt/"; +var uri_bn = "popt-1.14.tar.gz"; +var uri_fn = uri_dn + uri_bn; +var dn = "./tscripts"; +var fts_options = FTS_PHYSICAL | FTS_NOCHDIR; + +var GPSEE = require('rpmfts'); +var rpmst = require('rpmst'); + +var fts = new GPSEE.Fts(dn, fts_options); +ack("typeof fts;", "object"); +ack("fts instanceof GPSEE.Fts;", true); +ack("fts.debug = 1;", 1); +ack("fts.debug = 0;", 0); + +// print(JSON.stringify(fts)); + +// ack("fts();", fts); // XXX Fts_close() if no arguments given +// ack("fts(dn, fts_options);", fts); + +var ix = 0; + +// ack("fts.length", ix); // XXX ensure undefined or 0 until iterated +// for (var [key,val] in Iterator(fts)) { +// print("key: "+key, "val: "+val); +// ix++; +// } +// ack("fts.length", ix); + +// ack("fts(dn, fts_options);", fts); + +// ix = 0; +// ack("fts.length", ix); // XXX ensure undefined or 0 until iterated +// for (var [key,val] in Iterator(fts)) { +// print("key: "+key, "val: "+val); +// ix++; +// } +// ack("fts.length", ix); + +ix = 0; +fts.open(dn, fts_options); +while (fts.read()) { + var st = new rpmst.St(fts.accpath); + fts.number = ix; + print("FTS_"+ftsinfo[fts.info]+"\t"+fts.number+"\t"+fts.path); + + ack("fts.current", undefined); + ack("fts.child", undefined); + ack("fts.array", undefined); + ack("fts.rootdev", st.dev); + ack("fts.root", fts.accpath); + ack("fts.rootlen", undefined); // WTF: 4352? + ack("fts.nitems", 0); + ack("fts.options", fts_options); + + ack("fts.cycle", undefined); + ack("fts.parent", undefined); + ack("fts.link", undefined); + ack("fts.number", ix); + ack("fts.pointer", undefined); + ack("fts.accpath", fts.path); + ack("fts.path", fts.accpath); + ack("fts.errno", 0); + ack("fts.pathlen", fts.path.length); + ack("fts.namelen", fts.name.len); + ack("fts.ino", undefined); + ack("fts.dev", undefined); + ack("fts.nlink", undefined); + ack("fts.level", undefined); + ack("fts.info", undefined); + ack("fts.flags", 0); + ack("fts.instr", FTS_NOINSTR); + + var fts_st = fts.st; + ack("fts_st.dev", st.dev); + ack("fts_st.ino", st.ino); + ack("fts_st.mode", st.mode); + ack("fts_st.nlink", st.nlink); + ack("fts_st.uid", st.uid); + ack("fts_st.gid", st.gid); + ack("fts_st.rdev", st.rdev); + ack("fts_st.size", st.size); + ack("fts_st.blksize", st.blksize); + ack("fts_st.blocks", st.blocks); + ack("fts_st.atime", undefined); // st.atime? + ack("fts_st.mtime", undefined); // st.mtime? + ack("fts_st.ctime", undefined); // st.ctime? + + ack("fts.name", undefined); // basename(fts.accpath) + ix++; +} +fts.close(); + +ix = 0; +fts.open(uri_fn, fts_options); +while (fts.read()) { + fts.number = ix; + print("FTS_"+ftsinfo[fts.info]+"\t"+fts.number+"\t"+fts.path); + + ack("fts.current", undefined); + ack("fts.child", undefined); + ack("fts.array", undefined); + ack("fts.rootdev", 572662306); + ack("fts.root", uri_fn); + ack("fts.rootlen", undefined); // WTF: 4352? + ack("fts.nitems", 0); + ack("fts.options", fts_options); + + ack("fts.cycle", undefined); + ack("fts.parent", undefined); + ack("fts.link", undefined); + ack("fts.number", ix); + ack("fts.pointer", undefined); + ack("fts.accpath", uri_fn); + ack("fts.path", uri_fn); + ack("fts.errno", 0); + ack("fts.pathlen", uri_fn.length); + ack("fts.namelen", uri_bn.length); + ack("fts.ino", undefined); + ack("fts.dev", undefined); + ack("fts.nlink", undefined); + ack("fts.level", 0); + ack("fts.info", FTS_F); + ack("fts.flags", 0); + ack("fts.instr", FTS_NOINSTR); + + var fts_st = fts.st; + ack("fts_st.dev", 0); + ack("fts_st.ino", 907648754); + ack("fts_st.mode", 33188); + ack("fts_st.nlink", 1); + ack("fts_st.uid", 0); + ack("fts_st.gid", 0); + ack("fts_st.rdev", 0); + ack("fts_st.size", 695557); + ack("fts_st.blksize", 0); + ack("fts_st.blocks", 1359); + ack("fts_st.atime", "Fri Apr 06 0108 12:29:26 GMT-0500 (EST)"); + ack("fts_st.mtime", "Fri Apr 06 0108 12:29:26 GMT-0500 (EST)"); + ack("fts_st.ctime", "Fri Apr 06 0108 12:29:26 GMT-0500 (EST)"); + + ack("fts.name", uri_bn); + ix++; +} +fts.close(); + +if (loglvl) print("<-- Fts.js"); diff --git a/rpm-5.4.9/js/tscripts/Gi.js b/rpm-5.4.9/js/tscripts/Gi.js new file mode 100644 index 0000000..179a3f2 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Gi.js @@ -0,0 +1,11 @@ +if (loglvl) print("--> Gi.js"); + +var GPSEE = require('rpmgi'); + +var gi = new GPSEE.Gi(); +ack("typeof gi;", "object"); +ack("gi instanceof GPSEE.Gi;", true); +ack("gi.debug = 1;", 1); +ack("gi.debug = 0;", 0); + +if (loglvl) print("<-- Gi.js"); diff --git a/rpm-5.4.9/js/tscripts/Hdr.js b/rpm-5.4.9/js/tscripts/Hdr.js new file mode 100644 index 0000000..a52f2c3 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Hdr.js @@ -0,0 +1,127 @@ +if (loglvl) print("--> Hdr.js"); + +var RPMTAG_NAME = 1000; +var RPMTAG_REQUIRENAME = 1049; +var RPMTAG_BASENAMES = 1117; +var RPMTAG_NVRA = 1196; + +var N = "popt"; + +var NVRA = N; +var bingo = 0; + +var rpmhdr = require('rpmhdr'); +var rpmts = require('rpmts'); +var rpmmi = require('rpmmi'); +var rpmds = require('rpmds'); +var rpmfi = require('rpmfi'); + +var h = new rpmhdr.Hdr(); +ack("typeof h;", "object"); +ack("h instanceof rpmhdr.Hdr;", true); +ack("h.debug = 1;", 1); +ack("h.debug = 0;", 0); +delete h; + +var ts = new rpmts.Ts(); + +var mi = new rpmmi.Mi(ts, RPMTAG_NVRA, N); +ack("mi.length", 1); +ack("mi.count", 1); +ack("mi.instance", 0); // zero before iterating + +bingo = 0; +for (let [dbkey,h] in Iterator(mi)) { + nack("mi.instance", 0); // non-zero when iterating + + ack("typeof h;", "object"); + ack("h instanceof rpmhdr.Hdr;", true); + +// for (var [tagno,tagval] in Iterator(h,true)) +// print(h.tag(tagno),JSON.stringify(tagval)); + + var ds = h.ds(); + ack("typeof ds;", "object"); + ack("ds instanceof rpmds.Ds;", true); + var ds = h.ds(RPMTAG_NAME); + ack("typeof ds;", "object"); + ack("ds instanceof rpmds.Ds;", true); + var ds = h.ds(RPMTAG_REQUIRENAME); + ack("typeof ds;", "object"); + ack("ds instanceof rpmds.Ds;", true); + + var fi = h.fi(); + ack("typeof fi;", "object"); + ack("fi instanceof rpmfi.Fi;", true); + var fi = h.fi(RPMTAG_BASENAMES); + ack("typeof fi;", "object"); + ack("fi instanceof rpmfi.Fi;", true); + + ack("h.name", N); + ack("h[RPMTAG_NAME]", N); +// ack("h['name']", N); // not yet ... + ack("h.epoch", undefined); + ack("h.version", undefined); + ack("h.release", undefined); + + ack("h.summary", undefined); + ack("h.description", undefined); + ack("h.buildtime", undefined); + ack("h.buildhost", undefined); + ack("h.installtime", undefined); + ack("h.size", undefined); + ack("h.distribution", undefined); + ack("h.vendor", undefined); + ack("h.license", undefined); + ack("h.packager", undefined); + ack("h.group", undefined); + + ack("h.changelogtime", undefined); + ack("h.changelogname", undefined); + + ack("h.url", undefined); + ack("h.os", undefined); + ack("h.arch", undefined); + + ack("h.prein", undefined); + ack("h.preinprog", undefined); + ack("h.postin", undefined); + ack("h.postinprog", undefined); + ack("h.preun", undefined); + ack("h.preunprog", undefined); + ack("h.postun", undefined); + ack("h.postunprog", undefined); + + ack("h.filenames", undefined); + ack("h.dirnames", undefined); + ack("h.basenames", undefined); + + ack("h.filesizes", undefined); + ack("h.filestates", undefined); + ack("h.filemodes", undefined); + ack("h.filerdevs", undefined); + + ack("h.sourcerpm", undefined); + ack("h.archivesize", undefined); + + ack("h.providename", undefined); + ack("h.requirename", undefined); + ack("h.conflictname", undefined); + ack("h.obsoletesname", undefined); + +// ack("h.keys()", undefined); +// var legacyHeader = true; +// ack("h.unload(legacyHeader)", undefined); + var origin = "http://rpm5.org/files/popt/popt-1.14-1.i386.rpm"; + ack("h.setorigin(origin)", origin); + ack("h.getorigin()", origin); + var qfmt = "%{buildtime:date}"; + ack("h.sprintf(qfmt)", undefined); + bingo = 1; +} +ack('bingo', 1); + +delete mi; // GCZeal? +delete ts; // GCZeal? + +if (loglvl) print("<-- Hdr.js"); diff --git a/rpm-5.4.9/js/tscripts/Io.js b/rpm-5.4.9/js/tscripts/Io.js new file mode 100644 index 0000000..3fe88f7 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Io.js @@ -0,0 +1,103 @@ +if (loglvl) print("--> Io.js"); + +var GPSEE = require('rpmio'); +var rpmst = require('rpmst'); + +var io = new GPSEE.Io(); +ack("typeof io;", "object"); +ack("io instanceof GPSEE.Io;", true); +ack("io.debug = 1;", 1); +ack("io.debug = 0;", 0); + +ack("io() instanceof GPSEE.Io;", true); + +var tmpdir = '/tmp'; +var fn = tmpdir + '/io.file'; +var yadda = 'yadda yadda'; + +ack("io(fn, 'w') instanceof GPSEE.Io;", true); +ack("io.path", fn); +ack("io.flags", 0x241); +ack("io.mode", 0666); +ack("io.cpioPos", 0); +ack("io.bytesRemain", -1); +ack("io.lastModified", 0); +ack("io.contentLength", -1); +ack("io.contentType", null); +ack("io.contentDisposition", null); +ack("io.digestinit() instanceof GPSEE.Io;", true); +ack("io.ndigests", 1); +ack("io.fwrite(yadda);", true); +ack("io.fflush();", true); +ack("io.fstat() instanceof rpmst.St;", true); +ack("io.fchown(-1,-1);", 0); +ack("io.ferror();", true); +ack("io.fileno();", 3); +ack("io.digestfini();", 'e1a8e5c3fdc6995bbfdc721dcf16c52b'); +ack("io.cpioPos", 0); +ack("io.bytesRemain", -1); +ack("io.lastModified", 0); +ack("io.contentLength", -1); +ack("io.contentType", null); +ack("io.contentDisposition", null); +ack("io() instanceof GPSEE.Io;", true); + +ack("io(fn, 'r') instanceof GPSEE.Io;", true); +ack("io.path", fn); +ack("io.flags", 0x0); +ack("io.mode", 0666); +ack("io.cpioPos", 0); +ack("io.bytesRemain", -1); +ack("io.lastModified", 0); +ack("io.contentLength", -1); +ack("io.contentType", null); +ack("io.contentDisposition", null); +ack("io.digestinit() instanceof GPSEE.Io;", true); +ack("io.ndigests", 1); +ack("io.fread();", yadda); +ack("io.fstat() instanceof rpmst.St;", true); +ack("io.fchown(-1,-1);", 0); +ack("io.ferror();", true); +ack("io.fileno();", 3); +ack("io.digestfini();", 'e1a8e5c3fdc6995bbfdc721dcf16c52b'); +ack("io.cpioPos", 0); +ack("io.bytesRemain", -1); +ack("io.lastModified", 0); +ack("io.contentLength", -1); +ack("io.contentType", null); +ack("io.contentDisposition", null); +ack("io() instanceof GPSEE.Io;", true); + +ack("io(fn, 'r.fpio') instanceof GPSEE.Io;", true); +ack("io.path", fn); +ack("io.flags", 0x0); +ack("io.mode", 0666); +ack("io.cpioPos", 0); +ack("io.bytesRemain", -1); +ack("io.lastModified", 0); +ack("io.contentLength", -1); +ack("io.contentType", null); +ack("io.contentDisposition", null); + +ack("io.fseek(5);", 0); +ack("io.ftell();", 5); +ack("io.rewind();", true); +ack("io.ftell();", 0); + +ack("io.fread();", yadda); +ack("io.fstat() instanceof rpmst.St;", true); +ack("io.fchown(-1,-1);", 0); +ack("io.ferror();", true); +ack("io.fileno();", 3); + +ack("io.cpioPos", 0); +ack("io.bytesRemain", -1); +ack("io.lastModified", 0); +ack("io.contentLength", -1); +ack("io.contentType", null); +ack("io.contentDisposition", null); +ack("io() instanceof GPSEE.Io;", true); + +delete io; + +if (loglvl) print("<-- Io.js"); diff --git a/rpm-5.4.9/js/tscripts/Iob.js b/rpm-5.4.9/js/tscripts/Iob.js new file mode 100644 index 0000000..686cf64 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Iob.js @@ -0,0 +1,11 @@ +if (loglvl) print("--> Iob.js"); + +var GPSEE = require('rpmiob'); + +var iob = new GPSEE.Iob(); +ack("typeof iob;", "object"); +ack("iob instanceof GPSEE.Iob;", true); +ack("iob.debug = 1;", 1); +ack("iob.debug = 0;", 0); + +if (loglvl) print("<-- Iob.js"); diff --git a/rpm-5.4.9/js/tscripts/Mc.js b/rpm-5.4.9/js/tscripts/Mc.js new file mode 100644 index 0000000..c58ffb6 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Mc.js @@ -0,0 +1,67 @@ +if (loglvl) print("--> Mc.js"); + +var GPSEE = require('rpmmc'); + +var mc = new GPSEE.Mc(); +ack("typeof mc;", "object"); +ack("mc instanceof GPSEE.Mc;", true); +ack("mc.debug = 1;", 1); +ack("mc.debug = 0;", 0); + +ack('mc.expand("%{_bindir}")', "/usr/bin"); + +// XXX noisy, adding pattern/index/level filters todo++ +// nack('mc.list()', null); +ack('mc.add("foo bar")', true); +ack('mc.expand("%{foo}")', "bar"); +ack('mc.del("foo")', true); +ack('mc.expand("%{foo}")', "%{foo}"); +// XXX noisy, adding pattern/index/level filters todo++ +// ack('mc.list()', false); + +ack('mc.expand("%{lua:print(\\"lua\\")}")', "lua"); + +// FIXME: reloading rpm modules within embedded interpreter segfaults +// ack('mc.expand("%{perl:print \\"perl\\"}")', "perl"); +// ack('mc.expand("%{python:print \\"python\\"}")', "python"); + +// XXX hmmm, HEAD segfaults here, rpm-5_2 doesn't. todo++ +// ack('mc.expand("%{ruby:puts \\"ruby\\"}")', "ruby"); +// ack('mc.expand("%{tcl:puts \\"tcl\\"}")', "tcl"); +delete mc + +mc = new GPSEE.Mc("cli"); +ack('mc.list()', null); +ack('mc.add("foo bar")', true); +ack('mc.list()', "%foo bar"); +ack('mc.expand("%{foo}")', "bar"); +ack('mc.del("foo")', true); +ack('mc.list()', null); +ack('mc.expand("%{foo}")', "%{foo}"); +delete mc + +mc = new GPSEE.Mc("tscripts/macros"); +ack('mc.list()', null); +ack('mc.add("foo bar")', true); +ack('mc.list()', "%foo bar"); +ack('mc.expand("%{foo}")', "bar"); +ack('mc.del("foo")', true); +ack('mc.list()', null); +ack('mc.expand("%{foo}")', "%{foo}"); +delete mc + +mc = new GPSEE.Mc(""); +ack('mc.list()', null); +ack('mc.add("foo bar")', true); +ack('mc.list()', "%foo bar"); +ack('mc.expand("%{foo}")', "bar"); +ack('mc.del("foo")', true); +ack('mc.list()', null); +ack('mc.expand("%{foo}")', "%{foo}"); +delete mc + +// FIXME: there's no internal code path error returns to force an error out. +mc = new GPSEE.Mc("tscripts/nonexistent"); +delete mc + +if (loglvl) print("<-- Mc.js"); diff --git a/rpm-5.4.9/js/tscripts/Mg.js b/rpm-5.4.9/js/tscripts/Mg.js new file mode 100644 index 0000000..ff78fe6 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Mg.js @@ -0,0 +1,42 @@ +if (loglvl) print("--> Mg.js"); + +const MAGIC_NONE = 0x000000; /* No flags */ +const MAGIC_DEBUG = 0x000001; /* Turn on debugging */ +const MAGIC_SYMLINK = 0x000002; /* Follow symlinks */ +const MAGIC_COMPRESS = 0x000004; /* Check inside compressed files */ +const MAGIC_DEVICES = 0x000008; /* Look at the contents of devices */ +const MAGIC_MIME_TYPE = 0x000010; /* Return only the MIME type */ +const MAGIC_CONTINUE = 0x000020; /* Return all matches */ +const MAGIC_CHECK = 0x000040; /* Print warnings to stderr */ +const MAGIC_PRESERVE_ATIME = 0x000080; /* Restore access time on exit */ +const MAGIC_RAW = 0x000100; /* Don't translate unprint chars */ +const MAGIC_ERROR = 0x000200; /* Handle ENOENT etc as real errors */ +const MAGIC_MIME_ENCODING = 0x000400; /* Return only the MIME encoding */ +const MAGIC_MIME = (MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING); +const MAGIC_NO_CHECK_COMPRESS = 0x001000; /* Don't check for compressed files */ +const MAGIC_NO_CHECK_TAR = 0x002000; /* Don't check for tar files */ +const MAGIC_NO_CHECK_SOFT = 0x004000; /* Don't check magic entries */ +const MAGIC_NO_CHECK_APPTYPE = 0x008000; /* Don't check application type */ +const MAGIC_NO_CHECK_ELF = 0x010000; /* Don't check for elf details */ +const MAGIC_NO_CHECK_ASCII = 0x020000; /* Don't check for ascii files */ +const MAGIC_NO_CHECK_TOKENS = 0x100000; /* Don't check ascii/tokens */ + +var magicfile = "/usr/lib/rpm/magic"; + +var GPSEE = require('rpmmg'); + +var magic = new GPSEE.Mg(magicfile, MAGIC_CHECK); +ack("typeof magic;", "object"); +ack("magic instanceof GPSEE.Mg;", true); +ack("magic.debug = 1;", 1); +ack("magic.debug = 0;", 0); + +var mime = new GPSEE.Mg(magicfile, MAGIC_CHECK|MAGIC_MIME); +var fn = '/bin/sh'; + +print(fn+": mime("+mime(fn)+") "+magic(fn)); + +delete mime; +delete magic; + +if (loglvl) print("<-- Mg.js"); diff --git a/rpm-5.4.9/js/tscripts/Mi.js b/rpm-5.4.9/js/tscripts/Mi.js new file mode 100644 index 0000000..16ae113 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Mi.js @@ -0,0 +1,189 @@ +if (loglvl) print("--> Mi.js"); + +var RPMDBI_PACKAGES = 0; +var RPMTAG_NAME = 1000; +var RPMTAG_VERSION = 1001; +var RPMTAG_RELEASE = 1002; +var RPMTAG_GROUP = 1016; +var RPMTAG_OS = 1021; +var RPMTAG_ARCH = 1022; +var RPMTAG_INSTALLTID = 1128; +var RPMTAG_REMOVETID = 1129; +var RPMTAG_PACKAGECOLOR = 1184; +var RPMTAG_NVRA = 1196; + +var RPMMIRE_DEFAULT = 0; /*!< posix regex with \., .* and ^...$ added */ +var RPMMIRE_STRCMP = 1; /*!< strings using strcmp(3) */ +var RPMMIRE_REGEX = 2; /*!< posix regex(7) patterns using regcomp(3) */ +var RPMMIRE_GLOB = 3; /*!< glob(7) patterns using fnmatch(3) */ +var RPMMIRE_PCRE = 4; /*!< pcre patterns using pcre_compile2(3) */ + +var N = "popt"; +var V = ""; +var R = ""; +var A = ""; +var O = ""; +var G = ""; +var IID = 0; +var color = -1; + +var NVRA = N; +var hdrNum = 0; +var bingo = 0; +var npkgs = 0; +var IIDcounts = []; +var IIDcount = 0; + +var rpmts = require('rpmts'); +var rpmmi = require('rpmmi'); +var rpmhdr = require('rpmhdr'); + +var ts = new rpmts.Ts(); + +var mi = new rpmmi.Mi(ts); +ack("typeof mi;", "object"); +ack("mi instanceof rpmmi.Mi;", true); +ack("mi.debug = 1;", 1); +ack("mi.debug = 0;", 0); +delete mi; + +// --- Iterate over packages, counting, grab hdrNum and NVRA on the fly. +var mi = new rpmmi.Mi(ts); +bingo = 0; +for (var [dbkey,h] in Iterator(mi)) { +// ack("mi.instance != 0", true); +// ack("mi.instance < 0x0000ffff", true); +// ack("mi.instance == h.dbinstance", true); + ++npkgs; + if (IIDcounts[h.installtid[0].toString(16)] > 0) + ++IIDcounts[h.installtid[0].toString(16)]; + else + IIDcounts[h.installtid[0].toString(16)] = 1; + if (h.name == N) { + hdrNum = mi.instance; + V = h.version; + R = h.release; + O = h.os; + A = h.arch; + G = h.group; + IID = h.installtid[0]; + color = h.packagecolor; + NVRA = h.nvra; + } + delete h; + bingo = 1; +} +ack("bingo", 1); +delete mi; + +function doITER(ts, tag, key) { + this.mi = new rpmmi.Mi(ts, tag, key); + this.bingo = 0; + for ([this.dbkey,this.h] in Iterator(this.mi)) { + ack("this.h.name", N); + ack("this.h.nvra", NVRA); + ack("this.mi.instance == hdrNum", true); + ack("this.mi.instance == this.h.dbinstance", true); + delete this.h; + this.bingo = 1; + } + ack("this.bingo", 1); + delete this.mi; + return true; +} + +// --- Retrieve by package primary key +doITER(ts, RPMDBI_PACKAGES, hdrNum); + +// --- Retrieve by N and NVRA string key(s). +doITER(ts, RPMTAG_NAME, N); +doITER(ts, RPMTAG_NVRA, NVRA); + +// --- Retrieve by N, N-V, N-V-R, and N-V-R.A strings. +doITER(ts, RPMTAG_NVRA, N); +doITER(ts, RPMTAG_NVRA, N+"-"+V); +doITER(ts, RPMTAG_NVRA, N+"-"+V+"-"+R); +doITER(ts, RPMTAG_NVRA, N+"-"+V+"-"+R+"."+A); + +// --- Retrieve by N pattern. +doITER(ts, RPMTAG_NVRA, "\^"+N+"-[0-9].*$"); +doITER(ts, RPMTAG_NVRA, "\^"+N+"-[0-9].*"+"\."+A+"$"); + +// --- Retrieve by N with various mire pattern selectors. +var mi = new rpmmi.Mi(ts, RPMTAG_NAME, N); +ack("mi.pattern(RPMTAG_VERSION, V)", true); +ack("mi.pattern('release', R, RPMMIRE_STRCMP)", true); +ack("mi.pattern(RPMTAG_OS, O, RPMMIRE_REGEX)", true); +ack("mi.pattern('arch', A, RPMMIRE_GLOB)", true); +ack("mi.pattern(RPMTAG_GROUP, G, RPMMIRE_PCRE)", true); +bingo = 0; +for (var [dbkey,h] in Iterator(mi)) { + ack("h.name", N); + ack("h.nvra", NVRA); + ack("mi.instance == hdrNum", true); + ack("mi.instance == h.dbinstance", true); + delete h; + bingo = 1; +} +ack("bingo", 1); +delete mi; + +// --- Retrieve by N, filtering the instance (i.e. nothing found). +var mi = new rpmmi.Mi(ts, RPMTAG_NAME, N); +ack("mi.prune(hdrNum)", true); +bingo = 0; +for (var [dbkey,h] in Iterator(mi)) { + nack("h.name", N); + nack("h.nvra", NVRA); + nack("mi.instance == hdrNum", true); + nack("mi.instance == h.dbinstance", true); + delete h; + bingo = 1; +} +ack("bingo", 0); +delete mi; + +// --- Retrieve by adding the instance. +var mi = new rpmmi.Mi(ts); +ack("mi.grow(hdrNum)", true); +bingo = 0; +for (var [dbkey,h] in Iterator(mi)) { + ack("h.name", N); + ack("h.nvra", NVRA); + ack("mi.instance == hdrNum", true); + ack("mi.instance == h.dbinstance", true); + delete h; + bingo = 1; +} +ack("bingo", 1); +delete mi; + +// --- Count the install transaction set members. +var mi = new rpmmi.Mi(ts, RPMTAG_INSTALLTID, IID); +bingo = 0; +IIDcount = 0; +for (var [dbkey,h] in Iterator(mi)) { + ++IIDcount; + delete h; + bingo = 1; +} +ack("bingo", 1); +ack("IIDcount", IIDcounts[IID.toString(16)]); +delete mi; + +// --- Print packages that contain "README". +var bn = "README"; +var mi = new rpmmi.Mi(ts, RPMTAG_BASENAMES, null); +ack("mi.growbn(bn)", true); +bingo = 0; +for (var [dbkey,h] in Iterator(mi)) { +// print(h.nvra); + delete h; + bingo = 1; +} +ack("bingo", 1); +delete mi; + +delete ts; + +if (loglvl) print("<-- Mi.js"); diff --git a/rpm-5.4.9/js/tscripts/Mpf.js b/rpm-5.4.9/js/tscripts/Mpf.js new file mode 100644 index 0000000..c1895be --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Mpf.js @@ -0,0 +1,11 @@ +if (loglvl) print("--> Mpf.js"); + +var rpmmpf = require('rpmmpf'); + +var mpf = new rpmmpf.Mpf(); +ack("typeof mpf;", "object"); +ack("mpf instanceof rpmmpf.Mpf;", true); +ack("mpf.debug = 1;", 1); +ack("mpf.debug = 0;", 0); + +if (loglvl) print("<-- Mpf.js"); diff --git a/rpm-5.4.9/js/tscripts/Mpw.js b/rpm-5.4.9/js/tscripts/Mpw.js new file mode 100644 index 0000000..3d49cef --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Mpw.js @@ -0,0 +1,2017 @@ +if (loglvl) print("--> Mpw.js"); + +var rpmmpw = require('rpmmpw'); + +var mpw = new rpmmpw.Mpw(); +ack("typeof mpw;", "object"); +ack("mpw instanceof Mpw;", true); +// ack("mpw.debug = 1;", 1); +// ack("mpw.debug = 0;", 0); + +// ===== Basic tests +var wa = mpw('0000000987654321'); +ack('wa.toString(16)', '0x987654321'); +ack('wa.toString(10)', '40926266145') +ack('wa.toString(8)', '0460731241441') +ack('wa.toString(2)', '2#100110000111011001010100001100100001') + +var wb = mpw(0x10); +ack('wb.toString(16)', '0x10'); +var wc = mpw('fedcba000000000'); +ack('wc.toString(16)', '0xfedcba000000000'); + +var za = 0x0000000007654321; +var wa = mpw(za); +var zb = 0x0000000000000010; +var wb = mpw(zb); +var zc = 0; + +ack('mpw(wa, wb, "+").toString(10)', (za + zb).toString(10)); +ack('mpw(wa, wb, "-").toString(10)', (za - zb).toString(10)); +ack('mpw(wa, wb, "*").toString(10)', (za * zb).toString(10)); +ack('mpw(wa, wb, "/").toString(10)', Math.floor(za / zb).toString(10)); +ack('mpw(wa, wb, "%").toString(10)', (za % zb).toString(10)); +ack('mpw(wa, wb, "**").toString(10)', Math.pow(za, zb).toString(10)); +ack('mpw(wa, wb, "<<").toString(10)', (za << zb).toString(10)); +ack('mpw(wa, wb, ">>").toString(10)', (za >> zb).toString(10)); +ack('mpw(wa, wb, "&").toString(10)', (za & zb).toString(10)); +ack('mpw(wa, wb, "^").toString(10)', (za ^ zb).toString(10)); +ack('mpw(wa, wb, "|").toString(10)', (za | zb).toString(10)); + +// XXX FIXME divide-by-zero exception handling +// var foo = mpw(1, 0, "/"); +// var foo = mpw(1, 0, "%"); + +var m = mpw(15); +ack('m.toString(10)', '15'); +ack('m.isPrime()', false); +ack('m.toString(10)', m.valueOf()); +var x = mpw(7); +ack('x.toString(10)', '7'); +ack('x.toString(10)', x.valueOf()); +var y = mpw(13); +ack('y.toString(10)', '13'); +ack('y.toString(10)', y.valueOf()); + +ack('mpw(x, m, "invm").toString(10)', '13'); +ack('mpw(x, m, "sqrm").toString(10)', '4'); + +ack('mpw(x, y, m, "addm").toString(10)', '5'); +ack('mpw(x, y, m, "subm").toString(10)', '9'); +ack('mpw(x, y, m, "mulm").toString(10)', '1'); +ack('mpw(x, y, m, "powm").toString(10)', '7'); + +var zx = 2*3*5*19; +// zx *= zx; +// zx *= zx; +// FIXME segfault, check gcd scaling for zy +// zx *= zx; +var zy = 7*11*13*19; +ack('mpw(zx, zy, "gcd").toString(10)', '19'); + +ack('mpw(zx, "neg").toString(10)', (-zx).toString(10)); +ack('mpw(zx, "abs").toString(10)', Math.abs(zx).toString(10)); +ack('mpw(zx, "~").toString(10)', (~zx).toString(10)); + +zx = -1.2345678901234567890123456789012345678901234567890123456789e10; +ack('mpw(zx*zx, "sqrt").toString(10)', Math.floor(Math.sqrt(zx*zx)).toString(10)); +zx = -1.2345678901234e10; +ack('mpw(zx*zx, "sqrt").toString(10)', Math.floor(Math.sqrt(zx*zx)).toString(10)); +// for (zx = 0; zx < 1025; zx++) { +// ack('mpw(zx*zx, "sqrt").toString(10)', Math.sqrt(zx*zx).toString(10)); +// } +// for (var i = 0; i < 128; i++) { +// zx = (1 << i) - 1; +// ack('mpw(zx*zx, "sqrt").toString(10)', Math.sqrt(zx*zx).toString(10)); +// } + +// ===== Carry/borrow tests +var a = 0x7fffffff; +wa = mpw(-a, -a, "+"); +var za = (-a) + (-a); +wb = mpw(-1); +var zb = -1; +wc = mpw(1); +var zc = 1; +wd = mpw(a, a, "+"); +var zd = a + a; + +ack('mpw(wa, wa, "+").toString(10)', (za + za).toString(10)); +ack('mpw(wb, wd, "+").toString(10)', (zb + zd).toString(10)); +ack('mpw(wc, wa, "+").toString(10)', (zc + za).toString(10)); +ack('mpw(wd, wd, "+").toString(10)', (zd + zd).toString(10)); + +ack('mpw(wb, wa, "-").toString(10)', (zb - za).toString(10)); +ack('mpw(wc, wd, "-").toString(10)', (zc - zd).toString(10)); + +// ===== Signs +var wpa = mpw(13); +var wma = mpw(-13); +var wpb = mpw(wpa, 3, "-"); +var wmb = mpw(-10); +var zpa = 13; +var zma = -zpa; +var zpb = zpa - 3; +var zmb = -zpb; + +ack('mpw(wma, wmb, "+").toString(10)', (zma + zmb).toString(10)); +ack('mpw(wma, wpb, "+").toString(10)', (zma + zpb).toString(10)); +ack('mpw(wpa, wmb, "+").toString(10)', (zpa + zmb).toString(10)); +ack('mpw(wpa, wpb, "+").toString(10)', (zpa + zpb).toString(10)); + +ack('mpw(wma, wmb, "-").toString(10)', (zma - zmb).toString(10)); +ack('mpw(wma, wpb, "-").toString(10)', (zma - zpb).toString(10)); +ack('mpw(wpa, wmb, "-").toString(10)', (zpa - zmb).toString(10)); +ack('mpw(wpa, wpb, "-").toString(10)', (zpa - zpb).toString(10)); +ack('mpw(wmb, wma, "-").toString(10)', (zmb - zma).toString(10)); +ack('mpw(wmb, wpa, "-").toString(10)', (zmb - zpa).toString(10)); +ack('mpw(wpb, wma, "-").toString(10)', (zpb - zma).toString(10)); +ack('mpw(wpb, wpa, "-").toString(10)', (zpb - zpa).toString(10)); + +ack('mpw(wma, wmb, "*").toString(10)', (zma * zmb).toString(10)); +ack('mpw(wma, wpb, "*").toString(10)', (zma * zpb).toString(10)); +ack('mpw(wpa, wmb, "*").toString(10)', (zpa * zmb).toString(10)); +ack('mpw(wpa, wpb, "*").toString(10)', (zpa * zpb).toString(10)); + +ack('mpw(wma, wmb, "/").toString(10)', Math.floor(zma/zmb).toString(10)); +ack('mpw(wma, wpb, "/").toString(10)', Math.floor(zma/zpb).toString(10)); +ack('mpw(wpa, wmb, "/").toString(10)', Math.floor(zpa/zmb).toString(10)); +ack('mpw(wpa, wpb, "/").toString(10)', Math.floor(zpa/zpb).toString(10)); +ack('mpw(wmb, wma, "/").toString(10)', Math.floor(zmb/zma).toString(10)); +ack('mpw(wmb, wpa, "/").toString(10)', Math.floor(zmb/zpa).toString(10)); +ack('mpw(wpb, wma, "/").toString(10)', Math.floor(zpb/zma).toString(10)); +ack('mpw(wpb, wpa, "/").toString(10)', Math.floor(zpb/zpa).toString(10)); + +ack('mpw(wma, wmb, "**").toString(10)', Math.floor(Math.pow(zma, zmb)).toString(10)); +ack('mpw(wma, wpb, "**").toString(10)', Math.pow(zma, zpb).toString(10)); +ack('mpw(wpa, wmb, "**").toString(10)', Math.floor(Math.pow(zpa, zmb)).toString(10)); +ack('mpw(wpa, wpb, "**").toString(10)', Math.pow(zpa, zpb).toString(10)); +ack('mpw(wmb, wma, "**").toString(10)', Math.floor(Math.abs(Math.pow(zmb, zma))).toString(10)); +ack('mpw(wmb, wpa, "**").toString(10)', Math.pow(zmb, zpa).toString(10)); +ack('mpw(wpb, wma, "**").toString(10)', Math.floor(Math.pow(zpb, zma)).toString(10)); +ack('mpw(wpb, wpa, "**").toString(10)', Math.pow(zpb, zpa).toString(10)); + +ack('mpw(wma, wmb, "%").toString(10)', (zma % zmb).toString(10)); +ack('mpw(wma, wpb, "%").toString(10)', (zma % zpb).toString(10)); +ack('mpw(wpa, wmb, "%").toString(10)', (zpa % zmb).toString(10)); +ack('mpw(wpa, wpb, "%").toString(10)', (zpa % zpb).toString(10)); +ack('mpw(wmb, wma, "%").toString(10)', (zmb % zma).toString(10)); +ack('mpw(wmb, wpa, "%").toString(10)', (zmb % zpa).toString(10)); +ack('mpw(wpb, wma, "%").toString(10)', (zpb % zma).toString(10)); +ack('mpw(wpb, wpa, "%").toString(10)', (zpb % zpa).toString(10)); + +ack('mpw.eq(wma, wma)', zma == zma); +ack('mpw.ne(wma, wma)', zma != zma); +ack('mpw.eq(wma, wpa)', zma == zpa); +ack('mpw.ne(wma, wpa)', zma != zpa); +ack('mpw.eq(wpa, wma)', zpa == zma); +ack('mpw.ne(wpa, wma)', zpa != zma); +ack('mpw.eq(wpa, wpa)', zpa == zpa); +ack('mpw.ne(wpa, wpa)', zpa != zpa); + +ack('mpw.lt(wma, wma)', zma < zma); +ack('mpw.le(wma, wma)', zma <= zma); +ack('mpw.gt(wma, wma)', zma > zma); +ack('mpw.ge(wma, wma)', zma >= zma); +ack('mpw.lt(wma, wpa)', zma < zpa); +ack('mpw.le(wma, wpa)', zma <= zpa); +ack('mpw.gt(wma, wpa)', zma > zpa); +ack('mpw.ge(wma, wpa)', zma >= zpa); +ack('mpw.lt(wpa, wma)', zpa < zma); +ack('mpw.le(wpa, wma)', zpa <= zma); +ack('mpw.gt(wpa, wma)', zpa > zma); +ack('mpw.ge(wpa, wma)', zpa >= zma); +ack('mpw.lt(wpa, wpa)', zpa < zpa); +ack('mpw.le(wpa, wpa)', zpa <= zpa); +ack('mpw.gt(wpa, wpa)', zpa > zpa); +ack('mpw.ge(wpa, wpa)', zpa >= zpa); + +ack('mpw.min(zma, zmb)', Math.min(zma, zmb)); +ack('mpw.min(zma, zpb)', Math.min(zma, zpb)); +ack('mpw.min(zpa, zmb)', Math.min(zpa, zmb)); +ack('mpw.min(zpa, zpb)', Math.min(zpa, zpb)); +ack('mpw.max(zma, zmb)', Math.max(zma, zmb)); +ack('mpw.max(zma, zpb)', Math.max(zma, zpb)); +ack('mpw.max(zpa, zmb)', Math.max(zpa, zmb)); +ack('mpw.max(zpa, zpb)', Math.max(zpa, zpb)); + +var za = 5; +var zb = 3; +// FIXME +// ack('mpw(+za, 0, "%").toString(10)', za.toString(10)); +ack('mpw(+5, +3, "%").toString(10)', '2'); +ack('mpw(+5, -3, "%").toString(10)', '-1'); +ack('mpw(-5, +3, "%").toString(10)', '1'); +ack('mpw(-5, -3, "%").toString(10)', '-2'); +function mathmod(x, y) { return (x - y * Math.floor(x/y)); } +ack('mpw(+za, +zb, "%").toString(10)', mathmod(+za, +zb).toString(10)); +ack('mpw(+za, -zb, "%").toString(10)', mathmod(+za, -zb).toString(10)); +ack('mpw(-za, +zb, "%").toString(10)', mathmod(-za, +zb).toString(10)); +ack('mpw(-za, -zb, "%").toString(10)', mathmod(-za, -zb).toString(10)); + +ack('mpw(+za, +zb, "%").toString(10)', (+za % +zb).toString(10)); +ack('mpw(+za, -zb, "%").toString(10)', (+za % -zb).toString(10)); +ack('mpw(-za, +zb, "%").toString(10)', (-za % +zb).toString(10)); +ack('mpw(-za, -zb, "%").toString(10)', (-za % -zb).toString(10)); + +// ===== Knuth poly +var lo = 2; +var hi = 10; +// var bases = [8, 10, 16]; +var bases = [13]; + +for (var i in bases) { + var t = bases[i]; + var tm1 = (t - 1); + var tm2 = (t - 2); + print("=====\t("+t+"**m - 1) * ("+t+"**n - 1), m,n in ["+lo+","+hi+")"); + for (var m = lo; m < hi; m++) { + wb = mpw(t, m, "**", 1, "-"); + for (var n = m+1; n < hi+1; n++) { + wc = mpw(t, n, "**", 1, "-"); + wa = mpw(wb, wc, "*"); +// print(wa.toString(t)); + switch (t) { + case 8: zs = '0'; break; + case 10: zs = ''; break; + case 16: zs = '0x'; break; + default: zs = t.toString(10) + "#"; break; + } + for (var j = 0; j < (m - 1); j++) zs += (t - 1).toString(t); + zs += (t - 2).toString(t); + for (var j = 0; j < (n - m); j++) zs += (t - 1).toString(t); + for (var j = 0; j < (m - 1); j++) zs += "0"; + zs += "1"; +// print(zs); + ack('wa.toString(t)', zs); + } + } +} + +// ======================================================= +function RSA(p, q, e) { + this.p = mpw(p); + ack('mpw(p).isPrime()', true); + this.pm1 = mpw(this.p, 1, "-"); + this.q = mpw(q); + ack('mpw(q).isPrime()', true); + this.qm1 = mpw(this.q, 1, "-"); + this.e = mpw(e); + + this.n = mpw(this.p, this.q, "*"); + this.phi = mpw(this.pm1, this.qm1, "*"); +// ack('mpw(this.e, this.phi, "gcd").toString(10)', '1'); + this.d = mpw(this.e, this.phi, "invm"); +// ack('mpw(this.e, this.d, "*", this.phi, "%").toString(10)', '1'); + + this.sign = + function (hm) { + this.hm = mpw(hm); + this.s = mpw(this.hm, this.d, this.n, "powm"); + return this.s; + }; + this.verify = + function (hm, s) { + return (mpw(s, this.e, this.n, "powm").toString(10) == hm.toString(10) + ? true : false); + } + return true; +} + +function RSAv21(p, q, d, e, dP, dQ, qInv) { + this.p = mpw(p); + ack('mpw(p).isPrime()', true); + this.pm1 = mpw(this.p, 1, "-"); + this.q = mpw(q); + ack('mpw(q).isPrime()', true); + this.qm1 = mpw(this.q, 1, "-"); + this.d = mpw(d); + this.e = mpw(e); + + this.n = mpw(this.p, this.q, "*"); + this.lambda = mpw(this.p, 1, "-", this.q, 1, "-", "*"); +// ack('mpw(this.n, this.lambda, "gcd").toString(10)', '1'); +// ack('mpw(this.e, this.lambda, "gcd").toString(10)', '1'); + +// this.d = mpw(this.e, this.lambda, "invm"); +// ack('mpw(this.e, this.lambda, "invm").toString(16)', d.toString(16)); + +// ack('mpw(this.e, this.d, this.lambda, "mulm").toString(10)', '1'); + + this.dP = mpw(this.e, this.p, 1, "-", "invm"); + ack('mpw(this.e, this.p, 1, "-", "invm").toString(16)', dP.toString(16)); + ack('mpw(this.e, this.dP, this.p, 1, "-", "mulm").toString(10)', '1'); + ack('mpw(this.e, this.dP, "*", this.p, 1, "-", "%").toString(10)', '1'); + + this.dQ = mpw(this.e, this.q, 1, "-", "invm"); + ack('mpw(this.e, this.q, 1, "-", "invm").toString(16)', dQ.toString(16)); + ack('mpw(this.e, this.dQ, this.q, 1, "-", "mulm").toString(10)', '1'); + ack('mpw(this.e, this.dQ, "*", this.q, 1, "-", "%").toString(10)', '1'); + + this.qInv = mpw(this.q, this.p, "invm"); + ack('this.qInv.toString(16)', qInv.toString(16)); + ack('mpw(this.q, this.qInv, this.p, "mulm").toString(10)', '1'); + + this.sign = + function (hm) { + this.hm = mpw(hm); + this.s = mpw(this.hm, this.d, this.n, "powm"); + return this.s; + }; + this.verify = + function (hm, s) { + return (mpw(s, this.e, this.n, "powm").toString(10) == hm.toString(10) + ? true : false); + } + return this; +} + +// ===== RSA example (from "Handbook of Applied Cryptography" 11.20 p434). +var p = 7927; +var q = 6997; +var n = 55465219; +ack('p * q', n); +var e = 5; +var phi = 55450296; +ack('(p - 1) * (q - 1)', phi); +var d = 44360237; +var hm = 31229978; +var s = 30729435; + +print("===== RSA"); +var rsa = new RSA(p, q, e); + +ack('rsa.verify(hm, rsa.sign(hm))', true); + +ack('rsa.p.toString(10)', p.toString(10)); +ack('rsa.q.toString(10)', q.toString(10)); +ack('rsa.n.toString(10)', n.toString(10)); +ack('rsa.e.toString(10)', e.toString(10)); +ack('rsa.phi.toString(10)', phi.toString(10)); +ack('rsa.d.toString(10)', d.toString(10)); +ack('rsa.hm.toString(10)', hm.toString(10)); +ack('rsa.s.toString(10)', s.toString(10)); + +// ====== RSA using PKCS #1 v1.5 examples from +// http://www.wigiwigi.com/index.php?title=RSA_in_32bits + +// ===== Encryption +rsa.n = mpw( + 'a9e167983f39d55ff2a093415ea6798985c8355d9a915bfb1d01da197026170f'+ + 'bda522d035856d7a986614415ccfb7b7083b09c991b81969376df9651e7bd9a9'+ + '3324a37f3bbbaf460186363432cb07035952fc858b3104b8cc18081448e64f1c'+ + 'fb5d60c4e05c1f53d37f53d86901f105f87a70d1be83c65f38cf1c2caa6aa7eb'); +rsa.e = 0x10001; +rsa.d = mpw( + '67cd484c9a0d8f98c21b65ff22839c6df0a6061dbceda7038894f21c6b0f8b35'+ + 'de0e827830cbe7ba6a56ad77c6eb517970790aa0f4fe45e0a9b2f419da8798d6'+ + '308474e4fc596cc1c677dca991d07c30a0a2c5085e217143fc0d073df0fa6d14'+ + '9e4e63f01758791c4b981c3d3db01bdffa253ba3c02c9805f61009d887db0319'); + +var PS = '257f48fd1f1793b7e5e02306f2d3228f5c95adf5f31566729f132aa12009'+ + 'e3fc9b2b475cd6944ef191e3f59545e671e474b555799fe3756099f044964038'+ + 'b16b2148e9a2f9c6f44bb5c52e3c6c8061cf694145fafdb24402ad1819eacedf'+ + '4a36c6e4d2cd8fc1d62e5a1268f496'; +var D = '4e636af98e40f3adcfccb698f4e80b9f'; + +// em = 00 || 02 || PS || 00 || D +var em = mpw('00' + '02' + PS + '00' + D); +var c = mpw( + '3d2ab25b1eb667a40f504cc4d778ec399a899c8790edecef062cd739492c9ce5'+ + '8b92b9ecf32af4aac7a61eaec346449891f49a722378e008eff0b0a8dbc6e621'+ + 'edc90cec64cf34c640f5b36c48ee9322808af8f4a0212b28715c76f3cb99ac7e'+ + '609787adce055839829e0142c44b676d218111ffe69f9d41424e177cba3a435b'); + +ack('mpw(em, rsa.e, rsa.n, "powm").toString(16)', c.toString(16)); +ack('mpw( c, rsa.d, rsa.n, "powm").toString(16)', em.toString(16)); + +// ===== Signing +rsa.n = mpw( + 'E08973398DD8F5F5E88776397F4EB005BB5383DE0FB7ABDC7DC775290D052E6D'+ + '12DFA68626D4D26FAA5829FC97ECFA82510F3080BEB1509E4644F12CBBD832CF'+ + 'C6686F07D9B060ACBEEE34096A13F5F7050593DF5EBA3556D961FF197FC981E6'+ + 'F86CEA874070EFAC6D2C749F2DFA553AB9997702A648528C4EF357385774575F'); +rsa.e = 0x10001; +rsa.d = mpw( + '00A403C327477634346CA686B57949014B2E8AD2C862B2C7D748096A8B91F736'+ + 'F275D6E8CD15906027314735644D95CD6763CEB49F56AC2F376E1CEE0EBF282D'+ + 'F439906F34D86E085BD5656AD841F313D72D395EFE33CBFF29E4030B3D05A28F'+ + 'B7F18EA27637B07957D32F2BDE8706227D04665EC91BAF8B1AC3EC9144AB7F21'); + +var M = 'abc'; +var PS = 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'+ + 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'+ + 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'; +var asn1 = '3021300906052B0E03021A05000414'; +var hm = 'A9993E364706816ABA3E25717850C26C9CD0D89D'; +var T = asn1 + hm; + +// eb = 00 || 01 || PS || 00 || T +var eb = mpw('00' + '01' + PS + '00' + T); +var c = mpw( + '60AD5A78FB4A4030EC542C8974CD15F55384E836554CEDD9A322D5F4135C6267'+ + 'A9D20970C54E6651070B0144D43844C899320DD8FA7819F7EBC6A7715287332E'+ + 'C8675C136183B3F8A1F81EF969418267130A756FDBB2C71D9A667446E34E0EAD'+ + '9CF31BFB66F816F319D0B7E430A5F2891553986E003720261C7E9022C0D9F11F'); + +ack('mpw(eb, rsa.d, rsa.n, "powm").toString(16)', c.toString(16)); +ack('mpw( c, rsa.e, rsa.n, "powm").toString(16)', eb.toString(16)); + +delete rsa; + +// ===== RSAES-OAEP examples from +// ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1-vec.zip +// var n = mpw( +// 'a8b3b284af8eb50b387034a860f146c4919f318763cd6c5598c8ae4811a1e0ab'+ +// 'c4c7e0b082d693a5e7fced675cf4668512772c0cbc64a742c6c630f533c8cc72'+ +// 'f62ae833c40bf25842e984bb78bdbf97c0107d55bdb662f5c4e0fab9845cb514'+ +// '8ef7392dd3aaff93ae1e6b667bb3d4247616d4f5ba10d4cfd226de88d39f16fb'); +// var e = 0x10001; +// var d = mpw( +// '53339cfdb79fc8466a655c7316aca85c55fd8f6dd898fdaf119517ef4f52e8fd'+ +// '8e258df93fee180fa0e4ab29693cd83b152a553d4ac4d1812b8b9fa5af0e7f55'+ +// 'fe7304df41570926f3311f15c4d65a732c483116ee3d3d2d0af3549ad9bf7cbf'+ +// 'b78ad884f84d5beb04724dc7369b31def37d0cf539e9cfcdd3de653729ead5d1'); +// var p = mpw( +// 'd32737e7267ffe1341b2d5c0d150a81b586fb3132bed2f8d5262864a9cb9f30a'+ +// 'f38be448598d413a172efb802c21acf1c11c520c2f26a471dcad212eac7ca39d'); +// var q = mpw( +// 'cc8853d1d54da630fac004f471f281c7b8982d8224a490edbeb33d3e3d5cc93c'+ +// '4765703d1dd791642f1f116a0dd852be2419b2af72bfe9a030e860b0288b5d77'); +// var dP = mpw( +// '0e12bf1718e9cef5599ba1c3882fe8046a90874eefce8f2ccc20e4f2741fb0a3'+ +// '3a3848aec9c9305fbecbd2d76819967d4671acc6431e4037968db37878e695c1'); +// var dQ = mpw( +// '95297b0f95a2fa67d00707d609dfd4fc05c89dafc2ef6d6ea55bec771ea33373'+ +// '4d9251e79082ecda866efef13c459e1a631386b7e354c899f5f112ca85d71583'); +// var qInv = mpw( +// '4f456c502493bdc0ed2ab756a3a6ed4d67352a697d4216e93212b127a63d5411'+ +// 'ce6fa98d5dbefd73263e3728142743818166ed7dd63687dd2a8ca1d2f4fbd8e1'); +// var m = mpw('6628194e12073db03ba94cda9ef9532397d50dba79b987004afefe34'); +// var h = mpw('8176326046e571e18464d875262420772782ac3a'); +// var seed = mpw('18b776ea21069d69776a33e96bad48e1dda0a5ef'); +// var s = mpw( +// '354fe67b4a126d5d35fe36c777791a3f7ba13def484e2d3908aff722fad468fb'+ +// '21696de95d0be911c2d3174f8afcc201035f7b6d8e69402de5451618c21a535f'+ +// 'a9d7bfc5b8dd9fc243f8cf927db31322d6e881eaa91a996170e657a05a266426'+ +// 'd98c88003f8477c1227094a0d9fa1e8c4024309ce1ecccb5210035d47ac72e8a'); + +//================= +var n = mpw( + 'bbf82f090682ce9c2338ac2b9da871f7368d07eed41043a440d6b6f07454f51f'+ + 'b8dfbaaf035c02ab61ea48ceeb6fcd4876ed520d60e1ec4619719d8a5b8b807f'+ + 'afb8e0a3dfc737723ee6b4b7d93a2584ee6a649d060953748834b2454598394e'+ + 'e0aab12d7b61a51f527a9a41f6c1687fe2537298ca2a8f5946f8e5fd091dbdcb'); +var e = 0x11; +var d = mpw( + 'a5dafc5341faf289c4b988db30c1cdf83f31251e0668b42784813801579641b2'+ + '9410b3c7998d6bc465745e5c392669d6870da2c082a939e37fdcb82ec93edac9'+ + '7ff3ad5950accfbc111c76f1a9529444e56aaf68c56c092cd38dc3bef5d20a93'+ + '9926ed4f74a13eddfbe1a1cecc4894af9428c2b7b8883fe4463a4bc85b1cb3c1'); +var p = mpw( + 'eecfae81b1b9b3c908810b10a1b5600199eb9f44aef4fda493b81a9e3d84f632'+ + '124ef0236e5d1e3b7e28fae7aa040a2d5b252176459d1f397541ba2a58fb6599'); +var q = mpw( + 'c97fb1f027f453f6341233eaaad1d9353f6c42d08866b1d05a0f2035028b9d86'+ + '9840b41666b42e92ea0da3b43204b5cfce3352524d0416a5a441e700af461503'); +var dP = mpw( + '54494ca63eba0337e4e24023fcd69a5aeb07dddc0183a4d0ac9b54b051f2b13e'+ + 'd9490975eab77414ff59c1f7692e9a2e202b38fc910a474174adc93c1f67c981'); +var dQ = mpw( + '471e0290ff0af0750351b7f878864ca961adbd3a8a7e991c5c0556a94c3146a7'+ + 'f9803f8f6f8ae342e931fd8ae47a220d1b99a495849807fe39f9245a9836da3d'); +var qInv = mpw( + 'b06c4fdabb6301198d265bdbae9423b380f271f73453885093077fcd39e2119f'+ + 'c98632154f5883b167a967bf402b4e9e2e0f9656e698ea3666edfb25798039f7'); +var msg = mpw('d436e99569fd32a7c8a05bbc90d32c49'); +var lhash = mpw('da39a3ee5e6b4b0d3255bfef95601890afd80709'); +var db = mpw( + 'da39a3ee5e6b4b0d3255bfef95601890afd80709000000000000000000000000'+ + '0000000000000000000000000000000000000000000000000000000000000000'+ + '000000000000000000000000000000000000000000000000000001d436e99569'+ + 'fd32a7c8a05bbc90d32c49'); +var seed = mpw('aafd12f659cae63489b479e5076ddec2f06cb58f'); + +var em = mpw( + '00eb7a19ace9e3006350e329504b45e2ca82310b26dcd87d5c68f1eea8f55267'+ + 'c31b2e8bb4251f84d7e0b2c04626f5aff93edcfb25c9c2b3ff8ae10e839a2ddb'+ + '4cdcfe4ff47728b4a1b7c1362baad29ab48d2869d5024121435811591be392f9'+ + '82fb3e87d095aeb40448db972f3ac14f7bc275195281ce32d2f1b76d4d353e2d'); +var c = mpw( + '1253e04dc0a5397bb44a7ab87e9bf2a039a33d1e996fc82a94ccd30074c95df7'+ + '63722017069e5268da5d1c0b4f872cf653c11df82314a67968dfeae28def04bb'+ + '6d84b1c31d654a1970e5783bd6eb96a024c2ca2f4a90fe9f2ef5c9c140e5bb48'+ + 'da9536ad8700c84fc9130adea74e558d51a74ddf85d8b50de96838d6063e0955'); +var cmodp = mpw( + 'de63d4723566faa759bfe408821dd52572ec92854ddf87a2b664d44daa37ca34'+ + '6a05203d82ff2de8e36cec1d34f98eb605e2a7d26de7af369ce4ecae14e35633'); +var cmodq = mpw( + 'a2d924ded9c36d623ed9a65b5d862cfbec8b199c64279c5414e641196ef1c93c'+ + '507a9b5213881aad05b4ccfa028ac1ec61420974bf1625836b0b7d05fbb75336'); +var m1 = mpw( + '896ca26cd7e4871c7fc968a8edea11e271824f0e0365521794f1e9e943b4a44b'+ + '57c9e395a1467478f526496b4bb91f1cbaea900ffc602cf0c6636eba84fc9ff7'); +var m2 = mpw( + '4ebb227585f0c1312dca19e0b541db1499fbf14e270e698e239a8c27a96cda9a'+ + '740974de937b5c9c93ead9462c6575021a23d46499dc9f6b35897559608f19be'); +var h = mpw( + '012b2b24150e76e159bd8ddb4276e07bfac188e08d6047cf0efb8ae2aebdf251'+ + 'c40ebc23dcfd4a34424394ada92cfcbe1b2effbb60fdfb03359a95368d980925'); +var m = mpw( + '00eb7a19ace9e3006350e329504b45e2ca82310b26dcd87d5c68f1eea8f55267'+ + 'c31b2e8bb4251f84d7e0b2c04626f5aff93edcfb25c9c2b3ff8ae10e839a2ddb'+ + '4cdcfe4ff47728b4a1b7c1362baad29ab48d2869d5024121435811591be392f9'+ + '82fb3e87d095aeb40448db972f3ac14f7bc275195281ce32d2f1b76d4d353e2d'); + +print("===== RSAES-OAEP"); +var rsa = new RSA(p, q, e); +ack('rsa.n.toString(16)', n.toString(16)); +ack('rsa.e.toString(10)', e.toString(10)); +ack('rsa.d.toString(16)', d.toString(16)); +ack('rsa.p.toString(16)', p.toString(16)); +ack('rsa.q.toString(16)', q.toString(16)); + +ack('mpw(em, rsa.e, rsa.n, "powm").toString(16)', c.toString(16)); +ack('mpw( c, rsa.d, rsa.n, "powm").toString(16)', em.toString(16)); + +ack('mpw(c, rsa.p, "%").toString(16)', cmodp.toString(16)); +ack('mpw(c, rsa.q, "%").toString(16)', cmodq.toString(16)); + +// ack('mpw(c, rsa.dP, rsa.p, "powm").toString(16)', m1.toString(16)); +// ack('mpw(cmodp, rsa.dP, rsa.p, "powm").toString(16)', m1.toString(16)); +// ack('mpw(c, rsa.dQ, rsa.q, "powm").toString(16)', m2.toString(16)); +// ack('mpw(cmodq, rsa.dQ, rsa.q, "powm").toString(16)', m2.toString(16)); + +// ack('mpw(m1, m2, "-", rsa.qInv, "*", rsa.p, "%").toString(16)', h.toString(16)); + +ack('mpw(m2, rsa.q, h, "*", "+").toString(16)', em.toString(16)); + +delete rsa; + +print("===== RSAES-OAEP 2.1"); +var rsa = new RSAv21(p, q, d, e, dP, dQ, qInv); + +ack('rsa.n.toString(16)', n.toString(16)); +ack('rsa.e.toString(10)', e.toString(10)); +ack('rsa.d.toString(16)', d.toString(16)); +ack('rsa.p.toString(16)', p.toString(16)); +ack('rsa.q.toString(16)', q.toString(16)); + +ack('rsa.dP.toString(16)', dP.toString(16)); +ack('rsa.dQ.toString(16)', dQ.toString(16)); +ack('rsa.qInv.toString(16)', qInv.toString(16)); + +// ack('rsa.verify(hm, rsa.sign(hm))', true); +ack('mpw(em, rsa.e, rsa.n, "powm").toString(16)', c.toString(16)); +ack('mpw( c, rsa.d, rsa.n, "powm").toString(16)', em.toString(16)); + +// ack('rsa.phi.toString(10)', phi.toString(10)); +// ack('rsa.hm.toString(10)', hm.toString(10)); +// ack('rsa.s.toString(10)', s.toString(10)); + +delete rsa; + +// ===== RSASSA-PSS example from +// ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1-vec.zip +// var n = mpw( +// 'a56e4a0e701017589a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991'+ +// 'd8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1df'+ +// 'd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f1'+ +// '05acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137'); +// var e = 0x10001; +// var d = mpw( +// '33a5042a90b27d4f5451ca9bbbd0b44771a101af884340aef9885f2a4bbe92e8'+ +// '94a724ac3c568c8f97853ad07c0266c8c6a3ca0929f1e8f11231884429fc4d9a'+ +// 'e55fee896a10ce707c3ed7e734e44727a39574501a532683109c2abacaba283c'+ +// '31b4bd2f53c3ee37e352cee34f9e503bd80c0622ad79c6dcee883547c6a3b325'); +// var p = mpw( +// 'e7e8942720a877517273a356053ea2a1bc0c94aa72d55c6e86296b2dfc967948'+ +// 'c0a72cbccca7eacb35706e09a1df55a1535bd9b3cc34160b3b6dcd3eda8e6443'); +// var q = mpw( +// 'b69dca1cf7d4d7ec81e75b90fcca874abcde123fd2700180aa90479b6e48de8d'+ +// '67ed24f9f19d85ba275874f542cd20dc723e6963364a1f9425452b269a6799fd'); +// var dP = mpw( +// '28fa13938655be1f8a159cbaca5a72ea190c30089e19cd274a556f36c4f6e19f'+ +// '554b34c077790427bbdd8dd3ede2448328f385d81b30e8e43b2fffa027861979'); +// var dQ = mpw( +// '1a8b38f398fa712049898d7fb79ee0a77668791299cdfa09efc0e507acb21ed7'+ +// '4301ef5bfd48be455eaeb6e1678255827580a8e4e8e14151d1510a82a3f2e729'); +// var qInv = mpw( +// '27156aba4126d24a81f3a528cbfb27f56886f840a9f6e86e17a44b94fe931958'+ +// '4b8e22fdde1e5a2e3bd8aa5ba8d8584194eb2190acf832b847f13a3d24a79f4d'); +// var hm = 31229978; +// var s = mpw( +// '9074308fb598e9701b2294388e52f971faac2b60a5145af185df5287b5ed2887'+ +// 'e57ce7fd44dc8634e407c8e0e4360bc226f3ec227f9d9e54638e8d31f5051215'+ +// 'df6ebb9c2f9579aa77598a38f914b5b9c1bd83c4e2f9f382a0d0aa3542ffee65'+ +// '984a601bc69eb28deb27dca12c82c2d4c3f66cd500f1ff2b994d8a4e30cbb33c'); + +//================= +var n = mpw( + 'a2ba40ee07e3b2bd2f02ce227f36a195024486e49c19cb41bbbdfbba98b22b0e'+ + '577c2eeaffa20d883a76e65e394c69d4b3c05a1e8fadda27edb2a42bc000fe88'+ + '8b9b32c22d15add0cd76b3e7936e19955b220dd17d4ea904b1ec102b2e4de775'+ + '1222aa99151024c7cb41cc5ea21d00eeb41f7c800834d2c6e06bce3bce7ea9a5'); +var e = 0x10001; +var d = mpw( + '50e2c3e38d886110288dfc68a9533e7e12e27d2aa56d2cdb3fb6efa990bcff29'+ + 'e1d2987fb711962860e7391b1ce01ebadb9e812d2fbdfaf25df4ae26110a6d7a'+ + '26f0b810f54875e17dd5c9fb6d641761245b81e79f8c88f0e55a6dcd5f133abd'+ + '35f8f4ec80adf1bf86277a582894cb6ebcd2162f1c7534f1f4947b129151b71'); +var p = mpw( + 'd17f655bf27c8b16d35462c905cc04a26f37e2a67fa9c0ce0dced472394a0df7'+ + '43fe7f929e378efdb368eddff453cf007af6d948e0ade757371f8a711e278f6b'); +var q = mpw( + 'c6d92b6fee7414d1358ce1546fb62987530b90bd15e0f14963a5e2635adb6934'+ + '7ec0c01b2ab1763fd8ac1a592fb22757463a982425bb97a3a437c5bf86d03f2f'); +var dP = mpw( + '9d0dbf83e5ce9e4b1754dcd5cd05bcb7b55f1508330ea49f14d4e889550f8256'+ + 'cb5f806dff34b17ada44208853577d08e4262890acf752461cea05547601bc4f'); +var dQ = mpw( + '1291a524c6b7c059e90e46dc83b2171eb3fa98818fd179b6c8bf6cecaa476303'+ + 'abf283fe05769cfc495788fe5b1ddfde9e884a3cd5e936b7e955ebf97eb563b1'); +var qInv = mpw( + 'a63f1da38b950c9ad1c67ce0d677ec2914cd7d40062df42a67eb198a176f9742'+ + 'aac7c5fea14f2297662b84812c4defc49a8025ab4382286be4c03788dd01d69f'); +var msg = mpw( + '859eef2fd78aca00308bdc471193bf55bf9d78db8f8a672b484634f3c9c26e64'+ + '78ae10260fe0dd8c082e53a5293af2173cd50c6d5d354febf78b26021c25c027'+ + '12e78cd4694c9f469777e451e7f8e9e04cd3739c6bbfedae487fb55644e9ca74'+ + 'ff77a53cb729802f6ed4a5ffa8ba159890fc'); +var mhash = mpw('37b66ae0445843353d47ecb0b4fd14c110e62d6a'); +var salt = mpw('e3b5d5d002c1bce50c2b65ef88a188d83bce7e61'); +var em = mpw( + '66e4672e836ad121ba244bed6576b867d9a447c28a6e66a5b87dee7fbc7e65af'+ + '5057f86fae8984d9ba7f969ad6fe02a4d75f7445fefdd85b6d3a477c28d24ba1'+ + 'e3756f792dd1dce8ca94440ecb5279ecd3183a311fc896da1cb39311af37ea4a'+ + '75e24bdbfd5c1da0de7cecdf1a896f9d8bc816d97cd7a2c43bad546fbe8cfebc'); +var c = mpw( + '8daa627d3de7595d63056c7ec659e54406f10610128baae821c8b2a0f3936d54'+ + 'dc3bdce46689f6b7951bb18e840542769718d5715d210d85efbb596192032c42'+ + 'be4c29972c856275eb6d5a45f05f51876fc6743deddd28caec9bb30ea99e02c3'+ + '488269604fe497f74ccd7c7fca1671897123cbd30def5d54a2b5536ad90a747e'); +var cmodp = mpw( + '3e4f9f1d6075fe401607694fee634b4115d42d06d6d627987204610da92a8e1a'+ + '2056fb78fe627fea87e6622eb6fa0461e398153ed978e56add8df1f5a6c31c19'); +var cmodq = mpw( + '25710bf7a5d3c479bc36e783b2be445281d0c7ac5c3a9fcacd94f45e7a183c55'+ + '2d931040c6f7b3bcd1a0e43ae22322dfe71e1b3af7cab021f6915178f9744199'); + +print("===== RSASSA-PSS"); +var rsa = new RSA(p, q, e); +ack('rsa.n.toString(16)', n.toString(16)); +ack('rsa.e.toString(10)', e.toString(10)); +ack('rsa.d.toString(16)', d.toString(16)); +ack('rsa.p.toString(16)', p.toString(16)); +ack('rsa.q.toString(16)', q.toString(16)); + +// ack('rsa.verify(hm, rsa.sign(hm))', true); +ack('mpw(em, rsa.d, rsa.n, "powm").toString(16)', c.toString(16)); +ack('mpw( c, rsa.e, rsa.n, "powm").toString(16)', em.toString(16)); + +ack('mpw(c, rsa.p, "%").toString(16)', cmodp.toString(16)); +ack('mpw(c, rsa.q, "%").toString(16)', cmodq.toString(16)); + +delete rsa; + +print("===== RSASSA-PSS 2.1"); +var rsa = new RSAv21(p, q, d, e, dP, dQ, qInv); + +ack('rsa.n.toString(16)', n.toString(16)); +ack('rsa.e.toString(10)', e.toString(10)); +ack('rsa.d.toString(16)', d.toString(16)); +ack('rsa.p.toString(16)', p.toString(16)); +ack('rsa.q.toString(16)', q.toString(16)); +ack('rsa.dP.toString(16)', dP.toString(16)); +ack('rsa.dQ.toString(16)', dQ.toString(16)); +ack('rsa.qInv.toString(16)', qInv.toString(16)); + +// ack('rsa.verify(hm, rsa.sign(hm))', true); +ack('mpw(em, rsa.d, rsa.n, "powm").toString(16)', c.toString(16)); +ack('mpw( c, rsa.e, rsa.n, "powm").toString(16)', em.toString(16)); + +ack('mpw(c, rsa.p, "%").toString(16)', cmodp.toString(16)); +ack('mpw(c, rsa.q, "%").toString(16)', cmodq.toString(16)); + +delete rsa; + +// ======================================================= +function ElGamal(p, alpha, a, k) { + this.p = mpw(p); + ack('mpw(p).isPrime()', true); + this.pm1 = mpw(p, 1, "-"); + this.alpha = mpw(alpha); + this.a = mpw(a); + this.k = mpw(k); + + this.y = mpw(this.alpha, this.a, this.p, "powm"); + + this.sign = + function (hm) { + this.hm = mpw(hm); + this.r = mpw(this.alpha, this.k, this.p, "powm"); + this.kinv = mpw(this.k, this.pm1, "invm"); +// ack('mpw(this.k, this.kinv, this.pm1, "mulm").toString(10)', '1'); + this.s = mpw(this.hm, this.a, this.r, this.pm1, "mulm", this.pm1, "subm", this.kinv, this.pm1, "mulm"); + return true; + }; + + this.verify = + function (hm) { + this.hm = mpw(hm); + this.v1 = mpw(this.y, this.r, this.p, "powm", this.r, this.s, this.p, "powm", this.p, "mulm"); + this.v2 = mpw(this.alpha, this.hm, this.p, "powm"); + return (elgamal.v2.toString(10) == elgamal.v1.toString(10) + ? true : false); + } + + return this; +} + +// ===== ElGamal example (from "Handbook of Applied Cryptography" 11.65 p455). +// Keygen ElGamal +print("===== ElGamal"); +var p = 2357; +var alpha = 2; +var a = 1751; +var y = 1185; +var hm = 1463; +var k = 1529; +var r = 1490; +var s = 1777; +var v1 = 1072; + +var pm1 = p - 1; + +var elgamal = new ElGamal(p, alpha, a, k); +ack('elgamal.p.toString(10)', p.toString(10)); +ack('elgamal.alpha.toString(10)', alpha.toString(10)); +ack('elgamal.a.toString(10)', a.toString(10)); +ack('elgamal.k.toString(10)', k.toString(10)); +ack('elgamal.y.toString(10)', y.toString(10)); + +ack('elgamal.sign(hm)', true); +ack('elgamal.r.toString(10)', r.toString(10)); +var kinv = mpw(k, pm1, "invm"); +ack('elgamal.kinv.toString(10)', kinv.toString(10)); +ack('elgamal.s.toString(10)', s.toString(10)); + +ack('elgamal.verify(hm)', true); +ack('elgamal.v1.toString(10)', v1.toString(10)); +ack('elgamal.v2.toString(10)', v1.toString(10)); + +delete elgamal; + +// ======================================================= +function DSA(p, q, g) { + this.p = mpw(p); + ack('mpw(p).isPrime()', true); + this.q = mpw(q); + ack('mpw(q).isPrime()', true); + this.g = mpw(g); + +// ack('mpw(this.p, 1, "-", this.q, "%").toString(10)', '0'); +// this.pdivq = mpw(this.p, 1, "-", this.q, "/"); +// this.alpha = mpw(this.g, this.pdivq, this.p, "powm"); + +// this.x = mpw(this.c, this.q, 1, "-", "%", 1, "+"); +// ack('mpw(this.c, this.q, 1, "-", "%", 1, "+").toString(16)', this.x.toString(16)); +// this.y = mpw(this.alpha, this.a, this.p, "powm"); +// ack('mpw(this.g, this.x, this.p, "powm").toString(16)', this.y.toString(16)); + + this.sign = + function (hm) { + this.hm = mpw(hm); +// this.k = this.q.randomK(); +// this.kinv = mpw(this.k, this.q, "invm"); + ack('mpw(this.k, this.kinv, this.q, "mulm").toString(10)', '1'); + this.r = mpw(this.g, this.k, this.p, "powm", this.q, "%"); + this.s = mpw(this.x, this.r, this.q, "mulm", this.hm, this.q, "addm", this.kinv, this.q, "mulm"); + return true; + }; + + this.verify = + function (hm) { + this.hm = mpw(hm); + this.w = mpw(this.s, this.q, "invm"); + this.u1 = mpw(this.w, this.hm, this.q, "mulm"); + this.u2 = mpw(this.r, this.w, this.q, "mulm"); + this.v1 = mpw(this.g, this.u1, this.p, "powm"); + this.v2 = mpw(this.y, this.u2, this.p, "powm"); + this.v = mpw(this.v1, this.v2, this.p, "mulm", this.q, "%"); + + return (this.v.toString(10) == this.r.toString(10) + ? true : false); + } + return this; +} + +// ===== DSA example (from "Handbook of Applied Cryptography" 11.57 p453). +// print("===== DSA"); +// var p = 124540019; +// var q = 17389; +// var g = 110217528; +// var a = 12496; +// var pdivq = 7162; +// var alpha = 10083255; +// var y = 119946265; + +// var hm = 5246; +// var k = 9557; +// var r = 34; +// var kinv = 7631; +// var s = 13049; + +// var w = 1799; +// var u1 = 12716; +// var u2 = 8999; +// var v = 27039929; + +// var dsa = new DSA(p, q, g, a, k); + +// ack('dsa.p.toString(10)', p.toString(10)); +// ack('dsa.q.toString(10)', q.toString(10)); +// ack('dsa.g.toString(10)', g.toString(10)); +// ack('dsa.a.toString(10)', a.toString(10)); +// ack('dsa.k.toString(10)', k.toString(10)); +// ack('dsa.pdivq.toString(10)', pdivq.toString(10)); +// ack('dsa.alpha.toString(10)', alpha.toString(10)); +// ack('dsa.y.toString(10)', y.toString(10)); + +// ack('dsa.sign(hm)', true); +// ack('dsa.hm.toString(10)', hm.toString(10)); +// ack('dsa.r.toString(10)', r.toString(10)); +// ack('dsa.kinv.toString(10)', kinv.toString(10)); +// ack('dsa.s.toString(10)', s.toString(10)); + +// ack('dsa.verify(hm)', true); +// ack('dsa.w.toString(10)', w.toString(10)); +// ack('dsa.u1.toString(10)', u1.toString(10)); +// ack('dsa.u2.toString(10)', u2.toString(10)); +// ack('dsa.v.toString(10)', v.toString(10)); + +// delete dsa; + +// ===== DSA example from +// http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/DSA2_All.pdf +print("===== DSA"); +var p = mpw('e0a67598cd1b763b'+ + 'c98c8abb333e5dda0cd3aa0e5e1fb5ba8a7b4eabc10ba338'+ + 'fae06dd4b90fda70d7cf0cb0c638be3341bec0af8a7330a3'+ + '307ded2299a0ee606df035177a239c34a912c202aa5f83b9'+ + 'c4a7cf0235b5316bfc6efb9a248411258b30b839af172440'+ + 'f32563056cb67a861158ddd90e6a894c72a5bbef9e286c6b'); +var q = mpw('e950511eab424b9a19a2aeb4e159b7844c589c4f'); +var g = mpw('d29d5121b0423c27'+ + '69ab21843e5a3240ff19cacc792264e3bb6be4f78edd1b15'+ + 'c4dff7f1d905431f0ab16790e1f773b5ce01c804e509066a'+ + '9919f5195f4abc58189fd9ff987389cb5bedf21b4dab4f8b'+ + '76a055ffe2770988fe2ec2de11ad92219f0b351869ac24da'+ + '3d7ba87011a701ce8ee7bfe49486ed4527b7186ca4610a75'); +var c = mpw('f3b4c192'+ + '385620feec46cb7f5d55fe0c231b0404a61539729ea1291c'); + +var dsa = new DSA(p, q, g); + +var x = mpw('d0ec4e50bb290a42e9e355c73d8809345de2e139'); +var y = mpw('25282217f5730501'+ + 'dd8dba3edfcf349aaffec20921128d70fac44110332201bb'+ + 'a3f10986140cbb97c726938060473c8ec97b4731db004293'+ + 'b5e730363609df9780f8d883d8c4d41ded6a2f1e1bbbdc97'+ + '9e1b9d6d3c940301f4e978d65b19041fcf1e8b518f5c0576'+ + 'c770fe5a7a485d8329ee2914a2de1b5da4a6128ceab70f79'); +dsa.c = mpw(c); +dsa.x = mpw(dsa.c, dsa.q, 1, "-", "%", 1, "+"); +dsa.y = mpw(dsa.g, dsa.x, dsa.p, "powm"); +ack('dsa.x.toString(16)', x.toString(16)); +ack('dsa.y.toString(16)', y.toString(16)); + +var hm = mpw('a9993e364706816aba3e25717850c26c9cd0d89d'); +var k = mpw('349c55648dcf992f3f33e8026cfac87c1d2ba075'); +var kinv = mpw('d557a1b4e7346c4a55427a28d47191381c269bde'); +var r = mpw('636155ac9a4633b4665d179f9e4117df68601f34'); +var s = mpw('6c540b02d9d4852f89df8cfc99963204f4347704'); + +dsa.k = mpw(k); +dsa.kinv = mpw(kinv); +ack('dsa.sign(hm)', true); +ack('dsa.r.toString(16)', r.toString(16)); +ack('dsa.s.toString(16)', s.toString(16)); + +var w = mpw('7e4f353b71d1a3dc2946f6bae3b9285ef736ce34'); +var u1 = mpw('00abfd278373edf8ce08347d49cd81308880103e'); +var u2 = mpw('0da3ab84ae3ff412d703a63b41d1ec61d64b061c'); +var v1 = mpw('9c26b54969e24166'+ + 'd89b06f5bec3b0df8179e4f9cf7606f67162edd150f73a1f'+ + '9e09e49d21ab0d04b4a02e2446c47bc9311e38c80effd862'+ + 'fb69fe39eab9fc270b494a575e0d0862bef45df1a826a448'+ + '8bac5b3757e9c3513dd4d965e6b0ee18811bc711013cf4ea'+ + 'beb578878c133783f80342cafa147b0c1cc6e51e937c8d11'); +var v2 = mpw('841232c0aa641d81'+ + '74aa4619826357f66fdf66e9a9b2a7c832e901d04b07b0e3'+ + '7c35596fe9e873e7888af879aa4795f558d9be9aa6cc302c'+ + 'b29b9ccb03d72c5ebcfda30e03f3ab574d3c31c161b2fa41'+ + 'd31f49f9d2df72a5a91378455b0a852614b6e40b3c4d1cfe'+ + '81e28ea6ce9d563b7506413cd29bfb7bde64e2f14828a631'); +var v3 = mpw(v1, v2, p, "mulm"); +var v = mpw('636155ac9a4633b4665d179f9e4117df68601f34'); + +ack('dsa.verify(hm)', true); +ack('dsa.w.toString(16)', w.toString(16)); +ack('dsa.u1.toString(16)', u1.toString(16)); +ack('dsa.u2.toString(16)', u2.toString(16)); +ack('dsa.v1.toString(16)', v1.toString(16)); +ack('dsa.v2.toString(16)', v2.toString(16)); +ack('dsa.v.toString(16)', v.toString(16)); + +dsa.p = mpw( + '8ca8d2c0c04101b8bd0e079dd8bae6890c60ecfee4be2600c43de5401906f20a'+ + '9c25870a3c2544c33ba6080eaa1e442f0c148f20c3cc52b2e068fcb7ffaa7203'); +dsa.q = mpw('f37f99c87899a57e9af91beb78e47bde64028309'); +dsa.g = mpw( + '1d667d15baae47abd369b8fcff5a80ec874b10ce204cc636843c74c5b9fac935'+ + 'd4f279b79bb05f2abdc75df9eeb884c585041b4dc8d883ae0e7e45843b7e36ce'); + +var hm = mpw('f49a5dac15284e7fc72d66f85dbf3d1a5b97b575'); +dsa.x = mpw('ac19b8c465a05b2bbca71e8e36ee70d31ad5e946'); +dsa.y = mpw( + '1bfdc2e1627153415eaf74aeb89a938e9352b50a601d5fbdfaffe3d8d1f5ef99'+ + '7e93675d10a10b9a882475d7bf9756f8d75b5dd9cd0185a28fdaaeabdf28946e'); +dsa.r = mpw('11f0065438ec658438caa16178250c93d4bb750f'); +dsa.s = mpw('47693a4c58b1564590afe893272a4c6672af2656'); +ack('dsa.verify(hm)', true); + +var hm = mpw('82153920a1378c06ba9a34b99b4704ab622064a1'); +dsa.x = mpw('83f10c8644a9390d6b6c05539ef0731159973870'); +dsa.y = mpw( + '0a79f8fbc27416188f3996ee1e68749859337cc0330b1e598e75301e4f1bb02c'+ + 'd5bd9467d96f28d7aab0847641ff3b32111bc52ca6fdd62c7f1b2995cc4c2887'); +dsa.r = mpw('593aea363bbe8479cd3ac77018d5f799215fd784'); +dsa.s = mpw('369642bf2850334eeeb045db96f77a7733aefb7e'); +ack('dsa.verify(hm)', true); + +delete dsa + +// ======================================================= +function CurveFp(p, a, b) { + this.p = mpw(p); + this.a = mpw(a); + this.b = mpw(b); + + this.contains = + function (x, y) { + if (x == undefined && y == undefined) + return true; + var t1 = mpw(y, y, "*"); + var t2 = mpw(x, x, "*", this.a, "+", x, "*", this.b, "+"); + // XXX FIXME negative 0 + t1 = mpw(t1, t2, "-", this.p, "%", "abs"); + return (mpw.eq(t1, 0)); + } + + return this; +} + +// ======================================================= +function PointFp(C, x, y, n) { + this.C = C; + this.x = (x != undefined ? mpw(x) : undefined); + this.y = (y != undefined ? mpw(y) : undefined); + this.z = mpw(1); + this.n = (n != undefined ? mpw(n) : undefined); + if (!C.contains(this.x, this.y)) + print("NACK: ", this.x, this.y); + + this.cmp = + function (p1, p2) { + if (p1.x == undefined || p1.y == undefined || p2.x == undefined || p2.y == undefined) + return (p1.x == undefined && p1.y == undefined && p2.x == undefined && p2.y == undefined); + return (mpw.eq(p1.x, p2.x) && mpw.eq(p1.y, p2.y)); + } + + this.dbl = + function (P) { + var C = P.C; + if (P.x == undefined || P.y == undefined) + return new PointFp(C, undefined, undefined, P.n); + var l = mpw(P.x, P.x, "*", 3, "*", C.a, "+", C.p, "%", 2, P.y, "abs", "*", C.p, "%", C.p, "invm", "*", C.p, "%", "abs"); + if (mpw.lt(P.y, 0)) + l = mpw(l, "neg"); + var x = mpw(l, l, "*", 2, P.x, "*", "-", C.p, "%"); + var y = mpw(P.x, x, "-", l, "*", P.y, "-", C.p, "%"); +// y = mpw(y, "abs"); // XXX force positive for now + return new PointFp(C, x, y, P.n); + } + + this.add = + function (P, Q) { + var C = P.C; + if (Q.x == undefined || Q.y == undefined) + return new PointFp(C, P.x, P.y, P.n); + if (P.x == undefined || P.y == undefined) + return new PointFp(C, Q.x, Q.y, Q.n); + if (mpw.eq(P.x, Q.x)) { + if (mpw.eq(mpw(P.y, Q.y, "+", C.p, "%", "abs"), 0)) + return new PointFp(C, undefined, undefined, P.n); + return P.dbl(P); + } + if (mpw.gt(P.x, Q.x)) { + var l = mpw(P.y, Q.y, "-", C.p, "%", P.x, Q.x, "-", C.p, "invm", "*", C.p, "%"); + } else { + var l = mpw(Q.y, P.y, "-", C.p, "%", Q.x, P.x, "-", C.p, "invm", "*", C.p, "%"); + } + var x = mpw(l, l, "*", P.x, Q.x, "+", "-", C.p, "%"); + var y = mpw(l, P.x, x, "-", "*", P.y, "-", C.p, "%"); + return new PointFp(C, x, y, P.n); + } + + this.sub = + function (P, Q) { + if (Q.x == undefined || Q.y == undefined) + return new PointFp(P.C, P.x, P.y, P.n); + N = new PointFp(Q.C, Q.x, mpw(Q.y, "neg"), Q.n); + return this.add(P, N); + } + + this.mul = + function (P, m) { + var C = P.C; + var e = mpw(m); + if (P.n != undefined && !mpw.eq(P.n, 0)) + e = mpw(e, P.n, "%", "abs"); + if (mpw.eq(e, 0) || P.x == undefined || P.y == undefined) + return new PointFp(C, undefined, undefined, P.n); + var N = new PointFp(C, P.x, mpw(P.y, "neg"), P.n); + var e3 = mpw(3, e, "*"); + var i = mpw(e3, e3, "^", "not"); + i = mpw(i, i, 1, ">>", "^"); + while (mpw.eq(mpw(e3, i, "&"), 0)) + i = mpw(i, 1, ">>"); + i = mpw(i, 1, ">>"); + var r = new PointFp(C, P.x, P.y, P.n); + while (mpw.gt(i, 1)) { + r = r.dbl(r); + if (!mpw.eq(mpw(e3, i, "&"), 0) && mpw.eq(mpw( e, i, "&"), 0)) + r = r.add(r, P); + if ( mpw.eq(mpw(e3, i, "&"), 0) && !mpw.eq(mpw( e, i, "&"), 0)) + r = r.add(r, N); + i = mpw(i, 1, ">>"); + } + return r; + } + + return this; +} + +function walkDbl(P, imax) { + var PP = P.dbl(P); + for (let i = 1; i < imax; i++) + PP = P.dbl(PP); + return PP; +} + +function walkAdd(P, Q, imax) { + var PQ = P.add(P, Q); + for (let i = 1; i < imax; i++) + PQ = P.add(PQ, Q); + return PQ; +} + +function walkMul(P, imax) { + PM = new PointFp(P.C, undefined, undefined, P.n); + for (let i = 1; i < imax; i++) + PM = P.mul(P, i); + return PM; +} + +function walkDblMul(P, imax) { + PP = P.dbl(P); + for (let i = 1; i < imax; i++) { + var j = Math.pow(2, i); + PM = P.mul(P, j); +ack('PP.cmp(PP,PM)', true); + PP = PP.dbl(PP); + } + return true; +} + +function walkDblAdd(P, imax) { + var j = 2; + PQ = P.add(P, P); + PP = P.dbl(P); + for (let i = 1; i < imax; i++) { + while (j < Math.pow(2, i)) { + PQ = PQ.add(PQ, P); + j++; + } +ack('PP.cmp(PP,PQ)', true); + PP = PP.dbl(PP); + } + return true; +} + +function checkP(C, x, y, n) { + var P = new PointFp(C, x, y, n); +// var PP = P.sub(P, P); +// var PP = P.dbl(P); +// var P1 = P.mul(P, 1); +// var P2 = P.mul(P, 2); + + walkDbl(P, 10); + walkDblMul(P, 10); + +// walkAdd(P, P, 10); +// walkDblAdd(P, 2); + + var N = new PointFp(C, x, mpw(y, "neg"), n); + var NN = N.sub(N, N); + var NN = N.dbl(N); + var N1 = N.mul(N, 1); + var N2 = N.mul(N, 2); + + walkDbl(N, 10); + walkDblMul(N, 10); + +// walkAdd(N, N, 1); +// walkDblAdd(N, 1); + + var NP = N.add(N, P); + + return P; +} + +// ===== secp 112r1 +print("===== SECP 112r1"); +var p = mpw('db7c2abf62e35e668076bead208b'); +ack('mpw(mpw(mpw(2, 128, "**"), 3, "-"), 76439, "/").toString(16)', p.toString(16)); +var b = mpw('659ef8ba043916eede8911702b22'); +var n = mpw('db7c2abf62e35e7628dfac6561c5'); +var gx = mpw('09487239995a5ee76b55f9c2f098'); +var gy = mpw('a89ce5af8724c0a23e0e0ff77500'); + +C = new CurveFp(p, -3, b); +G = checkP(C, gx, gy, n); +// walkMul(G, 1024); + +delete C; +delete G; + +// ===== SECP 128r1 +print("===== SECP 128r1"); +var p = mpw('fffffffdffffffffffffffffffffffff'); +ack('mpw(mpw(mpw(2, 128, "**"), mpw(2, 97, "**"), "-"), 1, "-").toString(16)', p.toString(16)); +var b = mpw('e87579c11079f43dd824993c2cee5ed3'); +var n = mpw('fffffffe0000000075a30d1b9038a115'); +var gx = mpw('161ff7528b899b2d0c28607ca52c5b86'); +var gy = mpw('cf5ac8395bafeb13c02da292dded7a83'); + +C = new CurveFp(p, -3, b); +G = checkP(C, gx, gy, n); +walkMul(G, 5); + +delete C; +delete G; + +// ===== SECP 160r1 +print("===== SECP 160r1"); +var p = mpw('ffffffffffffffffffffffffffffffff7fffffff'); +ack('mpw(mpw(mpw(2, 160, "**"), mpw(2, 31, "**"), "-"), 1, "-").toString(16)', p.toString(16)); +var b = mpw('1c97befc54bd7a8b65acf89f81d4d4adc565fa45'); +var n = mpw('0100000000000000000001f4c8f927aed3ca752257'); +var gx = mpw('4a96b5688ef573284664698968c38bb913cbfc82'); +var gy = mpw('23a628553168947d59dcc912042351377ac5fb32'); + +C = new CurveFp(p, -3, b); +G = checkP(C, gx, gy, n); +walkMul(G, 53); + +delete C; +delete G; + +// ===== ECDSA P-192 example from +// http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/ECDSA_Prime.pdf +print("===== P-192"); +var p = mpw(mpw(mpw(2, 192, "**"), mpw(2, 64, "**"), "-"), 1, "-"); +ack('p.toString(10)', '6277101735386680763835789423207666416083908700390324961279'); +var n = mpw('ffffffffffffffffffffffff99def836146bc9b1b4d22831'); +ack('n.toString(10)', '6277101735386680763835789423176059013767194773182842284081'); + +var c = mpw('3099d2bbbfcb2538542dcd5fb078b6ef5f3d6fe2c745de65'); +var b = mpw('64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1'); +ack('mpw(mpw(b, p, "sqrm"), c, p, "mulm").toString(10)', mpw(p, 27, "-").toString(10)); + +var gx = mpw('188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012'); +var gy = mpw('07192b95ffc8da78631011ed6b24cdd573f977a11e794811'); + +C = new CurveFp(p, -3, b); +G = checkP(C, gx, gy, n); +walkMul(G, 15); + +//===================== FIPS 186-3 + +var d = mpw('7891686032fd8057f636b44b1f47cce564d2509923a7465b'); +var qx = mpw('fba2aac647884b504eb8cd5a0a1287babcc62163f606a9a2'); +var qy = mpw('dae6d4cc05ef4f27d79ee38b71c9c8ef4865d98850d84aa5'); +Q = checkP(C, qx, qy, n); +GQ = walkAdd(G, Q, 1); +QG = walkAdd(Q, G, 82); +walkMul(Q, 5); + +// dG = G.mul(G, d); +// ack('Q.cmp(Q,dG)', true); + +var k = mpw('d06cb0a0ef2f708b0744f08aa06b6deedea9c0f80a69d847'); +var msg = "Example of ECDSA with P-192"; +var e = mpw('1b376f0b735c615ceeeb31baee654b0a374825db'); +var kinv = mpw('5a277943c5a4d34b3c7dd97bdfe9b82c042586701088c00b'); +ack('mpw(k, n, "invm").toString(16)', kinv.toString(16)); +var r = mpw('f0ecba72b88cde399cc5a18e2a8b7da54d81d04fb9802821'); +var s = mpw('1e6d3d4ae2b1fab2bd2040f5dabf00f854fa140b6d21e8ed'); +ack('mpw(kinv, mpw(e, mpw(r, d, n, "mulm"), n, "addm"), n, "mulm").toString(16)', s.toString(16)); + +// kG = G.mul(G, k); +// ack('mpw(kG.x, kG.n, "%").toString(16)', r.toString(16)); + +var w = mpw(s, n, "invm"); +var u1 = mpw('785760fd37767d546003fa66933b7d202642352331b15b84'); +ack('mpw(e, w, n, "mulm").toString(16)', u1.toString(16)); +var u2 = mpw('de0747072e426e307ba1e19bd5c1b57f9e29220ae97cc9bc'); +ack('mpw(r, w, n, "mulm").toString(16)', u2.toString(16)); +var v = mpw('f0ecba72b88cde399cc5a18e2a8b7da54d81d04fb9802821'); + +// uG = G.mul(G, u1); +// uQ = Q.mul(Q, u2); +// V = G.add(uG, uQ); +// ack('mpw(V.x, V.n, "%").toString(16)', v.toString(16)); + +//===================== X9.66-1998 J.3.1 + +var d = mpw('1A8D598FC15BF0FD89030B5CB1111AEB92AE8BAF5EA475FB'); +// Q compressed = 02 62B12D60 690CDCF3 30BABAB6 E69763B4 71F994DD 702D16A5 +var qx = mpw('62B12D60690CDCF330BABAB6E69763B471F994DD702D16A5'); +var qy = mpw(qx, qx, "*", -3, "+", qx, "*", b, "+", p, "%", p, 1, "+", 2, ">>", p, "powm"); +Q = checkP(C, qx, qy, n); +// GQ = walkAdd(G, Q, 1); +// QG = walkAdd(Q, G, 82); +// walkMul(Q, 5); + +// dG = G.mul(G, d); +// ack('Q.cmp(Q,dG)', true); + +var k = mpw('FA6DE29746BBEB7F8BB1E761F85F7DFB2983169D82FA2F4E'); +var msg = "abc"; +var e = mpw('A9993E364706816ABA3E25717850C26C9CD0D89D'); +ack('e.toString(10)', '968236873715988614170569073515315707566766479517'); +var kinv = mpw(k, n, "invm"); +// ack('mpw(k, n, "invm").toString(16)', kinv.toString(16)); +var r = mpw('885052380FF147B734C330C43D39B2C4A89F29B0F749FEAD'); +ack('r.toString(10)', '3342403536405981729393488334694600415596881826869351677613'); +var s = mpw('E9ECC78106DEF82BF1070CF1D4D804C3CB390046951DF686'); +ack('s.toString(10)', '5735822328888155254683894997897571951568553642892029982342'); +ack('mpw(kinv, mpw(e, mpw(r, d, n, "mulm"), n, "addm"), n, "mulm").toString(16)', s.toString(16)); + +// kG = G.mul(G, k); +// ack('mpw(kG.x, kG.n, "%").toString(16)', r.toString(16)); + +var w = mpw(s, n, "invm"); +ack('w.toString(10)', '3250964404472526825130516490452346217749189704049629042861'); +var u1 = mpw('688E3FF66F55524374317D0AA03FA2B6E7DB44964CF9D457'); +ack('u1.toString(10)', '2563697409189434185194736134579731015366492496392189760599'); +ack('mpw(e, w, n, "mulm").toString(16)', u1.toString(16)); +var u2 = mpw('9FBBC2459B10ADC858EE18BE81541041229A839EF04268518'); +ack('u2.toString(10)', '62666438133486179671864777102357858491364063233387822220568'); +// XXX FIXME wrong answer +// ack('mpw(r, w, n, "mulm").toString(16)', u2.toString(16)); +var v = mpw('885052380FF147B734C330C43D39B2C4A89F29B0F749FEAD'); +ack('v.toString(10)', '3342403536405981729393488334694600415596881826869351677613'); + +// uG = G.mul(G, u1); +// uQ = Q.mul(Q, u2); +// V = G.add(uG, uQ); +// ack('mpw(V.x, V.n, "%").toString(16)', v.toString(16)); + +delete C; +delete G; +delete Q; + +// ===== ECDSA P-224 example from +// http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/ECDSA_Prime.pdf +print("===== P-224"); +var p = mpw(mpw(mpw(2, 224, "**"), mpw(2, 96, "**"), "-"), 1, "+"); +ack('p.toString(10)', '26959946667150639794667015087019630673557916260026308143510066298881'); +var n = mpw('ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a3d'); +ack('n.toString(10)', '26959946667150639794667015087019625940457807714424391721682722368061'); + +var c = mpw('5b056c7e11dd68f40469ee7f3c7a7d74f7d121116506d031218291fb'); +var b = mpw('b4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4'); +// FIXME mulm? +ack('mpw(mpw(b, b, "*", p, "%"), c, "*", p, "%").toString(10)', mpw(p, 27, "-").toString(10)); + +var gx = mpw('b70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21'); +var gy = mpw('bd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34'); + +C = new CurveFp(p, -3, b); +G = checkP(C, gx, gy, n); +walkMul(G, 5); + +var d = mpw('3f0c488e987c80be0fee521f8d90be6034ec69ae11ca72aa777481e8'); +var qx = mpw('e84fb0b8e7000cb657d7973cf6b42ed78b301674276df744af130b3e'); +var qy = mpw('4376675c6fc5612c21a0ff2d2a89d2987df7a2bc52183b5982298555'); +Q = checkP(C, qx, qy, n); +GQ = walkAdd(G, Q, 5); +QG = walkAdd(Q, G, 1); +walkMul(Q, 39); + +// dG = G.mul(G, d); +// ack('Q.cmp(Q,dG)', true); + +var k = mpw('a548803b79df17c40cde3ff0e36d025143bcbba146ec32908eb84937'); +var msg = "Example of ECDSA with P-224"; +var e = mpw('1f1e1cf892926cfccfc5a28feef3d807d23f778008dba4b35f04b2fd'); +var kinv = mpw('b4d9d81feff7b325e09e770c40bace8b008d6074371967326f39130c'); +ack('mpw(k, n, "invm").toString(16)', kinv.toString(16)); +var r = mpw('c3a3f5b82712532004c6f6d1db672f55d931c3409ea1216d0be77380'); +var s = mpw('c5aa1eae6095dea34c9bd84da3852cca41a8bd9d5548f36dabdf6617'); +ack('mpw(kinv, mpw(e, mpw(r, d, n, "mulm"), n, "addm"), n, "mulm").toString(16)', s.toString(16)); + +// kG = G.mul(G, k); +// ack('mpw(kG.x, kG.n, "%").toString(16)', r.toString(16)); + +var w = mpw(s, n, "invm"); +var u1 = mpw('69df611df949498ebe20c1e453cf231cdd2f30adeecba9335481295d'); +ack('mpw(e, w, n, "mulm").toString(16)', u1.toString(16)); +var u2 = mpw('86daaf97dc9bb13a66ec7b735e69bccd60f395efb2cdfded8a3ccbcf'); +ack('mpw(r, w, n, "mulm").toString(16)', u2.toString(16)); +var v = mpw('c3a3f5b82712532004c6f6d1db672f55d931c3409ea1216d0be77380'); + +// uG = G.mul(G, u1); +// uQ = Q.mul(Q, u2); +// V = G.add(uG, uQ); +// ack('mpw(V.x, V.n, "%").toString(16)', v.toString(16)); + +delete C; +delete G; +delete Q; + +// ===== ECDSA P-239 example from X9.62-1998 J.3.2 +print("===== P-239"); +var p = mpw('7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFF'); +ack('p.toString(10)', '883423532389192164791648750360308885314476597252960362792450860609699839'); +var n = mpw('7FFFFFFFFFFFFFFFFFFFFFFF7FFFFF9E5E9A9F5D9071FBD1522688909D0B'); +ack('n.toString(10)', '883423532389192164791648750360308884807550341691627752275345424702807307'); + +var b = mpw('6B016C3BDCF18941D0D654921475CA71A9DB2FB27D1D37796185C2942C0A'); +var a = mpw('7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFC'); + +// G compressed = 020FFA 963CDCA8 816CCC33 B8642BED F905C3D3 58573D3F 27FBBD3B 3CB9AAAF +var gx = mpw('0FFA963CDCA8816CCC33B8642BEDF905C3D358573D3F27FBBD3B3CB9AAAF'); +var gy = mpw(gx, gx, "*", -3, "+", gx, "*", b, "+", p, "%", p, 1, "+", 2, ">>", p, "powm"); + +C = new CurveFp(p, -3, b); +G = checkP(C, gx, gy, n); +// walkMul(G, 128); + +var d = mpw('7EF7C6FABEFFFDEA864206E80B0B08A9331ED93E698561B64CA0F7777F3D'); +ack('d.toString(10)', '876300101507107567501066130761671078357010671067781776716671676178726717'); +// Q compressed = 025B6D C53BC61A 2548FFB0 F671472D E6C9521A 9D2D2534 E65ABFCB D5FE0C70 +var qx = mpw('5B6DC53BC61A2548FFB0F671472DE6C9521A9D2D2534E65ABFCBD5FE0C70'); +var qy = mpw(qx, qx, "*", -3, "+", qx, "*", b, "+", p, "%", p, 1, "+", 2, ">>", p, "powm"); +Q = checkP(C, qx, qy, n); +// GQ = walkAdd(G, Q, 5); +// QG = walkAdd(Q, G, 1); +// walkMul(Q, 128); + +dG = G.mul(G, d); +// ack('Q.cmp(Q,dG)', true); + +var k = mpw('656C7196BF87DCC5D1F1020906DF2782360D36B2DE7A17ECE37D503784AF'); +ack('k.toString(10)', '700000017569056646655505781757157107570501575775705779575555657156756655'); +var msg = "abc"; +var e = mpw('A9993E364706816ABA3E25717850C26C9CD0D89D'); +ack('e.toString(10)', '968236873715988614170569073515315707566766479517'); +var kinv = mpw(k, n, "invm"); +var ry = mpw('20C08272B9E6C92B518A5AC5EB2835BE0102809D77E69304A6F7C522B47B'); +var r = mpw('2CB7F36803EBB9C427C58D8265F11FC5084747133078FC279DE874FBECB0'); +ack('r.toString(10)', '308636143175167811492622547300668018854959378758531778147462058306432176'); +var s = mpw('2EEAE988104E9C2234A3C2BEB1F53BFA5DC11FF36A875D1E3CCB1F7E45CF'); +ack('s.toString(10)', '323813553209797357708078776831250505931891051755007842781978505179448783'); +ack('mpw(kinv, mpw(e, mpw(r, d, n, "mulm"), n, "addm"), n, "mulm").toString(16)', s.toString(16)); + +kG = G.mul(G, k); +ack('kG.x.toString(10)', '308636143175167811492622547300668018854959378758531778147462058306432176'); +ack('mpw(kG.x, kG.n, "%").toString(16)', r.toString(16)); + +var w = mpw(s, n, "invm"); +ack('w.toString(16)', '0x7886c9885b6fa74077186378969e35af072f6ba36b7364104e7a94447124'); +ack('w.toString(10)', '831843418332978390463010021843350581892480848636408104706147767766249764'); +var u1 = mpw('11F9D347D0996B633D8D83734C6F7E280011DEDC142CF5B3359A82CF15D9'); +ack('u1.toString(10)', '124064965052014194622159338097387562954788117638383503089995672152118745'); +ack('mpw(e, w, n, "mulm").toString(16)', u1.toString(16)); +var u2 = mpw('1975746D082DE951CA9C5129DF423065B870E28FE8E7A9A27D465787BC5CB'); +ack('u2.toString(10)', '2811363736140754465407544341268382421438687214093897850239246340491822539'); +// XXX FIXME wrong answer +ack('mpw(r, w, "*", n, "%").toString(16)', u2.toString(16)); +var v = mpw('2CB7F36803EBB9C427C58D8265F11FC5084747133078FC279DE874FBECB0'); +ack('v.toString(10)', '308636143175167811492622547300668018854959378758531778147462058306432176'); + +uG = G.mul(G, u1); +ack('uG.x.toString(16)', mpw('64C429FAF03DC1707700D2011D439836B4C712DCFFD8E4B7ED9937F62D1F').toString(16)); +ack('uG.y.toString(16)', mpw('6580DE1A6ECEDFD783538C7C9D8398BAE8B5A697EEFD004AA59660800F48').toString(16)); +uQ = Q.mul(Q, u2); +ack('uQ.x.toString(16)', mpw('3DCA0CAFD86C59DDD9FC251A20739F69845168F5922E523B7994AFC92D9D').toString(16)); +ack('uQ.y.toString(16)', mpw('5532B0A717E945EED3D8AD1C26AB37907E942833CD22AFFE63AC1F5BC8FE').toString(16)); + +uQ.x = mpw('3DCA0CAFD86C59DDD9FC251A20739F69845168F5922E523B7994AFC92D9D'); +uQ.y = mpw(uQ.x, uQ.x, "*", -3, "+", uQ.x, "*", b, "+", p, "%", p, 1, "+", 2, ">>", p, "powm"); +V = G.add(uG, uQ); +ack('V.x.toString(16)', mpw('2CB7F36803EBB9C427C58D8265F11FC5084747133078FC279DE874FBECB0').toString(16)); +ack('V.y.toString(16)', mpw('20C08272B9E6C92B518A5AC5EB2835BE0102809D77E69304A6F7C522B47B').toString(16)); +ack('mpw(V.x, V.n, "%").toString(16)', v.toString(16)); + +delete C; +delete G; +delete Q; + +// ===== ECDSA P-256 example from +// http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/ECDSA_Prime.pdf +print("===== P-256"); +var p = mpw(2, 256, "**"); +p = mpw(p, mpw(2, 224, "**"), "-"); +p = mpw(p, mpw(2, 192, "**"), "+"); +p = mpw(p, mpw(2, 96, "**"), "+"); +p = mpw(p, 1, "-"); +ack('p.toString(10)', '115792089210356248762697446949407573530086143415290314195533631308867097853951'); +var n = mpw('ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551'); +ack('n.toString(10)', '115792089210356248762697446949407573529996955224135760342422259061068512044369'); + +var c = mpw('7efba1662985be9403cb055c75d4f7e0ce8d84a9c5114abcaf3177680104fa0d'); +var b = mpw('5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b'); +ack('mpw(mpw(b, p, "sqrm"), c, p, "mulm").toString(10)', mpw(p, 27, "-").toString(10)); + +var gx = mpw('6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296'); +var gy = mpw('4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5'); + +C = new CurveFp(p, -3, b); +G = checkP(C, gx, gy, n); +walkMul(G, 3); + +var d = mpw('c477f9f65c22cce20657faa5b2d1d8122336f851a508a1ed04e479c34985bf96'); +var qx = mpw('b7e08afdfe94bad3f1dc8c734798ba1c62b3a0ad1e9ea2a38201cd0889bc7a19'); +var qy = mpw('3603f747959dbf7a4bb226e41928729063adc7ae43529e61b563bbc606cc5e09'); +Q = checkP(C, qx, qy, n); +GQ = walkAdd(G, Q, 1); +QG = walkAdd(Q, G, 1); +walkMul(Q, 9); + +// dG = G.mul(G, d); +// ack('Q.cmp(Q,dG)', true); + +var k = mpw('7a1a7e52797fc8caaa435d2a4dace39158504bf204fbe19f14dbb427faee50ae'); +var msg = "Example of ECDSA with P-256"; +var e = mpw('a41a41a12a799548211c410c65d8133afde34d28bdd542e4b680cf2899c8a8c4'); +var kinv = mpw('62159e5ba9e712fb098cce8fe20f1bed8346554e98ef3c7c1fc3332ba67d87ef'); +ack('mpw(k, n, "invm").toString(16)', kinv.toString(16)); +var r = mpw('2b42f576d07f4165ff65d1f3b1500f81e44c316f1f0b3ef57325b69aca46104f'); +var s = mpw('dc42c2122d6392cd3e3a993a89502a8198c1886fe69d262c4b329bdb6b63faf1'); +// FIXME mulm? +ack('mpw(mpw(mpw(r, d, "*", n, "%"), e, "+", n, "%"), kinv, "*", n, "%").toString(16)', s.toString(16)); + +// kG = G.mul(G, k); +// ack('mpw(kG.x, kG.n, "%").toString(16)', r.toString(16)); + +var w = mpw(s, n, "invm"); +var u1 = mpw('b807bf3281dd13849958f444fd9aea808d074c2c48ee8382f6c47a435389a17e'); +// FIXME mulm? +ack('mpw(e, w, "*", n, "%").toString(16)', u1.toString(16)); +var u2 = mpw('1777f73443a4d68c23d1fc4cb5f8b7f2554578ee87f04c253df44efd181c184c'); +// FIXME mulm? +ack('mpw(r, w, "*", n, "%").toString(16)', u2.toString(16)); +var v = mpw('2b42f576d07f4165ff65d1f3b1500f81e44c316f1f0b3ef57325b69aca46104f'); + +// uG = G.mul(G, u1); +// uQ = Q.mul(Q, u2); +// V = G.add(uG, uQ); +// ack('mpw(V.x, V.n, "%").toString(16)', v.toString(16)); + +delete C; +delete G; +delete Q; + +// ===== ECDSA P-384 example from +// http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/ECDSA_Prime.pdf +print("===== P-384"); +var p = mpw(2, 384, "**"); +p = mpw(p, mpw(2, 128, "**"), "-"); +p = mpw(p, mpw(2, 96, "**"), "-"); +p = mpw(p, mpw(2, 32, "**"), "+"); +p = mpw(p, 1, "-"); +ack('p.toString(10)', '39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319'); +var n = mpw('ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973'); +ack('n.toString(10)', '39402006196394479212279040100143613805079739270465446667946905279627659399113263569398956308152294913554433653942643'); + +var c = mpw('79d1e655f868f02fff48dcdee14151ddb80643c1406d0ca10dfe6fc52009540a495e8042ea5f744f6e184667cc722483'); +var b = mpw('b3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef'); +// FIXME mulm? +ack('mpw(mpw(b, b, "*", p, "%"), c, "*", p, "%").toString(10)', mpw(p, 27, "-").toString(10)); + +var gx = mpw('aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7'); +var gy = mpw('3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f'); + +C = new CurveFp(p, -3, b); +G = checkP(C, gx, gy, n); +walkMul(G, 7); + +var d = mpw('f92c02ed629e4b48c0584b1c6ce3a3e3b4faae4afc6acb0455e73dfc392e6a0ae393a8565e6b9714d1224b57d83f8a08'); +var qx = mpw('3bf701bc9e9d36b4d5f1455343f09126f2564390f2b487365071243c61e6471fb9d2ab74657b82f9086489d9ef0f5cb5'); +var qy = mpw('d1a358eafbf952e68d533855ccbdaa6ff75b137a5101443199325583552a6295ffe5382d00cfcda30344a9b5b68db855'); +Q = checkP(C, qx, qy, n); +GQ = walkAdd(G, Q, 2); +QG = walkAdd(Q, G, 10); +walkMul(Q, 5); + +// dG = G.mul(G, d); +// ack('Q.cmp(Q,dG)', true); + +var k = mpw('2e44ef1f8c0bea8394e3dda81ec6a7842a459b534701749e2ed95f054f0137680878e0749fc43f85edcae06cc2f43fef'); +var msg = "Example of ECDSA with P-384"; +var e = mpw('5aea187d1c4f6e1b35057d20126d836c6adbbc7049ee0299c9529f5e0b3f8b5a7411149d6c30d6cb2b8af70e0a781e89'); +var kinv = mpw('ac227da51929533dfc2e9eefb4e0f7bd22392ca73289ed1c6c00b214e8874d8007c8ac46b25d677dfe9b1c6c10a47e4a'); +ack('mpw(k, n, "invm").toString(16)', kinv.toString(16)); +var r = mpw('30ea514fc0d38d8208756f068113c7cada9f66a3b40ea3b313d040d9b57dd41a332795d02cc7d507fcef9faf01a27088'); +var s = mpw('cc808e504be414f46c9027bcbf78adf067a43922d6fcaa66c4476875fbb7b94efd1f7d5dbe620bfb821c46d549683ad8'); +ack('mpw(kinv, mpw(e, mpw(r, d, n, "mulm"), n, "addm"), n, "mulm").toString(16)', s.toString(16)); + +// kG = G.mul(G, k); +// ack('mpw(kG.x, kG.n, "%").toString(16)', r.toString(16)); + +var w = mpw(s, n, "invm"); +var u1 = mpw('9c0590ee8000b79832dc4c6776f7e5fd2a74be161741c7c2d2f038d439831696a1b8ece4199d225b12b76dd9e637b250'); +ack('mpw(e, w, n, "mulm").toString(16)', u1.toString(16)); +var u2 = mpw('8f77be5b0eb32a1a3b9274cfda53518a01aad4afc4bd46a392b7c7de4eed3fe6dee54f3064234fe7fde57ae45532c24d'); +ack('mpw(r, w, n, "mulm").toString(16)', u2.toString(16)); +var v = mpw('30ea514fc0d38d8208756f068113c7cada9f66a3b40ea3b313d040d9b57dd41a332795d02cc7d507fcef9faf01a27088'); + +// uG = G.mul(G, u1); +// uQ = Q.mul(Q, u2); +// V = G.add(uG, uQ); +// ack('mpw(V.x, V.n, "%").toString(16)', v.toString(16)); + +delete C; +delete G; +delete Q; + +// ===== ECDSA P-521 example from +// http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/ECDSA_Prime.pdf +print("===== P-521"); +var p = mpw(mpw(2, 521, "**"), 1, "-"); +ack('p.toString(10)', '6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151'); +var n = mpw('01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409'); +ack('n.toString(10)', '6864797660130609714981900799081393217269435300143305409394463459185543183397655394245057746333217197532963996371363321113864768612440380340372808892707005449'); + +var c = mpw('79d1e655f868f02fff48dcdee14151ddb80643c1406d0ca10dfe6fc52009540a495e8042ea5f744f6e184667cc722483'); +var b = mpw('051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00'); +// FIXME: wrong answer +// ack('mpw(mpw(b, p, "sqrm"), c, p, "mulm").toString(10)', mpw(p, 27, "-").toString(10)); + +var gx = mpw('c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66'); +var gy = mpw('11839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650'); + +C = new CurveFp(p, -3, b); +G = checkP(C, gx, gy, n); +// walkMul(G, 1024); + +var d = mpw('0100085f47b8e1b8b11b7eb33028c0b2888e304bfc98501955b45bba1478dc184eeedf09b86a5f7c21994406072787205e69a63709fe35aa93ba333514b24f961722'); +var qx = mpw('0098e91eef9a68452822309c52fab453f5f117c1da8ed796b255e9ab8f6410cca16e59df403a6bdc6ca467a37056b1e54b3005d8ac030decfeb68df18b171885d5c4'); +var qy = mpw('0164350c321aecfc1cca1ba4364c9b15656150b4b78d6a48d7d28e7f31985ef17be8554376b72900712c4b83ad668327231526e313f5f092999a4632fd50d946bc2e'); +Q = checkP(C, qx, qy, n); +// GQ = walkAdd(G, Q, 1024); +// QG = walkAdd(Q, G, 1024); +// walkMul(Q, 1024); +// walkDblAdd(Q, 3); +// walkDblMul(Q, 31); + +dG = G.mul(G, d); +ack('Q.cmp(Q,dG)', true); + +var k = mpw('c91e2349ef6ca22d2de39dd51819b6aad922d3aecdeab452ba172f7d63e370cecd70575f597c09a174ba76bed05a48e562be0625336d16b8703147a6a231d6bf'); +var msg = "Example of ECDSA with P-512"; +var e = mpw('9bf0e1deeda31e00f925b77f7cb6b1ced7368de1dc75bb9f94582c1ca709205d32af90025b02fa132fbebd6cddcd9172c0d66d8e581767a8b6f71de60be1f932'); +var kinv = mpw('01eab94335a7ed337bce83c95de95447925edb0ee27f8e8378713e767d6da570fccfb4f13dcf57f898e77ddb540a9453e0c3d5c97ae8d2ec843590bcb1d349044c09'); +ack('mpw(k, n, "invm").toString(16)', kinv.toString(16)); +var r = mpw('0140c8edca57108ce3f7e7a240ddd3ad74d81e2de62451fc1d558fdc79269adacd1c2526eeeef32f8c0432a9d56e2b4a8a732891c37c9b96641a9254ccfe5dc3e2ba'); +var s = mpw('00d72f15229d0096376da6651d9985bfd7c07f8d49583b545db3eab20e0a2c1e8615bd9e298455bdeb6b61378e77af1c54eee2ce37b2c61f5c9a8232951cb988b5b1'); +ack('mpw(kinv, mpw(e, mpw(r, d, n, "mulm"), n, "addm"), n, "mulm").toString(16)', s.toString(16)); + +kG = G.mul(G, k); +ack('mpw(kG.x, kG.n, "%").toString(16)', r.toString(16)); + +var w = mpw(s, n, "invm"); +var u1 = mpw('01697eefb6bd3a6db024254fe69fd19c80eb04b71cdd16af72f322106093f971cb08c29f6f8950f0f61e45bf65bac39a590dcb043758c6606907f216a759b4ea4be4'); +ack('mpw(e, w, n, "mulm").toString(16)', u1.toString(16)); +var u2 = mpw('014e7fc3ee94b91e092f660253dcaf92a70306bdfa317a0ab7efb2c8286944bee5f146114f2c61950f8c8699cce1a22fe632ea89967d33fefcb0e7607b4b66d157b6'); +ack('mpw(r, w, n, "mulm").toString(16)', u2.toString(16)); +var v = mpw('0140c8edca57108ce3f7e7a240ddd3ad74d81e2de62451fc1d558fdc79269adacd1c2526eeeef32f8c0432a9d56e2b4a8a732891c37c9b96641a9254ccfe5dc3e2ba'); + +uG = G.mul(G, u1); +uQ = Q.mul(Q, u2); +V = G.add(uG, uQ); +ack('mpw(V.x, V.n, "%").toString(16)', v.toString(16)); + +delete C; +delete G; +delete Q; + +// ############################################################## +// Curve K-163 +// ############################################################## +print("===== K-163"); +var n = mpw('0004000000000000000000020108a2e0cc0d99f8a5ef'); +ack('n.toString(10)', '5846006549323611672814741753598448348329118574063'); + +var d = mpw('7ff9959e88692406041273ab70e00b88ea18c9e6'); +var qx = mpw('2cc266f6d83736500418d2e00ce2d07c2ff8f734'); +var qy = mpw('00028553ea0676c40d577dcfe5259968b341a1d33af2'); + +var k = mpw('1e7ec8c98ab49fc14e1bc841ebf61a0ad0961472'); +var msg = "Example of ECDSA with K-163" + +var rx = mpw('000718ef5ef376b8f5301b5fd2a761989c417807a275'); + +var e = mpw('590d17df8bf17246eaf975b41864abcc7a747021'); +var kinv = mpw('39252c5d41a936736cae1413da88924935f61b58'); + +var r = mpw('000318ef5ef376b8f5301b5dd19ebeb7d033de0efc86'); +ack('r.toString(10)', '4526858839996231728501073084029310952934625705094'); +var s = mpw('0002fd6b089af933c881d4b9feb3a550cbded50cd7bd'); +ack('s.toString(10)', '4369764869049498617479414634111521353329149794237'); + +var w = mpw(s, n, "invm"); +var u1 = mpw('000332dd232ef2d65c09309d52c7be1646d41fc9de20'); +var u2 = mpw('0003d355dad4b1418780a63a87dafc06d38bfc287312'); +var rx = mpw('000718ef5ef376b8f5301b5fd2a761989c417807a275'); +var v = mpw('000318ef5ef376b8f5301b5dd19ebeb7d033de0efc86'); + +var F = []; +function Fuv(p, u, v) +{ + var sum = 0; +print("Fuv("+p+", "+ u.toString(2) +", "+ v.toString(2) +")"); + for (var k = 1; k < p - 1; k++) { + var ubit = (u >> F[k+1]) & 1; + var vbit = (v >> F[p-k]) & 1; + if (ubit && vbit) + sum ^= 1; + } +print("F(" + u.toString(2) + " , " + v.toString(2) + ") = ", sum); + return sum; +} + +function Fgenerate(T, m, g) +{ + var p = T * m + 1; + var w = 1; + for (var j = 0; j < T; j++) { + var n = w; + for (var i = 0; i < m; i++) { + F[n] = i; + n = (2 * n) % p; + } + w = (g * w) % p; + } + print(JSON.stringify(F)); +} + +function Fmul() +{ + var T = 4; + var m = 7; + var g = 12; + var p = T * m + 1; + + Fgenerate(T, m, g); + + Fuv(p, 0x57, 0x61); + Fuv(p, 0x2f, 0x43); + Fuv(p, 0x5e, 0x07); + Fuv(p, 0x3d, 0x0e); + Fuv(p, 0x7a, 0x1c); + Fuv(p, 0x75, 0x38); + Fuv(p, 0x6b, 0x70); + +} + +// ======================================================= +// Return y^2 + xy - x^3 - x^2 (modulo p) +function vfyBinaryCurve(p, x, y) { + var t1 = mpw(y, y, p, "mulp"); + var t2 = mpw(x, y, p, "mulp"); + t1 = mpw(t1, t2, p, "addp"); + t2 = mpw(x, x, p, "mulp"); + t1 = mpw(t1, t2, p, "subp"); + t2 = mpw(t2, x, p, "mulp"); + t1 = mpw(t1, t2, p, "subp"); + return t1; +} + +// ======================================================= +// Return y^2 + xy - x^3 - 1 (modulo p) +function vfyKoblitzCurve0(p, x, y) { + var t1 = mpw(mpw(mpw(x, y, "+"), y, "*"), p, "%"); + var t2 = mpw(mpw(mpw(x, x, "*"), p, "%"), x, "*"); + t1 = mpw(t1, t2, "-"); + t1 = mpw(t1, 1, "-"); + t1 = mpw(t1, p, "%"); + return t1; +} + +// ======================================================= +// Return y^2 + xy - x^3 - x^2 - 1 (modulo p) +function vfyKoblitzCurve1(p, x, y) { + var t1 = vfyBinaryCurve(p, x, y); + t1 = mpw(t1, 1, p, "subp"); + return t1; +} + +// ############################################################## +// Curve B-163 +// ############################################################## +print("===== B-163"); +// Fmul(); +var p = mpw(2, 163, "**"); +p = mpw(p, mpw(2, 7, "**"), "+"); +p = mpw(p, mpw(2, 6, "**"), "+"); +p = mpw(p, mpw(2, 3, "**"), "+"); +p = mpw(p, 1, "+"); +ack('p.toString(16)', '0x800000000000000000000000000000000000000c9'); +var n = mpw('00040000000000000000000292fe77e70c12a4234c33'); +ack('n.toString(10)', '5846006549323611672814742442876390689256843201587'); + +// polynomial basis +var b = mpw('20a601907b8c953ca1481eb10512f78744a3205fd'); +var gx = mpw('3f0eba16286a2d57ea0991168d4994637e8343e36'); +var gy = mpw('0d51fbc6c71a0094fa2cdd545b11c5c0c797324f1'); +// normal basis +// var b = mpw('6645f3cacf1638e139c6cd13ef61734fbc9e3d9fb'); +// var gx = mpw('0311103c17167564ace77ccb09c681f886ba54ee8'); +// var gy = mpw('333ac13c6447f2e67613bf7009daf98c87bb50c7f'); + +// var t1 = vfyBinaryCurve(p, gx, gy); +// ack('t1.toString(16)', b.toString(16)); + +var d = mpw('000348d138c2de9447bd288feed177222ee377fb7bea'); +var qx = mpw('00066b015c0b72b0f81b1ecba6f58e7545d94744644c'); +var qy = mpw('ba6d4d62419155b186a29784f4aa4b8e8e1e7f76'); + +var k = mpw('8ed0f93f7d492bb3991847d0e96f9cc3947259aa'); +var msg = "Example of ECDSA with B-163" + +var rx = mpw('000760938a97d88b30fdfb2cce1a4c59783ad0ed8fde'); +var e = mpw('728d59bbe028509dd5d2ce480f458e2925232ac3'); +var kinv = mpw('00036dc66491684211373aaa8bd16024dd0a12a8ff11'); + +var r = mpw('000360938a97d88b30fdfb2a3b1bd4726c282cca43ab'); +ack('r.toString(10)', '4935858308701913308545983330530451819807197774763'); +var s = mpw('00019a7b5043d93a13d714b4717fc0698e6791cf7f7c'); +ack('s.toString(10)', '2343436199767730626813973682401889576912314924924'); + +var e = mpw('728d59bbe028509dd5d2ce480f458e2925232ac3'); + +var w = mpw(s, n, "invm"); +var u1 = mpw('0003c4099db241a80c807e02d81be10955b2eb2e5d8c'); +var u2 = mpw('000160ccedabb7e3e767a604d8b042a65751708cc262'); +var rx = mpw('000760938a97d88b30fdfb2cce1a4c59783ad0ed8fde'); +var v = mpw('000360938a97d88b30fdfb2a3b1bd4726c282cca43ab'); + +// ############################################################## +// Curve K-233 +// ############################################################## +print("===== K-233"); +var n = mpw('008000000000000000000000000000069d5bb915bcd46efb1ad5f173abdf'); +ack('n.toString(10)', '3450873173395281893717377931138512760570940988862252126328087024741343'); + +var d = mpw('8434613f4b799b4c26e4d7ab8e9481b04b09e648c94affd14b611a20'); +var qx = mpw('017c9dd766aefbe4de4b15f46db0671dc4ca0767ed51ecea94757d9c662e'); +var qy = mpw('01cdd726084837ae73c11c27d605c6eb2d5e31482358780305c2522b151b'); + +var k = mpw('000190da60fe3b179b96611db7c7e5217c9aff0aee435782ebfb2dfff27f'); +var msg = "Example of ECDSA with K-233" + +var rx = mpw('01bea7231662e6516f11e37d59d500eae71d116e9b7bbce5964b88d4cc4d'); +var e = mpw('cb2314b21e913f4d345af272ed611f3eba00388056921da8a450f731'); +var kinv = mpw('00759a37371c026e261add7278b81ee15d18e2b0d9bd1a077aebf96aa067'); + +var r = mpw('003ea7231662e6516f11e37d59d500d70f09e62d64fe6ff445c9b479c8b0'); +ack('r.toString(10)', '1689118280210305605171693773892079201866275012021226933371217775282352'); +var s = mpw('007503ec8e630386ce36a6276f221bc8ee4592cca5960a1eabe3bd2a282a'); +ack('s.toString(10)', '3154727010507234306862258506085323724325131083359956345879910870034474'); + +var w = mpw(s, n, "invm"); +var u1 = mpw('0043a8ea51489b412b0a1ca97865a12491e8e144159e56cdc8bbe201d0d5'); +var u2 = mpw('0036d6ac76bcac51707f796e6fa1cb649f7fd2c69aed93d01ab7c8ae35aa'); +var rx = mpw('01bea7231662e6516f11e37d59d500eae71d116e9b7bbce5964b88d4cc4d'); +var v = mpw('003ea7231662e6516f11e37d59d500d70f09e62d64fe6ff445c9b479c8b0'); + +// ############################################################## +// Curve B-233 +// ############################################################## +print("===== B-233"); +var n = mpw('01000000000000000000000000000013e974e72f8a6922031d2603cfe0d7'); +ack('n.toString(10)', '6901746346790563787434755862277025555839812737345013555379383634485463'); + +var d = mpw('8af6d5a8e875977c7d4ba1f611cf7b6d70b26140bf84a1cc281f1b7b'); +var qx = mpw('01d3ad52d68f8383f582e2ba00f89ce1632211edc24440c31798e0c8ed40'); +var qy = mpw('006c3b96cc0e6bc59355a1294e22dbf1d4b9071c28da1389b6debe0e7f43'); + +var k = mpw('8a65482917ba18f1e8b266a3795b0a3a09c439fa6b611e37123baf72'); +var msg = "Example of ECDSA with B-233" + +var rx = mpw('0186806715d9620f0a3e62c1ba593d9817b6dcb23de85bf504c326629e63'); +var e = mpw('6a8389d3644c7fa90d7f57e6049d0dd41b8e473cd296c71d0ff232b3'); +var kinv = mpw('0097589e4b9b7c0f0c1e58d2ac61e8297d83fe7d00172e64b7d0df207dd9'); + +var r = mpw('0086806715d9620f0a3e62c1ba593d842e41f582b37f39f1e79d2292bd8c'); +ack('r.toString(10)', '3626155233584346473011272901749115607875304189783836849535359105809804'); +var s = mpw('0040159539861be6673c0a3b2e49f5f6c9532b60130c6fc78826c9e900ef'); +ack('s.toString(10)', '1727709532304725124330354137202758438690663000173119669782159003549935'); + +var w = mpw(s, n, "invm"); +var u1 = mpw('0009621acb96ba987e2354a4ca3273c142bc963cce4cb84e17f4a6a8a3e1'); +var u2 = mpw('006f64d0192b2965749d0ac29c7840245cc70bdb296f7e71cfc59c069515'); +var rx = mpw('0186806715d9620f0a3e62c1ba593d9817b6dcb23de85bf504c326629e63'); +var v = mpw('0086806715d9620f0a3e62c1ba593d842e41f582b37f39f1e79d2292bd8c'); + +// ############################################################## +// Curve K-283 +// ############################################################## +print("===== K-283"); +var n = mpw('01ffffffffffffffffffffffffffffffffffe9ae2ed07577265dff7f94451e061e163c61'); +ack('n.toString(10)', '3885337784451458141838923813647037813284811733793061324295874997529815829704422603873'); + +var d = mpw('00069e6d19f7e454a83664ff49208f6038eaf842e164df42d0f64948ff9c94b014988329'); +var qx = mpw('01b64a60d4a365409635aaa27e1708d90b839afa2d9820e12b79c3af1094b6010aaef5be'); +var qy = mpw('0334b5f30ca21756bde6d47738f2458f56fbf6bdc76fcfb8f3e591455f041a952ee87a8e'); + +var k = mpw('e3084442d66fa9a02c42890163e57ee33ca1f4583c65bcbde92781c7a3c83e89b773'); +var msg = "Example of ECDSA with K-283" + +var rx = mpw('07c973d58fd17a06aa8f39d5ec42e0a6b992f6cc61f157565dd7036c147d9005400c1328'); +var e = mpw('184f9aea741e7668b8b5c72c81617fa4068929628f77bd2f7a713a0a09916b81'); +var kinv = mpw('0045d85f04239846deb60444da59f95ca0ca13fb9c30b6972e852e332e223067143d174d'); + +var r = mpw('01c973d58fd17a06aa8f39d5ec42e0a6b99339c1d57ff6f0eabd04ed57ae35f2e5c95e05'); +ack('r.toString(10)', '3471401162510341375623239443838810951682842412872079937478668905492984462483269443077'); +var s = mpw('014a4ed02cbe4d76ed5ddaa34a9f2d7390af2de327edbc3335119d3e43cbb7fe0384d841'); +ack('s.toString(10)', '2506557860315181892752630984589168964256966490874765067882847886248065073786590124097'); + +var w = mpw(s, n, "invm"); +var u1 = mpw('001950717a3ba3fe8cc4677c5c6a1f9ec4c92a7d405e39e133250abc8038a945b86fbbb8'); +var u2 = mpw('00b8d9b42e8b8c1c7b610132b88a9d3ddc8beae7bd8a7e5fc94fc937c46779bf8e33ca2a'); +var rx = mpw('07c973d58fd17a06aa8f39d5ec42e0a6b992f6cc61f157565dd7036c147d9005400c1328'); +var v = mpw('01c973d58fd17a06aa8f39d5ec42e0a6b99339c1d57ff6f0eabd04ed57ae35f2e5c95e05'); + +// ############################################################## +// Curve B-283 +// ############################################################## +print("===== B-283"); +var n = mpw('03ffffffffffffffffffffffffffffffffffef90399660fc938a90165b042a7cefadb307'); +ack('n.toString(10)', '7770675568902916283677847627294075626569625924376904889109196526770044277787378692871'); + +var d = mpw('010652d37b0a9db64d4033ac6549cd1df37e1eede2612c2363257c6aff6c8cb5dcb63648'); +var qx = mpw('0390858e9327a714c74af0c3adedf4e6c75cafdcc46507a49e415b138a094b6f43e882ac'); +var qy = mpw('00d4a65d973cd150a5221bedf872a4ba207ff4427dfffd4827c5bf169e719162504d0631'); + +var k = mpw('0100ec321393e6dd6c4d47be5ae189e5e35408579d0862178f94ccbba3c4049a4d88e297'); +var msg = "Example of ECDSA with B-283" + +var rx = mpw('077cb284ac41e72eda2a93eb8d6dff58620f6c69d528dfe90d909aa5cabc03a34e5d5a76'); +var e = mpw('f0bf4aef3f694ebdde0a79445c897adb2430b91877c772da9b7362cb03aea87f'); +var kinv = mpw('00ab6d18af222d8fde7d93894d4faeeb36accd4fb68ec95d9e9bff4c08aff3c631a67be4'); + +var r = mpw('037cb284ac41e72eda2a93eb8d6dff58620f7cd99b927eec7a060a8f6fb7d9265eafa76f'); +ack('r.toString(10)', '6774278697741420663687521446478692454362079599099886695356533960517936672443416422255'); +var s = mpw('00a37ac10aebfc22fc6e6ee22e8f235e3eeb0555a0f0f9da92d9ffa734ad767956d27f23'); +ack('s.toString(10)', '1240572480066211322672976019324920068198845924194402393411512731505068634362155794211'); + +var w = mpw(s, n, "invm"); +var u1 = mpw('01a9af084b9e04574c178a2d00c97cfe36f25d5f834fcd7044235a92e89ac3346c8c9af3'); +var u2 = mpw('009949042a40d7613f3880cfcc3b3e9d22ee9c130651cee1f263efc881cf9a53a564fbce'); +var rx = mpw('077cb284ac41e72eda2a93eb8d6dff58620f6c69d528dfe90d909aa5cabc03a34e5d5a76'); +var v = mpw('037cb284ac41e72eda2a93eb8d6dff58620f7cd99b927eec7a060a8f6fb7d9265eafa76f'); + +// ############################################################## +// Curve K-409 +// ############################################################## +print("===== K-409"); +var n = mpw('007ffffffffffffffffffffffffffffffffffffffffffffffffffe5f83b2d4ea20400ec4557d5ed3e3e7ca5b4b5c83b8e01e5fcf'); +ack('n.toString(10)', '330527984395124299475957654016385519914202341482140609642324395022880711289249191050673258457777458014096366590617731358671'); + +var d = mpw('00019f5789fe26e0e700c69e253e9f74d76eafb4c979d0b1584d4fe98715d45b7baaa851e02a1ecaed8b96602cf611d8a504bbd5'); +var qx = mpw('0127065590df9265fdfba4ed6edf76a9bc8ce880b58b6f571a1ab62ba3401269441f3b95ecd0909465022240ae45c7b36a91de58'); +var qy = mpw('003c85268d9267302090425bbc14c3d9ae1c1cfc78e0bfcccfc1fb5dca5b195c6f8cfbe2d85e4071b71317aa2b0b65c391f82502'); + +var k = mpw('0001592048516ccd793c7b863b00985fdba71c3d1edf449f667ac0d05ef37d15a94ad3282f29f7e9fd9491872f931354a1ccfa39'); +var msg = "Example of ECDSA with K-409" + +var rx = mpw('00ef421a230aa8b471939a77bf4f2c64fc0b4caa39edcd06337a9115af89df725e3c748ae018320e89d77abcd3aa13a6ccf10c34'); +var e = mpw('b18623fe7d6b79c3947651cf64a066400f89dc989d07bfd8c1aaf75e3c9b3d48fc457204168de4ed4eca8e240e009b95'); +var kinv = mpw('0064d066b74c9771a843f341a1853f0520696aa57338c21c4a839507b5ee65cb98a7f87c8e53037c02980cf5185300b709901d59'); + +var r = mpw('006f421a230aa8b471939a77bf4f2c64fc0b4caa39edcd06337a92b62bd70a883dfc65c68a9ad33aa5efb061884d8fedecd2ac65'); +ack('r.toString(10)', '287296502609903755047276062317671877380342987214246771450934811188142631858192434973293671444180485746280616241641144101989'); +var s = mpw('00425f2ff9cbbf1b9e3fc17c4b66303622d7749047373cc9f919758cd88420c4cd0fdf14b819a4ada9961c3e6095000467c2f823'); +ack('s.toString(10)', '171388639085828986597824337788600168526139265051294280998358619335390078299394527527443716590351871100863295063908700846115'); + +var w = mpw(s, n, "invm"); +var u1 = mpw('007fc6bdb66a9d2a23bf69d4f96bb3e7e24e365b45d111c666747a42b39275ed0ba4f2866d3723dd13851a45208c864525d5f530'); +var u2 = mpw('0005e16d63457088b1f3012e844c852e23c9f1225aa569a883de8a5828dde30917d23c4d807a371aa1fc5db25149abbcd53f7558'); +var rx = mpw('00ef421a230aa8b471939a77bf4f2c64fc0b4caa39edcd06337a9115af89df725e3c748ae018320e89d77abcd3aa13a6ccf10c34'); +var v = mpw('006f421a230aa8b471939a77bf4f2c64fc0b4caa39edcd06337a92b62bd70a883dfc65c68a9ad33aa5efb061884d8fedecd2ac65'); + +// ############################################################## +// Curve B-409 +// ############################################################## +print("===== B-409"); +var n = mpw('010000000000000000000000000000000000000000000000000001e2aad6a612f33307be5fa47c3c9e052f838164cd37d9a21173'); +ack('n.toString(10)', '661055968790248598951915308032771039828404682964281219284648798304157774827374805208143723762179110965979867288366567526771'); + +var d = mpw('4af896db379abdf70c8fade9ebd28cd530f2ecb336b4de84bd6e065ef56c8c548c532d00fa55ca8acf3e98adbca9f78d241b'); +var qx = mpw('01951c5e41607e9317f247d49a389d0e120f479d47737543098ae5e1bb62bd59de70e1c584ae655c702d39dd4f7883e1876c4a9b'); +var qy = mpw('016b16b98a3353d75beb4d3576c64568ba381463cf77d4aeb85218d2d546e7a1ee3ab9316d8c7df00d155b7891b2c0bf4b5e942e'); + +var k = mpw('6a0b81d9320b5c305d730b1c1e74b03fafb88a7ec355990b75f9b70e8532433296a32492cba06f8583d5b19c5b8c5d6d07ec'); +var msg = "Example of ECDSA with B-409" + +var rx = mpw('01f3e4da3101c64239d76831995c0ec1e56ce4690c42ddd53dbf3ef725d819df090b8632f327499b5b99c280d7f410cd7105c8db'); +var e = mpw('4bbf1bc0ddf9d3b7bfe21fc68642b3e5508ca6ba4d365c1d00abbfabdb0f3ec2b0be995ae803de47d0880bf192649edc'); +var kinv = mpw('00a202ea455d0e1a5ef09054b39259c768db76ffd1a77b6281fc7056a4a23a1012cdd604e4d7993e0d9edd422defd782c1225a1a'); + +var r = mpw('00f3e4da3101c64239d76831995c0ec1e56ce4690c42ddd53dbf3d147b0173cc15d87e749382cd5ebd9492fd568f43959763b768'); +ack('r.toString(10)', '629795133852997848663164416330632008108488131029367711198400899015295569161990628452056613359116571349413663774547185481576'); +var s = mpw('00292fa994dc6ea367236ad73956dbc1eb62b8779df438165407141587e3feed883741cdf5542f255bebc57b9d0c87ad403b8eab'); +ack('s.toString(10)', '106353011790980050510402230388010919168837770971007460637281001297135413850335587267331709367101624723953375840680931987115'); + +var w = mpw(s, n, "invm"); +var u1 = mpw('0033d4f3ce2b7d4f2548f54c92420a8c30e6b02d768cbd6ca4ab020e88be82eefe4d58a9b4db2854561ead8975e1a58fb45c2117'); +var u2 = mpw('00eb0671192b38cbc911cade604d9e048c7e660af3c7085d54839c1b7549691e5f7fffdab4003ade05208775d4a0287e448740af'); +var rx = mpw('01f3e4da3101c64239d76831995c0ec1e56ce4690c42ddd53dbf3ef725d819df090b8632f327499b5b99c280d7f410cd7105c8db'); +var v = mpw('00f3e4da3101c64239d76831995c0ec1e56ce4690c42ddd53dbf3d147b0173cc15d87e749382cd5ebd9492fd568f43959763b768'); + +// ############################################################## +// Curve K-571 +// ############################################################## +print("===== K-571"); +var n = mpw('020000000000000000000000000000000000000000000000000000000000000000000000131850e1f19a63e4b391a8db917f4138b630d84be5d639381e91deb45cfe778f637c1001'); +ack('n.toString(10)', '1932268761508629172347675945465993672149463664853217499328617625725759571144780212268133978522706711834706712800825351461273674974066617311929682421617092503555733685276673'); + +var d = mpw('01042fde4d66e76725e7957e208a85cf23bc0d5b8d001b36aeafb34ad1104004ccf99afdfabca11585a4eb5263c87052cb05ef7fb39d9e5f6cf495e9dce5840b83fbc5ff3ad8b2f3'); +var qx = mpw('04d9cfe0a7338fea703e007f5d10babd2df3f319b47df1e23c4f7e5abf5014c1390b78f117e6af8258a48f56acb9faac788530b5ccdb1ab7e9390ec5dd7a39d5eeaf6c41bf50ac76'); +var qy = mpw('064732c504f81dc5f9b0e882b6da46e124e8241358f077896d25ecf028ad0e6011993c85e68741a07d7817c400cf94b1a3f524f48668b5b970972618616db4362a769d16cac34bf0'); + +var k = mpw('0104063c918de62000a3fd87775d8d71398722bd153b8ea33060349c5fe6cf6cb4677957e6ba50d3c8a8b5182b9cf962954a6bbb5f7868b88e5778aa62a0cf8002bf19da3049ff51'); +var msg = "Example of ECDSA with K-571" + +var rx = mpw('0668758c313fbf1945f775d95b25866dbc8d001d9c7ef4ffa53774e8c68927a52707f034cebb3a712be6d164f2ffe1897b069f8fbaec4650b5372ddfa31cdeccfa78569197cf50f1'); +var e = mpw('46e30abdd459269cf19af76900af7131b4f639227414719ebebe548ccd4026b75c1f52618547aa3821f29fcf685e33640bd9e29f7fe46817627d4139eee411c6'); +var kinv = mpw('0075a02beaea51660a1d05053b173c9c6dccaeba80f72ca08dec3c32e2a47cbc5674998ad19fc77b6615bfbed482451af7fd9b416b64b0e8f8429449fa9685f2b9c8dc2108544d98'); + +var r = mpw('0068758c313fbf1945f775d95b25866dbc8d001d9c7ef4ffa53774e8c68927a52707f034957247cb5717a5b6d84ae6f6c688dbe59859bd6d03b48237476742afe37cefe36d5b20ee'); +ack('r.toString(10)', '394224984077781794110496797090243013264310697694235133152929357615210591117311039789635553626060843213156329295090794526694846023847676866900261239702547152597222099198190'); +var s = mpw('00f5c8e975a1da26b2e0acd4f486c4a4231c1e29ee8ecfa03a697761498f5d53ff898afc16945975d328d34a8dcdc6d0613c73fe4f516f5685e23716fe105ed3472c3358b5b4ad41'); +ack('s.toString(10)', '927582646247034536177419741157642737320661633591180227914401573622207818585635957265237189528319320264021523961000220604458498430712577999892194455415491822501994555551041'); + +var w = mpw(s, n, "invm"); +var u1 = mpw('0121b1f8919c4ed41d4676bc6f417dbf7f93c2314c74796642d1b17df4fd04c114ae293707913e2ebb65e173d52c3678c8366eb3c94e7b7ecee53f6b0b625ac62b924e3d6b975ff3'); +var u2 = mpw('01afbf8d1d31511413eb6846b32ced90d38e515ff26cb8334ef619677794cc3b92da014e9b0e39bf49d8933d3e998145594128612aeccbfc7004d08777fd90bc197d13dc6238bf0b'); +var rx = mpw('0668758c313fbf1945f775d95b25866dbc8d001d9c7ef4ffa53774e8c68927a52707f034cebb3a712be6d164f2ffe1897b069f8fbaec4650b5372ddfa31cdeccfa78569197cf50f1'); +var v = mpw('0068758c313fbf1945f775d95b25866dbc8d001d9c7ef4ffa53774e8c68927a52707f034957247cb5717a5b6d84ae6f6c688dbe59859bd6d03b48237476742afe37cefe36d5b20ee'); + +// ############################################################## +// Curve B-571 +// ############################################################## +print("===== B-571"); +var n = mpw('03ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe661ce18ff55987308059b186823851ec7dd9ca1161de93d5174d66e8382e9bb2fe84e47'); +ack('n.toString(10)', '3864537523017258344695351890931987344298927329706434998657235251451519142289560424536143999389415773083133881121926944486246872462816813070234528288303332411393191105285703'); + +var d = mpw('0003cce32ba00dc3a7eefc9eb6f6cbfb9c5f0e57f532b7ee6826d4a75d0e756fd533900f2cea8cccc50ee22ce079398d371ec4a2ec45cc24b887606678e9c67453d0f5e768e9d752'); +var qx = mpw('00310ead2bef3ddb84f9fc1777a7ee179ffcb77aab497bdc00e290597a5fce306fe419d2f1f208e54850516526db8e03b0519bef60e3a3cc8198fbca8c469acfe46ab70d5c31874f'); +var qy = mpw('0373ce6ea68f55d1501d5203aca03c5ab709a337a8e03b03838f47c06762065fbdd08a102a08c42ff1760145be54d8606d326ea22a54df034fac30988049820beba2b0af9f6404b3'); + +var k = mpw('01062ff6d95c49ac610cb9af9900d59c288669c3626306db7eb7f119499ba1d54cb6be888758caada69952675cc0cd4999176879bc302a7e2a5118dfc7d538da114ccac2baf9ad08'); +var msg = "Example of ECDSA with B-571" + +var rx = mpw('00e17447e422a2c0085190354ac149210c1137a92c10f9b14d225e6510da76b19ef44d39390dd9d808c9dfbae67d9cf0e7be79a9e72fa8fa1dfe89f43fb6d093a6ceb30e136eaba3'); +var e = mpw('60edef7da1d9d35a77d1da441ebb63454501f2bb1af8a4c49d281298e5f4d4e6b7e9bce4b66b2512bf590288b57915bfd3aed2c2604a5c574107df674faf9779'); +var kinv = mpw('028c3ae12bd7922b837fe05066136bb45eda0337d39e31c3d4b9164c93f17fd7549471eb0385fccea8768dd6e5925adf1d1888826ff6aecc48f3db39905d46a644eb2f0c3a3dcbbd'); + +var r = mpw('00e17447e422a2c0085190354ac149210c1137a92c10f9b14d225e6510da76b19ef44d39390dd9d808c9dfbae67d9cf0e7be79a9e72fa8fa1dfe89f43fb6d093a6ceb30e136eaba3'); +ack('r.toString(10)', '850855762239502026591058023510563289273348857487181767834743944602362175979470988825265490247148142789747022832891719663177918797433599028444576028042439884754109942639523'); +var s = mpw('00624e852c7b6a061b4b39a907b518200fed380fd692c9ae147c5250f4852434afa24a1ca5062c48e5fc217fb689ab3a7266b5522f176f32a5cea22d6bf2820d349e4193bcee75c8'); +ack('s.toString(10)', '371005865765721334746413249075321341103084481747665324048935832930246035334494733931256416306196179464892337407155249561524652370280994639556574699020735912775043796334024'); + +var w = mpw(s, n, "invm"); +var u1 = mpw('01a73be1676983c3b1583a8504c46e290ac2ffc3fd7866e6242ae2a3dc40f362e2b799173698175f7f094e9fa06ee09b3aa7d284549b8fcf4671051b829aa38ef59d066b3554de19'); +var u2 = mpw('010df449e4fb576079a7d63a59f000da5e24da7800fa29bf321084ed549834b1ed95e5baf48fd65830f2bd0957b6f709dac14af90be29993fe428bd7df93206cc9ed9296230b8657'); +var rx = mpw('00e17447e422a2c0085190354ac149210c1137a92c10f9b14d225e6510da76b19ef44d39390dd9d808c9dfbae67d9cf0e7be79a9e72fa8fa1dfe89f43fb6d093a6ceb30e136eaba3'); +var v = mpw('00e17447e422a2c0085190354ac149210c1137a92c10f9b14d225e6510da76b19ef44d39390dd9d808c9dfbae67d9cf0e7be79a9e72fa8fa1dfe89f43fb6d093a6ceb30e136eaba3'); + +if (loglvl) print("<-- Mpw.js"); diff --git a/rpm-5.4.9/js/tscripts/Ps.js b/rpm-5.4.9/js/tscripts/Ps.js new file mode 100644 index 0000000..76742f7 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Ps.js @@ -0,0 +1,60 @@ +if (loglvl) print("--> Ps.js"); + +var RPMPROB_BADARCH = 0; /*!< (unused) package ... is for a different architecture */ +var RPMPROB_BADOS = 1; /*!< (unused) package ... is for a different operating system */ +var RPMPROB_PKG_INSTALLED = 2; /*!< package ... is already installed */ +var RPMPROB_BADRELOCATE = 3; /*! Seq.js"); + +// ---- access methods +var DB_BTREE = 1; +var DB_HASH = 2; +var DB_RECNO = 3; +var DB_QUEUE = 4; +var DB_UNKNOWN = 5; /* Figure it out on open. */ + +// ----- access flags +var DB_AFTER = 1; /* Dbc.put */ +var DB_APPEND = 2; /* Db.put */ +var DB_BEFORE = 3; /* Dbc.put */ +var DB_CONSUME = 4; /* Db.get */ +var DB_CONSUME_WAIT = 5; /* Db.get */ +var DB_CURRENT = 6; /* Dbc.get, Dbc.put, DbLogc.get */ +var DB_FIRST = 7; /* Dbc.get, DbLogc->get */ +var DB_GET_BOTH = 8; /* Db.get, Dbc.get */ +var DB_GET_BOTHC = 9; /* Dbc.get (internal) */ +var DB_GET_BOTH_RANGE = 10; /* Db.get, Dbc.get */ +var DB_GET_RECNO = 11; /* Dbc.get */ +var DB_JOIN_ITEM = 12; /* Dbc.get; don't do primary lookup */ +var DB_KEYFIRST = 13; /* Dbc.put */ +var DB_KEYLAST = 14; /* Dbc.put */ +var DB_LAST = 15; /* Dbc.get, DbLogc->get */ +var DB_NEXT = 16; /* Dbc.get, DbLogc->get */ +var DB_NEXT_DUP = 17; /* Dbc.get */ +var DB_NEXT_NODUP = 18; /* Dbc.get */ +var DB_NODUPDATA = 19; /* Db.put, Dbc.put */ +var DB_NOOVERWRITE = 20; /* Db.put */ +var DB_NOSYNC = 21; /* Db.close */ +var DB_OVERWRITE_DUP = 22; /* Dbc.put, Db.put; no DB_KEYEXIST */ +var DB_POSITION = 23; /* Dbc.dup */ +var DB_PREV = 24; /* Dbc.get, DbLogc->get */ +var DB_PREV_DUP = 25; /* Dbc.get */ +var DB_PREV_NODUP = 26; /* Dbc.get */ +var DB_SET = 27; /* Dbc.get, DbLogc->get */ +var DB_SET_RANGE = 28; /* Dbc.get */ +var DB_SET_RECNO = 29; /* Db.get, Dbc.get */ +var DB_UPDATE_SECONDARY = 30; /* Dbc.get, Dbc.del (internal) */ +var DB_SET_LTE = 31; /* Dbc.get (internal) */ +var DB_GET_BOTH_LTE = 32; /* Dbc.get (internal) */ + +// ------------------------- +var DB_AGGRESSIVE = 0x00000001; +var DB_ARCH_ABS = 0x00000001; +var DB_ARCH_DATA = 0x00000002; +var DB_ARCH_LOG = 0x00000004; +var DB_ARCH_REMOVE = 0x00000008; +var DB_AUTO_COMMIT = 0x00000100; +var DB_CDB_ALLDB = 0x00000040; +var DB_CHKSUM = 0x00000008; +var DB_CKP_INTERNAL = 0x00000002; +var DB_CREATE = 0x00000001; +var DB_CURSOR_BULK = 0x00000001; +var DB_CURSOR_TRANSIENT = 0x00000004; +var DB_CXX_NO_EXCEPTIONS = 0x00000002; +var DB_DIRECT = 0x00000010; +var DB_DIRECT_DB = 0x00000080; +var DB_DSYNC_DB = 0x00000200; +var DB_DUP = 0x00000010; +var DB_DUPSORT = 0x00000004; +var DB_DURABLE_UNKNOWN = 0x00000020; +var DB_ENCRYPT = 0x00000001; +var DB_ENCRYPT_AES = 0x00000001; +var DB_EXCL = 0x00000040; +var DB_EXTENT = 0x00000040; +var DB_FAILCHK = 0x00000020; +var DB_FAST_STAT = 0x00000001; +var DB_FCNTL_LOCKING = 0x00000800; +var DB_FLUSH = 0x00000001; +var DB_FORCE = 0x00000001; +var DB_FOREIGN_ABORT = 0x00000001; +var DB_FOREIGN_CASCADE = 0x00000002; +var DB_FOREIGN_NULLIFY = 0x00000004; +var DB_FREELIST_ONLY = 0x00000001; +var DB_FREE_SPACE = 0x00000002; +var DB_IGNORE_LEASE = 0x00002000; +var DB_IMMUTABLE_KEY = 0x00000002; +var DB_INIT_CDB = 0x00000040; +var DB_INIT_LOCK = 0x00000080; +var DB_INIT_LOG = 0x00000100; +var DB_INIT_MPOOL = 0x00000200; +var DB_INIT_REP = 0x00000400; +var DB_INIT_TXN = 0x00000800; +var DB_INORDER = 0x00000020; +var DB_JOIN_NOSORT = 0x00000001; +var DB_LOCKDOWN = 0x00001000; +var DB_LOCK_NOWAIT = 0x00000001; +var DB_LOCK_RECORD = 0x00000002; +var DB_LOCK_SET_TIMEOUT = 0x00000004; +var DB_LOCK_SWITCH = 0x00000008; +var DB_LOCK_UPGRADE = 0x00000010; +var DB_LOG_AUTO_REMOVE = 0x00000001; +var DB_LOG_CHKPNT = 0x00000002; +var DB_LOG_COMMIT = 0x00000004; +var DB_LOG_DIRECT = 0x00000002; +var DB_LOG_DSYNC = 0x00000004; +var DB_LOG_IN_MEMORY = 0x00000008; +var DB_LOG_NOCOPY = 0x00000008; +var DB_LOG_NOT_DURABLE = 0x00000010; +var DB_LOG_WRNOSYNC = 0x00000020; +var DB_LOG_ZERO = 0x00000010; +var DB_MPOOL_CREATE = 0x00000001; +var DB_MPOOL_DIRTY = 0x00000002; +var DB_MPOOL_DISCARD = 0x00000001; +var DB_MPOOL_EDIT = 0x00000004; +var DB_MPOOL_FREE = 0x00000008; +var DB_MPOOL_LAST = 0x00000010; +var DB_MPOOL_NEW = 0x00000020; +var DB_MPOOL_NOFILE = 0x00000001; +var DB_MPOOL_NOLOCK = 0x00000002; +var DB_MPOOL_TRY = 0x00000040; +var DB_MPOOL_UNLINK = 0x00000002; +var DB_MULTIPLE = 0x00000800; +var DB_MULTIPLE_KEY = 0x00004000; +var DB_MULTIVERSION = 0x00000004; +var DB_MUTEX_ALLOCATED = 0x00000001; +var DB_MUTEX_LOCKED = 0x00000002; +var DB_MUTEX_LOGICAL_LOCK = 0x00000004; +var DB_MUTEX_PROCESS_ONLY = 0x00000008; +var DB_MUTEX_SELF_BLOCK = 0x00000010; +var DB_MUTEX_SHARED = 0x00000020; +var DB_NOLOCKING = 0x00000400; +var DB_NOMMAP = 0x00000008; +var DB_NOORDERCHK = 0x00000002; +var DB_NOPANIC = 0x00000800; +var DB_NO_AUTO_COMMIT = 0x00001000; +var DB_ODDFILESIZE = 0x00000080; +var DB_ORDERCHKONLY = 0x00000004; +var DB_OVERWRITE = 0x00001000; +var DB_PANIC_ENVIRONMENT = 0x00002000; +var DB_PRINTABLE = 0x00000008; +var DB_PRIVATE = 0x00002000; +var DB_PR_PAGE = 0x00000010; +var DB_PR_RECOVERYTEST = 0x00000020; +var DB_RDONLY = 0x00000400; +var DB_RDWRMASTER = 0x00002000; +var DB_READ_COMMITTED = 0x00000400; +var DB_READ_UNCOMMITTED = 0x00000200; +var DB_RECNUM = 0x00000040; +var DB_RECOVER = 0x00000002; +var DB_RECOVER_FATAL = 0x00004000; +var DB_REGION_INIT = 0x00004000; +var DB_REGISTER = 0x00008000; +var DB_RENUMBER = 0x00000080; +var DB_REPMGR_CONF_2SITE_STRICT = 0x00000001; +var DB_REPMGR_PEER = 0x00000001; +var DB_REP_ANYWHERE = 0x00000001; +var DB_REP_CLIENT = 0x00000001; +var DB_REP_CONF_BULK = 0x00000002; +var DB_REP_CONF_DELAYCLIENT = 0x00000004; +var DB_REP_CONF_INMEM = 0x00000008; +var DB_REP_CONF_LEASE = 0x00000010; +var DB_REP_CONF_NOAUTOINIT = 0x00000020; +var DB_REP_CONF_NOWAIT = 0x00000040; +var DB_REP_ELECTION = 0x00000004; +var DB_REP_MASTER = 0x00000002; +var DB_REP_NOBUFFER = 0x00000002; +var DB_REP_PERMANENT = 0x00000004; +var DB_REP_REREQUEST = 0x00000008; +var DB_REVSPLITOFF = 0x00000100; +var DB_RMW = 0x00001000; +var DB_RPCCLIENT = 0x00000001; +var DB_SALVAGE = 0x00000040; +var DB_SA_SKIPFIRSTKEY = 0x00000080; +var DB_SA_UNKNOWNKEY = 0x00000100; +var DB_SEQ_DEC = 0x00000001; +var DB_SEQ_INC = 0x00000002; +var DB_SEQ_RANGE_SET = 0x00000004; +var DB_SEQ_WRAP = 0x00000008; +var DB_SEQ_WRAPPED = 0x00000010; +var DB_SET_LOCK_TIMEOUT = 0x00000001; +var DB_SET_REG_TIMEOUT = 0x00000004; +var DB_SET_TXN_NOW = 0x00000008; +var DB_SET_TXN_TIMEOUT = 0x00000002; +var DB_SHALLOW_DUP = 0x00000100; +var DB_SNAPSHOT = 0x00000200; +var DB_STAT_ALL = 0x00000004; +var DB_STAT_CLEAR = 0x00000001; +var DB_STAT_LOCK_CONF = 0x00000008; +var DB_STAT_LOCK_LOCKERS = 0x00000010; +var DB_STAT_LOCK_OBJECTS = 0x00000020; +var DB_STAT_LOCK_PARAMS = 0x00000040; +var DB_STAT_MEMP_HASH = 0x00000008; +var DB_STAT_MEMP_NOERROR = 0x00000010; +var DB_STAT_SUBSYSTEM = 0x00000002; +var DB_ST_DUPOK = 0x00000200; +var DB_ST_DUPSET = 0x00000400; +var DB_ST_DUPSORT = 0x00000800; +var DB_ST_IS_RECNO = 0x00001000; +var DB_ST_OVFL_LEAF = 0x00002000; +var DB_ST_RECNUM = 0x00004000; +var DB_ST_RELEN = 0x00008000; +var DB_ST_TOPLEVEL = 0x00010000; +var DB_SYSTEM_MEM = 0x00010000; +var DB_THREAD = 0x00000010; +var DB_TIME_NOTGRANTED = 0x00008000; +var DB_TRUNCATE = 0x00004000; +var DB_TXN_NOSYNC = 0x00000001; +var DB_TXN_NOT_DURABLE = 0x00000002; +var DB_TXN_NOWAIT = 0x00000010; +var DB_TXN_SNAPSHOT = 0x00000002; +var DB_TXN_SYNC = 0x00000004; +var DB_TXN_WAIT = 0x00000008; +var DB_TXN_WRITE_NOSYNC = 0x00000020; +var DB_UNREF = 0x00020000; +var DB_UPGRADE = 0x00000001; +var DB_USE_ENVIRON = 0x00000004; +var DB_USE_ENVIRON_ROOT = 0x00000008; +var DB_VERB_DEADLOCK = 0x00000001; +var DB_VERB_FILEOPS = 0x00000002; +var DB_VERB_FILEOPS_ALL = 0x00000004; +var DB_VERB_RECOVERY = 0x00000008; +var DB_VERB_REGISTER = 0x00000010; +var DB_VERB_REPLICATION = 0x00000020; +var DB_VERB_REPMGR_CONNFAIL = 0x00000040; +var DB_VERB_REPMGR_MISC = 0x00000080; +var DB_VERB_REP_ELECT = 0x00000100; +var DB_VERB_REP_LEASE = 0x00000200; +var DB_VERB_REP_MISC = 0x00000400; +var DB_VERB_REP_MSGS = 0x00000800; +var DB_VERB_REP_SYNC = 0x00001000; +var DB_VERB_REP_TEST = 0x00002000; +var DB_VERB_WAITSFOR = 0x00004000; +var DB_VERIFY = 0x00000002; +var DB_VERIFY_PARTITION = 0x00040000; +var DB_WRITECURSOR = 0x00000008; +var DB_WRITELOCK = 0x00000010; +var DB_WRITEOPEN = 0x00008000; +var DB_YIELDCPU = 0x00010000; +// ------------------------- + +var rpmdbe = require('rpmdbe'); +var rpmdb = require('rpmdb'); +var rpmseq = require('rpmseq'); + +var home = "./rpmdb"; +var eflags = DB_CREATE | DB_INIT_LOCK | DB_INIT_MPOOL | DB_INIT_REP | DB_INIT_TXN; +var emode = 0; + +var dbenv = new rpmdbe.Dbe(); +ack("typeof dbenv;", "object"); +ack("dbenv instanceof rpmdbe.Dbe;", true); +ack('dbenv.open(home, eflags, emode)', true); + +var dbfile = "Sequence.db"; +var dbname = "Sequence"; +var oflags = DB_CREATE | DB_AUTO_COMMIT; +var dbtype = DB_HASH; +var dbperms = 0644; + +var db = new rpmdb.Db(dbenv); +ack("typeof db;", "object"); +ack("db instanceof rpmdb.Db;", true); + +var txn = null; +ack('db.open(txn, dbfile, dbname, dbtype, oflags, dbperms)', true); + +var seq = new rpmseq.Seq(db); +ack("typeof seq;", "object"); +ack("seq instanceof rpmseq.Seq;", true); +ack("seq.debug = 1;", 1); +ack("seq.debug = 0;", 0); + +ack("seq.db", db); + +// only effective at creation time +var initval = 1234; +// var rangemin = -5678; +// var rangemax = 5678; +var rangemin = -9223372036854776000; +var rangemax = 9223372036854776000; +ack('seq.initval = initval', initval); + +var key = "foo"; +var soflags = DB_CREATE | DB_THREAD; +var flags = DB_SEQ_INC; + +// must be 0 if txn != null +var cachesize = 0; +ack('seq.cachesize = cachesize', cachesize); + +// var txn = dbenv.txn_begin(null, 0); +// ack('typeof txn', "object"); +// ack('txn instanceof Txn', true); + +ack('seq.open(txn, key, soflags)', true); +ack("seq.key", key); +// ack('seq.rangemin = rangemin', true); +// ack('seq.rangemax = rangemax', true); + +ack("seq.cachesize", cachesize); +ack("seq.flags", flags); +ack("seq.rangemin", rangemin); +ack("seq.rangemax", rangemax); + +ack("seq.st_wait", 0); +ack("seq.st_nowait", 0); +ack("seq.st_current", seq.st_value); +ack("seq.st_last_value", seq.st_value - 1); +ack("seq.st_min", rangemin); +ack("seq.st_max", rangemax); +ack("seq.st_cachesize", cachesize); +ack("seq.st_flags", flags); + +ack('seq.get(txn, 1, DB_TXN_NOSYNC)', seq.st_current); +ack('seq.get(txn, 1, DB_TXN_NOSYNC)', seq.st_current); +ack('seq.get(txn, 1, DB_TXN_NOSYNC)', seq.st_current); + +// ack('txn.commit()', true); +// delete txn; + +ack('seq.close(0)', true); +delete seq; + +ack('db.close(0)', true); +delete db; + +ack('dbenv.close(0)', true); +delete dbenv + +if (loglvl) print("<-- Seq.js"); diff --git a/rpm-5.4.9/js/tscripts/Sm.js b/rpm-5.4.9/js/tscripts/Sm.js new file mode 100644 index 0000000..d7813e6 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Sm.js @@ -0,0 +1,65 @@ +if (loglvl) print("--> Sm.js"); + +const RPMSM_FLAGS_NONE = 0; +const RPMSM_FLAGS_BASE = (1 << 1); /* -b,--base ... */ +const RPMSM_FLAGS_INSTALL = (1 << 2); /* -i,--install ... */ +const RPMSM_FLAGS_LIST = (1 << 3); /* -l,--list-modules ... */ +const RPMSM_FLAGS_REMOVE = (1 << 4); /* -r,--remove ... */ +const RPMSM_FLAGS_UPGRADE = (1 << 5); /* -u,--upgrade ... */ +const RPMSM_FLAGS_RELOAD = (1 << 6); /* -R,--reload ... */ +const RPMSM_FLAGS_BUILD = (1 << 7); /* -B,--build ... */ +const RPMSM_FLAGS_NOAUDIT = (1 << 8); /* -D,--disable_dontaudit ... */ +const RPMSM_FLAGS_COMMIT = (1 << 9); +const RPMSM_FLAGS_CREATE = (1 << 10); +const RPMSM_FLAGS_CONNECT = (1 << 11); +const RPMSM_FLAGS_SELECT = (1 << 12); +const RPMSM_FLAGS_ACCESS = (1 << 13); +const RPMSM_FLAGS_BEGIN = (1 << 14); + +const RPMSM_STATE_CLOSED = 0; +const RPMSM_STATE_SELECTED = 1; +const RPMSM_STATE_ACCESSED = 2; +const RPMSM_STATE_CREATED = 3; +const RPMSM_STATE_CONNECTED = 4; +const RPMSM_STATE_TRANSACTION = 5; + +var rpmsm = require('rpmsm'); + +var dn = "/usr/share/selinux"; +var store = "targeted"; +var flags = RPMSM_FLAGS_SELECT; +var state = RPMSM_STATE_SELECTED; + +var sm = new rpmsm.Sm(store, flags); +ack("typeof sm;", "object"); +ack("sm instanceof rpmsm.Sm;", true); +ack("sm.debug = 1;", 1); +ack("sm.debug = 0;", 0); + +ack("sm.store", store); +ack("sm.flags", flags); +ack("sm.state", state); + +var module = 'unconfined'; + +// var Rcmd = 'Reload '; +// ack('sm(Rcmd);', true); + +var lcmd = 'list ' + module + '-.*'; +ack('sm(lcmd);', 'unconfined-3.0.1'); + +var rcmd = 'remove ' + module; +ack('sm(rcmd);', true); + +var icmd = 'install ' + dn + '/' + store + '/' + module + '.pp.bz2'; +ack('sm(icmd);', true); + +var rcmd = 'remove ' + module; +ack('sm(rcmd);', true); + +var ucmd = 'upgrade ' + dn + '/' + store + '/' + module + '.pp.bz2'; +ack('sm(ucmd);', true); + +delete sm; + +if (loglvl) print("<-- Sm.js"); diff --git a/rpm-5.4.9/js/tscripts/Sp.js b/rpm-5.4.9/js/tscripts/Sp.js new file mode 100644 index 0000000..036c206 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Sp.js @@ -0,0 +1,25 @@ +if (loglvl) print("--> Sp.js"); + +const SYM_COMMONS = 0; +const SYM_CLASSES = 1; +const SYM_ROLES = 2; +const SYM_TYPES = 3; +const SYM_USERS = 4; +const SYM_BOOLS = 5; +const SYM_LEVELS = 6; +const SYM_CATS = 7; +const SYM_NUM = 8; + +var dn = "targeted"; + +var rpmsp = require('rpmsp'); + +var sp = new rpmsp.Sp(dn); +ack("typeof sp;", "object"); +ack("sp instanceof rpmsp.Sp;", true); +ack("sp.debug = 1;", 1); +ack("sp.debug = 0;", 0); + +delete sp; + +if (loglvl) print("<-- Sp.js"); diff --git a/rpm-5.4.9/js/tscripts/St.js b/rpm-5.4.9/js/tscripts/St.js new file mode 100644 index 0000000..c5a1e1e --- /dev/null +++ b/rpm-5.4.9/js/tscripts/St.js @@ -0,0 +1,91 @@ +if (loglvl) print("--> St.js"); + +var rpmst = require('rpmst'); + +var st = new rpmst.St('.'); +ack("typeof st;", "object"); +ack("st instanceof rpmst.St;", true); +ack("st.debug = 1;", 1); +ack("st.debug = 0;", 0); + +st(); + +var dndot = '.'; +var dnroot = '/'; +var dnfurl = 'file:///'; +var popturl = 'http://rpm5.org/files/popt/popt-1.14.tar.gz'; + +st(dndot); + +// print("============="); +// print(JSON.stringify(rpmst.St)); +// print(JSON.stringify(rpmst.St.prototype)); +// print(JSON.stringify(rpmst.St.prototype)); +// print(JSON.stringify(st)); +// print(JSON.stringify(st.__proto__)); +// for (let i in st) +// print(i + ': ' + st[i] + ': ' +st.__proto__[i]); +// print("============="); + +print(" dev: 0x" + st.dev.toString(16)); +print(" ino: " + st.ino); +print(" mode: 0" + st.mode.toString(8)); +print(" nlink: " + st.nlink); +print(" uid: " + st.uid); +print(" gid: " + st.gid); +print(" rdev: 0x" + st.rdev.toString(16)); +print(" size: " + st.size); +print("blksize: " + st.blksize); +print(" blocks: " + st.blocks); +print(" atime: " + st.atime); +print(" mtime: " + st.mtime); +print(" ctime: " + st.ctime); + +delete st; + +var rst = new rpmst.St(dnroot); +var fst = new rpmst.St(dnfurl); + +// print("============="); +// ack('JSON.stringify(rst.__proto__)', JSON.stringify(fst.__proto__)); +// print("============="); +ack("rst.dev", fst.dev); +ack("rst.ino", fst.ino); +ack("rst.mode", fst.mode); +ack("rst.nlink", fst.nlink); +ack("rst.uid", fst.uid); +ack("rst.gid", fst.gid); +ack("rst.rdev", fst.rdev); +ack("rst.size", fst.size); +ack("rst.blksize", fst.blksize); +ack("rst.blocks", fst.blocks); + +// grrr +// ack("rst.atime", fst.atime); +// ack("rst.mtime", fst.mtime); +// ack("rst.ctime", fst.ctime); + +delete fst; +delete rst; + +var st = new rpmst.St(popturl); + +// print(JSON.stringify(st.__proto__)); +ack("st.dev", 0x0); +ack("st.ino", 907648754); +ack("st.mode", 0100644); +ack("st.nlink", 1); +ack("st.uid", 0); +ack("st.gid", 0); +ack("st.rdev", 0x0); +ack("st.size", 695557); +ack("st.blksize", 0); +ack("st.blocks", 1359); + +ack("st.atime", 'Sun Apr 06 2008 12:29:26 GMT-0400 (EST)'); +ack("st.mtime", 'Sun Apr 06 2008 12:29:26 GMT-0400 (EST)'); +ack("st.ctime", 'Sun Apr 06 2008 12:29:26 GMT-0400 (EST)'); + +delete st; + +if (loglvl) print("<-- St.js"); diff --git a/rpm-5.4.9/js/tscripts/Sw.js b/rpm-5.4.9/js/tscripts/Sw.js new file mode 100644 index 0000000..dc8efac --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Sw.js @@ -0,0 +1,11 @@ +if (loglvl) print("--> Sw.js"); + +var GPSEE = require('rpmsw'); + +var sw = new GPSEE.Sw(); +ack("typeof sw;", "object"); +ack("sw instanceof GPSEE.Sw;", true); +ack("sw.debug = 1;", 1); +ack("sw.debug = 0;", 0); + +if (loglvl) print("<-- Sw.js"); diff --git a/rpm-5.4.9/js/tscripts/Sx.js b/rpm-5.4.9/js/tscripts/Sx.js new file mode 100644 index 0000000..3609a67 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Sx.js @@ -0,0 +1,65 @@ +if (loglvl) print("--> Sx.js"); + +var rpmsx = require('rpmsx'); + +var sx = new rpmsx.Sx(); +ack("typeof sx;", "object"); +ack("sx instanceof rpmsx.Sx;", true); +ack("sx.debug = 1;", 1); +ack("sx.debug = 0;", 0); + +print(" enabled: "+sx.enabled); +print(" mlsenabled: "+sx.mlsenabled); +print(" current: "+sx.current); +print(" pid: "+sx.pid); +print(" ppid: "+sx.ppid); +print(" prev: "+sx.prev); +print(" exec: "+sx.exec); +print(" fscreate: "+sx.fscreate); +print(" keycreate: "+sx.keycreate); +print(" sockcreate: "+sx.sockcreate); +print(" enforce: "+sx.enforce); +print(" deny: "+sx.deny); +print(" policyvers: "+sx.policyvers); + +print(" path: "+sx.path); +print(" root: "+sx.root); +print(" booleans: "+sx.booleans); +print(" contexts: "+sx.contexts); +print("customtypes: "+sx.customtypes); +print(" default: "+sx.default); +print(" failsafe: "+sx.failsafe); +print(" fcon: "+sx.fcon); +print(" fconhome: "+sx.fconhome); +print(" fconlocal: "+sx.fconlocal); +print(" fconsubs: "+sx.fconsubs); +print(" homedir: "+sx.homedir); +print(" media: "+sx.media); +print(" netfilter: "+sx.netfilter); +print(" removable: "+sx.removable); +print(" securetty: "+sx.securetty); +print(" user: "+sx.user); +print(" virtdomain: "+sx.virtdomain); +print(" virtimage: "+sx.virtimage); +print(" X: "+sx.X); +print(" binary: "+sx.binary); +print(" usersconf: "+sx.usersconf); +print(" xlations: "+sx.xlations); +print(" colors: "+sx.colors); +print(" users: "+sx.users); + +ack("sx.current = sx.current;", sx.current); +ack("sx.exec = sx.current;", sx.current); +ack("sx.fscreate = sx.current;", sx.current); +ack("sx.keycreate = sx.current;", sx.current); +ack("sx.sockcreate = sx.current;", sx.current); +ack("sx.enforce = sx.enforce;", sx.enforce); + +var fn_bash = '/bin/bash'; +var fn_sh = '/bin/sh'; +ack("sx(fn_bash);", 'system_u:object_r:shell_exec_t:s0'); +ack("sx(fn_sh);", 'system_u:object_r:bin_t:s0'); + +delete sx; + +if (loglvl) print("<-- Sx.js"); diff --git a/rpm-5.4.9/js/tscripts/Syck.js b/rpm-5.4.9/js/tscripts/Syck.js new file mode 100644 index 0000000..7559171 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Syck.js @@ -0,0 +1,11 @@ +if (loglvl) print("--> Syck.js"); + +var GPSEE = require('syck'); + +var syck = new GPSEE.Syck() +ack("typeof syck;", "object"); +ack("syck instanceof Syck;", true); +ack("syck.debug = 1;", 1); +ack("syck.debug = 0;", 0); + +if (loglvl) print("<-- Syck.js"); diff --git a/rpm-5.4.9/js/tscripts/Sys.js b/rpm-5.4.9/js/tscripts/Sys.js new file mode 100644 index 0000000..be8e299 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Sys.js @@ -0,0 +1,97 @@ +if (loglvl) print("--> Sys.js"); + +const R_OK = 4; /* Test for read permission. */ +const W_OK = 2; /* Test for write permission. */ +const X_OK = 1; /* Test for execute permission. */ +const F_OK = 0; /* Test for existence. */ + +var rpmsys = require('rpmsys'); +var rpmst = require('rpmst'); + +var sys = new rpmsys.Sys(); +ack("typeof sys;", "object"); +ack("sys instanceof rpmsys.Sys;", true); +ack("sys.debug = 1;", 1); +ack("sys.debug = 0;", 0); + +var tmpdir = "/tmp"; +var dn = tmpdir + "/sys.d"; +var fn = tmpdir + "/sys.file"; +var lfn = tmpdir + "/sys.link"; +var rfn = tmpdir + "/sys.rename"; +var sfn = tmpdir + "/sys.symlink"; + +ack("sys.ctermid", '/dev/tty'); +print(" ctime: "+sys.ctime); +print(" cwd: "+sys.cwd); +ack("sys.domainname", null); +ack("sys.egid", sys.gid); +ack("sys.euid", sys.uid); +ack("sys.gid", sys.egid); +ack("sys.gid", sys.groups[0]); +nack("sys.hostid", 0x00000000); +print(" hostname: "+sys.hostname); +ack("sys.pid", sys.pgid); +nack("sys.pid", sys.ppid); +ack("sys.sid", sys.tid); +ack("sys.time", sys.timeofday[0]); // timeval class? +ack("sys.uid", sys.euid); +ack("sys.umask", 0022); +// print(" uname: "+sys.uname); // BUGGY + +nack("sys.access(dn, F_OK);", 0); +ack("sys.mkdir(dn);", 0); +ack("sys.access(dn, F_OK);", 0); +ack("sys.rmdir(dn);", 0); + +var st; + +ack("sys.creat(fn,0644);", 0); +st = sys.stat(fn); +ack("st instanceof rpmst.St;", true); +ack("st.uid", sys.uid); +ack("st.gid", sys.gid); +ack("st.mode", 0100644); +ack("sys.chmod(fn,0640);", 0); + +st = sys.lstat(fn); +ack("st instanceof rpmst.St;", true); +print(" ino: " + st.ino); +// print(" mode: 0" + st.mode.toString(8)); +// print(" nlink: " + st.nlink); +// print(" uid: " + st.uid); +// print(" gid: " + st.gid); +// print(" rdev: 0x" + st.rdev.toString(16)); +// print(" size: " + st.size); +// print("blksize: " + st.blksize); +// print(" blocks: " + st.blocks); +// print(" atime: " + st.atime); +// print(" mtime: " + st.mtime); +// print(" ctime: " + st.ctime); + +ack("st.mode", 0100640); +ack("sys.chown(fn,-1,-1);", 0); +ack("sys.chown(fn,sys.uid,-1);", 0); +ack("sys.chown(fn,-1,sys.gid);", 0); +ack("sys.chown(fn,sys.uid,sys.gid);", 0); +ack("(st = sys.lstat(fn)) instanceof rpmst.St;", true); +ack("st.uid", sys.uid); +ack("st.gid", sys.gid); + +ack("sys.link(fn,lfn);", 0); +ack("sys.symlink(lfn,sfn);", 0); +ack("(st = sys.stat(sfn)) instanceof rpmst.St;", true); +ack("st.mode", 0100640); +ack("(st = sys.lstat(sfn)) instanceof rpmst.St;", true); +ack("st.mode", 0120777); +ack("sys.readlink(sfn);", lfn); +ack("sys.rename(lfn,rfn);", 0); + +ack("sys.unlink(fn);", 0); +nack("sys.unlink(lfn);", 0); +ack("sys.unlink(rfn);", 0); +ack("sys.unlink(sfn);", 0); + +delete sys; + +if (loglvl) print("<-- Sys.js"); diff --git a/rpm-5.4.9/js/tscripts/Te.js b/rpm-5.4.9/js/tscripts/Te.js new file mode 100644 index 0000000..ab7ff53 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Te.js @@ -0,0 +1,221 @@ +if (loglvl) print("--> Te.js"); + +var RPMTAG_PROVIDENAME = 1047; + +var RPMNS_TYPE_UNKNOWN = 0; +var RPMNS_TYPE_STRING = (1 << 0); /*!< unclassified string */ +var RPMNS_TYPE_PATH = (1 << 1); /*!< /bin */ +var RPMNS_TYPE_DSO = (1 << 2); /*!< libc.so.6 */ +var RPMNS_TYPE_FUNCTION = (1 << 3); /*!< %{foo} */ +var RPMNS_TYPE_ARCH = (1 << 4); /*!< foo.arch */ +var RPMNS_TYPE_VERSION = (1 << 5); /*!< foo-1.2.3-bar */ +var RPMNS_TYPE_COMPOUND = (1 << 6); /*!< foo.bar */ + /* 7 unused */ +var RPMNS_TYPE_NAMESPACE= (1 << 8); /*!< foo(bar) */ +var RPMNS_TYPE_RPMLIB = (1 << 9); /*!< rpmlib(bar) */ +var RPMNS_TYPE_CPUINFO = (1 << 10); /*!< cpuinfo(bar) */ +var RPMNS_TYPE_GETCONF = (1 << 11); /*!< getconf(bar) */ +var RPMNS_TYPE_UNAME = (1 << 12); /*!< uname(bar) */ +var RPMNS_TYPE_SONAME = (1 << 13); /*!< soname(bar) */ +var RPMNS_TYPE_ACCESS = (1 << 14); /*!< exists(bar) */ +var RPMNS_TYPE_TAG = (1 << 15); /*!< Tag(bar) */ +var RPMNS_TYPE_USER = (1 << 16); /*!< user(bar) */ +var RPMNS_TYPE_GROUP = (1 << 17); /*!< group(bar) */ +var RPMNS_TYPE_MOUNTED = (1 << 18); /*!< mounted(/path) */ +var RPMNS_TYPE_DISKSPACE= (1 << 19); /*!< diskspace(/path) */ +var RPMNS_TYPE_DIGEST = (1 << 20); /*!< digest(/path) = hex */ +var RPMNS_TYPE_GNUPG = (1 << 21); /*!< gnupg(/path/file.asc) */ +var RPMNS_TYPE_MACRO = (1 << 22); /*!< macro(foo) */ +var RPMNS_TYPE_ENVVAR = (1 << 23); /*!< envvar(foo) */ +var RPMNS_TYPE_RUNNING = (1 << 24); /*!< running(foo) */ +var RPMNS_TYPE_SANITY = (1 << 25); /*!< sanitycheck(foo) */ +var RPMNS_TYPE_VCHECK = (1 << 26); /*!< vcheck(foo) */ +var RPMNS_TYPE_SIGNATURE= (1 << 27); /*!< signature(/text:/sig) = /pub:id */ +var RPMNS_TYPE_VERIFY = (1 << 28); /*!< verify(N) = E:V-R */ +var RPMNS_TYPE_CONFIG = (1 << 29); /*!< config(N) = E:V-R */ + +var RPMSENSE_ANY = 0; +var RPMSENSE_SERIAL = (1 << 0); /*!< (obsolete). */ +var RPMSENSE_LESS = (1 << 1); +var RPMSENSE_GREATER = (1 << 2); +var RPMSENSE_EQUAL = (1 << 3); +var RPMSENSE_PROVIDES = (1 << 4); /* only used internally by builds */ +var RPMSENSE_CONFLICTS = (1 << 5); /* only used internally by builds */ +var RPMSENSE_PREREQ = (1 << 6); /*!< (obsolete). */ +var RPMSENSE_OBSOLETES = (1 << 7); /* only used internally by builds */ +var RPMSENSE_INTERP = (1 << 8); /*!< Interpreter used by scriptlet. */ +var RPMSENSE_SCRIPT_PRE = (1 << 9); /*!< %pre dependency. */ +var RPMSENSE_SCRIPT_POST = (1 << 10); /*!< %post dependency. */ +var RPMSENSE_SCRIPT_PREUN = (1 << 11); /*!< %preun dependency. */ +var RPMSENSE_SCRIPT_POSTUN = (1 << 12); /*!< %postun dependency. */ +var RPMSENSE_SCRIPT_VERIFY = (1 << 13); /*!< %verify dependency. */ +var RPMSENSE_FIND_REQUIRES = (1 << 14); /*!< find-requires dependency. */ +var RPMSENSE_FIND_PROVIDES = (1 << 15); /*!< find-provides dependency. */ + +var RPMSENSE_TRIGGERIN = (1 << 16); /*!< %triggerin dependency. */ +var RPMSENSE_TRIGGERUN = (1 << 17); /*!< %triggerun dependency. */ +var RPMSENSE_TRIGGERPOSTUN = (1 << 18); /*!< %triggerpostun dependency. */ +var RPMSENSE_MISSINGOK = (1 << 19); /*!< suggests/enhances hint. */ +var RPMSENSE_SCRIPT_PREP = (1 << 20); /*!< %prep build dependency. */ +var RPMSENSE_SCRIPT_BUILD = (1 << 21); /*!< %build build dependency. */ +var RPMSENSE_SCRIPT_INSTALL = (1 << 22);/*!< %install build dependency. */ +var RPMSENSE_SCRIPT_CLEAN = (1 << 23); /*!< %clean build dependency. */ +var RPMSENSE_RPMLIB = (1 << 24); /*!< rpmlib(feature) dependency. */ +var RPMSENSE_TRIGGERPREIN = (1 << 25); /*!< %triggerprein dependency. */ +var RPMSENSE_KEYRING = (1 << 26); +var RPMSENSE_STRONG = (1 << 27); /*!< placeholder SuSE */ +var RPMSENSE_CONFIG = (1 << 28); +var RPMSENSE_PROBE = (1 << 29); +var RPMSENSE_PACKAGE = (1 << 30); +var RPMSENSE_SCRIPT_SANITYCHECK = (1 << 31); /*!< %sanitycheck dependency. */ + +var rpmts = require('rpmts'); +var rpmte = require('rpmte'); +var rpmds = require('rpmds'); +var rpmfi = require('rpmfi'); +var rpmbf = require('rpmbf'); + +var ts = new rpmts.Ts(); + +var te = new rpmte.Te(ts) +ack("typeof te;", "object"); +ack("te instanceof rpmte.Te;", true); +ack("te.debug = 1;", 1); +ack("te.debug = 0;", 0); +delete te; + +ack("ts.add('+time')", true); +ack("ts.add('+popt')", true); +ack("ts.check()", true); +ack("ts.order()", true); + +te = ts[0]; +ack("typeof te;", "object"); +ack("te instanceof rpmte.Te;", true); + +ack("te.N", "popt"); +ack("te.E", 0); +ack("te.V", "1.13"); +ack("te.R", "5.fc11"); +ack("te.A", "i586"); +ack("te.O", "linux"); +ack("te.NEVR", "popt-1.13-5.fc11.i586"); +ack("te.NEVRA", "popt-1.13-5.fc11.i586"); +ack("te.pkgid", "239098a0368d5589e9dd432944d5eb06"); +ack("te.hdrid", "ca6058bf3cbde1ab84dfdb901a1b32b3dc152f8e"); +ack("te.color", 1); +ack("te.fsize", 0); +ack("te.breadth", 0); +ack("te.depth", 0); +ack("te.npreds", 0); +ack("te.degree", 0); +ack("te.parent", 0); +ack("te.tree", 2); +ack("te.addedkey", 1); +ack("te.dboffset", 0); +ack("te.key", 0); +ack("te.sourcerpm", "popt-1.13-5.fc11.src.rpm"); + + var ds = te.ds(RPMTAG_PROVIDENAME); +ack("typeof ds;", "object"); +ack("ds instanceof rpmds.Ds;", true); + + ack("ds.ix", 0); + ack("ds.N", "libpopt.so.0"); + ack("ds.EVR", ''); + ack("ds.F", RPMSENSE_FIND_PROVIDES); + ack("ds.DNEVR", "P libpopt.so.0"); + ack("ds.NS", RPMNS_TYPE_DSO); + ack("ds.refs += 1;", 1); + ack("ds.result = 1;", 1); + + ack("ds.ix += 1", 1); + ack("ds.N", "libpopt.so.0(LIBPOPT_0)"); + ack("ds.EVR", ''); + ack("ds.F", RPMSENSE_FIND_PROVIDES); + ack("ds.DNEVR", "P libpopt.so.0(LIBPOPT_0)"); + ack("ds.NS", RPMNS_TYPE_NAMESPACE); + ack("ds.refs += 1;", 1); + ack("ds.result = 1;", 1); + + ack("ds.ix += 1", 2); + ack("ds.N", "popt"); + ack("ds.EVR", '1.13-5.fc11'); + ack("ds.F", RPMSENSE_EQUAL); + ack("ds.DNEVR", "P popt = 1.13-5.fc11"); + ack("ds.NS", RPMNS_TYPE_STRING); + ack("ds.refs += 1;", 1); + ack("ds.result = 1;", 1); + + delete ds; + + var fi = te.fi(); +ack("typeof fi;", "object"); +ack("fi instanceof rpmfi.Fi;", true); + + var files = new Array(); + var ix = 0; + for (let [fikey,fival] in Iterator(fi)) { + files[ix++] = fival; + } + ack("ix == fi.length", true); + + ix = 0 + for (var [key,val] in Iterator(fi)) { + ack("key == ix", true); + ack("files[key] == val", true); + ack("fi[key] == val", true); + ack("fi[key] == files[key]", true); + ix++; + } + ack("ix == fi.length", true); + + ack("fi.fc", 32); + ack("fi.fx", -1); + ack("fi.dc", 30); + ack("fi.dx", 29); + + ack("fi.dx = -1;", -1); + ack("++fi.dx;", 0); + ack("++fi.dx;", 1); + + ack("fi.fx = -1;", -1); + ack("fi.fx += 1;", 0); + ack("fi.fx += 1;", 1); + ack("fi.fx += 1;", 2); + +var bn = "libpopt.so.0.0.0"; +var dn = "/lib/"; +var fn = dn + bn; + ack("fi.bn", bn); + ack("fi.dn", dn); + ack("fi.fn", fn); + +var bf = fi.fnbf; +ack("typeof bf;", "object"); +ack("bf instanceof rpmbf.Bf;", true); +ack('bf.chk(bn)', false); +ack('bf.chk(dn)', false); +ack('bf.chk(fn)', true); + + ack("fi.vflags", -1); + ack("fi.fflags", 0); + ack("fi.fmode", 33261); + ack("fi.fstate", 0); + ack("fi.fdigest", "27cc0f6d99f0fb391ddcbaafb7a020da2a265aa687e0b3c317aae80b0d728777"); + ack("fi.flink", ''); + ack("fi.fsize", 32832); + ack("fi.frdev", 0); + ack("fi.fmtime", 0x0); // needs full uint32_t return + ack("fi.fuser", 'root'); + ack("fi.fgroup", 'root'); + ack("fi.fcolor", 1); + ack("fi.fclass", "ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped"); + + delete fi; + +delete te; + +delete ts; + +if (loglvl) print("<-- Te.js"); diff --git a/rpm-5.4.9/js/tscripts/Ts.js b/rpm-5.4.9/js/tscripts/Ts.js new file mode 100644 index 0000000..0687d41 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Ts.js @@ -0,0 +1,60 @@ +if (loglvl) print("--> Ts.js"); + +var RPMTAG_NAME = 1000; +var RPMTAG_PROVIDENAME = 1047; +var RPMTAG_BASENAMES = 1117; + +var RPMMIRE_STRCMP = 1; + +var rpmts = require('rpmts'); +var rpmte = require('rpmte'); + +var ts = new rpmts.Ts(); +ack("typeof ts;", "object"); +ack("ts instanceof rpmts.Ts;", true); +ack("ts.debug = 1;", 1); +ack("ts.debug = 0;", 0); + +var rootdir = "/path/to/rootdir"; +ack("ts.rootdir = rootdir", rootdir); +ack("ts.rootdir = \"/\"", "/"); + +var vsflags = 0x1234; +ack("ts.vsflags = vsflags", vsflags); +ack("ts.vsflags = 0", 0); + +ack("ts.dbrebuild()", true); + +var pat = '^a.*$'; +var a = ts.dbkeys(pat); +var b = ts.dbkeys(pat, RPMTAG_NAME); +var c = ts.dbkeys(pat, RPMTAG_NAME, RPMMIRE_STRCMP); +ack('a.length == b.length', true); +ack('b.length == c.length', true); + +ack("ts.add('-popt')", true); +ack("ts[ts.length-1].N", "popt"); +ack("ts.add('+bash')", true); +ack("ts[ts.length-1].N", "bash"); +ack("ts.add('glibc')", true); +ack("ts[ts.length-1].N", "glibc"); + +var ix = 0; +for (var [key,te] in Iterator(ts)) { + ack("typeof te;", "object"); + ack("te instanceof rpmte.Te;", true); + ack("key == ix", true); +// print(JSON.stringify(te.ds(RPMTAG_NAME))); +// print(JSON.stringify(te.ds(RPMTAG_PROVIDENAME))); +// print(JSON.stringify(te.fi(RPMTAG_BASENAMES))); + ix++; +} +ack("ts.length == ix", true); + +// ack("ts.check()", true); +// ack("ts.order()", true); +// ack("ts.run()", true); + +delete ts; // GCZeal? + +if (loglvl) print("<-- Ts.js"); diff --git a/rpm-5.4.9/js/tscripts/Txn.js b/rpm-5.4.9/js/tscripts/Txn.js new file mode 100644 index 0000000..a70c31a --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Txn.js @@ -0,0 +1,11 @@ +if (loglvl) print("--> Txn.js"); + +var rpmtxn = require('rpmtxn'); + +var txn = new rpmtxn.Txn(); +ack("typeof txn;", "object"); +ack("txn instanceof rpmtxn.Txn;", true); +ack("txn.debug = 1;", 1); +ack("txn.debug = 0;", 0); + +if (loglvl) print("<-- Txn.js"); diff --git a/rpm-5.4.9/js/tscripts/Uuid.js b/rpm-5.4.9/js/tscripts/Uuid.js new file mode 100644 index 0000000..163a650 --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Uuid.js @@ -0,0 +1,20 @@ +if (loglvl) print("--> Uuid.js"); + +var ns = "ns:URL"; +var abc = "http://rpm5.org/abc"; + +var GPSEE = require('uuid'); +var uuid = new GPSEE.Uuid(ns); +ack("typeof uuid;", "object"); +ack("uuid instanceof GPSEE.Uuid;", true); +ack("uuid.debug = 1;", 1); +ack("uuid.debug = 0;", 0); + +ack("uuid.describe(uuid.generate(1))", undefined); +ack("uuid.describe(uuid.generate(3, ns, abc));",undefined); +ack("uuid.describe(uuid.generate(4))", undefined); +ack("uuid.describe(uuid.generate(5, ns, abc));",undefined); + +delete uuid; + +if (loglvl) print("<-- Uuid.js"); diff --git a/rpm-5.4.9/js/tscripts/Xar.js b/rpm-5.4.9/js/tscripts/Xar.js new file mode 100644 index 0000000..9fcfd2d --- /dev/null +++ b/rpm-5.4.9/js/tscripts/Xar.js @@ -0,0 +1,31 @@ +if (loglvl) print("--> Xar.js"); + +var fn = "popt-1.14.xar"; +var path = null; +var st = null; +var ix = 0; + +var rpmxar = require('rpmxar'); +var rpmst = require('rpmst'); + +var xar = new rpmxar.Xar(fn, "r"); +ack("typeof xar;", "object"); +ack("xar instanceof rpmxar.Xar;", true); +ack("xar.debug = 1;", 1); +ack("xar.debug = 0;", 0); + +ix = 0; +ack("xar.length", undefined); // XXX ensure undefined or 0 until iterated +for (var [key,val] in Iterator(xar)) { + path = val[0]; + st = val[1]; + print("key: "+key, "val: "+path); + print('\t0'+st.mode.toString(8)+' '+st.uid+'/'+st.gid+' '+st.size+' '+st.mtime); + ix++; +} +ack("ix > 0", true); +ack("xar.length", ix); + +delete xar; + +if (loglvl) print("<-- Xar.js"); diff --git a/rpm-5.4.9/js/uuid-js.c b/rpm-5.4.9/js/uuid-js.c new file mode 100644 index 0000000..f0e0cf6 --- /dev/null +++ b/rpm-5.4.9/js/uuid-js.c @@ -0,0 +1,334 @@ +/** \ingroup js_c + * \file js/uuid-js.c + */ + +#if defined(__APPLE__) +/* workaround for "uuid_t" type conflict, between and "uuid.h" */ +#define _UUID_T +#define uuid_t __darwin_uuid_t +#include +#undef uuid_t +#undef _UUID_T +#endif + +#include "system.h" + +#include "rpmjs-debug.h" + +#if defined(WITH_UUID) +#include +#include "uuid-js.h" + +#include "debug.h" + +/*@unchecked@*/ +static int _debug = 0; + +#define uuid_addprop JS_PropertyStub +#define uuid_delprop JS_PropertyStub +#define uuid_convert JS_ConvertStub + +typedef struct uuid_s { + const char * ns_str; + uuid_t * ns; +} * JSUuid; + +/* --- helpers */ + +/* --- Object methods */ + +static JSBool +uuid_generate(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &uuidClass, NULL); + int32 version = 0; + const char *uuid_ns_str = NULL; + const char *data = NULL; + uuid_t *uuid = NULL; + uuid_t *uuid_ns = NULL; + uuid_rc_t rc; + char buf[UUID_LEN_STR+1]; + char *b = buf; + size_t blen = sizeof(buf); + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + ok = JS_ConvertArguments(cx, argc, argv, "i/ss", + &version, &uuid_ns_str, &data); + if (!ok) + goto exit; + + switch (version) { + default: goto exit; /*@notreached@*/ break; + case 1: + case 4: + break; + case 3: + case 5: + if (uuid_ns_str == NULL || data == NULL + || (rc = uuid_create(&uuid_ns)) != UUID_RC_OK) + goto exit; + if ((rc = uuid_load(uuid_ns, uuid_ns_str)) != UUID_RC_OK + && (rc = uuid_import(uuid_ns, UUID_FMT_STR, uuid_ns_str, strlen(uuid_ns_str))) != UUID_RC_OK) + goto exit; + break; + } + + if ((rc = uuid_create(&uuid)) != UUID_RC_OK) + goto exit; + + switch (version) { + default: goto exit; /*@notreached@*/break; + case 1: rc = uuid_make(uuid, UUID_MAKE_V1); break; + case 3: rc = uuid_make(uuid, UUID_MAKE_V3, uuid_ns, data); break; + case 4: rc = uuid_make(uuid, UUID_MAKE_V4); break; + case 5: rc = uuid_make(uuid, UUID_MAKE_V5, uuid_ns, data); break; + } + if (rc != UUID_RC_OK) + goto exit; + + if ((rc = uuid_export(uuid, UUID_FMT_STR, &b, &blen)) == UUID_RC_OK) { + JSString *str; + if ((str = JS_NewStringCopyZ(cx, b)) != NULL) { + *vp = STRING_TO_JSVAL(str); + ok = JS_TRUE; + } + } + +exit: + if (uuid != NULL) + uuid_destroy(uuid); + if (uuid_ns != NULL) + uuid_destroy(uuid_ns); + return ok; +} + +static JSBool +uuid_describe(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_THIS_OBJECT(cx, vp); + void * ptr = JS_GetInstancePrivate(cx, obj, &uuidClass, NULL); + uuid_t *uuid = NULL; + const char *uuid_str = NULL; + uuid_rc_t rc; + char *b = NULL; + size_t blen = 0; + JSBool ok = JS_FALSE; + +_METHOD_DEBUG_ENTRY(_debug); + + ok = JS_ConvertArguments(cx, argc, argv, "s", &uuid_str); + if (!ok) + goto exit; + + if ((rc = uuid_create(&uuid)) == UUID_RC_OK + && (rc = uuid_import(uuid, UUID_FMT_STR, uuid_str, strlen(uuid_str))) == UUID_RC_OK + && (rc = uuid_export(uuid, UUID_FMT_TXT, &b, &blen)) == UUID_RC_OK) + { JSString *str; + if ((str = JS_NewStringCopyZ(cx, b)) != NULL) { + *vp = STRING_TO_JSVAL(str); + ok = JS_TRUE; + } + } + +exit: + b = _free(b); + if (uuid != NULL) + uuid_destroy(uuid); + return ok; +} + +static JSFunctionSpec uuid_funcs[] = { + JS_FS("generate", uuid_generate, 0,0), + JS_FS("describe", uuid_describe, 0,0), + JS_FS_END +}; + +/* --- Object properties */ +enum uuid_tinyid { + _DEBUG = -2, +}; + +static JSPropertySpec uuid_props[] = { + {"debug", _DEBUG, JSPROP_ENUMERATE, NULL, NULL}, + {NULL, 0, 0, NULL, NULL} +}; + +static JSBool +uuid_getprop(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &uuidClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + if (JSVAL_IS_STRING(id)) { + char * str = JS_EncodeString(cx, JSVAL_TO_STRING(id)); + const JSFunctionSpec *fsp; + for (fsp = uuid_funcs; fsp->name != NULL; fsp++) { + if (strcmp(fsp->name, str)) + continue; + break; + } + str = _free(str); + goto exit; + } + + switch (tiny) { + case _DEBUG: + *vp = INT_TO_JSVAL(_debug); + break; + default: + break; + } +exit: + return JS_TRUE; +} + +static JSBool +uuid_setprop(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &uuidClass, NULL); + jsint tiny = JSVAL_TO_INT(id); + + /* XXX the class has ptr == NULL, instances have ptr != NULL. */ + if (ptr == NULL) + return JS_TRUE; + + switch (tiny) { + case _DEBUG: + if (!JS_ValueToInt32(cx, *vp, &_debug)) + break; + break; + default: + break; + } + + return JS_TRUE; +} + +static JSBool +uuid_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, + JSObject **objp) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &uuidClass, NULL); + +_RESOLVE_DEBUG_ENTRY(_debug); + + if ((flags & JSRESOLVE_ASSIGNING) + || (ptr == NULL)) { /* don't resolve to parent prototypes objects. */ + *objp = NULL; + goto exit; + } + + *objp = obj; /* XXX always resolve in this object. */ + +exit: + return JS_TRUE; +} + +static JSBool +uuid_enumerate(JSContext *cx, JSObject *obj, JSIterateOp op, + jsval *statep, jsid *idp) +{ + JSObject *iterator; + JSBool ok = JS_FALSE; + +_ENUMERATE_DEBUG_ENTRY(_debug); + + switch (op) { + case JSENUMERATE_INIT: + case JSENUMERATE_INIT_ALL: + if ((iterator = JS_NewPropertyIterator(cx, obj)) == NULL) + goto exit; + *statep = OBJECT_TO_JSVAL(iterator); + if (idp) + *idp = JSVAL_ZERO; + break; + case JSENUMERATE_NEXT: + iterator = (JSObject *) JSVAL_TO_OBJECT(*statep); + if (!JS_NextProperty(cx, iterator, idp)) + goto exit; + if (!JSID_IS_VOID(*idp)) + break; + /*@fallthrough@*/ + case JSENUMERATE_DESTROY: + /* Allow our iterator object to be GC'd. */ + *statep = JSVAL_NULL; + break; + } + ok = JS_TRUE; +exit: + return ok; +} + +/* --- Object ctors/dtors */ +static void +uuid_dtor(JSContext *cx, JSObject *obj) +{ + void * ptr = JS_GetInstancePrivate(cx, obj, &uuidClass, NULL); + +_DTOR_DEBUG_ENTRY(_debug); + + ptr = _free(ptr); +} + +static JSBool +uuid_ctor(JSContext *cx, uintN argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + JSObject *obj = JS_NewObjectForConstructor(cx, vp); + JSBool ok = JS_FALSE; + +_CTOR_DEBUG_ENTRY(_debug); + + if (JS_IsConstructing(cx, vp)) { + JSUuid ptr = xcalloc(0, sizeof(*ptr)); + + if (ptr == NULL || !JS_SetPrivate(cx, obj, ptr)) { + ptr = _free(ptr); + goto exit; + } + } else { + if ((obj = JS_NewObject(cx, &uuidClass, NULL, NULL)) == NULL) + goto exit; + *vp = OBJECT_TO_JSVAL(obj); + } + ok = JS_TRUE; + +exit: + return ok; +} + +/* --- Class initialization */ +JSClass uuidClass = { + "Uuid", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE, + uuid_addprop, uuid_delprop, uuid_getprop, uuid_setprop, + (JSEnumerateOp)uuid_enumerate, (JSResolveOp)uuid_resolve, + uuid_convert, uuid_dtor, + JSCLASS_NO_OPTIONAL_MEMBERS +}; + +JSObject * +rpmjs_InitUuidClass(JSContext *cx, JSObject* obj) +{ + JSObject * o; + +if (_debug) +fprintf(stderr, "==> %s(%p,%p)\n", __FUNCTION__, cx, obj); + + o = JS_InitClass(cx, obj, NULL, &uuidClass, uuid_ctor, 1, + uuid_props, uuid_funcs, NULL, NULL); +assert(o != NULL); + return o; +} + +GPSEE_MODULE_WRAP(uuid, Uuid, JS_TRUE) + +#endif /* WITH_UUID */ diff --git a/rpm-5.4.9/js/uuid-js.h b/rpm-5.4.9/js/uuid-js.h new file mode 100644 index 0000000..892b47e --- /dev/null +++ b/rpm-5.4.9/js/uuid-js.h @@ -0,0 +1,23 @@ +#ifndef H_UUID_JS +#define H_UUID_JS + +/** + * \file js/uuid-js.h + */ + +#include "rpm-js.h" + +extern JSClass uuidClass; + +#ifdef __cplusplus +extern "C" { +#endif + +extern JSObject* +rpmjs_InitUuidClass(JSContext *cx, JSObject* obj); + +#ifdef __cplusplus +} +#endif + +#endif /* H_UUID_JS */ diff --git a/rpm-5.4.9/lib/Makefile.am b/rpm-5.4.9/lib/Makefile.am new file mode 100644 index 0000000..21c988d --- /dev/null +++ b/rpm-5.4.9/lib/Makefile.am @@ -0,0 +1,191 @@ +# Makefile for rpm library. + +AUTOMAKE_OPTIONS = 1.4 foreign + +LINT = splint +MCCABE = pmccabe + +SUBDIRS = auto # tests + +AM_CPPFLAGS = \ + -I$(srcdir) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/build \ + -I$(top_srcdir)/lib \ + -I$(top_builddir)/lib \ + -I$(top_srcdir)/rpmdb \ + -I$(top_srcdir)/rpmio \ + -I$(top_srcdir)/misc \ + @WITH_BEECRYPT_CPPFLAGS@ \ + @WITH_DB_CPPFLAGS@ \ + @WITH_FILE_CPPFLAGS@ \ + @WITH_LUA_CPPFLAGS@ \ + @WITH_PCRE_CPPFLAGS@ \ + @WITH_POPT_CPPFLAGS@ \ + @WITH_SYCK_CPPFLAGS@ \ + @WITH_XAR_CPPFLAGS@ \ + @WITH_ZLIB_CPPFLAGS@ + +AM_CFLAGS = $(OPENMP_CFLAGS) + +RPMMISC_LDADD_COMMON = \ + $(top_builddir)/misc/librpmmisc.la \ + @LTLIBINTL@ +RPMIO_LDADD_COMMON = \ + $(top_builddir)/rpmio/librpmio.la \ + $(RPMMISC_LDADD_COMMON) +RPMDB_LDADD_COMMON = \ + $(top_builddir)/rpmdb/librpmdb.la \ + $(RPMIO_LDADD_COMMON) +RPM_LDADD_COMMON = \ + $(top_builddir)/lib/librpm.la \ + $(RPMDB_LDADD_COMMON) +RPMBUILD_LDADD_COMMON = \ + $(top_builddir)/build/librpmbuild.la \ + $(RPM_LDADD_COMMON) + +EXTRA_DIST = librpm.vers + +EXTRA_PROGRAMS = tevr tgi tsbt + +#XYZ: +# mkdir -p $@ +# +#XYZ/%.cpp: %.c +# @echo $(SUFFIXES) +# @cp $< $@ + +#pkglibdir = @USRLIBRPM@ +#pkglib_LTLIBRARIES = libsql.la + +pkgincdir = $(pkgincludedir)$(WITH_PATH_VERSIONED_SUFFIX) +pkginc_HEADERS = \ + rpmcli.h rpmversion.h rpmds.h rpmfi.h rpmgi.h rpmps.h \ + rpmrc.h rpmte.h rpmts.h rpm4compat.h rpm46compat.h +noinst_HEADERS = \ + filetriggers.h fs.h fsm.h manifest.h misc.h psm.h rpmal.h \ + rpmfc.h rpmlib.h rpmlock.h rpmluaext.h rpmrollback.h + +usrlibdir = $(libdir) +usrlib_LTLIBRARIES = librpm.la +librpm_la_SOURCES = \ + formats.c fsm.c order.c poptI.c psm.c \ + depends.c \ + filetriggers.c \ + fs.c \ + manifest.c \ + misc.c \ + poptALL.c \ + poptQV.c \ + query.c \ + rpmal.c \ + rpmchecksig.c \ + rpmds.c \ + rpmfc.c \ + rpmfi.c \ + rpmgi.c \ + rpminstall.c \ + rpmlock.c \ + rpmluaext.c \ + rpmps.c \ + rpmrc.c \ + rpmrollback.c \ + rpmte.c \ + rpmts.c \ + rpmversion.c \ + transaction.c \ + verify.c + +librpm_la_LDFLAGS = -release $(LT_CURRENT).$(LT_REVISION) +if HAVE_LD_VERSION_SCRIPT +librpm_la_LDFLAGS += -Wl,@LD_VERSION_SCRIPT_FLAG@,@top_srcdir@/lib/librpm.vers +endif +librpm_la_LIBADD = +if ENABLE_BUILD_INTLIBDEP +librpm_la_LIBADD += \ + $(top_builddir)/rpmdb/librpmdb.la \ + $(top_builddir)/rpmio/librpmio.la \ + $(top_builddir)/misc/librpmmisc.la +endif +if ENABLE_BUILD_MAXEXTLIBDEP +librpm_la_LDFLAGS += $(LDFLAGS) +librpm_la_LIBADD += $(LIBS) +endif +librpm.la: $(librpm_la_OBJECTS) $(librpm_la_DEPENDENCIES) + $(librpm_la_LINK) -rpath $(usrlibdir) $(librpm_la_OBJECTS) $(librpm_la_LIBADD) + +#libsql_la_SOURCES = libsql.c +#libsql_la_LIBADD = librpm.la $(RPMDB_LDADD_COMMON) + +install-data-hook: +if !ENABLE_BUILD_LAFILES + -for l in $(usrlib_LTLIBRARIES); do \ + rm -f $(DESTDIR)$(usrlibdir)/$${l}; \ + done +endif +if WITH_PATH_VERSIONED + -for l in $(usrlib_LTLIBRARIES); do \ + base=`echo "$${l}" | sed -e 's;\.la$$;;'`; \ + if [ -f $(DESTDIR)$(usrlibdir)/$${base}.a ]; then \ + mv $(DESTDIR)$(usrlibdir)/$${base}.a \ + $(DESTDIR)$(usrlibdir)/$${base}-$(VERSION).a; \ + fi; \ + done +endif + +check-local: + +BUILT_SOURCES = # rpmlib.lcd + +rpmlib.lcd: Makefile.am ${librpm_la_SOURCES} ${pkginc_HEADERS} ${noinst_HEADERS} + -lclint ${DEFS} ${INCLUDES} ${librpm_la_SOURCES} -dump $@ 2>/dev/null + +.PHONY: sources +sources: + @echo $(librpm_la_SOURCES:%=lib/%) + +.PHONY: lint +lint: + $(LINT) $(DEFS) $(INCLUDES) $(librpm_la_SOURCES) + +.PHONY: mccabe +mccabe: + $(MCCABE) $(librpm_la_SOURCES) | sort -n -r | head -n 20 + +.PHONY: lcov-reset # run lcov from scratch, always +lcov-reset: + make lcov-run + make lcov-report + +.PHONY: lcov # run lcov from scratch if the dir is not there +lcov: + make lcov-reset + +.PHONY: lcov-run # reset run coverage tests +lcov-run: + @-rm -rf lcov + find . -name "*.gcda" -exec rm {} \; + make check + +.PHONY: lcov-report # generate report based on current coverage data +lcov-report: + mkdir lcov + lcov --directory . --capture --output-file lcov/lcov.info + lcov -l lcov/lcov.info | grep -v "`cd $(top_srcdir) && pwd`" | cut -d: -f1 > lcov/remove + lcov -r lcov/lcov.info `cat lcov/remove` > lcov/lcov.cleaned.info + rm lcov/remove + mv lcov/lcov.cleaned.info lcov/lcov.info + genhtml -t "$(PACKAGE_STRING)" -o lcov lcov/lcov.info + +#.PHONY: lcov-upload +#lcov-upload: lcov +# rsync -rvz -e ssh --delete lcov/* ??? + +tevr_SOURCES = tevr.c +tevr_LDADD = $(RPMBUILD_LDADD) + +tgi_SOURCES = tgi.c +tgi_LDADD = $(RPMBUILD_LDADD) + +tsbt_SOURCES = tsbt.c +tsbt_LDADD = $(RPM_LDADD) diff --git a/rpm-5.4.9/lib/Makefile.in b/rpm-5.4.9/lib/Makefile.in new file mode 100644 index 0000000..3ffc45d --- /dev/null +++ b/rpm-5.4.9/lib/Makefile.in @@ -0,0 +1,1305 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ + +# Makefile for rpm library. + + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +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@ +target_triplet = @target@ +EXTRA_PROGRAMS = tevr$(EXEEXT) tgi$(EXEEXT) tsbt$(EXEEXT) +@HAVE_LD_VERSION_SCRIPT_TRUE@am__append_1 = -Wl,@LD_VERSION_SCRIPT_FLAG@,@top_srcdir@/lib/librpm.vers +@ENABLE_BUILD_INTLIBDEP_TRUE@am__append_2 = \ +@ENABLE_BUILD_INTLIBDEP_TRUE@ $(top_builddir)/rpmdb/librpmdb.la \ +@ENABLE_BUILD_INTLIBDEP_TRUE@ $(top_builddir)/rpmio/librpmio.la \ +@ENABLE_BUILD_INTLIBDEP_TRUE@ $(top_builddir)/misc/librpmmisc.la + +@ENABLE_BUILD_MAXEXTLIBDEP_TRUE@am__append_3 = $(LDFLAGS) +@ENABLE_BUILD_MAXEXTLIBDEP_TRUE@am__append_4 = $(LIBS) +subdir = lib +DIST_COMMON = $(noinst_HEADERS) $(pkginc_HEADERS) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/rpmversion.h.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = rpmversion.h +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(usrlibdir)" "$(DESTDIR)$(pkgincdir)" +LTLIBRARIES = $(usrlib_LTLIBRARIES) +am__DEPENDENCIES_1 = +@ENABLE_BUILD_MAXEXTLIBDEP_TRUE@am__DEPENDENCIES_2 = \ +@ENABLE_BUILD_MAXEXTLIBDEP_TRUE@ $(am__DEPENDENCIES_1) +librpm_la_DEPENDENCIES = $(am__append_2) $(am__DEPENDENCIES_2) +am_librpm_la_OBJECTS = formats.lo fsm.lo order.lo poptI.lo psm.lo \ + depends.lo filetriggers.lo fs.lo manifest.lo misc.lo \ + poptALL.lo poptQV.lo query.lo rpmal.lo rpmchecksig.lo rpmds.lo \ + rpmfc.lo rpmfi.lo rpmgi.lo rpminstall.lo rpmlock.lo \ + rpmluaext.lo rpmps.lo rpmrc.lo rpmrollback.lo rpmte.lo \ + rpmts.lo rpmversion.lo transaction.lo verify.lo +librpm_la_OBJECTS = $(am_librpm_la_OBJECTS) +librpm_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(librpm_la_LDFLAGS) $(LDFLAGS) -o $@ +am_tevr_OBJECTS = tevr.$(OBJEXT) +tevr_OBJECTS = $(am_tevr_OBJECTS) +tevr_DEPENDENCIES = +am_tgi_OBJECTS = tgi.$(OBJEXT) +tgi_OBJECTS = $(am_tgi_OBJECTS) +tgi_DEPENDENCIES = +am_tsbt_OBJECTS = tsbt.$(OBJEXT) +tsbt_OBJECTS = $(am_tsbt_OBJECTS) +tsbt_DEPENDENCIES = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(librpm_la_SOURCES) $(tevr_SOURCES) $(tgi_SOURCES) \ + $(tsbt_SOURCES) +DIST_SOURCES = $(librpm_la_SOURCES) $(tevr_SOURCES) $(tgi_SOURCES) \ + $(tsbt_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +HEADERS = $(noinst_HEADERS) $(pkginc_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDROOTDIR_MACRO = @BUILDROOTDIR_MACRO@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBAPI = @DBAPI@ +DBLIBOBJS = @DBLIBOBJS@ +DBLIBSRCS = @DBLIBSRCS@ +DBPATH = @DBPATH@ +DBPATH_MACRO = @DBPATH_MACRO@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTRO_MACROS = @DISTRO_MACROS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIXPERMS = @FIXPERMS@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GPSEE_MODULES_PATH = @GPSEE_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_STATIC = @LDFLAGS_STATIC@ +LD_VERSION_SCRIPT_FLAG = @LD_VERSION_SCRIPT_FLAG@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOLIZE = @LIBTOOLIZE@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MACROFILES = @MACROFILES@ +MAGIC_MACRO = @MAGIC_MACRO@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR = @MKDIR@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NCPUS_COMMAND = @NCPUS_COMMAND@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENMP_CFLAGS = @OPENMP_CFLAGS@ +OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_INSTALLDIRS = @PERL_INSTALLDIRS@ +PERL_URPM_INSTALLDIRS = @PERL_URPM_INSTALLDIRS@ +PKGSRCDIR = @PKGSRCDIR@ +PKGSRCDIR_MACRO = @PKGSRCDIR_MACRO@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +ROOT_GROUP = @ROOT_GROUP@ +RPMCANONARCH = @RPMCANONARCH@ +RPMCANONCOLOR = @RPMCANONCOLOR@ +RPMCANONGNU = @RPMCANONGNU@ +RPMCANONOS = @RPMCANONOS@ +RPMCANONVENDOR = @RPMCANONVENDOR@ +RPMGID = @RPMGID@ +RPMGROUP = @RPMGROUP@ +RPMLUAFILES = @RPMLUAFILES@ +RPMPOPTFILES = @RPMPOPTFILES@ +RPMUID = @RPMUID@ +RPMUSER = @RPMUSER@ +RPM_TIMESTAMP = @RPM_TIMESTAMP@ +RPM_VENDOR = @RPM_VENDOR@ +RPM_VERSION = @RPM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFIGDIR = @SYSCONFIGDIR@ +USE_NLS = @USE_NLS@ +USRLIBRPM = @USRLIBRPM@ +VERSION = @VERSION@ +WITH_ACL = @WITH_ACL@ +WITH_APIDOCS = @WITH_APIDOCS@ +WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ +WITH_APR = @WITH_APR@ +WITH_ATERM = @WITH_ATERM@ +WITH_ATTR = @WITH_ATTR@ +WITH_AUGEAS = @WITH_AUGEAS@ +WITH_AUGEAS_AUGTOOL = @WITH_AUGEAS_AUGTOOL@ +WITH_BASH = @WITH_BASH@ +WITH_BASH_CPPFLAGS = @WITH_BASH_CPPFLAGS@ +WITH_BASH_LDFLAGS = @WITH_BASH_LDFLAGS@ +WITH_BASH_LIBS = @WITH_BASH_LIBS@ +WITH_BASH_SUBDIR = @WITH_BASH_SUBDIR@ +WITH_BEECRYPT = @WITH_BEECRYPT@ +WITH_BEECRYPT_CPPFLAGS = @WITH_BEECRYPT_CPPFLAGS@ +WITH_BEECRYPT_LDFLAGS = @WITH_BEECRYPT_LDFLAGS@ +WITH_BEECRYPT_LIBS = @WITH_BEECRYPT_LIBS@ +WITH_BEECRYPT_SUBDIR = @WITH_BEECRYPT_SUBDIR@ +WITH_BZIP2 = @WITH_BZIP2@ +WITH_CPUINFO = @WITH_CPUINFO@ +WITH_CUDF = @WITH_CUDF@ +WITH_CUDF_CUDFTOOL = @WITH_CUDF_CUDFTOOL@ +WITH_DB = @WITH_DB@ +WITH_DBSQL = @WITH_DBSQL@ +WITH_DBSQL_CPPFLAGS = @WITH_DBSQL_CPPFLAGS@ +WITH_DBSQL_LDFLAGS = @WITH_DBSQL_LDFLAGS@ +WITH_DBSQL_LIBS = @WITH_DBSQL_LIBS@ +WITH_DBSQL_SUBDIR = @WITH_DBSQL_SUBDIR@ +WITH_DB_CPPFLAGS = @WITH_DB_CPPFLAGS@ +WITH_DB_LDFLAGS = @WITH_DB_LDFLAGS@ +WITH_DB_LIBS = @WITH_DB_LIBS@ +WITH_DB_SUBDIR = @WITH_DB_SUBDIR@ +WITH_DMALLOC = @WITH_DMALLOC@ +WITH_EFENCE = @WITH_EFENCE@ +WITH_EXPAT = @WITH_EXPAT@ +WITH_FICL = @WITH_FICL@ +WITH_FICL_CPPFLAGS = @WITH_FICL_CPPFLAGS@ +WITH_FICL_LDFLAGS = @WITH_FICL_LDFLAGS@ +WITH_FICL_LIBS = @WITH_FICL_LIBS@ +WITH_FICL_SUBDIR = @WITH_FICL_SUBDIR@ +WITH_FILE = @WITH_FILE@ +WITH_FILE_CPPFLAGS = @WITH_FILE_CPPFLAGS@ +WITH_FILE_LDFLAGS = @WITH_FILE_LDFLAGS@ +WITH_FILE_LIBS = @WITH_FILE_LIBS@ +WITH_FILE_SUBDIR = @WITH_FILE_SUBDIR@ +WITH_GCRYPT = @WITH_GCRYPT@ +WITH_GNUTLS = @WITH_GNUTLS@ +WITH_GPSEE = @WITH_GPSEE@ +WITH_GPSEE_CPPFLAGS = @WITH_GPSEE_CPPFLAGS@ +WITH_GPSEE_LDFLAGS = @WITH_GPSEE_LDFLAGS@ +WITH_GPSEE_LIBS = @WITH_GPSEE_LIBS@ +WITH_GPSEE_SUBDIR = @WITH_GPSEE_SUBDIR@ +WITH_JS_SUBDIR = @WITH_JS_SUBDIR@ +WITH_KEYUTILS = @WITH_KEYUTILS@ +WITH_KEYUTILS_RPMKEY = @WITH_KEYUTILS_RPMKEY@ +WITH_LIBELF_DEBUGEDIT = @WITH_LIBELF_DEBUGEDIT@ +WITH_LIBGIT2 = @WITH_LIBGIT2@ +WITH_LIBGIT2_CPPFLAGS = @WITH_LIBGIT2_CPPFLAGS@ +WITH_LIBGIT2_LDFLAGS = @WITH_LIBGIT2_LDFLAGS@ +WITH_LIBGIT2_LIBS = @WITH_LIBGIT2_LIBS@ +WITH_LIBGIT2_SUBDIR = @WITH_LIBGIT2_SUBDIR@ +WITH_LIBTASN1 = @WITH_LIBTASN1@ +WITH_LUA = @WITH_LUA@ +WITH_LUA_CPPFLAGS = @WITH_LUA_CPPFLAGS@ +WITH_LUA_LDFLAGS = @WITH_LUA_LDFLAGS@ +WITH_LUA_LIBS = @WITH_LUA_LIBS@ +WITH_LUA_SUBDIR = @WITH_LUA_SUBDIR@ +WITH_LUA_SUBDIR_DEF = @WITH_LUA_SUBDIR_DEF@ +WITH_LUA_SUBDIR_LIB = @WITH_LUA_SUBDIR_LIB@ +WITH_MOZJS185 = @WITH_MOZJS185@ +WITH_MOZJS185_CPPFLAGS = @WITH_MOZJS185_CPPFLAGS@ +WITH_MOZJS185_LDFLAGS = @WITH_MOZJS185_LDFLAGS@ +WITH_MOZJS185_LIBS = @WITH_MOZJS185_LIBS@ +WITH_MOZJS185_SUBDIR = @WITH_MOZJS185_SUBDIR@ +WITH_NEON = @WITH_NEON@ +WITH_NEON_CPPFLAGS = @WITH_NEON_CPPFLAGS@ +WITH_NEON_LDFLAGS = @WITH_NEON_LDFLAGS@ +WITH_NEON_LIBS = @WITH_NEON_LIBS@ +WITH_NEON_SUBDIR = @WITH_NEON_SUBDIR@ +WITH_NIX = @WITH_NIX@ +WITH_NSS = @WITH_NSS@ +WITH_OPENSSL = @WITH_OPENSSL@ +WITH_PAKCHOIS = @WITH_PAKCHOIS@ +WITH_PATH_VERSIONED = @WITH_PATH_VERSIONED@ +WITH_PATH_VERSIONED_SUFFIX = @WITH_PATH_VERSIONED_SUFFIX@ +WITH_PCRE = @WITH_PCRE@ +WITH_PCRE_CPPFLAGS = @WITH_PCRE_CPPFLAGS@ +WITH_PCRE_LDFLAGS = @WITH_PCRE_LDFLAGS@ +WITH_PCRE_LIBS = @WITH_PCRE_LIBS@ +WITH_PCRE_SUBDIR = @WITH_PCRE_SUBDIR@ +WITH_PERLEMBED = @WITH_PERLEMBED@ +WITH_PERL_LIBS = @WITH_PERL_LIBS@ +WITH_PERL_SUBDIR = @WITH_PERL_SUBDIR@ +WITH_PERL_SUBPACKAGE = @WITH_PERL_SUBPACKAGE@ +WITH_PERL_URPM_LIBS = @WITH_PERL_URPM_LIBS@ +WITH_PERL_URPM_SUBDIR = @WITH_PERL_URPM_SUBDIR@ +WITH_PERL_URPM_SUBPACKAGE = @WITH_PERL_URPM_SUBPACKAGE@ +WITH_POPT = @WITH_POPT@ +WITH_POPT_CPPFLAGS = @WITH_POPT_CPPFLAGS@ +WITH_POPT_LDFLAGS = @WITH_POPT_LDFLAGS@ +WITH_POPT_LIBS = @WITH_POPT_LIBS@ +WITH_POPT_SUBDIR = @WITH_POPT_SUBDIR@ +WITH_PYTHONEMBED = @WITH_PYTHONEMBED@ +WITH_PYTHON_INCDIR = @WITH_PYTHON_INCDIR@ +WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ +WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ +WITH_RC = @WITH_RC@ +WITH_RC_CPPFLAGS = @WITH_RC_CPPFLAGS@ +WITH_RC_LDFLAGS = @WITH_RC_LDFLAGS@ +WITH_RC_LIBS = @WITH_RC_LIBS@ +WITH_RC_SUBDIR = @WITH_RC_SUBDIR@ +WITH_READLINE = @WITH_READLINE@ +WITH_RUBY = @WITH_RUBY@ +WITH_RUBY_CPPFLAGS = @WITH_RUBY_CPPFLAGS@ +WITH_RUBY_SUBDIR = @WITH_RUBY_SUBDIR@ +WITH_RUBY_VENDORARCHDIR = @WITH_RUBY_VENDORARCHDIR@ +WITH_SELINUX = @WITH_SELINUX@ +WITH_SEMANAGE = @WITH_SEMANAGE@ +WITH_SEMANAGE_SEMODULE = @WITH_SEMANAGE_SEMODULE@ +WITH_SEPOL = @WITH_SEPOL@ +WITH_SPIDERMONKEY_SUBDIR = @WITH_SPIDERMONKEY_SUBDIR@ +WITH_SQLITE = @WITH_SQLITE@ +WITH_SQLITE_CPPFLAGS = @WITH_SQLITE_CPPFLAGS@ +WITH_SQLITE_LDFLAGS = @WITH_SQLITE_LDFLAGS@ +WITH_SQLITE_LIBS = @WITH_SQLITE_LIBS@ +WITH_SQLITE_SUBDIR = @WITH_SQLITE_SUBDIR@ +WITH_SQUIRREL = @WITH_SQUIRREL@ +WITH_SUBVERSION = @WITH_SUBVERSION@ +WITH_SYCK = @WITH_SYCK@ +WITH_SYCK_CPPFLAGS = @WITH_SYCK_CPPFLAGS@ +WITH_SYCK_LDFLAGS = @WITH_SYCK_LDFLAGS@ +WITH_SYCK_LIBS = @WITH_SYCK_LIBS@ +WITH_SYCK_SUBDIR = @WITH_SYCK_SUBDIR@ +WITH_TCL = @WITH_TCL@ +WITH_TCL_SUBDIR = @WITH_TCL_SUBDIR@ +WITH_TOMCRYPT = @WITH_TOMCRYPT@ +WITH_TPM = @WITH_TPM@ +WITH_UNIXODBC = @WITH_UNIXODBC@ +WITH_UUID = @WITH_UUID@ +WITH_XAR = @WITH_XAR@ +WITH_XAR_CPPFLAGS = @WITH_XAR_CPPFLAGS@ +WITH_XAR_LDFLAGS = @WITH_XAR_LDFLAGS@ +WITH_XAR_LIBS = @WITH_XAR_LIBS@ +WITH_XAR_SUBDIR = @WITH_XAR_SUBDIR@ +WITH_XZ = @WITH_XZ@ +WITH_XZ_CPPFLAGS = @WITH_XZ_CPPFLAGS@ +WITH_XZ_LDFLAGS = @WITH_XZ_LDFLAGS@ +WITH_XZ_LIBS = @WITH_XZ_LIBS@ +WITH_XZ_SUBDIR = @WITH_XZ_SUBDIR@ +WITH_ZLIB = @WITH_ZLIB@ +WITH_ZLIB_CPPFLAGS = @WITH_ZLIB_CPPFLAGS@ +WITH_ZLIB_LDFLAGS = @WITH_ZLIB_LDFLAGS@ +WITH_ZLIB_LIBS = @WITH_ZLIB_LIBS@ +WITH_ZLIB_SUBDIR = @WITH_ZLIB_SUBDIR@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__BASH = @__BASH@ +__BZIP2 = @__BZIP2@ +__CAT = @__CAT@ +__CHATTR = @__CHATTR@ +__CHGRP = @__CHGRP@ +__CHGRP_RHF = @__CHGRP_RHF@ +__CHMOD = @__CHMOD@ +__CHOWN = @__CHOWN@ +__CHOWN_RHF = @__CHOWN_RHF@ +__CMAKE = @__CMAKE@ +__CPIO = @__CPIO@ +__CURL = @__CURL@ +__CVS = @__CVS@ +__DBSQL = @__DBSQL@ +__DB_ARCHIVE = @__DB_ARCHIVE@ +__DB_CHECKPOINT = @__DB_CHECKPOINT@ +__DB_DEADLOCK = @__DB_DEADLOCK@ +__DB_DUMP = @__DB_DUMP@ +__DB_HOTBACKUP = @__DB_HOTBACKUP@ +__DB_LOAD = @__DB_LOAD@ +__DB_LOG_VERIFY = @__DB_LOG_VERIFY@ +__DB_PRINTLOG = @__DB_PRINTLOG@ +__DB_RECOVER = @__DB_RECOVER@ +__DB_REPLICATE = @__DB_REPLICATE@ +__DB_SQL_CODEGEN = @__DB_SQL_CODEGEN@ +__DB_STAT = @__DB_STAT@ +__DB_TUNER = @__DB_TUNER@ +__DB_UPGRADE = @__DB_UPGRADE@ +__DB_VERIFY = @__DB_VERIFY@ +__DIFF = @__DIFF@ +__DITTO = @__DITTO@ +__DOXYGEN = @__DOXYGEN@ +__FILE = @__FILE@ +__GIT = @__GIT@ +__GPG = @__GPG@ +__GSR = @__GSR@ +__GST_INSPECT = @__GST_INSPECT@ +__GZIP = @__GZIP@ +__HG = @__HG@ +__ID = @__ID@ +__ID_U = @__ID_U@ +__INSTALL = @__INSTALL@ +__INSTALL_INFO = @__INSTALL_INFO@ +__LD = @__LD@ +__LDCONFIG = @__LDCONFIG@ +__LN = @__LN@ +__LRZIP = @__LRZIP@ +__LSATTR = @__LSATTR@ +__LZIP = @__LZIP@ +__LZMA = @__LZMA@ +__LZOP = @__LZOP@ +__MAKE = @__MAKE@ +__MKDIR = @__MKDIR@ +__MKDIR_P = @__MKDIR_P@ +__MODINFO = @__MODINFO@ +__MONGO = @__MONGO@ +__MV = @__MV@ +__NM = @__NM@ +__OBJCOPY = @__OBJCOPY@ +__OBJDUMP = @__OBJDUMP@ +__PATCH = @__PATCH@ +__PAX = @__PAX@ +__PERL = @__PERL@ +__PGP = @__PGP@ +__PHP = @__PHP@ +__PYTHON = @__PYTHON@ +__RM = @__RM@ +__RMDIR = @__RMDIR@ +__RSH = @__RSH@ +__RUBY = @__RUBY@ +__SED = @__SED@ +__SH = @__SH@ +__SQLITE3 = @__SQLITE3@ +__SSH = @__SSH@ +__STRIP = @__STRIP@ +__SVN = @__SVN@ +__TAR = @__TAR@ +__TCLSH = @__TCLSH@ +__UNZIP = @__UNZIP@ +__XZ = @__XZ@ +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_CXX = @ac_ct_CXX@ +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@ +autorelocate_dcolor = @autorelocate_dcolor@ +autorelocate_path = @autorelocate_path@ +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@ +exeext = @exeext@ +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@ +libext = @libext@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +objext = @objext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +shlibext = @shlibext@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +testdir = @testdir@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrprefix = @usrprefix@ +varprefix = @varprefix@ +AUTOMAKE_OPTIONS = 1.4 foreign +LINT = splint +MCCABE = pmccabe +SUBDIRS = auto # tests +AM_CPPFLAGS = \ + -I$(srcdir) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/build \ + -I$(top_srcdir)/lib \ + -I$(top_builddir)/lib \ + -I$(top_srcdir)/rpmdb \ + -I$(top_srcdir)/rpmio \ + -I$(top_srcdir)/misc \ + @WITH_BEECRYPT_CPPFLAGS@ \ + @WITH_DB_CPPFLAGS@ \ + @WITH_FILE_CPPFLAGS@ \ + @WITH_LUA_CPPFLAGS@ \ + @WITH_PCRE_CPPFLAGS@ \ + @WITH_POPT_CPPFLAGS@ \ + @WITH_SYCK_CPPFLAGS@ \ + @WITH_XAR_CPPFLAGS@ \ + @WITH_ZLIB_CPPFLAGS@ + +AM_CFLAGS = $(OPENMP_CFLAGS) +RPMMISC_LDADD_COMMON = \ + $(top_builddir)/misc/librpmmisc.la \ + @LTLIBINTL@ + +RPMIO_LDADD_COMMON = \ + $(top_builddir)/rpmio/librpmio.la \ + $(RPMMISC_LDADD_COMMON) + +RPMDB_LDADD_COMMON = \ + $(top_builddir)/rpmdb/librpmdb.la \ + $(RPMIO_LDADD_COMMON) + +RPM_LDADD_COMMON = \ + $(top_builddir)/lib/librpm.la \ + $(RPMDB_LDADD_COMMON) + +RPMBUILD_LDADD_COMMON = \ + $(top_builddir)/build/librpmbuild.la \ + $(RPM_LDADD_COMMON) + +EXTRA_DIST = librpm.vers + +#XYZ: +# mkdir -p $@ +# +#XYZ/%.cpp: %.c +# @echo $(SUFFIXES) +# @cp $< $@ + +#pkglibdir = @USRLIBRPM@ +#pkglib_LTLIBRARIES = libsql.la +pkgincdir = $(pkgincludedir)$(WITH_PATH_VERSIONED_SUFFIX) +pkginc_HEADERS = \ + rpmcli.h rpmversion.h rpmds.h rpmfi.h rpmgi.h rpmps.h \ + rpmrc.h rpmte.h rpmts.h rpm4compat.h rpm46compat.h + +noinst_HEADERS = \ + filetriggers.h fs.h fsm.h manifest.h misc.h psm.h rpmal.h \ + rpmfc.h rpmlib.h rpmlock.h rpmluaext.h rpmrollback.h + +usrlibdir = $(libdir) +usrlib_LTLIBRARIES = librpm.la +librpm_la_SOURCES = \ + formats.c fsm.c order.c poptI.c psm.c \ + depends.c \ + filetriggers.c \ + fs.c \ + manifest.c \ + misc.c \ + poptALL.c \ + poptQV.c \ + query.c \ + rpmal.c \ + rpmchecksig.c \ + rpmds.c \ + rpmfc.c \ + rpmfi.c \ + rpmgi.c \ + rpminstall.c \ + rpmlock.c \ + rpmluaext.c \ + rpmps.c \ + rpmrc.c \ + rpmrollback.c \ + rpmte.c \ + rpmts.c \ + rpmversion.c \ + transaction.c \ + verify.c + +librpm_la_LDFLAGS = -release $(LT_CURRENT).$(LT_REVISION) \ + $(am__append_1) $(am__append_3) +librpm_la_LIBADD = $(am__append_2) $(am__append_4) +BUILT_SOURCES = # rpmlib.lcd + +#.PHONY: lcov-upload +#lcov-upload: lcov +# rsync -rvz -e ssh --delete lcov/* ??? +tevr_SOURCES = tevr.c +tevr_LDADD = $(RPMBUILD_LDADD) +tgi_SOURCES = tgi.c +tgi_LDADD = $(RPMBUILD_LDADD) +tsbt_SOURCES = tsbt.c +tsbt_LDADD = $(RPM_LDADD) +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 lib/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign lib/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +rpmversion.h: $(top_builddir)/config.status $(srcdir)/rpmversion.h.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-usrlibLTLIBRARIES: $(usrlib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(usrlib_LTLIBRARIES)'; test -n "$(usrlibdir)" || 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)$(usrlibdir)'"; \ + $(MKDIR_P) '$(DESTDIR)$(usrlibdir)' || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(usrlibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(usrlibdir)"; \ + } + +uninstall-usrlibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(usrlib_LTLIBRARIES)'; test -n "$(usrlibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(usrlibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(usrlibdir)/$$f"; \ + done + +clean-usrlibLTLIBRARIES: + -test -z "$(usrlib_LTLIBRARIES)" || rm -f $(usrlib_LTLIBRARIES) + @list='$(usrlib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +tevr$(EXEEXT): $(tevr_OBJECTS) $(tevr_DEPENDENCIES) $(EXTRA_tevr_DEPENDENCIES) + @rm -f tevr$(EXEEXT) + $(LINK) $(tevr_OBJECTS) $(tevr_LDADD) $(LIBS) +tgi$(EXEEXT): $(tgi_OBJECTS) $(tgi_DEPENDENCIES) $(EXTRA_tgi_DEPENDENCIES) + @rm -f tgi$(EXEEXT) + $(LINK) $(tgi_OBJECTS) $(tgi_LDADD) $(LIBS) +tsbt$(EXEEXT): $(tsbt_OBJECTS) $(tsbt_DEPENDENCIES) $(EXTRA_tsbt_DEPENDENCIES) + @rm -f tsbt$(EXEEXT) + $(LINK) $(tsbt_OBJECTS) $(tsbt_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/depends.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filetriggers.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/formats.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/manifest.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/order.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poptALL.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poptI.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poptQV.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/query.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmchecksig.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmds.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmfc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmfi.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmgi.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpminstall.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmlock.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmluaext.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmps.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmrc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmrollback.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmte.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmts.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmversion.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tevr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tgi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transaction.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsbt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verify.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgincHEADERS: $(pkginc_HEADERS) + @$(NORMAL_INSTALL) + @list='$(pkginc_HEADERS)'; test -n "$(pkgincdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgincdir)'"; \ + $(MKDIR_P) '$(DESTDIR)$(pkgincdir)' || 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)$(pkgincdir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincdir)" || exit $$?; \ + done + +uninstall-pkgincHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginc_HEADERS)'; test -n "$(pkgincdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgincdir)'; $(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. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(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" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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 +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(usrlibdir)" "$(DESTDIR)$(pkgincdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-recursive + +clean-am: clean-generic clean-libtool clean-usrlibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-pkgincHEADERS install-usrlibLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -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-pkgincHEADERS uninstall-usrlibLTLIBRARIES + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ + check-am ctags-recursive install install-am install-data-am \ + install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am check-local clean clean-generic \ + clean-libtool clean-usrlibLTLIBRARIES ctags ctags-recursive \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-data-hook 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-pkgincHEADERS install-ps install-ps-am \ + install-strip install-usrlibLTLIBRARIES installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am \ + uninstall-pkgincHEADERS uninstall-usrlibLTLIBRARIES + +librpm.la: $(librpm_la_OBJECTS) $(librpm_la_DEPENDENCIES) + $(librpm_la_LINK) -rpath $(usrlibdir) $(librpm_la_OBJECTS) $(librpm_la_LIBADD) + +#libsql_la_SOURCES = libsql.c +#libsql_la_LIBADD = librpm.la $(RPMDB_LDADD_COMMON) + +install-data-hook: +@ENABLE_BUILD_LAFILES_FALSE@ -for l in $(usrlib_LTLIBRARIES); do \ +@ENABLE_BUILD_LAFILES_FALSE@ rm -f $(DESTDIR)$(usrlibdir)/$${l}; \ +@ENABLE_BUILD_LAFILES_FALSE@ done +@WITH_PATH_VERSIONED_TRUE@ -for l in $(usrlib_LTLIBRARIES); do \ +@WITH_PATH_VERSIONED_TRUE@ base=`echo "$${l}" | sed -e 's;\.la$$;;'`; \ +@WITH_PATH_VERSIONED_TRUE@ if [ -f $(DESTDIR)$(usrlibdir)/$${base}.a ]; then \ +@WITH_PATH_VERSIONED_TRUE@ mv $(DESTDIR)$(usrlibdir)/$${base}.a \ +@WITH_PATH_VERSIONED_TRUE@ $(DESTDIR)$(usrlibdir)/$${base}-$(VERSION).a; \ +@WITH_PATH_VERSIONED_TRUE@ fi; \ +@WITH_PATH_VERSIONED_TRUE@ done + +check-local: + +rpmlib.lcd: Makefile.am ${librpm_la_SOURCES} ${pkginc_HEADERS} ${noinst_HEADERS} + -lclint ${DEFS} ${INCLUDES} ${librpm_la_SOURCES} -dump $@ 2>/dev/null + +.PHONY: sources +sources: + @echo $(librpm_la_SOURCES:%=lib/%) + +.PHONY: lint +lint: + $(LINT) $(DEFS) $(INCLUDES) $(librpm_la_SOURCES) + +.PHONY: mccabe +mccabe: + $(MCCABE) $(librpm_la_SOURCES) | sort -n -r | head -n 20 + +.PHONY: lcov-reset # run lcov from scratch, always +lcov-reset: + make lcov-run + make lcov-report + +.PHONY: lcov # run lcov from scratch if the dir is not there +lcov: + make lcov-reset + +.PHONY: lcov-run # reset run coverage tests +lcov-run: + @-rm -rf lcov + find . -name "*.gcda" -exec rm {} \; + make check + +.PHONY: lcov-report # generate report based on current coverage data +lcov-report: + mkdir lcov + lcov --directory . --capture --output-file lcov/lcov.info + lcov -l lcov/lcov.info | grep -v "`cd $(top_srcdir) && pwd`" | cut -d: -f1 > lcov/remove + lcov -r lcov/lcov.info `cat lcov/remove` > lcov/lcov.cleaned.info + rm lcov/remove + mv lcov/lcov.cleaned.info lcov/lcov.info + genhtml -t "$(PACKAGE_STRING)" -o lcov lcov/lcov.info + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/rpm-5.4.9/lib/auto/Makefile.am b/rpm-5.4.9/lib/auto/Makefile.am new file mode 100644 index 0000000..ce428ed --- /dev/null +++ b/rpm-5.4.9/lib/auto/Makefile.am @@ -0,0 +1,21 @@ +AUTOMAKE_OPTIONS = 1.4 foreign + +EXTRA_DIST = types desc + +# http://forge.ispras.ru/projects/abi-compliance-checker +ABITEST = @abs_top_srcdir@/scripts/abi-check/abi-compliance-checker.pl +# http://forge.ispras.ru/projects/api-sanity-autotest +AUTOTEST = @abs_top_srcdir@/scripts/api-sanity-checker.pl + +TDIRS = descriptors_storage header_compile_errors test_results tests + +desc.xml: desc + cp $< $@ + +clean-local: + rm -rf $(TDIRS) desc.xml + +check-local: desc.xml + -[ -d tests ] && ${AUTOTEST} -l lib -d desc.xml -clean + -${AUTOTEST} -l lib -d desc.xml -st types -td test_data \ + -gen -splint-specs -build -run diff --git a/rpm-5.4.9/lib/auto/Makefile.in b/rpm-5.4.9/lib/auto/Makefile.in new file mode 100644 index 0000000..140dd08 --- /dev/null +++ b/rpm-5.4.9/lib/auto/Makefile.in @@ -0,0 +1,738 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +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@ +target_triplet = @target@ +subdir = lib/auto +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/desc.in $(srcdir)/types.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = desc types +CONFIG_CLEAN_VPATH_FILES = +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 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDROOTDIR_MACRO = @BUILDROOTDIR_MACRO@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBAPI = @DBAPI@ +DBLIBOBJS = @DBLIBOBJS@ +DBLIBSRCS = @DBLIBSRCS@ +DBPATH = @DBPATH@ +DBPATH_MACRO = @DBPATH_MACRO@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTRO_MACROS = @DISTRO_MACROS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIXPERMS = @FIXPERMS@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GPSEE_MODULES_PATH = @GPSEE_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_STATIC = @LDFLAGS_STATIC@ +LD_VERSION_SCRIPT_FLAG = @LD_VERSION_SCRIPT_FLAG@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOLIZE = @LIBTOOLIZE@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MACROFILES = @MACROFILES@ +MAGIC_MACRO = @MAGIC_MACRO@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR = @MKDIR@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NCPUS_COMMAND = @NCPUS_COMMAND@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENMP_CFLAGS = @OPENMP_CFLAGS@ +OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_INSTALLDIRS = @PERL_INSTALLDIRS@ +PERL_URPM_INSTALLDIRS = @PERL_URPM_INSTALLDIRS@ +PKGSRCDIR = @PKGSRCDIR@ +PKGSRCDIR_MACRO = @PKGSRCDIR_MACRO@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +ROOT_GROUP = @ROOT_GROUP@ +RPMCANONARCH = @RPMCANONARCH@ +RPMCANONCOLOR = @RPMCANONCOLOR@ +RPMCANONGNU = @RPMCANONGNU@ +RPMCANONOS = @RPMCANONOS@ +RPMCANONVENDOR = @RPMCANONVENDOR@ +RPMGID = @RPMGID@ +RPMGROUP = @RPMGROUP@ +RPMLUAFILES = @RPMLUAFILES@ +RPMPOPTFILES = @RPMPOPTFILES@ +RPMUID = @RPMUID@ +RPMUSER = @RPMUSER@ +RPM_TIMESTAMP = @RPM_TIMESTAMP@ +RPM_VENDOR = @RPM_VENDOR@ +RPM_VERSION = @RPM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFIGDIR = @SYSCONFIGDIR@ +USE_NLS = @USE_NLS@ +USRLIBRPM = @USRLIBRPM@ +VERSION = @VERSION@ +WITH_ACL = @WITH_ACL@ +WITH_APIDOCS = @WITH_APIDOCS@ +WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ +WITH_APR = @WITH_APR@ +WITH_ATERM = @WITH_ATERM@ +WITH_ATTR = @WITH_ATTR@ +WITH_AUGEAS = @WITH_AUGEAS@ +WITH_AUGEAS_AUGTOOL = @WITH_AUGEAS_AUGTOOL@ +WITH_BASH = @WITH_BASH@ +WITH_BASH_CPPFLAGS = @WITH_BASH_CPPFLAGS@ +WITH_BASH_LDFLAGS = @WITH_BASH_LDFLAGS@ +WITH_BASH_LIBS = @WITH_BASH_LIBS@ +WITH_BASH_SUBDIR = @WITH_BASH_SUBDIR@ +WITH_BEECRYPT = @WITH_BEECRYPT@ +WITH_BEECRYPT_CPPFLAGS = @WITH_BEECRYPT_CPPFLAGS@ +WITH_BEECRYPT_LDFLAGS = @WITH_BEECRYPT_LDFLAGS@ +WITH_BEECRYPT_LIBS = @WITH_BEECRYPT_LIBS@ +WITH_BEECRYPT_SUBDIR = @WITH_BEECRYPT_SUBDIR@ +WITH_BZIP2 = @WITH_BZIP2@ +WITH_CPUINFO = @WITH_CPUINFO@ +WITH_CUDF = @WITH_CUDF@ +WITH_CUDF_CUDFTOOL = @WITH_CUDF_CUDFTOOL@ +WITH_DB = @WITH_DB@ +WITH_DBSQL = @WITH_DBSQL@ +WITH_DBSQL_CPPFLAGS = @WITH_DBSQL_CPPFLAGS@ +WITH_DBSQL_LDFLAGS = @WITH_DBSQL_LDFLAGS@ +WITH_DBSQL_LIBS = @WITH_DBSQL_LIBS@ +WITH_DBSQL_SUBDIR = @WITH_DBSQL_SUBDIR@ +WITH_DB_CPPFLAGS = @WITH_DB_CPPFLAGS@ +WITH_DB_LDFLAGS = @WITH_DB_LDFLAGS@ +WITH_DB_LIBS = @WITH_DB_LIBS@ +WITH_DB_SUBDIR = @WITH_DB_SUBDIR@ +WITH_DMALLOC = @WITH_DMALLOC@ +WITH_EFENCE = @WITH_EFENCE@ +WITH_EXPAT = @WITH_EXPAT@ +WITH_FICL = @WITH_FICL@ +WITH_FICL_CPPFLAGS = @WITH_FICL_CPPFLAGS@ +WITH_FICL_LDFLAGS = @WITH_FICL_LDFLAGS@ +WITH_FICL_LIBS = @WITH_FICL_LIBS@ +WITH_FICL_SUBDIR = @WITH_FICL_SUBDIR@ +WITH_FILE = @WITH_FILE@ +WITH_FILE_CPPFLAGS = @WITH_FILE_CPPFLAGS@ +WITH_FILE_LDFLAGS = @WITH_FILE_LDFLAGS@ +WITH_FILE_LIBS = @WITH_FILE_LIBS@ +WITH_FILE_SUBDIR = @WITH_FILE_SUBDIR@ +WITH_GCRYPT = @WITH_GCRYPT@ +WITH_GNUTLS = @WITH_GNUTLS@ +WITH_GPSEE = @WITH_GPSEE@ +WITH_GPSEE_CPPFLAGS = @WITH_GPSEE_CPPFLAGS@ +WITH_GPSEE_LDFLAGS = @WITH_GPSEE_LDFLAGS@ +WITH_GPSEE_LIBS = @WITH_GPSEE_LIBS@ +WITH_GPSEE_SUBDIR = @WITH_GPSEE_SUBDIR@ +WITH_JS_SUBDIR = @WITH_JS_SUBDIR@ +WITH_KEYUTILS = @WITH_KEYUTILS@ +WITH_KEYUTILS_RPMKEY = @WITH_KEYUTILS_RPMKEY@ +WITH_LIBELF_DEBUGEDIT = @WITH_LIBELF_DEBUGEDIT@ +WITH_LIBGIT2 = @WITH_LIBGIT2@ +WITH_LIBGIT2_CPPFLAGS = @WITH_LIBGIT2_CPPFLAGS@ +WITH_LIBGIT2_LDFLAGS = @WITH_LIBGIT2_LDFLAGS@ +WITH_LIBGIT2_LIBS = @WITH_LIBGIT2_LIBS@ +WITH_LIBGIT2_SUBDIR = @WITH_LIBGIT2_SUBDIR@ +WITH_LIBTASN1 = @WITH_LIBTASN1@ +WITH_LUA = @WITH_LUA@ +WITH_LUA_CPPFLAGS = @WITH_LUA_CPPFLAGS@ +WITH_LUA_LDFLAGS = @WITH_LUA_LDFLAGS@ +WITH_LUA_LIBS = @WITH_LUA_LIBS@ +WITH_LUA_SUBDIR = @WITH_LUA_SUBDIR@ +WITH_LUA_SUBDIR_DEF = @WITH_LUA_SUBDIR_DEF@ +WITH_LUA_SUBDIR_LIB = @WITH_LUA_SUBDIR_LIB@ +WITH_MOZJS185 = @WITH_MOZJS185@ +WITH_MOZJS185_CPPFLAGS = @WITH_MOZJS185_CPPFLAGS@ +WITH_MOZJS185_LDFLAGS = @WITH_MOZJS185_LDFLAGS@ +WITH_MOZJS185_LIBS = @WITH_MOZJS185_LIBS@ +WITH_MOZJS185_SUBDIR = @WITH_MOZJS185_SUBDIR@ +WITH_NEON = @WITH_NEON@ +WITH_NEON_CPPFLAGS = @WITH_NEON_CPPFLAGS@ +WITH_NEON_LDFLAGS = @WITH_NEON_LDFLAGS@ +WITH_NEON_LIBS = @WITH_NEON_LIBS@ +WITH_NEON_SUBDIR = @WITH_NEON_SUBDIR@ +WITH_NIX = @WITH_NIX@ +WITH_NSS = @WITH_NSS@ +WITH_OPENSSL = @WITH_OPENSSL@ +WITH_PAKCHOIS = @WITH_PAKCHOIS@ +WITH_PATH_VERSIONED = @WITH_PATH_VERSIONED@ +WITH_PATH_VERSIONED_SUFFIX = @WITH_PATH_VERSIONED_SUFFIX@ +WITH_PCRE = @WITH_PCRE@ +WITH_PCRE_CPPFLAGS = @WITH_PCRE_CPPFLAGS@ +WITH_PCRE_LDFLAGS = @WITH_PCRE_LDFLAGS@ +WITH_PCRE_LIBS = @WITH_PCRE_LIBS@ +WITH_PCRE_SUBDIR = @WITH_PCRE_SUBDIR@ +WITH_PERLEMBED = @WITH_PERLEMBED@ +WITH_PERL_LIBS = @WITH_PERL_LIBS@ +WITH_PERL_SUBDIR = @WITH_PERL_SUBDIR@ +WITH_PERL_SUBPACKAGE = @WITH_PERL_SUBPACKAGE@ +WITH_PERL_URPM_LIBS = @WITH_PERL_URPM_LIBS@ +WITH_PERL_URPM_SUBDIR = @WITH_PERL_URPM_SUBDIR@ +WITH_PERL_URPM_SUBPACKAGE = @WITH_PERL_URPM_SUBPACKAGE@ +WITH_POPT = @WITH_POPT@ +WITH_POPT_CPPFLAGS = @WITH_POPT_CPPFLAGS@ +WITH_POPT_LDFLAGS = @WITH_POPT_LDFLAGS@ +WITH_POPT_LIBS = @WITH_POPT_LIBS@ +WITH_POPT_SUBDIR = @WITH_POPT_SUBDIR@ +WITH_PYTHONEMBED = @WITH_PYTHONEMBED@ +WITH_PYTHON_INCDIR = @WITH_PYTHON_INCDIR@ +WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ +WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ +WITH_RC = @WITH_RC@ +WITH_RC_CPPFLAGS = @WITH_RC_CPPFLAGS@ +WITH_RC_LDFLAGS = @WITH_RC_LDFLAGS@ +WITH_RC_LIBS = @WITH_RC_LIBS@ +WITH_RC_SUBDIR = @WITH_RC_SUBDIR@ +WITH_READLINE = @WITH_READLINE@ +WITH_RUBY = @WITH_RUBY@ +WITH_RUBY_CPPFLAGS = @WITH_RUBY_CPPFLAGS@ +WITH_RUBY_SUBDIR = @WITH_RUBY_SUBDIR@ +WITH_RUBY_VENDORARCHDIR = @WITH_RUBY_VENDORARCHDIR@ +WITH_SELINUX = @WITH_SELINUX@ +WITH_SEMANAGE = @WITH_SEMANAGE@ +WITH_SEMANAGE_SEMODULE = @WITH_SEMANAGE_SEMODULE@ +WITH_SEPOL = @WITH_SEPOL@ +WITH_SPIDERMONKEY_SUBDIR = @WITH_SPIDERMONKEY_SUBDIR@ +WITH_SQLITE = @WITH_SQLITE@ +WITH_SQLITE_CPPFLAGS = @WITH_SQLITE_CPPFLAGS@ +WITH_SQLITE_LDFLAGS = @WITH_SQLITE_LDFLAGS@ +WITH_SQLITE_LIBS = @WITH_SQLITE_LIBS@ +WITH_SQLITE_SUBDIR = @WITH_SQLITE_SUBDIR@ +WITH_SQUIRREL = @WITH_SQUIRREL@ +WITH_SUBVERSION = @WITH_SUBVERSION@ +WITH_SYCK = @WITH_SYCK@ +WITH_SYCK_CPPFLAGS = @WITH_SYCK_CPPFLAGS@ +WITH_SYCK_LDFLAGS = @WITH_SYCK_LDFLAGS@ +WITH_SYCK_LIBS = @WITH_SYCK_LIBS@ +WITH_SYCK_SUBDIR = @WITH_SYCK_SUBDIR@ +WITH_TCL = @WITH_TCL@ +WITH_TCL_SUBDIR = @WITH_TCL_SUBDIR@ +WITH_TOMCRYPT = @WITH_TOMCRYPT@ +WITH_TPM = @WITH_TPM@ +WITH_UNIXODBC = @WITH_UNIXODBC@ +WITH_UUID = @WITH_UUID@ +WITH_XAR = @WITH_XAR@ +WITH_XAR_CPPFLAGS = @WITH_XAR_CPPFLAGS@ +WITH_XAR_LDFLAGS = @WITH_XAR_LDFLAGS@ +WITH_XAR_LIBS = @WITH_XAR_LIBS@ +WITH_XAR_SUBDIR = @WITH_XAR_SUBDIR@ +WITH_XZ = @WITH_XZ@ +WITH_XZ_CPPFLAGS = @WITH_XZ_CPPFLAGS@ +WITH_XZ_LDFLAGS = @WITH_XZ_LDFLAGS@ +WITH_XZ_LIBS = @WITH_XZ_LIBS@ +WITH_XZ_SUBDIR = @WITH_XZ_SUBDIR@ +WITH_ZLIB = @WITH_ZLIB@ +WITH_ZLIB_CPPFLAGS = @WITH_ZLIB_CPPFLAGS@ +WITH_ZLIB_LDFLAGS = @WITH_ZLIB_LDFLAGS@ +WITH_ZLIB_LIBS = @WITH_ZLIB_LIBS@ +WITH_ZLIB_SUBDIR = @WITH_ZLIB_SUBDIR@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__BASH = @__BASH@ +__BZIP2 = @__BZIP2@ +__CAT = @__CAT@ +__CHATTR = @__CHATTR@ +__CHGRP = @__CHGRP@ +__CHGRP_RHF = @__CHGRP_RHF@ +__CHMOD = @__CHMOD@ +__CHOWN = @__CHOWN@ +__CHOWN_RHF = @__CHOWN_RHF@ +__CMAKE = @__CMAKE@ +__CPIO = @__CPIO@ +__CURL = @__CURL@ +__CVS = @__CVS@ +__DBSQL = @__DBSQL@ +__DB_ARCHIVE = @__DB_ARCHIVE@ +__DB_CHECKPOINT = @__DB_CHECKPOINT@ +__DB_DEADLOCK = @__DB_DEADLOCK@ +__DB_DUMP = @__DB_DUMP@ +__DB_HOTBACKUP = @__DB_HOTBACKUP@ +__DB_LOAD = @__DB_LOAD@ +__DB_LOG_VERIFY = @__DB_LOG_VERIFY@ +__DB_PRINTLOG = @__DB_PRINTLOG@ +__DB_RECOVER = @__DB_RECOVER@ +__DB_REPLICATE = @__DB_REPLICATE@ +__DB_SQL_CODEGEN = @__DB_SQL_CODEGEN@ +__DB_STAT = @__DB_STAT@ +__DB_TUNER = @__DB_TUNER@ +__DB_UPGRADE = @__DB_UPGRADE@ +__DB_VERIFY = @__DB_VERIFY@ +__DIFF = @__DIFF@ +__DITTO = @__DITTO@ +__DOXYGEN = @__DOXYGEN@ +__FILE = @__FILE@ +__GIT = @__GIT@ +__GPG = @__GPG@ +__GSR = @__GSR@ +__GST_INSPECT = @__GST_INSPECT@ +__GZIP = @__GZIP@ +__HG = @__HG@ +__ID = @__ID@ +__ID_U = @__ID_U@ +__INSTALL = @__INSTALL@ +__INSTALL_INFO = @__INSTALL_INFO@ +__LD = @__LD@ +__LDCONFIG = @__LDCONFIG@ +__LN = @__LN@ +__LRZIP = @__LRZIP@ +__LSATTR = @__LSATTR@ +__LZIP = @__LZIP@ +__LZMA = @__LZMA@ +__LZOP = @__LZOP@ +__MAKE = @__MAKE@ +__MKDIR = @__MKDIR@ +__MKDIR_P = @__MKDIR_P@ +__MODINFO = @__MODINFO@ +__MONGO = @__MONGO@ +__MV = @__MV@ +__NM = @__NM@ +__OBJCOPY = @__OBJCOPY@ +__OBJDUMP = @__OBJDUMP@ +__PATCH = @__PATCH@ +__PAX = @__PAX@ +__PERL = @__PERL@ +__PGP = @__PGP@ +__PHP = @__PHP@ +__PYTHON = @__PYTHON@ +__RM = @__RM@ +__RMDIR = @__RMDIR@ +__RSH = @__RSH@ +__RUBY = @__RUBY@ +__SED = @__SED@ +__SH = @__SH@ +__SQLITE3 = @__SQLITE3@ +__SSH = @__SSH@ +__STRIP = @__STRIP@ +__SVN = @__SVN@ +__TAR = @__TAR@ +__TCLSH = @__TCLSH@ +__UNZIP = @__UNZIP@ +__XZ = @__XZ@ +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_CXX = @ac_ct_CXX@ +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@ +autorelocate_dcolor = @autorelocate_dcolor@ +autorelocate_path = @autorelocate_path@ +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@ +exeext = @exeext@ +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@ +libext = @libext@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +objext = @objext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +shlibext = @shlibext@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +testdir = @testdir@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrprefix = @usrprefix@ +varprefix = @varprefix@ +AUTOMAKE_OPTIONS = 1.4 foreign +EXTRA_DIST = types desc + +# http://forge.ispras.ru/projects/abi-compliance-checker +ABITEST = @abs_top_srcdir@/scripts/abi-check/abi-compliance-checker.pl +# http://forge.ispras.ru/projects/api-sanity-autotest +AUTOTEST = @abs_top_srcdir@/scripts/api-sanity-checker.pl +TDIRS = descriptors_storage header_compile_errors test_results tests +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 lib/auto/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign lib/auto/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +desc: $(top_builddir)/config.status $(srcdir)/desc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +types: $(top_builddir)/config.status $(srcdir)/types.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool 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-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: check-am install-am install-strip + +.PHONY: all all-am check check-am check-local clean clean-generic \ + clean-libtool clean-local distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am + + +desc.xml: desc + cp $< $@ + +clean-local: + rm -rf $(TDIRS) desc.xml + +check-local: desc.xml + -[ -d tests ] && ${AUTOTEST} -l lib -d desc.xml -clean + -${AUTOTEST} -l lib -d desc.xml -st types -td test_data \ + -gen -splint-specs -build -run + +# 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/rpm-5.4.9/lib/auto/desc b/rpm-5.4.9/lib/auto/desc new file mode 100644 index 0000000..500e9ff --- /dev/null +++ b/rpm-5.4.9/lib/auto/desc @@ -0,0 +1,114 @@ + + 5.4.9 + + + + fs.h + + manifest.h + misc.h + + + + rpmal.h + rpmcli.h + rpmds.h + rpmfc.h + rpmfi.h + rpmgi.h + rpmlib.h + rpmlock.h + + rpmps.h + rpmrc.h + + rpmte.h + rpmts.h + rpmversion.h + + + + /home/mdawkins/wdj54/lib/.libs/librpm.so + + + + + + + /home/mdawkins/wdj54/lib + /home/mdawkins/wdj54/rpmdb + /home/mdawkins/wdj54/rpmio + + + + -O2 -g -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC -DPIC -Wall -W -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -Wno-unused-parameter -Wformat-security -g3 -fno-delete-null-pointer-checks -D_FORTIFY_SOURCE=2 -fstack-protector -fexceptions -fexceptions -Wno-missing-field-initializers -D_GNU_SOURCE -D_REENTRANT + + + + stdint.h + stdio.h + stdlib.h + string.h + assert.h + rpmiotypes.h + rpmio.h + rpmtypes.h + rpmevr.h + rpmtag.h + + + + + + + + + + + + + + + + /usr/include/rpm/*.h + + + + /usr/lib64/libdb.so + /usr/lib64/libsqlite3.so + + + + + + + + + + + + + + + + + + /home/mdawkins/wdj54/rpmdb/.libs/librpmdb.so + /home/mdawkins/wdj54/rpmio/.libs/librpmio.so + /home/mdawkins/wdj54/misc/.libs/librpmmisc.so + + + + + + + + + + + + + + + + diff --git a/rpm-5.4.9/lib/auto/desc.in b/rpm-5.4.9/lib/auto/desc.in new file mode 100644 index 0000000..53a780e --- /dev/null +++ b/rpm-5.4.9/lib/auto/desc.in @@ -0,0 +1,114 @@ + + @VERSION@ + + + + fs.h + + manifest.h + misc.h + + + + rpmal.h + rpmcli.h + rpmds.h + rpmfc.h + rpmfi.h + rpmgi.h + rpmlib.h + rpmlock.h + + rpmps.h + rpmrc.h + + rpmte.h + rpmts.h + rpmversion.h + + + + @abs_top_builddir@/lib/.libs/librpm.@shlibext@ + + + + + + + @abs_top_srcdir@/lib + @abs_top_srcdir@/rpmdb + @abs_top_srcdir@/rpmio + + + + @CFLAGS@ + + + + stdint.h + stdio.h + stdlib.h + string.h + assert.h + rpmiotypes.h + rpmio.h + rpmtypes.h + rpmevr.h + rpmtag.h + + + + + + + + + + + + + + + + @prefix@/include/rpm/*.h + + + + @prefix@/lib64/libdb.@shlibext@ + @prefix@/lib64/libsqlite3.@shlibext@ + + + + + + + + + + + + + + + + + + @abs_top_builddir@/rpmdb/.libs/librpmdb.@shlibext@ + @abs_top_builddir@/rpmio/.libs/librpmio.@shlibext@ + @abs_top_builddir@/misc/.libs/librpmmisc.@shlibext@ + + + + + + + + + + + + + + + + diff --git a/rpm-5.4.9/lib/auto/types b/rpm-5.4.9/lib/auto/types new file mode 100644 index 0000000..652200d --- /dev/null +++ b/rpm-5.4.9/lib/auto/types @@ -0,0 +1,629 @@ + + + + + common_env + + #include + #include + #include + static struct poptOption optionsTable[] = { + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0, + "Common options for all rpmio executables:", NULL }, + POPT_AUTOHELP + POPT_TABLEEND + }; + + + poptContext con = rpmcliInit(argc, argv, optionsTable); + + + con = rpmcliFini(con); + + + + + + common_param + ARGint_t + 0xdeadbeef + + + + common_param + ARGI_t + NULL + + assert(argiAdd(&$0, -1, 1) == 0 && $0 != NULL && argiCount($0) == 1); + + + $0 = argiFree($0); + + + + + normal + ARGI_t + NULL + + assert(argiAdd(&$0, -1, 1) == 0 && $0 != NULL && argiCount($0) == 1); + + + argiFree + param1 + + + + + common_param + ARGstr_t + "foo" + + + + common_param + ARGV_t + NULL + + assert(argvAdd(&$0, "/foo") == 0 && $0 != NULL && !strcmp($0[0], "/foo")); + + + $0 = argvFree($0); + + + + + normal + ARGV_t + NULL + + assert(argvAdd(&$0, "/foo") == 0 && $0 != NULL && !strcmp($0[0], "/foo")); + + + argvFree + param1 + + + + + normal + ARGV_t * + NULL + + + static ARGV_t _av; + + + $0 = &_av; + assert(argvAdd($0, "foo") == 0 && *$0 != NULL && !strcmp((*$0)[0], "foo")); + + + if ($0) *$0 = argvFree(*$0); + + + + argvAdd + argvAppend + argvSplit + + param1 + + + + + + + + common_param + FD_t + fdDup(fileno(tmpfile())) + + (void) Fclose($0); + + + + normal + FD_t + fdDup(fileno(tmpfile())) + + + Fclose + ufdGetFile + + param1 + + + + + common_param + mode_t + 0700 + + + + normal + void * + &__pglob + + #include + static glob_t __pglob; + + + (void) Glob("*", 0, Glob_error, $0); + + + Globfree + param1 + + + + + normal + char * + NULL + + Realpath + param2 + + + + + + common_param + DIGEST_CTX + NULL + + #include /* XXX rpmioItem */ + static pgpHashAlgo _algo = PGPHASHALGO_MD5; + static rpmDigestFlags _flags = RPMDIGEST_NONE; + + + $0 = rpmDigestInit(_algo, _flags); + + + (void) rpmDigestFinal($0, NULL, NULL, 0); + + + + normal + DIGEST_CTX + NULL + + #include /* XXX rpmioItem */ + static pgpHashAlgo _algo = PGPHASHALGO_MD5; + static rpmDigestFlags _flags = RPMDIGEST_NONE; + + + $0 = rpmDigestInit(_algo, _flags); + + + rpmDigestFinal + param1 + + + + normal + const char * + NULL + + $0 = strdup("foo"); + + + xstrtolocale + param1 + + + + normal + rpmioP + NULL + + (void) rpmioParse(&$0, "bing bang boom"); + + + rpmioPFree + param1 + + + + + + common_param + MacroContext + NULL + + + normal + void * + NULL + + expandMacros + param1 + + + + + + common_param + rpmsw + NULL + + #include /* XXX rpmioItem */ + + + $0 = calloc(1, sizeof(*$0)); + + + if ($0) + free($0); + + + + + + common_param + yarnThread + NULL + + static unsigned int _seconds = 10; + static void _snooze (void * _uip) { + unsigned int * uip = _uip; + if (uip) + sleep(*uip); + } + + + $0 = yarnLaunch(_snooze, &_seconds); + + + + + + + + common_param + Header + headerNew() + + + + common_param + HE_t + &_he + + static struct _HE_s _he = { .tag = RPMTAG_NVRA }; + + + + + + + + + + + + + + + + normal + void * + fdDup(fileno(tmpfile())) + + (void) Fclose($0); + + + rpmVerifySignatures + param3 + + + + + + common_param + rpmds + NULL + + $0 = rpmdsSingle(RPMTAG_REQUIRENAME, "foo", "0:1.2-3", RPMSENSE_EQUAL); + + + $0 = rpmdsFree($0); + + + + + common_param + rpmPRCO + rpmdsNewPRCO(NULL) + + $0 = rpmdsFreePRCO($0); + + + + normal + rpmPRCO + rpmdsNewPRCO(NULL) + + rpmdsFreePRCO + param1 + + + + normal + void * + NULL + + $0 = rpmdsNewPRCO(NULL); + + + $0 = rpmdsFreePRCO($0); + + + rpmdsMergePRCO + param1 + + + + + normal + const char * + NULL + + rpmdsSysinfo + param2 + + + + + normal + rpmds * + &_ds + + static rpmds _ds; + + + rpmdsRpmlib + param1 + + + + normal + void * + NULL + + rpmdsRpmlib + param2 + + + + + + common_param + rpmfc + NULL + + #include + + + $0 = rpmfcNew(); + + + $0 = rpmfcFree($0); + + + + normal + const char ** + NULL + + #include + + + assert(argvAdd(&$0, "/foo") == 0 && $0 != NULL && !strcmp($0[0], "/foo")); + + + $0 = argvFree($0); + + + rpmfcClassify + param2 + + + + + + common_param + rpmfi + NULL + + #include + #include + static rpmts _ts; + static Header _h; + + + if (_ts == NULL) _ts = rpmtsCreate(); + if (_h == NULL) _h = headerNew(); + $0 = rpmfiNew(_ts, _h, RPMTAG_BASENAMES, 0); + + + $0 = rpmfiFree($0); + if (_h) _h = headerFree(_h); + if (_ts) _ts = rpmtsFree(_ts); + + + + + + common_param + rpmgi + NULL + + #include + #include + static rpmts _ts; + + + if (_ts == NULL) _ts = rpmtsCreate(); + $0 = rpmgiNew(_ts, RPMDBI_ARGLIST, NULL, 0); + + + $0 = rpmgiFree($0); + if (_ts) _ts = rpmtsFree(_ts); + + + + + + normal + void * + fdDup(fileno(tmpfile())) + + (void) Fclose($0); + + + rpmInstallSourcePackage + param2 + + + + normal + const char ** + NULL + + rpmInstallSourcePackage + + param3 + param4 + + + + + + + + + + common_param + rpmps + NULL + + #include + + + $0 = rpmpsCreate(); + rpmpsAppend($0, 2, "pkg-1.2-3", NULL, "/dn/", "bn", "alt-4.5-6", 789UL); + + + $0 = rpmpsFree($0); + + + + + common_param + rpmProblem + NULL + + #include + static rpmps _ps; + + + if (_ps == NULL) _ps = rpmpsCreate(); + rpmpsAppend(_ps, 2, "pkg-1.2-3", NULL, "/dn/", "bn", "alt-4.5-6", 789UL); + $0 = rpmpsGetProblem(_ps, 0); + + + if (_ps) _ps = rpmpsFree(_ps); + + + + common_param + fnpyKey + NULL + + $0 = (fnpyKey) "fnpyKey"; + + + + + + + + common_param + rpmte + NULL + + #include + static rpmts _ts; + static Header _h; + static fnpyKey _key = (fnpyKey)"fnpyKey"; + + + if (_ts == NULL) _ts = rpmtsCreate(); + if (_h == NULL) _h = headerNew(); + $0 = rpmteNew(_ts, _h, TR_ADDED, _key, NULL, 0, (alKey)NULL); + + + $0 = rpmteFree($0); + if (_h) _h = headerFree(_h); + if (_ts) _ts = rpmtsFree(_ts); + + + + common_param + rpmtsi + NULL + + #include + static rpmts _ts; + + + if (_ts == NULL) _ts = rpmtsCreate(); + $0 = rpmtsiInit(_ts); + + + $0 = rpmtsiFree($0); + if (_ts) _ts = rpmtsFree(_ts); + + + + + + common_param + rpmts + NULL + + #include + #include + #include + + + $0 = rpmtsCreate(); + + + $0 = rpmtsFree($0); + + + + + + + diff --git a/rpm-5.4.9/lib/auto/types.in b/rpm-5.4.9/lib/auto/types.in new file mode 100644 index 0000000..652200d --- /dev/null +++ b/rpm-5.4.9/lib/auto/types.in @@ -0,0 +1,629 @@ + + + + + common_env + + #include + #include + #include + static struct poptOption optionsTable[] = { + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0, + "Common options for all rpmio executables:", NULL }, + POPT_AUTOHELP + POPT_TABLEEND + }; + + + poptContext con = rpmcliInit(argc, argv, optionsTable); + + + con = rpmcliFini(con); + + + + + + common_param + ARGint_t + 0xdeadbeef + + + + common_param + ARGI_t + NULL + + assert(argiAdd(&$0, -1, 1) == 0 && $0 != NULL && argiCount($0) == 1); + + + $0 = argiFree($0); + + + + + normal + ARGI_t + NULL + + assert(argiAdd(&$0, -1, 1) == 0 && $0 != NULL && argiCount($0) == 1); + + + argiFree + param1 + + + + + common_param + ARGstr_t + "foo" + + + + common_param + ARGV_t + NULL + + assert(argvAdd(&$0, "/foo") == 0 && $0 != NULL && !strcmp($0[0], "/foo")); + + + $0 = argvFree($0); + + + + + normal + ARGV_t + NULL + + assert(argvAdd(&$0, "/foo") == 0 && $0 != NULL && !strcmp($0[0], "/foo")); + + + argvFree + param1 + + + + + normal + ARGV_t * + NULL + + + static ARGV_t _av; + + + $0 = &_av; + assert(argvAdd($0, "foo") == 0 && *$0 != NULL && !strcmp((*$0)[0], "foo")); + + + if ($0) *$0 = argvFree(*$0); + + + + argvAdd + argvAppend + argvSplit + + param1 + + + + + + + + common_param + FD_t + fdDup(fileno(tmpfile())) + + (void) Fclose($0); + + + + normal + FD_t + fdDup(fileno(tmpfile())) + + + Fclose + ufdGetFile + + param1 + + + + + common_param + mode_t + 0700 + + + + normal + void * + &__pglob + + #include + static glob_t __pglob; + + + (void) Glob("*", 0, Glob_error, $0); + + + Globfree + param1 + + + + + normal + char * + NULL + + Realpath + param2 + + + + + + common_param + DIGEST_CTX + NULL + + #include /* XXX rpmioItem */ + static pgpHashAlgo _algo = PGPHASHALGO_MD5; + static rpmDigestFlags _flags = RPMDIGEST_NONE; + + + $0 = rpmDigestInit(_algo, _flags); + + + (void) rpmDigestFinal($0, NULL, NULL, 0); + + + + normal + DIGEST_CTX + NULL + + #include /* XXX rpmioItem */ + static pgpHashAlgo _algo = PGPHASHALGO_MD5; + static rpmDigestFlags _flags = RPMDIGEST_NONE; + + + $0 = rpmDigestInit(_algo, _flags); + + + rpmDigestFinal + param1 + + + + normal + const char * + NULL + + $0 = strdup("foo"); + + + xstrtolocale + param1 + + + + normal + rpmioP + NULL + + (void) rpmioParse(&$0, "bing bang boom"); + + + rpmioPFree + param1 + + + + + + common_param + MacroContext + NULL + + + normal + void * + NULL + + expandMacros + param1 + + + + + + common_param + rpmsw + NULL + + #include /* XXX rpmioItem */ + + + $0 = calloc(1, sizeof(*$0)); + + + if ($0) + free($0); + + + + + + common_param + yarnThread + NULL + + static unsigned int _seconds = 10; + static void _snooze (void * _uip) { + unsigned int * uip = _uip; + if (uip) + sleep(*uip); + } + + + $0 = yarnLaunch(_snooze, &_seconds); + + + + + + + + common_param + Header + headerNew() + + + + common_param + HE_t + &_he + + static struct _HE_s _he = { .tag = RPMTAG_NVRA }; + + + + + + + + + + + + + + + + normal + void * + fdDup(fileno(tmpfile())) + + (void) Fclose($0); + + + rpmVerifySignatures + param3 + + + + + + common_param + rpmds + NULL + + $0 = rpmdsSingle(RPMTAG_REQUIRENAME, "foo", "0:1.2-3", RPMSENSE_EQUAL); + + + $0 = rpmdsFree($0); + + + + + common_param + rpmPRCO + rpmdsNewPRCO(NULL) + + $0 = rpmdsFreePRCO($0); + + + + normal + rpmPRCO + rpmdsNewPRCO(NULL) + + rpmdsFreePRCO + param1 + + + + normal + void * + NULL + + $0 = rpmdsNewPRCO(NULL); + + + $0 = rpmdsFreePRCO($0); + + + rpmdsMergePRCO + param1 + + + + + normal + const char * + NULL + + rpmdsSysinfo + param2 + + + + + normal + rpmds * + &_ds + + static rpmds _ds; + + + rpmdsRpmlib + param1 + + + + normal + void * + NULL + + rpmdsRpmlib + param2 + + + + + + common_param + rpmfc + NULL + + #include + + + $0 = rpmfcNew(); + + + $0 = rpmfcFree($0); + + + + normal + const char ** + NULL + + #include + + + assert(argvAdd(&$0, "/foo") == 0 && $0 != NULL && !strcmp($0[0], "/foo")); + + + $0 = argvFree($0); + + + rpmfcClassify + param2 + + + + + + common_param + rpmfi + NULL + + #include + #include + static rpmts _ts; + static Header _h; + + + if (_ts == NULL) _ts = rpmtsCreate(); + if (_h == NULL) _h = headerNew(); + $0 = rpmfiNew(_ts, _h, RPMTAG_BASENAMES, 0); + + + $0 = rpmfiFree($0); + if (_h) _h = headerFree(_h); + if (_ts) _ts = rpmtsFree(_ts); + + + + + + common_param + rpmgi + NULL + + #include + #include + static rpmts _ts; + + + if (_ts == NULL) _ts = rpmtsCreate(); + $0 = rpmgiNew(_ts, RPMDBI_ARGLIST, NULL, 0); + + + $0 = rpmgiFree($0); + if (_ts) _ts = rpmtsFree(_ts); + + + + + + normal + void * + fdDup(fileno(tmpfile())) + + (void) Fclose($0); + + + rpmInstallSourcePackage + param2 + + + + normal + const char ** + NULL + + rpmInstallSourcePackage + + param3 + param4 + + + + + + + + + + common_param + rpmps + NULL + + #include + + + $0 = rpmpsCreate(); + rpmpsAppend($0, 2, "pkg-1.2-3", NULL, "/dn/", "bn", "alt-4.5-6", 789UL); + + + $0 = rpmpsFree($0); + + + + + common_param + rpmProblem + NULL + + #include + static rpmps _ps; + + + if (_ps == NULL) _ps = rpmpsCreate(); + rpmpsAppend(_ps, 2, "pkg-1.2-3", NULL, "/dn/", "bn", "alt-4.5-6", 789UL); + $0 = rpmpsGetProblem(_ps, 0); + + + if (_ps) _ps = rpmpsFree(_ps); + + + + common_param + fnpyKey + NULL + + $0 = (fnpyKey) "fnpyKey"; + + + + + + + + common_param + rpmte + NULL + + #include + static rpmts _ts; + static Header _h; + static fnpyKey _key = (fnpyKey)"fnpyKey"; + + + if (_ts == NULL) _ts = rpmtsCreate(); + if (_h == NULL) _h = headerNew(); + $0 = rpmteNew(_ts, _h, TR_ADDED, _key, NULL, 0, (alKey)NULL); + + + $0 = rpmteFree($0); + if (_h) _h = headerFree(_h); + if (_ts) _ts = rpmtsFree(_ts); + + + + common_param + rpmtsi + NULL + + #include + static rpmts _ts; + + + if (_ts == NULL) _ts = rpmtsCreate(); + $0 = rpmtsiInit(_ts); + + + $0 = rpmtsiFree($0); + if (_ts) _ts = rpmtsFree(_ts); + + + + + + common_param + rpmts + NULL + + #include + #include + #include + + + $0 = rpmtsCreate(); + + + $0 = rpmtsFree($0); + + + + + + + diff --git a/rpm-5.4.9/lib/depends.c b/rpm-5.4.9/lib/depends.c new file mode 100644 index 0000000..c586be2 --- /dev/null +++ b/rpm-5.4.9/lib/depends.c @@ -0,0 +1,2061 @@ +/** \ingroup rpmts + * \file lib/depends.c + */ + +#include "system.h" + +#include +#include /* XXX fnpyKey */ +#include +#include +#include /* XXX rpmExpand("%{_dependency_whiteout}" */ +#include +#include /* XXX user()/group() probes */ + +#include +#define _RPMDB_INTERNAL /* XXX response cache needs dbiOpen et al. */ +#include + +#define _RPMEVR_INTERNAL +#include +#include + +#define _RPMTE_INTERNAL +#include +#define _RPMTS_INTERNAL +#include /* XXX rpmcliPackagesTotal */ + +#include "debug.h" + +/*@access tsortInfo @*/ +/*@access rpmte @*/ /* XXX for install <-> erase associate. */ +/*@access rpmts @*/ +/*@access rpmDiskSpaceInfo @*/ + +#define CACHE_DEPENDENCY_RESULT 1 +#if defined(CACHE_DEPENDENCY_RESULT) +/*@unchecked@*/ +int _cacheDependsRC = CACHE_DEPENDENCY_RESULT; +#endif + +/*@observer@*/ /*@unchecked@*/ +const char *rpmNAME = PACKAGE; + +/*@observer@*/ /*@unchecked@*/ +const char *rpmEVR = VERSION; + +/*@unchecked@*/ +int rpmFLAGS = RPMSENSE_EQUAL; + +/** + * Compare removed package instances (qsort/bsearch). + * @param a 1st instance address + * @param b 2nd instance address + * @return result of comparison + */ +static int uintcmp(const void * a, const void * b) + /*@requires maxRead(a) == 0 /\ maxRead(b) == 0 @*/ +{ + const uint32_t * aptr = (const uint32_t *) a; + const uint32_t * bptr = (const uint32_t *) b; + int rc = (*aptr - *bptr); + return rc; +} + +/** + * Add removed package instance to ordered transaction set. + * @param ts transaction set + * @param h header + * @param hdrNum rpm database instance + * @retval *indexp removed element index (if not NULL) + * @param depends installed package of pair (or RPMAL_NOMATCH on erase) + * @return 0 on success + */ +static int removePackage(rpmts ts, Header h, uint32_t hdrNum, + /*@null@*/ int * indexp, + /*@exposed@*/ /*@dependent@*/ /*@null@*/ alKey depends) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, h, *indexp, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + rpmte p; + int xx; + + /* Filter out duplicate erasures. */ + if (ts->numRemovedPackages > 0 && ts->removedPackages != NULL) { + uint32_t * needle = NULL; + needle = (uint32_t *) bsearch(&hdrNum, + ts->removedPackages, ts->numRemovedPackages, + sizeof(*ts->removedPackages), uintcmp); + if (needle != NULL) { + /* XXX lastx should be per-call, not per-ts. */ + if (indexp != NULL) + *indexp = needle - ts->removedPackages; + return 0; + } + } + + if (ts->rbf == NULL) { + static size_t n = 10000; /* XXX population estimate */ + static double e = 1.0e-4; + size_t m = 0; + size_t k = 0; + rpmbfParams(n, e, &m, &k); + ts->rbf = rpmbfNew(m, k, 0); + } + + if (ts->numRemovedPackages == ts->allocedRemovedPackages) { + ts->allocedRemovedPackages += ts->delta; + ts->removedPackages = (uint32_t *) xrealloc(ts->removedPackages, + sizeof(ts->removedPackages) * ts->allocedRemovedPackages); + } + +assert(ts->removedPackages != NULL); /* XXX can't happen. */ + xx = rpmbfAdd(ts->rbf, &hdrNum, sizeof(hdrNum)); +assert(xx == 0); + ts->removedPackages[ts->numRemovedPackages] = hdrNum; + ts->numRemovedPackages++; + if (ts->numRemovedPackages > 1) + qsort(ts->removedPackages, ts->numRemovedPackages, + sizeof(*ts->removedPackages), uintcmp); + + if (ts->orderCount >= ts->orderAlloced) { + ts->orderAlloced += (ts->orderCount - ts->orderAlloced) + ts->delta; +/*@-type +voidabstract @*/ + ts->order = (rpmte *) xrealloc(ts->order, sizeof(*ts->order) * ts->orderAlloced); +/*@=type =voidabstract @*/ + } + + p = rpmteNew(ts, h, TR_REMOVED, NULL, NULL, hdrNum, depends); + ts->order[ts->orderCount] = p; + ts->numErasedFiles += rpmfiFC(rpmteFI(p, RPMTAG_BASENAMES)); + if (indexp != NULL) + *indexp = ts->orderCount; + ts->orderCount++; + +/*@-nullstate@*/ /* XXX FIX: ts->order[] can be NULL. */ + return 0; +/*@=nullstate@*/ +} + +/** + * Are two headers identical? + * @param first first header + * @param second second header + * @return 1 if headers are identical, 0 otherwise + */ +static int rpmHeadersIdentical(Header first, Header second) + /*@globals internalState @*/ + /*@modifies internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + const char * one, * two; + int rc = 0; + int xx; + + he->tag = RPMTAG_HDRID; + xx = headerGet(first, he, 0); + one = he->p.str; + he->tag = RPMTAG_HDRID; + xx = headerGet(second, he, 0); + two = he->p.str; + + if (one && two) + rc = ((strcmp(one, two) == 0) ? 1 : 0); + else if (one && !two) + rc = 0; + else if (!one && two) + rc = 0; + else { + /* XXX Headers w/o digests case devolves to NEVR comparison. */ + rpmds A = rpmdsThis(first, RPMTAG_REQUIRENAME, RPMSENSE_EQUAL); + rpmds B = rpmdsThis(second, RPMTAG_REQUIRENAME, RPMSENSE_EQUAL); + rc = rpmdsCompare(A, B); + (void)rpmdsFree(A); + A = NULL; + (void)rpmdsFree(B); + B = NULL; + } + one = _free(one); + two = _free(two); + return rc; +} + +/*@unchecked@*/ +static rpmTag _upgrade_tag; +/*@unchecked@*/ +static rpmTag _debuginfo_tag; +/*@unchecked@*/ +static rpmTag _obsolete_tag; + +/** + * Add upgrade erasures to a transaction set. + * @param ts transaction set + * @param p transaction element + * @param hcolor header color + * @param h header + * @return 0 on success + */ +static int rpmtsAddUpgrades(rpmts ts, rpmte p, rpmuint32_t hcolor, Header h) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, p, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmuint32_t tscolor = rpmtsColor(ts); + alKey pkgKey = rpmteAddedKey(p); + rpmuint32_t ohcolor; + rpmmi mi; + Header oh; + int xx; + + if (_upgrade_tag == 0) { + const char * t = rpmExpand("%{?_upgrade_tag}", NULL); +/*@-mods@*/ + _upgrade_tag = (!strcmp(t, "name") ? RPMTAG_NAME : RPMTAG_PROVIDENAME); +/*@=mods@*/ + t = _free(t); + } + + mi = rpmtsInitIterator(ts, _upgrade_tag, rpmteN(p), 0); + while((oh = rpmmiNext(mi)) != NULL) { + int lastx; + rpmte q; + + /* Ignore colored packages not in our rainbow. */ + ohcolor = hGetColor(oh); + if (tscolor && hcolor && ohcolor && !(hcolor & ohcolor)) + continue; + + /* Snarf the original install tid & time from older package(s). */ + he->tag = RPMTAG_ORIGINTID; + xx = headerGet(oh, he, 0); + if (xx && he->p.ui32p != NULL) { + if (p->originTid[0] == 0 || p->originTid[0] > he->p.ui32p[0] + || (he->c > 1 && p->originTid[0] == he->p.ui32p[0] && p->originTid[1] > he->p.ui32p[1])) + { + p->originTid[0] = he->p.ui32p[0]; + p->originTid[1] = (he->c > 1 ? he->p.ui32p[1] : 0); + } + he->p.ptr = _free(he->p.ptr); + } + he->tag = RPMTAG_ORIGINTIME; + xx = headerGet(oh, he, 0); + if (xx && he->p.ui32p != NULL) { + if (p->originTime[0] == 0 || p->originTime[0] > he->p.ui32p[0] + || (he->c > 1 && p->originTime[0] == he->p.ui32p[0] && p->originTime[1] > he->p.ui32p[1])) + { + p->originTime[0] = he->p.ui32p[0]; + p->originTime[1] = (he->c > 1 ? he->p.ui32p[1] : 0); + } + he->p.ptr = _free(he->p.ptr); + } + +#if defined(RPM_VENDOR_WINDRIVER) + /* + * If we're capable of installing multiple colors + * but at least one of the packages are white (0), we + * further verify the arch is the same (or compatible) to trigger an upgrade + * we do have a special case to allow upgrades of noarch w/ a arch package + */ + if (tscolor && (!hcolor || !ohcolor)) { + const char * arch; + const char * oharch; + he->tag = RPMTAG_ARCH; + xx = headerGet(h, he, 0); + arch = (xx && he->p.str != NULL ? he->p.str : NULL); + he->tag = RPMTAG_ARCH; + xx = headerGet(oh, he, 0); + oharch = (xx && he->p.str != NULL ? he->p.str : NULL); + if (arch != NULL && oharch != NULL) { + if (strcmp("noarch", arch) || strcmp("noarch", oharch)) { + if (!_isCompatibleArch(arch, oharch)) { + arch = _free(arch); + oharch = _free(oharch); + continue; + } + } + } + arch = _free(arch); + oharch = _free(oharch); + } +#endif + + /* Skip identical packages. */ + if (rpmHeadersIdentical(h, oh)) + continue; + + /* Create an erasure element. */ + lastx = -1; + xx = removePackage(ts, oh, rpmmiInstance(mi), &lastx, pkgKey); +assert(lastx >= 0 && lastx < ts->orderCount); + q = ts->order[lastx]; + + /* Chain through upgrade flink. */ + xx = rpmteChain(p, q, oh, "Upgrades"); + +/*@-nullptrarith@*/ + rpmlog(RPMLOG_DEBUG, D_(" upgrade erases %s\n"), rpmteNEVRA(q)); +/*@=nullptrarith@*/ + + } + mi = rpmmiFree(mi); + + return 0; +} + +/** + * Check string for a suffix. + * @param fn string + * @param suffix suffix + * @return 1 if string ends with suffix + */ +static inline int chkSuffix(const char * fn, const char * suffix) + /*@*/ +{ + size_t flen = strlen(fn); + size_t slen = strlen(suffix); + return (flen > slen && !strcmp(fn + flen - slen, suffix)); +} + +/** + * Add unreferenced debuginfo erasures to a transaction set. + * @param ts transaction set + * @param p transaction element + * @param h header + * @param pkgKey added package key (erasure uses RPMAL_NOKEY) + * @return no. of references from build set + */ +static int rpmtsEraseDebuginfo(rpmts ts, rpmte p, Header h, + /*@exposed@*/ /*@dependent@*/ /*@null@*/ alKey pkgKey) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, p, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + const void *keyval = NULL; + size_t keylen = 0; + size_t nrefs = 0; + rpmuint32_t debuginfoInstance = 0; + Header debuginfoHeader = NULL; + rpmmi mi; + Header oh; + int xx; + + /* XXX SOURCEPKGID is not populated reliably, do not use (yet). */ + if (_debuginfo_tag == 0) { + const char * t = rpmExpand("%{?_debuginfo_tag}", NULL); +/*@-mods@*/ + _debuginfo_tag = (*t != '\0' && !strcmp(t, "pkgid") + ? RPMTAG_SOURCEPKGID : RPMTAG_SOURCERPM); +/*@=mods@*/ + t = _free(t); + } + + /* Grab the retrieval key. */ + switch (_debuginfo_tag) { + default: return 0; /*@notreached@*/ break; + case RPMTAG_SOURCERPM: keyval = rpmteSourcerpm(p); break; + } + + /* Count remaining members in build set, excluding -debuginfo (if any). */ + mi = rpmtsInitIterator(ts, _debuginfo_tag, keyval, keylen); + xx = rpmmiPrune(mi, ts->removedPackages, ts->numRemovedPackages, 1); + while((oh = rpmmiNext(mi)) != NULL) { + /* Skip identical packages. */ + if (rpmHeadersIdentical(h, oh)) + continue; + + he->tag = RPMTAG_NAME; + xx = headerGet(oh, he, 0); + if (!xx || he->p.str == NULL) + continue; + /* Save the -debuginfo member. */ + if (chkSuffix(he->p.str, "-debuginfo")) { + debuginfoInstance = rpmmiInstance(mi); + debuginfoHeader = headerLink(oh); + } else + nrefs++; + he->p.str = _free(he->p.str); + } + mi = rpmmiFree(mi); + + /* Remove -debuginfo package when last build member is erased. */ + if (nrefs == 0 && debuginfoInstance > 0 && debuginfoHeader != NULL) { + int lastx = -1; + rpmte q; + + /* Create an erasure element. */ + lastx = -1; + xx = removePackage(ts, debuginfoHeader, debuginfoInstance, + &lastx, pkgKey); +assert(lastx >= 0 && lastx < ts->orderCount); + q = ts->order[lastx]; + + /* Chain through upgrade flink. */ + /* XXX avoid assertion failure when erasing. */ + if (pkgKey != RPMAL_NOMATCH) + xx = rpmteChain(p, q, oh, "Upgrades"); + +/*@-nullptrarith@*/ + rpmlog(RPMLOG_DEBUG, D_(" lastref erases %s\n"), rpmteNEVRA(q)); +/*@=nullptrarith@*/ + + } + (void)headerFree(debuginfoHeader); + debuginfoHeader = NULL; + + return (int)nrefs; +} + +/** + * Add Obsoletes: erasures to a transaction set. + * @param ts transaction set + * @param p transaction element + * @param hcolor header color + * @return 0 on success + */ +static int rpmtsAddObsoletes(rpmts ts, rpmte p, rpmuint32_t hcolor) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, p, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + rpmuint32_t tscolor = rpmtsColor(ts); + alKey pkgKey = rpmteAddedKey(p); + rpmuint32_t ohcolor; + rpmds obsoletes; + rpmuint32_t dscolor; + rpmmi mi; + Header oh; + int xx; + + if (_obsolete_tag == 0) { + const char *t = rpmExpand("%{?_obsolete_tag}", NULL); +/*@-mods@*/ + _obsolete_tag = (!strcmp(t, "name") ? RPMTAG_NAME : RPMTAG_PROVIDENAME); +/*@=mods@*/ + t = _free(t); + } + + obsoletes = rpmdsLink(rpmteDS(p, RPMTAG_OBSOLETENAME), "Obsoletes"); + obsoletes = rpmdsInit(obsoletes); + if (obsoletes != NULL) + while (rpmdsNext(obsoletes) >= 0) { + const char * Name; + + if ((Name = rpmdsN(obsoletes)) == NULL) + continue; /* XXX can't happen */ + + /* Ignore colored obsoletes not in our rainbow. */ +#if 0 + /* XXX obsoletes are never colored, so this is for future devel. */ + dscolor = rpmdsColor(obsoletes); +#else + dscolor = hcolor; +#endif + if (tscolor && dscolor && !(tscolor & dscolor)) + continue; + + /* XXX avoid self-obsoleting packages. */ + if (!strcmp(rpmteN(p), Name)) + continue; + + /* Obsolete containing package if given a file, otherwise provide. */ + if (Name[0] == '/') + mi = rpmtsInitIterator(ts, RPMTAG_BASENAMES, Name, 0); + else + mi = rpmtsInitIterator(ts, _obsolete_tag, Name, 0); + + xx = rpmmiPrune(mi, ts->removedPackages, ts->numRemovedPackages, 1); + + while((oh = rpmmiNext(mi)) != NULL) { + int lastx; + rpmte q; + + /* Ignore colored packages not in our rainbow. */ + ohcolor = hGetColor(oh); + + /* XXX provides *are* colored, effectively limiting Obsoletes: + to matching only colored Provides: based on pkg coloring. */ + if (tscolor && hcolor && ohcolor && !(hcolor & ohcolor)) + /*@innercontinue@*/ continue; + + /* + * Rpm prior to 3.0.3 does not have versioned obsoletes. + * If no obsoletes version info is available, match all names. + */ + if (!(rpmdsEVR(obsoletes) == NULL + || rpmdsAnyMatchesDep(oh, obsoletes, _rpmds_nopromote))) + /*@innercontinue@*/ continue; + + /* Create an erasure element. */ + lastx = -1; + xx = removePackage(ts, oh, rpmmiInstance(mi), &lastx, pkgKey); +assert(lastx >= 0 && lastx < ts->orderCount); + q = ts->order[lastx]; + + /* Chain through obsoletes flink. */ + xx = rpmteChain(p, q, oh, "Obsoletes"); + +/*@-nullptrarith@*/ + rpmlog(RPMLOG_DEBUG, D_(" Obsoletes: %s\t\terases %s\n"), + rpmdsDNEVR(obsoletes)+2, rpmteNEVRA(q)); +/*@=nullptrarith@*/ + } + mi = rpmmiFree(mi); + } + (void)rpmdsFree(obsoletes); + obsoletes = NULL; + + return 0; +} + +#if defined(RPM_VENDOR_WINDRIVER) +/* Is "compat" compatible w/ arch? */ +int _isCompatibleArch(const char * arch, const char * compat) +{ + const char * compatArch = rpmExpand(compat, " %{?_", compat, "_compat_arch}", NULL); + const char * p, * pe, * t; + int match = 0; + + /* Hack to ensure iX86 being automatically compatible */ + if (arch[0] == 'i' && arch[2] == '8' && arch[3] == '6') { + if ((arch[0] == compat[0]) && + (arch[2] == compat[2]) && + (arch[3] == compat[3])) + match = 1; + + if (!strcmp(compat, "x86_32")) + match = 1; + } + + for ( p = pe = compatArch ; *pe && match == 0 ; ) { + while (*p && xisspace(*p)) p++; + pe = p ; while (*pe && !xisspace(*pe)) pe++; + if (p == pe) + break; + t = strndup(p, (pe - p)); + p = pe; /* Advance to next chunk */ +rpmlog(RPMLOG_DEBUG, D_(" Comparing compat archs %s ? %s\n"), arch, t); + if (!strcmp(arch, t)) + match = 1; + t = _free(t); + } + compatArch = _free(compatArch); + return match; +} +#endif + +int rpmtsAddInstallElement(rpmts ts, Header h, + fnpyKey key, int upgrade, rpmRelocation relocs) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmdepFlags depFlags = rpmtsDFlags(ts); + rpmuint32_t tscolor = rpmtsColor(ts); + rpmuint32_t hcolor; + int isSource; + int duplicate = 0; + rpmtsi pi = NULL; rpmte p; + const char * arch = NULL; + const char * os = NULL; + rpmds oldChk, newChk; + alKey pkgKey; /* addedPackages key */ + int xx; + int ec = 0; + int rc; + int oc; + + hcolor = hGetColor(h); + pkgKey = RPMAL_NOMATCH; + + /* + * Always add source headers. + */ + isSource = + (headerIsEntry(h, RPMTAG_SOURCERPM) == 0 && + headerIsEntry(h, RPMTAG_ARCH) != 0); + if (isSource) { + oc = ts->orderCount; + goto addheader; + } + + /* + * Check platform affinity of binary packages. + */ + he->tag = RPMTAG_ARCH; + xx = headerGet(h, he, 0); + arch = he->p.str; + he->tag = RPMTAG_OS; + xx = headerGet(h, he, 0); + os = he->p.str; + if (nplatpat > 1) { + const char * platform = NULL; + + he->tag = RPMTAG_PLATFORM; + xx = headerGet(h, he, 0); + platform = he->p.str; + if (!xx || platform == NULL) + platform = rpmExpand(arch, "-unknown-", os, NULL); + + rc = rpmPlatformScore(platform, platpat, nplatpat); +#if defined(RPM_VENDOR_MANDRIVA) + /* + * If no match on platform tag, we'll try again with arch tag + * in case platform tag is inconsistent with it, which is the case + * for older noarch sub-packages built (mdvbz#61746). + */ + if(xx && rc <= 0) { + platform = _free(platform); + platform = rpmExpand(arch, "-unknown-", os, NULL); + rc = rpmPlatformScore(platform, platpat, nplatpat); + } +#endif + if (rc <= 0) { + rpmps ps = rpmtsProblems(ts); + he->tag = RPMTAG_NVRA; + xx = headerGet(h, he, 0); +assert(he->p.str != NULL); + + rpmpsAppend(ps, RPMPROB_BADPLATFORM, he->p.str, key, + platform, NULL, NULL, 0); + + /* XXX problem string should be printed by caller instead. */ + if (rpmIsVerbose()) { + const char * msg = rpmProblemString(rpmpsGetProblem(ps, -1)); + rpmlog(RPMLOG_WARNING, "%s\n", msg); + msg = _free(msg); + } + + ps = rpmpsFree(ps); + he->p.ptr = _free(he->p.ptr); + ec = 1; + } + platform = _free(platform); + if (ec) + goto exit; + } + + /* + * Always install compatible binary packages. + */ + if (!upgrade) { + oc = ts->orderCount; + goto addheader; + } + + /* + * Check that upgrade package is uniquely newer, replace older if necessary. + */ + oldChk = rpmdsThis(h, RPMTAG_REQUIRENAME, (evrFlags)(RPMSENSE_LESS)); + newChk = rpmdsThis(h, RPMTAG_REQUIRENAME, (evrFlags)(RPMSENSE_EQUAL|RPMSENSE_GREATER)); + /* XXX can't use rpmtsiNext() filter or oc will have wrong value. */ + for (pi = rpmtsiInit(ts), oc = 0; (p = rpmtsiNext(pi, (rpmElementType)0)) != NULL; oc++) { + rpmds ds; + + /* XXX Only added packages need be checked for dupes here. */ + if (rpmteType(p) == TR_REMOVED) + continue; + + /* XXX Never check source header NEVRAO. */ + if (rpmteIsSource(p)) + continue; + + if (tscolor) { + const char * parch; + const char * pos; + + if (arch == NULL || (parch = rpmteA(p)) == NULL) + continue; +#if defined(RPM_VENDOR_WINDRIVER) + /* XXX hackery for alias matching. */ + if (!_isCompatibleArch(arch, parch)) + continue; +#else + /* XXX hackery for i[3456]86 alias matching. */ + if (arch[0] == 'i' && arch[2] == '8' && arch[3] == '6') { + if (arch[0] != parch[0]) continue; + if (arch[2] != parch[2]) continue; + if (arch[3] != parch[3]) continue; + } +#endif + else if (strcmp(arch, parch)) + continue; + if (os == NULL || (pos = rpmteO(p)) == NULL) + continue; + + if (strcmp(os, pos)) + continue; + } + + /* OK, binary rpm's with same arch and os. Check NEVR. */ + if ((ds = rpmteDS(p, RPMTAG_NAME)) == NULL) + continue; /* XXX can't happen */ + + /* If newer NEVRAO already added, then skip adding older. */ + rc = rpmdsCompare(newChk, ds); + if (rc != 0) { + const char * pkgNEVR = rpmdsDNEVR(ds); + const char * addNEVR = rpmdsDNEVR(oldChk); + if (rpmIsVerbose()) + rpmlog(RPMLOG_WARNING, + _("package %s was already added, skipping %s\n"), + (pkgNEVR ? pkgNEVR + 2 : "?pkgNEVR?"), + (addNEVR ? addNEVR + 2 : "?addNEVR?")); + ec = 1; + break; + } + + /* If older NEVRAO already added, then replace old with new. */ + rc = rpmdsCompare(oldChk, ds); + if (rc != 0) { + const char * pkgNEVR = rpmdsDNEVR(ds); + const char * addNEVR = rpmdsDNEVR(newChk); + if (rpmIsVerbose()) + rpmlog(RPMLOG_WARNING, + _("package %s was already added, replacing with %s\n"), + (pkgNEVR ? pkgNEVR + 2 : "?pkgNEVR?"), + (addNEVR ? addNEVR + 2 : "?addNEVR?")); + duplicate = 1; + pkgKey = rpmteAddedKey(p); + break; + } + } + pi = rpmtsiFree(pi); + (void)rpmdsFree(oldChk); + oldChk = NULL; + (void)rpmdsFree(newChk); + newChk = NULL; + + /* If newer (or same) NEVRAO was already added, exit now. */ + if (ec) + goto exit; + +addheader: + if (oc >= ts->orderAlloced) { + ts->orderAlloced += (oc - ts->orderAlloced) + ts->delta; +/*@-type +voidabstract @*/ + ts->order = (rpmte *) xrealloc(ts->order, ts->orderAlloced * sizeof(*ts->order)); +/*@=type =voidabstract @*/ + } + + p = rpmteNew(ts, h, TR_ADDED, key, relocs, -1, pkgKey); +assert(p != NULL); + + if (duplicate && oc < ts->orderCount) { + ts->numAddedFiles -= rpmfiFC(rpmteFI(ts->order[oc], RPMTAG_BASENAMES)); +/*@-type -unqualifiedtrans@*/ + ts->order[oc] = rpmteFree(ts->order[oc]); +/*@=type =unqualifiedtrans@*/ + } + + ts->order[oc] = p; + ts->numAddedFiles += rpmfiFC(rpmteFI(p, RPMTAG_BASENAMES)); + if (!duplicate) { + ts->orderCount++; + rpmcliPackagesTotal++; + } + + pkgKey = rpmalAdd(&ts->addedPackages, pkgKey, rpmteKey(p), + rpmteDS(p, RPMTAG_PROVIDENAME), + rpmteFI(p, RPMTAG_BASENAMES), tscolor); + if (pkgKey == RPMAL_NOMATCH) { + ts->order[oc] = rpmteFree(ts->order[oc]); + ts->teInstall = NULL; + ec = 1; + goto exit; + } + (void) rpmteSetAddedKey(p, pkgKey); + + if (!duplicate) { + ts->numAddedPackages++; + } + + ts->teInstall = ts->order[oc]; + + /* XXX rpmgi hack: Save header in transaction element if requested. */ + if (upgrade & 0x2) + (void) rpmteSetHeader(p, h); + + /* If not upgrading, then we're done. */ + if (!(upgrade & 0x1)) + goto exit; + + /* If source rpm, then we're done. */ + if (isSource) + goto exit; + + /* Do lazy (readonly?) open of rpm database. */ + if (rpmtsGetRdb(ts) == NULL && rpmtsDBMode(ts) != -1) { + if ((ec = rpmtsOpenDB(ts, rpmtsDBMode(ts)) != 0)) + goto exit; + } + + /* Add upgrades to the transaction (if not disabled). */ + if (!(depFlags & RPMDEPS_FLAG_NOUPGRADE)) { + /* + * Don't upgrade -debuginfo until build set is empty. + * + * XXX Almost, but not quite, correct since the test depends on + * added package arrival order. + * I.e. -debuginfo additions must always follow all + * other additions so that erasures of other members in the + * same build set are seen if/when included in the same transaction. + */ + xx = rpmtsEraseDebuginfo(ts, p, h, pkgKey); + if (!chkSuffix(rpmteN(p), "-debuginfo") || xx == 0) + xx = rpmtsAddUpgrades(ts, p, hcolor, h); + } + + /* Add Obsoletes: to the transaction (if not disabled). */ + if (!(depFlags & RPMDEPS_FLAG_NOOBSOLETES)) { + xx = rpmtsAddObsoletes(ts, p, hcolor); + } + + ec = 0; + +exit: + arch = _free(arch); + os = _free(os); + pi = rpmtsiFree(pi); + return ec; +} + +int rpmtsAddEraseElement(rpmts ts, Header h, uint32_t hdrNum) +{ + int oc = -1; + int rc = removePackage(ts, h, hdrNum, &oc, RPMAL_NOMATCH); + if (rc == 0 && oc >= 0 && oc < ts->orderCount) { + (void) rpmtsEraseDebuginfo(ts, ts->order[oc], h, RPMAL_NOMATCH); + ts->teErase = ts->order[oc]; + } else + ts->teErase = NULL; + return rc; +} + +/*@only@*/ /*@null@*/ /*@unchecked@*/ +static char *sysinfo_path = NULL; + +/*@refcounted@*/ /*@null@*/ /*@unchecked@*/ +static rpmds rpmlibP = NULL; +/*@refcounted@*/ /*@null@*/ /*@unchecked@*/ +rpmds cpuinfoP = NULL; +/*@refcounted@*/ /*@null@*/ /*@unchecked@*/ +static rpmds getconfP = NULL; +/*@refcounted@*/ /*@null@*/ /*@unchecked@*/ +static rpmds unameP = NULL; + +void rpmnsClean(void) + /*@globals sysinfo_path, _sysinfo_path, rpmlibP, cpuinfoP, getconfP, unameP @*/ + /*@modifies sysinfo_path, _sysinfo_path, rpmlibP, cpuinfoP, getconfP, unameP @*/ +{ + (void)rpmdsFree(rpmlibP); + rpmlibP = NULL; + (void)rpmdsFree(cpuinfoP); + cpuinfoP = NULL; + (void)rpmdsFree(getconfP); + getconfP = NULL; + (void)rpmdsFree(unameP); + unameP = NULL; +/*@-observertrans@*/ + _sysinfo_path = _free(_sysinfo_path); +/*@=observertrans@*/ + sysinfo_path = _free(sysinfo_path); +} + +/** + * Check dep for an unsatisfied dependency. + * @param ts transaction set + * @param dep dependency + * @param adding dependency is from added package set? + * @return 0 if satisfied, 1 if not satisfied, 2 if error + */ +static int unsatisfiedDepend(rpmts ts, rpmds dep, int adding) + /*@globals _cacheDependsRC, rpmGlobalMacroContext, h_errno, + sysinfo_path, fileSystem, internalState @*/ + /*@modifies ts, dep, _cacheDependsRC, rpmGlobalMacroContext, + sysinfo_path, fileSystem, internalState @*/ +{ + DBT * key = (DBT *) alloca(sizeof(*key)); + DBT * data = (DBT *) alloca(sizeof(*data)); + rpmmi mi; + nsType NSType; + const char * Name; + rpmuint32_t Flags; + Header h; +#if defined(CACHE_DEPENDENCY_RESULT) + int _cacheThisRC = 1; +#endif + int rc; + int xx; + int retries = 20; + + if ((Name = rpmdsN(dep)) == NULL) + return 0; /* XXX can't happen */ + Flags = rpmdsFlags(dep); + NSType = rpmdsNSType(dep); + +#if defined(CACHE_DEPENDENCY_RESULT) + /* + * Check if dbiOpen/dbiPut failed (e.g. permissions), we can't cache. + */ + if (_cacheDependsRC) { + dbiIndex dbi; + dbi = dbiOpen(rpmtsGetRdb(ts), RPMDBI_DEPCACHE, 0); + if (dbi == NULL) + _cacheDependsRC = 0; + else { + const char * DNEVR; + + rc = -1; + if ((DNEVR = rpmdsDNEVR(dep)) != NULL) { + DBC * dbcursor = NULL; + void * datap = NULL; + size_t datalen = 0; + size_t DNEVRlen = strlen(DNEVR); + + xx = dbiCopen(dbi, dbiTxnid(dbi), &dbcursor, 0); + + memset(key, 0, sizeof(*key)); +/*@i@*/ key->data = (void *) DNEVR; + key->size = DNEVRlen; + memset(data, 0, sizeof(*data)); + data->data = datap; + data->size = datalen; +/*@-nullstate@*/ /* FIX: data->data may be NULL */ + xx = dbiGet(dbi, dbcursor, key, data, DB_SET); +/*@=nullstate@*/ + DNEVR = (char *) key->data; + DNEVRlen = key->size; + datap = data->data; + datalen = data->size; + + if (xx == 0 && datap && datalen == 4) + memcpy(&rc, datap, datalen); + xx = dbiCclose(dbi, dbcursor, 0); + } + + if (rc >= 0) { + rpmdsNotify(dep, _("(cached)"), rc); + return rpmdsNegateRC(dep, rc); + } + } + } +#endif + +retry: + rc = 0; /* assume dependency is satisfied */ + + /* Expand macro probe dependencies. */ + if (NSType == RPMNS_TYPE_FUNCTION) { + xx = rpmExpandNumeric(Name); + rc = (xx ? 0 : 1); + if (Flags & RPMSENSE_MISSINGOK) + goto unsatisfied; + rpmdsNotify(dep, _("(function probe)"), rc); + goto exit; + } + + /* Evaluate user/group lookup probes. */ + if (NSType == RPMNS_TYPE_USER) { + const char *s; + uid_t uid = 0; + s = Name; while (*s && xisdigit(*s)) s++; + + if (*s) + xx = unameToUid(Name, &uid); + else { + uid = strtol(Name, NULL, 10); + xx = (uidToUname(uid) ? 0 : -1); + } + rc = (xx >= 0 ? 0 : 1); + if (Flags & RPMSENSE_MISSINGOK) + goto unsatisfied; + rpmdsNotify(dep, _("(user lookup)"), rc); + goto exit; + } + if (NSType == RPMNS_TYPE_GROUP) { + const char *s; + gid_t gid = 0; + s = Name; while (*s && xisdigit(*s)) s++; + + if (*s) + xx = gnameToGid(Name, &gid); + else { + gid = strtol(Name, NULL, 10); + xx = (gidToGname(gid) ? 0 : -1); + } + rc = (xx >= 0 ? 0 : 1); + if (Flags & RPMSENSE_MISSINGOK) + goto unsatisfied; + rpmdsNotify(dep, _("(group lookup)"), rc); + goto exit; + } + + /* Evaluate access(2) probe dependencies. */ + if (NSType == RPMNS_TYPE_ACCESS) { + rc = rpmioAccess(Name, NULL, X_OK); + if (Flags & RPMSENSE_MISSINGOK) + goto unsatisfied; + rpmdsNotify(dep, _("(access probe)"), rc); + goto exit; + } + + /* Evaluate mtab lookup and diskspace probe dependencies. */ + if (NSType == RPMNS_TYPE_MOUNTED) { + const char ** fs = NULL; + int nfs = 0; + int i = 0; + + xx = rpmtsInitDSI(ts); + fs = ts->filesystems; + nfs = ts->filesystemCount; + + if (fs != NULL) + for (i = 0; i < nfs; i++) { + if (!strcmp(fs[i], Name)) + break; + } + rc = (i < nfs ? 0 : 1); + if (Flags & RPMSENSE_MISSINGOK) + goto unsatisfied; + rpmdsNotify(dep, _("(mtab probe)"), rc); + goto exit; + } + + if (NSType == RPMNS_TYPE_DISKSPACE) { + size_t nb = strlen(Name); + rpmDiskSpaceInfo dsi = NULL; + const char ** fs = NULL; + size_t fslen = 0, longest = 0; + int nfs = 0; + int i = 0; + + xx = rpmtsInitDSI(ts); + fs = ts->filesystems; + nfs = ts->filesystemCount; + + if (fs != NULL) + for (i = 0; i < nfs; i++) { + fslen = strlen(fs[i]); + if (fslen > nb) + continue; + if (strncmp(fs[i], Name, fslen)) + continue; + if (fslen > 1 && Name[fslen] != '/' && Name[fslen] != '\0') + continue; + if (fslen < longest) + continue; + longest = fslen; + dsi = ts->dsi + i; + } + if (dsi == NULL) + rc = 1; /* no mounted paths !?! */ + else { + char * end = NULL; +/*@-unrecog@*/ + rpmuint64_t needed = strtoll(rpmdsEVR(dep), &end, 0); +/*@=unrecog@*/ + + if (end && *end) { + if (strchr("Gg", end[0]) && strchr("Bb", end[1]) && !end[2]) + needed *= 1024 * 1024 * 1024; + if (strchr("Mm", end[0]) && strchr("Bb", end[1]) && !end[2]) + needed *= 1024 * 1024; + if (strchr("Kk", end[0]) && strchr("Bb", end[1]) && !end[2]) + needed *= 1024; + } else + needed *= 1024 * 1024; /* XXX assume Mb if no units given */ + + needed = BLOCK_ROUND(needed, dsi->f_bsize); + xx = (dsi->f_bavail - needed); + if ((Flags & RPMSENSE_LESS) && xx < 0) rc = 0; + else if ((Flags & RPMSENSE_GREATER) && xx > 0) rc = 0; + else if ((Flags & RPMSENSE_EQUAL) && xx == 0) rc = 0; + else rc = 1; + } + if (Flags & RPMSENSE_MISSINGOK) + goto unsatisfied; + rpmdsNotify(dep, _("(diskspace probe)"), rc); + goto exit; + } + + if (NSType == RPMNS_TYPE_DIGEST) { + const char * EVR = rpmdsEVR(dep); + const char *filename; + pgpHashAlgo digestHashAlgo; + FD_t fd; + char *cp; + pgpHashAlgo algo; + + filename = Name; + digestHashAlgo = PGPHASHALGO_MD5; + if ((cp = (char *) strchr(filename, ':')) != NULL) { + if ((algo = pgpHashAlgoStringToNumber(filename, cp-filename)) != PGPHASHALGO_ERROR) { + digestHashAlgo = algo; + filename = cp + 1; + } + } + rc = 1; /* XXX assume failure */ + fd = Fopen(filename, "r.fdio"); + if (fd && !Ferror(fd)) { + DIGEST_CTX ctx = rpmDigestInit(digestHashAlgo, RPMDIGEST_NONE); + const char * digest = NULL; + size_t digestlen = 0; + int asAscii = 1; + size_t nbuf = 8 * BUFSIZ; + char * buf = (char *) alloca(nbuf); + size_t nb; + + while ((nb = Fread(buf, sizeof(buf[0]), nbuf, fd)) > 0) + xx = rpmDigestUpdate(ctx, buf, nb); + xx = Fclose(fd); fd = NULL; + xx = rpmDigestFinal(ctx, &digest, &digestlen, asAscii); + + xx = (EVR && *EVR && digest && *digest) ? strcasecmp(EVR, digest) : -1; + /* XXX only equality makes sense for digest compares */ + if ((Flags & RPMSENSE_EQUAL) && xx == 0) rc = 0; + } + if (Flags & RPMSENSE_MISSINGOK) + goto unsatisfied; + rpmdsNotify(dep, _("(digest probe)"), rc); + goto exit; + } + + if (NSType == RPMNS_TYPE_SIGNATURE) { + const char * EVR = rpmdsEVR(dep); + ARGV_t avN = NULL; + ARGV_t avEVR = NULL; + rpmRC res; + + /* Split /fn:/sig */ + xx = argvSplit(&avN, Name, ":"); + + /* Split /pub:id */ + xx = (EVR && *EVR) ? argvSplit(&avEVR, EVR, ":") : argvAdd(&avEVR, ""); + + res = rpmnsProbeSignature(ts, avN[0], avN[1], avEVR[0], avEVR[1], 0); + rc = (res == RPMRC_OK ? 0 : 1); + + avN = argvFree(avN); + avEVR = argvFree(avEVR); + + if (Flags & RPMSENSE_MISSINGOK) + goto unsatisfied; + rpmdsNotify(dep, _("(signature probe)"), rc); + goto exit; + } + + if (NSType == RPMNS_TYPE_VERIFY) { + QVA_t qva = (QVA_t) memset(alloca(sizeof(*qva)), 0, sizeof(*qva)); + + qva->qva_mode = 'v'; + qva->qva_flags = (rpmQueryFlags) + (VERIFY_ALL & ~(VERIFY_DEPS|VERIFY_SCRIPT)); + rc = 0; /* assume success */ + if (rpmtsGetRdb(ts) != NULL) { + if (!strcmp(Name, "*")) /* -Va probe */ + mi = rpmtsInitIterator(ts, RPMDBI_PACKAGES, NULL, 0); + else if (Name[0] == '/') /* -Vf probe */ + mi = rpmtsInitIterator(ts, RPMTAG_BASENAMES, Name, 0); + else /* -V probe */ + mi = rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, Name, 0); + while ((h = rpmmiNext(mi)) != NULL) { + if (!(Name[0] == '/' || !strcmp(Name, "*"))) + if (!rpmdsAnyMatchesDep(h, dep, _rpmds_nopromote)) + continue; + xx = (showVerifyPackage(qva, ts, h) ? 1 : 0); + if (xx) + rc = 1; + } + mi = rpmmiFree(mi); + } + + if (Flags & RPMSENSE_MISSINGOK) + goto unsatisfied; + rpmdsNotify(dep, _("(verify probe)"), rc); + goto exit; + } + + if (NSType == RPMNS_TYPE_GNUPG) { + const char * EVR = rpmdsEVR(dep); + if (!(EVR && *EVR)) { + static const char gnupg_pre[] = "%(%{__gpg} --batch --no-tty --quiet --verify "; + static const char gnupg_post[] = " 2>/dev/null; echo $?)"; + const char * t = rpmExpand(gnupg_pre, Name, gnupg_post, NULL); + rc = (t && t[0] == '0') ? 0 : 1; + t = _free(t); + } + else { + static const char gnupg_pre[] = "%(%{__gpg} --batch --no-tty --quiet --verify "; + static const char gnupg_post[] = " 2>&1 | grep '^Primary key fingerprint:' | sed -e 's;^.*: *;;' -e 's; *;;g')"; + const char * t = rpmExpand(gnupg_pre, Name, gnupg_post, NULL); + rc = ((Flags & RPMSENSE_EQUAL) && strcasecmp(EVR, t) == 0) ? 0 : 1; + t = _free(t); + } + if (Flags & RPMSENSE_MISSINGOK) + goto unsatisfied; + rpmdsNotify(dep, _("(gnupg probe)"), rc); + goto exit; + } + + if (NSType == RPMNS_TYPE_MACRO) { + static const char macro_pre[] = "%{?"; + static const char macro_post[] = ":0}"; + const char * a = rpmExpand(macro_pre, Name, macro_post, NULL); + + rc = (a && a[0] == '0') ? 0 : 1; + a = _free(a); + if (Flags & RPMSENSE_MISSINGOK) + goto unsatisfied; + rpmdsNotify(dep, _("(macro probe)"), rc); + goto exit; + } + + if (NSType == RPMNS_TYPE_ENVVAR) { + const char * a = envGet(Name); + const char * b = rpmdsEVR(dep); + + /* Existence test if EVR is missing/empty. */ + if (!(b && *b)) + rc = (!(a && *a)); + else { + int sense = (a && *a) ? strcmp(a, b) : -1; + + if ((Flags & RPMSENSE_SENSEMASK) == RPMSENSE_NOTEQUAL) + rc = (sense == 0); + else if (sense < 0 && (Flags & RPMSENSE_LESS)) + rc = 0; + else if (sense > 0 && (Flags & RPMSENSE_GREATER)) + rc = 0; + else if (sense == 0 && (Flags & RPMSENSE_EQUAL)) + rc = 0; + else + rc = (sense != 0); + } + + if (Flags & RPMSENSE_MISSINGOK) + goto unsatisfied; + rpmdsNotify(dep, _("(envvar probe)"), rc); + goto exit; + } + + if (NSType == RPMNS_TYPE_RUNNING) { + char *t = NULL; + pid_t pid = strtol(Name, &t, 10); + + if (t == NULL || *t != '\0') { + const char * fn = rpmGetPath("%{_varrun}/", Name, ".pid", NULL); + FD_t fd = NULL; + + if (fn && *fn != '%' && (fd = Fopen(fn, "r.fdio")) && !Ferror(fd)) { + char buf[32]; + size_t nb = Fread(buf, sizeof(buf[0]), sizeof(buf), fd); + + if (nb > 0) + pid = strtol(buf, &t, 10); + } else + pid = 0; + if (fd != NULL) + (void) Fclose(fd); + fn = _free(fn); + } + rc = (pid > 0 ? (kill(pid, 0) < 0 && errno == ESRCH) : 1); + if (Flags & RPMSENSE_MISSINGOK) + goto unsatisfied; + rpmdsNotify(dep, _("(running probe)"), rc); + goto exit; + } + + if (NSType == RPMNS_TYPE_SANITY) { + /* XXX only the installer does not have the database open here. */ + rc = 1; /* assume failure */ + if (rpmtsGetRdb(ts) != NULL) { + mi = rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, Name, 0); + while ((h = rpmmiNext(mi)) != NULL) { + if (!rpmdsAnyMatchesDep(h, dep, _rpmds_nopromote)) + continue; + rc = (headerIsEntry(h, RPMTAG_SANITYCHECK) == 0); + if (rc == 0) { + /* XXX FIXME: actually run the sanitycheck script. */ + break; + } + } + mi = rpmmiFree(mi); + } + if (Flags & RPMSENSE_MISSINGOK) + goto unsatisfied; + rpmdsNotify(dep, _("(sanity probe)"), rc); + goto exit; + } + + if (NSType == RPMNS_TYPE_VCHECK) { + rc = 1; /* assume failure */ + if (rpmtsGetRdb(ts) != NULL) { + mi = rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, Name, 0); + while ((h = rpmmiNext(mi)) != NULL) { + if (!rpmdsAnyMatchesDep(h, dep, _rpmds_nopromote)) + continue; + rc = (headerIsEntry(h, RPMTAG_TRACK) == 0); + if (rc == 0) { + /* XXX FIXME: actually run the vcheck script. */ + break; + } + } + mi = rpmmiFree(mi); + } + if (Flags & RPMSENSE_MISSINGOK) + goto unsatisfied; + rpmdsNotify(dep, _("(vcheck probe)"), rc); + goto exit; + } + + /* Search system configured provides. */ + if (sysinfo_path == NULL) { + sysinfo_path = rpmExpand("%{?_rpmds_sysinfo_path}", NULL); + if (!(sysinfo_path != NULL && *sysinfo_path == '/')) { + sysinfo_path = _free(sysinfo_path); + sysinfo_path = xstrdup(SYSCONFIGDIR "/sysinfo"); + } + } + + if (!rpmioAccess(sysinfo_path, NULL, R_OK)) { +#ifdef NOTYET /* XXX just sysinfo Provides: for now. */ + rpmTag tagN = (Name[0] == '/' ? RPMTAG_DIRNAMES : RPMTAG_PROVIDENAME); +#else + rpmTag tagN = RPMTAG_PROVIDENAME; +#endif + rpmds P = rpmdsFromPRCO(rpmtsPRCO(ts), tagN); + if (rpmdsSearch(P, dep) >= 0) { + rpmdsNotify(dep, _("(sysinfo provides)"), rc); + goto exit; + } + } + + /* + * New features in rpm packaging implicitly add versioned dependencies + * on rpmlib provides. The dependencies look like "rpmlib(YaddaYadda)". + * Check those dependencies now. + */ + if (NSType == RPMNS_TYPE_RPMLIB) { + static int oneshot = -1; + + if (oneshot) + oneshot = rpmdsRpmlib(&rpmlibP, NULL); + if (rpmlibP == NULL) + goto unsatisfied; + + if (rpmdsSearch(rpmlibP, dep) >= 0) { + rpmdsNotify(dep, _("(rpmlib provides)"), rc); + goto exit; + } + goto unsatisfied; + } + + if (NSType == RPMNS_TYPE_CPUINFO) { + static int oneshot = -1; + + if (oneshot && cpuinfoP == NULL) + oneshot = rpmdsCpuinfo(&cpuinfoP, NULL); + if (cpuinfoP == NULL) + goto unsatisfied; + + if (rpmdsSearch(cpuinfoP, dep) >= 0) { + rpmdsNotify(dep, _("(cpuinfo provides)"), rc); + goto exit; + } + goto unsatisfied; + } + + if (NSType == RPMNS_TYPE_GETCONF) { + static int oneshot = -1; + + if (oneshot) + oneshot = rpmdsGetconf(&getconfP, NULL); + if (getconfP == NULL) + goto unsatisfied; + + if (rpmdsSearch(getconfP, dep) >= 0) { + rpmdsNotify(dep, _("(getconf provides)"), rc); + goto exit; + } + goto unsatisfied; + } + + if (NSType == RPMNS_TYPE_UNAME) { + static int oneshot = -1; + + if (oneshot) + oneshot = rpmdsUname(&unameP, NULL); + if (unameP == NULL) + goto unsatisfied; + + if (rpmdsSearch(unameP, dep) >= 0) { + rpmdsNotify(dep, _("(uname provides)"), rc); + goto exit; + } + goto unsatisfied; + } + + if (NSType == RPMNS_TYPE_SONAME) { + rpmds sonameP = NULL; + rpmPRCO PRCO = rpmdsNewPRCO(NULL); + char * fn = strcpy((char *)alloca(strlen(Name)+1), Name); + int flags = 0; /* XXX RPMELF_FLAG_SKIPREQUIRES? */ + rpmds ds; + + /* XXX Only absolute paths for now. */ + if (*fn != '/') + goto unsatisfied; + fn[strlen(fn)-1] = '\0'; + + /* Extract ELF Provides: from /path/to/DSO. */ + xx = rpmdsELF(fn, flags, rpmdsMergePRCO, PRCO); + sonameP = rpmdsFromPRCO(PRCO, RPMTAG_PROVIDENAME); + if (!(xx == 0 && sonameP != NULL)) + goto unsatisfied; + + /* Search using the original {EVR,"",Flags} from the dep set. */ + ds = rpmdsSingle(rpmdsTagN(dep), rpmdsEVR(dep), "", (evrFlags)Flags); + xx = rpmdsSearch(sonameP, ds); + (void)rpmdsFree(ds); + ds = NULL; + PRCO = rpmdsFreePRCO(PRCO); + + /* Was the dependency satisfied? */ + if (xx >= 0) { + rpmdsNotify(dep, _("(soname provides)"), rc); + goto exit; + } + goto unsatisfied; + } + + /* Search added packages for the dependency. */ + if (rpmalSatisfiesDepend(ts->addedPackages, dep, NULL) != NULL) { +#if defined(CACHE_DEPENDENCY_RESULT) + /* + * XXX Ick, context sensitive answers from dependency cache. + * XXX Always resolve added dependencies within context to disambiguate. + */ + if (_rpmds_nopromote) + _cacheThisRC = 0; +#endif + goto exit; + } + + /* XXX only the installer does not have the database open here. */ + if (rpmtsGetRdb(ts) != NULL) { + /* XXX Always satisfy Requires: /, SuSE (others?) doesn't package "/" */ + if (Name[0] == '/' && Name[1] == '\0') { + rpmdsNotify(dep, _("(root files)"), rc); + goto exit; + } + if (Name[0] == '/') { + mi = rpmtsInitIterator(ts, RPMTAG_BASENAMES, Name, 0); + (void) rpmmiPrune(mi, + ts->removedPackages, ts->numRemovedPackages, 1); + while ((h = rpmmiNext(mi)) != NULL) { + rpmdsNotify(dep, _("(db files)"), rc); + mi = rpmmiFree(mi); + goto exit; + } + mi = rpmmiFree(mi); + } + + mi = rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, Name, 0); + (void) rpmmiPrune(mi, + ts->removedPackages, ts->numRemovedPackages, 1); + while ((h = rpmmiNext(mi)) != NULL) { + if (rpmdsAnyMatchesDep(h, dep, _rpmds_nopromote)) { + rpmdsNotify(dep, _("(db provides)"), rc); + mi = rpmmiFree(mi); + goto exit; + } + } + mi = rpmmiFree(mi); + } + + /* + * Search for an unsatisfied dependency. + */ + if (adding == 1 && retries > 0 && !(rpmtsDFlags(ts) & RPMDEPS_FLAG_NOSUGGEST)) { + if (ts->solve != NULL) { + xx = (*ts->solve) (ts, dep, ts->solveData); + if (xx == 0) + goto exit; + if (xx == -1) { + retries--; + rpmalMakeIndex(ts->addedPackages); + goto retry; + } + } + } + +unsatisfied: + if (Flags & RPMSENSE_MISSINGOK) { + rc = 0; /* dependency is unsatisfied, but just a hint. */ +#if defined(CACHE_DEPENDENCY_RESULT) + _cacheThisRC = 0; +#endif + rpmdsNotify(dep, _("(hint skipped)"), rc); + } else { + rc = 1; /* dependency is unsatisfied */ + rpmdsNotify(dep, NULL, rc); + } + +exit: + /* + * If dbiOpen/dbiPut fails (e.g. permissions), we can't cache. + */ +#if defined(CACHE_DEPENDENCY_RESULT) + if (_cacheDependsRC && _cacheThisRC) { + dbiIndex dbi; + dbi = dbiOpen(rpmtsGetRdb(ts), RPMDBI_DEPCACHE, 0); + if (dbi == NULL) { + _cacheDependsRC = 0; + } else { + const char * DNEVR; + xx = 0; + if ((DNEVR = rpmdsDNEVR(dep)) != NULL) { + DBC * dbcursor = NULL; + size_t DNEVRlen = strlen(DNEVR); + + xx = dbiCopen(dbi, dbiTxnid(dbi), &dbcursor, DB_WRITECURSOR); + + memset(key, 0, sizeof(*key)); +/*@i@*/ key->data = (void *) DNEVR; + key->size = DNEVRlen; + memset(data, 0, sizeof(*data)); + data->data = &rc; + data->size = sizeof(rc); + + /*@-compmempass@*/ + xx = dbiPut(dbi, dbcursor, key, data, 0); + /*@=compmempass@*/ + xx = dbiCclose(dbi, dbcursor, DB_WRITECURSOR); + } + if (xx) + _cacheDependsRC = 0; + } + } +#endif + + return rpmdsNegateRC(dep, rc); +} + +/** + * Check added requires/conflicts against against installed+added packages. + * @param ts transaction set + * @param pkgNEVRA package name-version-release.arch + * @param requires Requires: dependencies (or NULL) + * @param conflicts Conflicts: dependencies (or NULL) + * @param dirnames Dirnames: dependencies (or NULL) + * @param linktos Filelinktos: dependencies (or NULL) + * @param depName dependency name to filter (or NULL) + * @param tscolor color bits for transaction set (0 disables) + * @param adding dependency is from added package set? + * @return 0 = deps ok, 1 = dep problems, 2 = error + */ +static int checkPackageDeps(rpmts ts, const char * pkgNEVRA, + /*@null@*/ rpmds requires, + /*@null@*/ rpmds conflicts, + /*@null@*/ rpmds dirnames, + /*@null@*/ rpmds linktos, + /*@null@*/ const char * depName, + rpmuint32_t tscolor, int adding) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies ts, requires, conflicts, dirnames, linktos, + rpmGlobalMacroContext, fileSystem, internalState */ +{ + rpmps ps = rpmtsProblems(ts); + rpmuint32_t dscolor; + const char * Name; + int terminate = 2; /* XXX terminate if rc >= terminate */ + int rc; + int ourrc = 0; +#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_ARK) || defined(RPM_OPTIONAL_DIRNAME_AND_SYMLINK_DEPS) /* optional-dirname-and-symlink-deps */ + int dirname_deps; + int symlink_deps; +#endif + + requires = rpmdsInit(requires); + if (requires != NULL) + while (ourrc < terminate && rpmdsNext(requires) >= 0) { + + if ((Name = rpmdsN(requires)) == NULL) + continue; /* XXX can't happen */ + + /* Filter out requires that came along for the ride. */ + if (depName != NULL && strcmp(depName, Name)) + continue; + + /* Ignore colored requires not in our rainbow. */ + dscolor = rpmdsColor(requires); + if (tscolor && dscolor && !(tscolor & dscolor)) + continue; + + rc = unsatisfiedDepend(ts, requires, adding); + + switch (rc) { + case 0: /* requirements are satisfied. */ + /*@switchbreak@*/ break; + case 1: /* requirements are not satisfied. */ + { fnpyKey * suggestedKeys = NULL; + + if (ts->availablePackages != NULL) { + suggestedKeys = rpmalAllSatisfiesDepend(ts->availablePackages, + requires, NULL); + } + + rpmdsProblem(ps, pkgNEVRA, requires, suggestedKeys, adding); + + } + ourrc = 1; + /*@switchbreak@*/ break; + case 2: /* something went wrong! */ + default: + ourrc = 2; + /*@switchbreak@*/ break; + } + } + + conflicts = rpmdsInit(conflicts); + if (conflicts != NULL) + while (ourrc < terminate && rpmdsNext(conflicts) >= 0) { + + if ((Name = rpmdsN(conflicts)) == NULL) + continue; /* XXX can't happen */ + + /* Filter out conflicts that came along for the ride. */ + if (depName != NULL && strcmp(depName, Name)) + continue; + + /* Ignore colored conflicts not in our rainbow. */ + dscolor = rpmdsColor(conflicts); + if (tscolor && dscolor && !(tscolor & dscolor)) + continue; + + rc = unsatisfiedDepend(ts, conflicts, adding); + + /* 1 == unsatisfied, 0 == satsisfied */ + switch (rc) { + case 0: /* conflicts exist. */ + rpmdsProblem(ps, pkgNEVRA, conflicts, NULL, adding); + ourrc = 1; + /*@switchbreak@*/ break; + case 1: /* conflicts don't exist. */ + /*@switchbreak@*/ break; + case 2: /* something went wrong! */ + default: + ourrc = 2; + /*@switchbreak@*/ break; + } + } + +#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_ARK) || defined(RPM_OPTIONAL_DIRNAME_AND_SYMLINK_DEPS) /* optional-dirname-and-symlink-deps */ + dirname_deps = rpmExpandNumeric("%{?_check_dirname_deps}%{?!_check_dirname_deps:1}"); + if (dirname_deps) { +#endif + dirnames = rpmdsInit(dirnames); + if (dirnames != NULL) + while (ourrc < terminate && rpmdsNext(dirnames) >= 0) { + + if ((Name = rpmdsN(dirnames)) == NULL) + continue; /* XXX can't happen */ + + /* Filter out dirnames that came along for the ride. */ + if (depName != NULL && strcmp(depName, Name)) + continue; + + /* Ignore colored dirnames not in our rainbow. */ + dscolor = rpmdsColor(dirnames); + if (tscolor && dscolor && !(tscolor & dscolor)) + continue; + + rc = unsatisfiedDepend(ts, dirnames, adding); + + switch (rc) { + case 0: /* requirements are satisfied. */ + /*@switchbreak@*/ break; + case 1: /* requirements are not satisfied. */ + { fnpyKey * suggestedKeys = NULL; + + if (ts->availablePackages != NULL) { + suggestedKeys = rpmalAllSatisfiesDepend(ts->availablePackages, + dirnames, NULL); + } + + rpmdsProblem(ps, pkgNEVRA, dirnames, suggestedKeys, adding); + + } + ourrc = 1; + /*@switchbreak@*/ break; + case 2: /* something went wrong! */ + default: + ourrc = 2; + /*@switchbreak@*/ break; + } + } +#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_ARK) || defined(RPM_OPTIONAL_DIRNAME_AND_SYMLINK_DEPS) /* optional-dirname-and-symlink-deps */ + } + + symlink_deps = rpmExpandNumeric("%{?_check_symlink_deps}%{?!_check_symlink_deps:1}"); + if (symlink_deps) { +#endif + linktos = rpmdsInit(linktos); + if (linktos != NULL) + while (ourrc < terminate && rpmdsNext(linktos) >= 0) { + + if ((Name = rpmdsN(linktos)) == NULL) + continue; /* XXX can't happen */ + if (*Name == '\0') /* XXX most linktos are empty */ + continue; + + /* Filter out linktos that came along for the ride. */ + if (depName != NULL && strcmp(depName, Name)) + continue; + + /* Ignore colored linktos not in our rainbow. */ + dscolor = rpmdsColor(linktos); + if (tscolor && dscolor && !(tscolor & dscolor)) + continue; + + rc = unsatisfiedDepend(ts, linktos, adding); + + switch (rc) { + case 0: /* requirements are satisfied. */ + /*@switchbreak@*/ break; + case 1: /* requirements are not satisfied. */ + { fnpyKey * suggestedKeys = NULL; + + if (ts->availablePackages != NULL) { + suggestedKeys = rpmalAllSatisfiesDepend(ts->availablePackages, + linktos, NULL); + } + + rpmdsProblem(ps, pkgNEVRA, linktos, suggestedKeys, adding); + + } + ourrc = 1; + /*@switchbreak@*/ break; + case 2: /* something went wrong! */ + default: + ourrc = 2; + /*@switchbreak@*/ break; + } + } +#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_ARK) || defined(RPM_OPTIONAL_DIRNAME_AND_SYMLINK_DEPS) /* optional-dirname-and-symlink-deps */ + } +#endif + + ps = rpmpsFree(ps); + return ourrc; +} + +/** + * Check dependency against installed packages. + * Adding: check name/provides dep against each conflict match, + * Erasing: check name/provides/filename dep against each requiredby match. + * @param ts transaction set + * @param depName dependency name + * @param mi rpm database iterator + * @param adding dependency is from added package set? + * @return 0 no problems found + */ +static int checkPackageSet(rpmts ts, const char * depName, + /*@only@*/ /*@null@*/ rpmmi mi, int adding) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, mi, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmdepFlags depFlags = rpmtsDFlags(ts); + rpmuint32_t tscolor = rpmtsColor(ts); + int scareMem = 0; + Header h; + int terminate = 2; /* XXX terminate if rc >= terminate */ + int ourrc = 0; + + (void) rpmmiPrune(mi, + ts->removedPackages, ts->numRemovedPackages, 1); + while (ourrc < terminate && (h = rpmmiNext(mi)) != NULL) { + rpmds requires = NULL; + rpmds conflicts = NULL; + rpmds dirnames = NULL; + rpmds linktos = NULL; + int rc; + + he->tag = RPMTAG_NVRA; + rc = (headerGet(h, he, 0) ? 0 : 2); + if (rc > ourrc) + ourrc = rc; + if (ourrc >= terminate) { + he->p.str = _free(he->p.str); + break; + } + + if (!(depFlags & RPMDEPS_FLAG_NOREQUIRES)) + requires = rpmdsNew(h, RPMTAG_REQUIRENAME, scareMem); + if (!(depFlags & RPMDEPS_FLAG_NOCONFLICTS)) + conflicts = rpmdsNew(h, RPMTAG_CONFLICTNAME, scareMem); + if (!(depFlags & RPMDEPS_FLAG_NOPARENTDIRS)) + dirnames = rpmdsNew(h, RPMTAG_DIRNAMES, scareMem); + if (!(depFlags & RPMDEPS_FLAG_NOLINKTOS)) + linktos = rpmdsNew(h, RPMTAG_FILELINKTOS, scareMem); + + (void) rpmdsSetNoPromote(requires, _rpmds_nopromote); + (void) rpmdsSetNoPromote(conflicts, _rpmds_nopromote); + (void) rpmdsSetNoPromote(dirnames, _rpmds_nopromote); + (void) rpmdsSetNoPromote(linktos, _rpmds_nopromote); + + rc = checkPackageDeps(ts, he->p.str, + requires, conflicts, dirnames, linktos, + depName, tscolor, adding); + + (void)rpmdsFree(linktos); + linktos = NULL; + (void)rpmdsFree(dirnames); + dirnames = NULL; + (void)rpmdsFree(conflicts); + conflicts = NULL; + (void)rpmdsFree(requires); + requires = NULL; + he->p.str = _free(he->p.str); + + if (rc > ourrc) + ourrc = rc; + } + mi = rpmmiFree(mi); + + return ourrc; +} + +/** + * Check to-be-erased dependencies against installed requires. + * @param ts transaction set + * @param depName requires name + * @return 0 no problems found + */ +static int checkDependentPackages(rpmts ts, const char * depName) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + int rc = 0; + + /* XXX rpmdb can be closed here, avoid error msg. */ + if (rpmtsGetRdb(ts) != NULL) { + rpmmi mi; + mi = rpmtsInitIterator(ts, RPMTAG_REQUIRENAME, depName, 0); + rc = checkPackageSet(ts, depName, mi, 0); + } + return rc; +} + +/** + * Check to-be-added dependencies against installed conflicts. + * @param ts transaction set + * @param depName conflicts name + * @return 0 no problems found + */ +static int checkDependentConflicts(rpmts ts, const char * depName) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + int rc = 0; + + /* XXX rpmdb can be closed here, avoid error msg. */ + if (rpmtsGetRdb(ts) != NULL) { + rpmmi mi; + mi = rpmtsInitIterator(ts, RPMTAG_CONFLICTNAME, depName, 0); + rc = checkPackageSet(ts, depName, mi, 1); + } + + return rc; +} + +int _rpmtsCheck(rpmts ts) +{ + const char * depName = NULL; + rpmdepFlags depFlags = rpmtsDFlags(ts); + rpmuint32_t tscolor = rpmtsColor(ts); + rpmmi mi = NULL; + rpmtsi pi = NULL; rpmte p; + int closeatexit = 0; + int xx; + int terminate = 2; /* XXX terminate if rc >= terminate */ + int rc = 0; + int ourrc = 0; + +if (_rpmts_debug) +fprintf(stderr, "--> %s(%p) tsFlags 0x%x\n", __FUNCTION__, ts, rpmtsFlags(ts)); + + (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_CHECK), 0); + + /* Do lazy, readonly, open of rpm database. */ + if (rpmtsGetRdb(ts) == NULL && rpmtsDBMode(ts) != -1) { + rc = (rpmtsOpenDB(ts, rpmtsDBMode(ts)) ? 2 : 0); + closeatexit = (rc == 0); + } + if (rc && (ourrc = rc) >= terminate) + goto exit; + + ts->probs = rpmpsFree(ts->probs); + + rpmalMakeIndex(ts->addedPackages); + + /* + * Look at all of the added packages and make sure their dependencies + * are satisfied. + */ + pi = rpmtsiInit(ts); + while (ourrc < terminate && (p = rpmtsiNext(pi, TR_ADDED)) != NULL) { + rpmds provides, requires, conflicts, dirnames, linktos; + rpmfi fi; + +/*@-nullpass@*/ /* FIX: rpmts{A,O} can return null. */ + rpmlog(RPMLOG_DEBUG, "========== +++ %s %s/%s 0x%x\n", + rpmteNEVR(p), rpmteA(p), rpmteO(p), rpmteColor(p)); +/*@=nullpass@*/ + requires = (!(depFlags & RPMDEPS_FLAG_NOREQUIRES) + ? rpmteDS(p, RPMTAG_REQUIRENAME) : NULL); + conflicts = (!(depFlags & RPMDEPS_FLAG_NOCONFLICTS) + ? rpmteDS(p, RPMTAG_CONFLICTNAME) : NULL); + /* XXX srpm's don't have directory paths. */ + if (p->isSource) { + dirnames = NULL; + linktos = NULL; + } else { + dirnames = (!(depFlags & RPMDEPS_FLAG_NOPARENTDIRS) + ? rpmteDS(p, RPMTAG_DIRNAMES) : NULL); + linktos = (!(depFlags & RPMDEPS_FLAG_NOLINKTOS) + ? rpmteDS(p, RPMTAG_FILELINKTOS) : NULL); + } + + rc = checkPackageDeps(ts, rpmteNEVRA(p), + requires, conflicts, dirnames, linktos, + NULL, tscolor, 1); + if (rc && (ourrc = rc) >= terminate) + break; + + provides = rpmteDS(p, RPMTAG_PROVIDENAME); + provides = rpmdsInit(provides); + if (provides != NULL) + while (ourrc < terminate && rpmdsNext(provides) >= 0) { + depName = _free(depName); + depName = xstrdup(rpmdsN(provides)); + +#ifdef NOTYET + if (rpmdsNSType(provides) == RPMNS_TYPE_ENVVAR) { + const char * EVR = rpmdsEVR(provides); + if (rpmdsNegateRC(provides, 0)) + EVR = NULL; + if (envPut(depName, EVR)); + rc = 2; + } else +#endif + + /* Adding: check provides key against conflicts matches. */ + if (checkDependentConflicts(ts, depName)) + rc = 1; + } + if (rc && (ourrc = rc) >= terminate) + break; + + fi = rpmteFI(p, RPMTAG_BASENAMES); + fi = rpmfiInit(fi, 0); + while (ourrc < terminate && rpmfiNext(fi) >= 0) { + depName = _free(depName); + depName = xstrdup(rpmfiFN(fi)); + /* Adding: check filename against conflicts matches. */ + if (checkDependentConflicts(ts, depName)) + rc = 1; + } + if (rc && (ourrc = rc) >= terminate) + break; + } + pi = rpmtsiFree(pi); + if (rc && (ourrc = rc) >= terminate) + goto exit; + + /* + * Look at the removed packages and make sure they aren't critical. + */ + pi = rpmtsiInit(ts); + while (ourrc < terminate && (p = rpmtsiNext(pi, TR_REMOVED)) != NULL) { + rpmds provides; + rpmfi fi; + +/*@-nullpass@*/ /* FIX: rpmts{A,O} can return null. */ + rpmlog(RPMLOG_DEBUG, "========== --- %s %s/%s 0x%x\n", + rpmteNEVR(p), rpmteA(p), rpmteO(p), rpmteColor(p)); +/*@=nullpass@*/ + + provides = rpmteDS(p, RPMTAG_PROVIDENAME); + provides = rpmdsInit(provides); + if (provides != NULL) + while (ourrc < terminate && rpmdsNext(provides) >= 0) { + depName = _free(depName); + depName = xstrdup(rpmdsN(provides)); + + /* Erasing: check provides against requiredby matches. */ + if (checkDependentPackages(ts, depName)) + rc = 1; + } + if (rc && (ourrc = rc) >= terminate) + break; + + fi = rpmteFI(p, RPMTAG_BASENAMES); + fi = rpmfiInit(fi, 0); + while (ourrc < terminate && rpmfiNext(fi) >= 0) { + depName = _free(depName); + depName = xstrdup(rpmfiFN(fi)); + /* Erasing: check filename against requiredby matches. */ + if (checkDependentPackages(ts, depName)) + rc = 1; + } + if (rc && (ourrc = rc) >= terminate) + break; + } + pi = rpmtsiFree(pi); + if (rc && (ourrc = rc) >= terminate) + goto exit; + + /* + * Make sure transaction dependencies are satisfied. + */ + { const char * tsNEVRA = "transaction dependencies"; + rpmds R = rpmdsFromPRCO(rpmtsPRCO(ts), RPMTAG_REQUIRENAME); + rpmds C = rpmdsFromPRCO(rpmtsPRCO(ts), RPMTAG_CONFLICTNAME); + rpmds D = NULL; + rpmds L = NULL; + const char * dep = NULL; + int adding = 2; + tscolor = 0; /* XXX no coloring for transaction dependencies. */ + rc = checkPackageDeps(ts, tsNEVRA, R, C, D, L, dep, tscolor, adding); + } + if (rc && (ourrc = rc) >= terminate) + goto exit; + +exit: + mi = rpmmiFree(mi); + pi = rpmtsiFree(pi); + depName = _free(depName); + + (void) rpmswExit(rpmtsOp(ts, RPMTS_OP_CHECK), 0); + + if (closeatexit) + xx = rpmtsCloseDB(ts); +#if defined(CACHE_DEPENDENCY_RESULT) + else if (_cacheDependsRC) + xx = rpmdbCloseDBI(rpmtsGetRdb(ts), RPMDBI_DEPCACHE); +#endif + +#ifdef NOTYET + /* On failed dependencies, perform the autorollback goal (if any). */ + { rpmps ps = rpmtsProblems(ts); + if (rc || rpmpsNumProblems(ps) > 0) + (void) rpmtsRollback(ts, RPMPROB_FILTER_NONE, 0, NULL); + ps = rpmpsFree(ps); + } +#endif + + return ourrc; +} + +int (*rpmtsCheck) (rpmts ts) + = _rpmtsCheck; diff --git a/rpm-5.4.9/lib/filetriggers.c b/rpm-5.4.9/lib/filetriggers.c new file mode 100644 index 0000000..1d53b69 --- /dev/null +++ b/rpm-5.4.9/lib/filetriggers.c @@ -0,0 +1,400 @@ +#include "system.h" + +#if defined(RPM_VENDOR_MANDRIVA) +#include /* XXX for fdGetFILE() */ +#include +#include +#define _MIRE_INTERNAL +#include +#include /* XXX for rpmExpand */ +#include +#include +#include + +#include "filetriggers.h" /* mayAddToFilesAwaitingFiletriggers rpmRunFileTriggers */ + +#include "debug.h" + +#define _FILES_AWAITING_FILETRIGGERS "/var/lib/rpm/files-awaiting-filetriggers" + +/*@unchecked@*/ /*@observer@*/ +static const char * files_awaiting_filetriggers = _FILES_AWAITING_FILETRIGGERS; + +#define FILTER_EXTENSION ".filter" + +/*@unchecked@*/ /*@shared@*/ /*@null@*/ +static const char * _filetriggers_dir; + +/*@null@*/ /*@observer@*/ +static const char * filetriggers_dir(void) + /*@globals _filetriggers_dir, rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies _filetriggers_dir, rpmGlobalMacroContext, internalState @*/ +{ + if (_filetriggers_dir == NULL) + _filetriggers_dir = rpmExpand("%{?_filetriggers_dir}", NULL); + return (_filetriggers_dir != NULL && _filetriggers_dir[0] != '\0') + ? _filetriggers_dir : NULL; +} + +/*@only@*/ /*@null@*/ +static char * get_filter_name(/*@returned@*/ const char * fn) + /*@*/ +{ + char * p = strrchr(fn, '/'); + if (p == NULL) + return NULL; +#if defined(HAVE_STRNDUP) && !defined(__LCLINT__) + p = strndup(p+1, strlen(p+1) - strlen(FILTER_EXTENSION)); +#else + { char * p_src = p; + size_t p_len = strlen(p_src+1) - strlen(FILTER_EXTENSION); + p = (char *) xmalloc(p_len+1); + strncpy(p, p_src+1, p_len); + } +#endif + return p; +} + +int mayAddToFilesAwaitingFiletriggers(const char * rootDir, rpmfi fi, + int install_or_erase) +{ + const char * fn; + FILE * fp; + int rc = RPMRC_FAIL; + int xx; + + if (filetriggers_dir() == NULL) + return RPMRC_OK; + + fn = rpmGetPath(rootDir ? rootDir : "/", files_awaiting_filetriggers, NULL); + + fp = fopen(fn, "a"); + if (fp == NULL) { + rpmlog(RPMLOG_ERR, _("%s: open failed: %s\n"), fn, strerror(errno)); + goto exit; + } + + fi = rpmfiInit(fi, 0); + if (fi != NULL) + while (rpmfiNext(fi) >= 0) { + xx = fputc(install_or_erase ? '+' : '-', fp); + xx = fputs(rpmfiFN(fi), fp); + xx = fputc('\n', fp); + } + xx = fclose(fp); + rc = RPMRC_OK; + +exit: + fn = _free(fn); + return rc; +} + +struct filetrigger_raw { + char * regexp; +/*@relnull@*/ + char * name; +}; + +struct filetrigger { + miRE mire; + char * name; + int command_pipe; + pid_t command_pid; +}; + +static int getFiletriggers_raw(const char * rootDir, int * nftp, + struct filetrigger_raw ** list_raw) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies *nftp, *list_raw, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + const char * dn = filetriggers_dir(); + const char * globstr = NULL; + ARGV_t av = NULL; + int ac = 0; + int xx; + int i; + + if (dn == NULL) + goto exit; + + globstr = rpmGetPath(rootDir ? rootDir : "/", dn, "/*" FILTER_EXTENSION, NULL); + xx = rpmGlob(globstr, &ac, &av); + if (ac == 0) + goto exit; + + *list_raw = (struct filetrigger_raw *) xcalloc(ac, sizeof(**list_raw)); + + for (i = 0; i < ac; i++) { + const char * fn = av[i]; + int fdno = open(fn, O_RDONLY); + struct stat sb; + + if (fdno == -1) { + rpmlog(RPMLOG_ERR, "opening %s failed: %s\n", fn, strerror(errno)); + continue; + } + + if (fstat(fdno, &sb) == 0 && sb.st_size > 0) { + size_t bn = sb.st_size; + char * b = (char *) xmalloc(bn + 1); + + if (read(fdno, b, bn) != (ssize_t)bn) { + rpmlog(RPMLOG_ERR, "reading %s failed: %s\n", fn, + strerror(errno)); + b = _free(b); + } else { + char * be = b + bn; + *be = '\0'; + if ((be = strchr(b, '\n')) != NULL) { + *be = '\0'; + while (be > b && xisspace((int)be[-1])) + *(--be) = '\0'; + } + (*list_raw)[i].regexp = b; + (*list_raw)[i].name = get_filter_name(fn); + } + } + xx = close(fdno); + } + +exit: + if (nftp != NULL) + *nftp = ac; + av = argvFree(av); + globstr = _free(globstr); + return RPMRC_OK; +} + +static char * computeMatchesAnyFilter(size_t nb, + struct filetrigger_raw * list_raw) + /*@*/ +{ + char * matches_any; + char * p; + size_t regexp_str_size = 0; + int i; + + for (i = 0; i < (int)nb; i++) + regexp_str_size += strlen(list_raw[i].regexp) + 1; + + matches_any = (char *) xmalloc(regexp_str_size); + p = stpcpy(matches_any, list_raw[0].regexp); + + for (i = 1; i < (int)nb; i++) { + *p++ = '|'; + p = stpcpy(p, list_raw[i].regexp); + } + rpmlog(RPMLOG_DEBUG, D_("[filetriggers] matches-any regexp is %s\n"), + matches_any); + return matches_any; +} + +static void compileFiletriggersRegexp(/*@only@*/ char * raw, miRE mire) + /*@modifies raw, mire @*/ +{ + static int options = REG_NOSUB | REG_EXTENDED | REG_NEWLINE; + int xx; + + xx = mireSetCOptions(mire, RPMMIRE_REGEX, 0, options, NULL); + + if (mireRegcomp(mire, raw) != 0) { + rpmlog(RPMLOG_ERR, "failed to compile filetrigger filter: %s\n", raw); + mire = mireFree(mire); + } + raw = _free(raw); +} + +static void getFiletriggers(const char * rootDir, miRE matches_any, + int * nftp, struct filetrigger ** list) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies matches_any, *nftp, *list, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + struct filetrigger_raw * list_raw = NULL; + int xx; + int i; + + xx = getFiletriggers_raw(rootDir, nftp, &list_raw); + if (*nftp == 0) return; + + compileFiletriggersRegexp(computeMatchesAnyFilter(*nftp, list_raw), matches_any); + + *list = (struct filetrigger *) xcalloc(*nftp, sizeof(**list)); + for (i = 0; i < *nftp; i++) { + (*list)[i].name = list_raw[i].name; + (*list)[i].mire = mireNew(0, 0); + compileFiletriggersRegexp(list_raw[i].regexp, (*list)[i].mire); + } + list_raw = _free(list_raw); +} + +static void freeFiletriggers(/*@only@*/ miRE matches_any, + int nft, /*@only@*/ struct filetrigger * list) + /*@modifies matches_any, list @*/ +{ + int i; + + matches_any = mireFree(matches_any); + for (i = 0; i < nft; i++) { + list[i].mire = mireFree(list[i].mire); + list[i].name = _free(list[i].name); + } + list = _free(list); +} + +static int is_regexp_matching(miRE mire, const char * s) + /*@modifies mire @*/ +{ + return mireRegexec(mire, s, (size_t) 0) == 0; +} + +static int popen_with_root(const char * rootDir, const char * cmd, + pid_t * pidp) + /*@globals fileSystem, internalState @*/ + /*@modifies *pidp, fileSystem, internalState @*/ +{ + int pipes[2]; + int xx; + + if (pipe(pipes) != 0) + return 0; + + *pidp = fork(); + if (*pidp == 0) { + const char * argv[2]; + + xx = close(pipes[1]); + xx = dup2(pipes[0], STDIN_FILENO); + xx = close(pipes[0]); + + if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/') { +/*@-superuser@*/ + if (Chroot(rootDir) != 0) { + rpmlog(RPMLOG_ERR, "chroot to %s failed\n", rootDir); + _exit(-1); + } +/*@=superuser@*/ + xx = chdir("/"); + } + argv[0] = cmd; + argv[1] = NULL; + xx = execv(argv[0], (char *const *) argv); + _exit(-1); + } + + xx = close(pipes[0]); + + return pipes[1]; +} + +static void mayStartFiletrigger(const char * rootDir, + struct filetrigger * trigger) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies trigger, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + if (!trigger->command_pipe) { + const char * dn = filetriggers_dir(); + const char * cmd; + + if (dn == NULL) + return; + + cmd = rpmGetPath(dn, "/", trigger->name, ".script", NULL); + rpmlog(RPMLOG_DEBUG, D_("[filetriggers] spawning %s\n"), + cmd); + trigger->command_pipe = popen_with_root(rootDir, cmd, + &trigger->command_pid); + cmd = _free(cmd); + } +} + +void rpmRunFileTriggers(const char * rootDir) +{ + miRE matches_any = mireNew(RPMMIRE_DEFAULT, 0); + int nft = 0; + struct filetrigger *list = NULL; + const char * fn = NULL; + FD_t fd = NULL; + FILE * fp = NULL; + int xx; + + rpmlog(RPMLOG_DEBUG, D_("[filetriggers] starting\n")); + + fn = rpmGenPath(rootDir, files_awaiting_filetriggers, NULL); + + if (!filetriggers_dir()) + goto exit; + + getFiletriggers(rootDir, matches_any, &nft, &list); + if (nft <= 0) + goto exit; + + fd = Fopen(fn, "r.fpio"); + if (fd == NULL) + goto exit; + + fp = fdGetFILE(fd); + + if (fp != NULL) { + void (*oldhandler)(int) = signal(SIGPIPE, SIG_IGN); + char tmp[BUFSIZ]; + int i; + + rpmlog(RPMLOG_DEBUG, + D_("[filetriggers] testing files from list: %s\n"), fn); + + while (fgets(tmp, (int)sizeof(tmp), fp)) { + size_t tmplen = strlen(tmp); + + if (tmplen > 0 && tmp[tmplen-1] == '\n') + tmp[--tmplen] = '\0'; + + if (!is_regexp_matching(matches_any, tmp)) + continue; + + rpmlog(RPMLOG_DEBUG, + D_("[filetriggers] matches-any regexp found %s\n"), + tmp); + + for (i = 0; i < nft; i++) { + ssize_t nw; + if (!is_regexp_matching(list[i].mire, tmp)) + /*@innercontinue@*/ continue; + + rpmlog(RPMLOG_DEBUG, + D_("[filetriggers] file name '%s' matches pattern '%s'\n"), + tmp, list[i].mire->pattern); + + mayStartFiletrigger(rootDir, &list[i]); + nw = write(list[i].command_pipe, tmp, tmplen); + nw = write(list[i].command_pipe, "\n", 1); + } + } + + xx = Fclose(fd); + fd = NULL; + fp = NULL; + + for (i = 0; i < nft; i++) { + int status; + if (list[i].command_pipe) { + pid_t pid; + xx = close(list[i].command_pipe); + rpmlog(RPMLOG_DEBUG, + D_("[filetriggers] waiting for %s to end\n"), + list[i].name); + pid = waitpid(list[i].command_pid, &status, 0); + list[i].command_pipe = 0; + } + } + + oldhandler = signal(SIGPIPE, oldhandler); + } + +exit: + freeFiletriggers(matches_any, nft, list); + + if (fn != NULL) + xx = unlink(fn); + fn = _free(fn); +} +#endif /* defined(RPM_VENDOR_MANDRIVA) */ diff --git a/rpm-5.4.9/lib/filetriggers.h b/rpm-5.4.9/lib/filetriggers.h new file mode 100644 index 0000000..dbfa2f6 --- /dev/null +++ b/rpm-5.4.9/lib/filetriggers.h @@ -0,0 +1,30 @@ +#ifndef H_FILETRIGGERS +#define H_FILETRIGGERS + +/** + * \file lib/filetriggers.h + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + */ +__attribute__ ((visibility("hidden"))) +int mayAddToFilesAwaitingFiletriggers(const char *rootDir, rpmfi fi, + int install_or_erase) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies fi, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** + */ +void rpmRunFileTriggers(const char *rootDir) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/; + +#ifdef __cplusplus +} +#endif + +#endif /* H_FILETRIGGERS */ diff --git a/rpm-5.4.9/lib/formats.c b/rpm-5.4.9/lib/formats.c new file mode 100644 index 0000000..da41177 --- /dev/null +++ b/rpm-5.4.9/lib/formats.c @@ -0,0 +1,305 @@ +/** \ingroup header + * \file lib/formats.c + */ + +#include "system.h" + +#include +#include /* XXX fnpyKey */ +#include /* XXX for %_i18ndomains */ + +#define _RPMTAG_INTERNAL +#include +#include + +#define _RPMEVR_INTERNAL +#include +#include + +#include "legacy.h" +#include "manifest.h" +#include "argv.h" +#include "fs.h" + +#include "debug.h" + +#ifdef __cplusplus +GENfree(rpmuint32_t *) +#endif /* __cplusplus */ + +/*@access headerSprintfExtension @*/ + +/** + * Retrieve mounted file system paths. + * @param h header + * @retval *he tag container + * @return 0 on success + */ +static int fsnamesTag( /*@unused@*/ Header h, HE_t he) + /*@globals fileSystem, internalState @*/ + /*@modifies he, fileSystem, internalState @*/ +{ + const char ** list; + + if (rpmGetFilesystemList(&list, &he->c)) + return 1; + + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = list; + he->freeData = 0; + + return 0; +} + +/** + * Retrieve mounted file system space. + * @param h header + * @retval *he tag container + * @return 0 on success + */ +static int fssizesTag(Header h, HE_t he) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies he, rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + rpmTagData fnames = { .ptr = NULL }; + rpmTagData fsizes = { .ptr = NULL }; + rpmTagData p; + rpmuint64_t *usages; + int numFiles; + int rc = 1; /* assume error */ + int xx, yy; + + p.ptr = he->p.ptr; + he->tag = RPMTAG_FILESIZES; + xx = headerGet(h, he, 0); + fsizes.ptr = he->p.ptr; + he->tag = RPMTAG_FILEPATHS; + yy = headerGet(h, he, 0); + fnames.ptr = he->p.ptr; + numFiles = he->c; + he->p.ptr = p.ptr; + if (!xx || !yy) { + numFiles = 0; + fsizes.ui32p = _free(fsizes.ui32p); + fnames.argv = _free(fnames.argv); + } + + if (rpmGetFilesystemList(NULL, &he->c)) + goto exit; + + he->t = RPM_UINT64_TYPE; + he->freeData = 1; + + if (fnames.ptr == NULL) + usages = (rpmuint64_t *) xcalloc(he->c, sizeof(*usages)); + else + if (rpmGetFilesystemUsage(fnames.argv, fsizes.ui32p, numFiles, &usages, 0)) + goto exit; + + he->p.ui64p = usages; + rc = 0; + +exit: + fnames.ptr = _free(fnames.ptr); + fsizes.ptr = _free(fsizes.ptr); + + return rc; +} + +/** + * Retrieve file classes. + * @param h header + * @retval *he tag container + * @return 0 on success + */ +static int fileclassTag(Header h, HE_t he) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies h, he, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + he->t = RPM_STRING_ARRAY_TYPE; + rpmfiBuildFClasses(h, &he->p.argv, &he->c); + he->freeData = 1; + return 0; +} + +#ifdef DYING +/** + * Retrieve file contexts from header. + * @param h header + * @retval *he tag container + * @return 0 on success + */ +static int filecontextsTag(Header h, HE_t he) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies h, he, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + he->t = RPM_STRING_ARRAY_TYPE; + rpmfiBuildFContexts(h, &he->p.argv, &he->c); + he->freeData = 1; + return 0; +} + +/** + * Retrieve file contexts from file system. + * @param h header + * @retval *he tag container + * @return 0 on success + */ +static int fscontextsTag(Header h, HE_t he) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies h, he, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + he->t = RPM_STRING_ARRAY_TYPE; + rpmfiBuildFSContexts(h, &he->p.argv, &he->c); + he->freeData = 1; + return 0; +} + +/** + * Retrieve file contexts from policy RE's. + * @param h header + * @retval *he tag container + * @return 0 on success + */ +static int recontextsTag(Header h, HE_t he) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies h, he, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + he->t = RPM_STRING_ARRAY_TYPE; + rpmfiBuildREContexts(h, &he->p.argv, &he->c); + he->freeData = 1; + return 0; +} +#endif + +/** + * Retrieve file provides. + * @param h header + * @retval *he tag container + * @return 0 on success + */ +static int fileprovideTag(Header h, HE_t he) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies h, he, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + he->t = RPM_STRING_ARRAY_TYPE; + rpmfiBuildFDeps(h, RPMTAG_PROVIDENAME, &he->p.argv, &he->c); + he->freeData = 1; + return 0; +} + +/** + * Retrieve file requires. + * @param h header + * @retval *he tag container + * @return 0 on success + */ +static int filerequireTag(Header h, HE_t he) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies h, he, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + he->t = RPM_STRING_ARRAY_TYPE; + rpmfiBuildFDeps(h, RPMTAG_REQUIRENAME, &he->p.argv, &he->c); + he->freeData = 1; + return 0; +} + +/** + * Retrieve Requires(missingok): array for Suggests: or Enhances:. + * @param h header + * @retval *he tag container + * @return 0 on success + */ +static int missingokTag(Header h, HE_t he) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies h, he, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + rpmds ds = rpmdsNew(h, RPMTAG_REQUIRENAME, 0); + ARGV_t av = NULL; + ARGV_t argv; + int argc = 0; + char * t; + size_t nb = 0; + int i; + + if (ds == NULL) + return 1; + + /* Collect dependencies marked as hints. */ + ds = rpmdsInit(ds); + if (ds != NULL) + while (rpmdsNext(ds) >= 0) { + int Flags = rpmdsFlags(ds); + const char * DNEVR; + if (!(Flags & RPMSENSE_MISSINGOK)) + continue; + DNEVR = rpmdsDNEVR(ds); + if (DNEVR == NULL) + continue; + nb += sizeof(*argv) + strlen(DNEVR+2) + 1; + (void) argvAdd(&av, DNEVR+2); + argc++; + } + nb += sizeof(*argv); /* final argv NULL */ + + /* Create contiguous header string array. */ + argv = (ARGV_t) xcalloc(nb, 1); + t = (char *)(argv + argc); + for (i = 0; i < argc; i++) { + argv[i] = t; + t = stpcpy(t, av[i]); + *t++ = '\0'; + } + av = argvFree(av); + (void)rpmdsFree(ds); + ds = NULL; + + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = argv; + he->c = argc; + he->freeData = 1; + return 0; +} + +/*@-type@*/ /* FIX: cast? */ +static struct headerSprintfExtension_s _rpmHeaderFormats[] = { + { HEADER_EXT_TAG, "RPMTAG_ENHANCES", + { .tagFunction = missingokTag } }, + { HEADER_EXT_TAG, "RPMTAG_FILECLASS", + { .tagFunction = fileclassTag } }, +#ifdef DYING + { HEADER_EXT_TAG, "RPMTAG_FILECONTEXTS", + { .tagFunction = filecontextsTag } }, +#endif + { HEADER_EXT_TAG, "RPMTAG_FILEPROVIDE", + { .tagFunction = fileprovideTag } }, + { HEADER_EXT_TAG, "RPMTAG_FILEREQUIRE", + { .tagFunction = filerequireTag } }, +#ifdef DYING + { HEADER_EXT_TAG, "RPMTAG_FSCONTEXTS", + { .tagFunction = fscontextsTag } }, +#endif + { HEADER_EXT_TAG, "RPMTAG_FSNAMES", + { .tagFunction = fsnamesTag } }, + { HEADER_EXT_TAG, "RPMTAG_FSSIZES", + { .tagFunction = fssizesTag } }, +#ifdef DYING + { HEADER_EXT_TAG, "RPMTAG_RECONTEXTS", + { .tagFunction = recontextsTag } }, +#endif + { HEADER_EXT_TAG, "RPMTAG_SUGGESTS", + { .tagFunction = missingokTag } }, + { HEADER_EXT_MORE, NULL, { (void *) &headerCompoundFormats } } +} ; +/*@=type@*/ + +headerSprintfExtension rpmHeaderFormats = &_rpmHeaderFormats[0]; diff --git a/rpm-5.4.9/lib/fs.c b/rpm-5.4.9/lib/fs.c new file mode 100644 index 0000000..b3937d8 --- /dev/null +++ b/rpm-5.4.9/lib/fs.c @@ -0,0 +1,411 @@ +/** + * \file lib/fs.c + */ + +#include "system.h" +#include +#include +#include +#include /* XXX for rpmGetPath */ + +#include "fs.h" + +#include "debug.h" + +/*@-usereleased -onlytrans@*/ + +struct fsinfo { +/*@only@*/ /*@relnull@*/ + const char * mntPoint; /*!< path to mount point. */ + dev_t dev; /*!< devno for mount point. */ + int rdonly; /*!< is mount point read only? */ +}; + +#ifdef __cplusplus +GENfree(rpmuint64_t *) +GENfree(struct fsinfo *) +#endif /* __cplusplus */ + +/*@unchecked@*/ +/*@only@*/ /*@null@*/ +static struct fsinfo * filesystems = NULL; +/*@unchecked@*/ +/*@only@*/ /*@null@*/ +static const char ** fsnames = NULL; +/*@unchecked@*/ +static int numFilesystems = 0; + +void rpmFreeFilesystems(void) + /*@globals filesystems, fsnames, numFilesystems @*/ + /*@modifies filesystems, fsnames, numFilesystems @*/ +{ + int i; + + if (filesystems) + for (i = 0; i < numFilesystems; i++) + filesystems[i].mntPoint = _free(filesystems[i].mntPoint); + + filesystems = _free(filesystems); + fsnames = _free(fsnames); + numFilesystems = 0; +} + +#if defined(HAVE_MNTCTL) + +/* modeled after sample code from Till Bubeck */ + +#include +#include + +/* + * There is NO mntctl prototype in any header file of AIX 3.2.5! + * So we have to declare it by ourself... + */ +int mntctl(int command, int size, char *buffer); + +/** + * Get information for mounted file systems. + * @todo determine rdonly for non-linux file systems. + * @return 0 on success, 1 on error + */ +static int getFilesystemList(void) + /*@*/ +{ + int size; + void * buf; + struct vmount * vm; + struct stat sb; + int rdonly = 0; + int num; + int fsnameLength; + int i; + + num = mntctl(MCTL_QUERY, sizeof(size), (char *) &size); + if (num < 0) { + rpmlog(RPMLOG_ERR, _("mntctl() failed to return size: %s\n"), + strerror(errno)); + return 1; + } + + /* + * Double the needed size, so that even when the user mounts a + * filesystem between the previous and the next call to mntctl + * the buffer still is large enough. + */ + size *= 2; + + buf = alloca(size); + num = mntctl(MCTL_QUERY, size, buf); + if ( num <= 0 ) { + rpmlog(RPMLOG_ERR, _("mntctl() failed to return mount points: %s\n"), + strerror(errno)); + return 1; + } + + numFilesystems = num; + + filesystems = (struct fsinfo *) xcalloc((numFilesystems + 1), sizeof(*filesystems)); + fsnames = (const char **) xcalloc((numFilesystems + 1), sizeof(char *)); + + for (vm = buf, i = 0; i < num; i++) { + char *fsn; + fsnameLength = vm->vmt_data[VMT_STUB].vmt_size; + fsn = (char *) xmalloc(fsnameLength + 1); + strncpy(fsn, (char *)vm + vm->vmt_data[VMT_STUB].vmt_off, + fsnameLength); + + filesystems[i].mntPoint = fsnames[i] = fsn; + +#if defined(RPM_VENDOR_OPENPKG) /* always-skip-proc-filesystem */ + if (!(strcmp(fsn, "/proc") == 0)) { +#endif + if (Stat(fsn, &sb) < 0) { + switch(errno) { + default: + rpmlog(RPMLOG_ERR, _("failed to stat %s: %s\n"), fsn, + strerror(errno)); + rpmFreeFilesystems(); + return 1; + case ENOENT: /* XXX avoid /proc if leaked into *BSD jails. */ + sb.st_dev = 0; /* XXXX make sure st_dev is initialized. */ + /*@switchbreak@*/ break; + } + } + + filesystems[i].dev = sb.st_dev; + filesystems[i].rdonly = rdonly; +#if defined(RPM_VENDOR_OPENPKG) /* always-skip-proc-filesystem */ + } +#endif + + /* goto the next vmount structure: */ + vm = (struct vmount *)((char *)vm + vm->vmt_length); + } + + filesystems[i].mntPoint = NULL; + fsnames[i] = NULL; + + return 0; +} + +#else /* HAVE_MNTCTL */ + +/** + * Get information for mounted file systems. + * @todo determine rdonly for non-linux file systems. + * @return 0 on success, 1 on error + */ +static int getFilesystemList(void) + /*@globals h_errno, filesystems, fsnames, numFilesystems, + fileSystem, internalState @*/ + /*@modifies filesystems, fsnames, numFilesystems, + fileSystem, internalState @*/ +{ + int numAlloced = 10; + struct stat sb; + int i; + const char * mntdir; + int rdonly = 0; + +# if GETMNTENT_ONE || GETMNTENT_TWO + our_mntent item; + FILE * mtab; + + mtab = fopen(MOUNTED, "r"); + if (!mtab) { + rpmlog(RPMLOG_ERR, _("failed to open %s: %s\n"), MOUNTED, + strerror(errno)); + return 1; + } +# elif defined(HAVE_GETMNTINFO_R) + /* This is OSF */ + struct statfs * mounts = NULL; + int mntCount = 0, bufSize = 0, flags = MNT_NOWAIT; + int nextMount = 0; + + getmntinfo_r(&mounts, flags, &mntCount, &bufSize); +# elif defined(HAVE_GETMNTINFO) + /* This is Mac OS X */ +#if defined(__NetBSD__) + struct statvfs * mounts = NULL; +#else + struct statfs * mounts = NULL; +#endif + int mntCount = 0, flags = MNT_NOWAIT; + int nextMount = 0; + + /* XXX 0 on error, errno set */ + mntCount = getmntinfo(&mounts, flags); +# endif + + filesystems = (struct fsinfo *) xcalloc((numAlloced + 1), sizeof(*filesystems)); /* XXX memory leak */ + + numFilesystems = 0; + while (1) { +# if GETMNTENT_ONE + /* this is Linux */ + /*@-modunconnomods -moduncon @*/ + our_mntent * itemptr = getmntent(mtab); + if (!itemptr) break; + item = *itemptr; /* structure assignment */ + mntdir = item.our_mntdir; +#if defined(MNTOPT_RO) + /*@-compdef@*/ + if (hasmntopt(itemptr, MNTOPT_RO) != NULL) + rdonly = 1; + /*@=compdef@*/ +#endif + /*@=modunconnomods =moduncon @*/ +# elif GETMNTENT_TWO + /* Solaris, maybe others */ + if (getmntent(mtab, &item)) break; + mntdir = item.our_mntdir; +# elif defined(HAVE_GETMNTINFO_R) + /* This is OSF */ + if (nextMount == mntCount) break; + mntdir = mounts[nextMount++].f_mntonname; +# elif defined(HAVE_GETMNTINFO) + /* This is Mac OS X */ + if (nextMount == mntCount) break; + mntdir = mounts[nextMount++].f_mntonname; +# endif + +#if defined(RPM_VENDOR_OPENPKG) /* always-skip-proc-filesystem */ + if (strcmp(mntdir, "/proc") == 0) + continue; +#endif + + if (Stat(mntdir, &sb) < 0) { + switch(errno) { + default: + rpmlog(RPMLOG_ERR, _("failed to stat %s: %s\n"), mntdir, + strerror(errno)); + rpmFreeFilesystems(); + return 1; + /*@notreached@*/ /*@switchbreak@*/ break; + case ENOENT: /* XXX avoid /proc if leaked into *BSD jails. */ + case EACCES: /* XXX fuse fs #220991 */ + case ESTALE: + continue; + /*@notreached@*/ /*@switchbreak@*/ break; + } + } + + if ((numFilesystems + 2) == numAlloced) { + numAlloced += 10; + filesystems = (struct fsinfo *) xrealloc(filesystems, + sizeof(*filesystems) * (numAlloced + 1)); + } + + filesystems[numFilesystems].dev = sb.st_dev; + filesystems[numFilesystems].mntPoint = xstrdup(mntdir); + filesystems[numFilesystems].rdonly = rdonly; +#if 0 + rpmlog(RPMLOG_DEBUG, "%5d 0x%04x %s %s\n", + numFilesystems, + (unsigned) filesystems[numFilesystems].dev, + (filesystems[numFilesystems].rdonly ? "ro" : "rw"), + filesystems[numFilesystems].mntPoint); +#endif + numFilesystems++; + } + +# if GETMNTENT_ONE || GETMNTENT_TWO + (void) fclose(mtab); +# elif defined(HAVE_GETMNTINFO_R) + mounts = _free(mounts); +# endif + + filesystems[numFilesystems].dev = 0; + filesystems[numFilesystems].mntPoint = NULL; + filesystems[numFilesystems].rdonly = 0; + + fsnames = (const char **) xcalloc((numFilesystems + 1), sizeof(*fsnames)); + for (i = 0; i < numFilesystems; i++) + fsnames[i] = filesystems[i].mntPoint; + fsnames[numFilesystems] = NULL; + +/*@-nullstate@*/ /* FIX: fsnames[] may be NULL */ + return 0; +/*@=nullstate@*/ +} +#endif /* HAVE_MNTCTL */ + +int rpmGetFilesystemList(const char *** listptr, rpmuint32_t * num) +{ + if (!fsnames) + if (getFilesystemList()) + return 1; + + if (listptr) *listptr = fsnames; + if (num) *num = numFilesystems; + + return 0; +} + +int rpmGetFilesystemUsage(const char ** fileList, rpmuint32_t * fssizes, + int numFiles, rpmuint64_t ** usagesPtr, + /*@unused@*/ int flags) +{ + rpmuint64_t * usages; + int i, j; + char * buf, * dirName; + char * chptr; + size_t maxLen; + size_t len; + char * lastDir; + const char * sourceDir; + int lastfs = 0; + dev_t lastDev = (dev_t)-1; /* I hope nobody uses -1 for a st_dev */ + struct stat sb; + int rc = 1; /* assume failure */ + + if (!fsnames) + if (getFilesystemList()) + return rc; + + usages = (rpmuint64_t *) xcalloc(numFilesystems, sizeof(*usages)); + + sourceDir = rpmGetPath("%{_sourcedir}", NULL); + + maxLen = strlen(sourceDir); + for (i = 0; i < numFiles; i++) { + len = strlen(fileList[i]); + if (maxLen < len) maxLen = len; + } + + buf = (char *) alloca(maxLen + 1); + lastDir = (char *) alloca(maxLen + 1); + dirName = (char *) alloca(maxLen + 1); + *lastDir = '\0'; + + /* cut off last filename */ + for (i = 0; i < numFiles; i++) { + if (*fileList[i] == '/') { + strcpy(buf, fileList[i]); + chptr = buf + strlen(buf) - 1; + while (*chptr != '/') chptr--; + if (chptr == buf) + buf[1] = '\0'; + else + *chptr-- = '\0'; + } else { + /* this should only happen for source packages (gulp) */ + strcpy(buf, sourceDir); + } + + if (strcmp(lastDir, buf)) { + strcpy(dirName, buf); + chptr = dirName + strlen(dirName) - 1; + while (Stat(dirName, &sb) < 0) { + switch(errno) { + default: + rpmlog(RPMLOG_ERR, _("failed to stat %s: %s\n"), buf, + strerror(errno)); + goto exit; + /*@notreached@*/ /*@switchbreak@*/ break; + case ENOENT: /* XXX paths in empty chroot's don't exist. */ + /*@switchbreak@*/ break; + } + + /* cut off last directory part, because it was not found. */ + while (*chptr != '/') chptr--; + + if (chptr == dirName) + dirName[1] = '\0'; + else + *chptr-- = '\0'; + } + + if (lastDev != sb.st_dev) { + for (j = 0; j < numFilesystems; j++) + if (filesystems && filesystems[j].dev == sb.st_dev) + /*@innerbreak@*/ break; + + if (j == numFilesystems) { + rpmlog(RPMLOG_ERR, + _("file %s is on an unknown device\n"), buf); + goto exit; + } + + lastfs = j; + lastDev = sb.st_dev; + } + } + + strcpy(lastDir, buf); + usages[lastfs] += fssizes[i]; + } + rc = 0; + +exit: + sourceDir = _free(sourceDir); + + if (rc == 0 && usagesPtr) + *usagesPtr = usages; + else + usages = _free(usages); + + return rc; +} +/*@=usereleased =onlytrans@*/ diff --git a/rpm-5.4.9/lib/fs.h b/rpm-5.4.9/lib/fs.h new file mode 100644 index 0000000..9c20f51 --- /dev/null +++ b/rpm-5.4.9/lib/fs.h @@ -0,0 +1,59 @@ +#ifndef H_FS +#define H_FS + +/** \ingroup rpmtrans + * \file lib/fs.h + * Access mounted file system information. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Release storage used by file system usage cache. + */ +void rpmFreeFilesystems(void) + /*@globals internalState@*/ + /*@modifies internalState@*/; + +/** + * Return (cached) file system mount points. + * @retval listptr addess of file system names (or NULL) + * @retval num address of number of file systems (or NULL) + * @return 0 on success, 1 on error + */ +/*@-incondefs@*/ +int rpmGetFilesystemList( /*@null@*/ /*@out@*/ const char *** listptr, + /*@null@*/ /*@out@*/ rpmuint32_t * num) + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies *listptr, *num, fileSystem, internalState @*/ + /*@requires maxSet(listptr) >= 0 /\ maxSet(num) >= 0 @*/; +/*@=incondefs@*/ + +/** + * Determine per-file system usage for a list of files. + * @param fileList array of absolute file names + * @param fssizes array of file sizes + * @param numFiles number of files in list + * @retval usagesPtr address of per-file system usage array (or NULL) + * @param flags (unused) + * @return 0 on success, 1 on error + */ +/*@-incondefs@*/ +int rpmGetFilesystemUsage(const char ** fileList, rpmuint32_t * fssizes, + int numFiles, /*@null@*/ /*@out@*/ rpmuint64_t ** usagesPtr, + int flags) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies *usagesPtr, rpmGlobalMacroContext, + fileSystem, internalState @*/ + /*@requires maxSet(fileList) >= 0 /\ maxSet(fssizes) == 0 + /\ maxSet(usagesPtr) >= 0 @*/; +/*@=incondefs@*/ + +#ifdef __cplusplus +} +#endif + +#endif /* H_FS */ diff --git a/rpm-5.4.9/lib/fsm.c b/rpm-5.4.9/lib/fsm.c new file mode 100644 index 0000000..6e6beef --- /dev/null +++ b/rpm-5.4.9/lib/fsm.c @@ -0,0 +1,2418 @@ +/** \ingroup payload + * \file lib/fsm.c + * File state machine to handle a payload from a package. + */ + +#include "system.h" + +#include /* XXX urlPath, fdGetCpioPos */ +#include /* XXX fnpyKey */ +#include "rpmsq.h" +#include +#if defined(SUPPORT_AR_PAYLOADS) +#include "ar.h" +#endif +#include "cpio.h" +#include "tar.h" +#include "ugid.h" /* XXX unameToUid() and gnameToGid() */ + +#include +#include +#define _RPMDB_INTERNAL +#include + +#define _RPMFI_INTERNAL +#include "rpmfi.h" + +#define _IOSM_INTERNAL +#include +#define fsmUNSAFE fsmStage + +#define _USE_RPMTE +#if defined(_USE_RPMTE) +#include "rpmte.h" +#endif +#include "rpmts.h" + +#include "debug.h" + +/*@access FD_t @*/ /* XXX void ptr args */ +/*@access FSMI_t @*/ +/*@access IOSM_t @*/ +/*@access IOSMI_t @*/ + +/*@access rpmfi @*/ + +/*@access rpmsx @*/ /* XXX cast */ +/*@access rpmte @*/ /* XXX cast */ +/*@access rpmts @*/ /* XXX cast */ + +#ifdef __cplusplus +GENfree(const void *) +GENfree(unsigned short *) +GENfree(DNLI_t) +GENfree(FSMI_t) +#endif /* __cplusplus */ + +#define alloca_strdup(_s) strcpy((char *)alloca(strlen(_s)+1), (_s)) + +#define _FSM_DEBUG 0 +/*@unchecked@*/ +int _fsm_debug = _FSM_DEBUG; + +/*@-exportheadervar@*/ +/*@unchecked@*/ +int _fsm_threads = 0; +/*@=exportheadervar@*/ + +/** + * Retrieve transaction set from file state machine iterator. + * @param fsm file state machine + * @return transaction set + */ +static rpmts fsmGetTs(const IOSM_t fsm) + /*@*/ +{ + const FSMI_t iter = fsm->iter; + /*@-compdef -refcounttrans -retexpose -usereleased @*/ + return (rpmts) (iter ? iter->ts : NULL); + /*@=compdef =refcounttrans =retexpose =usereleased @*/ +} + +/** + * Retrieve transaction element file info from file state machine iterator. + * @param fsm file state machine + * @return transaction element file info + */ +static rpmfi fsmGetFi(const IOSM_t fsm) + /*@*/ +{ + const FSMI_t iter = fsm->iter; + /*@-compdef -refcounttrans -retexpose -usereleased @*/ + return (rpmfi) (iter ? iter->fi : NULL); + /*@=compdef =refcounttrans =retexpose =usereleased @*/ +} + +#define SUFFIX_RPMORIG ".rpmorig" +#define SUFFIX_RPMSAVE ".rpmsave" +#define SUFFIX_RPMNEW ".rpmnew" + +/** \ingroup payload + * Build path to file from file info, ornamented with subdir and suffix. + * @param fsm file state machine data + * @param st file stat info + * @param subdir subdir to use (NULL disables) + * @param suffix suffix to use (NULL disables) + * @retval path to file + */ +static /*@only@*//*@null@*/ +const char * fsmFsPath(/*@special@*/ /*@null@*/ const IOSM_t fsm, + /*@null@*/ const struct stat * st, + /*@null@*/ const char * subdir, + /*@null@*/ const char * suffix) + /*@uses fsm->dirName, fsm->baseName */ + /*@*/ +{ + const char * s = NULL; + + if (fsm) { + char * t; + int nb; + nb = strlen(fsm->dirName) + + (st && !S_ISDIR(st->st_mode) ? (subdir ? strlen(subdir) : 0) : 0) + + (st && !S_ISDIR(st->st_mode) ? (suffix ? strlen(suffix) : 0) : 0) + + strlen(fsm->baseName) + 1; + s = t = (char *) xmalloc(nb); + t = stpcpy(t, fsm->dirName); + if (st && !S_ISDIR(st->st_mode)) + if (subdir) t = stpcpy(t, subdir); + t = stpcpy(t, fsm->baseName); + if (st && !S_ISDIR(st->st_mode)) + if (suffix) t = stpcpy(t, suffix); + } + return s; +} + +/** \ingroup payload + * Destroy file info iterator. + * @param _iter file info iterator + * @retval NULL always + */ +static /*@null@*/ void * mapFreeIterator(/*@only@*//*@null@*/ void * _iter) + /*@globals fileSystem @*/ + /*@modifies fileSystem @*/ +{ + FSMI_t iter = (FSMI_t) _iter; + if (iter) { + iter->fi = rpmfiUnlink(iter->fi, "mapIterator"); +/*@-internalglobs@*/ /* XXX rpmswExit() */ + (void)rpmtsFree(iter->ts); + iter->ts = NULL; +/*@=internalglobs@*/ + } + return _free(iter); +} + +/** \ingroup payload + * Create file info iterator. + * @param fi transaction element file info + * @param reverse iterate in reverse order? + * @return file info iterator + */ +static void * +mapInitIterator(rpmfi fi, int reverse) + /*@modifies fi @*/ +{ + FSMI_t iter = NULL; + + iter = (FSMI_t) xcalloc(1, sizeof(*iter)); +/*@-assignexpose -castexpose @*/ + iter->fi = rpmfiLink(fi, "mapIterator"); +/*@=assignexpose =castexpose @*/ + iter->reverse = reverse; + iter->i = (iter->reverse ? (fi->fc - 1) : 0); + iter->isave = iter->i; + return iter; +} + +/** \ingroup payload + * Return next index into file info. + * @param _iter file info iterator + * @return next index, -1 on termination + */ +static int mapNextIterator(/*@null@*/ void * _iter) + /*@*/ +{ + FSMI_t iter = (FSMI_t) _iter; + int i = -1; + + if (iter) { +/*@-onlytrans@*/ + const rpmfi fi = (rpmfi) iter->fi; +/*@=onlytrans@*/ + if (iter->reverse) { + if (iter->i >= 0) i = iter->i--; + } else { + if (iter->i < (int)fi->fc) i = iter->i++; + } + iter->isave = i; + } + return i; +} + +/** \ingroup payload + */ +static int cpioStrCmp(const void * a, const void * b) + /*@*/ +{ + const char * aurl = *(const char **)a; + const char * burl = *(const char **)b; + const char * afn = NULL; + const char * bfn = NULL; + + (void) urlPath(aurl, &afn); + (void) urlPath(burl, &bfn); + +#ifdef VERY_OLD_BUGGY_RPM_PACKAGES + /* XXX Some rpm-2.4 packages from 1997 have basename only in payloads. */ + if (strchr(afn, '/') == NULL) + bfn = strrchr(bfn, '/') + 1; +#endif + + /* Match rpm-4.0 payloads with ./ prefixes. */ + if (afn[0] == '.' && afn[1] == '/') afn += 2; + if (bfn[0] == '.' && bfn[1] == '/') bfn += 2; + + /* If either path is absolute, make it relative to '/'. */ + if (afn[0] == '/') afn += 1; + if (bfn[0] == '/') bfn += 1; + + return strcmp(afn, bfn); +} + +/** \ingroup payload + * Locate archive path in file info. + * @param iter file info iterator + * @param fsmPath archive path + * @return index into file info, -1 if archive path was not found + */ +static int mapFind(/*@null@*/ FSMI_t iter, const char * fsmPath) + /*@modifies iter @*/ +{ + int ix = -1; + + if (iter) { +/*@-onlytrans@*/ + const rpmfi fi = (rpmfi) iter->fi; +/*@=onlytrans@*/ + size_t fc = rpmfiFC(fi); + if (fi && fc > 0 && fi->apath && fsmPath && *fsmPath) { + const char ** p = NULL; + + if (fi->apath != NULL) + p = (const char **) + bsearch(&fsmPath, fi->apath, fc, sizeof(fsmPath), + cpioStrCmp); + if (p) { + iter->i = p - fi->apath; + ix = mapNextIterator(iter); + } + } + } + return ix; +} + +/** \ingroup payload + * Directory name iterator. + */ +typedef struct dnli_s { + rpmfi fi; +/*@only@*/ /*@null@*/ + char * active; + int reverse; + int isave; + int i; +} * DNLI_t; + +/** \ingroup payload + * Destroy directory name iterator. + * @param _dnli directory name iterator + * @retval NULL always + */ +static /*@null@*/ void * dnlFreeIterator(/*@only@*//*@null@*/const void * _dnli) + /*@modifies a @*/ +{ + if (_dnli) { + DNLI_t dnli = (DNLI_t) _dnli; + if (dnli->active) free(dnli->active); + } + return _free(_dnli); +} + +/** \ingroup payload + */ +static inline int dnlCount(/*@null@*/ const DNLI_t dnli) + /*@*/ +{ + return (int) (dnli ? dnli->fi->dc : 0); +} + +/** \ingroup payload + */ +static inline int dnlIndex(/*@null@*/ const DNLI_t dnli) + /*@*/ +{ + return (dnli ? dnli->isave : -1); +} + +/** \ingroup payload + * Create directory name iterator. + * @param fsm file state machine data + * @param reverse traverse directory names in reverse order? + * @return directory name iterator + */ +/*@-usereleased@*/ +static /*@only@*/ /*@null@*/ +void * dnlInitIterator(/*@special@*/ const IOSM_t fsm, + int reverse) + /*@uses fsm->iter @*/ + /*@*/ +{ + rpmfi fi = fsmGetFi(fsm); + const char * dnl; + DNLI_t dnli; + int i, j; + + if (fi == NULL) + return NULL; + dnli = (DNLI_t) xcalloc(1, sizeof(*dnli)); + dnli->fi = fi; + dnli->reverse = reverse; + dnli->i = (int) (reverse ? fi->dc : 0); + + if (fi->dc) { + dnli->active = (char *) xcalloc(fi->dc, sizeof(*dnli->active)); + + /* Identify parent directories not skipped. */ + if ((fi = rpmfiInit(fi, 0)) != NULL) + while ((i = rpmfiNext(fi)) >= 0) { + if (!iosmFileActionSkipped(fi->actions[i])) dnli->active[fi->dil[i]] = 1; + } + + /* Exclude parent directories that are explicitly included. */ + if ((fi = rpmfiInit(fi, 0)) != NULL) + while ((i = rpmfiNext(fi)) >= 0) { + rpmuint32_t dil; + size_t dnlen, bnlen; + + if (!S_ISDIR(fi->fmodes[i])) + continue; + + dil = fi->dil[i]; + dnlen = strlen(fi->dnl[dil]); + bnlen = strlen(fi->bnl[i]); + + for (j = 0; j < (int)fi->dc; j++) { + size_t jlen; + + if (!dnli->active[j] || j == (int)dil) + /*@innercontinue@*/ continue; + (void) urlPath(fi->dnl[j], &dnl); + jlen = strlen(dnl); + if (jlen != (dnlen+bnlen+1)) + /*@innercontinue@*/ continue; + if (strncmp(dnl, fi->dnl[dil], dnlen)) + /*@innercontinue@*/ continue; + if (strncmp(dnl+dnlen, fi->bnl[i], bnlen)) + /*@innercontinue@*/ continue; + if (dnl[dnlen+bnlen] != '/' || dnl[dnlen+bnlen+1] != '\0') + /*@innercontinue@*/ continue; + /* This directory is included in the package. */ + dnli->active[j] = 0; + /*@innerbreak@*/ break; + } + } + + /* Print only once per package. */ + if (!reverse) { + j = 0; + for (i = 0; i < (int)fi->dc; i++) { + if (!dnli->active[i]) continue; + if (j == 0) { + j = 1; + rpmlog(RPMLOG_DEBUG, + D_("========== Directories not explicitly included in package:\n")); + } + (void) urlPath(fi->dnl[i], &dnl); + rpmlog(RPMLOG_DEBUG, "%10d %s\n", i, dnl); + } + if (j) + rpmlog(RPMLOG_DEBUG, "==========\n"); + } + } + return dnli; +} +/*@=usereleased@*/ + +/** \ingroup payload + * Return next directory name (from file info). + * @param dnli directory name iterator + * @return next directory name + */ +static /*@observer@*/ /*@null@*/ +const char * dnlNextIterator(/*@null@*/ DNLI_t dnli) + /*@modifies dnli @*/ +{ + const char * dn = NULL; + + if (dnli) { + rpmfi fi = dnli->fi; + int i = -1; + + if (dnli->active) + do { + i = (!dnli->reverse ? dnli->i++ : --dnli->i); + } while (i >= 0 && i < (int)fi->dc && !dnli->active[i]); + + if (i >= 0 && i < (int)fi->dc) + dn = fi->dnl[i]; + else + i = -1; + dnli->isave = i; + } + return dn; +} + +#if defined(WITH_PTHREADS) +static void * fsmThread(void * _fsm) + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies arg, fileSystem, internalState @*/ +{ + IOSM_t fsm = (IOSM_t) _fsm; +/*@-unqualifiedtrans@*/ + return ((void *) ((long)fsmStage(fsm, fsm->nstage))); +/*@=unqualifiedtrans@*/ +} +#endif + +int fsmNext(IOSM_t fsm, iosmFileStage nstage) + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies fsm, fileSystem, internalState @*/ +{ + fsm->nstage = nstage; +#if defined(WITH_PTHREADS) + if (fsm->multithreaded) + return rpmsqJoin( rpmsqThread(fsmThread, fsm) ); +#endif + return fsmStage(fsm, fsm->nstage); +} + +/** \ingroup payload + * Save hard link in chain. + * @param fsm file state machine data + * @return Is chain only partially filled? + */ +static int saveHardLink(/*@special@*/ /*@partial@*/ IOSM_t fsm) + /*@uses fsm->links, fsm->ix, fsm->sb, fsm->goal, fsm->nsuffix @*/ + /*@defines fsm->li @*/ + /*@releases fsm->path @*/ + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies fsm, fileSystem, internalState @*/ +{ + struct stat * st = &fsm->sb; + int rc = 0; + int ix = -1; + int j; + + /* Find hard link set. */ + for (fsm->li = fsm->links; fsm->li; fsm->li = fsm->li->next) { + if (fsm->li->sb.st_ino == st->st_ino && fsm->li->sb.st_dev == st->st_dev) + break; + } + + /* New hard link encountered, add new link to set. */ + if (fsm->li == NULL) { + fsm->li = (struct hardLink_s *) xcalloc(1, sizeof(*fsm->li)); + fsm->li->next = NULL; + fsm->li->sb = *st; /* structure assignment */ + fsm->li->nlink = (int) st->st_nlink; + fsm->li->linkIndex = fsm->ix; + fsm->li->createdPath = -1; + + fsm->li->filex = (int *) xcalloc(st->st_nlink, sizeof(fsm->li->filex[0])); + memset(fsm->li->filex, -1, (st->st_nlink * sizeof(fsm->li->filex[0]))); + fsm->li->nsuffix = (const char **) xcalloc(st->st_nlink, sizeof(*fsm->li->nsuffix)); + + if (fsm->goal == IOSM_PKGBUILD) + fsm->li->linksLeft = (int) st->st_nlink; + if (fsm->goal == IOSM_PKGINSTALL) + fsm->li->linksLeft = 0; + + /*@-kepttrans@*/ + fsm->li->next = fsm->links; + /*@=kepttrans@*/ + fsm->links = fsm->li; + } + + if (fsm->goal == IOSM_PKGBUILD) --fsm->li->linksLeft; + fsm->li->filex[fsm->li->linksLeft] = fsm->ix; + /*@-observertrans -dependenttrans@*/ + fsm->li->nsuffix[fsm->li->linksLeft] = fsm->nsuffix; + /*@=observertrans =dependenttrans@*/ + if (fsm->goal == IOSM_PKGINSTALL) fsm->li->linksLeft++; + + if (fsm->goal == IOSM_PKGBUILD) + return (fsm->li->linksLeft > 0); + + if (fsm->goal != IOSM_PKGINSTALL) + return 0; + + if (!(st->st_size || fsm->li->linksLeft == (int) st->st_nlink)) + return 1; + + /* Here come the bits, time to choose a non-skipped file name. */ + { rpmfi fi = fsmGetFi(fsm); + + for (j = fsm->li->linksLeft - 1; j >= 0; j--) { + ix = fsm->li->filex[j]; + if (ix < 0 || iosmFileActionSkipped(fi->actions[ix])) + continue; + break; + } + } + + /* Are all links skipped or not encountered yet? */ + if (ix < 0 || j < 0) + return 1; /* XXX W2DO? */ + + /* Save the non-skipped file name and map index. */ + fsm->li->linkIndex = j; + fsm->path = _free(fsm->path); + fsm->ix = ix; + rc = fsmNext(fsm, IOSM_MAP); + return rc; +} + +/** \ingroup payload + * Destroy set of hard links. + * @param li set of hard links + * @return NULL always + */ +static /*@null@*/ void * freeHardLink(/*@only@*/ /*@null@*/ struct hardLink_s * li) + /*@modifies li @*/ +{ + if (li) { + li->nsuffix = _free(li->nsuffix); /* XXX elements are shared */ + li->filex = _free(li->filex); + } + return _free(li); +} + +IOSM_t newFSM(void) +{ + IOSM_t fsm = (IOSM_t) xcalloc(1, sizeof(*fsm)); + return fsm; +} + +IOSM_t freeFSM(IOSM_t fsm) +{ + if (fsm) { + fsm->path = _free(fsm->path); + while ((fsm->li = fsm->links) != NULL) { + fsm->links = fsm->li->next; + fsm->li->next = NULL; + fsm->li = freeHardLink((struct hardLink_s *)fsm->li); + } + fsm->dnlx = _free(fsm->dnlx); + fsm->ldn = _free(fsm->ldn); + fsm->iter = mapFreeIterator(fsm->iter); + } + return _free(fsm); +} + +#if defined(SUPPORT_AR_PAYLOADS) +static int arSetup(IOSM_t fsm, rpmfi fi) + /*@modifies fsm @*/ +{ + const char * path; + char * t; + size_t lmtablen = 0; + size_t nb; + + /* Calculate size of ar(1) long member table. */ + if ((fi = rpmfiInit(fi, 0)) != NULL) + while (rpmfiNext(fi) >= 0) { +#ifdef NOTYET + if (fi->apath) { + const char * apath = NULL; + (void) urlPath(fi->apath[ix], &apath); + path = apath + fi->striplen; + } else +#endif + path = rpmfiBN(fi); + if ((nb = strlen(path)) < 15) + continue; + lmtablen += nb + 1; /* trailing \n */ + } + + /* Anything to do? */ + if (lmtablen == 0) + return 0; + + /* Create and load ar(1) long member table. */ + fsm->lmtab = t = (char *) xmalloc(lmtablen + 1); /* trailing \0 */ + fsm->lmtablen = lmtablen; + fsm->lmtaboff = 0; + if ((fi = rpmfiInit(fi, 0)) != NULL) + while (rpmfiNext(fi) >= 0) { +#ifdef NOTYET + if (fi->apath) { + const char * apath = NULL; + (void) urlPath(fi->apath[ix], &apath); + path = apath + fi->striplen; + } else +#endif + path = rpmfiBN(fi); + if ((nb = strlen(path)) < 15) + continue; + t = stpcpy(t, path); + *t++ = '\n'; + } + *t = '\0'; + + return 0; +} +#endif + +int fsmSetup(void * _fsm, iosmFileStage goal, const char * afmt, + const void * _ts, const void * _fi, FD_t cfd, + unsigned int * archiveSize, const char ** failedFile) +{ + IOSM_t fsm = (IOSM_t) _fsm; +/*@-castexpose@*/ + const rpmts ts = (const rpmts) _ts; + const rpmfi fi = (const rpmfi) _fi; +/*@=castexpose@*/ +#if defined(_USE_RPMTE) + int reverse = (rpmteType(fi->te) == TR_REMOVED && fi->action != FA_COPYOUT); + int adding = (rpmteType(fi->te) == TR_ADDED); +#else + int reverse = 0; /* XXX HACK: devise alternative means */ + int adding = 1; /* XXX HACK: devise alternative means */ +#endif + size_t pos = 0; + int rc, ec = 0; + + fsm->debug = _fsm_debug; + fsm->multithreaded = _fsm_threads; + fsm->adding = adding; + +/*@+voidabstract -nullpass@*/ +if (fsm->debug < 0) +fprintf(stderr, "--> fsmSetup(%p, 0x%x, \"%s\", %p, %p, %p, %p, %p)\n", fsm, goal, afmt, (void *)ts, fi, cfd, archiveSize, failedFile); +/*@=voidabstract =nullpass@*/ + + _iosmNext = &fsmNext; + if (fsm->headerRead == NULL) { + if (afmt != NULL && (!strcmp(afmt, "tar") || !strcmp(afmt, "ustar"))) { +if (fsm->debug < 0) +fprintf(stderr, "\ttar vectors set\n"); + fsm->headerRead = &tarHeaderRead; + fsm->headerWrite = &tarHeaderWrite; + fsm->trailerWrite = &tarTrailerWrite; + fsm->blksize = TAR_BLOCK_SIZE; + } else +#if defined(SUPPORT_AR_PAYLOADS) + if (afmt != NULL && !strcmp(afmt, "ar")) { +if (fsm->debug < 0) +fprintf(stderr, "\tar vectors set\n"); + fsm->headerRead = &arHeaderRead; + fsm->headerWrite = &arHeaderWrite; + fsm->trailerWrite = &arTrailerWrite; + fsm->blksize = 2; + if (goal == IOSM_PKGBUILD || goal == IOSM_PKGERASE) + (void) arSetup(fsm, fi); + } else +#endif + { +if (fsm->debug < 0) +fprintf(stderr, "\tcpio vectors set\n"); + fsm->headerRead = &cpioHeaderRead; + fsm->headerWrite = &cpioHeaderWrite; + fsm->trailerWrite = &cpioTrailerWrite; + fsm->blksize = 4; + } + } + + fsm->goal = goal; + if (cfd != NULL) { +/*@-assignexpose -castexpose @*/ + fsm->cfd = fdLink(cfd, "persist (fsm)"); +/*@=assignexpose =castexpose @*/ + pos = fdGetCpioPos(fsm->cfd); + fdSetCpioPos(fsm->cfd, 0); + } +/*@-mods@*/ /* LCL: avoid void * _ts/_fi annotations for now. */ + fsm->iter = mapInitIterator(fi, reverse); +/*@-assignexpose -castexpose @*/ + fsm->iter->ts = rpmtsLink(ts, "mapIterator"); +/*@=assignexpose =castexpose @*/ + fsm->nofcontexts = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOCONTEXTS); +/*@=mods@*/ + fsm->nofdigests = + (ts != NULL && !(rpmtsFlags(ts) & RPMTRANS_FLAG_NOFDIGESTS)) + ? 0 : 1; +#define _tsmask (RPMTRANS_FLAG_PKGCOMMIT | RPMTRANS_FLAG_COMMIT) + fsm->commit = ((ts && (rpmtsFlags(ts) & _tsmask) && + fsm->goal != IOSM_PKGCOMMIT) ? 0 : 1); +#undef _tsmask + + if (fsm->goal == IOSM_PKGINSTALL || fsm->goal == IOSM_PKGBUILD) { + void * ptr; + fi->archivePos = 0; + ptr = rpmtsNotify(ts, fi->te, + RPMCALLBACK_INST_START, fi->archivePos, fi->archiveSize); + } + + /*@-assignexpose@*/ + fsm->archiveSize = archiveSize; + if (fsm->archiveSize) + *fsm->archiveSize = 0; + fsm->failedFile = failedFile; + if (fsm->failedFile) + *fsm->failedFile = NULL; + /*@=assignexpose@*/ + + memset(fsm->sufbuf, 0, sizeof(fsm->sufbuf)); + if (fsm->goal == IOSM_PKGINSTALL) { + if (ts && rpmtsGetTid(ts) != (rpmuint32_t)-1) + sprintf(fsm->sufbuf, ";%08x", (unsigned)rpmtsGetTid(ts)); + } + + ec = fsm->rc = 0; +/*@-mods@*/ /* LCL: avoid void * _fsm annotation for now. */ + rc = fsmUNSAFE(fsm, IOSM_CREATE); +/*@=mods@*/ + if (rc && !ec) ec = rc; + +/*@-mods@*/ /* LCL: avoid void * _fsm annotation for now. */ + rc = fsmUNSAFE(fsm, fsm->goal); +/*@=mods@*/ + if (rc && !ec) ec = rc; + + if (fsm->archiveSize && ec == 0) + *fsm->archiveSize = (fdGetCpioPos(fsm->cfd) - pos); + +/*@-nullstate@*/ /* FIX: *fsm->failedFile may be NULL */ + return ec; +/*@=nullstate@*/ +} + +int fsmTeardown(void * _fsm) +{ + IOSM_t fsm = (IOSM_t) _fsm; + int rc = fsm->rc; + +if (fsm->debug < 0) +fprintf(stderr, "--> fsmTeardown(%p)\n", fsm); + if (!rc) + rc = fsmUNSAFE(fsm, IOSM_DESTROY); + + (void) rpmswAdd(rpmtsOp(fsmGetTs(fsm), RPMTS_OP_DIGEST), + &fsm->op_digest); + + fsm->lmtab = _free(fsm->lmtab); + (void)rpmtsFree(fsm->iter->ts); + fsm->iter->ts = NULL; + fsm->iter = mapFreeIterator(fsm->iter); + if (fsm->cfd != NULL) { +/*@-refcounttrans@*/ /* FIX: XfdFree annotation */ + fsm->cfd = fdFree(fsm->cfd, "persist (fsm)"); +/*@=refcounttrans@*/ + fsm->cfd = NULL; + } + fsm->failedFile = NULL; + return rc; +} + +/* + * Set file security context (if not disabled). + * @param fsm file state machine data + * @return 0 always + */ +static int fsmMapFContext(IOSM_t fsm) + /*@modifies fsm @*/ +{ + fsm->fcontext = NULL; + if (!fsm->nofcontexts) { + fsm->fcontext = rpmsxMatch(NULL, fsm->path, fsm->sb.st_mode); +#ifdef DYING /* XXX SELinux file contexts not set from package content. */ + { rpmfi fi = fsmGetFi(fsm); + int i = fsm->ix; + + /* Get file security context from package. */ + if (fi && i >= 0 && i < (int)fi->fc) + fsm->fcontext = (fi->fcontexts ? fi->fcontexts[i] : NULL); + } +#endif + } + return 0; +} + +int fsmMapPath(IOSM_t fsm) +{ + rpmfi fi = fsmGetFi(fsm); /* XXX const except for fstates */ + int teAdding = fsm->adding; + int rc = 0; + int i = fsm->ix; + + fsm->osuffix = NULL; + fsm->nsuffix = NULL; + fsm->astriplen = 0; + fsm->action = FA_UNKNOWN; + fsm->mapFlags = fi->mapflags; + + if (fi && i >= 0 && i < (int)fi->fc) { + + fsm->astriplen = fi->astriplen; + fsm->action = (fi->actions ? fi->actions[i] : fi->action); + fsm->fflags = (fi->fflags ? fi->fflags[i] : fi->flags); + fsm->mapFlags = (fi->fmapflags ? fi->fmapflags[i] : fi->mapflags); + + /* src rpms have simple base name in payload. */ + fsm->dirName = fi->dnl[fi->dil[i]]; + fsm->baseName = fi->bnl[i]; + + switch (fsm->action) { + case FA_SKIP: + break; + case FA_UNKNOWN: + break; + + case FA_COPYOUT: + break; + case FA_COPYIN: + case FA_CREATE: +assert(teAdding); + break; + + case FA_SKIPNSTATE: + if (fi->fstates && teAdding) + fi->fstates[i] = RPMFILE_STATE_NOTINSTALLED; + break; + + case FA_SKIPNETSHARED: + if (fi->fstates && teAdding) + fi->fstates[i] = RPMFILE_STATE_NETSHARED; + break; + + case FA_SKIPCOLOR: + if (fi->fstates && teAdding) + fi->fstates[i] = RPMFILE_STATE_WRONGCOLOR; + break; + + case FA_BACKUP: + if (!(fsm->fflags & RPMFILE_GHOST)) /* XXX Don't if %ghost file. */ + fsm->osuffix = (teAdding ? SUFFIX_RPMORIG : SUFFIX_RPMSAVE); + break; + + case FA_ALTNAME: +assert(teAdding); + if (!(fsm->fflags & RPMFILE_GHOST)) /* XXX Don't if %ghost file. */ + fsm->nsuffix = SUFFIX_RPMNEW; + break; + + case FA_SAVE: +assert(teAdding); + if (!(fsm->fflags & RPMFILE_GHOST)) /* XXX Don't if %ghost file. */ + fsm->osuffix = SUFFIX_RPMSAVE; + break; + case FA_ERASE: +#if 0 /* XXX is this a genhdlist fix? */ + assert(rpmteType(fi->te) == TR_REMOVED); +#endif + /* + * XXX TODO: %ghost probably shouldn't be removed, but that changes + * legacy rpm behavior. + */ + break; + default: + break; + } + + if ((fsm->mapFlags & IOSM_MAP_PATH) || fsm->nsuffix) { + const struct stat * st = &fsm->sb; + fsm->path = _free(fsm->path); + fsm->path = fsmFsPath(fsm, st, fsm->subdir, + (fsm->suffix ? fsm->suffix : fsm->nsuffix)); + } + } + return rc; +} + +int fsmMapAttrs(IOSM_t fsm) +{ + struct stat * st = &fsm->sb; + rpmfi fi = fsmGetFi(fsm); + int i = fsm->ix; + + if (fi && i >= 0 && i < (int) fi->fc) { + mode_t perms = (S_ISDIR(st->st_mode) ? fi->dperms : fi->fperms); + mode_t finalMode = (fi->fmodes ? (mode_t)fi->fmodes[i] : perms); + dev_t finalRdev = (dev_t)(fi->frdevs ? fi->frdevs[i] : 0); + rpmuint32_t finalMtime = (fi->fmtimes ? fi->fmtimes[i] : 0); + uid_t uid = fi->uid; + gid_t gid = fi->gid; + + /* Make sure OpenPKG/Mandriva RPM does not try to set file owner/group on files during + installation of _source_ RPMs. Instead, let it use the current + run-time owner/group, because most of the time the owner/group in + the source RPM (which is the owner/group of the files as staying on + the package author system) is not existing on the target system, of + course. */ + if (fi->fuser && unameToUid(fi->fuser[i], &uid)) { + if (!fi->isSource) { + if (fsm->goal == IOSM_PKGINSTALL) + rpmlog(RPMLOG_WARNING, + _("user %s does not exist - using root\n"), fi->fuser[i]); + uid = 0; + finalMode &= ~S_ISUID; /* turn off suid bit */ + } + } + + if (fi->fgroup && gnameToGid(fi->fgroup[i], &gid)) { + if (!fi->isSource) { + if (fsm->goal == IOSM_PKGINSTALL) + rpmlog(RPMLOG_WARNING, + _("group %s does not exist - using root\n"), fi->fgroup[i]); + gid = 0; + finalMode &= ~S_ISGID; /* turn off sgid bit */ + } + } + + if (fsm->mapFlags & IOSM_MAP_MODE) + st->st_mode = (st->st_mode & S_IFMT) | (finalMode & ~S_IFMT); + if (fsm->mapFlags & IOSM_MAP_TYPE) { + st->st_mode = (st->st_mode & ~S_IFMT) | (finalMode & S_IFMT); + if ((S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)) + && st->st_nlink == 0) + st->st_nlink = 1; + st->st_rdev = finalRdev; + st->st_mtime = finalMtime; + } + if (fsm->mapFlags & IOSM_MAP_UID) + st->st_uid = uid; + if (fsm->mapFlags & IOSM_MAP_GID) + st->st_gid = gid; + + /* + * Set file digest (if not disabled). + */ + if (!fsm->nofdigests) { + fsm->fdigestalgo = fi->digestalgo; + fsm->fdigest = (fi->fdigests ? fi->fdigests[i] : NULL); + fsm->digestlen = fi->digestlen; + fsm->digest = (fi->digests ? (fi->digests + (fsm->digestlen * i)) : NULL); + } else { + fsm->fdigestalgo = 0; + fsm->fdigest = NULL; + fsm->digestlen = 0; + fsm->digest = NULL; + } + } + return 0; +} + +/** \ingroup payload + * Create file from payload stream. + * @param fsm file state machine data + * @return 0 on success + */ +/*@-compdef@*/ +static int extractRegular(/*@special@*/ IOSM_t fsm) + /*@uses fsm->fdigest, fsm->digest, fsm->sb, fsm->wfd @*/ + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies fsm, fileSystem, internalState @*/ +{ + const struct stat * st = &fsm->sb; + size_t left = (size_t) st->st_size; + int rc = 0; + int xx; + + { const char * fn = fsm->path; + mode_t mode = st->st_mode; + uint8_t * b = (uint8_t *)""; + size_t blen = 1; + const uint8_t * d = fsm->digest; + size_t dlen = fsm->digestlen; + uint32_t dalgo = fsm->fdigestalgo; + + xx = rpmlioCreat(rpmtsGetRdb(fsmGetTs(fsm)), fn, mode, b, blen, d, dlen, dalgo); + } + + rc = fsmNext(fsm, IOSM_WOPEN); + if (rc) + goto exit; + + if (st->st_size > 0 && (fsm->fdigest != NULL || fsm->digest != NULL)) + fdInitDigest(fsm->wfd, fsm->fdigestalgo, 0); + + while (left) { + + fsm->wrlen = (left > fsm->wrsize ? fsm->wrsize : left); + rc = fsmNext(fsm, IOSM_DREAD); + if (rc) + goto exit; + + rc = fsmNext(fsm, IOSM_WRITE); + if (rc) + goto exit; + + left -= fsm->wrnb; + + /* Notify iff progress, completion is done elsewhere */ + if (!rc && left) + (void) fsmNext(fsm, IOSM_NOTIFY); + } + +#ifdef DYING +/* Measurements from installing kernel-source package: + * +fsync + * total: 1 0.000000 MB 640.854524 secs + * +fdatasync + * total: 1 0.000000 MB 419.983200 secs + * w/o fsync/fdsatasync: + * total: 1 0.000000 MB 12.492918 secs + */ + xx = fsync(Fileno(fsm->wfd)); +#endif + + if (st->st_size > 0 && (fsm->fdigest || fsm->digest)) { + void * digest = NULL; + int asAscii = (fsm->digest == NULL ? 1 : 0); + + (void) Fflush(fsm->wfd); + fdFiniDigest(fsm->wfd, fsm->fdigestalgo, &digest, NULL, asAscii); + + if (digest == NULL) { + rc = IOSMERR_DIGEST_MISMATCH; + goto exit; + } + + if (fsm->digest != NULL) { + if (memcmp(digest, fsm->digest, fsm->digestlen)) + rc = IOSMERR_DIGEST_MISMATCH; + } else { + if (strcmp(digest, fsm->fdigest)) + rc = IOSMERR_DIGEST_MISMATCH; + } + digest = _free(digest); + } + +exit: + (void) fsmNext(fsm, IOSM_WCLOSE); + + return rc; +} +/*@=compdef@*/ + +/** \ingroup payload + * Write next item to payload stream. + * @param fsm file state machine data + * @param writeData should data be written? + * @return 0 on success + */ +/*@-compdef -compmempass@*/ +static int writeFile(/*@special@*/ /*@partial@*/ IOSM_t fsm, int writeData) + /*@uses fsm->path, fsm->opath, fsm->sb, fsm->osb, fsm->cfd @*/ + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies fsm, fileSystem, internalState @*/ +{ + const char * path = fsm->path; + const char * opath = fsm->opath; + struct stat * st = &fsm->sb; + struct stat * ost = &fsm->osb; + size_t left; + int xx; + int rc; + + st->st_size = (writeData ? ost->st_size : 0); + + if (S_ISDIR(st->st_mode)) { + st->st_size = 0; + } else if (S_ISLNK(st->st_mode)) { + /* + * While linux puts the size of a symlink in the st_size field, + * I don't think that's a specified standard. + */ + /* XXX NUL terminated result in fsm->rdbuf, len in fsm->rdnb. */ + rc = fsmUNSAFE(fsm, IOSM_READLINK); + if (rc) goto exit; + st->st_size = fsm->rdnb; + fsm->lpath = xstrdup(fsm->rdbuf); /* XXX save readlink return. */ + } + + if (fsm->mapFlags & IOSM_MAP_ABSOLUTE) { + size_t nb= strlen(fsm->dirName) + strlen(fsm->baseName) + sizeof("."); + char * t = (char *) alloca(nb); + *t = '\0'; + fsm->path = t; + if (fsm->mapFlags & IOSM_MAP_ADDDOT) + *t++ = '.'; + t = stpcpy( stpcpy(t, fsm->dirName), fsm->baseName); + } else if (fsm->mapFlags & IOSM_MAP_PATH) { + rpmfi fi = fsmGetFi(fsm); + if (fi->apath) { + const char * apath = NULL; + (void) urlPath(fi->apath[fsm->ix], &apath); + fsm->path = apath + fi->striplen; + } else + fsm->path = fi->bnl[fsm->ix]; + } + + rc = fsmNext(fsm, IOSM_HWRITE); + fsm->path = path; + if (rc) goto exit; + + if (writeData && S_ISREG(st->st_mode)) { +#if defined(HAVE_MMAP) + char * rdbuf = NULL; + void * mapped = (void *)-1; + size_t nmapped = 0; + /* XXX 128 Mb resource cap for top(1) scrutiny, MADV_DONTNEED better. */ + int use_mmap = (st->st_size <= 0x07ffffff); +#endif + + rc = fsmNext(fsm, IOSM_ROPEN); + if (rc) goto exit; + + /* XXX unbuffered mmap generates *lots* of fdio debugging */ +#if defined(HAVE_MMAP) + if (use_mmap) { + mapped = mmap(NULL, st->st_size, PROT_READ, MAP_SHARED, Fileno(fsm->rfd), 0); + if (mapped != (void *)-1) { + rdbuf = fsm->rdbuf; + fsm->rdbuf = (char *) mapped; + fsm->rdlen = nmapped = st->st_size; +#if defined(HAVE_MADVISE) && defined(MADV_DONTNEED) + xx = madvise(mapped, nmapped, MADV_DONTNEED); +#endif + } + } +#endif + + left = st->st_size; + + while (left) { +#if defined(HAVE_MMAP) + if (mapped != (void *)-1) { + fsm->rdnb = nmapped; + } else +#endif + { + fsm->rdlen = (left > fsm->rdsize ? fsm->rdsize : left), + rc = fsmNext(fsm, IOSM_READ); + if (rc) goto exit; + } + + /* XXX DWRITE uses rdnb for I/O length. */ + rc = fsmNext(fsm, IOSM_DWRITE); + if (rc) goto exit; + + left -= fsm->wrnb; + } + +#if defined(HAVE_MMAP) + if (mapped != (void *)-1) { +/* XXX splint misses size_t 2nd arg. */ +/*@i@*/ xx = msync(mapped, nmapped, MS_ASYNC); +#if defined(HAVE_MADVISE) && defined(MADV_DONTNEED) + xx = madvise(mapped, nmapped, MADV_DONTNEED); +#endif + xx = munmap(mapped, nmapped); + fsm->rdbuf = rdbuf; + } else +#endif + xx = fsync(Fileno(fsm->rfd)); + + } + + rc = fsmNext(fsm, IOSM_PAD); + if (rc) goto exit; + + rc = 0; + +exit: + if (fsm->rfd != NULL) + (void) fsmNext(fsm, IOSM_RCLOSE); +/*@-dependenttrans@*/ + fsm->opath = opath; + fsm->path = path; +/*@=dependenttrans@*/ + return rc; +} +/*@=compdef =compmempass@*/ + +/** \ingroup payload + * Write set of linked files to payload stream. + * @param fsm file state machine data + * @return 0 on success + */ +static int writeLinkedFile(/*@special@*/ /*@partial@*/ IOSM_t fsm) + /*@uses fsm->path, fsm->nsuffix, fsm->ix, fsm->li, fsm->failedFile @*/ + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies fsm, fileSystem, internalState @*/ +{ + const char * path = fsm->path; + const char * lpath = fsm->lpath; + const char * nsuffix = fsm->nsuffix; + int iterIndex = fsm->ix; + int ec = 0; + int rc; + int i; + const char * linkpath = NULL; + int firstfile = 1; + + fsm->path = NULL; + fsm->lpath = NULL; + fsm->nsuffix = NULL; + fsm->ix = -1; + + for (i = fsm->li->nlink - 1; i >= 0; i--) { + + if (fsm->li->filex[i] < 0) continue; + + fsm->ix = fsm->li->filex[i]; +/*@-compdef@*/ + rc = fsmNext(fsm, IOSM_MAP); +/*@=compdef@*/ + + /* XXX tar and cpio have to do things differently. */ + if (fsm->headerWrite == tarHeaderWrite) { + if (firstfile) { + const char * apath = NULL; + char *t; + (void) urlPath(fsm->path, &apath); + /* Remove the buildroot prefix. */ + t = (char *) xmalloc(sizeof(".") + strlen(apath + fsm->astriplen)); + (void) stpcpy( stpcpy(t, "."), apath + fsm->astriplen); + linkpath = t; + firstfile = 0; + } else + fsm->lpath = linkpath; + + /* Write data after first link for tar. */ + rc = writeFile(fsm, (fsm->lpath == NULL)); + } else { + /* Write data after last link for cpio. */ + rc = writeFile(fsm, (i == 0)); + } + if (fsm->failedFile && rc != 0 && *fsm->failedFile == NULL) { + ec = rc; + *fsm->failedFile = xstrdup(fsm->path); + } + + fsm->path = _free(fsm->path); + fsm->li->filex[i] = -1; + } + +/*@-dependenttrans@*/ + linkpath = _free(linkpath); +/*@=dependenttrans@*/ + fsm->ix = iterIndex; + fsm->nsuffix = nsuffix; + fsm->lpath = lpath; + fsm->path = path; + return ec; +} + +/** \ingroup payload + * Create pending hard links to existing file. + * @param fsm file state machine data + * @return 0 on success + */ +/*@-compdef@*/ +static int fsmMakeLinks(/*@special@*/ /*@partial@*/ IOSM_t fsm) + /*@uses fsm->path, fsm->opath, fsm->nsuffix, fsm->ix, fsm->li @*/ + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies fsm, fileSystem, internalState @*/ +{ + const char * path = fsm->path; + const char * opath = fsm->opath; + const char * nsuffix = fsm->nsuffix; + int iterIndex = fsm->ix; + int ec = 0; + int rc; + int i; + + fsm->path = NULL; + fsm->opath = NULL; + fsm->nsuffix = NULL; + fsm->ix = -1; + + fsm->ix = fsm->li->filex[fsm->li->createdPath]; + rc = fsmNext(fsm, IOSM_MAP); + fsm->opath = fsm->path; + fsm->path = NULL; + for (i = 0; i < fsm->li->nlink; i++) { + if (fsm->li->filex[i] < 0) continue; + if (fsm->li->createdPath == i) continue; + + fsm->ix = fsm->li->filex[i]; + fsm->path = _free(fsm->path); + rc = fsmNext(fsm, IOSM_MAP); + if (iosmFileActionSkipped(fsm->action)) continue; + + rc = fsmUNSAFE(fsm, IOSM_VERIFY); + if (!rc) continue; + if (!(rc == IOSMERR_ENOENT)) break; + + /* XXX link(fsm->opath, fsm->path) */ + rc = fsmNext(fsm, IOSM_LINK); + if (fsm->failedFile && rc != 0 && *fsm->failedFile == NULL) { + ec = rc; + *fsm->failedFile = xstrdup(fsm->path); + } + + fsm->li->linksLeft--; + } + fsm->path = _free(fsm->path); + fsm->opath = _free(fsm->opath); + + fsm->ix = iterIndex; + fsm->nsuffix = nsuffix; + fsm->path = path; + fsm->opath = opath; + return ec; +} +/*@=compdef@*/ + +/** \ingroup payload + * Commit hard linked file set atomically. + * @param fsm file state machine data + * @return 0 on success + */ +/*@-compdef@*/ +static int fsmCommitLinks(/*@special@*/ /*@partial@*/ IOSM_t fsm) + /*@uses fsm->path, fsm->nsuffix, fsm->ix, fsm->sb, + fsm->li, fsm->links @*/ + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies fsm, fileSystem, internalState @*/ +{ + const char * path = fsm->path; + const char * nsuffix = fsm->nsuffix; + int iterIndex = fsm->ix; + struct stat * st = &fsm->sb; + int rc = 0; + int i; + + fsm->path = NULL; + fsm->nsuffix = NULL; + fsm->ix = -1; + + for (fsm->li = fsm->links; fsm->li; fsm->li = fsm->li->next) { + if (fsm->li->sb.st_ino == st->st_ino && fsm->li->sb.st_dev == st->st_dev) + break; + } + + for (i = 0; i < fsm->li->nlink; i++) { + if (fsm->li->filex[i] < 0) continue; + fsm->ix = fsm->li->filex[i]; + rc = fsmNext(fsm, IOSM_MAP); + if (!iosmFileActionSkipped(fsm->action)) + rc = fsmNext(fsm, IOSM_COMMIT); + fsm->path = _free(fsm->path); + fsm->li->filex[i] = -1; + } + + fsm->ix = iterIndex; + fsm->nsuffix = nsuffix; + fsm->path = path; + return rc; +} +/*@=compdef@*/ + +/** + * Remove (if created) directories not explicitly included in package. + * @param fsm file state machine data + * @return 0 on success + */ +static int fsmRmdirs(/*@special@*/ /*@partial@*/ IOSM_t fsm) + /*@uses fsm->path, fsm->dnlx, fsm->ldn, fsm->rdbuf, fsm->iter @*/ + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies fsm, fileSystem, internalState @*/ +{ + const char * path = fsm->path; + void * dnli = dnlInitIterator(fsm, 1); + char * dn = fsm->rdbuf; + int dc = dnlCount(dnli); + int rc = 0; + + fsm->path = NULL; + dn[0] = '\0'; + /*@-observertrans -dependenttrans@*/ + if (fsm->ldn != NULL && fsm->dnlx != NULL) + while ((fsm->path = dnlNextIterator(dnli)) != NULL) { + size_t dnlen = strlen(fsm->path); + char * te; + + dc = dnlIndex(dnli); + if (fsm->dnlx[dc] < 1 || (size_t)fsm->dnlx[dc] >= dnlen) + continue; + + /* Copy to avoid const on fsm->path. */ + te = stpcpy(dn, fsm->path) - 1; + fsm->path = dn; + + /* Remove generated directories. */ + /*@-usereleased@*/ /* LCL: te used after release? */ + do { + if (*te == '/') { + *te = '\0'; +/*@-compdef@*/ + rc = fsmNext(fsm, IOSM_RMDIR); +/*@=compdef@*/ + *te = '/'; + } + if (rc) + /*@innerbreak@*/ break; + te--; + } while ((te - fsm->path) > fsm->dnlx[dc]); + /*@=usereleased@*/ + } + dnli = dnlFreeIterator(dnli); + /*@=observertrans =dependenttrans@*/ + + fsm->path = path; + return rc; +} + +/** + * Create (if necessary) directories not explicitly included in package. + * @param fsm file state machine data + * @return 0 on success + */ +static int fsmMkdirs(/*@special@*/ /*@partial@*/ IOSM_t fsm) + /*@uses fsm->path, fsm->sb, fsm->osb, fsm->rdbuf, fsm->iter, + fsm->ldn, fsm->ldnlen, fsm->ldnalloc @*/ + /*@defines fsm->dnlx, fsm->ldn @*/ + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies fsm, fileSystem, internalState @*/ +{ + struct stat * st = &fsm->sb; + struct stat * ost = &fsm->osb; + const char * path = fsm->path; + mode_t st_mode = st->st_mode; + void * dnli = dnlInitIterator(fsm, 0); + char * dn = fsm->rdbuf; + int dc = dnlCount(dnli); + int rc = 0; + size_t i; + + fsm->path = NULL; + + dn[0] = '\0'; + fsm->dnlx = (unsigned short *) (dc ? xcalloc(dc, sizeof(*fsm->dnlx)) : NULL); + /*@-observertrans -dependenttrans@*/ + if (fsm->dnlx != NULL) + while ((fsm->path = dnlNextIterator(dnli)) != NULL) { + size_t dnlen = strlen(fsm->path); + char * te; + + dc = dnlIndex(dnli); + if (dc < 0) continue; + fsm->dnlx[dc] = (unsigned short) dnlen; + if (dnlen <= 1) + continue; + + /*@-compdef -nullpass@*/ /* FIX: fsm->ldn not defined ??? */ + if (dnlen <= fsm->ldnlen && !strcmp(fsm->path, fsm->ldn)) + continue; + /*@=compdef =nullpass@*/ + + /* Copy to avoid const on fsm->path. */ + (void) stpcpy(dn, fsm->path); + fsm->path = dn; + + /* Assume '/' directory exists, "mkdir -p" for others if non-existent */ + (void) urlPath(dn, (const char **)&te); + for (i = 1, te++; *te != '\0'; te++, i++) { + if (*te != '/') + /*@innercontinue@*/ continue; + + *te = '\0'; + + /* Already validated? */ + /*@-usedef -compdef -nullpass -nullderef@*/ + if (i < fsm->ldnlen && + (fsm->ldn[i] == '/' || fsm->ldn[i] == '\0') && + !strncmp(fsm->path, fsm->ldn, i)) + { + *te = '/'; + /* Move pre-existing path marker forward. */ + fsm->dnlx[dc] = (te - dn); + /*@innercontinue@*/ continue; + } + /*@=usedef =compdef =nullpass =nullderef@*/ + + /* Validate next component of path. */ + rc = fsmUNSAFE(fsm, IOSM_LSTAT); + *te = '/'; + + /* Directory already exists? */ + if (rc == 0 && S_ISDIR(ost->st_mode)) { + /* Move pre-existing path marker forward. */ + fsm->dnlx[dc] = (te - dn); + } else if (rc == IOSMERR_ENOENT) { + rpmfi fi = fsmGetFi(fsm); + *te = '\0'; + st->st_mode = S_IFDIR | (fi->dperms & 07777); + rc = fsmNext(fsm, IOSM_MKDIR); + if (!rc) { + /* XXX FIXME? only new dir will have context set. */ + /* Get file security context from patterns. */ + if (!fsm->nofcontexts) { + fsm->fcontext = + rpmsxMatch(NULL, fsm->path, st->st_mode); + if (fsm->fcontext != NULL) + rc = fsmNext(fsm, IOSM_LSETFCON); + } else + fsm->fcontext = NULL; + rpmlog(RPMLOG_DEBUG, + D_("%s directory created with perms %04o, context %s.\n"), + fsm->path, (unsigned)(st->st_mode & 07777), + (fsm->fcontext ? fsm->fcontext : "(no context)")); + fsm->fcontext = _free(fsm->fcontext); + } + *te = '/'; + } + if (rc) + /*@innerbreak@*/ break; + } + if (rc) break; + + /* Save last validated path. */ +/*@-compdef@*/ /* FIX: ldn/path annotations ? */ + if (fsm->ldnalloc < (dnlen + 1)) { + fsm->ldnalloc = dnlen + 100; + fsm->ldn = (char *) xrealloc(fsm->ldn, fsm->ldnalloc); + } + if (fsm->ldn != NULL) { /* XXX can't happen */ + strcpy(fsm->ldn, fsm->path); + fsm->ldnlen = dnlen; + } +/*@=compdef@*/ + } + dnli = dnlFreeIterator(dnli); + /*@=observertrans =dependenttrans@*/ + + fsm->path = path; + st->st_mode = st_mode; /* XXX restore st->st_mode */ +/*@-compdef@*/ /* FIX: ldn/path annotations ? */ + return rc; +/*@=compdef@*/ +} + +#ifdef NOTYET +/** + * Check for file on disk. + * @param fsm file state machine data + * @return 0 on success + */ +static int fsmStat(/*@special@*/ /*@partial@*/ IOSM_t fsm) + /*@globals fileSystem, internalState @*/ + /*@modifies fsm, fileSystem, internalState @*/ +{ + int rc = 0; + + if (fsm->path != NULL) { + int saveernno = errno; + rc = fsmUNSAFE(fsm, (!(fsm->mapFlags & IOSM_FOLLOW_SYMLINKS) + ? IOSM_LSTAT : IOSM_STAT)); + if (rc == IOSMERR_ENOENT) { + errno = saveerrno; + rc = 0; + fsm->exists = 0; + } else if (rc == 0) { + fsm->exists = 1; + } + } else { + /* Skip %ghost files on build. */ + fsm->exists = 0; + } + return rc; +} +#endif + +#define IS_DEV_LOG(_x) \ + ((_x) != NULL && strlen(_x) >= (sizeof("/dev/log")-1) && \ + !strncmp((_x), "/dev/log", sizeof("/dev/log")-1) && \ + ((_x)[sizeof("/dev/log")-1] == '\0' || \ + (_x)[sizeof("/dev/log")-1] == ';')) + +/*@-compmempass@*/ +int fsmStage(IOSM_t fsm, iosmFileStage stage) +{ +#ifdef NOTUSED + iosmFileStage prevStage = fsm->stage; + const char * const prev = iosmFileStageString(prevStage); +#endif + const char * const cur = iosmFileStageString(stage); + struct stat * st = &fsm->sb; + struct stat * ost = &fsm->osb; + int saveerrno = errno; + int rc = fsm->rc; + int i; + +#define _fafilter(_a) \ + (!((_a) == FA_CREATE || (_a) == FA_ERASE || (_a) == FA_COPYIN || (_a) == FA_COPYOUT) \ + ? iosmFileActionString(_a) : "") + + if (stage & IOSM_DEAD) { + /* do nothing */ + } else if (stage & IOSM_INTERNAL) { + if (fsm->debug && !(stage & IOSM_SYSCALL)) + rpmlog(RPMLOG_DEBUG, " %8s %06o%3d (%4d,%4d)%12lu %s %s\n", + cur, + (unsigned)st->st_mode, (int)st->st_nlink, + (int)st->st_uid, (int)st->st_gid, (unsigned long)st->st_size, + (fsm->path ? fsm->path : ""), + _fafilter(fsm->action)); + } else { + const char * apath = NULL; + if (fsm->path) + (void) urlPath(fsm->path, &apath); + fsm->stage = stage; + if (fsm->debug || !(stage & IOSM_VERBOSE)) + rpmlog(RPMLOG_DEBUG, "%-8s %06o%3d (%4d,%4d)%12lu %s %s\n", + cur, + (unsigned)st->st_mode, (int)st->st_nlink, + (int)st->st_uid, (int)st->st_gid, (unsigned long)st->st_size, + (apath ? apath + fsm->astriplen : ""), + _fafilter(fsm->action)); + } +#undef _fafilter + + switch (stage) { + case IOSM_UNKNOWN: + break; + case IOSM_PKGINSTALL: + while (1) { + /* Clean fsm, free'ing memory. Read next archive header. */ + rc = fsmUNSAFE(fsm, IOSM_INIT); + + /* Exit on end-of-payload. */ + if (rc == IOSMERR_HDR_TRAILER) { + rc = 0; + /*@loopbreak@*/ break; + } + + /* Exit on error. */ + if (rc) { + fsm->postpone = 1; + (void) fsmNext(fsm, IOSM_UNDO); + /*@loopbreak@*/ break; + } + + /* Extract file from archive. */ + rc = fsmNext(fsm, IOSM_PROCESS); + if (rc) { + (void) fsmNext(fsm, IOSM_UNDO); + /*@loopbreak@*/ break; + } + + /* Notify on success. */ + (void) fsmNext(fsm, IOSM_NOTIFY); + + rc = fsmNext(fsm, IOSM_FINI); + if (rc) { + /*@loopbreak@*/ break; + } + } + break; + case IOSM_PKGERASE: + case IOSM_PKGCOMMIT: + while (1) { + /* Clean fsm, free'ing memory. */ + rc = fsmUNSAFE(fsm, IOSM_INIT); + + /* Exit on end-of-payload. */ + if (rc == IOSMERR_HDR_TRAILER) { + rc = 0; + /*@loopbreak@*/ break; + } + + /* Rename/erase next item. */ + if (fsmNext(fsm, IOSM_FINI)) + /*@loopbreak@*/ break; + } + break; + case IOSM_PKGBUILD: + while (1) { + + rc = fsmUNSAFE(fsm, IOSM_INIT); + + /* Exit on end-of-payload. */ + if (rc == IOSMERR_HDR_TRAILER) { + rc = 0; + /*@loopbreak@*/ break; + } + + /* Exit on error. */ + if (rc) { + fsm->postpone = 1; + (void) fsmNext(fsm, IOSM_UNDO); + /*@loopbreak@*/ break; + } + + /* Copy file into archive. */ + rc = fsmNext(fsm, IOSM_PROCESS); + if (rc) { + (void) fsmNext(fsm, IOSM_UNDO); + /*@loopbreak@*/ break; + } + + /* Notify on success. */ + (void) fsmNext(fsm, IOSM_NOTIFY); + + if (fsmNext(fsm, IOSM_FINI)) + /*@loopbreak@*/ break; + } + + /* Flush partial sets of hard linked files. */ + if (!(fsm->mapFlags & IOSM_ALL_HARDLINKS)) { + int nlink, j; + while ((fsm->li = fsm->links) != NULL) { + fsm->links = fsm->li->next; + fsm->li->next = NULL; + + /* Re-calculate link count for archive header. */ + for (j = -1, nlink = 0, i = 0; i < fsm->li->nlink; i++) { + if (fsm->li->filex[i] < 0) + /*@innercontinue@*/ continue; + nlink++; + if (j == -1) j = i; + } + /* XXX force the contents out as well. */ + if (j != 0) { + fsm->li->filex[0] = fsm->li->filex[j]; + fsm->li->filex[j] = -1; + } + fsm->li->sb.st_nlink = nlink; + + fsm->sb = fsm->li->sb; /* structure assignment */ + fsm->osb = fsm->sb; /* structure assignment */ + + if (!rc) rc = writeLinkedFile(fsm); + + fsm->li = freeHardLink(fsm->li); + } + } + + if (!rc) + rc = fsmNext(fsm, IOSM_TRAILER); + + break; + case IOSM_CREATE: + fsm->path = _free(fsm->path); + fsm->lpath = _free(fsm->lpath); + fsm->opath = _free(fsm->opath); + fsm->dnlx = _free(fsm->dnlx); + + fsm->ldn = _free(fsm->ldn); + fsm->ldnalloc = fsm->ldnlen = 0; + + fsm->rdsize = fsm->wrsize = 0; + fsm->rdbuf = fsm->rdb = _free(fsm->rdb); + fsm->wrbuf = fsm->wrb = _free(fsm->wrb); + if (fsm->goal == IOSM_PKGINSTALL || fsm->goal == IOSM_PKGBUILD) { + fsm->rdsize = 16 * BUFSIZ; + fsm->rdbuf = fsm->rdb = (char *) xmalloc(fsm->rdsize); + fsm->wrsize = 16 * BUFSIZ; + fsm->wrbuf = fsm->wrb = (char *) xmalloc(fsm->wrsize); + } + + fsm->mkdirsdone = 0; + fsm->ix = -1; + fsm->links = NULL; + fsm->li = NULL; + errno = 0; /* XXX get rid of EBADF */ + + /* Detect and create directories not explicitly in package. */ + if (fsm->goal == IOSM_PKGINSTALL) { +/*@-compdef@*/ + rc = fsmNext(fsm, IOSM_MKDIRS); +/*@=compdef@*/ + if (!rc) fsm->mkdirsdone = 1; + } + + break; + case IOSM_INIT: + fsm->path = _free(fsm->path); + fsm->lpath = _free(fsm->lpath); + fsm->postpone = 0; + fsm->diskchecked = fsm->exists = 0; + fsm->subdir = NULL; + fsm->suffix = (fsm->sufbuf[0] != '\0' ? fsm->sufbuf : NULL); + fsm->action = FA_UNKNOWN; + fsm->osuffix = NULL; + fsm->nsuffix = NULL; + + if (fsm->goal == IOSM_PKGINSTALL) { + /* Read next header from payload, checking for end-of-payload. */ + rc = fsmUNSAFE(fsm, IOSM_NEXT); + } + if (rc) break; + + /* Identify mapping index. */ + fsm->ix = ((fsm->goal == IOSM_PKGINSTALL) + ? mapFind(fsm->iter, fsm->path) : mapNextIterator(fsm->iter)); + +if (!(fsmGetFi(fsm)->mapflags & IOSM_PAYLOAD_LIST)) { + /* Detect end-of-loop and/or mapping error. */ +if (!(fsmGetFi(fsm)->mapflags & IOSM_PAYLOAD_EXTRACT)) { + if (fsm->ix < 0) { + if (fsm->goal == IOSM_PKGINSTALL) { +#if 0 + rpmlog(RPMLOG_WARNING, + _("archive file %s was not found in header file list\n"), + fsm->path); +#endif + if (fsm->failedFile && *fsm->failedFile == NULL) + *fsm->failedFile = xstrdup(fsm->path); + rc = IOSMERR_UNMAPPED_FILE; + } else { + rc = IOSMERR_HDR_TRAILER; + } + break; + } +} + + /* On non-install, mode must be known so that dirs don't get suffix. */ + if (fsm->goal != IOSM_PKGINSTALL) { + rpmfi fi = fsmGetFi(fsm); + st->st_mode = fi->fmodes[fsm->ix]; + } +} + + /* Generate file path. */ + rc = fsmNext(fsm, IOSM_MAP); + if (rc) break; + + /* Perform lstat/stat for disk file. */ +#ifdef NOTYET + rc = fsmStat(fsm); +#else + if (fsm->path != NULL && + !(fsm->goal == IOSM_PKGINSTALL && S_ISREG(st->st_mode))) + { + rc = fsmUNSAFE(fsm, (!(fsm->mapFlags & IOSM_FOLLOW_SYMLINKS) + ? IOSM_LSTAT : IOSM_STAT)); + if (rc == IOSMERR_ENOENT) { + errno = saveerrno; + rc = 0; + fsm->exists = 0; + } else if (rc == 0) { + fsm->exists = 1; + } + } else { + /* Skip %ghost files on build. */ + fsm->exists = 0; + } +#endif + fsm->diskchecked = 1; + if (rc) break; + + /* On non-install, the disk file stat is what's remapped. */ + if (fsm->goal != IOSM_PKGINSTALL) + *st = *ost; /* structure assignment */ + + /* Remap file perms, owner, and group. */ + rc = fsmMapAttrs(fsm); + if (rc) break; + + fsm->postpone = iosmFileActionSkipped(fsm->action); + if (fsm->goal == IOSM_PKGINSTALL || fsm->goal == IOSM_PKGBUILD) { + /*@-evalorder@*/ /* FIX: saveHardLink can modify fsm */ + if (S_ISREG(st->st_mode) && st->st_nlink > 1) + fsm->postpone = saveHardLink(fsm); + /*@=evalorder@*/ + } +if (fsmGetFi(fsm)->mapflags & IOSM_PAYLOAD_LIST) fsm->postpone = 1; + break; + case IOSM_PRE: + break; + case IOSM_MAP: + rc = fsmMapPath(fsm); + break; + case IOSM_MKDIRS: + rc = fsmMkdirs(fsm); + break; + case IOSM_RMDIRS: + if (fsm->dnlx) + rc = fsmRmdirs(fsm); + break; + case IOSM_PROCESS: + if (fsm->postpone) { + if (fsm->goal == IOSM_PKGINSTALL) { + /* XXX Skip over file body, archive headers already done. */ + if (S_ISREG(st->st_mode)) + rc = fsmNext(fsm, IOSM_EAT); + } + break; + } + + if (fsm->goal == IOSM_PKGBUILD) { + if (fsm->fflags & RPMFILE_GHOST) /* XXX Don't if %ghost file. */ + break; + if (S_ISREG(st->st_mode) && st->st_nlink > 1) { + struct hardLink_s * li, * prev; + +if (!(fsm->mapFlags & IOSM_ALL_HARDLINKS)) break; + rc = writeLinkedFile(fsm); + if (rc) break; /* W2DO? */ + + for (li = fsm->links, prev = NULL; li; prev = li, li = li->next) + if (li == fsm->li) + /*@loopbreak@*/ break; + + if (prev == NULL) + fsm->links = fsm->li->next; + else + prev->next = fsm->li->next; + fsm->li->next = NULL; + fsm->li = freeHardLink(fsm->li); + } else { + rc = writeFile(fsm, 1); + } + break; + } + + if (fsm->goal != IOSM_PKGINSTALL) + break; + + if (S_ISREG(st->st_mode) && fsm->lpath != NULL) { + const char * opath = fsm->opath; + char * t = (char *) xmalloc(strlen(fsm->lpath+1) + strlen(fsm->suffix) + 1); + (void) stpcpy(t, fsm->lpath+1); + fsm->opath = t; + /* XXX link(fsm->opath, fsm->path) */ + rc = fsmNext(fsm, IOSM_LINK); + if (fsm->failedFile && rc != 0 && *fsm->failedFile == NULL) { + *fsm->failedFile = xstrdup(fsm->path); + } + fsm->opath = _free(fsm->opath); + fsm->opath = opath; + break; /* XXX so that delayed hard links get skipped. */ + } + if (S_ISREG(st->st_mode)) { + const char * path = fsm->path; + if (fsm->osuffix) + fsm->path = fsmFsPath(fsm, st, NULL, NULL); + rc = fsmUNSAFE(fsm, IOSM_VERIFY); + + if (rc == 0 && fsm->osuffix) { + const char * opath = fsm->opath; + fsm->opath = fsm->path; + fsm->path = fsmFsPath(fsm, st, NULL, fsm->osuffix); + rc = fsmNext(fsm, IOSM_RENAME); + if (!rc) + rpmlog(RPMLOG_WARNING, + _("%s saved as %s\n"), + (fsm->opath ? fsm->opath : ""), + (fsm->path ? fsm->path : "")); + fsm->path = _free(fsm->path); + fsm->opath = opath; + } + + /*@-dependenttrans@*/ + fsm->path = path; + /*@=dependenttrans@*/ + if (!(rc == IOSMERR_ENOENT)) return rc; + rc = extractRegular(fsm); + } else if (S_ISDIR(st->st_mode)) { + mode_t st_mode = st->st_mode; + rc = fsmUNSAFE(fsm, IOSM_VERIFY); + if (rc == IOSMERR_ENOENT) { + st->st_mode &= ~07777; /* XXX abuse st->st_mode */ + st->st_mode |= 00700; + rc = fsmNext(fsm, IOSM_MKDIR); + st->st_mode = st_mode; /* XXX restore st->st_mode */ + } + } else if (S_ISLNK(st->st_mode)) { +assert(fsm->lpath != NULL); + /*@=dependenttrans@*/ + rc = fsmUNSAFE(fsm, IOSM_VERIFY); + if (rc == IOSMERR_ENOENT) + rc = fsmNext(fsm, IOSM_SYMLINK); + } else if (S_ISFIFO(st->st_mode)) { + mode_t st_mode = st->st_mode; + /* This mimics cpio S_ISSOCK() behavior but probably isnt' right */ + rc = fsmUNSAFE(fsm, IOSM_VERIFY); + if (rc == IOSMERR_ENOENT) { + st->st_mode = 0000; /* XXX abuse st->st_mode */ + rc = fsmNext(fsm, IOSM_MKFIFO); + st->st_mode = st_mode; /* XXX restore st->st_mode */ + } + } else if (S_ISCHR(st->st_mode) || + S_ISBLK(st->st_mode) || + /*@-unrecog@*/ S_ISSOCK(st->st_mode) /*@=unrecog@*/) + { + rc = fsmUNSAFE(fsm, IOSM_VERIFY); + if (rc == IOSMERR_ENOENT) + rc = fsmNext(fsm, IOSM_MKNOD); + } else { + /* XXX Repackaged payloads may be missing files. */ + if (fsm->repackaged) + break; + + /* XXX Special case /dev/log, which shouldn't be packaged anyways */ + if (!IS_DEV_LOG(fsm->path)) + rc = IOSMERR_UNKNOWN_FILETYPE; + } + if (S_ISREG(st->st_mode) && st->st_nlink > 1) { + fsm->li->createdPath = fsm->li->linkIndex; + rc = fsmMakeLinks(fsm); + } + break; + case IOSM_POST: + break; + case IOSM_MKLINKS: + rc = fsmMakeLinks(fsm); + break; + case IOSM_NOTIFY: /* XXX move from fsm to psm -> tsm */ + if (fsm->goal == IOSM_PKGINSTALL || fsm->goal == IOSM_PKGBUILD) { + rpmts ts = fsmGetTs(fsm); + rpmfi fi = fsmGetFi(fsm); + void * ptr; + rpmuint64_t archivePos = fdGetCpioPos(fsm->cfd); + if (archivePos > fi->archivePos) { + fi->archivePos = (unsigned long long) archivePos; + ptr = rpmtsNotify(ts, fi->te, RPMCALLBACK_INST_PROGRESS, + fi->archivePos, fi->archiveSize); + } + } + break; + case IOSM_UNDO: + if (fsm->postpone) + break; + if (fsm->goal == IOSM_PKGINSTALL) { + /* XXX only erase if temp fn w suffix is in use */ + if (fsm->sufbuf[0] != '\0') + (void) fsmNext(fsm, + (S_ISDIR(st->st_mode) ? IOSM_RMDIR : IOSM_UNLINK)); + +#ifdef NOTYET /* XXX remove only dirs just created, not all. */ + if (fsm->dnlx) + (void) fsmNext(fsm, IOSM_RMDIRS); +#endif + errno = saveerrno; + } + if (fsm->failedFile && *fsm->failedFile == NULL) + *fsm->failedFile = xstrdup(fsm->path); + break; + case IOSM_FINI: + if (!fsm->postpone && fsm->commit) { + if (fsm->goal == IOSM_PKGINSTALL) + rc = ((S_ISREG(st->st_mode) && st->st_nlink > 1) + ? fsmCommitLinks(fsm) : fsmNext(fsm, IOSM_COMMIT)); + if (fsm->goal == IOSM_PKGCOMMIT) + rc = fsmNext(fsm, IOSM_COMMIT); + if (fsm->goal == IOSM_PKGERASE) + rc = fsmNext(fsm, IOSM_COMMIT); + } + fsm->path = _free(fsm->path); + fsm->lpath = _free(fsm->lpath); + fsm->opath = _free(fsm->opath); + memset(st, 0, sizeof(*st)); + memset(ost, 0, sizeof(*ost)); + break; + case IOSM_COMMIT: + /* Rename pre-existing modified or unmanaged file. */ + if (fsm->osuffix && fsm->diskchecked && + (fsm->exists || (fsm->goal == IOSM_PKGINSTALL && S_ISREG(st->st_mode)))) + { + const char * opath = fsm->opath; + const char * path = fsm->path; + fsm->opath = fsmFsPath(fsm, st, NULL, NULL); + fsm->path = fsmFsPath(fsm, st, NULL, fsm->osuffix); + rc = fsmNext(fsm, IOSM_RENAME); + if (!rc) { + rpmlog(RPMLOG_WARNING, _("%s saved as %s\n"), + (fsm->opath ? fsm->opath : ""), + (fsm->path ? fsm->path : "")); + } + fsm->path = _free(fsm->path); + fsm->path = path; + fsm->opath = _free(fsm->opath); + fsm->opath = opath; + } + + /* Remove erased files. */ + if (fsm->goal == IOSM_PKGERASE) { + if (fsm->action == FA_ERASE) { + rpmfi fi = fsmGetFi(fsm); + if (S_ISDIR(st->st_mode)) { + rc = fsmNext(fsm, IOSM_RMDIR); + if (!rc) break; + switch (rc) { + case IOSMERR_ENOENT: /* XXX rmdir("/") linux 2.2.x kernel hack */ + case IOSMERR_ENOTEMPTY: + /* XXX make sure that build side permits %missingok on directories. */ + if (fsm->fflags & RPMFILE_MISSINGOK) + /*@innerbreak@*/ break; + + /* XXX common error message. */ + rpmlog( + (fsm->strict_erasures ? RPMLOG_ERR : RPMLOG_DEBUG), + _("%s rmdir of %s failed: Directory not empty\n"), + rpmfiTypeString(fi), fsm->path); + /*@innerbreak@*/ break; + default: + rpmlog( + (fsm->strict_erasures ? RPMLOG_ERR : RPMLOG_DEBUG), + _("%s rmdir of %s failed: %s\n"), + rpmfiTypeString(fi), fsm->path, strerror(errno)); + /*@innerbreak@*/ break; + } + } else { + rc = fsmNext(fsm, IOSM_UNLINK); + if (!rc) break; + switch (rc) { + case IOSMERR_ENOENT: + if (fsm->fflags & RPMFILE_MISSINGOK) + /*@innerbreak@*/ break; + /*@fallthrough@*/ + default: + rpmlog( + (fsm->strict_erasures ? RPMLOG_ERR : RPMLOG_DEBUG), + _(" %s: unlink of %s failed: %s\n"), + rpmfiTypeString(fi), fsm->path, strerror(errno)); + /*@innerbreak@*/ break; + } + } + } + /* XXX Failure to remove is not (yet) cause for failure. */ + if (!fsm->strict_erasures) rc = 0; + break; + } + + /* XXX Special case /dev/log, which shouldn't be packaged anyways */ +if (!(fsmGetFi(fsm)->mapflags & IOSM_PAYLOAD_EXTRACT)) { + if (!S_ISSOCK(st->st_mode) && !IS_DEV_LOG(fsm->path)) { + /* Rename temporary to final file name. */ + if (!S_ISDIR(st->st_mode) && + (fsm->subdir || fsm->suffix || fsm->nsuffix)) + { + fsm->opath = fsm->path; + fsm->path = fsmFsPath(fsm, st, NULL, fsm->nsuffix); + rc = fsmNext(fsm, IOSM_RENAME); + if (rc) + (void) Unlink(fsm->opath); + else if (fsm->nsuffix) { + const char * opath = fsmFsPath(fsm, st, NULL, NULL); + rpmlog(RPMLOG_WARNING, _("%s created as %s\n"), + (opath ? opath : ""), + (fsm->path ? fsm->path : "")); + opath = _free(opath); + } + fsm->opath = _free(fsm->opath); + } + /* + * Set file security context (if not disabled). + */ + if (!rc && !getuid()) { + rc = fsmMapFContext(fsm); + if (!rc) + rc = fsmNext(fsm, IOSM_LSETFCON); +/*@-dependenttrans -observertrans @*/ /* FIX: use the SELinux free wrapper */ + fsm->fcontext = _free(fsm->fcontext); +/*@=dependenttrans =observertrans @*/ + } + if (S_ISLNK(st->st_mode)) { + if (!rc && !getuid()) + rc = fsmNext(fsm, IOSM_LCHOWN); + } else { + if (!rc && !getuid()) + rc = fsmNext(fsm, IOSM_CHOWN); + if (!rc) + rc = fsmNext(fsm, IOSM_CHMOD); + if (!rc) { + time_t mtime = st->st_mtime; + rpmfi fi = fsmGetFi(fsm); + if (fi->fmtimes) + st->st_mtime = fi->fmtimes[fsm->ix]; + rc = fsmNext(fsm, IOSM_UTIME); + st->st_mtime = mtime; + } + } + } +} + + /* Notify on success. */ + if (!rc) rc = fsmNext(fsm, IOSM_NOTIFY); + else if (fsm->failedFile && *fsm->failedFile == NULL) { + *fsm->failedFile = fsm->path; + fsm->path = NULL; + } + break; + case IOSM_DESTROY: + fsm->path = _free(fsm->path); + + /* Check for hard links missing from payload. */ + while ((fsm->li = fsm->links) != NULL) { + fsm->links = fsm->li->next; + fsm->li->next = NULL; + if (fsm->goal == IOSM_PKGINSTALL && + fsm->commit && fsm->li->linksLeft) + { + for (i = 0 ; i < fsm->li->linksLeft; i++) { + if (fsm->li->filex[i] < 0) + /*@innercontinue@*/ continue; + rc = IOSMERR_MISSING_HARDLINK; + if (fsm->failedFile && *fsm->failedFile == NULL) { + fsm->ix = fsm->li->filex[i]; + if (!fsmNext(fsm, IOSM_MAP)) { + *fsm->failedFile = fsm->path; + fsm->path = NULL; + } + } + /*@loopbreak@*/ break; + } + } + if (fsm->goal == IOSM_PKGBUILD && + (fsm->mapFlags & IOSM_ALL_HARDLINKS)) + { + rc = IOSMERR_MISSING_HARDLINK; + } + fsm->li = freeHardLink(fsm->li); + } + fsm->ldn = _free(fsm->ldn); + fsm->ldnalloc = fsm->ldnlen = 0; + fsm->rdbuf = fsm->rdb = _free(fsm->rdb); + fsm->wrbuf = fsm->wrb = _free(fsm->wrb); + break; + case IOSM_VERIFY: + if (fsm->diskchecked && !fsm->exists) { + rc = IOSMERR_ENOENT; + break; + } + if (S_ISREG(st->st_mode)) { + char * path = (char *) alloca(strlen(fsm->path) + sizeof("-RPMDELETE")); + (void) stpcpy( stpcpy(path, fsm->path), "-RPMDELETE"); + /* + * XXX HP-UX (and other os'es) don't permit unlink on busy + * XXX files. + */ + fsm->opath = fsm->path; + fsm->path = path; + rc = fsmNext(fsm, IOSM_RENAME); + if (!rc) + (void) fsmNext(fsm, IOSM_UNLINK); + else + rc = IOSMERR_UNLINK_FAILED; + fsm->path = fsm->opath; + fsm->opath = NULL; + return (rc ? rc : IOSMERR_ENOENT); /* XXX HACK */ + /*@notreached@*/ break; + } else if (S_ISDIR(st->st_mode)) { + if (S_ISDIR(ost->st_mode)) return 0; + if (S_ISLNK(ost->st_mode)) { + rc = fsmUNSAFE(fsm, IOSM_STAT); + if (rc == IOSMERR_ENOENT) rc = 0; + if (rc) break; + errno = saveerrno; + if (S_ISDIR(ost->st_mode)) return 0; + } + } else if (S_ISLNK(st->st_mode)) { + if (S_ISLNK(ost->st_mode)) { + /* XXX NUL terminated result in fsm->rdbuf, len in fsm->rdnb. */ + rc = fsmUNSAFE(fsm, IOSM_READLINK); + errno = saveerrno; + if (rc) break; + if (!strcmp(fsm->lpath, fsm->rdbuf)) return 0; + } + } else if (S_ISFIFO(st->st_mode)) { + if (S_ISFIFO(ost->st_mode)) return 0; + } else if (S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)) { + if ((S_ISCHR(ost->st_mode) || S_ISBLK(ost->st_mode)) && + (ost->st_rdev == st->st_rdev)) return 0; + } else if (S_ISSOCK(st->st_mode)) { + if (S_ISSOCK(ost->st_mode)) return 0; + } + /* XXX shouldn't do this with commit/undo. */ + rc = 0; + if (fsm->stage == IOSM_PROCESS) rc = fsmNext(fsm, IOSM_UNLINK); + if (rc == 0) rc = IOSMERR_ENOENT; + return (rc ? rc : IOSMERR_ENOENT); /* XXX HACK */ + /*@notreached@*/ break; + + case IOSM_UNLINK: + { const char * fn = fsm->path; + uint8_t * b = (uint8_t *)""; + size_t blen = 0; + uint8_t * d = NULL; + size_t dlen = 0; + uint32_t dalgo = 0; + FD_t fd = NULL; + struct stat sb; + mode_t mode; + sb.st_mode = 0; + if (!Lstat(fn, &sb) && S_ISREG(sb.st_mode)) { + fd = Fopen(fn, "r.fdio"); + blen = sb.st_size; + b = mmap(NULL, blen, PROT_READ, MAP_SHARED, Fileno(fd), 0); + } + mode = sb.st_mode; + rc = rpmlioUnlink(rpmtsGetRdb(fsmGetTs(fsm)), fn, mode, b, blen, d, dlen, dalgo); + if (fd != NULL) { +/*@-observertrans@*/ /* FIX: b should be initialized to NULL, not "" */ + (void)munmap(b, blen); +/*@=observertrans@*/ + (void) Fclose(fd); + fd = NULL; + } + } goto iosmcall; + case IOSM_RENAME: + { const char * ofn = fsm->opath; + const char * fn = fsm->path; + uint8_t * b = NULL; + size_t blen = 0; + uint8_t * d = NULL; + size_t dlen = 0; + uint32_t dalgo = 0; + FD_t fd = NULL; + struct stat sb; + mode_t mode; + sb.st_mode = 0; + if (!Lstat(fn, &sb) && S_ISREG(sb.st_mode)) { + fd = Fopen(fn, "r.fdio"); + blen = sb.st_size; + b = mmap(NULL, blen, PROT_READ, MAP_SHARED, Fileno(fd), 0); + } + mode = sb.st_mode; + rc = rpmlioRename(rpmtsGetRdb(fsmGetTs(fsm)), ofn, fn, mode, b, blen, d, dlen, dalgo); + if (fd != NULL) { + (void)munmap(b, blen); + (void) Fclose(fd); + fd = NULL; + } + } goto iosmcall; + case IOSM_MKDIR: + rc = rpmlioMkdir(rpmtsGetRdb(fsmGetTs(fsm)), fsm->path, st->st_mode); + goto iosmcall; + case IOSM_RMDIR: + rc = rpmlioRmdir(rpmtsGetRdb(fsmGetTs(fsm)), fsm->path, st->st_mode); + goto iosmcall; + case IOSM_LSETFCON: + /* Log iff lsetfilecon() will actually be called. */ + if (fsm->fcontext && *fsm->fcontext + && strcmp(fsm->fcontext, "<>")) + rc = rpmlioLsetfilecon(rpmtsGetRdb(fsmGetTs(fsm)), + fsm->path, fsm->fcontext); + goto iosmcall; + case IOSM_CHOWN: + rc = rpmlioChown(rpmtsGetRdb(fsmGetTs(fsm)), fsm->path, st->st_uid, st->st_gid); + goto iosmcall; + case IOSM_LCHOWN: + rc = rpmlioLchown(rpmtsGetRdb(fsmGetTs(fsm)), fsm->path, st->st_uid, st->st_gid); + goto iosmcall; + case IOSM_CHMOD: + rc = rpmlioChmod(rpmtsGetRdb(fsmGetTs(fsm)), fsm->path, st->st_mode); + goto iosmcall; + case IOSM_UTIME: + rc = rpmlioUtime(rpmtsGetRdb(fsmGetTs(fsm)), fsm->path, st->st_mtime, st->st_mtime); + goto iosmcall; + case IOSM_SYMLINK: + rc = rpmlioSymlink(rpmtsGetRdb(fsmGetTs(fsm)), fsm->lpath, fsm->path); + goto iosmcall; + case IOSM_LINK: + rc = rpmlioLink(rpmtsGetRdb(fsmGetTs(fsm)), fsm->opath, fsm->path); + goto iosmcall; + case IOSM_MKFIFO: + rc = rpmlioMkfifo(rpmtsGetRdb(fsmGetTs(fsm)), fsm->path, st->st_mode); + goto iosmcall; + case IOSM_MKNOD: + rc = rpmlioMknod(rpmtsGetRdb(fsmGetTs(fsm)), fsm->path, st->st_mode, st->st_rdev); + goto iosmcall; + case IOSM_LSTAT: + case IOSM_STAT: + case IOSM_READLINK: + case IOSM_CHROOT: +iosmcall: + rc = iosmStage(fsm, stage); + break; + + case IOSM_NEXT: + case IOSM_EAT: + case IOSM_POS: + case IOSM_PAD: + case IOSM_TRAILER: + case IOSM_HREAD: + case IOSM_HWRITE: + case IOSM_DREAD: + case IOSM_DWRITE: + rc = iosmStage(fsm, stage); + break; + + case IOSM_ROPEN: + case IOSM_READ: + case IOSM_RCLOSE: + rc = iosmStage(fsm, stage); + break; + case IOSM_WOPEN: + case IOSM_WRITE: + case IOSM_WCLOSE: + rc = iosmStage(fsm, stage); + break; + + default: + break; + } + + if (!(stage & IOSM_INTERNAL)) { + fsm->rc = (rc == IOSMERR_HDR_TRAILER ? 0 : rc); + } + return rc; +} +/*@=compmempass@*/ diff --git a/rpm-5.4.9/lib/fsm.h b/rpm-5.4.9/lib/fsm.h new file mode 100644 index 0000000..a9ffca6 --- /dev/null +++ b/rpm-5.4.9/lib/fsm.h @@ -0,0 +1,118 @@ +#ifndef H_FSM +#define H_FSM + +/** \ingroup payload + * \file lib/fsm.h + * File state machine to handle a payload within an rpm package. + */ + +#include + +/** \ingroup payload + * File state machine data. + */ +typedef /*@abstract@*/ struct iosm_s * FSM_t; + +/*@-exportlocal@*/ +/*@unchecked@*/ +extern int _fsm_debug; +/*@=exportlocal@*/ + +/** \ingroup payload + * Iterator across package file info, forward on install, backward on erase. + */ +typedef /*@abstract@*/ struct iosmIterator_s * FSMI_t; + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Create file state machine instance. + * @return file state machine + */ +/*@only@*/ IOSM_t newFSM(void) + /*@*/; + +/** + * Destroy file state machine instance. + * @param fsm file state machine + * @return always NULL + */ +/*@null@*/ IOSM_t freeFSM(/*@only@*/ /*@null@*/ IOSM_t fsm) + /*@globals fileSystem @*/ + /*@modifies fsm, fileSystem @*/; + +/** + * Load external data into file state machine. + * @param _fsm file state machine + * @param goal + * @param afmt archive format (NULL uses cpio) + * @param _ts transaction set + * @param _fi transaction element file info + * @param cfd payload descriptor + * @retval archiveSize pointer to archive size + * @retval failedFile pointer to first file name that failed. + * @return 0 on success + */ +int fsmSetup(void * _fsm, iosmFileStage goal, /*@null@*/ const char * afmt, + const void * _ts, + const void * _fi, + FD_t cfd, + /*@out@*/ unsigned int * archiveSize, + /*@out@*/ const char ** failedFile) + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies cfd, *archiveSize, *failedFile, + fileSystem, internalState @*/; + +/** + * Clean file state machine. + * @param _fsm file state machine + * @return 0 on success + */ +int fsmTeardown(void * _fsm) + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies _fsm, fileSystem, internalState @*/; + +/** + * Map next file path and action. + * @param fsm file state machine + */ +int fsmMapPath(IOSM_t fsm) + /*@modifies fsm @*/; + +/** + * Map file stat(2) info. + * @param fsm file state machine + */ +int fsmMapAttrs(IOSM_t fsm) + /*@modifies fsm @*/; +/*@=exportlocal@*/ + +/** + * File state machine driver. + * @param fsm file state machine + * @param nstage next stage + * @return 0 on success + */ +int fsmNext(IOSM_t fsm, iosmFileStage nstage) + /*@globals errno, h_errno, fileSystem, internalState @*/ + /*@modifies fsm, errno, fileSystem, internalState @*/; + +/** + * File state machine driver. + * @param fsm file state machine + * @param stage next stage + * @return 0 on success + */ +/*@-exportlocal@*/ +int fsmStage(/*@partial@*/ IOSM_t fsm, iosmFileStage stage) + /*@globals errno, h_errno, fileSystem, internalState @*/ + /*@modifies fsm, errno, fileSystem, internalState @*/; +/*@=exportlocal@*/ + +#ifdef __cplusplus +} +#endif + +#endif /* H_FSM */ diff --git a/rpm-5.4.9/lib/librpm.vers b/rpm-5.4.9/lib/librpm.vers new file mode 100644 index 0000000..afeb132 --- /dev/null +++ b/rpm-5.4.9/lib/librpm.vers @@ -0,0 +1,410 @@ +LIBRPM_0 +{ + global: + __assert_program_name; + _cacheDependsRC; + _cpuinfo_path; + currentDirectory; + doputenv; + dosetenv; + fileActionString; + fileStageString; + _fini; + _fps_debug; + freeFSM; + _fsm_debug; + fsmGetFi; + fsmGetTs; + fsmMapAttrs; + fsmMapPath; + fsmNext; + fsmSetup; + fsmStage; + fsmTeardown; + _fsm_threads; + ftsOpts; + giFlags; + global_depFlags; + IDTXfree; + IDTXglob; + IDTXgrow; + IDTXload; + IDTXnew; + IDTXsort; + _init; + makeTempFile; + newFSM; + _nosigh; + nplatpat; + platpat; + _print_pkts; + _psm_debug; + _psm_threads; + rpmalAdd; + rpmalAddProvides; + rpmalAllFileSatisfiesDepend; + rpmalAllSatisfiesDepend; + rpmalCreate; + _rpmal_debug; + rpmalDel; + rpmalFree; + rpmalMakeIndex; + rpmalSatisfiesDepend; + rpmcliAllPoptTable; + rpmcliArgIter; + rpmcliConfigured; + rpmcliDepFlagsPoptTable; + rpmcliFini; + rpmcliHashesCurrent; + rpmcliHashesTotal; + rpmcliImportPubkey; + rpmcliInit; + rpmcliInstall; + rpmcliInstallCheck; + rpmcliInstallOrder; + rpmcliInstallProblems; + rpmcliInstallRun; + rpmcliInstallSuggests; + rpmcliPackagesTotal; + rpmcliProgressCurrent; + rpmcliProgressTotal; + rpmcliQuery; + rpmcliQueryFlags; + rpmcliRcfile; + rpmcliShowMatches; + rpmcliSign; + rpmcliTargets; + rpmcliVerify; + rpmdsA; + rpmdsAnyMatchesDep; + rpmdsBT; + rpmdsColor; + rpmdsCompare; + rpmdsCount; + rpmdsCpuinfo; + _rpmds_debug; + rpmdsDNEVR; + rpmdsELF; + rpmdsEVR; + rpmdsExclude; + rpmdsFind; + rpmdsFlags; + rpmdsFreePRCO; + rpmdsFromPRCO; + rpmdsGetconf; + rpmdsInclude; + rpmdsInit; + rpmdsIx; + rpmdsLdconfig; + rpmdsMatch; + rpmdsMerge; + rpmdsMergePRCO; + rpmdsN; + rpmdsNegateRC; + rpmdsNew; + rpmdsNewDNEVR; + rpmdsNewPRCO; + rpmdsNExclude; + rpmdsNext; + rpmdsNInclude; + _rpmds_nopromote; + rpmdsNoPromote; + rpmdsNotify; + rpmdsNSType; + rpmdsNVRMatchesDep; + rpmdsPipe; + rpmdsProblem; + rpmdsRefs; + rpmdsResult; + rpmdsRpmlib; + rpmdsSearch; + rpmdsSetBT; + rpmdsSetColor; + rpmdsSetIx; + rpmdsSetNoPromote; + rpmdsSetRefs; + rpmdsSetResult; + rpmdsSingle; + rpmdsSysinfo; + rpmdsTagN; + rpmdsThis; + rpmdsType; + rpmdsUname; + _rpmds_unspecified_epoch_noise; + rpmErase; + rpmEVR; + _rpmfc_debug; + rpmfcApply; + rpmfcClassify; + rpmfcColoring; + rpmfcExec; + rpmfcGenerateDepends; + rpmfcNew; + rpmfcPrint; + rpmfiAddRelocation; + rpmfiBN; + rpmfiBuildFClasses; + rpmfiBuildFContexts; + rpmfiBuildFDeps; + rpmfiBuildFSContexts; + rpmfiBuildREContexts; + rpmfiColor; + rpmfiCompare; + rpmfiDC; + _rpmfi_debug; + rpmfiDecideFate; + rpmfiDigest; + rpmfiDN; + rpmfiDX; + rpmfiExclude; + rpmfiFC; + rpmfiFClass; + rpmfiFColor; + rpmfiFContext; + rpmfiFDepends; + rpmfiFFlags; + rpmfiSetFFlags; + rpmfiFGroup; + rpmfiFInode; + rpmfiFLink; + rpmfiFMode; + rpmfiFMtime; + rpmfiFN; + rpmfiFNBF; + rpmfiFNlink; + rpmfiFNMaxLen; + rpmfiFRdev; + rpmfiFreeRelocations; + rpmfiFSize; + rpmfiFState; + rpmfiSetFState; + rpmfiFUser; + rpmfiFX; + rpmfiSetHeader; + rpmfiInclude; + rpmfiInit; + rpmfiInitD; + rpmfiNew; + rpmfiNExclude; + rpmfiNext; + rpmfiNextD; + rpmfiNInclude; + rpmfiSetDX; + rpmfiSetFX; + rpmfiTypeString; + rpmfiVFlags; + rpmfiSetVFlags; + rpmfiFStat; + rpmfiFStat; + rpmfiStat; + rpmfiOpendir; + rpmFLAGS; + rpmFreeFilesystems; + rpmFreeRpmrc; + rpmGetFilesystemList; + rpmGetFilesystemUsage; + rpmGetPassPhrase; + _rpmgi_debug; + rpmgiEscapeSpaces; + rpmgiHdrPath; + rpmgiHeader; + rpmgiNew; + rpmgiNext; + rpmgiSetArgs; + rpmgiTs; + rpmHeaderFormats; + rpmIArgs; + rpmInstallPoptTable; + rpmInstallSource; + rpmInstallSourcePackage; + rpmlibVersion; + rpmlibTimestamp; + rpmlibVendor; + rpmluaextActivate; + rpmMkdirPath; + rpmNAME; + rpmPermsString; + rpmPlatformScore; + rpmProblemString; + rpmpsAppend; + rpmpsCreate; + _rpmps_debug; + rpmpsFreeIterator; + rpmpsInitIterator; + rpmpsNextIterator; + rpmpsmNew; + rpmpsmStage; + rpmpsNumProblems; + rpmpsPrint; + rpmpsProblem; + rpmpsTrim; + rpmpsGetProblem; + rpmProblemGetAltNEVR; + rpmProblemGetDiskNeed; + rpmProblemGetStr; + rpmProblemGetType; + rpmProblemGetPkgNEVR; + rpmProblemKey; + rpmQueryPoptTable; + rpmQueryVerify; + rpmQVKArgs; + rpmQVSourcePoptTable; + rpmReadConfigFiles; + rpmReadPackageManifest; + rpmRollback; + rpmShowProgress; + rpmShowRC; + rpmSignPoptTable; + rpmsxContext; + rpmsxCount; + _rpmsx_debug; + rpmsxFContext; + rpmsxFMode; + rpmsxFStem; + rpmsxInit; + rpmsxIx; + rpmsxNew; + rpmsxNext; + rpmsxParse; + rpmsxPattern; + rpmsxRE; + rpmsxSetIx; + rpmsxType; + rpmteA; + rpmteAddedKey; + rpmteBreadth; + rpmteChain; + rpmteCleanDS; + rpmteColor; + rpmteColorDS; + rpmteD; + rpmteDBInstance; + rpmteDBOffset; + _rpmte_debug; + rpmteDegree; + rpmteDependsOnKey; + rpmteDepth; + rpmteDS; + rpmteE; + rpmteFd; + rpmteFI; + rpmteFlink; + rpmteFreeTSI; + rpmteHdrid; + rpmteHeader; + rpmteIsSource; + rpmteKey; + rpmteN; + rpmteNEVR; + rpmteNEVRA; + rpmteNew; + rpmteNewTSI; + rpmteNpreds; + rpmteO; + rpmteParent; + rpmtePkgid; + rpmtePkgFileSize; + rpmteR; + rpmteSetAddedKey; + rpmteSetBreadth; + rpmteSetColor; + rpmteSetDBInstance; + rpmteSetDegree; + rpmteSetDepth; + rpmteSetHeader; + rpmteSetNpreds; + rpmteSetParent; + rpmteSetTree; + rpmteSourcerpm; + rpmteTree; + rpmteTSI; + rpmteType; + rpmteV; + rpmtsARBGoal; + rpmtsAcquireLock; + rpmtsAddEraseElement; + rpmtsAddInstallElement; + rpmtsAvailable; + _rpmtsCheck; + rpmtsCheck; + rpmtsCheckDSIProblems; + rpmtsChrootDone; + rpmtsClean; + rpmtsCloseDB; + rpmtsCloseSDB; + rpmtsColor; + rpmtsCreate; + rpmtsCurrDir; + rpmtsDBMode; + rpmtsDFlags; + rpmtsDoARBGoal; + rpmtsElement; + rpmtsEmpty; + rpmtsFilterFlags; + rpmtsFindPubkey; + rpmtsFlags; + rpmtsFreeLock; + rpmtsGetKeyring; + rpmtsGetTid; + rpmtsGetType; + rpmtsGoal; + rpmtsiNext; + rpmtsInitDSI; + rpmtsInitIterator; + rpmtsiOc; + rpmtsNElements; + rpmtsNotify; + rpmtsOp; + rpmtsOpenDB; + rpmtsOpenSDB; + _rpmtsOrder; + _orgrpmtsOrder; + rpmtsOrder; + rpmtsPRCO; + rpmtsPrefColor; + rpmtsProblems; + rpmtsRebuildDB; + rpmtsRelocateElement; + rpmtsRootDir; + _rpmtsRun; + rpmtsRun; + rpmtsScriptFd; + rpmtsSELinuxEnabled; + rpmtsSetARBGoal; + rpmtsSetChrootDone; + rpmtsSetColor; + rpmtsSetCurrDir; + rpmtsSetDBMode; + rpmtsSetDFlags; + rpmtsSetFlags; + rpmtsSetGoal; + rpmtsSetKeyring; + rpmtsSetNotifyCallback; + rpmtsSetRelocateElement; + rpmtsSetRootDir; + rpmtsSetScriptFd; + rpmtsSetSolveCallback; + rpmtsSetSpec; + rpmtsSetTid; + rpmtsSetType; + rpmtsSetVSFlags; + rpmtsSolve; + rpmtsSpec; + rpmtsType; + _rpmts_debug; + _rpmts_macros; + _rpmts_stats; + rpmtsUnorderedSuccessors; + rpmtsUpdateDSI; + rpmtsVSFlags; + rpmVerifyPoptTable; + rpmVerifySignatures; + RPMVERSION; + showQueryPackage; + showVerifyPackage; + specedit; + strict_erasures; + XrpmtsiInit; + local: + *; +}; diff --git a/rpm-5.4.9/lib/manifest.c b/rpm-5.4.9/lib/manifest.c new file mode 100644 index 0000000..4249f2e --- /dev/null +++ b/rpm-5.4.9/lib/manifest.c @@ -0,0 +1,201 @@ +/** \ingroup rpmcli + * \file lib/manifest.c + */ + +#include "system.h" + +#include /* XXX fdGetFp */ +#include +#include + +#include +#include "manifest.h" +#include "debug.h" + +char * rpmPermsString(int mode) +{ + char *perms = xstrdup("----------"); + + if (S_ISREG(mode)) + perms[0] = '-'; + else if (S_ISDIR(mode)) + perms[0] = 'd'; + else if (S_ISLNK(mode)) + perms[0] = 'l'; + else if (S_ISFIFO(mode)) + perms[0] = 'p'; + /*@-unrecog@*/ + else if (S_ISSOCK(mode)) + perms[0] = 's'; + /*@=unrecog@*/ + else if (S_ISCHR(mode)) + perms[0] = 'c'; + else if (S_ISBLK(mode)) + perms[0] = 'b'; + else + perms[0] = '?'; + + if (mode & S_IRUSR) perms[1] = 'r'; + if (mode & S_IWUSR) perms[2] = 'w'; + if (mode & S_IXUSR) perms[3] = 'x'; + + if (mode & S_IRGRP) perms[4] = 'r'; + if (mode & S_IWGRP) perms[5] = 'w'; + if (mode & S_IXGRP) perms[6] = 'x'; + + if (mode & S_IROTH) perms[7] = 'r'; + if (mode & S_IWOTH) perms[8] = 'w'; + if (mode & S_IXOTH) perms[9] = 'x'; + + if (mode & S_ISUID) + perms[3] = ((mode & S_IXUSR) ? 's' : 'S'); + + if (mode & S_ISGID) + perms[6] = ((mode & S_IXGRP) ? 's' : 'S'); + + if (mode & S_ISVTX) + perms[9] = ((mode & S_IXOTH) ? 't' : 'T'); + + return perms; +} + +/**@todo Infinite loops through manifest files exist, operator error for now. */ +rpmRC rpmReadPackageManifest(FD_t fd, int * argcPtr, const char *** argvPtr) +{ + rpmiob iob = rpmiobNew(0); + char * s = NULL; + char * se; + int ac = 0; + const char ** av = NULL; + int argc = (argcPtr ? *argcPtr : 0); + const char ** argv = (argvPtr ? *argvPtr : NULL); + FD_t xfd; + FILE * f; + rpmRC rpmrc = RPMRC_OK; + int i, j, next, npre; + + if (fdGetFp(fd) == NULL) + xfd = Fdopen(fd, "r.fpio"); + else + xfd = fd; + +/*@+voidabstract@*/ + if ((f = (FILE *) fdGetFp(xfd)) == NULL) { +/*@=voidabstract@*/ + rpmrc = RPMRC_NOTFOUND; + goto exit; + } + + while (1) { + char line[BUFSIZ]; + + /* Read next line. */ + s = fgets(line, sizeof(line) - 1, f); + if (s == NULL) { + if (Ferror(xfd)) + rpmlog(RPMLOG_ERR, _("reading %s manifest failed: %s\n"), + fdGetOPath(xfd), Fstrerror(xfd)); + break; + } + + /* XXX stop processing manifest if HTML is found. */ +#define DOCTYPE_HTML_PUBLIC " s && (se[-1] == '\n' || se[-1] == '\r')) + *(--se) = '\0'; + while (*s && strchr(" \f\n\r\t\v", *s) != NULL) + s++; + if (*s == '\0') continue; + + /* Insure that file contains only ASCII */ + if (*s < 32) { + rpmlog(RPMLOG_ERR, _("reading %s manifest, non-printable characters found\n"), + fdGetOPath(xfd)); + + rpmrc = RPMRC_FAIL; /* XXX reject non-printable manifests. */ + goto exit; + } + + /* Concatenate next line in buffer. */ + *se++ = ' '; + *se = '\0'; + iob = rpmiobAppend(iob, s, 0); + } + + if (s == NULL) /* XXX always true */ + s = rpmiobStr(iob); + + if (!(s && *s)) { + rpmrc = RPMRC_FAIL; /* XXX force manifests to have content. */ + goto exit; + } + + /* Glob manifest items. */ + rpmrc = (rpmRC) rpmGlob(s, &ac, &av); + if (rpmrc != RPMRC_OK) goto exit; + + rpmlog(RPMLOG_DEBUG, D_("adding %d args from manifest.\n"), ac); + + /* Count non-NULL args, keeping track of 1st arg after last NULL. */ + npre = 0; + next = 0; + if (argv != NULL) + for (i = 0; i < argc; i++) { + if (argv[i] != NULL) + npre++; + else if (i >= next) + next = i + 1; + } + + /* Copy old arg list, inserting manifest before argv[next]. */ + if (argv != NULL) { + int nac = npre + ac; + const char ** nav = (const char **) xcalloc((nac + 1), sizeof(*nav)); + + for (i = 0, j = 0; i < next; i++) { + if (argv[i] != NULL) + nav[j++] = argv[i]; + } + + if (ac) + memcpy(nav + j, av, ac * sizeof(*nav)); + if ((argc - next) > 0) + memcpy(nav + j + ac, argv + next, (argc - next) * sizeof(*nav)); + nav[nac] = NULL; + + if (argvPtr) + *argvPtr = argv = _free(argv); + av = _free(av); + av = nav; + ac = nac; + } + + /* Save new argc/argv list. */ + if (argvPtr) { + *argvPtr = _free(*argvPtr); + *argvPtr = av; + } + if (argcPtr) + *argcPtr = ac; + +exit: + if (argvPtr == NULL || (rpmrc != RPMRC_OK && av)) { + if (av) + for (i = 0; i < ac; i++) + /*@-unqualifiedtrans@*/av[i] = _free(av[i]); /*@=unqualifiedtrans@*/ + /*@-dependenttrans@*/ av = _free(av); /*@=dependenttrans@*/ + } + iob = rpmiobFree(iob); +/*@-nullstate@*/ /* FIX: *argvPtr may be NULL. */ + return rpmrc; +/*@=nullstate@*/ +} diff --git a/rpm-5.4.9/lib/manifest.h b/rpm-5.4.9/lib/manifest.h new file mode 100644 index 0000000..d7a9e76 --- /dev/null +++ b/rpm-5.4.9/lib/manifest.h @@ -0,0 +1,39 @@ +#ifndef H_MANIFEST +#define H_MANIFEST + +/** + * \file lib/manifest.h + * Routines to expand a manifest containing glob expressions into an argv list. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Return ls(1)-like formatted mode string. + * @param mode file mode + * @return (malloc'd) formatted mode string + */ +/*@-incondefs@*/ +/*@only@*/ +char * rpmPermsString(int mode) + /*@*/; +/*@=incondefs@*/ + +/** + * Read manifest, glob items, and append to existing args. + * @param fd manifest file handle + * @retval argcPtr no. of args + * @retval argvPtr args themselves + * @return RPMRC_OK on success + */ +rpmRC rpmReadPackageManifest(FD_t fd, int * argcPtr, const char *** argvPtr) + /*@globals fileSystem, internalState @*/ + /*@modifies fd, *argcPtr, *argvPtr, fileSystem, internalState @*/; + +#ifdef __cplusplus +} +#endif + +#endif /* H_MANIFEST */ diff --git a/rpm-5.4.9/lib/misc.c b/rpm-5.4.9/lib/misc.c new file mode 100644 index 0000000..287f616 --- /dev/null +++ b/rpm-5.4.9/lib/misc.c @@ -0,0 +1,84 @@ +/** + * \file lib/misc.c + */ + +#include "system.h" + +#include +#include +#include +#include +#include /* XXX for rpmGetPath */ +#include +#include "misc.h" +#include "debug.h" + +/*@unchecked@*/ /*@observer@*/ +const char * RPMVERSION = VERSION; + +rpmRC rpmMkdirPath (const char * dpath, const char * dname) +{ + struct stat st; + int rc; + + if ((rc = Stat(dpath, &st)) < 0) { + int ut = urlPath(dpath, NULL); + switch (ut) { + case URL_IS_PATH: + case URL_IS_UNKNOWN: + if (errno != ENOENT) + break; + /*@fallthrough@*/ + case URL_IS_HTTPS: + case URL_IS_HTTP: + case URL_IS_FTP: + rc = Mkdir(dpath, 0755); + break; + case URL_IS_DASH: + case URL_IS_HKP: + case URL_IS_MONGO: /* XXX FIXME */ + break; + } + if (rc < 0) { + rpmlog(RPMLOG_ERR, _("cannot create %%%s %s\n"), dname, dpath); + return RPMRC_FAIL; + } + } + return RPMRC_OK; +} + +int doputenv(const char *str) +{ + char * a; + + /* FIXME: this leaks memory! */ + a = (char *) xmalloc(strlen(str) + 1); + strcpy(a, str); + return putenv(a); +} + +int dosetenv(const char * name, const char * value, int overwrite) +{ + char * a; + + if (!overwrite && getenv(name)) return 0; + + /* FIXME: this leaks memory! */ + a = (char *) xmalloc(strlen(name) + strlen(value) + sizeof("=")); + (void) stpcpy( stpcpy( stpcpy( a, name), "="), value); + return putenv(a); +} + +char * currentDirectory(void) +{ + int currDirLen = 0; + char * currDir = NULL; + + do { + currDirLen += 128; + currDir = (char *) xrealloc(currDir, currDirLen); + memset(currDir, 0, currDirLen); + } while (getcwd(currDir, currDirLen) == NULL && errno == ERANGE); + + return currDir; +} diff --git a/rpm-5.4.9/lib/misc.h b/rpm-5.4.9/lib/misc.h new file mode 100644 index 0000000..3b8ea94 --- /dev/null +++ b/rpm-5.4.9/lib/misc.h @@ -0,0 +1,58 @@ +#ifndef H_MISC +#define H_MISC + +/** + * \file lib/misc.h + */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Create directory if it does not exist, and make sure path is writable. + * @note This will only create last component of directory path. + * @param dpath directory path + * @param dname directory use string + * @return rpmRC return code + */ +rpmRC rpmMkdirPath (const char * dpath, const char * dname) + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies fileSystem, internalState @*/; + +/** + * Like the libc function, but malloc()'s the space needed. + * @deprecated Use setenv(3) instead. + * @param name variable name + * @param value variable value + * @param overwrite should an existing variable be changed? + * @return 0 on success + */ +int dosetenv(const char * name, const char * value, int overwrite) + /*@globals environ@*/ + /*@modifies *environ @*/; + +/** + * Like the libc function, but malloc()'s the space needed. + * @deprecated Use setenv(3) instead. + * @param str "name=value" string + * @return 0 on success + */ +int doputenv(const char * str) + /*@globals environ@*/ + /*@modifies *environ @*/; + +/** + * Return (malloc'd) current working directory. + * @return current working directory (malloc'ed) + */ +/*@only@*/ char * currentDirectory(void) + /*@*/; + +#ifdef __cplusplus +} +#endif + +#endif /* H_MISC */ diff --git a/rpm-5.4.9/lib/order.c b/rpm-5.4.9/lib/order.c new file mode 100644 index 0000000..4ee384e --- /dev/null +++ b/rpm-5.4.9/lib/order.c @@ -0,0 +1,2311 @@ +/** \ingroup rpmts + * \file lib/order.c + */ + +#include "system.h" + +#include +#include +#include /* XXX %{_dependency_whiteout} */ +#include + +#include +#include + +#define _RPMEVR_INTERNAL +#include +#include + +#define _RPMTE_INTERNAL +#define _RPMTS_ORDER_INTERNAL +#include +#define _RPMTS_INTERNAL +#include + +#include "debug.h" + +typedef rpmuint32_t rpm_color_t; + +/*@access alKey @*/ /* XXX for reordering and RPMAL_NOMATCH assign */ + +/** + */ +typedef /*@abstract@*/ struct orderListIndex_s * orderListIndex; +/*@access orderListIndex@*/ + +/** + */ +struct orderListIndex_s { +/*@dependent@*/ + alKey pkgKey; + int orIndex; +}; + +/* + * Strongly Connected Components + * set of packages (indirectly) requiering each other + */ +struct scc_s { + int count; /* # of external requires this SCC has */ +#if 0 + int qcnt; /* # of external requires pointing to this SCC */ +#endif + int size; /* # of members */ +#ifdef REFERENCE + tsortInfo * members; +#else + rpmte * members; +#endif /* REFERENCE */ +}; + +typedef struct scc_s * scc; + +#ifdef REFERENCE +struct relation_s { + tsortInfo rel_suc; /* pkg requiring this package */ + rpmsenseFlags rel_flags; /* accumulated flags of the requirements */ + struct relation_s * rel_next; +}; + +typedef struct relation_s * relation; + +struct tsortInfo_s { + rpmte te; + int tsi_count; /* #pkgs this pkg requires */ + int tsi_qcnt; /* #pkgs requiring this package */ + int tsi_reqx; /* requires Idx/mark as (queued/loop) */ + struct relation_s * tsi_relations; + struct relation_s * tsi_forward_relations; + tsortInfo tsi_suc; /* used for queuing (addQ) */ + int tsi_SccIdx; /* # of the SCC the node belongs to (1 for trivial SCCs) */ + int tsi_SccLowlink; /* used for SCC detection */ +}; +#endif /* REFERENCE */ + +struct badDeps_s { +/*@observer@*/ /*@owned@*/ /*@null@*/ + const char * pname; +/*@observer@*/ /*@dependent@*/ /*@null@*/ + const char * qname; +}; + +#ifdef __cplusplus +GENfree(orderListIndex) +GENfree(rpmte *) +#endif /* __cplusplus */ + +/*@unchecked@*/ +static int badDepsInitialized; + +/*@unchecked@*/ /*@only@*/ /*@null@*/ +static struct badDeps_s * badDeps; + +/** + */ +/*@-modobserver -observertrans @*/ +static void freeBadDeps(void) + /*@globals badDeps, badDepsInitialized @*/ + /*@modifies badDeps, badDepsInitialized @*/ +{ + if (badDeps) { + struct badDeps_s * bdp; + /* bdp->qname is a pointer to pname so doesn't need freeing */ + for (bdp = badDeps; bdp->pname != NULL && bdp->qname != NULL; bdp++) + bdp->pname = _free(bdp->pname); + badDeps = _free(badDeps); + } + badDepsInitialized = 0; +} +/*@=modobserver =observertrans @*/ + +/** + * Check for dependency relations to be ignored. + * + * @param ts transaction set + * @param p successor element (i.e. with Requires: ) + * @param q predecessor element (i.e. with Provides: ) + * @return 1 if dependency is to be ignored. + */ +static int ignoreDep(const rpmts ts, const rpmte p, const rpmte q) + /*@globals badDeps, badDepsInitialized, + rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies badDeps, badDepsInitialized, + rpmGlobalMacroContext, internalState @*/ +{ + struct badDeps_s * bdp; + + if (!badDepsInitialized) { + char * s = rpmExpand("%{?_dependency_whiteout}", NULL); + const char ** av = NULL; +#ifdef REFERENCE + int msglvl = (rpmtsDFlags(ts) & RPMDEPS_FLAG_DEPLOOPS) + ? RPMLOG_WARNING : RPMLOG_DEBUG; +#else + int anaconda = rpmtsDFlags(ts) & RPMDEPS_FLAG_ANACONDA; + int msglvl = (anaconda || (rpmtsDFlags(ts) & RPMDEPS_FLAG_DEPLOOPS)) + ? RPMLOG_WARNING : RPMLOG_DEBUG; +#endif + int ac = 0; + int i; + + if (s != NULL && *s != '\0' + && !(i = poptParseArgvString(s, &ac, (const char ***)&av)) + && ac > 0 && av != NULL) + { + bdp = badDeps = (struct badDeps_s *)xcalloc(ac+1, sizeof(*badDeps)); + for (i = 0; i < ac; i++, bdp++) { + char * pname, * qname; + + if (av[i] == NULL) + break; + pname = xstrdup(av[i]); + if ((qname = strchr(pname, '>')) != NULL) + *qname++ = '\0'; + bdp->pname = pname; +/*@-usereleased@*/ + bdp->qname = qname; +/*@=usereleased@*/ + rpmlog(msglvl, + _("ignore package name relation(s) [%d]\t%s -> %s\n"), + i, bdp->pname, (bdp->qname ? bdp->qname : "???")); + } + bdp->pname = NULL; + bdp->qname = NULL; + } + av = _free(av); + s = _free(s); + badDepsInitialized++; + } + +/*@-compdef@*/ + if (badDeps != NULL) + for (bdp = badDeps; bdp->pname != NULL && bdp->qname != NULL; bdp++) { + if (!strcmp(rpmteN(p), bdp->pname) && !strcmp(rpmteN(q), bdp->qname)) + return 1; + } + return 0; +/*@=compdef@*/ +} + +#ifdef REFERENCE +static void rpmTSIFree(tsortInfo tsi) +{ + relation rel; + + while (tsi->tsi_relations != NULL) { + rel = tsi->tsi_relations; + tsi->tsi_relations = tsi->tsi_relations->rel_next; + rel = _free(rel); + } + while (tsi->tsi_forward_relations != NULL) { + rel = tsi->tsi_forward_relations; + tsi->tsi_forward_relations = \ + tsi->tsi_forward_relations->rel_next; + rel = _free(rel); + } +} + +static inline int addSingleRelation(rpmte p, + rpmte q, + rpmsenseFlags dsflags) +{ + struct tsortInfo_s *tsi_p, *tsi_q; + relation rel; + rpmElementType teType = rpmteType(p); + rpmsenseFlags flags; + + /* Avoid deps outside this transaction and self dependencies */ + if (q == NULL || q == p) + return 0; + + /* Erasures are reversed installs. */ + if (teType == TR_REMOVED) { + rpmte r = p; + p = q; + q = r; + flags = isErasePreReq(dsflags); + } else { + flags = isInstallPreReq(dsflags); + } + + /* map legacy prereq to pre/preun as needed */ + if (isLegacyPreReq(dsflags)) { + flags |= (teType == TR_ADDED) ? + RPMSENSE_SCRIPT_PRE : RPMSENSE_SCRIPT_PREUN; + } + + tsi_p = rpmteTSI(p); + tsi_q = rpmteTSI(q); + + /* if relation got already added just update the flags */ + if (tsi_q->tsi_relations && tsi_q->tsi_relations->rel_suc == tsi_p) { + tsi_q->tsi_relations->rel_flags |= flags; + tsi_p->tsi_forward_relations->rel_flags |= flags; + return 0; + } + + /* Record next "q <- p" relation (i.e. "p" requires "q"). */ + if (p != q) { + /* bump p predecessor count */ + tsi_p->tsi_count++; + } + + rel = (relation) xcalloc(1, sizeof(*rel)); + rel->rel_suc = tsi_p; + rel->rel_flags = flags; + + rel->rel_next = tsi_q->tsi_relations; + tsi_q->tsi_relations = rel; + if (p != q) { + /* bump q successor count */ + tsi_q->tsi_qcnt++; + } + + rel = (relation) xcalloc(1, sizeof(*rel)); + rel->rel_suc = tsi_q; + rel->rel_flags = flags; + + rel->rel_next = tsi_p->tsi_forward_relations; + tsi_p->tsi_forward_relations = rel; + + return 0; +} +#endif /* REFERENCE */ + +/** + * Recursively mark all nodes with their predecessors. + * @param tsi successor chain + * @param q predecessor + */ +static void markLoop(/*@special@*/ tsortInfo tsi, rpmte q) + /*@globals internalState @*/ + /*@uses tsi @*/ + /*@modifies internalState @*/ +{ + rpmte p; + + while (tsi != NULL && (p = tsi->tsi_suc) != NULL) { + tsi = tsi->tsi_next; + if (rpmteTSI(p)->tsi_chain != NULL) + continue; + /*@-assignexpose -temptrans@*/ + rpmteTSI(p)->tsi_chain = q; + /*@=assignexpose =temptrans@*/ + if (rpmteTSI(p)->tsi_next != NULL) + markLoop(rpmteTSI(p)->tsi_next, p); + } +} + +/* + * Return display string a dependency, adding contextual flags marker. + * @param f dependency flags + * @return display string + */ +static inline /*@observer@*/ const char * identifyDepend(rpmuint32_t f) + /*@*/ +{ + f = _notpre(f); + if (f & RPMSENSE_SCRIPT_PRE) + return "Requires(pre):"; + if (f & RPMSENSE_SCRIPT_POST) + return "Requires(post):"; + if (f & RPMSENSE_SCRIPT_PREUN) + return "Requires(preun):"; + if (f & RPMSENSE_SCRIPT_POSTUN) + return "Requires(postun):"; + if (f & RPMSENSE_SCRIPT_VERIFY) + return "Requires(verify):"; + if (f & RPMSENSE_MISSINGOK) + return "Requires(hint):"; + if (f & RPMSENSE_FIND_REQUIRES) + return "Requires(auto):"; + return "Requires:"; +} + +/** + * Find (and eliminate co-requisites) "q <- p" relation in dependency loop. + * Search all successors of q for instance of p. Format the specific relation, + * (e.g. p contains "Requires: q"). Unlink and free co-requisite (i.e. + * pure Requires: dependencies) successor node(s). + * @param q sucessor (i.e. package required by p) + * @param p predecessor (i.e. package that "Requires: q") + * @param zap max. no. of co-requisites to remove (-1 is all)? + * @retval nzaps address of no. of relations removed + * @param msglvl message level at which to spew + * @return (possibly NULL) formatted "q <- p" releation (malloc'ed) + */ +/*@-mustmod@*/ /* FIX: hack modifies, but -type disables */ +static /*@owned@*/ /*@null@*/ const char * +zapRelation(rpmte q, rpmte p, + int zap, /*@in@*/ /*@out@*/ int * nzaps, int msglvl) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies q, p, *nzaps, rpmGlobalMacroContext, internalState @*/ +{ + rpmds requires; + tsortInfo tsi_prev; + tsortInfo tsi; + const char *dp = NULL; + + for (tsi_prev = rpmteTSI(q), tsi = rpmteTSI(q)->tsi_next; + tsi != NULL; + /* XXX Note: the loop traverses "not found", break on "found". */ + /*@-nullderef@*/ + tsi_prev = tsi, tsi = tsi->tsi_next) + /*@=nullderef@*/ + { + rpmuint32_t Flags; + + /*@-abstractcompare@*/ + if (tsi->tsi_suc != p) + continue; + /*@=abstractcompare@*/ + + requires = rpmteDS((rpmteType(p) == TR_REMOVED ? q : p), tsi->tsi_tagn); + if (requires == NULL) continue; /* XXX can't happen */ + + (void) rpmdsSetIx(requires, tsi->tsi_reqx); + + Flags = rpmdsFlags(requires); + + dp = rpmdsNewDNEVR( identifyDepend(Flags), requires); + + /* + * Attempt to unravel a dependency loop by eliminating Requires's. + */ + if (zap) { + rpmlog(msglvl, + _("removing %s \"%s\" from tsort relations.\n"), + (rpmteNEVRA(p) ? rpmteNEVRA(p) : "???"), dp); + rpmteTSI(p)->tsi_count--; + if (tsi_prev) tsi_prev->tsi_next = tsi->tsi_next; + tsi->tsi_next = NULL; + tsi->tsi_suc = NULL; + tsi = _free(tsi); + if (nzaps) + (*nzaps)++; + if (zap) + zap--; + } + /* XXX Note: the loop traverses "not found", get out now! */ + break; + } + return dp; +} +/*@=mustmod@*/ + +#ifdef REFERENCE +/** + * Record next "q <- p" relation (i.e. "p" requires "q"). + * @param ts transaction set + * @param p predecessor (i.e. package that "Requires: q") + * @param requires relation + * @return 0 always + */ +static inline int addRelation(rpmts ts, + rpmal al, + rpmte p, + rpmds requires) +{ + rpmte q; + ARGV_const_t qcolls; + rpmsenseFlags dsflags; + + dsflags = rpmdsFlags(requires); + + /* Avoid dependendencies which are not relevant for ordering */ + if (dsflags & (RPMSENSE_RPMLIB|RPMSENSE_CONFIG|RPMSENSE_PRETRANS)) + return 0; + + q = rpmalSatisfiesDepend(al, requires); + + /* Avoid deps outside this transaction and self dependencies */ + if (q == NULL || q == p) + return 0; + + /* Avoid certain dependency relations. */ + if (ignoreDep(ts, p, q)) + return 0; + + addSingleRelation(p, q, dsflags); + + /* If q is a member of any collections, make sure p requires all packages + * that are also in those collections */ + for (qcolls = rpmteCollections(q); qcolls && *qcolls; qcolls++) { + rpmte *te; + rpmte *tes = rpmalAllInCollection(al, *qcolls); + for (te = tes; te && *te; te++) { + addSingleRelation(p, *te, RPMSENSE_SCRIPT_PRE); + } + _free(tes); + } + + return 0; +} +#endif /* REFERENCE */ + +/** + * Record next "q <- p" relation (i.e. "p" requires "q"). + * @param ts transaction set + * @param p predecessor (i.e. package that "Requires: q") + * @param requires relation + * @return 0 always + */ +static inline int orgrpmAddRelation(rpmts ts, + rpmal al, + rpmte p, + rpmds requires) +{ + rpmte q; + struct tsortInfo_s * tsi_p, * tsi_q; + relation rel; + const char * N = rpmdsN(requires); + rpmElementType teType = rpmteType(p); + rpmsenseFlags flags; + rpmsenseFlags dsflags; + +#ifdef REFERENCE + if (N == NULL) + return 0; + + dsflags = rpmdsFlags(requires); + + /* Avoid rpmlib feature and package config dependencies */ + if (dsflags & (RPMSENSE_RPMLIB|RPMSENSE_CONFIG)) + return 0; + + q = rpmalSatisfiesDepend(al, requires); +#else + rpmtsi qi; + fnpyKey key; + alKey pkgKey; + int i = 0; + + dsflags = rpmdsFlags(requires); + + /* Avoid certain NS dependencies. */ + switch (rpmdsNSType(requires)) { + default: + break; + case RPMNS_TYPE_RPMLIB: + case RPMNS_TYPE_CONFIG: + case RPMNS_TYPE_CPUINFO: + case RPMNS_TYPE_GETCONF: + case RPMNS_TYPE_UNAME: + case RPMNS_TYPE_SONAME: + case RPMNS_TYPE_ACCESS: + case RPMNS_TYPE_USER: + case RPMNS_TYPE_GROUP: + case RPMNS_TYPE_MOUNTED: + case RPMNS_TYPE_DISKSPACE: + case RPMNS_TYPE_DIGEST: + case RPMNS_TYPE_GNUPG: + case RPMNS_TYPE_MACRO: + case RPMNS_TYPE_ENVVAR: + case RPMNS_TYPE_RUNNING: + case RPMNS_TYPE_SANITY: + case RPMNS_TYPE_VCHECK: + case RPMNS_TYPE_SIGNATURE: + return 0; + /*@notreached@*/ break; + } + +#ifndef NOTYET + /* Avoid looking up files/directories that are "owned" by _THIS_ package. */ + if (*N == '/') { + rpmfi fi = rpmteFI(p, RPMTAG_BASENAMES); + rpmbf bf = rpmfiFNBF(fi); + if (bf != NULL && rpmbfChk(bf, N, strlen(N)) > 0) + return 0; + } +#endif + + pkgKey = RPMAL_NOMATCH; + key = rpmalSatisfiesDepend(al, requires, &pkgKey); + + /* Ordering depends only on added/erased package relations. */ + if (pkgKey == RPMAL_NOMATCH) + return 0; + +/* XXX Set q to the added/removed package that was found. */ + /* XXX pretend erasedPackages are just appended to addedPackages. */ + if (teType == TR_REMOVED) + pkgKey = (alKey)(((long)pkgKey) + ts->numAddedPackages); + + for (qi = rpmtsiInit(ts), i = 0; (q = rpmtsiNext(qi, 0)) != NULL; i++) { + if (pkgKey == rpmteAddedKey(q)) + break; + } + qi = rpmtsiFree(qi); +#endif + + /* Avoid deps outside this transaction and self dependencies */ + if (q == NULL || q == p) + return 0; + + /* Avoid certain dependency relations. */ + if (ignoreDep(ts, p, q)) + return 0; + + /* Erasures are reversed installs. */ + if (teType == TR_REMOVED) { + rpmte r = p; + p = q; + q = r; + flags = isErasePreReq(dsflags); + } else { + flags = isInstallPreReq(dsflags); + } + +#ifndef DYING +#define isLegacyPreReq(_x) (((_x) & _ALL_REQUIRES_MASK) == RPMSENSE_PREREQ) + /* map legacy prereq to pre/preun as needed */ + if (isLegacyPreReq(dsflags)) { + flags |= (teType == TR_ADDED) ? + RPMSENSE_SCRIPT_PRE : RPMSENSE_SCRIPT_PREUN; + } +#undef isLegacyPreReq +#endif + + tsi_p = rpmteTSI(p); + tsi_q = rpmteTSI(q); + + /* if relation got already added just update the flags */ + if (tsi_q->tsi_relations && tsi_q->tsi_relations->rel_suc == p) { + tsi_q->tsi_relations->rel_flags |= flags; + tsi_p->tsi_forward_relations->rel_flags |= flags; + return 0; + } + + /* Record next "q <- p" relation (i.e. "p" requires "q"). */ + if (p != q) { + /* bump p predecessor count */ + rpmteTSI(p)->tsi_count++; + } + + /* Save max. depth in dependency tree */ + if (rpmteDepth(p) <= rpmteDepth(q)) + (void) rpmteSetDepth(p, (rpmteDepth(q) + 1)); + if (rpmteDepth(p) > ts->maxDepth) + ts->maxDepth = rpmteDepth(p); + + rel = (relation) xcalloc(1, sizeof(*rel)); + rel->rel_suc = p; + rel->rel_flags = flags; + + rel->rel_next = rpmteTSI(q)->tsi_relations; + rpmteTSI(q)->tsi_relations = rel; + if (p != q) { + /* bump q successor count */ + rpmteTSI(q)->tsi_qcnt++; + } + + rel = (relation) xcalloc(1, sizeof(*rel)); + rel->rel_suc = q; + rel->rel_flags = flags; + + rel->rel_next = rpmteTSI(p)->tsi_forward_relations; + rpmteTSI(p)->tsi_forward_relations = rel; + + return 0; +} + +/** + * Record next "q <- p" relation (i.e. "p" requires "q"). + * @param ts transaction set + * @param al added/erased package index + * @param p predecessor (i.e. package that "Requires: q") + * @param selected boolean package selected array + * @param requires relation + * @return 0 always + */ +/*@-mustmod@*/ +static inline int addRelation(rpmts ts, rpmal al, + /*@dependent@*/ rpmte p, + unsigned char * selected, + rpmds requires) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, p, *selected, rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + rpmtsi qi; rpmte q; + tsortInfo tsi; + const char * N = rpmdsN(requires); + fnpyKey key; + int teType = rpmteType(p); + alKey pkgKey; + int i = 0; + + /* Avoid certain NS dependencies. */ + switch (rpmdsNSType(requires)) { + default: + break; + case RPMNS_TYPE_RPMLIB: + case RPMNS_TYPE_CONFIG: + case RPMNS_TYPE_CPUINFO: + case RPMNS_TYPE_GETCONF: + case RPMNS_TYPE_UNAME: + case RPMNS_TYPE_SONAME: + case RPMNS_TYPE_ACCESS: + case RPMNS_TYPE_USER: + case RPMNS_TYPE_GROUP: + case RPMNS_TYPE_MOUNTED: + case RPMNS_TYPE_DISKSPACE: + case RPMNS_TYPE_DIGEST: + case RPMNS_TYPE_GNUPG: + case RPMNS_TYPE_MACRO: + case RPMNS_TYPE_ENVVAR: + case RPMNS_TYPE_RUNNING: + case RPMNS_TYPE_SANITY: + case RPMNS_TYPE_VCHECK: + case RPMNS_TYPE_SIGNATURE: + return 0; + /*@notreached@*/ break; + } + + /* Avoid looking up files/directories that are "owned" by _THIS_ package. */ + if (*N == '/') { + rpmfi fi = rpmteFI(p, RPMTAG_BASENAMES); + rpmbf bf = rpmfiFNBF(fi); + if (bf != NULL && rpmbfChk(bf, N, strlen(N)) > 0) + return 0; + } + + pkgKey = RPMAL_NOMATCH; + key = rpmalSatisfiesDepend(al, requires, &pkgKey); + + /* Ordering depends only on added/erased package relations. */ + if (pkgKey == RPMAL_NOMATCH) + return 0; + +/* XXX Set q to the added/removed package that was found. */ + /* XXX pretend erasedPackages are just appended to addedPackages. */ + if (teType == TR_REMOVED) + pkgKey = (alKey)(((long)pkgKey) + ts->numAddedPackages); + + for (qi = rpmtsiInit(ts), i = 0; (q = rpmtsiNext(qi, 0)) != NULL; i++) { + if (pkgKey == rpmteAddedKey(q)) + break; + } + qi = rpmtsiFree(qi); + if (q == NULL || i >= ts->orderCount) + return 0; + + /* Avoid certain dependency relations. */ + if (ignoreDep(ts, p, q)) + return 0; + + /* Avoid redundant relations. */ + if (selected[i] != 0) + return 0; + selected[i] = 1; + + /* Erasures are reversed installs. */ + if (teType == TR_REMOVED) { + rpmte r = p; + p = q; + q = r; + } + + /* T3. Record next "q <- p" relation (i.e. "p" requires "q"). */ + rpmteTSI(p)->tsi_count++; /* bump p predecessor count */ + + if (rpmteDepth(p) <= rpmteDepth(q)) /* Save max. depth in dependency tree */ + (void) rpmteSetDepth(p, (rpmteDepth(q) + 1)); + if (rpmteDepth(p) > ts->maxDepth) + ts->maxDepth = rpmteDepth(p); + + tsi = (tsortInfo) xcalloc(1, sizeof(*tsi)); + tsi->tsi_suc = p; + + tsi->tsi_tagn = rpmdsTagN(requires); + tsi->tsi_reqx = rpmdsIx(requires); + + tsi->tsi_next = rpmteTSI(q)->tsi_next; + rpmteTSI(q)->tsi_next = tsi; + rpmteTSI(q)->tsi_qcnt++; /* bump q successor count */ + + return 0; +} +/*@=mustmod@*/ + +/** + * Compare ordered list entries by index (qsort/bsearch). + * @param one 1st ordered list entry + * @param two 2nd ordered list entry + * @return result of comparison + */ +static int orderListIndexCmp(const void * one, const void * two) /*@*/ +{ + /*@-castexpose@*/ + long a = (long) ((const orderListIndex)one)->pkgKey; + long b = (long) ((const orderListIndex)two)->pkgKey; + /*@=castexpose@*/ + return (a - b); +} + +#ifdef REFERENCE +/** + * Add element to list sorting by tsi_qcnt. + * @param p new element + * @retval qp address of first element + * @retval rp address of last element + * @param prefcolor + */ +static void addQ(tsortInfo p, tsortInfo * qp, tsortInfo * rp, + rpm_color_t prefcolor) +{ + tsortInfo q, qprev; + + /* Mark the package as queued. */ + p->tsi_reqx = 1; + + if ((*rp) == NULL) { /* 1st element */ + /* FIX: double indirection */ + (*rp) = (*qp) = p; + return; + } + + /* Find location in queue using metric tsi_qcnt. */ + for (qprev = NULL, q = (*qp); + q != NULL; + qprev = q, q = q->tsi_suc) + { + /* XXX Insure preferred color first. */ + if (rpmteColor(p->te) != prefcolor && rpmteColor(p->te) != rpmteColor(q->te)) + continue; + + if (q->tsi_qcnt <= p->tsi_qcnt) + break; + } + + if (qprev == NULL) { /* insert at beginning of list */ + p->tsi_suc = q; + (*qp) = p; /* new head */ + } else if (q == NULL) { /* insert at end of list */ + qprev->tsi_suc = p; + (*rp) = p; /* new tail */ + } else { /* insert between qprev and q */ + p->tsi_suc = q; + qprev->tsi_suc = p; + } +} +#endif /* REFERENCE */ + +/** + * Add element to list sorting by tsi_qcnt. + * @param p new element + * @retval *qp first element + * @retval *rp last element + * @param prefcolor preferred color + */ +static void addQ(/*@dependent@*/ rpmte p, + /*@in@*/ /*@out@*/ rpmte * qp, + /*@in@*/ /*@out@*/ rpmte * rp, + rpmuint32_t prefcolor) + /*@modifies p, *qp, *rp @*/ +{ + rpmte q, qprev; + +#ifdef REFERENCE + /* Mark the package as queued. */ + rpmteTSI(p)->tsi_reqx = 1; +#endif /* REFERENCE */ + + if ((*rp) == NULL) { /* 1st element */ + (*rp) = (*qp) = p; + return; + } + + /* Find location in queue using metric tsi_qcnt. */ + for (qprev = NULL, q = (*qp); + q != NULL; + qprev = q, q = rpmteTSI(q)->tsi_suc) + { + /* XXX Insure preferred color first. */ + if (rpmteColor(p) != prefcolor && rpmteColor(p) != rpmteColor(q)) + continue; + +#ifdef REFERENCE +#else /* REFERENCE */ + /* XXX Insure removed after added. */ + if (rpmteType(p) == TR_REMOVED && rpmteType(p) != rpmteType(q)) + continue; + + /* XXX Follow all previous generations in the queue. */ + if (rpmteTSI(p)->tsi_queued > rpmteTSI(q)->tsi_queued) + continue; +#endif /* REFERENCE */ + + /* XXX Within a generation, queue behind more "important". */ + if (rpmteTSI(q)->tsi_qcnt <= rpmteTSI(p)->tsi_qcnt) + break; + } + + if (qprev == NULL) { /* insert at beginning of list */ + rpmteTSI(p)->tsi_suc = q; + (*qp) = p; /* new head */ + } else if (q == NULL) { /* insert at end of list */ + rpmteTSI(qprev)->tsi_suc = p; + (*rp) = p; /* new tail */ + } else { /* insert between qprev and q */ + rpmteTSI(p)->tsi_suc = q; + rpmteTSI(qprev)->tsi_suc = p; + } +} + +/*@unchecked@*/ +#ifdef NOTYET +static rpmuint32_t _autobits = _notpre(_ALL_REQUIRES_MASK); +#else +static rpmuint32_t _autobits = 0xffffffff; +#endif +#define isAuto(_x) ((_x) & _autobits) + +typedef struct sccData_s { + int index; /* DFS node number counter */ +#ifdef REFERENCE + tsortInfo *stack; /* Stack of nodes */ +#else + rpmte * stack; /* Stack of nodes */ +#endif + int stackcnt; /* Stack top counter */ + scc SCCs; /* Array of SCC's found */ + int sccCnt; /* Number of SCC's found */ +} * sccData; + +#ifdef REFERENCE +static void tarjan(sccData sd, tsortInfo tsi) +{ + tsortInfo tsi_q; + relation rel; + + /* use negative index numbers */ + sd->index--; + /* Set the depth index for p */ + tsi->tsi_SccIdx = sd->index; + tsi->tsi_SccLowlink = sd->index; + + sd->stack[sd->stackcnt++] = tsi; /* Push p on the stack */ + for (rel = tsi->tsi_relations; rel != NULL; rel = rel->rel_next) { + /* Consider successors of p */ + tsi_q = rel->rel_suc; + if (tsi_q->tsi_SccIdx > 0) + /* Ignore already found SCCs */ + continue; + if (tsi_q->tsi_SccIdx == 0) { + /* Was successor q not yet visited? */ + tarjan(sd, tsi_q); /* Recurse */ + /* negative index numbers: use max as it is closer to 0 */ + tsi->tsi_SccLowlink = (tsi->tsi_SccLowlink > tsi_q->tsi_SccLowlink) + ? tsi->tsi_SccLowlink : tsi_q->tsi_SccLowlink; + } else { + tsi->tsi_SccLowlink = (tsi->tsi_SccLowlink > tsi_q->tsi_SccIdx) + ? tsi->tsi_SccLowlink : tsi_q->tsi_SccIdx; + } + } + + if (tsi->tsi_SccLowlink == tsi->tsi_SccIdx) { + /* v is the root of an SCC? */ + if (sd->stack[sd->stackcnt-1] == tsi) { + /* ignore trivial SCCs */ + tsi_q = sd->stack[--sd->stackcnt]; + tsi_q->tsi_SccIdx = 1; + } else { + int stackIdx = sd->stackcnt; + do { + tsi_q = sd->stack[--stackIdx]; + tsi_q->tsi_SccIdx = sd->sccCnt; + } while (tsi_q != tsi); + + stackIdx = sd->stackcnt; + do { + tsi_q = sd->stack[--stackIdx]; + /* Calculate count for the SCC */ + sd->SCCs[sd->sccCnt].count += tsi_q->tsi_count; + /* Subtract internal relations */ + for (rel=tsi_q->tsi_relations; rel != NULL; rel=rel->rel_next) { + if (rel->rel_suc != tsi_q + && rel->rel_suc->tsi_SccIdx == sd->sccCnt) + sd->SCCs[sd->sccCnt].count--; + } + } while (tsi_q != tsi); + sd->SCCs[sd->sccCnt].size = sd->stackcnt - stackIdx; + /* copy members */ + sd->SCCs[sd->sccCnt].members = + (tsortInfo *) xcalloc(sd->SCCs[sd->sccCnt].size, sizeof(tsortInfo)); + memcpy(sd->SCCs[sd->sccCnt].members, sd->stack + stackIdx, + sd->SCCs[sd->sccCnt].size * sizeof(tsortInfo)); + sd->stackcnt = stackIdx; + sd->sccCnt++; + } + } +} +#else /* REFERENCE */ +static void tarjan(sccData sd, rpmte p) +{ + tsortInfo tsi = rpmteTSI(p); + rpmte q; + tsortInfo tsi_q; + relation rel; + + /* use negative index numbers */ + sd->index--; + /* Set the depth index for p */ + tsi->tsi_SccIdx = sd->index; + tsi->tsi_SccLowlink = sd->index; + + sd->stack[sd->stackcnt++] = p; /* Push p on the stack */ + for (rel = tsi->tsi_relations; rel != NULL; rel = rel->rel_next) { + /* Consider successors of p */ + q = rel->rel_suc; + tsi_q = rpmteTSI(q); + if (tsi_q->tsi_SccIdx > 0) + /* Ignore already found SCCs */ + continue; + if (tsi_q->tsi_SccIdx == 0) { + /* Was successor q not yet visited? */ + tarjan(sd, q); /* Recurse */ + /* negative index numbers: use max as it is closer to 0 */ + tsi->tsi_SccLowlink = (tsi->tsi_SccLowlink > tsi_q->tsi_SccLowlink) + ? tsi->tsi_SccLowlink : tsi_q->tsi_SccLowlink; + } else { + tsi->tsi_SccLowlink = (tsi->tsi_SccLowlink > tsi_q->tsi_SccIdx) + ? tsi->tsi_SccLowlink : tsi_q->tsi_SccIdx; + } + } + + if (tsi->tsi_SccLowlink == tsi->tsi_SccIdx) { + /* v is the root of an SCC? */ + if (sd->stack[sd->stackcnt-1] == p) { + /* ignore trivial SCCs */ + q = sd->stack[--sd->stackcnt]; + tsi_q = rpmteTSI(q); + tsi_q->tsi_SccIdx = 1; + } else { + int stackIdx = sd->stackcnt; + do { + q = sd->stack[--stackIdx]; + tsi_q = rpmteTSI(q); + tsi_q->tsi_SccIdx = sd->sccCnt; + } while (q != p); + + stackIdx = sd->stackcnt; + do { + q = sd->stack[--stackIdx]; + tsi_q = rpmteTSI(q); + /* Calculate count for the SCC */ + sd->SCCs[sd->sccCnt].count += tsi_q->tsi_count; + /* Subtract internal relations */ + for (rel=tsi_q->tsi_relations; rel != NULL; rel=rel->rel_next) { + if (rel->rel_suc != q + && rpmteTSI(rel->rel_suc)->tsi_SccIdx == sd->sccCnt) + sd->SCCs[sd->sccCnt].count--; + } + } while (q != p); + sd->SCCs[sd->sccCnt].size = sd->stackcnt - stackIdx; + /* copy members */ + sd->SCCs[sd->sccCnt].members = + (rpmte *) xcalloc(sd->SCCs[sd->sccCnt].size, sizeof(rpmte)); + memcpy(sd->SCCs[sd->sccCnt].members, sd->stack + stackIdx, + sd->SCCs[sd->sccCnt].size * sizeof(rpmte)); + sd->stackcnt = stackIdx; + sd->sccCnt++; + } + } +} +#endif /* REFERENCE */ + +/* Search for SCCs and return an array last entry has a .size of 0 */ +#ifdef REFERENCE +static scc detectSCCs(tsortInfo orderInfo, int nelem, int debugloops) +#else /* REFERENCE */ +static scc detectSCCs(rpmts ts) +#endif /* REFERENCE */ +{ +int nelem = ts->orderCount; + scc _SCCs = (scc) xcalloc(nelem+3, sizeof(*_SCCs)); +#ifdef REFERENCE + tsortInfo *_stack = (tsortInfo *) xcalloc(nelem, sizeof(*_stack)); +#else + rpmte * _stack = (rpmte *) xcalloc(nelem , sizeof(*_stack)); +#endif + struct sccData_s sd = { 0, _stack, 0, _SCCs, 2 }; + +#ifdef REFERENCE + for (int i = 0; i < nelem; i++) { + tsortInfo tsi = &orderInfo[i]; + /* Start a DFS at each node */ + if (tsi->tsi_SccIdx == 0) + tarjan(&sd, tsi); + } +#else /* REFERENCE */ + { rpmtsi pi; + rpmte p; + + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, 0)) != NULL) { + /* Start a DFS at each node */ + if (rpmteTSI(p)->tsi_SccIdx == 0) + tarjan(&sd, p); + } + pi = rpmtsiFree(pi); + } +#endif /* REFERENCE */ + + sd.stack = _free(sd.stack); + + sd.SCCs = (scc) xrealloc(sd.SCCs, (sd.sccCnt+1)*sizeof(*sd.SCCs)); + + /* Debug output */ + if (sd.sccCnt > 2) { +#ifdef REFERENCE +int debugloops = (rpmtsDFlags(ts) & RPMDEPS_FLAG_DEPLOOPS); + int msglvl = debugloops ? RPMLOG_WARNING : RPMLOG_DEBUG; +#else /* REFERENCE */ +int debugloops = (rpmtsDFlags(ts) & (RPMDEPS_FLAG_ANACONDA|RPMDEPS_FLAG_DEPLOOPS)); + rpmlogLvl msglvl = debugloops ? RPMLOG_WARNING : RPMLOG_ERR; + int i, j; +#endif /* REFERENCE */ + + rpmlog(msglvl, "%d Strongly Connected Components\n", sd.sccCnt-2); + for (i = 2; i < sd.sccCnt; i++) { + rpmlog(msglvl, "SCC #%d: requires %d packages\n", + i, sd.SCCs[i].count); + /* loop over members */ + for (j = 0; j < sd.SCCs[i].size; j++) { +#ifdef REFERENCE + tsortInfo member = SCCs[i].members[j]; + rpmlog(msglvl, "\t%s\n", rpmteNEVRA(member->te)); + /* show relations between members */ + relation rel = member->tsi_forward_relations; + for (; rel != NULL; rel=rel->rel_next) { + if (rel->rel_suc->tsi_SccIdx!=i) continue; + rpmlog(msglvl, "\t\t%s %s\n", + rel->rel_flags ? "=>" : "->", + rpmteNEVRA(rel->rel_suc->te)); + } +#else /* REFERENCE */ + /* show relations between members */ + rpmte member = sd.SCCs[i].members[j]; + rpmlog(msglvl, "\t%s\n", rpmteNEVRA(sd.SCCs[i].members[j])); + relation rel = rpmteTSI(member)->tsi_forward_relations; + for (; rel != NULL; rel=rel->rel_next) { + if (rpmteTSI(rel->rel_suc)->tsi_SccIdx!=i) continue; + rpmlog(msglvl, "\t\t%s %s\n", + rel->rel_flags ? "=>" : "->", + rpmteNEVRA(rel->rel_suc)); + } +#endif /* REFERENCE */ + } + } + } + + return sd.SCCs; +} + +#ifdef REFERENCE +static void collectTE(rpm_color_t prefcolor, tsortInfo q, + rpmte * newOrder, int * newOrderCount, + scc SCCs, + tsortInfo * queue_end, + tsortInfo * outer_queue, + tsortInfo * outer_queue_end) +{ + char deptypechar = (rpmteType(q->te) == TR_REMOVED ? '-' : '+'); + + if (rpmIsDebug()) { + int depth = 1; + /* figure depth in tree for nice formatting */ + for (rpmte p = q->te; (p = rpmteParent(p)); depth++) {} + rpmlog(RPMLOG_DEBUG, "%5d%5d%5d%5d %*s%c%s\n", + *newOrderCount, q->tsi_count, q->tsi_qcnt, + depth, (2 * depth), "", + deptypechar, rpmteNEVRA(q->te)); + } + + newOrder[*newOrderCount] = q->te; + (*newOrderCount)++; + + /* T6. Erase relations. */ + for (relation rel = q->tsi_relations; rel != NULL; rel = rel->rel_next) { + tsortInfo p = rel->rel_suc; + /* ignore already collected packages */ + if (p->tsi_SccIdx == 0) continue; + if (p == q) continue; + + if (p && (--p->tsi_count) == 0) { + (void) rpmteSetParent(p->te, q->te); + + if (q->tsi_SccIdx > 1 && q->tsi_SccIdx != p->tsi_SccIdx) { + /* Relation point outside of this SCC: add to outside queue */ + assert(outer_queue != NULL && outer_queue_end != NULL); + addQ(p, outer_queue, outer_queue_end, prefcolor); + } else { + addQ(p, &q->tsi_suc, queue_end, prefcolor); + } + } + if (p && p->tsi_SccIdx > 1 && + p->tsi_SccIdx != q->tsi_SccIdx) { + if (--SCCs[p->tsi_SccIdx].count == 0) { + /* New SCC is ready, add this package as representative */ + (void) rpmteSetParent(p->te, q->te); + + if (outer_queue != NULL) { + addQ(p, outer_queue, outer_queue_end, prefcolor); + } else { + addQ(p, &q->tsi_suc, queue_end, prefcolor); + } + } + } + } + q->tsi_SccIdx = 0; +} +#endif /* REFERENCE */ + +static void collectTE(rpm_color_t prefcolor, rpmte q, + rpmte * newOrder, int * newOrderCount, + scc SCCs, + rpmte * queue_end, + rpmte * outer_queue, + rpmte * outer_queue_end) +{ + int treex = rpmteTree(q); + int depth = rpmteDepth(q); + char deptypechar = (rpmteType(q) == TR_REMOVED ? '-' : '+'); + tsortInfo tsi = rpmteTSI(q); + relation rel; + + rpmlog(RPMLOG_DEBUG, "%5d%5d%5d%5d%5d %*s%c%s\n", + *newOrderCount, rpmteNpreds(q), + rpmteTSI(q)->tsi_qcnt, + treex, depth, + (2 * depth), "", + deptypechar, + (rpmteNEVRA(q) ? rpmteNEVRA(q) : "???")); + + (void) rpmteSetDegree(q, 0); + + newOrder[*newOrderCount] = q; + (*newOrderCount)++; + + /* T6. Erase relations. */ + for (rel = rpmteTSI(q)->tsi_relations; rel != NULL; rel = rel->rel_next) { + rpmte p = rel->rel_suc; + tsortInfo p_tsi = rpmteTSI(p); + + /* ignore already collected packages */ + if (p_tsi->tsi_SccIdx == 0) continue; + if (p == q) continue; + + if (p && (--p_tsi->tsi_count) == 0) { + + (void) rpmteSetTree(p, treex); + (void) rpmteSetDepth(p, depth+1); + (void) rpmteSetParent(p, q); + (void) rpmteSetDegree(q, rpmteDegree(q)+1); + + if (tsi->tsi_SccIdx > 1 && tsi->tsi_SccIdx != p_tsi->tsi_SccIdx) { + /* Relation point outside of this SCC: add to outside queue */ + assert(outer_queue != NULL && outer_queue_end != NULL); + addQ(p, outer_queue, outer_queue_end, prefcolor); + } else { + addQ(p, &tsi->tsi_suc, queue_end, prefcolor); + } + } + if (p && p_tsi->tsi_SccIdx > 1 && + p_tsi->tsi_SccIdx != rpmteTSI(q)->tsi_SccIdx) { + if (--SCCs[p_tsi->tsi_SccIdx].count == 0) { + /* New SCC is ready, add this package as representative */ + + (void) rpmteSetTree(p, treex); + (void) rpmteSetDepth(p, depth+1); + (void) rpmteSetParent(p, q); + (void) rpmteSetDegree(q, rpmteDegree(q)+1); + + if (outer_queue != NULL) { + addQ(p, outer_queue, outer_queue_end, prefcolor); + } else { + addQ(p, &rpmteTSI(q)->tsi_suc, queue_end, prefcolor); + } + } + } + } + tsi->tsi_SccIdx = 0; +} + +#ifdef REFERENCE +static void collectSCC(rpm_color_t prefcolor, tsortInfo p_tsi, + rpmte * newOrder, int * newOrderCount, + scc SCCs, tsortInfo * queue_end) +{ + int sccNr = p_tsi->tsi_SccIdx; + struct scc_s SCC = SCCs[sccNr]; + int i; + int start, end; + relation rel; + + /* remove p from the outer queue */ + tsortInfo outer_queue_start = p_tsi->tsi_suc; + p_tsi->tsi_suc = NULL; + + /* + * Run a multi source Dijkstra's algorithm to find relations + * that can be zapped with least danger to pre reqs. + * As weight of the edges is always 1 it is not necessary to + * sort the vertices by distance as the queue gets them + * already in order + */ + + /* can use a simple queue as edge weights are always 1 */ + tsortInfo * queue = (tsortInfo *) xmalloc((SCC.size+1) * sizeof(*queue)); + + /* + * Find packages that are prerequired and use them as + * starting points for the Dijkstra algorithm + */ + start = end = 0; + for (i = 0; i < SCC.size; i++) { + tsortInfo tsi = SCC.members[i]; + tsi->tsi_SccLowlink = INT_MAX; + for (rel=tsi->tsi_forward_relations; rel != NULL; rel=rel->rel_next) { + if (rel->rel_flags && rel->rel_suc->tsi_SccIdx == sccNr) { + if (rel->rel_suc != tsi) { + tsi->tsi_SccLowlink = 0; + queue[end++] = tsi; + } else { + tsi->tsi_SccLowlink = INT_MAX/2; + } + break; + } + } + } + + if (start == end) { /* no regular prereqs; add self prereqs to queue */ + for (i = 0; i < SCC.size; i++) { + tsortInfo tsi = SCC.members[i]; + if (tsi->tsi_SccLowlink != INT_MAX) { + queue[end++] = tsi; + } + } + } + + /* Do Dijkstra */ + while (start != end) { + tsortInfo tsi = queue[start++]; + for (rel=tsi->tsi_forward_relations; rel != NULL; rel=rel->rel_next) { + tsortInfo next_tsi = rel->rel_suc; + if (next_tsi->tsi_SccIdx != sccNr) continue; + if (next_tsi->tsi_SccLowlink > tsi->tsi_SccLowlink+1) { + next_tsi->tsi_SccLowlink = tsi->tsi_SccLowlink + 1; + queue[end++] = rel->rel_suc; + } + } + } + queue = _free(queue); + + + while (1) { + tsortInfo best = NULL; + tsortInfo inner_queue_start, inner_queue_end; + int best_score = 0; + + /* select best candidate to start with */ + for (int i = 0; i < SCC.size; i++) { + tsortInfo tsi = SCC.members[i]; + if (tsi->tsi_SccIdx == 0) /* package already collected */ + continue; + if (tsi->tsi_SccLowlink >= best_score) { + best = tsi; + best_score = tsi->tsi_SccLowlink; + } + } + + if (best == NULL) /* done */ + break; + + /* collect best candidate and all packages that get freed */ + inner_queue_start = inner_queue_end = NULL; + addQ(best, &inner_queue_start, &inner_queue_end, prefcolor); + + for (; inner_queue_start != NULL; + inner_queue_start = inner_queue_start->tsi_suc) { + /* Mark the package as unqueued. */ + inner_queue_start->tsi_reqx = 0; + collectTE(prefcolor, inner_queue_start, newOrder, newOrderCount, + SCCs, &inner_queue_end, &outer_queue_start, queue_end); + } + } + + /* restore outer queue */ + p_tsi->tsi_suc = outer_queue_start; +} +#endif /* REFERENCE */ + +static void collectSCC(rpm_color_t prefcolor, rpmte p, + rpmte * newOrder, int * newOrderCount, + scc SCCs, rpmte * queue_end) +{ + int sccNr = rpmteTSI(p)->tsi_SccIdx; + struct scc_s SCC = SCCs[sccNr]; + int i; + int start, end; + relation rel; + + /* remove p from the outer queue */ + rpmte outer_queue_start = rpmteTSI(p)->tsi_suc; + rpmteTSI(p)->tsi_suc = NULL; + + /* + * Run a multi source Dijkstra's algorithm to find relations + * that can be zapped with least danger to pre reqs. + * As weight of the edges is always 1 it is not necessary to + * sort the vertices by distance as the queue gets them + * already in order + */ + + /* can use a simple queue as edge weights are always 1 */ + rpmte * queue = (rpmte *) xmalloc((SCC.size+1) * sizeof(rpmte)); + + /* + * Find packages that are prerequired and use them as + * starting points for the Dijkstra algorithm + */ + start = end = 0; + for (i = 0; i < SCC.size; i++) { + rpmte q = SCC.members[i]; + tsortInfo tsi = rpmteTSI(q); + tsi->tsi_SccLowlink = INT_MAX; + for (rel=tsi->tsi_forward_relations; rel != NULL; rel=rel->rel_next) { + if (rel->rel_flags && rpmteTSI(rel->rel_suc)->tsi_SccIdx == sccNr) { + if (rel->rel_suc != q) { + tsi->tsi_SccLowlink = 0; + queue[end++] = q; + } else { + tsi->tsi_SccLowlink = INT_MAX/2; + } + break; + } + } + } + + if (start == end) { /* no regular prereqs; add self prereqs to queue */ + for (i = 0; i < SCC.size; i++) { + rpmte q = SCC.members[i]; + tsortInfo tsi = rpmteTSI(q); + if (tsi->tsi_SccLowlink != INT_MAX) { + queue[end++] = q; + } + } + } + + /* Do Dijkstra */ + while (start != end) { + rpmte q = queue[start++]; + tsortInfo tsi = rpmteTSI(q); + for (rel=tsi->tsi_forward_relations; rel != NULL; rel=rel->rel_next) { + tsortInfo next_tsi = rpmteTSI(rel->rel_suc); + if (next_tsi->tsi_SccIdx != sccNr) continue; + if (next_tsi->tsi_SccLowlink > tsi->tsi_SccLowlink+1) { + next_tsi->tsi_SccLowlink = tsi->tsi_SccLowlink + 1; + queue[end++] = rel->rel_suc; + } + } + } + queue = _free(queue); + + + while (1) { + rpmte best = NULL; + rpmte inner_queue_start, inner_queue_end; + int best_score = 0; + int i; + + /* select best candidate to start with */ + for (i = 0; i < SCC.size; i++) { + rpmte q = SCC.members[i]; + tsortInfo tsi = rpmteTSI(q); + if (tsi->tsi_SccIdx == 0) /* package already collected */ + continue; + if (tsi->tsi_SccLowlink >= best_score) { + best = q; + best_score = tsi->tsi_SccLowlink; + } + } + + if (best == NULL) /* done */ + break; + + /* collect best candidate and all packages that get freed */ + inner_queue_start = inner_queue_end = NULL; + addQ(best, &inner_queue_start, &inner_queue_end, prefcolor); + + for (; inner_queue_start != NULL; + inner_queue_start = rpmteTSI(inner_queue_start)->tsi_suc) { + /* Mark the package as unqueued. */ + rpmteTSI(inner_queue_start)->tsi_reqx = 0; + collectTE(prefcolor, inner_queue_start, newOrder, newOrderCount, + SCCs, &inner_queue_end, &outer_queue_start, queue_end); + } + } + + /* restore outer queue */ + rpmteTSI(p)->tsi_suc = outer_queue_start; +} + +#ifdef REFERENCE +int rpmtsOrder(rpmts ts) +{ + tsMembers tsmem = rpmtsMembers(ts); + rpm_color_t prefcolor = rpmtsPrefColor(ts); + rpmtsi pi; rpmte p; + tsortInfo q, r; + rpmte * newOrder; + int newOrderCount = 0; + int rc; + rpmal erasedPackages = rpmalCreate(5, rpmtsColor(ts), prefcolor); + scc SCCs; + int nelem = rpmtsNElements(ts); + tsortInfo sortInfo = (tsortInfo) xcalloc(nelem, sizeof(struct tsortInfo_s)); + + (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_ORDER), 0); + + /* Create erased package index. */ + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, TR_REMOVED)) != NULL) { + rpmalAdd(erasedPackages, p); + } + pi = rpmtsiFree(pi); + + for (int i = 0; i < nelem; i++) { + sortInfo[i].te = tsmem->order[i]; + rpmteSetTSI(tsmem->order[i], &sortInfo[i]); + } + + /* Record relations. */ + rpmlog(RPMLOG_DEBUG, "========== recording tsort relations\n"); + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, 0)) != NULL) { + rpmal al = (rpmteType(p) == TR_REMOVED) ? + erasedPackages : tsmem->addedPackages; + rpmds requires = rpmdsInit(rpmteDS(p, RPMTAG_REQUIRENAME)); + + while (rpmdsNext(requires) >= 0) { + /* Record next "q <- p" relation (i.e. "p" requires "q"). */ + (void) addRelation(ts, al, p, requires); + } + } + pi = rpmtsiFree(pi); + + newOrder = (rpmte *) xcalloc(tsmem->orderCount, sizeof(*newOrder)); + SCCs = detectSCCs(sortInfo, nelem, (rpmtsFlags(ts) & RPMTRANS_FLAG_DEPLOOPS)); + + rpmlog(RPMLOG_DEBUG, "========== tsorting packages (order, #predecessors, #succesors, depth)\n"); + + for (int i = 0; i < 2; i++) { + /* Do two separate runs: installs first - then erases */ + int oType = !i ? TR_ADDED : TR_REMOVED; + q = r = NULL; + /* Scan for zeroes and add them to the queue */ + for (int e = 0; e < nelem; e++) { + tsortInfo p = &sortInfo[e]; + if (rpmteType(p->te) != oType) continue; + if (p->tsi_count != 0) + continue; + p->tsi_suc = NULL; + addQ(p, &q, &r, prefcolor); + } + + /* Add one member of each leaf SCC */ + for (int i = 2; SCCs[i].members != NULL; i++) { + tsortInfo member = SCCs[i].members[0]; + if (SCCs[i].count == 0 && rpmteType(member->te) == oType) { + addQ(member, &q, &r, prefcolor); + } + } + + while (q != NULL) { + /* Mark the package as unqueued. */ + q->tsi_reqx = 0; + if (q->tsi_SccIdx > 1) { + collectSCC(prefcolor, q, newOrder, &newOrderCount, SCCs, &r); + } else { + collectTE(prefcolor, q, newOrder, &newOrderCount, SCCs, &r, + NULL, NULL); + } + q = q->tsi_suc; + } + } + + /* Clean up tsort data */ + for (int i = 0; i < nelem; i++) { + rpmteSetTSI(tsmem->order[i], NULL); + rpmTSIFree(&sortInfo[i]); + } + free(sortInfo); + + assert(newOrderCount == tsmem->orderCount); + + tsmem->order = _free(tsmem->order); + tsmem->order = newOrder; + tsmem->orderAlloced = tsmem->orderCount; + rc = 0; + + freeBadDeps(); + + for (int i = 2; SCCs[i].members != NULL; i++) { + free(SCCs[i].members); + } + free(SCCs); + rpmalFree(erasedPackages); + + (void) rpmswExit(rpmtsOp(ts, RPMTS_OP_ORDER), 0); + + return rc; +} +#endif /* REFERENCE */ + +int _orgrpmtsOrder(rpmts ts) +{ + rpm_color_t prefcolor = rpmtsPrefColor(ts); + rpmtsi pi; rpmte p; + rpmte q; + rpmte r; + rpmte * newOrder; + int newOrderCount = 0; + int treex; + int rc; +#ifdef REFERENCE + rpmal erasedPackages = rpmalCreate(5, rpmtsColor(ts), prefcolor); +#endif + scc SCCs; + int j; + int i; + + (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_ORDER), 0); + + /* + * XXX FIXME: this gets needlesly called twice on normal usage patterns, + * should track the need for generating the index somewhere + */ + rpmalMakeIndex(ts->addedPackages); + + /* Create erased package index. */ + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, TR_REMOVED)) != NULL) { +#ifdef REFERENCE + rpmalAdd(ts->erasedPackages, p); +#else + alKey pkgKey; + fnpyKey key; + rpmuint32_t tscolor = rpmtsColor(ts); + pkgKey = RPMAL_NOMATCH; +/*@-abstract@*/ + key = (fnpyKey) p; +/*@=abstract@*/ + pkgKey = rpmalAdd(&ts->erasedPackages, pkgKey, key, + rpmteDS(p, RPMTAG_PROVIDENAME), + rpmteFI(p, RPMTAG_BASENAMES), tscolor); + /* XXX pretend erasedPackages are just appended to addedPackages. */ + pkgKey = (alKey)(((long)pkgKey) + ts->numAddedPackages); + (void) rpmteSetAddedKey(p, pkgKey); +#endif + } + pi = rpmtsiFree(pi); + rpmalMakeIndex(ts->erasedPackages); + + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, 0)) != NULL) + rpmteNewTSI(p); + pi = rpmtsiFree(pi); + + /* Record relations. */ + rpmlog(RPMLOG_DEBUG, "========== recording tsort relations\n"); + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, 0)) != NULL) { + rpmal al = (rpmteType(p) == TR_REMOVED) ? + ts->erasedPackages : ts->addedPackages; + rpmds requires = rpmdsInit(rpmteDS(p, RPMTAG_REQUIRENAME)); + + while (rpmdsNext(requires) >= 0) { + /* Record next "q <- p" relation (i.e. "p" requires "q"). */ + (void) orgrpmAddRelation(ts, al, p, requires); + } + +#ifdef NOTYET + /* Ensure that erasures follow installs during upgrades. */ + if (rpmteType(p) == TR_REMOVED && p->flink.Pkgid && p->flink.Pkgid[0]) { + rpmtsi qi; + + qi = rpmtsiInit(ts); + while ((q = rpmtsiNext(qi, TR_ADDED)) != NULL) { + + if (strcmp(q->pkgid, p->flink.Pkgid[0])) + /*@innercontinue@*/ continue; + + requires = rpmdsFromPRCO(q->PRCO, RPMTAG_NAME); + if (requires != NULL) { + /* XXX disable erased arrow reversal. */ + p->type = TR_ADDED; + (void) orgrpmAddRelation(ts, ts->addedPackages, p, requires); + p->type = TR_REMOVED; + } + } + qi = rpmtsiFree(qi); + } +#endif /* NOTYET */ + +#ifdef NOTYET + /* Order by requiring parent directories as prerequisites. */ + requires = rpmdsInit(rpmteDS(p, RPMTAG_DIRNAMES)); + if (requires != NULL) + while (rpmdsNext(requires) >= 0) { + +#ifdef DYING + /* XXX Attempt to avoid loops by filtering out deep paths. */ + if (countSlashes(rpmdsN(requires)) > slashDepth) + /*@innercontinue@*/ continue; +#endif + + /* T3. Record next "q <- p" relation (i.e. "p" requires "q"). */ + (void) orgrpmAddRelation(ts, al, p, requires); + + } +#endif /* NOTYET */ + +#ifdef NOTYET + /* Order by requiring no dangling symlinks. */ + requires = rpmdsInit(rpmteDS(p, RPMTAG_FILELINKTOS)); + if (requires != NULL) + while (rpmdsNext(requires) >= 0) { + + /* T3. Record next "q <- p" relation (i.e. "p" requires "q"). */ + (void) orgrpmAddRelation(ts, al, p, requires); + + } +#endif /* NOTYET */ + + } + pi = rpmtsiFree(pi); + + /* Save predecessor count and mark tree roots. */ + treex = 0; + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, 0)) != NULL) { + int npreds = rpmteTSI(p)->tsi_count; + + (void) rpmteSetNpreds(p, npreds); + (void) rpmteSetDepth(p, 1); + + if (npreds == 0) + (void) rpmteSetTree(p, treex++); + else + (void) rpmteSetTree(p, -1); + } + pi = rpmtsiFree(pi); + ts->ntrees = treex; + + newOrder = (rpmte *) xcalloc(ts->orderCount, sizeof(*newOrder)); + SCCs = detectSCCs(ts); + + rpmlog(RPMLOG_DEBUG, "========== tsorting packages (order, #predecessors, #succesors, tree, depth)\n"); + + for (j = 0; j < 2; j++) { + /* Do two separate runs: installs first - then erases */ + unsigned oType = (j == 0 ? TR_ADDED : TR_REMOVED); + q = r = NULL; + pi = rpmtsiInit(ts); + /* Scan for zeroes and add them to the queue */ + while ((p = rpmtsiNext(pi, oType)) != NULL) { + if (rpmteTSI(p)->tsi_count != 0) + continue; + rpmteTSI(p)->tsi_suc = NULL; + addQ(p, &q, &r, prefcolor); + } + pi = rpmtsiFree(pi); + + /* Add one member of each leaf SCC */ + for (i = 2; SCCs[i].members != NULL; i++) { + if (SCCs[i].count == 0 && rpmteType(SCCs[i].members[0]) == oType) { + p = SCCs[i].members[0]; + rpmteTSI(p)->tsi_suc = NULL; + addQ(p, &q, &r, prefcolor); + } + } + + /* Process queue */ + for (; q != NULL; q = rpmteTSI(q)->tsi_suc) { + /* Mark the package as unqueued. */ + rpmteTSI(q)->tsi_reqx = 0; + if (rpmteTSI(q)->tsi_SccIdx > 1) { + collectSCC(prefcolor, q, newOrder, &newOrderCount, SCCs, &r); + } else { + collectTE(prefcolor, q, newOrder, &newOrderCount, SCCs, &r, + NULL, NULL); + } + } + } + + /* Clean up tsort data */ + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, 0)) != NULL) + rpmteFreeTSI(p); + pi = rpmtsiFree(pi); + + assert(newOrderCount == ts->orderCount); + + ts->order = _free(ts->order); + ts->order = newOrder; + ts->orderAlloced = ts->orderCount; + rc = 0; + + for (i = 2; SCCs[i].members != NULL; i++) + SCCs[i].members = _free(SCCs[i].members); + SCCs = _free(SCCs); + +#ifdef DYING + rpmalFree(ts->erasedPackages); + ts->erasedPackages = NULL; +#endif + freeBadDeps(); + + (void) rpmswExit(rpmtsOp(ts, RPMTS_OP_ORDER), 0); + + return rc; +} + +int _rpmtsOrder(rpmts ts) +{ + rpmds requires; + rpmuint32_t Flags; + + rpmuint32_t prefcolor = rpmtsPrefColor(ts); + rpmtsi pi; rpmte p; + rpmtsi qi; rpmte q; + rpmtsi ri; rpmte r; + rpmte * newOrder; + int newOrderCount = 0; + int treex; + int rc = -1; /* assume failure */ + int i; + int j; + + rpmal al; + +#ifdef REFERENCE + rpmal erasedPackages = rpmalCreate(5, rpmtsColor(ts), prefcolor); + scc SCCs; +#else /* REFERENCE */ + rpmuint32_t tscolor = rpmtsColor(ts); + int anaconda = rpmtsDFlags(ts) & RPMDEPS_FLAG_ANACONDA; + + tsortInfo tsi; + tsortInfo tsi_next; + alKey * ordering; + int orderingCount = 0; + + unsigned char * selected = (unsigned char *) alloca(sizeof(*selected) * (ts->orderCount + 1)); + int loopcheck; + orderListIndex orderList; + int numOrderList; + int npeer = 128; /* XXX more than deep enough for now. */ + int * peer = (int *) memset(alloca(npeer*sizeof(*peer)), 0, (npeer*sizeof(*peer))); + int nrescans = 100; + int _printed = 0; + char deptypechar; + size_t tsbytes = 0; + int oType = 0; + int depth; + int breadth; + int qlen; +#endif /* REFERENCE */ + +if (_rpmts_debug) +fprintf(stderr, "--> %s(%p) tsFlags 0x%x\n", __FUNCTION__, ts, rpmtsFlags(ts)); + + (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_ORDER), 0); + + /* Create added package index. */ +#ifdef REFERENCE + rpmalMakeIndex(ts->addedPackages); +#else +#endif + + /* Create erased package index. */ + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, TR_REMOVED)) != NULL) { +#ifdef REFERENCE + rpmalAdd(ts->erasedPackages, p); +#else +/*@-abstract@*/ + fnpyKey key = (fnpyKey) p; +/*@=abstract@*/ + alKey pkgKey = RPMAL_NOMATCH; + + pkgKey = rpmalAdd(&ts->erasedPackages, pkgKey, key, + rpmteDS(p, RPMTAG_PROVIDENAME), + rpmteFI(p, RPMTAG_BASENAMES), tscolor); + /* XXX pretend erasedPackages are just appended to addedPackages. */ + pkgKey = (alKey)(((long)pkgKey) + ts->numAddedPackages); + (void) rpmteSetAddedKey(p, pkgKey); +#endif + } + pi = rpmtsiFree(pi); + rpmalMakeIndex(ts->erasedPackages); + + /* T1. Initialize. */ +#ifdef REFERENCE +#else + if (oType == 0) + numOrderList = ts->orderCount; + else { + numOrderList = 0; + if (oType & TR_ADDED) + numOrderList += ts->numAddedPackages; + if (oType & TR_REMOVED) + numOrderList += ts->numRemovedPackages; + } + ordering = (alKey *) alloca(sizeof(*ordering) * (numOrderList + 1)); + loopcheck = numOrderList; +#endif + + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, oType)) != NULL) + rpmteNewTSI(p); + pi = rpmtsiFree(pi); + + /* Record all relations. */ + rpmlog(RPMLOG_DEBUG, D_("========== recording tsort relations\n")); + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, oType)) != NULL) { + al = (rpmteType(p) == TR_ADDED ? ts->addedPackages : ts->erasedPackages); + + /* T2. Next "q <- p" relation. */ + +#ifdef REFERENCE +#else + memset(selected, 0, sizeof(*selected) * ts->orderCount); + + /* Avoid narcisstic relations. */ + selected[rpmtsiOc(pi)] = 1; +#endif + + requires = rpmteDS(p, RPMTAG_REQUIRENAME); + requires = rpmdsInit(requires); + if (requires != NULL) + while (rpmdsNext(requires) >= 0) { + + Flags = rpmdsFlags(requires); + if (!isAuto(Flags)) + /*@innercontinue@*/ continue; + + /* T3. Record next "q <- p" relation (i.e. "p" requires "q"). */ +#ifdef REFERENCE + (void) orgrpmAddRelation(ts, al, p, requires); +#else + (void) addRelation(ts, al, p, selected, requires); +#endif + + } + +#ifdef REFERENCE +#else /* REFERENCE */ + /* Ensure that erasures follow installs during upgrades. */ + if (rpmteType(p) == TR_REMOVED && p->flink.Pkgid && p->flink.Pkgid[0]) { + + qi = rpmtsiInit(ts); + while ((q = rpmtsiNext(qi, TR_ADDED)) != NULL) { + + if (strcmp(q->pkgid, p->flink.Pkgid[0])) + /*@innercontinue@*/ continue; + + requires = rpmdsFromPRCO(q->PRCO, RPMTAG_NAME); + if (requires != NULL) { + /* XXX disable erased arrow reversal. */ + p->type = TR_ADDED; +#ifdef REFERENCE + (void) orgrpmAddRelation(ts, ts->addedPackages, p, requires); +#else + (void) addRelation(ts, ts->addedPackages, p, selected, requires); +#endif + p->type = TR_REMOVED; + } + } + qi = rpmtsiFree(qi); + } + + /* Order by requiring parent directories as prerequisites. */ + requires = rpmdsInit(rpmteDS(p, RPMTAG_DIRNAMES)); + if (requires != NULL) + while (rpmdsNext(requires) >= 0) { + + /* T3. Record next "q <- p" relation (i.e. "p" requires "q"). */ +#ifdef REFERENCE + (void) orgrpmAddRelation(ts, al, p, requires); +#else + (void) addRelation(ts, al, p, selected, requires); +#endif + + } + + /* Order by requiring no dangling symlinks. */ + requires = rpmdsInit(rpmteDS(p, RPMTAG_FILELINKTOS)); + if (requires != NULL) + while (rpmdsNext(requires) >= 0) { + + /* T3. Record next "q <- p" relation (i.e. "p" requires "q"). */ +#ifdef REFERENCE + (void) orgrpmAddRelation(ts, al, p, requires); +#else + (void) addRelation(ts, al, p, selected, requires); +#endif + + } +#endif /* REFERENCE */ + } + pi = rpmtsiFree(pi); + + /* Save predecessor count and mark tree roots. */ + treex = 0; + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, oType)) != NULL) { + int npreds = rpmteTSI(p)->tsi_count; + + (void) rpmteSetNpreds(p, npreds); +#ifdef REFERENCE + (void) rpmteSetDepth(p, 1); +#else + (void) rpmteSetDepth(p, 0); +#endif + + if (npreds == 0) { +#ifdef REFERENCE + (void) rpmteSetTree(p, treex++); +#else + (void) rpmteSetTree(p, ++treex); + (void) rpmteSetBreadth(p, treex); +#endif + } else + (void) rpmteSetTree(p, -1); +#ifdef UNNECESSARY + (void) rpmteSetParent(p, NULL); +#endif + + } + pi = rpmtsiFree(pi); + ts->ntrees = treex; + +#ifdef REFERENCE + /* Remove dependency loops. */ + newOrder = (rpmte *) xcalloc(ts->orderCount, sizeof(*newOrder)); + SCCs = detectSCCs(ts); +#endif + + /* T4. Scan for zeroes. */ + rpmlog(RPMLOG_DEBUG, D_("========== tsorting packages (order, #predecessors, #succesors, tree, Ldepth, Rbreadth)\n")); + +#ifdef REFERENCE + for (j = 0; j < 2; j++) { + /* Do two separate runs: installs first - then erases */ + unsigned oType = (j == 0 ? TR_ADDED : TR_REMOVED); + +#else +rescan: + if (pi != NULL) pi = rpmtsiFree(pi); +#endif + q = r = NULL; + qlen = 0; + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, oType)) != NULL) { + + /* Prefer packages in chainsaw or anaconda presentation order. */ + if (anaconda) + rpmteTSI(p)->tsi_qcnt = (ts->orderCount - rpmtsiOc(pi)); + + if (rpmteTSI(p)->tsi_count != 0) + continue; + + /* Mark the package as queued. */ + rpmteTSI(p)->tsi_queued = orderingCount + 1; + rpmteTSI(p)->tsi_suc = NULL; + addQ(p, &q, &r, prefcolor); + qlen++; + } + pi = rpmtsiFree(pi); + + /* T5. Output front of queue (T7. Remove from queue.) */ + for (; q != NULL; q = rpmteTSI(q)->tsi_suc) { + + /* Mark the package as unqueued. */ + rpmteTSI(q)->tsi_queued = 0; + + if (oType != 0) + switch (rpmteType(q)) { + case TR_ADDED: + if (!(oType & TR_ADDED)) + continue; + /*@switchbreak@*/ break; + case TR_REMOVED: + if (!(oType & TR_REMOVED)) + continue; + /*@switchbreak@*/ break; + default: + continue; + /*@notreached@*/ /*@switchbreak@*/ break; + } + deptypechar = (rpmteType(q) == TR_REMOVED ? '-' : '+'); + + treex = rpmteTree(q); + depth = rpmteDepth(q); + breadth = ((depth < npeer) ? peer[depth]++ : 0); + (void) rpmteSetBreadth(q, breadth); + + rpmlog(RPMLOG_DEBUG, "%5d%5d%5d%5d%5d%5d %*s%c%s\n", + orderingCount, rpmteNpreds(q), + rpmteTSI(q)->tsi_qcnt, + treex, depth, breadth, + (2 * depth), "", + deptypechar, + (rpmteNEVRA(q) ? rpmteNEVRA(q) : "???")); + + (void) rpmteSetDegree(q, 0); + tsbytes += rpmtePkgFileSize(q); + + ordering[orderingCount] = rpmteAddedKey(q); + orderingCount++; + qlen--; + loopcheck--; + + /* T6. Erase relations. */ + tsi_next = rpmteTSI(q)->tsi_next; + rpmteTSI(q)->tsi_next = NULL; + while ((tsi = tsi_next) != NULL) { + tsi_next = tsi->tsi_next; + tsi->tsi_next = NULL; + p = tsi->tsi_suc; + if (p && (--rpmteTSI(p)->tsi_count) <= 0) { + + (void) rpmteSetTree(p, treex); + (void) rpmteSetDepth(p, depth+1); + (void) rpmteSetParent(p, q); + (void) rpmteSetDegree(q, rpmteDegree(q)+1); + + /* Mark the package as queued. */ + rpmteTSI(p)->tsi_queued = orderingCount + 1; + /* XXX TODO: add control bit. */ + rpmteTSI(p)->tsi_suc = NULL; +/*@-nullstate@*/ /* XXX FIX: rpmteTSI(q)->tsi_suc can be NULL. */ + addQ(p, &rpmteTSI(q)->tsi_suc, &r, prefcolor); +/*@=nullstate@*/ + qlen++; + } + tsi = _free(tsi); + } + if (!_printed && loopcheck == qlen && rpmteTSI(q)->tsi_suc != NULL) { + _printed++; + (void) rpmtsUnorderedSuccessors(ts, orderingCount); + rpmlog(RPMLOG_DEBUG, + D_("========== successors only (%d bytes)\n"), (int)tsbytes); + + /* Relink the queue in presentation order. */ + tsi = rpmteTSI(q); + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, oType)) != NULL) { + /* Is this element in the queue? */ + if (rpmteTSI(p)->tsi_queued == 0) + /*@innercontinue@*/ continue; + tsi->tsi_suc = p; + tsi = rpmteTSI(p); + } + pi = rpmtsiFree(pi); + tsi->tsi_suc = NULL; + } + } +#ifdef REFERENCE + } +#else /* REFERENCE */ + /* T8. End of process. Check for loops. */ + if (loopcheck != 0) { + int nzaps; + + /* T9. Initialize predecessor chain. */ + nzaps = 0; + qi = rpmtsiInit(ts); + while ((q = rpmtsiNext(qi, oType)) != NULL) { + rpmteTSI(q)->tsi_chain = NULL; + rpmteTSI(q)->tsi_queued = 0; + /* Mark packages already sorted. */ + if (rpmteTSI(q)->tsi_count == 0) + rpmteTSI(q)->tsi_count = -1; + } + qi = rpmtsiFree(qi); + + /* T10. Mark all packages with their predecessors. */ + qi = rpmtsiInit(ts); + while ((q = rpmtsiNext(qi, oType)) != NULL) { + if ((tsi = rpmteTSI(q)->tsi_next) == NULL) + continue; + rpmteTSI(q)->tsi_next = NULL; + markLoop(tsi, q); + rpmteTSI(q)->tsi_next = tsi; + } + qi = rpmtsiFree(qi); + + /* T11. Print all dependency loops. */ + ri = rpmtsiInit(ts); + while ((r = rpmtsiNext(ri, oType)) != NULL) + { + int printed; + + printed = 0; + + /* T12. Mark predecessor chain, looking for start of loop. */ + for (q = rpmteTSI(r)->tsi_chain; q != NULL; + q = rpmteTSI(q)->tsi_chain) + { + if (rpmteTSI(q)->tsi_queued) + /*@innerbreak@*/ break; + rpmteTSI(q)->tsi_queued = 1; + } + + /* T13. Print predecessor chain from start of loop. */ + while ((p = q) != NULL && (q = rpmteTSI(p)->tsi_chain) != NULL) { +#if 0 + const char * nevra; +#endif + const char * dp; + rpmlogLvl msglvl = (anaconda || (rpmtsDFlags(ts) & RPMDEPS_FLAG_DEPLOOPS)) + ? RPMLOG_WARNING : RPMLOG_ERR; +#if defined(RPM_VENDOR_MANDRIVA) /* loop-detection-optional-loglevel */ + // Report loops as debug-level message by default (7 = RPMLOG_DEBUG), overridable + msglvl = rpmExpandNumeric("%{?_loop_detection_loglevel}%{?!_loop_detection_loglevel:7}"); +#endif + + /* Unchain predecessor loop. */ + rpmteTSI(p)->tsi_chain = NULL; + + if (!printed) { + rpmlog(msglvl, _("LOOP:\n")); + printed = 1; + } + + /* Find (and destroy if co-requisite) "q <- p" relation. */ + dp = zapRelation(q, p, 1, &nzaps, msglvl); + +#if 0 + /* Print next member of loop. */ + nevra = rpmteNEVRA(p); + rpmlog(msglvl, " %-40s %s\n", (nevra ? nevra : "???"), + (dp ? dp : "not found!?!")); +#endif + + dp = _free(dp); + } + + /* Walk (and erase) linear part of predecessor chain as well. */ + for (p = r, q = rpmteTSI(r)->tsi_chain; q != NULL; + p = q, q = rpmteTSI(q)->tsi_chain) + { + /* Unchain linear part of predecessor loop. */ + rpmteTSI(p)->tsi_chain = NULL; + rpmteTSI(p)->tsi_queued = 0; + } + } + ri = rpmtsiFree(ri); + + /* If a relation was eliminated, then continue sorting. */ + /* XXX TODO: add control bit. */ + if (nzaps && nrescans-- > 0) { + rpmlog(RPMLOG_DEBUG, D_("========== continuing tsort ...\n")); + goto rescan; + } + + /* Return no. of packages that could not be ordered. */ + rpmlog(RPMLOG_ERR, _("rpmtsOrder failed, %d elements remain\n"), + loopcheck); + +#ifdef NOTYET + /* Do autorollback goal since we could not sort this transaction properly. */ + (void) rpmtsRollback(ts, RPMPROB_FILTER_NONE, 0, NULL); +#endif + + return loopcheck; + } +#endif /* REFERENCE */ + + /* Clean up tsort remnants (if any). */ + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, 0)) != NULL) + rpmteFreeTSI(p); + pi = rpmtsiFree(pi); + +#ifdef REFERENCE +#else /* REFERENCE */ + /* The order ends up as installed packages followed by removed packages. */ + orderList = (orderListIndex) xcalloc(numOrderList, sizeof(*orderList)); + j = 0; + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, oType)) != NULL) { + /* Prepare added/erased package ordering permutation. */ + orderList[j].pkgKey = rpmteAddedKey(p); + orderList[j].orIndex = rpmtsiOc(pi); + j++; + } + pi = rpmtsiFree(pi); + + qsort(orderList, numOrderList, sizeof(*orderList), orderListIndexCmp); + +/*@-type@*/ + newOrder = (rpmte *) xcalloc(ts->orderCount, sizeof(*newOrder)); +/*@=type@*/ + for (i = 0, newOrderCount = 0; i < orderingCount; i++) + { + struct orderListIndex_s key; + orderListIndex needle; + + key.pkgKey = ordering[i]; + needle = bsearch(&key, orderList, numOrderList, + sizeof(key), orderListIndexCmp); + if (needle == NULL) /* XXX can't happen */ + continue; + + j = needle->orIndex; + if ((q = ts->order[j]) == NULL || needle->pkgKey == RPMAL_NOMATCH) + continue; + + newOrder[newOrderCount++] = q; + ts->order[j] = NULL; + } + orderList = _free(orderList); +#endif /* REFERENCE */ + +assert(newOrderCount == ts->orderCount); + rc = 0; + +/*@+voidabstract@*/ + ts->order = _free(ts->order); +/*@=voidabstract@*/ + ts->order = newOrder; + ts->orderAlloced = ts->orderCount; + +#ifdef REFERENCE + for (i = 2; SCCs[i].members != NULL; i++) + SCCs[i].members = _free(SCCs[i].members); + SCCs = _free(SCCs); + + rpmalFree(ts->erasedPackages); + ts->erasedPackages = NULL; +#else /* REFERENCE */ +#ifdef DYING /* XXX now done at the CLI level just before rpmtsRun(). */ + rpmtsClean(ts); +#endif +#endif /* REFERENCE */ + + freeBadDeps(); + + (void) rpmswExit(rpmtsOp(ts, RPMTS_OP_ORDER), 0); + + return rc; +} + +int (*rpmtsOrder) (rpmts ts) + = _rpmtsOrder; diff --git a/rpm-5.4.9/lib/poptALL.c b/rpm-5.4.9/lib/poptALL.c new file mode 100644 index 0000000..aa129a5 --- /dev/null +++ b/rpm-5.4.9/lib/poptALL.c @@ -0,0 +1,850 @@ +/** \ingroup rpmcli + * \file lib/poptALL.c + * Popt tables for all rpm modes. + */ + +#include "system.h" +extern const char *__progname; + +#if defined(RPM_VENDOR_WINDRIVER) +const char *__usrlibrpm = USRLIBRPM; +const char *__etcrpm = SYSCONFIGDIR; +#endif +#if defined(ENABLE_NLS) && !defined(__LCLINT__) +const char *__localedir = LOCALEDIR; +#endif + +#define _RPMIOB_INTERNAL +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include /* XXX rpmnsClean() */ + +#include +#include /* XXX rpmFreeFilesystems() */ +#include + +#include "debug.h" + +#ifdef __cplusplus + +#define QVA_ISSET(_qvaflags, _FLAG) ((_qvaflags) & (VERIFY_##_FLAG)) + +#define VSF_ISSET(_vsflags, _FLAG) ((_vsflags) & (RPMVSF_##_FLAG)) +#define VSF_SET(_vsflags, _FLAG) \ + (*((unsigned *)&(_vsflags)) |= (RPMVSF_##_FLAG)) +#define VSF_CLR(_vsflags, _FLAG) \ + (*((unsigned *)&(_vsflags)) &= ~(RPMVSF_##_FLAG)) + +GENfree(unsigned int *) + +#else /* __cplusplus */ + +#define QVA_ISSET(_qvaflags, _FLAG) ((_qvaflags) & (VERIFY_##_FLAG)) + +#define VSF_ISSET(_vsflags, _FLAG) ((_vsflags) & (RPMVSF_##_FLAG)) +#define VSF_SET(_vsflags, _FLAG) (_vsflags) |= (RPMVSF_##_FLAG) +#define VSF_CLR(_vsflags, _FLAG) (_vsflags) &= ~(RPMVSF_##_FLAG) + +#endif /* __cplusplus */ + +/*@unchecked@*/ /*@only@*/ /*@null@*/ +extern unsigned int * keyids; + +#define POPT_SHOWVERSION -999 +#define POPT_SHOWRC -998 +#define POPT_QUERYTAGS -997 +#define POPT_PREDEFINE -996 +#define POPT_UNDEFINE -994 + +/*@access headerTagIndices @*/ /* XXX rpmcliFini */ +/*@access headerTagTableEntry @*/ /* XXX rpmcliFini */ + +/*@unchecked@*/ +static int _debug = 0; + +/*@-exportheadervar@*/ +/*@unchecked@*/ +extern int _rpmds_nopromote; + +/*@unchecked@*/ +extern int _fps_debug; + +/*@unchecked@*/ +extern int _fsm_debug; + +/*@unchecked@*/ +extern int _fsm_threads; + +/*@unchecked@*/ +extern int _hdr_debug; +/*@unchecked@*/ +extern int _hdrqf_debug; + +/*@unchecked@*/ +extern int _pkgio_debug; + +/*@unchecked@*/ +extern int _rpmrepo_debug; + +/*@unchecked@*/ +extern int _print_pkts; + +/*@unchecked@*/ +extern int _psm_debug; +/*@unchecked@*/ +extern rpmioPool _psmPool; + +/*@unchecked@*/ +extern int _psm_threads; + +/*@unchecked@*/ +extern int _rpmal_debug; +/*@unchecked@*/ +extern rpmioPool _rpmalPool; + +/*@unchecked@*/ +extern int _rpmds_debug; +/*@unchecked@*/ +extern rpmioPool _rpmdsPool; + +/*@unchecked@*/ + int _rpmfc_debug; +/*@unchecked@*/ +extern rpmioPool _rpmfcPool; + +/*@unchecked@*/ +extern int _rpmfi_debug; +/*@unchecked@*/ +extern rpmioPool _rpmfiPool; + +/*@unchecked@*/ +extern int _rpmgi_debug; +/*@unchecked@*/ +extern rpmioPool _rpmgiPool; + +/*@unchecked@*/ +extern int _rpmmi_debug; + +/*@unchecked@*/ +extern int _rpmps_debug; +/*@unchecked@*/ +extern rpmioPool _rpmpsPool; + +/*@unchecked@*/ +extern int _rpmsq_debug; + +/*@unchecked@*/ +extern int _rpmte_debug; +/*@unchecked@*/ +extern rpmioPool _rpmtePool; +/*@unchecked@*/ +extern rpmioPool _rpmtsiPool; + +/*@unchecked@*/ +extern int _rpmts_debug; +/*@unchecked@*/ +extern rpmioPool _rpmtsPool; + +/*@unchecked@*/ +extern int _rpmwf_debug; + +/*@unchecked@*/ +extern int _rpmts_macros; + +/*@unchecked@*/ +extern int _rpmts_stats; + +/*@unchecked@*/ +extern int _hdr_stats; + +/*@unchecked@*/ +rpmQueryFlags rpmcliQueryFlags; + +/*@unchecked@*/ /*@null@*/ +const char * rpmcliTargets = NULL; + +/*@unchecked@*/ +static int rpmcliInitialized = -1; + +#ifdef WITH_LUA +/*@unchecked@*/ +extern const char *rpmluaFiles; +#endif + +/*@-readonlytrans@*/ /* argv loading prevents observer, xstrdup needed. */ +/*@unchecked@*/ +static const char *rpmpoptfiles = RPMPOPTFILES; +/*@=readonlytrans@*/ + +/** + * Display rpm version. + */ +static void printVersion(FILE * fp) + /*@globals rpmEVR, fileSystem, internalState @*/ + /*@modifies *fp, fileSystem, internalState @*/ +{ + fprintf(fp, _("%s (" RPM_NAME ") %s\n"), __progname, rpmEVR); + if (rpmIsVerbose()) + fprintf(fp, "rpmlib 0x%08x,0x%08x,0x%08x\n", (unsigned)rpmlibVersion(), + (unsigned)rpmlibTimestamp(), (unsigned)rpmlibVendor()); +} + +void rpmcliConfigured(void) + /*@globals rpmcliInitialized, rpmCLIMacroContext, rpmGlobalMacroContext, + h_errno, fileSystem, internalState @*/ + /*@modifies rpmcliInitialized, rpmCLIMacroContext, rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + + if (rpmcliInitialized < 0) { + char * t = NULL; + if (rpmcliTargets != NULL) { + char *te; + t = xstrdup(rpmcliTargets); + if ((te = strchr(t, ',')) != NULL) + *te = '\0'; + } + rpmcliInitialized = rpmReadConfigFiles(NULL, t); + t = _free(t); + } + if (rpmcliInitialized) + exit(EXIT_FAILURE); +} + +/* ========== all-rpm-modes popt args */ + +static const char * rpmcliEvalSlurp(const char * arg) + /*@globals rpmGlobalMacroContext @*/ + /*@modifies rpmGlobalMacroContext @*/ +{ + const char * pre = ""; + const char * post = ""; + rpmiob iob = NULL; + const char * val = NULL; + struct stat sb; + int xx; + + if (!strcmp(arg, "-")) { /* Macros from stdin arg. */ + xx = rpmiobSlurp(arg, &iob); + } else + if ((arg[0] == '/' || strchr(arg, ' ') == NULL) + && !Stat(arg, &sb) + && S_ISREG(sb.st_mode)) { /* Macros from a file arg. */ + xx = rpmiobSlurp(arg, &iob); + } else { /* Macros from string arg. */ + iob = rpmiobAppend(rpmiobNew(strlen(arg)+1), arg, 0); + } + + val = rpmExpand(pre, iob->b, post, NULL); + iob = rpmiobFree(iob); + return val; +} + +/** + */ +static void rpmcliAllArgCallback(poptContext con, + /*@unused@*/ enum poptCallbackReason reason, + const struct poptOption * opt, const char * arg, + /*@unused@*/ const void * data) + /*@globals pgpDigVSFlags, rpmcliTargets, rpmcliQueryFlags, rpmCLIMacroContext, + rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies con, pgpDigVSFlags, rpmcliTargets, rpmcliQueryFlags, rpmCLIMacroContext, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + + /* XXX avoid accidental collisions with POPT_BIT_SET for flags */ + if (opt->arg == NULL) + switch (opt->val) { + case POPT_PREDEFINE: + (void) rpmDefineMacro(NULL, arg, RMIL_CMDLINE); + break; + case 'D': + { char *s, *t; + /* XXX Convert '-' in macro name to underscore, skip leading %. */ + s = t = xstrdup(arg); + while (*t && !xisspace(*t)) { + if (*t == '-') *t = '_'; + t++; + } + t = s; + if (*t == '%') t++; + rpmcliConfigured(); +/*@-type@*/ + /* XXX adding macro to global context isn't Right Thing Todo. */ + (void) rpmDefineMacro(NULL, t, RMIL_CMDLINE); + (void) rpmDefineMacro(rpmCLIMacroContext, t, RMIL_CMDLINE); +/*@=type@*/ + s = _free(s); + } break; + case POPT_UNDEFINE: + { char *s, *t; + /* XXX Convert '-' in macro name to underscore, skip leading %. */ + s = t = xstrdup(arg); + while (*t && !xisspace(*t)) { + if (*t == '-') *t = '_'; + t++; + } + t = s; + if (*t == '%') t++; +/*@-type@*/ + rpmcliConfigured(); + (void) rpmUndefineMacro(NULL, t); + (void) rpmUndefineMacro(rpmCLIMacroContext, t); +/*@=type@*/ + s = _free(s); + } break; + case 'E': +assert(arg != NULL); + rpmcliConfigured(); + { const char * val = rpmcliEvalSlurp(arg); + size_t val_len = fwrite(val, strlen(val), 1, stdout); + if (val_len > 0 && val[val_len - 1] != '\n') + fprintf(stdout, "\n"); + val = _free(val); + } break; + case POPT_SHOWVERSION: + printVersion(stdout); +/*@i@*/ con = rpmcliFini(con); + exit(EXIT_SUCCESS); + /*@notreached@*/ break; + case POPT_SHOWRC: + rpmcliConfigured(); + (void) rpmShowRC(stdout); +/*@i@*/ con = rpmcliFini(con); + exit(EXIT_SUCCESS); + /*@notreached@*/ break; + case POPT_QUERYTAGS: + rpmDisplayQueryTags(NULL, NULL, NULL); +/*@i@*/ con = rpmcliFini(con); + exit(EXIT_SUCCESS); + /*@notreached@*/ break; + case RPMCLI_POPT_NODIGEST: + rpmcliQueryFlags = (rpmQueryFlags)(rpmcliQueryFlags | VERIFY_DIGEST); +#if defined(SUPPORT_NOSIGNATURES) + VSF_SET(pgpDigVSFlags, NOSHA1HEADER); + VSF_SET(pgpDigVSFlags, NOMD5HEADER); + VSF_SET(pgpDigVSFlags, NOSHA1); + VSF_SET(pgpDigVSFlags, NOMD5); + VSF_CLR(pgpDigVSFlags, NEEDPAYLOAD); /* XXX needed? */ +#endif + break; + + case RPMCLI_POPT_NOSIGNATURE: + rpmcliQueryFlags = (rpmQueryFlags)(rpmcliQueryFlags | VERIFY_SIGNATURE); +#if defined(SUPPORT_NOSIGNATURES) + VSF_SET(pgpDigVSFlags, NODSAHEADER); + VSF_SET(pgpDigVSFlags, NORSAHEADER); + VSF_SET(pgpDigVSFlags, NODSA); + VSF_SET(pgpDigVSFlags, NORSA); + VSF_CLR(pgpDigVSFlags, NEEDPAYLOAD); /* XXX needed? */ +#endif + break; + + case RPMCLI_POPT_NOHDRCHK: + rpmcliQueryFlags = (rpmQueryFlags) (rpmcliQueryFlags | VERIFY_HDRCHK); +#if defined(SUPPORT_NOSIGNATURES) + VSF_SET(pgpDigVSFlags, NOHDRCHK); + VSF_CLR(pgpDigVSFlags, NEEDPAYLOAD); /* XXX needed? */ +#endif + break; + + case RPMCLI_POPT_TARGETPLATFORM: + if (rpmcliTargets == NULL) + rpmcliTargets = xstrdup(arg); + else { +/*@-modobserver @*/ + char * t = (char *) rpmcliTargets; + size_t nb = strlen(t) + (sizeof(",")-1) + strlen(arg) + 1; +/*@i@*/ t = (char *) xrealloc(t, nb); + (void) stpcpy( stpcpy(t, ","), arg); + rpmcliTargets = t; +/*@=modobserver @*/ + } + break; + } +} + +/*@unchecked@*/ +int global_depFlags = RPMDEPS_FLAG_ADDINDEPS; + +/*@unchecked@*/ +struct poptOption rpmcliDepFlagsPoptTable[] = { + { "noaid", '\0', POPT_BIT_CLR|POPT_ARGFLAG_TOGGLE, &global_depFlags, RPMDEPS_FLAG_ADDINDEPS, + N_("Add packages to resolve dependencies"), NULL }, + { "anaconda", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &global_depFlags, RPMDEPS_FLAG_ANACONDA|RPMDEPS_FLAG_DEPLOOPS, + N_("Use anaconda \"presentation order\""), NULL}, + { "deploops", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &global_depFlags, RPMDEPS_FLAG_DEPLOOPS, + N_("Print dependency loops as warning"), NULL}, + { "nosuggest", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &global_depFlags, RPMDEPS_FLAG_NOSUGGEST, + N_("Do not suggest missing dependency resolution(s)"), NULL}, + { "noconflicts", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &global_depFlags, RPMDEPS_FLAG_NOCONFLICTS, + N_("Do not check added package conflicts"), NULL}, + { "nolinktos", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &global_depFlags, RPMDEPS_FLAG_NOLINKTOS, + N_("Ignore added package requires on symlink targets"), NULL}, + { "noobsoletes", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &global_depFlags, RPMDEPS_FLAG_NOOBSOLETES, + N_("Ignore added package obsoletes"), NULL}, + { "noparentdirs", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &global_depFlags, RPMDEPS_FLAG_NOPARENTDIRS, + N_("Ignore added package requires on file parent directory"), NULL}, + { "norequires", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &global_depFlags, RPMDEPS_FLAG_NOREQUIRES, + N_("Do not check added package requires"), NULL}, + { "noupgrade", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &global_depFlags, RPMDEPS_FLAG_NOUPGRADE, + N_("Ignore added package upgrades"), NULL}, + POPT_TABLEEND +}; + +/*@-bitwisesigned -compmempass @*/ +/*@unchecked@*/ +struct poptOption rpmcliAllPoptTable[] = { +/*@-type@*/ /* FIX: cast? */ + { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, + (void *) rpmcliAllArgCallback, 0, NULL, NULL }, +/*@=type@*/ + + { "debug", 'd', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_debug, -1, + N_("Debug generic operations"), NULL}, + + { "predefine", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, NULL, POPT_PREDEFINE, + N_("Predefine MACRO with value EXPR"), + N_("'MACRO EXPR'") }, + + { "define", 'D', POPT_ARG_STRING, NULL, 'D', + N_("Define MACRO with value EXPR"), + N_("'MACRO EXPR'") }, + { "undefine", '\0', POPT_ARG_STRING, NULL, POPT_UNDEFINE, + N_("Undefine MACRO"), + N_("'MACRO'") }, + { "eval", 'E', POPT_ARG_STRING, NULL, 'E', + N_("Print macro expansion of EXPR"), + N_("'EXPR'") }, + { "macros", '\0', POPT_ARG_STRING, &rpmMacrofiles, 0, + N_("Read instead of default file(s)"), + N_("") }, +#ifdef WITH_LUA + { "rpmlua", '\0', POPT_ARG_STRING, &rpmluaFiles, 0, + N_("Read instead of default RPM Lua file(s)"), + N_("") }, +#endif + { "rpmpopt", '\0', POPT_ARG_STRING, NULL, 0, + N_("Read instead of default POPT file(s)"), + N_("") }, + + { "target", '\0', POPT_ARG_STRING, NULL, RPMCLI_POPT_TARGETPLATFORM, + N_("Specify target platform"), N_("CPU-VENDOR-OS") }, + + { "nodigest", '\0', 0, NULL, RPMCLI_POPT_NODIGEST, + N_("Don't verify package digest(s)"), NULL }, + { "nohdrchk", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NOHDRCHK, + N_("Don't verify database header(s) when retrieved"), NULL }, + { "nosignature", '\0', 0, NULL, RPMCLI_POPT_NOSIGNATURE, + N_("Don't verify package signature(s)"), NULL }, + + { "querytags", '\0', 0, NULL, POPT_QUERYTAGS, + N_("Display known query tags"), NULL }, + { "showrc", '\0', 0, NULL, POPT_SHOWRC, + N_("Display macro and configuration values"), NULL }, + { "version", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, POPT_SHOWVERSION, + N_("Print the version"), NULL }, + + { "promoteepoch", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmds_nopromote, 0, + NULL, NULL}, + + { "fpsdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_fps_debug, -1, + N_("Debug file FingerPrintS"), NULL}, + { "fsmdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_fsm_debug, -1, + N_("Debug payload File State Machine"), NULL}, + { "fsmthreads", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_fsm_threads, -1, + N_("Use threads for File State Machine"), NULL}, + { "hdrdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_hdr_debug, -1, + NULL, NULL}, + { "hdrqfdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_hdrqf_debug, -1, + NULL, NULL}, + { "macrosused", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmts_macros, -1, + N_("Display macros used"), NULL}, + { "pkgiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_pkgio_debug, -1, + NULL, NULL}, + { "prtpkts", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_print_pkts, -1, + N_("Display OpenPGP (RFC 2440/4880) parsing"), NULL}, + { "psmdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_psm_debug, -1, + N_("Debug Package State Machine"), NULL}, + { "psmthreads", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_psm_threads, -1, + N_("Use threads for Package State Machine"), NULL}, + { "rpmdsdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmds_debug, -1, + N_("Debug rpmds Dependency Set"), NULL}, + { "rpmfcdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmfc_debug, -1, + N_("Debug rpmfc File Classifier"), NULL}, + { "rpmfidebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmfi_debug, -1, + N_("Debug rpmfi File Info"), NULL}, + { "rpmgidebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmgi_debug, -1, + N_("Debug rpmgi Generalized Iterator"), NULL}, + { "rpmmidebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmmi_debug, -1, + N_("Debug rpmmi Match Iterator"), NULL}, + { "rpmnsdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmns_debug, -1, + N_("Debug rpmns Name Space"), NULL}, + { "rpmpsdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmps_debug, -1, + N_("Debug rpmps Problem Set"), NULL}, + { "rpmtedebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmte_debug, -1, + N_("Debug rpmte Transaction Element"), NULL}, + { "rpmtsdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmts_debug, -1, + N_("Debug rpmts Transaction Set"), NULL}, + { "rpmwfdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmwf_debug, -1, + N_("Debug rpmwf Wrapper Format"), NULL}, + { "stats", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmts_stats, -1, + N_("Display operation statistics"), NULL}, + + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioAllPoptTable, 0, + NULL, NULL}, + + POPT_TABLEEND +}; +/*@=bitwisesigned =compmempass @*/ + +poptContext +rpmcliFini(poptContext optCon) + /*@globals keyids @*/ + /*@modifies keyids @*/ +{ +/*@-nestedextern@*/ + extern rpmioPool _rpmjsPool; + extern rpmioPool _rpmrubyPool; + extern rpmioPool _headerPool; + extern rpmioPool _rpmmiPool; + extern rpmioPool _dbiPool; +#if defined(HAVE_SQLITE3_H) /* XXX test --with-sqlite=external */ + extern rpmioPool _scpPool; +#endif + extern rpmioPool _rpmdbPool; + extern rpmioPool _rpmmdbPool; + extern rpmioPool _rpmrepoPool; + extern rpmioPool _rpmwfPool; + extern const char * evr_tuple_order; + extern const char * evr_tuple_match; + extern miRE evr_tuple_mire; +/*@=nestedextern@*/ + +/*@-mods@*/ + evr_tuple_order = _free(evr_tuple_order); + evr_tuple_match = _free(evr_tuple_match); + evr_tuple_mire = mireFree(evr_tuple_mire); + +/*@-onlyunqglobaltrans@*/ + /* Realease (and dereference) embedded interpreter global objects first. */ + _rpmjsI = rpmjsFree(_rpmjsI); + _rpmjsPool = rpmioFreePool(_rpmjsPool); + _rpmrubyI = rpmrubyFree(_rpmrubyI); + _rpmrubyPool = rpmioFreePool(_rpmrubyPool); + + _rpmmdbI = rpmmdbFree(_rpmmdbI); + _rpmmdbPool = rpmioFreePool(_rpmmdbPool); + + _rpmgiPool = rpmioFreePool(_rpmgiPool); + _rpmmiPool = rpmioFreePool(_rpmmiPool); + + _psmPool = rpmioFreePool(_psmPool); + _rpmtsiPool = rpmioFreePool(_rpmtsiPool); + + _rpmtsPool = rpmioFreePool(_rpmtsPool); + _rpmtePool = rpmioFreePool(_rpmtePool); + _rpmpsPool = rpmioFreePool(_rpmpsPool); + _rpmalPool = rpmioFreePool(_rpmalPool); + + _rpmfcPool = rpmioFreePool(_rpmfcPool); + + rpmnsClean(); + + _rpmdsPool = rpmioFreePool(_rpmdsPool); + _rpmfiPool = rpmioFreePool(_rpmfiPool); + + _rpmwfPool = rpmioFreePool(_rpmwfPool); + _rpmdbPool = rpmioFreePool(_rpmdbPool); + _rpmrepoPool = rpmioFreePool(_rpmrepoPool); +#if defined(HAVE_SQLITE3_H) /* XXX test --with-sqlite=external */ + _scpPool = rpmioFreePool(_scpPool); +#endif + _dbiPool = rpmioFreePool(_dbiPool); + _headerPool = rpmioFreePool(_headerPool); +/*@=onlyunqglobaltrans@*/ +/*@=mods@*/ + + /* XXX this should be done in the rpmioClean() wrapper. */ + /* keeps memory leak checkers quiet */ + rpmFreeMacros(NULL); +/*@i@*/ rpmFreeMacros(rpmCLIMacroContext); + + rpmFreeRpmrc(); /* XXX mireFreeAll(platpat) before rpmioFreePool. */ + + rpmFreeFilesystems(); +/*@i@*/ rpmcliTargets = _free(rpmcliTargets); + + keyids = _free(keyids); + + tagClean(NULL); /* Free header tag indices. */ + + rpmioClean(); /* XXX rpmioFreePool()'s after everything else. */ + + optCon = poptFreeContext(optCon); + +#if defined(HAVE_MCHECK_H) && defined(HAVE_MTRACE) + /*@-noeffect@*/ + muntrace(); /* Trace malloc only if MALLOC_TRACE=mtrace-output-file. */ + /*@=noeffect@*/ +#endif + +/*@-globstate@*/ + return NULL; +/*@=globstate@*/ +} + +static inline int checkfd(const char * devnull, int fdno, int flags) + /*@*/ +{ + struct stat sb; + int ret = 0; + + if (fstat(fdno, &sb) == -1 && errno == EBADF) + ret = (open(devnull, flags) == fdno) ? 1 : 2; + return ret; +} + +#if defined(RPM_VENDOR_WINDRIVER) +void setRuntimeRelocPaths(void) +{ + /* + * This is just an example of setting the values using env + * variables.... if they're not set, we make sure they get set + * for helper apps... We probably want to escape "%" in the path + * to avoid macro expansion.. someone might have a % in a path... + */ + + __usrlibrpm = getenv("RPM_USRLIBRPM"); + __etcrpm = getenv("RPM_ETCRPM"); +#if defined(ENABLE_NLS) && !defined(__LCLINT__) + __localedir = getenv("RPM_LOCALEDIR"); +#endif + + if ( __usrlibrpm == NULL ) { + __usrlibrpm = USRLIBRPM ; + setenv("RPM_USRLIBRPM", USRLIBRPM, 0); + } + + if ( __etcrpm == NULL ) { + __etcrpm = SYSCONFIGDIR ; + setenv("RPM_ETCRPM", SYSCONFIGDIR, 0); + } + +#if defined(ENABLE_NLS) && !defined(__LCLINT__) + if ( __localedir == NULL ) { + __localedir = LOCALEDIR ; + setenv("RPM_LOCALEDIR", LOCALEDIR, 0); + } +#endif +} +#endif + +/*@-globstate@*/ +poptContext +rpmcliInit(int argc, char *const argv[], struct poptOption * optionsTable) + /*@globals rpmpoptfiles @*/ + /*@modifies rpmpoptfiles @*/ +{ + poptContext optCon; + int rc; + int xx; + int i; + +#if defined(HAVE_MCHECK_H) && defined(HAVE_MTRACE) + /*@-noeffect@*/ + mtrace(); /* Trace malloc only if MALLOC_TRACE=mtrace-output-file. */ + /*@=noeffect@*/ +#endif +/*@-globs -mods@*/ + setprogname(argv[0]); /* Retrofit glibc __progname */ + + /* XXX glibc churn sanity */ + if (__progname == NULL) { + if ((__progname = strrchr(argv[0], '/')) != NULL) __progname++; + else __progname = argv[0]; + } +/*@=globs =mods@*/ + + /* Insure that stdin/stdout/stderr are open, lest stderr end up in rpmdb. */ + { static const char _devnull[] = "/dev/null"; +#if defined(STDIN_FILENO) + (void) checkfd(_devnull, STDIN_FILENO, O_RDONLY); +#endif +#if defined(STDOUT_FILENO) + (void) checkfd(_devnull, STDOUT_FILENO, O_WRONLY); +#endif +#if defined(STDERR_FILENO) + (void) checkfd(_devnull, STDERR_FILENO, O_WRONLY); +#endif + } + +#if defined(RPM_VENDOR_WINDRIVER) + (void) setRuntimeRelocPaths(); +#endif + +#if defined(ENABLE_NLS) && !defined(__LCLINT__) + (void) setlocale(LC_ALL, "" ); + (void) bindtextdomain(PACKAGE, __localedir); + (void) textdomain(PACKAGE); +#endif + + rpmSetVerbosity(RPMLOG_NOTICE); + + if (optionsTable == NULL) { + /* Read rpm configuration (if not already read). */ + rpmcliConfigured(); + return NULL; + } + + /* read all RPM POPT configuration files */ + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "--rpmpopt") == 0 && i+1 < argc) { + rpmpoptfiles = argv[i+1]; + break; + } + else if (strncmp(argv[i], "--rpmpopt=", 10) == 0) { + rpmpoptfiles = argv[i]+10; + break; + } + } + + /* XXX strip off the "lt-" prefix so that rpmpopt aliases "work". */ +{ static const char lt_[] = "lt-"; + const char * s = __progname; + if (!strncmp(s, lt_, sizeof(lt_)-1)) + s += sizeof(lt_)-1; +/*@-nullpass -temptrans@*/ + optCon = poptGetContext(s, argc, (const char **)argv, optionsTable, 0); +/*@=nullpass =temptrans@*/ +} + +#if defined(RPM_VENDOR_OPENPKG) /* stick-with-rpm-file-sanity-checking */ || \ + !defined(POPT_ERROR_BADCONFIG) /* XXX POPT 1.15 retrofit */ + { char * path_buf = xstrdup(rpmpoptfiles); + char *path; + char *path_next; + + for (path = path_buf; path != NULL && *path != '\0'; path = path_next) { + const char **av; + int ac; + + /* locate start of next path element */ + path_next = strchr(path, ':'); + if (path_next != NULL && *path_next == ':') + *path_next++ = '\0'; + else + path_next = path + strlen(path); + + /* glob-expand the path element */ + ac = 0; + av = NULL; + if ((xx = rpmGlob(path, &ac, &av)) != 0) + continue; + + /* work-off each resulting file from the path element */ + for (i = 0; i < ac; i++) { + const char *fn = av[i]; + if (fn[0] == '@' /* attention */) { + fn++; + if (!rpmSecuritySaneFile(fn)) { + rpmlog(RPMLOG_WARNING, "existing POPT configuration file \"%s\" considered INSECURE -- not loaded\n", fn); + /*@innercontinue@*/ continue; + } + } + (void) poptReadConfigFile(optCon, fn); + av[i] = _free(av[i]); + } + av = _free(av); + } + path_buf = _free(path_buf); + } +#else + /* XXX FIXME: better error message is needed. */ + if ((xx = poptReadConfigFiles(optCon, rpmpoptfiles)) != 0) + rpmlog(RPMLOG_WARNING, "existing POPT configuration file \"%s\" considered INSECURE -- not loaded\n", rpmpoptfiles); +#endif + +#if defined(RPM_VENDOR_WINDRIVER) + { const char * poptAliasFn = rpmGetPath(__usrlibrpm, "/rpmpopt", NULL); + (void) poptReadConfigFile(optCon, poptAliasFn); + poptAliasFn = _free(poptAliasFn); + } +#endif + + /* read standard POPT configuration files */ + /* XXX FIXME: the 2nd arg useEnv flag is UNUSED. */ + (void) poptReadDefaultConfig(optCon, 1); + +#if defined(RPM_VENDOR_WINDRIVER) + { const char * poptExecPath = rpmGetPath(__usrlibrpm, NULL); + poptSetExecPath(optCon, poptExecPath, 1); + poptExecPath = _free(poptExecPath); + } +#else + poptSetExecPath(optCon, USRLIBRPM, 1); +#endif + + /* Process all options, whine if unknown. */ + while ((rc = poptGetNextOpt(optCon)) > 0) { + const char * optArg = poptGetOptArg(optCon); +/*@-dependenttrans -observertrans@*/ /* Avoid popt memory leaks. */ + optArg = _free(optArg); +/*@=dependenttrans =observertrans @*/ + switch (rc) { + default: +/*@-nullpass@*/ + fprintf(stderr, _("%s: option table misconfigured (%d)\n"), + __progname, rc); +/*@=nullpass@*/ + exit(EXIT_FAILURE); + + /*@notreached@*/ /*@switchbreak@*/ break; + } + } + + if (rc < -1) { +/*@-nullpass@*/ + fprintf(stderr, "%s: %s: %s\n", __progname, + poptBadOption(optCon, POPT_BADOPTION_NOALIAS), + poptStrerror(rc)); +/*@=nullpass@*/ + exit(EXIT_FAILURE); + } + + /* Read rpm configuration (if not already read). */ + rpmcliConfigured(); + + if (_debug) { + rpmIncreaseVerbosity(); + rpmIncreaseVerbosity(); + } + + /* Initialize header stat collection. */ +/*@-mods@*/ + _hdr_stats = _rpmts_stats; +/*@=mods@*/ + + return optCon; +} +/*@=globstate@*/ diff --git a/rpm-5.4.9/lib/poptI.c b/rpm-5.4.9/lib/poptI.c new file mode 100644 index 0000000..ec8edc9 --- /dev/null +++ b/rpm-5.4.9/lib/poptI.c @@ -0,0 +1,393 @@ +/** \ingroup rpmcli + * \file lib/poptI.c + * Popt tables for install modes. + */ + +#include "system.h" + +#include +#include +#include + +#include +#include + +#include "debug.h" + +/*@-redecl@*/ +extern time_t get_date(const char * p, void * now); /* XXX expedient lies */ +/*@=redecl@*/ + +/*@-fullinitblock@*/ +/*@unchecked@*/ +struct rpmQVKArguments_s rpmIArgs = { +#if defined(RPM_VENDOR_MANDRIVA) /* dont-filter-install-file-conflicts */ + .probFilter = RPMPROB_FILTER_NONE, +#else + .probFilter = (RPMPROB_FILTER_REPLACEOLDFILES | RPMPROB_FILTER_REPLACENEWFILES), +#endif +}; +/*@=fullinitblock@*/ + +#define POPT_RELOCATE -1021 +#define POPT_EXCLUDEPATH -1022 +#define POPT_ROLLBACK -1023 +#define POPT_ROLLBACK_EXCLUDE -1024 +/* -1025 thrugh -1033 are common in rpmcli.h. */ +#define POPT_AUTOROLLBACK_GOAL -1036 + +#define alloca_strdup(_s) strcpy((char *)alloca(strlen(_s)+1), (_s)) + +/** + * Print a message and exit. + * @todo (CLI embedding) Use rpmlog/rpmlog instead of fprintf, remove exit. + * @param desc message + */ +static void argerror(const char * desc) __attribute__((__noreturn__)); +/*@exits@*/ +static void argerror(const char * desc) + /*@globals stderr, fileSystem @*/ + /*@modifies stderr, fileSystem @*/ +{ + /*@-modfilesys -globs @*/ + fprintf(stderr, _("%s: %s\n"), __progname, desc); + /*@=modfilesys =globs @*/ + exit(EXIT_FAILURE); +} + +/** + */ +static void installArgCallback(/*@unused@*/ poptContext con, + /*@unused@*/ enum poptCallbackReason reason, + const struct poptOption * opt, const char * arg, + /*@unused@*/ const void * data) + /*@globals rpmIArgs, stderr @*/ + /*@modifies rpmIArgs, stderr @*/ +{ + QVA_t ia = &rpmIArgs; + int xx; + + /* XXX avoid accidental collisions with POPT_BIT_SET for flags */ + if (opt->arg == NULL) + switch (opt->val) { + + case 'i': + ia->installInterfaceFlags = (rpmInstallInterfaceFlags) + (ia->installInterfaceFlags | INSTALL_INSTALL); + break; + + case POPT_EXCLUDEPATH: + if (arg == NULL || *arg != '/') + argerror(_("exclude paths must begin with a /")); + xx = rpmfiAddRelocation(&ia->relocations, &ia->nrelocations, arg, NULL); + break; + case POPT_RELOCATE: + { char * oldPath = NULL; + char * newPath = NULL; + + if (arg == NULL) + argerror(_("Option --relocate needs /old/path=/new/path argument")); + if (*arg != '/') + argerror(_("relocations must begin with a /")); + oldPath = xstrdup(arg); + if (!(newPath = strchr(oldPath, '='))) + argerror(_("relocations must contain a =")); + *newPath++ = '\0'; + if (*newPath != '/') + argerror(_("relocations must have a / following the =")); + xx = rpmfiAddRelocation(&ia->relocations, &ia->nrelocations, + oldPath, newPath); + oldPath = _free(oldPath); + } break; + + case POPT_ROLLBACK_EXCLUDE: + { rpmuint32_t tid; + char *t, *te; + + /* Make sure we were given the proper number of args */ + if (arg == NULL) + argerror(_("Option --rbexclude needs transaction id argument(s)")); + + te = alloca_strdup(arg); + while (*te != '\0' && strchr(" \t\n,", *te) != NULL) + *te++ = '\0'; + while ((t = te++) != NULL && *t != '\0') { + /* Find next tid. */ + while (*te != '\0' && strchr(" \t\n,", *te) == NULL) + te++; + while (*te != '\0' && strchr(" \t\n,", *te) != NULL) + *te++ = '\0'; + + /* Convert arg to TID which happens to be time_t */ + /* XXX: Need check for arg to be an integer */ + tid = (rpmuint32_t) strtol(t, NULL, 0); + + /* Allocate space for new exclude tid */ + ia->rbtidExcludes = (rpmuint32_t *) xrealloc(ia->rbtidExcludes, + sizeof(*ia->rbtidExcludes) * (ia->numrbtidExcludes + 1)); + + /* Add it to the list and iterate count*/ +/*@-temptrans@*/ + ia->rbtidExcludes[ia->numrbtidExcludes] = tid; +/*@=temptrans@*/ + ia->numrbtidExcludes++; + } + } break; + + case POPT_ROLLBACK: + { time_t tid; + if (arg == NULL) + argerror(_("Option --rollback needs a time/date stamp argument")); + + /*@-moduncon@*/ + tid = get_date(arg, NULL); + rpmlog(RPMLOG_INFO, _("Rollback goal: %-24.24s (0x%08x)\n"), ctime(&tid), (int)tid); + /*@=moduncon@*/ + + if (tid == (time_t)-1 || tid == (time_t)0) + argerror(_("malformed rollback time/date stamp argument")); + ia->rbtid = (rpmuint32_t)tid; + } break; + + case POPT_AUTOROLLBACK_GOAL: + { time_t tid; + if (arg == NULL) + argerror(_("arbgoal takes a time/date stamp argument")); + + /*@-moduncon@*/ + tid = get_date(arg, NULL); + /*@=moduncon@*/ + + if (tid == (time_t)-1 || tid == (time_t)0) + argerror(_("malformed arbgoal time/date stamp argument")); + ia->arbtid = (rpmuint32_t)tid; + } break; + + case RPMCLI_POPT_NODIGEST: + ia->qva_flags = (rpmQueryFlags) (ia->qva_flags | VERIFY_DIGEST); + break; + + case RPMCLI_POPT_NOSIGNATURE: + ia->qva_flags = (rpmQueryFlags) (ia->qva_flags | VERIFY_SIGNATURE); + break; + + case RPMCLI_POPT_NOHDRCHK: + ia->qva_flags = (rpmQueryFlags) (ia->qva_flags | VERIFY_HDRCHK); + break; + + case RPMCLI_POPT_NODEPS: + ia->noDeps = 1; + break; + + case RPMCLI_POPT_NOCONTEXTS: + ia->transFlags = (rpmtransFlags) + (ia->transFlags | RPMTRANS_FLAG_NOCONTEXTS); + break; + + case RPMCLI_POPT_NOSCRIPTS: + ia->transFlags = (rpmtransFlags) + (ia->transFlags | (_noTransScripts|_noTransTriggers)); + break; + + case RPMCLI_POPT_NOFDIGESTS: + ia->transFlags = (rpmtransFlags) + (ia->transFlags | RPMTRANS_FLAG_NOFDIGESTS); + break; + + } +} + +/** + */ +/*@-bitwisesigned -compmempass @*/ +/*@unchecked@*/ +struct poptOption rpmInstallPoptTable[] = { +/*@-type@*/ /* FIX: cast? */ + { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, + (void *) installArgCallback, 0, NULL, NULL }, +/*@=type@*/ + + { "allfiles", '\0', POPT_BIT_SET, + &rpmIArgs.transFlags, RPMTRANS_FLAG_ALLFILES, + N_("install all files, even configurations which might otherwise be skipped"), + NULL}, + { "apply", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &rpmIArgs.transFlags, + (_noTransScripts|_noTransTriggers| + RPMTRANS_FLAG_APPLYONLY|RPMTRANS_FLAG_PKGCOMMIT), + N_("do not execute package scriptlet(s)"), NULL }, + { "dirstash", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &rpmIArgs.transFlags, RPMTRANS_FLAG_DIRSTASH, + N_("save erased package files by renaming into sub-directory"), NULL}, + { "excludeconfigs", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &rpmIArgs.transFlags, RPMTRANS_FLAG_NOCONFIGS, + N_("do not install configuration files"), NULL}, + { "excludedocs", '\0', POPT_BIT_SET, + &rpmIArgs.transFlags, RPMTRANS_FLAG_NODOCS, + N_("do not install documentation"), NULL}, + { "justdb", '\0', POPT_BIT_SET, &rpmIArgs.transFlags, RPMTRANS_FLAG_JUSTDB, + N_("update the database, but do not modify the filesystem"), NULL}, + { "noconfigs", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmIArgs.transFlags, RPMTRANS_FLAG_NOCONFIGS, + N_("do not install configuration files"), NULL}, + { "nodocs", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmIArgs.transFlags, RPMTRANS_FLAG_NODOCS, + N_("do not install documentation"), NULL}, +#ifdef NOTYET /* XXX multiple identical options forces popt callback. */ + { "nocontexts", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmIArgs.transFlags, RPMTRANS_FLAG_NOCONTEXTS, + N_("don't install file security contexts"), NULL}, + { "nofdigests", '\0', POPT_BIT_SET, + &rpmIArgs.transFlags, RPMTRANS_FLAG_NOFDIGESTS, + N_("don't verify file digests"), NULL }, +#else + { "nocontexts", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NOCONTEXTS, + N_("don't verify file security contexts"), NULL }, + { "nofdigests", '\0', 0, NULL, RPMCLI_POPT_NOFDIGESTS, + N_("don't verify file digests"), NULL }, +#endif + { "norpmdb", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmIArgs.transFlags, RPMTRANS_FLAG_NORPMDB, + N_("don't register headers in rpmdb"), NULL}, + +#ifdef NOTYET /* XXX multiple identical options forces popt callback. */ + { "noscripts", '\0', POPT_BIT_SET, + &rpmIArgs.transFlags, (_noTransScripts|_noTransTriggers), + N_("do not execute package scriptlet(s)"), NULL }, +#else + { "noscripts", '\0', 0, NULL, RPMCLI_POPT_NOSCRIPTS, + N_("do not execute package scriptlet(s)"), NULL }, +#endif + { "nopretrans", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmIArgs.transFlags, RPMTRANS_FLAG_NOPRETRANS, + N_("do not execute %%pretrans scriptlet (if any)"), NULL }, + { "nopre", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmIArgs.transFlags, RPMTRANS_FLAG_NOPRE, + N_("do not execute %%pre scriptlet (if any)"), NULL }, + { "nopost", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmIArgs.transFlags, RPMTRANS_FLAG_NOPOST, + N_("do not execute %%post scriptlet (if any)"), NULL }, + { "nopreun", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmIArgs.transFlags, RPMTRANS_FLAG_NOPREUN, + N_("do not execute %%preun scriptlet (if any)"), NULL }, + { "nopostun", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmIArgs.transFlags, RPMTRANS_FLAG_NOPOSTUN, + N_("do not execute %%postun scriptlet (if any)"), NULL }, + { "noposttrans", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmIArgs.transFlags, RPMTRANS_FLAG_NOPOSTTRANS, + N_("do not execute %%postrans scriptlet (if any)"), NULL }, + + { "notriggers", '\0', POPT_BIT_SET, &rpmIArgs.transFlags, _noTransTriggers, + N_("do not execute any scriptlet(s) triggered by this package"), NULL}, + { "notriggerprein", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmIArgs.transFlags, RPMTRANS_FLAG_NOTRIGGERPREIN, + N_("do not execute any %%triggerprein scriptlet(s)"), NULL}, + { "notriggerin", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmIArgs.transFlags, RPMTRANS_FLAG_NOTRIGGERIN, + N_("do not execute any %%triggerin scriptlet(s)"), NULL}, + { "notriggerun", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmIArgs.transFlags, RPMTRANS_FLAG_NOTRIGGERUN, + N_("do not execute any %%triggerun scriptlet(s)"), NULL}, + { "notriggerpostun", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmIArgs.transFlags, RPMTRANS_FLAG_NOTRIGGERPOSTUN, + N_("do not execute any %%triggerpostun scriptlet(s)"), NULL}, + + { "repackage", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &rpmIArgs.transFlags, RPMTRANS_FLAG_REPACKAGE, + N_("save erased package files by repackaging"), NULL}, + { "test", '\0', POPT_BIT_SET, &rpmIArgs.transFlags, RPMTRANS_FLAG_TEST, + N_("don't install, but tell if it would work or not"), NULL}, + + { "allmatches", '\0', POPT_BIT_SET, + &rpmIArgs.installInterfaceFlags, INSTALL_ALLMATCHES, + N_("remove all packages which match (normally an error is generated if specified multiple packages)"), + NULL}, + + { "badreloc", '\0', POPT_BIT_SET, + &rpmIArgs.probFilter, RPMPROB_FILTER_FORCERELOCATE, + N_("relocate files in non-relocatable package"), NULL}, + + { "erase", 'e', POPT_BIT_SET, + &rpmIArgs.installInterfaceFlags, INSTALL_ERASE, + N_("erase (uninstall) package"), N_("+") }, + { "excludepath", '\0', POPT_ARG_STRING, NULL, POPT_EXCLUDEPATH, + N_("skip files with leading component "), + N_("") }, + + { "fileconflicts", '\0', POPT_BIT_CLR, &rpmIArgs.probFilter, + (RPMPROB_FILTER_REPLACEOLDFILES | RPMPROB_FILTER_REPLACENEWFILES), + N_("detect file conflicts between packages"), NULL}, + + { "freshen", 'F', POPT_BIT_SET, &rpmIArgs.installInterfaceFlags, + (INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_INSTALL), + N_("upgrade package(s) if already installed"), + N_("+") }, + { "hash", 'h', POPT_BIT_SET, &rpmIArgs.installInterfaceFlags, INSTALL_HASH, + N_("print hash marks as package installs (good with -v)"), NULL}, +#ifndef DIEDIEDIE + { "ignorearch", '\0', POPT_BIT_SET, + &rpmIArgs.probFilter, RPMPROB_FILTER_IGNOREARCH, + N_("don't verify package architecture"), NULL}, + { "ignoreos", '\0', POPT_BIT_SET, + &rpmIArgs.probFilter, RPMPROB_FILTER_IGNOREOS, + N_("don't verify package operating system"), NULL}, +#endif + { "ignoresize", '\0', POPT_BIT_SET, &rpmIArgs.probFilter, + (RPMPROB_FILTER_DISKSPACE|RPMPROB_FILTER_DISKNODES), + N_("don't check disk space before installing"), NULL}, + { "includedocs", '\0', POPT_ARGFLAG_DOC_HIDDEN, &rpmIArgs.incldocs, 0, + N_("install documentation"), NULL}, + + { "install", 'i', 0, NULL, 'i', + N_("install package(s)"), N_("+") }, + + { "nodeps", '\0', 0, NULL, RPMCLI_POPT_NODEPS, + N_("do not verify package dependencies"), NULL }, + + { "noorder", '\0', POPT_BIT_SET, + &rpmIArgs.installInterfaceFlags, INSTALL_NOORDER, + N_("do not reorder package installation to satisfy dependencies"), + NULL}, + + { "nodigest", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NODIGEST, + N_("don't verify package digest(s)"), NULL }, + { "nohdrchk", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NOHDRCHK, + N_("don't verify database header(s) when retrieved"), NULL }, + { "nosignature", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NOSIGNATURE, + N_("don't verify package signature(s)"), NULL }, + + { "oldpackage", '\0', POPT_BIT_SET, + &rpmIArgs.probFilter, RPMPROB_FILTER_OLDPACKAGE, + N_("upgrade to an old version of the package (--force on upgrades does this automatically)"), + NULL}, + { "percent", '\0', POPT_BIT_SET, + &rpmIArgs.installInterfaceFlags, INSTALL_PERCENT, + N_("print percentages as package installs"), NULL}, + { "prefix", '\0', POPT_ARG_STRING, &rpmIArgs.qva_prefix, 0, + N_("relocate the package to , if relocatable"), + N_("") }, + { "relocate", '\0', POPT_ARG_STRING, NULL, POPT_RELOCATE, + N_("relocate files from path to "), + N_("=") }, + { "replacefiles", '\0', POPT_BIT_SET, &rpmIArgs.probFilter, + (RPMPROB_FILTER_REPLACEOLDFILES | RPMPROB_FILTER_REPLACENEWFILES), + N_("ignore file conflicts between packages"), NULL}, + { "replacepkgs", '\0', POPT_BIT_SET, + &rpmIArgs.probFilter, RPMPROB_FILTER_REPLACEPKG, + N_("reinstall if the package is already present"), NULL}, + { "rollback", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, NULL, POPT_ROLLBACK, + N_("deinstall new, reinstall old, package(s), back to "), + N_("") }, + { "arbgoal", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, NULL, POPT_AUTOROLLBACK_GOAL, + N_("If transaction fails rollback to "), + N_("") }, + { "rbexclude", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, NULL, POPT_ROLLBACK_EXCLUDE, + N_("Exclude Transaction I.D. from rollback"), + N_("") }, + { "upgrade", 'U', POPT_BIT_SET, + &rpmIArgs.installInterfaceFlags, (INSTALL_UPGRADE|INSTALL_INSTALL), + N_("upgrade package(s)"), + N_("+") }, + + POPT_TABLEEND +}; +/*@=bitwisesigned =compmempass @*/ diff --git a/rpm-5.4.9/lib/poptQV.c b/rpm-5.4.9/lib/poptQV.c new file mode 100644 index 0000000..437356b --- /dev/null +++ b/rpm-5.4.9/lib/poptQV.c @@ -0,0 +1,526 @@ +/** \ingroup rpmcli + * \file lib/poptQV.c + * Popt tables for query/verify modes. + */ + +#include "system.h" + +#include +#include +#include + +#include +#include +#include /* XXX for giFlags */ + +#include "debug.h" + +/*@unchecked@*/ +struct rpmQVKArguments_s rpmQVKArgs; + +/*@unchecked@*/ +int specedit = 0; + +#define POPT_QUERYFORMAT -1000 +#define POPT_WHATREQUIRES -1001 +#define POPT_WHATPROVIDES -1002 +#define POPT_QUERYBYNUMBER -1003 +#define POPT_TRIGGEREDBY -1004 +#define POPT_DUMP -1005 +#define POPT_SPECFILE -1006 +#define POPT_QUERYBYPKGID -1007 +#define POPT_QUERYBYHDRID -1008 +#define POPT_QUERYBYFILEID -1009 +#define POPT_QUERYBYTID -1010 +#define POPT_HDLIST -1011 +#define POPT_FTSWALK -1012 + +/* -1025 thrugh -1033 are common in rpmcli.h. */ +#define POPT_TRUST -1037 +#define POPT_WHATNEEDS -1038 +#define POPT_SPECSRPM -1039 +#define POPT_QUERYBYSOURCEPKGID -1040 +#define POPT_WHATCONFLICTS -1041 +#define POPT_WHATOBSOLETES -1042 +#define POPT_NOPASSWORD -1043 + +/* ========== Query/Verify/Signature source args */ +static void rpmQVSourceArgCallback( /*@unused@*/ poptContext con, + /*@unused@*/ enum poptCallbackReason reason, + const struct poptOption * opt, + /*@unused@*/ const char * arg, + /*@unused@*/ const void * data) + /*@globals rpmQVKArgs @*/ + /*@modifies rpmQVKArgs @*/ +{ + QVA_t qva = &rpmQVKArgs; + + switch (opt->val) { + case 'q': /* from --query, -q */ + case 'Q': /* from --querytags (handled by poptALL) */ + case 'V': /* from --verify, -V */ + case 'A': /* from --addsign */ + case 'D': /* from --delsign */ + case 'I': /* from --import */ + case 'K': /* from --checksig, -K */ + case 'R': /* from --resign */ + if (qva->qva_mode == '\0' || strchr("qQ ", qva->qva_mode)) { + qva->qva_mode = opt->val; + qva->qva_char = ' '; + } + break; + case 'a': *((unsigned *)&qva->qva_source) |= RPMQV_ALL; qva->qva_sourceCount++; break; + case 'f': *((unsigned *)&qva->qva_source) |= RPMQV_PATH; qva->qva_sourceCount++; break; + case 'g': *((unsigned *)&qva->qva_source) |= RPMQV_GROUP; qva->qva_sourceCount++; break; + case 'p': *((unsigned *)&qva->qva_source) |= RPMQV_RPM; qva->qva_sourceCount++; break; + case POPT_WHATNEEDS: *((unsigned *)&qva->qva_source) |= RPMQV_WHATNEEDS; + qva->qva_sourceCount++; break; + case POPT_WHATPROVIDES: *((unsigned *)&qva->qva_source) |= RPMQV_WHATPROVIDES; + qva->qva_sourceCount++; break; + case POPT_WHATREQUIRES: *((unsigned *)&qva->qva_source) |= RPMQV_WHATREQUIRES; + qva->qva_sourceCount++; break; + case POPT_WHATCONFLICTS: *((unsigned *)&qva->qva_source) |= RPMQV_WHATCONFLICTS; + qva->qva_sourceCount++; break; + case POPT_WHATOBSOLETES: *((unsigned *)&qva->qva_source) |= RPMQV_WHATOBSOLETES; + qva->qva_sourceCount++; break; + case POPT_TRIGGEREDBY: *((unsigned *)&qva->qva_source) |= RPMQV_TRIGGEREDBY; + qva->qva_sourceCount++; break; + case POPT_QUERYBYSOURCEPKGID: *((unsigned *)&qva->qva_source) |= RPMQV_SOURCEPKGID; + qva->qva_sourceCount++; break; + case POPT_QUERYBYPKGID: *((unsigned *)&qva->qva_source) |= RPMQV_PKGID; + qva->qva_sourceCount++; break; + case POPT_QUERYBYHDRID: *((unsigned *)&qva->qva_source) |= RPMQV_HDRID; + qva->qva_sourceCount++; break; + case POPT_QUERYBYFILEID: *((unsigned *)&qva->qva_source) |= RPMQV_FILEID; + qva->qva_sourceCount++; break; + case POPT_QUERYBYTID: *((unsigned *)&qva->qva_source) |= RPMQV_TID; + qva->qva_sourceCount++; break; + case POPT_HDLIST: *((unsigned *)&qva->qva_source) |= RPMQV_HDLIST; + qva->qva_sourceCount++; break; + case POPT_FTSWALK: *((unsigned *)&qva->qva_source) |= RPMQV_FTSWALK; + qva->qva_sourceCount++; break; + +/* XXX SPECFILE is not verify sources */ + case POPT_SPECFILE: + *((unsigned *)&qva->qva_source) |= RPMQV_SPECFILE; + qva->qva_sourceCount++; + break; +/* XXX SPECSRPM is not verify sources */ + case POPT_SPECSRPM: + *((unsigned *)&qva->qva_source) |= RPMQV_SPECSRPM; + qva->qva_sourceCount++; + break; + case POPT_QUERYBYNUMBER: + *((unsigned *)&qva->qva_source) |= RPMQV_DBOFFSET; + qva->qva_sourceCount++; + break; + + case POPT_NOPASSWORD: + qva->nopassword = 1; + break; + + } +} + +/** + * Common query/verify mode options. + */ +/*@unchecked@*/ +struct poptOption rpmQVSourcePoptTable[] = { +/*@-type@*/ /* FIX: cast? */ + { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA, + (void *) rpmQVSourceArgCallback, 0, NULL, NULL }, +/*@=type@*/ + { "all", 'a', 0, NULL, 'a', + N_("query/verify all packages"), NULL }, + { "checksig", 'K', POPT_ARGFLAG_DOC_HIDDEN, NULL, 'K', + N_("rpm checksig mode"), NULL }, + { "file", 'f', 0, NULL, 'f', + N_("query/verify package(s) owning file"), "FILE" }, + { "group", 'g', 0, NULL, 'g', + N_("query/verify package(s) in group"), "GROUP" }, + { "package", 'p', 0, NULL, 'p', + N_("query/verify a package file"), NULL }, + + { "ftswalk", 'W', 0, NULL, POPT_FTSWALK, + N_("query/verify package(s) from TOP file tree walk"), "TOP" }, + { "hdlist", 'H', POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_HDLIST, + N_("query/verify package(s) from system HDLIST"), "HDLIST" }, + + { "sourcepkgid", '\0', 0, NULL, POPT_QUERYBYSOURCEPKGID, + N_("query/verify package(s) with source package identifier"), "MD5" }, + { "pkgid", '\0', 0, NULL, POPT_QUERYBYPKGID, + N_("query/verify package(s) with package identifier"), "MD5" }, + { "hdrid", '\0', 0, NULL, POPT_QUERYBYHDRID, + N_("query/verify package(s) with header identifier"), "SHA1" }, + { "fileid", '\0', 0, NULL, POPT_QUERYBYFILEID, + N_("query/verify package(s) with file identifier"), "MD5" }, + + { "query", 'q', POPT_ARGFLAG_DOC_HIDDEN, NULL, 'q', + N_("rpm query mode"), NULL }, + { "querybynumber", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, POPT_QUERYBYNUMBER, + N_("query/verify a header instance"), "HDRNUM" }, + { "specfile", '\0', 0, NULL, POPT_SPECFILE, + N_("query a spec file"), N_("") }, + { "specsrpm", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, POPT_SPECSRPM, + N_("query source metadata from spec file parse"), N_("") }, + { "tid", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, POPT_QUERYBYTID, + N_("query/verify package(s) from install transaction"), "TID" }, + { "triggeredby", '\0', 0, NULL, POPT_TRIGGEREDBY, + N_("query the package(s) triggered by the package"), "PACKAGE" }, + { "verify", 'V', POPT_ARGFLAG_DOC_HIDDEN, NULL, 'V', + N_("rpm verify mode"), NULL }, + { "whatrequires", '\0', 0, NULL, POPT_WHATREQUIRES, + N_("query/verify the package(s) which require a dependency"), "CAPABILITY" }, + { "whatneeds", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, POPT_WHATNEEDS, + N_("query/verify the package(s) which require any contained provide"), + "CAPABILITY" }, + + { "whatprovides", '\0', 0, NULL, POPT_WHATPROVIDES, + N_("query/verify the package(s) which provide a dependency"), "CAPABILITY" }, + { "whatconflicts", '\0', 0, NULL, POPT_WHATCONFLICTS, + N_("query/verify the package(s) which conflict with a dependency"), "CAPABILITY" }, + { "whatobsoletes", '\0', 0, NULL, POPT_WHATOBSOLETES, + N_("query/verify the package(s) which obsolete a dependency"), "CAPABILITY" }, + + { "transaction", 'T', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &giFlags, (RPMGI_TSADD|RPMGI_TSORDER), + N_("create transaction set"), NULL}, +#ifdef DYING /* XXX breaks --noorder in poptI.c */ + { "noorder", '\0', POPT_BIT_CLR|POPT_ARGFLAG_DOC_HIDDEN, &giFlags, RPMGI_TSORDER, + N_("do not order transaction set"), NULL}, +#endif + { "noglob", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &giFlags, RPMGI_NOGLOB, + N_("do not glob arguments"), NULL}, + { "nomanifest", '\0', POPT_BIT_SET, &giFlags, RPMGI_NOMANIFEST, + N_("do not process non-package files as manifests"), NULL}, + { "noheader", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &giFlags, RPMGI_NOHEADER, + N_("do not read headers"), NULL}, + + + POPT_TABLEEND +}; + +/* ========== Query specific popt args */ + +static void queryArgCallback(poptContext con, + /*@unused@*/ enum poptCallbackReason reason, + const struct poptOption * opt, const char * arg, + /*@unused@*/ const void * data) + /*@globals rpmQVKArgs @*/ + /*@modifies con, rpmQVKArgs @*/ +{ + QVA_t qva = &rpmQVKArgs; + + /* XXX avoid accidental collisions with POPT_BIT_SET for flags */ + if (opt->arg == NULL) + switch (opt->val) { + case 'c': *((unsigned *)&qva->qva_flags) |= QUERY_FOR_CONFIG | QUERY_FOR_LIST; break; + case 'd': *((unsigned *)&qva->qva_flags) |= QUERY_FOR_DOCS | QUERY_FOR_LIST; break; + case 'l': *((unsigned *)&qva->qva_flags) |= QUERY_FOR_LIST; break; + case 's': *((unsigned *)&qva->qva_flags) |= QUERY_FOR_STATE | QUERY_FOR_LIST; + break; + case POPT_DUMP: *((unsigned *)&qva->qva_flags) |= QUERY_FOR_DUMPFILES | QUERY_FOR_LIST; + break; + + case POPT_QUERYFORMAT: + if (arg) { + char * qf = (char *)qva->qva_queryFormat; + char * b = NULL; + size_t nb = 0; + + /* Read queryformat from file. */ + if (arg[0] == '/') { + const char * fn = arg; + int rc; + + rc = poptReadFile(fn, &b, &nb, POPT_READFILE_TRIMNEWLINES); + if (rc != 0) + goto _qfexit; + if (b == NULL || nb == 0) /* XXX can't happen */ + goto _qfexit; + /* XXX trim double quotes */ + if (*b == '"') { + while (nb > 0 && b[nb] != '"') + b[nb--] = '\0'; + b[nb] = '\0'; + arg = b + 1; + } else + arg = b; + } + + /* Append to existing queryformat. */ + if (qf) { + size_t len = strlen(qf) + strlen(arg) + 1; + qf = (char *) xrealloc(qf, len); + strcat(qf, arg); + } else { + qf = (char *) xmalloc(strlen(arg) + 1); + strcpy(qf, arg); + } + qva->qva_queryFormat = qf; + + _qfexit: + b = _free(b); + } + break; + + case 'i': + if (qva->qva_mode == 'q') { + /*@-nullassign -readonlytrans@*/ + const char * infoCommand[] = { "--info", NULL }; + /*@=nullassign =readonlytrans@*/ + (void) poptStuffArgs(con, infoCommand); + } + break; + + case RPMCLI_POPT_NODIGEST: + *((unsigned *)&qva->qva_flags) |= VERIFY_DIGEST; + break; + + case RPMCLI_POPT_NOSIGNATURE: + *((unsigned *)&qva->qva_flags) |= VERIFY_SIGNATURE; + break; + + case RPMCLI_POPT_NOHDRCHK: + *((unsigned *)&qva->qva_flags) |= VERIFY_HDRCHK; + break; + + case RPMCLI_POPT_NODEPS: + *((unsigned *)&qva->qva_flags) |= VERIFY_DEPS; + break; + + case RPMCLI_POPT_NOFDIGESTS: + *((unsigned *)&qva->qva_flags) |= VERIFY_FDIGEST; + break; + + case RPMCLI_POPT_NOCONTEXTS: + *((unsigned *)&qva->qva_flags) |= VERIFY_CONTEXTS; + break; + + case RPMCLI_POPT_NOSCRIPTS: + *((unsigned *)&qva->qva_flags) |= VERIFY_SCRIPT; + break; + + case RPMCLI_POPT_NOHMACS: + *((unsigned *)&qva->qva_flags) |= VERIFY_HMAC; + break; + + /* XXX perhaps POPT_ARG_INT instead of callback. */ + case POPT_TRUST: + { char * end = NULL; + long trust = (int) strtol(arg, &end, 0); + /* XXX range checks on trust. */ + /* XXX if (end && *end) argerror(_("non-numeric trust metric.")); */ + qva->trust = trust; + } break; + } +} + +/** + * Query mode options. + */ +/*@unchecked@*/ +struct poptOption rpmQueryPoptTable[] = { +/*@-type@*/ /* FIX: cast? */ + { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, + (void *) queryArgCallback, 0, NULL, NULL }, +/*@=type@*/ + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmQVSourcePoptTable, 0, + NULL, NULL }, + { "configfiles", 'c', 0, 0, 'c', + N_("list all configuration files"), NULL }, + { "docfiles", 'd', 0, 0, 'd', + N_("list all documentation files"), NULL }, + { "dump", '\0', 0, 0, POPT_DUMP, + N_("dump basic file information"), NULL }, + { NULL, 'i', POPT_ARGFLAG_DOC_HIDDEN, 0, 'i', + NULL, NULL }, + { "list", 'l', 0, 0, 'l', + N_("list files in package"), NULL }, + + { "aid", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.depFlags, RPMDEPS_FLAG_ADDINDEPS, + N_("add suggested packages to transaction"), NULL }, + + /* Duplicate file attr flags from packages into command line options. */ + { "noconfig", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.qva_fflags, RPMFILE_CONFIG, + N_("skip %%config files"), NULL }, + { "nodoc", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.qva_fflags, RPMFILE_DOC, + N_("skip %%doc files"), NULL }, + { "noghost", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.qva_fflags, RPMFILE_GHOST, + N_("skip %%ghost files"), NULL }, +#ifdef NOTEVER /* XXX there's hardly a need for these */ + { "nolicense", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.qva_fflags, RPMFILE_LICENSE, + N_("skip %%license files"), NULL }, + { "noreadme", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.qva_fflags, RPMFILE_README, + N_("skip %%readme files"), NULL }, +#endif + + { "qf", '\0', POPT_ARG_STRING | POPT_ARGFLAG_DOC_HIDDEN, 0, + POPT_QUERYFORMAT, NULL, NULL }, + { "queryformat", '\0', POPT_ARG_STRING, 0, POPT_QUERYFORMAT, + N_("use the following query format"), N_("QUERYFORMAT") }, + { "specedit", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &specedit, -1, + N_("substitute i18n sections into spec file"), NULL }, + { "state", 's', 0, 0, 's', + N_("display the states of the listed files"), NULL }, + { "target", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, 0, RPMCLI_POPT_TARGETPLATFORM, + N_("specify target platform"), N_("CPU-VENDOR-OS") }, + POPT_TABLEEND +}; + +/** + * Verify mode options. + */ +struct poptOption rpmVerifyPoptTable[] = { +/*@-type@*/ /* FIX: cast? */ + { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, + (void *) queryArgCallback, 0, NULL, NULL }, +/*@=type@*/ + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmQVSourcePoptTable, 0, + NULL, NULL }, + + { "aid", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.depFlags, RPMDEPS_FLAG_ADDINDEPS, + N_("add suggested packages to transaction"), NULL }, + + /* Duplicate file attr flags from packages into command line options. */ + { "noconfig", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.qva_fflags, RPMFILE_CONFIG, + N_("skip %%config files"), NULL }, + { "nodoc", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.qva_fflags, RPMFILE_DOC, + N_("skip %%doc files"), NULL }, + + /* Duplicate file verify flags from packages into command line options. */ +/** @todo Add --nomd5 alias to rpmpopt, eliminate. */ +#ifdef DYING + { "nomd5", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_FDIGEST, + N_("don't verify file digests"), NULL }, +#else + { "nomd5", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NOFDIGESTS, + N_("don't verify file digests"), NULL }, + { "nofdigests", '\0', 0, NULL, RPMCLI_POPT_NOFDIGESTS, + N_("don't verify file digests"), NULL }, +#endif + { "nosize", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.qva_flags, VERIFY_SIZE, + N_("don't verify size of files"), NULL }, + { "nolinkto", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.qva_flags, VERIFY_LINKTO, + N_("don't verify symlink path of files"), NULL }, + { "nouser", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.qva_flags, VERIFY_USER, + N_("don't verify owner of files"), NULL }, + { "nogroup", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.qva_flags, VERIFY_GROUP, + N_("don't verify group of files"), NULL }, + { "nomtime", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.qva_flags, VERIFY_MTIME, + N_("don't verify modification time of files"), NULL }, + { "nomode", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.qva_flags, VERIFY_MODE, + N_("don't verify mode of files"), NULL }, + { "nordev", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.qva_flags, VERIFY_RDEV, + N_("don't verify mode of files"), NULL }, + + { "nohmacs", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NOHMACS, + N_("don't verify file HMAC's"), NULL }, + { "nocontexts", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NOCONTEXTS, + N_("don't verify file security contexts"), NULL }, + { "nofiles", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_FILES, + N_("don't verify files in package"), NULL}, +#ifdef DYING + { "nodeps", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_DEPS, + N_("don't verify package dependencies"), NULL }, +#else + { "nodeps", '\0', 0, NULL, RPMCLI_POPT_NODEPS, + N_("don't verify package dependencies"), NULL }, +#endif + +#ifdef DYING + { "noscript", '\0', POPT_BIT_SET,&rpmQVKArgs.qva_flags, VERIFY_SCRIPT, + N_("don't execute verify script(s)"), NULL }, + /* XXX legacy had a trailing s on --noscript */ + { "noscripts", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.qva_flags, VERIFY_SCRIPT, + N_("don't execute verify script(s)"), NULL }, +#else + { "noscript", '\0', 0, NULL, RPMCLI_POPT_NOSCRIPTS, + N_("don't execute verify script(s)"), NULL }, + /* XXX legacy had a trailing s on --noscript */ + { "noscripts", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NOSCRIPTS, + N_("don't execute verify script(s)"), NULL }, +#endif + +#ifdef DYING + { "nodigest", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_DIGEST, + N_("don't verify package digest(s)"), NULL }, + { "nohdrchk", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.qva_flags, VERIFY_HDRCHK, + N_("don't verify database header(s) when retrieved"), NULL }, + { "nosignature", '\0', POPT_BIT_SET, + &rpmQVKArgs.qva_flags, VERIFY_SIGNATURE, + N_("don't verify package signature(s)"), NULL }, +#else + { "nodigest", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, RPMCLI_POPT_NODIGEST, + N_("don't verify package digest(s)"), NULL }, + { "nohdrchk", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, RPMCLI_POPT_NOHDRCHK, + N_("don't verify database header(s) when retrieved"), NULL }, + { "nosignature", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, RPMCLI_POPT_NOSIGNATURE, + N_("don't verify package signature(s)"), NULL }, +#endif + + POPT_TABLEEND +}; + +/** + * Signature mode options. + */ +/*@unchecked@*/ +struct poptOption rpmSignPoptTable[] = { +/*@-type@*/ /* FIX: cast? */ + { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE, + (void *) rpmQVSourceArgCallback, 0, NULL, NULL }, +/*@=type@*/ + { "addsign", '\0', 0, NULL, 'A', + N_("sign package(s) (identical to --resign)"), NULL }, + { "checksig", 'K', 0, NULL, 'K', + N_("verify package signature(s)"), NULL }, + { "delsign", '\0', 0, NULL, 'D', + N_("delete package signatures"), NULL }, + { "import", '\0', 0, NULL, 'I', + N_("import an armored public key"), NULL }, + { "resign", '\0', 0, NULL, 'R', + N_("sign package(s) (identical to --addsign)"), NULL }, + { "sign", '\0', POPT_ARGFLAG_DOC_HIDDEN, &rpmQVKArgs.sign, 0, + N_("generate signature"), NULL }, + + { "trust", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_TRUST, + N_("specify trust metric"), N_("TRUST") }, + { "trusted", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.trust, 1, + N_("set ultimate trust when importing pubkey(s)"), NULL }, + { "untrusted", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.trust, -1, + N_("unset ultimate trust when importing pubkey(s)"), NULL }, + { "nopassword", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_NOPASSWORD, + N_("disable password challenge"), NULL }, + /* XXX perhaps POPT_ARG_INT instead of callback. */ + + { "nodigest", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_DIGEST, + N_("don't verify package digest(s)"), NULL }, + { "nohdrchk", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.qva_flags, VERIFY_HDRCHK, + N_("don't verify database header(s) when retrieved"), NULL }, + { "nosignature", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_SIGNATURE, + N_("don't verify package signature(s)"), NULL }, + + POPT_TABLEEND +}; diff --git a/rpm-5.4.9/lib/psm.c b/rpm-5.4.9/lib/psm.c new file mode 100644 index 0000000..07155f6 --- /dev/null +++ b/rpm-5.4.9/lib/psm.c @@ -0,0 +1,3155 @@ +/** \ingroup rpmts payload + * \file lib/psm.c + * Package state machine to handle a package from a transaction set. + */ + +#include "system.h" + +#define _MIRE_INTERNAL /* XXX mireApply doesn't tell which pattern matched. */ + +#include /* XXX FDSTAT_READ */ +#include /* XXX fnpyKey */ +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(WITH_LUA) || defined(WITH_AUGEAS) || defined(WITH_FICL) || defined(WITH_GPSEE) || defined(WITH_PERLEMBED) || defined(WITH_PYTHONEMBED) || defined(WITH_RUBYEMBED) || defined(WITH_SEMANAGE) || defined(WITH_SQLITE) || defined(WITH_SQUIRREL) || defined(WITH_TCL) +#define _WITH_EMBEDDED +#else +#undef _WITH_ENBEDDED +#endif + +#include +#include +#include +#define _RPMDB_INTERNAL +#include /* XXX for db_chrootDone */ +#include +#include "signature.h" /* signature constants */ +#include + +#define _RPMFI_INTERNAL +#include "rpmfi.h" +#include "fsm.h" /* XXX CPIO_FOO/IOSM_FOO constants */ +#define _RPMSQ_INTERNAL +#define _RPMPSM_INTERNAL +#include "psm.h" +#define F_ISSET(_psm, _FLAG) ((_psm)->flags & (RPMPSM_FLAGS_##_FLAG)) +#define F_SET(_psm, _FLAG) \ + (*((unsigned *)&(_psm)->flags) |= (RPMPSM_FLAGS_##_FLAG)) +#define F_CLR(_psm, _FLAG) \ + (*((unsigned *)&(_psm)->flags) &= ~(RPMPSM_FLAGS_##_FLAG)) + +#define _RPMEVR_INTERNAL +#include "rpmds.h" + +#define _RPMTE_INTERNAL +#include "rpmte.h" + +#define _RPMTS_INTERNAL /* XXX ts->notify */ +#include "rpmts.h" + +#include "misc.h" /* XXX rpmMkdirPath, makeTempFile, doputenv */ + +#include + +#include "debug.h" + +#define _PSM_DEBUG 0 +/*@unchecked@*/ +int _psm_debug = _PSM_DEBUG; +/*@unchecked@*/ +int _psm_threads = 0; + +/*@access FD_t @*/ /* XXX void * arg */ +/*@access Header @*/ /* XXX void * arg */ +/*@access miRE @*/ + +/*@access rpmpsm @*/ + +/*@access rpmfi @*/ +/*@access rpmte @*/ /* XXX rpmInstallSourcePackage */ +/*@access rpmts @*/ /* XXX ts->notify */ + +/*@access rpmluav @*/ + +#ifdef __cplusplus +GENfree(HE_t) +GENfree(int *) +GENfree(const struct stat *) +#endif /* __cplusplus */ + +#ifdef DYING +/** + * Mark files in database shared with this package as "replaced". + * @param psm package state machine data + * @return 0 always + */ +static rpmRC markReplacedFiles(const rpmpsm psm) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + const rpmts ts = psm->ts; + rpmte te = psm->te; + rpmfi fi = psm->fi; + sharedFileInfo replaced = (te ? te->replaced : NULL); + sharedFileInfo sfi; + rpmmi mi; + Header h; + uint32_t * offsets; + rpmuint32_t prev; + int num; + int xx; + + if (!(rpmfiFC(fi) > 0 && replaced != NULL)) + return RPMRC_OK; + + num = prev = 0; + for (sfi = replaced; sfi->otherPkg; sfi++) { + if (prev && prev == sfi->otherPkg) + continue; + prev = sfi->otherPkg; + num++; + } + if (num == 0) + return RPMRC_OK; + + offsets = (uint32_t *) alloca(num * sizeof(*offsets)); + offsets[0] = 0; + num = prev = 0; + for (sfi = replaced; sfi->otherPkg; sfi++) { + if (prev && prev == sfi->otherPkg) + continue; + prev = sfi->otherPkg; + offsets[num++] = sfi->otherPkg; + } + + mi = rpmtsInitIterator(ts, RPMDBI_PACKAGES, NULL, 0); + xx = rpmmiGrow(mi, offsets, num); + xx = rpmmiSetRewrite(mi, 1); + + sfi = replaced; + while ((h = rpmmiNext(mi)) != NULL) { + int modified; + + modified = 0; + + /* XXX FIXME: not correct yet, but headerGetEntry needs to die now! */ + he->tag = RPMTAG_FILESTATES; + xx = headerGet(h, he, 0); + if (!xx) + continue; + + prev = rpmmiInstance(mi); + num = 0; + while (sfi->otherPkg && sfi->otherPkg == prev) { +assert(sfi->otherFileNum < he->c); + if (he->p.ui8p[sfi->otherFileNum] != RPMFILE_STATE_REPLACED) { + he->p.ui8p[sfi->otherFileNum] = RPMFILE_STATE_REPLACED; + if (modified == 0) { + /* Modified header will be rewritten. */ + modified = 1; + xx = rpmmiSetModified(mi, modified); + } + num++; + } + sfi++; + } + he->p.ptr = _free(he->p.ptr); + } + mi = rpmmiFree(mi); + + return RPMRC_OK; +} +#endif + +static rpmRC createDir(rpmts ts, rpmfi fi, const char ** fn, const char * name) + /*@globals rpmGlobalMacroContext @*/ + /*@modifies *fn, rpmGlobalMacroContext @*/ +{ + const char * N = rpmGenPath(rpmtsRootDir(ts), name, ""); + char * t = xstrdup(name+2); + rpmRC rc; + + t[strlen(t)-1] = '\0'; + + rc = rpmMkdirPath(N, t+1); + if (rc != RPMRC_OK) { + if (Access(N, W_OK)) + rpmlog(RPMLOG_ERR, _("cannot write to %%%s %s\n"), t, N); + else if (fi) + Chown(N, fi->uid, fi->gid); + } + + if (fn) + *fn = N; + else + N = _free(N); + t = _free(t); + + return rc; +} + +rpmRC rpmInstallSourcePackage(rpmts ts, void * _fd, + const char ** specFilePtr, const char ** cookie) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + FD_t fd = (FD_t) _fd; + rpmfi fi = NULL; + rpmte p = NULL; + rpmpsm psm = NULL; + Header h = NULL; + int isSource; + rpmRC rc; + int i; + +/*@-mods@*/ /* Avoid void * _fd annotations for now. */ + rc = rpmReadPackageFile(ts, fd, __FUNCTION__, &h); +/*@=mods@*/ + switch (rc) { + case RPMRC_NOTTRUSTED: + case RPMRC_NOKEY: + case RPMRC_OK: + break; + default: + goto exit; + /*@notreached@*/ break; + } + if (h == NULL) + goto exit; + + rc = RPMRC_FAIL; /* assume failure */ + + isSource = + (headerIsEntry(h, RPMTAG_SOURCERPM) == 0 && + headerIsEntry(h, RPMTAG_ARCH) != 0); + + if (!isSource) { + rpmlog(RPMLOG_ERR, _("source package expected, binary found\n")); + goto exit; + } + + (void) rpmtsAddInstallElement(ts, h, NULL, 0, NULL); + + p = rpmtsElement(ts, 0); +assert(p->h == NULL); + (void) rpmteSetHeader(p, h); +/*@-mods@*/ /* LCL: avoid void * _fd annotation for now. */ +/*@-assignexpose -castexpose -temptrans @*/ + p->fd = fdLink(fd, __FUNCTION__); +/*@=assignexpose =castexpose =temptrans @*/ +/*@=mods@*/ + + fi = rpmteFI(p, RPMTAG_BASENAMES); + fi->h = headerLink(h); +/*@-onlytrans@*/ /* FIX: te reference */ + fi->te = p; +/*@=onlytrans@*/ + + /* XXX FIXME: don't do per-file mapping, force global flags. */ + fi->fmapflags = _free(fi->fmapflags); + fi->mapflags = IOSM_MAP_PATH | IOSM_MAP_MODE | IOSM_MAP_UID | IOSM_MAP_GID; + + fi->uid = getuid(); + fi->gid = getgid(); +#if defined(RPM_VENDOR_OPENPKG) /* switch-from-susr-to-musr-on-srpm-install */ + /* If running as the OpenPKG "susr", do not unpack source RPM + packages with "susr" file ownerships as the OpenPKG Set-UID + wrapper switches from "musr" to "susr" on "openpkg rpm -Uvh + *.src.rpm". As a result the installed files could be never + removed again by "musr". It is more consistent to always unpack + as "musr" if possible. */ + if (fi->uid == 0) { + char *muid_str; + char *mgid_str; + uid_t muid; + gid_t mgid; + if ((muid_str = rpmExpand("%{l_muid}", NULL)) != NULL) + if ((muid = (uid_t)strtol(muid_str, (char **)NULL, 10)) > 0) + fi->uid = muid; + if ((mgid_str = rpmExpand("%{l_mgid}", NULL)) != NULL) + if ((mgid = (gid_t)strtol(mgid_str, (char **)NULL, 10)) > 0) + fi->gid = mgid; + } +#endif + for (i = 0; i < (int)fi->fc; i++) + fi->actions[i] = FA_CREATE; + + /* Load relative (in a *.src.rpm) file paths as an argv array. */ + fi->astriplen = 0; + fi->striplen = 0; + he->tag = RPMTAG_FILEPATHS; + if (!headerGet(h, he, 0) || he->p.argv == NULL || he->p.argv[0] == NULL) + goto exit; + fi->apath = he->p.argv; + + (void) headerMacrosLoad(h); + +#if defined(RPM_VENDOR_OPENPKG) /* switch-from-susr-to-musr-on-srpm-install */ + if (createDir(ts, fi, NULL, "%{_topdir}") + || createDir(ts, fi, NULL, "%{_builddir}") + || createDir(ts, fi, NULL, "%{_rpmdir}") + || createDir(ts, fi, NULL, "%{_srcrpmdir}") + || createDir(ts, fi, NULL, "%{_sourcedir}") + || createDir(ts, fi, NULL, "%{_specdir}")) +#else + if (createDir(ts, NULL, NULL, "%{_topdir}") + || createDir(ts, NULL, NULL, "%{_builddir}") + || createDir(ts, NULL, NULL, "%{_rpmdir}") + || createDir(ts, NULL, NULL, "%{_srcrpmdir}") + || createDir(ts, NULL, NULL, "%{_sourcedir}") + || createDir(ts, NULL, NULL, "%{_specdir}")) +#endif + goto exit; + + /* Retrieve build cookie. */ + if (cookie) { + *cookie = NULL; + he->tag = RPMTAG_COOKIE; + if (headerGet(h, he, 0)) *cookie = he->p.str; + } + + /* Find spec file path. */ + if (specFilePtr) { + *specFilePtr = NULL; + fi = rpmfiInit(fi, 0); + while ((i = rpmfiNext(fi)) >= 0) { + if (!(rpmfiFFlags(fi) & RPMFILE_SPECFILE)) + continue; + *specFilePtr = xstrdup(rpmfiFN(fi)); + break; + } + if (*specFilePtr == NULL) { + rpmlog(RPMLOG_ERR, _("source package contains no .spec file\n")); + goto exit; + } + } + + /* Unpack the SRPM contents. */ + psm = rpmpsmNew(ts, p, fi); + psm->goal = PSM_PKGINSTALL; + rc = rpmpsmStage(psm, PSM_PROCESS); + (void) rpmpsmStage(psm, PSM_FINI); + psm = rpmpsmFree(psm, __FUNCTION__); + +exit: + if (rc != RPMRC_OK) { + if (specFilePtr) *specFilePtr = _free(*specFilePtr); + if (cookie) *cookie = _free(*cookie); + } + + if (fi) + fi->te = NULL; + + if (p) { + (void) rpmteSetHeader(p, NULL); +/*@-mods@*/ /* Avoid void * _fd annotations for now. */ + if (p->fd != NULL) + (void) Fclose(p->fd); +/*@=mods@*/ + p->fd = NULL; + } + + /* XXX nuke the added package(s). */ + rpmtsClean(ts); + + (void) headerFree(h); + h = NULL; + + return rc; +} + +/*@observer@*/ /*@unchecked@*/ +static const char * SCRIPT_PATH = + "PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin"; + +/** + * Return scriptlet name from tag. + * @param tag scriptlet tag + * @return name of scriptlet + */ +static /*@observer@*/ const char * tag2sln(rpmTag tag) + /*@*/ +{ + switch (tag) { + case RPMTAG_PRETRANS: return "%pretrans"; + case RPMTAG_TRIGGERPREIN: return "%triggerprein"; + case RPMTAG_PREIN: return "%pre"; + case RPMTAG_POSTIN: return "%post"; + case RPMTAG_TRIGGERIN: return "%triggerin"; + case RPMTAG_TRIGGERUN: return "%triggerun"; + case RPMTAG_PREUN: return "%preun"; + case RPMTAG_POSTUN: return "%postun"; + case RPMTAG_POSTTRANS: return "%posttrans"; + case RPMTAG_TRIGGERPOSTUN: return "%triggerpostun"; + case RPMTAG_VERIFYSCRIPT: return "%verify"; + case RPMTAG_SANITYCHECK: return "%sanitycheck"; + case RPMTAG_BUILDPREP: return "%prep"; + case RPMTAG_BUILDBUILD: return "%build"; + case RPMTAG_BUILDINSTALL: return "%install"; + case RPMTAG_BUILDCHECK: return "%check"; + default: break; + } + return "%unknownscript"; +} + +/** + * Return scriptlet id from tag. + * @param tag scriptlet tag + * @return id of scriptlet + */ +static rpmScriptID tag2slx(rpmTag tag) + /*@*/ +{ + switch (tag) { + case RPMTAG_PRETRANS: return RPMSCRIPT_PRETRANS; + case RPMTAG_TRIGGERPREIN: return RPMSCRIPT_TRIGGERPREIN; + case RPMTAG_PREIN: return RPMSCRIPT_PREIN; + case RPMTAG_POSTIN: return RPMSCRIPT_POSTIN; + case RPMTAG_TRIGGERIN: return RPMSCRIPT_TRIGGERIN; + case RPMTAG_TRIGGERUN: return RPMSCRIPT_TRIGGERUN; + case RPMTAG_PREUN: return RPMSCRIPT_PREUN; + case RPMTAG_POSTUN: return RPMSCRIPT_POSTUN; + case RPMTAG_POSTTRANS: return RPMSCRIPT_POSTTRANS; + case RPMTAG_TRIGGERPOSTUN: return RPMSCRIPT_TRIGGERPOSTUN; + case RPMTAG_VERIFYSCRIPT: return RPMSCRIPT_VERIFY; + case RPMTAG_SANITYCHECK: return RPMSCRIPT_SANITYCHECK; + case RPMTAG_BUILDPREP: return RPMSCRIPT_PREP; + case RPMTAG_BUILDBUILD: return RPMSCRIPT_BUILD; + case RPMTAG_BUILDINSTALL: return RPMSCRIPT_INSTALL; + case RPMTAG_BUILDCHECK: return RPMSCRIPT_CHECK; + default: break; + } + return RPMSCRIPT_MAX; +} + +/** + * Wait for child process to be reaped. + * @param psm package state machine data + * @return + */ +static pid_t psmWait(rpmpsm psm) + /*@globals fileSystem, internalState @*/ + /*@modifies psm, fileSystem, internalState @*/ +{ + const rpmts ts = psm->ts; + rpmtime_t msecs; + + (void) rpmsqWait(&psm->sq); + msecs = psm->sq.op.usecs/1000; + (void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_SCRIPTLETS), &psm->sq.op); + + rpmlog(RPMLOG_DEBUG, + D_("%s: waitpid(%d) rc %d status %x secs %u.%03u\n"), + psm->stepName, (unsigned)psm->sq.child, + (unsigned)psm->sq.reaped, psm->sq.status, + (unsigned)msecs/1000, (unsigned)msecs%1000); + + if (psm->sstates != NULL) + { rpmuint32_t * ssp = psm->sstates + tag2slx(psm->scriptTag); + *ssp &= ~0xffff; + *ssp |= (psm->sq.status & 0xffff); + *ssp |= RPMSCRIPT_STATE_REAPED; + } + + return psm->sq.reaped; +} + +#ifdef WITH_LUA +/** + * Run internal Lua script. + * @param psm package state machine data + * @param sln name of scriptlet section + * @param Phe scriptlet args, Phe->p.argv[0] is interpreter to use + * @param script scriptlet body + * @param arg1 no. instances of package installed after scriptlet exec + * (-1 is no arg) + * @param arg2 ditto, but for the target package + * @return RPMRC_OK on success + */ +static rpmRC runLuaScript(rpmpsm psm, const char * sln, HE_t Phe, + const char *script, int arg1, int arg2) + /*@globals fileSystem, internalState @*/ + /*@modifies psm, fileSystem, internalState @*/ +{ + rpmRC rc = RPMRC_OK; + int xx; + rpmlua lua = NULL; /* Global state. */ + rpmluav var; + + /* Create arg variable */ + rpmluaPushTable(lua, "arg"); + var = rpmluavNew(); + rpmluavSetListMode(var, 1); +/*@+relaxtypes@*/ + if (Phe->p.argv) { + int i; + for (i = 0; i < (int)Phe->c && Phe->p.argv[i]; i++) { + rpmluavSetValue(var, RPMLUAV_STRING, Phe->p.argv[i]); + rpmluaSetVar(lua, var); + } + } + if (arg1 >= 0) { + rpmluavSetValueNum(var, arg1); + rpmluaSetVar(lua, var); + } + if (arg2 >= 0) { + rpmluavSetValueNum(var, arg2); + rpmluaSetVar(lua, var); + } +/*@=relaxtypes@*/ +/*@-moduncon@*/ + var = (rpmluav) rpmluavFree(var); +/*@=moduncon@*/ + rpmluaPop(lua); + + { char buf[BUFSIZ]; + xx = snprintf(buf, BUFSIZ, "%s(%s)", sln, psm->NVRA); + xx = rpmluaRunScript(lua, script, buf); + if (xx == -1) { + void * ptr = rpmtsNotify(psm->ts, psm->te, RPMCALLBACK_SCRIPT_ERROR, + psm->scriptTag, 1); + ptr = ptr; /* XXX keep gcc happy. */ + rc = RPMRC_FAIL; + } else + rc = RPMRC_OK; + } + rpmluaDelVar(lua, "arg"); + + return rc; +} +#endif /* WITH_LUA */ + +#if defined(_WITH_EMBEDDED) +static int enterChroot(rpmpsm psm, int * pwdFdnop, int * rootFdnop) + /*@globals fileSystem, internalState @*/ + /*@modifies *pwdFdnop, *rootFdnop, fileSystem, internalState @*/ +{ + const rpmts ts = psm->ts; + int inChroot; + int xx; + + /* Save the current working directory. */ + if (pwdFdnop) + (*pwdFdnop) = open(".", O_RDONLY, 0); + + /* Save the current root directory. */ + if (rootFdnop) + (*rootFdnop) = open("/", O_RDONLY, 0); + + /* Get into the chroot. */ + if (!rpmtsChrootDone(ts)) { + const char *rootDir = rpmtsRootDir(ts); + inChroot = 0; + /*@-modobserver @*/ + if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/') { + xx = Chroot(rootDir); + /*@=modobserver @*/ + xx = rpmtsSetChrootDone(ts, 1); + } + } else + inChroot = 1; + + /* All embedded scriptlets run with CWD == "/". */ + xx = Chdir("/"); + + return inChroot; +} + +static int exitChroot(rpmpsm psm, int inChroot, int pwdFdno, int rootFdno) + /*@globals fileSystem, internalState @*/ + /*@modifies psm, fileSystem, internalState @*/ +{ + const rpmts ts = psm->ts; + const char *rootDir = rpmtsRootDir(ts); + int xx; + + if (rpmtsChrootDone(ts) && !inChroot) { + xx = fchdir(rootFdno); +/*@-modobserver@*/ + if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/') { + xx = Chroot("."); +/*@=modobserver@*/ + xx = rpmtsSetChrootDone(ts, 0); + } + xx = fchdir(pwdFdno); + } else + xx = fchdir(pwdFdno); + + xx = close(rootFdno); + xx = close(pwdFdno); + + return 0; +} + +/** + * Run embedded interpreter script. + * @param psm package state machine data + * @param sln name of scriptlet section + * @param Phe scriptlet args, Phe->p.argv[0] is interpreter to use + * @param script scriptlet body + * @param arg1 no. instances of package installed after scriptlet exec + * (-1 is no arg) + * @param arg2 ditto, but for the target package + * @return RPMRC_OK on success + */ +static rpmRC runEmbeddedScript(rpmpsm psm, const char * sln, HE_t Phe, + const char *script, int arg1, int arg2) + /*@globals fileSystem, internalState @*/ + /*@modifies psm, fileSystem, internalState @*/ +{ + char * av[] = { NULL, NULL, NULL, NULL }; + int pwdFdno = -1; + int rootFdno = -1; + rpmRC rc = RPMRC_OK; + int xx = 0; + rpmuint32_t * ssp = NULL; + int inChroot = enterChroot(psm, &pwdFdno, &rootFdno); + + if (psm->sstates != NULL) + ssp = psm->sstates + tag2slx(psm->scriptTag); + if (ssp != NULL) + *ssp |= (RPMSCRIPT_STATE_EMBEDDED|RPMSCRIPT_STATE_EXEC); + + av[0] = (char *) Phe->p.argv[0]; + if (arg1 >= 0) + (void) sprintf((av[1] = (char *) alloca(32)), "%d", arg1); + if (arg2 >= 0) + (void) sprintf((av[2] = (char *) alloca(32)), "%d", arg2); + +#if defined(WITH_LUA) + if (!strcmp(Phe->p.argv[0], "")) { + rc = runLuaScript(psm, sln, Phe, script, arg1, arg2); + } else +#endif +#if defined(WITH_AUGEAS) + if (!strcmp(Phe->p.argv[0], "")) { + /* XXX change rpmaugNew() to common embedded interpreter API */ + rpmaug aug = NULL; + rc = rpmaugRun(aug, script, NULL) == RPMRC_OK + ? RPMRC_OK : RPMRC_FAIL; + aug = rpmaugFree(aug); + } else +#endif +#if defined(WITH_FICL) + if (!strcmp(Phe->p.argv[0], "")) { + rpmficl ficl = rpmficlNew((char **)av, 0); + rc = rpmficlRun(ficl, script, NULL) == RPMRC_OK + ? RPMRC_OK : RPMRC_FAIL; + ficl = rpmficlFree(ficl); + } else +#endif +#if defined(WITH_GPSEE) + if (!strcmp(Phe->p.argv[0], "")) { + rpmjs js = rpmjsNew((char **)av, 0); + rc = rpmjsRun(js, script, NULL) == RPMRC_OK + ? RPMRC_OK : RPMRC_FAIL; + js = rpmjsFree(js); + } else +#endif +#if defined(WITH_PERLEMBED) + if (!strcmp(Phe->p.argv[0], "")) { + rpmperl perl = rpmperlNew((char **)av, 0); + rc = rpmperlRun(perl, script, NULL) == RPMRC_OK + ? RPMRC_OK : RPMRC_FAIL; + perl = rpmperlFree(perl); + } else +#endif +#if defined(WITH_PYTHONEMBED) + if (!strcmp(Phe->p.argv[0], "")) { + rpmpython python = rpmpythonNew((char **)av, 0); + rc = rpmpythonRun(python, script, NULL) == RPMRC_OK + ? RPMRC_OK : RPMRC_FAIL; + python = rpmpythonFree(python); + } else +#endif +#if defined(WITH_RUBY) + if (!strcmp(Phe->p.argv[0], "")) { + rpmruby ruby = rpmrubyNew((char **)av, 0); + rc = rpmrubyRun(ruby, script, NULL) == RPMRC_OK + ? RPMRC_OK : RPMRC_FAIL; + ruby = rpmrubyFree(ruby); + } else +#endif +#if defined(WITH_SEMANAGE) + if (!strcmp(Phe->p.argv[0], "")) { + /* XXX change rpmsmNew() to common embedded interpreter API */ + rpmsm sm = NULL; + /* XXX HACK: use an argv for now. */ + const char * av[2]; + av[0] = script; + av[1] = NULL; + rc = rpmsmRun(sm, (char **)av, NULL) == RPMRC_OK + ? RPMRC_OK : RPMRC_FAIL; + sm = rpmsmFree(sm); + } else +#endif +#if defined(WITH_SQLITE) + if (!strcmp(Phe->p.argv[0], "")) { + int Pac = Phe->c; + const char ** Pav = (const char **) xmalloc((Pac + 1) * sizeof(*Pav)); + const char * result = NULL; + rpmsql sql; + int i; + + /* XXX ignore $1/$2, copy the tag array instead. */ + /* XXX no NULL sentinel in tag arrays. */ + for (i = 0; i < Pac; i++) + Pav[i] = rpmExpand(Phe->p.argv[i], NULL); + Pav[Pac] = NULL; + + sql = rpmsqlNew((char **)Pav, 0); + rc = rpmsqlRun(sql, script, &result) == RPMRC_OK + ? RPMRC_OK : RPMRC_FAIL; + sql = rpmsqlFree(sql); + Pav = argvFree(Pav); + } else +#endif +#if defined(WITH_SQUIRREL) + if (!strcmp(Phe->p.argv[0], "")) { + rpmsquirrel squirrel = rpmsquirrelNew((char **)av, 0); + rc = rpmsquirrelRun(squirrel, script, NULL) == RPMRC_OK + ? RPMRC_OK : RPMRC_FAIL; + squirrel = rpmsquirrelFree(squirrel); + } else +#endif +#if defined(WITH_TCL) + if (!strcmp(Phe->p.argv[0], "")) { + rpmtcl tcl = rpmtclNew((char **)av, 0); + rc = rpmtclRun(tcl, script, NULL) == RPMRC_OK + ? RPMRC_OK : RPMRC_FAIL; + tcl = rpmtclFree(tcl); + } else +#endif + rc = RPMRC_NOTFOUND; + + if (ssp != NULL) { + *ssp &= ~0xffff; + *ssp |= (xx & 0xffff); + *ssp |= RPMSCRIPT_STATE_REAPED; + } + + xx = exitChroot(psm, inChroot, pwdFdno, rootFdno); + + return rc; +} +#endif + +/** + */ +/*@unchecked@*/ +static int ldconfig_done = 0; + +/*@unchecked@*/ /*@observer@*/ /*@null@*/ +static const char * ldconfig_path = "/sbin/ldconfig"; + +/** + * Run scriptlet with args. + * + * Run a script with an interpreter. If the interpreter is not specified, + * /bin/sh will be used. + * + * @param psm package state machine data + * @param h header + * @param sln name of scriptlet section + * @param Phe scriptlet args, Phe->p.argv[0] is interpreter to use + * @param script scriptlet body + * @param arg1 no. instances of package installed after scriptlet exec + * (-1 is no arg) + * @param arg2 ditto, but for the target package + * @return RPMRC_OK on success + */ +static rpmRC runScript(rpmpsm psm, Header h, const char * sln, HE_t Phe, + const char * script, int arg1, int arg2) + /*@globals ldconfig_done, rpmGlobalMacroContext, h_errno, + fileSystem, internalState@*/ + /*@modifies psm, ldconfig_done, rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + const rpmts ts = psm->ts; + const char * NVRA = psm->NVRA; + HE_t IPhe = psm->IPhe; + const char ** argv = NULL; + int argc = 0; + const char ** IP = NULL; + int nIP; + size_t maxPrefixLength; + size_t len; + char * prefixBuf = NULL; + const char * fn = NULL; + FD_t scriptFd = NULL; + FD_t out = NULL; /* exit: expects this to be initialized. */ + rpmRC rc = RPMRC_FAIL; /* assume failure */ + const char * body = NULL; + rpmop op = (rpmop) memset(alloca(sizeof(*op)), 0, sizeof(*op)); + int ix = tag2slx(psm->scriptTag); + rpmuint32_t * ssp = NULL; + pid_t pid; + int xx; + int i; + + if (psm->sstates != NULL && ix >= 0 && ix < RPMSCRIPT_MAX) + ssp = psm->sstates + ix; + if (ssp != NULL) + *ssp = RPMSCRIPT_STATE_UNKNOWN; + + if (Phe->p.argv == NULL && script == NULL) + return RPMRC_OK; + + /* Macro expand all scriptlets. */ + body = rpmExpand(script, NULL); + + /* XXX Load NVRA lazily. This should be done elsewhere ... */ + if (NVRA == NULL) { + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + he->tag = RPMTAG_NVRA; + xx = headerGet(h, he, 0); +assert(he->p.str != NULL); + psm->NVRA = NVRA = he->p.str; + } + + if (op != NULL) + (void) rpmswEnter(op, 0); + + if (Phe->p.argv && Phe->p.argv[0]) + if (!strcmp(Phe->p.argv[0], "") + || !strcmp(Phe->p.argv[0], "") + || !strcmp(Phe->p.argv[0], "") + || !strcmp(Phe->p.argv[0], "") + || !strcmp(Phe->p.argv[0], "") + || !strcmp(Phe->p.argv[0], "") + || !strcmp(Phe->p.argv[0], "") + || !strcmp(Phe->p.argv[0], "") + || !strcmp(Phe->p.argv[0], "") + || !strcmp(Phe->p.argv[0], "")) + { +#if defined(_WITH_EMBEDDED) + rpmlog(RPMLOG_DEBUG, + D_("%s: %s(%s) running %s scriptlet.\n"), + psm->stepName, tag2sln(psm->scriptTag), NVRA, Phe->p.argv[0]); + rc = runEmbeddedScript(psm, sln, Phe, body, arg1, arg2); +#endif + goto exit; + } + + psm->sq.reaper = 1; + + /* + * If a successor node, and ldconfig was just run, don't bother. + */ + if (ldconfig_path && Phe->p.argv != NULL && F_ISSET(psm, UNORDERED)) { + if (ldconfig_done && !strcmp(Phe->p.argv[0], ldconfig_path)) { + rpmlog(RPMLOG_DEBUG, + D_("%s: %s(%s) skipping redundant \"%s\".\n"), + psm->stepName, tag2sln(psm->scriptTag), NVRA, + Phe->p.argv[0]); + rc = RPMRC_OK; + goto exit; + } + } + + rpmlog(RPMLOG_DEBUG, + D_("%s: %s(%s) %ssynchronous scriptlet start\n"), + psm->stepName, tag2sln(psm->scriptTag), NVRA, + (F_ISSET(psm, UNORDERED) ? "a" : "")); + + if (Phe->p.argv == NULL) { + argv = (const char **) alloca(5 * sizeof(*argv)); + argv[0] = "/bin/sh"; + argc = 1; + ldconfig_done = 0; + } else { + argv = (const char **) alloca((Phe->c + 4) * sizeof(*argv)); + memcpy(argv, Phe->p.argv, Phe->c * sizeof(*argv)); + argc = Phe->c; + ldconfig_done = (ldconfig_path && !strcmp(argv[0], ldconfig_path) + ? 1 : 0); + } + + /* XXX Load INSTPREFIXES lazily. This should be done elsewhere ... */ + if (IPhe->tag == 0) { + IPhe->tag = RPMTAG_INSTPREFIXES; + xx = headerGet(h, IPhe, 0); + if (!xx) { + IPhe->p.ptr = _free(IPhe->p.ptr); + IPhe->tag = RPMTAG_INSTALLPREFIX; + xx = headerGet(h, IPhe, 0); + if (xx) { + const char ** av = (const char **) + xmalloc(sizeof(*av) + strlen(IPhe->p.argv[0]) + 1); + char * t = (char *) &av[1]; + + av[0] = t; + t = stpcpy(t, IPhe->p.argv[0]); + *t = '\0'; + IPhe->p.ptr = _free(IPhe->p.ptr); + IPhe->t = RPM_STRING_ARRAY_TYPE; + IPhe->p.argv = av; + IPhe->c = 1; + } else { + IPhe->p.argv = NULL; + IPhe->c = 0; + } + } + } + IP = IPhe->p.argv; + nIP = IPhe->c; + + maxPrefixLength = 0; + if (IP != NULL) + for (i = 0; i < nIP; i++) { + len = strlen(IP[i]); + if (len > maxPrefixLength) maxPrefixLength = len; + } + prefixBuf = (char *) alloca(maxPrefixLength + 50); + + if (script) { + const char * rootDir = rpmtsRootDir(ts); + FD_t fd; + size_t nw; + + if (rpmTempFile((!rpmtsChrootDone(ts) ? rootDir : "/"), &fn, &fd)) + goto exit; + + if (rpmIsDebug() && + (!strcmp(argv[0], "/bin/sh") || !strcmp(argv[0], "/bin/bash"))) + { + static const char set_x[] = "set -x\n"; + nw = Fwrite(set_x, sizeof(set_x[0]), sizeof(set_x)-1, fd); + } + + if (ldconfig_path && strstr(body, ldconfig_path) != NULL) + ldconfig_done = 1; + + nw = Fwrite(body, sizeof(body[0]), strlen(body), fd); + xx = Fclose(fd); + + { const char * sn = fn; + if (!rpmtsChrootDone(ts) && rootDir != NULL && + !(rootDir[0] == '/' && rootDir[1] == '\0')) + { + sn += strlen(rootDir)-1; + } + argv[argc++] = sn; + } + + if (arg1 >= 0) { + char *av = (char *) alloca(20); + sprintf(av, "%d", arg1); + argv[argc++] = av; + } + if (arg2 >= 0) { + char *av = (char *) alloca(20); + sprintf(av, "%d", arg2); + argv[argc++] = av; + } + } + + argv[argc] = NULL; + + /* Log the scriptlet to be exec'd. */ + switch (psm->scriptTag) { + default: + break; + case RPMTAG_PREIN: + (void) rpmlioPrein(rpmtsGetRdb(ts), argv, body); + break; + case RPMTAG_POSTIN: + (void) rpmlioPostin(rpmtsGetRdb(ts), argv, body); + break; + case RPMTAG_PREUN: + (void) rpmlioPreun(rpmtsGetRdb(ts), argv, body); + break; + case RPMTAG_POSTUN: + (void) rpmlioPostun(rpmtsGetRdb(ts), argv, body); + break; + } + + scriptFd = rpmtsScriptFd(ts); + if (scriptFd != NULL) { + if (rpmIsVerbose()) { + out = fdDup(Fileno(scriptFd)); + } else { + out = Fopen("/dev/null", "w.fdio"); + if (Ferror(out)) { + out = fdDup(Fileno(scriptFd)); + } + } + } else { + out = fdDup(STDOUT_FILENO); + } + if (out == NULL) /* XXX can't happen */ + goto exit; + + pid = rpmsqFork(&psm->sq); + if (psm->sq.child == 0) { + int pipes[2]; + int flag; + int fdno; + + pipes[0] = pipes[1] = 0; + /* Make stdin inaccessible */ + xx = pipe(pipes); + xx = close(pipes[1]); + xx = dup2(pipes[0], STDIN_FILENO); + xx = close(pipes[0]); + + /* XXX Force FD_CLOEXEC on 1st 100 inherited fdno's. */ + for (fdno = 3; fdno < 100; fdno++) { + flag = fcntl(fdno, F_GETFD); + if (flag == -1 || (flag & FD_CLOEXEC)) + continue; + rpmlog(RPMLOG_DEBUG, + D_("%s: %s(%s)\tfdno(%d) missing FD_CLOEXEC\n"), + psm->stepName, sln, NVRA, + fdno); + xx = fcntl(fdno, F_SETFD, FD_CLOEXEC); + /* XXX W2DO? debug msg for inheirited fdno w/o FD_CLOEXEC */ + } + + if (scriptFd != NULL) { + int sfdno = Fileno(scriptFd); + int ofdno = Fileno(out); + if (sfdno != STDERR_FILENO) + xx = dup2(sfdno, STDERR_FILENO); + if (ofdno != STDOUT_FILENO) + xx = dup2(ofdno, STDOUT_FILENO); + /* make sure we don't close stdin/stderr/stdout by mistake! */ + if (ofdno > STDERR_FILENO && ofdno != sfdno) + xx = Fclose (out); + if (sfdno > STDERR_FILENO && ofdno != sfdno) + xx = Fclose (scriptFd); + } + + { const char *ipath = rpmExpand("PATH=%{_install_script_path}", NULL); + const char *path = SCRIPT_PATH; + + if (ipath && ipath[5] != '%') + path = ipath; + + xx = doputenv(path); + /*@-modobserver@*/ + ipath = _free(ipath); + /*@=modobserver@*/ + } + + if (IP != NULL) + for (i = 0; i < nIP; i++) { + sprintf(prefixBuf, "RPM_INSTALL_PREFIX%d=%s", i, IP[i]); + xx = doputenv(prefixBuf); + + /* backwards compatibility */ + if (i == 0) { + sprintf(prefixBuf, "RPM_INSTALL_PREFIX=%s", IP[i]); + xx = doputenv(prefixBuf); + } + } + + { const char * rootDir = rpmtsRootDir(ts); + if (!rpmtsChrootDone(ts) && rootDir != NULL && + !(rootDir[0] == '/' && rootDir[1] == '\0')) + { + /*@-modobserver@*/ + xx = Chroot(rootDir); + /*@=modobserver@*/ + } + xx = Chdir("/"); + rpmlog(RPMLOG_DEBUG, D_("%s: %s(%s)\texecv(%s) pid %d\n"), + psm->stepName, sln, NVRA, + argv[0], (unsigned)getpid()); + + /* XXX Don't mtrace into children. */ + unsetenv("MALLOC_CHECK_"); + + if (ssp != NULL) + *ssp |= RPMSCRIPT_STATE_EXEC; + + /* Permit libselinux to do the scriptlet exec. */ + if (rpmtsSELinuxEnabled(ts) == 1) { + if (ssp != NULL) + *ssp |= RPMSCRIPT_STATE_SELINUX; + xx = rpmsxExec(NULL, 0, argv); + } else { +/*@-nullstate@*/ + xx = execv(argv[0], (char *const *)argv); +/*@=nullstate@*/ + } + } + + if (ssp != NULL) + *ssp &= ~RPMSCRIPT_STATE_EXEC; + + _exit(-1); + /*@notreached@*/ + } + + if (psm->sq.child == (pid_t)-1) { + rpmlog(RPMLOG_ERR, _("Couldn't fork %s: %s\n"), sln, strerror(errno)); + goto exit; + } + + (void) psmWait(psm); + + /* XXX filter order dependent multilib "other" arch helper error. */ + if (!(psm->sq.reaped >= 0 && !strcmp(argv[0], "/usr/sbin/glibc_post_upgrade") && WEXITSTATUS(psm->sq.status) == 110)) { + void *ptr = NULL; + if (psm->sq.reaped < 0) { + rpmlog(RPMLOG_ERR, + _("%s(%s) scriptlet failed, waitpid(%d) rc %d: %s\n"), + sln, NVRA, (int)psm->sq.child, (int)psm->sq.reaped, + strerror(errno)); + goto exit; + } else + if (!WIFEXITED(psm->sq.status) || WEXITSTATUS(psm->sq.status)) { + if (WIFSIGNALED(psm->sq.status)) { + ptr = rpmtsNotify(ts, psm->te, RPMCALLBACK_SCRIPT_ERROR, + psm->scriptTag, WTERMSIG(psm->sq.status)); + rpmlog(RPMLOG_ERR, + _("%s(%s) scriptlet failed, signal %d\n"), + sln, NVRA, WTERMSIG(psm->sq.status)); + } else { + ptr = rpmtsNotify(ts, psm->te, RPMCALLBACK_SCRIPT_ERROR, + psm->scriptTag, WEXITSTATUS(psm->sq.status)); + rpmlog(RPMLOG_ERR, + _("%s(%s) scriptlet failed, exit status %d\n"), + sln, NVRA, WEXITSTATUS(psm->sq.status)); + } + goto exit; + } + } + + rc = RPMRC_OK; + +exit: + if (op != NULL) { + static unsigned int scale = 1000; + (void) rpmswExit(op, 0); + if (ix >= 0 && ix < RPMSCRIPT_MAX) + psm->smetrics[ix] += op->usecs / scale; + } + + if (out) + xx = Fclose(out); /* XXX dup'd STDOUT_FILENO */ + + if (script) { + if (!rpmIsDebug() && fn != NULL) + xx = Unlink(fn); + fn = _free(fn); + } + + body = _free(body); + + return rc; +} + +/** + * Retrieve and run scriptlet from header. + * @param psm package state machine data + * @return rpmRC return code + */ +static rpmRC runInstScript(rpmpsm psm) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + HE_t Phe = (HE_t) memset(alloca(sizeof(*Phe)), 0, sizeof(*Phe)); + HE_t She = (HE_t) memset(alloca(sizeof(*She)), 0, sizeof(*She)); + rpmfi fi = psm->fi; + const char * argv0 = NULL; + rpmRC rc = RPMRC_OK; + +assert(fi->h != NULL); + She->tag = psm->scriptTag; + if (!headerGet(fi->h, She, 0)) + goto exit; + + Phe->tag = psm->progTag; + if (!headerGet(fi->h, Phe, 0)) + goto exit; + + /* Coerce strings into header argv return. */ + if (Phe->t == RPM_STRING_TYPE) { + const char * s = Phe->p.str; + char * t; + Phe->p.argv = (const char **) + xmalloc(sizeof(Phe->p.argv[0]) + strlen(s) + 1); + Phe->p.argv[0] = t = (char *) &Phe->p.argv[1]; + t = stpcpy(t, s); + *t = '\0'; + s = _free(s); + } + + /* Expand "%script -p %%{interpreter}" macros. */ + if (Phe->p.argv[0][0] == '%') + Phe->p.argv[0] = argv0 = rpmExpand(Phe->p.argv[0], NULL); + + rc = runScript(psm, fi->h, tag2sln(psm->scriptTag), Phe, + She->p.str, psm->scriptArg, -1); + +exit: + argv0 = _free(argv0); + Phe->p.ptr = _free(Phe->p.ptr); + She->p.ptr = _free(She->p.ptr); + return rc; +} + +/*@unchecked@*/ +static rpmTag _trigger_tag; + +/** + * Execute triggers. + * @param psm package state machine data + * @param sourceH + * @param triggeredH + * @param arg2 + * @return RPMRC_OK on success + */ +static rpmRC handleOneTrigger(const rpmpsm psm, + Header sourceH, Header triggeredH, int arg2) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState@*/ + /*@modifies psm, sourceH, triggeredH, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + static int scareMem = 0; + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + HE_t Ihe = (HE_t) memset(alloca(sizeof(*Ihe)), 0, sizeof(*Ihe)); + HE_t She = (HE_t) memset(alloca(sizeof(*She)), 0, sizeof(*She)); + HE_t Phe = (HE_t) memset(alloca(sizeof(*Phe)), 0, sizeof(*Phe)); + miRE mire = NULL; + const rpmts ts = psm->ts; + rpmds Tds = NULL; + rpmds Fds = NULL; + rpmds Dds = NULL; + rpmds Pds = NULL; + const char * sourceName; + const char * triggerName; + rpmRC rc = RPMRC_OK; + int arg1; + int xx; + int i; + + he->tag = RPMTAG_NAME; + xx = headerGet(sourceH, he, 0); + sourceName = he->p.str; + + he->tag = RPMTAG_NAME; + xx = headerGet(triggeredH, he, 0); + triggerName = he->p.str; + + arg1 = rpmdbCountPackages(rpmtsGetRdb(ts), triggerName); + if (arg1 < 0) { + /* XXX W2DO? fails as "execution of script failed" */ + rc = RPMRC_FAIL; + goto exit; + } + arg1 += psm->countCorrection; + + Tds = rpmdsNew(triggeredH, RPMTAG_TRIGGERNAME, scareMem); + if (Tds == NULL) + goto exit; + xx = rpmdsSetNoPromote(Tds, 1); + + Ihe->tag = RPMTAG_TRIGGERINDEX; + if (!headerGet(triggeredH, Ihe, 0)) + goto exit; + + She->tag = RPMTAG_TRIGGERSCRIPTS; + if (!headerGet(triggeredH, She, 0)) + goto exit; + + Phe->tag = RPMTAG_TRIGGERSCRIPTPROG; + if (!headerGet(triggeredH, Phe, 0)) + goto exit; + + if ((Tds = rpmdsInit(Tds)) != NULL) + while ((i = rpmdsNext(Tds)) >= 0) { + rpmuint32_t Flags = rpmdsFlags(Tds); + char * depName; + int bingo; + + /* Skip triggers that are not in this context. */ + if (!(Flags & psm->sense)) + continue; + + bingo = 0; /* no trigger to fire. */ + depName = (char *) rpmdsN(Tds); + if (depName[0] == '/') { + size_t nb = strlen(depName); + if (Glob_pattern_p(depName, 0)) { + rpmds ds = NULL; + if (depName[nb-1] == '/') { + /* XXX Dirnames w trailing "/" needed. */ + if (Dds == NULL) + Dds = rpmdsNew(sourceH, RPMTAG_DIRNAMES, 0x2); + ds = rpmdsLink(Dds, "Triggers"); + } else { + if (Fds == NULL) + Fds = rpmdsNew(sourceH, RPMTAG_BASENAMES, 0); + ds = rpmdsLink(Fds, "Triggers"); + } + if (mire == NULL) + mire = mireNew(RPMMIRE_GLOB, 0); + + xx = mireRegcomp(mire, depName); + if ((ds = rpmdsInit(ds)) != NULL) + while (rpmdsNext(ds) >= 0) { + const char * N = rpmdsN(ds); + xx = mireRegexec(mire, N, 0); + if (xx < 0) + /*@innercontinue@*/ continue; + bingo = 1; + /*@innerbreak@*/ break; + } + (void)rpmdsFree(ds); + ds = NULL; + xx = mireClean(mire); + } + + /* If not matched, and directory trigger, try dir names. */ + if (!bingo && depName[nb-1] == '/') { + /* XXX Dirnames w trailing "/" needed. */ + if (Dds == NULL) + Dds = rpmdsNew(sourceH, RPMTAG_DIRNAMES, 0x2); + bingo = rpmdsMatch(Tds, Dds); + } + + /* If not matched, try file paths. */ + if (!bingo) { + if (Fds == NULL) + Fds = rpmdsNew(sourceH, RPMTAG_BASENAMES, 0); + bingo = rpmdsMatch(Tds, Fds); + } + } + + /* If trigger not fired yet, try provided dependency match. */ + if (!bingo) { + if (Pds == NULL) + Pds = rpmdsNew(sourceH, RPMTAG_PROVIDENAME, 0); + bingo = rpmdsMatch(Tds, Pds); + bingo = rpmdsNegateRC(Tds, bingo); + } + if (!bingo) + continue; + + /* Coerce strings into header argv return. */ + /* XXX FIXME: permit trigger scripts with arguments. */ + { int index = Ihe->p.ui32p[i]; + const char * s = Phe->p.argv[index]; + char * t; + + he->tag = Phe->tag; + he->t = RPM_STRING_ARRAY_TYPE; + he->c = 1; + he->p.argv = (const char **) + xmalloc(sizeof(Phe->p.argv[0]) + strlen(s) + 1); + he->p.argv[0] = t = (char *) &he->p.argv[1]; + t = stpcpy(t, s); + *t = '\0'; + + if (runScript(psm, triggeredH, "%trigger", he, + She->p.argv[index], arg1, arg2)) + rc = RPMRC_FAIL; + + he->p.ptr = _free(he->p.ptr); + } + } + + mire = mireFree(mire); + (void)rpmdsFree(Pds); + Pds = NULL; + (void)rpmdsFree(Dds); + Dds = NULL; + (void)rpmdsFree(Fds); + Fds = NULL; + (void)rpmdsFree(Tds); + Tds = NULL; + +exit: + Ihe->p.ptr = _free(Ihe->p.ptr); + She->p.ptr = _free(She->p.ptr); + Phe->p.ptr = _free(Phe->p.ptr); + triggerName = _free(triggerName); + sourceName = _free(sourceName); + + return rc; +} + +/* Retrieve trigger patterns from rpmdb. */ +static int rpmdbTriggerGlobs(rpmpsm psm) + /*@globals rpmGlobalMacroContext @*/ + /*@modifies psm, rpmGlobalMacroContext @*/ +{ + const rpmts ts = psm->ts; + ARGV_t keys = NULL; + int xx = rpmdbMireApply(rpmtsGetRdb(ts), RPMTAG_TRIGGERNAME, + RPMMIRE_STRCMP, NULL, &keys); + int nkeys = argvCount(keys); + int i; + + if (keys) + for (i = 0; i < nkeys; i++) { + char * t = (char *) keys[i]; + if (!Glob_pattern_p(t, 0)) + continue; + xx = mireAppend(RPMMIRE_GLOB, 0, t, NULL, + (miRE *)&psm->Tmires, &psm->nTmires); + xx = argvAdd(&psm->Tpats, t); + } + keys = argvFree(keys); + return 0; +} + +/** + * Run a dependency set loop against rpmdb triggers. + * @param psm package state machine data + * @param tagno dependency set to run against rpmdb + * @param arg2 scriptlet arg2 + * @return RPMRC_OK on success + */ +static rpmRC runTriggersLoop(rpmpsm psm, rpmTag tagno, int arg2) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies psm, rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + static int scareMem = 0; + const rpmts ts = psm->ts; + rpmfi fi = psm->fi; + rpmds ds = rpmdsNew(fi->h, tagno, scareMem); + char * depName = NULL; + ARGI_t instances = NULL; + rpmmi mi; + Header triggeredH; + rpmRC rc = RPMRC_OK; + int i; + int xx; + + /* Fire elements against rpmdb trigger strings. */ + if ((ds = rpmdsInit(ds)) != NULL) + while ((i = rpmdsNext(ds)) >= 0) { + const char * Name = rpmdsN(ds); + size_t nName = strlen(Name); + unsigned prev, instance; + unsigned nvals; + ARGint_t vals; + + depName = _free(depName); + depName = (char *) xmalloc(nName + 1 + 1); + (void) stpcpy(depName, Name); + /* XXX re-add the pesky trailing '/' to dirnames. */ + depName[nName] = (tagno == RPMTAG_DIRNAMES ? '/' : '\0'); + depName[nName+1] = '\0'; + + if (depName[0] == '/' && psm->Tmires != NULL) { + miRE mire; + int j; + + /* XXX mireApply doesn't tell which pattern matched. */ + for (j = 0, mire = (miRE)psm->Tmires; j < psm->nTmires; j++, mire++) { + const char * pattern = psm->Tpats[j]; + if (depName[nName-1] != '/') { + size_t npattern = strlen(pattern); + depName[nName] = (pattern[npattern-1] == '/') ? '/' : '\0'; + } + if (mireRegexec(mire, depName, 0) < 0) + /*@innercontinue@*/ continue; + + /* Reset the primary retrieval key to the pattern. */ + depName = _free(depName); + depName = xstrdup(pattern); + /*@innerbreak@*/ break; + } + } + + /* Retrieve triggered header(s) by key. */ + mi = rpmtsInitIterator(ts, RPMTAG_TRIGGERNAME, depName, 0); + + nvals = argiCount(instances); + vals = argiData(instances); + if (nvals > 0) + xx = rpmmiPrune(mi, (uint32_t *)vals, nvals, 1); + + prev = 0; + while((triggeredH = rpmmiNext(mi)) != NULL) { + instance = rpmmiInstance(mi); + if (prev == instance) + /*@innercontinue@*/ continue; + if (handleOneTrigger(psm, fi->h, triggeredH, arg2)) + rc = RPMRC_FAIL; + prev = instance; + xx = argiAdd(&instances, -1, instance); + xx = argiSort(instances, NULL); + } + + mi = rpmmiFree(mi); + } + + instances = argiFree(instances); + depName = _free(depName); + (void)rpmdsFree(ds); + ds = NULL; + + return rc; +} + +/** + * Run trigger scripts in the database that are fired by this header. + * @param psm package state machine data + * @return 0 on success + */ +static rpmRC runTriggers(rpmpsm psm) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies psm, rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + const rpmts ts = psm->ts; + rpmfi fi = psm->fi; + int numPackage; + rpmTag tagno; + rpmRC rc = RPMRC_OK; + + /* Select RPMTAG_NAME or RPMTAG_PROVIDENAME index for triggering. */ + if (_trigger_tag == 0) { + const char * t = rpmExpand("%{?_trigger_tag}", NULL); +/*@-mods@*/ + _trigger_tag = (!strcmp(t, "name") ? RPMTAG_NAME : RPMTAG_PROVIDENAME); +/*@=mods@*/ + t = _free(t); + } + tagno = _trigger_tag; + +assert(psm->te != NULL); + { const char * N = rpmteN(psm->te); +assert(N != NULL); + numPackage = rpmdbCountPackages(rpmtsGetRdb(ts), N); + numPackage += psm->countCorrection; + if (numPackage < 0) + return RPMRC_NOTFOUND; + } +assert(fi != NULL); +assert(fi->h != NULL); + + /* XXX Save/restore count correction. */ + { int countCorrection = psm->countCorrection; + + psm->countCorrection = 0; + + /* Try name/providename triggers first. */ + if (runTriggersLoop(psm, tagno, numPackage)) + rc = RPMRC_FAIL; + + /* If not limited to NEVRA triggers, also try file/dir path triggers. */ + if (tagno != RPMTAG_NAME) { + int xx; + /* Retrieve trigger patterns from rpmdb. */ + xx = rpmdbTriggerGlobs(psm); + + if (runTriggersLoop(psm, RPMTAG_BASENAMES, numPackage)) + rc = RPMRC_FAIL; + if (runTriggersLoop(psm, RPMTAG_DIRNAMES, numPackage)) + rc = RPMRC_FAIL; + + psm->Tpats = argvFree(psm->Tpats); + psm->Tmires = mireFreeAll((miRE)psm->Tmires, psm->nTmires); + psm->nTmires = 0; + } + + psm->countCorrection = countCorrection; + } + + return rc; +} + +/** + * Run triggers from this header that are fired by headers in the database. + * @param psm package state machine data + * @return 0 on success + */ +static rpmRC runImmedTriggers(rpmpsm psm) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies psm, rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + HE_t Ihe = (HE_t) memset(alloca(sizeof(*Ihe)), 0, sizeof(*Ihe)); + const rpmts ts = psm->ts; + rpmfi fi = psm->fi; + rpmds triggers = NULL; + rpmmi mi; + ARGV_t keys = NULL; + ARGI_t instances = NULL; + Header sourceH = NULL; + const char * Name; + rpmTag tagno; + rpmRC rc = RPMRC_OK; + int i; + int xx; + +assert(fi->h != NULL); + + /* Select RPMTAG_NAME or RPMTAG_PROVIDENAME index for triggering. */ + if (_trigger_tag == 0) { + const char * t = rpmExpand("%{?_trigger_tag}", NULL); +/*@-mods@*/ + _trigger_tag = (!strcmp(t, "name") ? RPMTAG_NAME : RPMTAG_PROVIDENAME); +/*@=mods@*/ + t = _free(t); + } + tagno = _trigger_tag; + +/*@-castexpose@*/ + triggers = rpmdsLink(psm->triggers, "ImmedTriggers"); +/*@=castexpose@*/ + if (triggers == NULL) + goto exit; + + Ihe->tag = RPMTAG_TRIGGERINDEX; + xx = headerGet(fi->h, Ihe, 0); + if (!(xx && Ihe->p.ui32p && Ihe->c)) goto exit; + + /* Collect primary trigger keys, expanding globs as needed. */ + triggers = rpmdsInit(triggers); + if (triggers != NULL) + while ((i = rpmdsNext(triggers)) >= 0) { + evrFlags Flags = rpmdsFlags(triggers); + const char * N = rpmdsN(triggers); + const char * EVR = rpmdsEVR(triggers); + + /* Skip triggers that are not in this context. */ + if (!(Flags & psm->sense)) + continue; + + /* If not limited to NEVRA triggers, use file/dir index. */ + if (tagno != RPMTAG_NAME) { + /* XXX if trigger name ends with '/', use dirnames instead. */ + if (N[0] == '/') + tagno = (N[strlen(N)-1] == '/') + ? RPMTAG_DIRNAMES : RPMTAG_FILEPATHS; + } + /* XXX For now, permit globs only in unversioned triggers. */ + if ((EVR == NULL || *EVR == '\0') && Glob_pattern_p(N, 0)) + xx = rpmdbMireApply(rpmtsGetRdb(ts), tagno, RPMMIRE_GLOB, N, &keys); + else + xx = argvAdd(&keys, N); + } + (void)rpmdsFree(triggers); + triggers = NULL; + + /* For all primary keys, retrieve headers and fire triggers. */ + if (keys != NULL) + for (i = 0; (Name = keys[i]) != NULL; i++) { + unsigned prev, instance; + unsigned nvals; + ARGint_t vals; + + /* If not limited to NEVRA triggers, use file/dir index. */ + if (tagno != RPMTAG_NAME) { + /* XXX if trigger name ends with '/', use dirnames instead. */ + if (Name[0] == '/') + tagno = (Name[strlen(Name)-1] == '/') + ? RPMTAG_DIRNAMES : RPMTAG_FILEPATHS; + } + + mi = rpmtsInitIterator(ts, tagno, Name, 0); + + /* Don't retrieve headers that have already been processed. */ + nvals = argiCount(instances); + vals = argiData(instances); + if (nvals > 0) + xx = rpmmiPrune(mi, (uint32_t *)vals, nvals, 1); + + prev = 0; + while((sourceH = rpmmiNext(mi)) != NULL) { + + /* Skip headers that have already been processed. */ + instance = rpmmiInstance(mi); + if (prev == instance) + /*@innercontinue@*/ continue; + + if (handleOneTrigger(psm, sourceH, fi->h, rpmmiCount(mi))) + rc = RPMRC_FAIL; + + /* Mark header instance as processed. */ + prev = instance; + xx = argiAdd(&instances, -1, instance); + xx = argiSort(instances, NULL); + } + + mi = rpmmiFree(mi); + } + +exit: + instances = argiFree(instances); + keys = argvFree(keys); + Ihe->p.ptr = _free(Ihe->p.ptr); + return rc; +} + +/*@observer@*/ +static const char * pkgStageString(pkgStage a) + /*@*/ +{ + switch(a) { + case PSM_UNKNOWN: return "unknown"; + + case PSM_PKGINSTALL: return " install"; + case PSM_PKGERASE: return " erase"; + case PSM_PKGCOMMIT: return " commit"; + case PSM_PKGSAVE: return "repackage"; + + case PSM_INIT: return "init"; + case PSM_PRE: return "pre"; + case PSM_PROCESS: return "process"; + case PSM_POST: return "post"; + case PSM_UNDO: return "undo"; + case PSM_FINI: return "fini"; + + case PSM_CREATE: return "create"; + case PSM_NOTIFY: return "notify"; + case PSM_DESTROY: return "destroy"; + case PSM_COMMIT: return "commit"; + + case PSM_CHROOT_IN: return "chrootin"; + case PSM_CHROOT_OUT: return "chrootout"; + case PSM_SCRIPT: return "script"; + case PSM_TRIGGERS: return "triggers"; + case PSM_IMMED_TRIGGERS: return "immedtriggers"; + + case PSM_RPMIO_FLAGS: return "rpmioflags"; + + case PSM_RPMDB_LOAD: return "rpmdbload"; + case PSM_RPMDB_ADD: return "rpmdbadd"; + case PSM_RPMDB_REMOVE: return "rpmdbremove"; + + default: return "???"; + } + /*@noteached@*/ +} + +void rpmpsmSetAsync(rpmpsm psm, int async) +{ + assert(psm != NULL); +#ifdef REFERENCE + psm->unorderedSuccessor = async; +#else + if (async) + F_SET(psm, UNORDERED); + else + F_CLR(psm, UNORDERED); +#endif +} + +rpmRC rpmpsmScriptStage(rpmpsm psm, rpmTag scriptTag, rpmTag progTag) +{ +assert(psm != NULL); + psm->scriptTag = scriptTag; + psm->progTag = progTag; + /* XXX other tags needed? */ + switch (scriptTag) { + default: break; + case RPMTAG_SANITYCHECK: psm->stepName = "sanitycheck"; break; + case RPMTAG_VERIFYSCRIPT: psm->stepName = "verify"; break; + case RPMTAG_PRETRANS: psm->stepName = "pretrans"; break; + case RPMTAG_POSTTRANS: psm->stepName = "posttrans"; break; + } + return rpmpsmStage(psm, PSM_SCRIPT); +} + +/*@-mustmod@*/ +static void rpmpsmFini(void * _psm) + /*@modifies _psm @*/ +{ + rpmpsm psm = (rpmpsm) _psm; + +/*@-nullstate@*/ + psm->fi = rpmfiFree(psm->fi); +#ifdef NOTYET + psm->te = rpmteFree(psm->te); +#else + psm->te = NULL; +#endif +/*@-internalglobs@*/ + (void)rpmtsFree(psm->ts); + psm->ts = NULL; +/*@=internalglobs@*/ + + psm->IPhe->p.ptr = _free(psm->IPhe->p.ptr); + psm->IPhe = _free(psm->IPhe); + psm->NVRA = _free(psm->NVRA); + (void)rpmdsFree(psm->triggers); + psm->triggers = NULL; +/*@=nullstate@*/ +} +/*@=mustmod@*/ + +/*@unchecked@*/ /*@only@*/ /*@null@*/ +rpmioPool _psmPool; + +static rpmpsm rpmpsmGetPool(/*@null@*/ rpmioPool pool) + /*@globals _psmPool, fileSystem, internalState @*/ + /*@modifies pool, _psmPool, fileSystem, internalState @*/ +{ + rpmpsm psm; + + if (_psmPool == NULL) { + _psmPool = rpmioNewPool("psm", sizeof(*psm), -1, _psm_debug, + NULL, NULL, rpmpsmFini); + pool = _psmPool; + } + psm = (rpmpsm) rpmioGetPool(pool, sizeof(*psm)); + memset(((char *)psm)+sizeof(psm->_item), 0, sizeof(*psm)-sizeof(psm->_item)); + return psm; +} + +rpmpsm rpmpsmNew(rpmts ts, rpmte te, rpmfi fi) +{ + static const char msg[] = "rpmpsmNew"; + rpmpsm psm = rpmpsmGetPool(_psmPool); + +/*@-assignexpose -castexpose @*/ + if (ts) psm->ts = rpmtsLink(ts, msg); +#ifdef NOTYET + if (te) psm->te = rpmteLink(te, msg); +#else +/*@-temptrans @*/ + if (te) psm->te = te; +/*@=temptrans @*/ +#endif + if (fi) psm->fi = rpmfiLink(fi, msg); +/*@=assignexpose =castexpose @*/ + + psm->triggers = NULL; + psm->NVRA = NULL; + psm->IPhe = (HE_t) xcalloc(1, sizeof(*psm->IPhe)); + memset(psm->sstates, 0, sizeof(psm->sstates)); + memset(psm->smetrics, 0, sizeof(psm->smetrics)); + + return rpmpsmLink(psm, msg); +} + +/** + * Load a transaction id from a header. + * @param h header + * @param tag tag to load + * @return tag value (0 on failure) + */ +static rpmuint32_t hLoadTID(Header h, rpmTag tag) + /*@globals internalState @*/ + /*@modifies internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmuint32_t val; + int xx; + + he->tag = tag; + xx = headerGet(h, he, 0); + val = (xx && he->p.ui32p ? he->p.ui32p[0] : 0); + he->p.ptr = _free(he->p.ptr); + return val; +} + +/** + * Copy a tag from a source to a target header. + * @param sh source header + * @param th target header + * @param tag tag to copy + * @return 0 always + */ +static int hCopyTag(Header sh, Header th, rpmTag tag) + /*@globals internalState @*/ + /*@modifies th, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + int xx = 1; + + he->tag = tag; + if (headerGet(sh, he, 0) && he->c > 0) + xx = headerPut(th, he, 0); + he->p.ptr = _free(he->p.ptr); + return 0; +} + +/** + * Save backward link(s) of an upgrade chain into a header. + * @param h header + * @param *blink backward links + * @return 0 always + */ +static int hSaveBlinks(Header h, const struct rpmChainLink_s * blink) + /*@modifies h @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); +/*@observer@*/ + static const char * chain_end = RPMTE_CHAIN_END; + int ac; + int xx = 1; + + /* Save forward links into header upgrade chain. */ + he->tag = RPMTAG_BLINKNEVRA; + he->t = RPM_STRING_ARRAY_TYPE; + ac = argvCount(blink->NEVRA); + if (ac > 0) { + he->p.argv = argvData(blink->NEVRA); + he->c = ac; + } else { /* XXX Add an explicit chain terminator on 1st install. */ + he->p.argv = &chain_end; + he->c = 1; + } + xx = headerPut(h, he, 0); + + he->tag = RPMTAG_BLINKPKGID; + he->t = RPM_STRING_ARRAY_TYPE; + ac = argvCount(blink->Pkgid); + if (ac > 0) { + he->p.argv = argvData(blink->Pkgid); + he->c = ac; + } else { /* XXX Add an explicit chain terminator on 1st install. */ + he->p.argv = &chain_end; + he->c = 1; + } + xx = headerPut(h, he, 0); + + he->tag = RPMTAG_BLINKHDRID; + he->t = RPM_STRING_ARRAY_TYPE; + ac = argvCount(blink->Hdrid); + if (ac > 0) { + he->p.argv = argvData(blink->Hdrid); + he->c = ac; + } else { /* XXX Add an explicit chain terminator on 1st install. */ + he->p.argv = &chain_end; + he->c = 1; + } + xx = headerPut(h, he, 0); + + return 0; +} + +/** + * Save forward link(s) of an upgrade chain into a header. + * @param h header + * @param *flink forward links + * @return 0 always + */ +static int hSaveFlinks(Header h, const struct rpmChainLink_s * flink) + /*@modifies h @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); +#ifdef NOTYET + /*@observer@*/ + static const char * chain_end = RPMTE_CHAIN_END; +#endif + int ac; + int xx = 1; + + /* Save forward links into header upgrade chain. */ + he->tag = RPMTAG_FLINKNEVRA; + he->t = RPM_STRING_ARRAY_TYPE; + ac = argvCount(flink->NEVRA); + if (ac > 0) { + he->p.argv = argvData(flink->NEVRA); + he->c = ac; + } +#ifdef NOTYET /* XXX is an explicit flink terminator needed? */ + else { /* XXX Add an explicit chain terminator on 1st install. */ + he->p.argv = &chain_end; + he->c = 1; + } +#endif + xx = headerPut(h, he, 0); + + he->tag = RPMTAG_FLINKPKGID; + he->t = RPM_STRING_ARRAY_TYPE; + ac = argvCount(flink->Pkgid); + if (ac > 0) { + he->p.argv = argvData(flink->Pkgid); + he->c = ac; + } +#ifdef NOTYET /* XXX is an explicit flink terminator needed? */ + else { /* XXX Add an explicit chain terminator on 1st install. */ + he->p.argv = &chain_end; + he->c = 1; + } +#endif + xx = headerPut(h, he, 0); + + he->tag = RPMTAG_FLINKHDRID; + he->t = RPM_STRING_ARRAY_TYPE; + ac = argvCount(flink->Hdrid); + if (ac > 0) { + he->p.argv = argvData(flink->Hdrid); + he->c = ac; + } +#ifdef NOTYET /* XXX is an explicit flink terminator needed? */ + else { /* XXX Add an explicit chain terminator on 1st install. */ + he->p.argv = &chain_end; + he->c = 1; + } +#endif + xx = headerPut(h, he, 0); + + return 0; +} + +/** + * Add per-transaction data to an install header. + * @param ts transaction set + * @param te transaction element + * @param fi file info set + * @return 0 always + */ +static int populateInstallHeader(const rpmts ts, const rpmte te, rpmfi fi) + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies fi, fileSystem, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmuint32_t tscolor = rpmtsColor(ts); + rpmuint32_t tecolor = rpmteColor(te); + rpmuint32_t * uip; + rpmuint32_t installTime[2]; + rpmuint32_t originTime[2]; + rpmuint32_t originTid[2]; + int xx = 1; + +assert(fi->h != NULL); + + { struct timeval tv; + xx = gettimeofday(&tv, NULL); + installTime[0] = (rpmuint32_t) tv.tv_sec; + installTime[1] = (rpmuint32_t) tv.tv_usec; + } + he->tag = RPMTAG_INSTALLTIME; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &installTime[0]; + he->c = 2; + xx = headerPut(fi->h, he, 0); + + /* Propagate the tid & time that the package was first installed. */ + if ((uip = rpmteOriginTime(te)) != NULL) + memcpy(originTime, uip, sizeof(originTime)); + if (originTime[0] == 0) + memcpy(originTime, installTime, sizeof(originTime)); + he->tag = RPMTAG_ORIGINTIME; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = originTime; + he->c = 2; + xx = headerPut(fi->h, he, 0); + + if ((uip = rpmteOriginTid(te)) != NULL) + memcpy(originTid, uip, sizeof(originTid)); + if (originTid[0] == 0) + memcpy(originTid, ts->tid, sizeof(originTid)); + he->tag = RPMTAG_ORIGINTID; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = originTid; + he->c = 2; + xx = headerPut(fi->h, he, 0); + + he->tag = RPMTAG_INSTALLCOLOR; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &tscolor; + he->c = 1; + xx = headerPut(fi->h, he, 0); + + /* XXX FIXME: add preferred color at install. */ + + he->tag = RPMTAG_PACKAGECOLOR; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &tecolor; + he->c = 1; + xx = headerPut(fi->h, he, 0); + + /* Add the header's origin/digest/stat (i.e. URL) */ + { const char * fn = headerGetOrigin(fi->h); + const char * digest = headerGetDigest(fi->h); + struct stat * st = headerGetStatbuf(fi->h); + + if (fn != NULL) { + he->tag = RPMTAG_PACKAGEORIGIN; + he->t = RPM_STRING_TYPE; + he->p.str = xstrdup(fn); + he->c = 1; + xx = headerPut(fi->h, he, 0); + he->p.ptr = _free(he->p.ptr); + + if (digest != NULL) { + he->tag = RPMTAG_PACKAGEDIGEST; + he->t = RPM_STRING_TYPE; + he->p.str = headerGetDigest(fi->h); + he->c = 1; + xx = headerPut(fi->h, he, 0); + } + if (st != NULL) { +/* XXX Fstat(2) in pkgio.c should set *st. Verify st->st_mode w assert(3). */ +#ifndef DYING + int ut = urlPath(fn, NULL); + /* XXX URI is active, so avoid the lazy Stat(2) for now. */ + if (!(ut == URL_IS_HTTP || ut == URL_IS_HTTPS)) + if (st->st_mode == 0 && st->st_mtime == 0 && st->st_size == 0) + xx = Stat(fn, st); +#endif + if (st->st_mode != 0) { + he->tag = RPMTAG_PACKAGESTAT; + he->t = RPM_BIN_TYPE; + he->p.ptr = (void *)st; + he->c = (rpmTagCount) sizeof(*st); + xx = headerPut(fi->h, he, 0); + } + } + } + } + + /* XXX Don't clobber forward/backward upgrade chain on rollbacks */ + if (rpmtsType(ts) != RPMTRANS_TYPE_ROLLBACK) + xx = hSaveBlinks(fi->h, &te->blink); + + return 0; +} + +/** + * Add fi->states to an install header. + * @param ts transaction set + * @param te transaction element + * @param fi file info set + * @return 0 always + */ +static int postPopulateInstallHeader(/*@unused@*/ const rpmts ts, + const rpmpsm psm, rpmfi fi) + /*@modifies psm, fi @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + int fc = rpmfiFC(fi); + int xx = 1; + + /* Add the (install) scriptlet status/metrics. */ + he->tag = RPMTAG_SCRIPTSTATES; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = psm->sstates; + he->c = RPMSCRIPT_MAX; + xx = headerPut(fi->h, he, 0); + he->tag = RPMTAG_SCRIPTMETRICS; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = psm->smetrics; + he->c = RPMSCRIPT_MAX; + xx = headerPut(fi->h, he, 0); + + /* Add file states to install header. */ + if (fi->fstates != NULL && fc > 0) { + he->tag = RPMTAG_FILESTATES; + he->t = RPM_UINT8_TYPE; + he->p.ui8p = fi->fstates; + he->c = fc; + xx = headerPut(fi->h, he, 0); + } + + return 0; +} + +#if defined(WITH_PTHREADS) +static void * rpmpsmThread(void * _psm) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies arg, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + rpmpsm psm = (rpmpsm) _psm; +/*@-unqualifiedtrans@*/ + return ((void *) rpmpsmStage(psm, psm->nstage)); +/*@=unqualifiedtrans@*/ +} +#endif + +static int rpmpsmNext(rpmpsm psm, pkgStage nstage) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + psm->nstage = nstage; +#if defined(WITH_PTHREADS) + if (_psm_threads) + return rpmsqJoin( rpmsqThread(rpmpsmThread, psm) ); +#endif + return rpmpsmStage(psm, psm->nstage); +} + +/** + * @todo Packages w/o files never get a callback, hence don't get displayed + * on install with -v. + */ +/*@-nullpass@*/ /* FIX: testing null annotation for fi->h */ +rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + const rpmts ts = psm->ts; + rpmuint32_t tscolor = rpmtsColor(ts); + rpmfi fi = psm->fi; + rpmRC rc = psm->rc; + int saveerrno; + int xx; + +/* XXX hackery to assert(!scareMem) in rpmfiNew. */ +/*@-castexpose@*/ +if (fi->h == NULL && fi->te && ((rpmte)fi->te)->h != NULL) fi->h = headerLink(((rpmte)fi->te)->h); +/*@=castexpose@*/ + + switch (stage) { + case PSM_UNKNOWN: + break; + case PSM_INIT: + rpmlog(RPMLOG_DEBUG, D_("%s: %s has %d files, test = %d\n"), + psm->stepName, rpmteNEVR(psm->te), + rpmfiFC(fi), (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST)); + + /* + * When we run scripts, we pass an argument which is the number of + * versions of this package that will be installed when we are + * finished. + */ + psm->npkgs_installed = rpmdbCountPackages(rpmtsGetRdb(ts), rpmteN(psm->te)); + if (psm->npkgs_installed < 0) { + rc = RPMRC_FAIL; + break; + } + + /* Adjust package count on rollback downgrade. */ +assert(psm->te != NULL); + if (rpmtsType(ts) == RPMTRANS_TYPE_AUTOROLLBACK && + (psm->goal & ~(PSM_PKGSAVE|PSM_PKGERASE))) + { + if (psm->te->downgrade) + psm->npkgs_installed--; + } + + if (psm->goal == PSM_PKGINSTALL) { + int fc = rpmfiFC(fi); + const char * hdrid; + + /* Add per-transaction data to install header. */ + xx = populateInstallHeader(ts, psm->te, fi); + + psm->scriptArg = psm->npkgs_installed + 1; + +assert(psm->mi == NULL); + hdrid = rpmteHdrid(psm->te); + if (hdrid != NULL) { + /* XXX should use RPMTAG_HDRID not RPMTAG_SHA1HEADER */ + psm->mi = rpmtsInitIterator(ts, RPMTAG_SHA1HEADER, hdrid, 0); + } else { + psm->mi = rpmtsInitIterator(ts, RPMTAG_NAME, rpmteN(psm->te),0); + xx = rpmmiAddPattern(psm->mi, RPMTAG_EPOCH, RPMMIRE_STRCMP, + rpmteE(psm->te)); + xx = rpmmiAddPattern(psm->mi, RPMTAG_VERSION, RPMMIRE_STRCMP, + rpmteV(psm->te)); + xx = rpmmiAddPattern(psm->mi, RPMTAG_RELEASE, RPMMIRE_STRCMP, + rpmteR(psm->te)); +#ifdef RPM_VENDOR_MANDRIVA + xx = rpmmiAddPattern(psm->mi, RPMTAG_DISTEPOCH, RPMMIRE_STRCMP, + rpmteD(psm->te)); +#endif + if (tscolor) { + xx = rpmmiAddPattern(psm->mi,RPMTAG_ARCH, RPMMIRE_STRCMP, + rpmteA(psm->te)); + xx = rpmmiAddPattern(psm->mi, RPMTAG_OS, RPMMIRE_STRCMP, + rpmteO(psm->te)); + } + } + + while ((psm->oh = rpmmiNext(psm->mi)) != NULL) { + fi->record = rpmmiInstance(psm->mi); + psm->oh = NULL; + /*@loopbreak@*/ break; + } + psm->mi = rpmmiFree(psm->mi); + + rc = RPMRC_OK; + + /* XXX lazy alloc here may need to be done elsewhere. */ + if (fi->fstates == NULL && fc > 0) { + fi->fstates = (rpmuint8_t *) xmalloc(sizeof(*fi->fstates) * fc); + memset(fi->fstates, RPMFILE_STATE_NORMAL, fc); + } + + xx = rpmtxnBegin(rpmtsGetRdb(ts), ts->txn, &psm->te->txn); + + if (rpmtsFlags(ts) & RPMTRANS_FLAG_JUSTDB) break; + if (fc <= 0) break; + + /* + * Old format relocatable packages need the entire default + * prefix stripped to form the cpio list, while all other packages + * need the leading / stripped. + */ + he->tag = RPMTAG_DEFAULTPREFIX; + xx = headerGet(fi->h, he, 0); + fi->striplen = (xx && he->p.str ? strlen(he->p.str) + 1 : 1); + he->p.ptr = _free(he->p.ptr); + fi->mapflags = + IOSM_MAP_PATH | IOSM_MAP_MODE | IOSM_MAP_UID | IOSM_MAP_GID | (fi->mapflags & IOSM_SBIT_CHECK); + + if (headerIsEntry(fi->h, RPMTAG_ORIGBASENAMES)) + he->tag = RPMTAG_ORIGPATHS; + else + he->tag = RPMTAG_FILEPATHS; + xx = headerGet(fi->h, he, 0); +assert(he->p.argv != NULL); + fi->apath = he->p.argv; + + if (fi->fuser == NULL) { + he->tag = RPMTAG_FILEUSERNAME; + xx = headerGet(fi->h, he, 0); + fi->fuser = he->p.argv; + } + if (fi->fgroup == NULL) { + he->tag = RPMTAG_FILEGROUPNAME; + xx = headerGet(fi->h, he, 0); + fi->fgroup = he->p.argv; + } + rc = RPMRC_OK; + } + if (psm->goal == PSM_PKGERASE || psm->goal == PSM_PKGSAVE) { + psm->scriptArg = psm->npkgs_installed - 1; + + /* XXX FIXME: PSM_PKGSAVE needs to be transactionally protected. */ + if (psm->goal == PSM_PKGERASE) + xx = rpmtxnBegin(rpmtsGetRdb(ts), ts->txn, &psm->te->txn); + + /* Retrieve installed header. */ + rc = (rpmRC) rpmpsmNext(psm, PSM_RPMDB_LOAD); + if (rc == RPMRC_OK && psm->te) + (void) rpmteSetHeader(psm->te, fi->h); + } + if (psm->goal == PSM_PKGSAVE) { + /* Open output package for writing. */ + { char tiddn[32]; + const char * bfmt; + const char * pkgdn; + const char * pkgbn; + char * pkgdn_buf; + + xx = snprintf(tiddn, sizeof(tiddn), "%d", rpmtsGetTid(ts)); + bfmt = rpmGetPath(tiddn, "/", "%{_repackage_name_fmt}", NULL); + pkgbn = headerSprintf(fi->h, bfmt, + NULL, rpmHeaderFormats, NULL); + bfmt = _free(bfmt); + psm->pkgURL = rpmGenPath("%{?_repackage_root}", + "%{?_repackage_dir}", + pkgbn); + pkgbn = _free(pkgbn); + (void) urlPath(psm->pkgURL, &psm->pkgfn); + pkgdn_buf = xstrdup(psm->pkgfn); +/*@-moduncon@*/ + pkgdn = dirname(pkgdn_buf); +/*@=moduncon@*/ + rc = rpmMkdirPath(pkgdn, "_repackage_dir"); + pkgdn_buf = _free(pkgdn_buf); + if (rc == RPMRC_FAIL) + break; + psm->fd = Fopen(psm->pkgfn, "w.fdio"); + if (psm->fd == NULL || Ferror(psm->fd)) { + rc = RPMRC_FAIL; + break; + } + } + } + break; + case PSM_PRE: + if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST) break; + +/* XXX insure that trigger index is opened before entering chroot. */ +#ifdef NOTYET + { static int oneshot = 0; + dbiIndex dbi; + if (!oneshot) { + dbi = dbiOpen(rpmtsGetRdb(ts), RPMTAG_TRIGGERNAME, 0); + oneshot++; + } + } +#endif + + /* Change root directory if requested and not already done. */ + rc = (rpmRC) rpmpsmNext(psm, PSM_CHROOT_IN); + + if (psm->goal == PSM_PKGINSTALL) { + psm->scriptTag = RPMTAG_PREIN; + psm->progTag = RPMTAG_PREINPROG; + psm->sense = RPMSENSE_TRIGGERPREIN; + psm->countCorrection = 0; /* XXX is this correct?!? */ + + if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOTRIGGERPREIN)) { + + /* Run triggers in other package(s) this package sets off. */ + rc = (rpmRC) rpmpsmNext(psm, PSM_TRIGGERS); + if (rc) break; + + /* Run triggers in this package other package(s) set off. */ + rc = (rpmRC) rpmpsmNext(psm, PSM_IMMED_TRIGGERS); + if (rc) break; + } + + if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOPRE)) { + rc = (rpmRC) rpmpsmNext(psm, PSM_SCRIPT); + if (rc != RPMRC_OK) { + rpmlog(RPMLOG_ERR, + _("%s: %s scriptlet failed (%d), skipping %s\n"), + psm->stepName, tag2sln(psm->scriptTag), rc, + rpmteNEVR(psm->te)); + break; + } + } + } + + if (psm->goal == PSM_PKGERASE) { + psm->scriptTag = RPMTAG_PREUN; + psm->progTag = RPMTAG_PREUNPROG; + psm->sense = RPMSENSE_TRIGGERUN; + psm->countCorrection = -1; + + if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOTRIGGERUN)) { + /* Run triggers in this package other package(s) set off. */ + rc = (rpmRC) rpmpsmNext(psm, PSM_IMMED_TRIGGERS); + if (rc) break; + + /* Run triggers in other package(s) this package sets off. */ + rc = (rpmRC) rpmpsmNext(psm, PSM_TRIGGERS); + if (rc) break; + } + + if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOPREUN)) + rc = (rpmRC) rpmpsmNext(psm, PSM_SCRIPT); + } + if (psm->goal == PSM_PKGSAVE) { + int noArchiveSize = 0; + const char * origin = NULL; + const char * digest = NULL; + const struct stat * st = NULL; + size_t nstbytes = 0; + + /* Regenerate original header. */ + { void * uh = NULL; + + /* Save original header's origin/digest/stat (i.e. URL) */ + he->tag = RPMTAG_PACKAGEORIGIN; + xx = headerGet(fi->h, he, 0); + origin = he->p.str; + he->tag = RPMTAG_PACKAGEDIGEST; + xx = headerGet(fi->h, he, 0); + if (xx && he->p.str != NULL) + digest = he->p.str; + he->tag = RPMTAG_PACKAGESTAT; + xx = headerGet(fi->h, he, 0); + if (xx && he->p.ptr != NULL && (size_t)he->c == sizeof(*st)) { + st = (struct stat *) he->p.ptr; + nstbytes = he->c; + } + + /* Retrieve original header blob. */ + he->tag = RPMTAG_HEADERIMMUTABLE; + xx = headerGet(fi->h, he, 0); + uh = he->p.ptr; + if (xx && uh != NULL) { + psm->oh = headerCopyLoad(uh); + uh = _free(uh); + } else { + he->tag = RPMTAG_HEADERIMAGE; + xx = headerGet(fi->h, he, 0); + uh = he->p.ptr; + if (xx && uh != NULL) { + HeaderIterator hi; + Header oh; + + /* Load the original header from the blob. */ + oh = headerCopyLoad(uh); + + /* XXX this is headerCopy w/o headerReload() */ + psm->oh = headerNew(); + + for (hi = headerInit(oh); + headerNext(hi, he, 0); + he->p.ptr = _free(he->p.ptr)) + { + if (he->tag == RPMTAG_ARCHIVESIZE) + noArchiveSize = 1; + xx = headerPut(psm->oh, he, 0); + } + hi = headerFini(hi); + + (void)headerFree(oh); + oh = NULL; + uh = _free(uh); + } else + break; /* XXX shouldn't ever happen */ + } + } + + /* Retrieve type of payload compression. */ + /*@-nullstate@*/ /* FIX: psm->oh may be NULL */ + rc = (rpmRC) rpmpsmNext(psm, PSM_RPMIO_FLAGS); + /*@=nullstate@*/ + + /* Write the lead section into the package. */ + { static const char item[] = "Lead"; + const char * NEVR = rpmteNEVR(psm->te); + size_t nb = rpmpkgSizeof(item, NULL); + + if (nb == 0) + rc = RPMRC_FAIL; + else { + void * l = memset(alloca(nb), 0, nb); + rc = rpmpkgWrite(item, psm->fd, l, &NEVR); + } + if (rc != RPMRC_OK) { + rpmlog(RPMLOG_ERR, _("Unable to write package: %s\n"), + Fstrerror(psm->fd)); + break; + } + } + + /* Write the signature section into the package. */ + /* XXX rpm-4.1 and later has archive size in signature header. */ + { static const char item[] = "Signature"; + Header sigh = headerRegenSigHeader(fi->h, noArchiveSize); + /* Reallocate the signature into one contiguous region. */ + sigh = headerReload(sigh, RPMTAG_HEADERSIGNATURES); + if (sigh == NULL) { + rpmlog(RPMLOG_ERR, _("Unable to reload signature header\n")); + rc = RPMRC_FAIL; + break; + } + rc = rpmpkgWrite(item, psm->fd, sigh, NULL); + (void)headerFree(sigh); + sigh = NULL; + if (rc != RPMRC_OK) { + break; + } + } + + /* Add remove transaction id to header. */ + if (psm->oh != NULL) + { rpmuint32_t tid = rpmtsGetTid(ts); + + he->tag = RPMTAG_REMOVETID; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &tid; + he->c = 1; + xx = headerPut(psm->oh, he, 0); + + /* Add original header's origin/digest/stat (i.e. URL) */ + if (origin != NULL) { + he->tag = RPMTAG_PACKAGEORIGIN; + he->t = RPM_STRING_TYPE; + he->p.str = origin; + he->c = 1; + xx = headerPut(psm->oh, he, 0); + origin = _free(origin); + } + if (digest != NULL) { + he->tag = RPMTAG_PACKAGEDIGEST; + he->t = RPM_STRING_TYPE; + he->p.str = digest; + he->c = 1; + xx = headerPut(psm->oh, he, 0); + digest = _free(digest); + } + if (st != NULL) { + he->tag = RPMTAG_PACKAGESTAT; + he->t = RPM_BIN_TYPE; + he->p.ptr = (void *)st; + he->c = (rpmTagCount)nstbytes; + xx = headerPut(psm->oh, he, 0); + st = _free(st); + } + + /* Copy upgrade chain link tags. */ + xx = hCopyTag(fi->h, psm->oh, RPMTAG_INSTALLTID); + xx = hCopyTag(fi->h, psm->oh, RPMTAG_BLINKPKGID); + xx = hCopyTag(fi->h, psm->oh, RPMTAG_BLINKHDRID); + xx = hCopyTag(fi->h, psm->oh, RPMTAG_BLINKNEVRA); + +assert(psm->te != NULL); + xx = hSaveFlinks(psm->oh, &psm->te->flink); + } + + /* Write the metadata section into the package. */ + { const char item[] = "Header"; + const char * msg = NULL; + rc = rpmpkgWrite(item, psm->fd, psm->oh, &msg); + if (rc != RPMRC_OK) { + rpmlog(RPMLOG_ERR, "%s: %s: %s", psm->pkgfn, item, + (msg && *msg ? msg : "write failed\n")); + msg = _free(msg); + } + } + } + break; + case PSM_PROCESS: + if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST) break; + + if (psm->goal == PSM_PKGINSTALL) { + + if (rpmtsFlags(ts) & RPMTRANS_FLAG_JUSTDB) break; + + /* XXX Synthesize callbacks for packages with no files. */ + if (rpmfiFC(fi) <= 0) { + void * ptr; + ptr = rpmtsNotify(ts, (rpmte)fi->te, RPMCALLBACK_INST_START, 0, 100); + ptr = rpmtsNotify(ts, (rpmte)fi->te, RPMCALLBACK_INST_PROGRESS, 100, 100); + break; + } + + /* Retrieve type of payload compression. */ + rc = (rpmRC) rpmpsmNext(psm, PSM_RPMIO_FLAGS); + + if (rpmteFd((rpmte)fi->te) == NULL) { /* XXX can't happen */ + rc = RPMRC_FAIL; + break; + } + + /*@-nullpass@*/ /* LCL: fi->fd != NULL here. */ + psm->cfd = Fdopen(fdDup(Fileno(rpmteFd((rpmte)fi->te))), psm->rpmio_flags); + /*@=nullpass@*/ + if (psm->cfd == NULL) { /* XXX can't happen */ + rc = RPMRC_FAIL; + break; + } + + xx = rpmtxnBegin(rpmtsGetRdb(ts), psm->te->txn, NULL); + + rc = (rpmRC) fsmSetup(fi->fsm, IOSM_PKGINSTALL, psm->payload_format, + ts, fi, psm->cfd, NULL, &psm->failedFile); + (void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_UNCOMPRESS), + fdstat_op(psm->cfd, FDSTAT_READ)); + (void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_DIGEST), + fdstat_op(psm->cfd, FDSTAT_DIGEST)); + xx = fsmTeardown(fi->fsm); + + saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */ + xx = Fclose(psm->cfd); + psm->cfd = NULL; + /*@-mods@*/ + errno = saveerrno; /* XXX FIXME: Fclose with libio destroys errno */ + /*@=mods@*/ + + if (!rc) + rc = (rpmRC) rpmpsmNext(psm, PSM_COMMIT); + + /* Commit/abort the SRPM install transaction. */ + /* XXX move into the PSM package state machine w PSM_COMMIT */ + { rpmdb db = rpmtsGetRdb(ts); + rpmtxn _txn = (db ? db->db_txn : NULL); + if (_txn != NULL) { + if (rc) + xx = rpmtxnAbort(_txn); + else + xx = rpmtxnCommit(_txn); + db->db_txn = NULL; + } + } + + /* XXX make sure progress is closed out */ + psm->what = RPMCALLBACK_INST_PROGRESS; + psm->amount = (fi->archiveSize ? fi->archiveSize : 100); + psm->total = psm->amount; + xx = rpmpsmNext(psm, PSM_NOTIFY); + + if (rc) { + const char * msg = iosmStrerror(rc); + rpmlog(RPMLOG_ERR, + _("unpacking of archive failed%s%s: %s\n"), + (psm->failedFile != NULL ? _(" on file ") : ""), + (psm->failedFile != NULL ? psm->failedFile : ""), + msg); + msg = _free(msg); + rc = RPMRC_FAIL; + + /* XXX notify callback on error. */ + psm->what = RPMCALLBACK_UNPACK_ERROR; + psm->amount = 0; + psm->total = 0; + xx = rpmpsmNext(psm, PSM_NOTIFY); + + break; + } + } + if (psm->goal == PSM_PKGERASE) { + int fc = rpmfiFC(fi); + + if (rpmtsFlags(ts) & RPMTRANS_FLAG_JUSTDB) break; + if (rpmtsFlags(ts) & RPMTRANS_FLAG_APPLYONLY) break; + + psm->what = RPMCALLBACK_UNINST_START; + psm->amount = fc; + psm->total = (fc ? fc : 100); + xx = rpmpsmNext(psm, PSM_NOTIFY); + + if (fc > 0) { + rc = (rpmRC) fsmSetup(fi->fsm, IOSM_PKGERASE, psm->payload_format, + ts, fi, NULL, NULL, &psm->failedFile); + xx = fsmTeardown(fi->fsm); + } + + psm->what = RPMCALLBACK_UNINST_STOP; + psm->amount = (fc ? fc : 100); + psm->total = (fc ? fc : 100); + xx = rpmpsmNext(psm, PSM_NOTIFY); + + } + if (psm->goal == PSM_PKGSAVE) { + iosmFileAction * actions = (iosmFileAction *) fi->actions; + iosmFileAction action = (iosmFileAction) fi->action; + + fi->action = FA_COPYOUT; + fi->actions = NULL; + + if (psm->fd == NULL) { /* XXX can't happen */ + rc = RPMRC_FAIL; + break; + } + /*@-nullpass@*/ /* FIX: fdDup mey return NULL. */ + xx = Fflush(psm->fd); + psm->cfd = Fdopen(fdDup(Fileno(psm->fd)), psm->rpmio_flags); + /*@=nullpass@*/ + if (psm->cfd == NULL) { /* XXX can't happen */ + rc = RPMRC_FAIL; + break; + } + + rc = (rpmRC) fsmSetup(fi->fsm, IOSM_PKGBUILD, psm->payload_format, + ts, fi, psm->cfd, NULL, &psm->failedFile); + (void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_COMPRESS), + fdstat_op(psm->cfd, FDSTAT_WRITE)); + (void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_DIGEST), + fdstat_op(psm->cfd, FDSTAT_DIGEST)); + xx = fsmTeardown(fi->fsm); + + saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */ + xx = Fclose(psm->cfd); + psm->cfd = NULL; + /*@-mods@*/ + errno = saveerrno; + /*@=mods@*/ + + /* XXX make sure progress is closed out */ + psm->what = RPMCALLBACK_INST_PROGRESS; + psm->amount = (fi->archiveSize ? fi->archiveSize : 100); + psm->total = psm->amount; + xx = rpmpsmNext(psm, PSM_NOTIFY); + + fi->action = (int) action; + fi->actions = (int *) actions; + } + break; + case PSM_POST: + if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST) break; + + if (psm->goal == PSM_PKGINSTALL) { + + psm->scriptTag = RPMTAG_POSTIN; + psm->progTag = RPMTAG_POSTINPROG; + psm->sense = RPMSENSE_TRIGGERIN; + psm->countCorrection = 0; + + if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOPOST)) { + rc = (rpmRC) rpmpsmNext(psm, PSM_SCRIPT); + if (rc) break; + } + if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOTRIGGERIN)) { + /* Run triggers in other package(s) this package sets off. */ + rc = (rpmRC) rpmpsmNext(psm, PSM_TRIGGERS); + if (rc) break; + + /* Run triggers in this package other package(s) set off. */ + rc = (rpmRC) rpmpsmNext(psm, PSM_IMMED_TRIGGERS); + if (rc) break; + } + + /* + * If this header has already been installed, remove it from + * the database before adding the new header. + */ + if (fi->record && !(rpmtsFlags(ts) & RPMTRANS_FLAG_APPLYONLY)) { + rc = (rpmRC) rpmpsmNext(psm, PSM_RPMDB_REMOVE); + if (rc) break; + } + + /* Add scriptlet/file states to install header. */ + xx = postPopulateInstallHeader(ts, psm, fi); + + rc = (rpmRC) rpmpsmNext(psm, PSM_RPMDB_ADD); + if (rc) break; + +#ifdef DYING + if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_APPLYONLY)) + rc = markReplacedFiles(psm); +#endif + + } + if (psm->goal == PSM_PKGERASE) { + + psm->scriptTag = RPMTAG_POSTUN; + psm->progTag = RPMTAG_POSTUNPROG; + psm->sense = RPMSENSE_TRIGGERPOSTUN; + psm->countCorrection = -1; + + if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOPOSTUN)) { + rc = (rpmRC) rpmpsmNext(psm, PSM_SCRIPT); + if (rc) break; + } + + if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOTRIGGERPOSTUN)) { + /* Run triggers in other package(s) this package sets off. */ + rc = (rpmRC) rpmpsmNext(psm, PSM_TRIGGERS); + if (rc) break; + + /* Run triggers in this package other package(s) set off. */ + rc = (rpmRC) rpmpsmNext(psm, PSM_IMMED_TRIGGERS); + if (rc) break; + } + + if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_APPLYONLY)) + rc = (rpmRC) rpmpsmNext(psm, PSM_RPMDB_REMOVE); + } + if (psm->goal == PSM_PKGSAVE) { + } + + /* Restore root directory if changed. */ + xx = rpmpsmNext(psm, PSM_CHROOT_OUT); + break; + case PSM_UNDO: + break; + case PSM_FINI: + /* Restore root directory if changed. */ + xx = rpmpsmNext(psm, PSM_CHROOT_OUT); + + if (psm->fd != NULL) { + saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */ + xx = Fclose(psm->fd); + psm->fd = NULL; + /*@-mods@*/ + errno = saveerrno; + /*@=mods@*/ + } + + if (psm->goal == PSM_PKGSAVE) { + if (!rc && ts && ts->notify == NULL) { + rpmlog(RPMLOG_INFO, _("Wrote: %s\n"), + (psm->pkgURL ? psm->pkgURL : "???")); + } + } + + if (rc) { + const char * msg = iosmStrerror(rc); + if (psm->failedFile) + rpmlog(RPMLOG_ERR, + _("%s failed on file %s: %s\n"), + psm->stepName, psm->failedFile, msg); + else + rpmlog(RPMLOG_ERR, _("%s failed: %s\n"), + psm->stepName, msg); + msg = _free(msg); + + /* XXX notify callback on error. */ + psm->what = RPMCALLBACK_CPIO_ERROR; + psm->amount = 0; + psm->total = 0; + /*@-nullstate@*/ /* FIX: psm->fd may be NULL. */ + xx = rpmpsmNext(psm, PSM_NOTIFY); + /*@=nullstate@*/ + if (psm->te->txn != NULL) { + xx = rpmtxnAbort(psm->te->txn); + psm->te->txn = NULL; + } + } else { + if (psm->te->txn != NULL) { + xx = rpmtxnCommit(psm->te->txn); + psm->te->txn = NULL; + } + } + + if (psm->goal == PSM_PKGERASE || psm->goal == PSM_PKGSAVE) { + if (psm->te != NULL) + (void) rpmteSetHeader(psm->te, NULL); + if (fi->h != NULL) { + (void)headerFree(fi->h); + fi->h = NULL; + } + } + (void)headerFree(psm->oh); + psm->oh = NULL; + psm->pkgURL = _free(psm->pkgURL); + psm->rpmio_flags = _free(psm->rpmio_flags); + psm->payload_format = _free(psm->payload_format); + psm->failedFile = _free(psm->failedFile); + + fi->fgroup = _free(fi->fgroup); + fi->fuser = _free(fi->fuser); + fi->apath = _free(fi->apath); + fi->fstates = _free(fi->fstates); + break; + + case PSM_PKGINSTALL: + case PSM_PKGERASE: + case PSM_PKGSAVE: + psm->goal = stage; + psm->rc = RPMRC_OK; + psm->stepName = pkgStageString(stage); + + rc = (rpmRC) rpmpsmNext(psm, PSM_INIT); + if (!rc) rc = (rpmRC) rpmpsmNext(psm, PSM_PRE); + if (!rc) rc = (rpmRC) rpmpsmNext(psm, PSM_PROCESS); + if (!rc) rc = (rpmRC) rpmpsmNext(psm, PSM_POST); + xx = rpmpsmNext(psm, PSM_FINI); + break; + case PSM_PKGCOMMIT: + break; + + case PSM_CREATE: + break; + case PSM_NOTIFY: + { void * ptr; +/*@-nullpass@*/ /* FIX: psm->te may be NULL */ + ptr = rpmtsNotify(ts, psm->te, psm->what, psm->amount, psm->total); +/*@-nullpass@*/ + } break; + case PSM_DESTROY: + break; + case PSM_COMMIT: + if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_PKGCOMMIT)) break; + if (rpmtsFlags(ts) & RPMTRANS_FLAG_APPLYONLY) break; + + rc = (rpmRC) fsmSetup(fi->fsm, IOSM_PKGCOMMIT, psm->payload_format, + ts, fi, NULL, NULL, &psm->failedFile); + xx = fsmTeardown(fi->fsm); + break; + + case PSM_CHROOT_IN: + { const char * rootDir = rpmtsRootDir(ts); + /* Change root directory if requested and not already done. */ + if (rootDir != NULL && !(rootDir[0] == '/' && rootDir[1] == '\0') + && !rpmtsChrootDone(ts) && !F_ISSET(psm, CHROOTDONE)) + { + static int _pw_loaded = 0; + static int _gr_loaded = 0; + + if (!_pw_loaded) { + (void)getpwnam("root"); + endpwent(); + _pw_loaded++; + } + if (!_gr_loaded) { + (void)getgrnam("root"); + endgrent(); + _gr_loaded++; + } + + xx = Chdir("/"); + /*@-modobserver@*/ + if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/') + rc = (rpmRC) Chroot(rootDir); + /*@=modobserver@*/ + F_SET(psm, CHROOTDONE); + (void) rpmtsSetChrootDone(ts, 1); + } + } break; + case PSM_CHROOT_OUT: + /* Restore root directory if changed. */ + if (F_ISSET(psm, CHROOTDONE)) { + const char * rootDir = rpmtsRootDir(ts); + const char * currDir = rpmtsCurrDir(ts); + /*@-modobserver@*/ + if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/') + rc = (rpmRC) Chroot("."); + /*@=modobserver@*/ + F_CLR(psm, CHROOTDONE); + (void) rpmtsSetChrootDone(ts, 0); + if (currDir != NULL) /* XXX can't happen */ + xx = Chdir(currDir); + } + break; + case PSM_SCRIPT: /* Run current package scriptlets. */ + /* XXX running %verifyscript/%sanitycheck doesn't have psm->te */ + { rpmtxn _parent = (psm && psm->te ? psm->te->txn : NULL); + xx = rpmtxnBegin(rpmtsGetRdb(ts), _parent, NULL); + rc = runInstScript(psm); + if (rc) + xx = rpmtxnAbort(rpmtsGetRdb(ts)->db_txn); + else + xx = rpmtxnCommit(rpmtsGetRdb(ts)->db_txn); + rpmtsGetRdb(ts)->db_txn = NULL; + } break; + case PSM_TRIGGERS: + /* Run triggers in other package(s) this package sets off. */ + if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST) break; + rc = runTriggers(psm); + break; + case PSM_IMMED_TRIGGERS: + /* Run triggers in this package other package(s) set off. */ + if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST) break; + if (!F_ISSET(psm, GOTTRIGGERS)) { + psm->triggers = rpmdsNew(fi->h, RPMTAG_TRIGGERNAME, 0); + F_SET(psm, GOTTRIGGERS); + } + if (psm->triggers != NULL) + rc = runImmedTriggers(psm); + break; + + case PSM_RPMIO_FLAGS: + { const char * payload_compressor = NULL; + const char * payload_format = NULL; + char * t; + + he->tag = RPMTAG_PAYLOADCOMPRESSOR; + xx = headerGet(fi->h, he, 0); + payload_compressor = he->p.str; + if (payload_compressor == NULL) + payload_compressor = xstrdup("gzip"); + + psm->rpmio_flags = t = (char *) xmalloc(sizeof("w9.gzdio")); + *t = '\0'; + t = stpcpy(t, ((psm->goal == PSM_PKGSAVE) ? "w9" : "r")); + if (!strcmp(payload_compressor, "gzip")) + t = stpcpy(t, ".gzdio"); + if (!strcmp(payload_compressor, "bzip2")) + t = stpcpy(t, ".bzdio"); + if (!strcmp(payload_compressor, "lzma")) + t = stpcpy(t, ".lzdio"); + if (!strcmp(payload_compressor, "xz")) + t = stpcpy(t, ".xzdio"); + payload_compressor = _free(payload_compressor); + + he->tag = RPMTAG_PAYLOADFORMAT; + xx = headerGet(fi->h, he, 0); + payload_format = he->p.str; + if (!xx || payload_format == NULL || !( + !strcmp(payload_format, "tar") || !strcmp(payload_format, "ustar") +#if defined(SUPPORT_AR_PAYLOADS) + || !strcmp(payload_format, "ar") +#endif + )) + { + payload_format = _free(payload_format); + payload_format = xstrdup("cpio"); + } + psm->payload_format = _free(psm->payload_format); + psm->payload_format = payload_format; + rc = RPMRC_OK; + } break; + + case PSM_RPMDB_LOAD: +assert(psm->mi == NULL); + psm->mi = rpmtsInitIterator(ts, RPMDBI_PACKAGES, + &fi->record, sizeof(fi->record)); + fi->h = rpmmiNext(psm->mi); +/*@-castexpose@*/ + if (fi->h != NULL) + fi->h = headerLink(fi->h); +/*@=castexpose@*/ + psm->mi = rpmmiFree(psm->mi); + + if (fi->h != NULL) { + (void) headerSetInstance(fi->h, fi->record); + rc = RPMRC_OK; + } else + rc = RPMRC_FAIL; + break; + case PSM_RPMDB_ADD: + if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST) break; + if (rpmtsFlags(ts) & RPMTRANS_FLAG_NORPMDB) break; + if (fi->isSource) break; /* XXX never add SRPM's */ + if (fi->h == NULL) break; /* XXX can't happen */ + + xx = rpmtxnBegin(rpmtsGetRdb(ts), psm->te->txn, NULL); + + /* Add header to db, doing header check if requested */ + /* XXX rollback headers propagate the previous transaction id. */ + { rpmuint32_t tid = ((rpmtsType(ts) == RPMTRANS_TYPE_ROLLBACK) + ? hLoadTID(fi->h, RPMTAG_INSTALLTID) : rpmtsGetTid(ts)); + (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_DBADD), 0); + if (!(rpmtsVSFlags(ts) & RPMVSF_NOHDRCHK)) + rc = (rpmRC) rpmdbAdd(rpmtsGetRdb(ts), tid, fi->h, ts); + else + rc = (rpmRC) rpmdbAdd(rpmtsGetRdb(ts), tid, fi->h, NULL); + (void) rpmswExit(rpmtsOp(ts, RPMTS_OP_DBADD), 0); +#if defined(HAVE_SYSLOG_H) && defined(RPM_VENDOR_MANDRIVA) /* log-install-remove-to-syslog */ + { + char *s, fmt; + fmt = rpmExpand("%{___NVRA}", NULL); + s = headerSprintf(fi->h, fmt, + rpmTagTable, rpmHeaderFormats, NULL); + syslog(LOG_NOTICE, "[RPM] %s installed\n", s); + fmt = _free(fmt); + s = _free(s); + } +#endif + } + + if (rc != RPMRC_OK) { + xx = rpmtxnAbort(rpmtsGetRdb(ts)->db_txn); + rpmtsGetRdb(ts)->db_txn = NULL; + break; + } else + xx = rpmtxnCommit(rpmtsGetRdb(ts)->db_txn); + rpmtsGetRdb(ts)->db_txn = NULL; + +assert(psm->te != NULL); + /* Mark non-rollback elements as installed. */ + if (rpmtsType(ts) != RPMTRANS_TYPE_ROLLBACK) + psm->te->installed = 1; + + /* Set the database instance for (possible) rollbacks. */ + rpmteSetDBInstance(psm->te, headerGetInstance(fi->h)); + + break; + case PSM_RPMDB_REMOVE: + { + if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST) break; + if (rpmtsFlags(ts) & RPMTRANS_FLAG_NORPMDB) break; + + xx = rpmtxnBegin(rpmtsGetRdb(ts), psm->te->txn, NULL); + + (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_DBREMOVE), 0); + rc = (rpmRC) rpmdbRemove(rpmtsGetRdb(ts), rpmtsGetTid(ts), fi->record, NULL); + (void) rpmswExit(rpmtsOp(ts, RPMTS_OP_DBREMOVE), 0); +#if defined(HAVE_SYSLOG_H) && defined(RPM_VENDOR_MANDRIVA) /* log-install-remove-to-syslog */ + { + char *s, fmt; + fmt = rpmExpand("%{___NVRA}", NULL); + s = headerSprintf(fi->h, fmt, + rpmTagTable, rpmHeaderFormats, NULL); + syslog(LOG_NOTICE, "[RPM] %s removed\n", s); + fmt = _free(fmt); + s = _free(s); + } +#endif + + if (rc != RPMRC_OK) { + xx = rpmtxnAbort(rpmtsGetRdb(ts)->db_txn); + rpmtsGetRdb(ts)->db_txn = NULL; + break; + } else + xx = rpmtxnCommit(rpmtsGetRdb(ts)->db_txn); + rpmtsGetRdb(ts)->db_txn = NULL; + + /* Forget the offset of a successfully removed header. */ + if (psm->te != NULL) /* XXX can't happen */ + psm->te->u.removed.dboffset = 0; + + } break; + + default: + break; +/*@i@*/ } + +/*@-nullstate@*/ /* FIX: psm->oh and psm->fi->h may be NULL. */ + return rc; +/*@=nullstate@*/ +} +/*@=nullpass@*/ diff --git a/rpm-5.4.9/lib/psm.h b/rpm-5.4.9/lib/psm.h new file mode 100644 index 0000000..4675953 --- /dev/null +++ b/rpm-5.4.9/lib/psm.h @@ -0,0 +1,230 @@ +#ifndef H_PSM +#define H_PSM + +/** \ingroup rpmtrans payload + * \file lib/psm.h + * Package state machine to handle a package from a transaction set. + */ + + +/** \ingroup rpmts + * Package state machine data. + */ +typedef /*@abstract@*/ /*@refcounted@*/ struct rpmpsm_s * rpmpsm; + +#include +#include /* XXX rpmfi typedef */ + +/*@-exportlocal@*/ +/*@unchecked@*/ +extern int _psm_debug; +/*@=exportlocal@*/ + +/** + */ +#define PSM_VERBOSE 0x8000 +#define PSM_INTERNAL 0x4000 +#define PSM_SYSCALL 0x2000 +#define PSM_DEAD 0x1000 +#define _fv(_a) ((_a) | PSM_VERBOSE) +#define _fi(_a) ((_a) | PSM_INTERNAL) +#define _fs(_a) ((_a) | (PSM_INTERNAL | PSM_SYSCALL)) +#define _fd(_a) ((_a) | (PSM_INTERNAL | PSM_DEAD)) +typedef enum pkgStage_e { + PSM_UNKNOWN = 0, + PSM_INIT = 1, + PSM_PRE = 2, + PSM_PROCESS = 3, + PSM_POST = 4, + PSM_UNDO = 5, + PSM_FINI = 6, + + PSM_PKGINSTALL = 7, + PSM_PKGERASE = 8, + PSM_PKGCOMMIT = 10, + PSM_PKGSAVE = 12, + + PSM_CREATE = 17, + PSM_NOTIFY = 22, + PSM_DESTROY = 23, + PSM_COMMIT = 25, + + PSM_CHROOT_IN = 51, + PSM_CHROOT_OUT = 52, + PSM_SCRIPT = 53, + PSM_TRIGGERS = 54, + PSM_IMMED_TRIGGERS = 55, + PSM_RPMIO_FLAGS = 56, + + PSM_RPMDB_LOAD = 97, + PSM_RPMDB_ADD = 98, + PSM_RPMDB_REMOVE = 99 + +} pkgStage; +#undef _fv +#undef _fi +#undef _fs +#undef _fd + +#if defined(_RPMPSM_INTERNAL) +/** + * PSM control bits. + */ +typedef enum rpmpsmFlags_e { + RPMPSM_FLAGS_DEBUG = (1 << 0), /*!< (unimplemented) */ + RPMPSM_FLAGS_CHROOTDONE = (1 << 1), /*!< Was chroot(2) done? */ + RPMPSM_FLAGS_UNORDERED = (1 << 2), /*!< Are all pre-requsites done? */ + RPMPSM_FLAGS_GOTTRIGGERS = (1 << 3), /*!< Triggers were retrieved? */ +} rpmpsmFlags; + +/** + */ +struct rpmpsm_s { + struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ + struct rpmsqElem sq; /*!< Scriptlet/signal queue element. */ + +/*@only@*/ /*@null@*/ + const char * NVRA; /*!< NVRA identifier (for debugging) */ + rpmpsmFlags flags; /*!< PSM control bit(s). */ +/*@refcounted@*/ + rpmts ts; /*!< transaction set */ +/*@dependent@*/ /*@null@*/ + rpmte te; /*!< current transaction element */ +/*@refcounted@*/ /*@relnull@*/ + rpmfi fi; /*!< file info */ +/*@refcounted@*/ /*@relnull@*/ + rpmds triggers; /*!< trigger dependency set */ +/*@null@*/ + const char ** Tpats; /*!< rpmdb trigger pattern strings */ +/*@null@*/ + void * Tmires; /*!< rpmdb trigger patterns */ + int nTmires; /*!< no. of rpmdb trigger patterns */ +/*@only@*/ + HE_t IPhe; /*!< Install prefixes */ +/*@relnull@*/ + FD_t cfd; /*!< Payload file handle. */ +/*@relnull@*/ + FD_t fd; /*!< Repackage file handle. */ + Header oh; /*!< Repackage header. */ +/*@null@*/ + rpmmi mi; /*!< An rpmdb iterator for this psm's use. */ +/*@observer@*/ + const char * stepName; /*!< The current PSM step (for display). */ +/*@only@*/ /*@null@*/ + const char * rpmio_flags; /*!< Payload compression type/flags. */ +/*@only@*/ /*@null@*/ + const char * payload_format;/*!< Payload archive format. */ +/*@only@*/ /*@null@*/ + const char * failedFile; +/*@only@*/ /*@null@*/ + const char * pkgURL; /*!< Repackage URL. */ +/*@dependent@*/ + const char * pkgfn; /*!< Repackage file name. */ +/*@only@*/ /*@null@*/ + rpmuint32_t sstates[RPMSCRIPT_MAX]; /*!< Scriptlet return codes. */ + rpmuint32_t smetrics[RPMSCRIPT_MAX];/*!< Scriptlet time metrics. */ + rpmTag scriptTag; /*!< Scriptlet data tag. */ + rpmTag progTag; /*!< Scriptlet interpreter tag. */ + int npkgs_installed; /*!< No. of installed instances. */ + int scriptArg; /*!< Scriptlet package arg. */ + int sense; /*!< One of RPMSENSE_TRIGGER{PREIN,IN,UN,POSTUN}. */ + int countCorrection; /*!< 0 if installing, -1 if removing. */ + rpmCallbackType what; /*!< Callback type. */ + unsigned long long amount; /*!< Callback amount. */ + unsigned long long total; /*!< Callback total. */ + rpmRC rc; + pkgStage goal; +/*@unused@*/ + pkgStage stage; /*!< Current psm stage. */ + pkgStage nstage; /*!< Next psm stage. */ + +#if defined(__LCLINT__) +/*@refs@*/ + int nrefs; /*!< (unused) keep splint happy */ +#endif +}; +#endif /* _RPMPSM_INTERNAL */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Unreference a package state machine instance. + * @param psm package state machine + * @param msg + * @return NULL on last dereference + */ +/*@unused@*/ /*@null@*/ +rpmpsm rpmpsmUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmpsm psm, + /*@null@*/ const char * msg) + /*@modifies psm @*/; +#define rpmpsmUnlink(_psm, _msg) \ + ((rpmpsm)rpmioUnlinkPoolItem((rpmioItem)(_psm), _msg, __FILE__, __LINE__)) + +/** + * Reference a package state machine instance. + * @param psm package state machine + * @param msg + * @return new package state machine reference + */ +/*@unused@*/ /*@newref@*/ /*@null@*/ +rpmpsm rpmpsmLink (/*@null@*/ rpmpsm psm, /*@null@*/ const char * msg) + /*@modifies psm @*/; +#define rpmpsmLink(_psm, _msg) \ + ((rpmpsm)rpmioLinkPoolItem((rpmioItem)(_psm), _msg, __FILE__, __LINE__)) + +/** + * Destroy a package state machine. + * @param psm package state machine + * @return NULL on last dereference + */ +/*@null@*/ +rpmpsm rpmpsmFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmpsm psm, + /*@null@*/ const char * msg) + /*@globals fileSystem @*/ + /*@modifies psm, fileSystem @*/; +#define rpmpsmFree(_psm, _msg) \ + ((rpmpsm)rpmioFreePoolItem((rpmioItem)(_psm), _msg, __FILE__, __LINE__)) + +/** + * Create and load a package state machine. + * @param ts transaction set + * @param te transaction set element + * @param fi file info set + * @return new package state machine + */ +/*@null@*/ +rpmpsm rpmpsmNew(rpmts ts, /*@null@*/ rpmte te, rpmfi fi) + /*@modifies ts, fi @*/; + +/** + * Package state machine driver. + * @param psm package state machine data + * @param stage next stage + * @return 0 on success + */ +rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/; +#define rpmpsmUNSAFE rpmpsmSTAGE + +/** + * Run rpmpsmStage(PSM_SCRIPT) for scriptTag and progTag + * @param psm package state machine data + * @param scriptTag scriptlet tag to execute + * @param progTag scriptlet prog tag to execute + * @return 0 on success + */ +rpmRC rpmpsmScriptStage(rpmpsm psm, rpmTag scriptTag, rpmTag progTag) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/; + +void rpmpsmSetAsync(rpmpsm psm, int async) + /*@modifies psm @*/; + +#ifdef __cplusplus +} +#endif + +#endif /* H_PSM */ diff --git a/rpm-5.4.9/lib/query.c b/rpm-5.4.9/lib/query.c new file mode 100644 index 0000000..5d6d61f --- /dev/null +++ b/rpm-5.4.9/lib/query.c @@ -0,0 +1,972 @@ +/** \ingroup rpmcli + * \file lib/query.c + * Display tag values from package metadata. + */ + +#include "system.h" + +#ifndef PATH_MAX +/*@-incondefs@*/ /* FIX: long int? */ +# define PATH_MAX 255 +/*@=incondefs@*/ +#endif + +#include +#include +#include + +#include +#include "rpmdb.h" + +#include "rpmfi.h" +#define _RPMTS_INTERNAL /* XXX for ts->rdb */ +#include "rpmts.h" +#include "rpmgi.h" + +#include "manifest.h" +#include "misc.h" /* XXX for currentDirectory() */ + +#include + +#include "debug.h" + +static int _jbj; +#define JBJDEBUG(_list) if (_jbj) fprintf _list + +/*@access rpmts @*/ /* XXX cast */ + +#ifdef __cplusplus + +#define FF_ISSET(_fflags, _FLAG) ((_fflags) & (RPMFILE_##_FLAG)) + +#define QVA_ISSET(_qvaflags, _FLAG) ((_qvaflags) & (QUERY_##_FLAG)) + +#define VSF_ISSET(_vsflags, _FLAG) ((_vsflags) & (RPMVSF_##_FLAG)) +#define VSF_SET(_vsflags, _FLAG) \ + (*((unsigned *)&(_vsflags)) |= (RPMVSF_##_FLAG)) +#define VSF_CLR(_vsflags, _FLAG) \ + (*((unsigned *)&(_vsflags)) &= ~(RPMVSF_##_FLAG)) + +#else /* __cplusplus */ + +#define FF_ISSET(_fflags, _FLAG) ((_fflags) & (RPMFILE_##_FLAG)) + +#define QVA_ISSET(_qvaflags, _FLAG) ((_qvaflags) & (QUERY_##_FLAG)) + +#define VSF_ISSET(_vsflags, _FLAG) ((_vsflags) & (RPMVSF_##_FLAG)) +#define VSF_SET(_vsflags, _FLAG) (_vsflags) |= (RPMVSF_##_FLAG) +#define VSF_CLR(_vsflags, _FLAG) (_vsflags) &= ~(RPMVSF_##_FLAG) + +#endif /* __cplusplus */ + +/** + */ +static void printFileInfo(char * te, const char * name, + size_t size, unsigned short mode, + unsigned int mtime, + unsigned short rdev, unsigned int nlink, + const char * owner, const char * group, + const char * linkto) + /*@modifies *te @*/ +{ + char sizefield[15]; +#if defined(RPM_VENDOR_OPENPKG) /* adjust-verbose-listing */ + /* In verbose file listing output, give the owner and group fields + more width and at the same time reduce the nlink and size fields + more to typical sizes within OpenPKG. */ + char ownerfield[13+1], groupfield[13+1]; +#else + char ownerfield[8+1], groupfield[8+1]; +#endif + char timefield[100]; + time_t when = mtime; /* important if sizeof(rpmuint32_t) ! sizeof(time_t) */ + struct tm * tm; + static time_t now; + static struct tm nowtm; + const char * namefield = name; + char * perms = rpmPermsString(mode); + + /* On first call, grab snapshot of now */ + if (now == 0) { + now = time(NULL); + tm = localtime(&now); + if (tm) nowtm = *tm; /* structure assignment */ + } + + strncpy(ownerfield, owner, sizeof(ownerfield)); + ownerfield[sizeof(ownerfield)-1] = '\0'; + + strncpy(groupfield, group, sizeof(groupfield)); + groupfield[sizeof(groupfield)-1] = '\0'; + + /* this is normally right */ +#if defined(RPM_VENDOR_OPENPKG) /* adjust-verbose-listing */ + /* In verbose file listing output, give the owner and group fields + more width and at the same time reduce the nlink and size fields + more to typical sizes within OpenPKG. */ + sprintf(sizefield, "%8u", (unsigned)size); +#else + sprintf(sizefield, "%12u", (unsigned)size); +#endif + + /* this knows too much about dev_t */ + + if (S_ISLNK(mode)) { + char *nf = (char *) + alloca(strlen(name) + sizeof(" -> ") + strlen(linkto)); + sprintf(nf, "%s -> %s", name, linkto); + namefield = nf; + } else if (S_ISCHR(mode)) { + perms[0] = 'c'; + sprintf(sizefield, "%3u, %3u", ((unsigned)(rdev >> 8) & 0xff), + ((unsigned)rdev & 0xff)); + } else if (S_ISBLK(mode)) { + perms[0] = 'b'; + sprintf(sizefield, "%3u, %3u", ((unsigned)(rdev >> 8) & 0xff), + ((unsigned)rdev & 0xff)); + } + + /* Convert file mtime to display format */ + tm = localtime(&when); + timefield[0] = '\0'; + if (tm != NULL) + { const char *fmt; + if (now > when + 6L * 30L * 24L * 60L * 60L || /* Old. */ + now < when - 60L * 60L) /* In the future. */ + { + /* The file is fairly old or in the future. + * POSIX says the cutoff is 6 months old; + * approximate this by 6*30 days. + * Allow a 1 hour slop factor for what is considered "the future", + * to allow for NFS server/client clock disagreement. + * Show the year instead of the time of day. + */ + fmt = "%b %e %Y"; + } else { + fmt = "%b %e %H:%M"; + } + (void)strftime(timefield, sizeof(timefield) - 1, fmt, tm); + } + +#if defined(RPM_VENDOR_OPENPKG) /* adjust-verbose-listing */ + /* In verbose file listing output, give the owner and group fields + more width and at the same time reduce the nlink and size fields + more to typical sizes within OpenPKG. */ + sprintf(te, "%s %d %-13s %-13s %8s %s %s", perms, + (int)nlink, ownerfield, groupfield, sizefield, timefield, namefield); +#else + sprintf(te, "%s %4d %-7s %-8s %10s %s %s", perms, + (int)nlink, ownerfield, groupfield, sizefield, timefield, namefield); +#endif + perms = _free(perms); +} + +/** + */ +static inline /*@null@*/ const char * queryHeader(Header h, const char * qfmt) + /*@globals internalState @*/ + /*@modifies h, internalState @*/ +{ + const char * errstr = "(unkown error)"; + const char * str; + +/*@-modobserver@*/ + str = headerSprintf(h, qfmt, NULL, rpmHeaderFormats, &errstr); +/*@=modobserver@*/ + if (str == NULL) + rpmlog(RPMLOG_ERR, _("incorrect format: %s\n"), errstr); + return str; +} + +/** + */ +static void flushBuffer(char ** tp, char ** tep, int nonewline) + /*@modifies *tp, **tp, *tep, **tep @*/ +{ + char *t, *te; + + t = *tp; + te = *tep; + if (te > t) { + if (!nonewline) { + *te++ = '\n'; + *te = '\0'; + } + rpmlog(RPMLOG_NOTICE, "%s", t); + te = t; + *t = '\0'; + } + *tp = t; + *tep = te; +} + +int showQueryPackage(QVA_t qva, rpmts ts, Header h) +{ + int scareMem = 0; + rpmfi fi = NULL; + size_t tb = 2 * BUFSIZ; + size_t sb; + char * t, * te; + char * prefix = NULL; + int rc = 0; /* XXX FIXME: need real return code */ + int i; + +JBJDEBUG((stderr, "--> %s(%p,%p,%p)\n", __FUNCTION__, qva, ts, h)); + te = t = (char *) xmalloc(tb); + *te = '\0'; + + if (qva->qva_queryFormat != NULL) { + const char * str; +/*@-type@*/ /* FIX rpmtsGetRDB()? */ + (void) headerSetRpmdb(h, ts->rdb); +/*@=type@*/ + str = queryHeader(h, qva->qva_queryFormat); + (void) headerSetRpmdb(h, NULL); + if (str) { + size_t tx = (te - t); + + sb = strlen(str); + if (sb) { + tb += sb; + t = (char *) xrealloc(t, tb); + te = t + tx; + } + /*@-usereleased@*/ + te = stpcpy(te, str); + /*@=usereleased@*/ + str = _free(str); + flushBuffer(&t, &te, 1); + } + } + + if (!QVA_ISSET(qva->qva_flags, FOR_LIST)) + goto exit; + + fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, scareMem); + if (rpmfiFC(fi) <= 0) { + te = stpcpy(te, _("(contains no files)")); + goto exit; + } + + fi = rpmfiInit(fi, 0); + if (fi != NULL) + while ((i = rpmfiNext(fi)) >= 0) { + rpmfileAttrs fflags; + unsigned short fmode; + unsigned short frdev; + unsigned int fmtime; + rpmfileState fstate; + size_t fsize; + const char * fn; + const char * fdigest; + const char * fuser; + const char * fgroup; + const char * flink; + rpmuint32_t fnlink; + + fflags = (rpmfileAttrs) rpmfiFFlags(fi); + fmode = rpmfiFMode(fi); + frdev = rpmfiFRdev(fi); + fmtime = rpmfiFMtime(fi); + fstate = rpmfiFState(fi); + fsize = rpmfiFSize(fi); + fn = rpmfiFN(fi); + { static char hex[] = "0123456789abcdef"; + int dalgo = 0; + size_t dlen = 0; + const unsigned char * digest = rpmfiDigest(fi, &dalgo, &dlen); + char * p; + size_t j; + fdigest = p = (char *) xcalloc(1, ((2 * dlen) + 1)); + for (j = 0; j < dlen; j++) { + unsigned k = *digest++; + *p++ = hex[ (k >> 4) & 0xf ]; + *p++ = hex[ (k ) & 0xf ]; + } + *p = '\0'; + } + fuser = rpmfiFUser(fi); + fgroup = rpmfiFGroup(fi); + flink = rpmfiFLink(fi); + fnlink = rpmfiFNlink(fi); +assert(fn != NULL); +assert(fdigest != NULL); + + /* If querying only docs, skip non-doc files. */ + if (QVA_ISSET(qva->qva_flags, FOR_DOCS) && !FF_ISSET(fflags, DOC)) + continue; + + /* If querying only configs, skip non-config files. */ + if (QVA_ISSET(qva->qva_flags, FOR_CONFIG) && !FF_ISSET(fflags, CONFIG)) + continue; + + /* If not querying %config, skip config files. */ + if (FF_ISSET(qva->qva_fflags, CONFIG) && FF_ISSET(fflags, CONFIG)) + continue; + + /* If not querying %doc, skip doc files. */ + if (FF_ISSET(qva->qva_fflags, DOC) && FF_ISSET(fflags, DOC)) + continue; + + /* If not querying %ghost, skip ghost files. */ + if (FF_ISSET(qva->qva_fflags, GHOST) && FF_ISSET(fflags, GHOST)) + continue; + + /* Insure space for header derived data */ + sb = 0; + if (fn) sb += strlen(fn); + if (fdigest) sb += strlen(fdigest); + if (fuser) sb += strlen(fuser); + if (fgroup) sb += strlen(fgroup); + if (flink) sb += strlen(flink); + if ((sb + BUFSIZ) > tb) { + size_t tx = (te - t); + tb += sb + BUFSIZ; + t = (char *) xrealloc(t, tb); + te = t + tx; + } + + if (!rpmIsVerbose() && prefix) + te = stpcpy(te, prefix); + + if (QVA_ISSET(qva->qva_flags, FOR_STATE)) { + switch (fstate) { + case RPMFILE_STATE_NORMAL: + te = stpcpy(te, _("normal ")); + /*@switchbreak@*/ break; + case RPMFILE_STATE_REPLACED: + te = stpcpy(te, _("replaced ")); + /*@switchbreak@*/ break; + case RPMFILE_STATE_NOTINSTALLED: + te = stpcpy(te, _("not installed ")); + /*@switchbreak@*/ break; + case RPMFILE_STATE_NETSHARED: + te = stpcpy(te, _("net shared ")); + /*@switchbreak@*/ break; + case RPMFILE_STATE_WRONGCOLOR: + te = stpcpy(te, _("wrong color ")); + /*@switchbreak@*/ break; + case RPMFILE_STATE_MISSING: + te = stpcpy(te, _("(no state) ")); + /*@switchbreak@*/ break; + default: + sprintf(te, _("(unknown %3d) "), fstate); + te += strlen(te); + /*@switchbreak@*/ break; + } + } + + if (QVA_ISSET(qva->qva_flags, FOR_DUMPFILES)) { + sprintf(te, "%s %d %d %s 0%o ", + fn, (int)fsize, fmtime, fdigest, fmode); + te += strlen(te); + + if (fuser && fgroup) { +/*@-nullpass@*/ + sprintf(te, "%s %s", fuser, fgroup); +/*@=nullpass@*/ + te += strlen(te); + } else { + rpmlog(RPMLOG_CRIT, _("package without owner/group tags\n")); + } + + sprintf(te, " %s %s %u ", + FF_ISSET(fflags, CONFIG) ? "1" : "0", + FF_ISSET(fflags, DOC) ? "1" : "0", + frdev); + te += strlen(te); + + sprintf(te, "%s", (flink && *flink ? flink : "X")); + te += strlen(te); + } else + if (!rpmIsVerbose()) { + te = stpcpy(te, fn); + } + else { + + /* XXX Adjust directory link count and size for display output. */ + if (S_ISDIR(fmode)) { + fnlink++; + fsize = 0; + } + + if (fuser && fgroup) { +/*@-nullpass@*/ + printFileInfo(te, fn, fsize, fmode, fmtime, frdev, fnlink, + fuser, fgroup, flink); +/*@=nullpass@*/ + te += strlen(te); + } else { + rpmlog(RPMLOG_CRIT, _("package without owner/group tags\n")); + } + } + flushBuffer(&t, &te, 0); + fdigest = _free(fdigest); + } + + rc = 0; + +exit: + flushBuffer(&t, &te, 0); + t = _free(t); + + fi = rpmfiFree(fi); +JBJDEBUG((stderr, "<-- %s(%p,%p,%p) rc %d\n", __FUNCTION__, qva, ts, h, rc)); + return rc; +} + +static int rpmgiShowMatches(QVA_t qva, rpmts ts) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies qva, rpmGlobalMacroContext, h_errno, internalState @*/ +{ + rpmgi gi = qva->qva_gi; + rpmRC rpmrc = RPMRC_NOTFOUND; + int ec = 0; + +JBJDEBUG((stderr, "--> %s(%p,%p)\n", __FUNCTION__, qva, ts)); + + while ((rpmrc = rpmgiNext(gi)) == RPMRC_OK) { + Header h; + int rc; + +#ifdef NOTYET /* XXX exiting here will leave stale locks. */ + (void) rpmdbCheckSignals(); +#endif + + h = rpmgiHeader(gi); + if (h == NULL) /* XXX perhaps stricter break instead? */ + continue; + if ((rc = qva->qva_showPackage(qva, ts, h)) != 0) + ec = rc; + if (qva->qva_source == RPMQV_DBOFFSET) + break; + } + if (ec == 0 && rpmrc == RPMRC_FAIL) + ec++; + +JBJDEBUG((stderr, "<-- %s(%p,%p) rc %d\n", __FUNCTION__, qva, ts, ec)); + return ec; +} + +/** \ingroup rpmcli + * Display query/verify information for each header in iterator. + * + * This routine uses: + * - qva->qva_mi rpm database iterator + * - qva->qva_showPackage query/verify display routine + * + * @param qva parsed query/verify options + * @param ts transaction set + * @return result of last non-zero showPackage() return + */ +static int rpmcliShowMatches(QVA_t qva, rpmts ts) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies qva, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + Header h; + int ec = 1; + +JBJDEBUG((stderr, "--> %s(%p,%p)\n", __FUNCTION__, qva, ts)); + qva->qva_showFAIL = qva->qva_showOK = 0; + while ((h = rpmmiNext(qva->qva_mi)) != NULL) { + ec = qva->qva_showPackage(qva, ts, h); + if (ec) + qva->qva_showFAIL++; + else + qva->qva_showOK++; + if (qva->qva_source == RPMQV_DBOFFSET) + break; + } + qva->qva_mi = rpmmiFree(qva->qva_mi); +JBJDEBUG((stderr, "<-- %s(%p,%p) rc %d\n", __FUNCTION__, qva, ts, ec)); + return ec; +} + +/** + * Convert hex to binary nibble. + * @param c hex character + * @return binary nibble + */ +static inline unsigned char nibble(char c) + /*@*/ +{ + if (c >= '0' && c <= '9') + return (c - '0'); + if (c >= 'A' && c <= 'F') + return (c - 'A') + 10; + if (c >= 'a' && c <= 'f') + return (c - 'a') + 10; + return 0; +} + +int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg) +{ + int res = 0; + const char * s; + int i; + int provides_checked = 0; + +JBJDEBUG((stderr, "--> %s(%p,%p,%p)\n", __FUNCTION__, qva, ts, arg)); + + (void) rpmdbCheckSignals(); + + if (qva->qva_showPackage == NULL) + return 1; + + switch (qva->qva_source) { +#ifdef NOTYET + default: +#endif + case RPMQV_GROUP: + case RPMQV_TRIGGEREDBY: + case RPMQV_WHATCONFLICTS: + case RPMQV_WHATOBSOLETES: + qva->qva_mi = rpmtsInitIterator(ts, (rpmTag) qva->qva_source, arg, 0); + if (qva->qva_mi == NULL) { + rpmlog(RPMLOG_NOTICE, _("key \"%s\" not found in %s table\n"), + arg, tagName((rpmTag)qva->qva_source)); + res = 1; + } else + res = rpmcliShowMatches(qva, ts); + break; + + case RPMQV_RPM: + res = rpmgiShowMatches(qva, ts); + break; + + case RPMQV_ALL: + res = rpmgiShowMatches(qva, ts); + break; + + case RPMQV_HDLIST: + res = rpmgiShowMatches(qva, ts); + break; + + case RPMQV_FTSWALK: + res = rpmgiShowMatches(qva, ts); + break; + + case RPMQV_SPECSRPM: + case RPMQV_SPECFILE: + res = ((qva->qva_specQuery != NULL) + ? qva->qva_specQuery(ts, qva, arg) : 1); + break; + +#ifdef DYING + case RPMQV_GROUP: + qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_GROUP, arg, 0); + if (qva->qva_mi == NULL) { + rpmlog(RPMLOG_ERR, + _("group %s does not contain any packages\n"), arg); + res = 1; + } else + res = rpmcliShowMatches(qva, ts); + break; + + case RPMQV_TRIGGEREDBY: + qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_TRIGGERNAME, arg, 0); + if (qva->qva_mi == NULL) { + rpmlog(RPMLOG_NOTICE, _("no package triggers %s\n"), arg); + res = 1; + } else + res = rpmcliShowMatches(qva, ts); + break; +#endif + + case RPMQV_SOURCEPKGID: + case RPMQV_PKGID: + { unsigned char MD5[16]; + unsigned char * t; + rpmuint32_t tag; + + for (i = 0, s = arg; *s && isxdigit(*s); s++, i++) + {}; + if (i != 32) { + rpmlog(RPMLOG_NOTICE, _("malformed %s: %s\n"), "pkgid", arg); + return 1; + } + + MD5[0] = '\0'; + for (i = 0, t = MD5, s = arg; i < 16; i++, t++, s += 2) + *t = (nibble(s[0]) << 4) | nibble(s[1]); + + tag = (qva->qva_source == RPMQV_PKGID + ? RPMTAG_SOURCEPKGID : RPMTAG_PKGID); + qva->qva_mi = rpmtsInitIterator(ts, (rpmTag) tag, MD5, sizeof(MD5)); + if (qva->qva_mi == NULL) { + rpmlog(RPMLOG_NOTICE, _("no package matches %s: %s\n"), + "pkgid", arg); + res = 1; + } else + res = rpmcliShowMatches(qva, ts); + } break; + + case RPMQV_HDRID: + for (i = 0, s = arg; *s && isxdigit(*s); s++, i++) + {}; + if (i != 40) { + rpmlog(RPMLOG_NOTICE, _("malformed %s: %s\n"), "hdrid", arg); + return 1; + } + + qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_SHA1HEADER, arg, 0); + if (qva->qva_mi == NULL) { + rpmlog(RPMLOG_NOTICE, _("no package matches %s: %s\n"), + "hdrid", arg); + res = 1; + } else + res = rpmcliShowMatches(qva, ts); + break; + + case RPMQV_FILEID: + { unsigned char * t; + unsigned char * digest; + size_t dlen; + + /* Insure even no. of digits and at least 8 digits. */ + for (dlen = 0, s = arg; *s && isxdigit(*s); s++, dlen++) + {}; + if ((dlen & 1) || dlen < 8) { + rpmlog(RPMLOG_ERR, _("malformed %s: %s\n"), "fileid", arg); + return 1; + } + + dlen /= 2; + digest = (unsigned char *) memset(alloca(dlen), 0, dlen); + for (t = digest, s = arg; *s; t++, s += 2) + *t = (nibble(s[0]) << 4) | nibble(s[1]); + + qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_FILEDIGESTS, digest, dlen); + if (qva->qva_mi == NULL) { + rpmlog(RPMLOG_NOTICE, _("no package matches %s: %s\n"), + "fileid", arg); + res = 1; + } else + res = rpmcliShowMatches(qva, ts); + } break; + + case RPMQV_TID: + { int mybase = 10; + const char * myarg = arg; + char * end = NULL; + unsigned iid; + + /* XXX should be in strtoul */ + if (*myarg == '0') { + myarg++; + mybase = 8; + if (*myarg == 'x') { + myarg++; + mybase = 16; + } + } + iid = (unsigned) strtoul(myarg, &end, mybase); + if ((*end) || (end == arg) || (iid == UINT_MAX)) { + rpmlog(RPMLOG_ERR, _("malformed %s: %s\n"), "tid", arg); + return 1; + } + qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_INSTALLTID, &iid, sizeof(iid)); + if (qva->qva_mi == NULL) { + rpmlog(RPMLOG_NOTICE, _("no package matches %s: %s\n"), + "tid", arg); + res = 1; + } else + res = rpmcliShowMatches(qva, ts); + } break; + + case RPMQV_WHATNEEDS: + case RPMQV_WHATREQUIRES: + qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_REQUIRENAME, arg, 0); + if (qva->qva_mi == NULL) { + rpmlog(RPMLOG_NOTICE, _("no package requires %s\n"), arg); + res = 1; + } else + res = rpmcliShowMatches(qva, ts); + break; + + case RPMQV_WHATPROVIDES: + if (arg[0] != '/') { + provides_checked = 1; + qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, arg, 0); + if (qva->qva_mi == NULL) { + rpmlog(RPMLOG_NOTICE, _("no package provides %s\n"), arg); + res = 1; + } else + res = rpmcliShowMatches(qva, ts); + break; + } + /*@fallthrough@*/ + case RPMQV_PATH: + { int gotpattern = 0; + char * fn; + + if (arg[0] == '^' || arg[strlen(arg)-1] == '$') { + fn = xstrdup(arg); + gotpattern++; + } else +#ifdef NOTYET + if (arg[0] == '/' && Glob_pattern_p(arg, 1)) { + fn = xstrdup(arg); + gotpattern++; + } else +#endif + { + for (s = arg; *s != '\0'; s++) { + if (!(*s == '.' || *s == '/')) + /*@loopbreak@*/ break; + } + + if (*s == '\0') { + char fnbuf[PATH_MAX]; + fn = Realpath(arg, fnbuf); + fn = xstrdup( (fn != NULL ? fn : arg) ); + } else if (*arg != '/') { + const char *curDir = currentDirectory(); + fn = (char *) rpmGetPath(curDir, "/", arg, NULL); + curDir = _free(curDir); + } else + fn = xstrdup(arg); + (void) rpmCleanPath(fn); + } + + qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_FILEPATHS, fn, 0); + if (qva->qva_mi == NULL && !provides_checked && !gotpattern) { + qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, fn, 0); +#if defined(RPM_VENDOR_MANDRIVA) + if(rpmmiCount(qva->qva_mi) == 0) + qva->qva_mi = rpmmiFree(qva->qva_mi); +#endif + } + + if (qva->qva_mi == NULL) { + struct stat sb; + if (!gotpattern && Lstat(fn, &sb) != 0) + rpmlog(RPMLOG_NOTICE, _("file %s: %s\n"), fn, strerror(errno)); + else + rpmlog(RPMLOG_NOTICE, + _("file %s is not owned by any package\n"), fn); + res = 1; + } else + res = rpmcliShowMatches(qva, ts); + + fn = _free(fn); + } break; + + case RPMQV_DBOFFSET: + { int mybase = 10; + const char * myarg = arg; + char * end = NULL; + uint32_t hdrNum; + + /* XXX should be in strtoul */ + if (*myarg == '0') { + myarg++; + mybase = 8; + if (*myarg == 'x') { + myarg++; + mybase = 16; + } + } + hdrNum = (uint32_t) strtoul(myarg, &end, mybase); + if ((*end) || (end == arg) || (hdrNum == UINT_MAX)) { + rpmlog(RPMLOG_NOTICE, _("invalid package number: %s\n"), arg); + return 1; + } + rpmlog(RPMLOG_DEBUG, D_("package record number: %u\n"), (unsigned)hdrNum); + qva->qva_mi = rpmtsInitIterator(ts, RPMDBI_PACKAGES, &hdrNum, sizeof(hdrNum)); + if (qva->qva_mi == NULL) { + rpmlog(RPMLOG_NOTICE, + _("record %u could not be read\n"), (unsigned)hdrNum); + res = 1; + } else + res = rpmcliShowMatches(qva, ts); + } break; + + case RPMQV_PACKAGE: + qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_NVRA, arg, 0); + if (qva->qva_mi == NULL) { + rpmlog(RPMLOG_NOTICE, _("package %s is not installed\n"), arg); + res = 1; + } else { + res = rpmcliShowMatches(qva, ts); + /* detect foo.bogusarch empty iterations. */ + if (qva->qva_showOK == 0 && qva->qva_showFAIL == 0) { + rpmlog(RPMLOG_NOTICE, _("package %s is not installed\n"), arg); + res = 1; + } + } + break; + } + +JBJDEBUG((stderr, "<-- %s(%p,%p,%p) rc %d\n", __FUNCTION__, qva, ts, arg, res)); + return res; +} + +int rpmcliArgIter(rpmts ts, QVA_t qva, ARGV_t argv) + /*@globals rpmioFtsOpts @*/ + /*@modifies rpmioFtsOpts @*/ +{ + rpmRC rpmrc = RPMRC_NOTFOUND; + int ec = 0; + +JBJDEBUG((stderr, "--> %s(%p,%p,%p)\n", __FUNCTION__, ts, qva, argv)); + switch (qva->qva_source) { + case RPMQV_ALL: + qva->qva_gi = rpmgiNew(ts, RPMDBI_PACKAGES, NULL, 0); + qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, rpmioFtsOpts, RPMGI_NONE); + + if (rpmgiGetFlags(qva->qva_gi) & RPMGI_TSADD) /* Load the ts with headers. */ + while ((rpmrc = rpmgiNext(qva->qva_gi)) == RPMRC_OK) + {}; + if (rpmrc != RPMRC_NOTFOUND) + return 1; /* XXX should be no. of failures. */ + + /*@-nullpass@*/ /* FIX: argv can be NULL, cast to pass argv array */ + ec = rpmQueryVerify(qva, ts, (const char *) argv); + /*@=nullpass@*/ + rpmtsEmpty(ts); + break; + case RPMQV_RPM: + qva->qva_gi = rpmgiNew(ts, RPMDBI_ARGLIST, NULL, 0); + qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, rpmioFtsOpts, giFlags); + + if (rpmgiGetFlags(qva->qva_gi) & RPMGI_TSADD) /* Load the ts with headers. */ + while ((rpmrc = rpmgiNext(qva->qva_gi)) == RPMRC_OK) + {}; + if (rpmrc != RPMRC_NOTFOUND) + return 1; /* XXX should be no. of failures. */ + + /*@-nullpass@*/ /* FIX: argv can be NULL, cast to pass argv array */ + ec = rpmQueryVerify(qva, ts, NULL); + /*@=nullpass@*/ + rpmtsEmpty(ts); + break; + case RPMQV_HDLIST: + qva->qva_gi = rpmgiNew(ts, RPMDBI_HDLIST, NULL, 0); + qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, rpmioFtsOpts, giFlags); + + if (rpmgiGetFlags(qva->qva_gi) & RPMGI_TSADD) /* Load the ts with headers. */ + while ((rpmrc = rpmgiNext(qva->qva_gi)) == RPMRC_OK) + {}; + if (rpmrc != RPMRC_NOTFOUND) + return 1; /* XXX should be no. of failures. */ + + /*@-nullpass@*/ /* FIX: argv can be NULL, cast to pass argv array */ + ec = rpmQueryVerify(qva, ts, NULL); + /*@=nullpass@*/ + rpmtsEmpty(ts); + break; + case RPMQV_FTSWALK: + if (rpmioFtsOpts == 0) + rpmioFtsOpts = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); + qva->qva_gi = rpmgiNew(ts, RPMDBI_FTSWALK, NULL, 0); + qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, rpmioFtsOpts, giFlags); + + if (rpmgiGetFlags(qva->qva_gi) & RPMGI_TSADD) /* Load the ts with headers. */ + while ((rpmrc = rpmgiNext(qva->qva_gi)) == RPMRC_OK) + {}; + if (rpmrc != RPMRC_NOTFOUND) + return 1; /* XXX should be no. of failures. */ + + /*@-nullpass@*/ /* FIX: argv can be NULL, cast to pass argv array */ + ec = rpmQueryVerify(qva, ts, NULL); + /*@=nullpass@*/ + rpmtsEmpty(ts); + break; + default: + if (giFlags & RPMGI_TSADD) { + qva->qva_gi = rpmgiNew(ts, RPMTAG_NVRA, NULL, 0); + qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, rpmioFtsOpts, + (rpmgiFlags) (giFlags | (RPMGI_NOGLOB ))); + if (rpmgiGetFlags(qva->qva_gi) & RPMGI_TSADD) /* Load the ts with headers. */ + while ((rpmrc = rpmgiNext(qva->qva_gi)) == RPMRC_OK) + {}; + if (rpmrc != RPMRC_NOTFOUND) + return 1; /* XXX should be no. of failures. */ + qva->qva_source = RPMQV_ALL; + /*@-nullpass@*/ /* FIX: argv can be NULL, cast to pass argv array */ + ec = rpmQueryVerify(qva, ts, NULL); + /*@=nullpass@*/ + rpmtsEmpty(ts); + } else { + qva->qva_gi = rpmgiNew(ts, RPMDBI_ARGLIST, NULL, 0); + qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, rpmioFtsOpts, + (rpmgiFlags) (giFlags | (RPMGI_NOGLOB|RPMGI_NOHEADER))); + while ((rpmrc = rpmgiNext(qva->qva_gi)) == RPMRC_OK) { + const char * path; + path = rpmgiHdrPath(qva->qva_gi); +assert(path != NULL); + ec += rpmQueryVerify(qva, ts, path); + rpmtsEmpty(ts); + } + } + break; + } + + qva->qva_gi = rpmgiFree(qva->qva_gi); + +JBJDEBUG((stderr, "<-- %s(%p,%p,%p) rc %d\n", __FUNCTION__, ts, qva, argv, ec)); + return ec; +} + +int rpmcliQuery(rpmts ts, QVA_t qva, const char ** argv) +{ + rpmdepFlags depFlags = qva->depFlags, odepFlags; + rpmtransFlags transFlags = qva->transFlags, otransFlags; + rpmVSFlags vsflags, ovsflags; + int ec = 0; + +JBJDEBUG((stderr, "--> %s(%p,%p,%p)\n", __FUNCTION__, ts, qva, argv)); + if (qva->qva_showPackage == NULL) + qva->qva_showPackage = showQueryPackage; + + /* If --queryformat unspecified, then set default now. */ + if (qva->qva_queryFormat == NULL + && !QVA_ISSET(qva->qva_flags, FOR_LIST) + && !QVA_ISSET(qva->qva_flags, FOR_STATE) + && !QVA_ISSET(qva->qva_flags, FOR_DOCS) + && !QVA_ISSET(qva->qva_flags, FOR_CONFIG) + && !QVA_ISSET(qva->qva_flags, FOR_DUMPFILES) + ) { + qva->qva_queryFormat = rpmExpand("%{?_query_all_fmt}\n", NULL); + if (!(qva->qva_queryFormat != NULL && *qva->qva_queryFormat != '\0')) { + qva->qva_queryFormat = _free(qva->qva_queryFormat); + qva->qva_queryFormat = xstrdup("%{name}-%{version}-%{release}.%{arch}\n"); + } + } + + vsflags = (rpmVSFlags) rpmExpandNumeric("%{?_vsflags_query}"); + vsflags = (rpmVSFlags) 0; /* XXX FIXME: ignore default disablers. */ +#if defined(SUPPORT_NOSIGNATURES) + if (!QVA_ISSET(qva->qva_flags, DIGEST)) { + VSF_SET(vsflags, NOSHA1HEADER); + VSF_SET(vsflags, NOMD5HEADER); + VSF_SET(vsflags, NOSHA1); + VSF_SET(vsflags, NOMD5); + } + if (!QVA_ISSET(qva->qva_flags, SIGNATURE)) { + VSF_SET(vsflags, NODSAHEADER); + VSF_SET(vsflags, NORSAHEADER); + VSF_SET(vsflags, NODSA); + VSF_SET(vsflags, NORSA); + } + if (!QVA_ISSET(qva->qva_flags, HDRCHK)) { + VSF_SET(vsflags, NOHDRCHK); + } + VSF_CLR(vsflags, NEEDPAYLOAD); /* XXX needed? */ +#endif + + odepFlags = rpmtsSetDFlags(ts, depFlags); + otransFlags = rpmtsSetFlags(ts, transFlags); + ovsflags = rpmtsSetVSFlags(ts, vsflags); + ec = rpmcliArgIter(ts, qva, argv); + vsflags = rpmtsSetVSFlags(ts, ovsflags); + transFlags = rpmtsSetFlags(ts, otransFlags); + depFlags = rpmtsSetDFlags(ts, odepFlags); + + if (qva->qva_showPackage == showQueryPackage) + qva->qva_showPackage = NULL; + +JBJDEBUG((stderr, "<-- %s(%p,%p,%p) rc %d\n", __FUNCTION__, ts, qva, argv, ec)); + return ec; +} diff --git a/rpm-5.4.9/lib/rpm46compat.h b/rpm-5.4.9/lib/rpm46compat.h new file mode 100644 index 0000000..6c9631e --- /dev/null +++ b/rpm-5.4.9/lib/rpm46compat.h @@ -0,0 +1,309 @@ +/* + * Copyright © 2009 Per Øyvind Karlsen + * + * $Id: rpm46compat.h,v 2.2 2010/10/03 06:12:32 pkarlsen Exp $ + */ + +#ifndef H_RPM46COMPAT +#define H_RPM46COMPAT 1 + +#include +#include + +typedef rpmuint64_t rpm_loff_t; + +typedef enum rpmtdFlags_e { + RPMTD_NONE = 0, + RPMTD_ALLOCED = (1 << 0), /* was memory allocated? */ + RPMTD_PTR_ALLOCED = (1 << 1), /* were array pointers allocated? */ + RPMTD_IMMUTABLE = (1 << 2), /* header data or modifiable? */ +} rpmtdFlags; + +typedef struct rpmtd_s * rpmtd; + +typedef rpmTagCount rpm_count_t; + +typedef void * rpm_data_t; + +/* + * Notice that the layout of this struct has been modified to + * fit HE_s and is different from the "original" rpmtd_s. + * This way you can safely cast from 'rpmtd' to 'HE_t' while providing + * the same member and typedef names for rpm >= 4.6 compatibility. + */ +struct rpmtd_s { + rpmTag tag; /* rpm tag of this data entry*/ + rpmTagType type; /* data type */ + rpm_data_t data; /* pointer to actual data */ + rpm_count_t count; /* number of entries */ + int ix; /* iteration index */ + unsigned int freeData : 1; + unsigned int avail : 1; + unsigned int append : 1; + rpmtdFlags flags; /* flags on memory allocation etc */ +}; + +typedef enum headerGetFlags_e { + HEADERGET_DEFAULT = 0, /* legacy headerGetEntry() behavior */ + HEADERGET_MINMEM = (1 << 0), /* pointers can refer to header memory */ + HEADERGET_EXT = (1 << 1), /* lookup extension types too */ + HEADERGET_RAW = (1 << 2), /* return raw contents (no i18n lookups) */ + HEADERGET_ALLOC = (1 << 3), /* always allocate memory for all data */ + HEADERGET_ARGV = (1 << 4), /* return string arrays NULL-terminated */ +} headerGetFlags; + +typedef enum headerPutFlags_e { + HEADERPUT_DEFAULT = 0, + HEADERPUT_APPEND = (1 << 0), +} headerPutFlags; + +#ifdef __cplusplus +extern "C" { +#endif + +static inline rpmTagCount rpmtdCount(rpmtd td) +{ + assert(td != NULL); + /* fix up for binary type abusing count as data length */ + return (td->type == RPM_BIN_TYPE) ? 1 : td->count; +} + +static inline rpmtd rpmtdReset(rpmtd td) +{ + memset(td, 0, sizeof(*td)); + td->ix = -1; + return td; +} + +static inline void rpmtdFreeData(rpmtd td) +{ + HE_t he = (HE_t)td; + + if (he && he->freeData) + he->p.ptr = _free(he->p.ptr); + td = rpmtdReset(td); +} + +static inline rpmuint8_t * rpmtdGetUint8(rpmtd td) +{ + HE_t he = (HE_t)td; + rpmuint8_t *res = NULL; + + assert(he != NULL); + if (he->t == RPM_UINT8_TYPE) + res = &(he->p.ui8p[td->ix >= 0 ? td->ix : 0]); + + return res; +} + +static inline rpmuint16_t * rpmtdGetUint16(rpmtd td) +{ + HE_t he = (HE_t)td; + rpmuint16_t *res = NULL; + + assert(he != NULL); + if (he->t == RPM_UINT16_TYPE) + res = &(he->p.ui16p[td->ix >= 0 ? td->ix : 0]); + + return res; +} + +static inline rpmuint32_t * rpmtdGetUint32(rpmtd td) +{ + uint32_t *res = NULL; + + assert(td != NULL); + + if (td->type == RPM_INT32_TYPE) { + int ix = (td->ix >= 0 ? td->ix : 0); + res = (uint32_t *) td->data + ix; + } + return res; + +} + +static inline rpmuint64_t * rpmtdGetUint64(rpmtd td) +{ + HE_t he = (HE_t)td; + rpmuint64_t *res = NULL; + + assert(he != NULL); + if (he->t == RPM_UINT64_TYPE) + res = &(he->p.ui64p[td->ix >= 0 ? td->ix : 0]); + + return res; +} + +static inline const char * rpmtdGetString(rpmtd td) +{ + HE_t he = (HE_t)td; + const char *str = NULL; + + assert(he != NULL); + if (he->t == RPM_STRING_TYPE) + str = (const char *) he->p.str; + else if(he->t == RPM_STRING_ARRAY_TYPE || + he->t == RPM_I18NSTRING_TYPE) + str = he->p.argv[td->ix >= 0 ? td->ix : 0]; + return str; +} + +static inline int rpmtdNext(rpmtd td) +{ + int i = -1; + + assert(td != NULL); + + if (++td->ix >= 0) { + if (td->ix < (int)rpmtdCount(td)) { + i = td->ix; + } else { + td->ix = i; + } + } + return i; +} + +static inline rpmuint32_t *rpmtdNextUint32(rpmtd td) +{ + rpmuint32_t *res = NULL; + assert(td != NULL); + if (rpmtdNext(td) >= 0) { + res = rpmtdGetUint32(td); + } + return res; +} + +static inline rpmuint64_t *rpmtdNextUint64(rpmtd td) +{ + rpmuint64_t *res = NULL; + assert(td != NULL); + if (rpmtdNext(td) >= 0) { + res = rpmtdGetUint64(td); + } + return res; +} + +static inline const char *rpmtdNextString(rpmtd td) +{ + const char *res = NULL; + assert(td != NULL); + if (rpmtdNext(td) >= 0) { + res = rpmtdGetString(td); + } + return res; +} + +static inline rpmTagType rpmtdType(rpmtd td) +{ + assert(td != NULL); + return td->type; +} + +static inline char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg) { + return headerSprintf(h, fmt, NULL, NULL, errmsg); +} + +static inline int headerGet_RPMorg(Header h, rpmTag tag, rpmtd td, headerGetFlags flags) +{ + int rc; + unsigned int rflags = 0; + HE_t he = (HE_t)rpmtdReset(td); + + /* XXX: Ehhr..? */ + he->tag = (rpmTag)tag; + if(flags & HEADERGET_EXT) + rflags &= ~HEADERGET_NOEXTENSION; + else + rflags |= HEADERGET_NOEXTENSION; + if(flags & HEADERGET_RAW) + rflags |= HEADERGET_NOI18NSTRING; + else + rflags &= ~HEADERGET_NOI18NSTRING; + + rc = headerGet(h, (HE_t)he, rflags); + + return rc; +} + +static inline int headerPut_RPMorg(Header h, rpmtd td, headerPutFlags flags) +{ + HE_t he = (HE_t)td; + if (flags & HEADERPUT_APPEND) + he->append = 1; + return headerPut(h, he, 0); +} + +static inline int headerPutString(Header h, rpmTag tag, const char *val) +{ + HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he)); + + he->tag = tag; + he->p.str = val; + he->c = 1; + return headerPut(h, he, 0); +} + +static inline int headerMod_RPMorg(Header h, rpmtd td) +{ + HE_t he = (HE_t)td; + return headerMod(h, he, 0); +} + +static inline int headerNext_RPMorg(HeaderIterator hi, rpmtd td) +{ + HE_t he = (HE_t)rpmtdReset(td); + return headerNext(hi, he, 0); +} + +static inline rpmProblem rpmpsGetProblem_RPMorg(rpmpsi psi) +{ + return rpmpsGetProblem(psi->ps, psi->ix); +} + +typedef Spec rpmSpec; + +static inline void initSourceHeader_RPMorg(rpmSpec spec) +{ + initSourceHeader(spec, NULL); +} + +static inline int parseSpec_RPMorg(rpmts ts, const char * specFile, + const char * rootDir, + __attribute__((unused)) const char * buildRoot, + int recursing, + const char * passPhrase, + const char * cookie, + int anyarch, int force) +{ + return parseSpec(ts, specFile, rootDir, recursing, passPhrase, cookie, + anyarch, force, 0); +} + +#ifdef __cplusplus +} +#endif + +/* + * This hack will make the conflictiong functions work with the same number + * of arguments and behavior as in the rpm >= 4.6 API, providing API + * compatibility by redefining the functions to use the *_RPMorg wrapper + * versions. + * I have no idea if this might break with other compilers, and it will also + * for sure break the "real" versions of these functions provided with this + * rpm version, ie. you cannot mix functions from the different APIs. + * To prevent this you can define RPM46COMPAT_NO_CONFLICT_HACK. + */ +#ifndef RPM46COMPAT_NO_CONFLICT_HACK +#define headerDel(h, tag) headerRemoveEntry(h, tag) +#define headerGet(h, tag, he, flags) headerGet_RPMorg(h, tag, he, flags) +#define headerMod(h, td) headerMod_RPMorg(h, td) +#define headerNext(hi, td) headerNext_RPMorg(hi, td) +#define headerPut(h, td, flags) headerPut_RPMorg(h, td, flags) +#define initSourceHeader(spec) initSourceHeader_RPMorg(spec) +#define parseSpec(ts, specFile, rootDir, buildRoot, recursing, passPhrase, cookie, anyarch, force) \ + parseSpec_RPMorg(ts, specFile, rootDir, buildRoot, recursing, passPhrase, cookie, anyarch, force) +#define rpmpsGetProblem(psi) rpmpsGetProblem_RPMorg(psi) +#endif + +#endif /* H_RPM46COMPAT */ diff --git a/rpm-5.4.9/lib/rpm4compat.h b/rpm-5.4.9/lib/rpm4compat.h new file mode 100644 index 0000000..8eb3d1f --- /dev/null +++ b/rpm-5.4.9/lib/rpm4compat.h @@ -0,0 +1,419 @@ +/* + * Copyright © 2008 Per Øyvind Karlsen + * + * $Id: rpm4compat.h,v 2.32.2.4 2011/01/09 10:02:56 pkarlsen Exp $ + */ + +#ifndef H_RPM4COMPAT +#define H_RPM4COMPAT 1 + +#define RPM_NULL_TYPE 0 +#define RPM_CHAR_TYPE 1 +#define RPM_INT8_TYPE RPM_UINT8_TYPE +#define RPM_INT16_TYPE RPM_UINT16_TYPE +#define RPM_INT32_TYPE RPM_UINT32_TYPE +#define RPM_INT64_TYPE RPM_UINT64_TYPE + +#define RPMMESS_DEBUG RPMLOG_DEBUG +#define RPMMESS_VERBOSE RPMLOG_INFO +#define RPMMESS_NORMAL RPMLOG_NOTICE +#define RPMMESS_WARNING RPMLOG_WARNING +#define RPMMESS_ERROR RPMLOG_ERR +#define RPMMESS_FATALERROR RPMLOG_CRIT +#define RPMMESS_QUIET RPMMESS_WARNING + +#define RPMERR_BADSPEC RPMLOG_ERR + +#define RPMTRANS_FLAG_NOMD5 RPMTRANS_FLAG_NOFDIGESTS +#define RPMTRANS_FLAG_NOSUGGEST RPMDEPS_FLAG_NOSUGGEST +#define RPMTRANS_FLAG_ADDINDEPS RPMDEPS_FLAG_ADDINDEPS + +#define RPMBUILD_ISSOURCE RPMFILE_SOURCE +#define RPMBUILD_ISPATCH RPMFILE_PATCH +#define RPMBUILD_ISICON RPMFILE_ICON +#define RPMBUILD_ISNO RPMFILE_MISSINGOK + +#define RPMTAG_FILENAMES RPMTAG_FILEPATHS +#define RPMDBI_LABEL RPMTAG_NVRA + +#define buildRestrictions sourceHeader + +#include +#include +#include +#include + +#define WITH_DB +#define _RPMDB_INTERNAL +#define _RPMTAG_INTERNAL +#define _RPMEVR_INTERNAL +#define _RPMPS_INTERNAL + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +enum hMagic { + HEADER_MAGIC_NO = 0, + HEADER_MAGIC_YES = 1 +}; + +typedef rpmuint32_t * hTAG_t; +typedef rpmuint32_t * hTYP_t; +typedef const void * hPTR_t; +typedef rpmuint32_t * hCNT_t; +typedef rpmuint32_t int_32; +typedef rpmuint32_t uint_32; +typedef rpmuint16_t uint_16; +typedef rpmuint16_t int_16; +typedef rpmuint8_t int_8; +typedef rpmuint8_t byte; + +typedef union hRET_s { + const void * ptr; + const char ** argv; + const char * str; + rpmuint32_t * ui32p; + rpmuint16_t * ui16p; + rpmuint32_t * i32p; + rpmuint16_t * i16p; + rpmuint8_t * i8p; +} * hRET_t; + +typedef enum pgpVSFlags_e rpmVSFlags_e; + +enum rpm_machtable_e { + RPM_MACHTABLE_INSTARCH = 0, /*!< Install platform architecture. */ + RPM_MACHTABLE_INSTOS = 1, /*!< Install platform operating system. */ + RPM_MACHTABLE_BUILDARCH = 2, /*!< Build platform architecture. */ + RPM_MACHTABLE_BUILDOS = 3 /*!< Build platform operating system. */ +}; +#define RPM_MACHTABLE_COUNT 4 /*!< No. of arch/os tables. */ + +typedef enum urltype_e { + URL_IS_UNKNOWN = 0, /*!< unknown (aka a file) */ + URL_IS_DASH = 1, /*!< stdin/stdout */ + URL_IS_PATH = 2, /*!< file://... */ + URL_IS_FTP = 3, /*!< ftp://... */ + URL_IS_HTTP = 4, /*!< http://... */ + URL_IS_HTTPS = 5, /*!< https://... */ + URL_IS_HKP = 6 /*!< hkp://... */ +} urltype; + +typedef rpmmi rpmdbMatchIterator; + +urltype urlPath(const char * url, /*@out@*/ const char ** pathp); + +#ifdef __cplusplus +extern "C" { +#endif + +static inline int headerGetEntry(Header h, int_32 tag, hTYP_t type, void ** p, hCNT_t c) { + HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he)); + int rc; + + /* Always ensure to initialize */ + *(void **)p = NULL; + he->tag = (rpmTag)tag; + rc = headerGet(h, he, 0); + if (rc) { + if (type) *type = he->t; + if (p) *(void **) p = he->p.ptr; + if (c) *c = he->c; + } + + return rc; +} + + +static inline int headerGetRawEntry(Header h, int_32 tag, hTYP_t type, void * p, hCNT_t c) { + HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he)); + int rc; + + he->tag = (rpmTag)tag; + he->t = *(rpmTagType*)type; + he->p.str = (const char*)p; + he->c = *(rpmTagCount*)c; + + rc = headerGet(h, he, tag); + + if (rc) { + if (type) *type = he->t; + if (p) *(void **) p = he->p.ptr; + if (c) *c = he->c; + } + + return rc; +} + +static inline void rpmfiBuildFNames(Header h, rpmTag tagN, const char *** fnp, rpmTagCount * fcp) { + HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he)); + + rpmTag dirNameTag = (rpmTag)0; + rpmTag dirIndexesTag = (rpmTag)0; + rpmTagData baseNames; + rpmTagData dirNames; + rpmTagData dirIndexes; + rpmTagData fileNames; + rpmTagCount count; + size_t size; + char * t; + unsigned i; + int xx; + + if (tagN == RPMTAG_BASENAMES) { + dirNameTag = RPMTAG_DIRNAMES; + dirIndexesTag = RPMTAG_DIRINDEXES; + } else if (tagN == RPMTAG_ORIGBASENAMES) { + dirNameTag = RPMTAG_ORIGDIRNAMES; + dirIndexesTag = RPMTAG_ORIGDIRINDEXES; + } else { + if (fnp) *fnp = NULL; + if (fcp) *fcp = 0; + return; + } + + he->tag = tagN; + xx = headerGet(h, he, 0); + baseNames.argv = he->p.argv; + count = he->c; + + if (!xx) { + if (fnp) *fnp = NULL; + if (fcp) *fcp = 0; + return; /* no file list */ + } + + he->tag = dirNameTag; + xx = headerGet(h, he, 0); + dirNames.argv = he->p.argv; + + he->tag = dirIndexesTag; + xx = headerGet(h, he, 0); + dirIndexes.ui32p = he->p.ui32p; + count = he->c; + + size = sizeof(*fileNames.argv) * count; + for (i = 0; i < (unsigned)count; i++) { + const char * dn = NULL; + (void) urlPath(dirNames.argv[dirIndexes.ui32p[i]], &dn); + size += strlen(baseNames.argv[i]) + strlen(dn) + 1; + } + + fileNames.argv = (const char**)malloc(size); + t = (char *)&fileNames.argv[count]; + for (i = 0; i < (unsigned)count; i++) { + const char * dn = NULL; + (void) urlPath(dirNames.argv[dirIndexes.ui32p[i]], &dn); + fileNames.argv[i] = t; + t = stpcpy( stpcpy(t, dn), baseNames.argv[i]); + *t++ = '\0'; + } + baseNames.ptr = _free(baseNames.ptr); + dirNames.ptr = _free(dirNames.ptr); + dirIndexes.ptr = _free(dirIndexes.ptr); + + if (fnp) + *fnp = fileNames.argv; + else + fileNames.ptr = _free(fileNames.ptr); + if (fcp) *fcp = count; +} + +static inline int headerAddEntry(Header h, int_32 tag, int_32 type, const void * p, int_32 c) { + HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he)); + + he->tag = (rpmTag)tag; + he->t = (rpmTagType)type; + he->p.str = (const char*)p; + he->c = (rpmTagCount)c; + return headerPut(h, he, 0); +} + +static inline int headerAddOrAppendEntry(Header h, int_32 tag, int_32 type, const void * p, int_32 c) { + HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he)); + + he->tag = (rpmTag)tag; + he->t = (rpmTagType)type; + he->p.str = (const char*)p; + he->c = (rpmTagCount)c; + he->append = 1; + return headerPut(h, he, 0); +} + +static inline int headerAppendEntry(Header h, int_32 tag, int_32 type, const void * p, int_32 c) { + + return headerAddOrAppendEntry(h, tag, type, p, c); +} + +static inline int headerRemoveEntry(Header h, int_32 tag) { + HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he)); + + he->tag = (rpmTag)tag; + return headerDel(h, he, 0); +} + +static inline int headerModifyEntry(Header h, int_32 tag, int_32 type, const void * p, int_32 c) { + HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he)); + + he->tag = (rpmTag)tag; + he->t = (rpmTagType)type; + he->p.str = (const char*)p; + he->c = (rpmTagCount)c; + return headerMod(h, he, 0); + +} + +static inline int headerNextIterator(HeaderIterator hi, hTAG_t tag, hTYP_t type, hPTR_t * p, hCNT_t c) { + HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he)); + int rc = headerNext(hi, he, 0); + + if (rc) { + if (tag) *tag = he->tag; + if (type) *type = he->t; + if (p) *(void **) p = he->p.ptr; + if (c) *c = he->c; + } + + return rc; +} + +static inline HeaderIterator headerFreeIterator(HeaderIterator hi) { + return headerFini(hi); +} + +static inline HeaderIterator headerInitIterator(Header h){ + return headerInit(h); +} + +static inline void * headerFreeData(const void * data, __attribute__((unused)) rpmTagType type) { + if (data) + free((void *)data); + return NULL; +} + +static inline int headerWrite(void * _fd, Header h, __attribute__((unused)) enum hMagic magicp) { + const char item[] = "Header"; + const char * msg = NULL; + rpmRC rc = rpmpkgWrite(item, (FD_t)_fd, h, &msg); + if (rc != RPMRC_OK) { + rpmlog(RPMLOG_ERR, "%s: %s: %s\n", "headerWrite", item, msg); + rc = RPMRC_FAIL; + } + msg = (const char*)_free(msg); + return rc; +} + +static inline Header headerRead(void * _fd, __attribute__((unused)) enum hMagic magicp) { + const char item[] = "Header"; + Header h = NULL; + const char * msg = NULL; + rpmRC rc = rpmpkgRead(item, (FD_t)_fd, &h, &msg); + switch (rc) { + default: + rpmlog(RPMLOG_ERR, "%s: %s: %s\n", "headerRead", item, msg); + case RPMRC_NOTFOUND: + h = NULL; + case RPMRC_OK: + break; + } + msg = (const char*)_free(msg); + return h; +} + +static inline int rpmMachineScore(__attribute__((unused)) int type, const char * name) { + char * platform = rpmExpand(name, "-%{_target_vendor}-%{_target_os}%{?_gnu}", NULL); + int score = rpmPlatformScore(platform, NULL, 0); + + _free(platform); + return score; +} + +static inline rpmRC rpmtsImportPubkey(const rpmts ts, const unsigned char * pkt, ssize_t pktlen) { + return rpmcliImportPubkey(ts, pkt, pktlen); +} + +static inline rpmuint64_t rpmProblemGetLong(rpmProblem prob){ + return rpmProblemGetDiskNeed(prob); +} + +static inline off_t fdSize(FD_t fd){ + struct stat sb; + Fstat(fd, &sb); + return sb.st_size; +} + + +static inline unsigned int rpmdbGetIteratorOffset(rpmdbMatchIterator mi) { + return rpmmiInstance(mi); +} + +static inline int rpmdbGetIteratorCount(rpmdbMatchIterator mi) { + return rpmmiCount(mi); +} + +static inline int rpmdbAppendIterator(rpmdbMatchIterator mi, + const uint32_t * hdrNums, int nHdrNums) { + return rpmmiGrow(mi, hdrNums, nHdrNums); +} + +static inline int rpmdbPruneIterator(rpmdbMatchIterator mi, + uint32_t * hdrNums, int nHdrNums, int sorted) { + return rpmmiPrune(mi, hdrNums, nHdrNums, sorted); +} + +static inline int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpmTag tag, + rpmMireMode mode, const char * pattern) { + return rpmmiAddPattern(mi, tag, mode, pattern); +} + +static inline int rpmdbSetIteratorRewrite(rpmdbMatchIterator mi, int rewrite) { + return rpmmiSetRewrite(mi, rewrite); +} + +static inline int rpmdbSetIteratorModified(rpmdbMatchIterator mi, int modified) { + return rpmmiSetModified(mi, modified); +} + +static inline int rpmdbSetHdrChk(rpmdbMatchIterator mi, rpmts ts, + rpmRC (*hdrchk) (rpmts ts, const void * uh, size_t uc, char ** msg)) { + return 0; +} + +static inline rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmTag tag, + const void * keyp, size_t keylen) { + return rpmmiInit(db, tag, keyp, keylen); +} + +static inline Header rpmdbNextIterator(rpmdbMatchIterator mi) { + return rpmmiNext(mi); +} + +static inline rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi) { + return rpmmiFree(mi); +} + +#ifdef __cplusplus +} + +static inline rpmds rpmdsSingle(rpmTag tagN, const char * N, const char * EVR, int_32 Flags){ + return rpmdsSingle(tagN, N, EVR, static_cast(Flags)); +} +#endif + +#endif /* rpm4compat.h */ + diff --git a/rpm-5.4.9/lib/rpmal.c b/rpm-5.4.9/lib/rpmal.c new file mode 100644 index 0000000..844d6f2 --- /dev/null +++ b/rpm-5.4.9/lib/rpmal.c @@ -0,0 +1,490 @@ +/** \ingroup rpmdep + * \file lib/rpmal.c + */ + +#include "system.h" + +#include +#include /* XXX fnpyKey */ +#include + +#include +#include + +#define _RPMDS_INTERNAL +#include +#include + +#include "debug.h" + +typedef /*@abstract@*/ struct availablePackage_s * availablePackage; + +/*@access alKey @*/ +/*@access alNum @*/ +/*@access rpmal @*/ +/*@access rpmds @*/ +/*@access availablePackage @*/ + +/*@access fnpyKey @*/ /* XXX suggestedKeys array */ + +/*@unchecked@*/ +int _rpmal_debug = 0; + +/** \ingroup rpmdep + * Info about a single package to be installed. + */ +struct availablePackage_s { +/*@refcounted@*/ /*@null@*/ + rpmds provides; /*!< Provides: dependencies. */ +/*@refcounted@*/ /*@null@*/ + rpmbf bf; /*!< File name Bloom filter. */ + + rpmuint32_t tscolor; /*!< Transaction color bits. */ + +/*@exposed@*/ /*@dependent@*/ /*@null@*/ + fnpyKey key; /*!< Associated file name/python object */ + +}; + +typedef /*@abstract@*/ struct availableIndexEntry_s * availableIndexEntry; +/*@access availableIndexEntry@*/ + +typedef enum { + IET_PROVIDES=1 /*!< A Provides: dependency. */ +} indexEntryType_e; + +/** \ingroup rpmdep + * A single available item (e.g. a Provides: dependency). + */ +struct availableIndexEntry_s { +/*@exposed@*/ /*@dependent@*/ /*@null@*/ + alKey pkgKey; /*!< Containing package. */ +/*@observer@*/ + const char * entry; /*!< Dependency name. */ + unsigned short entryLen; /*!< No. of bytes in name. */ + unsigned short entryIx; /*!< Dependency index. */ + indexEntryType_e type; /*!< Type of available item. */ +}; + +typedef /*@abstract@*/ struct availableIndex_s * availableIndex; +/*@access availableIndex@*/ + +/** \ingroup rpmdep + * Index of all available items. + */ +struct availableIndex_s { +/*@null@*/ + availableIndexEntry index; /*!< Array of available items. */ + int size; /*!< No. of available items. */ + int k; /*!< Current index. */ +}; + +/** \ingroup rpmdep + * Set of available packages, items, and directories. + */ +struct rpmal_s { + struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ +/*@owned@*/ /*@null@*/ + availablePackage list; /*!< Set of packages. */ + struct availableIndex_s index; /*!< Set of available items. */ + int delta; /*!< Delta for pkg list reallocation. */ + int size; /*!< No. of pkgs in list. */ + int alloced; /*!< No. of pkgs allocated for list. */ + rpmuint32_t tscolor; /*!< Transaction color. */ +}; + +#ifdef __cplusplus +GENfree(availablePackage) +GENfree(availableIndexEntry) +GENfree(fnpyKey *) +#endif /* __cplusplus */ + +static inline alNum alKey2Num(/*@unused@*/ /*@null@*/ const rpmal al, + /*@null@*/ alKey pkgKey) + /*@*/ +{ + /*@-nullret -temptrans -retalias @*/ + union { alKey key; alNum num; } u; + u.num = 0; + u.key = pkgKey; + return u.num; + /*@=nullret =temptrans =retalias @*/ +} + +static inline alKey alNum2Key(/*@unused@*/ /*@null@*/ const rpmal al, + /*@null@*/ alNum pkgNum) + /*@*/ +{ + /*@-nullret -temptrans -retalias @*/ + union { alKey key; alNum num; } u; + u.key = 0; + u.num = pkgNum; + return u.key; + /*@=nullret =temptrans =retalias @*/ +} + +/** + * Destroy available item index. + * @param al available list + */ +static void rpmalFreeIndex(rpmal al) + /*@modifies al @*/ +{ + availableIndex ai = &al->index; + if (ai->size > 0) { + ai->index = _free(ai->index); + ai->size = 0; + } +} + +static void rpmalFini(void * _al) +{ + rpmal al = (rpmal) _al; + availablePackage alp; + int i; + + if ((alp = al->list) != NULL) + for (i = 0; i < al->size; i++, alp++) { + (void)rpmdsFree(alp->provides); + alp->provides = NULL; + (void)rpmbfFree(alp->bf); + alp->bf = NULL; + } + + al->list = _free(al->list); + al->alloced = 0; + rpmalFreeIndex(al); +} + +/*@unchecked@*/ /*@only@*/ /*@null@*/ +rpmioPool _rpmalPool; + +static rpmal rpmalGetPool(/*@null@*/ rpmioPool pool) + /*@globals _rpmdsPool, fileSystem, internalState @*/ + /*@modifies pool, _rpmdsPool, fileSystem, internalState @*/ +{ + rpmal al; + + if (_rpmalPool == NULL) { + _rpmalPool = rpmioNewPool("al", sizeof(*al), -1, _rpmal_debug, + NULL, NULL, rpmalFini); + pool = _rpmalPool; + } + al = (rpmal) rpmioGetPool(pool, sizeof(*al)); + memset(((char *)al)+sizeof(al->_item), 0, sizeof(*al)-sizeof(al->_item)); + return al; +} + +rpmal rpmalNew(int delta) +{ + rpmal al = rpmalGetPool(_rpmalPool); + availableIndex ai = &al->index; + + al->delta = delta; + al->size = 0; + al->list = (availablePackage) xcalloc(al->delta, sizeof(*al->list)); + al->alloced = al->delta; + + ai->index = NULL; + ai->size = 0; + + return rpmalLink(al, __FUNCTION__); +} + +void rpmalDel(rpmal al, alKey pkgKey) +{ + alNum pkgNum = alKey2Num(al, pkgKey); + availablePackage alp; + + if (al == NULL || al->list == NULL) + return; /* XXX can't happen */ + + alp = al->list + pkgNum; + + (void)rpmdsFree(alp->provides); + alp->provides = NULL; + (void)rpmbfFree(alp->bf); + alp->bf = NULL; + + memset(alp, 0, sizeof(*alp)); /* XXX trash and burn */ + return; +} + +alKey rpmalAdd(rpmal * alistp, alKey pkgKey, fnpyKey key, + rpmds provides, rpmfi fi, rpmuint32_t tscolor) +{ + alNum pkgNum; + rpmal al; + availablePackage alp; + + /* If list doesn't exist yet, create. */ + if (*alistp == NULL) + *alistp = rpmalNew(5); + al = *alistp; + pkgNum = alKey2Num(al, pkgKey); + + if (pkgNum >= 0 && pkgNum < al->size) { + rpmalDel(al, pkgKey); + } else { + if (al->size == al->alloced) { + al->alloced += al->delta; + al->list = (availablePackage) xrealloc(al->list, sizeof(*al->list) * al->alloced); + } + pkgNum = al->size++; + } + + if (al->list == NULL) + return RPMAL_NOMATCH; /* XXX can't happen */ + + alp = al->list + pkgNum; + + alp->key = key; + alp->tscolor = tscolor; + +/*@-assignexpose -castexpose @*/ + alp->provides = rpmdsLink(provides, "Provides (rpmalAdd)"); + alp->bf = rpmbfLink(rpmfiFNBF(fi)); +/*@=assignexpose =castexpose @*/ + + rpmalFreeIndex(al); + +assert(((alNum)(alp - al->list)) == pkgNum); + return ((alKey)(alp - al->list)); +} + +/** + * Compare two available index entries by name (qsort/bsearch). + * @param one 1st available index entry + * @param two 2nd available index entry + * @return result of comparison + */ +static int indexcmp(const void * one, const void * two) + /*@*/ +{ + /*@-castexpose@*/ + const availableIndexEntry a = (const availableIndexEntry) one; + const availableIndexEntry b = (const availableIndexEntry) two; + /*@=castexpose@*/ + int lenchk; + + lenchk = a->entryLen - b->entryLen; + if (lenchk) + return lenchk; + + return strcmp(a->entry, b->entry); +} + +void rpmalAddProvides(rpmal al, alKey pkgKey, rpmds provides, rpmuint32_t tscolor) +{ + rpmuint32_t dscolor; + const char * Name; + alNum pkgNum = alKey2Num(al, pkgKey); + availableIndex ai = &al->index; + availableIndexEntry aie; + int ix; + + if (provides == NULL || pkgNum < 0 || pkgNum >= al->size) + return; + if (ai->index == NULL || ai->k < 0 || ai->k >= ai->size) + return; + + if (rpmdsInit(provides) != NULL) + while (rpmdsNext(provides) >= 0) { + + if ((Name = provides->N[provides->i]) == NULL) + continue; /* XXX can't happen */ + + /* Ignore colored provides not in our rainbow. */ + dscolor = rpmdsColor(provides); + if (tscolor && dscolor && !(tscolor & dscolor)) + continue; + + aie = ai->index + ai->k; + ai->k++; + + aie->pkgKey = pkgKey; +/*@-assignexpose@*/ + aie->entry = Name; +/*@=assignexpose@*/ + aie->entryLen = (unsigned short)strlen(Name); + ix = rpmdsIx(provides); + +/* XXX make sure that element index fits in unsigned short */ +assert(ix < 0x10000); + + aie->entryIx = ix; + aie->type = IET_PROVIDES; + } +} + +void rpmalMakeIndex(rpmal al) +{ + availableIndex ai; + availablePackage alp; + int i; + + if (al == NULL || al->list == NULL) return; + ai = &al->index; + + ai->size = 0; + for (i = 0; i < al->size; i++) { + alp = al->list + i; + if (alp->provides != NULL) + ai->size += rpmdsCount(alp->provides); + } + if (ai->size == 0) return; + + ai->index = (availableIndexEntry) xrealloc(ai->index, ai->size * sizeof(*ai->index)); + ai->k = 0; + for (i = 0; i < al->size; i++) { + alp = al->list + i; + rpmalAddProvides(al, alNum2Key(NULL, (alNum)i), alp->provides, alp->tscolor); + } + + /* Reset size to the no. of provides added. */ + ai->size = ai->k; + qsort(ai->index, ai->size, sizeof(*ai->index), indexcmp); +} + +fnpyKey * +rpmalAllFileSatisfiesDepend(const rpmal al, const rpmds ds, alKey * keyp) +{ + fnpyKey * ret = NULL; + int found = 0; + const char * fn; + size_t nfn; + int i; + + if (keyp) *keyp = RPMAL_NOMATCH; + + if (al == NULL || (fn = rpmdsN(ds)) == NULL || *fn != '/') + goto exit; + nfn = strlen(fn); + + if (al->list != NULL) /* XXX always true */ + for (i = 0; i < al->size; i++) { + availablePackage alp = al->list + i; + + if (!rpmbfChk(alp->bf, fn, nfn)) + continue; + + rpmdsNotify(ds, _("(added files)"), 0); + + ret = (fnpyKey *) xrealloc(ret, (found + 2) * sizeof(*ret)); + if (ret) /* can't happen */ + ret[found] = alp->key; + if (keyp) + *keyp = alNum2Key(al, i); + found++; + } + + if (ret) + ret[found] = NULL; + +exit: +/*@-nullstate@*/ /* FIX: *keyp may be NULL */ + return ret; +/*@=nullstate@*/ +} + +fnpyKey * +rpmalAllSatisfiesDepend(const rpmal al, const rpmds ds, alKey * keyp) +{ + availableIndex ai; + availableIndexEntry needle; + availableIndexEntry match; + fnpyKey * ret = NULL; + int found = 0; + const char * KName; + availablePackage alp; + int rc; + + if (keyp) *keyp = RPMAL_NOMATCH; + + if (al == NULL || ds == NULL || (KName = rpmdsN(ds)) == NULL) + goto exit; + + if (*KName == '/') { + /* First, look for files "contained" in package ... */ + ret = rpmalAllFileSatisfiesDepend(al, ds, keyp); + if (ret != NULL && *ret != NULL) + goto exit; + ret = _free(ret); + /* ... then, look for files "provided" by package. */ + } + + ai = &al->index; + if (ai->index == NULL || ai->size <= 0) + goto exit; + + needle = (availableIndexEntry) + memset(alloca(sizeof(*needle)), 0, sizeof(*needle)); + /*@-assignexpose -temptrans@*/ + needle->entry = KName; + /*@=assignexpose =temptrans@*/ + needle->entryLen = (unsigned short)strlen(needle->entry); + + match = (availableIndexEntry) + bsearch(needle, ai->index, ai->size, sizeof(*ai->index), indexcmp); + if (match == NULL) + goto exit; + + /* rewind to the first match */ + while (match > ai->index && indexcmp(match-1, needle) == 0) + match--; + + if (al->list != NULL) /* XXX always true */ + for (ret = NULL, found = 0; + match < ai->index + ai->size && indexcmp(match, needle) == 0; + match++) + { + alp = al->list + alKey2Num(al, match->pkgKey); + + rc = 0; + if (alp->provides != NULL) /* XXX can't happen */ + switch (match->type) { + case IET_PROVIDES: + /* XXX single step on rpmdsNext to regenerate DNEVR string */ + (void) rpmdsSetIx(alp->provides, match->entryIx - 1); + if (rpmdsNext(alp->provides) >= 0) + rc = rpmdsCompare(alp->provides, ds); + + if (rc) + rpmdsNotify(ds, _("(added provide)"), 0); + + /*@switchbreak@*/ break; + } + + if (rc) { + ret = (fnpyKey *) xrealloc(ret, (found + 2) * sizeof(*ret)); + if (ret) /* can't happen */ + ret[found] = alp->key; +/*@-dependenttrans@*/ + if (keyp) + *keyp = match->pkgKey; +/*@=dependenttrans@*/ + found++; + } + } + + if (ret) + ret[found] = NULL; + +exit: +/*@-nullstate@*/ /* FIX: *keyp may be NULL */ + return ret; +/*@=nullstate@*/ +} + +fnpyKey +rpmalSatisfiesDepend(const rpmal al, const rpmds ds, alKey * keyp) +{ + fnpyKey * tmp = rpmalAllSatisfiesDepend(al, ds, keyp); + + if (tmp) { + fnpyKey ret = tmp[0]; + free(tmp); + return ret; + } + return NULL; +} diff --git a/rpm-5.4.9/lib/rpmal.h b/rpm-5.4.9/lib/rpmal.h new file mode 100644 index 0000000..e4114c4 --- /dev/null +++ b/rpm-5.4.9/lib/rpmal.h @@ -0,0 +1,177 @@ +#ifndef H_RPMAL +#define H_RPMAL + +/** \ingroup rpmdep rpmtrans + * \file lib/rpmal.h + * Structures used for managing added/available package lists. + */ + +#include +#include + +/*@-exportlocal@*/ +/*@unchecked@*/ +extern int _rpmal_debug; +/*@=exportlocal@*/ + +#define RPMAL_NOMATCH ((alKey)-1L) + +/** \ingroup rpmts + * An added/available package retrieval index. + */ +/*@-mutrep@*/ +typedef /*@abstract@*/ int alNum; +/*@=mutrep@*/ + +/** + */ +typedef /*@abstract@*/ struct rpmal_s * rpmal; + +#ifdef __cplusplus +extern "C" { +#endif + +/** \ingroup rpmal + * Unreference available list. + * @param al available list + * @param msg + * @return NULL on last dereference + */ +/*@unused@*/ /*@null@*/ +rpmal rpmalUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmal al, + /*@null@*/ const char * msg) + /*@modifies al @*/; +#define rpmalUnlink(_al, _msg) \ + ((rpmal)rpmioUnlinkPoolItem((rpmioItem)(_al), _msg, __FILE__, __LINE__)) + +/** \ingroup rpmal + * Reference available list. + * @param al available list + * @param msg + * @return new available list reference + */ +/*@unused@*/ /*@newref@*/ /*@null@*/ +rpmal rpmalLink (/*@null@*/ rpmal al, /*@null@*/ const char * msg) + /*@modifies al @*/; +#define rpmalLink(_al, _msg) \ + ((rpmal)rpmioLinkPoolItem((rpmioItem)(_al), _msg, __FILE__, __LINE__)) + +/** \ingroup rpmal + * Destroy available list. + * @param al available list + * @return NULL on last dereference + */ +/*@null@*/ +rpmal rpmalFree(/*@killref@*/ /*@null@*/ rpmal al) + /*@modifies al @*/; +#define rpmalFree(_al) \ + ((rpmal)rpmioFreePoolItem((rpmioItem)(_al), __FUNCTION__, __FILE__, __LINE__)) + +/** + * Initialize available list. + * @param delta no. of entries to add on each realloc + * @return al new available list + */ +/*@-exportlocal@*/ +/*@only@*/ +rpmal rpmalNew(int delta) + /*@*/; +/*@=exportlocal@*/ + +/** + * Delete package from available list. + * @param al available list + * @param pkgKey package key + */ +/*@-exportlocal@*/ +void rpmalDel(/*@null@*/ rpmal al, /*@null@*/ alKey pkgKey) + /*@globals fileSystem @*/ + /*@modifies al, fileSystem @*/; +/*@=exportlocal@*/ + +/** + * Add package to available list. + * @param alistp address of available list + * @param pkgKey package key, RPMAL_NOMATCH to force an append + * @param key associated file name/python object + * @param provides provides dependency set + * @param fi file info set + * @param tscolor transaction color bits + * @return available package index + */ +alKey rpmalAdd(rpmal * alistp, + /*@dependent@*/ /*@null@*/ alKey pkgKey, + /*@dependent@*/ /*@null@*/ fnpyKey key, + /*@null@*/ rpmds provides, /*@null@*/ rpmfi fi, + rpmuint32_t tscolor) + /*@globals fileSystem @*/ + /*@modifies *alistp, provides, fi, fileSystem @*/; + +/** + * Add package provides to available list index. + * @param al available list + * @param pkgKey package key + * @param provides added package provides + * @param tscolor transaction color bits + */ +/*@-exportlocal@*/ +void rpmalAddProvides(rpmal al, + /*@dependent@*/ /*@null@*/ alKey pkgKey, + /*@null@*/ rpmds provides, rpmuint32_t tscolor) + /*@modifies al, provides @*/; +/*@=exportlocal@*/ + +/** + * Generate index for available list. + * @param al available list + */ +void rpmalMakeIndex(/*@null@*/ rpmal al) + /*@modifies al @*/; + +/** + * Check added package file lists for package(s) that provide a file. + * @param al available list + * @param ds dependency set + * @retval keyp added package key pointer (or NULL) + * @return associated package key(s), NULL if none + */ +/*@-exportlocal@*/ +/*@only@*/ /*@null@*/ +fnpyKey * rpmalAllFileSatisfiesDepend(/*@null@*/ const rpmal al, + /*@null@*/ const rpmds ds, /*@null@*/ alKey * keyp) + /*@globals fileSystem, internalState @*/ + /*@modifies al, *keyp, fileSystem, internalState @*/; +/*@=exportlocal@*/ + +/** + * Check added package file lists for package(s) that have a provide. + * @param al available list + * @param ds dependency set + * @retval keyp added package key pointer (or NULL) + * @return associated package key(s), NULL if none + */ +/*@only@*/ /*@null@*/ +fnpyKey * rpmalAllSatisfiesDepend(const rpmal al, const rpmds ds, + /*@null@*/ alKey * keyp) + /*@globals fileSystem, internalState @*/ + /*@modifies al, *keyp, fileSystem, internalState @*/; + +/** + * Check added package file lists for first package that has a provide. + * @todo Eliminate. + * @param al available list + * @param ds dependency set + * @retval keyp added package key pointer (or NULL) + * @return associated package key, NULL if none + */ +/*@null@*/ +fnpyKey rpmalSatisfiesDepend(const rpmal al, const rpmds ds, + /*@null@*/ alKey * keyp) + /*@globals fileSystem, internalState @*/ + /*@modifies al, *keyp, fileSystem, internalState @*/; + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMAL */ diff --git a/rpm-5.4.9/lib/rpmchecksig.c b/rpm-5.4.9/lib/rpmchecksig.c new file mode 100644 index 0000000..df404d5 --- /dev/null +++ b/rpm-5.4.9/lib/rpmchecksig.c @@ -0,0 +1,1373 @@ +/** \ingroup rpmcli + * \file lib/rpmchecksig.c + * Verify the signature of a package. + */ + +#include "system.h" + +#include +#include +#include /* XXX beecrypt base64 */ + +#define _RPMHKP_INTERNAL /* XXX internal prototypes. */ +#include + +#include +#include +#define _RPMEVR_INTERNAL /* XXX RPMSENSE_KEYRING */ +#include +#define _RPMDB_INTERNAL /* XXX db_txn */ +#include +#include +#include +#include +#include "signature.h" + +#define _RPMTS_INTERNAL /* XXX ts->hkp */ +#include + +#include "rpmgi.h" + +#include +#include + +#include "debug.h" + +/*@access FD_t @*/ /* XXX stealing digests */ +/*@access Header @*/ /* XXX void * arg */ +/*@access pgpDig @*/ +/*@access pgpDigParams @*/ + +#ifdef __cplusplus +GENfree(struct rpmlead *) +GENfree(rpmuint8_t **) +#endif /* __cplusplus */ + +/*@unchecked@*/ +int _print_pkts = 0; + +/** + */ +static int manageFile(/*@out@*/ FD_t *fdp, + /*@null@*/ /*@out@*/ const char **fnp, + int flags, /*@unused@*/ int rc) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies *fdp, *fnp, rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + const char *fn; + FD_t fd; + + if (fdp == NULL) /* programmer error */ + return 1; + + /* close and reset *fdp to NULL */ + if (*fdp && (fnp == NULL || *fnp == NULL)) { + (void) Fclose(*fdp); + *fdp = NULL; + return 0; + } + + /* open a file and set *fdp */ + if (*fdp == NULL && fnp != NULL && *fnp != NULL) { + fd = Fopen(*fnp, ((flags & O_WRONLY) ? "w.fdio" : "r.fdio")); + if (fd == NULL || Ferror(fd)) { + rpmlog(RPMLOG_ERR, _("%s: open failed: %s\n"), *fnp, + Fstrerror(fd)); + return 1; + } + *fdp = fd; + return 0; + } + + /* open a temp file */ + if (*fdp == NULL && (fnp == NULL || *fnp == NULL)) { + fn = NULL; + if (rpmTempFile(NULL, (fnp ? &fn : NULL), &fd)) { + rpmlog(RPMLOG_ERR, _("rpmTempFile failed\n")); + return 1; + } + if (fnp != NULL) + *fnp = fn; +/*@-refcounttrans@*/ /* FIX: XfdLink/XfdFree annotation */ + *fdp = fdLink(fd, "manageFile return"); + fd = fdFree(fd, "manageFile return"); +/*@=refcounttrans@*/ + return 0; + } + + /* no operation */ + if (*fdp != NULL && fnp != NULL && *fnp != NULL) + return 0; + + /* XXX never reached */ + return 1; +} + +/** + * Copy header+payload, calculating digest(s) on the fly. + */ +static int copyFile(FD_t *sfdp, const char **sfnp, + FD_t *tfdp, const char **tfnp) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies *sfdp, *sfnp, *tfdp, *tfnp, rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + unsigned char buf[BUFSIZ]; + ssize_t count; + int rc = 1; + + if (manageFile(sfdp, sfnp, O_RDONLY, 0)) + goto exit; + if (manageFile(tfdp, tfnp, O_WRONLY|O_CREAT|O_TRUNC, 0)) + goto exit; + + while ((count = Fread(buf, sizeof(buf[0]), sizeof(buf), *sfdp)) > 0) + { + if (Fwrite(buf, sizeof(buf[0]), count, *tfdp) != (size_t)count) { + rpmlog(RPMLOG_ERR, _("%s: Fwrite failed: %s\n"), *tfnp, + Fstrerror(*tfdp)); + goto exit; + } + } + if (count < 0) { + rpmlog(RPMLOG_ERR, _("%s: Fread failed: %s\n"), *sfnp, Fstrerror(*sfdp)); + goto exit; + } + if (Fflush(*tfdp) != 0) { + rpmlog(RPMLOG_ERR, _("%s: Fflush failed: %s\n"), *tfnp, + Fstrerror(*tfdp)); + goto exit; + } + + rc = 0; + +exit: + if (*sfdp) (void) manageFile(sfdp, NULL, 0, rc); + if (*tfdp) (void) manageFile(tfdp, NULL, 0, rc); + return rc; +} + +/** + * Retrieve signer fingerprint from an OpenPGP signature tag. + * @param sigh signature header + * @param sigtag signature tag + * @retval signid signer fingerprint + * @return 0 on success + */ +static int getSignid(Header sigh, rpmSigTag sigtag, unsigned char * signid) + /*@globals fileSystem, internalState @*/ + /*@modifies *signid, fileSystem, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + int rc = 1; + int xx; + + he->tag = (rpmTag) sigtag; + xx = headerGet(sigh, he, 0); + if (xx && he->p.ptr != NULL) { + pgpDig dig = pgpDigNew(RPMVSF_DEFAULT, PGPPUBKEYALGO_UNKNOWN); + + /* XXX expose ppSignid() from rpmhkp.c? */ + pgpPkt pp = (pgpPkt) alloca(sizeof(*pp)); + (void) pgpPktLen(he->p.ui8p, he->c, pp); + if (!rpmhkpLoadSignature(NULL, dig, pp)) { + memcpy(signid, dig->signature.signid, sizeof(dig->signature.signid)); + rc = 0; + } + + he->p.ptr = _free(he->p.ptr); + dig = pgpDigFree(dig); + } + return rc; +} + +/** \ingroup rpmcli + * Create/modify elements in signature header. + * @param ts transaction set + * @param qva mode flags and parameters + * @param argv array of package file names (NULL terminated) + * @return 0 on success + */ +static int rpmReSign(/*@unused@*/ rpmts ts, + QVA_t qva, const char ** argv) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmgi gi = NULL; + FD_t fd = NULL; + FD_t ofd = NULL; + struct rpmlead *lead = NULL; + rpmSigTag sigtag; + const char *sigtarget = NULL; + char tmprpm[1024+1]; + Header sigh = NULL; + int res = 1; /* XXX assume failure */ + int deleting = (qva->qva_mode == RPMSIGN_DEL_SIGNATURE); + rpmRC rpmrc = RPMRC_OK; + int xx; + int i; + mode_t mode; + + tmprpm[0] = '\0'; + + if (argv) + { /* start-of-arg-iteration */ + rpmuint32_t tag = (qva->qva_source == RPMQV_FTSWALK) + ? RPMDBI_FTSWALK : RPMDBI_ARGLIST; + rpmgiFlags _giFlags = RPMGI_NONE; + + gi = rpmgiNew(ts, tag, NULL, 0); +/*@-mods@*/ + if (rpmioFtsOpts == 0) + rpmioFtsOpts = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); +/*@=mods@*/ + rpmrc = rpmgiSetArgs(gi, argv, rpmioFtsOpts, (rpmgiFlags)(_giFlags|RPMGI_NOHEADER)); + + while ((rpmrc = rpmgiNext(gi)) == RPMRC_OK) { + const char * fn = rpmgiHdrPath(gi); + const char * tfn; + + fprintf(stdout, "%s:\n", fn); + +/*@-modobserver@*/ /* XXX rpmgiHdrPath should not be observer */ + if (manageFile(&fd, &fn, O_RDONLY, 0)) + goto exit; +/*@=modobserver@*/ + + { const char item[] = "Lead"; + const char * msg = NULL; + rpmRC rc = rpmpkgRead(item, fd, &lead, &msg); + if (rc != RPMRC_OK) { + rpmlog(RPMLOG_ERR, "%s: %s: %s\n", fn, item, msg); + msg = _free(msg); + goto exit; + } + msg = _free(msg); + } + + { const char item[] = "Signature"; + const char * msg = NULL; + rpmRC rc = rpmpkgRead(item, fd, &sigh, &msg); + switch (rc) { + default: + rpmlog(RPMLOG_ERR, "%s: %s: %s\n", fn, item, + (msg && *msg ? msg : "")); + msg = _free(msg); + goto exit; + /*@notreached@*/ /*@switchbreak@*/ break; + case RPMRC_OK: + if (sigh == NULL) { + rpmlog(RPMLOG_ERR, _("%s: No signature available\n"), fn); + goto exit; + } + /*@switchbreak@*/ break; + } + msg = _free(msg); + } + + /* Write the header and archive to a temp file */ + /* ASSERT: ofd == NULL && sigtarget == NULL */ +/*@-modobserver@*/ /* XXX rpmgiHdrPath should not be observer */ + if (copyFile(&fd, &fn, &ofd, &sigtarget)) + goto exit; +/*@=modobserver@*/ + /* Both fd and ofd are now closed. sigtarget contains tempfile name. */ + /* ASSERT: fd == NULL && ofd == NULL */ + + /* Lose the immutable region (if present). */ + he->tag = RPMTAG_HEADERSIGNATURES; + xx = headerGet(sigh, he, 0); + if (xx) { + HE_t ohe = (HE_t) memset(alloca(sizeof(*ohe)), 0, sizeof(*ohe)); + HeaderIterator hi; + Header oh; + Header nh; + + nh = headerNew(); + if (nh == NULL) { + he->p.ptr = _free(he->p.ptr); + goto exit; + } + + oh = headerCopyLoad(he->p.ptr); + for (hi = headerInit(oh); + headerNext(hi, ohe, 0); + ohe->p.ptr = _free(ohe->p.ptr)) + { + if (ohe->p.ptr) { + xx = headerPut(nh, ohe, 0); + } + } + hi = headerFini(hi); + (void)headerFree(oh); + oh = NULL; + + (void)headerFree(sigh); + sigh = NULL; + sigh = headerLink(nh); + (void)headerFree(nh); + nh = NULL; + } + +if (sigh != NULL) { + /* Eliminate broken digest values. */ + he->tag = (rpmTag)RPMSIGTAG_LEMD5_1; + xx = headerDel(sigh, he, 0); + he->tag = (rpmTag)RPMSIGTAG_LEMD5_2; + xx = headerDel(sigh, he, 0); + he->tag = (rpmTag)RPMSIGTAG_BADSHA1_1; + xx = headerDel(sigh, he, 0); + he->tag = (rpmTag)RPMSIGTAG_BADSHA1_2; + xx = headerDel(sigh, he, 0); + + /* Toss and recalculate header+payload size and digests. */ + { static const rpmuint32_t sigs[] = + { RPMSIGTAG_SIZE, RPMSIGTAG_MD5, RPMSIGTAG_SHA1 }; + size_t nsigs = sizeof(sigs) / sizeof(sigs[0]); + for (i = 0; i < (int)nsigs; i++) { + he->tag = (rpmTag)sigs[i]; + xx = headerDel(sigh, he, 0); + xx = rpmAddSignature(sigh, sigtarget, (rpmSigTag) he->tag, qva->passPhrase); + if (xx) + goto exit; + } + } + + if (deleting) { + /* Nuke all the signature tags. */ + static const rpmuint32_t sigs[] = + { RPMSIGTAG_GPG, RPMSIGTAG_PGP5, RPMSIGTAG_PGP, + RPMSIGTAG_DSA, RPMSIGTAG_RSA }; + size_t nsigs = sizeof(sigs) / sizeof(sigs[0]); + for (i = 0; i < (int)nsigs; i++) { + he->tag = (rpmTag)sigs[i]; + xx = headerDel(sigh, he, 0); + } + } else { /* If gpg/pgp is configured, replace the signature. */ + int addsig = 0; + sigtag = RPMSIGTAG_GPG; + addsig = 1; + + if (addsig) { + unsigned char oldsignid[8], newsignid[8]; + + /* Grab the old signature fingerprint (if any) */ + memset(oldsignid, 0, sizeof(oldsignid)); + xx = getSignid(sigh, sigtag, oldsignid); + + switch (sigtag) { + default: + /*@switchbreak@*/ break; + case RPMSIGTAG_DSA: + he->tag = (rpmTag)RPMSIGTAG_GPG; + xx = headerDel(sigh, he, 0); + /*@switchbreak@*/ break; + case RPMSIGTAG_RSA: + he->tag = (rpmTag)RPMSIGTAG_PGP; + xx = headerDel(sigh, he, 0); + /*@switchbreak@*/ break; + case RPMSIGTAG_GPG: + he->tag = (rpmTag)RPMSIGTAG_PGP; + xx = headerDel(sigh, he, 0); + he->tag = (rpmTag)RPMSIGTAG_DSA; + xx = headerDel(sigh, he, 0); + /*@fallthrough@*/ + case RPMSIGTAG_PGP5: + case RPMSIGTAG_PGP: + he->tag = (rpmTag)RPMSIGTAG_RSA; + xx = headerDel(sigh, he, 0); + /*@switchbreak@*/ break; + } + + he->tag = (rpmTag)sigtag; + xx = headerDel(sigh, he, 0); + xx = rpmAddSignature(sigh, sigtarget, sigtag, qva->passPhrase); + if (xx) + goto exit; + + /* If package was previously signed, check for same signer. */ + memset(newsignid, 0, sizeof(newsignid)); + if (memcmp(oldsignid, newsignid, sizeof(oldsignid))) { + + /* Grab the new signature fingerprint */ + xx = getSignid(sigh, sigtag, newsignid); + + /* If same signer, skip resigning the package. */ + if (!memcmp(oldsignid, newsignid, sizeof(oldsignid))) { + + rpmlog(RPMLOG_WARNING, + _("%s: was already signed by key ID %s, skipping\n"), + fn, pgpHexStr(newsignid+4, sizeof(newsignid)-4)); + + /* Clean up intermediate target */ + xx = Unlink(sigtarget); + sigtarget = _free(sigtarget); + continue; + } + } + } + } + + /* Reallocate the signature into one contiguous region. */ + sigh = headerReload(sigh, RPMTAG_HEADERSIGNATURES); + if (sigh == NULL) /* XXX can't happen */ + goto exit; +} + + /* Write the lead/signature of the output rpm */ + (void) stpcpy( stpcpy(tmprpm, fn), ".XXXXXX"); + +#if defined(HAVE_MKSTEMP) + mode = umask(0077); + (void) close(mkstemp(tmprpm)); + (void) umask(mode); +#else + (void) mktemp(tmprpm); +#endif + tfn = tmprpm; + + if (manageFile(&ofd, &tfn, O_WRONLY|O_CREAT|O_TRUNC, 0)) + goto exit; + + { const char item[] = "Lead"; + const char * msg = NULL; + rpmRC rc = rpmpkgWrite(item, ofd, lead, &msg); + if (rc != RPMRC_OK) { + rpmlog(RPMLOG_ERR, "%s: %s: %s\n", tfn, item, Fstrerror(ofd)); + msg = _free(msg); + goto exit; + } + msg = _free(msg); + } + + { const char item[] = "Signature"; + const char * msg = NULL; + rpmRC rc = rpmpkgWrite(item, ofd, sigh, &msg); + if (rc != RPMRC_OK) { + rpmlog(RPMLOG_ERR, "%s: %s: %s\n", tfn, item, Fstrerror(ofd)); + msg = _free(msg); + goto exit; + } + msg = _free(msg); + } + (void)headerFree(sigh); + sigh = NULL; + + /* Append the header and archive from the temp file */ + /* ASSERT: fd == NULL && ofd != NULL */ + if (copyFile(&fd, &sigtarget, &ofd, &tfn)) + goto exit; + /* Both fd and ofd are now closed. */ + /* ASSERT: fd == NULL && ofd == NULL */ + + /* Move final target into place. */ + xx = Unlink(fn); + xx = Rename(tfn, fn); + tmprpm[0] = '\0'; + + /* Clean up intermediate target */ + xx = Unlink(sigtarget); + sigtarget = _free(sigtarget); + } + + /* XXX disambiguate end-of-iteration from item failures. */ + if (rpmrc == RPMRC_NOTFOUND) + rpmrc = (rpmRC) rpmgiRc(gi); + + gi = rpmgiFree(gi); + + } /* end-of-arg-iteration */ + + if (rpmrc == RPMRC_OK) + res = 0; + +exit: + if (fd) (void) manageFile(&fd, NULL, 0, res); + if (ofd) (void) manageFile(&ofd, NULL, 0, res); + + lead = _free(lead); + (void)headerFree(sigh); + sigh = NULL; + + if (sigtarget) { + xx = Unlink(sigtarget); + sigtarget = _free(sigtarget); + } + if (tmprpm[0] != '\0') { + xx = Unlink(tmprpm); + tmprpm[0] = '\0'; + } + + return res; +} + +rpmRC rpmcliImportPubkey(const rpmts ts, const unsigned char * pkt, ssize_t pktlen) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + static unsigned char zeros[] = + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + const char * afmt = "%{pubkeys:armor}"; + const char * group = "Public Keys"; + const char * license = "pubkey"; + const char * buildhost = "localhost"; + rpmuint32_t pflags = (RPMSENSE_KEYRING|RPMSENSE_EQUAL); + rpmuint32_t zero = 0; + pgpDig dig = NULL; + pgpDigParams pubp = NULL; + const char * d = NULL; + const char * enc = NULL; + const char * n = NULL; + const char * u = NULL; + const char * v = NULL; + const char * r = NULL; + const char * evr = NULL; + Header h = NULL; + rpmRC rc = RPMRC_FAIL; /* assume failure */ + char * t; + int xx; +rpmhkp hkp = NULL; +pgpPkt pp = (pgpPkt) alloca(sizeof(*pp)); +int validate = 1; + + if (pkt == NULL || pktlen <= 0) + goto exit; + if (rpmtsOpenDB(ts, (O_RDWR|O_CREAT))) + goto exit; + +/*@-moduncon@*/ + if ((enc = b64encode(pkt, pktlen)) == NULL) + goto exit; +/*@=moduncon@*/ + + dig = pgpDigNew(RPMVSF_DEFAULT, PGPPUBKEYALGO_UNKNOWN); + pubp = pgpGetPubkey(dig); + + //* Validate the pubkey. */ + if (ts->hkp == NULL) + ts->hkp = rpmhkpNew(NULL, 0); + hkp = rpmhkpLink(ts->hkp); +hkp->pkt = (rpmuint8_t *)pkt; +hkp->pktlen = pktlen; + + xx = pgpGrabPkts(hkp->pkt, hkp->pktlen, &hkp->pkts, &hkp->npkts); + if (!xx) + (void) pgpPubkeyFingerprint(hkp->pkt, hkp->pktlen, hkp->keyid); + memcpy(pubp->signid, hkp->keyid, sizeof(pubp->signid)); /* XXX useless */ + + xx = pgpPktLen(hkp->pkt, hkp->pktlen, pp); + + xx = rpmhkpLoadKey(hkp, dig, 0, 0); + + /* Validate pubkey self-signatures. */ + if (validate) { + rpmRC yy = rpmhkpValidate(hkp, NULL); + switch (yy) { + case RPMRC_OK: + break; + case RPMRC_NOTFOUND: + case RPMRC_FAIL: /* XXX remap to NOTFOUND? */ + case RPMRC_NOTTRUSTED: + case RPMRC_NOKEY: + default: +#ifdef NOTYET /* XXX make check-pubkey fails?!? . */ + rc = yy; + goto exit; +#endif + /*@notreached@*/ break; + } + } + + /* XXX hack up a user id (if not already present) */ + if (pubp->userid == NULL) { + if (hkp->uidx >= 0 && hkp->uidx < hkp->npkts) { + size_t nb = pgpPktLen(hkp->pkts[hkp->uidx], hkp->pktlen, pp); + char * t; + nb = pp->hlen; + t = (char *) memcpy(xmalloc(nb + 1), pp->u.u->userid, nb); + t[nb] = '\0'; + pubp->userid = t; + } else + pubp->userid = xstrdup(pgpHexStr(pubp->signid+4, 4)); + } + +#ifdef DYING +_rpmhkpDumpDig(__FUNCTION__, dig); +#endif + + /* Build header elements. */ + if (!memcmp(pubp->signid, zeros, sizeof(pubp->signid)) + || !memcmp(pubp->time, zeros, sizeof(pubp->time)) + || pubp->userid == NULL) + goto exit; + + v = t = (char *) xmalloc(16+1); + t = stpcpy(t, pgpHexStr(pubp->signid, sizeof(pubp->signid))); + + r = t = (char *) xmalloc(8+1); + t = stpcpy(t, pgpHexStr(pubp->time, sizeof(pubp->time))); + + n = t = (char *) xmalloc(sizeof("gpg()")+8); + t = stpcpy( stpcpy( stpcpy(t, "gpg("), v+8), ")"); + + { const char * userid = + (pubp->userid ? pubp->userid : pgpHexStr(pubp->signid+4, 4)); + u = t = (char *) xmalloc(sizeof("gpg()")+strlen(userid)); + t = stpcpy( stpcpy( stpcpy(t, "gpg("), userid), ")"); + } + + evr = t = (char *) xmalloc(sizeof("4X:-")+strlen(v)+strlen(r)); + t = stpcpy(t, (pubp->version == 4 ? "4:" : "3:")); + t = stpcpy( stpcpy( stpcpy(t, v), "-"), r); + + /* Check for pre-existing header. */ + + /* Build pubkey header. */ + h = headerNew(); + + he->append = 1; + + he->tag = RPMTAG_PUBKEYS; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &enc; + he->c = 1; + xx = headerPut(h, he, 0); + + he->append = 0; + + d = headerSprintf(h, afmt, NULL, rpmHeaderFormats, NULL); + if (d == NULL) + goto exit; + + he->t = RPM_STRING_TYPE; + he->c = 1; + he->tag = RPMTAG_NAME; + he->p.str = xstrdup("gpg-pubkey"); + xx = headerPut(h, he, 0); + he->p.ptr = _free(he->p.ptr); + he->tag = RPMTAG_VERSION; + he->p.str = v+8; + xx = headerPut(h, he, 0); + he->tag = RPMTAG_RELEASE; + he->p.str = xstrdup(r); + xx = headerPut(h, he, 0); + he->p.ptr = _free(he->p.ptr); + + /* Add Summary/Description/Group. */ + he->tag = RPMTAG_DESCRIPTION; + he->p.str = xstrdup(d); +#if defined(SUPPORT_I18NSTRING_TYPE) + xx = headerAddI18NString(h, he->tag, he->p.str, "C"); +#else + xx = headerPut(h, he, 0); +#endif + he->p.ptr = _free(he->p.ptr); + + he->tag = RPMTAG_GROUP; + he->p.str = xstrdup(group); +#if defined(SUPPORT_I18NSTRING_TYPE) + xx = headerAddI18NString(h, he->tag, he->p.str, "C"); +#else + xx = headerPut(h, he, 0); +#endif + he->p.ptr = _free(he->p.ptr); + + he->tag = RPMTAG_SUMMARY; + he->p.str = xstrdup(u); +#if defined(SUPPORT_I18NSTRING_TYPE) + xx = headerAddI18NString(h, he->tag, he->p.str, "C"); +#else + xx = headerPut(h, he, 0); +#endif + he->p.ptr = _free(he->p.ptr); + +#ifdef NOTYET /* XXX can't erase pubkeys with "pubkey" arch. */ + /* Add a "pubkey" arch/os to avoid missing value NULL ptrs. */ + he->tag = RPMTAG_ARCH; + he->p.str = "pubkey"; + xx = headerPut(h, he, 0); + he->tag = RPMTAG_OS; + he->p.str = "pubkey"; + xx = headerPut(h, he, 0); +#endif + + he->tag = RPMTAG_LICENSE; + he->p.str = xstrdup(license); + xx = headerPut(h, he, 0); + he->p.ptr = _free(he->p.ptr); + + he->tag = RPMTAG_SIZE; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &zero; + he->c = 1; + xx = headerPut(h, he, 0); + + he->append = 1; + + /* Provides: gpg(IDENTITY) = PUBKEYVERSIONTYPE:PUBKEYID-CREATION */ + he->tag = RPMTAG_PROVIDENAME; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &u; + he->c = 1; + xx = headerPut(h, he, 0); + he->tag = RPMTAG_PROVIDEVERSION; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &evr; + he->c = 1; + xx = headerPut(h, he, 0); + he->tag = RPMTAG_PROVIDEFLAGS; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &pflags; + he->c = 1; + xx = headerPut(h, he, 0); + + /* Provides: gpg(PUBKEYID) = PUBKEYVERSION:PUBKEYID-CREATION */ + he->tag = RPMTAG_PROVIDENAME; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &n; + he->c = 1; + xx = headerPut(h, he, 0); + he->tag = RPMTAG_PROVIDEVERSION; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = &evr; + he->c = 1; + xx = headerPut(h, he, 0); + he->tag = RPMTAG_PROVIDEFLAGS; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &pflags; + he->c = 1; + xx = headerPut(h, he, 0); + + he->append = 0; + + he->tag = RPMTAG_RPMVERSION; + he->t = RPM_STRING_TYPE; + he->p.str = xstrdup(RPMVERSION); + he->c = 1; + xx = headerPut(h, he, 0); + he->p.ptr = _free(he->p.ptr); + + /* XXX W2DO: tag value inherited from parent? */ + he->tag = RPMTAG_BUILDHOST; + he->t = RPM_STRING_TYPE; + he->p.str = xstrdup(buildhost); + he->c = 1; + xx = headerPut(h, he, 0); + he->p.ptr = _free(he->p.ptr); + + { rpmuint32_t tid = rpmtsGetTid(ts); + he->tag = RPMTAG_INSTALLTIME; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &tid; + he->c = 1; + xx = headerPut(h, he, 0); + /* XXX W2DO: tag value inherited from parent? */ + he->tag = RPMTAG_BUILDTIME; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &tid; + he->c = 1; + xx = headerPut(h, he, 0); + } + +#ifdef NOTYET + /* XXX W2DO: tag value inherited from parent? */ + he->tag = RPMTAG_SOURCERPM; + he->t = RPM_STRING_TYPE; + he->p.str = fn; + he->c = 1; + xx = headerPut(h, he, 0); +#endif + + /* Reallocate the pubkey header into an immutable region. */ + he->tag = RPMTAG_HEADERIMMUTABLE; + h = headerReload(h, he->tag); + { size_t length = 0; + he->t = RPM_BIN_TYPE; + he->p.ptr = headerUnload(h, &length); + he->c = length; + } + + /* Calculate the header-only SHA1 digest. */ + { DIGEST_CTX ctx = rpmDigestInit(PGPHASHALGO_SHA1, RPMDIGEST_NONE); + unsigned char * hmagic = NULL; + size_t nmagic = 0; + const char * SHA1 = NULL; + + (void) headerGetMagic(NULL, &hmagic, &nmagic); + if (hmagic && nmagic > 0) + (void) rpmDigestUpdate(ctx, hmagic, nmagic); + (void) rpmDigestUpdate(ctx, he->p.ptr, he->c); + (void) rpmDigestFinal(ctx, &SHA1, NULL, 1); + he->p.ptr = _free(he->p.ptr); + + if (SHA1 == NULL) + goto exit; + he->tag = RPMTAG_SHA1HEADER; + he->t = RPM_STRING_TYPE; + he->p.str = SHA1; + he->c = 1; + xx = headerPut(h, he, 0); + SHA1 = _free(SHA1); + } + + he->tag = RPMTAG_PACKAGECOLOR; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = &zero; + he->c = 1; + xx = headerPut(h, he, 0); + + /* Add header to database. */ + xx = rpmtxnBegin(rpmtsGetRdb(ts), NULL, NULL); + xx = rpmdbAdd(rpmtsGetRdb(ts), rpmtsGetTid(ts), h, NULL); + if (xx != 0) { + xx = rpmtxnAbort(rpmtsGetRdb(ts)->db_txn); + rpmtsGetRdb(ts)->db_txn = NULL; + goto exit; + } else + xx = rpmtxnCommit(rpmtsGetRdb(ts)->db_txn); + rpmtsGetRdb(ts)->db_txn = NULL; + xx = rpmtxnCheckpoint(rpmtsGetRdb(ts)); + rc = RPMRC_OK; + +exit: + /* Clean up. */ +hkp->pkt = NULL; +hkp->pktlen = 0; +hkp->pkts = _free(hkp->pkts); +hkp->npkts = 0; + (void) rpmhkpFree(hkp); + hkp = NULL; + (void)headerFree(h); + h = NULL; + dig = pgpDigFree(dig); + n = _free(n); + u = _free(u); + v = _free(v); + r = _free(r); + evr = _free(evr); + enc = _free(enc); + d = _free(d); + + return rc; +} + +/** \ingroup rpmcli + * Import public key(s). + * @todo Implicit --update policy for gpg-pubkey headers. + * @param ts transaction set + * @param qva mode flags and parameters + * @param argv array of pubkey file names (NULL terminated) + * @return 0 on success + */ +static int rpmcliImportPubkeys(const rpmts ts, + /*@unused@*/ QVA_t qva, + /*@null@*/ const char ** argv) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + const char * fn; + rpmuint8_t * pkt = NULL; + size_t pktlen = 0; + char * t = NULL; + int res = 0; + rpmRC rpmrc; + int rc; + + if (argv == NULL) return res; + + while ((fn = *argv++) != NULL) { + + rpmtsClean(ts); + pkt = _free(pkt); + t = _free(t); + + /* If arg looks like a keyid, then attempt keyserver retrieve. */ + if (fn[0] == '0' && fn[1] == 'x') { + const char * s; + int i; + for (i = 0, s = fn+2; *s && isxdigit(*s); s++, i++) + {}; + if (i == 8 || i == 16) { + t = rpmExpand("%{_hkp_keyserver_query}", fn, NULL); + if (t && *t != '%') + fn = t; + } + } + + /* Read pgp packet. */ + if ((rc = pgpReadPkts(fn, &pkt, &pktlen)) <= 0) { + rpmlog(RPMLOG_ERR, _("%s: import read failed(%d).\n"), fn, rc); + res++; + continue; + } + if (rc != PGPARMOR_PUBKEY) { + rpmlog(RPMLOG_ERR, _("%s: not an armored public key.\n"), fn); + res++; + continue; + } + + /* Import pubkey packet(s). */ + if ((rpmrc = rpmcliImportPubkey(ts, pkt, pktlen)) != RPMRC_OK) { + rpmlog(RPMLOG_ERR, _("%s: import failed.\n"), fn); + res++; + continue; + } + + } + +rpmtsClean(ts); + pkt = _free(pkt); + t = _free(t); + return res; +} + +/** + * @todo If the GPG key was known available, the md5 digest could be skipped. + */ +static rpmRC readFile(FD_t fd, const char * fn) + /*@globals fileSystem, internalState @*/ + /*@modifies fd, fileSystem, internalState @*/ +{ +rpmxar xar = fdGetXAR(fd); +pgpDig dig = fdGetDig(fd); + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + unsigned char buf[4*BUFSIZ]; + ssize_t count; + unsigned ix; + rpmRC rc; + int xx; + + dig->nbytes = 0; + + /* Read the header from the package. */ + { Header h = NULL; + const char item[] = "Header"; + const char * msg = NULL; + rc = rpmpkgRead(item, fd, &h, &msg); + if (rc != RPMRC_OK) { + rpmlog(RPMLOG_ERR, "%s: %s: %s\n", fn, item, msg); + msg = _free(msg); + goto exit; + } + msg = _free(msg); + + dig->nbytes += headerSizeof(h); + + /* Fish out the autosign pubkey (if present). */ + he->tag = RPMTAG_PUBKEYS; + xx = headerGet(h, he, 0); + if (xx && he->p.argv != NULL && he->c > 0) + switch (he->t) { + default: + break; + case RPM_STRING_ARRAY_TYPE: + ix = he->c - 1; /* XXX FIXME: assumes last pubkey */ + dig->pub = _free(dig->pub); + dig->publen = 0; + { rpmiob iob = rpmiobNew(0); + iob = rpmiobAppend(iob, he->p.argv[ix], 0); + xx = pgpArmorUnwrap(iob, (rpmuint8_t **)&dig->pub, &dig->publen); + iob = rpmiobFree(iob); + } + if (xx != PGPARMOR_PUBKEY) { + dig->pub = _free(dig->pub); + dig->publen = 0; + } + break; + } + he->p.ptr = _free(he->p.ptr); + + if (headerIsEntry(h, RPMTAG_HEADERIMMUTABLE)) { + unsigned char * hmagic = NULL; + size_t nmagic = 0; + + he->tag = RPMTAG_HEADERIMMUTABLE; + xx = headerGet(h, he, 0); + if (!xx || he->p.ptr == NULL) { + (void)headerFree(h); + h = NULL; + rpmlog(RPMLOG_ERR, "%s: %s: %s\n", fn, _("headerGet failed"), + _("failed to retrieve original header\n")); + rc = RPMRC_FAIL; + goto exit; + } + (void) headerGetMagic(NULL, &hmagic, &nmagic); + dig->hdrsha1ctx = rpmDigestInit(PGPHASHALGO_SHA1, RPMDIGEST_NONE); + if (hmagic && nmagic > 0) + (void) rpmDigestUpdate(dig->hdrsha1ctx, hmagic, nmagic); + (void) rpmDigestUpdate(dig->hdrsha1ctx, he->p.ptr, he->c); + dig->hdrctx = rpmDigestInit((pgpHashAlgo)dig->signature.hash_algo, RPMDIGEST_NONE); + if (hmagic && nmagic > 0) + (void) rpmDigestUpdate(dig->hdrctx, hmagic, nmagic); + (void) rpmDigestUpdate(dig->hdrctx, he->p.ptr, he->c); + he->p.ptr = _free(he->p.ptr); + } + (void)headerFree(h); + h = NULL; + } + + if (xar != NULL) { + const char item[] = "Payload"; + if ((xx = rpmxarNext(xar)) != 0 || (xx = rpmxarPull(xar, item)) != 0) { + rpmlog(RPMLOG_ERR, "%s: %s: %s\n", fn, item, + _("XAR file not found (or no XAR support)")); + rc = RPMRC_NOTFOUND; + goto exit; + } + } + + /* Read the payload from the package. */ + while ((count = Fread(buf, sizeof(buf[0]), sizeof(buf), fd)) > 0) + dig->nbytes += count; + if (count < 0 || Ferror(fd)) { + rpmlog(RPMLOG_ERR, "%s: %s: %s\n", fn, _("Fread failed"), Fstrerror(fd)); + rc = RPMRC_FAIL; + goto exit; + } + + /* XXX Steal the digest-in-progress from the file handle. */ + fdStealDigest(fd, dig); + + rc = RPMRC_OK; /* XXX unnecessary */ + +exit: + return rc; +} + +int rpmVerifySignatures(QVA_t qva, rpmts ts, void * _fd, const char * fn) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + HE_t she = (HE_t) memset(alloca(sizeof(*she)), 0, sizeof(*she)); +/*@-castexpose@*/ + FD_t fd = (FD_t)_fd; +/*@=castexpose@*/ + char result[1024]; + char buf[8192], * b; + char missingKeys[7164], * m; + char untrustedKeys[7164], * u; + pgpDig dig; + pgpDigParams sigp; + Header sigh = NULL; + HeaderIterator hi = NULL; + int res = 0; + int xx; + rpmRC sigres; + int failed; + int nodigests = !(qva->qva_flags & VERIFY_DIGEST); + int nosignatures = !(qva->qva_flags & VERIFY_SIGNATURE); +pgpPkt pp = (pgpPkt) alloca(sizeof(*pp)); + + { + { const char item[] = "Lead"; + const char * msg = NULL; + rpmRC rc = rpmpkgRead(item, fd, NULL, &msg); + switch (rc) { + default: + rpmlog(RPMLOG_ERR, "%s: %s: %s\n", fn, item, msg); + msg = _free(msg); + res++; + goto exit; + /*@notreachea@*/ break; + case RPMRC_OK: + break; + } + msg = _free(msg); + } + + { const char item[] = "Signature"; + const char * msg = NULL; + rpmRC rc = rpmpkgRead(item, fd, &sigh, &msg); + switch (rc) { + default: + rpmlog(RPMLOG_ERR, "%s: %s: %s\n", fn, item, + (msg && *msg ? msg : "")); + msg = _free(msg); + res++; + goto exit; + /*@notreached@*/ /*@switchbreak@*/ break; + case RPMRC_OK: + if (sigh == NULL) { + rpmlog(RPMLOG_ERR, _("%s: No signature available\n"), fn); + res++; + goto exit; + } + /*@switchbreak@*/ break; + } + msg = _free(msg); + } + + /* Grab a hint of what needs doing to avoid duplication. */ + she->tag = (rpmTag)0; + if (she->tag == 0 && !nosignatures) { + if (headerIsEntry(sigh, (rpmTag) RPMSIGTAG_DSA)) + she->tag = (rpmTag) RPMSIGTAG_DSA; + else if (headerIsEntry(sigh, (rpmTag) RPMSIGTAG_RSA)) + she->tag = (rpmTag) RPMSIGTAG_RSA; + } + if (she->tag == 0 && !nodigests) { + if (headerIsEntry(sigh, (rpmTag) RPMSIGTAG_MD5)) + she->tag = (rpmTag) RPMSIGTAG_MD5; + else if (headerIsEntry(sigh, (rpmTag) RPMSIGTAG_SHA1)) + she->tag = (rpmTag) RPMSIGTAG_SHA1; /* XXX never happens */ + } + + dig = rpmtsDig(ts); +/*@-mods@*/ /* LCL: avoid void * _fd annotation for now. */ + (void) fdSetDig(fd, dig); +/*@=mods@*/ + sigp = pgpGetSignature(dig); + + /* XXX RSA needs the hash_algo, so decode early. */ + if ((rpmSigTag) she->tag == RPMSIGTAG_RSA) { + he->tag = she->tag; + xx = headerGet(sigh, he, 0); + xx = pgpPktLen(he->p.ui8p, he->c, pp); + xx = rpmhkpLoadSignature(NULL, dig, pp); + he->p.ptr = _free(he->p.ptr); + } + +/*@-mods@*/ /* LCL: avoid void * _fd annotation for now. */ + if (headerIsEntry(sigh, (rpmTag)RPMSIGTAG_MD5)) + fdInitDigest(fd, PGPHASHALGO_MD5, 0); +/*@=mods@*/ + + /* Read the file, generating digest(s) on the fly. */ +/*@-mods@*/ /* LCL: avoid void * _fd annotation for now. */ + if (dig == NULL || sigp == NULL + || readFile(fd, fn) != RPMRC_OK) + { + res++; + goto exit; + } +/*@=mods@*/ + + failed = 0; + b = buf; *b = '\0'; + m = missingKeys; *m = '\0'; + u = untrustedKeys; *u = '\0'; + sprintf(b, "%s:%c", fn, (rpmIsVerbose() ? '\n' : ' ') ); + b += strlen(b); + + if (sigh != NULL) + for (hi = headerInit(sigh); + headerNext(hi, she, 0) != 0; + she->p.ptr = _free(she->p.ptr)) + { + +assert(she->p.ptr != NULL); + + /* Clean up parameters from previous she->tag. */ + pgpDigClean(dig); + +/*@-ownedtrans -noeffect@*/ + xx = pgpSetSig(dig, she->tag, she->t, she->p.ptr, she->c); +/*@=ownedtrans =noeffect@*/ + + switch ((rpmSigTag)she->tag) { + case RPMSIGTAG_RSA: + case RPMSIGTAG_DSA: + if (nosignatures) + continue; + + xx = pgpPktLen(she->p.ui8p, she->c, pp); + xx = rpmhkpLoadSignature(NULL, dig, pp); + if (sigp->version != 3 && sigp->version != 4) { + rpmlog(RPMLOG_ERR, + _("skipping package %s with unverifiable V%u signature\n"), + fn, sigp->version); + res++; + goto exit; + } + /*@switchbreak@*/ break; + case RPMSIGTAG_SHA1: + if (nodigests) + continue; + /* XXX Don't bother with header sha1 if header dsa. */ + if (!nosignatures && (rpmSigTag)she->tag == RPMSIGTAG_DSA) + continue; + /*@switchbreak@*/ break; + case RPMSIGTAG_MD5: + if (nodigests) + continue; + /*@switchbreak@*/ break; + default: + continue; + /*@notreached@*/ /*@switchbreak@*/ break; + } + + sigres = rpmVerifySignature(dig, result); + + if (sigres) { + failed = 1; + if (rpmIsVerbose()) + b = stpcpy( stpcpy( stpcpy(b, " "), result), "\n"); + else + switch ((rpmSigTag)she->tag) { + case RPMSIGTAG_SIZE: + b = stpcpy(b, "SIZE "); + /*@switchbreak@*/ break; + case RPMSIGTAG_SHA1: + b = stpcpy(b, "SHA1 "); + /*@switchbreak@*/ break; + case RPMSIGTAG_MD5: + b = stpcpy(b, "MD5 "); + /*@switchbreak@*/ break; + case RPMSIGTAG_RSA: + b = stpcpy(b, "RSA "); + /*@switchbreak@*/ break; + case RPMSIGTAG_DSA: + b = stpcpy(b, "(SHA1) DSA "); + /*@switchbreak@*/ break; + default: + b = stpcpy(b, "?UnknownSignatureType? "); + /*@switchbreak@*/ break; + } + } else { + if (rpmIsVerbose()) + b = stpcpy( stpcpy( stpcpy(b, " "), result), "\n"); + else + switch ((rpmSigTag)she->tag) { + case RPMSIGTAG_SIZE: + b = stpcpy(b, "size "); + /*@switchbreak@*/ break; + case RPMSIGTAG_SHA1: + b = stpcpy(b, "sha1 "); + /*@switchbreak@*/ break; + case RPMSIGTAG_MD5: + b = stpcpy(b, "md5 "); + /*@switchbreak@*/ break; + case RPMSIGTAG_RSA: + b = stpcpy(b, "rsa "); + /*@switchbreak@*/ break; + case RPMSIGTAG_DSA: + b = stpcpy(b, "(sha1) dsa "); + /*@switchbreak@*/ break; + default: + b = stpcpy(b, "??? "); + /*@switchbreak@*/ break; + } + } + } + hi = headerFini(hi); + /* XXX clear the already free'd signature data. */ +/*@-noeffect@*/ + xx = pgpSetSig(dig, 0, 0, NULL, 0); +/*@=noeffect@*/ + + res += failed; + + if (failed) { + if (rpmIsVerbose()) { + rpmlog(RPMLOG_NOTICE, "%s", buf); + } else { + rpmlog(RPMLOG_NOTICE, "%s%s%s%s%s%s%s%s\n", buf, + _("NOT_OK"), + (missingKeys[0] != '\0') ? _(" (MISSING KEYS:") : "", + missingKeys, + (missingKeys[0] != '\0') ? _(") ") : "", + (untrustedKeys[0] != '\0') ? _(" (UNTRUSTED KEYS:") : "", + untrustedKeys, + (untrustedKeys[0] != '\0') ? _(")") : ""); + + } + } else { + if (rpmIsVerbose()) { + rpmlog(RPMLOG_NOTICE, "%s", buf); + } else { + rpmlog(RPMLOG_NOTICE, "%s%s%s%s%s%s%s%s\n", buf, + _("OK"), + (missingKeys[0] != '\0') ? _(" (MISSING KEYS:") : "", + missingKeys, + (missingKeys[0] != '\0') ? _(") ") : "", + (untrustedKeys[0] != '\0') ? _(" (UNTRUSTED KEYS:") : "", + untrustedKeys, + (untrustedKeys[0] != '\0') ? _(")") : ""); + } + } + + } + +exit: + rpmtsCleanDig(ts); + (void)headerFree(sigh); + sigh = NULL; + return res; +} + +int rpmcliSign(rpmts ts, QVA_t qva, const char ** argv) + /*@globals rpmioFtsOpts @*/ + /*@modifies rpmioFtsOpts @*/ +{ + rpmRC rpmrc; + int res = 0; + + if (argv == NULL) return res; + + switch (qva->qva_mode) { + case RPMSIGN_CHK_SIGNATURE: + break; + case RPMSIGN_IMPORT_PUBKEY: + return rpmcliImportPubkeys(ts, qva, argv); + /*@notreached@*/ break; + case RPMSIGN_NEW_SIGNATURE: + case RPMSIGN_ADD_SIGNATURE: + case RPMSIGN_DEL_SIGNATURE: + return rpmReSign(ts, qva, argv); + /*@notreached@*/ break; + case RPMSIGN_NONE: + default: + return -1; + /*@notreached@*/ break; + } + +{ /* start-of-arg-iteration */ + + int tag = (qva->qva_source == RPMQV_FTSWALK) + ? RPMDBI_FTSWALK : RPMDBI_ARGLIST; + rpmgi gi = rpmgiNew(ts, tag, NULL, 0); + rpmgiFlags _giFlags = RPMGI_NONE; + rpmRC rc; + + if (rpmioFtsOpts == 0) + rpmioFtsOpts = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); + rc = (rpmRC) + rpmgiSetArgs(gi, argv, rpmioFtsOpts, + (rpmgiFlags)(_giFlags|RPMGI_NOHEADER)); + while ((rpmrc = rpmgiNext(gi)) == RPMRC_OK) { + const char * fn = rpmgiHdrPath(gi); + FD_t fd; + int xx; + + fd = Fopen(fn, "r.fdio"); + if (fd == NULL || Ferror(fd)) { + rpmlog(RPMLOG_ERR, _("%s: open failed: %s\n"), + fn, Fstrerror(fd)); + res++; + } else if (rpmVerifySignatures(qva, ts, fd, fn)) { + res++; + } + + if (fd != NULL) { + xx = Fclose(fd); + } + } + + /* XXX disambiguate end-of-iteration from item failures. */ + if (res == 0 && rpmrc == RPMRC_NOTFOUND) { + rpmrc = (rpmRC) rpmgiRc(gi); + if (rpmrc != RPMRC_OK) + res++; + } + + gi = rpmgiFree(gi); + +} /* end-of-arg-iteration */ + + return res; +} diff --git a/rpm-5.4.9/lib/rpmcli.h b/rpm-5.4.9/lib/rpmcli.h new file mode 100644 index 0000000..50713be --- /dev/null +++ b/rpm-5.4.9/lib/rpmcli.h @@ -0,0 +1,757 @@ +#ifndef H_RPMCLI +#define H_RPMCLI + +/** \ingroup rpmcli rpmbuild + * \file lib/rpmcli.h + */ + +#include +#include +#include +#include +#include +#include +#include /* XXX rpmfileAttrs */ +#include /* XXX rpmdepFlags */ + +/** + * Table of query format extensions. + * @note Chains *headerCompoundFormats -> *headerDefaultFormats. + */ +/*@-redecl@*/ +/*@unchecked@*/ +extern headerSprintfExtension rpmHeaderFormats; +/*@=redecl@*/ + +/** \ingroup rpmcli + * Should version 3 packages be produced? + */ +/*@-redecl@*/ +/*@unchecked@*/ +extern int _noDirTokens; +/*@=redecl@*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \ingroup rpmcli + * Popt option table for options shared by all modes and executables. + */ +/*@unchecked@*/ +extern struct poptOption rpmcliAllPoptTable[]; + +/*@unchecked@*/ +extern int global_depFlags; + +/*@unchecked@*/ +extern struct poptOption rpmcliDepFlagsPoptTable[]; + +/*@unchecked@*/ /*@observer@*/ /*@null@*/ +extern const char * rpmcliTargets; +/*@=redecl@*/ + +/** + * Initialize most everything needed by an rpm CLI executable context. + * @param argc no. of args + * @param argv arg array + * @param optionsTable popt option table + * @return popt context (or NULL) + */ +/*@null@*/ +poptContext +rpmcliInit(int argc, char *const argv[], struct poptOption * optionsTable) + /*@globals rpmCLIMacroContext, rpmGlobalMacroContext, h_errno, stderr, + fileSystem, internalState @*/ + /*@modifies rpmCLIMacroContext, rpmGlobalMacroContext, stderr, + fileSystem, internalState @*/; + +/** + * Make sure that rpm configuration has been read. + * @warning Options like --rcfile and --verbose must precede callers option. + */ +/*@mayexit@*/ +void rpmcliConfigured(void) + /*@globals rpmCLIMacroContext, + rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies rpmCLIMacroContext, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +/** + * Destroy most everything needed by an rpm CLI executable context. + * @param optCon popt context + * @return NULL always + */ +poptContext +rpmcliFini(/*@only@*/ /*@null@*/ poptContext optCon) + /*@globals rpmTags, rpmGlobalMacroContext, + fileSystem, internalState @*/ + /*@modifies optCon, rpmTags, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +/** + * Common/global popt tokens used for command line option tables. + */ +#define RPMCLI_POPT_NODEPS -1026 +#define RPMCLI_POPT_NOFDIGESTS -1027 +#define RPMCLI_POPT_NOSCRIPTS -1028 +#define RPMCLI_POPT_NOSIGNATURE -1029 +#define RPMCLI_POPT_NODIGEST -1030 +#define RPMCLI_POPT_NOHDRCHK -1031 +#define RPMCLI_POPT_NOCONTEXTS -1032 +#define RPMCLI_POPT_TARGETPLATFORM -1033 +#define RPMCLI_POPT_NOHMACS -1034 + +/* ==================================================================== */ +/** \name RPMQV */ +/*@{*/ + +/** \ingroup rpmcli + * Query/Verify argument qualifiers. + * @todo Reassign to tag values. + */ +typedef enum rpmQVSources_e { + RPMQV_PACKAGE = 0, /*!< ... from package name db search. */ + RPMQV_PATH, /*!< ... from file path db search. */ + RPMQV_ALL, /*!< ... from each installed package. */ + RPMQV_RPM, /*!< ... from reading binary rpm package. */ + RPMQV_GROUP = RPMTAG_GROUP, + RPMQV_WHATPROVIDES, /*!< ... from provides db search. */ + RPMQV_WHATREQUIRES, /*!< ... from requires db search. */ + RPMQV_TRIGGEREDBY = RPMTAG_TRIGGERNAME, + RPMQV_DBOFFSET, /*!< ... from database header instance. */ + RPMQV_SPECFILE, /*!< ... from spec file parse (query only). */ + RPMQV_PKGID, /*!< ... from package id (header+payload MD5). */ + RPMQV_HDRID, /*!< ... from header id (immutable header SHA1). */ + RPMQV_FILEID, /*!< ... from file id (file digest, usually MD5). */ + RPMQV_TID, /*!< ... from install transaction id (time stamp). */ + RPMQV_HDLIST, /*!< ... from system hdlist. */ + RPMQV_FTSWALK, /*!< ... from fts(3) walk. */ + RPMQV_WHATNEEDS, /*!< ... from requires using contained provides. */ + RPMQV_SPECSRPM, /*!< ... srpm from spec file parse (query only). */ + RPMQV_SOURCEPKGID, /*!< ... from source package id (header+payload MD5). */ + RPMQV_WHATCONFLICTS = RPMTAG_CONFLICTNAME, + RPMQV_WHATOBSOLETES = RPMTAG_OBSOLETENAME +} rpmQVSources; + +/** \ingroup rpmcli + * Bit(s) for rpmVerifyFile() attributes and result. + */ +typedef enum rpmVerifyAttrs_e { + RPMVERIFY_NONE = 0, /*!< */ + RPMVERIFY_FDIGEST = (1 << 0), /*!< from %verify(digest) */ + RPMVERIFY_FILESIZE = (1 << 1), /*!< from %verify(size) */ + RPMVERIFY_LINKTO = (1 << 2), /*!< from %verify(link) */ + RPMVERIFY_USER = (1 << 3), /*!< from %verify(user) */ + RPMVERIFY_GROUP = (1 << 4), /*!< from %verify(group) */ + RPMVERIFY_MTIME = (1 << 5), /*!< from %verify(mtime) */ + RPMVERIFY_MODE = (1 << 6), /*!< from %verify(mode) */ + RPMVERIFY_RDEV = (1 << 7), /*!< from %verify(rdev) */ + RPMVERIFY_CAPS = (1 << 8), /*!< from %verify(caps) (unimplemented) */ + /* bits 9-13 unused, reserved for rpmVerifyAttrs */ + RPMVERIFY_HMAC = (1 << 14), + RPMVERIFY_CONTEXTS = (1 << 15), /*!< verify: from --nocontexts */ + /* bits 16-22 used in rpmVerifyFlags */ + /* bits 23-27 used in rpmQueryFlags */ + RPMVERIFY_READLINKFAIL= (1 << 28), /*!< readlink failed */ + RPMVERIFY_READFAIL = (1 << 29), /*!< file read failed */ + RPMVERIFY_LSTATFAIL = (1 << 30), /*!< lstat failed */ + RPMVERIFY_LGETFILECONFAIL = (1 << 31) /*!< lgetfilecon failed */ +} rpmVerifyAttrs; +#define RPMVERIFY_ALL ((rpmVerifyAttrs)~(RPMVERIFY_NONE)) +#define RPMVERIFY_FAILURES \ + (RPMVERIFY_LSTATFAIL|RPMVERIFY_READFAIL|RPMVERIFY_READLINKFAIL|RPMVERIFY_LGETFILECONFAIL) + +/** \ingroup rpmcli + * Bit(s) to control rpmQuery() operation, stored in qva_flags. + * @todo Merge rpmQueryFlags, rpmVerifyFlags, and rpmVerifyAttrs?. + */ +typedef enum rpmQueryFlags_e { +/*@-enummemuse@*/ + QUERY_FOR_DEFAULT = 0, /*!< */ + QUERY_FDIGEST = (1 << 0), /*!< from --nofdigest */ + QUERY_SIZE = (1 << 1), /*!< from --nosize */ + QUERY_LINKTO = (1 << 2), /*!< from --nolink */ + QUERY_USER = (1 << 3), /*!< from --nouser) */ + QUERY_GROUP = (1 << 4), /*!< from --nogroup) */ + QUERY_MTIME = (1 << 5), /*!< from --nomtime) */ + QUERY_MODE = (1 << 6), /*!< from --nomode) */ + QUERY_RDEV = (1 << 7), /*!< from --nodev */ + QUERY_CAPS = (1 << 8), /*!< (unimplemented) */ + /* bits 9-13 unused, reserved for rpmVerifyAttrs */ + QUERY_HMAC = (1 << 14), + QUERY_CONTEXTS = (1 << 15), /*!< verify: from --nocontexts */ + QUERY_FILES = (1 << 16), /*!< verify: from --nofiles */ + QUERY_DEPS = (1 << 17), /*!< verify: from --nodeps */ + QUERY_SCRIPT = (1 << 18), /*!< verify: from --noscripts */ + QUERY_DIGEST = (1 << 19), /*!< verify: from --nodigest */ + QUERY_SIGNATURE = (1 << 20), /*!< verify: from --nosignature */ + QUERY_PATCHES = (1 << 21), /*!< verify: from --nopatches */ + QUERY_HDRCHK = (1 << 22), /*!< verify: from --nohdrchk */ +/*@=enummemuse@*/ + QUERY_FOR_LIST = (1 << 23), /*!< query: from --list */ + QUERY_FOR_STATE = (1 << 24), /*!< query: from --state */ + QUERY_FOR_DOCS = (1 << 25), /*!< query: from --docfiles */ + QUERY_FOR_CONFIG = (1 << 26), /*!< query: from --configfiles */ + QUERY_FOR_DUMPFILES = (1 << 27) /*!< query: from --dump */ +} rpmQueryFlags; + +#define _QUERY_FOR_BITS \ + (QUERY_FOR_LIST|QUERY_FOR_STATE|QUERY_FOR_DOCS|QUERY_FOR_CONFIG|\ + QUERY_FOR_DUMPFILES) + +/** \ingroup rpmcli + * Bit(s) from common command line options. + */ +/*@unchecked@*/ +extern rpmQueryFlags rpmcliQueryFlags; + +/** \ingroup rpmcli + * Bit(s) to control rpmVerify() operation, stored in qva_flags. + * @todo Merge rpmQueryFlags, rpmVerifyFlags, and rpmVerifyAttrs values?. + */ +typedef enum rpmVerifyFlags_e { +/*@-enummemuse@*/ + VERIFY_DEFAULT = 0, /*!< */ +/*@=enummemuse@*/ + VERIFY_FDIGEST = (1 << 0), /*!< from --nofdigest */ + VERIFY_SIZE = (1 << 1), /*!< from --nosize */ + VERIFY_LINKTO = (1 << 2), /*!< from --nolinkto */ + VERIFY_USER = (1 << 3), /*!< from --nouser */ + VERIFY_GROUP = (1 << 4), /*!< from --nogroup */ + VERIFY_MTIME = (1 << 5), /*!< from --nomtime */ + VERIFY_MODE = (1 << 6), /*!< from --nomode */ + VERIFY_RDEV = (1 << 7), /*!< from --nodev */ + VERIFY_CAPS = (1 << 8), /*!< (unimplemented) */ + /* bits 9-13 unused, reserved for rpmVerifyAttrs */ + VERIFY_HMAC = (1 << 14), + VERIFY_CONTEXTS = (1 << 15), /*!< verify: from --nocontexts */ + VERIFY_FILES = (1 << 16), /*!< verify: from --nofiles */ + VERIFY_DEPS = (1 << 17), /*!< verify: from --nodeps */ + VERIFY_SCRIPT = (1 << 18), /*!< verify: from --noscripts */ + VERIFY_DIGEST = (1 << 19), /*!< verify: from --nodigest */ + VERIFY_SIGNATURE = (1 << 20), /*!< verify: from --nosignature */ + VERIFY_PATCHES = (1 << 21), /*!< verify: from --nopatches */ + VERIFY_HDRCHK = (1 << 22), /*!< verify: from --nohdrchk */ +/*@-enummemuse@*/ + VERIFY_FOR_LIST = (1 << 23), /*!< query: from --list */ + VERIFY_FOR_STATE = (1 << 24), /*!< query: from --state */ + VERIFY_FOR_DOCS = (1 << 25), /*!< query: from --docfiles */ + VERIFY_FOR_CONFIG = (1 << 26), /*!< query: from --configfiles */ + VERIFY_FOR_DUMPFILES= (1 << 27) /*!< query: from --dump */ +/*@=enummemuse@*/ + /* bits 28-31 used in rpmVerifyAttrs */ +} rpmVerifyFlags; + +#define VERIFY_ATTRS \ + ( VERIFY_FDIGEST | VERIFY_SIZE | VERIFY_LINKTO | VERIFY_USER | VERIFY_GROUP | \ + VERIFY_MTIME | VERIFY_MODE | VERIFY_RDEV | VERIFY_HMAC | VERIFY_CONTEXTS ) +#define VERIFY_ALL \ + ( VERIFY_ATTRS | VERIFY_FILES | VERIFY_DEPS | VERIFY_SCRIPT | VERIFY_DIGEST |\ + VERIFY_SIGNATURE | VERIFY_HDRCHK ) + +/** \ingroup rpmcli + */ +typedef struct rpmQVKArguments_s * QVA_t; + +/** \ingroup rpmcli + * Function to display iterator matches. + * + * @param qva parsed query/verify options + * @param ts transaction set + * @param h header to use for query/verify + * @return 0 on success + */ +typedef int (*QVF_t) (QVA_t qva, rpmts ts, Header h) + /*@globals fileSystem @*/ + /*@modifies qva, ts, fileSystem @*/; + +/** \ingroup rpmcli + * Function to query spec file. + * + * @param ts transaction set + * @param qva parsed query/verify options + * @param arg query argument + * @return 0 on success + */ +typedef int (*QSpecF_t) (rpmts ts, QVA_t qva, const char * arg) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies ts, qva, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +/** \ingroup rpmcli + */ +/*@unchecked@*/ +extern struct poptOption rpmQVSourcePoptTable[]; + +/** \ingroup rpmcli + */ +/*@unchecked@*/ +extern int specedit; + +/** \ingroup rpmcli + */ +/*@unchecked@*/ +extern struct poptOption rpmQueryPoptTable[]; + +/** \ingroup rpmcli + */ +/*@unchecked@*/ +extern struct poptOption rpmVerifyPoptTable[]; + +/** \ingroup rpmcli + * Common query/verify source interface, called once for each CLI arg. + * + * This routine uses: + * - qva->qva_mi rpm database iterator + * - qva->qva_showPackage query/verify display routine + * + * @param qva parsed query/verify options + * @param ts transaction set + * @param arg name of source to query/verify + * @return showPackage() result, 1 if rpmmiInit() is NULL + */ +int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies qva, ts, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +/** \ingroup rpmcli + * Display results of package query. + * @todo Devise a meaningful return code. + * @param qva parsed query/verify options + * @param ts transaction set + * @param h header to use for query + * @return 0 always + */ +int showQueryPackage(QVA_t qva, rpmts ts, Header h) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmcli + * Iterate over query/verify arg list. + * @param ts transaction set + * @param qva parsed query/verify options + * @param argv query argument(s) (or NULL) + * @return 0 on success, else no. of failures + */ +int rpmcliArgIter(rpmts ts, QVA_t qva, /*@null@*/ const char ** argv) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies ts, qva, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +/** \ingroup rpmcli + * Display package information. + * @todo hack: RPMQV_ALL can pass char ** arglist = NULL, not char * arg. Union? + * @param ts transaction set + * @param qva parsed query/verify options + * @param argv query argument(s) (or NULL) + * @return 0 on success, else no. of failures + */ +int rpmcliQuery(rpmts ts, QVA_t qva, /*@null@*/ const char ** argv) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies ts, qva, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +/** \ingroup rpmcli + * Display results of package verify. + * @param qva parsed query/verify options + * @param ts transaction set + * @param h header to use for verify + * @return result of last non-zero verify return + */ +int showVerifyPackage(QVA_t qva, rpmts ts, Header h) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** + * Check package and header signatures. + * @param qva parsed query/verify options + * @param ts transaction set + * @param _fd package file handle + * @param fn package file name + * @return 0 on success, 1 on failure + */ +int rpmVerifySignatures(QVA_t qva, rpmts ts, void * _fd, const char * fn) + /*@globals fileSystem, internalState @*/ + /*@modifies qva, ts, fileSystem, internalState @*/; + +/** \ingroup rpmcli + * Verify package install. + * @todo hack: RPMQV_ALL can pass char ** arglist = NULL, not char * arg. Union? + * @param ts transaction set + * @param qva parsed query/verify options + * @param argv verify argument(s) (or NULL) + * @return 0 on success, else no. of failures + */ +int rpmcliVerify(rpmts ts, QVA_t qva, /*@null@*/ const char ** argv) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies ts, qva, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +/*@}*/ +/* ==================================================================== */ +/** \name RPMEIU */ +/*@{*/ +/* --- install/upgrade/erase modes */ + +/** \ingroup rpmcli + * Bit(s) to control rpmcliInstall() and rpmErase() operation. + */ +typedef enum rpmInstallInterfaceFlags_e { + INSTALL_NONE = 0, + INSTALL_PERCENT = (1 << 0), /*!< from --percent */ + INSTALL_HASH = (1 << 1), /*!< from --hash */ + INSTALL_NODEPS = (1 << 2), /*!< from --nodeps */ + INSTALL_NOORDER = (1 << 3), /*!< from --noorder */ + INSTALL_LABEL = (1 << 4), /*!< from --verbose (notify) */ + INSTALL_UPGRADE = (1 << 5), /*!< from --upgrade */ + INSTALL_FRESHEN = (1 << 6), /*!< from --freshen */ + INSTALL_INSTALL = (1 << 7), /*!< from --install */ + INSTALL_ERASE = (1 << 8), /*!< from --erase */ + INSTALL_ALLMATCHES = (1 << 9) /*!< from --allmatches (erase) */ +} rpmInstallInterfaceFlags; + +/*@-redecl@*/ +/*@unchecked@*/ +extern int rpmcliPackagesTotal; +/*@=redecl@*/ +/*@unchecked@*/ +extern int rpmcliHashesCurrent; +/*@unchecked@*/ +extern int rpmcliHashesTotal; +/*@unchecked@*/ +extern rpmuint64_t rpmcliProgressCurrent; +/*@unchecked@*/ +extern rpmuint64_t rpmcliProgressTotal; + +/** \ingroup rpmcli + * The rpm CLI generic transaction callback handler. + * @todo Remove headerSprintf() from the progress callback. + * @warning This function's args have changed, so the function cannot be + * used portably + * @deprecated Transaction callback arguments need to change, so don't rely on + * this routine in the rpmcli API. + * + * @param arg per-callback private data (e.g. an rpm header) + * @param what callback identifier + * @param amount per-callback progress info + * @param total per-callback progress info + * @param key opaque header key (e.g. file name or PyObject) + * @param data private data (e.g. rpmInstallInterfaceFlags) + * @return per-callback data (e.g. an opened FD_t) + */ +/*@null@*/ +void * rpmShowProgress(/*@null@*/ const void * arg, + const rpmCallbackType what, + const rpmuint64_t amount, + const rpmuint64_t total, + /*@null@*/ fnpyKey key, + /*@null@*/ void * data) + /*@globals rpmcliHashesCurrent, + rpmcliProgressCurrent, rpmcliProgressTotal, + h_errno, rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@modifies arg, rpmcliHashesCurrent, + rpmcliProgressCurrent, rpmcliProgressTotal, + rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmcli + * Install source rpm package. + * @param ts transaction set + * @param arg source rpm file name + * @retval *specFilePtr (installed) spec file name + * @retval *cookie + * @return 0 on success + */ +int rpmInstallSource(rpmts ts, const char * arg, + /*@null@*/ /*@out@*/ const char ** specFilePtr, + /*@null@*/ /*@out@*/ const char ** cookie) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState@*/ + /*@modifies ts, *specFilePtr, *cookie, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +/** \ingroup rpmcli + * Report package problems (if any). + * @param ts transaction set + * @param msg problem context string to display + * @param rc result of a tranbsaction operation + * @return no. of (added) packages + */ +int rpmcliInstallProblems(rpmts ts, /*@null@*/ const char * msg, int rc) + /*@globals fileSystem, internalState @*/ + /*@modifies ts, fileSystem, internalState @*/; + +/** \ingroup rpmcli + * Report packages(if any) that satisfy unresolved dependencies. + * @param ts transaction set + * @return 0 always + */ +int rpmcliInstallSuggests(rpmts ts) + /*@globals internalState @*/ + /*@modifies ts, internalState @*/; + +/** \ingroup rpmcli + * Check package element dependencies in a transaction set, reporting problems. + * @param ts transaction set + * @return no. of (added) packages + */ +int rpmcliInstallCheck(rpmts ts) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmcli + * Order package elements in a transaction set, reporting problems. + * @param ts transaction set + * @return no. of (added) packages + */ +int rpmcliInstallOrder(rpmts ts) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmcli + * Install/erase package elements in a transaction set, reporting problems. + * @param ts transaction set + * @param okProbs previously known problems (or NULL) + * @param ignoreSet bits to filter problem types + * @return 0 on success, -1 on error, >0 no, of failed elements + */ +int rpmcliInstallRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmcli + * Install/upgrade/freshen binary rpm package. + * @todo Use rpmdsCompare rather than rpmVersionCompare. + * @param ts transaction set + * @param ia mode flags and parameters + * @param argv array of package file names (NULL terminated) + * @return 0 on success + */ +int rpmcliInstall(rpmts ts, QVA_t ia, /*@null@*/ const char ** argv) + /*@globals rpmcliPackagesTotal, rpmGlobalMacroContext, h_errno, + fileSystem, internalState@*/ + /*@modifies ts, ia, rpmcliPackagesTotal, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +/** \ingroup rpmcli + * Erase binary rpm package. + * @param ts transaction set + * @param ia control args/bits + * @param argv array of package names (NULL terminated) + * @return 0 on success + */ +int rpmErase(rpmts ts, QVA_t ia, /*@null@*/ const char ** argv) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, ia, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +/** \ingroup rpmcli + */ +/*@unchecked@*/ +extern struct poptOption rpmInstallPoptTable[]; + +/*@}*/ +/* ==================================================================== */ +/** \name RPMDB */ +/*@{*/ + +/** \ingroup rpmcli + */ +/*@unchecked@*/ +extern struct poptOption rpmDatabasePoptTable[]; + +/*@}*/ +/* ==================================================================== */ +/** \name RPMK */ +/*@{*/ + +/** \ingroup rpmcli + * Import public key packet(s). + * @todo Implicit --update policy for gpg-pubkey headers. + * @param ts transaction set + * @param pkt pgp pubkey packet(s) + * @param pktlen pgp pubkey length + * @return RPMRC_OK/RPMRC_FAIL + */ +rpmRC rpmcliImportPubkey(const rpmts ts, + const unsigned char * pkt, ssize_t pktlen) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +/** \ingroup rpmcli + * Bit(s) to control rpmReSign() operation. + */ +/*@-typeuse@*/ +#if !defined(SWIG) +typedef enum rpmSignFlags_e { + RPMSIGN_NONE = 0, + RPMSIGN_CHK_SIGNATURE = 'K', /*!< from --checksig */ + RPMSIGN_NEW_SIGNATURE = 'R', /*!< from --resign */ + RPMSIGN_ADD_SIGNATURE = 'A', /*!< from --addsign */ + RPMSIGN_DEL_SIGNATURE = 'D', /*!< from --delsign */ + RPMSIGN_IMPORT_PUBKEY = 'I', /*!< from --import */ +} rpmSignFlags; +#endif +/*@=typeuse@*/ + +/** \ingroup rpmcli + */ +/*@unchecked@*/ +extern struct poptOption rpmSignPoptTable[]; + +/** \ingroup rpmcli + * Create/Modify/Check elements from signature header. + * @param ts transaction set + * @param qva mode flags and parameters + * @param argv array of arguments (NULL terminated) + * @return 0 on success + */ +int rpmcliSign(rpmts ts, QVA_t qva, /*@null@*/ const char ** argv) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies ts, qva, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +/*@}*/ + +/** \ingroup rpmcli + * Command line option information. + */ +#if !defined(SWIG) +struct rpmQVKArguments_s { + rpmQVSources qva_source; /*!< Identify CLI arg type. */ + int qva_sourceCount;/*!< Exclusive option check (>1 is error). */ + rpmQueryFlags qva_flags; /*!< Bit(s) to control operation. */ + rpmfileAttrs qva_fflags; /*!< Bit(s) to filter on attribute. */ +/*@only@*/ /*@null@*/ + rpmmi qva_mi; /*!< Match iterator on selected headers. */ +/*@refccounted@*/ /*@relnull@*/ + rpmgi qva_gi; /*!< Generalized iterator on args. */ + rpmRC qva_rc; /*!< Current return code. */ + +/*@null@*/ + QVF_t qva_showPackage; /*!< Function to display iterator matches. */ + int qva_showOK; /*!< No. of successes. */ + int qva_showFAIL; /*!< No. of failures. */ +/*@null@*/ + QSpecF_t qva_specQuery; /*!< Function to query spec file. */ +/*@unused@*/ + int qva_verbose; /*!< (unused) */ +/*@only@*/ /*@null@*/ + const char * qva_queryFormat;/*!< Format for headerSprintf(). */ + int sign; /*!< Is a passphrase needed? */ + int nopassword; + int trust; /*!< Trust metric when importing pubkeys. */ +/*@observer@*/ + const char * passPhrase; /*!< Pass phrase. */ +/*@owned@*/ /*@null@*/ + const char * qva_prefix; /*!< Path to top of install tree. */ + char qva_mode; + /*!< + - 'q' from --query, -q + - 'Q' from --querytags + - 'V' from --verify, -V + - 'A' from --addsign + - 'I' from --import + - 'K' from --checksig, -K + - 'R' from --resign + */ + char qva_char; /*!< (unused) always ' ' */ + + /* install/erase mode arguments */ + rpmdepFlags depFlags; + rpmtransFlags transFlags; + rpmprobFilterFlags probFilter; + rpmInstallInterfaceFlags installInterfaceFlags; + rpmuint32_t arbtid; /*!< from --arbgoal */ + rpmuint32_t rbtid; /*!< from --rollback */ + rpmuint32_t *rbtidExcludes; /*!< from --rollback */ + int numrbtidExcludes; /*!< from --rollback */ + int noDeps; + int incldocs; + int no_rollback_links; +/*@owned@*/ /*@relnull@*/ + rpmRelocation relocations; + int nrelocations; + + /* database mode arguments */ + int rebuild; /*!< from --rebuilddb */ + + /* rollback vectors */ + int (*rbCheck) (rpmts ts); + int (*rbOrder) (rpmts ts); + int (*rbRun) (rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet); +}; +#endif + +/** \ingroup rpmcli + */ +/*@unchecked@*/ +extern struct rpmQVKArguments_s rpmQVKArgs; + +/** \ingroup rpmcli + */ +/*@unchecked@*/ +extern struct rpmQVKArguments_s rpmIArgs; + +/** \ingroup rpmcli + */ +/*@unchecked@*/ +extern struct rpmQVKArguments_s rpmDBArgs; + +/* ==================================================================== */ +/** \name RPMBT */ +/*@{*/ + +/** \ingroup rpmcli + * Describe build command line request. + */ +struct rpmBuildArguments_s { + rpmQueryFlags qva_flags; /*!< Bit(s) to control verification. */ + int buildAmount; /*!< Bit(s) to control operation. */ +/*@observer@*/ + const char * passPhrase; /*!< Pass phrase. */ +/*@only@*/ /*@null@*/ + const char * cookie; /*!< NULL for binary, ??? for source, rpm's */ + const char * specFile; /*!< from --rebuild/--recompile build */ + int noBuild; /*!< from --nobuild */ + int noDeps; /*!< from --nodeps */ + int noLang; /*!< from --nolang */ + int shortCircuit; /*!< from --short-circuit */ + int sign; /*!< from --sign */ + int nopassword; + char buildMode; /*!< Build mode (one of "btBC") */ + char buildChar; /*!< Build stage (one of "abcilps ") */ +/*@observer@*/ /*@null@*/ + const char * rootdir; +}; + +/** \ingroup rpmcli + */ +typedef struct rpmBuildArguments_s * BTA_t; + +/** \ingroup rpmcli + */ +/*@unchecked@*/ +extern struct rpmBuildArguments_s rpmBTArgs; + +/** \ingroup rpmcli + */ +/*@unchecked@*/ +extern struct poptOption rpmBuildPoptTable[]; + +/*@}*/ + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMCLI */ diff --git a/rpm-5.4.9/lib/rpmds.c b/rpm-5.4.9/lib/rpmds.c new file mode 100644 index 0000000..e5b9a91 --- /dev/null +++ b/rpm-5.4.9/lib/rpmds.c @@ -0,0 +1,4334 @@ +/** \ingroup rpmds + * \file lib/rpmds.c + */ +#include "system.h" + +#if defined(WITH_CPUINFO) +#include +#endif + +#if defined(HAVE_GELF_H) && !defined(__FreeBSD__) +#if LIBELF_H_LFS_CONFLICT +/* Some implementations of libelf.h/gelf.h are incompatible with + * the Large File API. + */ +# undef _LARGEFILE64_SOURCE +# undef _LARGEFILE_SOURCE +# undef _FILE_OFFSET_BITS +# define _FILE_OFFSET_BITS 32 +#endif + +#if defined(__LCLINT__) +typedef long long loff_t; +#endif +#include +/* + * On Solaris, gelf.h included libelf.h, which #undef'ed the gettext + * convenience macro _(). Repair by repeating (from system.h) just + * the bits that are needed for _() to function. + */ + +#if defined(__sun) +#if defined(ENABLE_NLS) && !defined(__LCLINT__) +# define _(Text) gettext (Text) +#else +# define _(Text) Text +#endif /* gettext _() fixup */ +#endif +#endif /* HAVE_GELF_H */ + +#if defined(HAVE_LIBELF) && !defined(HAVE_GELF_GETVERNAUX) && !defined(__FreeBSD__) +/* We have gelf.h and libelf, but we don't have some of the + * helper functions gelf_getvernaux(), gelf_getverneed(), etc. + * Provide our own simple versions here. + */ + +static GElf_Verdef *gelf_getverdef(Elf_Data *data, int offset, + GElf_Verdef *dst) +{ + return (GElf_Verdef *) ((char *) data->d_buf + offset); +} + +static GElf_Verdaux *gelf_getverdaux(Elf_Data *data, int offset, + GElf_Verdaux *dst) +{ + return (GElf_Verdaux *) ((char *) data->d_buf + offset); +} + +static GElf_Verneed *gelf_getverneed(Elf_Data *data, int offset, + GElf_Verneed *dst) +{ + return (GElf_Verneed *) ((char *) data->d_buf + offset); +} + +static GElf_Vernaux *gelf_getvernaux(Elf_Data *data, int offset, + GElf_Vernaux *dst) +{ + return (GElf_Vernaux *) ((char *) data->d_buf + offset); +} + +/* Most non-Linux systems won't have SHT_GNU_verdef or SHT_GNU_verneed, + * but they might have something mostly-equivalent. Solaris has + * SHT_SUNW_{verdef,verneed} + */ +#if !defined(SHT_GNU_verdef) && defined(__sun) && defined(SHT_SUNW_verdef) +# define SHT_GNU_verdef SHT_SUNW_verdef +# define SHT_GNU_verneed SHT_SUNW_verneed +#endif + +#endif /* HAVE_LIBELF && !HAVE_GELF_GETVERNAUX */ + +#if !defined(DT_GNU_HASH) +#define DT_GNU_HASH 0x6ffffef5 +#endif + +#define _RPMIOB_INTERNAL +#include +#include /* XXX fdGetFILE */ +#include /* XXX fnpyKey */ +#include +#include +#include + +#include +#include + +#define _RPMDS_INTERNAL +#define _RPMEVR_INTERNAL +#define _RPMPRCO_INTERNAL +#include + +#include "debug.h" + +/*@access rpmns @*/ +/*@access EVR_t @*/ + +#ifdef __cplusplus +GENfree(evrFlags *) +GENfree(rpmuint32_t *) +GENfree(rpmint32_t *) +GENfree(rpmPRCO) +#endif /* __cplusplus */ + +#define _isspace(_c) \ + ((_c) == ' ' || (_c) == '\t' || (_c) == '\r' || (_c) == '\n') + +/** + * Enable noisy range comparison debugging message? + */ +/*@unchecked@*/ +static int _noisy_range_comparison_debug_message = 0; + +/*@unchecked@*/ +int _rpmds_debug = 0; + +/*@unchecked@*/ +int _rpmds_nopromote = 1; + +/*@unchecked@*/ +/*@-exportheadervar@*/ +int _rpmds_unspecified_epoch_noise = 0; +/*@=exportheadervar@*/ + +/** + * Return dependency set type string. + * @param tagN dependency set tag + * @return dependency set type string + */ +/*@observer@*/ +static const char * rpmdsTagName(rpmTag tagN) + /*@*/ +{ + const char * Type; + + /* XXX Preserve existing names in debugging messages. */ + switch (tagN) { + default: Type = tagName(tagN); break; + case RPMTAG_PROVIDENAME: Type = "Provides"; break; + case RPMTAG_REQUIRENAME: Type = "Requires"; break; + case RPMTAG_CONFLICTNAME: Type = "Conflicts"; break; + case RPMTAG_OBSOLETENAME: Type = "Obsoletes"; break; + case RPMTAG_TRIGGERNAME: Type = "Triggers"; break; + case RPMTAG_SUGGESTSNAME: Type = "Suggests"; break; + case RPMTAG_ENHANCESNAME: Type = "Enhances"; break; + case RPMTAG_DIRNAMES: Type = "Dirs"; break; + case RPMTAG_BASENAMES: Type = "Files"; break; + case RPMTAG_FILELINKTOS: Type = "Linktos"; break; + case 0: Type = "Unknown"; break; + } + return Type; +} + +const char * rpmdsType(const rpmds ds) +{ + return rpmdsTagName(rpmdsTagN(ds)); +} + +static void rpmdsFini(void * _ds) +{ + rpmds ds = (rpmds) _ds; + + if (ds->Count > 0) { + ds->N = _free(ds->N); + ds->EVR = _free(ds->EVR); + ds->Flags = _free(ds->Flags); + (void)headerFree(ds->h); + ds->h = NULL; + } + + ds->DNEVR = _free(ds->DNEVR); + ds->ns.str = _free(ds->ns.str); + memset(&ds->ns, 0, sizeof(ds->ns)); + ds->A = _free(ds->A); + ds->Color = _free(ds->Color); + ds->Refs = _free(ds->Refs); + ds->Result = _free(ds->Result); + ds->exclude = (miRE) mireFreeAll(ds->exclude, ds->nexclude); + ds->include = (miRE) mireFreeAll(ds->include, ds->ninclude); +} + +/*@unchecked@*/ /*@only@*/ /*@null@*/ +rpmioPool _rpmdsPool; + +static rpmds rpmdsGetPool(/*@null@*/ rpmioPool pool) + /*@globals _rpmdsPool, fileSystem, internalState @*/ + /*@modifies pool, _rpmdsPool, fileSystem, internalState @*/ +{ + rpmds ds; + + if (_rpmdsPool == NULL) { + _rpmdsPool = rpmioNewPool("ds", sizeof(*ds), -1, _rpmds_debug, + NULL, NULL, rpmdsFini); + pool = _rpmdsPool; + } + ds = (rpmds) rpmioGetPool(pool, sizeof(*ds)); + memset(((char *)ds)+sizeof(ds->_item), 0, sizeof(*ds)-sizeof(ds->_item)); + return ds; +} + +static /*@null@*/ +const char ** rpmdsDupArgv(/*@null@*/ const char ** argv, int argc) + /*@*/ +{ + const char ** av; + size_t nb = 0; + int ac = 0; + char * t; + + if (argv == NULL) + return NULL; + for (ac = 0; ac < argc; ac++) { +assert(argv[ac] != NULL); + nb += strlen(argv[ac]) + 1; + } + nb += (ac + 1) * sizeof(*av); + + av = (const char **) xmalloc(nb); + t = (char *) (av + ac + 1); + for (ac = 0; ac < argc; ac++) { + av[ac] = t; + t = stpcpy(t, argv[ac]) + 1; + } + av[ac] = NULL; +/*@-nullret@*/ + return av; +/*@=nullret@*/ +} + +rpmds rpmdsNew(Header h, rpmTag tagN, int flags) +{ + int scareMem = (flags & 0x1); + int delslash = 1; + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmTag tagEVR, tagF; + rpmds ds = NULL; + const char * Type = NULL; + const char ** N; + rpmuint32_t Count; + int xx; + +assert(scareMem == 0); /* XXX always allocate memory */ + + if (tagN == RPMTAG_NAME) + return rpmdsThis(h, tagN, RPMSENSE_EQUAL); + + switch (tagN) { + default: + goto exit; + /*@notreached@*/ break; + case RPMTAG_PROVIDENAME: + tagEVR = RPMTAG_PROVIDEVERSION; + tagF = RPMTAG_PROVIDEFLAGS; + break; + case RPMTAG_REQUIRENAME: + tagEVR = RPMTAG_REQUIREVERSION; + tagF = RPMTAG_REQUIREFLAGS; + break; + case RPMTAG_CONFLICTNAME: + tagEVR = RPMTAG_CONFLICTVERSION; + tagF = RPMTAG_CONFLICTFLAGS; + break; + case RPMTAG_OBSOLETENAME: + tagEVR = RPMTAG_OBSOLETEVERSION; + tagF = RPMTAG_OBSOLETEFLAGS; + break; + case RPMTAG_TRIGGERNAME: + tagEVR = RPMTAG_TRIGGERVERSION; + tagF = RPMTAG_TRIGGERFLAGS; + break; + case RPMTAG_SUGGESTSNAME: + tagEVR = RPMTAG_SUGGESTSVERSION; + tagF = RPMTAG_SUGGESTSFLAGS; + break; + case RPMTAG_ENHANCESNAME: + tagEVR = RPMTAG_ENHANCESVERSION; + tagF = RPMTAG_ENHANCESFLAGS; + break; + case RPMTAG_DIRNAMES: + tagEVR = (rpmTag) 0; + tagF = (rpmTag) 0; + delslash = (flags & 0x2) ? 0 : 1; + break; + case RPMTAG_BASENAMES: + tagEVR = RPMTAG_DIRNAMES; + tagF = RPMTAG_DIRINDEXES; + break; + case RPMTAG_FILELINKTOS: + tagEVR = RPMTAG_DIRNAMES; + tagF = RPMTAG_DIRINDEXES; + break; + } + + if (Type == NULL) + Type = rpmdsTagName(tagN); + + he->tag = tagN; + xx = headerGet(h, he, 0); + N = he->p.argv; + Count = he->c; + if (xx && N != NULL && Count > 0) { + ds = rpmdsGetPool(_rpmdsPool); + ds->Type = Type; + ds->h = NULL; + ds->i = -1; + ds->DNEVR = NULL; + ds->tagN = tagN; + ds->N = N; + ds->Count = Count; + ds->nopromote = _rpmds_nopromote; + + if (tagEVR > 0) { + he->tag = tagEVR; + xx = headerGet(h, he, 0); + ds->EVR = he->p.argv; + } + if (tagF > 0) { + he->tag = tagF; + xx = headerGet(h, he, 0); + ds->Flags = (evrFlags * ) he->p.ui32p; + } + { + he->tag = RPMTAG_ARCH; + xx = headerGet(h, he, 0); + ds->A = he->p.str; + } + { + he->tag = RPMTAG_BUILDTIME; + xx = headerGet(h, he, 0); + ds->BT = (he->p.ui32p ? he->p.ui32p[0] : 0); + he->p.ptr = _free(he->p.ptr); + } + + if (tagN == RPMTAG_DIRNAMES) { + char * dn; + size_t len; + unsigned i; + /* XXX Dirnames always have trailing '/', trim that here. */ + if (delslash) + for (i = 0; i < Count; i++) { + (void) urlPath(N[i], (const char **)&dn); + if (dn > N[i]) + N[i] = dn; + dn = (char *)N[i]; + len = strlen(dn); + /* XXX don't truncate if parent is / */ + if (len > 1 && dn[len-1] == '/') + dn[len-1] = '\0'; + } + } else + if (tagN == RPMTAG_BASENAMES) { + const char ** av = (const char **) xcalloc(Count+1, sizeof(*av)); + char * dn; + unsigned i; + + for (i = 0; i < Count; i++) { + (void) urlPath(ds->EVR[ds->Flags[i]], (const char **)&dn); + av[i] = rpmGenPath(NULL, dn, N[i]); + } + av[Count] = NULL; + +/*@-unqualifiedtrans@*/ + N = ds->N = _free(ds->N); +/*@=unqualifiedtrans@*/ + N = ds->N = rpmdsDupArgv(av, Count); + av = argvFree(av); + ds->EVR = _free(ds->EVR); + ds->Flags = _free(ds->Flags); + } else + if (tagN == RPMTAG_FILELINKTOS) { + /* XXX Construct the absolute path of the target symlink(s). */ + const char ** av = (const char **) xcalloc(Count+1, sizeof(*av)); + unsigned i; + + for (i = 0; i < Count; i++) { + if (N[i] == NULL || *N[i] == '\0') + av[i] = xstrdup(""); + else if (*N[i] == '/') + av[i] = xstrdup(N[i]); + else if (ds->EVR != NULL && ds->Flags != NULL) + av[i] = rpmGenPath(NULL, ds->EVR[ds->Flags[i]], N[i]); + else + av[i] = xstrdup(""); + } + av[Count] = NULL; + +/*@-unqualifiedtrans@*/ + N = ds->N = _free(ds->N); +/*@=unqualifiedtrans@*/ + N = ds->N = rpmdsDupArgv(av, Count); + av = argvFree(av); + ds->EVR = _free(ds->EVR); + ds->Flags = _free(ds->Flags); + } + +/*@-modfilesys@*/ +if (_rpmds_debug < 0) +fprintf(stderr, "*** ds %p\t%s[%d]\n", ds, ds->Type, ds->Count); +/*@=modfilesys@*/ + + } + +exit: +/*@-compdef -usereleased@*/ /* FIX: ds->Flags may be NULL */ + /*@-nullstate@*/ /* FIX: ds->Flags may be NULL */ + ds = rpmdsLink(ds, (ds ? ds->Type : NULL)); + /*@=nullstate@*/ + + return ds; +/*@=compdef =usereleased@*/ +} + +const char * rpmdsNewN(rpmds ds) +{ + rpmns ns = &ds->ns; + const char * Name = ds->N[ds->i]; + int xx; + + xx = rpmnsParse(Name, ns); + +/*@-compdef -usereleased@*/ /* FIX: correct annotations for ds->ns shadow */ + return ns->N; +/*@=compdef =usereleased@*/ +} + +char * rpmdsNewDNEVR(const char * dspfx, rpmds ds) +{ + const char * N = rpmdsNewN(ds); + const char * NS = ds->ns.NS; + const char * A = ds->ns.A; + evrFlags dsFlags = (evrFlags) 0; + char * tbuf, * t; + size_t nb = 0; + + if (dspfx) nb += strlen(dspfx) + 1; + if (ds->ns.str[0] == '!') nb++; + if (NS) nb += strlen(NS) + sizeof("()") - 1; + if (N) nb += strlen(N); + if (A) { + if (_rpmns_N_at_A && _rpmns_N_at_A[0]) + nb += sizeof(_rpmns_N_at_A[0]); + nb += strlen(A); + } + /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */ + if (ds->Flags != NULL + && (dsFlags = (evrFlags) (ds->Flags[ds->i] & RPMSENSE_SENSEMASK))) + { + if (nb) nb++; + if (dsFlags == RPMSENSE_NOTEQUAL) + nb += 2; + else { + if (dsFlags & RPMSENSE_LESS) nb++; + if (dsFlags & RPMSENSE_GREATER) nb++; + if (dsFlags & RPMSENSE_EQUAL) nb++; + } + } + + ds->ns.Flags = dsFlags; + + /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */ + if (ds->EVR != NULL && ds->EVR[ds->i] && *ds->EVR[ds->i]) { + if (nb) nb++; + nb += strlen(ds->EVR[ds->i]); + } + + t = tbuf = (char *) xmalloc(nb + 1); + if (dspfx) { + t = stpcpy(t, dspfx); + *t++ = ' '; + } + if (ds->ns.str[0] == '!') + *t++ = '!'; + if (NS) + t = stpcpy( stpcpy(t, NS), "("); + if (N) + t = stpcpy(t, N); + if (NS) + t = stpcpy(t, ")"); + if (A) { + if (_rpmns_N_at_A && _rpmns_N_at_A[0]) + *t++ = _rpmns_N_at_A[0]; + t = stpcpy(t, A); + } + + /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */ + if (ds->Flags != NULL && (ds->Flags[ds->i] & RPMSENSE_SENSEMASK)) { + if (t != tbuf) *t++ = ' '; + if (dsFlags == RPMSENSE_NOTEQUAL) + t = stpcpy(t, "!="); + else { + if (dsFlags & RPMSENSE_LESS) *t++ = '<'; + if (dsFlags & RPMSENSE_GREATER) *t++ = '>'; + if (dsFlags & RPMSENSE_EQUAL) *t++ = '='; + } + } + /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */ + if (ds->EVR != NULL && ds->EVR[ds->i] && *ds->EVR[ds->i]) { + if (t != tbuf) *t++ = ' '; + t = stpcpy(t, ds->EVR[ds->i]); + } + *t = '\0'; + return tbuf; +} + +rpmds rpmdsThis(Header h, rpmTag tagN, evrFlags Flags) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmds ds = NULL; + const char * Type; + const char * Name, * V, * R; +#ifdef RPM_VENDOR_MANDRIVA + const char * D = NULL; +#endif + rpmuint32_t E; + const char ** N, ** EVR; + char * t; + size_t nb; + int xx; + + if (tagN == RPMTAG_NAME) + tagN = RPMTAG_PROVIDENAME; + + Type = rpmdsTagName(tagN); + + he->tag = RPMTAG_EPOCH; + xx = headerGet(h, he, 0); + E = (he->p.ui32p ? he->p.ui32p[0] : 0); + he->p.ptr = _free(he->p.ptr); + +#if defined(RPM_VENDOR_MANDRIVA) + he->tag = RPMTAG_DISTEPOCH; + xx = headerGet(h, he, 0); + D = (he->p.str ? he->p.str : NULL); +#endif +/*@-mods@*/ + xx = headerNEVRA(h, &Name, NULL, &V, &R, NULL); +/*@=mods@*/ + /* XXX segfault avoidance */ + if (Name == NULL) Name = xstrdup("N"); + if (V == NULL) V = xstrdup("V"); + if (R == NULL) R = xstrdup("R"); + + t = (char *) xmalloc(sizeof(*N) + strlen(Name) + 1); + N = (const char **) t; + t += sizeof(*N); + *t = '\0'; + N[0] = t; + t = stpcpy(t, Name); + Name = _free(Name); + + nb = sizeof(*EVR) + 20 + strlen(V) + strlen(R) + sizeof("-"); +#if defined(RPM_VENDOR_MANDRIVA) + nb += (D ? strlen(D) + sizeof(":") : 0); +#endif + t = (char *) xmalloc(nb); + EVR = (const char **) t; + t += sizeof(*EVR); + *t = '\0'; + EVR[0] = t; + sprintf(t, "%d:", E); + t += strlen(t); + t = stpcpy( stpcpy( stpcpy( t, V), "-"), R); +#if defined(RPM_VENDOR_MANDRIVA) + if (D != NULL) { + t = stpcpy( stpcpy( t, ":"), D); + D = _free(D); + } +#endif + V = _free(V); + R = _free(R); + + ds = rpmdsGetPool(_rpmdsPool); + ds->Type = Type; + ds->tagN = tagN; + ds->Count = 1; + ds->N = N; + ds->EVR = EVR; + ds->Flags = (evrFlags *) xmalloc(sizeof(*ds->Flags)); ds->Flags[0] = Flags; + + he->tag = RPMTAG_ARCH; + xx = headerGet(h, he, 0); + ds->A = he->p.str; + + he->tag = RPMTAG_BUILDTIME; + xx = headerGet(h, he, 0); + ds->BT = (he->p.ui32p ? he->p.ui32p[0] : 0); + he->p.ptr = _free(he->p.ptr); + + { char pre[2]; + pre[0] = ds->Type[0]; + pre[1] = '\0'; + /*@-nullstate@*/ /* LCL: ds->Type may be NULL ??? */ + ds->i = 0; /* XXX rpmdsNewN() needs ds->i = 0, not -1 */ +/*@i@*/ ds->DNEVR = rpmdsNewDNEVR(pre, ds); + /*@=nullstate@*/ + } + + return rpmdsLink(ds, (ds ? ds->Type : NULL)); +} + +rpmds rpmdsSingle(rpmTag tagN, const char * N, const char * EVR, evrFlags Flags) +{ + rpmds ds = rpmdsGetPool(_rpmdsPool); + const char * Type = rpmdsTagName(tagN); + + ds->Type = Type; + ds->tagN = tagN; + ds->A = NULL; + { time_t now = time(NULL); + ds->BT = (rpmuint32_t)now; + } + ds->Count = 1; + /*@-assignexpose@*/ + ds->N = (const char **) xcalloc(2, sizeof(*ds->N)); ds->N[0] = N; + ds->EVR = (const char **) xcalloc(2, sizeof(*ds->EVR)); ds->EVR[0] = EVR; + /*@=assignexpose@*/ + ds->Flags = (evrFlags *) xmalloc(sizeof(*ds->Flags)); ds->Flags[0] = Flags; + { char t[2]; + t[0] = ds->Type[0]; + t[1] = '\0'; + ds->i = 0; /* XXX rpmdsNewN() needs ds->i = 0, not -1 */ +/*@i@*/ ds->DNEVR = rpmdsNewDNEVR(t, ds); + } + + return rpmdsLink(ds, (ds ? ds->Type : NULL)); +} + +int rpmdsCount(const rpmds ds) +{ + return (ds != NULL ? ds->Count : 0); +} + +int rpmdsIx(const rpmds ds) +{ + return (ds != NULL ? ds->i : -1); +} + +int rpmdsSetIx(rpmds ds, int ix) +{ + int i = -1; + + if (ds != NULL) { + i = ds->i; + ds->i = ix; + } + return i; +} + +const char * rpmdsDNEVR(const rpmds ds) +{ + const char * DNEVR = NULL; + + if (ds != NULL && ds->i >= 0 && ds->i < (int)ds->Count) { + if (ds->DNEVR != NULL) + DNEVR = ds->DNEVR; + } + return DNEVR; +} + +const char * rpmdsN(const rpmds ds) +{ + const char * N = NULL; + + if (ds != NULL && ds->i >= 0 && ds->i < (int)ds->Count) { +/*@-globs -mods @*/ /* FIX: correct annotations for ds->ns shadow */ + N = (ds->ns.N ? ds->ns.N : rpmdsNewN(ds)); +/*@=globs =mods @*/ + } + return N; +} + +const char * rpmdsEVR(const rpmds ds) +{ + const char * EVR = NULL; + + if (ds != NULL && ds->i >= 0 && ds->i < (int)ds->Count) { + if (ds->EVR != NULL) + EVR = ds->EVR[ds->i]; + } + return EVR; +} + +evrFlags rpmdsFlags(const rpmds ds) +{ + evrFlags Flags = (evrFlags) 0; + + if (ds != NULL && ds->i >= 0 && ds->i < (int)ds->Count) { + if (ds->Flags != NULL) + Flags = ds->Flags[ds->i]; + } + return Flags; +} + +rpmTag rpmdsTagN(const rpmds ds) +{ + rpmTag tagN = (rpmTag) 0; + + if (ds != NULL) + tagN = ds->tagN; + return tagN; +} + +const char * rpmdsA(const rpmds ds) +{ + const char * A = NULL; + + if (ds != NULL) + A = ds->A; + return A; +} + +time_t rpmdsBT(const rpmds ds) +{ + time_t BT = 0; + if (ds != NULL && ds->BT > 0) + BT = ds->BT; + return BT; +} + +time_t rpmdsSetBT(const rpmds ds, time_t BT) +{ + time_t oBT = 0; + if (ds != NULL) { + oBT = (time_t)ds->BT; + ds->BT = (rpmuint32_t)BT; + } + return oBT; +} + +nsType rpmdsNSType(const rpmds ds) +{ + nsType NSType = RPMNS_TYPE_UNKNOWN; + if (ds != NULL) + NSType = ds->ns.Type; + return NSType; +} + +int rpmdsNoPromote(const rpmds ds) +{ + int nopromote = 0; + + if (ds != NULL) + nopromote = ds->nopromote; + return nopromote; +} + +int rpmdsSetNoPromote(rpmds ds, int nopromote) +{ + int onopromote = 0; + + if (ds != NULL) { + onopromote = ds->nopromote; + ds->nopromote = nopromote; + } + return onopromote; +} + +void * rpmdsSetEVRparse(rpmds ds, + int (*EVRparse)(const char *evrstr, EVR_t evr)) +{ + void * oEVRparse = NULL; + + if (ds != NULL) { +/*@i@*/ oEVRparse = (void *) ds->EVRparse; +/*@i@*/ ds->EVRparse = EVRparse; + } + return oEVRparse; +} + +void * rpmdsSetEVRcmp(rpmds ds, int (*EVRcmp)(const char *a, const char *b)) +{ + void * oEVRcmp = NULL; + + if (ds != NULL) { +/*@i@*/ oEVRcmp = (void *) ds->EVRcmp; +/*@i@*/ ds->EVRcmp = EVRcmp; + } + return oEVRcmp; +} + +rpmuint32_t rpmdsColor(const rpmds ds) +{ + rpmuint32_t Color = 0; + + if (ds != NULL && ds->i >= 0 && ds->i < (int)ds->Count) { + if (ds->Color != NULL) + Color = ds->Color[ds->i]; + } + return Color; +} + +rpmuint32_t rpmdsSetColor(const rpmds ds, rpmuint32_t color) +{ + rpmuint32_t ocolor = 0; + + if (ds == NULL) + return ocolor; + + if (ds->Color == NULL && ds->Count > 0) /* XXX lazy malloc */ + ds->Color = (rpmuint32_t *) xcalloc(ds->Count, sizeof(*ds->Color)); + + if (ds->i >= 0 && ds->i < (int)ds->Count) { + if (ds->Color != NULL) { + ocolor = ds->Color[ds->i]; + ds->Color[ds->i] = color; + } + } + return ocolor; +} + +void * rpmdsExclude(const rpmds ds) +{ + return (ds != NULL ? ds->exclude : NULL); +} + +int rpmdsNExclude(const rpmds ds) +{ + return (ds != NULL ? ds->nexclude : 0); +} + +void * rpmdsInclude(const rpmds ds) +{ + return (ds != NULL ? ds->include : NULL); +} + +int rpmdsNInclude(const rpmds ds) +{ + return (ds != NULL ? ds->ninclude : 0); +} + +rpmuint32_t rpmdsRefs(const rpmds ds) +{ + rpmuint32_t Refs = 0; + + if (ds != NULL && ds->i >= 0 && ds->i < (int)ds->Count) { + if (ds->Refs != NULL) + Refs = ds->Refs[ds->i]; + } + return Refs; +} + +rpmuint32_t rpmdsSetRefs(const rpmds ds, rpmuint32_t refs) +{ + rpmuint32_t orefs = 0; + + if (ds == NULL) + return orefs; + + if (ds->Refs == NULL && ds->Count > 0) /* XXX lazy malloc */ + ds->Refs = (rpmuint32_t *) xcalloc(ds->Count, sizeof(*ds->Refs)); + + if (ds->i >= 0 && ds->i < (int)ds->Count) { + if (ds->Refs != NULL) { + orefs = ds->Refs[ds->i]; + ds->Refs[ds->i] = refs; + } + } + return orefs; +} + +rpmint32_t rpmdsResult(const rpmds ds) +{ + rpmint32_t result = 0; + + if (ds != NULL && ds->i >= 0 && ds->i < (int)ds->Count) { + if (ds->Result != NULL) + result = ds->Result[ds->i]; + } + return result; +} + +rpmint32_t rpmdsSetResult(const rpmds ds, rpmint32_t result) +{ + rpmint32_t oresult = 0; + + if (ds == NULL) + return oresult; + + if (ds->Result == NULL && ds->Count > 0) /* XXX lazy malloc */ + ds->Result = (rpmint32_t *) xcalloc(ds->Count, sizeof(*ds->Result)); + + if (ds->i >= 0 && ds->i < (int)ds->Count) { + if (ds->Result != NULL) { + oresult = ds->Result[ds->i]; + ds->Result[ds->i] = result; + } + } + return oresult; +} + +void rpmdsNotify(rpmds ds, const char * where, int rc) +{ + if (!(ds != NULL && ds->i >= 0 && ds->i < (int)ds->Count)) + return; + if (ds->DNEVR == NULL) + return; + + rpmlog(RPMLOG_DEBUG, "%9s: %-45s %-s %s\n", rpmdsTagName(ds->tagN), + (!strcmp(ds->DNEVR, "cached") ? ds->DNEVR : ds->DNEVR+2), + (rc ? _("NO ") : _("YES")), + (where != NULL ? where : "")); +} + +int rpmdsNext(/*@null@*/ rpmds ds) + /*@modifies ds @*/ +{ + int i = -1; + + if (ds != NULL && ++ds->i >= 0) { + if (ds->i < (int)ds->Count) { + char t[2]; + i = ds->i; + ds->DNEVR = _free(ds->DNEVR); + ds->ns.str = _free(ds->ns.str); + memset(&ds->ns, 0, sizeof(ds->ns)); + t[0] = ((ds->Type != NULL) ? ds->Type[0] : '\0'); + t[1] = '\0'; + /*@-nullstate@*/ + /*@i@*/ ds->DNEVR = rpmdsNewDNEVR(t, ds); + /*@=nullstate@*/ + + } else + ds->i = -1; + +/*@-modfilesys @*/ +if (_rpmds_debug < 0 && i != -1 && ds->DNEVR[2] != '\0') +fprintf(stderr, "*** ds %p\t%s[%d]: %s\n", ds, (ds->Type ? ds->Type : "?Type?"), i, (ds->DNEVR ? ds->DNEVR : "?DNEVR?")); +/*@=modfilesys @*/ + + } + + return i; +} + +rpmds rpmdsInit(/*@null@*/ rpmds ds) + /*@modifies ds @*/ +{ + if (ds != NULL) + ds->i = -1; + /*@-refcounttrans@*/ + return ds; + /*@=refcounttrans@*/ +} + +/*@null@*/ +static rpmds rpmdsDup(const rpmds ods) + /*@modifies ods @*/ +{ + rpmds ds = rpmdsGetPool(_rpmdsPool); + size_t nb; + +/*@-assignexpose -castexpose @*/ + ds->h = (ods->h != NULL ? headerLink(ods->h) : NULL); + ds->Type = ods->Type; +/*@=assignexpose =castexpose @*/ + ds->tagN = ods->tagN; + ds->Count = ods->Count; + ds->i = ods->i; + ds->l = ods->l; + ds->u = ods->u; + + nb = (ds->Count+1) * sizeof(*ds->N); + ds->N = (const char **) (ds->h != NULL + ? memcpy(xmalloc(nb), ods->N, nb) + : rpmdsDupArgv(ods->N, ods->Count) ); + + /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */ +assert(ods->EVR != NULL); +assert(ods->Flags != NULL); + + nb = (ds->Count+1) * sizeof(*ds->EVR); + ds->EVR = (const char **) (ds->h != NULL + ? memcpy(xmalloc(nb), ods->EVR, nb) + : rpmdsDupArgv(ods->EVR, ods->Count) ); + + nb = (ds->Count * sizeof(*ds->Flags)); + ds->Flags = (evrFlags *) (ds->h != NULL + ? ods->Flags + : memcpy(xmalloc(nb), ods->Flags, nb) ); + ds->nopromote = ods->nopromote; +/*@-assignexpose@*/ + ds->EVRcmp = ods->EVRcmp;; +/*@=assignexpose@*/ + +/*@-compmempass@*/ /* FIX: ds->Flags is kept, not only */ + return rpmdsLink(ds, (ds ? ds->Type : NULL)); +/*@=compmempass@*/ +} + +int rpmdsFind(rpmds ds, const rpmds ods) +{ + int comparison; + + if (ds == NULL || ods == NULL) + return -1; + + ds->l = 0; + ds->u = ds->Count; + while (ds->l < ds->u) { + ds->i = (ds->l + ds->u) / 2; + + comparison = strcmp(ods->N[ods->i], ds->N[ds->i]); + + /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */ +/*@-nullderef@*/ + if (comparison == 0 && ods->EVR && ds->EVR) + comparison = strcmp(ods->EVR[ods->i], ds->EVR[ds->i]); + if (comparison == 0 && ods->Flags && ds->Flags) + comparison = (ods->Flags[ods->i] - ds->Flags[ds->i]); +/*@=nullderef@*/ + + if (comparison < 0) + ds->u = ds->i; + else if (comparison > 0) + ds->l = ds->i + 1; + else + return ds->i; + } + return -1; +} + +int rpmdsMerge(rpmds * dsp, rpmds ods) +{ + rpmds ds; + const char ** N; + const char ** EVR; + evrFlags * Flags; + int j; +int save; + + if (dsp == NULL || ods == NULL) + return -1; + + /* If not initialized yet, dup the 1st entry. */ + if (*dsp == NULL) { + save = ods->Count; + ods->Count = 1; + *dsp = rpmdsDup(ods); + ods->Count = save; + } + ds = *dsp; + if (ds == NULL) + return -1; + + /* + * Add new entries. + */ +save = ods->i; + ods = rpmdsInit(ods); + if (ods != NULL) + while (rpmdsNext(ods) >= 0) { + /* + * If this entry is already present, don't bother. + */ + if (rpmdsFind(ds, ods) >= 0) + continue; + + /* + * Insert new entry. + */ + for (j = ds->Count; j > (int)ds->u; j--) + ds->N[j] = ds->N[j-1]; + ds->N[ds->u] = ods->N[ods->i]; + N = rpmdsDupArgv(ds->N, ds->Count+1); + ds->N = _free(ds->N); + ds->N = N; + + /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */ +/*@-nullderef -nullpass -nullptrarith @*/ +assert(ods->EVR != NULL); +assert(ods->Flags != NULL); + + for (j = ds->Count; j > (int)ds->u; j--) + ds->EVR[j] = ds->EVR[j-1]; + ds->EVR[ds->u] = ods->EVR[ods->i]; + EVR = rpmdsDupArgv(ds->EVR, ds->Count+1); + ds->EVR = _free(ds->EVR); + ds->EVR = EVR; + + Flags = (evrFlags *) xmalloc((ds->Count+1) * sizeof(*Flags)); + if (ds->u > 0) + memcpy(Flags, ds->Flags, ds->u * sizeof(*Flags)); + if (ds->u < ds->Count) + memcpy(Flags + ds->u + 1, ds->Flags + ds->u, (ds->Count - ds->u) * sizeof(*Flags)); + Flags[ds->u] = ods->Flags[ods->i]; + ds->Flags = _free(ds->Flags); + ds->Flags = Flags; +/*@=nullderef =nullpass =nullptrarith @*/ + + ds->i = -1; + ds->Count++; + + } +/*@-nullderef@*/ +ods->i = save; +/*@=nullderef@*/ + return 0; +} + +int rpmdsSearch(rpmds ds, rpmds ods) +{ + int comparison; + int i, l, u; + + if (ds == NULL || ods == NULL) + return -1; + + /* Binary search to find the [l,u) subset that contains N */ + i = -1; + l = 0; + u = ds->Count; + while (l < u) { + i = (l + u) / 2; + + comparison = strcmp(ods->N[ods->i], ds->N[i]); + + if (comparison < 0) + u = i; + else if (comparison > 0) + l = i + 1; + else { + /* Set l to 1st member of set that contains N. */ + if (strcmp(ods->N[ods->i], ds->N[l])) + l = i; + while (l > 0 && !strcmp(ods->N[ods->i], ds->N[l-1])) + l--; + /* Set u to 1st member of set that does not contain N. */ + if (u >= (int)ds->Count || strcmp(ods->N[ods->i], ds->N[u])) + u = i; + while (++u < (int)ds->Count) { + if (strcmp(ods->N[ods->i], ds->N[u])) + /*@innerbreak@*/ break; + } + break; + } + } + + /* Check each member of [l,u) subset for ranges overlap. */ + i = -1; + if (l < u) { + int save = rpmdsSetIx(ds, l-1); + while ((l = rpmdsNext(ds)) >= 0 && (l < u)) { + if ((i = rpmdsCompare(ods, ds)) != 0) + break; + } + /* Return element index that overlaps, or -1. */ + if (i) + i = rpmdsIx(ds); + else { + (void) rpmdsSetIx(ds, save); + i = -1; + } + /* Save the return value. */ + if (ods->Result != NULL) + (void) rpmdsSetResult(ods, (i != -1 ? 1 : 0)); + } + return i; +} + +/** + * Merge a single provides, wrapping N as "NS(N)". + * @retval *dsp (loaded) dependency set + * @param NS dependency name space + * @param N name + * @param EVR epoch:version-release + * @param Flags comparison/context flags + */ +static void rpmdsNSAdd(/*@out@*/ rpmds *dsp, const char * NS, + const char *N, const char *EVR, evrFlags Flags) + /*@modifies *dsp @*/ +{ + char *t; + rpmds ds; + int xx; + + t = (char *) alloca(strlen(NS)+sizeof("()")+strlen(N)); + *t = '\0'; + (void) stpcpy( stpcpy( stpcpy( stpcpy(t, NS), "("), N), ")"); + + ds = rpmdsSingle(RPMTAG_PROVIDENAME, t, EVR, Flags); + xx = rpmdsMerge(dsp, ds); + (void)rpmdsFree(ds); + ds = NULL; +} + +#if defined(WITH_CPUINFO) +int rpmdsCpuinfo(rpmds *dsp, const char * fn) +{ + const char * NS = "cpuinfo"; + struct cpuinfo *cip = cpuinfo_new(); + cpuinfo_feature_t feature; + char tmp[20]; + union _dbswap { + rpmuint32_t ui; + unsigned char uc[4]; + }; + static union _dbswap orderedbytes = { .ui = 0x11223344 }; + const char * endian = NULL; + + snprintf(tmp, 19, "%d", cpuinfo_get_frequency(cip)); + tmp[19] = '\0'; + rpmdsNSAdd(dsp, NS, "cpu_MHz", tmp, RPMSENSE_PROBE|RPMSENSE_EQUAL); + snprintf(tmp, 19, "%d", cpuinfo_get_cores(cip)); + rpmdsNSAdd(dsp, NS, "cpu_cores", tmp, RPMSENSE_PROBE|RPMSENSE_EQUAL); + snprintf(tmp, 19, "%d", cpuinfo_get_threads(cip)); + rpmdsNSAdd(dsp, NS, "cpu_threads", tmp, RPMSENSE_PROBE|RPMSENSE_EQUAL); + + if(orderedbytes.uc[0] == 0x44) + endian = "little"; + else if(orderedbytes.uc[0] == 0x11) + endian = "big"; + else if(orderedbytes.uc[0] == 0x22) + endian = "pdp"; + rpmdsNSAdd(dsp, NS, "endian", endian, RPMSENSE_PROBE|RPMSENSE_EQUAL); + + for (feature = cpuinfo_feature_common; feature != cpuinfo_feature_architecture_max; feature++) { + if(feature == cpuinfo_feature_common_max) + feature = cpuinfo_feature_architecture; + if (cpuinfo_has_feature(cip, feature)) { + const char *name = cpuinfo_string_of_feature(feature); + if (name) + rpmdsNSAdd(dsp, NS, name, "", RPMSENSE_PROBE); + } + } + cpuinfo_destroy(cip); + + return RPMRC_OK; +} + +#else + +struct cpuinfo_s { +/*@observer@*/ /*@null@*/ + const char *name; + int done; + int flags; +}; + +/*@unchecked@*/ +static struct cpuinfo_s ctags[] = { + { "processor", 0, 0 }, + { "Processor", 0, 1 }, /* XXX armv5 */ + { "vendor_id", 0, 0 }, + { "cpu_family", 0, 1 }, + { "model", 0, 1 }, + { "model_name", 0, 0 }, + { "stepping", 0, 1 }, + { "cpu_MHz", 0, 1 }, + { "CPU_implementer",0, 1 }, /* XXX armv5 */ + { "CPU_architecture",0, 1 }, /* XXX armv5 */ + { "CPU_variant", 0, 1 }, /* XXX armv5 */ + { "CPU_part", 0, 1 }, /* XXX armv5 */ + { "CPU_revision", 0, 1 }, /* XXX armv5 */ + { "Hardware", 0, 2 }, /* XXX armv5 */ + { "Revision", 0, 1 }, /* XXX armv5 */ + { "Serial", 0, 1 }, /* XXX armv5 */ + { "cache_size", 0, 1 }, + { "physical_id", 0, 0 }, + { "siblings", 0, 0 }, + { "core_id", 0, 0 }, + { "cpu_cores", 0, 0 }, + { "fdiv_bug", 0, 3 }, + { "hlt_bug", 0, 3 }, + { "f00f_bug", 0, 3 }, + { "coma_bug", 0, 3 }, + { "fpu", 0, 0 }, /* XXX use flags attribute instead. */ + { "fpu_exception", 0, 3 }, + { "cpuid_level", 0, 0 }, + { "wp", 0, 3 }, + { "flags", 0, 4 }, + { "Features", 0, 4 }, /* XXX armv5 */ + { "bogomips", 0, 1 }, + { "BogoMIPS", 0, 1 }, /* XXX armv5 */ + { "clflush_size", 0, 1 }, + { NULL, 0, -1 } +}; + +/** + * Return dependency format to use for a cpuinfo line. + * @param name field name + * @return type of format (0 == ignore, -1 == not found) + */ +static int rpmdsCpuinfoCtagFlags(const char * name) + /*@globals ctags @*/ + /*@modifies ctags @*/ +{ + struct cpuinfo_s * ct; + int flags = -1; + + for (ct = ctags; ct->name != NULL; ct++) { + if (strcmp(ct->name, name)) + continue; + if (ct->done) + continue; + ct->done = 1; /* XXX insure single occurrence */ + flags = ct->flags; + break; + } + return flags; +} + +#define _PROC_CPUINFO "/proc/cpuinfo" +/** + */ +/*@unchecked@*/ /*@observer@*/ /*@owned@*/ /*@relnull@*/ +const char * _cpuinfo_path = NULL; + +int rpmdsCpuinfo(rpmds *dsp, const char * fn) + /*@globals _cpuinfo_path, ctags @*/ + /*@modifies _cpuinfo_path, ctags @*/ +{ + struct cpuinfo_s * ct; + const char * NS = "cpuinfo"; + rpmiob iob = NULL; + char * f, * fe, * fend; + char * g, * ge; + char * t; + int rc = -1; + int xx; + +/*@-modobserver@*/ + if (_cpuinfo_path == NULL) { + _cpuinfo_path = rpmExpand("%{?_rpmds_cpuinfo_path}", NULL); + /* XXX may need to validate path existence somewhen. */ + if (!(_cpuinfo_path != NULL && *_cpuinfo_path == '/')) { +/*@-observertrans @*/ + _cpuinfo_path = _free(_cpuinfo_path); +/*@=observertrans @*/ + _cpuinfo_path = xstrdup(_PROC_CPUINFO); + } + } +/*@=modobserver@*/ + + if (fn == NULL) + fn = _cpuinfo_path; + + /* Reset done variables. */ + for (ct = ctags; ct->name != NULL; ct++) + ct->done = 0; + + xx = rpmiobSlurp(fn, &iob); + if (!(xx == 0 && iob != NULL)) + goto exit; + + for (f = (char *)iob->b; *f != '\0'; f = fend) { + /* find EOL */ + fe = f; + while (*fe != '\0' && !(*fe == '\n' || *fe == '\r')) + fe++; + ge = fe; + while (*fe != '\0' && (*fe == '\n' || *fe == '\r')) + *fe++ = '\0'; + fend = fe; + + /* rtrim on line. */ + while (--ge > f && _isspace(*ge)) + *ge = '\0'; + + /* ltrim on line. */ + while (*f && _isspace(*f)) + f++; + + /* split on ':' */ + fe = f; + while (*fe && *fe != ':') + fe++; + if (*fe == '\0') + continue; + g = fe + 1; + + /* rtrim on field 1. */ + *fe = '\0'; + while (--fe > f && _isspace(*fe)) + *fe = '\0'; + if (*f == '\0') + continue; + + /* ltrim on field 2. */ + while (*g && _isspace(*g)) + g++; + if (*g == '\0') + continue; + + for (t = f; *t != '\0'; t++) { + if (_isspace(*t)) + *t = '_'; + } + + switch (rpmdsCpuinfoCtagFlags(f)) { + case -1: /* not found */ + case 0: /* ignore */ + default: + continue; + /*@notreached@*/ /*@switchbreak@*/ break; + case 1: /* Provides: cpuinfo(f) = g */ + for (t = g; *t != '\0'; t++) { + if (_isspace(*t) || *t == '(' || *t == ')') + *t = '_'; + } + rpmdsNSAdd(dsp, NS, f, g, (evrFlags)(RPMSENSE_PROBE|RPMSENSE_EQUAL)); + /*@switchbreak@*/ break; + case 2: /* Provides: cpuinfo(g) */ + for (t = g; *t != '\0'; t++) { + if (_isspace(*t) || *t == '(' || *t == ')') + *t = '_'; + } + rpmdsNSAdd(dsp, NS, g, "", RPMSENSE_PROBE); + /*@switchbreak@*/ break; + case 3: /* if ("yes") Provides: cpuinfo(f) */ + if (!strcmp(g, "yes")) + rpmdsNSAdd(dsp, NS, f, "", RPMSENSE_PROBE); + /*@switchbreak@*/ break; + case 4: /* Provides: cpuinfo(g[i]) */ + { char ** av = NULL; + int i = 0; + rc = poptParseArgvString(g, NULL, (const char ***)&av); + if (!rc && av != NULL) + while ((t = av[i++]) != NULL) + rpmdsNSAdd(dsp, NS, t, "", RPMSENSE_PROBE); + t = NULL; + if (av != NULL) + free(av); + } /*@switchbreak@*/ break; + } + } + +exit: + iob = rpmiobFree(iob); + return rc; +} +#endif + +struct rpmlibProvides_s { +/*@observer@*/ /*@relnull@*/ + const char * featureName; +/*@observer@*/ /*@relnull@*/ + const char * featureEVR; + evrFlags featureFlags; +/*@observer@*/ /*@relnull@*/ + const char * featureDescription; +}; + +/*@unchecked@*/ /*@observer@*/ +static struct rpmlibProvides_s rpmlibProvides[] = { + { "rpmlib(VersionedDependencies)", "3.0.3-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("PreReq:, Provides:, and Obsoletes: dependencies support versions.") }, + { "rpmlib(CompressedFileNames)", "3.0.4-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("file name(s) stored as (dirName,baseName,dirIndex) tuple, not as path.")}, +#if defined(WITH_BZIP2) + { "rpmlib(PayloadIsBzip2)", "3.0.5-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("package payload can be compressed using bzip2.") }, +#endif + { "rpmlib(PayloadFilesHavePrefix)", "4.0-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("package payload file(s) have \"./\" prefix.") }, + { "rpmlib(ExplicitPackageProvide)", "4.0-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("package name-version-release is not implicitly provided.") }, + { "rpmlib(HeaderLoadSortsTags)", "4.0.1-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("header tags are always sorted after being loaded.") }, + { "rpmlib(ScriptletInterpreterArgs)", "4.0.3-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("the scriptlet interpreter can use arguments from header.") }, + { "rpmlib(PartialHardlinkSets)", "4.0.4-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("a hardlink file set may be installed without being complete.") }, + { "rpmlib(ConcurrentAccess)", "4.1-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("package scriptlets may access the rpm database while installing.") }, +#if defined(WITH_LUA) + { "rpmlib(BuiltinLuaScripts)", "4.2.2-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("internal embedded lua scripts.") }, +#endif +#if defined(WITH_AUGEAS) + { "rpmlib(BuiltinAugeasScripts)", "5.3-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("internal embedded Augeas.") }, +#endif +#if defined(WITH_FICL) + { "rpmlib(BuiltinFiclScripts)", "5.2-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("internal embedded FICL.") }, +#endif +#if defined(WITH_GPSEE) + { "rpmlib(BuiltinJavaScript)", "5.2-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("internal embedded JavaScript.") }, +#endif +#if defined(WITH_PERLEMBED) + { "rpmlib(BuiltinPerlScripts)", "5.2-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("internal embedded perl scripts.") }, +#endif +#if defined(WITH_PYTHONEMBED) + { "rpmlib(BuiltinPythonScripts)", "5.2-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("internal embedded python scripts.") }, +#endif +#if defined(WITH_RUBYEMBED) + { "rpmlib(BuiltinRubyScripts)", "5.2-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("internal embedded ruby scripts.") }, +#endif +#if defined(WITH_SEMANAGE) + { "rpmlib(BuiltinSpookScripts)", "5.3-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("internal embedded Spook scripts.") }, +#endif +#if defined(WITH_SQLITE) + { "rpmlib(BuiltinSqlScripts)", "5.3-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("internal embedded sqlite3 scripts.") }, +#endif +#if defined(WITH_SQUIRREL) + { "rpmlib(BuiltinSquirrelScripts)", "5.2-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("internal embedded squirrel scripts.") }, +#endif +#if defined(WITH_TCL) + { "rpmlib(BuiltinTclScripts)", "5.2-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("internal embedded tcl scripts.") }, +#endif + { "rpmlib(HeaderTagTypeInt64)", "4.4.3-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("header tag data can be of type uint64_t.") }, + { "rpmlib(PayloadIsUstar)", "4.4.4-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("package payload can be in ustar tar archive format.") }, +#if defined(WITH_XZ) /* XXX should be 4.4.6, but use SuSE's 4.4.2 instead */ + { "rpmlib(PayloadIsLzma)", "4.4.2-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("package payload can be compressed using lzma.") }, +#endif + { "rpmlib(FileDigestParameterized)", "4.4.6-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("file digests can be other than MD5.") }, + { "rpmlib(FileDigests)", "4.6.0-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("file digests can be other than MD5.") }, +#if defined(SUPPORT_AR_PAYLOADS) + { "rpmlib(PayloadIsAr)", "5.1-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("package payload can be in ar archive format.") }, +#endif +#if defined(WITH_XZ) + { "rpmlib(PayloadIsXz)", "5.2-1", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("package payload can be compressed using xz.") }, +#endif + /* XXX FIXME: Alt should _NOT_ have added a tracking dependency. */ + { "rpmlib(SetVersions)", "4.0.4-alt98", + (evrFlags)(RPMSENSE_RPMLIB|RPMSENSE_EQUAL), + N_("dependencies support set/subset versions.") }, + { NULL, NULL, (evrFlags)0, NULL } +}; + +/** + * Load rpmlib provides into a dependency set. + * @retval *dsp (loaded) depedency set + * @param tblp rpmlib provides table (NULL uses internal table) + * @return 0 on success + */ +int rpmdsRpmlib(rpmds * dsp, void * tblp) +{ + const struct rpmlibProvides_s * rltblp = (struct rpmlibProvides_s *) tblp; + const struct rpmlibProvides_s * rlp; + int xx; + + if (rltblp == NULL) + rltblp = rpmlibProvides; + + for (rlp = rltblp; rlp->featureName != NULL; rlp++) { + rpmds ds = rpmdsSingle(RPMTAG_PROVIDENAME, rlp->featureName, + rlp->featureEVR, rlp->featureFlags); + xx = rpmdsMerge(dsp, ds); + (void)rpmdsFree(ds); + ds = NULL; + } + return 0; +} + +/** + * Merge contents of a sysinfo tag file into sysinfo dependencies. + * @retval *PRCO provides/requires/conflicts/obsoletes depedency set(s) + * @param fn path to file + * @param tagN dependency set tag + * @return 0 on success + */ +static int rpmdsSysinfoFile(rpmPRCO PRCO, const char * fn, rpmTag tagN) + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies PRCO, fileSystem, internalState @*/ +{ + char buf[BUFSIZ]; + const char *N, *EVR; + evrFlags Flags; + rpmds ds; + char * f, * fe; + char * g, * ge; + FD_t fd = NULL; + FILE * fp; + int rc = -1; + int ln; + int xx; + + /* XXX for now, collect Dirnames/Filelinktos in Providename */ + if (tagN == RPMTAG_DIRNAMES || tagN == RPMTAG_FILELINKTOS) + tagN = RPMTAG_PROVIDENAME; + +assert(fn != NULL); + fd = Fopen(fn, "r.fpio"); + if (fd == NULL || Ferror(fd)) + goto exit; + fp = fdGetFILE(fd); + + ln = 0; + if (fp != NULL) + while((f = fgets(buf, (int)sizeof(buf), fp)) != NULL) { + ln++; + + /* insure a terminator. */ + buf[sizeof(buf)-1] = '\0'; + + /* ltrim on line. */ + while (*f && _isspace(*f)) + f++; + + /* XXX skip YAML "- " markup */ + if (f[0] == '-' && _isspace(f[1])) { + f += sizeof("- ")-1; + while (*f && _isspace(*f)) + f++; + } + + /* skip empty lines and comments */ + if (*f == '\0' || *f == '#') + continue; + + /* rtrim on line. */ + fe = f + strlen(f); + while (--fe > f && _isspace(*fe)) + *fe = '\0'; + + if (!(xisalnum(f[0]) || strchr("/_%!", f[0]) != NULL)) { + fprintf(stderr, _("%s:%d \"%s\" has invalid name. Skipping ...\n"), + fn, ln, f); + continue; + } + + /* split on ' ' or comparison operator. */ + fe = f; + if (*f == '!') fe++; + while (*fe && !_isspace(*fe) && strchr("!<=>", *fe) == NULL) + fe++; + while (*fe && _isspace(*fe)) + *fe++ = '\0'; + + N = f; + EVR = NULL; + Flags = (evrFlags) 0; + + /* parse for non-path, versioned dependency. */ + if (*f != '/' && *fe != '\0') { + /* parse comparison operator */ + g = fe; + Flags = rpmEVRflags(fe, (const char **)&g); + if (Flags == 0) { + fprintf(stderr, _("%s:%d \"%s\" has no comparison operator. Skipping ...\n"), + fn, ln, fe); + continue; + } + *fe = '\0'; + + /* ltrim on field 2. */ + while (*g && _isspace(*g)) + g++; + if (*g == '\0') { + /* XXX No EVR comparison value found. */ + fprintf(stderr, _("%s:%d \"%s\" has no EVR string. Skipping ...\n"), + fn, ln, f); + continue; + } + + ge = g + 1; + while (*ge && !_isspace(*ge)) + ge++; + + if (*ge != '\0') + *ge = '\0'; /* XXX can't happen, line rtrim'ed already. */ + + EVR = g; + } + + if (EVR == NULL) + EVR = ""; + Flags = (evrFlags) (Flags | RPMSENSE_PROBE); + ds = rpmdsSingle(tagN, N, EVR , Flags); + if (ds) { /* XXX can't happen */ + xx = rpmdsMergePRCO(PRCO, ds); + (void)rpmdsFree(ds); + ds = NULL; + } + } + rc = 0; + +exit: + if (fd != NULL) (void) Fclose(fd); + return rc; +} + +#if defined(RPM_VENDOR_WINDRIVER) +#define _ETC_RPM_SYSINFO "%{_etcrpm}/sysinfo" +#else +#define _ETC_RPM_SYSINFO SYSCONFIGDIR "/sysinfo" +#endif + +/*@unchecked@*/ /*@observer@*/ /*@owned@*/ /*@relnull@*/ +const char *_sysinfo_path = NULL; + +/*@-nullassign@*/ +/*@unchecked@*/ /*@observer@*/ /*@relnull@*/ +static const char *_sysinfo_tags[] = { + "Providename", + "Requirename", + "Conflictname", + "Obsoletename", + "Dirnames", + "Filelinktos", + NULL +}; +/*@=nullassign@*/ + +int rpmdsSysinfo(rpmPRCO PRCO, const char * fn) + /*@globals _sysinfo_path @*/ + /*@modifies _sysinfo_path @*/ +{ + struct stat * st = (struct stat *) memset(alloca(sizeof(*st)), 0, sizeof(*st)); + int rc = -1; + int xx; + +/*@-modobserver@*/ + if (_sysinfo_path == NULL) { + _sysinfo_path = rpmExpand("%{?_rpmds_sysinfo_path}", NULL); + /* XXX may need to validate path existence somewhen. */ + if (!(_sysinfo_path != NULL && *_sysinfo_path == '/')) { +/*@-observertrans @*/ + _sysinfo_path = _free(_sysinfo_path); +/*@=observertrans @*/ + _sysinfo_path = xstrdup(_ETC_RPM_SYSINFO); + } + } +/*@=modobserver@*/ + + if (fn == NULL) + fn = _sysinfo_path; + + if (fn == NULL) + goto exit; + + xx = Stat(fn, st); + if (xx < 0) + goto exit; + + if (S_ISDIR(st->st_mode)) { + const char *dn = fn; + const char **av; + rpmTag tagN; + rc = 0; /* assume success */ + for (av = _sysinfo_tags; av && *av; av++) { + tagN = tagValue(*av); + if ((int)tagN < 0) /* XXX FIXME: all tags are valid now */ + continue; + fn = rpmGetPath(dn, "/", *av, NULL); + st = (struct stat *) memset(st, 0, sizeof(*st)); + xx = Stat(fn, st); + if (xx == 0 && S_ISREG(st->st_mode)) + rc = rpmdsSysinfoFile(PRCO, fn, tagN); + fn = _free(fn); + if (rc) + break; + } + } else + /* XXX for now, collect Dirnames/Filelinktos in Providename */ + if (S_ISREG(st->st_mode)) + rc = rpmdsSysinfoFile(PRCO, fn, RPMTAG_PROVIDENAME); + +exit: + return rc; +} + +typedef enum { SYSCONF, CONFSTR, PATHCONF } _conf_e; +struct _conf_s { +/*@observer@*/ /*@relnull@*/ + const char *name; + const int call_name; + const _conf_e call; +}; + +/*@unchecked@*/ /*@observer@*/ +static const struct _conf_s vars[] = { +#ifdef _PC_LINK_MAX + { "LINK_MAX", _PC_LINK_MAX, PATHCONF }, +#endif +#ifdef _PC_LINK_MAX + { "_POSIX_LINK_MAX", _PC_LINK_MAX, PATHCONF }, +#endif +#ifdef _PC_MAX_CANON + { "MAX_CANON", _PC_MAX_CANON, PATHCONF }, +#endif +#ifdef _PC_MAX_CANON + { "_POSIX_MAX_CANON", _PC_MAX_CANON, PATHCONF }, +#endif +#ifdef _PC_MAX_INPUT + { "MAX_INPUT", _PC_MAX_INPUT, PATHCONF }, +#endif +#ifdef _PC_MAX_INPUT + { "_POSIX_MAX_INPUT", _PC_MAX_INPUT, PATHCONF }, +#endif +#ifdef _PC_NAME_MAX + { "NAME_MAX", _PC_NAME_MAX, PATHCONF }, +#endif +#ifdef _PC_NAME_MAX + { "_POSIX_NAME_MAX", _PC_NAME_MAX, PATHCONF }, +#endif +#ifdef _PC_PATH_MAX + { "PATH_MAX", _PC_PATH_MAX, PATHCONF }, +#endif +#ifdef _PC_PATH_MAX + { "_POSIX_PATH_MAX", _PC_PATH_MAX, PATHCONF }, +#endif +#ifdef _PC_PIPE_BUF + { "PIPE_BUF", _PC_PIPE_BUF, PATHCONF }, +#endif +#ifdef _PC_PIPE_BUF + { "_POSIX_PIPE_BUF", _PC_PIPE_BUF, PATHCONF }, +#endif +#ifdef _PC_SOCK_MAXBUF + { "SOCK_MAXBUF", _PC_SOCK_MAXBUF, PATHCONF }, +#endif +#ifdef _PC_ASYNC_IO + { "_POSIX_ASYNC_IO", _PC_ASYNC_IO, PATHCONF }, +#endif +#ifdef _PC_CHOWN_RESTRICTED + { "_POSIX_CHOWN_RESTRICTED", _PC_CHOWN_RESTRICTED, PATHCONF }, +#endif +#ifdef _PC_NO_TRUNC + { "_POSIX_NO_TRUNC", _PC_NO_TRUNC, PATHCONF }, +#endif +#ifdef _PC_PRIO_IO + { "_POSIX_PRIO_IO", _PC_PRIO_IO, PATHCONF }, +#endif +#ifdef _PC_SYNC_IO + { "_POSIX_SYNC_IO", _PC_SYNC_IO, PATHCONF }, +#endif +#ifdef _PC_VDISABLE + { "_POSIX_VDISABLE", _PC_VDISABLE, PATHCONF }, +#endif + +#ifdef _SC_ARG_MAX + { "ARG_MAX", _SC_ARG_MAX, SYSCONF }, +#endif +#ifdef _SC_ATEXIT_MAX + { "ATEXIT_MAX", _SC_ATEXIT_MAX, SYSCONF }, +#endif +#ifdef _SC_CHAR_BIT + { "CHAR_BIT", _SC_CHAR_BIT, SYSCONF }, +#endif +#ifdef _SC_CHAR_MAX + { "CHAR_MAX", _SC_CHAR_MAX, SYSCONF }, +#endif +#ifdef _SC_CHAR_MIN + { "CHAR_MIN", _SC_CHAR_MIN, SYSCONF }, +#endif +#ifdef _SC_CHILD_MAX + { "CHILD_MAX", _SC_CHILD_MAX, SYSCONF }, +#endif +#ifdef _SC_CLK_TCK + { "CLK_TCK", _SC_CLK_TCK, SYSCONF }, +#endif +#ifdef _SC_INT_MAX + { "INT_MAX", _SC_INT_MAX, SYSCONF }, +#endif +#ifdef _SC_INT_MIN + { "INT_MIN", _SC_INT_MIN, SYSCONF }, +#endif +#ifdef _SC_UIO_MAXIOV + { "IOV_MAX", _SC_UIO_MAXIOV, SYSCONF }, +#endif +#ifdef _SC_LOGIN_NAME_MAX + { "LOGNAME_MAX", _SC_LOGIN_NAME_MAX, SYSCONF }, +#endif +#ifdef _SC_LONG_BIT + { "LONG_BIT", _SC_LONG_BIT, SYSCONF }, +#endif +#ifdef _SC_MB_LEN_MAX + { "MB_LEN_MAX", _SC_MB_LEN_MAX, SYSCONF }, +#endif +#ifdef _SC_NGROUPS_MAX + { "NGROUPS_MAX", _SC_NGROUPS_MAX, SYSCONF }, +#endif +#ifdef _SC_NL_ARGMAX + { "NL_ARGMAX", _SC_NL_ARGMAX, SYSCONF }, +#endif +#ifdef _SC_NL_LANGMAX + { "NL_LANGMAX", _SC_NL_LANGMAX, SYSCONF }, +#endif +#ifdef _SC_NL_MSGMAX + { "NL_MSGMAX", _SC_NL_MSGMAX, SYSCONF }, +#endif +#ifdef _SC_NL_NMAX + { "NL_NMAX", _SC_NL_NMAX, SYSCONF }, +#endif +#ifdef _SC_NL_SETMAX + { "NL_SETMAX", _SC_NL_SETMAX, SYSCONF }, +#endif +#ifdef _SC_NL_TEXTMAX + { "NL_TEXTMAX", _SC_NL_TEXTMAX, SYSCONF }, +#endif +#ifdef _SC_GETGR_R_SIZE_MAX + { "NSS_BUFLEN_GROUP", _SC_GETGR_R_SIZE_MAX, SYSCONF }, +#endif +#ifdef _SC_GETPW_R_SIZE_MAX + { "NSS_BUFLEN_PASSWD", _SC_GETPW_R_SIZE_MAX, SYSCONF }, +#endif +#ifdef _SC_NZERO + { "NZERO", _SC_NZERO, SYSCONF }, +#endif +#ifdef _SC_OPEN_MAX + { "OPEN_MAX", _SC_OPEN_MAX, SYSCONF }, +#endif +#ifdef _SC_PAGESIZE + { "PAGESIZE", _SC_PAGESIZE, SYSCONF }, +#endif +#ifdef _SC_PAGESIZE + { "PAGE_SIZE", _SC_PAGESIZE, SYSCONF }, +#endif +#ifdef _SC_PASS_MAX + { "PASS_MAX", _SC_PASS_MAX, SYSCONF }, +#endif +#ifdef _SC_THREAD_DESTRUCTOR_ITERATIONS + { "PTHREAD_DESTRUCTOR_ITERATIONS", _SC_THREAD_DESTRUCTOR_ITERATIONS, SYSCONF }, +#endif +#ifdef _SC_THREAD_KEYS_MAX + { "PTHREAD_KEYS_MAX", _SC_THREAD_KEYS_MAX, SYSCONF }, +#endif +#ifdef _SC_THREAD_STACK_MIN + { "PTHREAD_STACK_MIN", _SC_THREAD_STACK_MIN, SYSCONF }, +#endif +#ifdef _SC_THREAD_THREADS_MAX + { "PTHREAD_THREADS_MAX", _SC_THREAD_THREADS_MAX, SYSCONF }, +#endif +#ifdef _SC_SCHAR_MAX + { "SCHAR_MAX", _SC_SCHAR_MAX, SYSCONF }, +#endif +#ifdef _SC_SCHAR_MIN + { "SCHAR_MIN", _SC_SCHAR_MIN, SYSCONF }, +#endif +#ifdef _SC_SHRT_MAX + { "SHRT_MAX", _SC_SHRT_MAX, SYSCONF }, +#endif +#ifdef _SC_SHRT_MIN + { "SHRT_MIN", _SC_SHRT_MIN, SYSCONF }, +#endif +#ifdef _SC_SSIZE_MAX + { "SSIZE_MAX", _SC_SSIZE_MAX, SYSCONF }, +#endif +#ifdef _SC_TTY_NAME_MAX + { "TTY_NAME_MAX", _SC_TTY_NAME_MAX, SYSCONF }, +#endif +#ifdef _SC_TZNAME_MAX + { "TZNAME_MAX", _SC_TZNAME_MAX, SYSCONF }, +#endif +#ifdef _SC_UCHAR_MAX + { "UCHAR_MAX", _SC_UCHAR_MAX, SYSCONF }, +#endif +#ifdef _SC_UINT_MAX + { "UINT_MAX", _SC_UINT_MAX, SYSCONF }, +#endif +#ifdef _SC_UIO_MAXIOV + { "UIO_MAXIOV", _SC_UIO_MAXIOV, SYSCONF }, +#endif +#ifdef _SC_ULONG_MAX + { "ULONG_MAX", _SC_ULONG_MAX, SYSCONF }, +#endif +#ifdef _SC_USHRT_MAX + { "USHRT_MAX", _SC_USHRT_MAX, SYSCONF }, +#endif +#ifdef _SC_WORD_BIT + { "WORD_BIT", _SC_WORD_BIT, SYSCONF }, +#endif +#ifdef _SC_AVPHYS_PAGES + { "_AVPHYS_PAGES", _SC_AVPHYS_PAGES, SYSCONF }, +#endif +#ifdef _SC_NPROCESSORS_CONF + { "_NPROCESSORS_CONF", _SC_NPROCESSORS_CONF, SYSCONF }, +#endif +#ifdef _SC_NPROCESSORS_ONLN + { "_NPROCESSORS_ONLN", _SC_NPROCESSORS_ONLN, SYSCONF }, +#endif +#ifdef _SC_PHYS_PAGES + { "_PHYS_PAGES", _SC_PHYS_PAGES, SYSCONF }, +#endif +#ifdef _SC_ARG_MAX + { "_POSIX_ARG_MAX", _SC_ARG_MAX, SYSCONF }, +#endif +#ifdef _SC_ASYNCHRONOUS_IO + { "_POSIX_ASYNCHRONOUS_IO", _SC_ASYNCHRONOUS_IO, SYSCONF }, +#endif +#ifdef _SC_CHILD_MAX + { "_POSIX_CHILD_MAX", _SC_CHILD_MAX, SYSCONF }, +#endif +#ifdef _SC_FSYNC + { "_POSIX_FSYNC", _SC_FSYNC, SYSCONF }, +#endif +#ifdef _SC_JOB_CONTROL + { "_POSIX_JOB_CONTROL", _SC_JOB_CONTROL, SYSCONF }, +#endif +#ifdef _SC_MAPPED_FILES + { "_POSIX_MAPPED_FILES", _SC_MAPPED_FILES, SYSCONF }, +#endif +#ifdef _SC_MEMLOCK + { "_POSIX_MEMLOCK", _SC_MEMLOCK, SYSCONF }, +#endif +#ifdef _SC_MEMLOCK_RANGE + { "_POSIX_MEMLOCK_RANGE", _SC_MEMLOCK_RANGE, SYSCONF }, +#endif +#ifdef _SC_MEMORY_PROTECTION + { "_POSIX_MEMORY_PROTECTION", _SC_MEMORY_PROTECTION, SYSCONF }, +#endif +#ifdef _SC_MESSAGE_PASSING + { "_POSIX_MESSAGE_PASSING", _SC_MESSAGE_PASSING, SYSCONF }, +#endif +#ifdef _SC_NGROUPS_MAX + { "_POSIX_NGROUPS_MAX", _SC_NGROUPS_MAX, SYSCONF }, +#endif +#ifdef _SC_OPEN_MAX + { "_POSIX_OPEN_MAX", _SC_OPEN_MAX, SYSCONF }, +#endif +#ifdef _SC_PII + { "_POSIX_PII", _SC_PII, SYSCONF }, +#endif +#ifdef _SC_PII_INTERNET + { "_POSIX_PII_INTERNET", _SC_PII_INTERNET, SYSCONF }, +#endif +#ifdef _SC_PII_INTERNET_DGRAM + { "_POSIX_PII_INTERNET_DGRAM", _SC_PII_INTERNET_DGRAM, SYSCONF }, +#endif +#ifdef _SC_PII_INTERNET_STREAM + { "_POSIX_PII_INTERNET_STREAM", _SC_PII_INTERNET_STREAM, SYSCONF }, +#endif +#ifdef _SC_PII_OSI + { "_POSIX_PII_OSI", _SC_PII_OSI, SYSCONF }, +#endif +#ifdef _SC_PII_OSI_CLTS + { "_POSIX_PII_OSI_CLTS", _SC_PII_OSI_CLTS, SYSCONF }, +#endif +#ifdef _SC_PII_OSI_COTS + { "_POSIX_PII_OSI_COTS", _SC_PII_OSI_COTS, SYSCONF }, +#endif +#ifdef _SC_PII_OSI_M + { "_POSIX_PII_OSI_M", _SC_PII_OSI_M, SYSCONF }, +#endif +#ifdef _SC_PII_SOCKET + { "_POSIX_PII_SOCKET", _SC_PII_SOCKET, SYSCONF }, +#endif +#ifdef _SC_PII_XTI + { "_POSIX_PII_XTI", _SC_PII_XTI, SYSCONF }, +#endif +#ifdef _SC_POLL + { "_POSIX_POLL", _SC_POLL, SYSCONF }, +#endif +#ifdef _SC_PRIORITIZED_IO + { "_POSIX_PRIORITIZED_IO", _SC_PRIORITIZED_IO, SYSCONF }, +#endif +#ifdef _SC_PRIORITY_SCHEDULING + { "_POSIX_PRIORITY_SCHEDULING", _SC_PRIORITY_SCHEDULING, SYSCONF }, +#endif +#ifdef _SC_REALTIME_SIGNALS + { "_POSIX_REALTIME_SIGNALS", _SC_REALTIME_SIGNALS, SYSCONF }, +#endif +#ifdef _SC_SAVED_IDS + { "_POSIX_SAVED_IDS", _SC_SAVED_IDS, SYSCONF }, +#endif +#ifdef _SC_SELECT + { "_POSIX_SELECT", _SC_SELECT, SYSCONF }, +#endif +#ifdef _SC_SEMAPHORES + { "_POSIX_SEMAPHORES", _SC_SEMAPHORES, SYSCONF }, +#endif +#ifdef _SC_SHARED_MEMORY_OBJECTS + { "_POSIX_SHARED_MEMORY_OBJECTS", _SC_SHARED_MEMORY_OBJECTS, SYSCONF }, +#endif +#ifdef _SC_SSIZE_MAX + { "_POSIX_SSIZE_MAX", _SC_SSIZE_MAX, SYSCONF }, +#endif +#ifdef _SC_STREAM_MAX + { "_POSIX_STREAM_MAX", _SC_STREAM_MAX, SYSCONF }, +#endif +#ifdef _SC_SYNCHRONIZED_IO + { "_POSIX_SYNCHRONIZED_IO", _SC_SYNCHRONIZED_IO, SYSCONF }, +#endif +#ifdef _SC_THREADS + { "_POSIX_THREADS", _SC_THREADS, SYSCONF }, +#endif +#ifdef _SC_THREAD_ATTR_STACKADDR + { "_POSIX_THREAD_ATTR_STACKADDR", _SC_THREAD_ATTR_STACKADDR, SYSCONF }, +#endif +#ifdef _SC_THREAD_ATTR_STACKSIZE + { "_POSIX_THREAD_ATTR_STACKSIZE", _SC_THREAD_ATTR_STACKSIZE, SYSCONF }, +#endif +#ifdef _SC_THREAD_PRIORITY_SCHEDULING + { "_POSIX_THREAD_PRIORITY_SCHEDULING", _SC_THREAD_PRIORITY_SCHEDULING, SYSCONF }, +#endif +#ifdef _SC_THREAD_PRIO_INHERIT + { "_POSIX_THREAD_PRIO_INHERIT", _SC_THREAD_PRIO_INHERIT, SYSCONF }, +#endif +#ifdef _SC_THREAD_PRIO_PROTECT + { "_POSIX_THREAD_PRIO_PROTECT", _SC_THREAD_PRIO_PROTECT, SYSCONF }, +#endif +#ifdef _SC_THREAD_PROCESS_SHARED + { "_POSIX_THREAD_PROCESS_SHARED", _SC_THREAD_PROCESS_SHARED, SYSCONF }, +#endif +#ifdef _SC_THREAD_SAFE_FUNCTIONS + { "_POSIX_THREAD_SAFE_FUNCTIONS", _SC_THREAD_SAFE_FUNCTIONS, SYSCONF }, +#endif +#ifdef _SC_TIMERS + { "_POSIX_TIMERS", _SC_TIMERS, SYSCONF }, +#endif +#ifdef _SC_TIMER_MAX + { "TIMER_MAX", _SC_TIMER_MAX, SYSCONF }, +#endif +#ifdef _SC_TZNAME_MAX + { "_POSIX_TZNAME_MAX", _SC_TZNAME_MAX, SYSCONF }, +#endif +#ifdef _SC_VERSION + { "_POSIX_VERSION", _SC_VERSION, SYSCONF }, +#endif +#ifdef _SC_T_IOV_MAX + { "_T_IOV_MAX", _SC_T_IOV_MAX, SYSCONF }, +#endif +#ifdef _SC_XOPEN_CRYPT + { "_XOPEN_CRYPT", _SC_XOPEN_CRYPT, SYSCONF }, +#endif +#ifdef _SC_XOPEN_ENH_I18N + { "_XOPEN_ENH_I18N", _SC_XOPEN_ENH_I18N, SYSCONF }, +#endif +#ifdef _SC_XOPEN_LEGACY + { "_XOPEN_LEGACY", _SC_XOPEN_LEGACY, SYSCONF }, +#endif +#ifdef _SC_XOPEN_REALTIME + { "_XOPEN_REALTIME", _SC_XOPEN_REALTIME, SYSCONF }, +#endif +#ifdef _SC_XOPEN_REALTIME_THREADS + { "_XOPEN_REALTIME_THREADS", _SC_XOPEN_REALTIME_THREADS, SYSCONF }, +#endif +#ifdef _SC_XOPEN_SHM + { "_XOPEN_SHM", _SC_XOPEN_SHM, SYSCONF }, +#endif +#ifdef _SC_XOPEN_UNIX + { "_XOPEN_UNIX", _SC_XOPEN_UNIX, SYSCONF }, +#endif +#ifdef _SC_XOPEN_VERSION + { "_XOPEN_VERSION", _SC_XOPEN_VERSION, SYSCONF }, +#endif +#ifdef _SC_XOPEN_XCU_VERSION + { "_XOPEN_XCU_VERSION", _SC_XOPEN_XCU_VERSION, SYSCONF }, +#endif +#ifdef _SC_XOPEN_XPG2 + { "_XOPEN_XPG2", _SC_XOPEN_XPG2, SYSCONF }, +#endif +#ifdef _SC_XOPEN_XPG3 + { "_XOPEN_XPG3", _SC_XOPEN_XPG3, SYSCONF }, +#endif +#ifdef _SC_XOPEN_XPG4 + { "_XOPEN_XPG4", _SC_XOPEN_XPG4, SYSCONF }, +#endif + /* POSIX.2 */ +#ifdef _SC_BC_BASE_MAX + { "BC_BASE_MAX", _SC_BC_BASE_MAX, SYSCONF }, +#endif +#ifdef _SC_BC_DIM_MAX + { "BC_DIM_MAX", _SC_BC_DIM_MAX, SYSCONF }, +#endif +#ifdef _SC_BC_SCALE_MAX + { "BC_SCALE_MAX", _SC_BC_SCALE_MAX, SYSCONF }, +#endif +#ifdef _SC_BC_STRING_MAX + { "BC_STRING_MAX", _SC_BC_STRING_MAX, SYSCONF }, +#endif +#ifdef _SC_CHARCLASS_NAME_MAX + { "CHARCLASS_NAME_MAX", _SC_CHARCLASS_NAME_MAX, SYSCONF }, +#endif +#ifdef _SC_COLL_WEIGHTS_MAX + { "COLL_WEIGHTS_MAX", _SC_COLL_WEIGHTS_MAX, SYSCONF }, +#endif +#ifdef _SC_EQUIV_CLASS_MAX + { "EQUIV_CLASS_MAX", _SC_EQUIV_CLASS_MAX, SYSCONF }, +#endif +#ifdef _SC_EXPR_NEST_MAX + { "EXPR_NEST_MAX", _SC_EXPR_NEST_MAX, SYSCONF }, +#endif +#ifdef _SC_LINE_MAX + { "LINE_MAX", _SC_LINE_MAX, SYSCONF }, +#endif +#ifdef _SC_BC_BASE_MAX + { "POSIX2_BC_BASE_MAX", _SC_BC_BASE_MAX, SYSCONF }, +#endif +#ifdef _SC_BC_DIM_MAX + { "POSIX2_BC_DIM_MAX", _SC_BC_DIM_MAX, SYSCONF }, +#endif +#ifdef _SC_BC_SCALE_MAX + { "POSIX2_BC_SCALE_MAX", _SC_BC_SCALE_MAX, SYSCONF }, +#endif +#ifdef _SC_BC_STRING_MAX + { "POSIX2_BC_STRING_MAX", _SC_BC_STRING_MAX, SYSCONF }, +#endif +#ifdef _SC_2_CHAR_TERM + { "POSIX2_CHAR_TERM", _SC_2_CHAR_TERM, SYSCONF }, +#endif +#ifdef _SC_COLL_WEIGHTS_MAX + { "POSIX2_COLL_WEIGHTS_MAX", _SC_COLL_WEIGHTS_MAX, SYSCONF }, +#endif +#ifdef _SC_2_C_BIND + { "POSIX2_C_BIND", _SC_2_C_BIND, SYSCONF }, +#endif +#ifdef _SC_2_C_DEV + { "POSIX2_C_DEV", _SC_2_C_DEV, SYSCONF }, +#endif +#ifdef _SC_2_C_VERSION + { "POSIX2_C_VERSION", _SC_2_C_VERSION, SYSCONF }, +#endif +#ifdef _SC_EXPR_NEST_MAX + { "POSIX2_EXPR_NEST_MAX", _SC_EXPR_NEST_MAX, SYSCONF }, +#endif +#ifdef _SC_2_FORT_DEV + { "POSIX2_FORT_DEV", _SC_2_FORT_DEV, SYSCONF }, +#endif +#ifdef _SC_2_FORT_RUN + { "POSIX2_FORT_RUN", _SC_2_FORT_RUN, SYSCONF }, +#endif +#ifdef _SC_LINE_MAX + { "_POSIX2_LINE_MAX", _SC_LINE_MAX, SYSCONF }, +#endif +#ifdef _SC_2_LOCALEDEF + { "POSIX2_LOCALEDEF", _SC_2_LOCALEDEF, SYSCONF }, +#endif +#ifdef _SC_RE_DUP_MAX + { "POSIX2_RE_DUP_MAX", _SC_RE_DUP_MAX, SYSCONF }, +#endif +#ifdef _SC_2_SW_DEV + { "POSIX2_SW_DEV", _SC_2_SW_DEV, SYSCONF }, +#endif +#ifdef _SC_2_UPE + { "POSIX2_UPE", _SC_2_UPE, SYSCONF }, +#endif +#ifdef _SC_2_VERSION + { "POSIX2_VERSION", _SC_2_VERSION, SYSCONF }, +#endif +#ifdef _SC_RE_DUP_MAX + { "RE_DUP_MAX", _SC_RE_DUP_MAX, SYSCONF }, +#endif + +#ifdef _CS_PATH + { "PATH", _CS_PATH, CONFSTR }, + { "CS_PATH", _CS_PATH, CONFSTR }, +#endif + + /* LFS */ +#ifdef _CS_LFS_CFLAGS + { "LFS_CFLAGS", _CS_LFS_CFLAGS, CONFSTR }, +#endif +#ifdef _CS_LFS_LDFLAGS + { "LFS_LDFLAGS", _CS_LFS_LDFLAGS, CONFSTR }, +#endif +#ifdef _CS_LFS_LIBS + { "LFS_LIBS", _CS_LFS_LIBS, CONFSTR }, +#endif +#ifdef _CS_LFS_LINTFLAGS + { "LFS_LINTFLAGS", _CS_LFS_LINTFLAGS, CONFSTR }, +#endif +#ifdef _CS_LFS64_CFLAGS + { "LFS64_CFLAGS", _CS_LFS64_CFLAGS, CONFSTR }, +#endif +#ifdef _CS_LFS64_LDFLAGS + { "LFS64_LDFLAGS", _CS_LFS64_LDFLAGS, CONFSTR }, +#endif +#ifdef _CS_LFS64_LIBS + { "LFS64_LIBS", _CS_LFS64_LIBS, CONFSTR }, +#endif +#ifdef _CS_LFS64_LINTFLAGS + { "LFS64_LINTFLAGS", _CS_LFS64_LINTFLAGS, CONFSTR }, +#endif + + /* Programming environments. */ +#ifdef _SC_XBS5_ILP32_OFF32 + { "_XBS5_ILP32_OFF32", _SC_XBS5_ILP32_OFF32, SYSCONF }, +#endif +#ifdef _CS_XBS5_ILP32_OFF32_CFLAGS + { "XBS5_ILP32_OFF32_CFLAGS", _CS_XBS5_ILP32_OFF32_CFLAGS, CONFSTR }, +#endif +#ifdef _CS_XBS5_ILP32_OFF32_LDFLAGS + { "XBS5_ILP32_OFF32_LDFLAGS", _CS_XBS5_ILP32_OFF32_LDFLAGS, CONFSTR }, +#endif +#ifdef _CS_XBS5_ILP32_OFF32_LIBS + { "XBS5_ILP32_OFF32_LIBS", _CS_XBS5_ILP32_OFF32_LIBS, CONFSTR }, +#endif +#ifdef _CS_XBS5_ILP32_OFF32_LINTFLAGS + { "XBS5_ILP32_OFF32_LINTFLAGS", _CS_XBS5_ILP32_OFF32_LINTFLAGS, CONFSTR }, +#endif + +#ifdef _SC_XBS5_ILP32_OFFBIG + { "_XBS5_ILP32_OFFBIG", _SC_XBS5_ILP32_OFFBIG, SYSCONF }, +#endif +#ifdef _CS_XBS5_ILP32_OFFBIG_CFLAGS + { "XBS5_ILP32_OFFBIG_CFLAGS", _CS_XBS5_ILP32_OFFBIG_CFLAGS, CONFSTR }, +#endif +#ifdef _CS_XBS5_ILP32_OFFBIG_LDFLAGS + { "XBS5_ILP32_OFFBIG_LDFLAGS", _CS_XBS5_ILP32_OFFBIG_LDFLAGS, CONFSTR }, +#endif +#ifdef _CS_XBS5_ILP32_OFFBIG_LIBS + { "XBS5_ILP32_OFFBIG_LIBS", _CS_XBS5_ILP32_OFFBIG_LIBS, CONFSTR }, +#endif +#ifdef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS + { "XBS5_ILP32_OFFBIG_LINTFLAGS", _CS_XBS5_ILP32_OFFBIG_LINTFLAGS, CONFSTR }, +#endif + +#ifdef _SC_XBS5_LP64_OFF64 + { "_XBS5_LP64_OFF64", _SC_XBS5_LP64_OFF64, SYSCONF }, +#endif +#ifdef _CS_XBS5_LP64_OFF64_CFLAGS + { "XBS5_LP64_OFF64_CFLAGS", _CS_XBS5_LP64_OFF64_CFLAGS, CONFSTR }, +#endif +#ifdef _CS_XBS5_LP64_OFF64_LDFLAGS + { "XBS5_LP64_OFF64_LDFLAGS", _CS_XBS5_LP64_OFF64_LDFLAGS, CONFSTR }, +#endif +#ifdef _CS_XBS5_LP64_OFF64_LIBS + { "XBS5_LP64_OFF64_LIBS", _CS_XBS5_LP64_OFF64_LIBS, CONFSTR }, +#endif +#ifdef _CS_XBS5_LP64_OFF64_LINTFLAGS + { "XBS5_LP64_OFF64_LINTFLAGS", _CS_XBS5_LP64_OFF64_LINTFLAGS, CONFSTR }, +#endif + +#ifdef _SC_XBS5_LPBIG_OFFBIG + { "_XBS5_LPBIG_OFFBIG", _SC_XBS5_LPBIG_OFFBIG, SYSCONF }, +#endif +#ifdef _CS_XBS5_LPBIG_OFFBIG_CFLAGS + { "XBS5_LPBIG_OFFBIG_CFLAGS", _CS_XBS5_LPBIG_OFFBIG_CFLAGS, CONFSTR }, +#endif +#ifdef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS + { "XBS5_LPBIG_OFFBIG_LDFLAGS", _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, CONFSTR }, +#endif +#ifdef _CS_XBS5_LPBIG_OFFBIG_LIBS + { "XBS5_LPBIG_OFFBIG_LIBS", _CS_XBS5_LPBIG_OFFBIG_LIBS, CONFSTR }, +#endif +#ifdef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS + { "XBS5_LPBIG_OFFBIG_LINTFLAGS", _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS, CONFSTR }, +#endif + +#ifdef _SC_V6_ILP32_OFF32 + { "_POSIX_V6_ILP32_OFF32", _SC_V6_ILP32_OFF32, SYSCONF }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFF32_CFLAGS + { "POSIX_V6_ILP32_OFF32_CFLAGS", _CS_POSIX_V6_ILP32_OFF32_CFLAGS, CONFSTR }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS + { "POSIX_V6_ILP32_OFF32_LDFLAGS", _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, CONFSTR }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFF32_LIBS + { "POSIX_V6_ILP32_OFF32_LIBS", _CS_POSIX_V6_ILP32_OFF32_LIBS, CONFSTR }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS + { "POSIX_V6_ILP32_OFF32_LINTFLAGS", _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS, CONFSTR }, +#endif + +#ifdef _CS_V6_WIDTH_RESTRICTED_ENVS + { "_POSIX_V6_WIDTH_RESTRICTED_ENVS", _CS_V6_WIDTH_RESTRICTED_ENVS, CONFSTR }, +#endif + +#ifdef _SC_V6_ILP32_OFFBIG + { "_POSIX_V6_ILP32_OFFBIG", _SC_V6_ILP32_OFFBIG, SYSCONF }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS + { "POSIX_V6_ILP32_OFFBIG_CFLAGS", _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, CONFSTR }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS + { "POSIX_V6_ILP32_OFFBIG_LDFLAGS", _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, CONFSTR }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LIBS + { "POSIX_V6_ILP32_OFFBIG_LIBS", _CS_POSIX_V6_ILP32_OFFBIG_LIBS, CONFSTR }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS + { "POSIX_V6_ILP32_OFFBIG_LINTFLAGS", _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS, CONFSTR }, +#endif + +#ifdef _SC_V6_LP64_OFF64 + { "_POSIX_V6_LP64_OFF64", _SC_V6_LP64_OFF64, SYSCONF }, +#endif +#ifdef _CS_POSIX_V6_LP64_OFF64_CFLAGS + { "POSIX_V6_LP64_OFF64_CFLAGS", _CS_POSIX_V6_LP64_OFF64_CFLAGS, CONFSTR }, +#endif +#ifdef _CS_POSIX_V6_LP64_OFF64_LDFLAGS + { "POSIX_V6_LP64_OFF64_LDFLAGS", _CS_POSIX_V6_LP64_OFF64_LDFLAGS, CONFSTR }, +#endif +#ifdef _CS_POSIX_V6_LP64_OFF64_LIBS + { "POSIX_V6_LP64_OFF64_LIBS", _CS_POSIX_V6_LP64_OFF64_LIBS, CONFSTR }, +#endif +#ifdef _CS_POSIX_V6_LP64_OFF64_LINTFLAGS + { "POSIX_V6_LP64_OFF64_LINTFLAGS", _CS_POSIX_V6_LP64_OFF64_LINTFLAGS, CONFSTR }, +#endif + +#ifdef _SC_V6_LPBIG_OFFBIG + { "_POSIX_V6_LPBIG_OFFBIG", _SC_V6_LPBIG_OFFBIG, SYSCONF }, +#endif +#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS + { "POSIX_V6_LPBIG_OFFBIG_CFLAGS", _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, CONFSTR }, +#endif +#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS + { "POSIX_V6_LPBIG_OFFBIG_LDFLAGS", _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, CONFSTR }, +#endif +#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS + { "POSIX_V6_LPBIG_OFFBIG_LIBS", _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, CONFSTR }, +#endif +#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS + { "POSIX_V6_LPBIG_OFFBIG_LINTFLAGS", _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS, CONFSTR }, +#endif + +#ifdef _SC_ADVISORY_INFO + { "_POSIX_ADVISORY_INFO", _SC_ADVISORY_INFO, SYSCONF }, +#endif +#ifdef _SC_BARRIERS + { "_POSIX_BARRIERS", _SC_BARRIERS, SYSCONF }, +#endif +#ifdef _SC_BASE + { "_POSIX_BASE", _SC_BASE, SYSCONF }, +#endif +#ifdef _SC_C_LANG_SUPPORT + { "_POSIX_C_LANG_SUPPORT", _SC_C_LANG_SUPPORT, SYSCONF }, +#endif +#ifdef _SC_C_LANG_SUPPORT_R + { "_POSIX_C_LANG_SUPPORT_R", _SC_C_LANG_SUPPORT_R, SYSCONF }, +#endif +#ifdef _SC_CLOCK_SELECTION + { "_POSIX_CLOCK_SELECTION", _SC_CLOCK_SELECTION, SYSCONF }, +#endif +#ifdef _SC_CPUTIME + { "_POSIX_CPUTIME", _SC_CPUTIME, SYSCONF }, +#endif +#ifdef _SC_THREAD_CPUTIME + { "_POSIX_THREAD_CPUTIME", _SC_THREAD_CPUTIME, SYSCONF }, +#endif +#ifdef _SC_DEVICE_SPECIFIC + { "_POSIX_DEVICE_SPECIFIC", _SC_DEVICE_SPECIFIC, SYSCONF }, +#endif +#ifdef _SC_DEVICE_SPECIFIC_R + { "_POSIX_DEVICE_SPECIFIC_R", _SC_DEVICE_SPECIFIC_R, SYSCONF }, +#endif +#ifdef _SC_FD_MGMT + { "_POSIX_FD_MGMT", _SC_FD_MGMT, SYSCONF }, +#endif +#ifdef _SC_FIFO + { "_POSIX_FIFO", _SC_FIFO, SYSCONF }, +#endif +#ifdef _SC_PIPE + { "_POSIX_PIPE", _SC_PIPE, SYSCONF }, +#endif +#ifdef _SC_FILE_ATTRIBUTES + { "_POSIX_FILE_ATTRIBUTES", _SC_FILE_ATTRIBUTES, SYSCONF }, +#endif +#ifdef _SC_FILE_LOCKING + { "_POSIX_FILE_LOCKING", _SC_FILE_LOCKING, SYSCONF }, +#endif +#ifdef _SC_FILE_SYSTEM + { "_POSIX_FILE_SYSTEM", _SC_FILE_SYSTEM, SYSCONF }, +#endif +#ifdef _SC_MONOTONIC_CLOCK + { "_POSIX_MONOTONIC_CLOCK", _SC_MONOTONIC_CLOCK, SYSCONF }, +#endif +#ifdef _SC_MULTI_PROCESS + { "_POSIX_MULTI_PROCESS", _SC_MULTI_PROCESS, SYSCONF }, +#endif +#ifdef _SC_SINGLE_PROCESS + { "_POSIX_SINGLE_PROCESS", _SC_SINGLE_PROCESS, SYSCONF }, +#endif +#ifdef _SC_NETWORKING + { "_POSIX_NETWORKING", _SC_NETWORKING, SYSCONF }, +#endif +#ifdef _SC_READER_WRITER_LOCKS + { "_POSIX_READER_WRITER_LOCKS", _SC_READER_WRITER_LOCKS, SYSCONF }, +#endif +#ifdef _SC_SPIN_LOCKS + { "_POSIX_SPIN_LOCKS", _SC_SPIN_LOCKS, SYSCONF }, +#endif +#ifdef _SC_REGEXP + { "_POSIX_REGEXP", _SC_REGEXP, SYSCONF }, +#endif +#ifdef _SC_REGEX_VERSION + { "_REGEX_VERSION", _SC_REGEX_VERSION, SYSCONF }, +#endif +#ifdef _SC_SHELL + { "_POSIX_SHELL", _SC_SHELL, SYSCONF }, +#endif +#ifdef _SC_SIGNALS + { "_POSIX_SIGNALS", _SC_SIGNALS, SYSCONF }, +#endif +#ifdef _SC_SPAWN + { "_POSIX_SPAWN", _SC_SPAWN, SYSCONF }, +#endif +#ifdef _SC_SPORADIC_SERVER + { "_POSIX_SPORADIC_SERVER", _SC_SPORADIC_SERVER, SYSCONF }, +#endif +#ifdef _SC_THREAD_SPORADIC_SERVER + { "_POSIX_THREAD_SPORADIC_SERVER", _SC_THREAD_SPORADIC_SERVER, SYSCONF }, +#endif +#ifdef _SC_SYSTEM_DATABASE + { "_POSIX_SYSTEM_DATABASE", _SC_SYSTEM_DATABASE, SYSCONF }, +#endif +#ifdef _SC_SYSTEM_DATABASE_R + { "_POSIX_SYSTEM_DATABASE_R", _SC_SYSTEM_DATABASE_R, SYSCONF }, +#endif +#ifdef _SC_TIMEOUTS + { "_POSIX_TIMEOUTS", _SC_TIMEOUTS, SYSCONF }, +#endif +#ifdef _SC_TYPED_MEMORY_OBJECTS + { "_POSIX_TYPED_MEMORY_OBJECTS", _SC_TYPED_MEMORY_OBJECTS, SYSCONF }, +#endif +#ifdef _SC_USER_GROUPS + { "_POSIX_USER_GROUPS", _SC_USER_GROUPS, SYSCONF }, +#endif +#ifdef _SC_USER_GROUPS_R + { "_POSIX_USER_GROUPS_R", _SC_USER_GROUPS_R, SYSCONF }, +#endif +#ifdef _SC_2_PBS + { "POSIX2_PBS", _SC_2_PBS, SYSCONF }, +#endif +#ifdef _SC_2_PBS_ACCOUNTING + { "POSIX2_PBS_ACCOUNTING", _SC_2_PBS_ACCOUNTING, SYSCONF }, +#endif +#ifdef _SC_2_PBS_LOCATE + { "POSIX2_PBS_LOCATE", _SC_2_PBS_LOCATE, SYSCONF }, +#endif +#ifdef _SC_2_PBS_TRACK + { "POSIX2_PBS_TRACK", _SC_2_PBS_TRACK, SYSCONF }, +#endif +#ifdef _SC_2_PBS_MESSAGE + { "POSIX2_PBS_MESSAGE", _SC_2_PBS_MESSAGE, SYSCONF }, +#endif +#ifdef _SC_SYMLOOP_MAX + { "SYMLOOP_MAX", _SC_SYMLOOP_MAX, SYSCONF }, +#endif +#ifdef _SC_STREAM_MAX + { "STREAM_MAX", _SC_STREAM_MAX, SYSCONF }, +#endif +#ifdef _SC_AIO_LISTIO_MAX + { "AIO_LISTIO_MAX", _SC_AIO_LISTIO_MAX, SYSCONF }, +#endif +#ifdef _SC_AIO_MAX + { "AIO_MAX", _SC_AIO_MAX, SYSCONF }, +#endif +#ifdef _SC_AIO_PRIO_DELTA_MAX + { "AIO_PRIO_DELTA_MAX", _SC_AIO_PRIO_DELTA_MAX, SYSCONF }, +#endif +#ifdef _SC_DELAYTIMER_MAX + { "DELAYTIMER_MAX", _SC_DELAYTIMER_MAX, SYSCONF }, +#endif +#ifdef _SC_HOST_NAME_MAX + { "HOST_NAME_MAX", _SC_HOST_NAME_MAX, SYSCONF }, +#endif +#ifdef _SC_LOGIN_NAME_MAX + { "LOGIN_NAME_MAX", _SC_LOGIN_NAME_MAX, SYSCONF }, +#endif +#ifdef _SC_MQ_OPEN_MAX + { "MQ_OPEN_MAX", _SC_MQ_OPEN_MAX, SYSCONF }, +#endif +#ifdef _SC_MQ_PRIO_MAX + { "MQ_PRIO_MAX", _SC_MQ_PRIO_MAX, SYSCONF }, +#endif +#ifdef _SC_DEVICE_IO + { "_POSIX_DEVICE_IO", _SC_DEVICE_IO, SYSCONF }, +#endif +#ifdef _SC_TRACE + { "_POSIX_TRACE", _SC_TRACE, SYSCONF }, +#endif +#ifdef _SC_TRACE_EVENT_FILTER + { "_POSIX_TRACE_EVENT_FILTER", _SC_TRACE_EVENT_FILTER, SYSCONF }, +#endif +#ifdef _SC_TRACE_INHERIT + { "_POSIX_TRACE_INHERIT", _SC_TRACE_INHERIT, SYSCONF }, +#endif +#ifdef _SC_TRACE_LOG + { "_POSIX_TRACE_LOG", _SC_TRACE_LOG, SYSCONF }, +#endif +#ifdef _SC_RTSIG_MAX + { "RTSIG_MAX", _SC_RTSIG_MAX, SYSCONF }, +#endif +#ifdef _SC_SEM_NSEMS_MAX + { "SEM_NSEMS_MAX", _SC_SEM_NSEMS_MAX, SYSCONF }, +#endif +#ifdef _SC_SEM_VALUE_MAX + { "SEM_VALUE_MAX", _SC_SEM_VALUE_MAX, SYSCONF }, +#endif +#ifdef _SC_SIGQUEUE_MAX + { "SIGQUEUE_MAX", _SC_SIGQUEUE_MAX, SYSCONF }, +#endif +#ifdef _PC_FILESIZEBITS + { "FILESIZEBITS", _PC_FILESIZEBITS, PATHCONF }, +#endif +#ifdef _PC_ALLOC_SIZE_MIN + { "POSIX_ALLOC_SIZE_MIN", _PC_ALLOC_SIZE_MIN, PATHCONF }, +#endif +#ifdef _PC_REC_INCR_XFER_SIZE + { "POSIX_REC_INCR_XFER_SIZE", _PC_REC_INCR_XFER_SIZE, PATHCONF }, +#endif +#ifdef _PC_REC_MAX_XFER_SIZE + { "POSIX_REC_MAX_XFER_SIZE", _PC_REC_MAX_XFER_SIZE, PATHCONF }, +#endif +#ifdef _PC_REC_MIN_XFER_SIZE + { "POSIX_REC_MIN_XFER_SIZE", _PC_REC_MIN_XFER_SIZE, PATHCONF }, +#endif +#ifdef _PC_REC_XFER_ALIGN + { "POSIX_REC_XFER_ALIGN", _PC_REC_XFER_ALIGN, PATHCONF }, +#endif +#ifdef _PC_SYMLINK_MAX + { "SYMLINK_MAX", _PC_SYMLINK_MAX, PATHCONF }, +#endif +#ifdef _CS_GNU_LIBC_VERSION + { "GNU_LIBC_VERSION", _CS_GNU_LIBC_VERSION, CONFSTR }, +#endif +#ifdef _CS_GNU_LIBPTHREAD_VERSION + { "GNU_LIBPTHREAD_VERSION", _CS_GNU_LIBPTHREAD_VERSION, CONFSTR }, +#endif +#ifdef _PC_2_SYMLINKS + { "POSIX2_SYMLINKS", _PC_2_SYMLINKS, PATHCONF }, +#endif + +#ifdef _SC_LEVEL1_ICACHE_SIZE + { "LEVEL1_ICACHE_SIZE", _SC_LEVEL1_ICACHE_SIZE, SYSCONF }, +#endif +#ifdef _SC_LEVEL1_ICACHE_ASSOC + { "LEVEL1_ICACHE_ASSOC", _SC_LEVEL1_ICACHE_ASSOC, SYSCONF }, +#endif +#ifdef _SC_LEVEL1_ICACHE_LINESIZE + { "LEVEL1_ICACHE_LINESIZE", _SC_LEVEL1_ICACHE_LINESIZE, SYSCONF }, +#endif +#ifdef _SC_LEVEL1_DCACHE_SIZE + { "LEVEL1_DCACHE_SIZE", _SC_LEVEL1_DCACHE_SIZE, SYSCONF }, +#endif +#ifdef _SC_LEVEL1_DCACHE_ASSOC + { "LEVEL1_DCACHE_ASSOC", _SC_LEVEL1_DCACHE_ASSOC, SYSCONF }, +#endif +#ifdef _SC_LEVEL1_DCACHE_LINESIZE + { "LEVEL1_DCACHE_LINESIZE", _SC_LEVEL1_DCACHE_LINESIZE, SYSCONF }, +#endif +#ifdef _SC_LEVEL2_CACHE_SIZE + { "LEVEL2_CACHE_SIZE", _SC_LEVEL2_CACHE_SIZE, SYSCONF }, +#endif +#ifdef _SC_LEVEL2_CACHE_ASSOC + { "LEVEL2_CACHE_ASSOC", _SC_LEVEL2_CACHE_ASSOC, SYSCONF }, +#endif +#ifdef _SC_LEVEL2_CACHE_LINESIZE + { "LEVEL2_CACHE_LINESIZE", _SC_LEVEL2_CACHE_LINESIZE, SYSCONF }, +#endif +#ifdef _SC_LEVEL3_CACHE_SIZE + { "LEVEL3_CACHE_SIZE", _SC_LEVEL3_CACHE_SIZE, SYSCONF }, +#endif +#ifdef _SC_LEVEL3_CACHE_ASSOC + { "LEVEL3_CACHE_ASSOC", _SC_LEVEL3_CACHE_ASSOC, SYSCONF }, +#endif +#ifdef _SC_LEVEL3_CACHE_LINESIZE + { "LEVEL3_CACHE_LINESIZE", _SC_LEVEL3_CACHE_LINESIZE, SYSCONF }, +#endif +#ifdef _SC_LEVEL4_CACHE_SIZE + { "LEVEL4_CACHE_SIZE", _SC_LEVEL4_CACHE_SIZE, SYSCONF }, +#endif +#ifdef _SC_LEVEL4_CACHE_ASSOC + { "LEVEL4_CACHE_ASSOC", _SC_LEVEL4_CACHE_ASSOC, SYSCONF }, +#endif + +#ifdef _SC_IPV6 + { "IPV6", _SC_IPV6, SYSCONF }, +#endif +#ifdef _SC_RAW_SOCKETS + { "RAW_SOCKETS", _SC_RAW_SOCKETS, SYSCONF }, +#endif + + { NULL, 0, SYSCONF } +}; + +#define _GETCONF_PATH "/" +/*@unchecked@*/ /*@observer@*/ /*@owned@*/ /*@relnull@*/ +static const char *_getconf_path = NULL; + +int +rpmdsGetconf(rpmds * dsp, const char *path) + /*@globals _getconf_path @*/ + /*@modifies _getconf_path @*/ +{ + const struct _conf_s *c; + size_t clen; + long int value; + const char * NS = "getconf"; + const char *N; + char * EVR; + char * t; + evrFlags Flags; + +/*@-modobserver@*/ + if (_getconf_path == NULL) { + _getconf_path = rpmExpand("%{?_rpmds__getconf_path}", NULL); + /* XXX may need to validate path existence somewhen. */ + if (!(_getconf_path != NULL && *_getconf_path == '/')) { +/*@-observertrans @*/ + _getconf_path = _free(_getconf_path); +/*@=observertrans @*/ + _getconf_path = xstrdup(_GETCONF_PATH); + } + } +/*@=modobserver@*/ + + if (path == NULL) + path = _getconf_path; + + for (c = vars; c->name != NULL; ++c) { + N = c->name; + EVR = NULL; + switch (c->call) { + case PATHCONF: + value = pathconf(path, c->call_name); + if (value != -1) { + EVR = (char *) xmalloc(32); + sprintf(EVR, "%ld", value); + } + /*@switchbreak@*/ break; + case SYSCONF: + value = sysconf(c->call_name); + if (value == -1l) { +#if defined(_SC_UINT_MAX) && defined(_SC_ULONG_MAX) +/*@-unrecog@*/ + if (c->call_name == _SC_UINT_MAX + || c->call_name == _SC_ULONG_MAX) { + EVR = (char *) xmalloc(32); + sprintf(EVR, "%lu", value); + } +/*@=unrecog@*/ +#endif + } else { + EVR = (char *) xmalloc(32); + sprintf(EVR, "%ld", value); + } + /*@switchbreak@*/ break; + case CONFSTR: +#ifndef __CYGWIN__ + clen = confstr(c->call_name, (char *) NULL, 0); + EVR = (char *) xmalloc(clen+1); + *EVR = '\0'; + if (confstr (c->call_name, EVR, clen) != clen) { + fprintf(stderr, "confstr: %s\n", strerror(errno)); + exit (EXIT_FAILURE); + } + EVR[clen] = '\0'; +#endif + /*@switchbreak@*/ break; + } + if (EVR == NULL) + continue; + + for (t = EVR; *t; t++) { + if (*t == '\n') *t = ' '; + } + if (!strcmp(N, "GNU_LIBC_VERSION") + || !strcmp(N, "GNU_LIBPTHREAD_VERSION")) + { + for (t = EVR; *t; t++) { + if (*t == ' ') *t = '-'; + } + } + + if (*EVR == '\0' || strchr(EVR, ' ') != NULL + || (EVR[0] == '-' && strchr("0123456789", EVR[1]) == NULL)) + { + EVR = _free(EVR); + continue; + } + + Flags = (evrFlags) (RPMSENSE_PROBE|RPMSENSE_EQUAL); + rpmdsNSAdd(dsp, NS, N, EVR, Flags); + EVR = _free(EVR); + } + return 0; +} + +int rpmdsMergePRCO(void * context, rpmds ds) +{ + rpmPRCO PRCO = (rpmPRCO) context; + int rc = -1; + +/*@-modfilesys@*/ +if (_rpmds_debug < 0) +fprintf(stderr, "*** rpmdsMergePRCO(%p, %p) %s\n", context, ds, rpmdsTagName(rpmdsTagN(ds))); +/*@=modfilesys@*/ + switch(rpmdsTagN(ds)) { + default: + break; + case RPMTAG_PROVIDENAME: + rc = rpmdsMerge(PRCO->Pdsp, ds); + break; + case RPMTAG_REQUIRENAME: + rc = rpmdsMerge(PRCO->Rdsp, ds); + break; + case RPMTAG_CONFLICTNAME: + rc = rpmdsMerge(PRCO->Cdsp, ds); + break; + case RPMTAG_OBSOLETENAME: + rc = rpmdsMerge(PRCO->Odsp, ds); + break; + case RPMTAG_TRIGGERNAME: + rc = rpmdsMerge(PRCO->Tdsp, ds); + break; + case RPMTAG_DIRNAMES: + rc = rpmdsMerge(PRCO->Ddsp, ds); + break; + case RPMTAG_FILELINKTOS: + rc = rpmdsMerge(PRCO->Ldsp, ds); + break; + } + return rc; +} + +rpmPRCO rpmdsFreePRCO(rpmPRCO PRCO) +{ + if (PRCO) { + (void)rpmdsFree(PRCO->my); + PRCO->my = NULL; + (void)rpmdsFree(PRCO->P); + PRCO->P = NULL; + (void)rpmdsFree(PRCO->R); + PRCO->R = NULL; + (void)rpmdsFree(PRCO->C); + PRCO->C = NULL; + (void)rpmdsFree(PRCO->O); + PRCO->O = NULL; + (void)rpmdsFree(PRCO->T); + PRCO->T = NULL; + (void)rpmdsFree(PRCO->D); + PRCO->D = NULL; + (void)rpmdsFree(PRCO->L); + PRCO->L = NULL; + memset(PRCO, 0, sizeof(*PRCO)); + PRCO = _free(PRCO); + } + return NULL; +} + +rpmPRCO rpmdsNewPRCO(Header h) +{ + rpmPRCO PRCO = (rpmPRCO) xcalloc(1, sizeof(*PRCO)); + + if (h != NULL) { + static int scareMem = 0; + PRCO->my = rpmdsNew(h, RPMTAG_NAME, scareMem); + PRCO->P = rpmdsNew(h, RPMTAG_PROVIDENAME, scareMem); + PRCO->R = rpmdsNew(h, RPMTAG_REQUIRENAME, scareMem); + PRCO->C = rpmdsNew(h, RPMTAG_CONFLICTNAME, scareMem); + PRCO->O = rpmdsNew(h, RPMTAG_OBSOLETENAME, scareMem); + PRCO->T = rpmdsNew(h, RPMTAG_TRIGGERNAME, scareMem); + PRCO->D = rpmdsNew(h, RPMTAG_DIRNAMES, scareMem); + PRCO->L = rpmdsNew(h, RPMTAG_FILELINKTOS, scareMem); + } + PRCO->Pdsp = &PRCO->P; + PRCO->Rdsp = &PRCO->R; + PRCO->Cdsp = &PRCO->C; + PRCO->Odsp = &PRCO->O; + PRCO->Tdsp = &PRCO->T; + PRCO->Ddsp = &PRCO->D; + PRCO->Ldsp = &PRCO->L; + return PRCO; +} + +rpmds rpmdsFromPRCO(rpmPRCO PRCO, rpmTag tagN) +{ + /*@-compdef -refcounttrans -retalias -retexpose -usereleased @*/ + if (PRCO != NULL) + switch (tagN) { + default: break; + case RPMTAG_NAME: return PRCO->my; /*@notreached@*/ break; + case RPMTAG_PROVIDENAME: return *PRCO->Pdsp; /*@notreached@*/ break; + case RPMTAG_REQUIRENAME: return *PRCO->Rdsp; /*@notreached@*/ break; + case RPMTAG_CONFLICTNAME: return *PRCO->Cdsp; /*@notreached@*/ break; + case RPMTAG_OBSOLETENAME: return *PRCO->Odsp; /*@notreached@*/ break; + case RPMTAG_TRIGGERNAME: return *PRCO->Tdsp; /*@notreached@*/ break; + case RPMTAG_DIRNAMES: return *PRCO->Ddsp; /*@notreached@*/ break; + case RPMTAG_FILELINKTOS: return *PRCO->Ldsp; /*@notreached@*/ break; + } + return NULL; + /*@=compdef =refcounttrans =retalias =retexpose =usereleased @*/ +} + +/** + * Return a soname dependency constructed from an elf string. + * @retval t soname dependency + * @param s elf string (NULL uses "") + * @param isElf64 is this an ELF64 symbol? + */ +#if defined(HAVE_GELF_H) && defined(HAVE_LIBELF) && !defined(__FreeBSD__) +static char * sonameDep(/*@returned@*/ char * t, const char * s, int isElf64) + /*@modifies t @*/ +{ + *t = '\0'; +#if !defined(__alpha__) && !defined(__sun) + if (isElf64) { + if (s[strlen(s)-1] != ')') + (void) stpcpy( stpcpy(t, s), "()(64bit)"); + else + (void) stpcpy( stpcpy(t, s), "(64bit)"); + }else +#endif + (void) stpcpy(t, s); + return t; +} +#endif + +/*@-moduncon -noeffectuncon @*/ +int rpmdsELF(const char * fn, int flags, + int (*add) (void * context, rpmds ds), void * context) +{ +#if defined(HAVE_GELF_H) && defined(HAVE_LIBELF) && !defined(__FreeBSD__) + Elf * elf; + Elf_Scn * scn; + Elf_Data * data; + GElf_Ehdr ehdr_mem, * ehdr; + GElf_Shdr shdr_mem, * shdr; + GElf_Verdef def_mem, * def; + GElf_Verneed need_mem, * need; + GElf_Dyn dyn_mem, * dyn; + unsigned int auxoffset; + unsigned int offset; + int fdno; + int cnt2; + int cnt; + char buf[BUFSIZ]; + const char * s; + int is_executable; + const char * soname = NULL; + rpmds ds; + char * t; + int xx; + int isElf64; + int isDSO; + int gotSONAME = 0; + int gotDEBUG = 0; + int gotHASH = 0; + int gotGNUHASH = 0; + int skipP = (flags & RPMELF_FLAG_SKIPPROVIDES); + int skipR = (flags & RPMELF_FLAG_SKIPREQUIRES); + static int filter_GLIBC_PRIVATE = 0; + static int oneshot = 0; + +/*@-castfcnptr@*/ +if (_rpmds_debug < 0) +fprintf(stderr, "*** rpmdsELF(%s, %d, %p, %p)\n", fn, flags, (void *)add, context); +/*@=castfcnptr@*/ + if (oneshot == 0) { + oneshot = 1; + filter_GLIBC_PRIVATE = rpmExpandNumeric("%{?_filter_GLIBC_PRIVATE}"); + } + + /* Extract dependencies only from files with executable bit set. */ + { struct stat sb, * st = &sb; + if (stat(fn, st) != 0) + return -1; + is_executable = (int)(st->st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)); + } + + fdno = open(fn, O_RDONLY); + if (fdno < 0) + return fdno; + + (void) elf_version(EV_CURRENT); + +/*@-evalorder@*/ + elf = NULL; + if ((elf = elf_begin (fdno, ELF_C_READ, NULL)) == NULL + || elf_kind(elf) != ELF_K_ELF + || (ehdr = gelf_getehdr(elf, &ehdr_mem)) == NULL + || !(ehdr->e_type == ET_DYN || ehdr->e_type == ET_EXEC)) + goto exit; +/*@=evalorder@*/ + + isElf64 = ehdr->e_ident[EI_CLASS] == ELFCLASS64; + isDSO = ehdr->e_type == ET_DYN; + + /*@-uniondef @*/ + scn = NULL; + while ((scn = elf_nextscn(elf, scn)) != NULL) { + shdr = gelf_getshdr(scn, &shdr_mem); + if (shdr == NULL) + break; + + soname = _free(soname); + switch (shdr->sh_type) { + default: + continue; + /*@notreached@*/ /*@switchbreak@*/ break; + case SHT_NOTE: +#if defined(HAVE_GELF_GETNOTE) /* XXX OpenIndiana & older elfutils haven't. */ + if (!(shdr->sh_flags & SHF_ALLOC)) + continue; + data = NULL; + while ((data = elf_getdata(scn, data)) != NULL) { + GElf_Nhdr nhdr; + size_t name_offset; + size_t desc_offset; + offset = 0; + while (offset < data->d_size + && (offset = gelf_getnote(data, offset, + &nhdr, &name_offset, &desc_offset)) > 0) + { + const char *name = ((char *)data->d_buf) + name_offset; + const char *desc = ((char *)data->d_buf) + desc_offset; + if (memchr(name, '\0', nhdr.n_namesz) == NULL) + /*@innercontinue@*/ continue; + switch (nhdr.n_type) { + default: /*@innercontinue@*/ continue; +#if !defined(NT_GNU_BUILD_ID) +#define NT_GNU_BUILD_ID 3 +#endif + case NT_GNU_BUILD_ID: + if (strcmp(name, "GNU") == 0 && nhdr.n_descsz > 0) { + static const char hex[] = "0123456789abcdef"; + static evrFlags _Flags = (evrFlags) + (RPMSENSE_EQUAL|RPMSENSE_FIND_PROVIDES); + size_t i; + buf[0] = '\0'; + t = buf; + for (i = 0; i < nhdr.n_descsz; ++i) { + *t++ = hex[ (((unsigned)desc[i] >> 4) & 0x0f) ]; + *t++ = hex[ (((unsigned)desc[i] ) & 0x0f) ]; + } + *t = '\0'; + /* Add next buildid. */ + ds = rpmdsSingle(RPMTAG_PROVIDES, "elf(buildid)", + buf, _Flags); + xx = add(context, ds); + (void)rpmdsFree(ds); + ds = NULL; + } + /*@switchbreak@*/ break; + } + } + } +#endif /* defined(HAVE_GELF_GETNOTE) */ + /*@switchbreak@*/ break; + case SHT_GNU_verdef: + data = NULL; + if (!skipP) + while ((data = elf_getdata (scn, data)) != NULL) { + offset = 0; + for (cnt = (int)shdr->sh_info; --cnt >= 0; ) { + + def = gelf_getverdef (data, offset, &def_mem); + if (def == NULL) + /*@innerbreak@*/ break; + auxoffset = (unsigned)(offset + def->vd_aux); + for (cnt2 = (int)def->vd_cnt; --cnt2 >= 0; ) { + GElf_Verdaux aux_mem, * aux; + + aux = gelf_getverdaux (data, auxoffset, &aux_mem); + if (aux == NULL) + /*@innerbreak@*/ break; + + s = elf_strptr(elf, shdr->sh_link, aux->vda_name); + if (s == NULL) + /*@innerbreak@*/ break; + + if (def->vd_flags & VER_FLG_BASE) { + soname = _free(soname); + soname = xstrdup(s); + } else + if (soname != NULL + && !(filter_GLIBC_PRIVATE != 0 + && !strcmp(s, "GLIBC_PRIVATE"))) + { + buf[0] = '\0'; + t = buf; + t = stpcpy( stpcpy( stpcpy( stpcpy(t, soname), "("), s), ")"); + + t++; /* XXX "foo(bar)" already in buf. */ + + /* Add next provide dependency. */ + ds = rpmdsSingle(RPMTAG_PROVIDES, + sonameDep(t, buf, isElf64), + "", RPMSENSE_FIND_PROVIDES); + xx = add(context, ds); + (void)rpmdsFree(ds); + ds = NULL; + } + auxoffset += aux->vda_next; + } + offset += def->vd_next; + } + } + /*@switchbreak@*/ break; + case SHT_GNU_verneed: + data = NULL; + /* Only from files with executable bit set. */ + if (!skipR && is_executable) + while ((data = elf_getdata (scn, data)) != NULL) { + offset = 0; + for (cnt = (int)shdr->sh_info; --cnt >= 0; ) { + need = gelf_getverneed (data, offset, &need_mem); + if (need == NULL) + /*@innerbreak@*/ break; + + s = elf_strptr(elf, shdr->sh_link, need->vn_file); + if (s == NULL) + /*@innerbreak@*/ break; + soname = _free(soname); + soname = xstrdup(s); + auxoffset = (unsigned)(offset + need->vn_aux); + for (cnt2 = (int)need->vn_cnt; --cnt2 >= 0; ) { + GElf_Vernaux aux_mem, * aux; + + aux = gelf_getvernaux (data, auxoffset, &aux_mem); + if (aux == NULL) + /*@innerbreak@*/ break; + + s = elf_strptr(elf, shdr->sh_link, aux->vna_name); + if (s == NULL) + /*@innerbreak@*/ break; + + /* Filter dependencies that contain GLIBC_PRIVATE */ + if (soname != NULL + && !(filter_GLIBC_PRIVATE != 0 + && !strcmp(s, "GLIBC_PRIVATE"))) + { + buf[0] = '\0'; + t = buf; + t = stpcpy( stpcpy( stpcpy( stpcpy(t, soname), "("), s), ")"); + + t++; /* XXX "foo(bar)" already in buf. */ + + /* Add next require dependency. */ + ds = rpmdsSingle(RPMTAG_REQUIRENAME, + sonameDep(t, buf, isElf64), + "", RPMSENSE_FIND_REQUIRES); + xx = add(context, ds); + (void)rpmdsFree(ds); + ds = NULL; + } + auxoffset += aux->vna_next; + } + offset += need->vn_next; + } + } + /*@switchbreak@*/ break; + case SHT_DYNAMIC: + data = NULL; + while ((data = elf_getdata (scn, data)) != NULL) { + for (cnt = 0; cnt < (int)(shdr->sh_size / shdr->sh_entsize); ++cnt) { + dyn = gelf_getdyn (data, cnt, &dyn_mem); + if (dyn == NULL) + /*@innerbreak@*/ break; + s = NULL; + switch (dyn->d_tag) { + default: + /*@innercontinue@*/ continue; + /*@notreached@*/ /*@switchbreak@*/ break; + case DT_HASH: + gotHASH= 1; + /*@innercontinue@*/ continue; + case DT_GNU_HASH: + gotGNUHASH= 1; + /*@innercontinue@*/ continue; + case DT_DEBUG: + gotDEBUG = 1; + /*@innercontinue@*/ continue; + case DT_NEEDED: + /* Only from files with executable bit set. */ + if (skipR || !is_executable) + /*@innercontinue@*/ continue; + /* Add next require dependency. */ + s = elf_strptr(elf, shdr->sh_link, dyn->d_un.d_val); +assert(s != NULL); + buf[0] = '\0'; + ds = rpmdsSingle(RPMTAG_REQUIRENAME, + sonameDep(buf, s, isElf64), + "", RPMSENSE_FIND_REQUIRES); + xx = add(context, ds); + (void)rpmdsFree(ds); + ds = NULL; + /*@switchbreak@*/ break; + case DT_SONAME: + gotSONAME = 1; + if (skipP) + /*@innercontinue@*/ continue; + s = elf_strptr(elf, shdr->sh_link, dyn->d_un.d_val); +assert(s != NULL); + /* Add next provide dependency. */ + buf[0] = '\0'; + ds = rpmdsSingle(RPMTAG_PROVIDENAME, + sonameDep(buf, s, isElf64), + "", RPMSENSE_FIND_PROVIDES); + xx = add(context, ds); + (void)rpmdsFree(ds); + ds = NULL; + /*@switchbreak@*/ break; + } + } + } + /*@switchbreak@*/ break; + } + } + /*@=uniondef @*/ + + /* For DSOs which use the .gnu_hash section and don't have a .hash + * section, we need to ensure that we have a new enough glibc. */ + if (gotGNUHASH && !gotHASH) { + ds = rpmdsSingle(RPMTAG_REQUIRENAME, "rtld(GNU_HASH)", "", + RPMSENSE_FIND_REQUIRES); + xx = add(context, ds); + (void)rpmdsFree(ds); + ds = NULL; + } + + /* For DSO's, provide the basename of the file if DT_SONAME not found. */ + if (!skipP && isDSO && !gotDEBUG && !gotSONAME) { + s = strrchr(fn, '/'); + if (s != NULL) + s++; + else + s = fn; +assert(s != NULL); + + /* Add next provide dependency. */ + buf[0] = '\0'; + ds = rpmdsSingle(RPMTAG_PROVIDENAME, + sonameDep(buf, s, isElf64), "", RPMSENSE_FIND_PROVIDES); + xx = add(context, ds); + (void)rpmdsFree(ds); + ds = NULL; + } + +exit: + soname = _free(soname); + if (elf) (void) elf_end(elf); + if (fdno > 0) + xx = close(fdno); + return 0; +#else + return -1; +#endif +} +/*@=moduncon =noeffectuncon @*/ + + +#if defined(RPM_VENDOR_MANDRIVA) +/** + * Return a soname dependency constructed from an elf string, Mandriva-style. + * @retval t soname dependency + * @param s elf string (NULL uses "") + * @param isElf64 is this an ELF64 symbol? + */ +#if defined(HAVE_GELF_H) && defined(HAVE_LIBELF) && !defined(__FreeBSD__) +static char * mdvSonameDep(/*@returned@*/ char * t, const char * s, int isElf64, int devel) + /*@modifies t @*/ +{ + char *tmp = t; + *t = '\0'; + if (devel) { + tmp = stpcpy(t, "devel("); + } +#if !defined(__alpha__) && !defined(__sun) + if (!isElf64) { + /* XXX: eehhk, would've been nice with consistency, mandriva legacy... :| */ + if (!devel && s[strlen(s)-1] != ')') + (void) stpcpy( stpcpy(tmp, s), "()(64bit)"); + else { + tmp = stpcpy(tmp, s); + if (devel) + tmp = strstr(t, ".so"); + tmp = stpcpy(tmp, "(64bit)"); + } + }else +#endif + tmp = stpcpy(tmp, s); + if (devel) { + char *suffix = strstr(t, ".so"); + if (suffix) + tmp = suffix; + tmp = stpcpy(tmp, ")"); + } + + return t; +} +#endif + +/** \ingroup rpmds + * Extract dependencies from a symlink. + * XXX Prototype added to keep GCC quiet and avoid adding a symbol. + * @param fn file name + * @param flags 1: skip provides 2: skip requires + * @param *add add(arg, ds) saves next provide/require symlink dependency. + * @param context add() callback context + * @return 0 on success + */ +int rpmdsSymlink(const char * fn, int flags, + int (*add) (void * context, rpmds ds), void * context) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/; +int rpmdsSymlink(const char * fn, int flags, + int (*add) (void * context, rpmds ds), void * context) +{ +#if defined(HAVE_GELF_H) && defined(HAVE_LIBELF) && !defined(__FreeBSD__) + Elf * elf; + Elf_Scn * scn; + Elf_Data * data; + GElf_Ehdr ehdr_mem, * ehdr; + GElf_Shdr shdr_mem, * shdr; + GElf_Dyn dyn_mem, * dyn; + int fdno; + int cnt; + int i; + char buf[BUFSIZ]; + const char * s; + int is_executable; + const char * soname = NULL; + rpmds ds; + int xx; + int isElf64; + int gotSONAME = 0; + int skipP = (flags & RPMELF_FLAG_SKIPPROVIDES); + int skipR = (flags & RPMELF_FLAG_SKIPREQUIRES); + int lnklen; + char path[MAXPATHLEN]; + /* + * We filter out these as they come with glibc, making dependencies on + * them rather redundant. + */ + const char *filterRequires[] = {"ld-linux", "ld64-linux" "libBrokenLocale.so", + "libanl.so", "libc.so", "libcidn.so", "libcrypt.so", "libdl.so", "libm.so", + "libnsl.so", "libnss_compat.so", "libnss_dns.so", "libnss_files.so", + "libnss_hesiod.so", "libnss_nis.so", "libnss_nisplus.so", "libpthread.so", + "libresolv.so", "librt.so", "libutil.so", "libthread_db.so"}; + ARGV_t deps = NULL; + + /* Filename must end with ".so" to be devel(...) dependency. */ + if ((s = strrchr(fn, '.')) && strcmp(s, ".so")) + return 0; + + if ((lnklen = readlink(fn, path, MAXPATHLEN - 1)) == -1) { + warn("%s", fn); + return -1; + } + path[lnklen] = '\0'; + +/*@-castfcnptr@*/ +if (_rpmds_debug < 0) +fprintf(stderr, "*** rpmdsELF(%s, %d, %p, %p)\n", fn, flags, (void *)add, context); +/*@=castfcnptr@*/ + + /* Extract dependencies only from files with executable bit set. */ + { struct stat sb, * st = &sb; + if (lstat(fn, st) != 0) + return -1; + is_executable = (int)(st->st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)); + } + + fdno = open(fn, O_RDONLY); + if (fdno < 0) + return fdno; + + (void) elf_version(EV_CURRENT); + +/*@-evalorder@*/ + elf = NULL; + if ((elf = elf_begin (fdno, ELF_C_READ, NULL)) == NULL + || elf_kind(elf) != ELF_K_ELF + || (ehdr = gelf_getehdr(elf, &ehdr_mem)) == NULL + || !(ehdr->e_type == ET_DYN || ehdr->e_type == ET_EXEC)) + goto exit; +/*@=evalorder@*/ + + isElf64 = ehdr->e_ident[EI_CLASS] == ELFCLASS64; + + /*@-uniondef @*/ + scn = NULL; + while ((scn = elf_nextscn(elf, scn)) != NULL) { + shdr = gelf_getshdr(scn, &shdr_mem); + if (shdr == NULL) + break; + + soname = _free(soname); + switch (shdr->sh_type) { + default: + continue; + /*@notreached@*/ /*@switchbreak@*/ break; + case SHT_DYNAMIC: + data = NULL; + while ((data = elf_getdata (scn, data)) != NULL) { + for (cnt = 0; cnt < (int)(shdr->sh_size / shdr->sh_entsize); ++cnt) { + dyn = gelf_getdyn (data, cnt, &dyn_mem); + if (dyn == NULL) + /*@innerbreak@*/ break; + s = NULL; + switch (dyn->d_tag) { + default: + /*@innercontinue@*/ continue; + /*@notreached@*/ /*@switchbreak@*/ break; + case DT_NEEDED: + /* Only from files with executable bit set. */ + if (skipR || !is_executable) + /*@innercontinue@*/ continue; + /* Add next require dependency. */ + s = elf_strptr(elf, shdr->sh_link, dyn->d_un.d_val); +assert(s != NULL); + buf[0] = '\0'; + + for (i = 0; i < (int)(sizeof(filterRequires)/sizeof(filterRequires[0])); i++) + if (!strncmp(s, filterRequires[i], strlen(filterRequires[i]))) + break; + + if (sizeof(filterRequires)/sizeof(filterRequires[0]) == i) + argvAdd(&deps, s); + /*@switchbreak@*/ break; + case DT_SONAME: + gotSONAME = 1; + s = elf_strptr(elf, shdr->sh_link, dyn->d_un.d_val); +assert(s != NULL); + /* Add next provide dependency. */ + buf[0] = '\0'; + + if (!skipP) { + ds = rpmdsSingle(RPMTAG_PROVIDENAME, + mdvSonameDep(buf, s, isElf64, 1), + "", RPMSENSE_FIND_PROVIDES); + xx = add(context, ds); + (void)rpmdsFree(ds); + ds = NULL; + } + /*@switchbreak@*/ break; + } + } + } + /*@switchbreak@*/ break; + } + } + /*@=uniondef @*/ + +exit: + if (gotSONAME && !skipR) + for (i = 0, cnt = argvCount(deps); i < cnt; i++) { + ds = rpmdsSingle(RPMTAG_REQUIRENAME, + mdvSonameDep(buf, deps[i], isElf64, 1), + "", RPMSENSE_FIND_REQUIRES); + xx = add(context, ds); + (void)rpmdsFree(ds); + ds = NULL; + } + + deps = argvFree(deps); + if (elf) (void) elf_end(elf); + if (fdno > 0) + xx = close(fdno); + return 0; +#else + return -1; +#endif +} +#endif /* RPM_VENDOR_MANDRIVA */ + +#define _SBIN_LDCONFIG_P "/sbin/ldconfig -p" +/*@unchecked@*/ /*@observer@*/ /*@owned@*/ /*@relnull@*/ +static const char * _ldconfig_cmd = _SBIN_LDCONFIG_P; + +#define _LD_SO_CACHE "/etc/ld.so.cache" +/*@unchecked@*/ /*@observer@*/ /*@owned@*/ /*@relnull@*/ +static const char * _ldconfig_cache = NULL; + +int rpmdsLdconfig(rpmPRCO PRCO, const char * fn) + /*@globals _ldconfig_cmd, _ldconfig_cache @*/ + /*@modifies _ldconfig_cmd, _ldconfig_cache @*/ +{ + char buf[BUFSIZ]; + const char *DSOfn; + const char *N, *EVR; + evrFlags Flags = (evrFlags) 0; + rpmds ds; + char * f, * fe; + char * g, * ge; + char * t; + FILE * fp = NULL; + int rc = -1; + int xx; + + if (PRCO == NULL) + return -1; + +/*@-modobserver@*/ + if (_ldconfig_cmd == NULL) { + _ldconfig_cmd = rpmExpand("%{?_rpmds_ldconfig_cmd}", NULL); + if (!(_ldconfig_cmd != NULL && *_ldconfig_cmd == '/')) { +/*@-observertrans @*/ + _ldconfig_cmd = _free(_ldconfig_cmd); +/*@=observertrans @*/ + _ldconfig_cmd = xstrdup(_SBIN_LDCONFIG_P); + } + } + + if (_ldconfig_cache == NULL) { + _ldconfig_cache = rpmExpand("%{?_rpmds_ldconfig_cache}", NULL); + /* XXX may need to validate path existence somewhen. */ + if (!(_ldconfig_cache != NULL && *_ldconfig_cache == '/')) { +/*@-observertrans @*/ + _ldconfig_cache = _free(_ldconfig_cache); +/*@=observertrans @*/ + _ldconfig_cache = xstrdup(_LD_SO_CACHE); + } + } +/*@=modobserver@*/ + + if (fn == NULL) + fn = _ldconfig_cache; + +if (_rpmds_debug < 0) +fprintf(stderr, "*** rpmdsLdconfig(%p, %s) P %p R %p C %p O %p T %p D %p L %p\n", PRCO, fn, PRCO->Pdsp, PRCO->Rdsp, PRCO->Cdsp, PRCO->Odsp, PRCO->Tdsp, PRCO->Ddsp, PRCO->Ldsp); + + fp = popen(_ldconfig_cmd, "r"); + if (fp == NULL) + goto exit; + + while((f = fgets(buf, (int)sizeof(buf), fp)) != NULL) { + EVR = NULL; + /* rtrim on line. */ + ge = f + strlen(f); + while (--ge > f && _isspace(*ge)) + *ge = '\0'; + + /* ltrim on line. */ + while (*f && _isspace(*f)) + f++; + + /* split on '=>' */ + fe = f; + while (*fe && !(fe[0] == '=' && fe[1] == '>')) + fe++; + if (*fe == '\0') + continue; + + /* find the DSO file name. */ + DSOfn = fe + 2; + + /* ltrim on DSO file name. */ + while (*DSOfn && _isspace(*DSOfn)) + DSOfn++; + if (*DSOfn == '\0') + continue; + + /* rtrim from "=>" */ + if (fe > f && fe[-1] == ' ') fe[-1] = '\0'; + *fe++ = '\0'; + *fe++ = '\0'; + g = fe; + + /* ltrim on field 2. */ + while (*g && _isspace(*g)) + g++; + if (*g == '\0') + continue; + + /* split out flags */ + for (t = f; *t != '\0'; t++) { + if (!_isspace(*t)) + /*@innercontinue@*/ continue; + *t++ = '\0'; + /*@innerbreak@*/ break; + } + /* XXX "libc4" "ELF" "libc5" "libc6" _("unknown") */ + /* XXX use flags to generate soname color */ + /* ",64bit" ",IA-64" ",x86-64", ",64bit" are color = 2 */ + /* ",N32" for mips64/libn32 */ + + /* XXX use flags and LDASSUME_KERNEL to skip sonames? */ + /* "Linux" "Hurd" "Solaris" "FreeBSD" "kNetBSD" N_("Unknown OS") */ + /* ", OS ABI: %s %d.%d.%d" */ + + N = f; + if (EVR == NULL) + EVR = ""; + Flags = (evrFlags) (Flags | RPMSENSE_PROBE); + ds = rpmdsSingle(RPMTAG_PROVIDENAME, N, EVR, Flags); + xx = rpmdsMerge(PRCO->Pdsp, ds); + (void)rpmdsFree(ds); + ds = NULL; + + xx = rpmdsELF(DSOfn, 0, rpmdsMergePRCO, PRCO); + } + rc = 0; + +exit: + if (fp != NULL) (void) pclose(fp); + return rc; +} + + +#if defined(__sun) +#define _RLD_SEARCH_PATH "/lib:/usr/lib" +/*@unchecked@*/ /*@observer@*/ /*@owned@*/ /*@relnull@*/ +static const char * _rld_search_path = NULL; + +/* search a colon-separated list of directories for shared objects */ +int rpmdsRldpath(rpmPRCO PRCO, const char * rldp) + /*@globals _rld_search_path @*/ + /*@modifies _rld_search_path @*/ +{ + char buf[BUFSIZ]; + const char *N, *EVR; + evrFlags Flags = 0; + rpmds ds; + const char * f; + const char * g; + int rc = -1; + int xx; + glob_t gl; + char ** gp; + + if (PRCO == NULL) + return -1; + +/*@-modobserver@*/ + if (_rld_search_path == NULL) { + _rld_search_path = rpmExpand("%{?_rpmds_rld_search_path}", NULL); + /* XXX may need to validate path existence somewhen. */ + if (!(_rld_search_path != NULL && *_rld_search_path == '/')) { +/*@-observertrans @*/ + _rld_search_path = _free(_rld_search_path); +/*@=observertrans @*/ + _rld_search_path = xstrdup(_RLD_SEARCH_PATH); + } + } +/*@=modobserver@*/ + + if (rldp == NULL) + rldp = _rld_search_path; + +if (_rpmds_debug > 0) +fprintf(stderr, "*** rpmdsRldpath(%p, %s) P %p R %p C %p O %p\n", PRCO, rldp, PRCO->Pdsp, PRCO->Rdsp, PRCO->Cdsp, PRCO->Odsp); + + f = rldp; + /* move through the path, splitting on : */ + while (f) { + EVR = NULL; + g = strchr(f, ':'); + if (g == NULL) { + strcpy(buf, f); + /* this is the last element, no more :'s */ + f = NULL; + } else { + /* copy this chunk to buf */ + strncpy(buf, f, g - f + 1); + buf[g-f] = '\0'; + + /* get ready for next time through */ + f = g + 1; + } + + if ( !(strlen(buf) > 0 && buf[0] == '/') ) + continue; + + /* XXX: danger, buffer len */ + /* XXX: *.so.* should be configurable via a macro */ + strcat(buf, "/*.so.*"); + +if (_rpmds_debug > 0) +fprintf(stderr, "*** rpmdsRldpath(%p, %s) globbing %s\n", PRCO, rldp, buf); + + xx = Glob(buf, 0, NULL, &gl); + if (xx) /* glob error, probably GLOB_NOMATCH */ + continue; + +if (_rpmds_debug > 0) +fprintf(stderr, "*** rpmdsRldpath(%p, %s) glob matched %d files\n", PRCO, rldp, gl.gl_pathc); + + gp = gl.gl_pathv; + /* examine each match */ + while (gp && *gp) { + const char *DSOfn; + /* XXX: should probably verify that we matched a file */ + DSOfn = *gp; + gp++; + if (EVR == NULL) + EVR = ""; + + /* N needs to be basename of DSOfn */ + N = DSOfn + strlen(DSOfn); + while (N > DSOfn && *N != '/') + --N; + + Flags |= RPMSENSE_PROBE; + ds = rpmdsSingle(RPMTAG_PROVIDENAME, N, EVR, Flags); + xx = rpmdsMerge(PRCO->Pdsp, ds); + (void)rpmdsFree(ds); + ds = NULL; + + xx = rpmdsELF(DSOfn, 0, rpmdsMergePRCO, PRCO); + } +/*@-immediatetrans@*/ + Globfree(&gl); +/*@=immediatetrans@*/ + } + rc = 0; + + return rc; +} + +#define _SOLARIS_CRLE "/usr/sbin/crle" +/*@unchecked@*/ /*@observer@*/ /*@owned@*/ /*@relnull@*/ +static const char * _crle_cmd = NULL; + +int rpmdsCrle(rpmPRCO PRCO, /*@unused@*/ const char * fn) + /*@globals _crle_cmd @*/ + /*@modifies _crle_cmd @*/ +{ + char buf[BUFSIZ]; + char * f; + char * g, * ge; + FILE * fp = NULL; + int rc = -1; /* assume failure */ + int xx; + int found_dlp = 0; + + if (PRCO == NULL) + return -1; + +/*@-modobserver@*/ + if (_crle_cmd == NULL) { + _crle_cmd = rpmExpand("%{?_rpmds_crle_cmd}", NULL); + if (!(_crle_cmd != NULL && *_crle_cmd == '/')) { +/*@-observertrans @*/ + _crle_cmd = _free(_crle_cmd); +/*@=observertrans @*/ + _crle_cmd = xstrdup(_SOLARIS_CRLE); + } + } + + /* XXX: we rely on _crle_cmd including the -64 arg, if ELF64 */ + fp = popen(_crle_cmd, "r"); + if (fp == NULL) + return rc; + + /* + * we want the first line that contains "(ELF):" + * we cannot search for "Default Library Path (ELF):" because that + * changes in non-C locales. + */ + while((f = fgets(buf, sizeof(buf), fp)) != NULL) { + if (found_dlp) /* XXX read all data? */ + continue; + + g = strstr(f, "(ELF):"); + if (g == NULL) + continue; + + found_dlp = 1; + f = g + (sizeof("(ELF):")-1); + while (_isspace(*f)) + f++; + + /* rtrim path */ + ge = f + strlen(f); + while (--ge > f && _isspace(*ge)) + *ge = '\0'; + } + xx = pclose(fp); + + /* we have the loader path, let rpmdsRldpath() do the work */ + if (found_dlp) + rc = rpmdsRldpath(PRCO, f); + + return rc; +} +#endif + +int rpmdsUname(rpmds *dsp, const struct utsname * un) +{ +/*@observer@*/ + static const char * NS = "uname"; + struct utsname myun; + int rc = -1; + int xx; + + if (un == NULL) { + xx = uname(&myun); + if (xx != 0) + goto exit; + un = &myun; + } + +/*@-type@*/ + /* XXX values need to be checked for EVR (i.e. no '-' character.) */ + if (un->sysname != NULL) + rpmdsNSAdd(dsp, NS, "sysname", un->sysname, RPMSENSE_EQUAL); + if (un->nodename != NULL) + rpmdsNSAdd(dsp, NS, "nodename", un->nodename, RPMSENSE_EQUAL); + if (un->release != NULL) + rpmdsNSAdd(dsp, NS, "release", un->release, RPMSENSE_EQUAL); +#if 0 /* XXX has embedded spaces */ + if (un->version != NULL) + rpmdsNSAdd(dsp, NS, "version", un->version, RPMSENSE_EQUAL); +#endif + if (un->machine != NULL) + rpmdsNSAdd(dsp, NS, "machine", un->machine, RPMSENSE_EQUAL); +#if defined(__linux__) + if (un->domainname != NULL && strcmp(un->domainname, "(none)")) + rpmdsNSAdd(dsp, NS, "domainname", un->domainname, RPMSENSE_EQUAL); +#endif +/*@=type@*/ + rc = 0; + +exit: + return rc; +} + +#define _PERL_PROVIDES "/usr/bin/find /usr/lib/perl5 | /usr/lib/rpm/perl.prov" +/*@unchecked@*/ /*@observer@*/ /*@owned@*/ /*@relnull@*/ +static const char * _perldeps_cmd = NULL; + +int rpmdsPipe(rpmds * dsp, rpmTag tagN, const char * cmd) + /*@globals _perldeps_cmd @*/ + /*@modifies _perldeps_cmd @*/ +{ + char buf[BUFSIZ]; + const char *N, *EVR; + evrFlags Flags = (evrFlags) 0; + rpmds ds; + char * f, * fe; + char * g, * ge; + FILE * fp = NULL; + const char * fn = "pipe"; + int rc = -1; + int cmdprinted; + int ln; + int xx; + +/*@-modobserver@*/ + if (_perldeps_cmd == NULL) { + _perldeps_cmd = rpmExpand("%{?_rpmds_perldeps_cmd}", NULL); + /* XXX may need to validate path existence somewhen. */ + if (!(_perldeps_cmd != NULL && *_perldeps_cmd == '/')) { +/*@-observertrans @*/ + _perldeps_cmd = _free(_perldeps_cmd); +/*@=observertrans @*/ + _perldeps_cmd = xstrdup(_PERL_PROVIDES); + } + } +/*@=modobserver@*/ + + if (tagN <= 0) + tagN = RPMTAG_PROVIDENAME; + if (cmd == NULL) + cmd = _perldeps_cmd; + + fp = popen(cmd, "r"); + if (fp == NULL) + goto exit; + + ln = 0; + cmdprinted = 0; + while((f = fgets(buf, (int)sizeof(buf), fp)) != NULL) { + ln++; + + /* insure a terminator. */ + buf[sizeof(buf)-1] = '\0'; + + /* ltrim on line. */ + while (*f && _isspace(*f)) + f++; + + /* skip empty lines and comments */ + if (*f == '\0' || *f == '#') + continue; + + /* rtrim on line. */ + fe = f + strlen(f); + while (--fe > f && _isspace(*fe)) + *fe = '\0'; + + /* split on ' ' or comparison operator. */ + fe = f; + if (*f == '!') fe++; + while (*fe && !_isspace(*fe) && strchr("!<=>", *fe) == NULL) + fe++; + while (*fe && _isspace(*fe)) + *fe++ = '\0'; + + if (!(xisalnum(f[0]) || strchr("/_%!", f[0]) != NULL)) { + if (!cmdprinted++) + fprintf(stderr, _("running \"%s\" pipe command\n"), cmd); + fprintf(stderr, _("%s:%d \"%s\" has invalid name. Skipping ...\n"), + fn, ln, f); + continue; + } + + N = f; + EVR = NULL; + Flags = (evrFlags) 0; + + /* parse for non-path, versioned dependency. */ + if (*f != '/' && *fe != '\0') { + /* parse comparison operator */ + g = fe; + Flags = rpmEVRflags(fe, (const char **)&g); + if (Flags == 0) { + if (!cmdprinted++) + fprintf(stderr, _("running \"%s\" pipe command\n"), cmd), + fprintf(stderr, _("%s:%d \"%s\" has no comparison operator. Skipping ...\n"), + fn, ln, fe); + continue; + } + *fe = '\0'; + + /* ltrim on field 2. */ + while (*g && _isspace(*g)) + g++; + if (*g == '\0') { + if (!cmdprinted++) + fprintf(stderr, _("running \"%s\" pipe command\n"), cmd), + /* XXX No EVR comparison value found. */ + fprintf(stderr, _("\tline %d: No EVR comparison value found.\n Skipping ..."), + ln); + fprintf(stderr, _("%s:%d \"%s\" has no EVR string. Skipping ...\n"), + fn, ln, f); + continue; + } + + ge = g + 1; + while (*ge && !_isspace(*ge)) + ge++; + + if (*ge != '\0') + *ge = '\0'; /* XXX can't happen, line rtrim'ed already. */ + + EVR = g; + } + + if (EVR == NULL) + EVR = ""; + Flags = (evrFlags) (Flags | RPMSENSE_PROBE); + ds = rpmdsSingle(tagN, N, EVR, Flags); + xx = rpmdsMerge(dsp, ds); + (void)rpmdsFree(ds); + ds = NULL; + } + rc = 0; + +exit: + if (fp != NULL) (void) pclose(fp); + return rc; +} + +static int rpmdsNAcmp(rpmds A, rpmds B) + /*@*/ +{ + const char * AN = A->ns.N; + const char * AA = A->ns.A; + const char * BN = B->ns.N; + const char * BA = B->ns.A; + int rc; + + if (!AA && !BA) { + rc = strcmp(AN, BN); + } else if (AA && !BA) { + rc = strncmp(AN, BN, (AA - AN)) || BN[AA - AN]; + if (!rc) + rc = strcmp(AA, B->A); + } else if (!AA && BA) { + rc = strncmp(AN, BN, (BA - BN)) || AN[BA - BN]; + if (!rc) + rc = strcmp(BA, A->A); + } else { + rc = strcmp(AN, BN); + } + return rc; +} + +/*@unchecked@*/ /*@only@*/ /*@null@*/ +const char * evr_tuple_order = NULL; + +/** + * Return precedence permutation string. + * @return precedence permutation + */ +/*@observer@*/ +static const char * rpmdsEVRorder(void) + /*@globals evr_tuple_order @*/ + /*@modifies evr_tuple_order @*/ +{ + if (evr_tuple_order == NULL) { +/*@-mods@*/ + evr_tuple_order = rpmExpand("%{?evr_tuple_order}", NULL); +/*@=mods@*/ + if (evr_tuple_order == NULL || evr_tuple_order[0] == '\0') + evr_tuple_order = xstrdup("EVR"); + } +assert(evr_tuple_order != NULL && evr_tuple_order[0] != '\0'); +/*@-freshtrans@*/ + return evr_tuple_order; +/*@=freshtrans@*/ +} + +int rpmdsCompare(const rpmds A, const rpmds B) +{ + const char *aDepend = (A->DNEVR != NULL ? xstrdup(A->DNEVR+2) : ""); + const char *bDepend = (B->DNEVR != NULL ? xstrdup(B->DNEVR+2) : ""); + EVR_t a = (EVR_t) memset(alloca(sizeof(*a)), 0, sizeof(*a)); + EVR_t b = (EVR_t) memset(alloca(sizeof(*a)), 0, sizeof(*a)); + evrFlags aFlags = A->ns.Flags; + evrFlags bFlags = B->ns.Flags; + int (*EVRcmp) (const char *a, const char *b); + int result = 1; + const char * s; + int set_version = 0; + int sense; + int xx; + +assert((rpmdsFlags(A) & RPMSENSE_SENSEMASK) == A->ns.Flags); +assert((rpmdsFlags(B) & RPMSENSE_SENSEMASK) == B->ns.Flags); + /* Different names (and/or name.arch's) don't overlap. */ + if (rpmdsNAcmp(A, B)) { + result = 0; + goto exit; + } + + /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */ +/*@-nullderef@*/ + if (!(A->EVR && A->Flags && B->EVR && B->Flags)) + goto exit; + + /* Same name. If either A or B is an existence test, always overlap. */ + if (!(aFlags && bFlags)) + goto exit; + + /* If either EVR is non-existent or empty, always overlap. */ + if (!(A->EVR[A->i] && *A->EVR[A->i] && B->EVR[B->i] && *B->EVR[B->i])) + goto exit; + + /* Both AEVR and BEVR exist. */ + xx = (A->EVRparse ? A->EVRparse : rpmEVRparse) (A->EVR[A->i], a); + xx = (B->EVRparse ? B->EVRparse : rpmEVRparse) (B->EVR[B->i], b); + + /* If EVRcmp is identical, use that, otherwise use default. */ + EVRcmp = (A->EVRcmp && B->EVRcmp && A->EVRcmp == B->EVRcmp) + ? A->EVRcmp : rpmvercmp; + + /* Compare {A,B} [epoch:]version[-release][:distepoch] */ + sense = 0; + for (s = rpmdsEVRorder(); *s; s++) { + int ix; + switch ((int)*s) { + default: continue; /*@notreached@*//*@switchbreak@*/ break; + case 'E': + ix = RPMEVR_E; + if (a->F[ix] && *a->F[ix] && b->F[ix] && *b->F[ix]) { + /* XXX ALT version-set comparison */ + if (!strcmp(a->F[ix], "set") && !strcmp(b->F[ix], "set")) + set_version = 1; + /*@switchbreak@*/ break; + } + + /* XXX Special handling for missing Epoch: tags hysteria */ + if (a->F[ix] && *a->F[ix] && atol(a->F[ix]) > 0) { + if (!B->nopromote) { + int lvl = (_rpmds_unspecified_epoch_noise + ? RPMLOG_WARNING : RPMLOG_DEBUG); + rpmlog(lvl, _("The \"B\" dependency needs an epoch (assuming same epoch as \"A\")\n\tA = \"%s\"\tB = \"%s\"\n"), + aDepend, bDepend); + sense = 0; + } else + sense = 1; + } else + if (b->F[ix] && *b->F[ix] && atol(b->F[ix]) > 0) + sense = -1; + /*@switchbreak@*/ break; + case 'V': ix = RPMEVR_V; /*@switchbreak@*/break; + case 'R': ix = RPMEVR_R; /*@switchbreak@*/break; + case 'D': ix = RPMEVR_D; /*@switchbreak@*/break; + } +#if defined(RPM_VENDOR_MANDRIVA) /* mdvbz#55810 */ + if(ix >= RPMEVR_R && (bFlags & (~RPMSENSE_GREATER & RPMSENSE_EQUAL)) + && !(ix == RPMEVR_D && (bFlags & RPMSENSE_LESS)) + && *(b->F[ix]) == '\0') + break; + if (a->F[ix] && b->F[ix]) +#else + if (a->F[ix] && *a->F[ix] && b->F[ix] && *b->F[ix]) +#endif + { + /* XXX ALT version-set comparison */ + if (ix == RPMEVR_V && set_version) { + set_version = 0; + sense = rpmsetCmp(a->F[ix], b->F[ix]); + if (sense < -1) { + if (sense == -3) + rpmlog(RPMLOG_WARNING, _("failed to decode %s\n"), a->F[ix]); + if (sense == -4) + rpmlog(RPMLOG_WARNING, _("failed to decode %s\n"), b->F[ix]); + /* neither is subset of each other */ + sense = 0; + } + } else +/*@i@*/ sense = EVRcmp(a->F[ix], b->F[ix]); + } + if (sense) + break; + } + + a->str = _free(a->str); + b->str = _free(b->str); + + /* Detect overlap of {A,B} range. */ + if (aFlags == RPMSENSE_NOTEQUAL || bFlags == RPMSENSE_NOTEQUAL) { + result = (sense != 0); + } else if (sense < 0 && ((aFlags & RPMSENSE_GREATER) || (bFlags & RPMSENSE_LESS))) { + result = 1; + } else if (sense > 0 && ((aFlags & RPMSENSE_LESS) || (bFlags & RPMSENSE_GREATER))) { + result = 1; + } else if (sense == 0 && + (((aFlags & RPMSENSE_EQUAL) && (bFlags & RPMSENSE_EQUAL)) || + ((aFlags & RPMSENSE_LESS) && (bFlags & RPMSENSE_LESS)) || + ((aFlags & RPMSENSE_GREATER) && (bFlags & RPMSENSE_GREATER)))) { + result = 1; + } else + result = 0; +/*@=nullderef@*/ + +exit: + if (_noisy_range_comparison_debug_message) + rpmlog(RPMLOG_DEBUG, D_(" %s A %s\tB %s\n"), + (result ? _("YES") : _("NO ")), aDepend, bDepend); + aDepend = _free(aDepend); + bDepend = _free(bDepend); + return result; +} + +int rpmdsMatch(const rpmds A, rpmds B) +{ + int result = 0; + + /* If A dependency matches any in B, we're done. */ + if ((B = rpmdsInit(B)) != NULL) + while (rpmdsNext(B) >= 0) + if ((result = rpmdsCompare(A, B))) + break; + return result; +} + +void rpmdsProblem(rpmps ps, const char * pkgNEVR, const rpmds ds, + const fnpyKey * suggestedKeys, int adding) +{ + const char * Name = rpmdsN(ds); + const char * DNEVR = rpmdsDNEVR(ds); + const char * EVR = rpmdsEVR(ds); + rpmProblemType type; + fnpyKey key; + + if (ps == NULL) return; + + if (Name == NULL) Name = "?N?"; + if (EVR == NULL) EVR = "?EVR?"; + if (DNEVR == NULL) DNEVR = "? ?N? ?OP? ?EVR?"; + + rpmlog(RPMLOG_DEBUG, D_("package %s has unsatisfied %s: %s\n"), + pkgNEVR, ds->Type, DNEVR+2); + + switch ((unsigned)DNEVR[0]) { + case 'C': type = RPMPROB_CONFLICT; break; + default: + case 'R': type = RPMPROB_REQUIRES; break; + } + + key = (suggestedKeys ? suggestedKeys[0] : NULL); + rpmpsAppend(ps, type, pkgNEVR, key, NULL, NULL, DNEVR, adding); +} + +int rpmdsAnyMatchesDep (const Header h, const rpmds req, int nopromote) +{ + int scareMem = 0; + rpmds provides = NULL; + evrFlags reqFlags = req->ns.Flags; + int result = 1; + +assert((rpmdsFlags(req) & RPMSENSE_SENSEMASK) == req->ns.Flags); + /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */ + if (req->EVR == NULL || req->Flags == NULL) + goto exit; + + switch(req->ns.Type) { + default: + /* Primary key retrieve satisfes an existence compare. */ + if (!reqFlags || !req->EVR[req->i] || *req->EVR[req->i] == '\0') + goto exit; + /*@fallthrough@*/ + case RPMNS_TYPE_ARCH: + break; + } + + /* Get provides information from header */ + provides = rpmdsInit(rpmdsNew(h, RPMTAG_PROVIDENAME, scareMem)); + if (provides == NULL) { + result = 0; + goto exit; /* XXX should never happen */ + } + if (nopromote) + (void) rpmdsSetNoPromote(provides, nopromote); + + /* + * Rpm prior to 3.0.3 did not have versioned provides. + * If no provides version info is available, match any/all requires + * with same name. + */ + if (provides->EVR == NULL) + goto exit; + + /* If any provide matches the require, we're done. */ + result = 0; + if (provides != NULL) + while (rpmdsNext(provides) >= 0) + if ((result = rpmdsCompare(provides, req))) + break; + +exit: + (void)rpmdsFree(provides); + provides = NULL; + + return result; +} + +int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + const char * pkgN, * V, * R; +#ifdef RPM_VENDOR_MANDRIVA + const char * D; + int gotD = 0; +#endif + rpmuint32_t E; + int gotE = 0; + const char * pkgEVR; + char * t; + evrFlags reqFlags = req->ns.Flags; + evrFlags pkgFlags = RPMSENSE_EQUAL; + int result = 1; + rpmds pkg; + size_t nb; + +assert((rpmdsFlags(req) & RPMSENSE_SENSEMASK) == req->ns.Flags); + /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */ + if (req->EVR == NULL || req->Flags == NULL) + goto exit; + + if (!(reqFlags && req->EVR[req->i] && *req->EVR[req->i])) + goto exit; + + /* Get package information from header */ +/*@-mods@*/ + (void) headerNEVRA(h, &pkgN, NULL, &V, &R, NULL); +/*@=mods@*/ + /* XXX segfault avoidance */ + if (pkgN == NULL) pkgN = xstrdup("N"); + if (V == NULL) V = xstrdup("V"); + if (R == NULL) R = xstrdup("R"); + he->tag = RPMTAG_EPOCH; + gotE = headerGet(h, he, 0); + E = (he->p.ui32p ? he->p.ui32p[0] : 0); + he->p.ptr = _free(he->p.ptr); + +#if defined(RPM_VENDOR_MANDRIVA) + he->tag = RPMTAG_DISTEPOCH; + gotD = headerGet(h, he, 0); + D = (he->p.str ? he->p.str : NULL); +#endif + + nb = 21 + 1 + 1; + if (V) nb += strlen(V); + if (R) nb += strlen(R); +#if defined(RPM_VENDOR_MANDRIVA) + if (gotD) nb += strlen(D) + 1; +#endif + pkgEVR = t = (char *) alloca(nb); + *t = '\0'; + if (gotE) { + sprintf(t, "%d:", E); + t += strlen(t); + } + t = stpcpy( stpcpy( stpcpy(t, V) , "-") , R); +#if defined(RPM_VENDOR_MANDRIVA) + if (gotD) { + t = stpcpy( stpcpy( t, ":"), D); + D = _free(D); + } +#endif + V = _free(V); + R = _free(R); + + if ((pkg = rpmdsSingle(RPMTAG_PROVIDENAME, pkgN, pkgEVR, pkgFlags)) != NULL) { + if (nopromote) + (void) rpmdsSetNoPromote(pkg, nopromote); + result = rpmdsCompare(pkg, req); + (void)rpmdsFree(pkg); + pkg = NULL; + } + pkgN = _free(pkgN); + +exit: + return result; +} + +int rpmdsNegateRC(const rpmds ds, int rc) +{ + if (ds->ns.str[0] == '!') + rc = (rc == 0); + return rc; +} diff --git a/rpm-5.4.9/lib/rpmds.h b/rpm-5.4.9/lib/rpmds.h new file mode 100644 index 0000000..0afa7f7 --- /dev/null +++ b/rpm-5.4.9/lib/rpmds.h @@ -0,0 +1,828 @@ +#ifndef H_RPMDS +#define H_RPMDS + +/** \ingroup rpmds + * \file lib/rpmds.h + * Structure(s) used for dependency tag sets. + */ + +#include +#define _RPMNS_INTERNAL +#include +#include + +/** \ingroup rpmds + */ +/*@-exportlocal@*/ +/*@unchecked@*/ +extern int _rpmds_debug; +/*@=exportlocal@*/ + +/** \ingroup rpmds + */ +/*@unchecked@*/ /*@observer@*/ /*@owned@*/ /*@null@*/ +extern const char *_sysinfo_path; + +/** \ingroup rpmds + */ +/*@-exportlocal@*/ +/*@unchecked@*/ +extern int _rpmds_nopromote; +/*@=exportlocal@*/ + +#if defined(_RPMDS_INTERNAL) +#include + +/** \ingroup rpmds + * A dependency set. + */ +struct rpmds_s { + struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ +/*@observer@*/ + const char * Type; /*!< Tag name. */ +/*@only@*/ /*@null@*/ + const char * DNEVR; /*!< Formatted dependency string. */ +/*@refcounted@*/ /*@null@*/ + Header h; /*!< Header for dependency set (or NULL) */ +/*@only@*/ /*@relnull@*/ + const char ** N; /*!< Name. */ +/*@only@*/ /*@relnull@*/ + const char ** EVR; /*!< Epoch-Version-Release. */ +/*@only@*/ /*@relnull@*/ + evrFlags * Flags; /*!< Bit(s) identifying context/comparison. */ +/*@only@*/ /*@null@*/ + rpmuint32_t * Color; /*!< Bit(s) calculated from file color(s). */ +/*@only@*/ /*@null@*/ + rpmuint32_t * Refs; /*!< No. of file refs. */ +/*@only@*/ /*@null@*/ + rpmint32_t * Result; /*!< Dependency check result. */ +/*@null@*/ + int (*EVRparse) (const char *evrstr, EVR_t evr); /* EVR parsing. */ + int (*EVRcmp) (const char *a, const char *b); /* EVR comparison. */ + struct rpmns_s ns; /*!< Name (split). */ +/*@only@*/ /*@null@*/ + miRE exclude; /*!< Iterator exclude patterns. */ + int nexclude; /*!< No. of exclude patterns. */ +/*@only@*/ /*@null@*/ + miRE include; /*!< Iterator include patterns. */ + int ninclude; /*!< No. of include patterns. */ +/*@only@*/ /*@null@*/ + const char * A; /*!< Arch (from containing package). */ + rpmuint32_t BT; /*!< Package build time tie breaker. */ + rpmTag tagN; /*!< Header tag. */ + rpmuint32_t Count; /*!< No. of elements */ + int i; /*!< Element index. */ + unsigned l; /*!< Low element (bsearch). */ + unsigned u; /*!< High element (bsearch). */ + int nopromote; /*!< Don't promote Epoch: in rpmdsCompare()? */ +#if defined(__LCLINT__) +/*@refs@*/ + int nrefs; /*!< (unused) keep splint happy */ +#endif +}; +#endif /* _RPMDS_INTERNAL */ + +#if defined(_RPMPRCO_INTERNAL) +/** \ingroup rpmds + * Container for provides/requires/conflicts/obsoletes dependency set(s). + */ +struct rpmPRCO_s { + struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ +/*@dependent@*/ /*@relnull@*/ + rpmds * Pdsp; /*!< Provides: collector. */ +/*@dependent@*/ /*@relnull@*/ + rpmds * Rdsp; /*!< Requires: collector. */ +/*@dependent@*/ /*@relnull@*/ + rpmds * Cdsp; /*!< Conflicts: collector. */ +/*@dependent@*/ /*@relnull@*/ + rpmds * Odsp; /*!< Obsoletes: collector. */ +/*@dependent@*/ /*@relnull@*/ + rpmds * Tdsp; /*!< Triggers collector. */ +/*@dependent@*/ /*@relnull@*/ + rpmds * Ddsp; /*!< Dirnames collector. */ +/*@dependent@*/ /*@relnull@*/ + rpmds * Ldsp; /*!< Linktos collector. */ +/*@refcounted@*/ /*@null@*/ + rpmds my; /*!< N = EVR */ +/*@refcounted@*/ /*@null@*/ + rpmds P; /*!< Provides: */ +/*@refcounted@*/ /*@null@*/ + rpmds R; /*!< Requires: */ +/*@refcounted@*/ /*@null@*/ + rpmds C; /*!< Conflicts: */ +/*@refcounted@*/ /*@null@*/ + rpmds O; /*!< Obsoletes: */ +/*@refcounted@*/ /*@null@*/ + rpmds T; /*!< Triggers */ +/*@refcounted@*/ /*@null@*/ + rpmds D; /*!< Dirnames */ +/*@refcounted@*/ /*@null@*/ + rpmds L; /*!< Linktos */ +#if defined(__LCLINT__) +/*@refs@*/ + int nrefs; /*!< (unused) keep splint happy */ +#endif +}; +#endif /* _RPMPRCO_INTERNAL */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \name RPMDS */ +/*@{*/ + +/** \ingroup rpmds + * Unreference a dependency set instance. + * @param ds dependency set + * @param msg + * @return NULL on last dereference + */ +/*@unused@*/ /*@null@*/ +rpmds rpmdsUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmds ds, + /*@null@*/ const char * msg) + /*@modifies ds @*/; +#define rpmdsUnlink(_ds, _msg) \ + ((rpmds)rpmioUnlinkPoolItem((rpmioItem)(_ds), _msg, __FILE__, __LINE__)) + +/** \ingroup rpmds + * Reference a dependency set instance. + * @param ds dependency set + * @param msg + * @return new dependency set reference + */ +/*@unused@*/ /*@newref@*/ /*@null@*/ +rpmds rpmdsLink (/*@null@*/ rpmds ds, /*@null@*/ const char * msg) + /*@modifies ds @*/; +#define rpmdsLink(_ds, _msg) \ + ((rpmds)rpmioLinkPoolItem((rpmioItem)(_ds), _msg, __FILE__, __LINE__)) + +/** \ingroup rpmds + * Destroy a dependency set. + * @param ds dependency set + * @return NULL on last dereference + */ +/*@null@*/ +rpmds rpmdsFree(/*@killref@*/ /*@null@*/ rpmds ds) + /*@modifies ds @*/; +#define rpmdsFree(_ds) \ + ((rpmds)rpmioFreePoolItem((rpmioItem)(_ds), __FUNCTION__, __FILE__, __LINE__)) + +/** \ingroup rpmds + * Create and load a dependency set. + * @param h header + * @param tagN type of dependency + * @param flags scareMem(0x1), nofilter(0x2) + * @return new dependency set + */ +/*@null@*/ +rpmds rpmdsNew(Header h, rpmTag tagN, int flags) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies h, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmds + * Return N string, expanded if necessary. + * @param ds dependency set + * @return new N string (malloc'ed) + */ +/*@dependent@*/ /*@observer@*/ /*@null@*/ +const char * rpmdsNewN(rpmds ds) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies ds, rpmGlobalMacroContext, internalState @*/; + +/** \ingroup rpmds + * Return new formatted dependency string. + * @param dspfx formatted dependency string prefix + * @param ds dependency set + * @return new formatted dependency (malloc'ed) + */ +char * rpmdsNewDNEVR(const char * dspfx, rpmds ds) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies ds, rpmGlobalMacroContext, internalState @*/; + +/** \ingroup rpmds + * Create, load and initialize a dependency for this header. + * @param h header + * @param tagN type of dependency + * @param Flags comparison flags + * @return new dependency set + */ +/*@null@*/ +rpmds rpmdsThis(Header h, rpmTag tagN, evrFlags Flags) + /*@globals internalState @*/ + /*@modifies internalState @*/; + +/** \ingroup rpmds + * Create, load and initialize a dependency set of size 1. + * @param tagN type of dependency + * @param N name + * @param EVR epoch:version-release + * @param Flags comparison/context flags + * @return new dependency set + */ +/*@null@*/ +rpmds rpmdsSingle(rpmTag tagN, const char * N, const char * EVR, evrFlags Flags) + /*@*/; + +/** \ingroup rpmds + * Return dependency set count. + * @param ds dependency set + * @return current count + */ +int rpmdsCount(/*@null@*/ const rpmds ds) + /*@*/; + +/** \ingroup rpmds + * Return dependency set index. + * @param ds dependency set + * @return current index + */ +int rpmdsIx(/*@null@*/ const rpmds ds) + /*@*/; + +/** \ingroup rpmds + * Set dependency set index. + * @param ds dependency set + * @param ix new index + * @return current index + */ +int rpmdsSetIx(/*@null@*/ rpmds ds, int ix) + /*@modifies ds @*/; + +/** \ingroup rpmds + * Return current formatted dependency string. + * @param ds dependency set + * @return current dependency DNEVR, NULL on invalid + */ +/*@observer@*/ /*@relnull@*/ +extern const char * rpmdsDNEVR(/*@null@*/ const rpmds ds) + /*@*/; + +/** \ingroup rpmds + * Return current dependency name. + * @param ds dependency set + * @return current dependency name, NULL on invalid + */ +/*@observer@*/ /*@null@*/ +extern const char * rpmdsN(/*@null@*/ rpmds ds) + /*@globals internalState @*/ + /*@modifies internalState @*/; + +/** \ingroup rpmds + * Return current dependency epoch-version-release. + * @param ds dependency set + * @return current dependency EVR, NULL on invalid + */ +/*@observer@*/ /*@relnull@*/ +extern const char * rpmdsEVR(/*@null@*/ const rpmds ds) + /*@*/; + +/** \ingroup rpmds + * Return current dependency flags. + * @param ds dependency set + * @return current dependency flags, 0 on invalid + */ +evrFlags rpmdsFlags(/*@null@*/ const rpmds ds) + /*@*/; + +/** \ingroup rpmds + * Return current dependency type. + * @param ds dependency set + * @return current dependency type, 0 on invalid + */ +rpmTag rpmdsTagN(/*@null@*/ const rpmds ds) + /*@*/; + +/** \ingroup rpmds + * Return current dependency arch. + * @param ds dependency set + * @return current dependency arch, NULL on invalid + */ +/*@observer@*/ /*@relnull@*/ +extern const char * rpmdsA(/*@null@*/ const rpmds ds) + /*@*/; + +/** \ingroup rpmds + * Return dependency build time. + * @param ds dependency set + * @return dependency build time, 0 on invalid + */ +time_t rpmdsBT(/*@null@*/ const rpmds ds) + /*@*/; + +/** \ingroup rpmds + * Set dependency build time. + * @param ds dependency set + * @param BT build time + * @return dependency build time, 0 on invalid + */ +time_t rpmdsSetBT(/*@null@*/ const rpmds ds, time_t BT) + /*@modifies ds @*/; + +/** \ingroup rpmds + * Return dependency class type. + * @param ds dependency set + * @return dependency class type + */ +nsType rpmdsNSType(/*@null@*/ const rpmds ds) + /*@*/; + +/** \ingroup rpmds + * Return current "Don't promote Epoch:" flag. + * + * This flag controls for Epoch: promotion when a dependency set is + * compared. If the flag is set (for already installed packages), then + * an unspecified value will be treated as Epoch: 0. Otherwise (for added + * packages), the Epoch: portion of the comparison is skipped if the value + * is not specified, i.e. an unspecified Epoch: is assumed to be equal + * in dependency comparisons. + * + * @param ds dependency set + * @return current "Don't promote Epoch:" flag + */ +int rpmdsNoPromote(/*@null@*/ const rpmds ds) + /*@*/; + +/** \ingroup rpmds + * Set "Don't promote Epoch:" flag. + * @param ds dependency set + * @param nopromote Should an unspecified Epoch: be treated as Epoch: 0? + * @return previous "Don't promote Epoch:" flag + */ +int rpmdsSetNoPromote(/*@null@*/ rpmds ds, int nopromote) + /*@modifies ds @*/; + +/** \ingroup rpmds + * Set EVR parsing function. + * @param ds dependency set + * @param EVRparse EVR parsing function (NULL uses default) + * @return previous EVR parsing function + */ +/*@null@*/ +void * rpmdsSetEVRparse(/*@null@*/ rpmds ds, + /*@null@*/ int (*EVRparse)(const char *everstr, EVR_t evr)) + /*@modifies ds @*/; + +/** \ingroup rpmds + * Set EVR comparison function. + * @param ds dependency set + * @param EVRcmp EVR comparison function (NULL uses default) + * @return previous EVR comparison function + */ +/*@null@*/ +void * rpmdsSetEVRcmp(/*@null@*/ rpmds ds, + /*@null@*/ int (*EVRcmp)(const char *a, const char *b)) + /*@modifies ds @*/; + +/** \ingroup rpmds + * Return current dependency color. + * @param ds dependency set + * @return current dependency color (0 if not set) + */ +rpmuint32_t rpmdsColor(/*@null@*/ const rpmds ds) + /*@*/; + +/** \ingroup rpmds + * Set current dependency color. + * @param ds dependency set + * @param color new dependency color + * @return previous dependency color + */ +rpmuint32_t rpmdsSetColor(/*@null@*/ const rpmds ds, rpmuint32_t color) + /*@modifies ds @*/; + +/** \ingroup rpmds + * Return dependency exclude patterns. + * @param ds dependency set + * @return dependency exclude patterns (NULL if not set) + */ +/*@null@*/ +void * rpmdsExclude(/*@null@*/ const rpmds ds) + /*@*/; + +/** \ingroup rpmds + * Return no. of dependency exclude patterns. + * @param ds dependency set + * @return dependency exclude patterns (0 if not set) + */ +int rpmdsNExclude(/*@null@*/ const rpmds ds) + /*@*/; + +/** \ingroup rpmds + * Return dependency include patterns. + * @param ds dependency set + * @return dependency include patterns (NULL if not set) + */ +/*@null@*/ +void * rpmdsInclude(/*@null@*/ const rpmds ds) + /*@*/; + +/** \ingroup rpmds + * Return no. of dependency include patterns. + * @param ds dependency set + * @return dependency include patterns (0 if not set) + */ +int rpmdsNInclude(/*@null@*/ const rpmds ds) + /*@*/; + +/** \ingroup rpmds + * Return current dependency file refs. + * @param ds dependency set + * @return current dependency file refs (0 if not set) + */ +rpmuint32_t rpmdsRefs(/*@null@*/ const rpmds ds) + /*@*/; + +/** \ingroup rpmds + * Set current dependency file refs. + * @param ds dependency set + * @param refs new dependency refs + * @return previous dependency refs + */ +rpmuint32_t rpmdsSetRefs(/*@null@*/ const rpmds ds, rpmuint32_t refs) + /*@modifies ds @*/; + +/** \ingroup rpmds + * Return current dependency comparison result. + * @param ds dependency set + * @return current dependency result (0 if not set) + */ +rpmint32_t rpmdsResult(/*@null@*/ const rpmds ds) + /*@*/; + +/** \ingroup rpmds + * Set current dependency comparison result. + * @param ds dependency set + * @param result new dependency result + * @return previous dependency result + */ +rpmint32_t rpmdsSetResult(/*@null@*/ const rpmds ds, rpmint32_t result) + /*@modifies ds @*/; + +/** \ingroup rpmds + * Notify of results of dependency match. + * @param ds dependency set + * @param where where dependency was resolved (or NULL) + * @param rc 0 == YES, otherwise NO + */ +/*@-globuse@*/ /* FIX: rpmMessage annotation is a lie */ +void rpmdsNotify(/*@null@*/ rpmds ds, /*@null@*/ const char * where, int rc) + /*@globals fileSystem @*/ + /*@modifies fileSystem @*/; +/*@=globuse@*/ + +/** \ingroup rpmds + * Return next dependency set iterator index. + * @param ds dependency set + * @return dependency set iterator index, -1 on termination + */ +int rpmdsNext(/*@null@*/ rpmds ds) + /*@modifies ds @*/; + +/** \ingroup rpmds + * Initialize dependency set iterator. + * @param ds dependency set + * @return dependency set + */ +/*@null@*/ +rpmds rpmdsInit(/*@null@*/ rpmds ds) + /*@modifies ds @*/; + +/** \ingroup rpmds + * Find a dependency set element using binary search. + * @param ds dependency set to search + * @param ods dependency set element to find. + * @return dependency index (or -1 if not found) + */ +int rpmdsFind(rpmds ds, /*@null@*/ const rpmds ods) + /*@modifies ds @*/; + +/** \ingroup rpmds + * Merge a dependency set maintaining (N,EVR,Flags) sorted order. + * @retval *dsp (merged) dependency set + * @param ods dependency set to merge + * @return 0 on success + */ +int rpmdsMerge(/*@null@*/ /*@out@*/ rpmds * dsp, /*@null@*/ rpmds ods) + /*@modifies *dsp, ods @*/; + +/** \ingroup rpmds + * Search a sorted dependency set for an element that overlaps. + * A boolean result is saved (if allocated) and accessible through + * rpmdsResult(ods) afterwards. + * @param ds dependency set to search + * @param ods dependency set element to find. + * @return dependency index (or -1 if not found) + */ +int rpmdsSearch(/*@null@*/ rpmds ds, /*@null@*/ rpmds ods) + /*@modifies ds, ods @*/; + +/** + */ +/*@unchecked@*/ /*@null@*/ +extern const char * _cpuinfo_path; + +/** \ingroup rpmds + * Load /proc/cpuinfo provides into a dependency set. + * @retval *dsp (loaded) depedency set + * @param fn path to file (NULL uses /proc/cpuinfo) + * @return 0 on success + */ +int rpmdsCpuinfo(/*@out@*/ rpmds * dsp, /*@null@*/ const char * fn) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies *dsp, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/; + +/** \ingroup rpmds + * Load rpmlib provides into a dependency set. + * @retval *dsp (loaded) depedency set + * @param tblp rpmlib provides table (NULL uses internal table) + * @return 0 on success + */ +int rpmdsRpmlib(rpmds * dsp, /*@null@*/ void * tblp) + /*@modifies *dsp @*/; + +/** \ingroup rpmds + * Load sysinfo dependencies into a dependency set. + * @retval *PRCO provides/requires/conflicts/obsoletes depedency set(s) + * @param fn path to file (NULL uses /etc/rpm/sysinfo) + * @return 0 on success + */ +int rpmdsSysinfo(rpmPRCO PRCO, /*@null@*/ const char * fn) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies PRCO, rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/; + +/** \ingroup rpmds + * Load getconf provides into a dependency set. + * @retval *dsp (loaded) depedency set + * @param path getconf path (NULL uses /) + * @return 0 on success + */ +int rpmdsGetconf(rpmds * dsp, /*@null@*/ const char * path) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies *dsp, rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/; + +/** \ingroup rpmds + * Merge provides/requires/conflicts/obsoletes dependencies. + * @param context merge dependency set(s) container + * @param ds dependency set to merge + * @return 0 on success + */ +int rpmdsMergePRCO(void * context, rpmds ds) + /*@modifies context, ds @*/; + +/** \ingroup rpmds + * Free dependency set(s) container. + * @param PRCO dependency set(s) container + * @return NULL + */ +/*@null@*/ +rpmPRCO rpmdsFreePRCO(/*@only@*/ /*@null@*/ rpmPRCO PRCO) + /*@modifies PRCO @*/; + +/** \ingroup rpmds + * Create dependency set(s) container. + * @param h header + * @return 0 on success + */ +rpmPRCO rpmdsNewPRCO(/*@null@*/ Header h) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies h, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmds + * Retrieve a dependency set from container. + * @param PRCO dependency set(s) container + * @param tagN type of dependency set + * @return dependency set (or NULL) + */ +/*@null@*/ +rpmds rpmdsFromPRCO(/*@null@*/ rpmPRCO PRCO, rpmTag tagN) + /*@*/; + +/** \ingroup rpmds + * Extract ELF dependencies from a file. + * @param fn file name + * @param flags 1: skip provides 2: skip requires + * @param *add add(arg, ds) saves next provide/require elf dependency. + * @param context add() callback context + * @return 0 on success + */ +int rpmdsELF(const char * fn, int flags, + int (*add) (void * context, rpmds ds), void * context) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/; +#define RPMELF_FLAG_SKIPPROVIDES 0x1 /*= 0) + fprintf(fp, "%6d\t%s: %s\n", rpmdsIx(ds), rpmdsType(ds), rpmdsDNEVR(ds)+2); + return 0; +} + +/** \ingroup rpmds + * Print current dependency set results. + * @param ds dependency set + * @param fp file handle (NULL uses stderr) + * @return 0 always + */ +/*@unused@*/ static inline +int rpmdsPrintResults(/*@null@*/ rpmds ds, /*@null@*/ FILE * fp) + /*@globals fileSystem @*/ + /*@modifies ds, *fp, fileSystem @*/ +{ + if (fp == NULL) + fp = stderr; + ds = rpmdsInit(ds); + while (rpmdsNext(ds) >= 0) { + rpmint32_t rc = rpmdsResult(ds); + if (rc > 0) + continue; + fprintf(fp, "%6d\t%s: %s\n", rpmdsIx(ds), rpmdsType(ds), rpmdsDNEVR(ds)+2); + } + return 0; +} + +/** \ingroup rpmds + * Check Provides: against Requires: and print closure results. + * @param P Provides: dependency set + * @param R Requires: dependency set + * @param fp file handle (NULL uses stderr) + * @return 0 always + */ +/*@-mods@*/ /* XXX LCL wonky */ +/*@unused@*/ static inline +int rpmdsPrintClosure(/*@null@*/ rpmds P, /*@null@*/ rpmds R, + /*@null@*/ FILE * fp) + /*@globals fileSystem @*/ + /*@modifies P, R, *fp, fileSystem @*/ +{ + int rc; + + /* Allocate the R results array (to be filled in by rpmdsSearch). */ + (void) rpmdsSetResult(R, 0); /* allocate result array. */ + + /* Collect the rpmdsSearch results (in the R dependency set). */ + R = rpmdsInit(R); + while (rpmdsNext(R) >= 0) + rc = rpmdsSearch(P, R); + + return rpmdsPrintResults(R, fp); +} +/*@=mods@*/ +#endif +/*@}*/ + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMDS */ diff --git a/rpm-5.4.9/lib/rpmfc.c b/rpm-5.4.9/lib/rpmfc.c new file mode 100644 index 0000000..8049ff5 --- /dev/null +++ b/rpm-5.4.9/lib/rpmfc.c @@ -0,0 +1,2017 @@ +#include "system.h" + +#include /* getOutputFrom() */ + +#include +#include /* XXX fnpyKey */ +#include +#include +#include +#include +#define _MIRE_INTERNAL +#include + +#include +#define _RPMEVR_INTERNAL +#include + +#define _RPMNS_INTERNAL +#include + +#define _RPMFC_INTERNAL +#include + +#define _RPMDS_INTERNAL +#include +#include + +#include "debug.h" + +/*@access rpmds @*/ +/*@access miRE @*/ + +#ifdef __cplusplus +GENfree(rpmuint16_t *) +GENfree(rpmuint32_t *) +#endif /* __cplusplus */ + +/*@unchecked@*/ +static int _filter_values = 1; +/*@unchecked@*/ +static int _filter_execs = 1; + +/** + */ +static int rpmfcExpandAppend(/*@out@*/ ARGV_t * argvp, const ARGV_t av) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies *argvp, rpmGlobalMacroContext, internalState @*/ + /*@requires maxRead(argvp) >= 0 @*/ +{ + ARGV_t argv = *argvp; + int argc = argvCount(argv); + int ac = argvCount(av); + int i; + + argv = (ARGV_t) xrealloc(argv, (argc + ac + 1) * sizeof(*argv)); + for (i = 0; i < ac; i++) + argv[argc + i] = rpmExpand(av[i], NULL); + argv[argc + ac] = NULL; + *argvp = argv; + return 0; +} + +/* XXX FIXME: more AutoFu testing needed? */ +#if defined(HAVE_SIG_T) && !defined(SIGHANDLER_T) +typedef sig_t sighandler_t; +#endif + +/** + * Return output from helper script. + * @todo Use poll(2) rather than select(2), if available. + * @param dir directory to run in (or NULL) + * @param argv program and arguments to run + * @param writePtr bytes to feed to script on stdin (or NULL) + * @param writeBytesLeft no. of bytes to feed to script on stdin + * @param failNonZero is script failure an error? + * @return buffered stdout from script, NULL on error + */ +/*@null@*/ +static rpmiob getOutputFrom(/*@null@*/ const char * dir, ARGV_t argv, + const char * writePtr, size_t writeBytesLeft, + int failNonZero) + /*@globals h_errno, fileSystem, internalState@*/ + /*@modifies fileSystem, internalState@*/ +{ + pid_t child, reaped; + int toProg[2]; + int fromProg[2]; + int status; + sighandler_t oldhandler = signal(SIGPIPE, SIG_IGN); + rpmiob iob = NULL; + int done; + + toProg[0] = toProg[1] = 0; + fromProg[0] = fromProg[1] = 0; + if (pipe(toProg) < 0 || pipe(fromProg) < 0) { + rpmlog(RPMLOG_ERR, _("Couldn't create pipe for %s: %m\n"), argv[0]); + return NULL; + } + + if (!(child = fork())) { + (void) close(toProg[1]); + (void) close(fromProg[0]); + + (void) dup2(toProg[0], STDIN_FILENO); /* Make stdin the in pipe */ + (void) dup2(fromProg[1], STDOUT_FILENO); /* Make stdout the out pipe */ + + (void) close(toProg[0]); + (void) close(fromProg[1]); + + if (dir) { + (void) Chdir(dir); + } + + rpmlog(RPMLOG_DEBUG, D_("\texecv(%s) pid %d\n"), + argv[0], (unsigned)getpid()); + + unsetenv("MALLOC_CHECK_"); + (void) execvp(argv[0], (char *const *)argv); + /* XXX this error message is probably not seen. */ + rpmlog(RPMLOG_ERR, _("Couldn't exec %s: %s\n"), + argv[0], strerror(errno)); + _exit(EXIT_FAILURE); + } + if (child < 0) { + rpmlog(RPMLOG_ERR, _("Couldn't fork %s: %s\n"), + argv[0], strerror(errno)); + return NULL; + } + + (void) close(toProg[0]); + (void) close(fromProg[1]); + + /* Do not block reading or writing from/to prog. */ + (void) fcntl(fromProg[0], F_SETFL, O_NONBLOCK); + (void) fcntl(toProg[1], F_SETFL, O_NONBLOCK); + + iob = rpmiobNew(0); + + do { + fd_set ibits, obits; + struct timeval tv; + int nfd; + ssize_t nbr; + ssize_t nbw; + int rc; + + done = 0; +top: + FD_ZERO(&ibits); + FD_ZERO(&obits); + if (fromProg[0] >= 0) { + FD_SET(fromProg[0], &ibits); + } + if (toProg[1] >= 0) { + FD_SET(toProg[1], &obits); + } + /* XXX values set to limit spinning with perl doing ~100 forks/sec. */ + tv.tv_sec = 0; + tv.tv_usec = 10000; + nfd = ((fromProg[0] > toProg[1]) ? fromProg[0] : toProg[1]); + if ((rc = select(nfd, &ibits, &obits, NULL, &tv)) < 0) { + if (errno == EINTR) + goto top; + break; + } + + /* Write any data to program */ + if (toProg[1] >= 0 && FD_ISSET(toProg[1], &obits)) { + if (writePtr && writeBytesLeft > 0) { + if ((nbw = write(toProg[1], writePtr, + ((size_t)1024= 0) { /* close write fd */ + (void) close(toProg[1]); + toProg[1] = -1; + } + } + + /* Read any data from prog */ + { char buf[BUFSIZ+1]; + while ((nbr = read(fromProg[0], buf, sizeof(buf)-1)) > 0) { + buf[nbr] = '\0'; + iob = rpmiobAppend(iob, buf, 0); + } + } + + /* terminate on (non-blocking) EOF or error */ + done = (nbr == 0 || (nbr < 0 && errno != EAGAIN)); + + } while (!done); + + /* Clean up */ + if (toProg[1] >= 0) + (void) close(toProg[1]); + if (fromProg[0] >= 0) + (void) close(fromProg[0]); + (void) signal(SIGPIPE, oldhandler); + + /* Collect status from prog */ + reaped = waitpid(child, &status, 0); + rpmlog(RPMLOG_DEBUG, D_("\twaitpid(%d) rc %d status %x\n"), + (unsigned)child, (unsigned)reaped, status); + + if (failNonZero && (!WIFEXITED(status) || WEXITSTATUS(status))) { + const char *cmd = argvJoin(argv, ' '); + int rc = (WIFEXITED(status) ? WEXITSTATUS(status) : -1); + + rpmlog(RPMLOG_ERR, _("Command \"%s\" failed, exit(%d)\n"), cmd, rc); + cmd = _free(cmd); + iob = rpmiobFree(iob); + return NULL; + } + if (writeBytesLeft) { + rpmlog(RPMLOG_ERR, _("failed to write all data to %s\n"), argv[0]); + iob = rpmiobFree(iob); + return NULL; + } + return iob; +} + +int rpmfcExec(ARGV_t av, rpmiob iob_stdin, rpmiob * iob_stdoutp, + int failnonzero) +{ + const char * s = NULL; + ARGV_t xav = NULL; + ARGV_t pav = NULL; + int pac = 0; + int ec = -1; + rpmiob iob = NULL; + const char * buf_stdin = NULL; + size_t buf_stdin_len = 0; + int xx; + + if (iob_stdoutp) + *iob_stdoutp = NULL; + if (!(av && *av)) + goto exit; + + /* Find path to executable with (possible) args. */ + s = rpmExpand(av[0], NULL); + if (!(s && *s)) + goto exit; + + /* Parse args buried within expanded executable. */ + pac = 0; + xx = poptParseArgvString(s, &pac, (const char ***)&pav); + if (!(xx == 0 && pac > 0 && pav != NULL)) + goto exit; + + /* Build argv, appending args to the executable args. */ + xav = NULL; + xx = argvAppend(&xav, pav); + if (av[1]) + xx = rpmfcExpandAppend(&xav, av + 1); + + if (iob_stdin != NULL) { + buf_stdin = rpmiobStr(iob_stdin); + buf_stdin_len = rpmiobLen(iob_stdin); + } + + /* Read output from exec'd helper. */ + iob = getOutputFrom(NULL, xav, buf_stdin, buf_stdin_len, failnonzero); + + if (iob_stdoutp != NULL) { + *iob_stdoutp = iob; + iob = NULL; /* XXX don't free */ + } + + ec = 0; + +exit: + iob = rpmiobFree(iob); + xav = argvFree(xav); + pav = _free(pav); /* XXX popt mallocs in single blob. */ + s = _free(s); + return ec; +} + +/** + */ +static int rpmfcSaveArg(/*@out@*/ ARGV_t * argvp, const char * key) + /*@modifies *argvp @*/ + /*@requires maxSet(argvp) >= 0 @*/ +{ + int rc = 0; + + if (argvSearch(*argvp, key, NULL) == NULL) { + rc = argvAdd(argvp, key); + rc = argvSort(*argvp, NULL); + } + return rc; +} + +/** + */ +static char * rpmfcFileDep(/*@returned@*/ char * buf, size_t ix, + /*@null@*/ rpmds ds) + /*@globals internalState @*/ + /*@modifies buf, internalState @*/ + /*@requires maxSet(buf) >= 0 @*/ +{ + rpmTag tagN = rpmdsTagN(ds); + char deptype = 'X'; + + buf[0] = '\0'; + switch (tagN) { + default: +assert(0); + /*@notreached@*/ break; + case RPMTAG_PROVIDENAME: + deptype = 'P'; + break; + case RPMTAG_REQUIRENAME: + deptype = 'R'; + break; + } +/*@-nullpass@*/ + if (ds != NULL) + sprintf(buf, "%08u%c %s %s 0x%08x", (unsigned)ix, deptype, + rpmdsN(ds), rpmdsEVR(ds), rpmdsFlags(ds)); +/*@=nullpass@*/ + return buf; +}; + +/*@null@*/ +static void * rpmfcExpandRegexps(const char * str, int * nmirep) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies *nmirep, rpmGlobalMacroContext, internalState @*/ +{ + ARGV_t av = NULL; + int ac = 0; + miRE mire = NULL; + int nmire = 0; + const char * s; + int xx; + int i; + + s = rpmExpand(str, NULL); + if (s && *s) { + xx = poptParseArgvString(s, &ac, (const char ***)&av); + s = _free(s); + } + if (ac == 0 || av == NULL || *av == NULL) { + s = _free(s); + goto exit; + } + + for (i = 0; i < ac; i++) { + xx = mireAppend(RPMMIRE_REGEX, 0, av[i], NULL, &mire, &nmire); + /* XXX add REG_NOSUB? better error msg? */ + if (xx) { + rpmlog(RPMLOG_NOTICE, + _("Compilation of pattern '%s'" + " (expanded from '%s') failed. Skipping ...\n"), + av[i], str); + nmire--; /* XXX does this actually skip?!? */ + } + } + if (nmire == 0) + mire = mireFree(mire); + +exit: + av = _free(av); + if (nmirep) + *nmirep = nmire; + return mire; +} + +static int rpmfcMatchRegexps(void * _mire, int nmire, + const char * str, char deptype) + /*@modifies mires @*/ +{ + miRE mire = (miRE) _mire; + int xx; + int i; + + for (i = 0; i < nmire; i++) { +#ifdef DYING /* XXX noisy. use --miredebug if you need this spewage */ + rpmlog(RPMLOG_DEBUG, D_("Checking %c: '%s'\n"), deptype, str); +#endif + if ((xx = mireRegexec(mire + i, str, 0)) < 0) + continue; + rpmlog(RPMLOG_NOTICE, _("Skipping %c: '%s'\n"), deptype, str); + return 1; + } + return 0; +} + +/*@null@*/ +static void * rpmfcFreeRegexps(/*@only@*/ void * _mire, int nmire) + /*@modifies mires @*/ +{ + miRE mire = (miRE) _mire; +/*@-refcounttrans@*/ + return mireFreeAll(mire, nmire); +/*@=refcounttrans@*/ +} + +/** + * Run per-interpreter dependency helper. + * @param fc file classifier + * @param deptype 'P' == Provides:, 'R' == Requires:, helper + * @param nsdep class name for interpreter (e.g. "perl") + * @return 0 on success + */ +static int rpmfcHelper(rpmfc fc, unsigned char deptype, const char * nsdep) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + miRE mire = NULL; + int nmire = 0; + const char * fn = fc->fn[fc->ix]; + char buf[BUFSIZ]; + rpmiob iob_stdout = NULL; + rpmiob iob_stdin; + const char *av[2]; + rpmds * depsp, ds; + const char * N; + const char * EVR; + rpmTag tagN; + evrFlags Flags; + evrFlags dsContext; + ARGV_t pav; + const char * s; + int pac; + int xx; + int i; + + switch (deptype) { + default: + return -1; + /*@notreached@*/ break; + case 'P': + if (fc->skipProv) + return 0; + xx = snprintf(buf, sizeof(buf), "%%{?__%s_provides}", nsdep); + depsp = &fc->provides; + dsContext = RPMSENSE_FIND_PROVIDES; + tagN = RPMTAG_PROVIDENAME; + mire = (miRE) fc->Pmires; + nmire = fc->Pnmire; + break; + case 'R': + if (fc->skipReq) + return 0; + xx = snprintf(buf, sizeof(buf), "%%{?__%s_requires}", nsdep); + depsp = &fc->requires; + dsContext = RPMSENSE_FIND_REQUIRES; + tagN = RPMTAG_REQUIRENAME; + mire = (miRE) fc->Rmires; + nmire = fc->Rnmire; + break; + } + buf[sizeof(buf)-1] = '\0'; + av[0] = buf; + av[1] = NULL; + + iob_stdin = rpmiobNew(0); + iob_stdin = rpmiobAppend(iob_stdin, fn, 1); + iob_stdout = NULL; + xx = rpmfcExec(av, iob_stdin, &iob_stdout, 0); + iob_stdin = rpmiobFree(iob_stdin); + + if (xx == 0 && iob_stdout != NULL) { + pav = NULL; + xx = argvSplit(&pav, rpmiobStr(iob_stdout), " \t\n\r"); + pac = argvCount(pav); + if (pav) + for (i = 0; i < pac; i++) { + N = pav[i]; + EVR = ""; + Flags = dsContext; + if (pav[i+1] && strchr("=<>", *pav[i+1])) { + i++; + for (s = pav[i]; *s; s++) { + switch(*s) { + default: +assert(*s != '\0'); + /*@switchbreak@*/ break; + case '=': + Flags = (evrFlags) (Flags | RPMSENSE_EQUAL); + /*@switchbreak@*/ break; + case '<': + Flags = (evrFlags) (Flags | RPMSENSE_LESS); + /*@switchbreak@*/ break; + case '>': + Flags = (evrFlags) (Flags | RPMSENSE_GREATER); + /*@switchbreak@*/ break; + } + } + i++; + EVR = pav[i]; +assert(EVR != NULL); + } + + if (_filter_values && rpmfcMatchRegexps(mire, nmire, N, deptype)) + continue; + + /* Add tracking dependency for versioned Provides: */ + if (!fc->tracked && deptype == 'P' && *EVR != '\0') { + static evrFlags _Flags = (evrFlags) + (RPMSENSE_RPMLIB|(RPMSENSE_LESS|RPMSENSE_EQUAL)); + ds = rpmdsSingle(RPMTAG_REQUIRENAME, + "rpmlib(VersionedDependencies)", "3.0.3-1", + _Flags); + xx = rpmdsMerge(&fc->requires, ds); + (void)rpmdsFree(ds); + ds = NULL; + fc->tracked = 1; + } + + ds = rpmdsSingle(tagN, N, EVR, Flags); + +#if defined(RPM_VENDOR_MANDRIVA) /* filter-overlapping-dependencies */ + int overlap = 0; + if (*depsp) { + int ix = rpmdsSearch(*depsp, ds); + if (ix >= 0) { + EVR_t lEVR = rpmEVRnew(RPMSENSE_ANY, 0), + rEVR = rpmEVRnew(RPMSENSE_ANY, 0); + + rpmdsSetIx(*depsp, ix); + + rpmEVRparse(rpmdsEVR(*depsp), lEVR); + rpmEVRparse(EVR, rEVR); + lEVR->Flags = rpmdsFlags(*depsp) | RPMSENSE_EQUAL; + rEVR->Flags = Flags | RPMSENSE_EQUAL; + + if (rpmEVRcompare(lEVR, rEVR) < 0) { + (*depsp)->EVR[(*depsp)->i] = EVR; + (*depsp)->Flags[(*depsp)->i] = Flags; + overlap = 1; + } + lEVR = rpmEVRfree(lEVR); + rEVR = rpmEVRfree(rEVR); + } + } + if (!overlap) +#endif + /* Add to package dependencies. */ + xx = rpmdsMerge(depsp, ds); + + /* Add to file dependencies. */ + xx = rpmfcSaveArg(&fc->ddict, rpmfcFileDep(buf, fc->ix, ds)); + + (void)rpmdsFree(ds); + ds = NULL; + } + + pav = argvFree(pav); + } + iob_stdout = rpmiobFree(iob_stdout); + + return 0; +} + +/** + */ +/*@-nullassign@*/ +/*@unchecked@*/ /*@observer@*/ +static struct rpmfcTokens_s rpmfcTokens[] = { + { "directory", RPMFC_DIRECTORY|RPMFC_INCLUDE }, + + { " shared object", RPMFC_LIBRARY }, + { " executable", RPMFC_EXECUTABLE }, + { " statically linked", RPMFC_STATIC }, + { " not stripped", RPMFC_NOTSTRIPPED }, + { " archive", RPMFC_ARCHIVE }, + + { "MIPS, N32 MIPS32", RPMFC_ELFMIPSN32|RPMFC_INCLUDE }, + { "ELF 32-bit", RPMFC_ELF32|RPMFC_INCLUDE }, + { "ELF 64-bit", RPMFC_ELF64|RPMFC_INCLUDE }, + + { " script", RPMFC_SCRIPT }, + { " text", RPMFC_TEXT }, + { " document", RPMFC_DOCUMENT }, + + { " compressed", RPMFC_COMPRESSED }, + + { "troff or preprocessor input", RPMFC_MANPAGE|RPMFC_INCLUDE }, + { "GNU Info", RPMFC_MANPAGE|RPMFC_INCLUDE }, + + { "perl script text", RPMFC_PERL|RPMFC_INCLUDE }, + { "Perl5 module source text", RPMFC_PERL|RPMFC_MODULE|RPMFC_INCLUDE }, + + { "PHP script text", RPMFC_PHP|RPMFC_INCLUDE }, + { "G-IR binary database", RPMFC_TYPELIB|RPMFC_INCLUDE }, + + /* XXX "a /usr/bin/python -t script text executable" */ + /* XXX "python 2.3 byte-compiled" */ + { " /usr/bin/python", RPMFC_PYTHON|RPMFC_INCLUDE }, + { "python ", RPMFC_PYTHON|RPMFC_INCLUDE }, + + { "libtool library ", RPMFC_LIBTOOL|RPMFC_INCLUDE }, + { "pkgconfig ", RPMFC_PKGCONFIG|RPMFC_INCLUDE }, + + { "Bourne ", RPMFC_BOURNE|RPMFC_INCLUDE }, + { "Bourne-Again ", RPMFC_BOURNE|RPMFC_INCLUDE }, + + { "Java ", RPMFC_JAVA|RPMFC_INCLUDE }, + + { "Mono/.Net assembly", RPMFC_MONO|RPMFC_INCLUDE }, + + { "ruby script text", RPMFC_RUBY|RPMFC_INCLUDE }, + { "Ruby script text", RPMFC_RUBY|RPMFC_INCLUDE }, + + { "current ar archive", RPMFC_STATIC|RPMFC_LIBRARY|RPMFC_ARCHIVE|RPMFC_INCLUDE }, + + { "Zip archive data", RPMFC_COMPRESSED|RPMFC_ARCHIVE|RPMFC_INCLUDE }, + { "tar archive", RPMFC_ARCHIVE|RPMFC_INCLUDE }, + { "cpio archive", RPMFC_ARCHIVE|RPMFC_INCLUDE }, + { "RPM v3", RPMFC_ARCHIVE|RPMFC_INCLUDE }, + { "RPM v4", RPMFC_ARCHIVE|RPMFC_INCLUDE }, + + { " image", RPMFC_IMAGE|RPMFC_INCLUDE }, + { " font", RPMFC_FONT|RPMFC_INCLUDE }, + { " Font", RPMFC_FONT|RPMFC_INCLUDE }, + + { " commands", RPMFC_SCRIPT|RPMFC_INCLUDE }, + { " script", RPMFC_SCRIPT|RPMFC_INCLUDE }, + + { "empty", RPMFC_WHITE|RPMFC_INCLUDE }, + + { "HTML", RPMFC_WHITE|RPMFC_INCLUDE }, + { "SGML", RPMFC_WHITE|RPMFC_INCLUDE }, + { "XML", RPMFC_WHITE|RPMFC_INCLUDE }, + + { " program text", RPMFC_WHITE|RPMFC_INCLUDE }, + { " source", RPMFC_WHITE|RPMFC_INCLUDE }, + { "GLS_BINARY_LSB_FIRST", RPMFC_WHITE|RPMFC_INCLUDE }, + { " DB ", RPMFC_WHITE|RPMFC_INCLUDE }, + + { "ASCII English text", RPMFC_WHITE|RPMFC_INCLUDE }, + { "ASCII text", RPMFC_WHITE|RPMFC_INCLUDE }, + { "ISO-8859 text", RPMFC_WHITE|RPMFC_INCLUDE }, + + { "symbolic link to", RPMFC_SYMLINK }, + { "socket", RPMFC_DEVICE }, + { "special", RPMFC_DEVICE }, + + { "ASCII", RPMFC_WHITE }, + { "ISO-8859", RPMFC_WHITE }, + + { "data", RPMFC_WHITE }, + + { "application", RPMFC_WHITE }, + { "boot", RPMFC_WHITE }, + { "catalog", RPMFC_WHITE }, + { "code", RPMFC_WHITE }, + { "file", RPMFC_WHITE }, + { "format", RPMFC_WHITE }, + { "message", RPMFC_WHITE }, + { "program", RPMFC_WHITE }, + + { "broken symbolic link to ", RPMFC_WHITE|RPMFC_ERROR }, + { "can't read", RPMFC_WHITE|RPMFC_ERROR }, + { "can't stat", RPMFC_WHITE|RPMFC_ERROR }, + { "executable, can't read", RPMFC_WHITE|RPMFC_ERROR }, + { "core file", RPMFC_WHITE|RPMFC_ERROR }, + + { NULL, RPMFC_BLACK } +}; +/*@=nullassign@*/ + +int rpmfcColoring(const char * fmstr) +{ + rpmfcToken fct; + int fcolor = RPMFC_BLACK; + + for (fct = rpmfcTokens; fct->token != NULL; fct++) { + if (strstr(fmstr, fct->token) == NULL) + continue; + fcolor |= fct->colors; + if (fcolor & RPMFC_INCLUDE) + return fcolor; + } + return fcolor; +} + +void rpmfcPrint(const char * msg, rpmfc fc, FILE * fp) +{ + int fcolor; + int ndx; + int cx; + int dx; + size_t fx; + +unsigned nprovides; +unsigned nrequires; + + if (fp == NULL) fp = stderr; + + if (msg) + fprintf(fp, "===================================== %s\n", msg); + +nprovides = rpmdsCount(fc->provides); +nrequires = rpmdsCount(fc->requires); + + if (fc) + for (fx = 0; fx < fc->nfiles; fx++) { +assert(fx < fc->fcdictx->nvals); + cx = fc->fcdictx->vals[fx]; +assert(fx < fc->fcolor->nvals); + fcolor = fc->fcolor->vals[fx]; + + fprintf(fp, "%3d %s", (int)fx, fc->fn[fx]); + if (fcolor != RPMFC_BLACK) + fprintf(fp, "\t0x%x", fc->fcolor->vals[fx]); + else + fprintf(fp, "\t%s", fc->cdict[cx]); + fprintf(fp, "\n"); + + if (fc->fddictx == NULL || fc->fddictn == NULL) + continue; + +assert(fx < fc->fddictx->nvals); + dx = fc->fddictx->vals[fx]; +assert(fx < fc->fddictn->nvals); + ndx = fc->fddictn->vals[fx]; + + while (ndx-- > 0) { + const char * depval; + unsigned char deptype; + unsigned ix; + + ix = fc->ddictx->vals[dx++]; + deptype = ((ix >> 24) & 0xff); + ix &= 0x00ffffff; + depval = NULL; + switch (deptype) { + default: +assert(depval != NULL); + /*@switchbreak@*/ break; + case 'P': + if (nprovides > 0) { +assert(ix < nprovides); + (void) rpmdsSetIx(fc->provides, ix-1); + if (rpmdsNext(fc->provides) >= 0) + depval = rpmdsDNEVR(fc->provides); + } + /*@switchbreak@*/ break; + case 'R': + if (nrequires > 0) { +assert(ix < nrequires); + (void) rpmdsSetIx(fc->requires, ix-1); + if (rpmdsNext(fc->requires) >= 0) + depval = rpmdsDNEVR(fc->requires); + } + /*@switchbreak@*/ break; + } + if (depval) + fprintf(fp, "\t%s\n", depval); + } + } +} + +/** + * Extract script dependencies. + * @param fc file classifier + * @return 0 on success + */ +static int rpmfcSCRIPT(rpmfc fc) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + const char * fn = fc->fn[fc->ix]; + const char * bn; + rpmds ds; + char buf[BUFSIZ]; + FILE * fp; + char * s, * se; + int i; + int is_executable; + int xx; + const char * defaultdocdir = NULL; + + /* Extract dependencies only from files with executable bit set. */ + { struct stat sb, * st = &sb; + if (stat(fn, st) != 0) + return -1; + is_executable = (int)(st->st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)); + } + + fp = fopen(fn, "r"); + if (fp == NULL || ferror(fp)) { + if (fp) (void) fclose(fp); + return -1; + } + + /* Look for #! interpreter in first 10 lines. */ + for (i = 0; i < 10; i++) { + + s = fgets(buf, sizeof(buf) - 1, fp); + if (s == NULL || ferror(fp) || feof(fp)) + break; + s[sizeof(buf)-1] = '\0'; + if (!(s[0] == '#' && s[1] == '!')) + continue; + s += 2; + + while (*s && strchr(" \t\n\r", *s) != NULL) + s++; + if (*s == '\0') + continue; + if (*s != '/') + continue; + + for (se = s+1; *se; se++) { + if (strchr(" \t\n\r", *se) != NULL) + /*@innerbreak@*/ break; + } + *se = '\0'; + se++; + + if (!_filter_values + || (!fc->skipReq + && !rpmfcMatchRegexps(fc->Rmires, fc->Rnmire, s, 'R'))) + if (is_executable) { + /* Add to package requires. */ + ds = rpmdsSingle(RPMTAG_REQUIRENAME, s, "", RPMSENSE_FIND_REQUIRES); + xx = rpmdsMerge(&fc->requires, ds); + + /* Add to file requires. */ + xx = rpmfcSaveArg(&fc->ddict, rpmfcFileDep(se, fc->ix, ds)); + + (void)rpmdsFree(ds); + ds = NULL; + } + + /* Set color based on interpreter name. */ + /* XXX magic token should have already done this?!? */ +/*@-moduncon@*/ + bn = basename(s); +/*@=moduncon@*/ + if (!strcmp(bn, "perl")) + fc->fcolor->vals[fc->ix] |= RPMFC_PERL; + else if (!strncmp(bn, "python", sizeof("python")-1)) + fc->fcolor->vals[fc->ix] |= RPMFC_PYTHON; + else if (!strncmp(bn, "php", sizeof("php")-1)) + fc->fcolor->vals[fc->ix] |= RPMFC_PHP; + else if (!strncmp(bn, "ruby", sizeof("ruby")-1)) + fc->fcolor->vals[fc->ix] |= RPMFC_RUBY; + + break; + } + + (void) fclose(fp); + + if (fc->fcolor->vals[fc->ix] & RPMFC_PERL) { + defaultdocdir = rpmExpand("%{?_defaultdocdir}", NULL); + if (defaultdocdir == NULL || *defaultdocdir == '\0') + defaultdocdir = "/usr/share/doc"; + + if (strncmp(fn, defaultdocdir, sizeof(defaultdocdir)-1)) { + if (fc->fcolor->vals[fc->ix] & RPMFC_MODULE) + xx = rpmfcHelper(fc, 'P', "perl"); + if (is_executable || (fc->fcolor->vals[fc->ix] & RPMFC_MODULE)) + xx = rpmfcHelper(fc, 'R', "perl"); + } + } else + if (fc->fcolor->vals[fc->ix] & RPMFC_PYTHON) { + xx = rpmfcHelper(fc, 'P', "python"); +#ifdef NOTYET + if (is_executable) +#endif + xx = rpmfcHelper(fc, 'R', "python"); + } else + if (fc->fcolor->vals[fc->ix] & RPMFC_LIBTOOL) { + xx = rpmfcHelper(fc, 'P', "libtool"); +#ifdef NOTYET + if (is_executable) +#endif + xx = rpmfcHelper(fc, 'R', "libtool"); + } else + if (fc->fcolor->vals[fc->ix] & RPMFC_PKGCONFIG) { + xx = rpmfcHelper(fc, 'P', "pkgconfig"); +#ifdef NOTYET + if (is_executable) +#endif + xx = rpmfcHelper(fc, 'R', "pkgconfig"); + } else + if (fc->fcolor->vals[fc->ix] & RPMFC_BOURNE) { +#ifdef NOTYET + xx = rpmfcHelper(fc, 'P', "executable"); +#endif + if (is_executable) + xx = rpmfcHelper(fc, 'R', "executable"); + } else + if (fc->fcolor->vals[fc->ix] & RPMFC_PHP) { + xx = rpmfcHelper(fc, 'P', "php"); + if (is_executable) + xx = rpmfcHelper(fc, 'R', "php"); + } else + if (fc->fcolor->vals[fc->ix] & RPMFC_MONO) { + xx = rpmfcHelper(fc, 'P', "mono"); + if (is_executable) + xx = rpmfcHelper(fc, 'R', "mono"); + } else + if (fc->fcolor->vals[fc->ix] & RPMFC_RUBY) { + xx = rpmfcHelper(fc, 'P', "ruby"); +#ifdef NOTYET + if (is_executable) +#endif + xx = rpmfcHelper(fc, 'R', "ruby"); + } else + if (fc->fcolor->vals[fc->ix] & RPMFC_FONT) { + xx = rpmfcHelper(fc, 'P', "font"); + /* XXX: currently of no use, but for the sake of consistency... */ + xx = rpmfcHelper(fc, 'R', "font"); + } else + if (fc->fcolor->vals[fc->ix] & RPMFC_HASKELL) { + xx = rpmfcHelper(fc, 'P', "haskell"); + xx = rpmfcHelper(fc, 'R', "haskell"); + } else + if (fc->fcolor->vals[fc->ix] & RPMFC_TYPELIB) { + xx = rpmfcHelper(fc, 'P', "typelib"); +#ifdef NOTYET + if (is_executable) +#endif + xx = rpmfcHelper(fc, 'R', "typelib"); + } else + if ((fc->fcolor->vals[fc->ix] & (RPMFC_MODULE|RPMFC_LIBRARY)) && + strstr(fn, "/gstreamer")) { + xx = rpmfcHelper(fc, 'P', "gstreamer"); + /* XXX: currently of no use, but for the sake of consistency... */ + xx = rpmfcHelper(fc, 'R', "gstreamer"); + } + +/*@-observertrans@*/ + defaultdocdir = _free(defaultdocdir) ; +/*@=observertrans@*/ + return 0; +} + +/** + * Merge provides/requires dependencies into a rpmfc container. + * @param context merge dependency set(s) container + * @param ds dependency set to merge + * @return 0 on success + */ +static int rpmfcMergePR(void * context, rpmds ds) + /*@globals fileSystem, internalState @*/ + /*@modifies ds, fileSystem, internalState @*/ +{ + rpmfc fc = (rpmfc) context; + char buf[BUFSIZ]; + int rc = 0; + +if (_rpmfc_debug < 0) +fprintf(stderr, "*** rpmfcMergePR(%p, %p) %s\n", context, ds, tagName(rpmdsTagN(ds))); + switch(rpmdsTagN(ds)) { + default: + rc = -1; + break; + case RPMTAG_PROVIDENAME: + if (!_filter_values + || (!fc->skipProv + && !rpmfcMatchRegexps(fc->Pmires, fc->Pnmire, ds->N[0], 'P'))) + { + /* Add to package provides. */ + rc = rpmdsMerge(&fc->provides, ds); + + /* Add to file dependencies. */ + buf[0] = '\0'; + rc = rpmfcSaveArg(&fc->ddict, rpmfcFileDep(buf, fc->ix, ds)); + } + break; + case RPMTAG_REQUIRENAME: + if (!_filter_values + || (!fc->skipReq + && !rpmfcMatchRegexps(fc->Rmires, fc->Rnmire, ds->N[0], 'R'))) + { + /* Add to package requires. */ + rc = rpmdsMerge(&fc->requires, ds); + + /* Add to file dependencies. */ + buf[0] = '\0'; + rc = rpmfcSaveArg(&fc->ddict, rpmfcFileDep(buf, fc->ix, ds)); + } + break; + } + return rc; +} + +/** + * Extract Elf dependencies. + * @param fc file classifier + * @return 0 on success + */ +static int rpmfcELF(rpmfc fc) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + const char * fn = fc->fn[fc->ix]; + int flags = 0; + + if (fc->skipProv) + flags |= RPMELF_FLAG_SKIPPROVIDES; + if (fc->skipReq) + flags |= RPMELF_FLAG_SKIPREQUIRES; + + return rpmdsELF(fn, flags, rpmfcMergePR, fc); +} + +#if defined(RPM_VENDOR_MANDRIVA) +/** \ingroup rpmds + * Extract dependencies from a symlink. + * XXX Prototype added to keep GCC quite and avoid adding a symbol. + * @param fn file name + * @param flags 1: skip provides 2: skip requires + * @param *add add(arg, ds) saves next provide/require symlink dependency. + * @param context add() callback context + * @return 0 on success + */ +extern int rpmdsSymlink(const char * fn, int flags, + int (*add) (void * context, rpmds ds), void * context) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/; + +static int rpmfcSYMLINK(rpmfc fc) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + const char * fn = fc->fn[fc->ix]; + int flags = 0; + + if (fc->skipProv) + flags |= RPMELF_FLAG_SKIPPROVIDES; + if (fc->skipReq) + flags |= RPMELF_FLAG_SKIPREQUIRES; + + return rpmdsSymlink(fn, flags, rpmfcMergePR, fc); +} +#endif /* RPM_VENDOR_MANDRIVA */ + +typedef struct rpmfcApplyTbl_s { + int (*func) (rpmfc fc); + int colormask; +} * rpmfcApplyTbl; + +/** + * XXX Having two entries for rpmfcSCRIPT may be unnecessary duplication. + */ +/*@-nullassign@*/ +/*@unchecked@*/ +static struct rpmfcApplyTbl_s rpmfcApplyTable[] = { + { rpmfcELF, RPMFC_ELF }, + { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_FONT|RPMFC_HASKELL|RPMFC_PERL|RPMFC_PYTHON|RPMFC_LIBTOOL|RPMFC_PKGCONFIG|RPMFC_BOURNE|RPMFC_JAVA|RPMFC_PHP|RPMFC_MONO|RPMFC_TYPELIB) }, +#if defined(RPM_VENDOR_MANDRIVA) + { rpmfcSYMLINK, RPMFC_SYMLINK }, +#endif + { NULL, 0 } +}; +/*@=nullassign@*/ + +rpmRC rpmfcApply(rpmfc fc) +{ + rpmfcApplyTbl fcat; + const char * s; + char * se; + rpmds ds; + const char * fn; + const char * N; + const char * EVR; + evrFlags Flags; + unsigned char deptype; + int nddict; + int previx; + unsigned int val; + int dix; + int ix; + int i; + int xx; + int skipping; + + miRE mire; + int skipProv = fc->skipProv; + int skipReq = fc->skipReq; + int j; + + if (_filter_execs) { + fc->PFnmire = 0; + fc->PFmires = rpmfcExpandRegexps("%{?__noautoprovfiles}", &fc->PFnmire); + if (fc->PFnmire > 0) + rpmlog(RPMLOG_DEBUG, D_("added %d %%__noautoprovfiles patterns.\n"), + fc->PFnmire); + fc->RFnmire = 0; + fc->RFmires = rpmfcExpandRegexps("%{?__noautoreqfiles}", &fc->RFnmire); + if (fc->RFnmire > 0) + rpmlog(RPMLOG_DEBUG, D_("added %d %%__noautoreqfiles patterns.\n"), + fc->RFnmire); + fc->Pnmire = 0; + fc->Pmires = rpmfcExpandRegexps("%{?__noautoprov}", &fc->Pnmire); + if (fc->Pnmire > 0) + rpmlog(RPMLOG_DEBUG, D_("added %d %%__noautoprov patterns.\n"), + fc->Pnmire); + fc->Rnmire = 0; + fc->Rmires = rpmfcExpandRegexps("%{?__noautoreq}", &fc->Rnmire); + if (fc->Rnmire > 0) + rpmlog(RPMLOG_DEBUG, D_("added %d %%__noautoreq patterns.\n"), + fc->Rnmire); + } + +/* Make sure something didn't go wrong previously! */ +assert(fc->fn != NULL); + /* Generate package and per-file dependencies. */ + for (fc->ix = 0; fc->fn[fc->ix] != NULL; fc->ix++) { + + /* XXX Insure that /usr/lib{,64}/python files are marked RPMFC_PYTHON */ + /* XXX HACK: classification by path is intrinsically stupid. */ + { fn = strstr(fc->fn[fc->ix], "/usr/lib"); + if (fn) { + fn += sizeof("/usr/lib")-1; + if ((fn[0] == '3' && fn[1] == '2') || + (fn[0] == '6' && fn[1] == '4')) + fn += 2; + if (!strncmp(fn, "/python", sizeof("/python")-1)) + fc->fcolor->vals[fc->ix] |= RPMFC_PYTHON; + else if (!strncmp(fn, "/ruby", sizeof("/ruby")-1)) { + fc->fcolor->vals[fc->ix] |= RPMFC_RUBY; + if ((fn = strstr(fn, "/specifications/")) && + (fn = strrchr(fn, '.')) && !strcmp(fn, ".gemspec")) + fc->fcolor->vals[fc->ix] |= RPMFC_MODULE; + } + /* XXX: lacking better, more generic classifier... */ + else if (!strncmp(fn, "/gstreamer", sizeof("/gstreamer")-1) && + fc->fcolor->vals[fc->ix] & RPMFC_LIBRARY) + fc->fcolor->vals[fc->ix] |= (RPMFC_MODULE|RPMFC_SCRIPT); + } + } + + /* XXX ugly quick & dirty integration of haskell() dependencies */ + { fn = strstr(fc->fn[fc->ix], "/usr/share/haskell-deps"); + if (fn) + fc->fcolor->vals[fc->ix] |= RPMFC_HASKELL; + } + + if (fc->fcolor->vals[fc->ix]) + for (fcat = rpmfcApplyTable; fcat->func != NULL; fcat++) { + if (!(fc->fcolor->vals[fc->ix] & fcat->colormask)) + /*@innercontinue@*/ continue; + + if (_filter_execs) { + fc->skipProv = skipProv; + fc->skipReq = skipReq; + if ((mire = (miRE)fc->PFmires) != NULL) + for (j = 0; j < fc->PFnmire; j++, mire++) { + fn = fc->fn[fc->ix] + fc->brlen; + if ((xx = mireRegexec(mire, fn, 0)) < 0) + /*@innercontinue@*/ continue; + rpmlog(RPMLOG_NOTICE, _("skipping %s provides detection\n"), + fn); + fc->skipProv = 1; + /*@innerbreak@*/ break; + } + if ((mire = (miRE)fc->RFmires) != NULL) + for (j = 0; j < fc->RFnmire; j++, mire++) { + fn = fc->fn[fc->ix] + fc->brlen; + if ((xx = mireRegexec(mire, fn, 0)) < 0) + /*@innercontinue@*/ continue; + rpmlog(RPMLOG_NOTICE, _("skipping %s requires detection\n"), + fn); + fc->skipReq = 1; + /*@innerbreak@*/ break; + } + } + + xx = (*fcat->func) (fc); + } + } + + if (_filter_execs) { + fc->PFmires = rpmfcFreeRegexps(fc->PFmires, fc->PFnmire); + fc->RFmires = rpmfcFreeRegexps(fc->RFmires, fc->RFnmire); + fc->Pmires = rpmfcFreeRegexps(fc->Pmires, fc->Pnmire); + fc->Rmires = rpmfcFreeRegexps(fc->Rmires, fc->Rnmire); + } + fc->skipProv = skipProv; + fc->skipReq = skipReq; + + /* Generate per-file indices into package dependencies. */ + nddict = argvCount(fc->ddict); + previx = -1; + for (i = 0; i < nddict; i++) { + s = fc->ddict[i]; + + /* Parse out (file#,deptype,N,EVR,Flags) */ + ix = strtol(s, &se, 10); +assert(se != NULL); + deptype = *se++; + se++; + N = se; + while (*se && *se != ' ') + se++; + *se++ = '\0'; + EVR = se; + while (*se && *se != ' ') + se++; + *se++ = '\0'; + Flags = (evrFlags) strtol(se, NULL, 16); + + dix = -1; + skipping = 0; + switch (deptype) { + default: + /*@switchbreak@*/ break; + case 'P': + skipping = fc->skipProv; + ds = rpmdsSingle(RPMTAG_PROVIDENAME, N, EVR, Flags); + dix = rpmdsFind(fc->provides, ds); + (void)rpmdsFree(ds); + ds = NULL; + /*@switchbreak@*/ break; + case 'R': + skipping = fc->skipReq; + ds = rpmdsSingle(RPMTAG_REQUIRENAME, N, EVR, Flags); + dix = rpmdsFind(fc->requires, ds); + (void)rpmdsFree(ds); + ds = NULL; + /*@switchbreak@*/ break; + } + +/* XXX assertion incorrect while generating -debuginfo deps. */ +#if 0 +assert(dix >= 0); +#else + if (dix < 0) + continue; +#endif + + val = (deptype << 24) | (dix & 0x00ffffff); + xx = argiAdd(&fc->ddictx, -1, val); + + if (previx != ix) { + previx = ix; + xx = argiAdd(&fc->fddictx, ix, argiCount(fc->ddictx)-1); + } + if (fc->fddictn && fc->fddictn->vals && !skipping) + fc->fddictn->vals[ix]++; + } + + return RPMRC_OK; +} + +rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpmuint16_t * fmode) +{ + ARGV_t fcav = NULL; + ARGV_t dav; + rpmmg mg = NULL; + const char * s, * se; + size_t slen; + int fcolor; + int xx; + const char * magicfile = NULL; + + if (fc == NULL || argv == NULL) + return RPMRC_OK; + + magicfile = rpmExpand("%{?_rpmfc_magic_path}", NULL); + if (magicfile == NULL || *magicfile == '\0') + magicfile = _free(magicfile); + + mg = rpmmgNew(magicfile, 0); +assert(mg != NULL); /* XXX figger a proper return path. */ + + fc->nfiles = argvCount(argv); + + /* Initialize the per-file dictionary indices. */ + xx = argiAdd(&fc->fddictx, fc->nfiles-1, 0); + xx = argiAdd(&fc->fddictn, fc->nfiles-1, 0); + + /* Build (sorted) file class dictionary. */ + xx = argvAdd(&fc->cdict, ""); + xx = argvAdd(&fc->cdict, "directory"); + + for (fc->ix = 0; fc->ix < fc->nfiles; fc->ix++) { + const char * ftype; + int freeftype; + rpmuint16_t mode = (fmode ? fmode[fc->ix] : 0); + int urltype; + + ftype = ""; freeftype = 0; + urltype = urlPath(argv[fc->ix], &s); +assert(s != NULL && *s == '/'); + slen = strlen(s); + + switch (mode & S_IFMT) { + case S_IFCHR: ftype = "character special"; /*@switchbreak@*/ break; + case S_IFBLK: ftype = "block special"; /*@switchbreak@*/ break; +#if defined(S_IFIFO) + case S_IFIFO: ftype = "fifo (named pipe)"; /*@switchbreak@*/ break; +#endif +#if defined(S_IFSOCK) +/*@-unrecog@*/ + case S_IFSOCK: ftype = "socket"; /*@switchbreak@*/ break; +/*@=unrecog@*/ +#endif + case S_IFDIR: + case S_IFLNK: + case S_IFREG: + default: + +#define _suffix(_s, _x) \ + (slen >= sizeof(_x) && !strcmp((_s)+slen-(sizeof(_x)-1), (_x))) + + /* XXX all files with extension ".pm" are perl modules for now. */ + if (_suffix(s, ".pm")) + ftype = "Perl5 module source text"; + + /* XXX all files with extension ".jar" are java archives for now. */ + else if (_suffix(s, ".jar")) + ftype = "Java archive file"; + + /* XXX all files with extension ".class" are java class files for now. */ + else if (_suffix(s, ".class")) + ftype = "Java class file"; + + /* XXX all files with extension ".la" are libtool for now. */ + else if (_suffix(s, ".la")) + ftype = "libtool library file"; + + /* XXX all files with extension ".pc" are pkgconfig for now. */ + else if (_suffix(s, ".pc")) + ftype = "pkgconfig file"; + + /* XXX all files with extension ".php" are PHP for now. */ + else if (_suffix(s, ".php")) + ftype = "PHP script text"; + + /* XXX files with extension ".typelib" are GNOME typelib for now. */ + else if (_suffix(s, ".typelib")) + ftype = "G-IR binary database"; + + /* XXX files with extension ".js" have GNOME typelib requires for now */ + else if (_suffix(s, ".js")) + ftype = "G-IR binary database"; + + /* XXX skip all files in /dev/ which are (or should be) %dev dummies. */ + else if (slen >= fc->brlen+sizeof("/dev/") && !strncmp(s+fc->brlen, "/dev/", sizeof("/dev/")-1)) + ftype = ""; + else if (magicfile) { + ftype = rpmmgFile(mg, s); +assert(ftype != NULL); /* XXX never happens, rpmmgFile() returns "" */ + freeftype = 1; + } + /*@switchbreak@*/ break; + } + + se = ftype; + +if (_rpmfc_debug) /* XXX noisy */ + rpmlog(RPMLOG_DEBUG, "%s: %s\n", s, se); + + /* Save the path. */ + xx = argvAdd(&fc->fn, s); + + /* Save the file type string. */ + xx = argvAdd(&fcav, se); + + /* Add (filtered) entry to sorted class dictionary. */ + fcolor = rpmfcColoring(se); + xx = argiAdd(&fc->fcolor, (int)fc->ix, fcolor); + + if (fcolor != RPMFC_WHITE && (fcolor & RPMFC_INCLUDE)) + xx = rpmfcSaveArg(&fc->cdict, se); + +/*@-modobserver -observertrans @*/ /* XXX mixed types in variable */ + if (freeftype) + ftype = _free(ftype); +/*@=modobserver =observertrans @*/ + } + + /* Build per-file class index array. */ + fc->fknown = 0; + for (fc->ix = 0; fc->ix < fc->nfiles; fc->ix++) { + se = fcav[fc->ix]; +assert(se != NULL); + + dav = argvSearch(fc->cdict, se, NULL); + if (dav) { + xx = argiAdd(&fc->fcdictx, (int)fc->ix, (dav - fc->cdict)); + fc->fknown++; + } else { + xx = argiAdd(&fc->fcdictx, (int)fc->ix, 0); + fc->fwhite++; + } + } + + fcav = argvFree(fcav); + + mg = rpmmgFree(mg); + rpmlog(RPMLOG_DEBUG, + D_("categorized %d files into %u classes (using %s).\n"), + (unsigned)fc->nfiles, argvCount(fc->cdict), magicfile); + magicfile = _free(magicfile); + + return RPMRC_OK; +} + +/** + */ +typedef struct DepMsg_s * DepMsg_t; + +/** + */ +struct DepMsg_s { +/*@observer@*/ /*@null@*/ + const char * msg; +/*@observer@*/ + const char * argv[4]; + rpmTag ntag; + rpmTag vtag; + rpmTag ftag; + int mask; + int toggle; +}; + +/** + */ +/*@-nullassign@*/ +/*@unchecked@*/ +static struct DepMsg_s depMsgs[] = { + { "Provides", { "%{?__find_provides}", NULL, NULL, NULL }, + RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, RPMTAG_PROVIDEFLAGS, + 0, -1 }, + { "Requires(interp)", { NULL, "interp", NULL, NULL }, + RPMTAG_REQUIRENAME, RPMTAG_REQUIREVERSION, RPMTAG_REQUIREFLAGS, + _notpre(RPMSENSE_INTERP), 0 }, + { "Requires(rpmlib)", { NULL, "rpmlib", NULL, NULL }, + (rpmTag)-1, (rpmTag)-1, RPMTAG_REQUIREFLAGS, + _notpre(RPMSENSE_RPMLIB), 0 }, + { "Requires(verify)", { NULL, "verify", NULL, NULL }, + (rpmTag)-1, (rpmTag)-1, RPMTAG_REQUIREFLAGS, + RPMSENSE_SCRIPT_VERIFY, 0 }, + { "Requires(pre)", { NULL, "pre", NULL, NULL }, + (rpmTag)-1, (rpmTag)-1, RPMTAG_REQUIREFLAGS, + _notpre(RPMSENSE_SCRIPT_PRE), 0 }, + { "Requires(post)", { NULL, "post", NULL, NULL }, + (rpmTag)-1, (rpmTag)-1, RPMTAG_REQUIREFLAGS, + _notpre(RPMSENSE_SCRIPT_POST), 0 }, + { "Requires(preun)", { NULL, "preun", NULL, NULL }, + (rpmTag)-1, (rpmTag)-1, RPMTAG_REQUIREFLAGS, + _notpre(RPMSENSE_SCRIPT_PREUN), 0 }, + { "Requires(postun)", { NULL, "postun", NULL, NULL }, + (rpmTag)-1, (rpmTag)-1, RPMTAG_REQUIREFLAGS, + _notpre(RPMSENSE_SCRIPT_POSTUN), 0 }, + { "Requires", { "%{?__find_requires}", NULL, NULL, NULL }, + (rpmTag)-1, (rpmTag)-1, RPMTAG_REQUIREFLAGS, /* XXX inherit name/version arrays */ + RPMSENSE_FIND_REQUIRES|RPMSENSE_TRIGGERIN|RPMSENSE_TRIGGERUN|RPMSENSE_TRIGGERPOSTUN|RPMSENSE_TRIGGERPREIN, 0 }, + { "Conflicts", { "%{?__find_conflicts}", NULL, NULL, NULL }, + RPMTAG_CONFLICTNAME, RPMTAG_CONFLICTVERSION, RPMTAG_CONFLICTFLAGS, + 0, -1 }, + { "Obsoletes", { "%{?__find_obsoletes}", NULL, NULL, NULL }, + RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEVERSION, RPMTAG_OBSOLETEFLAGS, + 0, -1 }, + { NULL, { NULL, NULL, NULL, NULL }, (rpmTag)0, (rpmTag)0, (rpmTag)0, 0, 0 } +}; +/*@=nullassign@*/ + +/*@unchecked@*/ +static DepMsg_t DepMsgs = depMsgs; + +/** + * Print dependencies in a header. + * @param h header + */ +static void printDeps(Header h) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies h, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + DepMsg_t dm; + rpmds ds = NULL; + int flags = 0x2; /* XXX no filtering, !scareMem */ + const char * DNEVR; + evrFlags Flags; + int bingo = 0; + + for (dm = DepMsgs; dm->msg != NULL; dm++) { + if ((int)dm->ntag != -1) { + (void)rpmdsFree(ds); + ds = NULL; + ds = rpmdsNew(h, dm->ntag, flags); + } + if (dm->ftag == 0) + continue; + + ds = rpmdsInit(ds); + if (ds == NULL) + continue; /* XXX can't happen */ + + bingo = 0; + while (rpmdsNext(ds) >= 0) { + + Flags = rpmdsFlags(ds); + + if (!((Flags & dm->mask) ^ (dm->toggle))) + /*@innercontinue@*/ continue; + if (bingo == 0) { + rpmlog(RPMLOG_NOTICE, "%s:", (dm->msg ? dm->msg : "")); + bingo = 1; + } + if ((DNEVR = rpmdsDNEVR(ds)) == NULL) + /*@innercontinue@*/ continue; /* XXX can't happen */ + rpmlog(RPMLOG_NOTICE, " %s", DNEVR+2); + } + if (bingo) + rpmlog(RPMLOG_NOTICE, "\n"); + } + (void)rpmdsFree(ds); + ds = NULL; +} + +/** + */ +static rpmRC rpmfcGenerateDependsHelper(const Spec spec, Package pkg, rpmfi fi) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies fi, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + rpmiob iob_stdin; + rpmiob iob_stdout; + DepMsg_t dm; + int failnonzero = 0; + rpmRC rc = RPMRC_OK; + + /* + * Create file manifest buffer to deliver to dependency finder. + */ + iob_stdin = rpmiobNew(0); + fi = rpmfiInit(fi, 0); + if (fi != NULL) + while (rpmfiNext(fi) >= 0) + iob_stdin = rpmiobAppend(iob_stdin, rpmfiFN(fi), 1); + + for (dm = DepMsgs; dm->msg != NULL; dm++) { + rpmTag tag; + rpmsenseFlags tagflags; + char * s; + int xx; + + tag = (dm->ftag > 0) ? dm->ftag : dm->ntag; + tagflags = (rpmsenseFlags) 0; + s = NULL; + + switch(tag) { + case RPMTAG_PROVIDEFLAGS: + if (!pkg->autoProv) + continue; + failnonzero = 1; + tagflags = RPMSENSE_FIND_PROVIDES; + /*@switchbreak@*/ break; + case RPMTAG_REQUIREFLAGS: + if (!pkg->autoReq) + continue; + failnonzero = 0; + tagflags = RPMSENSE_FIND_REQUIRES; + /*@switchbreak@*/ break; + default: + continue; + /*@notreached@*/ /*@switchbreak@*/ break; + } + + xx = rpmfcExec(dm->argv, iob_stdin, &iob_stdout, failnonzero); + if (xx == -1) + continue; + + s = rpmExpand(dm->argv[0], NULL); + rpmlog(RPMLOG_NOTICE, _("Finding %s: %s\n"), dm->msg, + (s ? s : "")); + s = _free(s); + + if (iob_stdout == NULL) { + rpmlog(RPMLOG_ERR, _("Failed to find %s:\n"), dm->msg); + rc = RPMRC_FAIL; + break; + } + + /* Parse dependencies into header */ + if (spec->_parseRCPOT) + rc = spec->_parseRCPOT(spec, pkg, rpmiobStr(iob_stdout), tag, + 0, tagflags); + iob_stdout = rpmiobFree(iob_stdout); + + if (rc) { + rpmlog(RPMLOG_ERR, _("Failed to find %s:\n"), dm->msg); + break; + } + } + + iob_stdin = rpmiobFree(iob_stdin); + + return rc; +} + +/** + */ +/*@-nullassign@*/ +/*@unchecked@*/ +static struct DepMsg_s scriptMsgs[] = { + { "Requires(pre)", { "%{?__scriptlet_requires}", NULL, NULL, NULL }, + RPMTAG_PREINPROG, RPMTAG_PREIN, RPMTAG_REQUIREFLAGS, + RPMSENSE_SCRIPT_PRE, 0 }, + { "Requires(post)", { "%{?__scriptlet_requires}", NULL, NULL, NULL }, + RPMTAG_POSTINPROG, RPMTAG_POSTIN, RPMTAG_REQUIREFLAGS, + RPMSENSE_SCRIPT_POST, 0 }, + { "Requires(preun)", { "%{?__scriptlet_requires}", NULL, NULL, NULL }, + RPMTAG_PREUNPROG, RPMTAG_PREUN, RPMTAG_REQUIREFLAGS, + RPMSENSE_SCRIPT_PREUN, 0 }, + { "Requires(postun)", { "%{?__scriptlet_requires}", NULL, NULL, NULL }, + RPMTAG_POSTUNPROG, RPMTAG_POSTUN, RPMTAG_REQUIREFLAGS, + RPMSENSE_SCRIPT_POSTUN, 0 }, + { NULL, { NULL, NULL, NULL, NULL }, (rpmTag)0, (rpmTag)0, (rpmTag)0, 0, 0 } +}; +/*@=nullassign@*/ + +/*@unchecked@*/ +static DepMsg_t ScriptMsgs = scriptMsgs; + +/** + */ +static int rpmfcGenerateScriptletDeps(const Spec spec, Package pkg) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmiob iob_stdin = rpmiobNew(0); + rpmiob iob_stdout = NULL; + DepMsg_t dm; + int failnonzero = 0; + int rc = 0; + int xx; + + for (dm = ScriptMsgs; dm->msg != NULL; dm++) { + rpmTag tag; + rpmsenseFlags tagflags; + char * s; + + tag = dm->ftag; + tagflags = (rpmsenseFlags) (RPMSENSE_FIND_REQUIRES | dm->mask); + + /* Retrieve scriptlet interpreter. */ + he->tag = dm->ntag; + xx = headerGet(pkg->header, he, 0); + if (!xx || he->p.str == NULL) + continue; + xx = strcmp(he->p.str, "/bin/sh") && strcmp(he->p.str, "/bin/bash"); + he->p.ptr = _free(he->p.ptr); + if (xx) + continue; + + /* Retrieve scriptlet body. */ + he->tag = dm->vtag; + xx = headerGet(pkg->header, he, 0); + if (!xx || he->p.str == NULL) + continue; + iob_stdin = rpmiobEmpty(iob_stdin); + iob_stdin = rpmiobAppend(iob_stdin, he->p.str, 1); + iob_stdin = rpmiobRTrim(iob_stdin); + he->p.ptr = _free(he->p.ptr); + + xx = rpmfcExec(dm->argv, iob_stdin, &iob_stdout, failnonzero); + if (xx == -1) + continue; + + /* Parse dependencies into header */ + s = rpmiobStr(iob_stdout); + if (s != NULL && *s != '\0') { + char * se = s; + /* XXX Convert "executable(/path/to/file)" to "/path/to/file". */ + while ((se = strstr(se, "executable(/")) != NULL) { +/*@-modobserver@*/ /* FIX: rpmiobStr should not be observer */ + se = stpcpy(se, " "); + *se = '/'; /* XXX stpcpy truncates the '/' */ +/*@=modobserver@*/ + se = strchr(se, ')'); + if (se == NULL) + /*@innerbreak@*/ break; + *se++ = ' '; + } + if (spec->_parseRCPOT) + rc = spec->_parseRCPOT(spec, pkg, s, tag, 0, tagflags); + } + iob_stdout = rpmiobFree(iob_stdout); + + } + + iob_stdin = rpmiobFree(iob_stdin); + + return rc; +} + +rpmRC rpmfcGenerateDepends(void * _spec, void * _pkg) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + const Spec spec = (Spec) _spec; + Package pkg = (Package) _pkg; + rpmfi fi = pkg->fi; + rpmfc fc = NULL; + rpmds ds; + int flags = 0x2; /* XXX no filtering, !scareMem */ + ARGV_t av; + rpmuint16_t * fmode; + int ac = rpmfiFC(fi); + char buf[BUFSIZ]; + const char * N; + const char * EVR; + int genConfigDeps, internaldeps; + rpmRC rc = RPMRC_OK; + int i; + int xx; + + /* Skip packages with no files. */ + if (ac <= 0) + return RPMRC_OK; + + /* Skip packages that have dependency generation disabled. */ + if (! (pkg->autoReq || pkg->autoProv)) + return RPMRC_OK; + + /* If new-fangled dependency generation is disabled ... */ + internaldeps = rpmExpandNumeric("%{?_use_internal_dependency_generator}"); + if (internaldeps == 0) { + /* ... then generate dependencies using %{__find_requires} et al. */ + rc = rpmfcGenerateDependsHelper(spec, pkg, fi); + printDeps(pkg->header); + return rc; + } + + /* Generate scriptlet Dependencies. */ + if (internaldeps > 1) + xx = rpmfcGenerateScriptletDeps(spec, pkg); + + /* Extract absolute file paths in argv format. */ + /* XXX TODO: should use argvFoo ... */ + av = (ARGV_t) xcalloc(ac+1, sizeof(*av)); + fmode = (rpmuint16_t *) xcalloc(ac+1, sizeof(*fmode)); + + genConfigDeps = 0; + fi = rpmfiInit(fi, 0); + if (fi != NULL) + while ((i = rpmfiNext(fi)) >= 0) { + rpmfileAttrs fileAttrs; + + /* Does package have any %config files? */ + fileAttrs = (rpmfileAttrs) rpmfiFFlags(fi); + genConfigDeps |= (fileAttrs & RPMFILE_CONFIG); + + av[i] = xstrdup(rpmfiFN(fi)); + fmode[i] = rpmfiFMode(fi); + } + av[ac] = NULL; + + fc = rpmfcNew(); + fc->skipProv = !pkg->autoProv; + fc->skipReq = !pkg->autoReq; + fc->tracked = 0; + + { const char * buildRootURL; + const char * buildRoot; + buildRootURL = rpmGenPath(spec->rootURL, "%{?buildroot}", NULL); + (void) urlPath(buildRootURL, &buildRoot); + if (buildRoot && !strcmp(buildRoot, "/")) buildRoot = NULL; + fc->brlen = (buildRoot ? strlen(buildRoot) : 0); + buildRootURL = _free(buildRootURL); + } + + /* Copy (and delete) manually generated dependencies to dictionary. */ + if (!fc->skipProv) { + ds = rpmdsNew(pkg->header, RPMTAG_PROVIDENAME, flags); + xx = rpmdsMerge(&fc->provides, ds); + (void)rpmdsFree(ds); + ds = NULL; + he->tag = RPMTAG_PROVIDENAME; + xx = headerDel(pkg->header, he, 0); + he->tag = RPMTAG_PROVIDEVERSION; + xx = headerDel(pkg->header, he, 0); + he->tag = RPMTAG_PROVIDEFLAGS; + xx = headerDel(pkg->header, he, 0); + + /* Add config dependency, Provides: config(N) = EVR */ + if (genConfigDeps) { + static evrFlags _Flags = (evrFlags)(RPMSENSE_EQUAL|RPMSENSE_CONFIG); + N = rpmdsN(pkg->ds); +assert(N != NULL); + EVR = rpmdsEVR(pkg->ds); +assert(EVR != NULL); + sprintf(buf, "config(%s)", N); + ds = rpmdsSingle(RPMTAG_PROVIDENAME, buf, EVR, _Flags); + xx = rpmdsMerge(&fc->provides, ds); + (void)rpmdsFree(ds); + ds = NULL; + } + } + + if (!fc->skipReq) { + ds = rpmdsNew(pkg->header, RPMTAG_REQUIRENAME, flags); + xx = rpmdsMerge(&fc->requires, ds); + (void)rpmdsFree(ds); + ds = NULL; + he->tag = RPMTAG_REQUIRENAME; + xx = headerDel(pkg->header, he, 0); + he->tag = RPMTAG_REQUIREVERSION; + xx = headerDel(pkg->header, he, 0); + he->tag = RPMTAG_REQUIREFLAGS; + xx = headerDel(pkg->header, he, 0); + + /* Add config dependency, Requires: config(N) = EVR */ + if (genConfigDeps) { + static evrFlags _Flags = (evrFlags)(RPMSENSE_EQUAL|RPMSENSE_CONFIG); + N = rpmdsN(pkg->ds); +assert(N != NULL); + EVR = rpmdsEVR(pkg->ds); +assert(EVR != NULL); + sprintf(buf, "config(%s)", N); + ds = rpmdsSingle(RPMTAG_REQUIRENAME, buf, EVR, _Flags); + xx = rpmdsMerge(&fc->requires, ds); + (void)rpmdsFree(ds); + ds = NULL; + } + } + + /* Build file class dictionary. */ + xx = rpmfcClassify(fc, av, fmode); + + /* Build file/package dependency dictionary. */ + xx = rpmfcApply(fc); + + /* Add per-file colors(#files) */ + he->tag = RPMTAG_FILECOLORS; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = argiData(fc->fcolor); + he->c = argiCount(fc->fcolor); +assert(ac == (int)he->c); + if (he->p.ptr != NULL && he->c > 0) { + rpmuint32_t * fcolors = he->p.ui32p; + + /* XXX Make sure only primary (i.e. Elf32/Elf64) colors are added. */ + for (i = 0; i < (int)he->c; i++) + fcolors[i] &= 0x0f; + + xx = headerPut(pkg->header, he, 0); + } + + /* Add classes(#classes) */ + he->tag = RPMTAG_CLASSDICT; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = argvData(fc->cdict); + he->c = argvCount(fc->cdict); + if (he->p.ptr != NULL && he->c > 0) { + xx = headerPut(pkg->header, he, 0); + } + + /* Add per-file classes(#files) */ + he->tag = RPMTAG_FILECLASS; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = argiData(fc->fcdictx); + he->c = argiCount(fc->fcdictx); +assert(ac == (int)he->c); + if (he->p.ptr != NULL && he->c > 0) { + xx = headerPut(pkg->header, he, 0); + } + + /* Add Provides: */ + if (fc->provides != NULL && (he->c = rpmdsCount(fc->provides)) > 0 + && !fc->skipProv) + { + he->tag = RPMTAG_PROVIDENAME; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = fc->provides->N; + xx = headerPut(pkg->header, he, 0); + + /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */ +/*@-nullpass@*/ + he->tag = RPMTAG_PROVIDEVERSION; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = fc->provides->EVR; +assert(he->p.ptr != NULL); + xx = headerPut(pkg->header, he, 0); + + he->tag = RPMTAG_PROVIDEFLAGS; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = (rpmuint32_t *) fc->provides->Flags; +assert(he->p.ptr != NULL); + xx = headerPut(pkg->header, he, 0); +/*@=nullpass@*/ + } + + /* Add Requires: */ + if (fc->requires != NULL && (he->c = rpmdsCount(fc->requires)) > 0 + && !fc->skipReq) + { + he->tag = RPMTAG_REQUIRENAME; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = fc->requires->N; +assert(he->p.ptr != NULL); + xx = headerPut(pkg->header, he, 0); + + /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */ +/*@-nullpass@*/ + he->tag = RPMTAG_REQUIREVERSION; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = fc->requires->EVR; +assert(he->p.ptr != NULL); + xx = headerPut(pkg->header, he, 0); + + he->tag = RPMTAG_REQUIREFLAGS; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = (rpmuint32_t *) fc->requires->Flags; +assert(he->p.ptr != NULL); + xx = headerPut(pkg->header, he, 0); +/*@=nullpass@*/ + } + + /* Add dependency dictionary(#dependencies) */ + he->tag = RPMTAG_DEPENDSDICT; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = argiData(fc->ddictx); + he->c = argiCount(fc->ddictx); + if (he->p.ptr != NULL) { + xx = headerPut(pkg->header, he, 0); + } + + /* Add per-file dependency (start,number) pairs (#files) */ + he->tag = RPMTAG_FILEDEPENDSX; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = argiData(fc->fddictx); + he->c = argiCount(fc->fddictx); +assert(ac == (int)he->c); + if (he->p.ptr != NULL) { + xx = headerPut(pkg->header, he, 0); + } + + he->tag = RPMTAG_FILEDEPENDSN; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = argiData(fc->fddictn); + he->c = argiCount(fc->fddictn); +assert(ac == (int)he->c); + if (he->p.ptr != NULL) { + xx = headerPut(pkg->header, he, 0); + } + + printDeps(pkg->header); + +if (fc != NULL && _rpmfc_debug) { +char msg[BUFSIZ]; +sprintf(msg, "final: files %u cdict[%d] %u%% ddictx[%d]", (unsigned int)fc->nfiles, argvCount(fc->cdict), (unsigned int)((100 * fc->fknown)/fc->nfiles), argiCount(fc->ddictx)); +rpmfcPrint(msg, fc, NULL); +} + + /* Clean up. */ + fmode = _free(fmode); + fc = rpmfcFree(fc); + av = argvFree(av); + + return rc; +} + +/*@-mustmod@*/ +static void rpmfcFini(void * _fc) + /*@modifies _fc @*/ +{ + rpmfc fc = (rpmfc) _fc; + + fc->fn = argvFree(fc->fn); + fc->fcolor = argiFree(fc->fcolor); + fc->fcdictx = argiFree(fc->fcdictx); + fc->fddictx = argiFree(fc->fddictx); + fc->fddictn = argiFree(fc->fddictn); + fc->cdict = argvFree(fc->cdict); + fc->ddict = argvFree(fc->ddict); + fc->ddictx = argiFree(fc->ddictx); + + (void)rpmdsFree(fc->provides); + fc->provides = NULL; + (void)rpmdsFree(fc->requires); + fc->requires = NULL; + + fc->iob_java = rpmiobFree(fc->iob_java); + fc->iob_perl = rpmiobFree(fc->iob_perl); + fc->iob_python = rpmiobFree(fc->iob_python); + fc->iob_php = rpmiobFree(fc->iob_php); +} +/*@=mustmod@*/ + +/*@unchecked@*/ /*@only@*/ /*@null@*/ +rpmioPool _rpmfcPool = NULL; + +static rpmfc rpmfcGetPool(/*@null@*/ rpmioPool pool) + /*@globals _rpmfcPool, fileSystem, internalState @*/ + /*@modifies pool, _rpmfcPool, fileSystem, internalState @*/ +{ + rpmfc fc; + + if (_rpmfcPool == NULL) { + _rpmfcPool = rpmioNewPool("fc", sizeof(*fc), -1, _rpmfc_debug, + NULL, NULL, rpmfcFini); + pool = _rpmfcPool; + } + fc = (rpmfc) rpmioGetPool(pool, sizeof(*fc)); + memset(((char *)fc)+sizeof(fc->_item), 0, sizeof(*fc)-sizeof(fc->_item)); + return fc; +} + +rpmfc rpmfcNew(void) +{ + rpmfc fc = rpmfcGetPool(_rpmfcPool); + fc->fn = (ARGV_t) xcalloc(1, sizeof(*fc->fn)); + return rpmfcLink(fc); +} + diff --git a/rpm-5.4.9/lib/rpmfc.h b/rpm-5.4.9/lib/rpmfc.h new file mode 100644 index 0000000..b5d5430 --- /dev/null +++ b/rpm-5.4.9/lib/rpmfc.h @@ -0,0 +1,246 @@ +#ifndef _H_RPMFC_ +#define _H_RPMFC_ + +/*@-exportlocal@*/ +/*@unchecked@*/ +extern int _rpmfc_debug; +/*@=exportlocal@*/ + +/** + */ +typedef /*@abstract@*/ /*@refcounted@*/ struct rpmfc_s * rpmfc; + +/** + */ +typedef struct rpmfcTokens_s * rpmfcToken; + +/** + */ +typedef enum FCOLOR_e { + RPMFC_BLACK = 0, + RPMFC_ELF32 = (1 << 0), + RPMFC_ELF64 = (1 << 1), + RPMFC_ELFMIPSN32 = (1 << 2), +#define RPMFC_ELF (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32) + /* (1 << 3) leaks into package headers, reserved */ + + /* bit 4 unused */ + RPMFC_TYPELIB = (1 << 5), + RPMFC_HASKELL = (1 << 6), + RPMFC_RUBY = (1 << 7), + RPMFC_PKGCONFIG = (1 << 8), + RPMFC_LIBTOOL = (1 << 9), + RPMFC_BOURNE = (1 << 10), + RPMFC_MONO = (1 << 11), + + RPMFC_SCRIPT = (1 << 12), + RPMFC_STATIC = (1 << 13), + RPMFC_NOTSTRIPPED = (1 << 14), + /* bit 15 unused */ + + /* bits 16-19 are enumerated, not bits */ + RPMFC_DIRECTORY = (1 << 16), + RPMFC_SYMLINK = (2 << 16), + RPMFC_DEVICE = (3 << 16), + RPMFC_LIBRARY = (4 << 16), + RPMFC_FONT = (5 << 16), + RPMFC_IMAGE = (6 << 16), + RPMFC_MANPAGE = (7 << 16), + RPMFC_TEXT = (8 << 16), + RPMFC_DOCUMENT = (9 << 16), + + RPMFC_ARCHIVE = (1 << 20), + RPMFC_COMPRESSED = (1 << 21), + RPMFC_MODULE = (1 << 22), + RPMFC_EXECUTABLE = (1 << 23), + + RPMFC_PERL = (1 << 24), + RPMFC_JAVA = (1 << 25), + RPMFC_PYTHON = (1 << 26), + RPMFC_PHP = (1 << 27), + RPMFC_TCL = (1 << 28), + + RPMFC_WHITE = (1 << 29), + RPMFC_INCLUDE = (1 << 30), + RPMFC_ERROR = (1 << 31) +} FCOLOR_t; + +#if defined(_RPMFC_INTERNAL) +/** + */ +struct rpmfc_s { + struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ + size_t nfiles; /*!< no. of files */ + size_t fknown; /*!< no. of classified files */ + size_t fwhite; /*!< no. of "white" files */ + size_t ix; /*!< current file index */ + int skipProv; /*!< Don't auto-generate Provides:? */ + int skipReq; /*!< Don't auto-generate Requires:? */ + int tracked; /*!< Versioned Provides: tracking dependency added? */ + size_t brlen; /*!< strlen(spec->buildRoot) */ + + ARGV_t fn; /*!< (no. files) file names */ + ARGI_t fcolor; /*!< (no. files) file colors */ + ARGI_t fcdictx; /*!< (no. files) file class dictionary indices */ + ARGI_t fddictx; /*!< (no. files) file depends dictionary start */ + ARGI_t fddictn; /*!< (no. files) file depends dictionary no. entries */ + ARGV_t cdict; /*!< (no. classes) file class dictionary */ + ARGV_t ddict; /*!< (no. dependencies) file depends dictionary */ + ARGI_t ddictx; /*!< (no. dependencies) file->dependency mapping */ + +/*@relnull@*/ + rpmds provides; /*!< (no. provides) package provides */ +/*@relnull@*/ + rpmds requires; /*!< (no. requires) package requires */ + + rpmiob iob_java; /*!< concatenated list of java colored files. */ + rpmiob iob_perl; /*!< concatenated list of perl colored files. */ + rpmiob iob_python; /*!< concatenated list of python colored files. */ + rpmiob iob_php; /*!< concatenated list of php colored files. */ + +/*@null@*/ + void * Pmires; /*!< Filter patterns from %{__noautoprov} */ + int Pnmire; +/*@null@*/ + void * PFmires; /*!< Filter patterns from %{__noautoprov} */ + int PFnmire; +/*@null@*/ + void * Rmires; /*!< Filter patterns from %{__noautoreq} */ + int Rnmire; +/*@null@*/ + void * RFmires; /*!< Filter patterns from %{__noautoreqfile} */ + int RFnmire; + +}; + +/** + */ +struct rpmfcTokens_s { +/*@observer@*/ + const char * token; + int colors; +}; +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Return helper output. + * @param av helper argv (with possible macros) + * @param iob_stdin helper input + * @retval *iob_stdoutp helper output + * @param failnonzero Is non-zero helper exit status a failure? + */ +int rpmfcExec(const char ** av, rpmiob iob_stdin, /*@out@*/ rpmiob * iob_stdoutp, + int failnonzero) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies *iob_stdoutp, rpmGlobalMacroContext, + fileSystem, internalState @*/ + /*@requires maxSet(iob_stdoutp) >= 0 @*/; + +/** + * Return file color given file(1) string. + * @param fmstr file(1) string + * @return file color + */ +/*@-exportlocal@*/ +int rpmfcColoring(const char * fmstr) + /*@*/; +/*@=exportlocal@*/ + +/** + * Print results of file classification. + * @todo Remove debugging routine. + * @param msg message prefix (NULL for none) + * @param fc file classifier + * @param fp output file handle (NULL for stderr) + */ +/*@-exportlocal@*/ +void rpmfcPrint(/*@null@*/ const char * msg, rpmfc fc, /*@null@*/ FILE * fp) + /*@globals fileSystem @*/ + /*@modifies *fp, fc, fileSystem @*/; +/*@=exportlocal@*/ + +/** + * Build file class dictionary and mappings. + * @param fc file classifier + * @param argv files to classify + * @param fmode files mode_t array (or NULL) + * @return RPMRC_OK on success + */ +/*@-exportlocal@*/ +rpmRC rpmfcClassify(rpmfc fc, const char ** argv, /*@null@*/ rpmuint16_t * fmode) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/; +/*@=exportlocal@*/ + +/** + * Build file/package dependency dictionary and mappings. + * @param fc file classifier + * @return RPMRC_OK on success + */ +/*@-exportlocal@*/ +rpmRC rpmfcApply(rpmfc fc) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies fc, rpmGlobalMacroContext, internalState @*/; +/*@=exportlocal@*/ + +/** + * Generate package dependencies. + * @param _spec spec file control + * @param _pkg package control + * @return RPMRC_OK on success + */ +rpmRC rpmfcGenerateDepends(void * _spec, void * _pkg) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** + * Unreference a file classifier instance. + * @param ds dependency set + * @return NULL if free'd + */ +/*@unused@*/ /*@null@*/ +rpmfc rpmfcUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmfc fc) + /*@modifies fc @*/; +#define rpmfcUnlink(_fc) \ + ((rpmfc)rpmioUnlinkPoolItem((rpmioItem)(_fc), __FUNCTION__, __FILE__, __LINE__)) + +/** + * Reference a file classifier instance. + * @param ds file classifier + * @return new file classifier reference + */ +/*@unused@*/ /*@newref@*/ /*@null@*/ +rpmfc rpmfcLink (/*@null@*/ rpmfc fc) + /*@modifies fc @*/; +#define rpmfcLink(_fc) \ + ((rpmfc)rpmioLinkPoolItem((rpmioItem)(_fc), __FUNCTION__, __FILE__, __LINE__)) + +/** + * Destroy a file classifier. + * @param fc file classifier + * @return NULL if free'd + */ +/*@null@*/ +rpmfc rpmfcFree(/*@only@*/ /*@null@*/ rpmfc fc) + /*@modifies fc @*/; +#define rpmfcFree(_fc) \ + ((rpmfc)rpmioFreePoolItem((rpmioItem)(_fc), __FUNCTION__, __FILE__, __LINE__)) + +/** + * Create a file classifier. + * @return new file classifier + */ +/*@-exportlocal@*/ +rpmfc rpmfcNew(void) + /*@*/; +/*@=exportlocal@*/ + +#ifdef __cplusplus +} +#endif + +#endif /* _H_RPMFC_ */ diff --git a/rpm-5.4.9/lib/rpmfi.c b/rpm-5.4.9/lib/rpmfi.c new file mode 100644 index 0000000..9abdff8 --- /dev/null +++ b/rpm-5.4.9/lib/rpmfi.c @@ -0,0 +1,2231 @@ +/** \ingroup rpmfi + * \file lib/rpmfi.c + * Routines to handle file info tag sets. + */ + +#include "system.h" + +#include /* XXX fnpyKey */ +#include +#include +#include +#include /* XXX urlGetPath */ +#define _RPMDIR_INTERNAL +#include +#include /* XXX rpmCleanPath */ +#include + +#define _RPMAV_INTERNAL /* XXX avOpendir */ +#include + +#include +#include + +#define _FPRINT_INTERNAL +#include "fprint.h" + +#define _IOSM_INTERNAL +#define _RPMFI_INTERNAL +#include "fsm.h" /* XXX newFSM() */ +#include "legacy.h" /* XXX dodigest */ + +#include "rpmds.h" + +#define _RPMTE_INTERNAL /* relocations */ +#include "rpmte.h" +#include "rpmts.h" + +#include /* XXX rpmHeaderFormats */ + +#include "debug.h" + +/*@access IOSM_t @*/ /* XXX cast */ + +/*@access rpmte @*/ +/*@access rpmts @*/ /* XXX cast */ + +/*@access FSM_t @*/ /* XXX fsm->repackaged */ +/*@access DIR @*/ + +#ifdef __cplusplus +GENfree(int *) +GENpair(rpmuint16_t *) +GENpair(rpmuint32_t *) +GENfree(rpmRelocation) +#endif /* __cplusplus */ + +/** + */ +struct rpmRelocation_s { +/*@only@*/ /*@null@*/ + const char * oldPath; /*!< NULL here evals to RPMTAG_DEFAULTPREFIX, */ +/*@only@*/ /*@null@*/ + const char * newPath; /*!< NULL means to omit the file completely! */ +}; + +/*@unchecked@*/ +int _rpmfi_debug = 0; + +/** + * Remove occurences of trailing character from string. + * @param s string + * @param c character to strip + * @return string + */ +static /*@only@*/ +char * stripTrailingChar(/*@only@*/ char * s, char c) + /*@modifies *s */ +{ + char * t; +/*@-boundswrite@*/ + for (t = s + strlen(s) - 1; *t == c && t >= s; t--) + *t = '\0'; +/*@=boundswrite@*/ + return s; +} + +int rpmfiFC(rpmfi fi) +{ + return (fi != NULL ? fi->fc : 0); +} + +int rpmfiDC(rpmfi fi) +{ + return (fi != NULL ? fi->dc : 0); +} + +#ifdef NOTYET +int rpmfiDI(rpmfi fi) +{ +} +#endif + +int rpmfiFX(rpmfi fi) +{ + return (fi != NULL ? fi->i : -1); +} + +int rpmfiSetFX(rpmfi fi, int fx) +{ + int i = -1; + + if (fi != NULL && fx >= 0 && fx < (int)fi->fc) { + i = fi->i; + fi->i = fx; + fi->j = fi->dil[fi->i]; + } + return i; +} + +int rpmfiDX(rpmfi fi) +{ + return (fi != NULL ? fi->j : -1); +} + +int rpmfiSetDX(rpmfi fi, int dx) +{ + int j = -1; + + if (fi != NULL && dx >= 0 && dx < (int)fi->dc) { + j = fi->j; + fi->j = dx; + } + return j; +} + +int rpmfiIsSource(rpmfi fi) +{ + return (fi != NULL ? fi->isSource : 0); +} + +const char * rpmfiBN(rpmfi fi) +{ + const char * BN = NULL; + + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + if (fi->bnl != NULL) + BN = fi->bnl[fi->i]; + } + return BN; +} + +const char * rpmfiDN(rpmfi fi) +{ + const char * DN = NULL; + + if (fi != NULL && fi->j >= 0 && fi->j < (int)fi->dc) { + if (fi->dnl != NULL) + DN = fi->dnl[fi->j]; + } + return DN; +} + +const char * rpmfiFN(rpmfi fi) +{ + const char * FN = ""; + + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + const char *dn; + char * t; + if (fi->fn == NULL) + fi->fn = (char *) xmalloc(fi->fnlen + 1); + FN = t = fi->fn; + (void) urlPath(fi->dnl[fi->dil[fi->i]], &dn); + *t = '\0'; + t = stpcpy(t, dn); + t = stpcpy(t, fi->bnl[fi->i]); + } + return FN; +} + +void * rpmfiFNBF(rpmfi fi) +{ + void * _fnbf = NULL; + if (fi != NULL) { + if (fi->_fnbf == NULL) { + char * fn = (char *) alloca(fi->fnlen + 1); + static double e = 1.0e-4; + size_t n = (fi->fc > 10 ? fi->fc : 10); + size_t m = 0; + size_t k = 0; + rpmbf bf; + int i; + + rpmbfParams(n, e, &m, &k); + bf = rpmbfNew(m, k, 0); + for (i = 0; i < (int)fi->fc; i++) { + const char * dn; + int xx; + dn = NULL; + (void) urlPath(fi->dnl[fi->dil[i]], &dn); + dn = stpcpy(stpcpy(fn, dn), fi->bnl[i]); + xx = rpmbfAdd(bf, fn, (size_t)(dn - fn)); +assert(xx == 0); + } + fi->_fnbf = bf; + } + _fnbf = fi->_fnbf; + } + return _fnbf; +} + +size_t rpmfiFNMaxLen(rpmfi fi) +{ + return (fi ? fi->fnlen : 0); +} + +rpmuint32_t rpmfiFFlags(rpmfi fi) +{ + rpmuint32_t FFlags = 0; + + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + if (fi->fflags != NULL) + FFlags = fi->fflags[fi->i]; + } + return FFlags; +} + +rpmuint32_t rpmfiSetFFlags(rpmfi fi, rpmuint32_t FFlags) +{ + rpmuint32_t oFFlags = 0; + + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + if (fi->fflags != NULL && fi->h == NULL) { + oFFlags = fi->fflags[fi->i]; + *((rpmuint32_t *)(fi->fflags + fi->i)) = FFlags; + } + } + return oFFlags; +} + +rpmuint32_t rpmfiVFlags(rpmfi fi) +{ + rpmuint32_t VFlags = 0; + + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + if (fi->vflags != NULL) + VFlags = fi->vflags[fi->i]; + } + return VFlags; +} + +rpmuint32_t rpmfiSetVFlags(rpmfi fi, rpmuint32_t VFlags) +{ + rpmuint32_t oVFlags = 0; + + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + if (fi->vflags != NULL && fi->h == NULL) { + oVFlags = fi->vflags[fi->i]; + *((rpmuint32_t *)(fi->vflags + fi->i)) = VFlags; + } + } + return oVFlags; +} + +rpmuint16_t rpmfiFMode(rpmfi fi) +{ + rpmuint16_t fmode = 0; + + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + if (fi->fmodes != NULL) + fmode = fi->fmodes[fi->i]; + } + return fmode; +} + +rpmfileState rpmfiFState(rpmfi fi) +{ + rpmfileState fstate = (rpmfileState) RPMFILE_STATE_MISSING; + + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + if (fi->fstates != NULL) + fstate = (rpmfileState) fi->fstates[fi->i]; + } + return fstate; +} + +rpmfileState rpmfiSetFState(rpmfi fi, rpmfileState fstate) +{ + rpmuint32_t ofstate = 0; + + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + if (fi->fstates != NULL) { + ofstate = fi->fstates[fi->i]; + fi->fstates[fi->i] = fstate; + } + } + return (rpmfileState) ofstate; +} + +const unsigned char * rpmfiDigest(rpmfi fi, int * algop, size_t * lenp) +{ + unsigned char * digest = NULL; + + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + if (fi->digests != NULL) { + digest = fi->digests + (fi->digestlen * fi->i); + if (algop != NULL) + *algop = (fi->fdigestalgos + ? fi->fdigestalgos[fi->i] : fi->digestalgo); + if (lenp != NULL) + *lenp = fi->digestlen; + } + } + return digest; +} + +const char * rpmfiFLink(rpmfi fi) +{ + const char * flink = NULL; + + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + if (fi->flinks != NULL) + flink = fi->flinks[fi->i]; + } + return flink; +} + +rpmuint32_t rpmfiFSize(rpmfi fi) +{ + rpmuint32_t fsize = 0; + + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + if (fi->fsizes != NULL) + fsize = fi->fsizes[fi->i]; + } + return fsize; +} + +rpmuint16_t rpmfiFRdev(rpmfi fi) +{ + rpmuint16_t frdev = 0; + + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + if (fi->frdevs != NULL) + frdev = fi->frdevs[fi->i]; + } + return frdev; +} + +rpmuint32_t rpmfiFInode(rpmfi fi) +{ + rpmuint32_t finode = 0; + + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + if (fi->finodes != NULL) + finode = fi->finodes[fi->i]; + } + return finode; +} + +rpmuint32_t rpmfiColor(rpmfi fi) +{ + rpmuint32_t color = 0; + + if (fi != NULL) + /* XXX ignore all but lsnibble for now. */ + color = fi->color & 0xf; + return color; +} + +rpmuint32_t rpmfiFColor(rpmfi fi) +{ + rpmuint32_t fcolor = 0; + + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + if (fi->fcolors != NULL) + /* XXX ignore all but lsnibble for now. */ + fcolor = (fi->fcolors[fi->i] & 0x0f); + } + return fcolor; +} + +const char * rpmfiFClass(rpmfi fi) +{ + const char * fclass = NULL; + + if (fi != NULL && fi->fcdictx != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + int cdictx = fi->fcdictx[fi->i]; + if (fi->cdict != NULL && cdictx >= 0 && cdictx < (int)fi->ncdict) + fclass = fi->cdict[cdictx]; + } + return fclass; +} + +const char * rpmfiFContext(rpmfi fi) +{ + const char * fcontext = NULL; + + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + if (fi->fcontexts != NULL) + fcontext = fi->fcontexts[fi->i]; + } + return fcontext; +} + +rpmuint32_t rpmfiFDepends(rpmfi fi, const rpmuint32_t ** fddictp) +{ + int fddictx = -1; + int fddictn = 0; + const rpmuint32_t * fddict = NULL; + + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + if (fi->fddictn != NULL) + fddictn = fi->fddictn[fi->i]; + if (fddictn > 0 && fi->fddictx != NULL) + fddictx = fi->fddictx[fi->i]; + if (fi->ddict != NULL && fddictx >= 0 && (fddictx+fddictn) <= (int)fi->nddict) + fddict = fi->ddict + fddictx; + } +/*@-dependenttrans -onlytrans @*/ + if (fddictp) + *fddictp = fddict; +/*@=dependenttrans =onlytrans @*/ + return fddictn; +} + +rpmuint32_t rpmfiFNlink(rpmfi fi) +{ + rpmuint32_t nlink = 0; + + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + /* XXX rpm-2.3.12 has not RPMTAG_FILEINODES */ + if (fi->finodes && fi->frdevs) { + rpmuint32_t finode = fi->finodes[fi->i]; + rpmuint16_t frdev = fi->frdevs[fi->i]; + int j; + + for (j = 0; j < (int)fi->fc; j++) { + if (fi->frdevs[j] == frdev && fi->finodes[j] == finode) + nlink++; + } + } + } + return nlink; +} + +rpmuint32_t rpmfiFMtime(rpmfi fi) +{ + rpmuint32_t fmtime = 0; + + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + if (fi->fmtimes != NULL) + fmtime = fi->fmtimes[fi->i]; + } + return fmtime; +} + +const char * rpmfiFUser(rpmfi fi) +{ + const char * fuser = NULL; + + /* XXX add support for ancient RPMTAG_FILEUIDS? */ + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + if (fi->fuser != NULL) + fuser = fi->fuser[fi->i]; + } + return fuser; +} + +const char * rpmfiFGroup(rpmfi fi) +{ + const char * fgroup = NULL; + + /* XXX add support for ancient RPMTAG_FILEGIDS? */ + if (fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + if (fi->fgroup != NULL) + fgroup = fi->fgroup[fi->i]; + } + return fgroup; +} + +void * rpmfiBloomFN(const rpmfi fi) +{ +/*@-assignexpose -retexpose @*/ + return (fi != NULL ? fi->_fnbf : NULL); +/*@=assignexpose =retexpose @*/ +} + +void * rpmfiExclude(const rpmfi fi) +{ + return (fi != NULL ? fi->exclude : NULL); +} + +int rpmfiNExclude(const rpmfi fi) +{ + return (fi != NULL ? fi->nexclude : 0); +} + +void * rpmfiInclude(const rpmfi fi) +{ + return (fi != NULL ? fi->include : NULL); +} + +int rpmfiNInclude(const rpmfi fi) +{ + return (fi != NULL ? fi->ninclude : 0); +} + +struct fingerPrint_s * rpmfiFpsIndex(rpmfi fi, int ix) +{ + struct fingerPrint_s * fps = NULL; + if (fi != NULL && fi->fps != NULL && ix >= 0 && ix < (int)fi->fc) { + fps = fi->fps + ix; + } + return fps; +} + +void rpmfiFpLookup(rpmfi fi, fingerPrintCache fpc) +{ + if (fi->fc > 0 && fi->fps == NULL) { + fi->fps = (struct fingerPrint_s *) xcalloc(fi->fc, sizeof(*fi->fps)); + } + fpLookupList(fpc, fi->dnl, fi->bnl, fi->dil, fi->fc, fi->fps); +} + +int rpmfiNext(rpmfi fi) +{ + int i = -1; + + if (fi != NULL && ++fi->i >= 0) { + if (fi->i < (int)fi->fc) { + i = fi->i; + if (fi->dil != NULL) + fi->j = fi->dil[fi->i]; + } else + fi->i = -1; + +/*@-modfilesys @*/ +if (_rpmfi_debug < 0 && i != -1) +fprintf(stderr, "*** fi %p\t%s[%d] %s%s\n", fi, (fi->Type ? fi->Type : "?Type?"), i, (i >= 0 ? fi->dnl[fi->j] : ""), (i >= 0 ? fi->bnl[fi->i] : "")); +/*@=modfilesys @*/ + + } + + return i; +} + +rpmfi rpmfiInit(rpmfi fi, int fx) +{ + if (fi != NULL) { + if (fx >= 0 && fx < (int)fi->fc) { + fi->i = fx - 1; + fi->j = -1; + } + } + + /*@-refcounttrans@*/ + return fi; + /*@=refcounttrans@*/ +} + +int rpmfiNextD(rpmfi fi) +{ + int j = -1; + + if (fi != NULL && ++fi->j >= 0) { + if (fi->j < (int)fi->dc) + j = fi->j; + else + fi->j = -1; + +/*@-modfilesys @*/ +if (_rpmfi_debug < 0 && j != -1) +fprintf(stderr, "*** fi %p\t%s[%d]\n", fi, (fi->Type ? fi->Type : "?Type?"), j); +/*@=modfilesys @*/ + + } + + return j; +} + +rpmfi rpmfiInitD(rpmfi fi, int dx) +{ + if (fi != NULL) { + if (dx >= 0 && dx < (int)fi->fc) + fi->j = dx - 1; + else + fi = NULL; + } + + /*@-refcounttrans@*/ + return fi; + /*@=refcounttrans@*/ +} + +/** + * Identify a file type. + * @param ft file type + * @return string to identify a file type + */ +static /*@observer@*/ +const char * rpmfiFtstring (rpmFileTypes ft) + /*@*/ +{ + switch (ft) { + case XDIR: return "directory"; + case CDEV: return "char dev"; + case BDEV: return "block dev"; + case LINK: return "link"; + case SOCK: return "sock"; + case PIPE: return "fifo/pipe"; + case REG: return "file"; + default: return "unknown file type"; + } + /*@notreached@*/ +} + +/** + * Return file type from mode_t. + * @param mode file mode bits (from header) + * @return file type + */ +static rpmFileTypes rpmfiWhatis(rpmuint16_t mode) + /*@*/ +{ + if (S_ISDIR(mode)) return XDIR; + if (S_ISCHR(mode)) return CDEV; + if (S_ISBLK(mode)) return BDEV; + if (S_ISLNK(mode)) return LINK; +/*@-unrecog@*/ + if (S_ISSOCK(mode)) return SOCK; +/*@=unrecog@*/ + if (S_ISFIFO(mode)) return PIPE; + return REG; +} + +int rpmfiCompare(const rpmfi afi, const rpmfi bfi) + /*@*/ +{ + rpmFileTypes awhat = rpmfiWhatis(rpmfiFMode(afi)); + rpmFileTypes bwhat = rpmfiWhatis(rpmfiFMode(bfi)); + + if (awhat != bwhat) return 1; + + if (awhat == LINK) { + const char * alink = rpmfiFLink(afi); + const char * blink = rpmfiFLink(bfi); + if (alink == blink) return 0; + if (alink == NULL) return 1; + if (blink == NULL) return -1; + return strcmp(alink, blink); + } else if (awhat == REG) { + int aalgo = 0; + size_t alen = 0; + const unsigned char * adigest = rpmfiDigest(afi, &aalgo, &alen); + int balgo = 0; + size_t blen = 0; + const unsigned char * bdigest = rpmfiDigest(bfi, &balgo, &blen); + /* XXX W2DO? changing file digest algo may break rpmfiCompare. */ + if (!(aalgo == balgo && alen == blen)) + return -1; + if (adigest == bdigest) return 0; + if (adigest == NULL) return 1; + if (bdigest == NULL) return -1; + return memcmp(adigest, bdigest, alen); + } + + return 0; +} + +int rpmfiDecideFate(const rpmfi ofi, rpmfi nfi, int skipMissing) +{ + const char * fn = rpmfiFN(nfi); + int newFlags = rpmfiFFlags(nfi); + char buffer[1024+1]; + rpmFileTypes dbWhat, newWhat, diskWhat; + struct stat sb; + int save = (newFlags & RPMFILE_NOREPLACE) ? FA_ALTNAME : FA_SAVE; + + if (Lstat(fn, &sb)) { + /* + * The file doesn't exist on the disk. Create it unless the new + * package has marked it as missingok, or allfiles is requested. + */ + if (skipMissing && (newFlags & RPMFILE_MISSINGOK)) { + rpmlog(RPMLOG_DEBUG, D_("%s skipped due to missingok flag\n"), + fn); + return FA_SKIP; + } else { + return FA_CREATE; + } + } + + diskWhat = rpmfiWhatis((rpmuint16_t)sb.st_mode); + dbWhat = rpmfiWhatis(rpmfiFMode(ofi)); + newWhat = rpmfiWhatis(rpmfiFMode(nfi)); + + /* + * RPM >= 2.3.10 shouldn't create config directories -- we'll ignore + * them in older packages as well. + */ + if (newWhat == XDIR) + return FA_CREATE; + + if (diskWhat != newWhat && dbWhat != REG && dbWhat != LINK) + return save; + else if (newWhat != dbWhat && diskWhat != dbWhat) + return save; + else if (dbWhat != newWhat) + return FA_CREATE; + else if (dbWhat != LINK && dbWhat != REG) + return FA_CREATE; + + /* + * This order matters - we'd prefer to CREATE the file if at all + * possible in case something else (like the timestamp) has changed. + */ + memset(buffer, 0, sizeof(buffer)); + if (dbWhat == REG) { + int oalgo = 0; + size_t olen = 0; + const unsigned char * odigest; + int nalgo = 0; + size_t nlen = 0; + const unsigned char * ndigest; + odigest = rpmfiDigest(ofi, &oalgo, &olen); + if (diskWhat == REG) { + if (!(newFlags & RPMFILE_SPARSE)) + if (dodigest(oalgo, fn, (unsigned char *)buffer, 0, NULL)) + return FA_CREATE; /* assume file has been removed */ + if (odigest && !memcmp(odigest, buffer, olen)) + return FA_CREATE; /* unmodified config file, replace. */ + } + ndigest = rpmfiDigest(nfi, &nalgo, &nlen); +/*@-nullpass@*/ + if (odigest && ndigest && oalgo == nalgo && olen == nlen + && !memcmp(odigest, ndigest, nlen)) + return FA_SKIP; /* identical file, don't bother. */ +/*@=nullpass@*/ + } else /* dbWhat == LINK */ { + const char * oFLink, * nFLink; + oFLink = rpmfiFLink(ofi); + if (diskWhat == LINK) { + if (Readlink(fn, buffer, sizeof(buffer) - 1) == -1) + return FA_CREATE; /* assume file has been removed */ + buffer[sizeof(buffer)-1] = '\0'; + if (oFLink && !strcmp(oFLink, buffer)) + return FA_CREATE; /* unmodified config file, replace. */ + } + nFLink = rpmfiFLink(nfi); +/*@-nullpass@*/ + if (oFLink && nFLink && !strcmp(oFLink, nFLink)) + return FA_SKIP; /* identical file, don't bother. */ +/*@=nullpass@*/ + } + + /* + * The config file on the disk has been modified, but + * the ones in the two packages are different. It would + * be nice if RPM was smart enough to at least try and + * merge the difference ala CVS, but... + */ + return save; +} + +/*@observer@*/ +const char * rpmfiTypeString(rpmfi fi) +{ + switch(rpmteType((rpmte)fi->te)) { + case TR_ADDED: return " install"; + case TR_REMOVED: return " erase"; + default: return "???"; + } + /*@noteached@*/ +} + +#define alloca_strdup(_s) strcpy((char *)alloca(strlen(_s)+1), (_s)) + +/** + * Relocate files in header. + * @todo multilib file dispositions need to be checked. + * @param ts transaction set + * @param fi transaction element file info + * @param origH package header + * @param actions file dispositions + * @return header with relocated files + */ +static +Header relocateFileList(const rpmts ts, rpmfi fi, + Header origH, iosmFileAction * actions) + /*@globals rpmGlobalMacroContext, h_errno, + internalState @*/ + /*@modifies ts, fi, origH, actions, rpmGlobalMacroContext, + internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmte p = rpmtsRelocateElement(ts); + static int _printed = 0; + int allowBadRelocate = (rpmtsFilterFlags(ts) & RPMPROB_FILTER_FORCERELOCATE); + rpmRelocation relocations = NULL; + int numRelocations; + const char ** validRelocations; + rpmTagType validType; + int numValid; + const char ** baseNames; + const char ** dirNames; + rpmuint32_t * dirIndexes; + rpmuint32_t fileCount; + rpmuint32_t dirCount; + rpmuint32_t mydColor = rpmExpandNumeric("%{?_autorelocate_dcolor}"); + rpmuint32_t * fFlags = NULL; + rpmuint32_t * fColors = NULL; + rpmuint32_t * dColors = NULL; + rpmuint16_t * fModes = NULL; + Header h; + int nrelocated = 0; + size_t fileAlloced = 0; + char * fn = NULL; + int haveRelocatedFile = 0; + int reldel = 0; + size_t len; + int i, j; + int xx; + + he->tag = RPMTAG_PREFIXES; + xx = headerGet(origH, he, 0); + validType = he->t; + validRelocations = he->p.argv; + numValid = he->c; + if (!xx) + numValid = 0; + +assert(p != NULL); + numRelocations = 0; + if (p->relocs) + while (p->relocs[numRelocations].newPath || + p->relocs[numRelocations].oldPath) + numRelocations++; + + /* + * If no relocations are specified (usually the case), then return the + * original header. If there are prefixes, however, then INSTPREFIXES + * should be added, but, since relocateFileList() can be called more + * than once for the same header, don't bother if already present. + */ + if (p->relocs == NULL || numRelocations == 0) { + if (numValid) { + if (!headerIsEntry(origH, RPMTAG_INSTPREFIXES)) { + he->tag = RPMTAG_INSTPREFIXES; + he->t = validType; + he->p.argv = validRelocations; + he->c = numValid; + xx = headerPut(origH, he, 0); + } + validRelocations = _free(validRelocations); + } + /* XXX FIXME multilib file actions need to be checked. */ +/*@-castexpose@*/ + return headerLink(origH); +/*@=castexpose@*/ + } + +/*@-castexpose@*/ + h = headerLink(origH); +/*@=castexpose@*/ + + relocations = (rpmRelocation) alloca(sizeof(*relocations) * numRelocations); + + /* Build sorted relocation list from raw relocations. */ + for (i = 0; i < numRelocations; i++) { + char * t; + + /* + * Default relocations (oldPath == NULL) are handled in the UI, + * not rpmlib. + */ + if (p->relocs[i].oldPath == NULL) continue; /* XXX can't happen */ + + /* FIXME: Trailing /'s will confuse us greatly. Internal ones will + too, but those are more trouble to fix up. :-( */ + t = alloca_strdup(p->relocs[i].oldPath); + relocations[i].oldPath = (t[0] == '/' && t[1] == '\0') + ? t + : stripTrailingChar(t, '/'); + + /* An old path w/o a new path is valid, and indicates exclusion */ + if (p->relocs[i].newPath) { + int del; + + t = alloca_strdup(p->relocs[i].newPath); + relocations[i].newPath = (t[0] == '/' && t[1] == '\0') + ? t + : stripTrailingChar(t, '/'); + + /*@-nullpass@*/ /* FIX: relocations[i].oldPath == NULL */ + /* Verify that the relocation's old path is in the header. */ + for (j = 0; j < numValid; j++) { + if (!strcmp(validRelocations[j], relocations[i].oldPath)) + /*@innerbreak@*/ break; + } + + /* XXX actions check prevents problem from being appended twice. */ + if (j == numValid && !allowBadRelocate && actions) { + rpmps ps = rpmtsProblems(ts); + rpmpsAppend(ps, RPMPROB_BADRELOCATE, + rpmteNEVR(p), rpmteKey(p), + relocations[i].oldPath, NULL, NULL, 0); + ps = rpmpsFree(ps); + } + del = + (int)strlen(relocations[i].newPath) - (int)strlen(relocations[i].oldPath); + /*@=nullpass@*/ + + if (del > reldel) + reldel = del; + } else { + relocations[i].newPath = NULL; + } + } + + /* stupid bubble sort, but it's probably faster here */ + for (i = 0; i < numRelocations; i++) { + int madeSwap; + madeSwap = 0; + for (j = 1; j < numRelocations; j++) { + struct rpmRelocation_s tmpReloc; + if (relocations[j - 1].oldPath == NULL || /* XXX can't happen */ + relocations[j ].oldPath == NULL || /* XXX can't happen */ + strcmp(relocations[j - 1].oldPath, relocations[j].oldPath) <= 0) + /*@innercontinue@*/ continue; + /*@-usereleased@*/ /* LCL: ??? */ + tmpReloc = relocations[j - 1]; + relocations[j - 1] = relocations[j]; + relocations[j] = tmpReloc; + /*@=usereleased@*/ + madeSwap = 1; + } + if (!madeSwap) break; + } + + if (!_printed) { + _printed = 1; + rpmlog(RPMLOG_DEBUG, D_("========== relocations\n")); + for (i = 0; i < numRelocations; i++) { + if (relocations[i].oldPath == NULL) continue; /* XXX can't happen */ + if (relocations[i].newPath == NULL) + rpmlog(RPMLOG_DEBUG, D_("%5d exclude %s\n"), + i, relocations[i].oldPath); + else + rpmlog(RPMLOG_DEBUG, D_("%5d relocate %s -> %s\n"), + i, relocations[i].oldPath, relocations[i].newPath); + } + } + + /* Add relocation values to the header */ + if (numValid) { + const char ** actualRelocations; + int numActual; + + actualRelocations = (const char **) xmalloc(numValid * sizeof(*actualRelocations)); + numActual = 0; + for (i = 0; i < numValid; i++) { + for (j = 0; j < numRelocations; j++) { + if (relocations[j].oldPath == NULL || /* XXX can't happen */ + strcmp(validRelocations[i], relocations[j].oldPath)) + /*@innercontinue@*/ continue; + /* On install, a relocate to NULL means skip the path. */ + if (relocations[j].newPath) { + actualRelocations[numActual] = relocations[j].newPath; + numActual++; + } + /*@innerbreak@*/ break; + } + if (j == numRelocations) { + actualRelocations[numActual] = validRelocations[i]; + numActual++; + } + } + + if (numActual) { + he->tag = RPMTAG_INSTPREFIXES; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = actualRelocations; + he->c = numActual; + xx = headerPut(h, he, 0); + } + + actualRelocations = _free(actualRelocations); + validRelocations = _free(validRelocations); + } + + he->tag = RPMTAG_BASENAMES; + xx = headerGet(h, he, 0); + baseNames = he->p.argv; + fileCount = he->c; + he->tag = RPMTAG_DIRINDEXES; + xx = headerGet(h, he, 0); + dirIndexes = he->p.ui32p; + he->tag = RPMTAG_DIRNAMES; + xx = headerGet(h, he, 0); + dirNames = he->p.argv; + dirCount = he->c; + he->tag = RPMTAG_FILEFLAGS; + xx = headerGet(h, he, 0); + fFlags = he->p.ui32p; + he->tag = RPMTAG_FILECOLORS; + xx = headerGet(h, he, 0); + fColors = he->p.ui32p; + he->tag = RPMTAG_FILEMODES; + xx = headerGet(h, he, 0); + fModes = he->p.ui16p; + + dColors = (rpmuint32_t *) alloca(dirCount * sizeof(*dColors)); + memset(dColors, 0, dirCount * sizeof(*dColors)); + + /* + * For all relocations, we go through sorted file/relocation lists + * backwards so that /usr/local relocations take precedence over /usr + * ones. + */ + + /* Relocate individual paths. */ + + for (i = fileCount - 1; i >= 0; i--) { + rpmFileTypes ft; + size_t fnlen; + + len = reldel + + strlen(dirNames[dirIndexes[i]]) + strlen(baseNames[i]) + 1; + if (len >= fileAlloced) { + fileAlloced = len * 2; + fn = (char *) xrealloc(fn, fileAlloced); + } + +assert(fn != NULL); /* XXX can't happen */ + *fn = '\0'; + fnlen = stpcpy( stpcpy(fn, dirNames[dirIndexes[i]]), baseNames[i]) - fn; + +if (fColors != NULL) { +/* XXX pkgs may not have unique dirNames, so color all dirNames that match. */ +for (j = 0; j < (int)dirCount; j++) { +if (strcmp(dirNames[dirIndexes[i]], dirNames[j])) /*@innercontinue@*/ continue; +dColors[j] |= fColors[i]; +} +} + + /* + * See if this file path needs relocating. + */ + /* + * XXX FIXME: Would a bsearch of the (already sorted) + * relocation list be a good idea? + */ + for (j = numRelocations - 1; j >= 0; j--) { + if (relocations[j].oldPath == NULL) /* XXX can't happen */ + /*@innercontinue@*/ continue; + len = strcmp(relocations[j].oldPath, "/") + ? strlen(relocations[j].oldPath) + : 0; + + if (fnlen < len) + /*@innercontinue@*/ continue; + /* + * Only subdirectories or complete file paths may be relocated. We + * don't check for '\0' as our directory names all end in '/'. + */ + if (!(fn[len] == '/' || fnlen == len)) + /*@innercontinue@*/ continue; + + if (strncmp(relocations[j].oldPath, fn, len)) + /*@innercontinue@*/ continue; + /*@innerbreak@*/ break; + } + if (j < 0) continue; + +/*@-nullderef@*/ /* FIX: fModes may be NULL */ + ft = rpmfiWhatis(fModes[i]); +/*@=nullderef@*/ + + /* On install, a relocate to NULL means skip the path. */ + if (relocations[j].newPath == NULL) { + if (ft == XDIR) { + /* Start with the parent, looking for directory to exclude. */ + for (j = dirIndexes[i]; j < (int)dirCount; j++) { + len = strlen(dirNames[j]) - 1; + while (len > 0 && dirNames[j][len-1] == '/') len--; + if (fnlen != len) + /*@innercontinue@*/ continue; + if (strncmp(fn, dirNames[j], fnlen)) + /*@innercontinue@*/ continue; + /*@innerbreak@*/ break; + } + } + if (actions) { + actions[i] = FA_SKIPNSTATE; + rpmlog(RPMLOG_DEBUG, D_("excluding %s %s\n"), + rpmfiFtstring(ft), fn); + } + continue; + } + + /* Relocation on full paths only, please. */ + if (fnlen != len) continue; + + if (actions) + rpmlog(RPMLOG_DEBUG, D_("relocating %s to %s\n"), + fn, relocations[j].newPath); + nrelocated++; + + strcpy(fn, relocations[j].newPath); + { char * te = strrchr(fn, '/'); + if (te) { + if (te > fn) te++; /* root is special */ + fnlen = te - fn; + } else + te = fn + strlen(fn); + /*@-nullpass -nullderef@*/ /* LCL: te != NULL here. */ + if (strcmp(baseNames[i], te)) /* basename changed too? */ + baseNames[i] = alloca_strdup(te); + *te = '\0'; /* terminate new directory name */ + /*@=nullpass =nullderef@*/ + } + + /* Does this directory already exist in the directory list? */ + for (j = 0; j < (int)dirCount; j++) { + if (fnlen != strlen(dirNames[j])) + /*@innercontinue@*/ continue; + if (strncmp(fn, dirNames[j], fnlen)) + /*@innercontinue@*/ continue; + /*@innerbreak@*/ break; + } + + if (j < (int)dirCount) { + dirIndexes[i] = j; + continue; + } + + /* Creating new paths is a pita */ + if (!haveRelocatedFile) { + const char ** newDirList; + + haveRelocatedFile = 1; + newDirList = (const char **) xmalloc((dirCount + 1) * sizeof(*newDirList)); + for (j = 0; j < (int)dirCount; j++) + newDirList[j] = alloca_strdup(dirNames[j]); + dirNames = _free(dirNames); + dirNames = newDirList; + } else { + dirNames = (const char **) xrealloc(dirNames, + sizeof(*dirNames) * (dirCount + 1)); + } + + dirNames[dirCount] = alloca_strdup(fn); + dirIndexes[i] = dirCount; + dirCount++; + } + + /* Finish off by relocating directories. */ + for (i = dirCount - 1; i >= 0; i--) { + for (j = numRelocations - 1; j >= 0; j--) { + + /* XXX Don't autorelocate uncolored directories. */ + if (j == p->autorelocatex + && (dColors[i] == 0 || !(dColors[i] & mydColor))) + /*@innercontinue@*/ continue; + + if (relocations[j].oldPath == NULL) /* XXX can't happen */ + /*@innercontinue@*/ continue; + len = strcmp(relocations[j].oldPath, "/") + ? strlen(relocations[j].oldPath) + : 0; + + if (len && strncmp(relocations[j].oldPath, dirNames[i], len)) + /*@innercontinue@*/ continue; + + /* + * Only subdirectories or complete file paths may be relocated. We + * don't check for '\0' as our directory names all end in '/'. + */ + if (dirNames[i][len] != '/') + /*@innercontinue@*/ continue; + + if (relocations[j].newPath) { /* Relocate the path */ + const char * s = relocations[j].newPath; + size_t slen = strlen(s) + strlen(dirNames[i]) - len; + char * t = (char *) alloca(slen + 1); + + (void) stpcpy( stpcpy(t, s) , dirNames[i] + len); + + /* Unfortunatly rpmCleanPath strips the trailing slash.. */ + (void) rpmCleanPath(t); + slen = strlen(t); + t[slen] = '/'; + t[slen+1] = '\0'; + + if (actions) + rpmlog(RPMLOG_DEBUG, + D_("relocating directory %s to %s\n"), dirNames[i], t); + dirNames[i] = t; + nrelocated++; + } + } + } + + /* Save original filenames in header and replace (relocated) filenames. */ + if (nrelocated) { + he->tag = RPMTAG_BASENAMES; + xx = headerGet(h, he, 0); + he->tag = RPMTAG_ORIGBASENAMES; + xx = headerPut(h, he, 0); + he->p.ptr = _free(he->p.ptr); + + he->tag = RPMTAG_DIRNAMES; + xx = headerGet(h, he, 0); + he->tag = RPMTAG_ORIGDIRNAMES; + xx = headerPut(h, he, 0); + he->p.ptr = _free(he->p.ptr); + + he->tag = RPMTAG_DIRINDEXES; + xx = headerGet(h, he, 0); + he->tag = RPMTAG_ORIGDIRINDEXES; + xx = headerPut(h, he, 0); + he->p.ptr = _free(he->p.ptr); + + he->tag = RPMTAG_BASENAMES; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = baseNames; + he->c = fileCount; + xx = headerMod(h, he, 0); + fi->bnl = _free(fi->bnl); + xx = headerGet(h, he, 0); +/*@-dependenttrans@*/ + fi->bnl = he->p.argv; +/*@=dependenttrans@*/ + fi->fc = he->c; + + he->tag = RPMTAG_DIRNAMES; + he->t = RPM_STRING_ARRAY_TYPE; + he->p.argv = dirNames; + he->c = dirCount; + xx = headerMod(h, he, 0); + fi->dnl = _free(fi->dnl); + xx = headerGet(h, he, 0); + fi->dnl = he->p.argv; + fi->dc = he->c; + + he->tag = RPMTAG_DIRINDEXES; + he->t = RPM_UINT32_TYPE; + he->p.ui32p = dirIndexes; + he->c = fileCount; + xx = headerMod(h, he, 0); + fi->dil = _free(fi->dil); + xx = headerGet(h, he, 0); +/*@-dependenttrans@*/ + fi->dil = he->p.ui32p; +/*@=dependenttrans@*/ + } + + baseNames = _free(baseNames); + dirIndexes = _free(dirIndexes); + dirNames = _free(dirNames); + fFlags = _free(fFlags); + fColors = _free(fColors); + fModes = _free(fModes); + +/*@-dependenttrans@*/ + fn = _free(fn); +/*@=dependenttrans@*/ + +/*@-retalias@*/ + return h; +/*@=retalias@*/ +} + +int rpmfiSetHeader(rpmfi fi, Header h) +{ + if (fi->h != NULL) + (void)headerFree(fi->h); + fi->h = NULL; +/*@-assignexpose -castexpose @*/ + if (h != NULL) + fi->h = headerLink(h); +/*@=assignexpose =castexpose @*/ + return 0; +} + +static void rpmfiFini(void * _fi) + /*@modifies *_fi @*/ +{ + rpmfi fi = (rpmfi) _fi; + + /* Free pre- and post-transaction script and interpreter strings. */ + fi->pretrans = _free(fi->pretrans); + fi->pretransprog = _free(fi->pretransprog); + fi->posttrans = _free(fi->posttrans); + fi->posttransprog = _free(fi->posttransprog); + fi->verifyscript = _free(fi->verifyscript); + fi->verifyscriptprog = _free(fi->verifyscriptprog); + + if (fi->fc > 0) { + fi->bnl = _free(fi->bnl); + fi->dnl = _free(fi->dnl); + + fi->flinks = _free(fi->flinks); + fi->flangs = _free(fi->flangs); + fi->fdigests = _free(fi->fdigests); + fi->digests = _free(fi->digests); + + fi->cdict = _free(fi->cdict); + + fi->fuser = _free(fi->fuser); + fi->fgroup = _free(fi->fgroup); + + fi->fstates = _free(fi->fstates); + + fi->fmtimes = _free(fi->fmtimes); + fi->fmodes = _free(fi->fmodes); + fi->fflags = _free(fi->fflags); + fi->vflags = _free(fi->vflags); + fi->fsizes = _free(fi->fsizes); + fi->frdevs = _free(fi->frdevs); + fi->finodes = _free(fi->finodes); + fi->dil = _free(fi->dil); + + fi->fcolors = _free(fi->fcolors); + fi->fcdictx = _free(fi->fcdictx); + fi->ddict = _free(fi->ddict); + fi->fddictx = _free(fi->fddictx); + fi->fddictn = _free(fi->fddictn); + } + +/*@-globs@*/ /* Avoid rpmGlobalMacroContext */ + fi->fsm = freeFSM((IOSM_t)fi->fsm); +/*@=globs@*/ + + fi->_fnbf = rpmbfFree((rpmbf)fi->_fnbf); + fi->exclude = (miRE) mireFreeAll(fi->exclude, fi->nexclude); + fi->include = (miRE) mireFreeAll(fi->include, fi->ninclude); + + fi->fn = _free(fi->fn); + fi->apath = _free(fi->apath); + fi->fmapflags = _free(fi->fmapflags); + + fi->obnl = _free(fi->obnl); + fi->odnl = _free(fi->odnl); + + fi->fcontexts = _free(fi->fcontexts); + + fi->actions = _free(fi->actions); + fi->replacedSizes = _free(fi->replacedSizes); + + (void)headerFree(fi->h); + fi->h = NULL; +} + +/*@unchecked@*/ /*@only@*/ /*@null@*/ +rpmioPool _rpmfiPool; + +static rpmfi rpmfiGetPool(/*@null@*/ rpmioPool pool) + /*@globals _rpmfiPool, fileSystem, internalState @*/ + /*@modifies pool, _rpmfiPool, fileSystem, internalState @*/ +{ + rpmfi fi; + + if (_rpmfiPool == NULL) { + _rpmfiPool = rpmioNewPool("fi", sizeof(*fi), -1, _rpmfi_debug, + NULL, NULL, rpmfiFini); + pool = _rpmfiPool; + } + fi = (rpmfi) rpmioGetPool(pool, sizeof(*fi)); + memset(((char *)fi)+sizeof(fi->_item), 0, sizeof(*fi)-sizeof(fi->_item)); + return fi; +} + +/** + * Convert hex to binary nibble. + * @param c hex character + * @return binary nibble + */ +static inline unsigned char nibble(char c) + /*@*/ +{ + if (c >= '0' && c <= '9') + return (c - '0'); + if (c >= 'A' && c <= 'F') + return (c - 'A') + 10; + if (c >= 'a' && c <= 'f') + return (c - 'a') + 10; + return 0; +} + +#define _fdupestring(_h, _tag, _data) \ + he->tag = _tag; \ + xx = headerGet((_h), he, 0); \ + _data = he->p.str; + +#define _fdupedata(_h, _tag, _cast, _data) \ + he->tag = _tag; \ + xx = headerGet((_h), he, 0); \ + _data = (_cast) he->p.ptr; + +/*@-strictusereleased@*/ +rpmfi rpmfiNew(const void * _ts, Header h, rpmTag tagN, int flags) +{ +/*@-castexpose@*/ + const rpmts ts = (const rpmts) _ts; +/*@=castexpose@*/ + int scareMem = (flags & 0x1); + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmte p; + rpmfi fi = NULL; + const char * Type; + unsigned char * t; + pgpHashAlgo dalgo; + int xx; + int i; + +assert(scareMem == 0); /* XXX always allocate memory */ + if (tagN == RPMTAG_BASENAMES) { + Type = "Files"; + } else { + Type = "?Type?"; + goto exit; + } + + fi = rpmfiGetPool(_rpmfiPool); + if (fi == NULL) /* XXX can't happen */ + goto exit; + + fi->magic = RPMFIMAGIC; + fi->Type = Type; + fi->i = -1; + fi->tagN = tagN; + + fi->h = NULL; + fi->isSource = + (headerIsEntry(h, RPMTAG_SOURCERPM) == 0 && + headerIsEntry(h, RPMTAG_RPMVERSION) != 0 && + headerIsEntry(h, RPMTAG_ARCH) != 0); + + if (fi->fsm == NULL) + fi->fsm = newFSM(); + + ((FSM_t)fi->fsm)->repackaged = (headerIsEntry(h, RPMTAG_REMOVETID) ? 1 : 0); + + /* 0 means unknown */ + he->tag = RPMTAG_ARCHIVESIZE; + xx = headerGet(h, he, 0); + fi->archivePos = 0; + fi->archiveSize = (xx && he->p.ui32p ? he->p.ui32p[0] : 0); + he->p.ptr = _free(he->p.ptr); + + /* Extract pre- and post-transaction script and interpreter strings. */ + _fdupestring(h, RPMTAG_PRETRANS, fi->pretrans); + _fdupestring(h, RPMTAG_PRETRANSPROG, fi->pretransprog); + _fdupestring(h, RPMTAG_POSTTRANS, fi->posttrans); + _fdupestring(h, RPMTAG_POSTTRANSPROG, fi->posttransprog); + _fdupestring(h, RPMTAG_VERIFYSCRIPT, fi->verifyscript); + _fdupestring(h, RPMTAG_VERIFYSCRIPTPROG, fi->verifyscriptprog); + + he->tag = RPMTAG_BASENAMES; + xx = headerGet(h, he, 0); + /* XXX 3.0.x SRPM's can be used, relative fn's at RPMTAG_OLDFILENAMES. */ + if (xx == 0 && fi->isSource) { + he->tag = RPMTAG_OLDFILENAMES; + xx = headerGet(h, he, 0); + } + fi->bnl = he->p.argv; + fi->fc = he->c; + if (!xx) { + fi->fc = 0; + fi->dc = 0; + goto exit; + } + _fdupedata(h, RPMTAG_DIRNAMES, const char **, fi->dnl); + fi->dc = he->c; + /* XXX 3.0.x SRPM's can be used, relative fn's at RPMTAG_OLDFILENAMES. */ + if (fi->dc == 0 && fi->isSource) { + fi->dc = 1; + fi->dnl = (const char **) xcalloc(3, sizeof(*fi->dnl)); + fi->dnl[0] = (const char *)&fi->dnl[2]; + fi->dil = (rpmuint32_t *) xcalloc(fi->fc, sizeof(*fi->dil)); + } else { + _fdupedata(h, RPMTAG_DIRINDEXES, rpmuint32_t *, fi->dil); + } + _fdupedata(h, RPMTAG_FILEMODES, rpmuint16_t *, fi->fmodes); + _fdupedata(h, RPMTAG_FILEFLAGS, rpmuint32_t *, fi->fflags); + _fdupedata(h, RPMTAG_FILEVERIFYFLAGS, rpmuint32_t *, fi->vflags); + _fdupedata(h, RPMTAG_FILESIZES, rpmuint32_t *, fi->fsizes); + + _fdupedata(h, RPMTAG_FILECOLORS, rpmuint32_t *, fi->fcolors); + fi->color = 0; + if (fi->fcolors != NULL) + for (i = 0; i < (int)fi->fc; i++) + fi->color |= fi->fcolors[i]; + _fdupedata(h, RPMTAG_CLASSDICT, const char **, fi->cdict); + fi->ncdict = he->c; + _fdupedata(h, RPMTAG_FILECLASS, rpmuint32_t *, fi->fcdictx); + + _fdupedata(h, RPMTAG_DEPENDSDICT, rpmuint32_t *, fi->ddict); + fi->nddict = he->c; + _fdupedata(h, RPMTAG_FILEDEPENDSX, rpmuint32_t *, fi->fddictx); + _fdupedata(h, RPMTAG_FILEDEPENDSN, rpmuint32_t *, fi->fddictn); + + _fdupedata(h, RPMTAG_FILESTATES, rpmuint8_t *, fi->fstates); + if (xx == 0 || fi->fstates == NULL) + fi->fstates = (rpmuint8_t *) xcalloc(fi->fc, sizeof(*fi->fstates)); + + fi->action = FA_UNKNOWN; + fi->flags = 0; + +if (fi->actions == NULL) + fi->actions = (int *) xcalloc(fi->fc, sizeof(*fi->actions)); + + /* XXX TR_REMOVED needs IOSM_MAP_{ABSOLUTE,ADDDOT} IOSM_ALL_HARDLINKS */ + fi->mapflags = + IOSM_MAP_PATH | IOSM_MAP_MODE | IOSM_MAP_UID | IOSM_MAP_GID; + + _fdupedata(h, RPMTAG_FILELINKTOS, const char **, fi->flinks); + _fdupedata(h, RPMTAG_FILELANGS, const char **, fi->flangs); + + dalgo = PGPHASHALGO_ERROR; + fi->fdigestalgos = NULL; + _fdupedata(h, RPMTAG_FILEDIGESTALGOS, rpmuint32_t *, fi->fdigestalgos); + if (fi->fdigestalgos) { + /* XXX Insure that all algorithms are either 0 or constant. */ + for (i = 0; i < (int)fi->fc; i++) { + if (fi->fdigestalgos[i] == 0) + continue; + if (dalgo == PGPHASHALGO_ERROR) + dalgo = (pgpHashAlgo) (fi->fdigestalgos[i] & 0xff); + else +assert(dalgo == (pgpHashAlgo)fi->fdigestalgos[i]); + } + fi->fdigestalgos = _free(fi->fdigestalgos); + } else { + he->tag = RPMTAG_FILEDIGESTALGO; + xx = headerGet(h, he, 0); + if (xx) + dalgo = (pgpHashAlgo) he->p.ui32p[0]; + he->p.ptr = _free(he->p.ptr); + } + + switch (dalgo) { + default: dalgo = PGPHASHALGO_MD5; fi->digestlen = 128/8; break; + case PGPHASHALGO_MD2: fi->digestlen = 128/8; break; + case PGPHASHALGO_MD5: fi->digestlen = 128/8; break; + case PGPHASHALGO_SHA1: fi->digestlen = 160/8; break; + case PGPHASHALGO_RIPEMD128: fi->digestlen = 128/8; break; + case PGPHASHALGO_RIPEMD160: fi->digestlen = 160/8; break; + case PGPHASHALGO_RIPEMD256: fi->digestlen = 256/8; break; + case PGPHASHALGO_RIPEMD320: fi->digestlen = 320/8; break; + case PGPHASHALGO_SHA224: fi->digestlen = 224/8; break; + case PGPHASHALGO_SHA256: fi->digestlen = 256/8; break; + case PGPHASHALGO_SHA384: fi->digestlen = 384/8; break; + case PGPHASHALGO_SHA512: fi->digestlen = 512/8; break; + case PGPHASHALGO_CRC32: fi->digestlen = 32/8; break; + } + fi->digestalgo = dalgo; + + fi->digests = NULL; + _fdupedata(h, RPMTAG_FILEDIGESTS, const char **, fi->fdigests); + if (fi->fdigests) { + t = (unsigned char *) xmalloc(fi->fc * fi->digestlen); + fi->digests = t; + for (i = 0; i < (int)fi->fc; i++) { + const char * fdigests; + int j; + + fdigests = fi->fdigests[i]; + if (!(fdigests && *fdigests != '\0')) { + memset(t, 0, fi->digestlen); + t += fi->digestlen; + continue; + } + for (j = 0; j < (int)fi->digestlen; j++, t++, fdigests += 2) + *t = (nibble(fdigests[0]) << 4) | nibble(fdigests[1]); + } + fi->fdigests = _free(fi->fdigests); + } + + /* XXX TR_REMOVED doesn't need fmtimes, frdevs, finodes, or fcontexts */ + _fdupedata(h, RPMTAG_FILEMTIMES, rpmuint32_t *, fi->fmtimes); + _fdupedata(h, RPMTAG_FILERDEVS, rpmuint16_t *, fi->frdevs); + _fdupedata(h, RPMTAG_FILEINODES, rpmuint32_t *, fi->finodes); + _fdupedata(h, RPMTAG_FILECONTEXTS, const char **, fi->fcontexts); + + fi->replacedSizes = (rpmuint32_t *) xcalloc(fi->fc, sizeof(*fi->replacedSizes)); + + _fdupedata(h, RPMTAG_FILEUSERNAME, const char **, fi->fuser); + _fdupedata(h, RPMTAG_FILEGROUPNAME, const char **, fi->fgroup); + + if (ts != NULL) + if (fi != NULL) + if ((p = rpmtsRelocateElement(ts)) != NULL && rpmteType(p) == TR_ADDED + && headerIsEntry(h, RPMTAG_SOURCERPM) + && !headerIsEntry(h, RPMTAG_ORIGBASENAMES)) + { + const char * fmt = rpmGetPath("%{?_autorelocate_path}", NULL); + const char * errstr; + char * newPath; + Header foo; + + /* XXX error handling. */ + newPath = headerSprintf(h, fmt, NULL, rpmHeaderFormats, &errstr); + fmt = _free(fmt); + + /* XXX Make sure autoreloc is not already specified. */ + i = p->nrelocs; + if (newPath != NULL && *newPath != '\0' && p->relocs != NULL) + for (i = 0; i < p->nrelocs; i++) { +/*@-nullpass@*/ /* XXX {old,new}Path might be NULL */ + if (strcmp(p->relocs[i].oldPath, "/")) + continue; + if (strcmp(p->relocs[i].newPath, newPath)) + continue; +/*@=nullpass@*/ + break; + } + + /* XXX test for incompatible arch triggering autorelocation is dumb. */ + /* XXX DIEDIEDIE: used to test '... && p->archScore == 0' */ + if (newPath != NULL && *newPath != '\0' && i == p->nrelocs) { + + p->relocs = + (rpmRelocation) xrealloc(p->relocs, (p->nrelocs + 2) * sizeof(*p->relocs)); + p->relocs[p->nrelocs].oldPath = xstrdup("/"); + p->relocs[p->nrelocs].newPath = xstrdup(newPath); + p->autorelocatex = p->nrelocs; + p->nrelocs++; + p->relocs[p->nrelocs].oldPath = NULL; + p->relocs[p->nrelocs].newPath = NULL; + } + newPath = _free(newPath); + +/* XXX DYING */ +if (fi->actions == NULL) + fi->actions = (int *) xcalloc(fi->fc, sizeof(*fi->actions)); + /*@-compdef@*/ /* FIX: fi->digests undefined */ + foo = relocateFileList(ts, fi, h, (iosmFileAction *) fi->actions); + /*@=compdef@*/ + (void)headerFree(fi->h); + fi->h = NULL; + fi->h = headerLink(foo); + (void)headerFree(foo); + foo = NULL; + } + + if (fi->isSource && fi->dc == 1 && *fi->dnl[0] == '\0') { + const char ** av = (const char **) xcalloc(4+1, sizeof(*av)); + char * te; + size_t nb; + + xx = headerMacrosLoad(h); + av[0] = rpmGenPath(rpmtsRootDir(ts), "%{_sourcedir}", ""); + av[1] = rpmGenPath(rpmtsRootDir(ts), "%{_specdir}", ""); + av[2] = rpmGenPath(rpmtsRootDir(ts), "%{_patchdir}", ""); + av[3] = rpmGenPath(rpmtsRootDir(ts), "%{_icondir}", ""); + av[4] = NULL; + xx = headerMacrosUnload(h); + + /* Hack up a header RPM_STRING_ARRAY_TYPE array. */ + fi->dnl = _free(fi->dnl); + fi->dc = 4; + nb = fi->dc * sizeof(*av); + for (i = 0; i < (int)fi->dc; i++) + nb += strlen(av[i]) + sizeof("/"); + + fi->dnl = (const char **) xmalloc(nb); + te = (char *) (&fi->dnl[fi->dc]); + *te = '\0'; + for (i = 0; i < (int)fi->dc; i++) { + fi->dnl[i] = te; + te = stpcpy( stpcpy(te, av[i]), "/"); + *te++ = '\0'; + } + av = argvFree(av); + + /* Map basenames to appropriate directories. */ + for (i = 0; i < (int)fi->fc; i++) { + if (fi->fflags[i] & RPMFILE_SOURCE) + fi->dil[i] = 0; + else if (fi->fflags[i] & RPMFILE_SPECFILE) + fi->dil[i] = 1; + else if (fi->fflags[i] & RPMFILE_PATCH) + fi->dil[i] = 2; + else if (fi->fflags[i] & RPMFILE_ICON) + fi->dil[i] = 3; + else { + const char * b = fi->bnl[i]; + const char * be = b + strlen(b) - sizeof(".spec") - 1; + + fi->dil[i] = (be > b && !strcmp(be, ".spec") ? 1 : 0); + } + } + } + + if (!scareMem) + (void)headerFree(fi->h); + fi->h = NULL; + + fi->fn = NULL; + fi->fnlen = 0; + for (i = 0; i < (int)fi->fc; i++) { + size_t fnlen = strlen(fi->dnl[fi->dil[i]]) + strlen(fi->bnl[i]); + fnlen++; /* XXX guarantee space for pesky trailing '/' */ + if (fnlen > fi->fnlen) + fi->fnlen = fnlen; + } + + fi->dperms = 0755; + fi->fperms = 0644; + +exit: +/*@-modfilesys@*/ +if (_rpmfi_debug < 0) +fprintf(stderr, "*** fi %p\t%s[%d]\n", fi, Type, (fi ? fi->fc : 0)); +/*@=modfilesys@*/ + + /*@-compdef -nullstate@*/ /* FIX: rpmfi null annotations */ + return rpmfiLink(fi, (fi ? fi->Type : NULL)); + /*@=compdef =nullstate@*/ +} +/*@=strictusereleased@*/ + +int rpmfiAddRelocation(rpmRelocation * relp, int * nrelp, + const char * oldPath, const char * newPath) +{ +/*@-unqualifiedtrans@*/ + *relp = (rpmRelocation) xrealloc(*relp, sizeof(**relp) * ((*nrelp) + 1)); +/*@=unqualifiedtrans@*/ + (*relp)[*nrelp].oldPath = (oldPath ? xstrdup(oldPath) : NULL); + (*relp)[*nrelp].newPath = (newPath ? xstrdup(newPath) : NULL); + (*nrelp)++; + return 0; +} + +rpmRelocation rpmfiFreeRelocations(rpmRelocation relocs) +{ + if (relocs) { + rpmRelocation r; + for (r = relocs; (r->oldPath || r->newPath); r++) { + r->oldPath = _free(r->oldPath); + r->newPath = _free(r->newPath); + } + relocs = _free(relocs); + } + return NULL; +} + +rpmRelocation rpmfiDupeRelocations(rpmRelocation relocs, int * nrelocsp) +{ + rpmRelocation newr = NULL; + int nrelocs = 0; + + if (relocs) { + rpmRelocation r; + int i; + + for (r = relocs; r->oldPath || r->newPath; r++) + nrelocs++; + newr = (rpmRelocation) xmalloc((nrelocs + 1) * sizeof(*relocs)); + + for (i = 0, r = relocs; r->oldPath || r->newPath; i++, r++) { + newr[i].oldPath = r->oldPath ? xstrdup(r->oldPath) : NULL; + newr[i].newPath = r->newPath ? xstrdup(r->newPath) : NULL; + } + newr[i].oldPath = NULL; + newr[i].newPath = NULL; + } + if (nrelocsp) + *nrelocsp = nrelocs; + return newr; +} + +int rpmfiFStat(rpmfi fi, struct stat * st) +{ + int rc = -1; + + if (st != NULL && fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc) { + memset(st, 0, sizeof(*st)); + st->st_dev = + st->st_rdev = fi->frdevs[fi->i]; + st->st_ino = fi->finodes[fi->i]; + st->st_mode = fi->fmodes[fi->i]; + st->st_nlink = rpmfiFNlink(fi) + (int)S_ISDIR(st->st_mode); + if (unameToUid(fi->fuser[fi->i], &st->st_uid) == -1) + st->st_uid = 0; /* XXX */ + if (gnameToGid(fi->fgroup[fi->i], &st->st_gid) == -1) + st->st_gid = 0; /* XXX */ + st->st_size = fi->fsizes[fi->i]; + st->st_blksize = 4 * 1024; /* XXX */ + st->st_blocks = (st->st_size + (st->st_blksize - 1)) / st->st_blksize; + st->st_atime = + st->st_ctime = + st->st_mtime = fi->fmtimes[fi->i]; + rc = 0; + } + + return rc; +} + +int rpmfiStat(rpmfi fi, const char * path, struct stat * st) +{ + size_t pathlen = strlen(path); + int rc = -1; + int i; + + while (pathlen > 0 && path[pathlen-1] == '/') + pathlen--; + + /* If not actively iterating, initialize. */ + if (!(fi != NULL && fi->i >= 0 && fi->i < (int)fi->fc)) + fi = rpmfiInit(fi, 0); + + while ((i = rpmfiNext(fi)) >= 0) { + const char * fn = rpmfiFN(fi); + size_t fnlen = strlen(fn); + + if (pathlen != fnlen || strncmp(path, fn, fnlen)) + continue; + rc = rpmfiFStat(fi, st); + break; + } + +/*@-modfilesys@*/ +if (_rpmfi_debug) +fprintf(stderr, "*** rpmfiStat(%p, %s, %p) rc %d\n", fi, path, st, rc); +/*@=modfilesys@*/ + + return rc; +} + +void * rpmfiOpendir(rpmfi fi, const char * name) +{ + const char * dn = name; + size_t dnlen = strlen(dn); + const char ** fnames = NULL; + rpmuint16_t * fmodes = NULL; + DIR * dir; + int xx; + int i, j; + + j = 0; + fmodes = (rpmuint16_t *) xcalloc(fi->fc, sizeof(*fmodes)); + + /* XXX todo full iteration is pig slow, fi->dil can be used for speedup. */ + fi = rpmfiInit(fi, 0); + while ((i = rpmfiNext(fi)) >= 0) { + const char * fn = rpmfiFN(fi); + size_t fnlen = strlen(fn); + + if (fnlen <= dnlen) + continue; + if (strncmp(dn, fn, dnlen) || fn[dnlen] != '/') + continue; + + /* XXX todo basename, or orphandir/.../basname, needs to be used. */ + /* Trim the directory part of the name. */ + xx = argvAdd(&fnames, fn + dnlen + 1); + fmodes[j++] = fi->fmodes[i]; + } + + /* Add "." & ".." to the argv array. */ + dir = (DIR *) avOpendir(name, fnames, fmodes); + + fnames = argvFree(fnames); + fmodes = _free(fmodes); + +/*@-modfilesys +voidabstract @*/ +if (_rpmfi_debug) +fprintf(stderr, "*** rpmfiOpendir(%p, %s) dir %p\n", fi, name, dir); +/*@=modfilesys =voidabstract @*/ + + return (void *)dir; +} + +void rpmfiBuildFClasses(Header h, + /*@out@*/ const char *** fclassp, /*@out@*/ rpmuint32_t * fcp) +{ + int scareMem = 0; + rpmfi fi = rpmfiNew(NULL, h, RPMTAG_BASENAMES, scareMem); + const char * FClass; + const char ** av; + int ac; + size_t nb; + char * t; + + if ((ac = rpmfiFC(fi)) <= 0) { + av = NULL; + ac = 0; + goto exit; + } + + /* Compute size of file class argv array blob. */ + nb = (ac + 1) * sizeof(*av); + fi = rpmfiInit(fi, 0); + if (fi != NULL) + while (rpmfiNext(fi) >= 0) { + FClass = rpmfiFClass(fi); + if (FClass && *FClass != '\0') + nb += strlen(FClass); + nb += 1; + } + + /* Create and load file class argv array. */ + av = (const char **) xmalloc(nb); + t = ((char *) av) + ((ac + 1) * sizeof(*av)); + ac = 0; + fi = rpmfiInit(fi, 0); + if (fi != NULL) + while (rpmfiNext(fi) >= 0) { + FClass = rpmfiFClass(fi); + av[ac++] = t; + if (FClass && *FClass != '\0') + t = stpcpy(t, FClass); + *t++ = '\0'; + } + av[ac] = NULL; /* XXX tag arrays are not NULL terminated. */ + +exit: + fi = rpmfiFree(fi); + if (fclassp) + *fclassp = av; + else + av = _free(av); + if (fcp) *fcp = ac; +} + +#ifdef DYING +void rpmfiBuildFContexts(Header h, + /*@out@*/ const char *** fcontextp, /*@out@*/ rpmuint32_t * fcp) +{ + int scareMem = 0; + rpmfi fi = rpmfiNew(NULL, h, RPMTAG_BASENAMES, scareMem); + const char * fcontext; + const char ** av; + int ac; + size_t nb; + char * t; + + if ((ac = rpmfiFC(fi)) <= 0) { + av = NULL; + ac = 0; + goto exit; + } + + /* Compute size of argv array blob. */ + nb = (ac + 1) * sizeof(*av); + fi = rpmfiInit(fi, 0); + if (fi != NULL) + while (rpmfiNext(fi) >= 0) { + fcontext = rpmfiFContext(fi); + if (fcontext && *fcontext != '\0') + nb += strlen(fcontext); + nb += 1; + } + + /* Create and load argv array. */ + av = (const char **) xmalloc(nb); + t = ((char *) av) + ((ac + 1) * sizeof(*av)); + ac = 0; + fi = rpmfiInit(fi, 0); + if (fi != NULL) + while (rpmfiNext(fi) >= 0) { + fcontext = rpmfiFContext(fi); + av[ac++] = t; + if (fcontext && *fcontext != '\0') + t = stpcpy(t, fcontext); + *t++ = '\0'; + } + av[ac] = NULL; /* XXX tag arrays are not NULL terminated. */ + +exit: + fi = rpmfiFree(fi); + if (fcontextp) + *fcontextp = av; + else + av = _free(av); + if (fcp) *fcp = ac; +} + +void rpmfiBuildFSContexts(Header h, + /*@out@*/ const char *** fcontextp, /*@out@*/ rpmuint32_t * fcp) +{ + int scareMem = 0; + rpmfi fi = rpmfiNew(NULL, h, RPMTAG_BASENAMES, scareMem); + const char ** av; + int ac; + size_t nb; + char * t; + char * fctxt = NULL; + size_t fctxtlen = 0; + int * fcnb; + + if ((ac = rpmfiFC(fi)) <= 0) { + av = NULL; + ac = 0; + goto exit; + } + + /* Compute size of argv array blob, concatenating file contexts. */ + nb = ac * sizeof(*fcnb); + fcnb = memset(alloca(nb), 0, nb); + ac = 0; + fi = rpmfiInit(fi, 0); + if (fi != NULL) + while (rpmfiNext(fi) >= 0) { + const char *fn; + security_context_t scon = NULL; + + fn = rpmfiFN(fi); + fcnb[ac] = lgetfilecon(fn, &scon); + if (fcnb[ac] > 0) { + fctxt = (char *) xrealloc(fctxt, fctxtlen + fcnb[ac]); + memcpy(fctxt+fctxtlen, scon, fcnb[ac]); + fctxtlen += fcnb[ac]; + freecon(scon); + } + ac++; + } + + /* Create and load argv array from concatenated file contexts. */ + nb = (ac + 1) * sizeof(*av) + fctxtlen; + av = (const char **) xmalloc(nb); + t = ((char *) av) + ((ac + 1) * sizeof(*av)); + if (fctxt != NULL && fctxtlen > 0) + (void) memcpy(t, fctxt, fctxtlen); + ac = 0; + fi = rpmfiInit(fi, 0); + if (fi != NULL) + while (rpmfiNext(fi) >= 0) { + av[ac] = ""; + if (fcnb[ac] > 0) { + av[ac] = t; + t += fcnb[ac]; + } + ac++; + } + av[ac] = NULL; /* XXX tag arrays are not NULL terminated. */ + +exit: + fi = rpmfiFree(fi); + if (fcontextp) + *fcontextp = av; + else + av = _free(av); + if (fcp) *fcp = ac; +} + +void rpmfiBuildREContexts(Header h, + /*@out@*/ const char *** fcontextp, /*@out@*/ rpmuint32_t * fcp) +{ + int scareMem = 0; + rpmfi fi = rpmfiNew(NULL, h, RPMTAG_BASENAMES, scareMem); + const char ** av = NULL; + int ac; + size_t nb; + char * t; + char * fctxt = NULL; + size_t fctxtlen = 0; + int * fcnb; + + if ((ac = rpmfiFC(fi)) <= 0) { + ac = 0; + goto exit; + } + + /* Read security context patterns. */ + { const char *fn = rpmGetPath("%{?__file_context_path}", NULL); +/*@-moduncon -noeffectuncon @*/ + if (fn != NULL && *fn != '\0') + (void)matchpathcon_init(fn); +/*@=moduncon =noeffectuncon @*/ + fn = _free(fn); + } + + /* Compute size of argv array blob, concatenating file contexts. */ + nb = ac * sizeof(*fcnb); + fcnb = memset(alloca(nb), 0, nb); + ac = 0; + fi = rpmfiInit(fi, 0); + if (fi != NULL) + while (rpmfiNext(fi) >= 0) { + const char *fn; + mode_t fmode; + security_context_t scon; + + fn = rpmfiFN(fi); + fmode = rpmfiFMode(fi); + scon = NULL; +/*@-moduncon@*/ + if (matchpathcon(fn, fmode, &scon) == 0 && scon != NULL) { + fcnb[ac] = strlen(scon) + 1; + if (fcnb[ac] > 0) { + fctxt = (char *) xrealloc(fctxt, fctxtlen + fcnb[ac]); + memcpy(fctxt+fctxtlen, scon, fcnb[ac]); + fctxtlen += fcnb[ac]; + } + freecon(scon); + } +/*@=moduncon@*/ + ac++; + } + + /* Create and load argv array from concatenated file contexts. */ + nb = (ac + 1) * sizeof(*av) + fctxtlen; + av = (const char **) xmalloc(nb); + t = ((char *) av) + ((ac + 1) * sizeof(*av)); + (void) memcpy(t, fctxt, fctxtlen); + ac = 0; + fi = rpmfiInit(fi, 0); + if (fi != NULL) + while (rpmfiNext(fi) >= 0) { + av[ac] = ""; + if (fcnb[ac] > 0) { + av[ac] = t; + t += fcnb[ac]; + } + ac++; + } + av[ac] = NULL; /* XXX tag arrays are not NULL terminated. */ + +exit: +/*@-moduncon -noeffectuncon @*/ + matchpathcon_fini(); +/*@=moduncon =noeffectuncon @*/ + fi = rpmfiFree(fi); + if (fcontextp) + *fcontextp = av; + else + av = _free(av); + if (fcp) *fcp = ac; +} +#endif + +void rpmfiBuildFDeps(Header h, rpmTag tagN, + /*@out@*/ const char *** fdepsp, /*@out@*/ rpmuint32_t * fcp) +{ + int scareMem = 0; + rpmfi fi = rpmfiNew(NULL, h, RPMTAG_BASENAMES, scareMem); + rpmds ds = NULL; + const char ** av; + int ac; + size_t nb; + char * t; + char deptype = 'R'; + char mydt; + const char * DNEVR; + const rpmuint32_t * ddict; + unsigned ix; + int ndx; + + if ((ac = rpmfiFC(fi)) <= 0) { + av = NULL; + ac = 0; + goto exit; + } + + if (tagN == RPMTAG_PROVIDENAME) + deptype = 'P'; + else if (tagN == RPMTAG_REQUIRENAME) + deptype = 'R'; + + ds = rpmdsNew(h, tagN, scareMem); + + /* Compute size of file depends argv array blob. */ + nb = (ac + 1) * sizeof(*av); + fi = rpmfiInit(fi, 0); + if (fi != NULL) + while (rpmfiNext(fi) >= 0) { + ddict = NULL; + ndx = rpmfiFDepends(fi, &ddict); + if (ddict != NULL) + while (ndx-- > 0) { + ix = *ddict++; + mydt = ((ix >> 24) & 0xff); + if (mydt != deptype) + /*@innercontinue@*/ continue; + ix &= 0x00ffffff; + (void) rpmdsSetIx(ds, ix-1); + if (rpmdsNext(ds) < 0) + /*@innercontinue@*/ continue; + DNEVR = rpmdsDNEVR(ds); + if (DNEVR != NULL) + nb += strlen(DNEVR+2) + 1; + } + nb += 1; + } + + /* Create and load file depends argv array. */ + av = (const char **) xmalloc(nb); + t = ((char *) av) + ((ac + 1) * sizeof(*av)); + ac = 0; + fi = rpmfiInit(fi, 0); + if (fi != NULL) + while (rpmfiNext(fi) >= 0) { + av[ac++] = t; + ddict = NULL; + ndx = rpmfiFDepends(fi, &ddict); + if (ddict != NULL) + while (ndx-- > 0) { + ix = *ddict++; + mydt = ((ix >> 24) & 0xff); + if (mydt != deptype) + /*@innercontinue@*/ continue; + ix &= 0x00ffffff; + (void) rpmdsSetIx(ds, ix-1); + if (rpmdsNext(ds) < 0) + /*@innercontinue@*/ continue; + DNEVR = rpmdsDNEVR(ds); + if (DNEVR != NULL) { + t = stpcpy(t, DNEVR+2); + *t++ = ' '; + *t = '\0'; + } + } + *t++ = '\0'; + } + av[ac] = NULL; /* XXX tag arrays are not NULL terminated. */ + +exit: + fi = rpmfiFree(fi); + (void)rpmdsFree(ds); + ds = NULL; + if (fdepsp) + *fdepsp = av; + else + av = _free(av); + if (fcp) *fcp = ac; +} diff --git a/rpm-5.4.9/lib/rpmfi.h b/rpm-5.4.9/lib/rpmfi.h new file mode 100644 index 0000000..3b18876 --- /dev/null +++ b/rpm-5.4.9/lib/rpmfi.h @@ -0,0 +1,878 @@ +#ifndef H_RPMFI +#define H_RPMFI + +/** \ingroup rpmfi + * \file lib/rpmfi.h + * Structure(s) used for file info tag sets. + */ + +/*@-exportlocal@*/ +/*@unchecked@*/ +extern int _rpmfi_debug; +/*@=exportlocal@*/ + +/** \ingroup rpmfi + * File types. + * These are the file types used internally by rpm. The file + * type is determined by applying stat(2) macros like S_ISDIR to + * the file mode tag from a header. The values are arbitrary, + * but are identical to the linux stat(2) file types. + */ +typedef enum rpmFileTypes_e { + PIPE = 1, /*!< pipe/fifo */ + CDEV = 2, /*!< character device */ + XDIR = 4, /*!< directory */ + BDEV = 6, /*!< block device */ + REG = 8, /*!< regular file */ + LINK = 10, /*!< hard link */ + SOCK = 12 /*!< socket */ +} rpmFileTypes; + +/** + * File States (when installed). + */ +typedef enum rpmfileState_e { + RPMFILE_STATE_NORMAL = 0, + RPMFILE_STATE_REPLACED = 1, + RPMFILE_STATE_NOTINSTALLED = 2, + RPMFILE_STATE_NETSHARED = 3, + RPMFILE_STATE_WRONGCOLOR = 4 +} rpmfileState; +#define RPMFILE_STATE_MISSING -1 /* XXX used for unavailable data */ + +/** + * File Attributes. + */ +typedef enum rpmfileAttrs_e { +/*@-enummemuse@*/ + RPMFILE_NONE = 0, +/*@=enummemuse@*/ + RPMFILE_CONFIG = (1 << 0), /*!< from %%config */ + RPMFILE_DOC = (1 << 1), /*!< from %%doc */ + RPMFILE_ICON = (1 << 2), /*!< from Icon: */ + RPMFILE_MISSINGOK = (1 << 3), /*!< from %%config(missingok) */ + RPMFILE_NOREPLACE = (1 << 4), /*!< from %%config(noreplace) */ + RPMFILE_SPECFILE = (1 << 5), /*!< the specfile (srpm only). */ + RPMFILE_GHOST = (1 << 6), /*!< from %%ghost */ + RPMFILE_LICENSE = (1 << 7), /*!< from %%license */ + RPMFILE_README = (1 << 8), /*!< from %%readme */ + RPMFILE_EXCLUDE = (1 << 9), /*!< from %%exclude, internal */ + RPMFILE_UNPATCHED = (1 << 10), /*!< (deprecated) placeholder (SuSE) */ + RPMFILE_PUBKEY = (1 << 11), /*!< from %%pubkey */ + RPMFILE_POLICY = (1 << 12), /*!< from %%policy */ + RPMFILE_EXISTS = (1 << 13), /*!< did lstat(fn, st) succeed? */ + RPMFILE_SPARSE = (1 << 14), /*!< was ((512*st->st_blocks) < st->st_size) ? */ + RPMFILE_TYPED = (1 << 15), /*!< (unimplemented) from %%spook */ + RPMFILE_SOURCE = (1 << 16), /*!< from SourceN: (srpm only). */ + RPMFILE_PATCH = (1 << 17), /*!< from PatchN: (srpm only). */ + RPMFILE_OPTIONAL = (1 << 18), /*!< from %%optional. */ + RPMFILE_REMOVE = (1 << 19) /*!< remove file (after %post). */ +} rpmfileAttrs; + +#define RPMFILE_SPOOK (RPMFILE_GHOST|RPMFILE_TYPED) +#define RPMFILE_ALL ~(RPMFILE_NONE) + +/** \ingroup rpmfi + * File info tag sets from a header, so that a header can be discarded early. + */ +typedef /*@abstract@*/ /*@refcounted@*/ struct rpmfi_s * rpmfi; + +#if defined(_RPMFI_INTERNAL) + +#include "mire.h" + +/** \ingroup rpmfi + * A package filename set. + */ +struct rpmfi_s { + struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ + int i; /*!< Current file index. */ + int j; /*!< Current directory index. */ + +/*@observer@*/ + const char * Type; /*!< Tag name. */ + + rpmTag tagN; /*!< Header tag. */ +/*@refcounted@*/ /*@null@*/ + Header h; /*!< Header for file info set (or NULL) */ + +/*@only@*/ /*@relnull@*/ + const char ** bnl; /*!< Base name(s) (from header) */ +/*@only@*/ /*@relnull@*/ + const char ** dnl; /*!< Directory name(s) (from header) */ + +/*@only@*/ /*@relnull@*/ + const char ** fdigests; /*!< File digest(s) (from header) */ +/*@only@*/ /*@null@*/ + rpmuint32_t * fdigestalgos; /*!< File digest algorithm(s) (from header) */ +/*@only@*/ /*@relnull@*/ + const char ** flinks; /*!< File link(s) (from header) */ +/*@only@*/ /*@null@*/ + const char ** flangs; /*!< File lang(s) (from header) */ + +/*@only@*/ /*@relnull@*/ + rpmuint32_t * dil; /*!< Directory indice(s) (from header) */ +/*@only@*/ /*@relnull@*/ + const rpmuint32_t * fflags; /*!< File flag(s) (from header) */ +/*@only@*/ /*@relnull@*/ + const rpmuint32_t * fsizes; /*!< File size(s) (from header) */ +/*@only@*/ /*@relnull@*/ + const rpmuint32_t * fmtimes;/*!< File modification time(s) (from header) */ +/*@only@*/ /*@relnull@*/ + rpmuint16_t * fmodes; /*!< File mode(s) (from header) */ +/*@only@*/ /*@relnull@*/ + const rpmuint16_t * frdevs; /*!< File rdev(s) (from header) */ +/*@only@*/ /*@relnull@*/ + const rpmuint32_t * finodes;/*!< File inodes(s) (from header) */ + +/*@only@*/ /*@null@*/ + const char ** fuser; /*!< File owner(s) (from header) */ +/*@only@*/ /*@null@*/ + const char ** fgroup; /*!< File group(s) (from header) */ + +/*@only@*/ /*@null@*/ + rpmuint8_t * fstates; /*!< File state(s) (from header) */ + +/*@only@*/ /*@null@*/ + const rpmuint32_t * fcolors;/*!< File color bits (header) */ + +/*@only@*/ /*@null@*/ + const char ** fcaps; /*! File capabilities. */ + +/*@only@*/ /*@null@*/ + const char ** fcontexts; /*! File security contexts. */ + +/*@only@*/ /*@null@*/ + const char ** cdict; /*!< File class dictionary (header) */ + rpmuint32_t ncdict; /*!< No. of class entries. */ +/*@only@*/ /*@null@*/ + const rpmuint32_t * fcdictx;/*!< File class dictionary index (header) */ + +/*@only@*/ /*@null@*/ + const rpmuint32_t * ddict; /*!< File depends dictionary (header) */ + rpmuint32_t nddict; /*!< No. of depends entries. */ +/*@only@*/ /*@null@*/ + const rpmuint32_t * fddictx;/*!< File depends dictionary start (header) */ +/*@only@*/ /*@null@*/ + const rpmuint32_t * fddictn;/*!< File depends dictionary count (header) */ + +/*@only@*/ /*@relnull@*/ + const rpmuint32_t * vflags; /*!< File verify flag(s) (from header) */ + + rpmuint32_t dc; /*!< No. of directories. */ + rpmuint32_t fc; /*!< No. of files. */ + +/*=============================*/ +/*@dependent@*/ /*@relnull@*/ + void * te; + +/*@only@*/ + void * _fnbf; /*!< File paths Bloom filter. */ +/*@only@*/ /*@null@*/ + miRE exclude; /*!< Iterator exclude patterns. */ + int nexclude; /*!< No. of exclude patterns. */ +/*@only@*/ /*@null@*/ + miRE include; /*!< Iterator include patterns. */ + int ninclude; /*!< No. of include patterns. */ + +/*-----------------------------*/ + uid_t uid; /*!< File uid (default). */ + gid_t gid; /*!< File gid (default). */ + rpmuint32_t flags; /*!< File flags (default). */ + int action; /*!< File disposition (default). */ +/*@owned@*/ /*@relnull@*/ + int * actions; /*!< File disposition(s). */ +/*@owned@*/ + struct fingerPrint_s * fps; /*!< File fingerprint(s). */ +/*@owned@*/ + const char ** obnl; /*!< Original basename(s) (from header) */ +/*@owned@*/ + const char ** odnl; /*!< Original dirname(s) (from header) */ +/*@unused@*/ + rpmuint32_t * odil; /*!< Original dirindex(s) (from header) */ + +/*@only@*/ /*@relnull@*/ + unsigned char * digests; /*!< File digest(s) in binary. */ + rpmuint32_t digestalgo; /*!< File digest algorithm. */ + rpmuint32_t digestlen; /*!< No. bytes in binary digest. */ + +/*@only@*/ /*@relnull@*/ + const char * pretrans; +/*@only@*/ /*@relnull@*/ + const char * pretransprog; +/*@only@*/ /*@relnull@*/ + const char * posttrans; +/*@only@*/ /*@relnull@*/ + const char * posttransprog; +/*@only@*/ /*@relnull@*/ + const char * verifyscript; +/*@only@*/ /*@relnull@*/ + const char * verifyscriptprog; + +/*@only@*/ /*@null@*/ + char * fn; /*!< File name buffer, fnlen + 1 bytes. */ + size_t fnlen; /*!< Maximum file name length (without '\0'). */ + + size_t astriplen; + size_t striplen; + unsigned long long archivePos; + unsigned long long archiveSize; + mode_t dperms; /*!< Directory perms (0755) if not mapped. */ + mode_t fperms; /*!< File perms (0644) if not mapped. */ +/*@only@*/ /*@null@*/ + const char ** apath; + int mapflags; +/*@owned@*/ /*@null@*/ + int * fmapflags; +/*@owned@*/ + void * fsm; /*!< File state machine data. */ + rpmuint32_t color; /*!< Color bit(s) from file color union. */ + + int isSource; /*!< Is this a SRPM? */ + +/*@owned@*/ + rpmuint32_t * replacedSizes;/*!< (TR_ADDED) */ + + unsigned int record; /*!< (TR_REMOVED) */ + int magic; +#define RPMFIMAGIC 0x09697923 +/*=============================*/ +#if defined(__LCLINT__) +/*@refs@*/ + int nrefs; /*!< (unused) keep splint happy */ +#endif +}; + +#endif /* _RPMFI_INTERNAL */ + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(_RPMFI_NOMETHODS) +/** \name RPMFI */ +/*@{*/ + +/** + * Unreference a file info set instance. + * @param fi file info set + * @param msg + * @return NULL on last dereference + */ +/*@unused@*/ /*@null@*/ +rpmfi rpmfiUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmfi fi, + /*@null@*/ const char * msg) + /*@modifies fi @*/; +#define rpmfiUnlink(_fi, _msg) \ + ((rpmfi) rpmioUnlinkPoolItem((rpmioItem)(_fi), _msg, __FILE__, __LINE__)) + +/** + * Reference a file info set instance. + * @param fi file info set + * @param msg + * @return new file info set reference + */ +/*@unused@*/ /*@null@*/ +rpmfi rpmfiLink (/*@null@*/ rpmfi fi, /*@null@*/ const char * msg) + /*@modifies fi @*/; +#define rpmfiLink(_fi, _msg) \ + ((rpmfi) rpmioLinkPoolItem((rpmioItem)(_fi), _msg, __FILE__, __LINE__)) + +/** + * Return file count from file info set. + * @param fi file info set + * @return current file count + */ +int rpmfiFC(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Return current file index from file info set. + * @param fi file info set + * @return current file index + */ +/*@unused@*/ +int rpmfiFX(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Set current file index in file info set. + * @param fi file info set + * @param fx new file index + * @return current file index + */ +/*@unused@*/ +int rpmfiSetFX(/*@null@*/ rpmfi fi, int fx) + /*@modifies fi @*/; + +/** + * Return directory count from file info set. + * @param fi file info set + * @return current directory count + */ +int rpmfiDC(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Return current directory index from file info set. + * @param fi file info set + * @return current directory index + */ +int rpmfiDX(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Set current directory index in file info set. + * @param fi file info set + * @param dx new directory index + * @return current directory index + */ +int rpmfiSetDX(/*@null@*/ rpmfi fi, int dx) + /*@modifies fi @*/; + +/** + * Return source rpm marker from file info set. + * @param fi file info set + * @return source rpm? + */ +int rpmfiIsSource(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Return current base name from file info set. + * @param fi file info set + * @return current base name, NULL on invalid + */ +/*@observer@*/ /*@null@*/ +extern const char * rpmfiBN(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Return current directory name from file info set. + * @param fi file info set + * @return current directory, NULL on invalid + */ +/*@observer@*/ /*@null@*/ +extern const char * rpmfiDN(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Return current file name from file info set. + * @param fi file info set + * @return current file name + */ +/*@observer@*/ +extern const char * rpmfiFN(/*@null@*/ rpmfi fi) + /*@modifies fi @*/; + +/** + * Return maximum file name length from file info set. + * @param fi file info set + * @return maximum file name length (not including '\0') + */ +extern size_t rpmfiFNMaxLen(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Return current file flags from file info set. + * @param fi file info set + * @return current file flags, 0 on invalid + */ +rpmuint32_t rpmfiFFlags(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Set current file flags in file info set. + * @param fi file info set + * @param FFlags new file flags + * @return previous file flags, 0 on invalid + */ +rpmuint32_t rpmfiSetFFlags(/*@null@*/ rpmfi fi, rpmuint32_t FFlags) + /*@modifies fi @*/; + +/** + * Return current file verify flags from file info set. + * @param fi file info set + * @return current file verify flags, 0 on invalid + */ +rpmuint32_t rpmfiVFlags(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Set current file verify flags in file info set. + * @param fi file info set + * @param VFlags new file verify flags + * @return previous file verify flags, 0 on invalid + */ +rpmuint32_t rpmfiSetVFlags(/*@null@*/ rpmfi fi, rpmuint32_t VFlags) + /*@modifies fi @*/; + +/** + * Return current file mode from file info set. + * @param fi file info set + * @return current file mode, 0 on invalid + */ +rpmuint16_t rpmfiFMode(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Return current file state from file info set. + * @param fi file info set + * @return current file state, 0 on invalid + */ +rpmfileState rpmfiFState(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Set current file state in file info set. + * @param fi file info set + * @param fstate new file state + * @return previous file state, 0 on invalid + */ +rpmfileState rpmfiSetFState(/*@null@*/ rpmfi fi, rpmfileState fstate) + /*@modifies fi @*/; + +/** + * Return current file (binary) digest from file info set. + * @param fi file info set + * @retval *algop digest algorithm + * @retval *lenp digest length (in bytes) + * @return current file digest, NULL on invalid + */ +/*@observer@*/ /*@null@*/ +extern const unsigned char * rpmfiDigest(/*@null@*/ rpmfi fi, + /*@out@*/ /*@null@*/ int * algop, + /*@out@*/ /*@null@*/ size_t * lenp) + /*@modifies *algop, *lenp @*/; + +/** + * Return current file linkto (i.e. symlink(2) target) from file info set. + * @param fi file info set + * @return current file linkto, NULL on invalid + */ +/*@observer@*/ /*@null@*/ +extern const char * rpmfiFLink(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Return current file size from file info set. + * @param fi file info set + * @return current file size, 0 on invalid + */ +rpmuint32_t rpmfiFSize(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Return current file rdev from file info set. + * @param fi file info set + * @return current file rdev, 0 on invalid + */ +rpmuint16_t rpmfiFRdev(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Return current file inode from file info set. + * @param fi file info set + * @return current file inode, 0 on invalid + */ +rpmuint32_t rpmfiFInode(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Return union of all file color bits from file info set. + * @param fi file info set + * @return current color + */ +rpmuint32_t rpmfiColor(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Return current file color bits from file info set. + * @param fi file info set + * @return current file color + */ +rpmuint32_t rpmfiFColor(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Return current file class from file info set. + * @param fi file info set + * @return current file class, 0 on invalid + */ +/*@-exportlocal@*/ +/*@observer@*/ /*@null@*/ +extern const char * rpmfiFClass(/*@null@*/ rpmfi fi) + /*@*/; +/*@=exportlocal@*/ + +/** + * Return current file security context from file info set. + * @param fi file info set + * @return current file context, 0 on invalid + */ +/*@-exportlocal@*/ +/*@observer@*/ /*@null@*/ +extern const char * rpmfiFContext(/*@null@*/ rpmfi fi) + /*@*/; +/*@=exportlocal@*/ + +/** + * Return current file depends dictionary from file info set. + * @param fi file info set + * @retval *fddictp file depends dictionary array (or NULL) + * @return no. of file depends entries, 0 on invalid + */ +rpmuint32_t rpmfiFDepends(/*@null@*/ rpmfi fi, + /*@out@*/ /*@null@*/ const rpmuint32_t ** fddictp) + /*@modifies *fddictp @*/; + +/** + * Return (calculated) current file nlink count from file info set. + * @param fi file info set + * @return current file nlink count, 0 on invalid + */ +rpmuint32_t rpmfiFNlink(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Return current file modify time from file info set. + * @param fi file info set + * @return current file modify time, 0 on invalid + */ +rpmuint32_t rpmfiFMtime(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Return current file owner from file info set. + * @param fi file info set + * @return current file owner, NULL on invalid + */ +/*@observer@*/ /*@null@*/ +extern const char * rpmfiFUser(/*@null@*/ rpmfi fi) + /*@*/; + +/** + * Return current file group from file info set. + * @param fi file info set + * @return current file group, NULL on invalid + */ +/*@observer@*/ /*@null@*/ +extern const char * rpmfiFGroup(/*@null@*/ rpmfi fi) + /*@*/; + +/** \ingroup rpmfi + * Return file path Bloom filter. + * @param fi file info set + * @return file path Bloom filter (NULL if not set) + */ +void * rpmfiBloomFN(/*@null@*/ const rpmfi fi) + /*@*/; + +/** \ingroup rpmfi + * Return file info exclude patterns. + * @param fi file info set + * @return file info exclude patterns (NULL if not set) + */ +/*@null@*/ +void * rpmfiExclude(/*@null@*/ const rpmfi fi) + /*@*/; + +/** \ingroup rpmfi + * Return no. of file info exclude patterns. + * @param fi file info set + * @return file info exclude patterns (0 if not set) + */ +int rpmfiNExclude(/*@null@*/ const rpmfi fi) + /*@*/; + +/** \ingroup rpmfi + * Return file info include patterns. + * @param fi file info set + * @return file info include patterns (NULL if not set) + */ +/*@null@*/ +void * rpmfiInclude(/*@null@*/ const rpmfi fi) + /*@*/; + +/** \ingroup rpmfi + * Return no. of file info include patterns. + * @param fi file info set + * @return file info include patterns (0 if not set) + */ +int rpmfiNInclude(/*@null@*/ const rpmfi fi) + /*@*/; + +#if defined(_RPMFI_INTERNAL) +#include "fprint.h" +/** + * Return fingerprint from file info set. + * @param fi file info set + * @param ix + * @return fingerprint, NULL on invalid + */ +/*@null@*/ +struct fingerPrint_s * rpmfiFpsIndex(rpmfi fi, int ix) + /*@*/; + +void rpmfiFpLookup(rpmfi fi, fingerPrintCache fpc) + /*@modifies fi, fpc @*/; +#endif + +/** + * Return FN Bloom filter from file info set. + * @param fi file info set + * @return FN Bloom filter, NULL on invalid + */ +/*@null@*/ +void * rpmfiFNBF(rpmfi fi) + /*@*/; + +/** + * Return next file iterator index. + * @param fi file info set + * @return file iterator index, -1 on termination + */ +int rpmfiNext(/*@null@*/ rpmfi fi) + /*@modifies fi @*/; + +/** + * Initialize file iterator index. + * @param fi file info set + * @param fx file iterator index + * @return file info set + */ +/*@null@*/ +rpmfi rpmfiInit(/*@null@*/ rpmfi fi, int fx) + /*@modifies fi @*/; + +/** + * Return next directory iterator index. + * @param fi file info set + * @return directory iterator index, -1 on termination + */ +/*@unused@*/ +int rpmfiNextD(/*@null@*/ rpmfi fi) + /*@modifies fi @*/; + +/** + * Initialize directory iterator index. + * @param fi file info set + * @param dx directory iterator index + * @return file info set, NULL if dx is out of range + */ +/*@unused@*/ /*@null@*/ +rpmfi rpmfiInitD(/*@null@*/ rpmfi fi, int dx) + /*@modifies fi @*/; + +/** + * Link a header to a file info set. + * @param fi file info set + * @param h header + * @return 0 always + */ +int rpmfiSetHeader(rpmfi fi, /*@null@*/ Header h) + /*@modifies fi, h @*/; + +/** + * Destroy a file info set. + * @param fi file info set + * @return NULL on last dereference + */ +/*@null@*/ +rpmfi rpmfiFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmfi fi) + /*@globals fileSystem @*/ + /*@modifies fi, fileSystem @*/; +#define rpmfiFree(_fi) \ + ((rpmfi) rpmioFreePoolItem((rpmioItem)(_fi), __FUNCTION__, __FILE__, __LINE__)) + +/** + * Create and load a file info set. + * @param _ts transaction set (NULL skips path relocation) + * @param h header + * @param tagN RPMTAG_BASENAMES + * @param flags scareMem(0x1), nofilter(0x2) + * @return new file info set + */ +/*@null@*/ +rpmfi rpmfiNew(/*@null@*/ const void * _ts, Header h, rpmTag tagN, int flags) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies _ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** + * Return current stat(2) data from file info set. + * @param fi file info set + * @retval *st stat(2) data + * @return -1 on error, 0 on success + */ +int rpmfiFStat(rpmfi fi, /*@out@*/ struct stat * st) + /*@modifies *st @*/; + +/** + * Return lstat(2) data of path from file info set. + * @param fi file info set + * @param path file path + * @retval *st stat(2) data + * @return -1 on error, 0 on success + */ +int rpmfiStat(rpmfi fi, const char * path, /*@out@*/ struct stat * st) + /*@modifies fi, *st @*/; + +/** + * Return directory stream onto file info set. + * @param fi file info set + * @param name directory path + * @return NULL on error + */ +/*@null@*/ +void * rpmfiOpendir(rpmfi fi, const char * name) + /*@globals fileSystem, internalState @*/ + /*@modifies fi, fileSystem, internalState @*/; + +/** + * Retrieve file classes from header. + * + * This function is used to retrieve file classes from the header. + * + * @param h header + * @retval *fclassp array of file classes + * @retval *fcp number of files + */ +void rpmfiBuildFClasses(Header h, + /*@out@*/ const char *** fclassp, /*@out@*/ rpmuint32_t * fcp) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies h, *fclassp, *fcp, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +#ifdef DYING +/** + * Retrieve file security contexts from header. + * + * This function is used to retrieve file contexts from the header. + * + * @param h header + * @retval *fcontextp array of file contexts + * @retval *fcp number of files + */ +void rpmfiBuildFContexts(Header h, + /*@out@*/ const char *** fcontextp, /*@out@*/ rpmuint32_t * fcp) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies h, *fcontextp, *fcp, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +/** + * Retrieve file security contexts from file system. + * + * This function is used to retrieve file contexts from the file system. + * + * @param h header + * @retval *fcontextp array of file contexts + * @retval *fcp number of files + */ +void rpmfiBuildFSContexts(Header h, + /*@out@*/ const char *** fcontextp, /*@out@*/ rpmuint32_t * fcp) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies h, *fcontextp, *fcp, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +/** + * Retrieve file security contexts from policy RE's. + * + * This function is used to retrieve file contexts from policy RE's. + * + * @param h header + * @retval *fcontextp array of file contexts + * @retval *fcp number of files + */ +void rpmfiBuildREContexts(Header h, + /*@out@*/ const char *** fcontextp, /*@out@*/ rpmuint32_t * fcp) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies h, *fcontextp, *fcp, rpmGlobalMacroContext, + fileSystem, internalState @*/; +#endif + +/** + * Retrieve per-file dependencies from header. + * + * This function is used to retrieve per-file dependencies from the header. + * + * @param h header + * @param tagN RPMTAG_PROVIDENAME | RPMTAG_REQUIRENAME + * @retval *fdepsp array of file dependencies + * @retval *fcp number of files + */ +void rpmfiBuildFDeps(Header h, rpmTag tagN, + /*@out@*/ const char *** fdepsp, /*@out@*/ rpmuint32_t * fcp) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies h, *fdepsp, *fcp, + rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** + * Return file info comparison. + * @param afi 1st file info + * @param bfi 2nd file info + * @return 0 if identical + */ +int rpmfiCompare(const rpmfi afi, const rpmfi bfi) + /*@*/; + +/** + * Return file disposition. + * @param ofi old file info + * @param nfi new file info + * @param skipMissing OK to skip missing files? + * @return file dispostion + */ +int rpmfiDecideFate(const rpmfi ofi, rpmfi nfi, int skipMissing) + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies nfi, fileSystem, internalState @*/; + +/** + * Return formatted string representation of package disposition. + * @param fi file info set + * @return formatted string + */ +/*@-redef@*/ +/*@observer@*/ +const char * rpmfiTypeString(rpmfi fi) + /*@*/; +/*@=redef@*/ + +/** + * Free relocation array. + * @param relocs relocation array + * @return NULL always + */ +/*@null@*/ +rpmRelocation rpmfiFreeRelocations(/*@only@*/ rpmRelocation relocs) + /*@modifies relocs@*/; + +/** + * Duplicate a relocation array. + * @param relocs relocation array + * @retval *nrelocsp no. of elements + * @return duplicate relocation array + */ +/*@only@*/ /*@null@*/ +rpmRelocation rpmfiDupeRelocations(rpmRelocation relocs, int * nrelocsp) + /*@modifies *nrelocsp @*/; + +/** + * Add relocation element to array. + * @retval *relocations relocation array + * @retval *nrelocations no. of elements + * @param oldPath old path + * @param newPath new path + * @return 0 on success + */ +int rpmfiAddRelocation(rpmRelocation * relp, int * nrelp, + const char * oldPath, const char * newPath) + /*@modifies *relp, *nrelp @*/; + +/*@}*/ +#endif /* _RPMFI_NOMETHODS */ + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMDS */ diff --git a/rpm-5.4.9/lib/rpmgi.c b/rpm-5.4.9/lib/rpmgi.c new file mode 100644 index 0000000..3ef26a8 --- /dev/null +++ b/rpm-5.4.9/lib/rpmgi.c @@ -0,0 +1,872 @@ +/*@-modfilesys@*/ +/** \ingroup rpmgi + * \file lib/rpmgi.c + */ +#include "system.h" + +#include +#include /* XXX fnpyKey */ +#include +#include /* XXX rpmExpand */ +#include +#include +#include + +#include /* XXX rpmElementType */ +#include /* XXX rpmElementType */ + +#define _RPMGI_INTERNAL +#define _RPMTS_INTERNAL /* XXX ts->probs et al */ +#include + +#include "manifest.h" + +#include /* XXX rpmcliInstallFoo() */ + +#include "debug.h" + +/*@access FD_t @*/ /* XXX void * arg */ +/*@access fnpyKey @*/ +/*@access rpmmi @*/ +/*@access rpmts @*/ +/*@access rpmps @*/ + +/** + */ +/*@unchecked@*/ +int _rpmgi_debug = 0; + +/** + */ +/*@unchecked@*/ +rpmgiFlags giFlags = RPMGI_NONE; + +/** + */ +/*@unchecked@*/ +static int indent = 2; + +/** + */ +/*@unchecked@*/ /*@observer@*/ +static const char * ftsInfoStrings[] = { + "UNKNOWN", + "D", + "DC", + "DEFAULT", + "DNR", + "DOT", + "DP", + "ERR", + "F", + "INIT", + "NS", + "NSOK", + "SL", + "SLNONE", + "W", +}; + +/** + */ +/*@observer@*/ +static const char * ftsInfoStr(int fts_info) + /*@*/ +{ + + if (!(fts_info >= 1 && fts_info <= 14)) + fts_info = 0; +/*@-compmempass@*/ + return ftsInfoStrings[ fts_info ]; +/*@=compmempass@*/ +} + +/** + * Open a file after macro expanding path. + * @todo There are two error messages printed on header, then manifest failures. + * @param path file path + * @param fmode open mode + * @return file handle + */ +/*@null@*/ +static FD_t rpmgiOpen(const char * path, const char * fmode) + /*@globals rpmGlobalMacroContext, h_errno, errno, internalState @*/ + /*@modifies rpmGlobalMacroContext, h_errno, errno, internalState @*/ +{ + const char * fn = rpmExpand(path, NULL); + FD_t fd; + + /* FIXME (see http://rpm5.org/community/rpm-devel/0523.html) */ + errno = 0; + fd = Fopen(fn, fmode); + + if (fd == NULL || Ferror(fd)) { + rpmlog(RPMLOG_ERR, _("open of %s failed: %s\n"), fn, Fstrerror(fd)); + if (fd != NULL) (void) Fclose(fd); + fd = NULL; + } + fn = _free(fn); + +#if defined(POSIX_FADV_WILLNEED) + if(fd != NULL) + (void) Fadvise(fd, 0, 0, POSIX_FADV_WILLNEED); +#endif + + return fd; +} + +/** + * Load manifest into iterator arg list. + * @param gi generalized iterator + * @param path file path + * @return RPMRC_OK on success + */ +static rpmRC rpmgiLoadManifest(rpmgi gi, const char * path) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/ +{ + FD_t fd = rpmgiOpen(path, "r%{?_rpmgio}"); + rpmRC rpmrc = RPMRC_FAIL; + + if (fd != NULL) { + rpmrc = rpmReadPackageManifest(fd, &gi->argc, &gi->argv); + (void) Fclose(fd); + switch (rpmrc) { + case RPMRC_NOTFOUND: + case RPMRC_FAIL: + default: + gi->rc = rpmrc; + break; + case RPMRC_NOTTRUSTED: + case RPMRC_NOKEY: + case RPMRC_NOSIG: + case RPMRC_OK: + /* XXX manifest tried after *.rpm forces a reset. here? */ + if (gi->rc == RPMRC_NOTFOUND) + gi->rc = RPMRC_OK; + break; + } + } else { + gi->rc = RPMRC_NOTFOUND; /* XXX other failures? */ + } + + return rpmrc; +} + +Header rpmgiReadHeader(rpmgi gi, const char * path) +{ + FD_t fd = rpmgiOpen(path, "r%{?_rpmgio}"); + Header h = NULL; + + if (fd != NULL) { + /* XXX what if path needs expansion? */ + rpmRC rpmrc = rpmReadPackageFile(gi->ts, fd, path, &h); + + (void) Fclose(fd); + + switch (rpmrc) { + case RPMRC_NOTFOUND: + /* XXX Read a package manifest. Restart ftswalk on success. */ + case RPMRC_FAIL: + default: + (void)headerFree(h); + h = NULL; + gi->rc = rpmrc; + break; + case RPMRC_NOSIG: /* XXX FIXME */ + case RPMRC_NOTTRUSTED: + case RPMRC_NOKEY: + case RPMRC_OK: + break; + } + } else { + gi->rc = RPMRC_NOTFOUND; /* XXX other failures? */ + } + + return h; +} + +/** + * Load next key from argv list. + * @param gi generalized iterator + * @return RPMRC_OK on success + */ +static rpmRC rpmgiLoadNextKey(rpmgi gi) + /*@modifies gi @*/ +{ + rpmRC rpmrc = RPMRC_NOTFOUND; + if (gi->argv != NULL && gi->argv[gi->i] != NULL) { + gi->keyp = gi->argv[gi->i]; + gi->keylen = 0; + rpmrc = RPMRC_OK; + } else { + gi->i = -1; + gi->keyp = NULL; + gi->keylen = 0; + } + return rpmrc; +} + +/** + * Read next header from package, lazily expanding manifests as found. + * @todo An empty file read as manifest truncates argv returning RPMRC_NOTFOUND. + * @todo Errors, e.g. non-existent path in manifest, will terminate iteration. + * @todo Chained manifests lose an arg someplace. + * @param gi generalized iterator + * @return RPMRC_OK on success + */ +static rpmRC rpmgiLoadReadHeader(rpmgi gi) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/ +{ + rpmRC rpmrc = RPMRC_NOTFOUND; + Header h = NULL; + + if (gi->argv != NULL && gi->argv[gi->i] != NULL) + do { + const char * fn; /* XXX gi->hdrPath? */ + + fn = gi->argv[gi->i]; + /* XXX Skip +bing -bang =boom special arguments. */ + if (strchr("-+=", *fn) == NULL && !(gi->flags & RPMGI_NOHEADER)) { + h = rpmgiReadHeader(gi, fn); + if (h != NULL) + rpmrc = RPMRC_OK; + else + rpmrc = (rpmRC) gi->rc; + } else + rpmrc = RPMRC_OK; + + if (rpmrc == RPMRC_OK || gi->flags & RPMGI_NOMANIFEST) + break; + if (rpmrc == RPMRC_NOSIG) { + /* XXX move error message to caller. */ + rpmlog(RPMLOG_NOTICE, _("not signed: %s\n"), fn); + break; + } + if (errno == ENOENT) + break; + + /* Not a header, so try for a manifest. */ + gi->argv[gi->i] = NULL; /* Mark the insertion point */ + rpmrc = rpmgiLoadManifest(gi, fn); + /* XXX its unclear if RPMRC_NOTFOUND should fail or continue here. */ + if (rpmrc != RPMRC_OK) { + gi->argv[gi->i] = fn; /* Manifest failed, restore fn */ + break; + } + fn = _free(fn); + rpmrc = RPMRC_NOTFOUND; + } while (1); + + if (rpmrc == RPMRC_OK && h != NULL) + gi->h = headerLink(h); + (void)headerFree(h); + h = NULL; + + return rpmrc; +} + +/** + * Filter file tree walk path. + * @param gi generalized iterator + * @return RPMRC_OK on success + */ +/*@null@*/ +static rpmRC rpmgiWalkPathFilter(rpmgi gi) + /*@*/ +{ + FTSENT * fts = gi->fts; + rpmRC rpmrc = RPMRC_NOTFOUND; + const char * s; + +if (_rpmgi_debug < 0) +rpmlog(RPMLOG_DEBUG, "FTS_%s\t%*s %s%s\n", ftsInfoStr(fts->fts_info), + indent * (fts->fts_level < 0 ? 0 : fts->fts_level), "", + fts->fts_name, + ((fts->fts_info == FTS_D || fts->fts_info == FTS_DP) ? "/" : "")); + + switch (fts->fts_info) { + case FTS_D: /* preorder directory */ + break; + case FTS_DP: /* postorder directory */ + break; + case FTS_F: /* regular file */ + if ((size_t)fts->fts_namelen <= sizeof(".rpm")) + break; + /* Ignore all but *.rpm files. */ + s = fts->fts_name + fts->fts_namelen + 1 - sizeof(".rpm"); + if (strcmp(s, ".rpm")) + break; + rpmrc = RPMRC_OK; + break; + case FTS_NS: /* stat(2) failed */ + case FTS_DNR: /* unreadable directory */ + case FTS_ERR: /* error; errno is set */ + break; + case FTS_DC: /* directory that causes cycles */ + case FTS_DEFAULT: /* none of the above */ + case FTS_DOT: /* dot or dot-dot */ + case FTS_INIT: /* initialized only */ + case FTS_NSOK: /* no stat(2) requested */ + case FTS_SL: /* symbolic link */ + case FTS_SLNONE: /* symbolic link without target */ + case FTS_W: /* whiteout object */ + default: + break; + } + return rpmrc; +} + +/** + * Read header from next package, lazily walking file tree. + * @param gi generalized iterator + * @return RPMRC_OK on success + */ +/*@null@*/ +static rpmRC rpmgiWalkReadHeader(rpmgi gi) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/ +{ + rpmRC rpmrc = RPMRC_NOTFOUND; + + if (gi->ftsp != NULL) + while ((gi->fts = Fts_read(gi->ftsp)) != NULL) { + if (gi->walkPathFilter) + rpmrc = (*gi->walkPathFilter) (gi); + else + rpmrc = rpmgiWalkPathFilter(gi); + if (rpmrc == RPMRC_OK) + break; + } + + if (rpmrc == RPMRC_OK) { + Header h = NULL; + if (!(gi->flags & RPMGI_NOHEADER)) { + /* XXX rpmrc = rpmgiLoadReadHeader(gi); */ + if (gi->fts != NULL) /* XXX can't happen */ + h = rpmgiReadHeader(gi, gi->fts->fts_path); + } + if (h != NULL) { + gi->h = headerLink(h); + (void)headerFree(h); + h = NULL; +/*@-noeffectuncon@*/ + if (gi->stash != NULL) + (void) (*gi->stash) (gi, gi->h); +/*@=noeffectuncon@*/ + } + } + + return rpmrc; +} + +const char * rpmgiEscapeSpaces(const char * s) +{ + const char * se; + const char * t; + char * te; + size_t nb = 0; + + for (se = s; *se; se++) { + if (isspace(*se)) + nb++; + nb++; + } + nb++; + + t = te = (char *) xmalloc(nb); + for (se = s; *se; se++) { + if (isspace(*se)) + *te++ = '\\'; + *te++ = *se; + } + *te = '\0'; + return t; +} + +/** + * Append globbed arg list to iterator. + * @param gi generalized iterator + * @param argv arg list to be globbed (or NULL) + * @returns RPMRC_OK on success + */ +static rpmRC rpmgiGlobArgv(rpmgi gi, /*@null@*/ ARGV_t argv) + /*@globals internalState @*/ + /*@modifies gi, internalState @*/ +{ + const char * arg; + rpmRC rpmrc = RPMRC_OK; + int ac = 0; + int xx; + + /* XXX Expand globs only if requested or for gi specific tags */ + if ((gi->flags & RPMGI_NOGLOB) + || !(gi->tag == RPMDBI_HDLIST || gi->tag == RPMDBI_ARGLIST || gi->tag == RPMDBI_FTSWALK)) + { + if (argv != NULL) { + while (argv[ac] != NULL) + ac++; +/*@-nullstate@*/ /* XXX argv is not NULL */ + xx = argvAppend(&gi->argv, argv); +/*@=nullstate@*/ + } + gi->argc = ac; + return rpmrc; + } + + if (argv != NULL) + while ((arg = *argv++) != NULL) { + const char * t = rpmgiEscapeSpaces(arg); + ARGV_t av = NULL; + + xx = rpmGlob(t, &ac, &av); + xx = argvAppend(&gi->argv, av); + gi->argc += ac; + av = argvFree(av); + t = _free(t); + ac = 0; + } + return rpmrc; +} + +/** + * Return rpmdb match iterator with filters (if any) set. + * @param gi generalized iterator + * @returns RPMRC_OK on success + */ +static rpmRC rpmgiInitFilter(rpmgi gi) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/ +{ + rpmRC rpmrc = RPMRC_OK; + ARGV_t av; + int got = 0; + + gi->mi = rpmtsInitIterator(gi->ts, gi->tag, gi->keyp, gi->keylen); + +if (_rpmgi_debug < 0) +fprintf(stderr, "*** gi %p key %p[%d]\tmi %p\n", gi, gi->keyp, (int)gi->keylen, gi->mi); + + if (gi->argv != NULL) + for (av = (const char **) gi->argv; *av != NULL; av++) { + if (gi->tag == RPMDBI_PACKAGES) { + int tag = RPMTAG_NAME; + const char * pat; + char * a, * ae; + + pat = a = xstrdup(*av); + tag = RPMTAG_NAME; + + /* Parse for "tag=pattern" args. */ + if ((ae = strchr(a, '=')) != NULL) { + *ae++ = '\0'; + if (*a != '\0') { /* XXX HACK: permit '=foo' */ + tag = tagValue(a); +#ifdef DYING /* XXX arbitrary tags always have a return value */ + if (tag < 0) { + rpmlog(RPMLOG_NOTICE, _("unknown tag: \"%s\"\n"), a); + got = -1; + } +#endif + } + pat = ae; + got++; + } + if (got) { +if (_rpmgi_debug < 0) +fprintf(stderr, "\tav %p[%d]: \"%s\" -> %s ~= \"%s\"\n", gi->argv, (int)(av - gi->argv), *av, tagName((rpmTag)tag), pat); + got = rpmmiAddPattern(gi->mi, (rpmTag)tag, RPMMIRE_DEFAULT, pat); + } + a = _free(a); + } + + if (got >= 0) + continue; + + gi->mi = rpmmiFree(gi->mi); /* XXX odd side effect? */ + rpmrc = RPMRC_FAIL; + break; + } + + return rpmrc; +} + +/*@-mustmod@*/ +static void rpmgiFini(void * _gi) + /*@modifies _gi @*/ +{ + rpmgi gi = (rpmgi) _gi; + int xx; + + gi->hdrPath = _free(gi->hdrPath); + (void)headerFree(gi->h); + gi->h = NULL; + + gi->argv = argvFree(gi->argv); + + if (gi->ftsp != NULL) { + xx = Fts_close(gi->ftsp); + gi->ftsp = NULL; + gi->fts = NULL; + } + if (gi->fd != NULL) { + xx = Fclose(gi->fd); + gi->fd = NULL; + } + gi->tsi = rpmtsiFree(gi->tsi); + gi->mi = rpmmiFree(gi->mi); + (void)rpmtsFree(gi->ts); + gi->ts = NULL; +} +/*@=mustmod@*/ + +/*@unchecked@*/ /*@only@*/ /*@null@*/ +rpmioPool _rpmgiPool; + +static rpmgi rpmgiGetPool(/*@null@*/ rpmioPool pool) + /*@globals _rpmgiPool, fileSystem, internalState @*/ + /*@modifies pool, _rpmgiPool, fileSystem, internalState @*/ +{ + rpmgi gi; + + if (_rpmgiPool == NULL) { + _rpmgiPool = rpmioNewPool("gi", sizeof(*gi), -1, _rpmgi_debug, + NULL, NULL, rpmgiFini); + pool = _rpmgiPool; + } + gi = (rpmgi) rpmioGetPool(pool, sizeof(*gi)); + memset(((char *)gi)+sizeof(gi->_item), 0, sizeof(*gi)-sizeof(gi->_item)); + return gi; +} + +rpmgi rpmgiNew(rpmts ts, int tag, const void * keyp, size_t keylen) +{ + rpmgi gi = rpmgiGetPool(_rpmgiPool); + + if (gi == NULL) /* XXX can't happen */ + return NULL; + +/*@-assignexpose -castexpose @*/ + gi->ts = rpmtsLink(ts, "rpmgiNew"); +/*@=assignexpose =castexpose @*/ + gi->tsOrder = rpmcliInstallOrder; + gi->tag = (rpmTag) tag; +/*@-assignexpose@*/ + gi->keyp = keyp; +/*@=assignexpose@*/ + gi->keylen = keylen; + + gi->flags = (rpmgiFlags)0; + gi->active = 0; + gi->i = -1; + gi->hdrPath = NULL; + gi->h = NULL; + gi->rc = 0; + + gi->tsi = NULL; + gi->mi = NULL; + gi->fd = NULL; + gi->argv = (ARGV_t) xcalloc(1, sizeof(*gi->argv)); + gi->argc = 0; + gi->ftsOpts = 0; + gi->ftsp = NULL; + gi->fts = NULL; + gi->walkPathFilter = NULL; + gi->stash = NULL; + + return rpmgiLink(gi, "rpmgiNew"); +} + +/*@observer@*/ /*@unchecked@*/ +static const char * _query_hdlist_path = "/usr/share/comps/%{_arch}/hdlist"; + +rpmRC rpmgiNext(/*@null@*/ rpmgi gi) +{ + char hnum[32]; + rpmRC rpmrc = RPMRC_NOTFOUND; + int xx; + + if (gi == NULL) + return rpmrc; + +if (_rpmgi_debug) +fprintf(stderr, "--> %s(%p) tag %s\n", __FUNCTION__, gi, tagName(gi->tag)); + + /* Free header from previous iteration. */ + (void)headerFree(gi->h); + gi->h = NULL; + gi->hdrPath = _free(gi->hdrPath); + hnum[0] = '\0'; + + if (++gi->i >= 0) + switch (gi->tag) { + default: + if (!gi->active) { +nextkey: + rpmrc = rpmgiLoadNextKey(gi); + if (rpmrc != RPMRC_OK) + goto enditer; + rpmrc = rpmgiInitFilter(gi); + if (rpmrc != RPMRC_OK || gi->mi == NULL) { + gi->mi = rpmmiFree(gi->mi); /* XXX unnecessary */ + gi->i++; + goto nextkey; + } + rpmrc = RPMRC_NOTFOUND; /* XXX hack */ + gi->active = 1; + } + if (gi->mi != NULL) { /* XXX unnecessary */ + Header h = rpmmiNext(gi->mi); + if (h != NULL) { + if (!(gi->flags & RPMGI_NOHEADER)) + gi->h = headerLink(h); + /* XXX use h->origin instead. */ + sprintf(hnum, "%u", (unsigned)rpmmiInstance(gi->mi)); + gi->hdrPath = rpmExpand("rpmdb h# ", hnum, NULL); + rpmrc = RPMRC_OK; + /* XXX header reference held by iterator, so no headerFree */ + } + } + if (rpmrc != RPMRC_OK) { + gi->mi = rpmmiFree(gi->mi); + goto nextkey; + } + break; + case RPMDBI_PACKAGES: + if (!gi->active) { + rpmrc = rpmgiInitFilter(gi); + if (rpmrc != RPMRC_OK) { + gi->mi = rpmmiFree(gi->mi); /* XXX unnecessary */ + goto enditer; + } + rpmrc = RPMRC_NOTFOUND; /* XXX hack */ + gi->active = 1; + } + if (gi->mi != NULL) { /* XXX unnecessary */ + Header h = rpmmiNext(gi->mi); + if (h != NULL) { + if (!(gi->flags & RPMGI_NOHEADER)) + gi->h = headerLink(h); + /* XXX use h->origin instead. */ + sprintf(hnum, "%u", (unsigned)rpmmiInstance(gi->mi)); + gi->hdrPath = rpmExpand("rpmdb h# ", hnum, NULL); + rpmrc = RPMRC_OK; + /* XXX header reference held by iterator, so no headerFree */ + } + } + if (rpmrc != RPMRC_OK) { + gi->mi = rpmmiFree(gi->mi); + goto enditer; + } + break; + case RPMDBI_REMOVED: + case RPMDBI_ADDED: + { rpmte p; + rpmElementType teType = (rpmElementType)0; + const char * teTypeString = NULL; + + if (!gi->active) { + gi->tsi = rpmtsiInit(gi->ts); + gi->active = 1; + } + if ((p = rpmtsiNext(gi->tsi, teType)) != NULL) { + Header h = rpmteHeader(p); + if (h != NULL) + if (!(gi->flags & RPMGI_NOHEADER)) { + gi->h = headerLink(h); + switch(rpmteType(p)) { + case TR_ADDED: teTypeString = "+++"; /*@switchbreak@*/break; + case TR_REMOVED: teTypeString = "---"; /*@switchbreak@*/break; + } + sprintf(hnum, "%u", (unsigned)gi->i); + gi->hdrPath = rpmExpand("%s h# ", teTypeString, hnum, NULL); + rpmrc = RPMRC_OK; + (void)headerFree(h); + h = NULL; + } + } + if (rpmrc != RPMRC_OK) { + gi->tsi = rpmtsiFree(gi->tsi); + goto enditer; + } + } break; + case RPMDBI_HDLIST: + if (!gi->active) { + const char * path = rpmExpand("%{?_query_hdlist_path}", NULL); + if (path == NULL || *path == '\0') { + path = _free(path); + path = rpmExpand(_query_hdlist_path, NULL); + } + gi->fd = rpmgiOpen(path, "rm%{?_rpmgio}"); + gi->active = 1; + path = _free(path); + } + if (gi->fd != NULL) { + Header h = NULL; + const char item[] = "Header"; + const char * msg = NULL; +/*@+voidabstract@*/ + rpmrc = rpmpkgRead(item, gi->fd, &h, &msg); +/*@=voidabstract@*/ + switch(rpmrc) { + default: + rpmlog(RPMLOG_ERR, "%s: %s: %s\n", "rpmpkgRead", item, msg); + case RPMRC_NOTFOUND: + h = NULL; + case RPMRC_OK: + break; + } + msg = _free(msg); + if (h != NULL) { + if (!(gi->flags & RPMGI_NOHEADER)) + gi->h = headerLink(h); + sprintf(hnum, "%u", (unsigned)gi->i); + gi->hdrPath = rpmExpand("hdlist h# ", hnum, NULL); + rpmrc = RPMRC_OK; + (void)headerFree(h); + h = NULL; + } + } + if (rpmrc != RPMRC_OK) { + if (gi->fd != NULL) (void) Fclose(gi->fd); + gi->fd = NULL; + goto enditer; + } + break; + case RPMDBI_ARGLIST: + /* XXX gi->active initialize? */ +if (_rpmgi_debug < 0) +fprintf(stderr, "*** gi %p\t%p[%d]: %s\n", gi, gi->argv, gi->i, gi->argv[gi->i]); + /* Read next header, lazily expanding manifests as found. */ + rpmrc = rpmgiLoadReadHeader(gi); + + if (rpmrc != RPMRC_OK) /* XXX check this */ + goto enditer; + + gi->hdrPath = xstrdup(gi->argv[gi->i]); + break; + case RPMDBI_FTSWALK: + if (gi->argv == NULL || gi->argv[0] == NULL) /* HACK */ + goto enditer; + + if (!gi->active) { + gi->ftsp = Fts_open((char *const *)gi->argv, gi->ftsOpts, NULL); + /* XXX NULL with open(2)/malloc(3) errno set */ + gi->active = 1; + } + + /* Read next header, lazily walking file tree. */ + rpmrc = rpmgiWalkReadHeader(gi); + + if (rpmrc != RPMRC_OK) { + xx = Fts_close(gi->ftsp); + gi->ftsp = NULL; + goto enditer; + } + + if (gi->fts != NULL) + gi->hdrPath = xstrdup(gi->fts->fts_path); + break; + } + + if ((gi->flags & RPMGI_TSADD) && gi->h != NULL) { + /* XXX rpmgi hack: Save header in transaction element. */ + if (gi->flags & RPMGI_ERASING) { + uint32_t hdrNum = headerGetInstance(gi->h); + xx = rpmtsAddEraseElement(gi->ts, gi->h, hdrNum); + } else + xx = rpmtsAddInstallElement(gi->ts, gi->h, (fnpyKey)gi->hdrPath, 2, NULL); + } + goto exit; + +enditer: + if (gi->flags & RPMGI_TSORDER) { + rpmts ts = gi->ts; + + /* Block access to indices used for depsolving. */ + if (!(gi->flags & RPMGI_ERASING)) { + (void) rpmtsSetGoal(ts, TSM_INSTALL); + xx = rpmdbBlockDBI(rpmtsGetRdb(ts), -RPMDBI_DEPCACHE); + xx = rpmdbBlockDBI(rpmtsGetRdb(ts), -RPMTAG_BASENAMES); + xx = rpmdbBlockDBI(rpmtsGetRdb(ts), -RPMTAG_PROVIDENAME); + } else { + (void) rpmtsSetGoal(ts, TSM_ERASE); + } + + /* XXX query/verify will need the glop added to a buffer instead. */ + xx = rpmcliInstallCheck(ts); + xx = rpmcliInstallSuggests(ts); + + /* Permit access to indices used for depsolving. */ + if (!(gi->flags & RPMGI_ERASING)) { + xx = rpmdbBlockDBI(rpmtsGetRdb(ts), RPMTAG_PROVIDENAME); + xx = rpmdbBlockDBI(rpmtsGetRdb(ts), RPMTAG_BASENAMES); + xx = rpmdbBlockDBI(rpmtsGetRdb(ts), RPMDBI_DEPCACHE); + } + + /* XXX Display dependency loops with rpm -qvT. */ + if (rpmIsVerbose()) { + rpmdepFlags _depflags = (rpmdepFlags) + (rpmtsDFlags(ts) | RPMDEPS_FLAG_DEPLOOPS); + (void) rpmtsSetDFlags(ts, _depflags); + } + + xx = (*gi->tsOrder) (ts); + + /* XXX hackery alert! */ + gi->tag = (!(gi->flags & RPMGI_ERASING) ? RPMDBI_ADDED : RPMDBI_REMOVED); + gi->flags = (rpmgiFlags) (gi->flags & ~(RPMGI_TSADD|RPMGI_TSORDER)); + + } + + (void)headerFree(gi->h); + gi->h = NULL; + gi->hdrPath = _free(gi->hdrPath); + gi->i = -1; + gi->active = 0; + +exit: +if (_rpmgi_debug) +fprintf(stderr, "<-- %s(%p) rc %d\n", __FUNCTION__, gi, rpmrc); + return rpmrc; +} + +rpmgiFlags rpmgiGetFlags(rpmgi gi) +{ + return (gi != NULL ? gi->flags : RPMGI_NONE); +} + +const char * rpmgiHdrPath(rpmgi gi) +{ + return (gi != NULL ? gi->hdrPath : NULL); +} + +Header rpmgiHeader(rpmgi gi) +{ +/*@-compdef -refcounttrans -retexpose -usereleased@*/ + return (gi != NULL ? gi->h : NULL); +/*@=compdef =refcounttrans =retexpose =usereleased@*/ +} + +rpmts rpmgiTs(rpmgi gi) +{ +/*@-compdef -refcounttrans -retexpose -usereleased@*/ + return (gi != NULL ? gi->ts : NULL); +/*@=compdef =refcounttrans =retexpose =usereleased@*/ +} + +int rpmgiRc(rpmgi gi) +{ + return (gi != NULL ? gi->rc : RPMRC_OK); +} + +rpmRC rpmgiSetArgs(rpmgi gi, ARGV_t argv, int ftsOpts, rpmgiFlags flags) +{ + if (gi == NULL) return RPMRC_FAIL; + gi->ftsOpts = ftsOpts; + gi->flags = flags; + return rpmgiGlobArgv(gi, argv); +} + +/*@=modfilesys@*/ diff --git a/rpm-5.4.9/lib/rpmgi.h b/rpm-5.4.9/lib/rpmgi.h new file mode 100644 index 0000000..c31cb5f --- /dev/null +++ b/rpm-5.4.9/lib/rpmgi.h @@ -0,0 +1,238 @@ +#ifndef H_RPMGI +#define H_RPMGI + +/** \ingroup rpmgi + * \file lib/rpmgi.h + */ + +#include +#include +#include +#include +#include +#include + +/** + */ +/*@-exportlocal@*/ +/*@unchecked@*/ +extern int _rpmgi_debug; +/*@=exportlocal@*/ + +/** + */ +typedef enum rpmgiFlags_e { + RPMGI_NONE = 0, + RPMGI_TSADD = (1 << 0), + RPMGI_TSORDER = (1 << 1), + RPMGI_NOGLOB = (1 << 2), + RPMGI_NOMANIFEST = (1 << 3), + RPMGI_NOHEADER = (1 << 4), + RPMGI_ERASING = (1 << 5) +} rpmgiFlags; + +/** + */ +/*@unchecked@*/ +extern rpmgiFlags giFlags; + +#if defined(_RPMGI_INTERNAL) +/** \ingroup rpmgi + */ +struct rpmgi_s { + struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ +/*@refcounted@*/ + rpmts ts; /*!< Iterator transaction set. */ + int (*tsOrder) (rpmts ts); /*!< Iterator transaction ordering. */ + rpmTag tag; /*!< Iterator type. */ +/*@kept@*/ /*@relnull@*/ + const void * keyp; /*!< Iterator key. */ + size_t keylen; /*!< Iterator key length. */ + + rpmgiFlags flags; /*!< Iterator control bits. */ + int active; /*!< Iterator is active? */ + int i; /*!< Element index. */ +/*@null@*/ + const char * hdrPath; /*!< Path to current iterator header. */ +/*@refcounted@*/ /*@null@*/ + Header h; /*!< Current iterator header. */ + int rc; /*!< Current exit code, specific to item. */ + +/*@null@*/ + rpmtsi tsi; + +/*@null@*/ + rpmmi mi; + +/*@refcounted@*/ /*@relnull@*/ + FD_t fd; + + ARGV_t argv; + int argc; + + int ftsOpts; +/*@null@*/ + FTS * ftsp; +/*@relnull@*/ + FTSENT * fts; +/*@null@*/ + rpmRC (*walkPathFilter) (rpmgi gi); +/*@null@*/ + rpmRC (*stash) (rpmgi gi, Header h); + +#if defined(__LCLINT__) +/*@refs@*/ + int nrefs; /*!< (unused) keep splint happy */ +#endif +}; +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** \name RPMGI */ +/*@{*/ + +/** + * Unreference a generalized iterator instance. + * @param gi generalized iterator + * @param msg + * @return NULL on last dereference + */ +/*@unused@*/ /*@null@*/ +rpmgi rpmgiUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi, + /*@null@*/ const char * msg) + /*@modifies gi @*/; +#define rpmgiUnlink(_gi, _msg) \ + ((rpmgi)rpmioUnlinkPoolItem((rpmioItem)(_gi), _msg, __FILE__, __LINE__)) + +/** + * Reference a generalized iterator instance. + * @param gi generalized iterator + * @param msg + * @return new generalized iterator reference + */ +/*@unused@*/ /*@newref@*/ /*@null@*/ +rpmgi rpmgiLink (/*@null@*/ rpmgi gi, /*@null@*/ const char * msg) + /*@modifies gi @*/; +#define rpmgiLink(_gi, _msg) \ + ((rpmgi)rpmioLinkPoolItem((rpmioItem)(_gi), _msg, __FILE__, __LINE__)) + +/** Destroy a generalized iterator. + * @param gi generalized iterator + * @return NULL on last dereference + */ +/*@null@*/ +rpmgi rpmgiFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/; +#define rpmgiFree(_gi) \ + ((rpmgi)rpmioFreePoolItem((rpmioItem)(_gi), __FUNCTION__, __FILE__, __LINE__)) + +/** + * Return a generalized iterator. + * @param ts transaction set + * @param tag rpm tag + * @param keyp key data (NULL for sequential access) + * @param keylen key data length (0 will use strlen(keyp)) + * @return new iterator + */ +/*@null@*/ +rpmgi rpmgiNew(rpmts ts, int tag, /*@kept@*/ /*@null@*/ const void * keyp, + size_t keylen) + /*@globals internalState @*/ + /*@modifies ts, internalState @*/; + +/** + * Perform next iteration step. + * @param gi generalized iterator + * @return RPMRC_OK on success, RPMRC_NOTFOUND on EOI + */ +rpmRC rpmgiNext(/*@null@*/ rpmgi gi) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/; + +/** + * Return current iteration flags. + * @param gi generalized iterator + * @return flags + */ +rpmgiFlags rpmgiGetFlags(/*@null@*/ rpmgi gi) + /*@*/; + +/** + * Return current header path. + * @param gi generalized iterator + * @return header path + */ +/*@observer@*/ /*@null@*/ +const char * rpmgiHdrPath(/*@null@*/ rpmgi gi) + /*@*/; + +/** + * Return current iteration header. + * @param gi generalized iterator + * @return header + */ +/*@null@*/ +Header rpmgiHeader(/*@null@*/ rpmgi gi) + /*@*/; + +/** + * Return current iteration transaction set. + * @param gi generalized iterator + * @return transaction set + */ +/*@null@*/ +rpmts rpmgiTs(/*@null@*/ rpmgi gi) + /*@*/; + +/** + * Return current iteration item(s) exit code. + * @param gi generalized iterator + * @return transaction set + */ +/*@null@*/ +int rpmgiRc(/*@null@*/ rpmgi gi) + /*@*/; + +/** + * Escape isspace(3) characters in string. + * @param s string + * @return escaped string + */ +const char * rpmgiEscapeSpaces(const char * s) + /*@*/; + +/** + * Load iterator args. + * @param gi generalized iterator + * @param argv arg list + * @param ftsOpts fts(3) flags + * @param flags iterator flags + * @return RPMRC_OK on success + */ +rpmRC rpmgiSetArgs(/*@null@*/ rpmgi gi, /*@null@*/ ARGV_t argv, + int ftsOpts, rpmgiFlags flags) + /*@globals internalState @*/ + /*@modifies gi, internalState @*/; + +/** + * Return header from package. + * @param gi generalized iterator + * @param path file path + * @return header (NULL on failure) + */ +/*@null@*/ +Header rpmgiReadHeader(rpmgi gi, const char * path) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/; + +/*@}*/ + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMGI */ diff --git a/rpm-5.4.9/lib/rpminstall.c b/rpm-5.4.9/lib/rpminstall.c new file mode 100644 index 0000000..9455cf4 --- /dev/null +++ b/rpm-5.4.9/lib/rpminstall.c @@ -0,0 +1,913 @@ +/** \ingroup rpmcli + * \file lib/rpminstall.c + */ + +#include "system.h" + +#include +#include +#include + +#include +#define _RPMEVR_INTERNAL /* XXX expose rpmVersionCompare prototype */ +#include +#include "rpmdb.h" +#ifdef NOTYET +#include "rpmds.h" /* XXX ts->suggests, +foo -foo =foo args */ +#endif + +#include "rpmte.h" /* XXX rpmtsPrint() */ +#define _RPMTS_INTERNAL /* XXX ts->suggests */ +#include + +#include "manifest.h" +#define _RPMGI_INTERNAL /* XXX "+bing" args need gi->h. */ +#include "rpmgi.h" + +#include + +#include +#define _RPMROLLBACK_INTERNAL +#include + +#include "debug.h" + +/*@access FD_t @*/ /* XXX void * arg */ +/*@access rpmts @*/ /* XXX ts->suggests */ +/*@access rpmgi @*/ /* XXX gi->h */ +/*@access fnpyKey @*/ /* XXX cast */ + +#ifdef __cplusplus + +#define QVA_ISSET(_qvaflags, _FLAG) ((_qvaflags) & (VERIFY_##_FLAG)) + +#define VSF_ISSET(_vsflags, _FLAG) ((_vsflags) & (RPMVSF_##_FLAG)) +#define VSF_SET(_vsflags, _FLAG) \ + (*((unsigned *)&(_vsflags)) |= (RPMVSF_##_FLAG)) +#define VSF_CLR(_vsflags, _FLAG) \ + (*((unsigned *)&(_vsflags)) &= ~(RPMVSF_##_FLAG)) + +GENfree(const void **) + +#else /* __cplusplus */ + +#define QVA_ISSET(_qvaflags, _FLAG) ((_qvaflags) & (VERIFY_##_FLAG)) + +#define VSF_ISSET(_vsflags, _FLAG) ((_vsflags) & (RPMVSF_##_FLAG)) +#define VSF_SET(_vsflags, _FLAG) (_vsflags) |= (RPMVSF_##_FLAG) +#define VSF_CLR(_vsflags, _FLAG) (_vsflags) &= ~(RPMVSF_##_FLAG) + +#endif /* __cplusplus */ + +/*@unchecked@*/ +int rpmcliPackagesTotal = 0; +/*@unchecked@*/ +int rpmcliHashesCurrent = 0; +/*@unchecked@*/ +int rpmcliHashesTotal = 0; +/*@unchecked@*/ +rpmuint64_t rpmcliProgressCurrent = 0; +/*@unchecked@*/ +rpmuint64_t rpmcliProgressTotal = 0; + +/** + * Print a CLI progress bar. + * @todo Unsnarl isatty(STDOUT_FILENO) from the control flow. + * @param amount current + * @param total final + */ +static void printHash(const rpmuint64_t amount, const rpmuint64_t total) + /*@globals rpmcliHashesCurrent, rpmcliHashesTotal, + rpmcliProgressCurrent, fileSystem @*/ + /*@modifies rpmcliHashesCurrent, rpmcliHashesTotal, + rpmcliProgressCurrent, fileSystem @*/ +{ + int hashesNeeded; + + rpmcliHashesTotal = (isatty (STDOUT_FILENO) ? 44 : 50); + + if (rpmcliHashesCurrent != rpmcliHashesTotal) { + float pct = (float) (total ? (((float) amount) / total) : 1); + hashesNeeded = (int)((rpmcliHashesTotal * pct) + 0.5); + while (hashesNeeded > rpmcliHashesCurrent) { + if (isatty (STDOUT_FILENO)) { + int i; + for (i = 0; i < rpmcliHashesCurrent; i++) + (void) putchar ('#'); + for (; i < rpmcliHashesTotal; i++) + (void) putchar (' '); + fprintf(stdout, "(%3d%%)", (int)((100 * pct) + 0.5)); + for (i = 0; i < (rpmcliHashesTotal + 6); i++) + (void) putchar ('\b'); + } else + fprintf(stdout, "#"); + + rpmcliHashesCurrent++; + } + (void) fflush(stdout); + + if (rpmcliHashesCurrent == rpmcliHashesTotal) { + int i; + rpmcliProgressCurrent++; + if (isatty(STDOUT_FILENO)) { + for (i = 1; i < rpmcliHashesCurrent; i++) + (void) putchar ('#'); + pct = (float) (rpmcliProgressTotal + ? (((float) rpmcliProgressCurrent) / rpmcliProgressTotal) + : 1); + fprintf(stdout, " [%3d%%]", (int)((100 * pct) + 0.5)); + } + fprintf(stdout, "\n"); + } + (void) fflush(stdout); + } +} + +void * rpmShowProgress(/*@null@*/ const void * arg, + const rpmCallbackType what, + const rpmuint64_t amount, + const rpmuint64_t total, + /*@null@*/ fnpyKey key, + /*@null@*/ void * data) + /*@globals rpmcliHashesCurrent, rpmcliProgressCurrent, rpmcliProgressTotal, + rpmGlobalMacroContext, fileSystem @*/ + /*@modifies rpmcliHashesCurrent, rpmcliProgressCurrent, rpmcliProgressTotal, + rpmGlobalMacroContext, fileSystem @*/ +{ +/*@-abstract -castexpose @*/ + Header h = (Header) arg; +/*@=abstract =castexpose @*/ + const char * s; + int flags = (int) ((long)data); + void * rc = NULL; +/*@-abstract -assignexpose @*/ + const char * filename = (const char *)key; +/*@=abstract =assignexpose @*/ + static FD_t fd = NULL; + int xx; + + switch (what) { + case RPMCALLBACK_INST_OPEN_FILE: + if (filename == NULL || filename[0] == '\0') + return NULL; + fd = Fopen(filename, "r%{?_rpmgio}"); + + /* XXX Retry once to handle http:// server timeout reopen's. */ + if (Ferror(fd)) { + int ut = urlPath(filename, NULL); + if (ut == URL_IS_HTTP || ut == URL_IS_HTTPS) { + /* XXX HACK: Fclose(fd) no workie here. */ + fd = Fopen(filename, "r%{?_rpmgio}"); + } + } + + if (fd == NULL || Ferror(fd)) { + rpmlog(RPMLOG_ERR, _("open of %s failed: %s\n"), filename, + Fstrerror(fd)); + if (fd != NULL) { + xx = Fclose(fd); + fd = NULL; + } + } else + fd = fdLink(fd, "persist (showProgress)"); + +#if defined(POSIX_FADV_WILLNEED) + (void) Fadvise(fd, 0, 0, POSIX_FADV_WILLNEED); +#endif + +/*@+voidabstract@*/ + return (void *)fd; +/*@=voidabstract@*/ + /*@notreached@*/ break; + + case RPMCALLBACK_INST_CLOSE_FILE: + /*@-type@*/ /* FIX: still necessary? */ + fd = fdFree(fd, "persist (showProgress)"); + /*@=type@*/ + if (fd != NULL) { + xx = Fclose(fd); + fd = NULL; + } + break; + + case RPMCALLBACK_INST_START: + rpmcliHashesCurrent = 0; + if (h == NULL || !(flags & INSTALL_LABEL)) + break; + /* @todo Remove headerSprintf() on a progress callback. */ + if (flags & INSTALL_HASH) { + s = headerSprintf(h, "%{NAME}", + NULL, rpmHeaderFormats, NULL); + if (isatty (STDOUT_FILENO)) + fprintf(stdout, "%4d:%-23.23s", (int)rpmcliProgressCurrent + 1, s); + else + fprintf(stdout, "%-28.28s", s); + (void) fflush(stdout); + s = _free(s); + } else { + char * t = rpmExpand("%{?___NVRA}%{!?___NVRA:%%{NAME}-%%{VERSION}-%%{RELEASE}}", NULL); + s = headerSprintf(h, t, NULL, rpmHeaderFormats, NULL); + fprintf(stdout, "%s\n", s); + (void) fflush(stdout); + s = _free(s); + t = _free(t); + } + break; + + case RPMCALLBACK_TRANS_PROGRESS: + case RPMCALLBACK_INST_PROGRESS: +/*@+relaxtypes@*/ + if (flags & INSTALL_PERCENT) + fprintf(stdout, "%%%% %f\n", (double) (total + ? ((((float) amount) / total) * 100) + : 100.0)); + else if (flags & INSTALL_HASH) + printHash(amount, total); +/*@=relaxtypes@*/ + (void) fflush(stdout); + break; + + case RPMCALLBACK_TRANS_START: + rpmcliHashesCurrent = 0; + rpmcliProgressTotal = 1; + rpmcliProgressCurrent = 0; + if (!(flags & INSTALL_LABEL)) + break; + if (flags & INSTALL_HASH) + fprintf(stdout, "%-28s", _("Preparing...")); + else + fprintf(stdout, "%s\n", _("Preparing packages for installation...")); + (void) fflush(stdout); + break; + + case RPMCALLBACK_TRANS_STOP: + if (flags & INSTALL_HASH) + printHash(1, 1); /* Fixes "preparing..." progress bar */ + rpmcliProgressTotal = rpmcliPackagesTotal; + rpmcliProgressCurrent = 0; + break; + + case RPMCALLBACK_REPACKAGE_START: + rpmcliHashesCurrent = 0; + rpmcliProgressTotal = total; + rpmcliProgressCurrent = 0; + if (!(flags & INSTALL_LABEL)) + break; + if (flags & INSTALL_HASH) + fprintf(stdout, "%-28s\n", _("Repackaging...")); + else + fprintf(stdout, "%s\n", _("Repackaging erased files...")); + (void) fflush(stdout); + break; + + case RPMCALLBACK_REPACKAGE_PROGRESS: + if (amount && (flags & INSTALL_HASH)) + printHash(1, 1); /* Fixes "preparing..." progress bar */ + break; + + case RPMCALLBACK_REPACKAGE_STOP: + rpmcliProgressTotal = total; + rpmcliProgressCurrent = total; + if (flags & INSTALL_HASH) + printHash(1, 1); /* Fixes "preparing..." progress bar */ + rpmcliProgressTotal = rpmcliPackagesTotal; + rpmcliProgressCurrent = 0; + if (!(flags & INSTALL_LABEL)) + break; + if (flags & INSTALL_HASH) + fprintf(stdout, "%-28s\n", _("Upgrading...")); + else + fprintf(stdout, "%s\n", _("Upgrading packages...")); + (void) fflush(stdout); + break; + + case RPMCALLBACK_UNINST_PROGRESS: + break; + case RPMCALLBACK_UNINST_START: + break; + case RPMCALLBACK_UNINST_STOP: + break; + case RPMCALLBACK_UNPACK_ERROR: + break; + case RPMCALLBACK_CPIO_ERROR: + break; + case RPMCALLBACK_SCRIPT_ERROR: + break; + case RPMCALLBACK_UNKNOWN: + default: + break; + } + + return rc; +} + +int rpmcliInstallProblems(rpmts ts, const char * msg, int rc) + /*@globals fileSystem @*/ + /*@modifies ts, fileSystem @*/ +{ + rpmps ps = rpmtsProblems(ts); + + if (rc && rpmpsNumProblems(ps) > 0) { + if (msg) + rpmlog(RPMLOG_ERR, "%s:\n", msg); + rpmpsPrint(NULL, ps); + } + ps = rpmpsFree(ps); + return rc; +} + +int rpmcliInstallSuggests(rpmts ts) +{ + if (ts->suggests != NULL && ts->nsuggests > 0) { + const char * s; + int i; + + rpmlog(RPMLOG_NOTICE, _(" Suggested resolutions:\n")); + for (i = 0; i < ts->nsuggests && (s = (char *)ts->suggests[i]) != NULL; + s = _free(s), ts->suggests[i++] = NULL) + { + rpmlog(RPMLOG_NOTICE, "\t%s\n", s); + } + ts->suggests = _free(ts->suggests); + } + return 0; +} + +int rpmcliInstallCheck(rpmts ts) +{ +/*@-evalorder@*/ + return rpmcliInstallProblems(ts, _("Failed dependencies"), rpmtsCheck(ts)); +/*@=evalorder@*/ +} + +int rpmcliInstallOrder(rpmts ts) +{ +/*@-evalorder@*/ + return rpmcliInstallProblems(ts, _("Ordering problems"), rpmtsOrder(ts)); +/*@=evalorder@*/ +} + +int rpmcliInstallRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) +{ +/*@-evalorder@*/ + return rpmcliInstallProblems(ts, _("Install/Erase problems"), + rpmtsRun(ts, okProbs, ignoreSet)); +/*@=evalorder@*/ +} + +static rpmRC rpmcliEraseElement(rpmts ts, const char * arg) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + rpmmi mi; + Header h; + rpmRC rc = RPMRC_OK; + int xx; + + mi = rpmtsInitIterator(ts, RPMTAG_NVRA, arg, 0); + if (mi == NULL) + return RPMRC_NOTFOUND; + + while ((h = rpmmiNext(mi)) != NULL) { + uint32_t hdrNum = rpmmiInstance(mi); + + if (hdrNum == 0) { /* XXX can't happen. */ + rc = RPMRC_FAIL; + break; + } + xx = rpmtsAddEraseElement(ts, h, hdrNum); + } + mi = rpmmiFree(mi); + + /* XXX FIXME: return rc? */ + return (rpmRC)0; +} + +static const char * rpmcliWalkFirst(ARGV_t av, miRE mire) + /*@globals fileSystem, internalState @*/ + /*@modifies mire, fileSystem, internalState @*/ +{ + /* XXX use global ftsOpts? */ + /* XXX changing FTS_LOGICAL to FTS_PHYSICAL prevents symlink follow. */ + /* XXX FTS_NOCHDIR is automatically assumed for URI's */ + int _ftsOpts = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); + FTS * ftsp = NULL; + FTSENT * fts; + const char * fn = NULL; + int fts_level = 1; + int xx; + + if (av != NULL && av[0] != NULL) + ftsp = Fts_open((char *const *)av, _ftsOpts, NULL); + if (ftsp != NULL) + while((fts = Fts_read(ftsp)) != NULL) { + switch (fts->fts_info) { + /* No-op conditions. */ + case FTS_D: /* preorder directory */ + case FTS_DP: /* postorder directory */ + /* XXX Don't recurse downwards, all elements should be files. */ + if (fts_level > 0 && fts->fts_level >= fts_level) + xx = Fts_set(ftsp, fts, FTS_SKIP); + /*@fallthrough@*/ + case FTS_DOT: /* dot or dot-dot */ + continue; + /*@notreached@*/ /*@switchbreak@*/ break; + case FTS_F: /* regular file */ + if (mireRegexec(mire, fts->fts_accpath, 0) < 0) + continue; + /*@switchbreak@*/ break; + /* Error conditions. */ + case FTS_NS: /* stat(2) failed */ + case FTS_DNR: /* unreadable directory */ + case FTS_ERR: /* error; errno is set */ + case FTS_DC: /* directory that causes cycles */ + case FTS_DEFAULT: /* none of the above */ + case FTS_INIT: /* initialized only */ + case FTS_NSOK: /* no stat(2) requested */ + case FTS_SL: /* symbolic link */ + case FTS_SLNONE: /* symbolic link without target */ + case FTS_W: /* whiteout object */ + default: + goto exit; + /*@notreached@*/ /*@switchbreak@*/ break; + } + + /* Stop on first file that matches. */ + fn = xstrdup(fts->fts_accpath); + break; + } + +exit: + xx = Fts_close(ftsp); + return fn; +} + +static const char * rpmcliInstallElementPath(/*@unused@*/ rpmts ts, + const char * arg) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + /* A glob pattern list to match repository directories. */ + const char * fn = rpmExpand( + "%{?_rpmgi_pattern_glob}" + "%{!?_rpmgi_pattern_glob:.}", + NULL + ); + /* A regex pattern list to match candidate *.rpm files. */ + const char * mirePattern = rpmExpand( + "%{?_rpmgi_pattern_regex:%{_rpmgi_pattern_regex ", arg, "}}" + "%{!?_rpmgi_pattern_regex:", arg, "-[^-]+-[^-]+\\.[^.]+\\.rpm$}", + NULL + ); + miRE mire = mireNew(RPMMIRE_REGEX, 0); + ARGV_t dav = NULL; + int dac = 0; + ARGV_t av = NULL; + int xx = mireRegcomp(mire, mirePattern); + int i; + + /* Get list of candidate repository patterns. */ + xx = argvSplit(&dav, fn, ":"); + fn = _free(fn); + if (xx || dav == NULL) + goto exit; + + dac = argvCount(dav); + for (i = 0; i < dac; i++) { + ARGV_t nav = NULL; + int nac = 0; + + /* Make sure only directory paths are matched. */ + fn = rpmGetPath(dav[i], "/", NULL); + xx = rpmGlob(fn, &nac, &nav); + + if (nav != NULL) + for (i = 0; i < nac; i++) { + const char * t = nav[i]; + size_t nt = strlen(t); + + /* Make sure that final directory paths have trailing '/' */ + if (!(nt > 0 && t[nt-1] == '/')) + continue; + + t = rpmExpand(t, "/", NULL); + nav[i] = _free(nav[i]); + nav[i] = t; + } + + /* Append matches to list of repository directories. */ + if (nac > 0 && nav != NULL) + xx = argvAppend(&av, nav); + nav = argvFree(nav); + nac = 0; + fn = _free(fn); + } + + /* Walk (possibly multi-root'd) directories, until 1st match is found. */ + fn = rpmcliWalkFirst(av, mire); + +exit: + av = argvFree(av); + dav = argvFree(dav); + mire = mireFree(mire); + mirePattern = _free(mirePattern); + + return fn; +} + +/*@-redef@*/ /* XXX Add rpmfi methods to make rpmRelocation opaque. */ +struct rpmRelocation_s { +/*@only@*/ /*@null@*/ + const char * oldPath; /*!< NULL here evals to RPMTAG_DEFAULTPREFIX, */ +/*@only@*/ /*@null@*/ + const char * newPath; /*!< NULL means to omit the file completely! */ +}; +/*@=redef@*/ + +/** @todo Generalize --freshen policies. */ +int rpmcliInstall(rpmts ts, QVA_t ia, const char ** argv) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + ARGV_t avfn = NULL; + int acfn = 0; + int numFailed = 0; + int numRPMS = 0; + rpmRelocation relocations = NULL; + rpmVSFlags vsflags, ovsflags; + rpmRC rpmrc; + int rc; + int xx; + + if (argv == NULL) goto exit; + + (void) rpmtsSetGoal(ts, TSM_INSTALL); + rpmcliPackagesTotal = 0; + + if (rpmExpandNumeric("%{?_repackage_all_erasures}")) + ia->transFlags = (rpmtransFlags) + (ia->transFlags | RPMTRANS_FLAG_REPACKAGE); + + (void) rpmtsSetFlags(ts, ia->transFlags); + (void) rpmtsSetDFlags(ts, ia->depFlags); + + /* Display and set autorollback goal. */ + if (rpmExpandNumeric("%{?_rollback_transaction_on_failure}")) { + if (ia->arbtid) { + time_t ttid = (time_t)ia->arbtid; + rpmlog(RPMLOG_DEBUG, D_("Autorollback Goal: %-24.24s (0x%08x)\n"), + ctime(&ttid), ia->arbtid); + rpmtsSetARBGoal(ts, ia->arbtid); + } + } + + if (ia->installInterfaceFlags & INSTALL_UPGRADE) + vsflags = (rpmVSFlags) rpmExpandNumeric("%{?_vsflags_erase}"); + else + vsflags = (rpmVSFlags) rpmExpandNumeric("%{?_vsflags_install}"); + vsflags = (rpmVSFlags) 0; /* XXX FIXME: ignore default disablers. */ +#if defined(SUPPORT_NOSIGNATURES) + if (!QVA_ISSET(ia->qva_flags, DIGEST)) { + VSF_SET(vsflags, NOSHA1HEADER); + VSF_SET(vsflags, NOMD5HEADER); + VSF_SET(vsflags, NOSHA1); + VSF_SET(vsflags, NOMD5); + } + if (!QVA_ISSET(ia->qva_flags, SIGNATURE)) { + VSF_SET(vsflags, NODSAHEADER); + VSF_SET(vsflags, NORSAHEADER); + VSF_SET(vsflags, NODSA); + VSF_SET(vsflags, NORSA); + } + if (!QVA_ISSET(ia->qva_flags, HDRCHK)) { + VSF_SET(vsflags, NOHDRCHK); + } + VSF_SET(vsflags, NEEDPAYLOAD); +#endif + ovsflags = rpmtsSetVSFlags(ts, vsflags); + + { int notifyFlags; + notifyFlags = ia->installInterfaceFlags | (rpmIsVerbose() ? INSTALL_LABEL : 0 ); + xx = rpmtsSetNotifyCallback(ts, + rpmShowProgress, (void *) ((long)notifyFlags)); + } + + if ((relocations = ia->relocations) != NULL) { + while (relocations->oldPath) + relocations++; + if (relocations->newPath == NULL) + relocations = NULL; + } + + { /* start-of-transaction-build */ + int tag = (ia->qva_source == RPMQV_FTSWALK) + ? RPMDBI_FTSWALK : RPMDBI_ARGLIST; + rpmgi gi = rpmgiNew(ts, tag, NULL, 0); + rpmgiFlags _giFlags = RPMGI_NONE; + const char * fn = NULL;; + +/*@-mods@*/ + if (rpmioFtsOpts == 0) + rpmioFtsOpts = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); +/*@=mods@*/ + rc = rpmgiSetArgs(gi, argv, rpmioFtsOpts, _giFlags); + while ((rpmrc = rpmgiNext(gi)) == RPMRC_OK) { + Header h; + + fn = _free(fn); + fn = xstrdup(rpmgiHdrPath(gi)); + + /* === Check for "+bing" lookaside paths within install transaction. */ + if (fn[0] == '+') { + const char * nfn; + addMacro(NULL, "NEVRA", NULL, &fn[1], RMIL_GLOBAL); + nfn = rpmcliInstallElementPath(ts, &fn[1]); + delMacro(NULL, "NEVRA"); + if (nfn == NULL) { + rpmlog(RPMLOG_ERR, _("package \"%s\" cannot be found\n"), fn); + numFailed++; /* XXX multiple erasures? */ + continue; + } + fn = _free(fn); + fn = nfn; + /* XXX hack into rpmgi innards for now ... */ + h = rpmgiReadHeader(gi, fn); + if (h != NULL) + gi->h = headerLink(h); + (void)headerFree(h); + h = NULL; + } + + /* === Check for "-bang" erasures within install transaction. */ + if (fn[0] == '-') { + switch (rpmcliEraseElement(ts, &fn[1])) { + case RPMRC_OK: + numRPMS++; /* XXX multiple erasures? */ + /*@switchbreak@*/ break; + case RPMRC_NOTFOUND: + default: + rpmlog(RPMLOG_ERR, _("package \"%s\" cannot be erased\n"), fn); + numFailed++; /* XXX multiple erasures? */ + goto exit; + /*@notreached@*/ /*@switchbreak@*/ break; + } + continue; + } + + h = rpmgiHeader(gi); + if (h == NULL) { + numFailed++; + continue; + } + + /* === Check for relocatable package. */ + if (relocations) { + he->tag = RPMTAG_PREFIXES; + xx = headerGet(h, he, 0); + if (xx && he->c == 1) { + relocations->oldPath = xstrdup(he->p.argv[0]); + he->p.ptr = _free(he->p.ptr); + } else { + he->p.ptr = _free(he->p.ptr); + he->tag = RPMTAG_NVRA; + xx = headerGet(h, he, 0); + rpmlog(RPMLOG_ERR, + _("package %s is not relocatable\n"), he->p.str); + he->p.ptr = _free(he->p.ptr); + numFailed++; + goto exit; + /*@notreached@*/ + } + } + + /* === On --freshen, verify package is installed and newer. */ + if (ia->installInterfaceFlags & INSTALL_FRESHEN) { + rpmmi mi; + Header oldH; + int count; + + he->tag = RPMTAG_NAME; + xx = headerGet(h, he, 0); +assert(xx != 0 && he->p.str != NULL); + mi = rpmtsInitIterator(ts, RPMTAG_NAME, he->p.str, 0); + he->p.ptr = _free(he->p.ptr); + count = rpmmiCount(mi); + while ((oldH = rpmmiNext(mi)) != NULL) { + if (rpmVersionCompare(oldH, h) < 0) + /*@innercontinue@*/ continue; + /* same or newer package already installed */ + count = 0; + /*@innerbreak@*/ break; + } + mi = rpmmiFree(mi); + if (count == 0) + continue; + /* Package is newer than those currently installed. */ + } + + /* === Add binary package to transaction set. */ + xx = argvAdd(&avfn, fn); + rc = rpmtsAddInstallElement(ts, h, (fnpyKey)avfn[acfn++], + (ia->installInterfaceFlags & INSTALL_UPGRADE) != 0, + ia->relocations); + + if (relocations) + relocations->oldPath = _free(relocations->oldPath); + + numRPMS++; + } + + /* XXX disambiguate end-of-iteration from item failures. */ + if (rpmrc == RPMRC_NOTFOUND) + rpmrc = (rpmRC) rpmgiRc(gi); + + fn = _free(fn); + gi = rpmgiFree(gi); + + } /* end-of-transaction-build */ + + /* XXX exit if the iteration failed. */ + if (rpmrc != RPMRC_OK) + numFailed = (numRPMS ? numRPMS : 1); /* XXX error on no-op. */ + if (numFailed) goto exit; + + if (numRPMS) { + if (!(ia->installInterfaceFlags & INSTALL_NODEPS) + && (rc = rpmcliInstallCheck(ts)) != 0) { + numFailed = numRPMS; + (void) rpmcliInstallSuggests(ts); + } + + if (!(ia->installInterfaceFlags & INSTALL_NOORDER) + && (rc = rpmcliInstallOrder(ts)) != 0) + numFailed = (numRPMS ? numRPMS : 1); /* XXX error on no-op. */ + + /* Drop added/available package indices and dependency sets. */ + rpmtsClean(ts); + + /* XXX Avoid empty transaction msg, run iff there are elements. */ + if (numFailed == 0 && rpmtsNElements(ts) > 0 + && (rc = rpmcliInstallRun(ts, NULL, ia->probFilter)) != 0) { + if (rc > 0) + numFailed = rc; + else + numFailed = (numRPMS ? numRPMS : 1); /* XXX error on no-op. */ + } + } + + if (numFailed) goto exit; + +exit: + avfn = argvFree(avfn); + +#ifdef NOTYET /* XXX grrr, segfault in selabel_close */ + if (!(ia->transFlags & RPMTRANS_FLAG_NOCONTEXTS)) + matchpathcon_fini(); +#endif + + rpmtsEmpty(ts); + + return numFailed; +} + +int rpmErase(rpmts ts, QVA_t ia, const char ** argv) +{ + const char ** arg; + int numFailed = 0; + int numRPMS = 0; + rpmVSFlags vsflags, ovsflags; + int rc; + + if (argv == NULL) return 0; + + vsflags = (rpmVSFlags) rpmExpandNumeric("%{?_vsflags_erase}"); + vsflags = (rpmVSFlags) 0; /* XXX FIXME: ignore default disablers. */ +#if defined(SUPPORT_NOSIGNATURES) + if (!QVA_ISSET(ia->qva_flags, DIGEST)) { + VSF_SET(vsflags, NOSHA1HEADER); + VSF_SET(vsflags, NOMD5HEADER); + VSF_SET(vsflags, NOSHA1); + VSF_SET(vsflags, NOMD5); + } + if (!QVA_ISSET(ia->qva_flags, SIGNATURE)) { + VSF_SET(vsflags, NODSAHEADER); + VSF_SET(vsflags, NORSAHEADER); + VSF_SET(vsflags, NODSA); + VSF_SET(vsflags, NORSA); + } + if (!QVA_ISSET(ia->qva_flags, HDRCHK)) { + VSF_SET(vsflags, NOHDRCHK); + } + VSF_CLR(vsflags, NEEDPAYLOAD); /* XXX needed? */ +#endif + ovsflags = rpmtsSetVSFlags(ts, vsflags); + + if (rpmExpandNumeric("%{?_repackage_all_erasures}")) + ia->transFlags = (rpmtransFlags) + (ia->transFlags | RPMTRANS_FLAG_REPACKAGE); + + (void) rpmtsSetFlags(ts, ia->transFlags); + (void) rpmtsSetDFlags(ts, ia->depFlags); + + /* Display and set autorollback goal. */ + if (rpmExpandNumeric("%{?_rollback_transaction_on_failure}")) { + if (ia->arbtid) { + time_t ttid = (time_t)ia->arbtid; + rpmlog(RPMLOG_DEBUG, D_("Autorollback Goal: %-24.24s (0x%08x)\n"), + ctime(&ttid), ia->arbtid); + rpmtsSetARBGoal(ts, ia->arbtid); + } + } + +#ifdef NOTYET /* XXX no callbacks on erase yet */ + { int notifyFlags; + notifyFlags = ia->installInterfaceFlags | (rpmIsVerbose() ? INSTALL_LABEL : 0 ); + xx = rpmtsSetNotifyCallback(ts, + rpmShowProgress, (void *) ((long)notifyFlags)); + } +#endif + + (void) rpmtsSetGoal(ts, TSM_ERASE); + + for (arg = argv; *arg; arg++) { + rpmmi mi; + + /* XXX HACK to get rpmdbFindByLabel out of the API */ + mi = rpmtsInitIterator(ts, RPMTAG_NVRA, *arg, 0); + if (mi == NULL) { + rpmlog(RPMLOG_ERR, _("package %s is not installed\n"), *arg); + numFailed++; + } else { + Header h; /* XXX iterator owns the reference */ + int count = 0; + while ((h = rpmmiNext(mi)) != NULL) { + uint32_t hdrNum = rpmmiInstance(mi); + + if (!(count++ == 0 || (ia->installInterfaceFlags & INSTALL_ALLMATCHES))) { + rpmlog(RPMLOG_ERR, _("\"%s\" specifies multiple packages\n"), + *arg); + numFailed++; + /*@innerbreak@*/ break; + } + if (hdrNum) { + (void) rpmtsAddEraseElement(ts, h, hdrNum); + numRPMS++; + } + } + } + mi = rpmmiFree(mi); + } + + if (numFailed == 0 && numRPMS > 0) { + if (!(ia->installInterfaceFlags & INSTALL_NODEPS) + && (rc = rpmcliInstallCheck(ts)) != 0) + numFailed = numRPMS; + + if (numFailed == 0 + && !(ia->installInterfaceFlags & INSTALL_NOORDER) + && (rc = rpmcliInstallOrder(ts)) != 0) + numFailed = numRPMS; + + /* Drop added/available package indices and dependency sets. */ + rpmtsClean(ts); + + if (numFailed == 0 + && (rc = rpmcliInstallRun(ts, NULL, (rpmprobFilterFlags) (ia->probFilter & (RPMPROB_FILTER_DISKSPACE|RPMPROB_FILTER_DISKNODES)))) != 0) + numFailed += (rc < 0 ? numRPMS : rc); + + } + + rpmtsEmpty(ts); + + return numFailed; +} + +int rpmInstallSource(rpmts ts, const char * arg, + const char ** specFilePtr, const char ** cookie) +{ + FD_t fd = Fopen(arg, "r%{?_rpmgio}"); + rpmRC rc = RPMRC_FAIL; /* assume failure */ + + if (fd == NULL || Ferror(fd)) { + rpmlog(RPMLOG_ERR, _("cannot open %s: %s\n"), arg, Fstrerror(fd)); + goto exit; + } + + if (rpmIsVerbose()) + fprintf(stdout, _("Installing %s\n"), arg); + + { + rpmVSFlags nvsflags, ovsflags; + nvsflags = rpmtsVSFlags(ts); + VSF_SET(nvsflags, NEEDPAYLOAD); + ovsflags = rpmtsSetVSFlags(ts, nvsflags); + rc = rpmInstallSourcePackage(ts, fd, specFilePtr, cookie); + ovsflags = rpmtsSetVSFlags(ts, ovsflags); + } + if (rc != RPMRC_OK) + rpmlog(RPMLOG_ERR, _("%s cannot be installed\n"), arg); + +exit: + if (fd != NULL) (void) Fclose(fd); + + return (rc == RPMRC_OK ? 0 : 1); +} diff --git a/rpm-5.4.9/lib/rpmlib.h b/rpm-5.4.9/lib/rpmlib.h new file mode 100644 index 0000000..db35a1c --- /dev/null +++ b/rpm-5.4.9/lib/rpmlib.h @@ -0,0 +1,42 @@ +#ifndef H_RPMLIB +#define H_RPMLIB + +/** \ingroup rpmcli rpmrc rpmts rpmte rpmds rpmfi rpmdb lead signature header payload dbi + * \file lib/rpmlib.h + * + * In Memoriam: Steve Taylor was here, now he's not. + * + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ==================================================================== */ +/** \name RPMTS */ +/*@{*/ + +/** + * Install source package. + * @deprecated This routine needs to DIE! DIE! DIE!. + * @todo Eliminate in rpm-5.1, insturment rpmtsRun() state machine instead. + * @param ts transaction set + * @param _fd file handle + * @retval specFilePtr address of spec file name (or NULL) + * @retval cookie address of cookie pointer (or NULL) + * @return rpmRC return code + */ +rpmRC rpmInstallSourcePackage(rpmts ts, void * _fd, + /*@null@*/ /*@out@*/ const char ** specFilePtr, + /*@null@*/ /*@out@*/ const char ** cookie) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, *specFilePtr, *cookie, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +/*@}*/ + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMLIB */ diff --git a/rpm-5.4.9/lib/rpmlock.c b/rpm-5.4.9/lib/rpmlock.c new file mode 100644 index 0000000..0edfe60 --- /dev/null +++ b/rpm-5.4.9/lib/rpmlock.c @@ -0,0 +1,182 @@ +#include "system.h" + +#include +#include /* XXX fnpyKey */ +#include +#include +#include +#include + +#include "rpmts.h" +#include "rpmlock.h" + +#include "debug.h" + +/*@unchecked@*/ /*@observer@*/ +static const char * rpmlock_path_default = "%{?_rpmlock_path}"; +/*@unchecked@*/ /*@only@*/ /*null@*/ +static const char * rpmlock_path = NULL; + +enum { + RPMLOCK_READ = 1 << 0, + RPMLOCK_WRITE = 1 << 1, + RPMLOCK_WAIT = 1 << 2, +}; + +typedef struct { + int fd; + int omode; +} * rpmlock; + +#ifdef __cplusplus +GENfree(rpmlock) +#endif /* __cplusplus */ + +/*@null@*/ +static int rpmlock_new(/*@unused@*/ const char *rootdir, /*@null@*/ rpmlock *lockp) + /*@globals rpmlock_path, rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies *lockp, rpmlock_path, rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ +{ + static int oneshot = 0; + rpmlock lock = (rpmlock) xmalloc(sizeof(*lock)); + int rc = -1; + + if (lockp) + *lockp = NULL; + + /* XXX oneshot to determine path for fcntl lock. */ + /* XXX rpmlock_path is set once, cannot be changed with %{_rpmlock_path}. */ + if (!oneshot) { + const char * t = NULL; + char * check = rpmExpand(rpmlock_path_default, NULL); + if (check[0] != '\0') + t = rpmGenPath(rootdir, rpmlock_path_default, NULL); + check = _free(check); + + if (t == NULL || *t == '\0' || *t == '%') + t = _free(t); + rpmlock_path = t; + oneshot++; + } + + if (rpmlock_path != NULL) { + mode_t oldmask = umask(022); + lock->fd = open(rpmlock_path, O_RDWR|O_CREAT, 0644); + (void) umask(oldmask); + + if (lock->fd == -1) { + lock->fd = open(rpmlock_path, O_RDONLY); + if (lock->fd == -1) + rc = -1; + else + lock->omode = RPMLOCK_READ; + } else + lock->omode = RPMLOCK_WRITE | RPMLOCK_READ; + rc = 0; + } + if (rc == 0 && lockp != NULL) + *lockp = lock; + else + lock = _free(lock); +/*@-compdef@*/ /*@-nullstate@*/ /*@-globstate@*/ + return rc; +/*@=compdef@*/ /*@=nullstate@*/ /*@=globstate@*/ +} + +static rpmlock rpmlock_free(/*@only@*/ /*@null@*/ rpmlock lock) + /*@globals fileSystem, internalState @*/ + /*@modifies lock, fileSystem, internalState @*/ +{ + if (lock != NULL) { + if (lock->fd > 0) + (void) close(lock->fd); + lock = _free(lock); + } + return NULL; +} + +static int rpmlock_acquire(/*@null@*/ rpmlock lock, int mode) + /*@*/ +{ + int rc = 0; + + if (lock != NULL && (mode & lock->omode)) { + struct flock info; + int cmd; + if (mode & RPMLOCK_WAIT) + cmd = F_SETLKW; + else + cmd = F_SETLK; + if (mode & RPMLOCK_READ) + info.l_type = F_RDLCK; + else + info.l_type = F_WRLCK; + info.l_whence = SEEK_SET; + info.l_start = 0; + info.l_len = 0; + info.l_pid = 0; + if (fcntl(lock->fd, cmd, &info) != -1) + rc = 1; + } + return rc; +} + +static int rpmlock_release(/*@null@*/ rpmlock lock) + /*@globals internalState @*/ + /*@modifies internalState @*/ +{ + int rc = 0; + + if (lock != NULL) { + struct flock info; + info.l_type = F_UNLCK; + info.l_whence = SEEK_SET; + info.l_start = 0; + info.l_len = 0; + info.l_pid = 0; + rc = fcntl(lock->fd, F_SETLK, &info); + } + return rc; +} + +void *rpmtsAcquireLock(rpmts ts) +{ + const char *rootDir = rpmtsRootDir(ts); + rpmlock lock = NULL; + int rc; + + if (rootDir == NULL || rpmtsChrootDone(ts)) + rootDir = "/"; + rc = rpmlock_new(rootDir, &lock); + if (rc) { + if (rpmlock_path != NULL && strcmp(rpmlock_path, rootDir)) + rpmlog(RPMLOG_ERR, + _("can't create transaction lock on %s (%s)\n"), + rpmlock_path, strerror(errno)); + } else if (lock != NULL) { + if (!rpmlock_acquire(lock, RPMLOCK_WRITE)) { + if (lock->omode & RPMLOCK_WRITE) + rpmlog(RPMLOG_WARNING, + _("waiting for transaction lock on %s\n"), rpmlock_path); + if (!rpmlock_acquire(lock, RPMLOCK_WRITE|RPMLOCK_WAIT)) { + if (rpmlock_path != NULL && strcmp(rpmlock_path, rootDir)) + rpmlog(RPMLOG_ERR, + _("can't create transaction lock on %s (%s)\n"), + rpmlock_path, strerror(errno)); + lock = rpmlock_free(lock); + } + } + } +/*@-globstate@*/ /* rpmlock_path may be NULL. */ + return lock; +/*@=globstate@*/ +} + +void * rpmtsFreeLock(void *lock) +{ + (void) rpmlock_release((rpmlock)lock); /* Not really needed here. */ + lock = rpmlock_free((rpmlock)lock); + return NULL; +} diff --git a/rpm-5.4.9/lib/rpmlock.h b/rpm-5.4.9/lib/rpmlock.h new file mode 100644 index 0000000..52589d5 --- /dev/null +++ b/rpm-5.4.9/lib/rpmlock.h @@ -0,0 +1,22 @@ +#ifndef RPMLOCK_H +#define RPMLOCK_H + +#ifdef __cplusplus +extern "C" { +#endif + +/*@only@*/ /*@null@*/ +void * rpmtsAcquireLock(rpmts ts) + /*@globals h_errno, rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@modifies h_errno, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/*@null@*/ +void * rpmtsFreeLock(/*@only@*/ /*@null@*/ void *lock) + /*@globals fileSystem, internalState @*/ + /*@modifies lock, fileSystem, internalState @*/; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/rpm-5.4.9/lib/rpmluaext.c b/rpm-5.4.9/lib/rpmluaext.c new file mode 100644 index 0000000..614ab8a --- /dev/null +++ b/rpm-5.4.9/lib/rpmluaext.c @@ -0,0 +1,294 @@ +/** \ingroup lib + * \file lib/rpmluaext.c + */ + +#if defined(RPM_VENDOR_OPENPKG) || defined(RPM_LUA_EXTENSIONS_BASED_ON_RPMLIB) /* rpm-lua-extensions-based-on-rpm-lib-functionality */ + +#include "system.h" + +#ifdef WITH_LUA + +#define _MIRE_INTERNAL +#include +#include +#include +#include +#include + +#include +#include + +#include + +#define _RPMLUA_INTERNAL +#include +#include + +#include +#include +#include + +#include + +#include "debug.h" + +/* RPM Lua function: + * = rpm.vercmp( + * -- first version (e.g. "N.N.N") + * -- second version (e.g. "N.N.N") + * ) + */ +static int rpmluaext_vercmp(lua_State *L) +{ + const char *version1; + const char *version2; + int rc; + + /* fetch arguments */ + if (lua_isstring(L, 1)) + version1 = lua_tostring(L, 1); + else { + (void)luaL_argerror(L, 1, "first version string"); + return 0; + } + if (lua_isstring(L, 2)) + version2 = lua_tostring(L, 2); + else { + (void)luaL_argerror(L, 2, "second version string"); + return 0; + } + + /* compare versions */ + rc = rpmvercmp(version1, version2); + + /* provide results */ + lua_pushinteger(L, rc); + return 1; +} + +/* RPM Lua function: + * = rpm.digest( + * , -- digest algorithm type ("md5", "sha1", etc) + * -- file to calculate digest for + * ) + */ +static int rpmluaext_digest(lua_State *L) +{ + const char *filename; + pgpHashAlgo algo; + FD_t fd; + const char *digest = NULL; + size_t digest_len = 0; + DIGEST_CTX ctx; + char buf[8 * BUFSIZ]; + size_t nb; + + /* fetch arguments */ + if (lua_isstring(L, 1)) { + if ((algo = pgpHashAlgoStringToNumber(lua_tostring(L, 1), 0)) == PGPHASHALGO_ERROR) { + (void)luaL_argerror(L, 1, "digest type"); + return 0; + } + } + else { + (void)luaL_argerror(L, 1, "digest type"); + return 0; + } + if (lua_isstring(L, 2)) + filename = lua_tostring(L, 2); + else { + (void)luaL_argerror(L, 2, "data file"); + return 0; + } + + /* open file */ + fd = Fopen(filename, "r.fdio"); + if (fd == NULL || Ferror(fd)) { + luaL_error(L, "failed to create transaction"); + return 0; + } + + /* read file and calculate digest */ + ctx = rpmDigestInit(algo, RPMDIGEST_NONE); + while ((nb = Fread(buf, sizeof(buf[0]), sizeof(buf), fd)) > 0) + rpmDigestUpdate(ctx, buf, nb); + rpmDigestFinal(ctx, &digest, &digest_len, 1); + if (digest == NULL || digest[0] == '\0') { + luaL_error(L, "failed to calculate digest"); + return 0; + } + + /* close file */ + (void)Fclose(fd); + + /* provide results */ + lua_pushstring(L, digest); + return 1; +} + +/* RPM Lua function: + * = rpm.signature( + * , -- file to check signature on + * , -- file to contain detached signature (or "nil" for clearsigning) + * , -- file containing the signing public key (or "nil" to consult RPMDB) + * -- fingerprint of signing public key (or "nil" to accept any signing key) + * ) + */ +static int rpmluaext_signature(lua_State *L) +{ + rpmts ts; + rpmRC rc; + const char *fn_data; + const char *fn_sig; + const char *fn_pkey; + const char *fp; + + /* fetch arguments */ + if (lua_isstring(L, 1)) + fn_data = lua_tostring(L, 1); + else { + (void)luaL_argerror(L, 1, "filename of data file"); + return 0; + } + if (lua_isstring(L, 2)) + fn_sig = lua_tostring(L, 2); + else + fn_sig = NULL; + if (lua_isstring(L, 3)) + fn_pkey = lua_tostring(L, 3); + else + fn_pkey = NULL; + if (lua_isstring(L, 4)) + fp = lua_tostring(L, 4); + else + fp = NULL; + + /* create RPM transaction and open RPM database */ + if ((ts = rpmtsCreate()) == NULL) { + luaL_error(L, "failed to create transaction"); + return 0; + } + rpmtsOpenDB(ts, O_RDONLY); + + /* check signature on integrity specification file */ + rc = rpmnsProbeSignature(ts, fn_data, fn_sig, fn_pkey, fp, 0); + + /* destroy transaction */ + (void)rpmtsFree(ts); + ts = NULL; + + /* provide results */ + lua_pushboolean(L, rc == RPMRC_OK); + return 1; +} + +/* callback for converting rpmlog() output into Lua result table */ +static int rpmluaext_query_cb(rpmlogRec rec, rpmlogCallbackData data) +{ + lua_State *L = (lua_State *)data; + size_t n; + + if (rpmlogRecPriority(rec) & RPMLOG_NOTICE) { + const char *msg = rpmlogRecMessage(rec); + if (msg != NULL) { + luaL_checktype(L, -1, LUA_TTABLE); + n = lua_objlen(L, -1); + lua_pushinteger(L, n + 1); + lua_pushstring(L, msg); + lua_settable(L, -3); + } + } + return 0; +} + +/* RPM Lua function: + * = rpm.query( + * , -- query format (corresponds to CLI "rpm -q --qf ") + * -- query all flag (corresponds to CLI "rpm -q -a") + * -- query filter (corresponds to CLI "rpm -q ... ") + * ) + */ +static int rpmluaext_query(lua_State *L) +{ + rpmts ts; + QVA_t qva; + const char *argv[2]; + rpmlogCallback rpmlog_cb; + rpmlogCallbackData rpmlog_cb_data; + int ec; + + /* configure RPMDB query */ + if ((qva = (QVA_t)malloc(sizeof(*qva))) == NULL) { + luaL_error(L, "failed to allocate query configuration"); + return 0; + } + memset(qva, '\0', sizeof(*qva)); + if (!lua_isstring(L, 1)) { + (void)luaL_argerror(L, 1, "query format"); + return 0; + } + qva->qva_queryFormat = lua_tostring(L, 1); + qva->qva_mode = 'q'; + qva->qva_char = ' '; + if (!lua_isboolean(L, 2)) { + (void)luaL_argerror(L, 1, "query all flag"); + return 0; + } + if (lua_toboolean(L, 2)) { + qva->qva_source |= RPMQV_ALL; + qva->qva_sourceCount++; + } + argv[0] = NULL; + if (lua_isstring(L, 3)) { + argv[0] = lua_tostring(L, 3); + argv[1] = NULL; + } + + /* create RPM transaction and open RPM database */ + if ((ts = rpmtsCreate()) == NULL) { + luaL_error(L, "failed to create transaction"); + return 0; + } + rpmtsOpenDB(ts, O_RDONLY); + + /* intercept output channel */ + rpmlogGetCallback(&rpmlog_cb, &rpmlog_cb_data); + rpmlogSetCallback(rpmluaext_query_cb, L); + + /* create result Lua table on Lua stack */ + lua_newtable(L); + + /* perform query */ + ec = rpmcliQuery(ts, qva, argv); + + /* restore output channel */ + rpmlogSetCallback(rpmlog_cb, rpmlog_cb_data); + + /* destroy transaction */ + (void)rpmtsFree(ts); + ts = NULL; + + return 1; +} + +/* RPM Lua "rpm.*" function registry */ +static const luaL_reg rpmluaext_registry[] = { + { "vercmp", rpmluaext_vercmp }, + { "digest", rpmluaext_digest }, + { "signature", rpmluaext_signature }, + { "query", rpmluaext_query }, + { NULL, NULL } +}; + +/* activate our RPM Lua extensions */ +void rpmluaextActivate(rpmlua lua) +{ + lua_pushvalue(lua->L, LUA_GLOBALSINDEX); + luaL_openlib(lua->L, "rpm", rpmluaext_registry, 0); + return; +} + +#endif /* WITH_LUA */ + +#endif /* RPM_VENDOR_OPENPKG */ + diff --git a/rpm-5.4.9/lib/rpmluaext.h b/rpm-5.4.9/lib/rpmluaext.h new file mode 100644 index 0000000..afd4c19 --- /dev/null +++ b/rpm-5.4.9/lib/rpmluaext.h @@ -0,0 +1,25 @@ +#ifndef H_RPMLUAEXT +#define H_RPMLUAEXT + +/** \ingroup rpmluaext + * \file lib/rpmluaext.h + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \ingroup rpmluaext + * Add RPM _library_ based Lua extension + * @param lua Lua context + * @return none + */ +void rpmluaextActivate(rpmlua lua) + /*@*/; + +#ifdef __cplusplus +} +#endif + +#endif/* H_RPMLUA */ + diff --git a/rpm-5.4.9/lib/rpmps.c b/rpm-5.4.9/lib/rpmps.c new file mode 100644 index 0000000..418dba0 --- /dev/null +++ b/rpm-5.4.9/lib/rpmps.c @@ -0,0 +1,426 @@ +/** + * \file lib/rpmps.c + */ + +#include "system.h" + +#include +#include /* XXX fnpyKey */ +#include + +#define _RPMPS_INTERNAL +#include "rpmps.h" + +#include "debug.h" + +#ifdef __cplusplus +GENfree(rpmps) +GENfree(rpmpsi) +GENfree(rpmProblem) +#endif /* __cplusplus */ + +/*@access fnpyKey @*/ +/*@access rpmProblem @*/ + +/*@unchecked@*/ +int _rpmps_debug = 0; + +static void rpmpsFini(void * _ps) +{ + rpmps ps = (rpmps) _ps; + int i; + + if (ps == NULL) return; + if (ps->probs) + for (i = 0; i < ps->numProblems; i++) { + rpmProblem p = ps->probs + i; + p->pkgNEVR = _free(p->pkgNEVR); + p->altNEVR = _free(p->altNEVR); + p->str1 = _free(p->str1); + } + ps->probs = _free(ps->probs); +} + +/*@unchecked@*/ /*@only@*/ /*@null@*/ +rpmioPool _rpmpsPool; + +static rpmps rpmpsGetPool(/*@null@*/ rpmioPool pool) + /*@globals _rpmpsPool, fileSystem, internalState @*/ + /*@modifies pool, _rpmpsPool, fileSystem, internalState @*/ +{ + rpmps ps; + + if (_rpmpsPool == NULL) { + _rpmpsPool = rpmioNewPool("ps", sizeof(*ps), -1, _rpmps_debug, + NULL, NULL, rpmpsFini); + pool = _rpmpsPool; + } + return (rpmps) rpmioGetPool(pool, sizeof(*ps)); +} + +rpmps rpmpsCreate(void) +{ + rpmps ps = rpmpsGetPool(_rpmpsPool); + ps->numProblems = 0; + ps->numProblemsAlloced = 0; + ps->probs = NULL; + return rpmpsLink(ps, "create"); +} + +int rpmpsNumProblems(rpmps ps) +{ + int numProblems = 0; + if (ps && ps->probs) + numProblems = ps->numProblems; + return numProblems; +} + +rpmpsi rpmpsInitIterator(rpmps ps) +{ + rpmpsi psi = NULL; + if (ps != NULL) { + psi = (rpmpsi) xcalloc(1, sizeof(*psi)); +/*@-assignexpose -castexpose @*/ + psi->ps = rpmpsLink(ps, "iter ref"); +/*@=assignexpose =castexpose @*/ + psi->ix = -1; + } + return psi; +} + +rpmpsi rpmpsFreeIterator(rpmpsi psi) +{ + if (psi != NULL) { + psi->ps = rpmpsUnlink(psi->ps, "iter unref"); + psi = _free(psi); + } + return NULL; +} + +int rpmpsNextIterator(rpmpsi psi) +{ + int i = -1; + + if (psi != NULL && ++psi->ix >= 0) { + if (psi->ix < rpmpsNumProblems(psi->ps)) { + i = psi->ix; + } else { + psi->ix = -1; + } + } + return i; +} + +rpmProblem rpmpsProblem(rpmpsi psi) +{ + rpmProblem p = NULL; + if (psi != NULL && psi->ix >= 0 && psi->ix < rpmpsNumProblems(psi->ps)) { + p = psi->ps->probs + psi->ix; + } + return p; +} + +void rpmpsAppend(rpmps ps, rpmProblemType type, + const char * pkgNEVR, fnpyKey key, + const char * dn, const char * bn, + const char * altNEVR, rpmuint64_t ulong1) +{ + rpmProblem p; + char *t; + + if (ps == NULL) return; + + if (ps->numProblems == ps->numProblemsAlloced) { + if (ps->numProblemsAlloced) + ps->numProblemsAlloced *= 2; + else + ps->numProblemsAlloced = 2; + ps->probs = (rpmProblem) xrealloc(ps->probs, + ps->numProblemsAlloced * sizeof(*ps->probs)); + } + + p = ps->probs + ps->numProblems; + ps->numProblems++; + memset(p, 0, sizeof(*p)); + + p->type = type; + p->key = key; + p->ulong1 = ulong1; + p->ignoreProblem = 0; + + p->pkgNEVR = (pkgNEVR ? xstrdup(pkgNEVR) : NULL); + p->altNEVR = (altNEVR ? xstrdup(altNEVR) : NULL); + + p->str1 = NULL; + if (dn != NULL || bn != NULL) { + t = (char *) xcalloc(1, (dn != NULL ? strlen(dn) : 0) + + (bn != NULL ? strlen(bn) : 0) + 1); + p->str1 = t; + if (dn != NULL) t = stpcpy(t, dn); + if (bn != NULL) t = stpcpy(t, bn); + } +} + +#define XSTRCMP(a, b) ((!(a) && !(b)) || ((a) && (b) && !strcmp((a), (b)))) + +int rpmpsTrim(rpmps ps, rpmps filter) +{ + rpmProblem t; + rpmProblem f; + int gotProblems = 0; + + if (ps == NULL || ps->numProblems == 0) + return 0; + + if (filter == NULL) + return (ps->numProblems == 0 ? 0 : 1); + + t = ps->probs; + f = filter->probs; + + while ((f - filter->probs) < filter->numProblems) { + if (!f->ignoreProblem) { + f++; + continue; + } + while ((t - ps->probs) < ps->numProblems) { + /*@-nullpass@*/ /* LCL: looks good to me */ + if (f->type == t->type && t->key == f->key && + XSTRCMP(f->str1, t->str1)) + /*@innerbreak@*/ break; + /*@=nullpass@*/ + t++; + gotProblems = 1; + } + + /* XXX This can't happen, but let's be sane in case it does. */ + if ((t - ps->probs) == ps->numProblems) + break; + + t->ignoreProblem = f->ignoreProblem; + t++, f++; + } + + if ((t - ps->probs) < ps->numProblems) + gotProblems = 1; + + return gotProblems; +} + +#if !defined(HAVE_VSNPRINTF) +/*@-shadow -bufferoverflowhigh @*/ +static inline int vsnprintf(/*@out@*/ char * buf, /*@unused@*/ int nb, + const char * fmt, va_list ap) +{ + return vsprintf(buf, fmt, ap); +} +/*@=shadow =bufferoverflowhigh @*/ +#endif +#if !defined(HAVE_SNPRINTF) +static inline int snprintf(/*@out@*/ char * buf, int nb, const char * fmt, ...) +{ + va_list ap; + int rc; + va_start(ap, fmt); + rc = vsnprintf(buf, nb, fmt, ap); + va_end(ap); + return rc; +} +#endif + +const char * rpmProblemString(const rpmProblem prob) +{ +/*@observer@*/ + const char * pkgNEVR = (prob->pkgNEVR ? prob->pkgNEVR : "?pkgNEVR?"); +/*@observer@*/ + const char * altNEVR = (prob->altNEVR ? prob->altNEVR : "? ?altNEVR?"); +/*@observer@*/ + const char * str1 = (prob->str1 ? prob->str1 : N_("different")); + size_t nb = strlen(pkgNEVR) + strlen(str1) + strlen(altNEVR) + 1024; + char * buf = (char *) xmalloc(nb+1); + int rc; + + switch (prob->type) { + case RPMPROB_BADPLATFORM: + rc = snprintf(buf, nb, + _("package %s is intended for a %s platform"), + pkgNEVR, str1); + break; + case RPMPROB_PKG_INSTALLED: + rc = snprintf(buf, nb, + _("package %s is already installed"), + pkgNEVR); + break; + case RPMPROB_NOREPACKAGE: + rc = snprintf(buf, nb, + _("re-packaged package with %s: %s is missing"), + str1, altNEVR); + break; + case RPMPROB_BADRELOCATE: + rc = snprintf(buf, nb, + _("path %s in package %s is not relocatable"), + str1, pkgNEVR); + break; + case RPMPROB_NEW_FILE_CONFLICT: + rc = snprintf(buf, nb, + _("file %s conflicts between attempted installs of %s and %s"), + str1, pkgNEVR, altNEVR); + break; + case RPMPROB_FILE_CONFLICT: + rc = snprintf(buf, nb, + _("file %s from install of %s conflicts with file from package %s"), + str1, pkgNEVR, altNEVR); + break; + case RPMPROB_OLDPACKAGE: + rc = snprintf(buf, nb, + _("package %s (which is newer than %s) is already installed"), + altNEVR, pkgNEVR); + break; + case RPMPROB_DISKSPACE: + rc = snprintf(buf, nb, + _("installing package %s needs %lu%cB on the %s filesystem"), + pkgNEVR, + (unsigned long) (prob->ulong1 > (1024*1024) + ? (prob->ulong1 + 1024 * 1024 - 1) / (1024 * 1024) + : (prob->ulong1 + 1023) / 1024), + prob->ulong1 > (1024*1024) ? 'M' : 'K', + str1); + break; + case RPMPROB_DISKNODES: + rc = snprintf(buf, nb, + _("installing package %s needs %lu inodes on the %s filesystem"), + pkgNEVR, (unsigned long)prob->ulong1, str1); + break; + case RPMPROB_BADPRETRANS: + rc = snprintf(buf, nb, + _("package %s pre-transaction syscall(s): %s failed: %s"), + pkgNEVR, str1, strerror((int)(prob->ulong1))); + break; + case RPMPROB_REQUIRES: + rc = snprintf(buf, nb, _("%s is needed by %s%s"), + altNEVR+2, + (prob->ulong1 ? "" : _("(installed) ")), pkgNEVR); + break; + case RPMPROB_CONFLICT: + rc = snprintf(buf, nb, _("%s conflicts with %s%s"), + altNEVR+2, + (prob->ulong1 ? "" : _("(installed) ")), pkgNEVR); + break; + case RPMPROB_RDONLY: + rc = snprintf(buf, nb, + _("installing package %s on %s rdonly filesystem"), + pkgNEVR, str1); + break; + default: + rc = snprintf(buf, nb, + _("unknown error %d encountered while manipulating package %s"), + prob->type, pkgNEVR); + break; + } + + buf[nb] = '\0'; + return buf; +} + +static int sameProblem(const rpmProblem ap, const rpmProblem bp) + /*@*/ +{ + if (ap->type != bp->type) + return 1; + if (ap->pkgNEVR) + if (bp->pkgNEVR && strcmp(ap->pkgNEVR, bp->pkgNEVR)) + return 1; + if (ap->altNEVR) + if (bp->altNEVR && strcmp(ap->altNEVR, bp->altNEVR)) + return 1; + if (ap->str1) + if (bp->str1 && strcmp(ap->str1, bp->str1)) + return 1; + + if (ap->ulong1 != bp->ulong1) + return 1; + + return 0; +} + +void rpmpsPrint(FILE *fp, rpmps ps) +{ + const char * msg; + rpmpsi psi; + int i; + + if (ps == NULL || ps->probs == NULL || ps->numProblems <= 0) + return; + + if (fp == NULL) + fp = stderr; + + psi = rpmpsInitIterator(ps); + while ((i = rpmpsNextIterator(psi)) >= 0) { + rpmProblem p = rpmpsProblem(psi); + rpmpsi psif; + int j; + + if (p->ignoreProblem) + continue; + + /* Filter already displayed problems. */ + psif = rpmpsInitIterator(ps); + while ((j = rpmpsNextIterator(psif)) < i) { + if (!sameProblem(p, rpmpsProblem(psif))) + /*@innerbreak@*/ break; + } + psif = rpmpsFreeIterator(psif); + + if (j < i) + continue; + + msg = rpmProblemString(p); + fprintf(fp, "\t%s\n", msg); + msg = _free(msg); + + } + psi = rpmpsFreeIterator(psi); +} + +rpmProblem rpmpsGetProblem(rpmps ps, int num) +{ + if (ps == NULL) + return(NULL); + /* XXX Retrieve last problem with negative index. */ + if (num < 0) + num = ps->numProblems - 1; + if (num >= ps->numProblems) + return(NULL); + return (ps->probs + num); +} + +char * rpmProblemGetPkgNEVR(rpmProblem prob) +{ + return prob->pkgNEVR; +} + +char * rpmProblemGetAltNEVR(rpmProblem prob) +{ + return prob->altNEVR; +} + +char * rpmProblemGetStr(rpmProblem prob) +{ + return prob->str1; +} + +rpmuint64_t rpmProblemGetDiskNeed(rpmProblem prob) +{ + return prob->ulong1; +} + +rpmProblemType rpmProblemGetType(rpmProblem prob) +{ + return prob->type; +} + +fnpyKey rpmProblemKey(rpmProblem prob) +{ + return prob->key; +} diff --git a/rpm-5.4.9/lib/rpmps.h b/rpm-5.4.9/lib/rpmps.h new file mode 100644 index 0000000..0db83ae --- /dev/null +++ b/rpm-5.4.9/lib/rpmps.h @@ -0,0 +1,324 @@ +#ifndef H_RPMPS +#define H_RPMPS + +/** \ingroup rpmps + * \file lib/rpmps.h + * Structures and prototypes used for an "rpmps" problem set. + */ + +/*@-exportlocal@*/ +/*@unchecked@*/ +extern int _rpmps_debug; +/*@=exportlocal@*/ + +/** + * Raw data for an element of a problem set. + */ +typedef /*@abstract@*/ struct rpmProblem_s * rpmProblem; + +/** + * Transaction problems found while processing a transaction set/ + */ +typedef /*@abstract@*/ /*@refcounted@*/ struct rpmps_s * rpmps; + +/** +*/ +typedef /*@abstract@*/ struct rpmpsi_s * rpmpsi; + +/** + * @todo Generalize filter mechanism. + */ +typedef enum rpmprobFilterFlags_e { + RPMPROB_FILTER_NONE = 0, + RPMPROB_FILTER_IGNOREOS = (1 << 0), /*!< from --ignoreos */ + RPMPROB_FILTER_IGNOREARCH = (1 << 1), /*!< from --ignorearch */ + RPMPROB_FILTER_REPLACEPKG = (1 << 2), /*!< from --replacepkgs */ + RPMPROB_FILTER_FORCERELOCATE= (1 << 3), /*!< from --badreloc */ + RPMPROB_FILTER_REPLACENEWFILES= (1 << 4), /*!< from --replacefiles */ + RPMPROB_FILTER_REPLACEOLDFILES= (1 << 5), /*!< from --replacefiles */ + RPMPROB_FILTER_OLDPACKAGE = (1 << 6), /*!< from --oldpackage */ + RPMPROB_FILTER_DISKSPACE = (1 << 7), /*!< from --ignoresize */ + RPMPROB_FILTER_DISKNODES = (1 << 8) /*!< from --ignoresize */ +} rpmprobFilterFlags; + +/** + * Enumerate transaction set problem types. + */ +typedef enum rpmProblemType_e { + RPMPROB_BADARCH, /*!< (unused) package ... is for a different architecture */ + RPMPROB_BADOS, /*!< (unused) package ... is for a different operating system */ + RPMPROB_PKG_INSTALLED, /*!< package ... is already installed */ + RPMPROB_BADRELOCATE,/*!< path ... is not relocatable for package ... */ + RPMPROB_REQUIRES, /*!< package ... has unsatisfied Requires: ... */ + RPMPROB_CONFLICT, /*!< package ... has unsatisfied Conflicts: ... */ + RPMPROB_NEW_FILE_CONFLICT, /*!< file ... conflicts between attemped installs of ... */ + RPMPROB_FILE_CONFLICT,/*!< file ... from install of ... conflicts with file from package ... */ + RPMPROB_OLDPACKAGE, /*!< package ... (which is newer than ...) is already installed */ + RPMPROB_DISKSPACE, /*!< installing package ... needs ... on the ... filesystem */ + RPMPROB_DISKNODES, /*!< installing package ... needs ... on the ... filesystem */ + RPMPROB_RDONLY, /*!< installing package ... on ... rdonly filesystem */ + RPMPROB_BADPRETRANS,/*!< (unimplemented) */ + RPMPROB_BADPLATFORM,/*!< package ... is for a different platform */ + RPMPROB_NOREPACKAGE /*!< re-packaged package ... is missing */ + } rpmProblemType; + +/** + */ +#if defined(_RPMPS_INTERNAL) +struct rpmProblem_s { +/*@only@*/ /*@null@*/ + char * pkgNEVR; +/*@only@*/ /*@null@*/ + char * altNEVR; +/*@exposed@*/ /*@null@*/ + fnpyKey key; + rpmProblemType type; + int ignoreProblem; +/*@only@*/ /*@null@*/ + char * str1; + unsigned long long ulong1; +}; + +/** + */ +struct rpmps_s { + struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ + int numProblems; /*!< Current probs array size. */ + int numProblemsAlloced; /*!< Allocated probs array size. */ + rpmProblem probs; /*!< Array of specific problems. */ +#if defined(__LCLINT__) +/*@refs@*/ + int nrefs; /*!< (unused) keep splint happy */ +#endif +}; + +/** + */ +struct rpmpsi_s { + int ix; + rpmps ps; +}; + +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Return formatted string representation of a problem. + * @param prob rpm problem + * @return formatted string (malloc'd) + */ +/*@-exportlocal@*/ +/*@-redecl@*/ /* LCL: is confused. */ +/*@only@*/ extern const char * rpmProblemString(const rpmProblem prob) + /*@*/; +/*@=redecl@*/ +/*@=exportlocal@*/ + +/** + * Unreference a problem set instance. + * @param ps problem set + * @param msg + * @return problem set + */ +/*@unused@*/ /*@null@*/ +rpmps rpmpsUnlink (/*@killref@*/ /*@returned@*/ rpmps ps, + const char * msg) + /*@modifies ps @*/; +#define rpmpsUnlink(_ps, _msg) \ + ((rpmps)rpmioUnlinkPoolItem((rpmioItem)(_ps), _msg, __FILE__, __LINE__)) + +/** + * Reference a problem set instance. + * @param ps transaction set + * @param msg + * @return new transaction set reference + */ +/*@unused@*/ /*@newref@*/ +rpmps rpmpsLink (rpmps ps, const char * msg) + /*@modifies ps @*/; +#define rpmpsLink(_ps, _msg) \ + ((rpmps)rpmioLinkPoolItem((rpmioItem)(_ps), _msg, __FILE__, __LINE__)) + +/** + * Destroy a problem set. + * @param ps problem set + * @return NULL on last dereference + */ +/*@null@*/ +rpmps rpmpsFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmps ps) + /*@modifies ps @*/; +#define rpmpsFree(_ps) \ + ((rpmps)rpmioFreePoolItem((rpmioItem)(_ps), __FUNCTION__, __FILE__, __LINE__)) + +/** + * Return number of problems in set. + * @param ps problem set + * @return number of problems + */ +int rpmpsNumProblems(/*@null@*/ rpmps ps) + /*@*/; + +/** + * Initialize problem set iterator. + * @param ps problem set + * @return problem set iterator + */ +rpmpsi rpmpsInitIterator(rpmps ps) + /*@modifies ps @*/; + +/** + * Destroy problem set iterator. + * @param psi problem set iterator + * @return problem set iterator (NULL) + */ +rpmpsi rpmpsFreeIterator(/*@only@*/ rpmpsi psi) + /*@modifies psi @*/; + +/** + * Return next problem set iterator index + * @param psi problem set iterator + * @return iterator index, -1 on termination + */ +int rpmpsNextIterator(rpmpsi psi) + /*@modifies psi @*/; + +/** + * Return current problem from problem set + * @param psi problem set iterator + * @return current rpmProblem + */ +/*@observer@*/ +rpmProblem rpmpsProblem(rpmpsi psi) + /*@*/; + +/** + * Create a problem set. + * @return new problem set + */ +rpmps rpmpsCreate(void) + /*@*/; + +/** + * Print problems to file handle. + * @param fp file handle (NULL uses stderr) + * @param ps problem set + */ +void rpmpsPrint(/*@null@*/ FILE *fp, /*@null@*/ rpmps ps) + /*@globals fileSystem @*/ + /*@modifies *fp, ps, fileSystem @*/; + +/** + * Append a problem to current set of problems. + * @warning This function's args have changed, so the function cannot be + * used portably + * @param ps problem set + * @param type type of problem + * @param pkgNEVR package name + * @param key filename or python object address + * @param dn directory name + * @param bn file base name + * @param altNEVR related (e.g. through a dependency) package name + * @param ulong1 generic pointer/long attribute + */ +void rpmpsAppend(/*@null@*/ rpmps ps, rpmProblemType type, + /*@null@*/ const char * pkgNEVR, + /*@exposed@*/ /*@null@*/ fnpyKey key, + /*@null@*/ const char * dn, /*@null@*/ const char * bn, + /*@null@*/ const char * altNEVR, + rpmuint64_t ulong1) + /*@modifies ps @*/; + +/** + * Filter a problem set. + * + * As the problem sets are generated in an order solely dependent + * on the ordering of the packages in the transaction, and that + * ordering can't be changed, the problem sets must be parallel to + * one another. Additionally, the filter set must be a subset of the + * target set, given the operations available on transaction set. + * This is good, as it lets us perform this trim in linear time, rather + * then logarithmic or quadratic. + * + * @param ps problem set + * @param filter problem filter (or NULL) + * @return 0 no problems, 1 if problems remain + */ +int rpmpsTrim(/*@null@*/ rpmps ps, /*@null@*/ rpmps filter) + /*@modifies ps @*/; + +/** + * Return a problem from problem set + * + * @param ps problem set + * @param num problem number (<0 is last problem) + * @return rpmProblem, or NULL if error + */ +/*@exposed@*/ +rpmProblem rpmpsGetProblem(/*@null@*/ rpmps ps, int num) + /*@*/; + +/** + * Return the package NEVR causing the problem + * + * @param prob rpm problem + * @return NEVR string ptr + */ +/*@null@*/ /*@exposed@*/ +char * rpmProblemGetPkgNEVR(rpmProblem prob) + /*@*/; + +/** + * Return the second package NEVR causing the problem + * + * @param prob rpm problem + * @return NEVR string ptr, or NULL if unset + */ +/*@null@*/ /*@exposed@*/ +char * rpmProblemGetAltNEVR(rpmProblem prob) + /*@*/; + +/** + * Return a generic data string from a problem + * @param prob rpm problem + * @return a generic data string + * @todo needs a better name + */ +/*@null@*/ /*@exposed@*/ +char * rpmProblemGetStr(rpmProblem prob) + /*@*/; + +/** + * Return generic pointer/long attribute from a problem + * @param prob rpm problem + * @return a generic pointer/long attribute + */ +rpmuint64_t rpmProblemGetDiskNeed(rpmProblem prob) + /*@*/; + +/** + * Return the problem type + * + * @param prob rpm problem + * @return rpmProblemType + */ +rpmProblemType rpmProblemGetType(rpmProblem prob) + /*@*/; + +/** + * Return the transaction key causing the problem + * + * @param prob rpm problem + * @return fnpkey ptr if any or NULL + */ +/*@null@*/ /*@exposed@*/ +fnpyKey rpmProblemKey(rpmProblem prob) + /*@*/; + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMPS */ diff --git a/rpm-5.4.9/lib/rpmrc.c b/rpm-5.4.9/lib/rpmrc.c new file mode 100644 index 0000000..6bfde52 --- /dev/null +++ b/rpm-5.4.9/lib/rpmrc.c @@ -0,0 +1,1308 @@ +#include "system.h" + +#include + +#if defined(HAVE_SYS_SYSTEMCFG_H) +#include +#else +#define __power_pc() 0 +#endif + +#define _RPMIOB_INTERNAL /* XXX for rpmiobSlurp */ +#include +#include +#define _MIRE_INTERNAL +#include +#include +#include +#include +#include + +#include +#include +#define _RPMEVR_INTERNAL +#include + +#define _RPMDS_INTERNAL +#include + +#include + +#include + +#include "debug.h" + +/*@access miRE@*/ + +/*@unchecked@*/ /*@null@*/ +static const char * configTarget = NULL; + +/*@observer@*/ /*@unchecked@*/ +static const char * platform = SYSCONFIGDIR "/platform"; + +/*@only@*/ /*@relnull@*/ /*@unchecked@*/ +void * platpat = NULL; +/*@unchecked@*/ +int nplatpat = 0; + +extern rpmds cpuinfoP; + +/** \ingroup rpmrc + * Build and install arch/os table identifiers. + * @deprecated Eliminate from API. + * @todo Eliminate in rpm-5.1. + */ +enum rpm_machtable_e { + RPM_MACHTABLE_INSTARCH = 0, /*!< Install platform architecture. */ + RPM_MACHTABLE_INSTOS = 1, /*!< Install platform operating system. */ + RPM_MACHTABLE_BUILDARCH = 2, /*!< Build platform architecture. */ + RPM_MACHTABLE_BUILDOS = 3 /*!< Build platform operating system. */ +}; +#define RPM_MACHTABLE_COUNT 4 /*!< No. of arch/os tables. */ + +typedef /*@owned@*/ const char * cptr_t; + +typedef struct machCacheEntry_s { + const char * name; + int count; + cptr_t * equivs; + int visited; +} * machCacheEntry; + +typedef struct machCache_s { + machCacheEntry cache; + int size; +} * machCache; + +typedef struct machEquivInfo_s { + const char * name; + int score; +} * machEquivInfo; + +typedef struct machEquivTable_s { + int count; + machEquivInfo list; +} * machEquivTable; + +typedef struct defaultEntry_s { +/*@owned@*/ /*@null@*/ const char * name; +/*@owned@*/ /*@null@*/ const char * defName; +} * defaultEntry; + +typedef struct canonEntry_s { +/*@owned@*/ const char * name; +/*@owned@*/ const char * short_name; + short num; +} * canonEntry; + +/* tags are 'key'canon, 'key'translate, 'key'compat + * + * for giggles, 'key'_canon, 'key'_compat, and 'key'_canon will also work + */ +typedef struct tableType_s { +/*@observer@*/ const char * const key; + const int hasCanon; + const int hasTranslate; + struct machEquivTable_s equiv; + struct machCache_s cache; + defaultEntry defaults; + canonEntry canons; + int defaultsLength; + int canonsLength; +} * tableType; + +/*@-fullinitblock@*/ +/*@unchecked@*/ +static struct tableType_s tables[RPM_MACHTABLE_COUNT] = { + { "arch", 1, 0 }, + { "os", 1, 0 }, + { "buildarch", 0, 1 }, + { "buildos", 0, 1 } +}; +/*@=fullinitblock@*/ + +#define OS 0 +#define ARCH 1 + +/*@unchecked@*/ +static cptr_t current[2]; + +/*@unchecked@*/ +static int currTables[2] = { RPM_MACHTABLE_INSTOS, RPM_MACHTABLE_INSTARCH }; + +/*@unchecked@*/ +static int defaultsInitialized = 0; + +#ifdef __cplusplus +GENfree(canonEntry) +GENfree(defaultEntry) +GENfree(machCacheEntry) +GENfree(machEquivInfo) +#endif /* __cplusplus */ + +/* prototypes */ +static void rpmRebuildTargetVars(/*@null@*/ const char **target, /*@null@*/ const char ** canontarget) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies *canontarget, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +static /*@observer@*/ /*@null@*/ machCacheEntry +machCacheFindEntry(const machCache cache, const char * key) + /*@*/ +{ + int i; + + for (i = 0; i < cache->size; i++) + if (!strcmp(cache->cache[i].name, key)) return cache->cache + i; + + return NULL; +} + +static void machAddEquiv(machEquivTable table, const char * name, + int distance) + /*@modifies table->list, table->count @*/ +{ + machEquivInfo equiv; + + { int i; + equiv = NULL; + for (i = 0; i < table->count; i++) { + if (xstrcasecmp(table->list[i].name, name)) + continue; + equiv = table->list + i; + break; + } + } + + if (!equiv) { + if (table->count) + table->list = (machEquivInfo) + xrealloc(table->list, (table->count + 1) * sizeof(*table->list)); + else + table->list = (machEquivInfo) xmalloc(sizeof(*table->list)); + + table->list[table->count].name = xstrdup(name); + table->list[table->count++].score = distance; + } +} + +static void machCacheEntryVisit(machCache cache, + machEquivTable table, const char * name, int distance) + /*@modifies table->list, table->count @*/ +{ + machCacheEntry entry; + int i; + + entry = machCacheFindEntry(cache, name); + if (!entry || entry->visited) return; + + entry->visited = 1; + + for (i = 0; i < entry->count; i++) { + machAddEquiv(table, entry->equivs[i], distance); + } + + for (i = 0; i < entry->count; i++) { + machCacheEntryVisit(cache, table, entry->equivs[i], distance + 1); + } +} + +static void rebuildCompatTables(int type, const char * name) + /*@globals tables, internalState @*/ + /*@modifies tables, internalState @*/ +{ + machCache cache = &tables[currTables[type]].cache; + machEquivTable table = &tables[currTables[type]].equiv; + const char * key = name; + int i; + + for (i = 0; i < cache->size; i++) + cache->cache[i].visited = 0; + + while (table->count > 0) { + --table->count; + table->list[table->count].name = _free(table->list[table->count].name); + } + table->count = 0; + table->list = _free(table->list); + + /* + * We have a general graph built using strings instead of pointers. + * Yuck. We have to start at a point at traverse it, remembering how + * far away everything is. + */ + /*@-nullstate@*/ /* FIX: table->list may be NULL. */ + machAddEquiv(table, key, 1); + machCacheEntryVisit(cache, table, key, 2); + return; + /*@=nullstate@*/ +} + +static /*@null@*/ canonEntry lookupInCanonTable(const char * name, + const canonEntry table, int tableLen) + /*@*/ +{ + while (tableLen) { + tableLen--; + if (strcmp(name, table[tableLen].name)) + continue; + /*@-immediatetrans -retalias@*/ + return &(table[tableLen]); + /*@=immediatetrans =retalias@*/ + } + + return NULL; +} + +static /*@observer@*/ /*@null@*/ +const char * lookupInDefaultTable(const char * name, + const defaultEntry table, int tableLen) + /*@*/ +{ + while (tableLen) { + tableLen--; + if (table[tableLen].name && !strcmp(name, table[tableLen].name)) + return table[tableLen].defName; + } + + return name; +} + +static void addMacroDefault(const char * macroname, + const char * val, /*@null@*/ const char * body) + /*@globals rpmGlobalMacroContext, internalState @*/ + /*@modifies rpmGlobalMacroContext, internalState @*/ +{ + if (body == NULL) + body = val; + addMacro(NULL, macroname, NULL, body, RMIL_DEFAULT); +} + +static void setPathDefault(const char * macroname, const char * subdir) + /*@globals rpmGlobalMacroContext, internalState @*/ + /*@modifies rpmGlobalMacroContext, internalState @*/ +{ + if (macroname != NULL) { +#define _TOPDIRMACRO "%{_topdir}/" + char *body = (char *) alloca(sizeof(_TOPDIRMACRO) + strlen(subdir)); + strcpy(body, _TOPDIRMACRO); + strcat(body, subdir); + addMacro(NULL, macroname, NULL, body, RMIL_DEFAULT); +#undef _TOPDIRMACRO + } +} + +/*@observer@*/ /*@unchecked@*/ +static const char * ___build_pre = "\n\ +RPM_SOURCE_DIR=\"%{_sourcedir}\"\n\ +RPM_BUILD_DIR=\"%{_builddir}\"\n\ +RPM_OPT_FLAGS=\"%{optflags}\"\n\ +RPM_ARCH=\"%{_arch}\"\n\ +RPM_OS=\"%{_os}\"\n\ +export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\n\ +RPM_DOC_DIR=\"%{_docdir}\"\n\ +export RPM_DOC_DIR\n\ +RPM_PACKAGE_NAME=\"%{name}\"\n\ +RPM_PACKAGE_VERSION=\"%{version}\"\n\ +RPM_PACKAGE_RELEASE=\"%{release}\"\n\ +export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\n\ +%{?buildroot:RPM_BUILD_ROOT=\"%{buildroot}\"\n\ +export RPM_BUILD_ROOT\n}\ +"; + +#if defined(RPM_VENDOR_WINDRIVER) +/*@unchecked@*/ +extern const char * __usrlibrpm; +/*@unchecked@*/ +extern const char * __etcrpm; +#endif + +static void setDefaults(void) + /*@globals rpmGlobalMacroContext, internalState @*/ + /*@modifies rpmGlobalMacroContext, internalState @*/ +{ + +#if defined(RPM_VENDOR_WINDRIVER) + addMacro(NULL, "_usrlibrpm", NULL, __usrlibrpm, RMIL_DEFAULT); + addMacro(NULL, "_etcrpm", NULL, __etcrpm, RMIL_DEFAULT); + addMacro(NULL, "_vendor", NULL, "%{?_host_vendor}%{!?_host_vendor:wrs}", RMIL_DEFAULT); +#endif + + addMacro(NULL, "_usr", NULL, USRPREFIX, RMIL_DEFAULT); + addMacro(NULL, "_var", NULL, VARPREFIX, RMIL_DEFAULT); + addMacro(NULL, "_prefix", NULL, "%{_usr}", RMIL_DEFAULT); + + addMacro(NULL, "___build_pre", NULL, ___build_pre, RMIL_DEFAULT); + + addMacroDefault("_topdir", + "%{_usr}/src/rpm", NULL); + addMacroDefault("_tmppath", + "%{_var}/tmp", NULL); + addMacroDefault("_dbpath", + "%{_var}/lib/rpm", NULL); + addMacroDefault("_defaultdocdir", + "%{_usr}/share/doc", NULL); + + addMacroDefault("_rpmfilename", + "%%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm",NULL); + + addMacroDefault("optflags", + "-O2 -g", NULL); + addMacroDefault("sigtype", + "none", NULL); + addMacroDefault("_buildshell", + "/bin/sh", NULL); + + setPathDefault("_builddir", "BUILD"); + setPathDefault("_rpmdir", "RPMS"); + setPathDefault("_srcrpmdir", "SRPMS"); + setPathDefault("_sourcedir", "SOURCES"); + setPathDefault("_specdir", "SPECS"); + +} + +typedef struct cpu_vendor_os_gnu { +/*@owned@*/ + const char * str; +/*@observer@*/ + const char * cpu; +/*@observer@*/ + const char * vendor; +/*@observer@*/ + const char * os; +/*@observer@*/ + const char * gnu; +} * CVOG_t; + +#ifdef __cplusplus +GENfree(CVOG_t) +#endif /* __cplusplus */ + +/** + */ +static int parseCVOG(const char * str, CVOG_t *cvogp) + /*@modifies *cvogp @*/ +{ + CVOG_t cvog = (CVOG_t) xcalloc(1, sizeof(*cvog)); + char * p, * pe; + + cvog->str = p = xstrdup(str); + pe = p + strlen(p); + while (pe-- > p && isspace(*pe)) + *pe = '\0'; + + cvog->cpu = p; + cvog->vendor = "unknown"; + cvog->os = "unknown"; + cvog->gnu = ""; + while (*p && !(*p == '-' || isspace(*p))) + p++; + if (*p != '\0') *p++ = '\0'; + + cvog->vendor = p; + while (*p && !(*p == '-' || isspace(*p))) + p++; + if (*p != '-') { + if (*p != '\0') *p++ = '\0'; + cvog->os = cvog->vendor; + cvog->vendor = "unknown"; + } else { + if (*p != '\0') *p++ = '\0'; + + cvog->os = p; + while (*p && !(*p == '-' || isspace(*p))) + p++; + if (*p == '-') { + *p++ = '\0'; + + cvog->gnu = p; + while (*p && !(*p == '-' || isspace(*p))) + p++; + } + if (*p != '\0') *p++ = '\0'; + } + + if (cvogp) + *cvogp = cvog; + else { + cvog->str = _free(cvog->str); + cvog = _free(cvog); + } + return 0; +} + +/** + * Read and configure /etc/rpm/platform patterns. + * @param platform path to platform patterns + * @return RPMRC_OK on success + */ +/*@-onlytrans@*/ /* XXX miRE array, not refcounted. */ +static rpmRC rpmPlatform(const char * platform) + /*@globals nplatpat, platpat, + rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies nplatpat, platpat, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + CVOG_t cvog = NULL; + rpmiob iob = NULL; + int init_platform = 0; + miRE mi_re = NULL; + int mi_nre = 0; + char * p, * pe; + rpmRC rc; + int xx; + + rc = (rpmRC) rpmiobSlurp(platform, &iob); + + if (rc || iob == NULL) { + rc = RPMRC_FAIL; + goto exit; + } + + p = (char *)iob->b; + for (pe = p; p && *p; p = pe) { + pe = strchr(p, '\n'); + if (pe) + *pe++ = '\0'; + + while (*p && xisspace(*p)) + p++; + if (*p == '\0' || *p == '#') + continue; + + if (init_platform) { + char * t = p + strlen(p); + while (--t > p && xisspace(*t)) + *t = '\0'; + if (t > p) { + xx = mireAppend(RPMMIRE_REGEX, 0, p, NULL, &mi_re, &mi_nre); + } + continue; + } + + if (!parseCVOG(p, &cvog) && cvog != NULL) { + addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1); + addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1); + addMacro(NULL, "_host_os", NULL, cvog->os, -1); + } + +#if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */ + /* do not use vendor and GNU attribution */ + p = rpmExpand("%{_host_cpu}-%{_host_os}", NULL); +#else + p = rpmExpand("%{_host_cpu}-%{_host_vendor}-%{_host_os}", + (cvog && *cvog->gnu ? "-" : NULL), + (cvog ? cvog->gnu : NULL), NULL); +#endif + xx = mireAppend(RPMMIRE_STRCMP, 0, p, NULL, &mi_re, &mi_nre); + p = _free(p); + + init_platform++; + } + rc = (init_platform ? RPMRC_OK : RPMRC_FAIL); + +exit: + if (cvog) { + cvog->str = _free(cvog->str); + cvog = _free(cvog); + } + iob = rpmiobFree(iob); + if (rc == RPMRC_OK) { + platpat = mireFreeAll((miRE) platpat, nplatpat); + platpat = mi_re; + nplatpat = mi_nre; + } + return rc; +} +/*@=onlytrans@*/ + +#if defined(WITH_CPUINFO) && defined(WITH_SYCK) +static inline int rpmCpuinfoMatch(const char * feature, const char * EVR, rpmds cpuinfo) +{ + rpmds cpufeature = rpmdsSingle(RPMTAG_REQUIRENAME, feature, EVR, RPMSENSE_PROBE); + int ret = rpmdsMatch(cpufeature, cpuinfo); + + (void)rpmdsFree(cpufeature); + cpufeature = NULL; + return ret; +} + +static rpmRC rpmCpuinfo(void) +{ + rpmRC rc = RPMRC_FAIL; + const char *cpu, *_cpuinfo_path; + miRE mi_re = NULL; + int mi_nre = 0, xx, i; + CVOG_t cvog = NULL; + struct stat st; + char *yaml; + rpmsyck_node *tmp, node; + rpmSyck cpuinfoYaml; + FD_t fd; + + _cpuinfo_path = rpmGetPath("%{?_rpmhome}%{!?_rpmhome:" USRLIBRPM "}/cpuinfo.yaml", NULL); + if(Stat(_cpuinfo_path, &st)) + return rc; + + fd = Fopen(_cpuinfo_path, "r"); + _cpuinfo_path = _free(_cpuinfo_path); + yaml = (char *) xcalloc(st.st_size+1, 1); + Fread(yaml, 1, st.st_size, fd); + Fclose(fd); + + xx = rpmdsCpuinfo(&cpuinfoP, NULL); + cpuinfoYaml = rpmSyckLoad(yaml); + yaml = _free(yaml); + htGetEntry(cpuinfoYaml->firstNode->value.map, "cpuinfo", &tmp, NULL, NULL); + node = tmp[0]->value.seq; + + /* TODO: cleanup.. */ + for(i = 0; node[i].type != T_END; i++) { + if(node[i].type == T_MAP) { + rpmsyck_node *tmp; + if(htHasEntry(node[i].value.map, "Family")) { + htGetEntry(node[i].value.map, "Family", &tmp, NULL, NULL); + const char *family = tmp[0]->value.key; + int j; + hashTable cpus = NULL; + if(rpmCpuinfoMatch(family, "", cpuinfoP)) { + if(htHasEntry(node[i].value.map, "Arch")) { + htGetEntry(node[i].value.map, "Arch", &tmp, NULL, NULL); + rpmsyck_node arch = tmp[0]->value.seq; + for(j = 0; arch[j].type != T_END; j++); + cpus = htCreate(j*2, 0, 0, NULL, NULL); + for(j = 0; arch[j].type != T_END; j++) { + if(htHasEntry(arch[j].value.map, "Extends")) { + if(htGetEntry(arch[j].value.map, "Extends", &tmp, NULL, NULL) && + tmp[0]->type == T_STR && !htHasEntry(cpus, tmp[0]->value.key)) + continue; + } + if(htHasEntry(arch[j].value.map, "Features")) { + htGetEntry(arch[j].value.map, "Features", &tmp, NULL, NULL); + rpmsyck_node features = tmp[0]->value.seq; + int k, match = 0; + for(k = 0; features[k].type != T_END; k++) + if(features[k].type == T_STR && !(match = rpmCpuinfoMatch(features[k].value.key, "", cpuinfoP))) break; + if(!match) continue; + } + if(htHasEntry(arch[j].value.map, "Name")) { + htGetEntry(arch[j].value.map, "Name", &tmp, NULL, NULL); + if(tmp[0]->type != T_STR) continue; + const char *name = tmp[0]->value.key; + rpmsyck_node alias = NULL; + if(htHasEntry(arch[j].value.map, "Alias")) { + htGetEntry(arch[j].value.map, "Alias", &tmp, NULL, NULL); + alias = tmp[0]->value.seq; + } + htAddEntry(cpus, name, alias); + } + } + } + if(htHasEntry(node[i].value.map, "Priority")) { + htGetEntry(node[i].value.map, "Priority", &tmp, NULL, NULL); + rpmsyck_node priority = tmp[0]->value.seq; + int j; + for(j = 0; priority[j].type != T_END; j++) + if(htHasEntry(cpus, priority[j].value.key)) { + xx = mireAppend(RPMMIRE_REGEX, 0, priority[j].value.key, NULL, &mi_re, &mi_nre); + htGetEntry(cpus, priority[j].value.key, &tmp, NULL, NULL); + if(tmp[0]) { + rpmsyck_node alias = tmp[0]; + int k; + for(k = 0; alias[k].type != T_END; k++) + xx = mireAppend(RPMMIRE_REGEX, 0, alias[k].value.key, NULL, &mi_re, &mi_nre); + } + } + } + } + if(cpus) cpus = htFree(cpus); + } + } + } + + cpuinfoYaml = rpmSyckFree(cpuinfoYaml); + + xx = mireAppend(RPMMIRE_REGEX, 0, "noarch", NULL, &mi_re, &mi_nre); + + cpu = mi_re[0].pattern; + if(cpu != NULL) + { + if (!parseCVOG(cpu, &cvog) && cvog != NULL) { + addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1); + addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1); + addMacro(NULL, "_host_os", NULL, cvog->os, -1); + } + if (cvog) { + cvog->str = _free(cvog->str); + cvog = _free(cvog); + } + + rc = RPMRC_OK; + if (rc == RPMRC_OK) { + platpat = mireFreeAll(platpat, nplatpat); + platpat = mi_re; + nplatpat = mi_nre; + } + + } + return rc; +} +#endif + +/*@-onlytrans@*/ /* XXX miRE array, not refcounted. */ +int rpmPlatformScore(const char * platform, void * mi_re, int mi_nre) +{ + miRE mire; + int i; + + if (mi_re == NULL) { + mi_re = platpat; + mi_nre = nplatpat; + } + + if ((mire = (miRE) mi_re) != NULL) + for (i = 0; i < mi_nre; i++) { + if (mireRegexec(mire + i, platform, 0) >= 0) + return (i + 1); + } + return 0; +} +/*@=onlytrans@*/ + +/** + */ +static void defaultMachine(/*@out@*/ const char ** arch, + /*@out@*/ const char ** os) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies *arch, *os, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ +#if defined(RPM_VENDOR_OPENPKG) /* larger-utsname */ + /* utsname fields on some platforms (like HP-UX) are very small + (just about 8 characters). This is too small for OpenPKG, so cheat! */ + static struct utsname un_real; + static struct { + char sysname[32]; + char nodename[32]; + char release[32]; + char version[32]; + char machine[32]; + } un; +#else + static struct utsname un; +#endif + static int gotDefaults = 0; + int rc; + + while (!gotDefaults) { +#if defined(RPM_VENDOR_WINDRIVER) + const char * _platform = rpmGetPath(__etcrpm, "/platform", NULL); +#else + const char * _platform = platform; +#endif + CVOG_t cvog = NULL; +#if defined(RPM_VENDOR_OPENPKG) /* larger-utsname */ + const char *cp; +#endif +#if defined(RPM_VENDOR_OPENPKG) /* larger-utsname */ + /* utsname fields on some platforms (like HP-UX) are very small + (just about 8 characters). This is too small for OpenPKG, so cheat! */ + rc = uname(&un_real); + strncpy(un.sysname, un_real.sysname, sizeof(un.sysname)); un.sysname [sizeof(un.sysname) -1] = '\0'; + strncpy(un.nodename, un_real.nodename, sizeof(un.nodename)); un.nodename[sizeof(un.nodename)-1] = '\0'; + strncpy(un.release, un_real.release, sizeof(un.release)); un.release [sizeof(un.release) -1] = '\0'; + strncpy(un.version, un_real.version, sizeof(un.version)); un.version [sizeof(un.version) -1] = '\0'; + strncpy(un.machine, un_real.machine, sizeof(un.machine)); un.machine [sizeof(un.machine) -1] = '\0'; +#else + rc = uname(&un); +#endif + if (rc < 0) return; + +#if defined(RPM_VENDOR_OPENPKG) /* platform-major-minor-only */ + /* Reduce the platform version to major and minor version numbers */ + { + char *cp; + char *cpR; + int n; + cpR = un.release; + if ((n = strcspn(cpR, "0123456789")) > 0) + cpR += n; + if ((n = strspn(cpR, "0123456789.")) > 0) { + /* terminate after "N.N.N...." prefix */ + cpR[n] = '\0'; + /* shorten to "N.N" if longer */ + if ((cp = strchr(cpR, '.')) != NULL) { + if ((cp = strchr(cp+1, '.')) != NULL) + *cp = '\0'; + } + strcat(un.sysname, cpR); + } + /* fix up machine hardware name containing white-space as it + happens to be on Power Macs running MacOS X */ + if (!strncmp(un.machine, "Power Macintosh", 15)) + sprintf(un.machine, "powerpc"); + } +#endif + + if (!strncmp(un.machine, "Power Macintosh", 15)) { + sprintf(un.machine, "ppc"); + } + +#if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */ + /* allow the path to the "platforms" file be overridden under run-time */ + cp = rpmExpand("%{?__platform}", NULL); + if (cp == NULL || cp[0] == '\0') + cp = _platform; + if (rpmPlatform(cp) == RPMRC_OK) { +#elif defined(WITH_CPUINFO) && defined(WITH_SYCK) + if (rpmPlatform(_platform) == RPMRC_OK || rpmCpuinfo() == RPMRC_OK) +#else + if (rpmPlatform(_platform) == RPMRC_OK) +#endif + { + const char * s; + gotDefaults = 1; + s = rpmExpand("%{?_host_cpu}", NULL); + if (s && *s != '\0') { + strncpy(un.machine, s, sizeof(un.machine)); + un.machine[sizeof(un.machine)-1] = '\0'; + } + s = _free(s); + s = rpmExpand("%{?_host_os}", NULL); + if (s && *s != '\0') { + strncpy(un.sysname, s, sizeof(un.sysname)); + un.sysname[sizeof(un.sysname)-1] = '\0'; + } + s = _free(s); + } + +#if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */ + /* cleanup after above processing */ + if (cp != NULL && cp != _platform) + cp = _free(cp); +#endif +#if defined(RPM_VENDOR_WINDRIVER) + _platform = _free(_platform); +#endif + + if (configTarget && !parseCVOG(configTarget, &cvog) && cvog != NULL) { + gotDefaults = 1; + if (cvog->cpu && cvog->cpu[0] != '\0') { + strncpy(un.machine, cvog->cpu, sizeof(un.machine)); + un.machine[sizeof(un.machine)-1] = '\0'; + } + if (cvog->os && cvog->os[0] != '\0') { + strncpy(un.sysname, cvog->os, sizeof(un.sysname)); + un.sysname[sizeof(un.sysname)-1] = '\0'; + } + cvog->str = _free(cvog->str); + cvog = _free(cvog); + } + if (gotDefaults) + break; + gotDefaults = 1; + break; + } + + if (arch) *arch = un.machine; + if (os) *os = un.sysname; +} + +/** \ingroup rpmrc + * @deprecated Use addMacro to set _target_* macros. + * @todo Eliminate in rpm-5.1. + # @note Only used by build code. + * @param archTable + * @param osTable + */ +static void rpmSetTables(int archTable, int osTable) + /*@globals currTables, rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies currTables, rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + const char * arch, * os; + + defaultMachine(&arch, &os); + + if (currTables[ARCH] != archTable) { + currTables[ARCH] = archTable; + rebuildCompatTables(ARCH, arch); + } + + if (currTables[OS] != osTable) { + currTables[OS] = osTable; + rebuildCompatTables(OS, os); + } +} + +static void rpmSetMachine(const char * arch, const char * os) + /*@globals current, rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies current, rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + if (arch == NULL) { +/*@i@*/ defaultMachine(&arch, NULL); + if (tables[currTables[ARCH]].hasTranslate) + arch = lookupInDefaultTable(arch, + tables[currTables[ARCH]].defaults, + tables[currTables[ARCH]].defaultsLength); + } +assert(arch != NULL); + + if (os == NULL) { +/*@i@*/ defaultMachine(NULL, &os); + if (tables[currTables[OS]].hasTranslate) + os = lookupInDefaultTable(os, + tables[currTables[OS]].defaults, + tables[currTables[OS]].defaultsLength); + } +assert(os != NULL); + + + if (!current[ARCH] || strcmp(arch, current[ARCH])) { + current[ARCH] = _free(current[ARCH]); + current[ARCH] = xstrdup(arch); + rebuildCompatTables(ARCH, arch); + } + + if (!current[OS] || strcmp(os, current[OS])) { + char * t = xstrdup(os); + current[OS] = _free(current[OS]); + if (!strcmp(t, "linux")) + *t = 'L'; + current[OS] = t; + rebuildCompatTables(OS, os); + } +} + +static void getMachineInfo(int type, /*@null@*/ /*@out@*/ const char ** name, + /*@null@*/ /*@out@*/int * num) + /*@modifies *name, *num @*/ +{ + canonEntry canon; + int which = currTables[type]; + + /* use the normal canon tables, even if we're looking up build stuff */ + if (which >= 2) which -= 2; + + canon = lookupInCanonTable(current[type], + tables[which].canons, + tables[which].canonsLength); + + if (canon) { + if (num) *num = canon->num; + if (name) *name = canon->short_name; + } else { + if (num) *num = 255; +#if defined(WITH_CPUINFO) + if (name) { + if(type == ARCH) { + int i, j, n; + ARGV_t archs = NULL; + char *pref = rpmExpand("%{?_prefer_target_cpu}", NULL); + + (void) argvSplit(&archs, pref, " "); + for(i = 0, n = argvCount(archs); (i < n && !*name); i++) + if((j = rpmPlatformScore(archs[i], platpat, nplatpat)) > 0) + *name = ((miRE)platpat)[j-1].pattern; + + archs = argvFree(archs); + pref = _free(pref); + } + if(!*name) *name = current[type]; + } +#else + if (name) *name = current[type]; +#endif + } +} + +static void rpmRebuildTargetVars(const char ** target, const char ** canontarget) +{ + + char *ca = NULL, *co = NULL, *ct = NULL; + int x; + + /* Rebuild the compat table to recalculate the current target arch. */ + + rpmSetMachine(NULL, NULL); + rpmSetTables(RPM_MACHTABLE_INSTARCH, RPM_MACHTABLE_INSTOS); + rpmSetTables(RPM_MACHTABLE_BUILDARCH, RPM_MACHTABLE_BUILDOS); + + if (target && *target) { + char *c; + /* Set arch and os from specified build target */ + ca = xstrdup(*target); + if ((c = strchr(ca, '-')) != NULL) { + *c++ = '\0'; + + if ((co = strrchr(c, '-')) == NULL) { + co = c; + } else { + if (!xstrcasecmp(co, "-gnu")) + *co = '\0'; + if ((co = strrchr(c, '-')) == NULL) + co = c; + else + co++; + } + if (co != NULL) co = xstrdup(co); + } + } else { + const char *a = NULL; + const char *o = NULL; + /* Set build target from rpm arch and os */ + getMachineInfo(ARCH, &a, NULL); + ca = (a) ? xstrdup(a) : NULL; + getMachineInfo(OS, &o, NULL); + co = (o) ? xstrdup(o) : NULL; + } + + /* If still not set, Set target arch/os from default uname(2) values */ + if (ca == NULL) { + const char *a = NULL; + defaultMachine(&a, NULL); + ca = (a) ? xstrdup(a) : NULL; + } + if (ca != NULL) + for (x = 0; ca[x] != '\0'; x++) + ca[x] = (char)xtolower(ca[x]); + + if (co == NULL) { + const char *o = NULL; + defaultMachine(NULL, &o); + co = (o) ? xstrdup(o) : NULL; + } + if (co != NULL) + for (x = 0; co[x] != '\0'; x++) + co[x] = (char)xtolower(co[x]); + + /* XXX For now, set canonical target to arch-os */ + if (ct == NULL) { + ct = (char *) xmalloc(strlen(ca) + sizeof("-") + strlen(co)); + sprintf(ct, "%s-%s", ca, co); + } + +/* + * XXX All this macro pokery/jiggery could be achieved by doing a delayed + * rpmInitMacros(NULL, PER-PLATFORM-MACRO-FILE-NAMES); + */ + delMacro(NULL, "_target"); + addMacro(NULL, "_target", NULL, ct, RMIL_RPMRC); + delMacro(NULL, "_target_cpu"); + addMacro(NULL, "_target_cpu", NULL, ca, RMIL_RPMRC); + delMacro(NULL, "_target_os"); + addMacro(NULL, "_target_os", NULL, co, RMIL_RPMRC); + + if (canontarget) + *canontarget = ct; + else + ct = _free(ct); + ca = _free(ca); + /*@-usereleased@*/ + co = _free(co); + /*@=usereleased@*/ +} + +void rpmFreeRpmrc(void) + /*@globals current, tables, defaultsInitialized @*/ + /*@modifies current, tables, defaultsInitialized @*/ +{ + int i, j, k; + + (void)mireFreeAll((miRE)platpat, nplatpat); + platpat = NULL; + nplatpat = 0; + + for (i = 0; i < RPM_MACHTABLE_COUNT; i++) { + tableType t; + t = tables + i; + if (t->equiv.list) { + for (j = 0; j < t->equiv.count; j++) + t->equiv.list[j].name = _free(t->equiv.list[j].name); + t->equiv.list = _free(t->equiv.list); + t->equiv.count = 0; + } + if (t->cache.cache) { + for (j = 0; j < t->cache.size; j++) { + machCacheEntry e; + e = t->cache.cache + j; + if (e == NULL) + /*@innercontinue@*/ continue; + e->name = _free(e->name); + if (e->equivs) { + for (k = 0; k < e->count; k++) + e->equivs[k] = _free(e->equivs[k]); + e->equivs = _free(e->equivs); + } + } + t->cache.cache = _free(t->cache.cache); + t->cache.size = 0; + } + if (t->defaults) { + for (j = 0; j < t->defaultsLength; j++) { + t->defaults[j].name = _free(t->defaults[j].name); + t->defaults[j].defName = _free(t->defaults[j].defName); + } + t->defaults = _free(t->defaults); + t->defaultsLength = 0; + } + if (t->canons) { + for (j = 0; j < t->canonsLength; j++) { + t->canons[j].name = _free(t->canons[j].name); + t->canons[j].short_name = _free(t->canons[j].short_name); + } + t->canons = _free(t->canons); + t->canonsLength = 0; + } + } + + current[OS] = _free(current[OS]); + current[ARCH] = _free(current[ARCH]); + defaultsInitialized = 0; +/*@-globstate -nullstate@*/ /* FIX: platpat/current may be NULL */ + return; +/*@=globstate =nullstate@*/ +} + +/** \ingroup rpmrc + * Read macro configuration file(s). + * @return 0 on success + */ +static int rpmReadRC(const char *macrofiles) + /*@globals defaultsInitialized, + rpmGlobalMacroContext, rpmCLIMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies defaultsInitialized, rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + int rc = 0; + + if (!defaultsInitialized) { + setDefaults(); + defaultsInitialized = 1; + } + + /* Read macro files. */ + { const char *mfpath = rpmExpand(macrofiles, NULL); + + if (mfpath != NULL) { + rpmInitMacros(NULL, mfpath); + mfpath = _free(mfpath); + } + } + + return rc; +} + +int rpmReadConfigFiles(/*@unused@*/ const char * file, + const char * target) + /*@globals configTarget, rpmMacrofiles @*/ + /*@modifies configTarget @*/ +{ + mode_t mode = 0022; + +#ifdef PREMACROFILES + if (rpmReadRC(PREMACROFILES)) return -1; +#endif + + /* Reset umask to its default umask(2) value. */ + mode = umask(mode); + + configTarget = target; + + /* Preset target macros */ + /*@-nullstate@*/ /* FIX: target can be NULL */ + rpmRebuildTargetVars(&target, NULL); + + /* Read the files */ +/*@-globs@*/ + if (rpmReadRC(rpmMacrofiles)) return -1; +/*@=globs@*/ + + /* Reset target macros */ + rpmRebuildTargetVars(&target, NULL); + /*@=nullstate@*/ + + /* Finally set target platform */ + { const char *cpu = rpmExpand("%{_target_cpu}", NULL); + const char *os = rpmExpand("%{_target_os}", NULL); + rpmSetMachine(cpu, os); + + cpu = _free(cpu); + os = _free(os); + } + configTarget = NULL; + + /* Force Lua state initialization */ +#ifdef WITH_LUA + (void)rpmluaGetPrintBuffer(NULL); +#if defined(RPM_VENDOR_OPENPKG) /* rpm-lua-extensions-based-on-rpm-lib-functionality */ + (void)rpmluaextActivate(rpmluaGetGlobalState()); +#endif /* RPM_VENDOR_OPENPKG */ +#endif + + return 0; +} + +int rpmShowRC(FILE * fp) +{ + rpmds ds = NULL; + int i; + machEquivTable equivTable; + int xx; + miRE mire; + + /* the caller may set the build arch which should be printed here */ + fprintf(fp, "ARCHITECTURE AND OS:\n"); + fprintf(fp, "build arch : %s\n", current[ARCH]); + + fprintf(fp, "compatible build archs:"); + equivTable = &tables[RPM_MACHTABLE_BUILDARCH].equiv; + for (i = 0; i < equivTable->count; i++) + fprintf(fp," %s", equivTable->list[i].name); + fprintf(fp, "\n"); + + fprintf(fp, "build os : %s\n", current[OS]); + + fprintf(fp, "compatible build os's :"); + equivTable = &tables[RPM_MACHTABLE_BUILDOS].equiv; + for (i = 0; i < equivTable->count; i++) + fprintf(fp," %s", equivTable->list[i].name); + fprintf(fp, "\n"); + + fprintf(fp, "install arch : %s\n", current[ARCH]); + fprintf(fp, "install os : %s\n", current[OS]); + + fprintf(fp, "compatible archs :"); + for (mire = (miRE) platpat, i = 0; i < nplatpat; i++) + fprintf(fp, " %s", mire[i].pattern); + fprintf(fp, "\n"); + + fprintf(fp, "compatible os's :"); + equivTable = &tables[RPM_MACHTABLE_INSTOS].equiv; + for (i = 0; i < equivTable->count; i++) + fprintf(fp," %s", equivTable->list[i].name); + fprintf(fp, "\n"); + + { const char * s = rpmExpand("%{?optflags}", NULL); + fprintf(fp, "%-21s : %s\n", "optflags", ((s && *s) ? s : "(not set)")); + s = _free(s); + +#ifdef WITH_LUA + fprintf(fp, "\nLUA MODULES:\n"); +/*@-globs@*/ + s = rpmExpand(rpmluaFiles, NULL); +/*@=globs@*/ + fprintf(fp, "%-21s : %s\n", "luafiles", ((s && *s) ? s : "(not set)")); + s = _free(s); +/*@-globs@*/ + s = rpmExpand(rpmluaPath, NULL); +/*@=globs@*/ + fprintf(fp, "%-21s : %s\n", "luapath", ((s && *s) ? s : "(not set)")); + s = _free(s); +#endif + + fprintf(fp, "\nMACRO DEFINITIONS:\n"); +/*@-globs@*/ + s = rpmExpand(rpmMacrofiles, NULL); +/*@=globs@*/ + fprintf(fp, "%-21s : %s\n", "macrofiles", ((s && *s) ? s : "(not set)")); + s = _free(s); + } + + if (rpmIsVerbose()) { + rpmPRCO PRCO = rpmdsNewPRCO(NULL); + xx = rpmdsSysinfo(PRCO, NULL); + ds = rpmdsLink(rpmdsFromPRCO(PRCO, RPMTAG_PROVIDENAME), "PRCO"); + if (ds != NULL) { + const char * fn = (_sysinfo_path ? _sysinfo_path : "/etc/rpm/sysinfo"); + fprintf(fp, _("Configured system provides (from %s):\n"), fn); + ds = rpmdsInit(ds); + while (rpmdsNext(ds) >= 0) { + const char * DNEVR = rpmdsDNEVR(ds); + if (DNEVR != NULL) + fprintf(fp, " %s\n", DNEVR+2); + } + (void)rpmdsFree(ds); + ds = NULL; + fprintf(fp, "\n"); + } + PRCO = rpmdsFreePRCO(PRCO); + } + + if (rpmIsVerbose()) { + fprintf(fp, _("Features provided by rpmlib installer:\n")); + xx = rpmdsRpmlib(&ds, NULL); + ds = rpmdsInit(ds); + while (rpmdsNext(ds) >= 0) { + const char * DNEVR = rpmdsDNEVR(ds); + if (DNEVR != NULL) + fprintf(fp, " %s\n", DNEVR+2); + } + (void)rpmdsFree(ds); + ds = NULL; + fprintf(fp, "\n"); + + if(cpuinfoP == NULL) + xx = rpmdsCpuinfo(&cpuinfoP, NULL); + if (cpuinfoP != NULL) { +#if defined(WITH_CPUINFO) + const char * fn = "libcpuinfo"; +#else + const char * fn = (_cpuinfo_path ? _cpuinfo_path : "/proc/cpuinfo"); +#endif + fprintf(fp, + _("Features provided by current cpuinfo (from %s):\n"), fn); +/*@-mods@*/ + cpuinfoP = rpmdsInit(cpuinfoP); + while (rpmdsNext(cpuinfoP) >= 0) { + const char * DNEVR = rpmdsDNEVR(cpuinfoP); + if (DNEVR != NULL) + fprintf(fp, " %s\n", DNEVR+2); + } + (void)rpmdsFree(cpuinfoP); + cpuinfoP = NULL; +/*@=mods@*/ + + fprintf(fp, "\n"); + } + } + + if (rpmIsDebug()) { + xx = rpmdsGetconf(&ds, NULL); + if (ds != NULL) { + fprintf(fp, + _("Features provided by current getconf:\n")); + ds = rpmdsInit(ds); + while (rpmdsNext(ds) >= 0) { + const char * DNEVR = rpmdsDNEVR(ds); + if (DNEVR != NULL) + fprintf(fp, " %s\n", DNEVR+2); + } + (void)rpmdsFree(ds); + ds = NULL; + fprintf(fp, "\n"); + } + + xx = rpmdsUname(&ds, NULL); + if (ds != NULL) { + fprintf(fp, + _("Features provided by current uname:\n")); + ds = rpmdsInit(ds); + while (rpmdsNext(ds) >= 0) { + const char * DNEVR = rpmdsDNEVR(ds); + if (DNEVR != NULL) + fprintf(fp, " %s\n", DNEVR+2); + } + (void)rpmdsFree(ds); + ds = NULL; + fprintf(fp, "\n"); + } + } + + rpmDumpMacroTable(NULL, fp); + + return 0; +} diff --git a/rpm-5.4.9/lib/rpmrc.h b/rpm-5.4.9/lib/rpmrc.h new file mode 100644 index 0000000..e0cd3f2 --- /dev/null +++ b/rpm-5.4.9/lib/rpmrc.h @@ -0,0 +1,66 @@ +#ifndef H_RPMRC +#define H_RPMRC + +/** + * \file lib/rpmrc.h + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \ingroup rpmrc + * Read macro configuration file(s) for a target. + * @param file NULL always + * @param target target platform (NULL uses default) + * @return 0 on success, -1 on error + */ +int rpmReadConfigFiles(/*@null@*/ const char * file, + /*@null@*/ const char * target) + /*@globals rpmGlobalMacroContext, rpmCLIMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies rpmGlobalMacroContext, rpmCLIMacroContext, + fileSystem, internalState @*/; + +/*@only@*/ /*@null@*/ /*@unchecked@*/ +extern void * platpat; +/*@unchecked@*/ +extern int nplatpat; + +/** \ingroup rpmrc + * Return score of a platform string. + * A platform score measures the "nearness" of a platform string wrto + * configured platform patterns. The returned score is the line number + * of the 1st pattern in /etc/rpm/platform that matches the input string. + * + * @param platform cpu-vendor-os platform string + * @param mi_re pattern array (NULL uses /etc/rpm/platform patterns) + * @param mi_nre no. of patterns + * @return platform score (0 is no match, lower is preferred) + */ +int rpmPlatformScore(const char * platform, /*@null@*/ void * mi_re, int mi_nre) + /*@modifies mi_re @*/; + +/** \ingroup rpmrc + * Display current rpmrc (and macro) configuration. + * @param fp output file handle + * @return 0 always + */ +int rpmShowRC(FILE * fp) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies *fp, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmrc + * @todo Eliminate in rpm-5.1. + * Destroy rpmrc arch/os compatibility tables. + * @todo Eliminate from API. + */ +void rpmFreeRpmrc(void) + /*@globals platpat, nplatpat, internalState @*/ + /*@modifies platpat, nplatpat, internalState @*/; + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMRC */ diff --git a/rpm-5.4.9/lib/rpmrollback.c b/rpm-5.4.9/lib/rpmrollback.c new file mode 100644 index 0000000..094c736 --- /dev/null +++ b/rpm-5.4.9/lib/rpmrollback.c @@ -0,0 +1,731 @@ +/** \ingroup rpmcli + * \file lib/rpmrollback.c + */ + +#include "system.h" + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include "manifest.h" +#include "misc.h" /* XXX rpmGlob() */ + +#define _RPMTE_INTERNAL /* XXX findErases needs rpmte internals. */ +#define _RPMTS_INTERNAL /* XXX ts->teErase, ts->probs */ +#define _RPMTS_PRINT +#include /* XXX rpmgiEscapeSpaces */ + +#include +#define _RPMROLLBACK_INTERNAL +#include + +#include "debug.h" + +/*@access FD_t @*/ /* XXX void * arg */ +/*@access rpmts @*/ +/*@access rpmte @*/ /* XXX p->hdrid, p->pkgid, p->NEVRA */ +/*@access IDTX @*/ +/*@access IDT @*/ + +#ifdef __cplusplus + +#define QVA_ISSET(_qvaflags, _FLAG) ((_qvaflags) & (VERIFY_##_FLAG)) + +#define VSF_ISSET(_vsflags, _FLAG) ((_vsflags) & (RPMVSF_##_FLAG)) +#define VSF_SET(_vsflags, _FLAG) \ + (*((unsigned *)&(_vsflags)) |= (RPMVSF_##_FLAG)) +#define VSF_CLR(_vsflags, _FLAG) \ + (*((unsigned *)&(_vsflags)) &= ~(RPMVSF_##_FLAG)) + +GENfree(IDTX) +GENfree(IDT) + +#else /* __cplusplus */ + +#define QVA_ISSET(_qvaflags, _FLAG) ((_qvaflags) & (VERIFY_##_FLAG)) + +#define VSF_ISSET(_vsflags, _FLAG) ((_vsflags) & (RPMVSF_##_FLAG)) +#define VSF_SET(_vsflags, _FLAG) (_vsflags) |= (RPMVSF_##_FLAG) +#define VSF_CLR(_vsflags, _FLAG) (_vsflags) &= ~(RPMVSF_##_FLAG) + +#endif /* __cplusplus */ + +/*@unchecked@*/ +static int reverse = -1; + +/** + */ +static int IDTintcmp(const void * a, const void * b) + /*@*/ +{ + /*@-castexpose@*/ + return ( reverse * (((IDT)a)->val.u32 - ((IDT)b)->val.u32) ); + /*@=castexpose@*/ +} + +IDTX IDTXfree(IDTX idtx) +{ + if (idtx) { + int i; + if (idtx->idt) + for (i = 0; i < idtx->nidt; i++) { + IDT idt = idtx->idt + i; + (void)headerFree(idt->h); + idt->h = NULL; + idt->key = _free(idt->key); + } + idtx->idt = _free(idtx->idt); + idtx = _free(idtx); + } + return NULL; +} + +IDTX IDTXnew(void) +{ + IDTX idtx = (IDTX) xcalloc(1, sizeof(*idtx)); + idtx->delta = 10; + idtx->size = (int)sizeof(*((IDT)0)); + return idtx; +} + +IDTX IDTXgrow(IDTX idtx, int need) +{ + if (need < 0) return NULL; + if (idtx == NULL) + idtx = IDTXnew(); + if (need == 0) return idtx; + + if ((idtx->nidt + need) > idtx->alloced) { + while (need > 0) { + idtx->alloced += idtx->delta; + need -= idtx->delta; + } + idtx->idt = (IDT) xrealloc(idtx->idt, (idtx->alloced * idtx->size)); + } + return idtx; +} + +IDTX IDTXsort(IDTX idtx) +{ + if (idtx != NULL && idtx->idt != NULL && idtx->nidt > 0) + qsort(idtx->idt, idtx->nidt, idtx->size, IDTintcmp); + return idtx; +} + +IDTX IDTXload(rpmts ts, rpmTag tag, rpmuint32_t rbtid) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + IDTX idtx = NULL; + rpmmi mi; + Header h; + rpmuint32_t tid; + int xx; + + mi = rpmtsInitIterator(ts, tag, NULL, 0); +#ifdef NOTYET + (void) rpmmiAddPattern(mi, RPMTAG_NAME, RPMMIRE_DEFAULT, '!gpg-pubkey'); +#endif + while ((h = rpmmiNext(mi)) != NULL) { + he->tag = tag; + xx = headerGet(h, he, 0); + if (!xx || he->p.ui32p == NULL) + continue; + tid = (he->p.ui32p ? he->p.ui32p[0] : 0); + he->p.ptr = _free(he->p.ptr); + + if (tid == 0 || tid == 0xffffffff) + continue; + + /* Don't bother with headers installed prior to the rollback goal. */ + if (tid < rbtid) + continue; + + idtx = IDTXgrow(idtx, 1); + if (idtx == NULL || idtx->idt == NULL) + continue; + + { IDT idt; + /*@-nullderef@*/ + idt = idtx->idt + idtx->nidt; + /*@=nullderef@*/ + idt->done = 0; + idt->h = headerLink(h); + idt->key = NULL; + idt->instance = rpmmiInstance(mi); + idt->val.u32 = tid; + } + idtx->nidt++; + } + mi = rpmmiFree(mi); + + return IDTXsort(idtx); +} + +IDTX IDTXglob(rpmts ts, const char * globstr, rpmTag tag, rpmuint32_t rbtid) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + IDTX idtx = NULL; + Header h; + rpmuint32_t tid; + FD_t fd; + const char ** av = NULL; + const char * fn; + int ac = 0; + rpmRC rpmrc; + int xx; + int i; + + av = NULL; ac = 0; + fn = rpmgiEscapeSpaces(globstr); + xx = rpmGlob(fn, &ac, &av); + fn = _free(fn); + + if (xx == 0) + for (i = 0; i < ac; i++) { + int isSource; + + fd = Fopen(av[i], "r.fdio"); + if (fd == NULL || Ferror(fd)) { + rpmlog(RPMLOG_ERR, _("open of %s failed: %s\n"), av[i], + Fstrerror(fd)); + if (fd != NULL) (void) Fclose(fd); + continue; + } + + rpmrc = rpmReadPackageFile(ts, fd, av[i], &h); + (void) Fclose(fd); + switch (rpmrc) { + default: + goto bottom; + /*@notreached@*/ /*@switchbreak@*/ break; + case RPMRC_NOTTRUSTED: + case RPMRC_NOKEY: + case RPMRC_OK: + isSource = + (headerIsEntry(h, RPMTAG_SOURCERPM) == 0 && + headerIsEntry(h, RPMTAG_ARCH) != 0); + if (isSource) + goto bottom; + /*@switchbreak@*/ break; + } + +{ const char * origin = headerGetOrigin(h); +assert(origin != NULL); +assert(!strcmp(av[i], origin)); +} + he->tag = tag; + xx = headerGet(h, he, 0); + if (!xx || he->p.ui32p == NULL) + goto bottom; + tid = (he->p.ui32p ? he->p.ui32p[0] : 0); + he->p.ptr = _free(he->p.ptr); + + /* Don't bother with headers installed prior to the rollback goal. */ + if (tid < rbtid) + goto bottom; + + idtx = IDTXgrow(idtx, 1); + if (idtx == NULL || idtx->idt == NULL) + goto bottom; + + { IDT idt; + idt = idtx->idt + idtx->nidt; + idt->done = 0; + idt->h = headerLink(h); + idt->key = av[i]; + av[i] = NULL; + idt->instance = 0; + idt->val.u32 = tid; + } + idtx->nidt++; +bottom: + (void)headerFree(h); + h = NULL; + } + + for (i = 0; i < ac; i++) + av[i] = _free(av[i]); + av = _free(av); ac = 0; + + return IDTXsort(idtx); +} + +/** + * Search for string B in argv array AV. + * @param ts transaction set + * @param lname type of link + * @param AV argv array + * @param AC no. of args + * @param B string + * @return 1 if found, 0 not found, -1 error + */ +static int cmpArgvStr(rpmts ts, const char *lname, const char ** AV, int AC, + /*@null@*/ const char * B) + /*@modifies ts @*/ +{ + const char * A; + int i; + + if (AV != NULL && AC > 0 && B == NULL) { + if (!strcmp(lname, "NEVRA")) { + rpmps ps = rpmtsProblems(ts); + for (i = 0; i < AC && (A = AV[i]) != NULL; i++) { + rpmpsAppend(ps, RPMPROB_NOREPACKAGE, + NULL, NULL, /* NEVRA, key */ + lname, NULL, /* dn, bn */ + A, /* altNEVRA */ + 0); + } + ps = rpmpsFree(ps); + } + return 0; + } + + if (AV != NULL && B != NULL) + for (i = 0; i < AC && (A = AV[i]) != NULL; i++) { + if (*A && *B && !strcmp(A, B)) + return 1; + } + return 0; +} + +/** + * Find (and add to transaction set) all erase elements with matching blink. + * In addition, recreate any added transaction element linkages. + * + * XXX rp->h should have FLINK{HDRID,PKGID,NEVRA} populated. + * XXX ip->h should have BLINK{HDRID,PKGID,NEVRA} populated. + * XXX p = ts->teInstall is added transaction element from rp->h. + * + * @param ts transaction set (ts->teInstall set to last added pkg) + * @param p most recently added install element (NULL skips linking) + * @param thistid current transaction id + * @param ip currently installed package(s) to be erased + * @param niids no. of currently installed package(s) + * @return -1 on error, otherwise no. of erase elemnts added + */ +static int findErases(rpmts ts, /*@null@*/ rpmte p, unsigned thistid, + /*@null@*/ IDT ip, int niids) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, p, ip, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + int rc = 0; + int xx; + + /* Erase the previously installed packages for this transaction. + * Provided this transaction is not excluded from the rollback. + */ + while (ip != NULL && ip->val.u32 == thistid) { + + if (ip->done) + goto bottom; + + { + const char ** flinkPkgid = NULL; + const char ** flinkHdrid = NULL; + const char ** flinkNEVRA = NULL; + rpmuint32_t pn, hn, nn; + int bingo; + + he->tag = RPMTAG_BLINKPKGID; + xx = headerGet(ip->h, he, 0); + flinkPkgid = he->p.argv; + pn = he->c; + + /* XXX Always erase packages at beginning of upgrade chain. */ + if (pn == 1 && flinkPkgid[0] != NULL && !strcmp(flinkPkgid[0], RPMTE_CHAIN_END)) { + flinkPkgid = _free(flinkPkgid); + goto erase; + } + + he->tag = RPMTAG_BLINKHDRID; + xx = headerGet(ip->h, he, 0); + flinkHdrid = he->p.argv; + hn = he->c; + he->tag = RPMTAG_BLINKNEVRA; + xx = headerGet(ip->h, he, 0); + flinkNEVRA = he->p.argv; + nn = he->c; + + /* + * Link data may be missing and can have multiple entries. + */ + /* XXX Until link tags are reliably populated, check in the order + * NEVRA -> hdrid -> pkgid + * because NEVRA is easier to debug (hdrid/pkgid are more precise.) + */ + bingo = 0; + if (!bingo) + bingo = cmpArgvStr(ts, "NEVRA", flinkNEVRA, nn, (p ? p->NEVRA : NULL)); + if (!bingo) + bingo = cmpArgvStr(ts, "Hdrid", flinkHdrid, hn, (p ? p->hdrid : NULL)); +/*@-nullstate@*/ + if (!bingo) + bingo = cmpArgvStr(ts, "Pkgid", flinkPkgid, pn, (p ? p->pkgid : NULL)); +/*@=nullstate@*/ + flinkPkgid = _free(flinkPkgid); + flinkHdrid = _free(flinkHdrid); + flinkNEVRA = _free(flinkNEVRA); + + if (bingo < 0) { + rc = -1; + goto exit; + } + + if (!bingo) + goto bottom; + } + +erase: + rpmlog(RPMLOG_DEBUG, D_("\t--- erase h#%u\n"), ip->instance); + + rc = rpmtsAddEraseElement(ts, ip->h, ip->instance); + if (rc != 0) + goto exit; + + /* Cross link the transaction elements to mimic --upgrade. */ + if (p != NULL) { + rpmte q = ts->teErase; + xx = rpmteChain(p, q, ip->h, "Rollback"); + } + +#ifdef NOTYET + ip->instance = 0; +#endif + ip->done = 1; + +bottom: + + /* Go to the next header in the rpmdb */ + niids--; + if (niids > 0) + ip++; + else + ip = NULL; + } + +exit: + return rc; +} + +/** @todo Transaction handling, more, needs work. */ +int rpmRollback(rpmts ts, QVA_t ia, const char ** argv) +{ + int ifmask= (INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_INSTALL|INSTALL_ERASE); + unsigned thistid = 0xffffffff; + unsigned prevtid; + time_t tid; + IDTX itids = NULL; + IDTX rtids = NULL; + IDT rp; + int nrids = 0; + IDT ip; + int niids = 0; + int rc = 0; + rpmVSFlags vsflags, ovsflags; + int numAdded; + int numRemoved; + unsigned int _unsafe_rollbacks = 0; + rpmtransFlags transFlags = ia->transFlags; + rpmdepFlags depFlags = ia->depFlags; + int xx; + + if (argv != NULL && *argv != NULL) { + rc = -1; + goto exit; + } + + _unsafe_rollbacks = rpmExpandNumeric("%{?_unsafe_rollbacks}"); + + vsflags = (rpmVSFlags) rpmExpandNumeric("%{?_vsflags_erase}"); + vsflags = (rpmVSFlags) 0; /* XXX FIXME: ignore default disablers. */ +#if defined(SUPPORT_NOSIGNATURES) + if (!QVA_ISSET(ia->qva_flags, DIGEST)) { + VSF_SET(vsflags, NOSHA1HEADER); + VSF_SET(vsflags, NOMD5HEADER); + VSF_SET(vsflags, NOSHA1); + VSF_SET(vsflags, NOMD5); + } + if (!QVA_ISSET(ia->qva_flags, SIGNATURE)) { + VSF_SET(vsflags, NODSAHEADER); + VSF_SET(vsflags, NORSAHEADER); + VSF_SET(vsflags, NODSA); + VSF_SET(vsflags, NORSA); + } + if (!QVA_ISSET(ia->qva_flags, HDRCHK)) { + VSF_SET(vsflags, NOHDRCHK); + } + VSF_SET(vsflags, NEEDPAYLOAD); /* XXX needed? */ +#endif + ovsflags = rpmtsSetVSFlags(ts, vsflags); + + (void) rpmtsSetFlags(ts, transFlags); + (void) rpmtsSetDFlags(ts, depFlags); + + /* Make the transaction a rollback transaction. In a rollback + * a best effort is what we want + */ + rpmtsSetType(ts, RPMTRANS_TYPE_ROLLBACK); + + itids = IDTXload(ts, RPMTAG_INSTALLTID, ia->rbtid); + if (itids != NULL) { + ip = itids->idt; + niids = itids->nidt; + } else { + ip = NULL; + niids = 0; + } + + { const char * globstr = rpmExpand("%{_repackage_dir}/*/*.rpm", NULL); + if (globstr == NULL || *globstr == '%') { + globstr = _free(globstr); + rc = -1; + goto exit; + } + rtids = IDTXglob(ts, globstr, RPMTAG_REMOVETID, ia->rbtid); + + if (rtids != NULL) { + rp = rtids->idt; + nrids = rtids->nidt; + } else { + rp = NULL; + nrids = 0; + } + globstr = _free(globstr); + } + + { int notifyFlags; + notifyFlags = ia->installInterfaceFlags | (rpmIsVerbose() ? INSTALL_LABEL : 0 ); + xx = rpmtsSetNotifyCallback(ts, + rpmShowProgress, (void *) ((long)notifyFlags)); + } + + /* Run transactions until rollback goal is achieved. */ + do { + prevtid = thistid; + rc = 0; + rpmcliPackagesTotal = 0; + numAdded = 0; + numRemoved = 0; + ia->installInterfaceFlags = (rpmInstallInterfaceFlags) + (ia->installInterfaceFlags & ~ifmask); + + /* Find larger of the remaining install/erase transaction id's. */ + thistid = 0; + if (ip != NULL && ip->val.u32 > thistid) + thistid = ip->val.u32; + if (rp != NULL && rp->val.u32 > thistid) + thistid = rp->val.u32; + + /* If we've achieved the rollback goal, then we're done. */ + if (thistid == 0 || thistid < ia->rbtid) + break; + + /* If we've reached the (configured) rollback goal, then we're done. */ + if (_unsafe_rollbacks && thistid <= _unsafe_rollbacks) + break; + + /* Is this transaction excluded from the rollback? */ + if (ia->rbtidExcludes != NULL && ia->numrbtidExcludes > 0) + { + rpmuint32_t *excludedTID; + int excluded = 0; + for(excludedTID = ia->rbtidExcludes; + excludedTID < ia->rbtidExcludes + ia->numrbtidExcludes; + excludedTID++) { + if (thistid == *excludedTID) { + time_t ttid = (time_t)thistid; + rpmlog(RPMLOG_NOTICE, + _("Excluding TID from rollback: %-24.24s (0x%08x)\n"), + ctime(&ttid), thistid); + excluded = 1; + /*@innerbreak@*/ break; + } + } + if (excluded) { + /* Iterate over repackaged packages */ + while (rp != NULL && rp->val.u32 == thistid) { + /* Go to the next repackaged package */ + nrids--; + if (nrids > 0) + rp++; + else + rp = NULL; + } + /* Iterate over installed packages */ + while (ip != NULL && ip->val.u32 == thistid) { + /* Go to the next header in the rpmdb */ + niids--; + if (niids > 0) + ip++; + else + ip = NULL; + } + continue; /* with next transaction */ + } + } + + rpmtsEmpty(ts); + (void) rpmtsSetFlags(ts, transFlags); + (void) rpmtsSetDFlags(ts, depFlags); + ts->probs = rpmpsFree(ts->probs); + + /* Install the previously erased packages for this transaction. + */ + while (rp != NULL && rp->val.u32 == thistid) { + if (!rp->done) { + rpmlog(RPMLOG_DEBUG, D_("\t+++ install %s\n"), + (rp->key ? rp->key : "???")); + +/*@-abstract@*/ + rc = rpmtsAddInstallElement(ts, rp->h, (fnpyKey)rp->key, + 0, ia->relocations); +/*@=abstract@*/ + if (rc != 0) + goto exit; + + numAdded++; + rpmcliPackagesTotal++; + if (!(ia->installInterfaceFlags & ifmask)) + ia->installInterfaceFlags = (rpmInstallInterfaceFlags) + (ia->installInterfaceFlags | INSTALL_UPGRADE); + + /* Re-add linked (i.e. from upgrade/obsoletes) erasures. */ + rc = findErases(ts, ts->teInstall, thistid, ip, niids); + if (rc < 0) + goto exit; +#ifdef NOTYET + (void)headerFree(rp->h); + rpm->h = NULL; +#endif + rp->done = 1; + } + + /* Go to the next repackaged package */ + nrids--; + if (nrids > 0) + rp++; + else + rp = NULL; + } + + /* Re-add pure (i.e. not from upgrade/obsoletes) erasures. */ + rc = findErases(ts, NULL, thistid, ip, niids); + if (rc < 0) + goto exit; + + /* Check that all erasures have been re-added. */ + while (ip != NULL && ip->val.u32 == thistid) { +#ifdef NOTNOW +/* XXX Prevent incomplete rollback transactions. */ +assert(ip->done || ia->no_rollback_links); +#endif + if (!(ip->done || ia->no_rollback_links)) { + numRemoved++; + + if (_unsafe_rollbacks != 0) + rpmcliPackagesTotal++; + + if (!(ia->installInterfaceFlags & ifmask)) + ia->installInterfaceFlags = (rpmInstallInterfaceFlags) + (ia->installInterfaceFlags | INSTALL_ERASE); + } + + /* Go to the next header in the rpmdb */ + niids--; + if (niids > 0) + ip++; + else + ip = NULL; + } + + /* Print any rollback transaction problems */ + xx = rpmcliInstallProblems(ts, _("Missing re-packaged package(s)"), 1); + + /* Anything to do? */ + if (rpmcliPackagesTotal <= 0) + break; + + tid = (time_t)thistid; + rpmlog(RPMLOG_NOTICE, + _("Rollback packages (+%d/-%d) to %-24.24s (0x%08x):\n"), + numAdded, numRemoved, ctime(&tid), thistid); + + rc = (ia->rbCheck ? (*ia->rbCheck) (ts) : 0); + if (rc != 0) + goto exit; + + rc = (ia->rbOrder ? (*ia->rbOrder) (ts) : 0); + if (rc != 0) + goto exit; + + /* Drop added/available package indices and dependency sets. */ + rpmtsClean(ts); + + /* Print the transaction set. */ + xx = rpmtsPrint(ts, stdout); + + rc = (ia->rbRun + ? (*ia->rbRun)(ts, NULL, (rpmprobFilterFlags)(ia->probFilter|RPMPROB_FILTER_OLDPACKAGE)) + : 0); + if (rc != 0) + goto exit; + + /* Remove repackaged packages after successful reinstall. */ + if (rtids && !rpmIsDebug()) { + int i; + rpmlog(RPMLOG_NOTICE, _("Cleaning up repackaged packages:\n")); + if (rtids->idt) + for (i = 0; i < rtids->nidt; i++) { + IDT rrp = rtids->idt + i; + if (rrp->val.u32 != thistid) + /*@innercontinue@*/ continue; + if (rrp->key) { /* XXX can't happen */ + rpmlog(RPMLOG_NOTICE, _("\tRemoving %s:\n"), rrp->key); + (void) unlink(rrp->key); /* XXX: Should check rc??? */ + } + } + } + + /* The rpmdb has changed, so reload installed package chains. */ + itids = IDTXfree(itids); + itids = IDTXload(ts, RPMTAG_INSTALLTID, ia->rbtid); + if (itids != NULL) { + ip = itids->idt; + niids = itids->nidt; + } else { + ip = NULL; + niids = 0; + } + + /* Re-position the iterator at the current install tid. */ + while (ip != NULL && ip->val.u32 == thistid) { + /* Go to the next header in the rpmdb */ + niids--; + if (niids > 0) + ip++; + else + ip = NULL; + } + + } while (1); + +exit: + rtids = IDTXfree(rtids); + itids = IDTXfree(itids); + + rpmtsEmpty(ts); + (void) rpmtsSetFlags(ts, transFlags); + (void) rpmtsSetDFlags(ts, depFlags); + + return rc; +} diff --git a/rpm-5.4.9/lib/rpmrollback.h b/rpm-5.4.9/lib/rpmrollback.h new file mode 100644 index 0000000..94f7f97 --- /dev/null +++ b/rpm-5.4.9/lib/rpmrollback.h @@ -0,0 +1,135 @@ +#ifndef H_RPMROLLBACK +#define H_RPMROLLBACK + +/** \ingroup rpmts + * \file lib/rpmrollback.h + * + */ + +#include /* XXX QVA_t typedef */ + +/** + */ +typedef /*@abstract@*/ struct IDT_s * IDT; + +/** + */ +typedef /*@abstract@*/ struct IDTindex_s * IDTX; + +#if defined(_RPMROLLBACK_INTERNAL) +/** + * A rollback transaction id element. + */ +/*@-fielduse@*/ +#if !defined(SWIG) +struct IDT_s { + int done; /*!< package processed? */ + unsigned int instance; /*!< installed package transaction id. */ +/*@owned@*/ /*@null@*/ + const char * key; /*! removed package file name. */ + Header h; /*!< removed package header. */ + union { + rpmuint32_t u32; /*!< install/remove transaction id */ + } val; +}; +#endif +/*@=fielduse@*/ + +/** + * A rollback transaction id index. + */ +#if !defined(SWIG) +struct IDTindex_s { + int delta; /*!< no. elements to realloc as a chunk. */ + int size; /*!< size of id index element. */ + int alloced; /*!< current number of elements allocated. */ + int nidt; /*!< current number of elements initialized. */ +/*@only@*/ /*@null@*/ + IDT idt; /*!< id index elements. */ +}; +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Destroy id index. + * @param idtx id index + * @return NULL always + */ +/*@null@*/ +IDTX IDTXfree(/*@only@*/ /*@null@*/ IDTX idtx) + /*@modifies idtx @*/; + +/** + * Create id index. + * @return new id index + */ +/*@only@*/ +IDTX IDTXnew(void) + /*@*/; + +/** + * Insure that index has room for "need" elements. + * @param idtx id index + * @param need additional no. of elements needed + * @return id index (with room for "need" elements) + */ +/*@only@*/ /*@null@*/ +IDTX IDTXgrow(/*@only@*/ /*@null@*/ IDTX idtx, int need) + /*@modifies idtx @*/; + +/** + * Sort tag (instance,value) pairs. + * @param idtx id index + * @return id index + */ +/*@only@*/ /*@null@*/ +IDTX IDTXsort(/*@only@*/ /*@null@*/ IDTX idtx) + /*@modifies idtx @*/; + +/** + * Load tag (instance,value) pairs from rpm databse, and return sorted id index. + * @param ts transaction set + * @param tag rpm tag + * @param rbtid rollback goal + * @return id index + */ +/*@only@*/ /*@null@*/ +IDTX IDTXload(rpmts ts, rpmTag tag, rpmuint32_t rbtid) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** + * Load tag (instance,value) pairs from packages, and return sorted id index. + * @param ts transaction set + * @param globstr glob expression + * @param tag rpm tag + * @param rbtid rollback goal + * @return id index + */ +/*@only@*/ /*@null@*/ +IDTX IDTXglob(rpmts ts, const char * globstr, rpmTag tag, rpmuint32_t rbtid) + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies ts, fileSystem, internalState @*/; + +/** \ingroup rpmcli + * Rollback transactions, erasing new, reinstalling old, package(s). + * @param ts transaction set + * @param ia mode flags and parameters + * @param argv array of arguments (NULL terminated) + * @return 0 on success + */ +int rpmRollback(rpmts ts, QVA_t ia, /*@null@*/ const char ** argv) + /*@globals rpmcliPackagesTotal, rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies ts, ia, rpmcliPackagesTotal, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMROLLBACK */ diff --git a/rpm-5.4.9/lib/rpmte.c b/rpm-5.4.9/lib/rpmte.c new file mode 100644 index 0000000..343c0ff --- /dev/null +++ b/rpm-5.4.9/lib/rpmte.c @@ -0,0 +1,1095 @@ +/** \ingroup rpmdep + * \file lib/rpmte.c + * Routine(s) to handle an "rpmte" transaction element. + */ +#include "system.h" + +#include +#include /* XXX fnpyKey */ + +#include +#include +#include /* rpmmiFoo */ +#include /* rpmReadPackageFile */ + +#include "rpmds.h" +#define _RPMFI_INTERNAL /* pre/post trans scripts */ +#include "rpmfi.h" + +#define _RPMTE_INTERNAL +#include "rpmte.h" +#include "rpmts.h" + +#include "debug.h" + +/*@unchecked@*/ +int _rpmte_debug = 0; + +/*@access alKey @*/ +/*@access rpmts @*/ /* XXX cast */ +/*@access rpmtsi @*/ + +#ifdef __cplusplus +GENfree(rpmtsi) +GENfree(sharedFileInfo) +GENfree(tsortInfo) +#endif /* __cplusplus */ + +void rpmteCleanDS(rpmte te) +{ + te->PRCO = rpmdsFreePRCO(te->PRCO); +} + +/** + * Destroy transaction element data. + * @param p transaction element + */ +static void delTE(rpmte p) + /*@globals fileSystem @*/ + /*@modifies p, fileSystem @*/ +{ + p->relocs = rpmfiFreeRelocations(p->relocs); + + rpmteCleanDS(p); + +/*@-refcounttrans@*/ /* FIX: XfdFree annotation */ + if (p->fd != NULL) + p->fd = fdFree(p->fd, "delTE"); +/*@=refcounttrans@*/ + + p->os = _free(p->os); + p->arch = _free(p->arch); + p->epoch = _free(p->epoch); + p->name = _free(p->name); + p->version = _free(p->version); + p->release = _free(p->release); +#ifdef RPM_VENDOR_MANDRIVA + p->distepoch = _free(p->distepoch); +#endif + p->NEVR = _free(p->NEVR); + p->NEVRA = _free(p->NEVRA); + p->pkgid = _free(p->pkgid); + p->hdrid = _free(p->hdrid); + p->sourcerpm = _free(p->sourcerpm); + + p->replaced = _free(p->replaced); + + p->flink.NEVRA = argvFree(p->flink.NEVRA); + p->flink.Pkgid = argvFree(p->flink.Pkgid); + p->flink.Hdrid = argvFree(p->flink.Hdrid); + p->blink.NEVRA = argvFree(p->blink.NEVRA); + p->blink.Pkgid = argvFree(p->blink.Pkgid); + p->blink.Hdrid = argvFree(p->blink.Hdrid); + +assert(p->txn == NULL); /* XXX FIXME */ + p->txn = NULL; + p->fi = rpmfiFree(p->fi); + + (void)headerFree(p->h); + p->h = NULL; + + /*@-nullstate@*/ /* FIX: p->{NEVR,name} annotations */ + return; + /*@=nullstate@*/ +} + +/** + * Initialize transaction element data from header. + * @param ts transaction set + * @param p transaction element + * @param h header + * @param key (TR_ADDED) package retrieval key (e.g. file name) + * @param relocs (TR_ADDED) package file relocations + */ +static void addTE(rpmts ts, rpmte p, Header h, + /*@dependent@*/ /*@null@*/ fnpyKey key, + /*@null@*/ rpmRelocation relocs) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, p, h, + rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + int scareMem = 0; + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + int xx; + + he->tag = RPMTAG_NVRA; + xx = headerGet(h, he, 0); +assert(he->p.str != NULL); + p->NEVR = (xx ? he->p.str : xstrdup("?N-?V-?R.?A")); + + he->tag = RPMTAG_NAME; + xx = headerGet(h, he, 0); + p->name = (xx ? he->p.str : xstrdup("?RPMTAG_NAME?")); + he->tag = RPMTAG_VERSION; + xx = headerGet(h, he, 0); + p->version = (char *)(xx ? he->p.str : xstrdup("?RPMTAG_VERSION?")); + he->tag = RPMTAG_RELEASE; + xx = headerGet(h, he, 0); + p->release = (char *)(xx ? he->p.str : xstrdup("?RPMTAG_RELEASE?")); + + p->db_instance = 0; + + he->tag = RPMTAG_PKGID; + xx = headerGet(h, he, 0); + if (he->p.ui8p != NULL) { + static const char hex[] = "0123456789abcdef"; + char * t; + rpmuint32_t i; + + p->pkgid = t = (char *) xmalloc((2*he->c) + 1); + for (i = 0 ; i < he->c; i++) { + *t++ = hex[ (unsigned)((he->p.ui8p[i] >> 4) & 0x0f) ]; + *t++ = hex[ (unsigned)((he->p.ui8p[i] ) & 0x0f) ]; + } + *t = '\0'; + he->p.ptr = _free(he->p.ptr); + } else + p->pkgid = NULL; + + he->tag = RPMTAG_HDRID; + xx = headerGet(h, he, 0); + p->hdrid = (xx ? he->p.str : xstrdup("?RPMTAG_HDRID?")); + + he->tag = RPMTAG_SOURCERPM; + xx = headerGet(h, he, 0); + p->sourcerpm = (xx ? he->p.str : NULL); + + he->tag = RPMTAG_ARCH; + xx = headerGet(h, he, 0); + p->arch = (xx ? he->p.str : xstrdup("?RPMTAG_ARCH?")); + + he->tag = RPMTAG_OS; + xx = headerGet(h, he, 0); + p->os = (xx ? he->p.str : xstrdup("?RPMTAG_OS?")); + + p->isSource = + (headerIsEntry(h, RPMTAG_SOURCERPM) == 0 && + headerIsEntry(h, RPMTAG_ARCH) != 0); + + p->NEVRA = xstrdup(p->NEVR); + + he->tag = RPMTAG_EPOCH; + xx = headerGet(h, he, 0); + if (he->p.ui32p != NULL) { + p->epoch = (char *) xmalloc(20); + sprintf(p->epoch, "%u", he->p.ui32p[0]); + he->p.ptr = _free(he->p.ptr); + } else + p->epoch = NULL; + +#ifdef RPM_VENDOR_MANDRIVA + he->tag = RPMTAG_DISTEPOCH; + xx = headerGet(h, he, 0); + if (he->p.str != NULL) { + p->distepoch = (char*)(xx ? he->p.str : xstrdup("?RPMTAG_DISTEPOCH?")); + } else + p->distepoch = NULL; +#endif + + p->installed = 0; + + p->relocs = rpmfiDupeRelocations(relocs, &p->nrelocs); + p->autorelocatex = -1; + + p->key = key; + p->fd = NULL; + + p->replaced = NULL; + + p->pkgFileSize = 0; + memset(p->originTid, 0, sizeof(p->originTid)); + memset(p->originTime, 0, sizeof(p->originTime)); + + p->PRCO = rpmdsNewPRCO(h); + + { rpmte savep = rpmtsSetRelocateElement(ts, p); + p->fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, scareMem); + (void) rpmtsSetRelocateElement(ts, savep); + } + p->txn = NULL; + + rpmteColorDS(p, RPMTAG_PROVIDENAME); + rpmteColorDS(p, RPMTAG_REQUIRENAME); +/*@-compdef@*/ + return; +/*@=compdef@*/ +} + +static void rpmteFini(void * _te) + /*@modifies _te @*/ +{ + rpmte te = (rpmte) _te; + + delTE(te); +} + +/*@unchecked@*/ /*@only@*/ /*@null@*/ +rpmioPool _rpmtePool; + +static rpmte rpmteGetPool(/*@null@*/ rpmioPool pool) + /*@globals _rpmtePool, fileSystem, internalState @*/ + /*@modifies pool, _rpmtePool, fileSystem, internalState @*/ +{ + rpmte te; + + if (_rpmtePool == NULL) { + _rpmtePool = rpmioNewPool("te", sizeof(*te), -1, _rpmte_debug, + NULL, NULL, rpmteFini); + pool = _rpmtePool; + } + te = (rpmte) rpmioGetPool(pool, sizeof(*te)); + memset(((char *)te)+sizeof(te->_item), 0, sizeof(*te)-sizeof(te->_item)); + return te; +} + +rpmte rpmteNew(const rpmts ts, Header h, + rpmElementType type, + fnpyKey key, + rpmRelocation relocs, + uint32_t dboffset, + alKey pkgKey) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmte p = rpmteGetPool(_rpmtePool); + int xx; + + p->type = type; + + addTE(ts, p, h, key, relocs); + switch (type) { + case TR_ADDED: + p->u.addedKey = pkgKey; + /* XXX 256 is only an estimate of signature header. */ + p->pkgFileSize = 96 + 256; + he->tag = RPMTAG_SIGSIZE; + xx = headerGet(h, he, 0); + if (xx && he->p.ui32p) + p->pkgFileSize += *he->p.ui32p; + he->p.ptr = _free(he->p.ptr); + break; + case TR_REMOVED: + p->u.addedKey = pkgKey; + p->u.removed.dboffset = dboffset; + break; + } + return p; +} + +/* Get the DB Instance value */ +uint32_t rpmteDBInstance(rpmte te) +{ + return (te != NULL ? te->db_instance : 0); +} + +/* Set the DB Instance value */ +void rpmteSetDBInstance(rpmte te, unsigned int instance) +{ + if (te != NULL) + te->db_instance = instance; +} + +Header rpmteHeader(rpmte te) +{ +/*@-castexpose -retalias -retexpose @*/ + return (te != NULL && te->h != NULL ? headerLink(te->h) : NULL); +/*@=castexpose =retalias =retexpose @*/ +} + +Header rpmteSetHeader(rpmte te, Header h) +{ + if (te != NULL) { + (void)headerFree(te->h); + te->h = NULL; +/*@-assignexpose -castexpose @*/ + if (h != NULL) + te->h = headerLink(h); +/*@=assignexpose =castexpose @*/ + } + return NULL; +} + +rpmElementType rpmteType(rpmte te) +{ + return (te != NULL ? te->type : (rpmElementType)-1); +} + +const char * rpmteN(rpmte te) +{ + return (te != NULL ? te->name : NULL); +} + +const char * rpmteE(rpmte te) +{ + return (te != NULL ? te->epoch : NULL); +} + +const char * rpmteV(rpmte te) +{ + return (te != NULL ? te->version : NULL); +} + +const char * rpmteR(rpmte te) +{ + return (te != NULL ? te->release : NULL); +} + +const char * rpmteD(rpmte te) +{ +#ifdef RPM_VENDOR_MANDRIVA + return (te != NULL ? te->distepoch : NULL); +#else + return NULL; +#endif +} + +const char * rpmteA(rpmte te) +{ + return (te != NULL ? te->arch : NULL); +} + +const char * rpmteO(rpmte te) +{ + return (te != NULL ? te->os : NULL); +} + +int rpmteIsSource(rpmte te) +{ + return (te != NULL ? te->isSource : 0); +} + +rpmuint32_t rpmteColor(rpmte te) +{ + return (te != NULL ? te->color : 0); +} + +rpmuint32_t rpmteSetColor(rpmte te, rpmuint32_t color) +{ + int ocolor = 0; + if (te != NULL) { + ocolor = te->color; + te->color = color; + } + return ocolor; +} + +rpmuint32_t rpmtePkgFileSize(rpmte te) +{ + return (te != NULL ? te->pkgFileSize : 0); +} + +rpmuint32_t * rpmteOriginTid(rpmte te) +{ + return te->originTid; +} + +rpmuint32_t * rpmteOriginTime(rpmte te) +{ + return te->originTime; +} + +int rpmteDepth(rpmte te) +{ + return (te != NULL ? te->depth : 0); +} + +int rpmteSetDepth(rpmte te, int ndepth) +{ + int odepth = 0; + if (te != NULL) { + odepth = te->depth; + te->depth = ndepth; + } + return odepth; +} + +int rpmteBreadth(rpmte te) +{ + return (te != NULL ? te->depth : 0); +} + +int rpmteSetBreadth(rpmte te, int nbreadth) +{ + int obreadth = 0; + if (te != NULL) { + obreadth = te->breadth; + te->breadth = nbreadth; + } + return obreadth; +} + +int rpmteNpreds(rpmte te) +{ + return (te != NULL ? te->npreds : 0); +} + +int rpmteSetNpreds(rpmte te, int npreds) +{ + int opreds = 0; + if (te != NULL) { + opreds = te->npreds; + te->npreds = npreds; + } + return opreds; +} + +int rpmteTree(rpmte te) +{ + return (te != NULL ? te->tree : 0); +} + +int rpmteSetTree(rpmte te, int ntree) +{ + int otree = 0; + if (te != NULL) { + otree = te->tree; + te->tree = ntree; + } + return otree; +} + +rpmte rpmteParent(rpmte te) +{ + return (te != NULL ? te->parent : NULL); +} + +rpmte rpmteSetParent(rpmte te, rpmte pte) +{ + rpmte opte = NULL; + if (te != NULL) { + opte = te->parent; + /*@-assignexpose -temptrans@*/ + te->parent = pte; + /*@=assignexpose =temptrans@*/ + } + return opte; +} + +int rpmteDegree(rpmte te) +{ + return (te != NULL ? te->degree : 0); +} + +int rpmteSetDegree(rpmte te, int ndegree) +{ + int odegree = 0; + if (te != NULL) { + odegree = te->degree; + te->degree = ndegree; + } + return odegree; +} + +tsortInfo rpmteTSI(rpmte te) +{ + /*@-compdef -retalias -retexpose -usereleased @*/ + return te->tsi; + /*@=compdef =retalias =retexpose =usereleased @*/ +} + +void rpmteFreeTSI(rpmte te) +{ + if (te != NULL && rpmteTSI(te) != NULL) { + tsortInfo tsi; + + /* Clean up tsort remnants (if any). */ + while ((tsi = rpmteTSI(te)->tsi_next) != NULL) { + rpmteTSI(te)->tsi_next = tsi->tsi_next; + tsi->tsi_next = NULL; + tsi = _free(tsi); + } + te->tsi = _free(te->tsi); + } + /*@-nullstate@*/ /* FIX: te->tsi is NULL */ + return; + /*@=nullstate@*/ +} + +void rpmteNewTSI(rpmte te) +{ + if (te != NULL) { + rpmteFreeTSI(te); + te->tsi = (tsortInfo) xcalloc(1, sizeof(*te->tsi)); + } +} + +alKey rpmteAddedKey(rpmte te) +{ + return (te != NULL ? te->u.addedKey : RPMAL_NOMATCH); +} + +alKey rpmteSetAddedKey(rpmte te, alKey npkgKey) +{ + alKey opkgKey = RPMAL_NOMATCH; + if (te != NULL) { + opkgKey = te->u.addedKey; + te->u.addedKey = npkgKey; + } + return opkgKey; +} + + +int rpmteDBOffset(rpmte te) +{ + return (te != NULL ? te->u.removed.dboffset : 0); +} + +const char * rpmteNEVR(rpmte te) +{ + return (te != NULL ? te->NEVR : NULL); +} + +const char * rpmteNEVRA(rpmte te) +{ + return (te != NULL ? te->NEVRA : NULL); +} + +const char * rpmtePkgid(rpmte te) +{ + return (te != NULL ? te->pkgid : NULL); +} + +const char * rpmteHdrid(rpmte te) +{ + return (te != NULL ? te->hdrid : NULL); +} + +const char * rpmteSourcerpm(rpmte te) +{ + return (te != NULL ? te->sourcerpm : NULL); +} + +FD_t rpmteFd(rpmte te) +{ + /*@-compdef -refcounttrans -retalias -retexpose -usereleased @*/ + return (te != NULL ? te->fd : NULL); + /*@=compdef =refcounttrans =retalias =retexpose =usereleased @*/ +} + +fnpyKey rpmteKey(rpmte te) +{ + return (te != NULL ? te->key : NULL); +} + +rpmds rpmteDS(rpmte te, rpmTag tag) +{ + return (te != NULL ? rpmdsFromPRCO(te->PRCO, tag) : NULL); +} + +#ifdef REFERENCE +rpmfi rpmteFI(rpmte te) +{ + if (te == NULL) + return NULL; + + return te->fi; /* XXX take fi reference here? */ +} +#else +rpmfi rpmteFI(rpmte te, rpmTag tag) +{ + /*@-compdef -refcounttrans -retalias -retexpose -usereleased @*/ + if (te == NULL) + return NULL; + + if (tag == RPMTAG_BASENAMES) + return te->fi; + else + return NULL; + /*@=compdef =refcounttrans =retalias =retexpose =usereleased @*/ +} +#endif + +rpmfi rpmteSetFI(rpmte te, rpmfi fi) +{ + if (te != NULL) { + te->fi = rpmfiFree(te->fi); +/*@-assignexpose -castexpose @*/ + if (fi != NULL) + te->fi = rpmfiLink(fi, __FUNCTION__); +/*@=assignexpose =castexpose @*/ + } + return NULL; +} + +void rpmteColorDS(rpmte te, rpmTag tag) +{ + rpmfi fi = rpmteFI(te, RPMTAG_BASENAMES); + rpmds ds = rpmteDS(te, tag); + char deptype = 'R'; + char mydt; + const rpmuint32_t * ddict; + rpmuint32_t * colors; + rpmuint32_t * refs; + rpmuint32_t val; + int Count; + size_t nb; + unsigned ix; + int ndx, i; + + if (!(te && (Count = rpmdsCount(ds)) > 0 && rpmfiFC(fi) > 0)) + return; + + switch (tag) { + default: + return; + /*@notreached@*/ break; + case RPMTAG_PROVIDENAME: + deptype = 'P'; + break; + case RPMTAG_REQUIRENAME: + deptype = 'R'; + break; + } + + nb = Count * sizeof(*colors); + colors = (rpmuint32_t *) memset(alloca(nb), 0, nb); + nb = Count * sizeof(*refs); + refs = (rpmuint32_t *) memset(alloca(nb), -1, nb); + + /* Calculate dependency color and reference count. */ + fi = rpmfiInit(fi, 0); + if (fi != NULL) + while (rpmfiNext(fi) >= 0) { + val = rpmfiFColor(fi); + ddict = NULL; + ndx = rpmfiFDepends(fi, &ddict); + if (ddict != NULL) + while (ndx-- > 0) { + ix = *ddict++; + mydt = (char)((ix >> 24) & 0xff); + if (mydt != deptype) + /*@innercontinue@*/ continue; + ix &= 0x00ffffff; +assert ((int)ix < Count); + colors[ix] |= val; + refs[ix]++; + } + } + + /* Set color/refs values in dependency set. */ + ds = rpmdsInit(ds); + while ((i = rpmdsNext(ds)) >= 0) { + val = colors[i]; + te->color |= val; + (void) rpmdsSetColor(ds, val); + val = refs[i]; + (void) rpmdsSetRefs(ds, val); + } +} + +/*@unchecked@*/ +static int __mydebug = 0; + +int rpmteChain(rpmte p, rpmte q, Header oh, const char * msg) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + const char * blinkNEVRA = NULL; + const char * blinkPkgid = NULL; + const char * blinkHdrid = NULL; + int xx; + + if (msg == NULL) + msg = ""; + he->tag = RPMTAG_NVRA; + xx = headerGet(oh, he, 0); +assert(he->p.str != NULL); + blinkNEVRA = he->p.str; + + /* + * Convert binary pkgid to a string. + * XXX Yum's borken conception of a "header" doesn't have signature + * tags appended. + */ + he->tag = RPMTAG_PKGID; + xx = headerGet(oh, he, 0); + if (xx && he->p.ui8p != NULL) { + static const char hex[] = "0123456789abcdef"; + char * t; + rpmuint32_t i; + + blinkPkgid = t = (char *) xmalloc((2*he->c) + 1); + for (i = 0 ; i < he->c; i++) { + *t++ = hex[ ((he->p.ui8p[i] >> 4) & 0x0f) ]; + *t++ = hex[ ((he->p.ui8p[i] ) & 0x0f) ]; + } + *t = '\0'; + he->p.ptr = _free(he->p.ptr); + } else + blinkPkgid = NULL; + + he->tag = RPMTAG_HDRID; + xx = headerGet(oh, he, 0); + blinkHdrid = he->p.str; + +/*@-modfilesys@*/ +if (__mydebug) +fprintf(stderr, "%s argvAdd(&q->flink.NEVRA, \"%s\")\n", msg, p->NEVRA); + xx = argvAdd(&q->flink.NEVRA, p->NEVRA); +if (__mydebug) +fprintf(stderr, "%s argvAdd(&p->blink.NEVRA, \"%s\")\n", msg, blinkNEVRA); + xx = argvAdd(&p->blink.NEVRA, blinkNEVRA); +if (__mydebug) +fprintf(stderr, "%s argvAdd(&q->flink.Pkgid, \"%s\")\n", msg, p->pkgid); + if (p->pkgid != NULL) + xx = argvAdd(&q->flink.Pkgid, p->pkgid); +if (__mydebug) +fprintf(stderr, "%s argvAdd(&p->blink.Pkgid, \"%s\")\n", msg, blinkPkgid); + if (blinkPkgid != NULL) + xx = argvAdd(&p->blink.Pkgid, blinkPkgid); +if (__mydebug) +fprintf(stderr, "%s argvAdd(&q->flink.Hdrid, \"%s\")\n", msg, p->hdrid); + if (p->hdrid != NULL) + xx = argvAdd(&q->flink.Hdrid, p->hdrid); +if (__mydebug) +fprintf(stderr, "%s argvAdd(&p->blink.Hdrid, \"%s\")\n", msg, blinkHdrid); + if (blinkHdrid != NULL) + xx = argvAdd(&p->blink.Hdrid, blinkHdrid); +/*@=modfilesys@*/ + + blinkNEVRA = _free(blinkNEVRA); + blinkPkgid = _free(blinkPkgid); + blinkHdrid = _free(blinkHdrid); + + return 0; +} + +int rpmtsiOc(rpmtsi tsi) +{ + return tsi->ocsave; +} + +/*@-mustmod@*/ +static void rpmtsiFini(void * _tsi) + /*@modifies _tsi @*/ +{ + rpmtsi tsi = (rpmtsi) _tsi; +/*@-internalglobs@*/ + (void)rpmtsFree(tsi->ts); + tsi->ts = NULL; +/*@=internalglobs@*/ +} +/*@=mustmod@*/ + +/*@unchecked@*/ /*@only@*/ /*@null@*/ +rpmioPool _rpmtsiPool; + +static rpmtsi rpmtsiGetPool(/*@null@*/ rpmioPool pool) + /*@globals _rpmtsiPool, fileSystem, internalState @*/ + /*@modifies pool, _rpmtsiPool, fileSystem, internalState @*/ +{ + rpmtsi tsi; + + if (_rpmtsiPool == NULL) { + _rpmtsiPool = rpmioNewPool("tsi", sizeof(*tsi), -1, _rpmte_debug, + NULL, NULL, rpmtsiFini);/* XXX _rpmtsi_debug? */ + pool = _rpmtsiPool; + } + tsi = (rpmtsi) rpmioGetPool(pool, sizeof(*tsi)); + memset(((char *)tsi)+sizeof(tsi->_item), 0, sizeof(*tsi)-sizeof(tsi->_item)); + return tsi; +} + +rpmtsi XrpmtsiInit(rpmts ts, const char * fn, unsigned int ln) +{ + rpmtsi tsi = rpmtsiGetPool(_rpmtsiPool); + +/*@-assignexpose -castexpose @*/ + tsi->ts = rpmtsLink(ts, "rpmtsi"); +/*@=assignexpose =castexpose @*/ + tsi->reverse = 0; + tsi->oc = (tsi->reverse ? (rpmtsNElements(ts) - 1) : 0); + tsi->ocsave = tsi->oc; + + return (rpmtsi) rpmioLinkPoolItem((rpmioItem)tsi, "rpmtsiInit", fn, ln); +} + +/** + * Return next transaction element. + * @param tsi transaction element iterator + * @return transaction element, NULL on termination + */ +static /*@null@*/ /*@dependent@*/ +rpmte rpmtsiNextElement(rpmtsi tsi) + /*@modifies tsi @*/ +{ + rpmte te = NULL; + int oc = -1; + + if (tsi == NULL || tsi->ts == NULL || rpmtsNElements(tsi->ts) <= 0) + return te; + + if (tsi->reverse) { + if (tsi->oc >= 0) oc = tsi->oc--; + } else { + if (tsi->oc < rpmtsNElements(tsi->ts)) oc = tsi->oc++; + } + tsi->ocsave = oc; + if (oc != -1) + te = rpmtsElement(tsi->ts, oc); + return te; +} + +rpmte rpmtsiNext(rpmtsi tsi, rpmElementType type) +{ + rpmte te; + + while ((te = rpmtsiNextElement(tsi)) != NULL) { + if (type == 0 || (te->type & type) != 0) + break; + } + return te; +} + +/*@-mods@*/ +Header rpmteDBHeader(rpmts ts, uint32_t rec) +{ + rpmmi mi = rpmtsInitIterator(ts, RPMDBI_PACKAGES, &rec, sizeof(rec)); + Header h; + + /* iterator returns weak refs, grab hold of header */ + if ((h = rpmmiNext(mi)) != NULL) + h = headerLink(h); + mi = rpmmiFree(mi); + return h; +} +/*@=mods@*/ + +Header rpmteFDHeader(rpmts ts, rpmte te) +{ + Header h = NULL; + te->fd = (FD_t) rpmtsNotify(ts, te, RPMCALLBACK_INST_OPEN_FILE, 0, 0); + if (te->fd != NULL) { + rpmVSFlags nvsflags = (rpmVSFlags) + (rpmtsVSFlags(ts) | RPMVSF_NEEDPAYLOAD); + rpmVSFlags ovsflags = rpmtsSetVSFlags(ts, nvsflags); + rpmRC pkgrc = rpmReadPackageFile(ts, rpmteFd(te), rpmteNEVR(te), &h); + ovsflags = rpmtsSetVSFlags(ts, ovsflags); + switch (pkgrc) { + default: + (void) rpmteClose(te, ts, 1); + break; + case RPMRC_NOTTRUSTED: + case RPMRC_NOKEY: + case RPMRC_OK: + break; + } + } + return h; +} + +/*@-mods@*/ +int rpmteOpen(rpmte te, rpmts ts, int reload_fi) +{ + Header h = NULL; + uint32_t instance; + int rc = 0; /* assume failure */ + + if (te == NULL || ts == NULL) + goto exit; + + instance = rpmteDBInstance(te); + (void) rpmteSetHeader(te, NULL); + + switch (rpmteType(te)) { + case TR_ADDED: + h = instance ? rpmteDBHeader(ts, instance) : rpmteFDHeader(ts, te); + break; + case TR_REMOVED: + h = rpmteDBHeader(ts, instance); + break; + } + if (h != NULL) { +#ifdef REFERENCE + if (reload_fi) { + te->fi = getFI(te, ts, h); + } +#else + if (reload_fi) { + static int scareMem = 0; + te->fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, scareMem); + } +#endif + + (void) rpmteSetHeader(te, h); + h = headerFree(h); + rc = 1; + } + +exit: + return rc; +} +/*@=mods@*/ + +int rpmteClose(rpmte te, rpmts ts, int reset_fi) +{ + if (te == NULL || ts == NULL) + return 0; + + switch (te->type) { + case TR_ADDED: + if (te->fd != NULL) { + void * ptr; + ptr = rpmtsNotify(ts, te, RPMCALLBACK_INST_CLOSE_FILE, 0, 0); + te->fd = NULL; + } + break; + case TR_REMOVED: + /* eventually we'll want notifications for erase open too */ + break; + } + (void) rpmteSetHeader(te, NULL); + if (reset_fi) + (void) rpmteSetFI(te, NULL); + return 1; +} + +int rpmteFailed(rpmte te) +{ + return (te != NULL) ? te->linkFailed : -1; +} + +int rpmteHaveTransScript(rpmte te, rpmTag tag) +{ + rpmfi fi = (te ? te->fi : NULL); + int rc = 0; + + switch (tag) { + default: + break; + case RPMTAG_PRETRANS: + if (fi) + rc = (fi->pretrans || fi->pretransprog) ? 1 : 0; + break; + case RPMTAG_POSTTRANS: + if (fi) + rc = (fi->posttrans || fi->posttransprog) ? 1 : 0; + break; + } + return rc; +} + +#ifdef REFERENCE +int rpmteMarkFailed(rpmte te, rpmts ts) +{ + rpmtsi pi = rpmtsiInit(ts); + int rc = 0; + rpmte p; + + te->failed = 1; + /* XXX we can do a much better here than this... */ + while ((p = rpmtsiNext(pi, TR_REMOVED))) { + if (rpmteDependsOn(p) == te) { + p->failed = 1; + } + } + rpmtsiFree(pi); + return rc; +} + +rpmps rpmteProblems(rpmte te) +{ + return te ? te->probs : NULL; +} + +rpmfs rpmteGetFileStates(rpmte te) { + return te->fs; +} + +rpmfs rpmfsNew(unsigned int fc, rpmElementType type) { + rpmfs fs = (rpmfs) xmalloc(sizeof(*fs)); + fs->fc = fc; + fs->replaced = NULL; + fs->states = NULL; + if (type == TR_ADDED) { + fs->states = (sharedFileInfo) xmalloc(sizeof(*fs->states) * fs->fc); + memset(fs->states, RPMFILE_STATE_NORMAL, fs->fc); + } + fs->actions = (rpmFIleAction *) xmalloc(fc * sizeof(*fs->actions)); + memset(fs->actions, FA_UNKNOWN, fc * sizeof(*fs->actions)); + fs->numReplaced = fs->allocatedReplaced = 0; + return fs; +} + +rpmfs rpmfsFree(rpmfs fs) { + fs->replaced = _free(fs->replaced); + fs->states = _free(fs->states); + fs->actions = _free(fs->actions); + + fs = _free(fs); + return fs; +} + +rpm_count_t rpmfsFC(rpmfs fs) { + return fs->fc; +} + +void rpmfsAddReplaced(rpmfs fs, int pkgFileNum, int otherPkg, int otherFileNum) +{ + if (!fs->replaced) { + fs->replaced = (sharedFileInfo) xcalloc(3, sizeof(*fs->replaced)); + fs->allocatedReplaced = 3; + } + if (fs->numReplaced>=fs->allocatedReplaced) { + fs->allocatedReplaced += (fs->allocatedReplaced>>1) + 2; + fs->replaced = (sharedFileInfo) xrealloc(fs->replaced, fs->allocatedReplaced*sizeof(*fs->replaced)); + } + fs->replaced[fs->numReplaced].pkgFileNum = pkgFileNum; + fs->replaced[fs->numReplaced].otherPkg = otherPkg; + fs->replaced[fs->numReplaced].otherFileNum = otherFileNum; + + fs->numReplaced++; +} + +sharedFileInfo rpmfsGetReplaced(rpmfs fs) +{ + if (fs && fs->numReplaced) + return fs->replaced; + else + return NULL; +} + +sharedFileInfo rpmfsNextReplaced(rpmfs fs , sharedFileInfo replaced) +{ + if (fs && replaced) { + replaced++; + if (replaced - fs->replaced < fs->numReplaced) + return replaced; + } + return NULL; +} + +void rpmfsSetState(rpmfs fs, unsigned int ix, rpmfileState state) +{ + assert(ix < fs->fc); + fs->states[ix] = state; +} + +rpmfileState rpmfsGetState(rpmfs fs, unsigned int ix) +{ + assert(ix < fs->fc); + if (fs->states) return fs->states[ix]; + return RPMFILE_STATE_MISSING; +} + +rpm_fstate_t * rpmfsGetStates(rpmfs fs) +{ + return fs->states; +} + +rpmFileAction rpmfsGetAction(rpmfs fs, unsigned int ix) +{ + rpmFileAction action; + if (fs->actions != NULL && ix < fs->fc) { + action = fs->actions[ix]; + } else { + action = FA_UNKNOWN; + } + return action; +} + +void rpmfsSetAction(rpmfs fs, unsigned int ix, rpmFileAction action) +{ + if (fs->actions != NULL && ix < fs->fc) { + fs->actions[ix] = action; + } +} +#endif /* REFERENCE */ diff --git a/rpm-5.4.9/lib/rpmte.h b/rpm-5.4.9/lib/rpmte.h new file mode 100644 index 0000000..c5538d1 --- /dev/null +++ b/rpm-5.4.9/lib/rpmte.h @@ -0,0 +1,877 @@ +#ifndef H_RPMTE +#define H_RPMTE + +/** \ingroup rpmts rpmte + * \file lib/rpmte.h + * Structures used for an "rpmte" transaction element. + */ +#include + +/** + */ +/*@-exportlocal@*/ +/*@unchecked@*/ +extern int _rpmte_debug; +/*@=exportlocal@*/ + +/** \ingroup rpmte + * Transaction element ordering chain linkage. + */ +typedef /*@abstract@*/ struct tsortInfo_s * tsortInfo; + +/** \ingroup rpmte + * Transaction element iterator. + */ +typedef /*@abstract@*/ /*@refcounted@*/ struct rpmtsi_s *rpmtsi; + +/** \ingroup rpmte + * Transaction element type. + */ +typedef enum rpmElementType_e { + TR_ADDED = (1 << 0), /*!< Package will be installed. */ + TR_REMOVED = (1 << 1) /*!< Package will be removed. */ +} rpmElementType; + +#if defined(_RPMTE_INTERNAL) +#include +#include +#include + +typedef struct relation_s * relation; + +#if defined(_RPMTS_ORDER_INTERNAL) +struct relation_s { + rpmte rel_suc; // pkg requiring this package + rpmsenseFlags rel_flags; // accumulated flags of the requirements + struct relation_s * rel_next; +}; +#endif + +/** \ingroup rpmte + * Dependncy ordering information. + */ +/*@-fielduse@*/ /* LCL: confused by union? */ +struct tsortInfo_s { +/*@owned@*/ /*@null@*/ + tsortInfo tsi_next; +/*@exposed@*/ /*@dependent@*/ /*@null@*/ + rpmte tsi_chain; + int tsi_tagn; + int tsi_queued; + + int tsi_count; + int tsi_qcnt; + int tsi_reqx; + relation tsi_relations; + relation tsi_forward_relations; + rpmte tsi_suc; + int tsi_SccIdx; + int tsi_SccLowlink; +}; +/*@=fielduse@*/ + +/** \ingroup rpmte + * Info used to link transaction element upgrade/rollback side effects. + */ +struct rpmChainLink_s { +/*@only@*/ /*@null@*/ + ARGV_t Pkgid; /*!< link element pkgid's. */ +/*@only@*/ /*@null@*/ + ARGV_t Hdrid; /*!< link element hdrid's. */ +/*@only@*/ /*@null@*/ + ARGV_t NEVRA; /*!< link element NEVRA's. */ +}; + +/** \ingroup rpmte + */ +typedef struct sharedFileInfo_s * sharedFileInfo; + +/** \ingroup rpmte + * Replaced file cross reference. + */ +struct sharedFileInfo_s { + rpmuint32_t pkgFileNum; + rpmuint32_t otherFileNum; + rpmuint32_t otherPkg; + rpmuint32_t isRemoved; +}; + +/** \ingroup rpmte + * A single package instance to be installed/removed atomically. + */ +struct rpmte_s { + struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ + rpmElementType type; /*!< Package disposition (installed/removed). */ + +/*@refcounted@*/ /*@relnull@*/ + Header h; /*!< Package header. */ +/*@only@*/ + const char * NEVR; /*!< Package name-version-release. */ +/*@only@*/ + const char * NEVRA; /*!< Package name-version-release.arch. */ +/*@only@*/ /*@relnull@*/ + const char * pkgid; /*!< Package identifier (header+payload md5). */ +/*@only@*/ /*@relnull@*/ + const char * hdrid; /*!< Package header identifier (header sha1). */ +/*@only@*/ /*@null@*/ + const char * sourcerpm; /*!< Source package. */ +/*@only@*/ + const char * name; /*!< Name: */ +/*@only@*/ /*@null@*/ + char * epoch; +/*@only@*/ /*@null@*/ + char * version; /*!< Version: */ +/*@only@*/ /*@null@*/ + char * release; /*!< Release: */ +#ifdef RPM_VENDOR_MANDRIVA +/*@only@*/ /*@null@*/ + char * distepoch; +#endif +/*@only@*/ /*@null@*/ + const char * arch; /*!< Architecture hint. */ +/*@only@*/ /*@null@*/ + const char * os; /*!< Operating system hint. */ + int isSource; /*!< (TR_ADDED) source rpm? */ + + rpmte parent; /*!< Parent transaction element. */ + int degree; /*!< No. of immediate children. */ + int npreds; /*!< No. of predecessors. */ + int tree; /*!< Tree index. */ + int depth; /*!< Depth in dependency tree. */ + int breadth; /*!< Breadth in dependency tree. */ + uint32_t db_instance; /*!< Database Instance after add */ +/*@owned@*/ + tsortInfo tsi; /*!< Dependency ordering chains. */ + +/*@null@*/ + rpmPRCO PRCO; /*!< Current dependencies. */ + +/*@null@*/ + rpmtxn txn; /*!< Package transaction pointer. */ +/*@refcounted@*/ /*@null@*/ + rpmfi fi; /*!< File information. */ +#ifdef REFERENCE + rpmpol pol; /*!< Policies */ +#endif + + rpmuint32_t depFlags; /*!< Package depFlags mask. */ + rpmuint32_t transFlags; /*!< Package transFlags mask. */ + rpmuint32_t color; /*!< Color bit(s) from package dependencies. */ + rpmuint32_t pkgFileSize; /*!< No. of bytes in package file (approx). */ + +/*@exposed@*/ /*@dependent@*/ /*@null@*/ + fnpyKey key; /*!< (TR_ADDED) Retrieval key. */ +/*@owned@*/ /*@null@*/ + rpmRelocation relocs; /*!< (TR_ADDED) Payload file relocations. */ + int nrelocs; /*!< (TR_ADDED) No. of relocations. */ + int autorelocatex; /*!< (TR_ADDED) Auto relocation entry index. */ +/*@refcounted@*/ /*@null@*/ + FD_t fd; /*!< (TR_ADDED) Payload file descriptor. */ + +/*@owned@*/ /*@null@*/ + sharedFileInfo replaced; /*!< (TR_ADDED) Replaced file reference. */ + int nreplaced; /*!< (TR_ADDED) No. of replaced files. */ + + struct rpmChainLink_s blink;/*!< Backward link info to erased element. */ + struct rpmChainLink_s flink;/*!< Forward link info to installed element. */ + int linkFailed; /*!< Did the linked element upgrade succeed? */ + int done; /*!< Has the element been installed/erased? */ + rpmuint32_t originTid[2]; /*!< Transaction id of first install. */ + rpmuint32_t originTime[2]; /*!< Time that package was first installed. */ + + int installed; /*!< Was the header installed? */ + int downgrade; /*!< Adjust package count on downgrades. */ + + struct { +/*@exposed@*/ /*@dependent@*/ /*@null@*/ + alKey addedKey; + struct { +/*@exposed@*/ /*@dependent@*/ /*@null@*/ + alKey dependsOnKey; + uint32_t dboffset; + } removed; + } u; +#if defined(__LCLINT__) +/*@refs@*/ + int nrefs; /*!< (unused) keep splint happy */ +#endif +}; + +/** \ingroup rpmte + * Iterator across transaction elements, forward on install, backward on erase. + */ +struct rpmtsi_s { + struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ +/*@refcounted@*/ + rpmts ts; /*!< transaction set. */ + int reverse; /*!< reversed traversal? */ + int ocsave; /*!< last returned iterator index. */ + int oc; /*!< iterator index. */ +#if defined(__LCLINT__) +/*@refs@*/ + int nrefs; /*!< (unused) keep splint happy */ +#endif +}; + +#ifdef __cplusplus +extern "C" { +#endif + +int rpmteClose(rpmte te, rpmts ts, int reset_fi) + /*@modifies te, ts @*/; +Header rpmteDBHeader(rpmts ts, uint32_t rec) + /*@modifies ts @*/; +Header rpmteFDHeader(rpmts ts, rpmte te) + /*@modifies ts, te @*/; +int rpmteOpen(rpmte te, rpmts ts, int reload_fi) + /*@modifies te, ts @*/; + +/** \ingroup rpmte + * Return failed status of transaction element. + * @param te transaction element + * @return 1 if transaction element (or its parents) failed + */ +int rpmteFailed(rpmte te) + /*@*/; + +int rpmteHaveTransScript(rpmte te, rpmTag tag) + /*@*/; + +#ifdef __cplusplus +} +#endif + +#endif /* _RPMTE_INTERNAL */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \ingroup rpmte + * Destroy a transaction element. + * @param te transaction element + * @return NULL on last dereference + */ +/*@unused@*/ /*@null@*/ +rpmte rpmteFree(/*@only@*/ /*@null@*/ rpmte te) + /*@globals fileSystem @*/ + /*@modifies te, fileSystem @*/; +#define rpmteFree(_te) \ + ((rpmte) rpmioFreePoolItem((rpmioItem)(_te), __FUNCTION__, __FILE__, __LINE__)) + +/** \ingroup rpmte + * Create a transaction element. + * @param ts transaction set + * @param h header + * @param type TR_ADDED/TR_REMOVED + * @param key (TR_ADDED) package retrieval key (e.g. file name) + * @param relocs (TR_ADDED) package file relocations + * @param dboffset (TR_REMOVED) rpmdb instance + * @param pkgKey associated added package (if any) + * @return new transaction element + */ +/*@only@*/ /*@null@*/ +rpmte rpmteNew(const rpmts ts, Header h, rpmElementType type, + /*@exposed@*/ /*@dependent@*/ /*@null@*/ fnpyKey key, + /*@null@*/ rpmRelocation relocs, + uint32_t dboffset, + /*@exposed@*/ /*@dependent@*/ /*@null@*/ alKey pkgKey) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmte + * Retrieve header from transaction element. + * @param te transaction element + * @return header + */ +extern Header rpmteHeader(rpmte te) + /*@modifies te @*/; + +/** \ingroup rpmte + * Save header into transaction element. + * @param te transaction element + * @param h header + * @return NULL always + */ +extern Header rpmteSetHeader(rpmte te, Header h) + /*@modifies te, h @*/; + +/** \ingroup rpmte + * Retrieve type of transaction element. + * @param te transaction element + * @return type + */ +rpmElementType rpmteType(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Retrieve name string of transaction element. + * @param te transaction element + * @return name string + */ +/*@observer@*/ +extern const char * rpmteN(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Retrieve epoch string of transaction element. + * @param te transaction element + * @return epoch string + */ +/*@observer@*/ /*@null@*/ +extern const char * rpmteE(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Retrieve version string of transaction element. + * @param te transaction element + * @return version string + */ +/*@observer@*/ /*@null@*/ +extern const char * rpmteV(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Retrieve release string of transaction element. + * @param te transaction element + * @return release string + */ +/*@observer@*/ /*@null@*/ +extern const char * rpmteR(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Retrieve distepoch string of transaction element. + * @param te transaction element + * @return distepoch string + */ +/*@observer@*/ /*@null@*/ +extern const char * rpmteD(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Retrieve arch string of transaction element. + * @param te transaction element + * @return arch string + */ +/*@observer@*/ /*@null@*/ +extern const char * rpmteA(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Retrieve os string of transaction element. + * @param te transaction element + * @return os string + */ +/*@observer@*/ /*@null@*/ +extern const char * rpmteO(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Retrieve isSource attribute of transaction element. + * @param te transaction element + * @return isSource attribute + */ +extern int rpmteIsSource(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Retrieve color bits of transaction element. + * @param te transaction element + * @return color bits + */ +rpmuint32_t rpmteColor(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Set color bits of transaction element. + * @param te transaction element + * @param color new color bits + * @return previous color bits + */ +rpmuint32_t rpmteSetColor(rpmte te, rpmuint32_t color) + /*@modifies te @*/; + +/** \ingroup rpmte + * Retrieve last instance installed to the database. + * @param te transaction element + * @return last install instance. + */ +uint32_t rpmteDBInstance(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Set last instance installed to the database. + * @param te transaction element + * @param instance Database instance of last install element. + * @return last install instance. + */ +void rpmteSetDBInstance(rpmte te, unsigned int instance) + /*@modifies te @*/; + +/** \ingroup rpmte + * Retrieve size in bytes of package file. + * @todo Signature header is estimated at 256b. + * @param te transaction element + * @return size in bytes of package file. + */ +rpmuint32_t rpmtePkgFileSize(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Retrieve transaction start time that package was first installed. + * @param te transaction element + * @return origin time + */ +/*@observer@*/ +rpmuint32_t * rpmteOriginTid(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Retrieve time that package was first installed. + * @param te transaction element + * @return origin time + */ +/*@observer@*/ +rpmuint32_t * rpmteOriginTime(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Retrieve dependency tree depth of transaction element. + * @param te transaction element + * @return depth + */ +int rpmteDepth(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Set dependency tree depth of transaction element. + * @param te transaction element + * @param ndepth new depth + * @return previous depth + */ +int rpmteSetDepth(rpmte te, int ndepth) + /*@modifies te @*/; + +/** \ingroup rpmte + * Retrieve dependency tree breadth of transaction element. + * @param te transaction element + * @return breadth + */ +int rpmteBreadth(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Set dependency tree breadth of transaction element. + * @param te transaction element + * @param nbreadth new breadth + * @return previous breadth + */ +int rpmteSetBreadth(rpmte te, int nbreadth) + /*@modifies te @*/; + +/** \ingroup rpmte + * Retrieve tsort no. of predecessors of transaction element. + * @param te transaction element + * @return no. of predecessors + */ +int rpmteNpreds(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Set tsort no. of predecessors of transaction element. + * @param te transaction element + * @param npreds new no. of predecessors + * @return previous no. of predecessors + */ +int rpmteSetNpreds(rpmte te, int npreds) + /*@modifies te @*/; + +/** \ingroup rpmte + * Retrieve tree index of transaction element. + * @param te transaction element + * @return tree index + */ +int rpmteTree(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Set tree index of transaction element. + * @param te transaction element + * @param ntree new tree index + * @return previous tree index + */ +int rpmteSetTree(rpmte te, int ntree) + /*@modifies te @*/; + +/** \ingroup rpmte + * Retrieve parent transaction element. + * @param te transaction element + * @return parent transaction element + */ +/*@observer@*/ /*@unused@*/ +rpmte rpmteParent(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Set parent transaction element. + * @param te transaction element + * @param pte new parent transaction element + * @return previous parent transaction element + */ +/*@null@*/ +rpmte rpmteSetParent(rpmte te, rpmte pte) + /*@modifies te @*/; + +/** \ingroup rpmte + * Retrieve number of children of transaction element. + * @param te transaction element + * @return tree index + */ +int rpmteDegree(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Set number of children of transaction element. + * @param te transaction element + * @param ndegree new number of children + * @return previous number of children + */ +int rpmteSetDegree(rpmte te, int ndegree) + /*@modifies te @*/; + +/** \ingroup rpmte + * Retrieve tsort info for transaction element. + * @param te transaction element + * @return tsort info + */ +tsortInfo rpmteTSI(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Destroy tsort info of transaction element. + * @param te transaction element + */ +void rpmteFreeTSI(rpmte te) + /*@modifies te @*/; + +/** \ingroup rpmte + * Initialize tsort info of transaction element. + * @param te transaction element + */ +void rpmteNewTSI(rpmte te) + /*@modifies te @*/; + +/** \ingroup rpmte + * Destroy dependency set info of transaction element. + * @param te transaction element + */ +/*@unused@*/ +void rpmteCleanDS(rpmte te) + /*@modifies te @*/; + +#if defined(_RPMTE_INTERNAL) +/** \ingroup rpmte + * Retrieve pkgKey of TR_ADDED transaction element. + * @param te transaction element + * @return pkgKey + */ +/*@exposed@*/ /*@dependent@*/ /*@null@*/ +alKey rpmteAddedKey(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Set pkgKey of TR_ADDED transaction element. + * @param te transaction element + * @param npkgKey new pkgKey + * @return previous pkgKey + */ +/*@exposed@*/ /*@dependent@*/ /*@null@*/ +alKey rpmteSetAddedKey(rpmte te, + /*@exposed@*/ /*@dependent@*/ /*@null@*/ alKey npkgKey) + /*@modifies te @*/; +#endif /* _RPMTE_INTERNAL */ + +/** \ingroup rpmte + * Retrieve rpmdb instance of TR_REMOVED transaction element. + * @param te transaction element + * @return rpmdb instance + */ +int rpmteDBOffset(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Retrieve name-version-release string from transaction element. + * @param te transaction element + * @return name-version-release string + */ +/*@observer@*/ +extern const char * rpmteNEVR(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Retrieve name-version-release.arch string from transaction element. + * @param te transaction element + * @return name-version-release.arch string + */ +/*@-exportlocal@*/ +/*@observer@*/ +extern const char * rpmteNEVRA(rpmte te) + /*@*/; +/*@=exportlocal@*/ + +/** \ingroup rpmte + * Retrieve pkgid string from transaction element. + * @param te transaction element + * @return pkgid string + */ +/*@-exportlocal@*/ +/*@observer@*/ /*@null@*/ +extern const char * rpmtePkgid(rpmte te) + /*@*/; +/*@=exportlocal@*/ + +/** \ingroup rpmte + * Retrieve hdrid string from transaction element. + * @param te transaction element + * @return hdrid string + */ +/*@-exportlocal@*/ +/*@observer@*/ /*@null@*/ +extern const char * rpmteHdrid(rpmte te) + /*@*/; +/*@=exportlocal@*/ + +/** \ingroup rpmte + * Retrieve sourcerpm string from transaction element. + * @param te transaction element + * @return sourcerpm string + */ +/*@-exportlocal@*/ +/*@observer@*/ /*@null@*/ +extern const char * rpmteSourcerpm(rpmte te) + /*@*/; +/*@=exportlocal@*/ + +/** \ingroup rpmte + * Retrieve file handle from transaction element. + * @param te transaction element + * @return file handle + */ +FD_t rpmteFd(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Retrieve key from transaction element. + * @param te transaction element + * @return key + */ +/*@exposed@*/ +fnpyKey rpmteKey(rpmte te) + /*@*/; + +/** \ingroup rpmte + * Retrieve dependency tag set from transaction element. + * @param te transaction element + * @param tag dependency tag + * @return dependency tag set + */ +rpmds rpmteDS(rpmte te, rpmTag tag) + /*@*/; + +/** \ingroup rpmte + * Retrieve file info tag set from transaction element. + * @param te transaction element + * @param tag file info tag (RPMTAG_BASENAMES) + * @return file info tag set + */ +rpmfi rpmteFI(rpmte te, rpmTag tag) + /*@*/; +/*@null@*/ +rpmfi rpmteSetFI(rpmte te, rpmfi fi) + /*@modifies te, fi @*/; + +/** \ingroup rpmte + * Calculate transaction element dependency colors/refs from file info. + * @param te transaction element + * @param tag dependency tag (RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME) + */ +/*@-exportlocal@*/ +void rpmteColorDS(rpmte te, rpmTag tag) + /*@modifies te @*/; +/*@=exportlocal@*/ + +/** \ingroup rpmte + * Chain p <-> q forward/backward transaction element links. + * @param p installed element (needs backward link) + * @param q erased element (needs forward link) + * @param oh erased element header + * @param msg operation identifier for debugging (NULL uses "") + * @return 0 on success + */ +int rpmteChain(rpmte p, rpmte q, Header oh, /*@null@*/ const char * msg) + /*@globals internalState @*/ + /*@modifies p, q, oh, internalState @*/; + +#define RPMTE_CHAIN_END "CHAIN END" /*!< End of chain marker. */ + +/** \ingroup rpmte + * Return transaction element index. + * @param tsi transaction element iterator + * @return transaction element index + */ +int rpmtsiOc(rpmtsi tsi) + /*@*/; + +/** \ingroup rpmte + * Destroy transaction element iterator. + * @param tsi transaction element iterator + * @return NULL on last dereference + */ +/*@unused@*/ /*@null@*/ +rpmtsi rpmtsiFree(/*@killref@*//*@null@*/ rpmtsi tsi) + /*@globals fileSystem @*/ + /*@modifies fileSystem @*/; +#define rpmtsiFree(_tsi) \ + ((rpmtsi)rpmioFreePoolItem((rpmioItem)(_tsi), __FUNCTION__, __FILE__, __LINE__)) + +/** \ingroup rpmte + * Create transaction element iterator. + * @param ts transaction set + * @return transaction element iterator + */ +/*@unused@*/ /*@only@*/ +rpmtsi rpmtsiInit(rpmts ts) + /*@modifies ts @*/; + +/** \ingroup rpmte + * Create transaction element iterator. + * @param ts transaction set + * @param fn + * @param ln + * @return transaction element iterator + */ +/*@unused@*/ /*@only@*/ +rpmtsi XrpmtsiInit(rpmts ts, + const char * fn, unsigned int ln) + /*@modifies ts @*/; +#define rpmtsiInit(_ts) XrpmtsiInit(_ts, __FILE__, __LINE__) + +/** \ingroup rpmte + * Return next transaction element of type. + * @param tsi transaction element iterator + * @param type transaction element type selector (0 for any) + * @return next transaction element of type, NULL on termination + */ +/*@dependent@*/ /*@null@*/ +rpmte rpmtsiNext(rpmtsi tsi, rpmElementType type) + /*@modifies tsi @*/; + +#if defined(DYING) +#if !defined(SWIG) +/** \ingroup rpmte + */ +static inline void rpmtePrintID(rpmte p) + /*@globals fileSystem @*/ + /*@modifies fileSystem @*/ +{ + if (p != NULL) { + if (p->blink.Pkgid) argvPrint("blink.Pkgid", p->blink.Pkgid, NULL); + if (p->blink.Hdrid) argvPrint("blink.Hdrid", p->blink.Hdrid, NULL); + if (p->blink.NEVRA) argvPrint("blink.NEVRA", p->blink.NEVRA, NULL); + if (p->flink.Pkgid) argvPrint("flink.Pkgid", p->flink.Pkgid, NULL); + if (p->flink.Hdrid) argvPrint("flink.Hdrid", p->flink.Hdrid, NULL); + if (p->flink.NEVRA) argvPrint("flink.NEVRA", p->flink.NEVRA, NULL); + } +}; + +/** \ingroup rpmte + */ +static inline void hdrPrintInstalled(Header h) + /*@globals fileSystem @*/ + /*@modifies h, fileSystem @*/ +{ + const char * qfmt = "[%{erasednevra} O:%{packageorigin} P:%{erasedpkgid} H:%{erasedhdrid}\n]"; + const char * errstr = "(unknown error)"; +/*@-modobserver@*/ + const char * str = headerSprintf(h, qfmt, rpmTagTable, rpmHeaderFormats, &errstr); +/*@=modobserver@*/ + + if (str == NULL) + fprintf(stderr, "error: %s\n", errstr); + else { + fprintf(stderr, "%s", str); + str = _free(str); + } +} + +/** \ingroup rpmte + */ +static inline void hdrPrintErased(Header h) + /*@globals fileSystem @*/ + /*@modifies h, fileSystem @*/ +{ + const char * qfmt = "[%{installednevra} O:%{packageorigin} P:%{installedpkgid} H:%{installedhdrid}\n]"; + const char * errstr = "(unknown error)"; +/*@-modobserver@*/ + const char * str = headerSprintf(h, qfmt, rpmTagTable, rpmHeaderFormats, &errstr); +/*@=modobserver@*/ + if (str == NULL) + fprintf(stderr, "error: %s\n", errstr); + else { + fprintf(stderr, "%s", str); + str = _free(str); + } +} +#endif +#endif + +#ifdef REFERENCE +/** \ingroup rpmte + * Transaction element file states. + */ +typedef struct rpmfs_s * rpmfs; + +/** + */ +struct sharedFileInfo_s { + int pkgFileNum; + int otherPkg; + int otherFileNum; +}; + +typedef char rpm_fstate_t; + +struct rpmfs_s { + unsigned int fc; + + rpm_fstate_t * states; + rpmFileAction * actions; /*!< File disposition(s). */ + + sharedFileInfo replaced; /*!< (TR_ADDED) to be replaced files in the rpmdb */ + int numReplaced; + int allocatedReplaced; +}; + +int rpmteMarkFailed(rpmte te, rpmts ts); + +rpmps rpmteProblems(rpmte te); +rpmfs rpmteGetFileStates(rpmte te); +rpmfs rpmfsNew(unsigned int fc, rpmElementType type); +rpmfs rpmfsFree(rpmfs fs); +rpm_count_t rpmfsFC(rpmfs fs); +void rpmfsAddReplaced(rpmfs fs, int pkgFileNum, int otherPkg, int otherFileNum); +sharedFileInfo rpmfsGetReplaced(rpmfs fs); +sharedFileInfo rpmfsNextReplaced(rpmfs fs , sharedFileInfo replaced); +void rpmfsSetState(rpmfs fs, unsigned int ix, rpmfileState state); +rpmfileState rpmfsGetState(rpmfs fs, unsigned int ix); +/*@null@*/ +rpm_fstate_t * rpmfsGetStates(rpmfs fs); +void rpmfsSetAction(rpmfs fs, unsigned int ix, rpmFileAction action); +#endif /* REFERENCE */ + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMTE */ diff --git a/rpm-5.4.9/lib/rpmts.c b/rpm-5.4.9/lib/rpmts.c new file mode 100644 index 0000000..3937458 --- /dev/null +++ b/rpm-5.4.9/lib/rpmts.c @@ -0,0 +1,1543 @@ +/** \ingroup rpmdep + * \file lib/rpmts.c + * Routine(s) to handle a "rpmts" transaction sets. + */ +#include "system.h" + +#include +#include /* XXX fnpyKey */ +#include +#include /* XXX iosmFileAction */ +#include +#include +#include /* XXX rpmtsOpenDB() needs rpmGetPath */ +#include +#include +#include + +#include +#define _RPMTAG_INTERNAL /* XXX tagStore_s */ +#include +#include + +#define _RPMDB_INTERNAL /* XXX almost opaque sigh */ +#include "rpmdb.h" /* XXX stealing db->db_mode. */ + +#include "rpmal.h" +#include "rpmds.h" +#include "rpmfi.h" +#include "rpmlock.h" +#include "rpmns.h" + +#define _RPMTE_INTERNAL /* XXX te->h */ +#include "rpmte.h" + +#define _RPMTS_INTERNAL +#define _RPMBAG_INTERNAL +#include "rpmts.h" + +#include + +#include "fs.h" + +/* XXX FIXME: merge with existing (broken?) tests in system.h */ +/* portability fiddles */ +#if STATFS_IN_SYS_STATVFS +/*@-incondefs@*/ +#if defined(__LCLINT__) +/*@-declundef -exportheader -protoparammatch @*/ /* LCL: missing annotation */ +extern int statvfs (const char * file, /*@out@*/ struct statvfs * buf) + /*@globals fileSystem @*/ + /*@modifies *buf, fileSystem @*/; +/*@=declundef =exportheader =protoparammatch @*/ +/*@=incondefs@*/ +#else +# include +#endif +#else +# if STATFS_IN_SYS_VFS +# include +# else +# if STATFS_IN_SYS_MOUNT +# include +# else +# if STATFS_IN_SYS_STATFS +# include +# endif +# endif +# endif +#endif + +#include "debug.h" + +/*@access FD_t @*/ /* XXX void * arg */ +/*@access rpmdb @*/ /* XXX db->db_chrootDone, NULL */ + +/*@access rpmDiskSpaceInfo @*/ +/*@access rpmKeyring @*/ +/*@access rpmps @*/ +/*@access rpmte @*/ +/*@access rpmtsi @*/ +/*@access fnpyKey @*/ +/*@access pgpDig @*/ +/*@access pgpDigParams @*/ + +#ifdef __cplusplus +GENfree(rpmDiskSpaceInfo) +GENfree(uint32_t *) +GENfree(fnpyKey *) +GENfree(rpmte *) +#endif /* __cplusplus */ + +/*@unchecked@*/ +int _rpmts_debug = 0; + +/*@unchecked@*/ +int _rpmts_stats = 0; + +/*@unchecked@*/ +int _rpmts_macros = 0; + +int rpmtsCloseDB(rpmts ts) +{ + int rc = 0; + + if (ts->rdb != NULL) { + (void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_DBGET), &ts->rdb->db_getops); + (void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_DBPUT), &ts->rdb->db_putops); + (void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_DBDEL), &ts->rdb->db_delops); + rc = rpmdbClose(ts->rdb); + ts->rdb = NULL; + } + return rc; +} + +int rpmtsOpenDB(rpmts ts, int dbmode) +{ + int rc = 0; + + if (ts->rdb != NULL && ts->dbmode == dbmode) + return 0; + + (void) rpmtsCloseDB(ts); + + /* XXX there's a db lock race here that is the callers responsibility. */ + + ts->dbmode = dbmode; + rc = rpmdbOpen(ts->rootDir, &ts->rdb, ts->dbmode, (mode_t)0644); + if (rc) { + const char * dn = rpmGetPath(ts->rootDir, "%{_dbpath}", NULL); + rpmlog(RPMLOG_ERR, _("cannot open Packages database in %s\n"), dn); + dn = _free(dn); + } + return rc; +} + +int rpmtsRebuildDB(rpmts ts) +{ + void * lock = rpmtsAcquireLock(ts); + rpmdb db = NULL; + const char * fn; + struct stat sb; + int rc; + int xx; + + /* XXX Seqno update needs O_RDWR. */ + rc = rpmtsOpenDB(ts, O_RDWR); + if (rc) goto exit; + db = rpmtsGetRdb(ts); + + if (!(db->db_api == 3 || db->db_api == 4)) + goto exit; + + rc = rpmtxnCheckpoint(db); + if (rc) goto exit; + + { size_t dbix; + for (dbix = 0; dbix < db->db_ndbi; dbix++) { + tagStore_t dbiTags = &db->db_tags[dbix]; + + /* Remove configured secondary indices. */ + switch (dbiTags->tag) { + case RPMDBI_PACKAGES: + case RPMDBI_AVAILABLE: + case RPMDBI_ADDED: + case RPMDBI_REMOVED: + case RPMDBI_DEPCACHE: + case RPMDBI_SEQNO: + case RPMDBI_BTREE: + case RPMDBI_HASH: + case RPMDBI_QUEUE: + case RPMDBI_RECNO: + continue; + /*@notreached@*/ /*@switchbreak@*/ break; + default: + fn = rpmGetPath(db->db_root, db->db_home, "/", + (dbiTags->str != NULL ? dbiTags->str : tagName(dbiTags->tag)), + NULL); + if (!Stat(fn, &sb)) + xx = Unlink(fn); + fn = _free(fn); + /*@switchbreak@*/ break; + } + + /* Open (and re-create) each index. */ + (void) dbiOpen(db, dbiTags->tag, db->db_flags); + } + } + + /* Unreference header used by associated secondary index callbacks. */ + (void) headerFree(db->db_h); + db->db_h = NULL; + + /* Reset the Seqno counter to the maximum primary key */ + rpmlog(RPMLOG_DEBUG, D_("rpmdb: max. primary key %u\n"), + (unsigned)db->db_maxkey); + fn = rpmGetPath(db->db_root, db->db_home, "/Seqno", NULL); + if (!Stat(fn, &sb)) + xx = Unlink(fn); + (void) dbiOpen(db, RPMDBI_SEQNO, db->db_flags); + fn = _free(fn); + + rc = rpmtxnCheckpoint(db); + + xx = rpmtsCloseDB(ts); + +exit: + lock = rpmtsFreeLock(lock); + return rc; +} + +/*@-compdef@*/ /* keyp might not be defined. */ +rpmmi rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, + const void * keyp, size_t keylen) +{ + rpmmi mi = (ts->rdb == NULL && rpmtsOpenDB(ts, ts->dbmode)) + ? NULL + : rpmmiInit(ts->rdb, rpmtag, keyp, keylen); + return mi; +} +/*@=compdef@*/ + +int rpmtsCloseSDB(rpmts ts) +{ + rpmbag bag = ts->bag; + int rc = 0; + + if (bag != NULL) { + rpmsdb * sdbp = bag->sdbp; + int i = bag->nsdbp; + if (sdbp) + while (--i >= 0) { + rpmdb sdb; + if (sdbp[i] == NULL) + continue; + sdb = (rpmdb) sdbp[i]->_db; + if (sdb) { + int xx; + (void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_DBGET), &sdb->db_getops); + (void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_DBPUT), &sdb->db_putops); + (void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_DBDEL), &sdb->db_delops); + xx = rpmdbClose(sdb); + if (xx && rc == 0) + rc = xx; + } + (void) rpmbagDel(bag, i); + } + ts->bag = rpmbagFree(ts->bag); + } + return rc; +} + +int rpmtsOpenSDB(rpmts ts, int dbmode) +{ + static int has_sdbpath = -1; + rpmbag bag = ts->bag; + rpmsdb * sdbp = NULL; + rpmdb sdb = NULL; + int sdbmode = O_RDONLY; + const char * s = NULL; +#ifdef DYING /* XXX solevedb's never need chroot prefix. */ + const char * rootDir = ts->rootDir; +#else + const char * rootDir = "/"; +#endif + ARGV_t av = NULL; + int ac = 0; + int rc = 0; + int xx; + int i; + + if (bag == NULL) { + bag = ts->bag = rpmbagNew(NULL, 0); + if (bag == NULL) + goto exit; + } + sdbp = bag->sdbp; + sdb = (rpmdb) (sdbp[0] ? sdbp[0]->_db : NULL); + sdbmode = (sdbp[0] ? sdbp[0]->dbmode : O_RDONLY); + + if (sdb != NULL && sdbmode == dbmode) { + rc = 0; + goto exit; + } + + if (has_sdbpath < 0) + has_sdbpath = rpmExpandNumeric("%{?_solve_dbpath:1}"); + + /* If not configured, don't try to open. */ + if (has_sdbpath <= 0) { + rc = 1; + goto exit; + } + + s = rpmExpand("%{?_solve_dbpath}", NULL); + xx = argvSplit(&av, s, ":"); + ac = argvCount(av); + + for (i = 0; i < ac; i++) { + const char * fn; + urltype ut; + + if (av[i] == NULL || *av[i] == '\0') + continue; + + fn = NULL; + ut = urlPath(av[i], &fn); + + /* XXX Lstat(fn, &sb) to ensure a directory? */ + addMacro(NULL, "_dbpath", NULL, fn, RMIL_DEFAULT); + xx = rpmdbOpen(rootDir, &sdb, dbmode, (mode_t)0644); + delMacro(NULL, "_dbpath"); + + if (xx) { + const char * dn = rpmGetPath(rootDir, "/", fn, NULL); + rpmlog(RPMLOG_WARNING, _("cannot open Solve database in %s\n"), dn); + dn = _free(dn); + if (rc == 0) + rc = xx; + + /* XXX only try to open the solvedb once. */ + has_sdbpath = 0; + continue; + } + + xx = rpmbagAdd(bag, sdb, dbmode); + } + + av = argvFree(av); + s = _free(s); + +exit: +if (_rpmts_debug) +fprintf(stderr, "<-- %s(%p, 0%o) rc %d\n", __FUNCTION__, ts, dbmode, rc); + return rc; +} + +/** + * Compare suggested package resolutions (qsort/bsearch). + * @param a 1st instance address + * @param b 2nd instance address + * @return result of comparison + */ +static int sugcmp(const void * a, const void * b) + /*@*/ +{ + const char * astr = *(const char **)a; + const char * bstr = *(const char **)b; + return strcmp(astr, bstr); +} + +int rpmtsSolve(rpmts ts, rpmds ds, /*@unused@*/ const void * data) +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmbag bag = ts->bag; + rpmsdb * sdbp = NULL; + const char * errstr = NULL; + const char * str = NULL; + rpmmi mi; + Header bh = NULL; + Header h = NULL; + size_t bhnamelen = 0; + time_t bhtime = 0; + rpmTag rpmtag; + const char * keyp; + size_t keylen = 0; + int rc = 1; /* assume not found */ + int xx; + int i; + +if (_rpmts_debug) +fprintf(stderr, "--> %s(%p,%p,%p)\n", __FUNCTION__, ts, ds, data); + + /* Make suggestions only for installing Requires: */ + if (ts->goal != TSM_INSTALL) + goto exit; + + switch (rpmdsTagN(ds)) { + case RPMTAG_CONFLICTNAME: + default: + goto exit; + /*@notreached@*/ break; + case RPMTAG_DIRNAMES: /* XXX perhaps too many wrong answers? */ + case RPMTAG_REQUIRENAME: + case RPMTAG_FILELINKTOS: + break; + } + + keyp = rpmdsN(ds); + if (keyp == NULL) + goto exit; + + if (bag == NULL) { + xx = rpmtsOpenSDB(ts, O_RDONLY); + if (xx) + goto exit; + bag = ts->bag; + if (bag == NULL) + goto exit; + } + + sdbp = bag->sdbp; + + if (sdbp) + for (i = 0; i < (int)bag->nsdbp; i++) { + rpmdb sdb = NULL; + + if (sdbp[i] == NULL) + continue; + sdb = (rpmdb) sdbp[i]->_db; + if (sdb == NULL) + continue; + + /* Look for a matching Provides: in suggested universe. */ + rpmtag = (*keyp == '/' ? RPMTAG_FILEPATHS : RPMTAG_PROVIDENAME); + mi = rpmmiInit(sdb, rpmtag, keyp, keylen); + while ((h = rpmmiNext(mi)) != NULL) { + size_t hnamelen; + time_t htime; + + if (rpmtag == RPMTAG_PROVIDENAME && !rpmdsAnyMatchesDep(h, ds, 1)) + continue; + + he->tag = RPMTAG_NAME; + xx = headerGet(h, he, 0); + hnamelen = ((xx && he->p.str) ? strlen(he->p.str) : 0); + he->p.ptr = _free(he->p.ptr); + + /* XXX Prefer the shortest pkg N for basenames/provides resp. */ + if (bhnamelen > 0 && hnamelen > bhnamelen) + continue; + + /* XXX Prefer the newest build if given alternatives. */ + he->tag = RPMTAG_BUILDTIME; + xx = headerGet(h, he, 0); + htime = (xx && he->p.ui32p ? he->p.ui32p[0] : 0); + he->p.ptr = _free(he->p.ptr); + + if (htime <= bhtime) + continue; + + /* Save new "best" candidate. */ + (void)headerFree(bh); + bh = NULL; + bh = headerLink(h); + bhtime = htime; + bhnamelen = hnamelen; + } + mi = rpmmiFree(mi); + } + + /* Is there a suggested resolution? */ + if (bh == NULL) + goto exit; + + /* Get the path to the package file. */ + he->tag = RPMTAG_PACKAGEORIGIN; + he->p.ptr = NULL; + xx = headerGet(bh, he, 0); + if (he->p.str) { + str = he->p.str; + he->p.str = NULL; + } else { + /* Format the suggested resolution path. */ + const char * qfmt = rpmExpand("%{?_solve_name_fmt}", NULL); + if (qfmt == NULL || *qfmt == '\0') + goto exit; + str = headerSprintf(bh, qfmt, NULL, rpmHeaderFormats, &errstr); + qfmt = _free(qfmt); + } + + (void) headerFree(bh); + bh = NULL; + if (errstr) { + rpmlog(RPMLOG_ERR, _("incorrect solve path format: %s\n"), errstr); + goto exit; + } + + if (ts->depFlags & RPMDEPS_FLAG_ADDINDEPS) { + FD_t fd; + rpmRC rpmrc; + + fd = Fopen(str, "r.fdio"); + if (fd == NULL || Ferror(fd)) { + rpmlog(RPMLOG_ERR, _("open of %s failed: %s\n"), str, + Fstrerror(fd)); + if (fd != NULL) { + xx = Fclose(fd); + fd = NULL; + } + str = _free(str); + goto exit; + } + rpmrc = rpmReadPackageFile(ts, fd, str, &h); + xx = Fclose(fd); + switch (rpmrc) { + default: + str = _free(str); + break; + case RPMRC_NOTTRUSTED: + case RPMRC_NOKEY: + case RPMRC_OK: + if (h != NULL && + !rpmtsAddInstallElement(ts, h, (fnpyKey)str, 1, NULL)) + { + rpmlog(RPMLOG_DEBUG, D_("Adding: %s\n"), str); + rc = -1; /* XXX restart unsatisfiedDepends() */ + break; + } + break; + } + (void)headerFree(h); + h = NULL; + goto exit; + } + + rpmlog(RPMLOG_DEBUG, D_("Suggesting: %s\n"), str); + /* If suggestion is already present, don't bother. */ + if (ts->suggests != NULL && ts->nsuggests > 0) { + if (bsearch(&str, ts->suggests, ts->nsuggests, + sizeof(*ts->suggests), sugcmp)) + { + str = _free(str); + goto exit; + } + } + + /* Add a new (unique) suggestion. */ + ts->suggests = (const void **) xrealloc(ts->suggests, + sizeof(*ts->suggests) * (ts->nsuggests + 2)); + ts->suggests[ts->nsuggests] = str; + ts->nsuggests++; + ts->suggests[ts->nsuggests] = NULL; + + if (ts->nsuggests > 1) + qsort(ts->suggests, ts->nsuggests, sizeof(*ts->suggests), sugcmp); + +exit: +if (_rpmts_debug) +fprintf(stderr, "<-- %s(%p,%p,%p) rc %d N %s EVR %s F 0x%x\n", __FUNCTION__, ts, ds, data, rc, rpmdsN(ds), rpmdsEVR(ds), rpmdsFlags(ds)); + return rc; +} + +int rpmtsAvailable(rpmts ts, const rpmds ds) +{ + fnpyKey * sugkey; + int rc = 1; /* assume not found */ + + if (ts->availablePackages == NULL) + return rc; + sugkey = rpmalAllSatisfiesDepend(ts->availablePackages, ds, NULL); + if (sugkey == NULL) + return rc; + + /* XXX no alternatives yet */ + if (sugkey[0] != NULL) { + ts->suggests = (const void **) xrealloc(ts->suggests, + sizeof(*ts->suggests) * (ts->nsuggests + 2)); + ts->suggests[ts->nsuggests] = sugkey[0]; + sugkey[0] = NULL; + ts->nsuggests++; + ts->suggests[ts->nsuggests] = NULL; + } + sugkey = _free(sugkey); + return rc; +} + +int rpmtsSetSolveCallback(rpmts ts, + int (*solve) (rpmts ts, rpmds key, const void * data), + const void * solveData) +{ + int rc = 0; + + if (ts) { +/*@-assignexpose -temptrans @*/ + ts->solve = solve; + ts->solveData = solveData; +/*@=assignexpose =temptrans @*/ + } + return rc; +} + +rpmps rpmtsProblems(rpmts ts) +{ + static const char msg[] = "rpmtsProblems"; + rpmps ps = NULL; + if (ts) { + if (ts->probs == NULL) + ts->probs = rpmpsCreate(); +/*@-castexpose@*/ + ps = rpmpsLink(ts->probs, msg); +/*@=castexpose@*/ + } + return ps; +} + +void rpmtsClean(rpmts ts) +{ + rpmtsi pi; rpmte p; + + if (ts == NULL) + return; + + /* Clean up after dependency checks. */ + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, (rpmElementType)0)) != NULL) + rpmteCleanDS(p); + pi = rpmtsiFree(pi); + + ts->addedPackages = rpmalFree(ts->addedPackages); + ts->numAddedPackages = 0; + + ts->erasedPackages = rpmalFree(ts->erasedPackages); + ts->numErasedPackages = 0; + + ts->suggests = _free(ts->suggests); + ts->nsuggests = 0; + + ts->probs = rpmpsFree(ts->probs); + + rpmtsCleanDig(ts); +} + +void rpmtsEmpty(rpmts ts) +{ + rpmtsi pi; rpmte p; + int oc; + + if (ts == NULL) + return; + +/*@-nullstate@*/ /* FIX: partial annotations */ + rpmtsClean(ts); +/*@=nullstate@*/ + + for (pi = rpmtsiInit(ts), oc = 0; (p = rpmtsiNext(pi, (rpmElementType)0)) != NULL; oc++) { +/*@-type -unqualifiedtrans @*/ + ts->order[oc] = rpmteFree(ts->order[oc]); +/*@=type =unqualifiedtrans @*/ + } + pi = rpmtsiFree(pi); + ts->numAddedFiles = 0; + ts->numErasedFiles = 0; + + ts->orderCount = 0; + ts->ntrees = 0; + ts->maxDepth = 0; + + ts->numRemovedPackages = 0; +/*@-nullstate@*/ /* FIX: partial annotations */ + return; +/*@=nullstate@*/ +} + +static void rpmtsPrintStat(const char * name, /*@null@*/ struct rpmop_s * op) + /*@globals fileSystem @*/ + /*@modifies fileSystem @*/ +{ + static unsigned int scale = (1000 * 1000); + if (op != NULL && op->count > 0) + fprintf(stderr, " %s %8d %6lu.%06lu MB %6lu.%06lu secs\n", + name, op->count, + (unsigned long)op->bytes/scale, (unsigned long)op->bytes%scale, + op->usecs/scale, op->usecs%scale); +} + +/*@unchecked@*/ /*@relnull@*/ +extern rpmop _hdr_loadops; +/*@unchecked@*/ /*@relnull@*/ +extern rpmop _hdr_getops; + +static void rpmtsPrintStats(rpmts ts) + /*@globals fileSystem, internalState @*/ + /*@modifies fileSystem, internalState @*/ +{ + (void) rpmswExit(rpmtsOp(ts, RPMTS_OP_TOTAL), 0); + + if (_hdr_loadops) + (void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_HDRLOAD), _hdr_loadops); + if (_hdr_getops) + (void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_HDRGET), _hdr_getops); + + rpmtsPrintStat("total: ", rpmtsOp(ts, RPMTS_OP_TOTAL)); + rpmtsPrintStat("check: ", rpmtsOp(ts, RPMTS_OP_CHECK)); + rpmtsPrintStat("order: ", rpmtsOp(ts, RPMTS_OP_ORDER)); + rpmtsPrintStat("fingerprint: ", rpmtsOp(ts, RPMTS_OP_FINGERPRINT)); + rpmtsPrintStat("repackage: ", rpmtsOp(ts, RPMTS_OP_REPACKAGE)); + rpmtsPrintStat("install: ", rpmtsOp(ts, RPMTS_OP_INSTALL)); + rpmtsPrintStat("erase: ", rpmtsOp(ts, RPMTS_OP_ERASE)); + rpmtsPrintStat("scriptlets: ", rpmtsOp(ts, RPMTS_OP_SCRIPTLETS)); + rpmtsPrintStat("compress: ", rpmtsOp(ts, RPMTS_OP_COMPRESS)); + rpmtsPrintStat("uncompress: ", rpmtsOp(ts, RPMTS_OP_UNCOMPRESS)); + rpmtsPrintStat("digest: ", rpmtsOp(ts, RPMTS_OP_DIGEST)); + rpmtsPrintStat("signature: ", rpmtsOp(ts, RPMTS_OP_SIGNATURE)); + rpmtsPrintStat("dbadd: ", rpmtsOp(ts, RPMTS_OP_DBADD)); + rpmtsPrintStat("dbremove: ", rpmtsOp(ts, RPMTS_OP_DBREMOVE)); + rpmtsPrintStat("dbget: ", rpmtsOp(ts, RPMTS_OP_DBGET)); + rpmtsPrintStat("dbput: ", rpmtsOp(ts, RPMTS_OP_DBPUT)); + rpmtsPrintStat("dbdel: ", rpmtsOp(ts, RPMTS_OP_DBDEL)); + rpmtsPrintStat("readhdr: ", rpmtsOp(ts, RPMTS_OP_READHDR)); + rpmtsPrintStat("hdrload: ", rpmtsOp(ts, RPMTS_OP_HDRLOAD)); + rpmtsPrintStat("hdrget: ", rpmtsOp(ts, RPMTS_OP_HDRGET)); +/*@-globstate@*/ + return; +/*@=globstate@*/ +} + +static void rpmtsFini(void * _ts) + /*@modifies _ts @*/ +{ + rpmts ts = (rpmts) _ts; + +/*@-nullstate@*/ /* FIX: partial annotations */ + /* XXX there's a recursion here ... release and reacquire the lock */ +#ifndef BUGGY + yarnRelease(ts->_item.use); /* XXX hack-o-round */ +#endif + rpmtsEmpty(ts); +#ifndef BUGGY + yarnPossess(ts->_item.use); /* XXX hack-o-round */ +#endif +/*@=nullstate@*/ + + ts->PRCO = rpmdsFreePRCO(ts->PRCO); + + (void) rpmtsCloseDB(ts); +assert(ts->txn == NULL); /* XXX FIXME */ + ts->txn = NULL; + + (void) rpmtsCloseSDB(ts); + + (void) rpmbfFree(ts->rbf); + ts->rbf = NULL; + ts->removedPackages = _free(ts->removedPackages); + + ts->availablePackages = rpmalFree(ts->availablePackages); + ts->numAvailablePackages = 0; + + ts->dsi = _free(ts->dsi); + + if (ts->scriptFd != NULL) { +/*@-refcounttrans@*/ /* FIX: XfdFree annotation */ + ts->scriptFd = fdFree(ts->scriptFd, __FUNCTION__); +/*@=refcounttrans@*/ + ts->scriptFd = NULL; + } + ts->rootDir = _free(ts->rootDir); + ts->currDir = _free(ts->currDir); + +/*@-type +voidabstract @*/ /* FIX: double indirection */ + ts->order = _free(ts->order); +/*@=type =voidabstract @*/ + ts->orderAlloced = 0; + + ts->keyring = rpmKeyringFree(ts->keyring); + (void) rpmhkpFree(ts->hkp); + ts->hkp = NULL; + + if (_rpmts_stats) + rpmtsPrintStats(ts); + + if (_rpmts_macros) { + const char ** av = NULL; +/*@-globs@*/ /* Avoid rpmGlobalMcroContext et al. */ + (void)rpmGetMacroEntries(NULL, NULL, 1, &av); +/*@=globs@*/ + argvPrint("macros used", av, NULL); + av = argvFree(av); + } +} + +/*@unchecked@*/ /*@only@*/ /*@null@*/ +rpmioPool _rpmtsPool; + +static rpmts rpmtsGetPool(/*@null@*/ rpmioPool pool) + /*@globals _rpmtsPool, fileSystem, internalState @*/ + /*@modifies pool, _rpmtsPool, fileSystem, internalState @*/ +{ + rpmts ts; + + if (_rpmtsPool == NULL) { + _rpmtsPool = rpmioNewPool("ts", sizeof(*ts), -1, _rpmts_debug, + NULL, NULL, rpmtsFini); + pool = _rpmtsPool; + } + ts = (rpmts) rpmioGetPool(pool, sizeof(*ts)); + memset(((char *)ts)+sizeof(ts->_item), 0, sizeof(*ts)-sizeof(ts->_item)); + return ts; +} + +void * rpmtsGetKeyring(rpmts ts, /*@unused@*/ int autoload) +{ + rpmKeyring keyring = NULL; + if (ts) { +#ifdef NOTYET + if (ts->keyring == NULL && autoload) + loadKeyring(ts); + keyring = rpmKeyringLink(ts->keyring); +#else + keyring = ts->keyring; +#endif + } +/*@-refcounttrans@*/ + return (void *)keyring; +/*@=refcounttrans@*/ +} + +int rpmtsSetKeyring(rpmts ts, void * _keyring) +{ + rpmKeyring keyring = (rpmKeyring) _keyring; + + if (ts == NULL) + return -1; + +#ifdef NOTYET + /* + * Should we permit switching keyring on the fly? For now, require + * rpmdb isn't open yet (fairly arbitrary limitation)... + */ + if (rpmtsGetRdb(ts) != NULL) + return -1; +#endif + +/*@-modnomods@*/ + ts->keyring = rpmKeyringFree(ts->keyring); +/*@=modnomods@*/ + +#ifdef NOTYET + ts->keyring = rpmKeyringLink(keyring); +#else +/*@-assignexpose -newreftrans @*/ +/*@i@*/ ts->keyring = keyring; +/*@=assignexpose =newreftrans @*/ +#endif + + return 0; +} + +rpmVSFlags rpmtsVSFlags(/*@unused@*/ rpmts ts) +{ + return pgpDigVSFlags; +} + +rpmVSFlags rpmtsSetVSFlags(/*@unused@*/ rpmts ts, rpmVSFlags vsflags) + /*@globals pgpDigVSFlags @*/ + /*@modifies pgpDigVSFlags @*/ +{ + rpmVSFlags ovsflags; + ovsflags = pgpDigVSFlags; + pgpDigVSFlags = vsflags; + return ovsflags; +} + +/* + * This allows us to mark transactions as being of a certain type. + * The three types are: + * + * RPM_TRANS_NORMAL + * RPM_TRANS_ROLLBACK + * RPM_TRANS_AUTOROLLBACK + * + * ROLLBACK and AUTOROLLBACK transactions should always be ran as + * a best effort. In particular this is important to the autorollback + * feature to avoid rolling back a rollback (otherwise known as + * dueling rollbacks (-;). AUTOROLLBACK's additionally need instance + * counts passed to scriptlets to be altered. + */ +/* Let them know what type of transaction we are */ +rpmTSType rpmtsType(rpmts ts) +{ + return (rpmTSType) ((ts != NULL) ? ts->type : 0); +} + +void rpmtsSetType(rpmts ts, rpmTSType type) +{ + if (ts != NULL) + ts->type = type; +} + +rpmuint32_t rpmtsARBGoal(rpmts ts) +{ + return ((ts != NULL) ? ts->arbgoal : 0); +} + +void rpmtsSetARBGoal(rpmts ts, rpmuint32_t goal) +{ + if (ts != NULL) + ts->arbgoal = goal; +} + +int rpmtsUnorderedSuccessors(rpmts ts, int first) +{ + int unorderedSuccessors = 0; + if (ts != NULL) { + unorderedSuccessors = ts->unorderedSuccessors; + if (first >= 0) + ts->unorderedSuccessors = first; + } + return unorderedSuccessors; +} + +const char * rpmtsRootDir(rpmts ts) +{ + const char * rootDir = NULL; + + if (ts != NULL && ts->rootDir != NULL) { + urltype ut = urlPath(ts->rootDir, &rootDir); + switch (ut) { + case URL_IS_UNKNOWN: + case URL_IS_PATH: + break; + case URL_IS_DASH: + case URL_IS_HKP: + case URL_IS_FTP: + case URL_IS_HTTP: + case URL_IS_HTTPS: + case URL_IS_MONGO: /* XXX FIXME */ + default: + rootDir = "/"; + break; + } + } + return rootDir; +} + +void rpmtsSetRootDir(rpmts ts, const char * rootDir) +{ + if (ts != NULL) { + size_t rootLen; + + ts->rootDir = _free(ts->rootDir); + + if (rootDir == NULL) { +#ifdef DYING + ts->rootDir = xstrdup(""); +#endif + return; + } + rootLen = strlen(rootDir); + + /* Make sure that rootDir has trailing / */ + if (!(rootLen && rootDir[rootLen - 1] == '/')) { + char * t = (char *) alloca(rootLen + 2); + *t = '\0'; + (void) stpcpy( stpcpy(t, rootDir), "/"); + rootDir = t; + } + ts->rootDir = xstrdup(rootDir); + } +} + +const char * rpmtsCurrDir(rpmts ts) +{ + const char * currDir = NULL; + if (ts != NULL) { + currDir = ts->currDir; + } + return currDir; +} + +void rpmtsSetCurrDir(rpmts ts, const char * currDir) +{ + if (ts != NULL) { + ts->currDir = _free(ts->currDir); + if (currDir) + ts->currDir = xstrdup(currDir); + } +} + +FD_t rpmtsScriptFd(rpmts ts) +{ + FD_t scriptFd = NULL; + if (ts != NULL) { + scriptFd = ts->scriptFd; + } +/*@-compdef -refcounttrans -usereleased@*/ + return scriptFd; +/*@=compdef =refcounttrans =usereleased@*/ +} + +void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd) +{ + + if (ts != NULL) { + if (ts->scriptFd != NULL) { +/*@-assignexpose@*/ + ts->scriptFd = fdFree(ts->scriptFd, "rpmtsSetScriptFd"); +/*@=assignexpose@*/ + ts->scriptFd = NULL; + } +/*@-assignexpose -castexpose @*/ + if (scriptFd != NULL) + ts->scriptFd = fdLink((void *)scriptFd, "rpmtsSetScriptFd"); +/*@=assignexpose =castexpose @*/ + } +} + +int rpmtsSELinuxEnabled(rpmts ts) +{ + int selinuxEnabled = 0; + if (ts) + selinuxEnabled = (ts->selinuxEnabled > 0); + return selinuxEnabled; +} + +int rpmtsChrootDone(rpmts ts) +{ + return (ts != NULL ? ts->chrootDone : 0); +} + +int rpmtsSetChrootDone(rpmts ts, int chrootDone) +{ + int ochrootDone = 0; + if (ts != NULL) { + ochrootDone = ts->chrootDone; + if (ts->rdb != NULL) + ts->rdb->db_chrootDone = chrootDone; + ts->chrootDone = chrootDone; + } + return ochrootDone; +} + +rpmuint32_t rpmtsGetTid(rpmts ts) +{ + rpmuint32_t tid = 0; /* XXX -1 is time(2) error return. */ + if (ts != NULL) { + tid = ts->tid[0]; + } + return tid; +} + +rpmuint32_t rpmtsSetTid(rpmts ts, rpmuint32_t tid) +{ + rpmuint32_t otid = 0; /* XXX -1 is time(2) error return. */ + if (ts != NULL) { + otid = ts->tid[0]; + ts->tid[0] = tid; + ts->tid[1] = 0; + } + return otid; +} + +rpmPRCO rpmtsPRCO(rpmts ts) +{ + rpmPRCO PRCO = NULL; + + if (ts != NULL) { + static int oneshot = 0; + if (!oneshot) { + const char * fn = rpmGetPath("%{?_rpmds_sysinfo_path}", NULL); + int xx; + + ts->PRCO = rpmdsNewPRCO(NULL); + if (fn && *fn != '\0' && !rpmioAccess(fn, NULL, R_OK)) + xx = rpmdsSysinfo(ts->PRCO, NULL); + fn = _free(fn); + oneshot++; + } + PRCO = ts->PRCO; + } +/*@-compdef -retexpose -usereleased @*/ + return PRCO; +/*@=compdef =retexpose =usereleased @*/ +} + +int rpmtsInitDSI(const rpmts ts) +{ + rpmDiskSpaceInfo dsi; + struct stat sb; + int rc; + size_t i; + + if (rpmtsFilterFlags(ts) & RPMPROB_FILTER_DISKSPACE) + return 0; + if (ts->filesystems != NULL) + return 0; + + rpmlog(RPMLOG_DEBUG, D_("mounted filesystems:\n")); + rpmlog(RPMLOG_DEBUG, + D_(" i dev bsize bavail iavail mount point\n")); + + rc = rpmGetFilesystemList(&ts->filesystems, &ts->filesystemCount); + if (rc || ts->filesystems == NULL || ts->filesystemCount == 0) + return rc; + + /* Get available space on mounted file systems. */ + + ts->dsi = _free(ts->dsi); + ts->dsi = (rpmDiskSpaceInfo) xcalloc((ts->filesystemCount + 1), sizeof(*ts->dsi)); + + dsi = ts->dsi; + + if (dsi != NULL) + for (i = 0; (i < ts->filesystemCount) && dsi; i++, dsi++) { +#if STATFS_IN_SYS_STATVFS + struct statvfs sfb; + memset(&sfb, 0, sizeof(sfb)); + rc = statvfs(ts->filesystems[i], &sfb); +#else + struct statfs sfb; + memset(&sfb, 0, sizeof(sfb)); +# if STAT_STATFS4 +/* This platform has the 4-argument version of the statfs call. The last two + * should be the size of struct statfs and 0, respectively. The 0 is the + * filesystem type, and is always 0 when statfs is called on a mounted + * filesystem, as we're doing. + */ + rc = statfs(ts->filesystems[i], &sfb, sizeof(sfb), 0); +# else + rc = statfs(ts->filesystems[i], &sfb); +# endif +#endif + if (rc) + break; + + rc = stat(ts->filesystems[i], &sb); + if (rc) + break; + dsi->dev = sb.st_dev; +/* XXX figger out how to get this info for non-statvfs systems. */ +#if STATFS_IN_SYS_STATVFS + dsi->f_frsize = sfb.f_frsize; +#if defined(RPM_OS_AIX) + dsi->f_fsid = 0; /* sfb.f_fsid is a structure on AIX */ +#else + dsi->f_fsid = sfb.f_fsid; +#endif + dsi->f_flag = sfb.f_flag; + dsi->f_favail = (long long) sfb.f_favail; + dsi->f_namemax = sfb.f_namemax; +#elif defined(__APPLE__) && defined(__MACH__) && !defined(_SYS_STATVFS_H_) + dsi->f_fsid = 0; /* "Not meaningful in this implementation." */ + dsi->f_namemax = pathconf(ts->filesystems[i], _PC_NAME_MAX); +#elif defined(__OpenBSD__) + dsi->f_fsid = 0; /* sfb.f_fsid is a structure on OpenBSD */ + dsi->f_namemax = pathconf(ts->filesystems[i], _PC_NAME_MAX); +#else + dsi->f_fsid = sfb.f_fsid; + dsi->f_namemax = sfb.f_namelen; +#endif + + dsi->f_bsize = sfb.f_bsize; + dsi->f_blocks = (unsigned long long)sfb.f_blocks; + dsi->f_bfree = (unsigned long long)sfb.f_bfree; + dsi->f_files = (unsigned long long)sfb.f_files; + dsi->f_ffree = (unsigned long long)sfb.f_ffree; + + dsi->bneeded = 0; + dsi->ineeded = 0; +#ifdef STATFS_HAS_F_BAVAIL + dsi->f_bavail = (long long)(sfb.f_bavail ? sfb.f_bavail : 1); + if (sfb.f_ffree > 0 && sfb.f_files > 0 && sfb.f_favail > 0) + dsi->f_favail = (long long)sfb.f_favail; + else /* XXX who knows what evil lurks here? */ + dsi->f_favail = !(sfb.f_ffree == 0 && sfb.f_files == 0) + ? (signed long long) sfb.f_ffree : -1; +#else +/* FIXME: the statfs struct doesn't have a member to tell how many blocks are + * available for non-superusers. f_blocks - f_bfree is probably too big, but + * it's about all we can do. + */ + dsi->f_bavail = sfb.f_blocks - sfb.f_bfree; + /* XXX Avoid FAT and other file systems that have not inodes. */ + dsi->f_favail = !(sfb.f_ffree == 0 && sfb.f_files == 0) + ? sfb.f_ffree : -1; +#endif + +#if !defined(ST_RDONLY) +#define ST_RDONLY 1 +#endif + rpmlog(RPMLOG_DEBUG, "%5u 0x%08x %8u %12ld %12ld %s %s\n", + (unsigned)i, (unsigned) dsi->dev, (unsigned) dsi->f_bsize, + (signed long) dsi->f_bavail, (signed long) dsi->f_favail, + ((dsi->f_flag & ST_RDONLY) ? "ro" : "rw"), + ts->filesystems[i]); + } + return rc; +} + +void rpmtsUpdateDSI(const rpmts ts, dev_t dev, + rpmuint32_t fileSize, rpmuint32_t prevSize, rpmuint32_t fixupSize, + int _action) +{ + iosmFileAction action = (iosmFileAction) _action; + rpmDiskSpaceInfo dsi; + rpmuint64_t bneeded; + + dsi = ts->dsi; + if (dsi) { + while (dsi->f_bsize && dsi->dev != dev) + dsi++; + if (dsi->f_bsize == 0) + dsi = NULL; + } + if (dsi == NULL) + return; + + bneeded = BLOCK_ROUND(fileSize, dsi->f_bsize); + + switch (action) { + case FA_BACKUP: + case FA_SAVE: + case FA_ALTNAME: + dsi->ineeded++; + dsi->bneeded += bneeded; + /*@switchbreak@*/ break; + + /* + * FIXME: If two packages share a file (same md5sum), and + * that file is being replaced on disk, will dsi->bneeded get + * adjusted twice? Quite probably! + */ + case FA_CREATE: + dsi->bneeded += bneeded; + dsi->bneeded -= BLOCK_ROUND(prevSize, dsi->f_bsize); + /*@switchbreak@*/ break; + + case FA_ERASE: + dsi->ineeded--; + dsi->bneeded -= bneeded; + /*@switchbreak@*/ break; + + default: + /*@switchbreak@*/ break; + } + + if (fixupSize) + dsi->bneeded -= BLOCK_ROUND(fixupSize, dsi->f_bsize); +} + +void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te) +{ + rpmDiskSpaceInfo dsi; + rpmps ps; + int fc; + size_t i; + + if (ts->filesystems == NULL || ts->filesystemCount == 0) + return; + + dsi = ts->dsi; + if (dsi == NULL) + return; + fc = rpmfiFC( rpmteFI(te, RPMTAG_BASENAMES) ); + if (fc <= 0) + return; + + ps = rpmtsProblems(ts); + for (i = 0; i < ts->filesystemCount; i++, dsi++) { + + if (dsi->f_bavail > 0 && adj_fs_blocks(dsi->bneeded) > dsi->f_bavail) { + if (dsi->bneeded != dsi->obneeded) { + rpmpsAppend(ps, RPMPROB_DISKSPACE, + rpmteNEVR(te), rpmteKey(te), + ts->filesystems[i], NULL, NULL, + (adj_fs_blocks(dsi->bneeded) - dsi->f_bavail) * dsi->f_bsize); + dsi->obneeded = dsi->bneeded; + } + } + + if (dsi->f_favail > 0 && adj_fs_blocks(dsi->ineeded) > dsi->f_favail) { + if (dsi->ineeded != dsi->oineeded) { + rpmpsAppend(ps, RPMPROB_DISKNODES, + rpmteNEVR(te), rpmteKey(te), + ts->filesystems[i], NULL, NULL, + (adj_fs_blocks(dsi->ineeded) - dsi->f_favail)); + dsi->oineeded = dsi->ineeded; + } + } + + if ((dsi->bneeded || dsi->ineeded) && (dsi->f_flag & ST_RDONLY)) { + rpmpsAppend(ps, RPMPROB_RDONLY, + rpmteNEVR(te), rpmteKey(te), + ts->filesystems[i], NULL, NULL, 0); + } + } + ps = rpmpsFree(ps); +} + +void * rpmtsNotify(rpmts ts, rpmte te, + rpmCallbackType what, rpmuint64_t amount, rpmuint64_t total) +{ + void * ptr = NULL; + if (ts && ts->notify) { + Header h; + fnpyKey cbkey; + /*@-type@*/ /* FIX: cast? */ + /*@-noeffectuncon @*/ /* FIX: check rc */ + if (te) { +/*@-castexpose -mods@*/ /* XXX noisy in transaction.c */ + h = headerLink(te->h); +/*@=castexpose =mods@*/ + cbkey = rpmteKey(te); + } else { + h = NULL; + cbkey = NULL; + } + ptr = ts->notify(h, what, amount, total, cbkey, ts->notifyData); + (void)headerFree(h); + h = NULL; + /*@=noeffectuncon @*/ + /*@=type@*/ + } + return ptr; +} + +int rpmtsNElements(rpmts ts) +{ + int nelements = 0; + if (ts != NULL && ts->order != NULL) { + nelements = ts->orderCount; + } + return nelements; +} + +rpmte rpmtsElement(rpmts ts, int ix) +{ + rpmte te = NULL; + if (ts != NULL && ts->order != NULL) { + if (ix >= 0 && ix < ts->orderCount) + te = ts->order[ix]; + } + /*@-compdef@*/ + return te; + /*@=compdef@*/ +} + +rpmprobFilterFlags rpmtsFilterFlags(rpmts ts) +{ + return (rpmprobFilterFlags) (ts != NULL ? ts->ignoreSet : 0); +} + +rpmtransFlags rpmtsFlags(rpmts ts) +{ + rpmtransFlags transFlags = (rpmtransFlags)0; + if (ts != NULL) { + transFlags = ts->transFlags; + if (rpmtsSELinuxEnabled(ts) > 0) + transFlags = (rpmtransFlags)(transFlags & ~RPMTRANS_FLAG_NOCONTEXTS); + else + transFlags = (rpmtransFlags)(transFlags | RPMTRANS_FLAG_NOCONTEXTS); + } + return transFlags; +} + +rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags) +{ + rpmtransFlags otransFlags = (rpmtransFlags) 0; + if (ts != NULL) { + otransFlags = ts->transFlags; + if (rpmtsSELinuxEnabled(ts) > 0) + transFlags = (rpmtransFlags) + (transFlags & ~RPMTRANS_FLAG_NOCONTEXTS); + else + transFlags = (rpmtransFlags) + (transFlags | RPMTRANS_FLAG_NOCONTEXTS); + ts->transFlags = transFlags; + } + return otransFlags; +} + +rpmdepFlags rpmtsDFlags(rpmts ts) +{ + return (rpmdepFlags) (ts != NULL ? ts->depFlags : 0); +} + +rpmdepFlags rpmtsSetDFlags(rpmts ts, rpmdepFlags depFlags) +{ + rpmdepFlags odepFlags = (rpmdepFlags) 0; + if (ts != NULL) { + odepFlags = ts->depFlags; + ts->depFlags = depFlags; + } + return odepFlags; +} + +Spec rpmtsSpec(rpmts ts) +{ +/*@-compdef -retexpose -usereleased@*/ + return ts->spec; +/*@=compdef =retexpose =usereleased@*/ +} + +Spec rpmtsSetSpec(rpmts ts, Spec spec) +{ + Spec ospec = ts->spec; +/*@-assignexpose -temptrans@*/ + ts->spec = spec; +/*@=assignexpose =temptrans@*/ + return ospec; +} + +rpmte rpmtsRelocateElement(rpmts ts) +{ +/*@-compdef -retexpose -usereleased@*/ + return ts->relocateElement; +/*@=compdef =retexpose =usereleased@*/ +} + +rpmte rpmtsSetRelocateElement(rpmts ts, rpmte relocateElement) +{ + rpmte orelocateElement = ts->relocateElement; +/*@-assignexpose -temptrans@*/ + ts->relocateElement = relocateElement; +/*@=assignexpose =temptrans@*/ + return orelocateElement; +} + +tsmStage rpmtsGoal(rpmts ts) +{ + return (ts != NULL ? ts->goal : TSM_UNKNOWN); +} + +tsmStage rpmtsSetGoal(rpmts ts, tsmStage goal) +{ + tsmStage ogoal = TSM_UNKNOWN; + if (ts != NULL) { + ogoal = ts->goal; + ts->goal = goal; + } + return ogoal; +} + +int rpmtsDBMode(rpmts ts) +{ + return (ts != NULL ? ts->dbmode : 0); +} + +int rpmtsSetDBMode(rpmts ts, int dbmode) +{ + int odbmode = 0; + if (ts != NULL) { + odbmode = ts->dbmode; + ts->dbmode = dbmode; + } + return odbmode; +} + +rpmuint32_t rpmtsColor(rpmts ts) +{ + return (ts != NULL ? ts->color : 0); +} + +rpmuint32_t rpmtsSetColor(rpmts ts, rpmuint32_t color) +{ + rpmuint32_t ocolor = 0; + if (ts != NULL) { + ocolor = ts->color; + ts->color = color; + } + return ocolor; +} + +rpmuint32_t rpmtsPrefColor(rpmts ts) +{ + return (ts != NULL ? ts->prefcolor : 0); +} + +int rpmtsSetNotifyCallback(rpmts ts, + rpmCallbackFunction notify, rpmCallbackData notifyData) +{ + if (ts != NULL) { + ts->notify = notify; + ts->notifyData = notifyData; + } + return 0; +} + +rpmts rpmtsCreate(void) +{ + rpmts ts = rpmtsGetPool(_rpmtsPool); + int xx; + + memset(&ts->ops, 0, sizeof(ts->ops)); + (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_TOTAL), -1); + ts->type = RPMTRANS_TYPE_NORMAL; + ts->goal = TSM_UNKNOWN; + ts->filesystemCount = 0; + ts->filesystems = NULL; + ts->dsi = NULL; + + ts->solve = rpmtsSolve; + ts->solveData = NULL; + ts->nsuggests = 0; + ts->suggests = NULL; + + ts->PRCO = NULL; + + ts->bag = NULL; + + ts->rdb = NULL; + ts->dbmode = O_RDONLY; + ts->txn = NULL; + + ts->scriptFd = NULL; + { struct timeval tv; + xx = gettimeofday(&tv, NULL); + ts->tid[0] = (rpmuint32_t) tv.tv_sec; + ts->tid[1] = (rpmuint32_t) tv.tv_usec; + } + ts->delta = 5; + + ts->color = rpmExpandNumeric("%{?_transaction_color}"); + ts->prefcolor = rpmExpandNumeric("%{?_prefer_color}"); + if (!ts->prefcolor) ts->prefcolor = 0x2; + + ts->rbf = NULL; + ts->numRemovedPackages = 0; + ts->allocedRemovedPackages = ts->delta; + ts->removedPackages = (uint32_t *) xcalloc(ts->allocedRemovedPackages, + sizeof(*ts->removedPackages)); + + ts->rootDir = NULL; + ts->currDir = NULL; + ts->chrootDone = 0; + + ts->selinuxEnabled = rpmsxEnabled(NULL); + + ts->numAddedPackages = 0; + ts->addedPackages = NULL; + + ts->numErasedPackages = 0; + ts->erasedPackages = NULL; + + ts->numAvailablePackages = 0; + ts->availablePackages = NULL; + + ts->orderAlloced = 0; + ts->orderCount = 0; + ts->order = NULL; + ts->ntrees = 0; + ts->maxDepth = 0; + + ts->probs = NULL; + + ts->keyring = NULL; + ts->hkp = NULL; + ts->dig = NULL; + + /* Set autorollback goal to the end of time. */ + ts->arbgoal = 0xffffffff; + + return rpmtsLink(ts, "tsCreate"); +} diff --git a/rpm-5.4.9/lib/rpmts.h b/rpm-5.4.9/lib/rpmts.h new file mode 100644 index 0000000..0c52564 --- /dev/null +++ b/rpm-5.4.9/lib/rpmts.h @@ -0,0 +1,1157 @@ +#ifndef H_RPMTS +#define H_RPMTS + +/** \ingroup rpmts + * \file lib/rpmts.h + * Structures and prototypes used for an "rpmts" transaction set. + */ + +#include "rpmps.h" +#include "rpmsw.h" +#include /* XXX pgpVSFlags */ +#if defined(_RPMTS_INTERNAL) +#include +#endif + +/*@-exportlocal@*/ +/*@unchecked@*/ +extern int _rpmts_debug; +/*@unchecked@*/ +extern int _rpmts_macros; +/*@unchecked@*/ +extern int _rpmts_stats; +/*@unchecked@*/ +extern int _fps_debug; +/*@=exportlocal@*/ + +/** \ingroup rpmts + * Bit(s) to control digest and signature verification. + */ +typedef pgpVSFlags rpmVSFlags; + +/** \ingroup rpmts + * Bit(s) to control rpmtsCheck() and rpmtsOrder() operation. + * @todo Move to rpmts.h. + */ +typedef enum rpmdepFlags_e { + RPMDEPS_FLAG_NONE = 0, + RPMDEPS_FLAG_NOUPGRADE = (1 << 0), /*!< from --noupgrade */ + RPMDEPS_FLAG_NOREQUIRES = (1 << 1), /*!< from --norequires */ + RPMDEPS_FLAG_NOCONFLICTS = (1 << 2), /*!< from --noconflicts */ + RPMDEPS_FLAG_NOOBSOLETES = (1 << 3), /*!< from --noobsoletes */ + RPMDEPS_FLAG_NOPARENTDIRS = (1 << 4), /*!< from --noparentdirs */ + RPMDEPS_FLAG_NOLINKTOS = (1 << 5), /*!< from --nolinktos */ + RPMDEPS_FLAG_ANACONDA = (1 << 6), /*!< from --anaconda */ + RPMDEPS_FLAG_NOSUGGEST = (1 << 7), /*!< from --nosuggest */ + RPMDEPS_FLAG_ADDINDEPS = (1 << 8), /*!< from --aid */ + RPMDEPS_FLAG_DEPLOOPS = (1 << 9) /*!< from --deploops */ +} rpmdepFlags; + +/** \ingroup rpmts + * Bit(s) to control rpmtsRun() operation. + * @todo Move to rpmts.h. + */ +typedef enum rpmtransFlags_e { + RPMTRANS_FLAG_NONE = 0, + RPMTRANS_FLAG_TEST = (1 << 0), /*!< from --test */ + RPMTRANS_FLAG_BUILD_PROBS = (1 << 1), /*!< don't process payload */ + RPMTRANS_FLAG_NOSCRIPTS = (1 << 2), /*!< from --noscripts */ + RPMTRANS_FLAG_JUSTDB = (1 << 3), /*!< from --justdb */ + RPMTRANS_FLAG_NOTRIGGERS = (1 << 4), /*!< from --notriggers */ + RPMTRANS_FLAG_NODOCS = (1 << 5), /*!< from --excludedocs */ + RPMTRANS_FLAG_ALLFILES = (1 << 6), /*!< from --allfiles */ + /* 7 unused */ + RPMTRANS_FLAG_NOCONTEXTS = (1 << 8), /*!< from --nocontexts */ + RPMTRANS_FLAG_DIRSTASH = (1 << 9), /*!< from --dirstash */ + RPMTRANS_FLAG_REPACKAGE = (1 << 10), /*!< from --repackage */ + + RPMTRANS_FLAG_PKGCOMMIT = (1 << 11), +/*@-enummemuse@*/ + RPMTRANS_FLAG_PKGUNDO = (1 << 12), +/*@=enummemuse@*/ + RPMTRANS_FLAG_COMMIT = (1 << 13), +/*@-enummemuse@*/ + RPMTRANS_FLAG_UNDO = (1 << 14), +/*@=enummemuse@*/ + RPMTRANS_FLAG_APPLYONLY = (1 << 15), + + RPMTRANS_FLAG_NOTRIGGERPREIN= (1 << 16), /*!< from --notriggerprein */ + RPMTRANS_FLAG_NOPRE = (1 << 17), /*!< from --nopre */ + RPMTRANS_FLAG_NOPOST = (1 << 18), /*!< from --nopost */ + RPMTRANS_FLAG_NOTRIGGERIN = (1 << 19), /*!< from --notriggerin */ + RPMTRANS_FLAG_NOTRIGGERUN = (1 << 20), /*!< from --notriggerun */ + RPMTRANS_FLAG_NOPREUN = (1 << 21), /*!< from --nopreun */ + RPMTRANS_FLAG_NOPOSTUN = (1 << 22), /*!< from --nopostun */ + RPMTRANS_FLAG_NOTRIGGERPOSTUN = (1 << 23), /*!< from --notriggerpostun */ +/*@-enummemuse@*/ + RPMTRANS_FLAG_NOPAYLOAD = (1 << 24), +/*@=enummemuse@*/ + RPMTRANS_FLAG_NORPMDB = (1 << 25), /*!< from --norpmdb */ + RPMTRANS_FLAG_NOPOLICY = (1 << 26), /*!< from --nopolicy */ + RPMTRANS_FLAG_NOFDIGESTS = (1 << 27), /*!< from --nofdigests */ + RPMTRANS_FLAG_NOPRETRANS = (1 << 28), /*!< from --nopretrans */ + RPMTRANS_FLAG_NOPOSTTRANS = (1 << 29), /*!< from --noposttrans */ + RPMTRANS_FLAG_NOCONFIGS = (1 << 30) /*!< from --noconfigs */ + /* 31 unused */ +} rpmtransFlags; + +#define _noTransScripts \ + ( RPMTRANS_FLAG_NOPRETRANS | \ + RPMTRANS_FLAG_NOPRE | \ + RPMTRANS_FLAG_NOPOST | \ + RPMTRANS_FLAG_NOPREUN | \ + RPMTRANS_FLAG_NOPOSTUN | \ + RPMTRANS_FLAG_NOPOSTTRANS \ + ) + +#define _noTransTriggers \ + ( RPMTRANS_FLAG_NOTRIGGERPREIN | \ + RPMTRANS_FLAG_NOTRIGGERIN | \ + RPMTRANS_FLAG_NOTRIGGERUN | \ + RPMTRANS_FLAG_NOTRIGGERPOSTUN \ + ) + +/** \ingroup rpmts + * Indices for timestamps. + */ +typedef enum rpmtsOpX_e { + RPMTS_OP_TOTAL = 0, + RPMTS_OP_CHECK = 1, + RPMTS_OP_ORDER = 2, + RPMTS_OP_FINGERPRINT = 3, + RPMTS_OP_REPACKAGE = 4, + RPMTS_OP_INSTALL = 5, + RPMTS_OP_ERASE = 6, + RPMTS_OP_SCRIPTLETS = 7, + RPMTS_OP_COMPRESS = 8, + RPMTS_OP_UNCOMPRESS = 9, + RPMTS_OP_DIGEST = 10, + RPMTS_OP_SIGNATURE = 11, + RPMTS_OP_DBADD = 12, + RPMTS_OP_DBREMOVE = 13, + RPMTS_OP_DBGET = 14, + RPMTS_OP_DBPUT = 15, + RPMTS_OP_DBDEL = 16, + RPMTS_OP_READHDR = 17, + RPMTS_OP_HDRLOAD = 18, + RPMTS_OP_HDRGET = 19, + RPMTS_OP_DEBUG = 20, + RPMTS_OP_MAX = 20 +} rpmtsOpX; + +/** \ingroup rpmts + * Transaction Types + */ +typedef enum rpmTSType_e { + RPMTRANS_TYPE_NORMAL = 0, + RPMTRANS_TYPE_ROLLBACK = (1 << 0), + RPMTRANS_TYPE_AUTOROLLBACK = (1 << 1) +} rpmTSType; + +/** \ingroup rpmts + */ +typedef enum tsStage_e { + TSM_UNKNOWN = 0, + TSM_INSTALL = 7, + TSM_ERASE = 8 +} tsmStage; + +#if defined(_RPMTS_INTERNAL) + +#include +#include "rpmhash.h" /* XXX hashTable */ +#include "rpmkeyring.h" +#include +#include "rpmal.h" /* XXX availablePackage/relocateFileList ,*/ + +/*@unchecked@*/ +/*@-exportlocal@*/ +extern int _cacheDependsRC; +/*@=exportlocal@*/ + +/** \ingroup rpmts + */ +typedef /*@abstract@*/ struct diskspaceInfo_s * rpmDiskSpaceInfo; + +/** \ingroup rpmts + * An internal copy of (linux) struct statvfs for portability, with extensions. + */ +struct diskspaceInfo_s { + unsigned long f_bsize; /*!< File system block size. */ + unsigned long f_frsize; /*!< File system fragment size. */ + unsigned long long f_blocks;/*!< File system size (in frsize units). */ + unsigned long long f_bfree; /*!< No. of free blocks. */ + signed long long f_bavail; /*!< No. of blocks available to non-root. */ + unsigned long long f_files; /*!< No. of inodes. */ + unsigned long long f_ffree; /*!< No. of free inodes. */ + signed long long f_favail; /*!< No. of inodes available to non-root. */ + unsigned long f_fsid; /*!< File system id. */ + unsigned long f_flag; /*!< Mount flags. */ + unsigned long f_namemax; /*!< Maximum filename length. */ + + signed long long bneeded; /*!< No. of blocks needed. */ + signed long long ineeded; /*!< No. of inodes needed. */ + signed long long obneeded; /*!< Bookkeeping to avoid duplicate reports. */ + signed long long oineeded; /*!< Bookkeeping to avoid duplicate reports. */ + dev_t dev; /*!< File system device number. */ +}; + +/** \ingroup rpmts + * Adjust for root only reserved space. On linux e2fs, this is 5%. + */ +#define adj_fs_blocks(_nb) (((_nb) * 21) / 20) + +#define BLOCK_ROUND(size, block) (((size) + (block) - 1) / (block)) + +/** \ingroup rpmts + * The set of packages to be installed/removed atomically. + */ +struct rpmts_s { + struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ + rpmdepFlags depFlags; /*!< Bit(s) to control rpmtsCheck(). */ + rpmtransFlags transFlags; /*!< Bit(s) to control rpmtsRun(). */ + tsmStage goal; /*!< Transaction goal (i.e. mode) */ + rpmTSType type; /*!< default, rollback, autorollback */ + +/*@refcounted@*/ /*@null@*/ + rpmbag bag; /*!< Solve store collection. */ +/*@null@*/ + int (*solve) (rpmts ts, rpmds key, const void * data) + /*@modifies ts @*/; /*!< Search for NEVRA key. */ +/*@relnull@*/ + const void * solveData; /*!< Solve callback data */ + int nsuggests; /*!< No. of depCheck suggestions. */ +/*@only@*/ /*@null@*/ + const void ** suggests; /*!< Possible depCheck suggestions. */ + +/*@observer@*/ /*@null@*/ + rpmCallbackFunction notify; /*!< Callback function. */ +/*@observer@*/ /*@null@*/ + rpmCallbackData notifyData; /*!< Callback private data. */ + +/*@null@*/ + rpmPRCO PRCO; /*!< Current transaction dependencies. */ + +/*@refcounted@*/ /*@null@*/ + rpmps probs; /*!< Current problems in transaction. */ + rpmprobFilterFlags ignoreSet; + /*!< Bits to filter current problems. */ + + rpmuint32_t filesystemCount;/*!< No. of mounted filesystems. */ +/*@dependent@*/ /*@null@*/ + const char ** filesystems; /*!< Mounted filesystem names. */ +/*@only@*/ /*@relnull@*/ + rpmDiskSpaceInfo dsi; /*!< Per filesystem disk/inode usage. */ + +/*@refcounted@*/ /*@null@*/ + rpmdb rdb; /*!< Install database handle. */ + int dbmode; /*!< Install database open mode. */ +/*@only@*/ + hashTable ht; /*!< Fingerprint hash table. */ +/*@null@*/ + rpmtxn txn; /*!< Transaction set transaction pointer. */ + +/*@refcounted@*/ /*@null@*/ + rpmbf rbf; /*!< Removed packages Bloom filter. */ +/*@only@*/ /*@null@*/ + uint32_t * removedPackages; /*!< Set of packages being removed. */ + int numRemovedPackages; /*!< No. removed package instances. */ + int allocedRemovedPackages; /*!< Size of removed packages array. */ + +/*@only@*/ + rpmal addedPackages; /*!< Set of packages being installed. */ + int numAddedPackages; /*!< No. added package instances. */ + int numAddedFiles; /*!< No. of files in added packages. */ + +/*@only@*/ + rpmal erasedPackages; /*!< Set of packages being erased. */ + int numErasedPackages; /*!< No. erased package instances. */ + int numErasedFiles; /*!< No. of files in erased packages. */ + +#ifndef DYING +/*@only@*/ + rpmal availablePackages; /*!< Universe of available packages. */ + int numAvailablePackages; /*!< No. available package instances. */ +#endif + +/*@null@*/ + rpmte relocateElement; /*!< Element to use when relocating packages. */ + +/*@owned@*/ /*@relnull@*/ + rpmte * order; /*!< Packages sorted by dependencies. */ + int orderCount; /*!< No. of transaction elements. */ + int orderAlloced; /*!< No. of allocated transaction elements. */ + int unorderedSuccessors; /*!< Index of 1st element of successors. */ + int ntrees; /*!< No. of dependency trees. */ + int maxDepth; /*!< Maximum depth of dependency tree(s). */ + +/*@dependent@*/ /*@relnull@*/ + rpmte teInstall; /*!< current rpmtsAddInstallElement element. */ +/*@dependent@*/ /*@relnull@*/ + rpmte teErase; /*!< current rpmtsAddEraseElement element. */ + + int selinuxEnabled; /*!< Is SE linux enabled? */ + int chrootDone; /*!< Has chroot(2) been been done? */ +/*@only@*/ /*@null@*/ + const char * rootDir; /*!< Path to top of install tree. */ +/*@only@*/ /*@null@*/ + const char * currDir; /*!< Current working directory. */ +/*@null@*/ + FD_t scriptFd; /*!< Scriptlet stdout/stderr. */ + int delta; /*!< Delta for reallocation. */ + rpmuint32_t tid[2]; /*!< Transaction id. */ + + rpmuint32_t color; /*!< Transaction color bits. */ + rpmuint32_t prefcolor; /*!< Preferred file color. */ + +/*@observer@*/ /*@dependent@*/ /*@null@*/ + const char * fn; /*!< Current package fn. */ + +/*@refcounted@*/ /*@relnull@*/ + rpmKeyring keyring; /*!< Keyring in use. */ +/*@relnull@*/ + void * hkp; /*!< Pubkey validation container. */ + + struct rpmop_s ops[RPMTS_OP_MAX]; + +/*@refcounted@*/ /*@relnull@*/ + pgpDig dig; /*!< Current signature/pubkey parameters. */ + +/*@null@*/ + Spec spec; /*!< Spec file control structure. */ + + rpmuint32_t arbgoal; /*!< Autorollback goal */ + +#if defined(__LCLINT__) +/*@refs@*/ + int nrefs; /*!< (unused) keep splint happy */ +#endif +}; +#endif /* _RPMTS_INTERNAL */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \ingroup rpmts + * Perform dependency resolution on the transaction set. + * + * Any problems found by rpmtsCheck() can be examined by retrieving the + * problem set with rpmtsProblems(), success here only means that + * the resolution was successfully attempted for all packages in the set. + * + * @param ts transaction set + * @return 0 = deps ok, 1 = dep problems, 2 = error + */ +extern int (*rpmtsCheck) (rpmts ts) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; +int _rpmtsCheck(rpmts ts) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmts + * Determine package order in a transaction set according to dependencies. + * + * Order packages, returning error if circular dependencies cannot be + * eliminated by removing Requires's from the loop(s). Only dependencies from + * added or removed packages are used to determine ordering using a + * topological sort (Knuth vol. 1, p. 262). Use rpmtsCheck() to verify + * that all dependencies can be resolved. + * + * The final order ends up as installed packages followed by removed packages, + * with packages removed for upgrades immediately following the new package + * to be installed. + * + * @param ts transaction set + * @return no. of (added) packages that could not be ordered + */ +extern int (*rpmtsOrder) (rpmts ts) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; +int _rpmtsOrder(rpmts ts) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; +int _orgrpmtsOrder(rpmts ts) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmts + * Process all package elements in a transaction set. Before calling + * rpmtsRun be sure to have: + * + * - setup the rpm root dir via rpmtsSetRootDir(). + * - setup the rpm notify callback via rpmtsSetNotifyCallback(). + * - setup the rpm transaction flags via rpmtsSetFlags(). + * + * Additionally, though not required you may want to: + * + * - setup the rpm verify signature flags via rpmtsSetVSFlags(). + * + * @param ts transaction set + * @param okProbs previously known problems (or NULL) + * @param ignoreSet bits to filter problem types + * @return 0 on success, -1 on error, >0 with newProbs set + */ +extern int (*rpmtsRun) (rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; +int _rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmts + * Rollback a failed transaction. + * @param rbts failed transaction set + * @param ignoreSet problems to ignore + * @param running partial transaction? + * @param rbte failed transaction element + * @return RPMRC_OK, or RPMRC_FAIL + */ +rpmRC rpmtsRollback(rpmts rbts, rpmprobFilterFlags ignoreSet, + int running, rpmte rbte) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies rbts, rbte, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmts + * Unreference a transaction instance. + * @param ts transaction set + * @param msg + * @return NULL on last dereference + */ +/*@unused@*/ /*@null@*/ +rpmts rpmtsUnlink (/*@killref@*/ /*@only@*/ rpmts ts, + const char * msg) + /*@modifies ts @*/; +#define rpmtsUnlink(_ts, _msg) \ + ((rpmts) rpmioUnlinkPoolItem((rpmioItem)(_ts), _msg, __FILE__, __LINE__)) + +/** \ingroup rpmts + * Reference a transaction set instance. + * @param ts transaction set + * @param msg + * @return new transaction set reference + */ +/*@unused@*/ /*@newref@*/ +rpmts rpmtsLink (rpmts ts, const char * msg) + /*@modifies ts @*/; +#define rpmtsLink(_ts, _msg) \ + ((rpmts) rpmioLinkPoolItem((rpmioItem)(_ts), _msg, __FILE__, __LINE__)) + +/** \ingroup rpmts + * Close the database used by the transaction. + * @param ts transaction set + * @return 0 on success + */ +int rpmtsCloseDB(rpmts ts) + /*@globals fileSystem @*/ + /*@modifies ts, fileSystem @*/; + +/** \ingroup rpmts + * Open the database used by the transaction. + * @param ts transaction set + * @param dbmode O_RDONLY or O_RDWR + * @return 0 on success + */ +int rpmtsOpenDB(rpmts ts, int dbmode) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmts + * Initialize the database used by the transaction. + * @deprecated An explicit rpmdbInit() is never needed. + * @param ts transaction set + * @param dbmode O_RDONLY or O_RDWR + * @return 0 on success + */ +static inline /*@unused@*/ +int rpmtsInitDB(/*@unused@*/ rpmts ts, /*@unused@*/ int dbmode) + /*@*/ +{ + return -1; +} + +/** \ingroup rpmts + * Rebuild the database used by the transaction. + * @param ts transaction set + * @return 0 on success + */ +int rpmtsRebuildDB(rpmts ts) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmts + * Verify the database used by the transaction. + * @deprecated Use included standalone db_verify(1) utility instead. + * @param ts transaction set + * @return 0 on success + */ +static inline /*@unused@*/ +int rpmtsVerifyDB(/*@unused@*/ rpmts ts) + /*@*/ +{ + return -1; +} + +/** \ingroup rpmts + * Return transaction database iterator. + * @param ts transaction set + * @param rpmtag rpm tag + * @param keyp key data (NULL for sequential access) + * @param keylen key data length (0 will use strlen(keyp)) + * @return NULL on failure + */ +/*@only@*/ /*@null@*/ +rpmmi rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, + /*@null@*/ const void * keyp, size_t keylen) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmts + * Retrieve pubkey from rpm database. + * @param ts rpm transaction + * @param _dig container (NULL uses rpmtsDig(ts) instead). + * @return RPMRC_OK on success, RPMRC_NOKEY if not found + */ +/*@-exportlocal@*/ +rpmRC rpmtsFindPubkey(rpmts ts, /*@null@*/ void * _dig) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, _dig, rpmGlobalMacroContext, fileSystem, internalState */; +/*@=exportlocal@*/ + +/** \ingroup rpmts + * Close the database used by the transaction to solve dependencies. + * @param ts transaction set + * @return 0 on success + */ +/*@-exportlocal@*/ +int rpmtsCloseSDB(rpmts ts) + /*@globals fileSystem @*/ + /*@modifies ts, fileSystem @*/; +/*@=exportlocal@*/ + +/** \ingroup rpmts + * Open the database used by the transaction to solve dependencies. + * @param ts transaction set + * @param dbmode O_RDONLY or O_RDWR + * @return 0 on success + */ +/*@-exportlocal@*/ +int rpmtsOpenSDB(rpmts ts, int dbmode) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; +/*@=exportlocal@*/ + +/** \ingroup rpmts + * Attempt to solve a needed dependency using the solve database. + * @param ts transaction set + * @param ds dependency set + * @param data opaque data associated with callback + * @return -1 retry, 0 ignore, 1 not found + */ +/*@-exportlocal@*/ +int rpmtsSolve(rpmts ts, rpmds ds, const void * data) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; +/*@=exportlocal@*/ + +/** \ingroup rpmts + * Attempt to solve a needed dependency using memory resident tables. + * @deprecated This function will move from rpmlib to the python bindings. + * @param ts transaction set + * @param ds dependency set + * @return 0 if resolved (and added to ts), 1 not found + */ +/*@unused@*/ +int rpmtsAvailable(rpmts ts, const rpmds ds) + /*@globals fileSystem, internalState @*/ + /*@modifies ts, fileSystem, internalState @*/; + +/** \ingroup rpmts + * Set dependency solver callback. + * @param ts transaction set + * @param (*solve) dependency solver callback + * @param solveData dependency solver callback data (opaque) + * @return 0 on success + */ +int rpmtsSetSolveCallback(rpmts ts, + int (*solve) (rpmts ts, rpmds ds, const void * data), + const void * solveData) + /*@modifies ts @*/; + +/** \ingroup rpmts + * Return the type of a transaction. + * @param ts transaction set + * @return transaction type, 0 on unknown + */ +rpmTSType rpmtsType(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Set transaction type. + * Allowed types are: + * RPMTRANS_TYPE_NORMAL + * RPMTRANS_TYPE_ROLLBACK + * RPMTRANS_TYPE_AUTOROLLBACK + * + * @param ts transaction set + * @param type transaction type + */ +void rpmtsSetType(rpmts ts, rpmTSType type) + /*@modifies ts @*/; + +/** \ingroup rpmts + * Return the autorollback goal. + * @param ts transaction set + * @return autorollback goal + */ +rpmuint32_t rpmtsARBGoal(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Set autorollback goal. + * @param ts transaction set + * @param goal autorollback goal + */ +void rpmtsSetARBGoal(rpmts ts, rpmuint32_t goal) + /*@modifies ts @*/; + +/** \ingroup rpmts + * Return current transaction set problems. + * @param ts transaction set + * @return current problem set (or NULL) + */ +/*@null@*/ +rpmps rpmtsProblems(rpmts ts) + /*@modifies ts @*/; + +/** \ingroup rpmts + * Free signature verification data. + * @param ts transaction set + */ +void rpmtsCleanDig(rpmts ts) + /*@globals fileSystem @*/ + /*@modifies ts, fileSystem @*/; + +/** \ingroup rpmts + * Free memory needed only for dependency checks and ordering. + * @param ts transaction set + */ +void rpmtsClean(rpmts ts) + /*@globals fileSystem, internalState @*/ + /*@modifies ts, fileSystem , internalState@*/; + +/** \ingroup rpmts + * Re-create an empty transaction set. + * @param ts transaction set + */ +void rpmtsEmpty(rpmts ts) + /*@globals fileSystem, internalState @*/ + /*@modifies ts, fileSystem, internalState @*/; + +/** \ingroup rpmts + * Destroy transaction set, closing the database as well. + * @param ts transaction set + * @return NULL on last dereference + */ +/*@null@*/ +rpmts rpmtsFree(/*@killref@*/ /*@null@*/ rpmts ts) + /*@globals fileSystem, internalState @*/ + /*@modifies ts, fileSystem, internalState @*/; +#define rpmtsFree(_ts) \ + ((rpmts) rpmioFreePoolItem((rpmioItem)(_ts), __FUNCTION__, __FILE__, __LINE__)) + +/** \ingroup rpmts + * Get transaction keyring. + * @param ts transaction set + * @param autoload Should keyring be loaded? (unimplmented) + * @return transaction keyring + */ +void * rpmtsGetKeyring(rpmts ts, int autoload) + /*@*/; + +/** \ingroup rpmts + * Set transaction keyring. + * @param ts transaction set + * @param _keyring new transaction keyring + * @return 0 on success + */ +int rpmtsSetKeyring(rpmts ts, void * _keyring) + /*modifies ts, _keyring @*/; + +/** \ingroup rpmts + * Get verify signatures flag(s). + * @param ts transaction set + * @return verify signatures flags + */ +rpmVSFlags rpmtsVSFlags(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Set verify signatures flag(s). + * @param ts transaction set + * @param vsflags new verify signatures flags + * @return previous value + */ +rpmVSFlags rpmtsSetVSFlags(rpmts ts, rpmVSFlags vsflags) + /*@modifies ts @*/; + +/** \ingroup rpmts + * Set index of 1st element of successors. + * @param ts transaction set + * @param first new index of 1st element of successors + * @return previous value + */ +int rpmtsUnorderedSuccessors(rpmts ts, int first) + /*@modifies ts @*/; + +/** \ingroup rpmts + * Get transaction rootDir, i.e. path to chroot(2). + * @param ts transaction set + * @return transaction rootDir + */ +/*@observer@*/ /*@null@*/ +extern const char * rpmtsRootDir(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Set transaction rootDir, i.e. path to chroot(2). + * @param ts transaction set + * @param rootDir new transaction rootDir (or NULL) + */ +void rpmtsSetRootDir(rpmts ts, /*@null@*/ const char * rootDir) + /*@modifies ts @*/; + +/** \ingroup rpmts + * Get transaction currDir, i.e. current directory before chroot(2). + * @param ts transaction set + * @return transaction currDir + */ +/*@observer@*/ /*@null@*/ +extern const char * rpmtsCurrDir(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Set transaction currDir, i.e. current directory before chroot(2). + * @param ts transaction set + * @param currDir new transaction currDir (or NULL) + */ +void rpmtsSetCurrDir(rpmts ts, /*@null@*/ const char * currDir) + /*@modifies ts @*/; + +#if defined(_RPMTS_INTERNAL) /* XXX avoid FD_t in API. */ +/** \ingroup rpmts + * Get transaction script file handle, i.e. stdout/stderr on scriptlet execution + * @param ts transaction set + * @return transaction script file handle + */ +/*@null@*/ +FD_t rpmtsScriptFd(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Set transaction script file handle, i.e. stdout/stderr on scriptlet execution + * @param ts transaction set + * @param scriptFd new script file handle (or NULL) + */ +void rpmtsSetScriptFd(rpmts ts, /*@null@*/ FD_t scriptFd) + /*@globals fileSystem @*/ + /*@modifies ts, scriptFd, fileSystem @*/; +#endif + +/** \ingroup rpmts + * Get selinuxEnabled flag, i.e. is SE linux enabled? + * @param ts transaction set + * @return selinuxEnabled flag + */ +int rpmtsSELinuxEnabled(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Get chrootDone flag, i.e. has chroot(2) been performed? + * @param ts transaction set + * @return chrootDone flag + */ +int rpmtsChrootDone(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Set chrootDone flag, i.e. has chroot(2) been performed? + * @param ts transaction set + * @param chrootDone new chrootDone flag + * @return previous chrootDone flag + */ +int rpmtsSetChrootDone(rpmts ts, int chrootDone) + /*@modifies ts @*/; + +/** \ingroup rpmts + * Get transaction id, i.e. transaction time stamp. + * @param ts transaction set + * @return transaction id + */ +rpmuint32_t rpmtsGetTid(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Set transaction id, i.e. transaction time stamp. + * @param ts transaction set + * @param tid new transaction id + * @return previous transaction id + */ +rpmuint32_t rpmtsSetTid(rpmts ts, rpmuint32_t tid) + /*@modifies ts @*/; + +/** \ingroup rpmts + * Get OpenPGP packet parameters, i.e. signature/pubkey constants. + * @param ts transaction set + * @return signature/pubkey constants. + */ +pgpDig rpmtsDig(rpmts ts) + /*@globals fileSystem @*/ + /*@modifies fileSystem @*/; + +/** \ingroup rpmts + * Return OpenPGP pubkey constants. + * @param ts transaction set + * @return pubkey constants. + */ +/*@-exportlocal@*/ +/*@exposed@*/ /*@null@*/ +pgpDigParams rpmtsPubkey(const rpmts ts) + /*@globals fileSystem @*/ + /*@modifies fileSystem @*/; +/*@=exportlocal@*/ + +/** \ingroup rpmts + * Get transaction set database handle. + * @param ts transaction set + * @return transaction database handle + */ +/*@null@*/ +rpmdb rpmtsGetRdb(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Get transaction set dependencies. + * @param ts transaction set + * @return transaction set dependencies. + */ +/*@null@*/ +rpmPRCO rpmtsPRCO(rpmts ts) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; + +/** \ingroup rpmts + * Initialize disk space info for each and every mounted file systems. + * @param ts transaction set + * @return 0 on success + */ +int rpmtsInitDSI(const rpmts ts) + /*@globals fileSystem, internalState @*/ + /*@modifies ts, fileSystem, internalState @*/; + +/** \ingroup rpmts + * Update disk space info for a file. + * @param ts transaction set + * @param dev mount point device + * @param fileSize file size + * @param prevSize previous file size (if upgrading) + * @param fixupSize size difference (if + * @param _action file disposition + */ +void rpmtsUpdateDSI(const rpmts ts, dev_t dev, + rpmuint32_t fileSize, rpmuint32_t prevSize, rpmuint32_t fixupSize, + int _action) + /*@modifies ts @*/; + +/** \ingroup rpmts + * Check a transaction element for disk space problems. + * @param ts transaction set + * @param te current transaction element + */ +void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te) + /*@modifies ts @*/; + +/** \ingroup rpmts + * Perform transaction progress notify callback. + * @warning This function's args have changed, so the function cannot be + * used portably + * @param ts transaction set + * @param te current transaction element + * @param what type of call back + * @param amount current value + * @param total final value + * @return callback dependent pointer + */ +/*@null@*/ +void * rpmtsNotify(rpmts ts, rpmte te, + rpmCallbackType what, rpmuint64_t amount, rpmuint64_t total) + /*@modifies te @*/; + +/** \ingroup rpmts + * Return number of (ordered) transaction set elements. + * @param ts transaction set + * @return no. of transaction set elements + */ +int rpmtsNElements(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Return (ordered) transaction set element. + * @param ts transaction set + * @param ix transaction element index + * @return transaction element (or NULL) + */ +/*@null@*/ /*@dependent@*/ +rpmte rpmtsElement(rpmts ts, int ix) + /*@*/; + +/** \ingroup rpmts + * Get problem ignore bit mask, i.e. bits to filter encountered problems. + * @param ts transaction set + * @return ignore bit mask + */ +rpmprobFilterFlags rpmtsFilterFlags(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Get transaction flags, i.e. bits that control rpmtsRun(). + * @param ts transaction set + * @return transaction flags + */ +rpmtransFlags rpmtsFlags(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Set transaction flags, i.e. bits that control rpmtsRun(). + * @param ts transaction set + * @param transFlags new transaction flags + * @return previous transaction flags + */ +rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags) + /*@modifies ts @*/; + +/** \ingroup rpmts + * Get dependency flags, i.e. bits that control rpmtsCheck() and rpmtsOrder(). + * @param ts transaction set + * @return dependency flags + */ +rpmdepFlags rpmtsDFlags(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Set dependency flags, i.e. bits that control rpmtsCheck() and rpmtsOrder(). + * @param ts transaction set + * @param depFlags new dependency flags + * @return previous dependency flags + */ +rpmdepFlags rpmtsSetDFlags(rpmts ts, rpmdepFlags depFlags) + /*@modifies ts @*/; + +/** \ingroup rpmts + * Get spec control structure from transaction set. + * @param ts transaction set + * @return spec control structure + */ +/*@null@*/ +Spec rpmtsSpec(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Set a spec control structure in transaction set. + * @param ts transaction set + * @param spec new spec control structure + * @return previous spec control structure + */ +/*@null@*/ +Spec rpmtsSetSpec(rpmts ts, /*@null@*/ Spec spec) + /*@modifies ts @*/; + +/** \ingroup rpmts + * Get current relocate transaction element. + * @param ts transaction set + * @return current relocate transaction element + */ +/*@null@*/ +rpmte rpmtsRelocateElement(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Set current relocate transaction element. + * @param ts transaction set + * @param relocateElement new relocate transaction element + * @return previous relocate transaction element + */ +/*@null@*/ +rpmte rpmtsSetRelocateElement(rpmts ts, /*@null@*/ rpmte relocateElement) + /*@modifies ts @*/; + +/** \ingroup rpmts + * Retrieve goal of transaction set. + * @param ts transaction set + * @return goal + */ +tsmStage rpmtsGoal(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Set goal of transaction set. + * @param ts transaction set + * @param goal new goal + * @return previous goal + */ +tsmStage rpmtsSetGoal(rpmts ts, tsmStage goal) + /*@modifies ts @*/; + +/** \ingroup rpmts + * Retrieve dbmode of transaction set. + * @param ts transaction set + * @return dbmode + */ +int rpmtsDBMode(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Set dbmode of transaction set. + * @param ts transaction set + * @param dbmode new dbmode + * @return previous dbmode + */ +int rpmtsSetDBMode(rpmts ts, int dbmode) + /*@modifies ts @*/; + +/** \ingroup rpmts + * Retrieve color bits of transaction set. + * @param ts transaction set + * @return color bits + */ +rpmuint32_t rpmtsColor(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Retrieve prefered file color + * @param ts transaction set + * @return color bits + */ +rpmuint32_t rpmtsPrefColor(rpmts ts) + /*@*/; + +/** \ingroup rpmts + * Set color bits of transaction set. + * @param ts transaction set + * @param color new color bits + * @return previous color bits + */ +rpmuint32_t rpmtsSetColor(rpmts ts, rpmuint32_t color) + /*@modifies ts @*/; + +/** \ingroup rpmts + * Retrieve operation timestamp from a transaction set. + * @param ts transaction set + * @param opx operation timestamp index + * @return pointer to operation timestamp. + */ +/*@relnull@*/ +rpmop rpmtsOp(rpmts ts, rpmtsOpX opx) + /*@*/; + +/** \ingroup rpmts + * Set transaction notify callback function and argument. + * + * @warning This call must be made before rpmtsRun() for + * install/upgrade/freshen to function correctly. + * + * @param ts transaction set + * @param notify progress callback + * @param notifyData progress callback private data + * @return 0 on success + */ +int rpmtsSetNotifyCallback(rpmts ts, + /*@observer@*/ rpmCallbackFunction notify, + /*@observer@*/ rpmCallbackData notifyData) + /*@modifies ts @*/; + +/** \ingroup rpmts + * Create an empty transaction set. + * @return new transaction set + */ +/*@newref@*/ +rpmts rpmtsCreate(void) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies rpmGlobalMacroContext, internalState @*/; + +/*@-redecl@*/ +/*@unchecked@*/ +extern int rpmcliPackagesTotal; +/*@=redecl@*/ + +/** \ingroup rpmts + * Add package to be installed to transaction set. + * + * The transaction set is checked for duplicate package names. + * If found, the package with the "newest" EVR will be replaced. + * + * @param ts transaction set + * @param h header + * @param key package retrieval key (e.g. file name) + * @param upgrade is package being upgraded? + * @param relocs package file relocations + * @return 0 on success, 1 on I/O error, 2 needs capabilities + */ +int rpmtsAddInstallElement(rpmts ts, Header h, + /*@exposed@*/ /*@null@*/ const fnpyKey key, int upgrade, + /*@null@*/ rpmRelocation relocs) + /*@globals rpmcliPackagesTotal, rpmGlobalMacroContext, h_errno, + fileSystem, internalState @*/ + /*@modifies ts, h, rpmcliPackagesTotal, rpmGlobalMacroContext, + fileSystem, internalState @*/; + +/** \ingroup rpmts + * Add package to be erased to transaction set. + * @param ts transaction set + * @param h header + * @param hdrNum rpm database instance + * @return 0 on success + */ +int rpmtsAddEraseElement(rpmts ts, Header h, uint32_t hdrNum) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/; + +#if !defined(SWIG) +#if defined(_RPMTS_PRINT) +/** \ingroup rpmts + * Print current transaction set contents. + * @param ts transaction set + * @param fp file handle (NULL uses stderr) + * @return 0 always + */ +/*@unused@*/ static inline +int rpmtsPrint(/*@null@*/ rpmts ts, /*@null@*/ FILE * fp) + /*@globals fileSystem @*/ + /*@modifies ts, *fp, fileSystem @*/ +{ + rpmuint32_t tid = rpmtsGetTid(ts); + time_t ttid = tid; + rpmtsi tsi; + rpmte te; + + if (fp == NULL) + fp = stderr; + + fprintf(fp, _("=== Transaction at %-24.24s (0x%08x):\n"), ctime(&ttid),tid); + tsi = rpmtsiInit(ts); + while ((te = rpmtsiNext(tsi, (rpmElementType)0)) != NULL) + fprintf(fp, "t%s> %s\n", (rpmteType(te) == TR_ADDED ? "I" : "E"), + rpmteNEVRA(te)); + tsi = rpmtsiFree(tsi); + return 0; +} +#endif /* defined(_RPMTS_PRINT) */ +#endif /* !defined(SWIG) */ + +#ifdef __cplusplus +} +#endif + + +#endif /* H_RPMTS */ diff --git a/rpm-5.4.9/lib/rpmversion.c b/rpm-5.4.9/lib/rpmversion.c new file mode 100644 index 0000000..77acf37 --- /dev/null +++ b/rpm-5.4.9/lib/rpmversion.c @@ -0,0 +1,26 @@ +/** \ingroup rpmversion + * \file lib/rpmversion.c + */ + +#include "system.h" +#include "rpmiotypes.h" +#include "rpmversion.h" +#include "debug.h" + +/*@-shiftimplementation @*/ +rpmuint32_t rpmlibVersion(void) +{ + return (rpmuint32_t)RPMLIB_VERSION; +} + +rpmuint32_t rpmlibTimestamp(void) +{ + return (rpmuint32_t)RPMLIB_TIMESTAMP; +} + +rpmuint32_t rpmlibVendor(void) +{ + return (rpmuint32_t)RPMLIB_VENDOR; +} +/*@=shiftimplementation @*/ + diff --git a/rpm-5.4.9/lib/rpmversion.h b/rpm-5.4.9/lib/rpmversion.h new file mode 100644 index 0000000..a471d3f --- /dev/null +++ b/rpm-5.4.9/lib/rpmversion.h @@ -0,0 +1,154 @@ +#ifndef __RPMVERSION_H__ +#define __RPMVERSION_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/*@unchecked@*/ /*@observer@*/ +extern const char * RPMVERSION; + +/*@unchecked@*/ /*@observer@*/ +extern const char * rpmNAME; + +/*@unchecked@*/ /*@observer@*/ +extern const char * rpmEVR; + +/*@unchecked@*/ +extern int rpmFLAGS; + +/* + VERSION + --------------------- + + 3 2 1 0 + 10987654321098765432109876543210 + | || || || || || + | M || N ||t|| O || R |s + + M: bits 31-27 (5 bit): [0... 32[ [0..31] major version (architecture generation counter) + N: bits 26-21 (6 bit): [0... 64[ [0..63] minor version (functionality generation counter) + t: bits 20-18 (3 bit): {_,a,b,c,r} {_,a,b,c,r} release type + O: bits 17-10 (8 bit): [0...256[ [0..255] major revision (maintenance generation counter) + R: bits 09-01 (9 bit): [0...512[ [0..511] minor revision (hotfix generation counter) + s: bits 00-00 (1 bit): {_,s} {_,s} is snapshot? + + TIMESTAMP + --------------------- + + 3 2 1 0 + 10987654321098765432109876543210 + | || || || || | + | Y ||M || D || h || m | + + Y: bits 30-20 (12 bit): [0...4096[ [0...4095] year + M: bits 19-16 ( 4 bit): [0...16[ [1..12] month + D: bits 15-11 ( 5 bit): [0...32[ [1..31] day + h: bits 10-06 ( 5 bit): [0...32[ [00..23] hour (UTC +0000) + m: bits 05-00 ( 6 bit): [0...64[ [00..61] minute (UTC +0000) + + EXAMPLES + -------- + + version encoding + 5.6.DEV RPMLIB_VERSION_ENCODE(5,6,_,0,0,_) RPMLIB_TIMESTAMP_ENCODE(YYYY,MM,DD,HH,MM) + 5.6.SNAP.YYYYMMDD RPMLIB_VERSION_ENCODE(5,6,_,0,0,s) RPMLIB_TIMESTAMP_ENCODE(YYYY,MM,DD,00,00) + 5.6a7 RPMLIB_VERSION_ENCODE(5,6,a,7,0,_) RPMLIB_TIMESTAMP_ENCODE(YYYY,MM,DD,00,00) + 5.6b7 RPMLIB_VERSION_ENCODE(5,6,b,7,0,_) RPMLIB_TIMESTAMP_ENCODE(YYYY,MM,DD,00,00) + 5.6rc7 RPMLIB_VERSION_ENCODE(5,6,b,7,0,_) RPMLIB_TIMESTAMP_ENCODE(YYYY,MM,DD,00,00) + 5.6.7 RPMLIB_VERSION_ENCODE(5,6,r,7,0,_) RPMLIB_TIMESTAMP_ENCODE(YYYY,MM,DD,00,00) + 5.6.7.8 RPMLIB_VERSION_ENCODE(5,6,r,7,8,_) RPMLIB_TIMESTAMP_ENCODE(YYYY,MM,DD,00,00) + + USAGE + ----- + + #include + #if defined(RPMLIB_VERSION) && RPMLIB_VENDOR_EQ('R','P','M','5') && \ + RPMLIB_VERSION_GE(5,0,a,1,0,_) && RPMLIB_TIMESTAMP_GT(2007,11,13,00,00) + [...] + #endif +*/ + +/* link-time information */ +extern uint32_t rpmlibVersion(void) + /*@*/; +extern uint32_t rpmlibTimestamp(void) + /*@*/; +extern uint32_t rpmlibVendor(void) + /*@*/; + +/* compile-time information */ +#define RPMLIB_VERSION RPMLIB_VERSION_ENCODE(5,4,r,9,0,_) +#define RPMLIB_TIMESTAMP RPMLIB_TIMESTAMP_ENCODE(2012,4,2,0,0) +#define RPMLIB_VENDOR RPMLIB_VENDOR_ENCODE('R','P','M','5') + +/* RPM release version encoding */ +#define RPMLIB_VERSION_ENCODE(major,minor,type,micro,revision,snap) \ + ( RPMLIB_BITFIELD_SET(31,27,(major)) \ + | RPMLIB_BITFIELD_SET(26,21,(minor)) \ + | RPMLIB_BITFIELD_SET(20,18,RPMLIB_VERSION_ENCODE_T(type)) \ + | RPMLIB_BITFIELD_SET(17,10,(micro)) \ + | RPMLIB_BITFIELD_SET(9,1,(revision)) \ + | RPMLIB_BITFIELD_SET(0,0,RPMLIB_VERSION_ENCODE_S(snap))) +#define RPMLIB_VERSION_ENCODE_T(type) RPMLIB_VERSION_ENCODE_T_##type +#define RPMLIB_VERSION_ENCODE_T__ 0 +#define RPMLIB_VERSION_ENCODE_T_a 1 +#define RPMLIB_VERSION_ENCODE_T_b 2 +#define RPMLIB_VERSION_ENCODE_T_c 3 +#define RPMLIB_VERSION_ENCODE_T_r 4 +#define RPMLIB_VERSION_ENCODE_S(snap) RPMLIB_VERSION_ENCODE_S_##snap +#define RPMLIB_VERSION_ENCODE_S__ 0 +#define RPMLIB_VERSION_ENCODE_S_s 1 + +/* RPM release timestamp encoding */ +#define RPMLIB_TIMESTAMP_ENCODE(year,month,date,hour,minute) \ + ( RPMLIB_BITFIELD_SET(31,20,(year)) \ + | RPMLIB_BITFIELD_SET(19,16,(month)) \ + | RPMLIB_BITFIELD_SET(15,11,(date)) \ + | RPMLIB_BITFIELD_SET(10,6,(hour)) \ + | RPMLIB_BITFIELD_SET(5,0,(minute))) + +/* RPM vendor tag encoding */ +#define RPMLIB_VENDOR_ENCODE(c1,c2,c3,c4) \ + ( RPMLIB_BITFIELD_SET(31,24,(c1)) \ + | RPMLIB_BITFIELD_SET(23,16,(c2)) \ + | RPMLIB_BITFIELD_SET(15,8,(c3)) \ + | RPMLIB_BITFIELD_SET(7,0,(c4))) + +/* RPM release version assertion */ +#define RPMLIB_VERSION_LT(major,minor,type,micro,revision,snap) \ + (RPMLIB_VERSION < RPMLIB_VERSION_ENCODE((major),(minor),(type),(micro),(revision),(snap))) +#define RPMLIB_VERSION_LE(major,minor,type,micro,revision,snap) \ + (RPMLIB_VERSION <= RPMLIB_VERSION_ENCODE((major),(minor),(type),(micro),(revision),(snap))) +#define RPMLIB_VERSION_EQ(major,minor,type,micro,revision,snap) \ + (RPMLIB_VERSION == RPMLIB_VERSION_ENCODE((major),(minor),(type),(micro),(revision),(snap))) +#define RPMLIB_VERSION_GE(major,minor,type,micro,revision,snap) \ + (RPMLIB_VERSION >= RPMLIB_VERSION_ENCODE((major),(minor),(type),(micro),(revision),(snap))) +#define RPMLIB_VERSION_GT(major,minor,type,micro,revision,snap) \ + (RPMLIB_VERSION > RPMLIB_VERSION_ENCODE((major),(minor),(type),(micro),(revision),(snap))) + +/* RPM release timestamp assertion */ +#define RPMLIB_TIMESTAMP_LT(year,month,date,hour,minute) \ + (RPMLIB_TIMESTAMP < RPMLIB_TIMESTAMP_ENCODE((year),(month),(date),(hour),(minute))) +#define RPMLIB_TIMESTAMP_LE(major,minor,type,micro,revision) \ + (RPMLIB_TIMESTAMP <= RPMLIB_TIMESTAMP_ENCODE((year),(month),(date),(hour),(minute))) +#define RPMLIB_TIMESTAMP_EQ(major,minor,type,micro,revision) \ + (RPMLIB_TIMESTAMP == RPMLIB_TIMESTAMP_ENCODE((year),(month),(date),(hour),(minute))) +#define RPMLIB_TIMESTAMP_GE(major,minor,type,micro,revision) \ + (RPMLIB_TIMESTAMP >= RPMLIB_TIMESTAMP_ENCODE((year),(month),(date),(hour),(minute))) +#define RPMLIB_TIMESTAMP_GT(major,minor,type,micro,revision) \ + (RPMLIB_TIMESTAMP > RPMLIB_TIMESTAMP_ENCODE((year),(month),(date),(hour),(minute))) + +/* RPM vendor tag assertion */ +#define RPMLIB_VENDOR_EQ(c1,c2,c3,c4) \ + (RPMLIB_VENDOR == RPMLIB_VENDOR_ENCODE((c1),(c2),(c3),(c4))) + +/* encode numer "n" into the bits "l" (msb) to "r" (lsb) */ +#define RPMLIB_BITFIELD_SET(l,r,n) \ + (((n) & ((1<<(((l)-(r))+1))-1) ) << (r)) + +#ifdef __cplusplus +} +#endif + +#endif /* __RPMVERSION_H__ */ diff --git a/rpm-5.4.9/lib/rpmversion.h.in b/rpm-5.4.9/lib/rpmversion.h.in new file mode 100644 index 0000000..83ebdfd --- /dev/null +++ b/rpm-5.4.9/lib/rpmversion.h.in @@ -0,0 +1,154 @@ +#ifndef __RPMVERSION_H__ +#define __RPMVERSION_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/*@unchecked@*/ /*@observer@*/ +extern const char * RPMVERSION; + +/*@unchecked@*/ /*@observer@*/ +extern const char * rpmNAME; + +/*@unchecked@*/ /*@observer@*/ +extern const char * rpmEVR; + +/*@unchecked@*/ +extern int rpmFLAGS; + +/* + VERSION + --------------------- + + 3 2 1 0 + 10987654321098765432109876543210 + | || || || || || + | M || N ||t|| O || R |s + + M: bits 31-27 (5 bit): [0... 32[ [0..31] major version (architecture generation counter) + N: bits 26-21 (6 bit): [0... 64[ [0..63] minor version (functionality generation counter) + t: bits 20-18 (3 bit): {_,a,b,c,r} {_,a,b,c,r} release type + O: bits 17-10 (8 bit): [0...256[ [0..255] major revision (maintenance generation counter) + R: bits 09-01 (9 bit): [0...512[ [0..511] minor revision (hotfix generation counter) + s: bits 00-00 (1 bit): {_,s} {_,s} is snapshot? + + TIMESTAMP + --------------------- + + 3 2 1 0 + 10987654321098765432109876543210 + | || || || || | + | Y ||M || D || h || m | + + Y: bits 30-20 (12 bit): [0...4096[ [0...4095] year + M: bits 19-16 ( 4 bit): [0...16[ [1..12] month + D: bits 15-11 ( 5 bit): [0...32[ [1..31] day + h: bits 10-06 ( 5 bit): [0...32[ [00..23] hour (UTC +0000) + m: bits 05-00 ( 6 bit): [0...64[ [00..61] minute (UTC +0000) + + EXAMPLES + -------- + + version encoding + 5.6.DEV RPMLIB_VERSION_ENCODE(5,6,_,0,0,_) RPMLIB_TIMESTAMP_ENCODE(YYYY,MM,DD,HH,MM) + 5.6.SNAP.YYYYMMDD RPMLIB_VERSION_ENCODE(5,6,_,0,0,s) RPMLIB_TIMESTAMP_ENCODE(YYYY,MM,DD,00,00) + 5.6a7 RPMLIB_VERSION_ENCODE(5,6,a,7,0,_) RPMLIB_TIMESTAMP_ENCODE(YYYY,MM,DD,00,00) + 5.6b7 RPMLIB_VERSION_ENCODE(5,6,b,7,0,_) RPMLIB_TIMESTAMP_ENCODE(YYYY,MM,DD,00,00) + 5.6rc7 RPMLIB_VERSION_ENCODE(5,6,b,7,0,_) RPMLIB_TIMESTAMP_ENCODE(YYYY,MM,DD,00,00) + 5.6.7 RPMLIB_VERSION_ENCODE(5,6,r,7,0,_) RPMLIB_TIMESTAMP_ENCODE(YYYY,MM,DD,00,00) + 5.6.7.8 RPMLIB_VERSION_ENCODE(5,6,r,7,8,_) RPMLIB_TIMESTAMP_ENCODE(YYYY,MM,DD,00,00) + + USAGE + ----- + + #include + #if defined(RPMLIB_VERSION) && RPMLIB_VENDOR_EQ('R','P','M','5') && \ + RPMLIB_VERSION_GE(5,0,a,1,0,_) && RPMLIB_TIMESTAMP_GT(2007,11,13,00,00) + [...] + #endif +*/ + +/* link-time information */ +extern uint32_t rpmlibVersion(void) + /*@*/; +extern uint32_t rpmlibTimestamp(void) + /*@*/; +extern uint32_t rpmlibVendor(void) + /*@*/; + +/* compile-time information */ +#define RPMLIB_VERSION RPMLIB_VERSION_ENCODE(@RPM_VERSION@) +#define RPMLIB_TIMESTAMP RPMLIB_TIMESTAMP_ENCODE(@RPM_TIMESTAMP@) +#define RPMLIB_VENDOR RPMLIB_VENDOR_ENCODE(@RPM_VENDOR@) + +/* RPM release version encoding */ +#define RPMLIB_VERSION_ENCODE(major,minor,type,micro,revision,snap) \ + ( RPMLIB_BITFIELD_SET(31,27,(major)) \ + | RPMLIB_BITFIELD_SET(26,21,(minor)) \ + | RPMLIB_BITFIELD_SET(20,18,RPMLIB_VERSION_ENCODE_T(type)) \ + | RPMLIB_BITFIELD_SET(17,10,(micro)) \ + | RPMLIB_BITFIELD_SET(9,1,(revision)) \ + | RPMLIB_BITFIELD_SET(0,0,RPMLIB_VERSION_ENCODE_S(snap))) +#define RPMLIB_VERSION_ENCODE_T(type) RPMLIB_VERSION_ENCODE_T_##type +#define RPMLIB_VERSION_ENCODE_T__ 0 +#define RPMLIB_VERSION_ENCODE_T_a 1 +#define RPMLIB_VERSION_ENCODE_T_b 2 +#define RPMLIB_VERSION_ENCODE_T_c 3 +#define RPMLIB_VERSION_ENCODE_T_r 4 +#define RPMLIB_VERSION_ENCODE_S(snap) RPMLIB_VERSION_ENCODE_S_##snap +#define RPMLIB_VERSION_ENCODE_S__ 0 +#define RPMLIB_VERSION_ENCODE_S_s 1 + +/* RPM release timestamp encoding */ +#define RPMLIB_TIMESTAMP_ENCODE(year,month,date,hour,minute) \ + ( RPMLIB_BITFIELD_SET(31,20,(year)) \ + | RPMLIB_BITFIELD_SET(19,16,(month)) \ + | RPMLIB_BITFIELD_SET(15,11,(date)) \ + | RPMLIB_BITFIELD_SET(10,6,(hour)) \ + | RPMLIB_BITFIELD_SET(5,0,(minute))) + +/* RPM vendor tag encoding */ +#define RPMLIB_VENDOR_ENCODE(c1,c2,c3,c4) \ + ( RPMLIB_BITFIELD_SET(31,24,(c1)) \ + | RPMLIB_BITFIELD_SET(23,16,(c2)) \ + | RPMLIB_BITFIELD_SET(15,8,(c3)) \ + | RPMLIB_BITFIELD_SET(7,0,(c4))) + +/* RPM release version assertion */ +#define RPMLIB_VERSION_LT(major,minor,type,micro,revision,snap) \ + (RPMLIB_VERSION < RPMLIB_VERSION_ENCODE((major),(minor),(type),(micro),(revision),(snap))) +#define RPMLIB_VERSION_LE(major,minor,type,micro,revision,snap) \ + (RPMLIB_VERSION <= RPMLIB_VERSION_ENCODE((major),(minor),(type),(micro),(revision),(snap))) +#define RPMLIB_VERSION_EQ(major,minor,type,micro,revision,snap) \ + (RPMLIB_VERSION == RPMLIB_VERSION_ENCODE((major),(minor),(type),(micro),(revision),(snap))) +#define RPMLIB_VERSION_GE(major,minor,type,micro,revision,snap) \ + (RPMLIB_VERSION >= RPMLIB_VERSION_ENCODE((major),(minor),(type),(micro),(revision),(snap))) +#define RPMLIB_VERSION_GT(major,minor,type,micro,revision,snap) \ + (RPMLIB_VERSION > RPMLIB_VERSION_ENCODE((major),(minor),(type),(micro),(revision),(snap))) + +/* RPM release timestamp assertion */ +#define RPMLIB_TIMESTAMP_LT(year,month,date,hour,minute) \ + (RPMLIB_TIMESTAMP < RPMLIB_TIMESTAMP_ENCODE((year),(month),(date),(hour),(minute))) +#define RPMLIB_TIMESTAMP_LE(major,minor,type,micro,revision) \ + (RPMLIB_TIMESTAMP <= RPMLIB_TIMESTAMP_ENCODE((year),(month),(date),(hour),(minute))) +#define RPMLIB_TIMESTAMP_EQ(major,minor,type,micro,revision) \ + (RPMLIB_TIMESTAMP == RPMLIB_TIMESTAMP_ENCODE((year),(month),(date),(hour),(minute))) +#define RPMLIB_TIMESTAMP_GE(major,minor,type,micro,revision) \ + (RPMLIB_TIMESTAMP >= RPMLIB_TIMESTAMP_ENCODE((year),(month),(date),(hour),(minute))) +#define RPMLIB_TIMESTAMP_GT(major,minor,type,micro,revision) \ + (RPMLIB_TIMESTAMP > RPMLIB_TIMESTAMP_ENCODE((year),(month),(date),(hour),(minute))) + +/* RPM vendor tag assertion */ +#define RPMLIB_VENDOR_EQ(c1,c2,c3,c4) \ + (RPMLIB_VENDOR == RPMLIB_VENDOR_ENCODE((c1),(c2),(c3),(c4))) + +/* encode numer "n" into the bits "l" (msb) to "r" (lsb) */ +#define RPMLIB_BITFIELD_SET(l,r,n) \ + (((n) & ((1<<(((l)-(r))+1))-1) ) << (r)) + +#ifdef __cplusplus +} +#endif + +#endif /* __RPMVERSION_H__ */ diff --git a/rpm-5.4.9/lib/tevr.c b/rpm-5.4.9/lib/tevr.c new file mode 100644 index 0000000..126ac6b --- /dev/null +++ b/rpm-5.4.9/lib/tevr.c @@ -0,0 +1,237 @@ +#include "system.h" +#include +#include +#include +#include + +#include +#define _RPMEVR_INTERNAL +#include + +#include "debug.h" + +const char *__progname; +#define progname __progname + +static struct stats_e { + unsigned total; + unsigned files; + unsigned Kdigest; + unsigned Odigest; + unsigned Emiss; + unsigned Rmiss; + size_t strnb; + size_t dictnb; + size_t uuidnb; +} s; + +static int nofiles = 0; +static int noKdigests = 0; +static int noOdigests = 0; + +typedef struct rpmdict_s * rpmdict; +struct rpmdict_s { + ARGV_t av; + size_t ac; + hashTable ht; +}; + +/*@null@*/ +static rpmdict rpmdictFree(/*@only@*/ rpmdict dict) +{ + if (dict != NULL) { + dict->ht = (dict->ht ? htFree(dict->ht) : NULL); + dict->av = argvFree(dict->av); + dict = _free(dict); + } + return NULL; +} + +static void rpmdictAdd(rpmdict dict, const char * key) +{ + rpmuint64_t * val = NULL; + void ** data = (void **)&val; + if (htGetEntry(dict->ht, key, &data, NULL, NULL)) { + (void) argvAdd(&dict->av, key); + val = (rpmuint64_t *) xcalloc(1, sizeof(*val)); + htAddEntry(dict->ht, dict->av[dict->ac++], val); + } else + val = (rpmuint64_t *)data[0]; + val[0]++; +} + +/*@only@*/ +static rpmdict rpmdictCreate(void) +{ + static const char key[] = ""; + rpmdict dict = (rpmdict) xcalloc(1, sizeof(*dict)); + int nbuckets = 4093; + size_t keySize = 0; + int freeData = 1; + /* XXX hashEqualityString uses strcmp, perhaps rpmEVRcmp instead? */ + dict->ht = htCreate(nbuckets, keySize, freeData, NULL, NULL); + rpmdictAdd(dict, key); + return dict; +} + +static int rpmdictCmp(const void * a, const void * b) +{ + const char * astr = *(ARGV_t)a; + const char * bstr = *(ARGV_t)b; + return rpmEVRcmp(astr, bstr); +} + +static int isKdigest(const char * s) +{ + static char hex[] = "0123456789abcdefABCDEF"; + size_t len = strlen(s); + int rc = 0; + int c; + + switch (len) { + default: + break; + case 32: + case 40: + while ((c = *s++) != 0) + if (strchr(hex, c) == NULL) + break; + rc = (c == 0 ? 1 : 0); + break; + } + return rc; +} + +static int isOdigest(const char * s) +{ + static char hex[] = "0123456789abcdef"; + size_t len = strlen(s); + int hascolon = 0; + int hasdash = 0; + int rc = 0; + int c; + + switch (len) { + default: + break; + case 27: + while ((c = *s++) != 0) { + if (c == (int)':') hascolon++; + else if (c == (int)'-') hasdash++; + else if (strchr(hex, c) == NULL) + break; + } + rc = (c == 0 && hascolon == 1 && hasdash == 1 ? 1 : 0); + break; + } + return rc; +} + +static struct poptOption optionsTable[] = { + + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioAllPoptTable, 0, + N_("Common options for all rpmio executables:"), + NULL }, + + POPT_AUTOHELP + POPT_TABLEEND +}; + +int +main(int argc, char *const argv[]) +{ + poptContext optCon = rpmioInit(argc, argv, optionsTable); + ARGV_t av; + int ac; + rpmdict dict; + EVR_t evr = (EVR_t) xcalloc(1, sizeof(*evr)); + const char * arg; + int rc = 0; + int xx; + int i; + + if ((progname = strrchr(argv[0], '/')) != NULL) + progname++; + else + progname = argv[0]; + + av = NULL; + (void) argvAppend(&av, poptGetArgs(optCon)); + ac = argvCount(av); + + if (ac == 0 || !strcmp(*av, "-")) { + av = NULL; + xx = argvFgets(&av, NULL); + ac = argvCount(av); + } + + dict = rpmdictCreate(); + + if (av != NULL) + for (i = 0; (arg = av[i]) != NULL; i++) { + if (*arg == '\0') /* Skip cruft */ + continue; + s.total++; + + if (nofiles && *arg == '/') { /* Skip file paths. */ + s.files++; + continue; + } + if (noKdigests && isKdigest(arg)) { /* Skip kernel MD5/SHA1. */ + s.Kdigest++; + continue; + } + if (noOdigests && isOdigest(arg)) { /* Skip OCAML EVR strings. */ + s.Odigest++; + continue; + } + + /* Split E:V-R into components. */ + xx = rpmEVRparse(arg, evr); + if (evr->F[RPMEVR_E] == NULL) { + evr->F[RPMEVR_E] = "0"; + s.Emiss++; + } + if (evr->F[RPMEVR_R] == NULL) { + evr->F[RPMEVR_R] = ""; + s.Rmiss++; + } + rpmdictAdd(dict, evr->F[RPMEVR_E]); + rpmdictAdd(dict, evr->F[RPMEVR_V]); + rpmdictAdd(dict, evr->F[RPMEVR_R]); + +if (__debug) +fprintf(stderr, "%5d: %s => %s:%s-%s\n", s.total, arg, evr->F[RPMEVR_E], evr->F[RPMEVR_V], evr->F[RPMEVR_R]); + + evr->str = _free(evr->str); + } + + (void) argvSort(dict->av, rpmdictCmp); + + /* Compute size of string & uuid store. */ + for (i = 0; av[i] != NULL; i++) { + s.strnb += sizeof(*av) + strlen(av[i]) + 1; + s.uuidnb += 64/8; + } + s.strnb += sizeof(*av) + 1; + + /* Compute size of dictionary store. */ + for (i = 0; dict->av[i] != NULL; i++) { + s.dictnb += sizeof(*dict->av) + strlen(dict->av[i]) + 1; + } + s.dictnb += sizeof(*dict->av) + 1; + +fprintf(stderr, "total:%u files:%u Kdigest:%u Odigest:%u Emiss:%u Rmiss:%u dictlen:%u strnb:%u dictnb:%u uuidnb:%u\n", +s.total, s.files, s.Kdigest, s.Odigest, s.Emiss, s.Rmiss, argvCount(dict->av), (unsigned)s.strnb, (unsigned)s.dictnb, (unsigned)s.uuidnb); + +if (__debug) + argvPrint("E:V-R dictionary", dict->av, NULL); + + evr = _free(evr); + dict = rpmdictFree(dict); + + av = argvFree(av); + optCon = rpmioFini(optCon); + + return rc; +} diff --git a/rpm-5.4.9/lib/tgi.c b/rpm-5.4.9/lib/tgi.c new file mode 100644 index 0000000..516a72d --- /dev/null +++ b/rpm-5.4.9/lib/tgi.c @@ -0,0 +1,325 @@ +#include "system.h" + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include + +#include + +#include "debug.h" + +#ifdef __cplusplus + +#define QVA_ISSET(_qvaflags, _FLAG) ((_qvaflags) & (VERIFY_##_FLAG)) + +#define VSF_ISSET(_vsflags, _FLAG) ((_vsflags) & (RPMVSF_##_FLAG)) +#define VSF_SET(_vsflags, _FLAG) \ + (*((unsigned *)&(_vsflags)) |= (RPMVSF_##_FLAG)) +#define VSF_CLR(_vsflags, _FLAG) \ + (*((unsigned *)&(_vsflags)) &= ~(RPMVSF_##_FLAG)) + +#else /* __cplusplus */ + +#define QVA_ISSET(_qvaflags, _FLAG) ((_qvaflags) & (VERIFY_##_FLAG)) + +#define VSF_ISSET(_vsflags, _FLAG) ((_vsflags) & (RPMVSF_##_FLAG)) +#define VSF_SET(_vsflags, _FLAG) (_vsflags) |= (RPMVSF_##_FLAG) +#define VSF_CLR(_vsflags, _FLAG) (_vsflags) &= ~(RPMVSF_##_FLAG) + +#endif /* __cplusplus */ + +static const char * gitagstr = NULL; +static const char * gikeystr = NULL; +static rpmtransFlags transFlags = 0; +static rpmdepFlags depFlags = 0; + +static const char * queryFormat = NULL; +static const char * defaultQueryFormat = + "%{name}-%{version}-%{release}.%|SOURCERPM?{%{arch}.rpm}:{%|ARCH?{src.rpm}:{pubkey}|}|"; + +/*@only@*/ /*@null@*/ +static const char * rpmgiPathOrQF(const rpmgi gi) + /*@*/ +{ + const char * fmt = ((queryFormat != NULL) + ? queryFormat : defaultQueryFormat); + const char * val = NULL; + Header h = rpmgiHeader(gi); + + if (h != NULL) + val = headerSprintf(h, fmt, rpmTagTable, rpmHeaderFormats, NULL); + else { + const char * fn = rpmgiHdrPath(gi); + val = (fn != NULL ? xstrdup(fn) : NULL); + } + + return val; +} + +static rpmRC rpmcliEraseElement(rpmts ts, const char * arg) +{ + rpmmi mi; + Header h; + rpmRC rc = RPMRC_OK; + int xx; + + mi = rpmtsInitIterator(ts, RPMTAG_NVRA, arg, 0); + if (mi == NULL) + return RPMRC_NOTFOUND; + + while ((h = rpmmiNext(mi)) != NULL) { + uint32_t hdrNum = rpmmiInstance(mi); + + if (hdrNum == 0) { /* XXX can't happen. */ + rc = RPMRC_FAIL; + break; + } + xx = rpmtsAddEraseElement(ts, h, hdrNum); + } + mi = rpmmiFree(mi); + + return 0; +} + +static const char * rpmcliInstallElementPath(rpmts ts, const char * arg) +{ + static const char * pkgpat = "-[^-]*-[^-]*.[^.]*.rpm$"; + const char * mirePattern = rpmExpand(&arg[1], pkgpat, NULL); + miRE mire = mireNew(RPMMIRE_REGEX, 0); + const char * fn = NULL; + ARGV_t av = NULL; + int ac = 0; + int xx = mireRegcomp(mire, mirePattern); + int i; + + /* Get list of candidate package paths. */ + /* XXX note the added "-*.rpm" to force globbing on '-' boundaries. */ + fn = rpmGetPath("%{?_rpmgi_prefix:%{?_rpmgi_prefix}/}", arg, "-*.rpm", NULL); + xx = rpmGlob(fn, &ac, &av); + fn = _free(fn); + + /* Filter out glibc <-> glibc-common confusions. */ + for (i = 0; i < ac; i++) { + if (mireRegexec(mire, av[i], 0) < 0) + continue; + fn = xstrdup(av[0]); + break; + } + + av = argvFree(av); + mire = mireFree(mire); + mirePattern = _free(mirePattern); + + return fn; +} + +static struct poptOption optionsTable[] = { + { "rpmgidebug", 'd', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmgi_debug, -1, + N_("debug generalized iterator"), NULL}, + + { "tag", '\0', POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT, &gitagstr, 0, + N_("iterate tag index"), NULL }, + { "key", '\0', POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT, &gikeystr, 0, + N_("tag value key"), NULL }, + + { "transaction", 'T', POPT_BIT_SET, &giFlags, (RPMGI_TSADD|RPMGI_TSORDER), + N_("create transaction set"), NULL}, + { "noorder", '\0', POPT_BIT_CLR, &giFlags, RPMGI_TSORDER, + N_("do not order transaction set"), NULL}, + { "noglob", '\0', POPT_BIT_SET, &giFlags, RPMGI_NOGLOB, + N_("do not glob arguments"), NULL}, + { "nomanifest", '\0', POPT_BIT_SET, &giFlags, RPMGI_NOMANIFEST, + N_("do not process non-package files as manifests"), NULL}, + { "noheader", '\0', POPT_BIT_SET, &giFlags, RPMGI_NOHEADER, + N_("do not read headers"), NULL}, + + { "qf", '\0', POPT_ARG_STRING, &queryFormat, 0, + N_("use the following query format"), "QUERYFORMAT" }, + { "queryformat", '\0', POPT_ARG_STRING, &queryFormat, 0, + N_("use the following query format"), "QUERYFORMAT" }, + + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioFtsPoptTable, 0, + N_("File tree walk options for fts(3):"), + NULL }, + + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0, + N_("Common options for all rpm modes and executables:"), + NULL }, + + POPT_AUTOALIAS + POPT_AUTOHELP + POPT_TABLEEND +}; + +int +main(int argc, char *const argv[]) +{ + poptContext optCon; + rpmts ts = NULL; + rpmVSFlags vsflags; + int numRPMS = 0; + int numFailed = 0; + rpmgi gi = NULL; + int gitag = RPMDBI_ARGLIST; + const char * fn = NULL; + ARGV_t av; + int ac; + int rc = 0; + + optCon = rpmcliInit(argc, argv, optionsTable); + if (optCon == NULL) + exit(EXIT_FAILURE); + + if (rpmioFtsOpts == 0) + rpmioFtsOpts = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); + + if (gitagstr != NULL) { + gitag = tagValue(gitagstr); + if (gitag < 0) { + fprintf(stderr, _("unknown --tag argument: %s\n"), gitagstr); + exit(EXIT_FAILURE); + } + } + + av = poptGetArgs(optCon); + + /* XXX ftswalk segfault with no args. */ + + ts = rpmtsCreate(); + (void) rpmtsSetFlags(ts, transFlags); + (void) rpmtsSetDFlags(ts, depFlags); + + vsflags = (rpmVSFlags) rpmExpandNumeric("%{?_vsflags_query}"); + vsflags = (rpmVSFlags) 0; /* XXX FIXME: ignore default disablers. */ +#if defined(SUPPORT_NOSIGNATURES) + if (!QVA_ISSET(rpmcliQueryFlags, DIGEST)) { + VSF_SET(vsflags, NOSHA1HEADER); + VSF_SET(vsflags, NOMD5HEADER); + VSF_SET(vsflags, NOSHA1); + VSF_SET(vsflags, NOMD5); + } + if (!QVA_ISSET(rpmcliQueryFlags, SIGNATURE)) { + VSF_SET(vsflags, NODSAHEADER); + VSF_SET(vsflags, NORSAHEADER); + VSF_SET(vsflags, NODSA); + VSF_SET(vsflags, NORSA); + } + if (!QVA_ISSET(rpmcliQueryFlags, HDRCHK)) { + VSF_SET(vsflags, NOHDRCHK); + } + VSF_CLR(vsflags, NEEDPAYLOAD); /* XXX needed? */ +#endif + + (void) rpmtsSetVSFlags(ts, vsflags); + + gi = rpmgiNew(ts, gitag, gikeystr, 0); + + (void) rpmgiSetArgs(gi, av, rpmioFtsOpts, giFlags); + +#if defined(REFERENCE_FORNOW) +if (fileURL[0] == '=') { + rpmds this = rpmdsSingle(RPMTAG_REQUIRENAME, fileURL+1, NULL, 0); + + xx = rpmtsSolve(ts, this, NULL); + if (ts->suggests && ts->nsuggests > 0) { + fileURL = _free(fileURL); + fileURL = ts->suggests[0]; + ts->suggests[0] = NULL; + while (ts->nsuggests-- > 0) { + if (ts->suggests[ts->nsuggests] == NULL) + continue; + ts->suggests[ts->nsuggests] = _free(ts->suggests[ts->nsuggests]); + } + ts->suggests = _free(ts->suggests); + rpmlog(RPMLOG_DEBUG, D_("Adding goal: %s\n"), fileURL); + pkgURL[pkgx] = fileURL; + fileURL = NULL; + pkgx++; + } + (void)rpmdsFree(this); + this = NULL; +} else +#endif + + ac = 0; + while (rpmgiNext(gi) == RPMRC_OK) { + + fn = _free(fn); + fn = xstrdup(rpmgiHdrPath(gi)); + + /* === Check for "+bing" lookaside paths within install transaction. */ + if (fn[0] == '+') { + const char * nfn = rpmcliInstallElementPath(ts, &fn[1]); + fn = _free(fn); + fn = nfn; + } + + /* === Check for "-bang" erasures within install transaction. */ + if (fn[0] == '-') { + switch (rpmcliEraseElement(ts, &fn[1])) { + case RPMRC_OK: + numRPMS++; /* XXX multiple erasures? */ + break; + case RPMRC_NOTFOUND: + default: + rpmlog(RPMLOG_ERR, _("package %s cannot be erased\n"), &fn[1]); + numFailed++; /* XXX multiple erasures? */ + break; + } + continue; + } + + if (!(giFlags & RPMGI_TSADD)) { + const char * arg = rpmgiPathOrQF(gi); + fprintf(stdout, "%5d %s\n", ac, fn); + fn = _free(arg); + } + ac++; + } + fn = _free(fn); + + if (giFlags & RPMGI_TSORDER) { + rpmtsi tsi; + rpmte q; + int i; + +fprintf(stdout, "======================= %d transaction elements\n\ + # Tree Depth Degree Package\n\ +=======================\n", rpmtsNElements(ts)); + + i = 0; + tsi = rpmtsiInit(ts); + while((q = rpmtsiNext(tsi, 0)) != NULL) { + char deptypechar; + + if (i == rpmtsUnorderedSuccessors(ts, -1)) + fprintf(stdout, "======================= leaf nodes only:\n"); + + deptypechar = (rpmteType(q) == TR_REMOVED ? '-' : '+'); + fprintf(stdout, "%5d%5d%6d%7d %*s%c%s\n", + i, rpmteTree(q), rpmteDepth(q), rpmteDegree(q), + (2 * rpmteDepth(q)), "", + deptypechar, rpmteNEVRA(q)); + i++; + } + tsi = rpmtsiFree(tsi); + } + + gi = rpmgiFree(gi); + (void)rpmtsFree(ts); + ts = NULL; + optCon = rpmcliFini(optCon); + + return rc; +} diff --git a/rpm-5.4.9/lib/transaction.c b/rpm-5.4.9/lib/transaction.c new file mode 100644 index 0000000..a69bfcf --- /dev/null +++ b/rpm-5.4.9/lib/transaction.c @@ -0,0 +1,2303 @@ +/** \ingroup rpmts + * \file lib/transaction.c + */ + +#include "system.h" + +#include +#include +#include +#include /* XXX for rpmExpand */ +#include + +#include +#include +#include + +#define _FPRINT_INTERNAL +#include "fprint.h" + +#define _RPMDB_INTERNAL /* XXX for dbiIndexFoo() */ +#include +#include "legacy.h" /* XXX dodigest */ + +#define _RPMFI_INTERNAL +#include +#include "fsm.h" + +#define _RPMTE_INTERNAL +#include "rpmte.h" +#define _RPMTS_INTERNAL +#include "rpmts.h" + +#define _RPMSQ_INTERNAL +#define _RPMPSM_INTERNAL +#include "psm.h" + +#include "rpmds.h" + +#include "rpmlock.h" + +#include "misc.h" /* XXX currentDirectory */ + +#if defined(RPM_VENDOR_MANDRIVA) +#include "filetriggers.h" /* XXX mayAddToFilesAwaitingFiletriggers, rpmRunFileTriggers */ +#endif + +#include /* XXX QVA_t INSTALL_FOO flags */ +#include /* IDTX prototypes */ + +#include "debug.h" + +/*@access dbiIndexSet @*/ + +/*@access fnpyKey @*/ + +/*@access alKey @*/ +/*@access rpmdb @*/ /* XXX cast */ + +/*@access rpmfi @*/ +/*@access rpmps @*/ /* XXX need rpmProblemSetOK() */ +/*@access rpmpsm @*/ + +/*@access rpmte @*/ +/*@access rpmtsi @*/ +/*@access rpmts @*/ + +/*@access IDT @*/ +/*@access IDTX @*/ +/*@access FD_t @*/ + +#ifdef __cplusplus + +#define FF_ISSET(_fflags, _FLAG) ((_fflags) & (RPMFILE_##_FLAG)) + +#define QVA_ISSET(_qvaflags, _FLAG) ((_qvaflags) & (VERIFY_##_FLAG)) + +#define VSF_ISSET(_vsflags, _FLAG) ((_vsflags) & (RPMVSF_##_FLAG)) +#define VSF_SET(_vsflags, _FLAG) \ + (*((unsigned *)&(_vsflags)) |= (RPMVSF_##_FLAG)) +#define VSF_CLR(_vsflags, _FLAG) \ + (*((unsigned *)&(_vsflags)) &= ~(RPMVSF_##_FLAG)) + +#define TSF_ISSET(_tsflags, _FLAG) ((_tsflags) & (RPMTRANS_FLAG_##_FLAG)) +#define TSF_SET(_tsflags, _FLAG) \ + (*((unsigned *)&(_tsflags)) |= (RPMTRANS_FLAG_##_FLAG)) +#define TSF_CLR(_tsflags, _FLAG) \ + (*((unsigned *)&(_tsflags)) &= ~(RPMTRANS_FLAG_##_FLAG)) + +#define IIF_ISSET(_iflags, _FLAG) ((_iflags) & (INSTALL_##_FLAG)) +#define IIF_SET(_iflags, _FLAG) \ + (*((unsigned *)&(_iflags)) |= (INSTALL_##_FLAG)) +#define IIF_CLR(_iflags, _FLAG) \ + (*((unsigned *)&(_iflags)) &= ~(INSTALL_##_FLAG)) + +GENfree(int *) +GENfree(struct fingerPrint_s *) + +#else /* __cplusplus */ + +#define FF_ISSET(_fflags, _FLAG) ((_fflags) & (RPMFILE_##_FLAG)) + +#define QVA_ISSET(_qvaflags, _FLAG) ((_qvaflags) & (VERIFY_##_FLAG)) + +#define VSF_ISSET(_vsflags, _FLAG) ((_vsflags) & (RPMVSF_##_FLAG)) +#define VSF_SET(_vsflags, _FLAG) (_vsflags) |= (RPMVSF_##_FLAG) +#define VSF_CLR(_vsflags, _FLAG) (_vsflags) &= ~(RPMVSF_##_FLAG) + +#define TSF_ISSET(_tsflags, _FLAG) ((_tsflags) & (RPMTRANS_FLAG_##_FLAG)) +#define TSF_SET(_tsflags, _FLAG) (_tsflags) |= (RPMTRANS_FLAG_##_FLAG) +#define TSF_CLR(_tsflags, _FLAG) (_tsflags) &= ~(RPMTRANS_FLAG_##_FLAG) + +#define IIF_ISSET(_iflags, _FLAG) ((_iflags) & (INSTALL_##_FLAG)) +#define IIF_SET(_iflags, _FLAG) (_iflags) |= (INSTALL_##_FLAG) +#define IIF_CLR(_iflags, _FLAG) (_iflags) &= ~(INSTALL_##_FLAG) + +#endif /* __cplusplus */ + +static int handleInstInstalledFile(const rpmts ts, rpmte p, rpmfi fi, + Header otherHeader, rpmfi otherFi, + int beingRemoved) + /*@modifies ts, p, fi @*/ +{ + unsigned int fx = rpmfiFX(fi); + int isCfgFile = (FF_ISSET(rpmfiFFlags(otherFi), CONFIG) || FF_ISSET(rpmfiFFlags(fi), CONFIG)); +#ifdef REFERENCE + rpmfs fs = rpmteGetFileStates(p); + if (XFA_SKIPPING(rpmfsGetAction(fs, fx))) +#else + if (iosmFileActionSkipped((iosmFileAction) fi->actions[fx])) +#endif + return 0; + + if (rpmfiCompare(otherFi, fi)) { +#ifdef REFERENCE + rpm_color_t tscolor = rpmtsColor(ts); + rpm_color_t prefcolor = rpmtsPrefColor(ts); + rpm_color_t FColor = rpmfiFColor(fi) & tscolor; + rpm_color_t oFColor = rpmfiFColor(otherFi) & tscolor; +#else + rpmuint32_t tscolor = rpmtsColor(ts); + rpmuint32_t prefcolor = rpmtsPrefColor(ts); + rpmuint32_t FColor = rpmfiFColor(fi) & tscolor; + rpmuint32_t oFColor = rpmfiFColor(otherFi) & tscolor; +#endif + int rConflicts; + + rConflicts = !(beingRemoved || (rpmtsFilterFlags(ts) & RPMPROB_FILTER_REPLACEOLDFILES)); + /* Resolve file conflicts to prefer Elf64 (if not forced). */ + if (tscolor != 0 && FColor != 0 && FColor != oFColor) { + if (oFColor & prefcolor) { +#ifdef REFERENCE + rpmfsSetAction(fs, fx, FA_SKIPCOLOR); +#else + fi->actions[fx] = FA_SKIPCOLOR; +#endif + rConflicts = 0; + } else if (FColor & prefcolor) { +#ifdef REFERENCE + rpmfsSetAction(fs, fx, FA_CREATE); +#else + fi->actions[fx] = FA_CREATE; +#endif + rConflicts = 0; + } + } + + if (rConflicts) { + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmps ps = rpmtsProblems(ts); + int xx; + he->tag = RPMTAG_NVRA; + xx = headerGet(otherHeader, he, 0); + rpmpsAppend(ps, RPMPROB_FILE_CONFLICT, + rpmteNEVRA(p), rpmteKey(p), + rpmfiDN(fi), rpmfiBN(fi), + he->p.str, + 0); + he->p.ptr = _free(he->p.ptr); + ps = rpmpsFree(ps); + } + + /* Save file identifier to mark as state REPLACED. */ +#ifdef REFERENCE + if ( !(isCfgFile || XFA_SKIPPING(rpmfsGetAction(fs, fx))) ) { + if (!beingRemoved) + rpmfsAddReplaced(rpmteGetFileStates(p), rpmfiFX(fi), + headerGetInstance(otherHeader), + rpmfiFX(otherFi)); + } +#else + if ( !(isCfgFile || iosmFileActionSkipped((iosmFileAction) fi->actions[fx])) ) { + if (!beingRemoved) { + struct sharedFileInfo_s _shared; + + p->replaced = (sharedFileInfo) xrealloc(p->replaced, + sizeof(*p->replaced) * (p->nreplaced + 1)); + memset(p->replaced + p->nreplaced, 0, sizeof(*p->replaced)); + + _shared.pkgFileNum = fx; + _shared.otherFileNum = rpmfiFX(otherFi); + _shared.otherPkg = headerGetInstance(otherHeader); + _shared.isRemoved = 0; + p->replaced[p->nreplaced++] = _shared; + } + } +#endif + } + + /* Determine config file dispostion, skipping missing files (if any). */ + if (isCfgFile) { + rpmtransFlags tsflags = rpmtsFlags(ts); + int skipMissing = (TSF_ISSET(tsflags, ALLFILES) ? 0 : 1); +#ifdef REFERENCE + rpmFileAction action = rpmfiDecideFate(otherFi, fi, skipMissing); + rpmfsSetAction(fs, fx, action); +#else + fi->actions[fx] = rpmfiDecideFate(otherFi, fi, skipMissing); +#endif + } +#ifdef REFERENCE + rpmfiSetFReplacedSize(fi, rpmfiFSize(otherFi)); +#else + fi->replacedSizes[fx] = rpmfiFSize(otherFi); +#endif + + return 0; +} + +#define ISROOT(_d) (((_d)[0] == '/' && (_d)[1] == '\0') ? "" : (_d)) + +/*@unchecked@*/ +int _fps_debug = 0; +#define FPSDEBUG(_debug, _list) if ((_debug) || _fps_debug) fprintf _list + +/** + * Update disk space needs on each partition for this package's files. + */ +/* XXX only ts->{probs,di} modified */ +static void handleOverlappedFiles(const rpmts ts, const rpmte p, rpmfi fi) + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies ts, fi, fileSystem, internalState @*/ +{ + uint32_t fixupSize = 0; + rpmps ps; + const char * fn; + int i, j; + + uint32_t tscolor = rpmtsColor(ts); + uint32_t prefcolor = rpmtsPrefColor(ts); +#ifdef REFERENCE + rpmfs fs = rpmteGetFileStates(p); + rpmfs otherFs; +#endif /* REFERENCE */ + +FPSDEBUG(0, (stderr, "--> %s(%p,%p,%p)\n", __FUNCTION__, ts, p, fi)); + ps = rpmtsProblems(ts); + fi = rpmfiInit(fi, 0); + if (fi != NULL) + while ((i = rpmfiNext(fi)) >= 0) { + uint32_t oFColor; + uint32_t FColor; + struct fingerPrint_s * fiFps; + int otherPkgNum, otherFileNum; + rpmfi otherFi; + + rpmte otherTe; +#ifdef REFERENCE + rpmfileAttrs FFlags; + rpm_mode_t FMode; +#else /* REFERENCE */ + rpmuint32_t FFlags; + rpmuint16_t FMode; +#endif /* REFERENCE */ + struct rpmffi_s ** recs; + int numRecs; + + if (iosmFileActionSkipped((iosmFileAction) fi->actions[i])) + continue; + + fn = rpmfiFN(fi); +#ifdef REFERENCE + fiFps = rpmfiFpsIndex(fi, i); +#else /* REFERENCE */ + fiFps = fi->fps + i; +#endif /* REFERENCE */ + FFlags = rpmfiFFlags(fi); + FMode = rpmfiFMode(fi); + FColor = rpmfiFColor(fi); + FColor &= tscolor; + + fixupSize = 0; + + /* + * Retrieve all records that apply to this file. Note that the + * file info records were built in the same order as the packages + * will be installed and removed so the records for an overlapped + * files will be sorted in exactly the same order. + */ + recs = NULL; + numRecs = 0; +#ifdef REFERENCE + (void) rpmFpHashGetEntry(ht, fiFps, &recs, &numRecs, NULL); +#else /* REFERENCE */ + (void) htGetEntry(ts->ht, fiFps, &recs, &numRecs, NULL); +#endif /* REFERENCE */ + + /* + * If this package is being added, look only at other packages + * being added -- removed packages dance to a different tune. + * + * If both this and the other package are being added, overlapped + * files must be identical (or marked as a conflict). The + * disposition of already installed config files leads to + * a small amount of extra complexity. + * + * If this package is being removed, then there are two cases that + * need to be worried about: + * If the other package is being added, then skip any overlapped files + * so that this package removal doesn't nuke the overlapped files + * that were just installed. + * If both this and the other package are being removed, then each + * file removal from preceding packages needs to be skipped so that + * the file removal occurs only on the last occurence of an overlapped + * file in the transaction set. + */ + + /* Locate this overlapped file in the set of added/removed packages. */ + for (j = 0; j < numRecs && recs[j]->p != p; j++) { +FPSDEBUG(0, (stderr, "\trecs %p[%u:%u] te %p != %p\n", recs, (unsigned)j, (unsigned)numRecs, recs[j]->p, p)); + } +FPSDEBUG(0, (stderr, "*** got recs %p[%u:%u]\n", recs, (unsigned)j, (unsigned)numRecs)); + + /* Find what the previous disposition of this file was. */ + otherFileNum = -1; /* keep gcc quiet */ + otherFi = NULL; + otherTe = NULL; +#ifdef REFERENCE + otherFs = NULL; +#endif /* REFERENCE */ + + for (otherPkgNum = j - 1; otherPkgNum >= 0; otherPkgNum--) { +FPSDEBUG(0, (stderr, "\trecs %p[%u:%u] %p -> {%p,%d}\n", recs, (unsigned)otherPkgNum, (unsigned)numRecs, recs[otherPkgNum], recs[otherPkgNum]->p, recs[otherPkgNum]->fileno)); + otherTe = recs[otherPkgNum]->p; + otherFi = rpmteFI(otherTe, RPMTAG_BASENAMES); + otherFileNum = recs[otherPkgNum]->fileno; +#ifdef REFERENCE + otherFs = rpmteGetFileStates(otherTe); +#endif /* REFERENCE */ + + /* Added packages need only look at other added packages. */ + if (rpmteType(p) == TR_ADDED && rpmteType(otherTe) != TR_ADDED) + /*@innercontinue@*/ continue; + + (void) rpmfiSetFX(otherFi, otherFileNum); + + /* XXX Happens iff fingerprint for incomplete package install. */ + if (otherFi->actions[otherFileNum] != FA_UNKNOWN) + /*@innerbreak@*/ break; + } + + oFColor = rpmfiFColor(otherFi); + oFColor &= tscolor; + + switch (rpmteType(p)) { + case TR_ADDED: + { int reportConflicts = + !(rpmtsFilterFlags(ts) & RPMPROB_FILTER_REPLACENEWFILES); + int done = 0; + + if (otherPkgNum < 0) { + iosmFileAction action; + /* XXX is this test still necessary? */ + if (fi->actions[i] != FA_UNKNOWN) + /*@switchbreak@*/ break; +#ifdef REFERENCE + if (rpmfiConfigConflict(fi)) +#else + if (FF_ISSET(FFlags, CONFIG) && FF_ISSET(FFlags, EXISTS)) +#endif + { + /* Here is a non-overlapped pre-existing config file. */ + action = FF_ISSET(FFlags, NOREPLACE) + ? FA_ALTNAME : FA_BACKUP; + } else { + action = FA_CREATE; + } +#ifdef REFERENCE + rpmfsSetAction(fs, i, action); +#else + fi->actions[i] = action; +#endif + /*@switchbreak@*/ break; + } + +assert(otherFi != NULL); + /* Mark added overlapped non-identical files as a conflict. */ + if (rpmfiCompare(otherFi, fi)) { + int rConflicts; + + rConflicts = reportConflicts; + /* Resolve file conflicts to prefer Elf64 (if not forced) ... */ + if (tscolor != 0) { + if (FColor & prefcolor) { + /* ... last file of preferred colour is installed ... */ + if (!iosmFileActionSkipped((iosmFileAction) fi->actions[i])) { +#ifdef DEAD + /* XXX static helpers are order dependent. Ick. */ + if (strcmp(fn, "/usr/sbin/libgcc_post_upgrade") + && strcmp(fn, "/usr/sbin/glibc_post_upgrade")) +#endif + otherFi->actions[otherFileNum] = FA_SKIPCOLOR; + } + fi->actions[i] = FA_CREATE; + rConflicts = 0; + } else + if (oFColor & prefcolor) { + /* ... first file of preferred colour is installed ... */ + if (iosmFileActionSkipped((iosmFileAction) fi->actions[i])) + otherFi->actions[otherFileNum] = FA_CREATE; + fi->actions[i] = FA_SKIPCOLOR; + rConflicts = 0; + } else + if (FColor == 0 && oFColor == 0) { + /* ... otherwise, do both, last in wins. */ + otherFi->actions[otherFileNum] = FA_CREATE; + fi->actions[i] = FA_CREATE; + rConflicts = 0; + } + done = 1; + } + + if (rConflicts) { + rpmpsAppend(ps, RPMPROB_NEW_FILE_CONFLICT, + rpmteNEVR(p), rpmteKey(p), + fn, NULL, + rpmteNEVR((rpmte) otherFi->te), + 0); + } + } + + /* Try to get the disk accounting correct even if a conflict. */ + fixupSize = rpmfiFSize(otherFi); + +#ifdef REFERENCE + if (rpmfiConfigConflict(fi)) +#else /* REFERENCE */ + if (FF_ISSET(FFlags, CONFIG) && FF_ISSET(FFlags, EXISTS)) +#endif /* REFERENCE */ + { + /* Here is an overlapped pre-existing config file. */ + fi->actions[i] = FF_ISSET(FFlags, NOREPLACE) + ? FA_ALTNAME : FA_SKIP; + } else { + if (!done) + fi->actions[i] = FA_CREATE; + } + } /*@switchbreak@*/ break; + + case TR_REMOVED: + if (otherPkgNum >= 0) { +assert(otherFi != NULL); + /* Here is an overlapped added file we don't want to nuke. */ + if (otherFi->actions[otherFileNum] != FA_ERASE) { + /* On updates, don't remove files. */ + fi->actions[i] = FA_SKIP; + /*@switchbreak@*/ break; + } + /* Here is an overlapped removed file: skip in previous. */ + otherFi->actions[otherFileNum] = FA_SKIP; + } + if (iosmFileActionSkipped((iosmFileAction) fi->actions[i])) + /*@switchbreak@*/ break; + if (rpmfiFState(fi) != RPMFILE_STATE_NORMAL) + /*@switchbreak@*/ break; + + /* Disposition is assumed to be FA_ERASE. */ + fi->actions[i] = FA_ERASE; + if (!(S_ISREG(FMode) && FF_ISSET(FFlags, CONFIG))) + /*@switchbreak@*/ break; + + /* Check for pre-existing modified config file that needs saving. */ + if (!FF_ISSET(FFlags,SPARSE)) + { int dalgo = 0; + size_t dlen = 0; + const unsigned char * digest = rpmfiDigest(fi, &dalgo, &dlen); + unsigned char * fdigest; +assert(digest != NULL); + + fdigest = (unsigned char *) xcalloc(1, dlen); + /* Save (by renaming) locally modified config files. */ + if (!dodigest(dalgo, fn, fdigest, 0, NULL) + && memcmp(digest, fdigest, dlen)) + fi->actions[i] = FA_BACKUP; + fdigest = _free(fdigest); + } + /*@switchbreak@*/ break; + } + + /* Update disk space info for a file. */ +#ifdef REFERENCE + rpmtsUpdateDSI(ts, fiFps->entry->dev, rpmfiFSize(fi), + rpmfiFReplacedSize(fi), fixupSize, rpmfsGetAction(fs, i)); +#else + rpmtsUpdateDSI(ts, fiFps->entry->dev, rpmfiFSize(fi), + fi->replacedSizes[i], fixupSize, fi->actions[i]); +#endif + + } + ps = rpmpsFree(ps); +} + +/** + * Ensure that current package is newer than installed package. + * @param ts transaction set + * @param p current transaction element + * @param h installed header + * @return 0 if not newer, 1 if okay + */ +/*@-nullpass@*/ +static int ensureOlder(rpmts ts, + const rpmte p, const Header h) + /*@globals internalState @*/ + /*@modifies ts, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + evrFlags reqFlags = (evrFlags) (RPMSENSE_LESS | RPMSENSE_EQUAL); + const char * reqEVR; + rpmds req; + char * t; + size_t nb; + int rc; + +FPSDEBUG(0, (stderr, "--> %s(%p,%p,%p)\n", __FUNCTION__, ts, p, h)); + if (p == NULL || h == NULL) + return 1; + + nb = strlen(rpmteNEVR(p)) + (rpmteE(p) != NULL ? strlen(rpmteE(p)) : 0) + 1; +#ifdef RPM_VENDOR_MANDRIVA + nb += (rpmteD(p) != NULL ? strlen(rpmteD(p)) + 1 : 0); +#endif + t = (char *) alloca(nb); + *t = '\0'; + reqEVR = t; + if (rpmteE(p) != NULL) t = stpcpy( stpcpy(t, rpmteE(p)), ":"); + if (rpmteV(p) != NULL) t = stpcpy(t, rpmteV(p)); + *t++ = '-'; + if (rpmteR(p) != NULL) t = stpcpy(t, rpmteR(p)); +#ifdef RPM_VENDOR_MANDRIVA + if (rpmteD(p) != NULL) *t++ = ':', t = stpcpy(t, rpmteD(p)); +#endif + + req = rpmdsSingle(RPMTAG_REQUIRENAME, rpmteN(p), reqEVR, reqFlags); + rc = rpmdsNVRMatchesDep(h, req, _rpmds_nopromote); + (void)rpmdsFree(req); + req = NULL; + + if (rc == 0) { + rpmps ps = rpmtsProblems(ts); + he->tag = RPMTAG_NVRA; + rc = headerGet(h, he, 0); +assert(he->p.str != NULL); + rpmpsAppend(ps, RPMPROB_OLDPACKAGE, + rpmteNEVR(p), rpmteKey(p), + NULL, NULL, + he->p.str, + 0); + he->p.ptr = _free(he->p.ptr); + ps = rpmpsFree(ps); + rc = 1; + } else + rc = 0; + + return rc; +} +/*@=nullpass@*/ + +/** + * Skip any files that do not match install policies. + * @param ts transaction set + * @param fi file info set + */ +/*@-mustmod@*/ /* FIX: fi->actions is modified. */ +/*@-nullpass@*/ +static void rpmtsSkipFiles(const rpmts ts, rpmfi fi) + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*@modifies fi, rpmGlobalMacroContext, internalState @*/ +{ + rpmuint32_t tscolor = rpmtsColor(ts); + rpmuint32_t FColor; + rpmtransFlags tsflags = rpmtsFlags(ts); + int noConfigs = TSF_ISSET(tsflags, NOCONFIGS); + int noDocs = TSF_ISSET(tsflags, NODOCS); + ARGV_t netsharedPaths = NULL; + ARGV_t languages = NULL; + const char * dn, * bn; + size_t dnlen, bnlen; + int ix; + const char * s; + int * drc; + char * dff; + int dc; + int i, j; + int xx; + +FPSDEBUG(0, (stderr, "--> %s(%p,%p)\n", __FUNCTION__, ts, fi)); +#if defined(RPM_VENDOR_OPENPKG) /* allow-excludedocs-default */ + /* The "%_excludedocs" macro is intended to set the _default_ if + both --excludedocs and --includedocs are not specified and it + is evaluated already before. So, do not override it here again, + because it would not allow us to make "%_excludedocs 1" the + default. */ +#else + if (!noDocs) + noDocs = rpmExpandNumeric("%{_excludedocs}"); +#endif + + { const char *tmpPath = rpmExpand("%{?_netsharedpath}", NULL); + if (tmpPath && *tmpPath) + xx = argvSplit(&netsharedPaths, tmpPath, ":"); + tmpPath = _free(tmpPath); + } + + s = rpmExpand("%{?_install_langs}", NULL); + if (!(s && *s)) + s = _free(s); + if (s) { + xx = argvSplit(&languages, s, ":"); + s = _free(s); + } + + /* Compute directory refcount, skip directory if now empty. */ + dc = rpmfiDC(fi); + drc = (int *) alloca(dc * sizeof(*drc)); + memset(drc, 0, dc * sizeof(*drc)); + dff = (char *) alloca(dc * sizeof(*dff)); + memset(dff, 0, dc * sizeof(*dff)); + + fi = rpmfiInit(fi, 0); + if (fi != NULL) /* XXX lclint */ + while ((i = rpmfiNext(fi)) >= 0) + { + ARGV_t nsp; + + bn = rpmfiBN(fi); + bnlen = strlen(bn); + ix = rpmfiDX(fi); + dn = rpmfiDN(fi); + if (dn == NULL) + continue; /* XXX can't happen */ + dnlen = strlen(dn); + + drc[ix]++; + + /* Don't bother with skipped files */ + if (iosmFileActionSkipped((iosmFileAction) fi->actions[i])) { + drc[ix]--; dff[ix] = 1; + continue; + } + + /* Ignore colored files not in our rainbow. */ + FColor = rpmfiFColor(fi); + if (tscolor && FColor && !(tscolor & FColor)) { + drc[ix]--; dff[ix] = 1; + fi->actions[i] = FA_SKIPCOLOR; + continue; + } + + /* + * Skip net shared paths. + * Net shared paths are not relative to the current root (though + * they do need to take package relocations into account). + */ + for (nsp = netsharedPaths; nsp && *nsp; nsp++) { + size_t len; + + len = strlen(*nsp); + if (dnlen >= len) { + if (strncmp(dn, *nsp, len)) + /*@innercontinue@*/ continue; + /* Only directories or complete file paths can be net shared */ + if (!(dn[len] == '/' || dn[len] == '\0')) + /*@innercontinue@*/ continue; + } else { + if (len < (dnlen + bnlen)) + /*@innercontinue@*/ continue; + if (strncmp(dn, *nsp, dnlen)) + /*@innercontinue@*/ continue; + /* Insure that only the netsharedpath basename is compared. */ + if ((s = strchr((*nsp) + dnlen, '/')) != NULL && s[1] != '\0') + /*@innercontinue@*/ continue; + if (strncmp(bn, (*nsp) + dnlen, bnlen)) + /*@innercontinue@*/ continue; + len = dnlen + bnlen; + /* Only directories or complete file paths can be net shared */ + if (!((*nsp)[len] == '/' || (*nsp)[len] == '\0')) + /*@innercontinue@*/ continue; + } + + /*@innerbreak@*/ break; + } + + if (nsp && *nsp) { + drc[ix]--; dff[ix] = 1; + fi->actions[i] = FA_SKIPNETSHARED; + continue; + } + + /* + * Skip i18n language specific files. + */ + if (languages != NULL && fi->flangs != NULL && *fi->flangs[i]) { + ARGV_t lang; + const char *l, *le; + for (lang = languages; *lang != NULL; lang++) { + if (!strcmp(*lang, "all")) + /*@innerbreak@*/ break; + for (l = fi->flangs[i]; *l != '\0'; l = le) { + for (le = l; *le != '\0' && *le != '|'; le++) + {}; + if ((le-l) > 0 && !strncmp(*lang, l, (le-l))) + /*@innerbreak@*/ break; + if (*le == '|') le++; /* skip over | */ + } + if (*l != '\0') + /*@innerbreak@*/ break; + } + if (*lang == NULL) { + drc[ix]--; dff[ix] = 1; + fi->actions[i] = FA_SKIPNSTATE; + continue; + } + } + + /* + * Skip config files if requested. + */ + if (noConfigs && FF_ISSET(rpmfiFFlags(fi), CONFIG)) { + drc[ix]--; dff[ix] = 1; + fi->actions[i] = FA_SKIPNSTATE; + continue; + } + + /* + * Skip documentation if requested. + */ + if (noDocs && FF_ISSET(rpmfiFFlags(fi), DOC)) { + drc[ix]--; dff[ix] = 1; + fi->actions[i] = FA_SKIPNSTATE; + continue; + } + } + + /* Skip (now empty) directories that had skipped files. */ +#ifndef NOTYET + if (fi != NULL) /* XXX can't happen */ + for (j = 0; j < dc; j++) +#else + if ((fi = rpmfiInitD(fi)) != NULL) + while (j = rpmfiNextD(fi) >= 0) +#endif + { + + if (drc[j]) continue; /* dir still has files. */ + if (!dff[j]) continue; /* dir was not emptied here. */ + + /* Find parent directory and basename. */ + dn = fi->dnl[j]; dnlen = strlen(dn) - 1; + bn = dn + dnlen; bnlen = 0; + while (bn > dn && bn[-1] != '/') { + bnlen++; + dnlen--; + bn--; + } + + /* If explicitly included in the package, skip the directory. */ + fi = rpmfiInit(fi, 0); + if (fi != NULL) /* XXX lclint */ + while ((i = rpmfiNext(fi)) >= 0) { + const char * fdn, * fbn; + rpmuint16_t fFMode; + + if (iosmFileActionSkipped((iosmFileAction) fi->actions[i])) + /*@innercontinue@*/ continue; + + fFMode = rpmfiFMode(fi); + + if (!S_ISDIR(fFMode)) + /*@innercontinue@*/ continue; + fdn = rpmfiDN(fi); + if (strlen(fdn) != dnlen) + /*@innercontinue@*/ continue; + if (strncmp(fdn, dn, dnlen)) + /*@innercontinue@*/ continue; + fbn = rpmfiBN(fi); + if (strlen(fbn) != bnlen) + /*@innercontinue@*/ continue; + if (strncmp(fbn, bn, bnlen)) + /*@innercontinue@*/ continue; + rpmlog(RPMLOG_DEBUG, D_("excluding directory %s\n"), dn); + fi->actions[i] = FA_SKIPNSTATE; + /*@innerbreak@*/ break; + } + } + +/*@-dependenttrans@*/ + netsharedPaths = argvFree(netsharedPaths); + languages = argvFree(languages); +/*@=dependenttrans@*/ +} +/*@=nullpass@*/ +/*@=mustmod@*/ + +/** + * Return transaction element's file info. + * @todo Take a rpmfi refcount here. + * @param tsi transaction element iterator + * @return transaction element file info + */ +static /*@null@*/ +rpmfi rpmtsiFi(const rpmtsi tsi) + /*@*/ +{ + rpmfi fi = NULL; + + if (tsi != NULL && tsi->ocsave != -1) { + /*@-type -abstract@*/ /* FIX: rpmte not opaque */ + rpmte te = rpmtsElement(tsi->ts, tsi->ocsave); + /*@-assignexpose@*/ + if (te != NULL && (fi = te->fi) != NULL) + fi->te = te; + /*@=assignexpose@*/ + /*@=type =abstract@*/ + } + /*@-compdef -refcounttrans -usereleased @*/ + return fi; + /*@=compdef =refcounttrans =usereleased @*/ +} + +/** + * Search for string B in argv array AV. + * @param AV argv array + * @param B string + * @return 1 if found, 0 otherwise + */ +static int cmpArgvStr(/*@null@*/ const char ** AV, /*@null@*/ const char * B) + /*@*/ +{ + const char ** a; + + if (AV != NULL && B != NULL) + for (a = AV; *a != NULL; a++) { + if (**a && *B && !strcmp(*a, B)) + return 1; + } + return 0; +} + +/** + * Mark all erasure elements linked to installed element p as failed. + * @param ts transaction set + * @param p failed install transaction element + * @return 0 always + */ +static int rpmtsMarkLinkedFailed(rpmts ts, rpmte p) + /*@globals fileSystem @*/ + /*@modifies ts, p, fileSystem @*/ +{ + rpmtsi qi; rpmte q; + int bingo; + + p->linkFailed = 1; + + qi = rpmtsiInit(ts); + while ((q = rpmtsiNext(qi, TR_REMOVED)) != NULL) { + + if (q->done) + continue; + + /* + * Either element may have missing data and can have multiple entries. + * Try for hdrid, then pkgid, finally NEVRA, argv vs. argv compares. + */ + bingo = cmpArgvStr(q->flink.Hdrid, p->hdrid); + if (!bingo) + bingo = cmpArgvStr(q->flink.Pkgid, p->pkgid); + if (!bingo) + bingo = cmpArgvStr(q->flink.NEVRA, p->NEVRA); + + if (!bingo) + continue; + + q->linkFailed = p->linkFailed; + } + qi = rpmtsiFree(qi); + + return 0; +} + +/* ================================================================= */ + +/* Get a rpmdbMatchIterator containing all files in + * the rpmdb that share the basename with one from + * the transaction. + * @param ts transaction set + * @param fileCount no. of files + * @return rpmmi sorted by (package, fileNum) + */ +static +rpmmi rpmtsFindBaseNamesInDB(rpmts ts, uint32_t fileCount) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ +{ + rpmtsi pi; rpmte p; + rpmfi fi; + rpmmi mi; + int i, xx; + const char * s; + size_t ns; + void * ptr; + static rpmTag _tag = RPMTAG_BASENAMES; + size_t n = (fileCount > 10 ? fileCount : 10); + static double e = 1.0e-4; + size_t m = 0; + size_t k = 0; + rpmbf bf; + +FPSDEBUG(0, (stderr, "--> %s(%p,%u)\n", __FUNCTION__, ts, (unsigned)fileCount)); + rpmbfParams(n, e, &m, &k); + bf = rpmbfNew(m, k, 0); + + mi = rpmmiInit(rpmtsGetRdb(ts), _tag, NULL, 0); + + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, (rpmElementType) 0)) != NULL) { + + (void) rpmdbCheckSignals(); + + if ((fi = rpmteFI(p, _tag)) == NULL) + continue; /* XXX can't happen */ + + ptr = rpmtsNotify(ts, NULL, RPMCALLBACK_TRANS_PROGRESS, rpmtsiOc(pi), + ts->orderCount); + + /* Gather all installed headers with matching basename's. */ + fi = rpmfiInit(fi, 0); + while ((i = rpmfiNext(fi)) >= 0) { + s = rpmfiBN(fi); + ns = strlen(s); + + if (ns == 0) /* XXX "/" fixup */ + /*@innercontinue@*/ continue; + if (rpmbfChk(bf, s, ns)) + /*@innercontinue@*/ continue; + + xx = rpmmiGrowBasename(mi, s); + + xx = rpmbfAdd(bf, s, ns); + } + } + pi = rpmtsiFree(pi); + bf = rpmbfFree(bf); + + (void) rpmmiSort(mi); + + return mi; +} + +/* Check files in the transactions against the rpmdb + * Lookup all files with the same basename in the rpmdb + * and then check for matching finger prints + * @param ts transaction set + * @param fpc global finger print cache + */ +static +int rpmtsCheckInstalledFiles(rpmts ts, uint32_t fileCount, + hashTable ht, fingerPrintCache fpc) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, fpc, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ +{ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + rpmTagData BN = { NULL }; + rpmTagData DN = { NULL }; + rpmTagData DI = { NULL }; + rpmTagData FSTATES = { NULL }; + rpmuint32_t fc; + + rpmte p; + rpmmi mi; + Header h; + rpmfi fi; + + const char * oldDir; + int beingRemoved; + rpmfi otherFi = NULL; + unsigned int fileNum; + int xx; + int rc = 0; + +FPSDEBUG(0, (stderr, "--> %s(%p,%u,%p,%p)\n", __FUNCTION__, ts, (unsigned)fileCount, ht, fpc)); + +rpmlog(RPMLOG_DEBUG, D_("computing file dispositions\n")); + + /* XXX fileCount == 0 installing src.rpm's */ + if (fileCount == 0) + return rc; + + mi = rpmtsFindBaseNamesInDB(ts, fileCount); + + /* Loop over all packages from the rpmdb */ + while ((h = rpmmiNext(mi)) != NULL) { + fingerPrint fp; + uint32_t hdrNum = rpmmiInstance(mi); + uint32_t tagNum = rpmmiBNTag(mi); + int i; + int j; + + /* Is this package being removed? */ + beingRemoved = 0; + if (ts->removedPackages != NULL) + for (j = 0; j < ts->numRemovedPackages; j++) { + if (ts->removedPackages[j] != hdrNum) + /*@innercontinue@*/ continue; + beingRemoved = 1; + /*@innerbreak@*/ break; + } + + he->tag = RPMTAG_BASENAMES; + xx = headerGet(h, he, 0); + BN.argv = (xx ? he->p.argv : NULL); + fc = (xx ? he->c : 0); + + he->tag = RPMTAG_DIRNAMES; + xx = headerGet(h, he, 0); + DN.argv = (xx ? he->p.argv : NULL); + he->tag = RPMTAG_DIRINDEXES; + xx = headerGet(h, he, 0); + DI.ui32p = (xx ? he->p.ui32p : NULL); + he->tag = RPMTAG_FILESTATES; + xx = headerGet(h, he, 0); + FSTATES.ui8p = (xx ? he->p.ui8p : NULL); + + /* loop over all interesting files in that package */ + oldDir = NULL; + for (i = 0; i < (int)fc; i++) { + const char * baseName = BN.argv[i]; + rpmuint32_t baseKey = hashFunctionString(0, baseName, 0); + int gotRecs; + struct rpmffi_s ** recs; + int numRecs; + const char * dirName; + + /* Skip uninteresting basenames. */ + if (baseKey != tagNum) + /*@innercontinue@*/ continue; + fileNum = i; + dirName = DN.argv[DI.ui32p[fileNum]]; + + /* lookup finger print for this file */ + if (dirName == oldDir) { + /* directory is the same as last round */ + fp.baseName = baseName; + } else { + fp = fpLookup(fpc, dirName, baseName, 1); + oldDir = dirName; + } + + /* search for files in the transaction with same finger print */ + recs = NULL; + numRecs = 0; +#ifdef REFERENCE + gotRecs = rpmFpHashGetEntry(ht, &fp, &recs, &numRecs, NULL); +#else /* REFERENCE */ + gotRecs = (htGetEntry(ts->ht, &fp, &recs, &numRecs, NULL) == 0); +#endif /* REFERENCE */ + + for (j = 0; j < numRecs && gotRecs; j++) { + p = recs[j]->p; + fi = rpmteFI(p, RPMTAG_BASENAMES); + + /* Determine the fate of each file. */ + switch (rpmteType(p)) { + case TR_ADDED: + if (otherFi == NULL) { + static int scareMem = 0; + otherFi = rpmfiNew(ts, h, RPMTAG_BASENAMES, scareMem); + } + (void) rpmfiSetFX(fi, recs[j]->fileno); + (void) rpmfiSetFX(otherFi, fileNum); + xx = handleInstInstalledFile(ts, p, fi, h, otherFi, beingRemoved); + /*@switchbreak@*/ break; + case TR_REMOVED: + if (!beingRemoved) { + (void) rpmfiSetFX(fi, recs[j]->fileno); +#ifdef REFERENCE + if (*rpmtdGetChar(&ostates) == RPMFILE_STATE_NORMAL) { + rpmfs fs = rpmteGetFileStates(p); + rpmfsSetAction(fs, recs[j].fileno, FA_SKIP); + } +#else + if (FSTATES.ui8p[fileNum] == RPMFILE_STATE_NORMAL) + fi->actions[recs[j]->fileno] = FA_SKIP; +#endif + } + /*@switchbreak@*/ break; + } + } + + } + + otherFi = rpmfiFree(otherFi); + FSTATES.ptr = _free(FSTATES.ptr); + DI.ptr = _free(DI.ptr); + DN.ptr = _free(DN.ptr); + BN.ptr = _free(BN.ptr); + } + + mi = rpmmiFree(mi); + + return rc; +} + +/* + * For packages being installed: + * - verify package arch/os. + * - verify package epoch:version-release is newer. + */ +static rpmps rpmtsSanityCheck(rpmts ts, uint32_t * tfcp) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, *tfcp, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ +{ + rpmps ps; + rpmtsi pi; + rpmte p; + rpmfi fi; + uint32_t totalFileCount = 0; + int fc; + +FPSDEBUG(0, (stderr, "--> %s(%p,%p)\n", __FUNCTION__, ts, tfcp)); +rpmlog(RPMLOG_DEBUG, D_("sanity checking %d elements\n"), rpmtsNElements(ts)); + ps = rpmtsProblems(ts); + /* The ordering doesn't matter here */ + pi = rpmtsiInit(ts); + /* XXX Only added packages need be checked. */ + while ((p = rpmtsiNext(pi, TR_ADDED)) != NULL) { + int xx; + + if (p->isSource) continue; + if ((fi = rpmtsiFi(pi)) == NULL) + continue; /* XXX can't happen */ + fc = rpmfiFC(fi); + +#ifdef REFERENCE + if (!(rpmtsFilterFlags(ts) & RPMPROB_FILTER_IGNOREARCH)) + if (!archOkay(rpmteA(p))) + rpmpsAppend(ps, RPMPROB_BADARCH, + rpmteNEVRA(p), rpmteKey(p), + rpmteA(p), NULL, + NULL, 0); + + if (!(rpmtsFilterFlags(ts) & RPMPROB_FILTER_IGNOREOS)) + if (!osOkay(rpmteO(p))) + rpmpsAppend(ps, RPMPROB_BADOS, + rpmteNEVRA(p), rpmteKey(p), + rpmteO(p), NULL, + NULL, 0); +#endif /* REFERENCE */ + + if (!(rpmtsFilterFlags(ts) & RPMPROB_FILTER_OLDPACKAGE)) { + rpmmi mi = rpmtsInitIterator(ts, RPMTAG_NAME, rpmteN(p), 0); + Header h; + while ((h = rpmmiNext(mi)) != NULL) + xx = ensureOlder(ts, p, h); + mi = rpmmiFree(mi); + } + + if (!(rpmtsFilterFlags(ts) & RPMPROB_FILTER_REPLACEPKG)) { + ARGV_t keys = NULL; + int nkeys; + xx = rpmdbMireApply(rpmtsGetRdb(ts), RPMTAG_NVRA, + RPMMIRE_STRCMP, rpmteNEVRA(p), &keys); + nkeys = argvCount(keys); + + /* mdvbz: #63711 + * workaround for epoch & distepoch not being part of RPMTAG_NVRA, + * leading to packages of same VRA but with different epoch or distepoch + * being treated as the same package */ + if (nkeys > 0) { + int i, t; + rpmTag tags[2] = { RPMTAG_EPOCH, RPMTAG_DISTEPOCH }; + for (t = 0; t < 2; t++) { + for (i = 0; i < nkeys; i++) { + rpmmi mi = rpmtsInitIterator(ts, RPMTAG_NVRA, keys[i], 0); + Header h; + while ((h = rpmmiNext(mi)) != NULL) { + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + const char *val = NULL; + he->tag = tags[t]; + xx = headerGet(h, he, 0); + if (he->tag == RPMTAG_EPOCH) + val = rpmteE(p); + else if (he->tag == RPMTAG_DISTEPOCH) + val = rpmteD(p); + if (strcmp(he->p.str ? he->p.str : "", val ? val : "")) + nkeys--; + he->p.ptr = _free(he->p.ptr); + } + mi = rpmmiFree(mi); + } + } + } + if (nkeys > 0) + rpmpsAppend(ps, RPMPROB_PKG_INSTALLED, + rpmteNEVR(p), rpmteKey(p), + NULL, NULL, + NULL, 0); + keys = argvFree(keys); + } + +#ifdef REFERENCE + /* XXX rpmte problems can only be relocation problems atm */ + if (!(rpmtsFilterFlags(ts) & RPMPROB_FILTER_FORCERELOCATE)) { + rpmpsi psi = rpmpsInitIterator(rpmteProblems(p)); + while (rpmpsNextIterator(psi) >= 0) { + rpmpsAppendProblem(ps, rpmpsGetProblem(psi)); + } + rpmpsFreeIterator(psi); + } +#endif /* REFERENCE */ + + /* Count no. of files (if any). */ + totalFileCount += fc; + + } + pi = rpmtsiFree(pi); + + /* The ordering doesn't matter here */ + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, TR_REMOVED)) != NULL) { + + if (p->isSource) continue; + if ((fi = rpmtsiFi(pi)) == NULL) + continue; /* XXX can't happen */ + fc = rpmfiFC(fi); + + totalFileCount += fc; + } + pi = rpmtsiFree(pi); + + if (tfcp) + *tfcp = totalFileCount; + + return ps; +} + +/* + * Run pre/post transaction script. + * param ts transaction set + * param stag RPMTAG_PRETRANS or RPMTAG_POSTTRANS + * return 0 on success + */ +static int rpmtsRunScript(rpmts ts, rpmTag stag) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ +{ + rpmtsi pi; + rpmte p; + rpmfi fi; + rpmpsm psm; + int xx; + rpmTag ptag; + +FPSDEBUG(0, (stderr, "--> %s(%p,%s(%u))\n", __FUNCTION__, ts, tagName(stag), (unsigned)stag)); + switch (stag) { + default: +assert(0); + /*@notreached@*/ break; + case RPMTAG_PRETRANS: ptag = RPMTAG_PRETRANSPROG; break; + case RPMTAG_POSTTRANS: ptag = RPMTAG_POSTTRANSPROG; break; + } + + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, TR_ADDED)) != NULL) { + if (p->isSource) continue; + if ((fi = rpmtsiFi(pi)) == NULL) + continue; /* XXX can't happen */ + + /* If no prre/post transaction script, then don't bother. */ + if (!rpmteHaveTransScript(p, stag)) + continue; + + if (rpmteOpen(p, ts, 0)) { + if (p->fi != NULL) /* XXX can't happen */ + p->fi->te = p; +#ifdef REFERENCE + psm = rpmpsmNew(ts, p); +#else /* REFERENCE */ + psm = rpmpsmNew(ts, p, p->fi); +#endif /* REFERENCE */ + xx = rpmpsmScriptStage(psm, stag, ptag); + psm = rpmpsmFree(psm, __FUNCTION__); + xx = rpmteClose(p, ts, 0); + } + } + pi = rpmtsiFree(pi); + + return 0; +} + +/* Add fingerprint for each file not skipped. */ +static void rpmtsAddFingerprints(rpmts ts, uint32_t fileCount, hashTable ht, + fingerPrintCache fpc) + /*@modifies ts, fpc @*/ +{ + rpmtsi pi; + rpmte p; + rpmfi fi; + int i; + + hashTable symlinks = htCreate(fileCount/16+16, 0, 0, fpHashFunction, fpEqual); + +FPSDEBUG(0, (stderr, "--> %s(%p,%u,%p,%p)\n", __FUNCTION__, ts, (unsigned)fileCount, ht, fpc)); + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, (rpmElementType) 0)) != NULL) { + (void) rpmdbCheckSignals(); + + if (p->isSource) continue; + if ((fi = rpmtsiFi(pi)) == NULL) + continue; /* XXX can't happen */ + + (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_FINGERPRINT), 0); + + rpmfiFpLookup(fi, fpc); + + /* Collect symlinks. */ + fi = rpmfiInit(fi, 0); + if (fi != NULL) /* XXX lclint */ + while ((i = rpmfiNext(fi)) >= 0) { + char const *linktarget; + linktarget = rpmfiFLink(fi); + if (!(linktarget && *linktarget != '\0')) + /*@innercontinue@*/ continue; + if (iosmFileActionSkipped((iosmFileAction) fi->actions[i])) + /*@innercontinue@*/ continue; +#ifdef REFERENCE + { struct rpmffi_s ffi; + ffi.p = p; + ffi.fileno = i; + htAddEntry(symlinks, rpmfiFpsIndex(fi, i), ffi); + } +#else + { struct rpmffi_s *ffip = (struct rpmffi_s *) alloca(sizeof(*ffip)); +/*@-dependenttrans@*/ + ffip->p = p; +/*@=dependenttrans@*/ + ffip->fileno = i; + htAddEntry(symlinks, fi->fps + i, (void *) ffip); + } +#endif + } + + (void) rpmswExit(rpmtsOp(ts, RPMTS_OP_FINGERPRINT), rpmfiFC(fi)); + + } + pi = rpmtsiFree(pi); + + /* =============================================== + * Check fingerprints if they contain symlinks + * and add them to the hash table + */ + + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, (rpmElementType) 0)) != NULL) { + (void) rpmdbCheckSignals(); + + if (p->isSource) continue; + if ((fi = rpmteFI(p, RPMTAG_BASENAMES)) == NULL) + continue; /* XXX can't happen */ + fi = rpmfiInit(fi, 0); + (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_FINGERPRINT), 0); + while ((i = rpmfiNext(fi)) >= 0) { +#ifdef REFERENCE + if (XFA_SKIPPING(rpmfsGetAction(rpmteGetFileStates(p), i))) + continue; +#else + if (iosmFileActionSkipped((iosmFileAction) fi->actions[i])) + /*@innercontinue@*/ continue; +#endif + fpLookupSubdir(symlinks, ht, fpc, p, i); + } + (void) rpmswExit(rpmtsOp(ts, RPMTS_OP_FINGERPRINT), 0); + } + pi = rpmtsiFree(pi); + + symlinks = htFree(symlinks); + +} + +static int rpmtsSetup(rpmts ts, rpmprobFilterFlags ignoreSet, rpmsx * sxp) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, *sxp, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ +{ + rpmtransFlags tsflags = rpmtsFlags(ts); + int xx; + +/*@+voidabstract@*/ +FPSDEBUG(0, (stderr, "--> %s(%p,0x%x,%p)\n", __FUNCTION__, ts, ignoreSet, (void *)sxp)); +/*@=voidabstract@*/ + /* --noscripts implies no scripts or triggers, duh. */ + if (TSF_ISSET(tsflags, NOSCRIPTS)) { + TSF_SET(tsflags, NOPRETRANS); + TSF_SET(tsflags, NOPRE); + TSF_SET(tsflags, NOPOST); + TSF_SET(tsflags, NOPREUN); + TSF_SET(tsflags, NOPOSTUN); + TSF_SET(tsflags, NOPOSTTRANS); + + TSF_SET(tsflags, NOTRIGGERPREIN); + TSF_SET(tsflags, NOTRIGGERIN); + TSF_SET(tsflags, NOTRIGGERUN); + TSF_SET(tsflags, NOTRIGGERPOSTUN); + + (void) rpmtsSetFlags(ts, tsflags); + } + /* --notriggers implies no triggers, duh. */ + if (TSF_ISSET(tsflags, NOTRIGGERS)) { + TSF_SET(tsflags, NOTRIGGERPREIN); + TSF_SET(tsflags, NOTRIGGERIN); + TSF_SET(tsflags, NOTRIGGERUN); + TSF_SET(tsflags, NOTRIGGERPOSTUN); + (void) rpmtsSetFlags(ts, tsflags); + } + + /* --justdb implies no scripts or triggers, duh. */ + if (TSF_ISSET(tsflags, JUSTDB)) { + TSF_SET(tsflags, NOPRETRANS); + TSF_SET(tsflags, NOPRE); + TSF_SET(tsflags, NOPOST); + TSF_SET(tsflags, NOPREUN); + TSF_SET(tsflags, NOPOSTUN); + TSF_SET(tsflags, NOPOSTTRANS); + + TSF_SET(tsflags, NOTRIGGERPREIN); + TSF_SET(tsflags, NOTRIGGERIN); + TSF_SET(tsflags, NOTRIGGERUN); + TSF_SET(tsflags, NOTRIGGERPOSTUN); + + (void) rpmtsSetFlags(ts, tsflags); + } + + /* if SELinux isn't enabled or init fails, don't bother... */ + if (!rpmtsSELinuxEnabled(ts)) { + TSF_SET(tsflags, NOCONTEXTS); + TSF_SET(tsflags, NOPOLICY); + (void) rpmtsSetFlags(ts, tsflags); + } + + if (!(TSF_ISSET(tsflags, NOCONTEXTS) || TSF_ISSET(tsflags, NOPOLICY))) { + *sxp = rpmsxNew("%{?_install_file_context_path}", 0); + if (*sxp == NULL) { + TSF_SET(tsflags, NOCONTEXTS); + TSF_SET(tsflags, NOPOLICY); + (void) rpmtsSetFlags(ts, tsflags); + } + } else + *sxp = NULL; + + /* XXX Make sure the database is open RDWR for package install/erase. */ + { int dbmode = O_RDONLY; + + if (!TSF_ISSET(tsflags, TEST)) { + rpmtsi pi; + rpmte p; + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, (rpmElementType) 0)) != NULL) { + if (p->isSource) continue; + dbmode = (O_RDWR|O_CREAT); + break; + } + pi = rpmtsiFree(pi); + } + + /* Open database RDWR for installing packages. */ + if (rpmtsOpenDB(ts, dbmode)) + return -1; /* XXX W2DO? */ + + } + + ts->ignoreSet = ignoreSet; + ts->probs = rpmpsFree(ts->probs); + + { const char * currDir = currentDirectory(); + rpmtsSetCurrDir(ts, currDir); + currDir = _free(currDir); + } + + (void) rpmtsSetChrootDone(ts, 0); + + /* XXX rpmtsCreate() sets the transaction id, but apps may not honor. */ + { rpmuint32_t tid = (rpmuint32_t) time(NULL); + (void) rpmtsSetTid(ts, tid); + } + + /* Get available space on mounted file systems. */ + xx = rpmtsInitDSI(ts); + + return 0; +} + +static int rpmtsFinish(rpmts ts, /*@only@*/ rpmsx sx) + /*@modifies sx @*/ +{ +FPSDEBUG(0, (stderr, "--> %s(%p,%p)\n", __FUNCTION__, ts, sx)); +#ifdef REFERENCE + rpmtransFlags tsflags = rpmtsFlags(ts); + if (!TSF_ISSET(tsflags, NOCONTEXTS)) + matchpathcon_fini(); +#else /* REFERENCE */ + if (sx != NULL) sx = rpmsxFree(sx); +#endif /* REFERENCE */ + return 0; +} + +static int rpmtsPrepare(rpmts ts, rpmsx sx, uint32_t fileCount, + uint32_t * nrmvdp) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, *nrmvdp, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ +{ + rpmtsi pi; + rpmte p; + fingerPrintCache fpc; + rpmfi fi; + int xx; + int rc = 0; + +#ifdef REFERENCE + uint64_t fileCount = countFiles(ts); + const char * rootDir = rpmtsRootDir(ts); + int dochroot = (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/'); + + rpmFpHash ht = rpmFpHashCreate(fileCount/2+1, fpHashFunction, fpEqual, + NULL, NULL); + + fpc = fpCacheCreate(fileCount/2 + 10001); + + rpmlog(RPMLOG_DEBUG, "computing %" PRIu64 " file fingerprints\n", fileCount); + + /* Skip netshared paths, not our i18n files, and excluded docs */ + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, TR_ADDED)) != NULL) { + if ((fi = rpmteFI(p)) == NULL) + continue; /* XXX can't happen */ + + if (rpmfiFC(fi) > 0) + rpmtsSkipFiles(ts, p); + } + pi = rpmtsiFree(pi); + + /* Enter chroot for fingerprinting if necessary */ + if (!rpmtsChrootDone(ts)) { + xx = chdir("/"); + if (dochroot) { + /* opening db before chroot not optimal, see rhbz#103852 c#3 */ + xx = rpmdbOpenAll(ts->rdb); + if (chroot(rootDir) == -1) { + rpmlog(RPMLOG_ERR, _("Unable to change root directory: %m\n")); + rc = -1; + goto exit; + } + } + (void) rpmtsSetChrootDone(ts, 1); + } + +#else /* REFERENCE */ + + void * ptr; + uint32_t numAdded = 0; + uint32_t numRemoved = 0; + +FPSDEBUG(0, (stderr, "--> %s(%p,%p,%u,%p)\n", __FUNCTION__, ts, sx, (unsigned)fileCount, nrmvdp)); +rpmlog(RPMLOG_DEBUG, D_("computing %u file fingerprints\n"), (unsigned)fileCount); + + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, (rpmElementType) 0)) != NULL) { + int fc; + + if (p->isSource) continue; + if ((fi = rpmtsiFi(pi)) == NULL) + continue; /* XXX can't happen */ + fc = rpmfiFC(fi); + + switch (rpmteType(p)) { + case TR_ADDED: + numAdded++; + fi->record = 0; + /* Skip netshared paths, not our i18n files, and excluded docs */ + if (fc > 0) + rpmtsSkipFiles(ts, fi); + /*@switchbreak@*/ break; + case TR_REMOVED: + numRemoved++; + fi->record = rpmteDBOffset(p); + /*@switchbreak@*/ break; + } + + fi->fps = (struct fingerPrint_s *) + (fc > 0 ? xmalloc(fc * sizeof(*fi->fps)) : NULL); + } + pi = rpmtsiFree(pi); + + if (nrmvdp) + *nrmvdp = numRemoved; + + if (!rpmtsChrootDone(ts)) { + const char * rootDir = rpmtsRootDir(ts); + static int openall_before_chroot = -1; + + if (openall_before_chroot < 0) + openall_before_chroot = rpmExpandNumeric("%{?_openall_before_chroot}"); + + xx = Chdir("/"); + /*@-modobserver@*/ + if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/') { + if (openall_before_chroot) + xx = rpmdbOpenAll(rpmtsGetRdb(ts)); + xx = Chroot(rootDir); + } + /*@=modobserver@*/ + (void) rpmtsSetChrootDone(ts, 1); + } + + ts->ht = htCreate(fileCount/2 + 1, 0, 1, fpHashFunction, fpEqual); + fpc = fpCacheCreate(fileCount/2 + 10001); + +#endif /* REFERENCE */ + + ptr = rpmtsNotify(ts, NULL, RPMCALLBACK_TRANS_START, 6, ts->orderCount); + + /* =============================================== + * Add fingerprint for each file not skipped. + */ +#ifdef REFERENCE + rpmtsAddFingerprints(ts, fileCount, ht, fpc); +#else /* REFERENCE */ + rpmtsAddFingerprints(ts, fileCount, ts->ht, fpc); +#endif /* REFERENCE */ + + /* =============================================== + * Compute file disposition for each package in transaction set. + */ +#ifdef REFERENCE + rpmtsCheckInstalledFiles(ts, fileCount, ht, fpc); +#else /* REFERENCE */ + rc = rpmtsCheckInstalledFiles(ts, fileCount, ts->ht, fpc); + if (rc) + goto exit; +#endif /* REFERENCE */ + + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, (rpmElementType) 0)) != NULL) { + if ((fi = rpmteFI(p, RPMTAG_BASENAMES)) == NULL) + continue; /* XXX can't happen */ + /* XXX Set all SRPM files to FA_CREATE. */ + if (p->isSource) { + int i; + fi = rpmfiInit(fi, 0); + if (fi != NULL) + while ((i = rpmfiNext(fi)) >= 0) + fi->actions[i] = FA_CREATE; + continue; + } + + (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_FINGERPRINT), 0); + + /* Update disk space needs on each partition for this package. */ +/*@-nullpass@*/ +#ifdef REFERENCE + handleOverlappedFiles(ts, ht, p, fi); +#else /* REFERENCE */ + handleOverlappedFiles(ts, p, fi); +#endif /* REFERENCE */ +/*@=nullpass@*/ + + /* Check added package has sufficient space on each partition used. */ + switch (rpmteType(p)) { + case TR_ADDED: + rpmtsCheckDSIProblems(ts, p); + /*@switchbreak@*/ break; + case TR_REMOVED: + /*@switchbreak@*/ break; + } + (void) rpmswExit(rpmtsOp(ts, RPMTS_OP_FINGERPRINT), rpmfiFC(fi)); + } + pi = rpmtsiFree(pi); + + if (rpmtsChrootDone(ts)) { + const char * rootDir = rpmtsRootDir(ts); + const char * currDir = rpmtsCurrDir(ts); + /*@-modobserver@*/ + if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/') + xx = Chroot("."); + /*@=modobserver@*/ + (void) rpmtsSetChrootDone(ts, 0); + if (currDir != NULL) + xx = Chdir(currDir); + } + + ptr = rpmtsNotify(ts, NULL, RPMCALLBACK_TRANS_STOP, 6, ts->orderCount); + + /* =============================================== + * Free unused memory as soon as possible. + */ +#ifdef REFERENCE + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, (rpmElementType) 0)) != NULL) { + rpmteSetFI(p, NULL); + } + pi = rpmtsiFree(pi); +#else /* REFERENCE */ + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, (rpmElementType) 0)) != NULL) { + if (p->isSource) continue; + if ((fi = rpmtsiFi(pi)) == NULL) + continue; /* XXX can't happen */ + if (rpmfiFC(fi) == 0) + continue; + fi->fps = _free(fi->fps); + } + pi = rpmtsiFree(pi); +#endif /* REFERENCE */ + +exit: +#ifdef REFERENCE + ht = rpmFpHashFree(ht); +#else /* REFERENCE */ + ts->ht = htFree(ts->ht); +#endif /* REFERENCE */ + fpc = fpCacheFree(fpc); + + return rc; +} + +/* + * Transaction main loop: install and remove packages + */ +static int rpmtsProcess(rpmts ts, rpmprobFilterFlags ignoreSet, + int rollbackFailures) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ +{ + rpmtsi pi; + rpmte p; + int rc = 0; + +FPSDEBUG(0, (stderr, "--> %s(%p,0x%x,%d)\n", __FUNCTION__, ts, ignoreSet, rollbackFailures)); + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, (rpmElementType) 0)) != NULL) { + rpmfi fi; + rpmop sw; + rpmpsm psm = NULL; + pkgStage stage = PSM_UNKNOWN; + int failed; + int gotfd; + int xx; + +#ifdef REFERENCE + rpmElementType tetype = rpmteType(p); + rpmtsOpX op = (tetype == TR_ADDED) ? RPMTS_OP_INSTALL : RPMTS_OP_ERASE; +#endif /* REFERENCE */ + + (void) rpmdbCheckSignals(); + + failed = 1; + gotfd = 0; + if ((fi = rpmtsiFi(pi)) == NULL) + continue; /* XXX can't happen */ + + if (rpmteFailed(p)) { + /* XXX this should be a warning, need a better message though */ + rpmlog(RPMLOG_DEBUG, D_("element %s marked as failed, skipping\n"), + rpmteNEVRA(p)); + rc++; + continue; + } + + psm = rpmpsmNew(ts, p, fi); + { int async = (rpmtsiOc(pi) >= rpmtsUnorderedSuccessors(ts, -1)) ? + 1 : 0; + rpmpsmSetAsync(psm, async); + } + + switch (rpmteType(p)) { + case TR_ADDED: + rpmlog(RPMLOG_DEBUG, "========== +++ %s %s-%s 0x%x\n", + rpmteNEVR(p), rpmteA(p), rpmteO(p), rpmteColor(p)); + stage = PSM_PKGINSTALL; + sw = rpmtsOp(ts, RPMTS_OP_INSTALL); +#ifdef REFERENCE + if (rpmteOpen(p, ts, 1)) { + (void) rpmswEnter(rpmtsOp(ts, op), 0); + failed = rpmpsmStage(psm, stage); + (void) rpmswExit(rpmtsOp(ts, op), 0); + rpmteClose(p, ts, 1); + } +#else /* REFERENCE */ + if ((p->h = rpmteFDHeader(ts, p)) != NULL) + gotfd = 1; + + if (gotfd && rpmteFd(p) != NULL) { + /* + * XXX Sludge necessary to transfer existing fstates/actions + * XXX around a recreated file info set. + */ + rpmuint8_t * fstates = fi->fstates; + iosmFileAction * actions = (iosmFileAction *) fi->actions; + int mapflags = fi->mapflags; + rpmte savep; + int scareMem = 0; + + psm->fi = rpmfiFree(psm->fi); + + fi->fstates = NULL; + fi->actions = NULL; +/*@-nullstate@*/ /* FIX: fi->actions is NULL */ + fi = rpmfiFree(fi); +/*@=nullstate@*/ + + savep = rpmtsSetRelocateElement(ts, p); + fi = rpmfiNew(ts, p->h, RPMTAG_BASENAMES, scareMem); + (void) rpmtsSetRelocateElement(ts, savep); + + if (fi != NULL) { /* XXX can't happen */ + fi->te = p; + fi->fstates = _free(fi->fstates); + fi->fstates = fstates; + fi->actions = _free(fi->actions); + fi->actions = (int *) actions; + if (mapflags & IOSM_SBIT_CHECK) + fi->mapflags |= IOSM_SBIT_CHECK; + p->fi = fi; + } + + psm->fi = rpmfiLink(p->fi, __FUNCTION__); + + (void) rpmswEnter(sw, 0); + failed = (rpmpsmStage(psm, stage) != RPMRC_OK); + (void) rpmswExit(sw, 0); + + xx = rpmteClose(p, ts, 0); + gotfd = 0; + } + +#endif /* REFERENCE */ + /*@switchbreak@*/ break; + + case TR_REMOVED: + rpmlog(RPMLOG_DEBUG, "========== --- %s %s-%s 0x%x\n", + rpmteNEVR(p), rpmteA(p), rpmteO(p), rpmteColor(p)); + stage = PSM_PKGERASE; + sw = rpmtsOp(ts, RPMTS_OP_ERASE); +#ifdef REFERENCE + if (rpmteOpen(p, ts, 1)) { + (void) rpmswEnter(rpmtsOp(ts, op), 0); + failed = rpmpsmStage(psm, stage); + (void) rpmswExit(rpmtsOp(ts, op), 0); + rpmteClose(p, ts, 1); + } +#else /* REFERENCE */ + (void) rpmswEnter(sw, 0); + failed = (rpmpsmStage(psm, stage) != RPMRC_OK); + (void) rpmswExit(sw, 0); +#endif /* REFERENCE */ + /*@switchbreak@*/ break; + } + +#if defined(RPM_VENDOR_MANDRIVA) + { rpmtransFlags tsflags = rpmtsFlags(ts); + if (!failed && !TSF_ISSET(tsflags, TEST)) { + if(!rpmteIsSource(p)) + xx = mayAddToFilesAwaitingFiletriggers(rpmtsRootDir(ts), + fi, (rpmteType(p) == TR_ADDED ? 1 : 0)); + p->done = 1; + } + } +#endif + +/*@-nullstate@*/ /* FIX: psm->fi may be NULL */ + psm = rpmpsmFree(psm, __FUNCTION__); +/*@=nullstate@*/ + + if (failed) { + rc++; +#ifdef REFERENCE + rpmteMarkFailed(p, ts); +#else /* REFERENCE */ + xx = rpmtsMarkLinkedFailed(ts, p); + /* If we received an error, lets break out and rollback, provided + * autorollback is enabled. + */ + if (rollbackFailures) { + xx = rpmtsRollback(ts, ignoreSet, 1, p); + break; + } +#endif /* REFERENCE */ + } + + if (p->h != NULL) { + (void) headerFree(p->h); + p->h = NULL; + } + +#ifdef REFERENCE + (void) rpmdbSync(rpmtsGetRdb(ts)); +#endif /* REFERENCE */ + + } + pi = rpmtsiFree(pi); + return rc; +} + +/* ================================================================= */ +static int rpmtsRepackage(rpmts ts, uint32_t numRemoved) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ +{ + rpmtransFlags tsflags = rpmtsFlags(ts); + rpmpsm psm; + rpmfi fi; + rpmtsi pi; + rpmte p; + void * ptr; + int progress = 0; + int rc = 0; + int xx; + +FPSDEBUG(0, (stderr, "--> %s(%p,%u)\n", __FUNCTION__, ts, (unsigned)numRemoved)); + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, (rpmElementType) 0)) != NULL) { + + (void) rpmdbCheckSignals(); + + if (p->isSource) continue; + if ((fi = rpmtsiFi(pi)) == NULL) + continue; /* XXX can't happen */ + switch (rpmteType(p)) { + case TR_ADDED: + /*@switchbreak@*/ break; + case TR_REMOVED: + if (!TSF_ISSET(tsflags, REPACKAGE)) + /*@switchbreak@*/ break; + if (!progress) + ptr = rpmtsNotify(ts, NULL, RPMCALLBACK_REPACKAGE_START, + 7, numRemoved); + + ptr = rpmtsNotify(ts, NULL, RPMCALLBACK_REPACKAGE_PROGRESS, + progress, numRemoved); + progress++; + + (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_REPACKAGE), 0); + + /* XXX TR_REMOVED needs IOSM_MAP_{ABSOLUTE,ADDDOT} IOSM_ALL_HARDLINKS */ + fi->mapflags |= IOSM_MAP_ABSOLUTE; + fi->mapflags |= IOSM_MAP_ADDDOT; + fi->mapflags |= IOSM_ALL_HARDLINKS; + psm = rpmpsmNew(ts, p, fi); +assert(psm != NULL); + xx = rpmpsmStage(psm, PSM_PKGSAVE); + psm = rpmpsmFree(psm, __FUNCTION__); + fi->mapflags &= ~IOSM_MAP_ABSOLUTE; + fi->mapflags &= ~IOSM_MAP_ADDDOT; + fi->mapflags &= ~IOSM_ALL_HARDLINKS; + + (void) rpmswExit(rpmtsOp(ts, RPMTS_OP_REPACKAGE), 0); + + /*@switchbreak@*/ break; + } + } + pi = rpmtsiFree(pi); + if (progress) + ptr = rpmtsNotify(ts, NULL, RPMCALLBACK_REPACKAGE_STOP, 7, numRemoved); + + return rc; +} + +/** + * Force add a failed package into the rpmdb. + * @param ts current transaction set + * @param p failed rpmte. + * @return RPMRC_OK, or RPMRC_FAIL + */ +/*@-nullpass@*/ +static rpmRC _processFailedPackage(rpmts ts, rpmte p) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, p, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ +{ + int rc = RPMRC_OK; /* assume success */ + +FPSDEBUG(0, (stderr, "--> %s(%p,%p)\n", __FUNCTION__, ts, p)); + /* Handle failed packages. */ + /* XXX TODO: Add header to rpmdb in PSM_INIT, not PSM_POST. */ + if (p != NULL && rpmteType(p) == TR_ADDED && !p->installed) { +/*@-compdef -usereleased@*/ /* p->fi->te undefined */ + rpmpsm psm = rpmpsmNew(ts, p, p->fi); +/*@=compdef =usereleased@*/ + /* + * If it died before the header was put in the rpmdb, we need + * do to something wacky which is add the header to the DB anyway. + * This will allow us to add the failed package as an erase + * to the rollback transaction. This must be done because we + * want the the erase scriptlets to run, and the only way that + * is going is if the header is in the rpmdb. + */ +assert(psm != NULL); + psm->stepName = "failed"; /* XXX W2DO? */ + rc = rpmpsmStage(psm, PSM_RPMDB_ADD); + psm = rpmpsmFree(psm, __FUNCTION__); + } + return (rpmRC) rc; +} +/*@=nullpass@*/ + +/*@-nullpass@*/ +rpmRC rpmtsRollback(rpmts rbts, rpmprobFilterFlags ignoreSet, int running, rpmte rbte) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies rbts, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ + const char * semfn = NULL; + rpmRC rc = (rpmRC) 0; + rpmuint32_t arbgoal = rpmtsARBGoal(rbts); + QVA_t ia = (QVA_t) memset(alloca(sizeof(*ia)), 0, sizeof(*ia)); + time_t ttid; + int xx; + +FPSDEBUG(0, (stderr, "--> %s(%p,0x%x,%d,%p)\n", __FUNCTION__, rbts, ignoreSet, running, rbte)); + /* Don't attempt rollback's of rollback transactions */ + if ((rpmtsType(rbts) & RPMTRANS_TYPE_ROLLBACK) || + (rpmtsType(rbts) & RPMTRANS_TYPE_AUTOROLLBACK)) + return RPMRC_OK; + + if (arbgoal == 0xffffffff) + arbgoal = rpmtsGetTid(rbts); + + /* Don't attempt rollbacks if no goal is set. */ + if (!running && arbgoal == 0xffffffff) + return RPMRC_OK; + + /* We need to remove an headers that were going to be removed so + * as to not foul up the regular rollback mechanism which will not + * handle properly a file being in the repackaged package directory + * and also its header still in the DB. + */ + { rpmtsi tsi; + rpmte te; + + /* XXX Insure an O_RDWR rpmdb. */ + xx = rpmtsOpenDB(rbts, O_RDWR); + + tsi = rpmtsiInit(rbts); + while((te = rpmtsiNext(tsi, TR_REMOVED)) != NULL) { + if (te->isSource) continue; + if(!te->u.removed.dboffset) + continue; + rc = (rpmRC) rpmdbRemove(rpmtsGetRdb(rbts), + rpmtsGetTid(rbts), + te->u.removed.dboffset, NULL); + if (rc != RPMRC_OK) { + rpmlog(RPMLOG_ERR, _("rpmdb erase failed. NEVRA: %s\n"), + rpmteNEVRA(te)); + break; + } + } + tsi = rpmtsiFree(tsi); + if (rc != RPMRC_OK) + goto cleanup; + } + + /* Process the failed package */ + rc = _processFailedPackage(rbts, rbte); + if (rc != RPMRC_OK) + goto cleanup; + + rpmtsEmpty(rbts); + + ttid = (time_t)arbgoal; + rpmlog(RPMLOG_NOTICE, _("Rollback to %-24.24s (0x%08x)\n"), + ctime(&ttid), arbgoal); + + /* Set the verify signature flags: + * - can't verify signatures/digests on repackaged packages. + * - header check are out. + */ + { + rpmVSFlags vsflags = (rpmVSFlags) rpmExpandNumeric("%{?_vsflags_erase}"); + vsflags = (rpmVSFlags) 0; /* XXX FIXME: ignore default disablers. */ +#if defined(SUPPORT_NOSIGNATURES) + /* --nodigest */ + VSF_SET(vsflags, NOSHA1HEADER); + VSF_SET(vsflags, NOMD5HEADER); + VSF_SET(vsflags, NOSHA1); + VSF_SET(vsflags, NOMD5); + /* --nosignature */ + VSF_SET(vsflags, NODSAHEADER); + VSF_SET(vsflags, NORSAHEADER); + VSF_SET(vsflags, NODSA); + VSF_SET(vsflags, NORSA); + /* --nohdrchk */ + VSF_SET(vsflags, NOHDRCHK); + VSF_SET(vsflags, NEEDPAYLOAD); /* XXX needed? */ +#endif + xx = rpmtsSetVSFlags(rbts, vsflags); + } + + /* Set transaction flags to be the same as the running transaction */ + { + rpmtransFlags tsflags = rpmtsFlags(rbts); + TSF_CLR(tsflags, DIRSTASH); /* No repackage of rollbacks */ + TSF_CLR(tsflags, REPACKAGE); /* No repackage of rollbacks */ + TSF_SET(tsflags, NOFDIGESTS); /* Don't check file digests */ + tsflags = rpmtsSetFlags(rbts, tsflags); + } + + /* Create install arguments structure */ + ia->rbtid = arbgoal; + /* transFlags/depFlags from rbts, (re-)set in rpmRollback(). */ + ia->transFlags = rpmtsFlags(rbts); + ia->depFlags = rpmtsDFlags(rbts); + /* XXX probFilter is normally set in main(). */ + ia->probFilter = ignoreSet; /* XXX RPMPROB_FILTER_NONE? */ + /* XXX installInterfaceFlags is normally set in main(). */ + IIF_SET(ia->installInterfaceFlags, UPGRADE); + IIF_SET(ia->installInterfaceFlags, HASH); + + /* rpmtsCheck and rpmtsOrder failures do not have links. */ + ia->no_rollback_links = 1; + + /* Create a file semaphore. */ + semfn = rpmExpand("%{?semaphore_backout}", NULL); + if (semfn && *semfn) { + FD_t fd = Fopen(semfn, "w.fdio"); + if (fd) + xx = Fclose(fd); + } + +/*@-compmempass@*/ + rc = (rpmRC) rpmRollback(rbts, ia, NULL); +/*@=compmempass@*/ + +cleanup: + /* Remove the file semaphore. */ + if (semfn && *semfn) + xx = Unlink(semfn); + semfn = _free(semfn); + + return rc; +} +/*@=nullpass@*/ + +int _rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) +{ + rpmtransFlags tsflags = rpmtsFlags(ts); + int ourrc = -1; /* assume failure */ + uint32_t totalFileCount = 0; + rpmps ps; + rpmsx sx = NULL; + uint32_t numRemoved; + int rollbackFailures = 0; + void * lock = NULL; + int xx; + +FPSDEBUG(0, (stderr, "--> %s(%p,%p,0x%x)\n", __FUNCTION__, ts, okProbs, ignoreSet)); +if (_rpmts_debug) +fprintf(stderr, "--> %s(%p,%p,0x%x) tsflags 0x%x\n", __FUNCTION__, ts, okProbs, (unsigned) ignoreSet, tsflags); + + /* XXX programmer error segfault avoidance. */ + if (rpmtsNElements(ts) <= 0) { + rpmlog(RPMLOG_ERR, + _("Invalid number of transaction elements.\n")); + return -1; + } + + /* Don't acquire the transaction lock if testing. */ + if (!TSF_ISSET(tsflags, TEST)) + lock = rpmtsAcquireLock(ts); + + rollbackFailures = rpmExpandNumeric("%{?_rollback_transaction_on_failure}"); + /* Don't rollback unless repackaging. */ + if (!TSF_ISSET(tsflags, REPACKAGE)) + rollbackFailures = 0; + /* Don't rollback if testing. */ + if (TSF_ISSET(tsflags, TEST)) + rollbackFailures = 0; + + if (rpmtsType(ts) & (RPMTRANS_TYPE_ROLLBACK | RPMTRANS_TYPE_AUTOROLLBACK)) + rollbackFailures = 0; + + /* =============================================== + * Setup flags and such, open the rpmdb in O_RDWR mode. + */ + sx = NULL; + if (rpmtsSetup(ts, ignoreSet, &sx)) + goto exit; + + /* =============================================== + * For packages being installed: + * - verify package epoch:version-release is newer. + * - count files. + * For packages being removed: + * - count files. + */ + + totalFileCount = 0; + ps = rpmtsSanityCheck(ts, &totalFileCount); + ps = rpmpsFree(ps); + + /* =============================================== + * Run pre-transaction scripts, but only if no known problems exist. + */ + if (!TSF_ISSET(tsflags, NOPRETRANS) && + (!(TSF_ISSET(tsflags, BUILD_PROBS) || TSF_ISSET(tsflags, TEST)) + || (rpmpsNumProblems(ts->probs) && + (okProbs == NULL || rpmpsTrim(ts->probs, okProbs))))) + { + rpmlog(RPMLOG_DEBUG, D_("running pre-transaction scripts\n")); + xx = rpmtsRunScript(ts, RPMTAG_PRETRANS); + } + + /* =============================================== + * Compute file disposition for each package in transaction set. + */ + numRemoved = 0; + if (rpmtsPrepare(ts, sx, totalFileCount, &numRemoved)) + goto exit; + + /* =============================================== + * If unfiltered problems exist, free memory and return. + */ + if (TSF_ISSET(tsflags, BUILD_PROBS) + || (rpmpsNumProblems(ts->probs) && + (okProbs == NULL || rpmpsTrim(ts->probs, okProbs))) + ) + { + lock = rpmtsFreeLock(lock); + if (sx != NULL) sx = rpmsxFree(sx); + return ts->orderCount; + } + + /* =============================================== + * Save removed files before erasing. + */ + if (TSF_ISSET(tsflags, DIRSTASH) || TSF_ISSET(tsflags, REPACKAGE)) { + xx = rpmtsRepackage(ts, numRemoved); + } + +#ifdef NOTYET + xx = rpmtxnBegin(rpmtsGetRdb(ts), NULL, &ts->txn); +#endif + + /* =============================================== + * Install and remove packages. + */ + ourrc = rpmtsProcess(ts, ignoreSet, rollbackFailures); + + /* =============================================== + * Run post-transaction scripts unless disabled. + */ + if (!TSF_ISSET(tsflags, NOPOSTTRANS) && !TSF_ISSET(tsflags, TEST)) + { + +#if defined(RPM_VENDOR_MANDRIVA) + /* XXX FIXME: simplify the logic. */ + if (!TSF_ISSET(tsflags, NOTRIGGERPREIN) + || !TSF_ISSET(tsflags, NOTRIGGERIN) + || !TSF_ISSET(tsflags, NOTRIGGERUN) + || !TSF_ISSET(tsflags, NOTRIGGERPOSTUN)) + rpmRunFileTriggers(rpmtsRootDir(ts)); +#endif + + rpmlog(RPMLOG_DEBUG, D_("running post-transaction scripts\n")); + xx = rpmtsRunScript(ts, RPMTAG_POSTTRANS); + } + +exit: + xx = rpmtsFinish(ts, sx); + + lock = rpmtsFreeLock(lock); + + /*@-nullstate@*/ /* FIX: ts->flList may be NULL */ + if (ourrc) { + if (ts->txn != NULL) + xx = rpmtxnAbort(ts->txn); + ts->txn = NULL; + return -1; + } else { + if (ts->txn != NULL) + xx = rpmtxnCommit(ts->txn); + ts->txn = NULL; + xx = rpmtxnCheckpoint(rpmtsGetRdb(ts)); + return 0; + } + /*@=nullstate@*/ +} + +int (*rpmtsRun) (rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) + = _rpmtsRun; diff --git a/rpm-5.4.9/lib/tsbt.c b/rpm-5.4.9/lib/tsbt.c new file mode 100644 index 0000000..b045b17 --- /dev/null +++ b/rpm-5.4.9/lib/tsbt.c @@ -0,0 +1,172 @@ +#include +#include +#include +#include +#include +#include + +static int an[256]; +static int bn[256]; +static int nn[256]; +static int rn[256]; + +/* Activate nodes, count incoming edgees. */ +static int count(const char * s) +{ + int ax = (int)s[0]; + int bx; + int i; + + if (bn[ax] == 0) + bn[ax] = 1; + for (i = 1; (bx = (int)s[i]) != 0; i++) { + /* Prevent dependencies on self. */ + if (bx == ax) + continue; + if (bn[bx] == 0) + bn[bx] = 1; + /* Count an incoming edge. */ + nn[ax]++; + } + return 0; +} + +/* Compute paths to tree roots. */ +static int parent(const char * s) +{ + int ax = (int)s[0]; + int bx; + int i; + + for (i = 1; (bx = (int)s[i]) != 0; i++) { + /* Prevent dependencies on self. */ + if (bx == ax) + continue; + /* Save first parent. */ + if (rn[bx] == 0) { + rn[bx] = ax; + continue; + } + /* Multiple parents: prefer parent with fewest edges. */ + if (nn[bx] < nn[rn[bx]]) + rn[bx] = ax; + } + return 0; +} + +/* Find node with (a,b) label. */ +static int SBTfind(int a, int b) +{ + int i; + for (i = 0; i < 256; i++) { + if (bn[i] == 0) + continue; + if (a == an[i] && b == bn[i]) + return i; + } + return 0; +} + +/* Mark chains with S-B labels. */ +static int SBTmark(int i) +{ + if (i >= 1) { + int px = rn[i]; + int rx, lx; + + if (px) { + /* Mark all parent nodes first. */ + rn[i] = 0; /* Prevent loops. */ + SBTmark(px); + rn[i] = px; + + /* Does an Lnode already exist? */ + rx = lx = SBTfind(an[px], an[px] + bn[px]); + while (rx > 0) { + lx = rx; + rx = SBTfind(an[lx] + bn[lx], bn[lx]); + } + if (lx < 1) { + /* Add Lnode from parent */ + an[i] = an[px]; + bn[i] = an[px] + bn[px]; + } else { + /* Append Rnode to Lnode's end-of-chain. */ + an[i] = an[lx] + bn[lx]; + bn[i] = bn[lx]; + } + } + } + return 0; +} + +static int SBTprnode(int i) +{ + int a = an[i]; + int b = bn[i]; + + if (b == 1) { + printf("Pnode['%c'] (%d, %d)\n", i, a, b); + } else if (a > b) { + printf("Rnode['%c'] (%d, %d) has Pnode (%d, %d)\n", i, a, b, + (a-b), b); + } else { + printf("Lnode['%c'] (%d, %d) has Pnode (%d, %d)\n", i, a, b, + a, (b-a)); + } + + return 0; +} + +static struct poptOption optionsTable[] = { + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0, + N_("Common options:"), + NULL }, + + POPT_AUTOALIAS + POPT_AUTOHELP + POPT_TABLEEND +}; + +int +main(int argc, char *argv[]) +{ + poptContext optCon = rpmcliInit(argc, argv, optionsTable); + ARGV_t av = NULL; + int ac = 0; + int rc = 0; + int i; + + for (i = 0; i < 256; i++) { + an[i] = i; + bn[i] = 0; + nn[i] = 0; + rn[i] = 0; + } + + av = poptGetArgs(optCon); + ac = argvCount(av); + + /* Activate nodes, count edges. */ + for (i = 0; i < ac; i++) + count(av[i]); + + /* Save parents of nodes. */ + for (i = 0; i < ac; i++) + parent(av[i]); + + /* Compute Stern-Brocot labels. */ + for (i = 0; i < 256; i++) + SBTmark(i); + + /* Print results. */ + for (i = 0; i < 256; i++) { + if (bn[i] == 0) + continue; + SBTprnode(i); + } + + optCon = rpmcliFini(optCon); + + return rc; +} diff --git a/rpm-5.4.9/lib/verify.c b/rpm-5.4.9/lib/verify.c new file mode 100644 index 0000000..2807958 --- /dev/null +++ b/rpm-5.4.9/lib/verify.c @@ -0,0 +1,696 @@ +/** \ingroup rpmcli + * \file lib/verify.c + * Verify installed payload files from package metadata. + */ + +#include "system.h" + +#include +#include +#include +#include "ugid.h" + +#include +#include +#include + +#define _RPMFI_INTERNAL +#include + +#define _RPMSQ_INTERNAL +#include "psm.h" + +#include "legacy.h" /* XXX dodigest(), uidToUname(), gnameToGid */ + +#define _RPMPS_INTERNAL /* XXX rpmps needs iterator. */ +#define _RPMTS_INTERNAL /* XXX expose rpmtsSetScriptFd */ +#include + +#include "debug.h" + +/*@access rpmts @*/ /* XXX cast */ +/*@access rpmpsm @*/ /* XXX for %verifyscript through rpmpsmStage() */ + +#define S_ISDEV(m) (S_ISBLK((m)) || S_ISCHR((m))) + +/*@unchecked@*/ +extern int _rpmds_unspecified_epoch_noise; + +typedef struct rpmvf_s * rpmvf; +struct rpmvf_s { + struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ + const char * fn; + const char * flink; + struct stat sb; + rpmfileAttrs fflags; + rpmfileState fstate; + rpmVerifyAttrs vflags; + int dalgo; + size_t dlen; + const unsigned char * digest; + const char * fuser; + const char * fgroup; +#if defined(__LCLINT__NOTYET) +/*@refs@*/ + int nrefs; /*!< (unused) keep splint happy */ +#endif +}; + +#ifdef __cplusplus + +#define FF_ISSET(_fflags, _FLAG) ((_fflags) & (RPMFILE_##_FLAG)) + +#define VF_ISSET(_vflags, _FLAG) ((_vflags) & (RPMVERIFY_##_FLAG)) +#define VF_SET(_vflags, _FLAG) \ + (*((unsigned *)&(_vflags)) |= (RPMVERIFY_##_FLAG)) +#define VF_CLR(_vflags, _FLAG) \ + (*((unsigned *)&(_vflags)) &= ~(RPMVERIFY_##_FLAG)) + +#define QVA_ISSET(_qvaflags, _FLAG) ((_qvaflags) & (VERIFY_##_FLAG)) + +#define VSF_ISSET(_vsflags, _FLAG) ((_vsflags) & (RPMVSF_##_FLAG)) +#define VSF_SET(_vsflags, _FLAG) \ + (*((unsigned *)&(_vsflags)) |= (RPMVSF_##_FLAG)) +#define VSF_CLR(_vsflags, _FLAG) \ + (*((unsigned *)&(_vsflags)) &= ~(RPMVSF_##_FLAG)) + +GENfree(rpmvf) + +#else /* __cplusplus */ + +#define FF_ISSET(_fflags, _FLAG) ((_fflags) & (RPMFILE_##_FLAG)) + +#define VF_ISSET(_vflags, _FLAG) ((_vflags) & (RPMVERIFY_##_FLAG)) +#define VF_SET(_vflags, _FLAG) (_vflags) |= (RPMVERIFY_##_FLAG) +#define VF_CLR(_vflags, _FLAG) (_vflags) &= ~(RPMVERIFY_##_FLAG) + +#define QVA_ISSET(_qvaflags, _FLAG) ((_qvaflags) & (VERIFY_##_FLAG)) + +#define VSF_ISSET(_vsflags, _FLAG) ((_vsflags) & (RPMVSF_##_FLAG)) +#define VSF_SET(_vsflags, _FLAG) (_vsflags) |= (RPMVSF_##_FLAG) +#define VSF_CLR(_vsflags, _FLAG) (_vsflags) &= ~(RPMVSF_##_FLAG) + +#endif /* __cplusplus */ + +static rpmvf rpmvfFree(/*@only@*/ rpmvf vf) + /*@modifies vf @*/ +{ + + if (vf) { +#ifdef NOTYET + yarnPossess(vf->_item.use); + if (yarnPeekLock(vf->_item.use) <= 1L) { + yarnLock use = vf->_item.use; + vf->fn = _free(vf->fn); + vf = _free(vf); + yarnTwist(use, TO, 0); + use = yarnFreeLock(use); + } else + yarnTwist(vf->_item.use, BY, -1); +#else + vf->fn = _free(vf->fn); + vf = _free(vf); +#endif + } + return NULL; +} + +/*@only@*/ +static rpmvf rpmvfNew(rpmts ts, rpmfi fi, int i, rpmVerifyAttrs omitMask) + /*@*/ +{ + rpmvf vf = (rpmvf) DRD_xcalloc(1, sizeof(*vf)); + +#ifdef NOTYET + vf->_item.use = yarnNewLock(1); + vf->_item.pool = NULL; +#endif + +/*@-mods@*/ + vf->fn = rpmGetPath(rpmtsRootDir(ts), fi->dnl[fi->dil[i]], fi->bnl[i], NULL); +/*@=mods@*/ + vf->flink = fi->flinks[i]; + vf->fuser = fi->fuser[i]; + vf->fgroup = fi->fgroup[i]; + + { struct stat *st = &vf->sb; + st->st_dev = + st->st_rdev = fi->frdevs[i]; + st->st_ino = fi->finodes[i]; + st->st_mode = fi->fmodes[i]; +#ifdef NOTNEEDED + st->st_nlink = rpmfiFNlink(fi) + (int)S_ISDIR(st->st_mode); +#endif + if (unameToUid(vf->fuser, &st->st_uid) == -1) + st->st_uid = 0; /* XXX */ + if (gnameToGid(vf->fgroup, &st->st_gid) == -1) + st->st_gid = 0; /* XXX */ + st->st_size = fi->fsizes[i]; + st->st_blksize = 4 * 1024; /* XXX */ + st->st_blocks = (st->st_size + (st->st_blksize - 1)) / st->st_blksize; + st->st_atime = + st->st_ctime = + st->st_mtime = fi->fmtimes[i]; + } + + vf->fflags = (rpmfileAttrs) fi->fflags[i]; + vf->fstate = (rpmfileState) fi->fstates[i]; + vf->vflags = (rpmVerifyAttrs) fi->vflags[i]; + vf->dalgo = fi->fdigestalgos + ? fi->fdigestalgos[i] + : fi->digestalgo; + vf->dlen = fi->digestlen; + vf->digest = fi->digests + (fi->digestlen * i); + + /* Don't verify any features in omitMask. */ + *((unsigned *)&vf->vflags) &= ~(omitMask | RPMVERIFY_FAILURES); + + /* Content checks of %ghost files are meaningless. */ + if (FF_ISSET(vf->fflags, GHOST)) { + VF_CLR(vf->vflags, FDIGEST); + VF_CLR(vf->vflags, FILESIZE); + VF_CLR(vf->vflags, MTIME); + VF_CLR(vf->vflags, LINKTO); + VF_CLR(vf->vflags, HMAC); + } + + return vf; +} + +/** \ingroup rpmcli + * Verify file attributes (including file digest). + * @param vf file data to verify + * #param spew should verify results be printed? + * @return 0 on success (or not installed), 1 on error + */ +static int rpmvfVerify(rpmvf vf, int spew) + /*@globals h_errno, fileSystem, internalState @*/ + /*@modifies vf, fileSystem, internalState @*/ +{ + rpmVerifyAttrs res = RPMVERIFY_NONE; + struct stat sb; + int ec = 0; + + /* Check to see if the file was installed - if not pretend all is OK. */ + switch (vf->fstate) { + default: + case RPMFILE_STATE_NETSHARED: + case RPMFILE_STATE_REPLACED: + case RPMFILE_STATE_NOTINSTALLED: + case RPMFILE_STATE_WRONGCOLOR: + goto exit; + /*@notreached@*/ break; + case RPMFILE_STATE_NORMAL: + break; + } + +assert(vf->fn != NULL); + if (vf->fn == NULL || Lstat(vf->fn, &sb) != 0) { + VF_SET(res, LSTATFAIL); + ec = 1; + goto exit; + } + + /* Not all attributes of non-regular files can be verified. */ + if (S_ISDIR(sb.st_mode)) { + VF_CLR(vf->vflags, FDIGEST); + VF_CLR(vf->vflags, FILESIZE); + VF_CLR(vf->vflags, MTIME); + VF_CLR(vf->vflags, LINKTO); + VF_CLR(vf->vflags, HMAC); + } else if (S_ISLNK(sb.st_mode)) { + VF_CLR(vf->vflags, FDIGEST); + VF_CLR(vf->vflags, FILESIZE); + VF_CLR(vf->vflags, MTIME); + VF_CLR(vf->vflags, MODE); + VF_CLR(vf->vflags, HMAC); +#if CHOWN_FOLLOWS_SYMLINK + VF_CLR(vf->vflags, USER); + VF_CLR(vf->vflags, GROUP); +#endif + } + else if (S_ISFIFO(sb.st_mode)) { + VF_CLR(vf->vflags, FDIGEST); + VF_CLR(vf->vflags, FILESIZE); + VF_CLR(vf->vflags, MTIME); + VF_CLR(vf->vflags, LINKTO); + VF_CLR(vf->vflags, HMAC); + } else if (S_ISCHR(sb.st_mode)) { + VF_CLR(vf->vflags, FDIGEST); + VF_CLR(vf->vflags, FILESIZE); + VF_CLR(vf->vflags, MTIME); + VF_CLR(vf->vflags, LINKTO); + VF_CLR(vf->vflags, HMAC); + } else if (S_ISBLK(sb.st_mode)) { + VF_CLR(vf->vflags, FDIGEST); + VF_CLR(vf->vflags, FILESIZE); + VF_CLR(vf->vflags, MTIME); + VF_CLR(vf->vflags, LINKTO); + VF_CLR(vf->vflags, HMAC); + } else { + VF_CLR(vf->vflags, LINKTO); + } + + if (VF_ISSET(vf->vflags, FDIGEST) || VF_ISSET(vf->vflags, HMAC)) { + if (vf->digest == NULL || vf->dlen == 0) + VF_SET(res, FDIGEST); + else { + /* XXX If --nofdigest, then prelinked library sizes fail to verify. */ + unsigned char * fdigest = (unsigned char *) + memset(alloca(vf->dlen), 0, vf->dlen); + size_t fsize = 0; +#define _mask (RPMVERIFY_FDIGEST|RPMVERIFY_HMAC) + unsigned dflags = (vf->vflags & _mask) == RPMVERIFY_HMAC + ? 0x2 : 0x0; +#undef _mask + int rc = dodigest(vf->dalgo, vf->fn, fdigest, dflags, &fsize); + sb.st_size = fsize; + if (rc) { + VF_SET(res, READFAIL); + VF_SET(res, FDIGEST); + } else + if (memcmp(fdigest, vf->digest, vf->dlen)) + VF_SET(res, FDIGEST); + } + } + + if (VF_ISSET(vf->vflags, LINKTO)) { + char linkto[1024+1]; + int size = 0; + + if ((size = Readlink(vf->fn, linkto, sizeof(linkto)-1)) == -1) { + VF_SET(res, READLINKFAIL); + VF_SET(res, LINKTO); + } else { + linkto[size] = '\0'; + if (vf->flink == NULL || strcmp(linkto, vf->flink)) + VF_SET(res, LINKTO); + } + } + + if (VF_ISSET(vf->vflags, FILESIZE)) { + if (sb.st_size != vf->sb.st_size) + VF_SET(res, FILESIZE); + } + + if (VF_ISSET(vf->vflags, MODE)) { + /* XXX AIX has sizeof(mode_t) > sizeof(unsigned short) */ + unsigned short metamode = (unsigned short)vf->sb.st_mode; + unsigned short filemode = (unsigned short)sb.st_mode; + + /* Comparing type of %ghost files is meaningless, but perms are OK. */ + if (FF_ISSET(vf->fflags, GHOST)) { + metamode &= ~0xf000; + filemode &= ~0xf000; + } + if (metamode != filemode) + VF_SET(res, MODE); + } + + if (VF_ISSET(vf->vflags, RDEV)) { + if (S_ISCHR(vf->sb.st_mode) != S_ISCHR(sb.st_mode) + || S_ISBLK(vf->sb.st_mode) != S_ISBLK(sb.st_mode)) + VF_SET(res, RDEV); + else if (S_ISDEV(vf->sb.st_mode) && S_ISDEV(sb.st_mode)) { + rpmuint16_t st_rdev = (rpmuint16_t)(sb.st_rdev & 0xffff); + rpmuint16_t frdev = (rpmuint16_t)(vf->sb.st_rdev & 0xffff); + if (st_rdev != frdev) + VF_SET(res, RDEV); + } + } + + if (VF_ISSET(vf->vflags, MTIME)) { + if (sb.st_mtime != vf->sb.st_mtime) + VF_SET(res, MTIME); + } + + if (VF_ISSET(vf->vflags, USER)) { + const char * fuser = uidToUname(sb.st_uid); + if (fuser == NULL || vf->fuser == NULL || strcmp(fuser, vf->fuser)) + VF_SET(res, USER); + } + + if (VF_ISSET(vf->vflags, GROUP)) { + const char * fgroup = gidToGname(sb.st_gid); + if (fgroup == NULL || vf->fgroup == NULL || strcmp(fgroup, vf->fgroup)) + VF_SET(res, GROUP); + } + +exit: + + if (spew) { /* XXX no output w verify(...) probe. */ + char buf[BUFSIZ]; + char * t = buf; + char * te = t; + *te = '\0'; + if (ec) { + if (!(FF_ISSET(vf->fflags, MISSINGOK) ||FF_ISSET(vf->fflags, GHOST)) + || rpmIsVerbose()) + { + sprintf(te, _("missing %c %s"), + (FF_ISSET(vf->fflags, CONFIG) ? 'c' : + FF_ISSET(vf->fflags, DOC) ? 'd' : + FF_ISSET(vf->fflags, GHOST) ? 'g' : + FF_ISSET(vf->fflags, LICENSE) ? 'l' : + FF_ISSET(vf->fflags, PUBKEY) ? 'P' : + FF_ISSET(vf->fflags, README) ? 'r' : ' '), + vf->fn); + if (VF_ISSET(res, LSTATFAIL) && errno != ENOENT) { + te += strlen(te); + sprintf(te, " (%s)", strerror(errno)); + } + } + } else if (res || rpmIsVerbose()) { + /*@observer@*/ static const char aok[] = "."; + /*@observer@*/ static const char unknown[] = "?"; + +#define _verify(_FLAG, _C) \ + (VF_ISSET(res, _FLAG) ? _C : aok) +#define _verifylink(_FLAG, _C) \ + (VF_ISSET(res, READLINKFAIL) ? unknown : \ + VF_ISSET(res, _FLAG) ? _C : aok) +#define _verifyfile(_FLAG, _C) \ + (VF_ISSET(res, READFAIL) ? unknown : \ + VF_ISSET(res, _FLAG) ? _C : aok) + + const char * digest = _verifyfile(FDIGEST, "5"); + const char * size = _verify(FILESIZE, "S"); + const char * link = _verifylink(LINKTO, "L"); + const char * mtime = _verify(MTIME, "T"); + const char * rdev = _verify(RDEV, "D"); + const char * user = _verify(USER, "U"); + const char * group = _verify(GROUP, "G"); + const char * mode = _verify(MODE, "M"); + +#undef _verifyfile +#undef _verifylink +#undef _verify + + sprintf(te, "%s%s%s%s%s%s%s%s %c %s", + size, mode, digest, rdev, link, user, group, mtime, + (FF_ISSET(vf->fflags, CONFIG) ? 'c' : + FF_ISSET(vf->fflags, DOC) ? 'd' : + FF_ISSET(vf->fflags, GHOST) ? 'g' : + FF_ISSET(vf->fflags, LICENSE) ? 'l' : + FF_ISSET(vf->fflags, PUBKEY) ? 'P' : + FF_ISSET(vf->fflags, README) ? 'r' : ' '), + vf->fn); + + } + + if (t && *t) + rpmlog(RPMLOG_NOTICE, "%s\n", t); + + } + + return (res != 0); +} + +/** + * Return exit code from running verify script from header. + * @todo malloc/free/refcount handling is fishy here. + * @param qva parsed query/verify options + * @param ts transaction set + * @param fi file info set + * @param scriptFd file handle to use for stderr (or NULL) + * @return 0 on success + */ +static int rpmVerifyScript(/*@unused@*/ QVA_t qva, rpmts ts, + rpmfi fi, /*@null@*/ FD_t scriptFd) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, fi, scriptFd, rpmGlobalMacroContext, + fileSystem, internalState @*/ +{ + rpmpsm psm; + rpmRC rc; + int ec = 0; + + if (scriptFd != NULL) + rpmtsSetScriptFd(ts, scriptFd); + + psm = rpmpsmNew(ts, NULL, fi); + + rc = rpmpsmScriptStage(psm, RPMTAG_VERIFYSCRIPT, RPMTAG_VERIFYSCRIPTPROG); + if (rc != RPMRC_OK) + ec = 1; + + rc = rpmpsmScriptStage(psm, RPMTAG_SANITYCHECK, RPMTAG_SANITYCHECKPROG); + if (rc != RPMRC_OK) + ec = 1; + + psm = rpmpsmFree(psm, __FUNCTION__); + + if (scriptFd != NULL) + rpmtsSetScriptFd(ts, NULL); + + return ec; +} + +/** + * Check installed package dependencies for problems. + * @param qva parsed query/verify options + * @param ts transaction set + * @param h header + * @return number of problems found (0 for no problems) + */ +static int verifyDependencies(/*@unused@*/ QVA_t qva, rpmts ts, + Header h) + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/ +{ +#ifdef NOTYET + uint32_t hdrNum = headerGetInstance(h); +#endif + rpmps ps; + int rc = 0; /* assume no problems */ + int xx; + + rpmtsEmpty(ts); + +#ifdef NOTYET + if (hdrNum > 0) + (void) rpmtsAddEraseElement(ts, h, hdrNum); + else +#endif + (void) rpmtsAddInstallElement(ts, h, headerGetOrigin(h), 0, NULL); + + xx = rpmtsCheck(ts); + ps = rpmtsProblems(ts); + + if (rpmpsNumProblems(ps) > 0) { + const char * altNEVR; + const char * pkgNEVR = NULL; + rpmpsi psi; + rpmProblem prob; + char * t, * te; + int nb = 512; + + psi = rpmpsInitIterator(ps); + while (rpmpsNextIterator(psi) >= 0) { + prob = rpmpsProblem(psi); + if (pkgNEVR == NULL) + pkgNEVR = rpmProblemGetPkgNEVR(prob); + + altNEVR = rpmProblemGetAltNEVR(prob); +assert(altNEVR != NULL); + if (altNEVR[0] == 'R' && altNEVR[1] == ' ') + nb += sizeof("\tRequires: ")-1; + if (altNEVR[0] == 'C' && altNEVR[1] == ' ') + nb += sizeof("\tConflicts: ")-1; + nb += strlen(altNEVR+2) + sizeof("\n") - 1; + + } + psi = rpmpsFreeIterator(psi); + + te = t = (char *) alloca(nb); + *te = '\0'; + sprintf(te, _("Unsatisfied dependencies for %s:\n"), pkgNEVR); + te += strlen(te); + + psi = rpmpsInitIterator(ps); + while (rpmpsNextIterator(psi) >= 0) { + prob = rpmpsProblem(psi); + + if ((altNEVR = rpmProblemGetAltNEVR(prob)) == NULL) + altNEVR = "? ?altNEVR?"; + if (altNEVR[0] == 'R' && altNEVR[1] == ' ') + te = stpcpy(te, "\tRequires: "); + if (altNEVR[0] == 'C' && altNEVR[1] == ' ') + te = stpcpy(te, "\tConflicts: "); + te = stpcpy( stpcpy(te, altNEVR+2), "\n"); + + rc++; + } + psi = rpmpsFreeIterator(psi); + + if (te > t) { + *te++ = '\n'; + *te = '\0'; + rpmlog(RPMLOG_NOTICE, "%s", t); + te = t; + *t = '\0'; + } + } + + ps = rpmpsFree(ps); + + rpmtsEmpty(ts); + + return rc; +} + +int showVerifyPackage(QVA_t qva, rpmts ts, Header h) +{ + static int scareMem = 0; + rpmVerifyAttrs omitMask = (rpmVerifyAttrs) + ((qva->qva_flags & VERIFY_ATTRS) ^ VERIFY_ATTRS); + int spew = (qva->qva_mode != 'v'); /* XXX no output w verify(...) probe. */ + int ec = 0; + int i; +rpmfi fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, scareMem); +uint32_t fc = rpmfiFC(fi); + + { + /* Verify header digest/signature. */ + if (qva->qva_flags & (VERIFY_DIGEST | VERIFY_SIGNATURE)) + { + const char * horigin = headerGetOrigin(h); + const char * msg = NULL; + size_t uhlen = 0; + void * uh = headerUnload(h, &uhlen); + int lvl = headerCheck(rpmtsDig(ts), uh, uhlen, &msg) == RPMRC_FAIL + ? RPMLOG_ERR : RPMLOG_DEBUG; + rpmlog(lvl, "%s: %s\n", + (horigin ? horigin : "verify"), (msg ? msg : "")); + rpmtsCleanDig(ts); + uh = _free(uh); + msg = _free(msg); + } + + /* Verify file digests. */ + if (fc > 0 && (qva->qva_flags & VERIFY_FILES)) +#if defined(_OPENMP) + #pragma omp parallel for private(i) reduction(+:ec) +#endif + for (i = 0; i < (int)fc; i++) { + int fflags = fi->fflags[i]; + rpmvf vf; + int rc; + + /* If not querying %config, skip config files. */ + if (FF_ISSET(qva->qva_fflags, CONFIG) && FF_ISSET(fflags, CONFIG)) + continue; + + /* If not querying %doc, skip doc files. */ + if (FF_ISSET(qva->qva_fflags, DOC) && FF_ISSET(fflags, DOC)) + continue; + + /* If not verifying %ghost, skip ghost files. */ + /* XXX the broken!!! logic disables %ghost queries always. */ + if (!(FF_ISSET(qva->qva_fflags, GHOST) && FF_ISSET(fflags, GHOST))) + continue; + + /* Gather per-file data into a carrier. */ + vf = rpmvfNew(ts, fi, i, omitMask); + + /* Verify per-file metadata. */ + rc = rpmvfVerify(vf, spew); + if (rc) + ec += rc; + + (void) rpmvfFree(vf); + vf = NULL; + } + + /* Run verify/sanity scripts (if any). */ + if (qva->qva_flags & VERIFY_SCRIPT) + { + int rc; + + if (headerIsEntry(h, RPMTAG_VERIFYSCRIPT) || + headerIsEntry(h, RPMTAG_SANITYCHECK)) + { + FD_t fdo = fdDup(STDOUT_FILENO); + + rc = rpmfiSetHeader(fi, h); + if ((rc = rpmVerifyScript(qva, ts, fi, fdo)) != 0) + ec += rc; + if (fdo != NULL) + rc = Fclose(fdo); + rc = rpmfiSetHeader(fi, NULL); + } + } + + /* Verify dependency assertions. */ + if (qva->qva_flags & VERIFY_DEPS) + { + int save_noise = _rpmds_unspecified_epoch_noise; + int rc; + +/*@-mods@*/ + if (rpmIsVerbose()) + _rpmds_unspecified_epoch_noise = 1; + if ((rc = verifyDependencies(qva, ts, h)) != 0) + ec += rc; + _rpmds_unspecified_epoch_noise = save_noise; +/*@=mods@*/ + } + } + + fi = rpmfiFree(fi); + + return ec; +} + +int rpmcliVerify(rpmts ts, QVA_t qva, const char ** argv) +{ + rpmdepFlags depFlags = qva->depFlags, odepFlags; + rpmtransFlags transFlags = qva->transFlags, otransFlags; + rpmVSFlags vsflags, ovsflags; + int ec = 0; + +#if defined(_OPENMP) +(void) tagName((rpmTag)0); /* XXX instantiate the tagname store. */ +omp_set_nested(1); /* XXX permit nested thread teams. */ +#endif + + if (qva->qva_showPackage == NULL) + qva->qva_showPackage = showVerifyPackage; + + /* XXX verify flags are inverted from query. */ + vsflags = (rpmVSFlags) rpmExpandNumeric("%{?_vsflags_verify}"); + vsflags = (rpmVSFlags) 0; /* XXX FIXME: ignore default disablers. */ +#if defined(SUPPORT_NOSIGNATURES) + if (!QVA_ISSET(qva->qva_flags, DIGEST)) { + VSF_SET(vsflags, NOSHA1HEADER); + VSF_SET(vsflags, NOMD5HEADER); + VSF_SET(vsflags, NOSHA1); + VSF_SET(vsflags, NOMD5); + } + if (!QVA_ISSET(qva->qva_flags, SIGNATURE)) { + VSF_SET(vsflags, NODSAHEADER); + VSF_SET(vsflags, NORSAHEADER); + VSF_SET(vsflags, NODSA); + VSF_SET(vsflags, NORSA); + } + if (!QVA_ISSET(qva->qva_flags, HDRCHK)) { + VSF_SET(vsflags, NOHDRCHK); + } + VSF_CLR(vsflags, NEEDPAYLOAD); +#endif + + odepFlags = rpmtsSetDFlags(ts, depFlags); + otransFlags = rpmtsSetFlags(ts, transFlags); + ovsflags = rpmtsSetVSFlags(ts, vsflags); + ec = rpmcliArgIter(ts, qva, argv); + vsflags = rpmtsSetVSFlags(ts, ovsflags); + transFlags = rpmtsSetFlags(ts, otransFlags); + depFlags = rpmtsSetDFlags(ts, odepFlags); + + if (qva->qva_showPackage == showVerifyPackage) + qva->qva_showPackage = NULL; + + rpmtsEmpty(ts); + + return ec; +} diff --git a/rpm-5.4.9/ltmain.sh b/rpm-5.4.9/ltmain.sh new file mode 100644 index 0000000..e1e7abe --- /dev/null +++ b/rpm-5.4.9/ltmain.sh @@ -0,0 +1,9675 @@ + +# libtool (GNU libtool) 2.4.2 +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010, 2011 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --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 +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --no-warn don't display warning messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed 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) +# $progname: (GNU libtool) 2.4.2 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . + +PROGRAM=libtool +PACKAGE=libtool +VERSION=2.4.2 +TIMESTAMP="" +package_revision=1.3337 + +# define SED for historic ltconfig's generated by Libtool 1.3 +test -z "$SED" && SED=sed + +# 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 + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +$lt_unset CDPATH + + +# 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" + + + +: ${CP="cp -f"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +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. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation + + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# 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. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # 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 "$removedotparts" -e "$collapseslashes" -e "$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 "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$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_normal_abspath_result=$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_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + 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 "x$func_relative_path_tlibdir" = x ; 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 "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +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 +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to 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 '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && 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_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_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 "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "$my_tmpdir" +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and 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_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent 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 () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent 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 () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + 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 () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $opt_debug + + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $opt_debug + + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $opt_debug + + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ + p + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $opt_debug + + func_error "missing argument for $1." + exit_cmd=exit +} + + +# 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. +func_split_short_opt () +{ + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' + + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation + +exit_cmd=: + + + + + +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" + +# Global variables. +nonopt= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +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= + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "${1}=\$${1}\${2}" +} # func_append may be replaced by extended shell implementation + +# func_append_quoted var value +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +func_append_quoted () +{ + func_quote_for_eval "${2}" + eval "${1}=\$${1}\\ \$func_quote_for_eval_result" +} # func_append_quoted may be replaced by extended shell implementation + + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "${@}"` +} # func_arith may be replaced by extended shell implementation + + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + +# func_fatal_configuration arg... +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "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 "$build_libtool_libs" = yes; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; 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 +} + + +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac + + + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_warning=: +opt_verbose=: +opt_silent=false +opt_verbose=false + + +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do + opt="$1" + shift + case $opt in + --debug|-x) opt_debug='set -x' + func_echo "enabling shell trace mode" + $opt_debug + ;; + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" + shift + ;; + --preserve-dup-deps) + opt_preserve_dup_deps=: + ;; + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) + opt_silent=false +func_append preserve_args " $opt" + ;; + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; + --no-verbose) + opt_verbose=false +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" + shift + ;; + + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + + # Separate optargs to long options: + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; + esac + done + + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # 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 + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; 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." + } + + + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} + + + + +## ----------- ## +## Main. ## +## ----------- ## + +# 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 \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# 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 "$lalib_p" = yes +} + +# 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 () +{ + func_lalib_p "$1" +} + +# 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 () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + 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 () +{ + $opt_debug + 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 () +{ + $opt_debug + 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 "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; 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 "$lt_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 () +{ + $opt_debug + # 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 () +{ + $opt_debug + 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 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_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 () +{ + $opt_debug + 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 () +{ + $opt_debug + 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 () +{ + $opt_debug + 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 () +{ + $opt_debug + $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 () +{ + $opt_debug + 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 () +{ + $opt_debug + 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 () +{ + $opt_debug + 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 () +{ + $opt_debug + 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 () +{ + $opt_debug + 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 () +{ + $opt_debug + 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 () +{ + $opt_debug + 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 () +{ + $opt_debug + 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 () +{ + $opt_debug + 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 () +{ + $opt_debug + 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 () +{ + $opt_debug + 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 () +{ + $opt_debug + 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 () +{ + $opt_debug + 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_mode_compile arg... +func_mode_compile () +{ + $opt_debug + # 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 "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; 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 "$pic_mode" = no && test "$deplibs_check_method" != pass_all; 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 "$compiler_c_o" = no; 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 "$need_locks" = yes; 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 "$need_locks" = warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; 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 "$need_locks" = warn && + 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 "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; 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 "$need_locks" = warn && + 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 "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$opt_mode'" + ;; + esac + + echo + $ECHO "Try \`$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # 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 test "X$opt_dry_run" = Xfalse; then + 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" + else + # 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 + fi +} + +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + 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_silent && 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 "$opt_mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + 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=yes ;; + -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$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; 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 + ;; + 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 "$build_old_libs" = yes; 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=yes + 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'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; 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_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = install && 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 () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; 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$TIMESTAMP) $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 con'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 + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; 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 + + 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[]; +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + 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" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + 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"' + + # 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_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 () +{ + $opt_debug + 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 + 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 + } + }'` + 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 () +{ + $opt_debug + 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 () +{ + $opt_debug + 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 which possess that section. Heuristic: eliminate + # all those which 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_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 () +{ + $opt_debug + 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 () +{ + $opt_debug + 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_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 () +{ + $opt_debug + 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 () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + if test "$lock_old_archive_extraction" = yes; 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 "$lock_old_archive_extraction" = yes; 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 () +{ + $opt_debug + 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` + darwin_base_archive=`basename "$darwin_archive"` + 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 "$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 in which 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$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which 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$TIMESTAMP) $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 "$fast_install" = yes; 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 "$shlibpath_overrides_runpath" = yes && 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 + +/* 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 platforms) ... */ +#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 +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#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 ((void *) 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]; + int 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 = 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 (strcmp (str, pat) == 0) + *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 + int 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) + { + int orig_value_len = strlen (orig_value); + int 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 #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\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 () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + 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 + # which 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 which 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= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + 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 "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; 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 + ;; + 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 "$pic_object" = none && + test "$non_pic_object" = none; 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 "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; 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 "$prev" = dlprefiles; 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 "$non_pic_object" != none; 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 "$pic_object" = none ; 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 + ;; + 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 "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; 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$arg" = "X-lc" || test "X$arg" = "X-lm"; 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$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && 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$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + -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*|-flto*|-fwhopr*|-fuse-linker-plugin) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; 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 "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; 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 "$prev" = dlprefiles; 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 "$non_pic_object" != none; 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 "$pic_object" = none ; 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 "$prev" = dlfiles; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + if test "$module" = yes ; then + # [Mandriva] override ld option "--no-undefined" which is wrong for plugins + linker_flags="$linker_flags --warn-unresolved-symbols" + compiler_flags="$compiler_flags -Wl,--warn-unresolved-symbols" + fi + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && 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\" + + 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 "$linkmode" = lib; 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=no + 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 "$linkmode,$pass" = "lib,link"; 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 "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; 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 "$linkmode,$pass" = "lib,dlpreopen"; 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 "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; 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 "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # 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 "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; 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=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; 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 "$pass" = conv && 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 "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; 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 "$pass" = link; 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 "$pass" = conv; 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=no + 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=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + 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." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; 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=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # 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 "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; 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 "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; 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 "X$installed" = Xyes; 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 "X$hardcode_automatic" = Xyes && 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 "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; 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 "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; 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 "$linkmode" = prog && test "$pass" != link; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + 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 test "$linkalldeplibs" = yes; 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 "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + 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 test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + 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 "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test "$installed" = no; 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 "$shouldnotlink" = yes && test "$pass" = link; then + echo + if test "$linkmode" = prog; 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 "$linkmode" = lib && + test "$hardcode_into_libs" = yes; 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*) + 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 "$linkmode" = prog || test "$opt_mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; 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 can not + # 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 "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; 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 "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; 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 "$linkmode" = prog; 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 "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$opt_mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; 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 "$linkmode" = prog; 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 "$linkmode" = prog; 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 "$hardcode_direct" != unsupported; 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 "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; 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 can not 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 "$module" = yes; 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 "$build_old_libs" = no; 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 "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; 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 "$link_static" = no && 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 "$link_all_deplibs" != no; 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 "$pass" = link; then + if test "$linkmode" = "prog"; 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 "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # 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= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_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 + # 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 "$linkmode" = prog; then + dlfiles="$newdlfiles" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; 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 "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; 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 "$deplibs_check_method" != pass_all; 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 "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; 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 + # which has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|qnx|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; 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 "$loop" -ne 0; 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 "$loop" -ne 0; 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" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + 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 "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + func_append libobjs " $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$opt_mode" != relink; 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 "X$precious_files_regex" != "X"; 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 "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; 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 "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; 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 "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; 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 "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; 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 "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; 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 "X$deplibs_check_method" = "Xnone"; 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 "$droppeddeps" = yes; then + if test "$module" = yes; 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 "$build_old_libs" = no; 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 "$allow_undefined" = no; 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 "$build_old_libs" = no; 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 "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$opt_mode" != relink && 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 "$opt_mode" != relink && 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 + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # 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 + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || 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 "$try_normal_branch" = yes \ + && { 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 "X$skipped_export" != "X:"; 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 "X$skipped_export" != "X:" && 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= + inst_prefix_arg= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + if test -n "$inst_prefix_dir" && test "$inst_prefix_dir" != "/" && (echo "$test_deplib" | grep -- "$inst_prefix_dir" >/dev/null); then + func_append inst_prefix_arg " $test_deplib" + else + func_append tmp_deplibs " $test_deplib" + fi + ;; + esac + done + deplibs="$tmp_deplibs" + if test -n "$inst_prefix_arg"; then + deplibs="$inst_prefix_arg $deplibs" + fi + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" = yes && + 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 "$thread_safe" = yes && 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 "$opt_mode" = relink; 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 "$module" = yes && 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 "X$skipped_export" != "X:" && + 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 "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; 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 "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; 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 "X$objlist" = X || + 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 "$k" -eq 1 ; 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 + + if ${skipped_export-false}; then + 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 + 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_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; 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 + + if ${skipped_export-false}; then + 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 + 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 "$module" = yes && 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="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; 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 "$opt_mode" = relink; 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 "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; 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= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + 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 "$build_libtool_libs" != yes && 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" ### testsuite: skip nested quoting test + + 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 + + if test "$build_libtool_libs" != yes; then + 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 + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; 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" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + 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 "$tagname" = CXX ; 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 "$build_old_libs" = yes; 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@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # 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 + fi + + 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 "$no_install" = yes; 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 + + if test "$hardcode_action" = relink; then + # 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" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then + func_append oldobjs " $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + 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 "$build_libtool_libs" = yes; 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 "X$oldobjs" = "X" ; 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 "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" = yes; 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 "x$bindir" != x ; + 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$TIMESTAMP) $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 can not 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 "$installed" = no && test "$need_relink" = yes; 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 +} + +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + RM="$nonopt" + files= + rmforce= + 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=yes ;; + -*) 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 "X$dir" = X.; then + odir="$objdir" + else + odir="$dir/$objdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$opt_mode" = uninstall && odir="$dir" + + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; 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 test "$rmforce" = yes; 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" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || 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 "$pic_object" != none; 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 "$non_pic_object" != none; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$opt_mode" = clean ; 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 "$fast_install" = yes && 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 +} + +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +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 +# in which 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: +# vi:sw=2 + diff --git a/rpm-5.4.9/lua/.cvsignore b/rpm-5.4.9/lua/.cvsignore new file mode 100644 index 0000000..8d033b3 --- /dev/null +++ b/rpm-5.4.9/lua/.cvsignore @@ -0,0 +1,12 @@ +.deps +Makefile +Makefile.in +.libs +*.gcda +*.gcno +*.la +*.lcd +*.lo +bin2c +rpmlua +rpmluac diff --git a/rpm-5.4.9/lua/.splintrc b/rpm-5.4.9/lua/.splintrc new file mode 100644 index 0000000..2983f38 --- /dev/null +++ b/rpm-5.4.9/lua/.splintrc @@ -0,0 +1,92 @@ +-I. -I./include -I./local -DHAVE_CONFIG_H -DUSE_DLOPEN -DWITH_POSIX -D_GNU_SOURCE -D_REENTRANT -DUSE_POPEN + +#+partial ++forcehints + + +#-warnunixlib +-warnposix + ++unixlib + +#-unrecogcomments # XXX ignore doxygen markings + ++strict # lclint level + +# --- in progress ++enumindex # 20 + +-boolops # 8 +-branchstate # 54 +-bufferoverflowhigh # 1 +-castfcnptr # 1 +-compdef # 111 +-compdestroy # 18 +-compmempass # 137 +-declundef # 42 +-evalorder # 60 +-infloops # 2 +-mayaliasunique # 4 +-moduncon # 5 dlopen et al +-modunconnomods # 6 ctype.h +-noeffect # 169 +-noeffectuncon # 5 +-nullderef # 109 +-nullpass # 28 +-nullptrarith # 11 +-nullret # 1 +-nullstate # 19 +-predboolptr # 34 +-protoparammatch # 58 +-realcompare # 8 +-retalias # 30 +-retvalint # 44 +-retvalother # 42 +-shiftnegative # 8 +-sizeoftype # 125 +-stackref # 5 +-type # 12 +-uniondef # 26 +-unrecog +-usereleased # 13 + +-immediatetrans # 40 +-temptrans # 27 +-unqualifiedtrans # 2 + +-casebreak # 3 +-looploopbreak # 1 +-loopswitchbreak # 89 +-switchswitchbreak # 9 + +-exportheader # 233 +-exportlocal # 13 +-exporttype + +-fielduse # 24 +-typeuse # 1 ls_hash + +# --- not-yet at strict level +-bitwisesigned # +-elseifcomplete # +-forblock # +-ifblock # +-incondefs # +-namechecks # tedious ANSI compliance checks +-ptrarith # tedious + +-mustdefine # +-shiftimplementation # + +-strictops # +-whileblock # + +# --- not-yet at checks level +-mustfree # +-usedef # + +# --- not-yet at standard level ++boolint # ++charint # ++ignorequals # ++matchanyintegral # diff --git a/rpm-5.4.9/lua/COPYRIGHT b/rpm-5.4.9/lua/COPYRIGHT new file mode 100644 index 0000000..a54a16e --- /dev/null +++ b/rpm-5.4.9/lua/COPYRIGHT @@ -0,0 +1,34 @@ +Lua License +----------- + +Lua is licensed under the terms of the MIT license reproduced below. +This means that Lua is free software and can be used for both academic +and commercial purposes at absolutely no cost. + +For details and rationale, see http://www.lua.org/license.html . + +=============================================================================== + +Copyright (C) 1994-2007 Lua.org, PUC-Rio. + +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 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +=============================================================================== + +(end of COPYRIGHT) diff --git a/rpm-5.4.9/lua/HISTORY b/rpm-5.4.9/lua/HISTORY new file mode 100644 index 0000000..ce0c95b --- /dev/null +++ b/rpm-5.4.9/lua/HISTORY @@ -0,0 +1,183 @@ +HISTORY for Lua 5.1 + +* Changes from version 5.0 to 5.1 + ------------------------------- + Language: + + new module system. + + new semantics for control variables of fors. + + new semantics for setn/getn. + + new syntax/semantics for varargs. + + new long strings and comments. + + new `mod' operator (`%') + + new length operator #t + + metatables for all types + API: + + new functions: lua_createtable, lua_get(set)field, lua_push(to)integer. + + user supplies memory allocator (lua_open becomes lua_newstate). + + luaopen_* functions must be called through Lua. + Implementation: + + new configuration scheme via luaconf.h. + + incremental garbage collection. + + better handling of end-of-line in the lexer. + + fully reentrant parser (new Lua function `load') + + better support for 64-bit machines. + + native loadlib support for Mac OS X. + + standard distribution in only one library (lualib.a merged into lua.a) + +* Changes from version 4.0 to 5.0 + ------------------------------- + Language: + + lexical scoping. + + Lua coroutines. + + standard libraries now packaged in tables. + + tags replaced by metatables and tag methods replaced by metamethods, + stored in metatables. + + proper tail calls. + + each function can have its own global table, which can be shared. + + new __newindex metamethod, called when we insert a new key into a table. + + new block comments: --[[ ... ]]. + + new generic for. + + new weak tables. + + new boolean type. + + new syntax "local function". + + (f()) returns the first value returned by f. + + {f()} fills a table with all values returned by f. + + \n ignored in [[\n . + + fixed and-or priorities. + + more general syntax for function definition (e.g. function a.x.y:f()...end). + + more general syntax for function calls (e.g. (print or write)(9)). + + new functions (time/date, tmpfile, unpack, require, load*, etc.). + API: + + chunks are loaded by using lua_load; new luaL_loadfile and luaL_loadbuffer. + + introduced lightweight userdata, a simple "void*" without a metatable. + + new error handling protocol: the core no longer prints error messages; + all errors are reported to the caller on the stack. + + new lua_atpanic for host cleanup. + + new, signal-safe, hook scheme. + Implementation: + + new license: MIT. + + new, faster, register-based virtual machine. + + support for external multithreading and coroutines. + + new and consistent error message format. + + the core no longer needs "stdio.h" for anything (except for a single + use of sprintf to convert numbers to strings). + + lua.c now runs the environment variable LUA_INIT, if present. It can + be "@filename", to run a file, or the chunk itself. + + support for user extensions in lua.c. + sample implementation given for command line editing. + + new dynamic loading library, active by default on several platforms. + + safe garbage-collector metamethods. + + precompiled bytecodes checked for integrity (secure binary dostring). + + strings are fully aligned. + + position capture in string.find. + + read('*l') can read lines with embedded zeros. + +* Changes from version 3.2 to 4.0 + ------------------------------- + Language: + + new "break" and "for" statements (both numerical and for tables). + + uniform treatment of globals: globals are now stored in a Lua table. + + improved error messages. + + no more '$debug': full speed *and* full debug information. + + new read form: read(N) for next N bytes. + + general read patterns now deprecated. + (still available with -DCOMPAT_READPATTERNS.) + + all return values are passed as arguments for the last function + (old semantics still available with -DLUA_COMPAT_ARGRET) + + garbage collection tag methods for tables now deprecated. + + there is now only one tag method for order. + API: + + New API: fully re-entrant, simpler, and more efficient. + + New debug API. + Implementation: + + faster than ever: cleaner virtual machine and new hashing algorithm. + + non-recursive garbage-collector algorithm. + + reduced memory usage for programs with many strings. + + improved treatment for memory allocation errors. + + improved support for 16-bit machines (we hope). + + code now compiles unmodified as both ANSI C and C++. + + numbers in bases other than 10 are converted using strtoul. + + new -f option in Lua to support #! scripts. + + luac can now combine text and binaries. + +* Changes from version 3.1 to 3.2 + ------------------------------- + + redirected all output in Lua's core to _ERRORMESSAGE and _ALERT. + + increased limit on the number of constants and globals per function + (from 2^16 to 2^24). + + debugging info (lua_debug and hooks) moved into lua_state and new API + functions provided to get and set this info. + + new debug lib gives full debugging access within Lua. + + new table functions "foreachi", "sort", "tinsert", "tremove", "getn". + + new io functions "flush", "seek". + +* Changes from version 3.0 to 3.1 + ------------------------------- + + NEW FEATURE: anonymous functions with closures (via "upvalues"). + + new syntax: + - local variables in chunks. + - better scope control with DO block END. + - constructors can now be also written: { record-part; list-part }. + - more general syntax for function calls and lvalues, e.g.: + f(x).y=1 + o:f(x,y):g(z) + f"string" is sugar for f("string") + + strings may now contain arbitrary binary data (e.g., embedded zeros). + + major code re-organization and clean-up; reduced module interdependecies. + + no arbitrary limits on the total number of constants and globals. + + support for multiple global contexts. + + better syntax error messages. + + new traversal functions "foreach" and "foreachvar". + + the default for numbers is now double. + changing it to use floats or longs is easy. + + complete debug information stored in pre-compiled chunks. + + sample interpreter now prompts user when run interactively, and also + handles control-C interruptions gracefully. + +* Changes from version 2.5 to 3.0 + ------------------------------- + + NEW CONCEPT: "tag methods". + Tag methods replace fallbacks as the meta-mechanism for extending the + semantics of Lua. Whereas fallbacks had a global nature, tag methods + work on objects having the same tag (e.g., groups of tables). + Existing code that uses fallbacks should work without change. + + new, general syntax for constructors {[exp] = exp, ... }. + + support for handling variable number of arguments in functions (varargs). + + support for conditional compilation ($if ... $else ... $end). + + cleaner semantics in API simplifies host code. + + better support for writing libraries (auxlib.h). + + better type checking and error messages in the standard library. + + luac can now also undump. + +* Changes from version 2.4 to 2.5 + ------------------------------- + + io and string libraries are now based on pattern matching; + the old libraries are still available for compatibility + + dofile and dostring can now return values (via return statement) + + better support for 16- and 64-bit machines + + expanded documentation, with more examples + +* Changes from version 2.2 to 2.4 + ------------------------------- + + external compiler creates portable binary files that can be loaded faster + + interface for debugging and profiling + + new "getglobal" fallback + + new functions for handling references to Lua objects + + new functions in standard lib + + only one copy of each string is stored + + expanded documentation, with more examples + +* Changes from version 2.1 to 2.2 + ------------------------------- + + functions now may be declared with any "lvalue" as a name + + garbage collection of functions + + support for pipes + +* Changes from version 1.1 to 2.1 + ------------------------------- + + object-oriented support + + fallbacks + + simplified syntax for tables + + many internal improvements + +(end of HISTORY) diff --git a/rpm-5.4.9/lua/Makefile b/rpm-5.4.9/lua/Makefile new file mode 100644 index 0000000..bf167f2 --- /dev/null +++ b/rpm-5.4.9/lua/Makefile @@ -0,0 +1,1915 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# lua/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. + + + + + +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/rpm +pkgincludedir = $(includedir)/rpm +pkglibexecdir = $(libexecdir)/rpm +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 = x86_64-unknown-linux-gnu +host_triplet = x86_64-unknown-linux-gnu +target_triplet = x86_64-unknown-linux-gnu +am__append_1 = \ + -I$(srcdir)/chkconfig \ + -I$(builddir)/chkconfig \ + $(WITH_POPT_CPPFLAGS) + +am__append_2 = \ + -I$(srcdir)/shadow \ + -I$(builddir)/shadow + +pkgbin_PROGRAMS = rpmlua$(EXEEXT) rpmluac$(EXEEXT) +noinst_PROGRAMS = bin2c$(EXEEXT) +#am__append_3 = \ +# -DCRYPTO_OPENSSL + +#am__append_4 = \ +# local/lcrypto.c \ +# local/lcrypto.h \ +# local/lxplib.c \ +# local/lxplib.h + +am__append_5 = \ + local/lcrypto.c \ + local/lcrypto.h \ + local/lxplib.c \ + local/lxplib.h + +#am__append_6 = \ +# socket/auxiliar.c \ +# socket/auxiliar.h \ +# socket/buffer.c \ +# socket/buffer.h \ +# socket/except.c \ +# socket/except.h \ +# socket/ftp.lua \ +# socket/http.lua \ +# socket/inet.c \ +# socket/inet.h \ +# socket/io.c \ +# socket/io.h \ +# socket/ltn12.lua \ +# socket/luasocket.c \ +# socket/luasocket.h \ +# socket/mime.c \ +# socket/mime.h \ +# socket/mime.lua \ +# socket/options.c \ +# socket/options.h \ +# socket/select.c \ +# socket/select.h \ +# socket/smtp.lua \ +# socket/socket.h \ +# socket/socket.lua \ +# socket/tcp.c \ +# socket/tcp.h \ +# socket/timeout.c \ +# socket/timeout.h \ +# socket/tp.lua \ +# socket/udp.c \ +# socket/udp.h \ +# socket/unix.c \ +# socket/unix.h \ +# socket/url.lua \ +# socket/usocket.c \ +# socket/usocket.h \ +# socket/wsocket.c \ +# socket/wsocket.h + +am__append_7 = \ + socket/auxiliar.c \ + socket/auxiliar.h \ + socket/buffer.c \ + socket/buffer.h \ + socket/except.c \ + socket/except.h \ + socket/ftp.lua \ + socket/http.lua \ + socket/inet.c \ + socket/inet.h \ + socket/io.c \ + socket/io.h \ + socket/ltn12.lua \ + socket/luasocket.c \ + socket/luasocket.h \ + socket/mime.c \ + socket/mime.h \ + socket/mime.lua \ + socket/options.c \ + socket/options.h \ + socket/select.c \ + socket/select.h \ + socket/smtp.lua \ + socket/socket.h \ + socket/socket.lua \ + socket/tcp.c \ + socket/tcp.h \ + socket/timeout.c \ + socket/timeout.h \ + socket/tp.lua \ + socket/udp.c \ + socket/udp.h \ + socket/unix.c \ + socket/unix.h \ + socket/url.lua \ + socket/usocket.c \ + socket/usocket.h \ + socket/wsocket.c \ + socket/wsocket.h + +am__append_8 = \ + -DUSE_LUA_SHADOW + +am__append_9 = \ + shadow/chkname.h \ + shadow/commonio.h \ + shadow/commonio.c \ + shadow/shadow_config.h \ + shadow/copydir.c \ + shadow/defines.h \ + shadow/faillog.h \ + shadow/fputsx.c \ + shadow/getdef.h \ + shadow/getdef.c \ + shadow/groupadd.c \ + shadow/groupio.h \ + shadow/groupio.c \ + shadow/gshadow_.h \ + shadow/gshadow.c \ + shadow/list.c \ + shadow/nscd.h \ + shadow/prototypes.h \ + shadow/pwauth.h \ + shadow/pwio.h \ + shadow/pwio.c \ + shadow/sgroupio.h \ + shadow/sgroupio.c \ + shadow/sgetgrent.c \ + shadow/sgetpwent.c \ + shadow/shadowio.h \ + shadow/shadowio.c \ + shadow/strtoday.c \ + shadow/useradd.c + +#am__append_10 = \ +# shadow/chkname.h \ +# shadow/commonio.c \ +# shadow/commonio.h \ +# shadow/copydir.c \ +# shadow/defines.h \ +# shadow/faillog.h \ +# shadow/fputsx.c \ +# shadow/getdef.c \ +# shadow/getdef.h \ +# shadow/groupadd.c \ +# shadow/groupio.c \ +# shadow/groupio.h \ +# shadow/gshadow.c \ +# shadow/gshadow_.h \ +# shadow/list.c \ +# shadow/nscd.h \ +# shadow/prototypes.h \ +# shadow/pwauth.h \ +# shadow/pwio.c \ +# shadow/pwio.h \ +# shadow/sgetgrent.c \ +# shadow/sgetpwent.c \ +# shadow/sgroupio.c \ +# shadow/sgroupio.h \ +# shadow/shadow_config.h \ +# shadow/shadowio.c \ +# shadow/shadowio.h \ +# shadow/strtoday.c \ +# shadow/useradd.c + +am__append_11 = \ + -DUSE_LUA_CHKCONFIG + +am__append_12 = \ + chkconfig/chkconfig.c \ + chkconfig/leveldb.h \ + chkconfig/leveldb.c + +#am__append_13 = \ +# chkconfig/chkconfig.c \ +# chkconfig/leveldb.c \ +# chkconfig/leveldb.h + +subdir = lua +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(pkgbindir)" +LTLIBRARIES = $(pkglib_LTLIBRARIES) +liblua_la_DEPENDENCIES = +am__liblua_la_SOURCES_DIST = local/lcrypto.c local/lcrypto.h \ + local/lxplib.c local/lxplib.h socket/auxiliar.c \ + socket/auxiliar.h socket/buffer.c socket/buffer.h \ + socket/except.c socket/except.h socket/ftp.lua socket/http.lua \ + socket/inet.c socket/inet.h socket/io.c socket/io.h \ + socket/ltn12.lua socket/luasocket.c socket/luasocket.h \ + socket/mime.c socket/mime.h socket/mime.lua socket/options.c \ + socket/options.h socket/select.c socket/select.h \ + socket/smtp.lua socket/socket.h socket/socket.lua socket/tcp.c \ + socket/tcp.h socket/timeout.c socket/timeout.h socket/tp.lua \ + socket/udp.c socket/udp.h socket/unix.c socket/unix.h \ + socket/url.lua socket/usocket.c socket/usocket.h \ + socket/wsocket.c socket/wsocket.h shadow/chkname.h \ + shadow/commonio.h shadow/commonio.c shadow/shadow_config.h \ + shadow/copydir.c shadow/defines.h shadow/faillog.h \ + shadow/fputsx.c shadow/getdef.h shadow/getdef.c \ + shadow/groupadd.c shadow/groupio.h shadow/groupio.c \ + shadow/gshadow_.h shadow/gshadow.c shadow/list.c shadow/nscd.h \ + shadow/prototypes.h shadow/pwauth.h shadow/pwio.h \ + shadow/pwio.c shadow/sgroupio.h shadow/sgroupio.c \ + shadow/sgetgrent.c shadow/sgetpwent.c shadow/shadowio.h \ + shadow/shadowio.c shadow/strtoday.c shadow/useradd.c \ + chkconfig/chkconfig.c chkconfig/leveldb.h chkconfig/leveldb.c \ + local/llocal.c local/llocal.h local/lposix.h local/lposix.c \ + local/lrexlib.h local/lrexlib_algo.h local/lrexlib_common.h \ + local/lrexlib_common.c local/lrexlib_lpcre.c \ + local/lrexlib_lpcre_f.c local/lrexlib_lposix.c local/lshadow.h \ + local/lshadow.c local/luuid.h local/luuid.c local/lwrs.h \ + local/lwrs.c linit.c lauxlib.h lauxlib.c lua.h luaconf.h \ + lualib.h lbaselib.c ldblib.c liolib.c loslib.c lmathlib.c \ + loadlib.c lstrlib.c ltablib.c lapi.c lapi.h lcode.c lcode.h \ + ldebug.c ldebug.h ldo.c ldo.h ldump.c lfunc.c lfunc.h lgc.c \ + lgc.h llex.c llex.h llimits.h lmem.c lmem.h lobject.c \ + lobject.h lopcodes.c lopcodes.h lparser.c lparser.h lstate.c \ + lstate.h lstring.c lstring.h ltable.c ltable.h ltests.c ltm.c \ + ltm.h lundump.c lundump.h lvm.c lvm.h lzio.c lzio.h +#am__objects_1 = liblua_la-lcrypto.lo \ +# liblua_la-lxplib.lo +#am__objects_2 = liblua_la-auxiliar.lo \ +# liblua_la-buffer.lo liblua_la-except.lo \ +# liblua_la-inet.lo liblua_la-io.lo \ +# liblua_la-luasocket.lo liblua_la-mime.lo \ +# liblua_la-options.lo liblua_la-select.lo \ +# liblua_la-tcp.lo liblua_la-timeout.lo \ +# liblua_la-udp.lo liblua_la-unix.lo \ +# liblua_la-usocket.lo liblua_la-wsocket.lo +am__objects_3 = liblua_la-commonio.lo \ + liblua_la-copydir.lo liblua_la-fputsx.lo \ + liblua_la-getdef.lo liblua_la-groupadd.lo \ + liblua_la-groupio.lo liblua_la-gshadow.lo \ + liblua_la-list.lo liblua_la-pwio.lo \ + liblua_la-sgroupio.lo \ + liblua_la-sgetgrent.lo \ + liblua_la-sgetpwent.lo \ + liblua_la-shadowio.lo \ + liblua_la-strtoday.lo \ + liblua_la-useradd.lo +am__objects_4 = liblua_la-chkconfig.lo \ + liblua_la-leveldb.lo +am_liblua_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) $(am__objects_4) liblua_la-llocal.lo \ + liblua_la-lposix.lo liblua_la-lrexlib_common.lo \ + liblua_la-lrexlib_lpcre.lo liblua_la-lrexlib_lpcre_f.lo \ + liblua_la-lrexlib_lposix.lo liblua_la-lshadow.lo \ + liblua_la-luuid.lo liblua_la-lwrs.lo liblua_la-linit.lo \ + liblua_la-lauxlib.lo liblua_la-lbaselib.lo liblua_la-ldblib.lo \ + liblua_la-liolib.lo liblua_la-loslib.lo liblua_la-lmathlib.lo \ + liblua_la-loadlib.lo liblua_la-lstrlib.lo liblua_la-ltablib.lo \ + liblua_la-lapi.lo liblua_la-lcode.lo liblua_la-ldebug.lo \ + liblua_la-ldo.lo liblua_la-ldump.lo liblua_la-lfunc.lo \ + liblua_la-lgc.lo liblua_la-llex.lo liblua_la-lmem.lo \ + liblua_la-lobject.lo liblua_la-lopcodes.lo \ + liblua_la-lparser.lo liblua_la-lstate.lo liblua_la-lstring.lo \ + liblua_la-ltable.lo liblua_la-ltests.lo liblua_la-ltm.lo \ + liblua_la-lundump.lo liblua_la-lvm.lo liblua_la-lzio.lo +liblua_la_OBJECTS = $(am_liblua_la_OBJECTS) +liblua_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(liblua_la_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +PROGRAMS = $(noinst_PROGRAMS) $(pkgbin_PROGRAMS) +bin2c_SOURCES = bin2c.c +bin2c_OBJECTS = bin2c.$(OBJEXT) +bin2c_LDADD = $(LDADD) +am_rpmlua_OBJECTS = rpmlua-lua.$(OBJEXT) +rpmlua_OBJECTS = $(am_rpmlua_OBJECTS) +rpmlua_DEPENDENCIES = liblua.la +rpmlua_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(rpmlua_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_rpmluac_OBJECTS = rpmluac-luac.$(OBJEXT) rpmluac-print.$(OBJEXT) +rpmluac_OBJECTS = $(am_rpmluac_OBJECTS) +rpmluac_DEPENDENCIES = liblua.la +rpmluac_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(rpmluac_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(liblua_la_SOURCES) bin2c.c $(rpmlua_SOURCES) \ + $(rpmluac_SOURCES) +DIST_SOURCES = $(am__liblua_la_SOURCES_DIST) bin2c.c $(rpmlua_SOURCES) \ + $(rpmluac_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkglibdir = /usr/lib/rpm/lib +ACLOCAL = ${SHELL} /home/mdawkins/wdj54/missing --run aclocal-1.11 +ALLOCA = +AMTAR = $${TAR-tar} +AR = ar +AS = /usr/bin/as +AUTOCONF = ${SHELL} /home/mdawkins/wdj54/missing --run autoconf +AUTOHEADER = ${SHELL} /home/mdawkins/wdj54/missing --run autoheader +AUTOMAKE = ${SHELL} /home/mdawkins/wdj54/missing --run automake-1.11 +AWK = gawk +BUILDROOTDIR_MACRO = %{_tmppath} +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -O2 -g -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC -DPIC -Wall -W -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -Wno-unused-parameter -Wformat-security -g3 -fno-delete-null-pointer-checks -D_FORTIFY_SOURCE=2 -fstack-protector -fexceptions -fexceptions -Wno-missing-field-initializers -D_GNU_SOURCE -D_REENTRANT +CPP = gcc -E +CPPFLAGS = -DRPM_OS_LINUX=030300 -I/usr/include/p11-kit-1 -I/usr/include/neon -I/usr/include/db53 -I/usr/include/libxml2 -I/usr/include/ossp-uuid -I/usr/include/ossp-uuid +CXX = g++ +CXXCPP = g++ -E +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -O2 -g -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 +CYGPATH_W = echo +DBAPI = 3 +DBLIBOBJS = db3.lo sqlite.lo +DBLIBSRCS = db3.c sqlite.c +DBPATH = /var/lib/rpm +DBPATH_MACRO = %{_var}/lib/rpm +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DISTRO_MACROS = +DLLTOOL = false +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = +FGREP = /bin/grep -F +FIXPERMS = a+rX,u+w,g-w,o-w +GETTEXT_MACRO_VERSION = 0.18 +GMSGFMT = /usr/bin/msgfmt +GMSGFMT_015 = /usr/bin/msgfmt +GPSEE_MODULES_PATH = +GREP = /bin/grep +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +INTLLIBS = +INTL_MACOSX_LIBS = +LD = /usr/bin/ld -m elf_x86_64 +LDFLAGS = -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -L/usr/lib64/ +LDFLAGS_STATIC = +LD_VERSION_SCRIPT_FLAG = --version-script +LIBICONV = -liconv +LIBINTL = +LIBOBJS = +LIBS = -lcpuinfo -lkeyutils -lacl -lattr -lsyck -luuid -lossp-uuid -lpcreposix -lpcre -ldl -lm -ltcl -ltcl8.6 -laugeas -lreadline -lsqlite3 -ldb-5.3 -lmagic -lneon -lgnutls -ltasn1 -lcrypto -lgcrypt -lbeecrypt -llzma -lbz2 -lz -lpopt -lpthread -lrt -lelf -lpopt -lz -lgcrypt -lgpg-error -lssl -lcrypto -ltasn1 -lgnutls -lneon -laugeas -lxml2 -lpcre -lcpuinfo +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIBTOOLIZE = libtoolize +LIPO = +LN_S = ln -s +LOCALEDIR = /usr/share/locale +LTLIBICONV = -liconv +LTLIBINTL = +LTLIBOBJS = +LT_AGE = 0 +LT_CURRENT = 5 +LT_REVISION = 4 +MACROFILES = /usr/lib/rpm/macros:/usr/lib/rpm/%{_target}/macros:/etc/rpm/macros.*:/etc/rpm/macros:/etc/rpm/%{_target}/macros:/usr/lib/rpm/platform/%{_target}/macros:/usr/lib/rpm/mandriva/platform/%{_target}/macros:/etc/rpm/macros.d/*.macros:/usr/lib/rpm/macros.d/mandriva:~/.rpmmacros +MAGIC_MACRO = /usr/share/misc/magic +MAINT = +MAKEINFO = ${SHELL} /home/mdawkins/wdj54/missing --run makeinfo +MANIFEST_TOOL = : +MKDIR = /bin/mkdir +MKDIR_P = /bin/mkdir -p +MSGFMT = /usr/bin/msgfmt +MSGFMT_015 = /usr/bin/msgfmt +MSGMERGE = /usr/bin/msgmerge +NCPUS_COMMAND = /usr/bin/getconf _NPROCESSORS_ONLN +NM = /usr/bin/nm -B +NMEDIT = +OBJDUMP = objdump +OBJEXT = o +OPENMP_CFLAGS = -fopenmp +OPENMP_CXXFLAGS = -fopenmp +OTOOL = +OTOOL64 = +PACKAGE = rpm +PACKAGE_BUGREPORT = rpm-devel@rpm5.org +PACKAGE_NAME = rpm +PACKAGE_STRING = rpm 5.4.9 +PACKAGE_TARNAME = rpm +PACKAGE_URL = +PACKAGE_VERSION = 5.4.9 +PATH_SEPARATOR = : +PERL = /usr/bin/perl +PERL_INSTALLDIRS = 'INSTALLDIRS' => 'vendor', +PERL_URPM_INSTALLDIRS = +PKGSRCDIR = /usr/src/rpm +PKGSRCDIR_MACRO = %{_usr}/src/rpm +POSUB = po +PYTHON = /usr/bin/python +PYTHON_EXEC_PREFIX = ${exec_prefix} +PYTHON_PREFIX = ${prefix} +PYTHON_VERSION = 2.7 +RANLIB = ranlib +ROOT_GROUP = root +RPMCANONARCH = x86_64 +RPMCANONCOLOR = 3 +RPMCANONGNU = -gnu +RPMCANONOS = linux +RPMCANONVENDOR = mandriva +RPMGID = 37 +RPMGROUP = rpm +RPMLUAFILES = /usr/lib/rpm/init.lua:/usr/lib/rpm/rpmlua:/usr/lib/rpm/%{_target}/rpmlua:/etc/rpm/rpmlua.*:/etc/rpm/rpmlua:/etc/rpm/%{_target}/rpmlua:~/.rpmlua +RPMPOPTFILES = /usr/lib/rpm/rpmpopt:/usr/lib/rpm/%{_target}/rpmpopt:/etc/rpm/rpmpopt.*:/etc/rpm/rpmpopt:/etc/rpm/%{_target}/rpmpopt:~/.rpmpopt +RPMUID = 37 +RPMUSER = rpm +RPM_TIMESTAMP = 2012,4,2,0,0 +RPM_VENDOR = 'R','P','M','5' +RPM_VERSION = 5,4,r,9,0,_ +SED = /bin/sed +SET_MAKE = +SHELL = /bin/sh +STRIP = strip +SYSCONFIGDIR = /etc/rpm +USE_NLS = yes +USRLIBRPM = /usr/lib/rpm +VERSION = 5.4.9 +WITH_ACL = yes +WITH_APIDOCS = 1 +WITH_APIDOCS_TARGET = apidocs +WITH_APR = no +WITH_ATERM = no +WITH_ATTR = yes +WITH_AUGEAS = yes +WITH_AUGEAS_AUGTOOL = augtool +WITH_BASH = no +WITH_BASH_CPPFLAGS = +WITH_BASH_LDFLAGS = +WITH_BASH_LIBS = +WITH_BASH_SUBDIR = +WITH_BEECRYPT = yes +WITH_BEECRYPT_CPPFLAGS = +WITH_BEECRYPT_LDFLAGS = +WITH_BEECRYPT_LIBS = +WITH_BEECRYPT_SUBDIR = +WITH_BZIP2 = yes +WITH_CPUINFO = yes +WITH_CUDF = no +WITH_CUDF_CUDFTOOL = +WITH_DB = yes +WITH_DBSQL = no +WITH_DBSQL_CPPFLAGS = +WITH_DBSQL_LDFLAGS = +WITH_DBSQL_LIBS = +WITH_DBSQL_SUBDIR = +WITH_DB_CPPFLAGS = +WITH_DB_LDFLAGS = +WITH_DB_LIBS = +WITH_DB_SUBDIR = +WITH_DMALLOC = no +WITH_EFENCE = no +WITH_EXPAT = no +WITH_FICL = no +WITH_FICL_CPPFLAGS = +WITH_FICL_LDFLAGS = +WITH_FICL_LIBS = +WITH_FICL_SUBDIR = +WITH_FILE = yes +WITH_FILE_CPPFLAGS = +WITH_FILE_LDFLAGS = +WITH_FILE_LIBS = +WITH_FILE_SUBDIR = +WITH_GCRYPT = yes +WITH_GNUTLS = yes +WITH_GPSEE = no +WITH_GPSEE_CPPFLAGS = +WITH_GPSEE_LDFLAGS = +WITH_GPSEE_LIBS = +WITH_GPSEE_SUBDIR = +WITH_JS_SUBDIR = +WITH_KEYUTILS = yes +WITH_KEYUTILS_RPMKEY = rpmkey +WITH_LIBELF_DEBUGEDIT = debugedit +WITH_LIBGIT2 = no +WITH_LIBGIT2_CPPFLAGS = +WITH_LIBGIT2_LDFLAGS = +WITH_LIBGIT2_LIBS = +WITH_LIBGIT2_SUBDIR = +WITH_LIBTASN1 = yes +WITH_LUA = yes +WITH_LUA_CPPFLAGS = -I$(top_srcdir)/$(WITH_LUA_SUBDIR)/local -I$(top_builddir)/$(WITH_LUA_SUBDIR)/local -I$(top_srcdir)/$(WITH_LUA_SUBDIR) -I$(top_builddir)/$(WITH_LUA_SUBDIR) +WITH_LUA_LDFLAGS = -L$(top_builddir)/$(WITH_LUA_SUBDIR) +WITH_LUA_LIBS = -llua +WITH_LUA_SUBDIR = lua +WITH_LUA_SUBDIR_DEF = -DLUA_USE_DLOPEN -DLUA_USE_POSIX -DREX_POSIX_INCLUDE="" -DLUA_USE_PCRE -DLUA_USE_UUID +WITH_LUA_SUBDIR_LIB = +WITH_MOZJS185 = no +WITH_MOZJS185_CPPFLAGS = +WITH_MOZJS185_LDFLAGS = +WITH_MOZJS185_LIBS = +WITH_MOZJS185_SUBDIR = +WITH_NEON = yes +WITH_NEON_CPPFLAGS = +WITH_NEON_LDFLAGS = +WITH_NEON_LIBS = +WITH_NEON_SUBDIR = +WITH_NIX = no +WITH_NSS = no +WITH_OPENSSL = yes +WITH_PAKCHOIS = no +WITH_PATH_VERSIONED = no +WITH_PATH_VERSIONED_SUFFIX = +WITH_PCRE = yes +WITH_PCRE_CPPFLAGS = +WITH_PCRE_LDFLAGS = +WITH_PCRE_LIBS = +WITH_PCRE_SUBDIR = +WITH_PERLEMBED = no +WITH_PERL_LIBS = -lpthread -lrt -lelf +WITH_PERL_SUBDIR = perl +WITH_PERL_SUBPACKAGE = 1 +WITH_PERL_URPM_LIBS = -lpthread -lrt -lelf +WITH_PERL_URPM_SUBDIR = +WITH_PERL_URPM_SUBPACKAGE = 0 +WITH_POPT = yes +WITH_POPT_CPPFLAGS = +WITH_POPT_LDFLAGS = +WITH_POPT_LIBS = +WITH_POPT_SUBDIR = +WITH_PYTHONEMBED = no +WITH_PYTHON_INCDIR = /usr/include/python2.7 +WITH_PYTHON_SUBDIR = python +WITH_PYTHON_SUBPACKAGE = 1 +WITH_RC = no +WITH_RC_CPPFLAGS = +WITH_RC_LDFLAGS = +WITH_RC_LIBS = +WITH_RC_SUBDIR = +WITH_READLINE = yes +WITH_RUBY = no +WITH_RUBY_CPPFLAGS = +WITH_RUBY_SUBDIR = +WITH_RUBY_VENDORARCHDIR = +WITH_SELINUX = no +WITH_SEMANAGE = no +WITH_SEMANAGE_SEMODULE = +WITH_SEPOL = no +WITH_SPIDERMONKEY_SUBDIR = +WITH_SQLITE = yes +WITH_SQLITE_CPPFLAGS = +WITH_SQLITE_LDFLAGS = +WITH_SQLITE_LIBS = +WITH_SQLITE_SUBDIR = +WITH_SQUIRREL = no +WITH_SUBVERSION = no +WITH_SYCK = yes +WITH_SYCK_CPPFLAGS = +WITH_SYCK_LDFLAGS = +WITH_SYCK_LIBS = +WITH_SYCK_SUBDIR = +WITH_TCL = yes +WITH_TCL_SUBDIR = +WITH_TOMCRYPT = no +WITH_TPM = no +WITH_UNIXODBC = no +WITH_UUID = yes +WITH_XAR = no +WITH_XAR_CPPFLAGS = +WITH_XAR_LDFLAGS = +WITH_XAR_LIBS = +WITH_XAR_SUBDIR = +WITH_XZ = yes +WITH_XZ_CPPFLAGS = +WITH_XZ_LDFLAGS = +WITH_XZ_LIBS = +WITH_XZ_SUBDIR = +WITH_ZLIB = yes +WITH_ZLIB_CPPFLAGS = +WITH_ZLIB_LDFLAGS = +WITH_ZLIB_LIBS = +WITH_ZLIB_SUBDIR = +XGETTEXT = /usr/bin/xgettext +XGETTEXT_015 = /usr/bin/xgettext +XGETTEXT_EXTRA_OPTIONS = +YACC = bison -y +YFLAGS = +__BASH = /bin/bash +__BZIP2 = /usr/bin/bzip2 +__CAT = /bin/cat +__CHATTR = /usr/bin/chattr +__CHGRP = /bin/chgrp +__CHGRP_RHF = %{__chgrp} -Rhf +__CHMOD = /bin/chmod +__CHOWN = /bin/chown +__CHOWN_RHF = %{__chown} -Rhf +__CMAKE = %{_bindir}/cmake +__CPIO = /bin/cpio +__CURL = /usr/bin/curl +__CVS = /usr/bin/cvs +__DBSQL = %{_bindir}/db53sql +__DB_ARCHIVE = /usr/bin/db53_archive +__DB_CHECKPOINT = /usr/bin/db53_checkpoint +__DB_DEADLOCK = /usr/bin/db53_deadlock +__DB_DUMP = /usr/bin/db53_dump +__DB_HOTBACKUP = /usr/bin/db53_hotbackup +__DB_LOAD = /usr/bin/db53_load +__DB_LOG_VERIFY = /usr/bin/db53_log_verify +__DB_PRINTLOG = /usr/bin/db53_printlog +__DB_RECOVER = /usr/bin/db53_recover +__DB_REPLICATE = /usr/bin/db53_replicate +__DB_SQL_CODEGEN = /usr/bin/db53_sql_codegen +__DB_STAT = /usr/bin/db53_stat +__DB_TUNER = /usr/bin/db53_tuner +__DB_UPGRADE = /usr/bin/db53_upgrade +__DB_VERIFY = /usr/bin/db53_verify +__DIFF = /usr/bin/diff +__DITTO = %{_bindir}/ditto +__DOXYGEN = /usr/bin/doxygen +__FILE = /usr/bin/file +__GIT = /usr/bin/git +__GPG = /usr/bin/gpg2 +__GSR = %{_bindir}/gsr +__GST_INSPECT = %{_bindir}/gst-inspect-0.10 +__GZIP = /bin/gzip +__HG = /usr/bin/hg +__ID = /bin/id +__ID_U = %{__id} -u +__INSTALL = /usr/bin/install +__INSTALL_INFO = /sbin/install-info +__LD = /usr/bin/ld +__LDCONFIG = /sbin/ldconfig +__LN = /bin/ln +__LRZIP = /usr/bin/lrzip +__LSATTR = /usr/bin/lsattr +__LZIP = /usr/bin/lzip +__LZMA = /usr/bin/lzma +__LZOP = /usr/bin/lzop +__MAKE = /usr/bin/make +__MKDIR = /bin/mkdir +__MKDIR_P = /bin/mkdir -p +__MODINFO = /sbin/modinfo +__MONGO = %{_bindir}/mongo +__MV = /bin/mv +__NM = /usr/bin/nm +__OBJCOPY = /usr/bin/objcopy +__OBJDUMP = /usr/bin/objdump +__PATCH = /usr/bin/patch +__PAX = %{_bindir}/pax +__PERL = /usr/bin/perl +__PGP = %{_bindir}/pgp +__PHP = %{_bindir}/php +__PYTHON = /usr/bin/python +__RM = /bin/rm +__RMDIR = /bin/rmdir +__RSH = %{_bindir}/rsh +__RUBY = /usr/bin/ruby +__SED = /bin/sed +__SH = /bin/sh +__SQLITE3 = %{_bindir}/sqlite3 +__SSH = /usr/bin/ssh +__STRIP = /usr/bin/strip +__SVN = /usr/bin/svn +__TAR = /bin/tar +__TCLSH = /usr/bin/tclsh +__UNZIP = /usr/bin/unzip +__XZ = /usr/bin/xz +abs_builddir = /home/mdawkins/wdj54/lua +abs_srcdir = /home/mdawkins/wdj54/lua +abs_top_builddir = /home/mdawkins/wdj54 +abs_top_srcdir = /home/mdawkins/wdj54 +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_CXX = g++ +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = tar --format=ustar -chf - "$$tardir" +am__untar = tar -xf - +autorelocate_dcolor = 0 +autorelocate_path = %{nil} +bindir = ${exec_prefix}/bin +build = x86_64-unknown-linux-gnu +build_alias = +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = unknown +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +exeext = +host = x86_64-unknown-linux-gnu +host_alias = +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = unknown +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /home/mdawkins/wdj54/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +libext = a +localedir = /usr/share/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +objext = o +oldincludedir = /usr/include +pdfdir = ${docdir} +pkgpyexecdir = ${pyexecdir}/${PACKAGE} +pkgpythondir = ${pythondir}/${PACKAGE} +prefix = /usr +program_transform_name = s,x,x, +psdir = ${docdir} +pyexecdir = ${pythondir} +pythondir = /usr/lib64/python2.7/site-packages +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +shlibext = so +srcdir = . +subdirs = +sysconfdir = ${prefix}/etc +target = x86_64-unknown-linux-gnu +target_alias = +target_cpu = x86_64 +target_os = linux +target_vendor = unknown +testdir = /home/mdawkins/wdj54/tests +top_build_prefix = ../ +top_builddir = .. +top_srcdir = .. +usrprefix = /usr +varprefix = /var +EXTRA_DIST = COPYRIGHT HISTORY local/lom.lua local/llocal.lua \ + $(am__append_5) $(am__append_7) $(am__append_10) \ + $(am__append_13) +AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir)/local -I$(builddir)/local \ + $(am__append_1) $(am__append_2) \ + -I$(srcdir) +pkgbindir = /usr/lib/rpm/bin +pkglib_LTLIBRARIES = liblua.la +rpmlua_SOURCES = lua.c +rpmlua_CFLAGS = +rpmlua_LDADD = liblua.la +rpmluac_SOURCES = luac.c print.c +rpmluac_CFLAGS = +rpmluac_LDADD = liblua.la +liblua_la_SOURCES = $(am__append_4) $(am__append_6) $(am__append_9) \ + $(am__append_12) local/llocal.c local/llocal.h local/lposix.h \ + local/lposix.c local/lrexlib.h local/lrexlib_algo.h \ + local/lrexlib_common.h local/lrexlib_common.c \ + local/lrexlib_lpcre.c local/lrexlib_lpcre_f.c \ + local/lrexlib_lposix.c local/lshadow.h local/lshadow.c \ + local/luuid.h local/luuid.c local/lwrs.h local/lwrs.c linit.c \ + lauxlib.h lauxlib.c lua.h luaconf.h lualib.h lbaselib.c \ + ldblib.c liolib.c loslib.c lmathlib.c loadlib.c lstrlib.c \ + ltablib.c lapi.c lapi.h lcode.c lcode.h ldebug.c ldebug.h \ + ldo.c ldo.h ldump.c lfunc.c lfunc.h lgc.c lgc.h llex.c llex.h \ + llimits.h lmem.c lmem.h lobject.c lobject.h lopcodes.c \ + lopcodes.h lparser.c lparser.h lstate.c lstate.h lstring.c \ + lstring.h ltable.c ltable.h ltests.c ltm.c ltm.h lundump.c \ + lundump.h lvm.c lvm.h lzio.c lzio.h +liblua_la_CFLAGS = -DLUA_USE_DLOPEN -DLUA_USE_POSIX -DREX_POSIX_INCLUDE="" -DLUA_USE_PCRE -DLUA_USE_UUID $(am__append_3) \ + $(am__append_8) $(am__append_11) +liblua_la_LIBADD = -lm -lexpat +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lua/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign lua/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || 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)$(pkglibdir)'"; \ + $(MKDIR_P) '$(DESTDIR)$(pkglibdir)' || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ + } + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +install-pkgbinPROGRAMS: $(pkgbin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(pkgbin_PROGRAMS)'; test -n "$(pkgbindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgbindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgbindir)" || 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)$(pkgbindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkgbindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-pkgbinPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(pkgbin_PROGRAMS)'; test -n "$(pkgbindir)" || 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)$(pkgbindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgbindir)" && rm -f $$files + +clean-pkgbinPROGRAMS: + @list='$(pkgbin_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 +rpmlua$(EXEEXT): $(rpmlua_OBJECTS) $(rpmlua_DEPENDENCIES) $(EXTRA_rpmlua_DEPENDENCIES) + @rm -f rpmlua$(EXEEXT) + $(rpmlua_LINK) $(rpmlua_OBJECTS) $(rpmlua_LDADD) $(LIBS) +rpmluac$(EXEEXT): $(rpmluac_OBJECTS) $(rpmluac_DEPENDENCIES) $(EXTRA_rpmluac_DEPENDENCIES) + @rm -f rpmluac$(EXEEXT) + $(rpmluac_LINK) $(rpmluac_OBJECTS) $(rpmluac_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/bin2c.Po +include ./$(DEPDIR)/liblua_la-auxiliar.Plo +include ./$(DEPDIR)/liblua_la-buffer.Plo +include ./$(DEPDIR)/liblua_la-chkconfig.Plo +include ./$(DEPDIR)/liblua_la-commonio.Plo +include ./$(DEPDIR)/liblua_la-copydir.Plo +include ./$(DEPDIR)/liblua_la-except.Plo +include ./$(DEPDIR)/liblua_la-fputsx.Plo +include ./$(DEPDIR)/liblua_la-getdef.Plo +include ./$(DEPDIR)/liblua_la-groupadd.Plo +include ./$(DEPDIR)/liblua_la-groupio.Plo +include ./$(DEPDIR)/liblua_la-gshadow.Plo +include ./$(DEPDIR)/liblua_la-inet.Plo +include ./$(DEPDIR)/liblua_la-io.Plo +include ./$(DEPDIR)/liblua_la-lapi.Plo +include ./$(DEPDIR)/liblua_la-lauxlib.Plo +include ./$(DEPDIR)/liblua_la-lbaselib.Plo +include ./$(DEPDIR)/liblua_la-lcode.Plo +include ./$(DEPDIR)/liblua_la-lcrypto.Plo +include ./$(DEPDIR)/liblua_la-ldblib.Plo +include ./$(DEPDIR)/liblua_la-ldebug.Plo +include ./$(DEPDIR)/liblua_la-ldo.Plo +include ./$(DEPDIR)/liblua_la-ldump.Plo +include ./$(DEPDIR)/liblua_la-leveldb.Plo +include ./$(DEPDIR)/liblua_la-lfunc.Plo +include ./$(DEPDIR)/liblua_la-lgc.Plo +include ./$(DEPDIR)/liblua_la-linit.Plo +include ./$(DEPDIR)/liblua_la-liolib.Plo +include ./$(DEPDIR)/liblua_la-list.Plo +include ./$(DEPDIR)/liblua_la-llex.Plo +include ./$(DEPDIR)/liblua_la-llocal.Plo +include ./$(DEPDIR)/liblua_la-lmathlib.Plo +include ./$(DEPDIR)/liblua_la-lmem.Plo +include ./$(DEPDIR)/liblua_la-loadlib.Plo +include ./$(DEPDIR)/liblua_la-lobject.Plo +include ./$(DEPDIR)/liblua_la-lopcodes.Plo +include ./$(DEPDIR)/liblua_la-loslib.Plo +include ./$(DEPDIR)/liblua_la-lparser.Plo +include ./$(DEPDIR)/liblua_la-lposix.Plo +include ./$(DEPDIR)/liblua_la-lrexlib_common.Plo +include ./$(DEPDIR)/liblua_la-lrexlib_lpcre.Plo +include ./$(DEPDIR)/liblua_la-lrexlib_lpcre_f.Plo +include ./$(DEPDIR)/liblua_la-lrexlib_lposix.Plo +include ./$(DEPDIR)/liblua_la-lshadow.Plo +include ./$(DEPDIR)/liblua_la-lstate.Plo +include ./$(DEPDIR)/liblua_la-lstring.Plo +include ./$(DEPDIR)/liblua_la-lstrlib.Plo +include ./$(DEPDIR)/liblua_la-ltable.Plo +include ./$(DEPDIR)/liblua_la-ltablib.Plo +include ./$(DEPDIR)/liblua_la-ltests.Plo +include ./$(DEPDIR)/liblua_la-ltm.Plo +include ./$(DEPDIR)/liblua_la-luasocket.Plo +include ./$(DEPDIR)/liblua_la-lundump.Plo +include ./$(DEPDIR)/liblua_la-luuid.Plo +include ./$(DEPDIR)/liblua_la-lvm.Plo +include ./$(DEPDIR)/liblua_la-lwrs.Plo +include ./$(DEPDIR)/liblua_la-lxplib.Plo +include ./$(DEPDIR)/liblua_la-lzio.Plo +include ./$(DEPDIR)/liblua_la-mime.Plo +include ./$(DEPDIR)/liblua_la-options.Plo +include ./$(DEPDIR)/liblua_la-pwio.Plo +include ./$(DEPDIR)/liblua_la-select.Plo +include ./$(DEPDIR)/liblua_la-sgetgrent.Plo +include ./$(DEPDIR)/liblua_la-sgetpwent.Plo +include ./$(DEPDIR)/liblua_la-sgroupio.Plo +include ./$(DEPDIR)/liblua_la-shadowio.Plo +include ./$(DEPDIR)/liblua_la-strtoday.Plo +include ./$(DEPDIR)/liblua_la-tcp.Plo +include ./$(DEPDIR)/liblua_la-timeout.Plo +include ./$(DEPDIR)/liblua_la-udp.Plo +include ./$(DEPDIR)/liblua_la-unix.Plo +include ./$(DEPDIR)/liblua_la-useradd.Plo +include ./$(DEPDIR)/liblua_la-usocket.Plo +include ./$(DEPDIR)/liblua_la-wsocket.Plo +include ./$(DEPDIR)/rpmlua-lua.Po +include ./$(DEPDIR)/rpmluac-luac.Po +include ./$(DEPDIR)/rpmluac-print.Po + +.c.o: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c $< + +.c.obj: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: + $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +# source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LTCOMPILE) -c -o $@ $< + +liblua_la-lcrypto.lo: local/lcrypto.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lcrypto.lo -MD -MP -MF $(DEPDIR)/liblua_la-lcrypto.Tpo -c -o liblua_la-lcrypto.lo `test -f 'local/lcrypto.c' || echo '$(srcdir)/'`local/lcrypto.c + $(am__mv) $(DEPDIR)/liblua_la-lcrypto.Tpo $(DEPDIR)/liblua_la-lcrypto.Plo +# source='local/lcrypto.c' object='liblua_la-lcrypto.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lcrypto.lo `test -f 'local/lcrypto.c' || echo '$(srcdir)/'`local/lcrypto.c + +liblua_la-lxplib.lo: local/lxplib.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lxplib.lo -MD -MP -MF $(DEPDIR)/liblua_la-lxplib.Tpo -c -o liblua_la-lxplib.lo `test -f 'local/lxplib.c' || echo '$(srcdir)/'`local/lxplib.c + $(am__mv) $(DEPDIR)/liblua_la-lxplib.Tpo $(DEPDIR)/liblua_la-lxplib.Plo +# source='local/lxplib.c' object='liblua_la-lxplib.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lxplib.lo `test -f 'local/lxplib.c' || echo '$(srcdir)/'`local/lxplib.c + +liblua_la-auxiliar.lo: socket/auxiliar.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-auxiliar.lo -MD -MP -MF $(DEPDIR)/liblua_la-auxiliar.Tpo -c -o liblua_la-auxiliar.lo `test -f 'socket/auxiliar.c' || echo '$(srcdir)/'`socket/auxiliar.c + $(am__mv) $(DEPDIR)/liblua_la-auxiliar.Tpo $(DEPDIR)/liblua_la-auxiliar.Plo +# source='socket/auxiliar.c' object='liblua_la-auxiliar.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-auxiliar.lo `test -f 'socket/auxiliar.c' || echo '$(srcdir)/'`socket/auxiliar.c + +liblua_la-buffer.lo: socket/buffer.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-buffer.lo -MD -MP -MF $(DEPDIR)/liblua_la-buffer.Tpo -c -o liblua_la-buffer.lo `test -f 'socket/buffer.c' || echo '$(srcdir)/'`socket/buffer.c + $(am__mv) $(DEPDIR)/liblua_la-buffer.Tpo $(DEPDIR)/liblua_la-buffer.Plo +# source='socket/buffer.c' object='liblua_la-buffer.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-buffer.lo `test -f 'socket/buffer.c' || echo '$(srcdir)/'`socket/buffer.c + +liblua_la-except.lo: socket/except.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-except.lo -MD -MP -MF $(DEPDIR)/liblua_la-except.Tpo -c -o liblua_la-except.lo `test -f 'socket/except.c' || echo '$(srcdir)/'`socket/except.c + $(am__mv) $(DEPDIR)/liblua_la-except.Tpo $(DEPDIR)/liblua_la-except.Plo +# source='socket/except.c' object='liblua_la-except.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-except.lo `test -f 'socket/except.c' || echo '$(srcdir)/'`socket/except.c + +liblua_la-inet.lo: socket/inet.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-inet.lo -MD -MP -MF $(DEPDIR)/liblua_la-inet.Tpo -c -o liblua_la-inet.lo `test -f 'socket/inet.c' || echo '$(srcdir)/'`socket/inet.c + $(am__mv) $(DEPDIR)/liblua_la-inet.Tpo $(DEPDIR)/liblua_la-inet.Plo +# source='socket/inet.c' object='liblua_la-inet.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-inet.lo `test -f 'socket/inet.c' || echo '$(srcdir)/'`socket/inet.c + +liblua_la-io.lo: socket/io.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-io.lo -MD -MP -MF $(DEPDIR)/liblua_la-io.Tpo -c -o liblua_la-io.lo `test -f 'socket/io.c' || echo '$(srcdir)/'`socket/io.c + $(am__mv) $(DEPDIR)/liblua_la-io.Tpo $(DEPDIR)/liblua_la-io.Plo +# source='socket/io.c' object='liblua_la-io.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-io.lo `test -f 'socket/io.c' || echo '$(srcdir)/'`socket/io.c + +liblua_la-luasocket.lo: socket/luasocket.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-luasocket.lo -MD -MP -MF $(DEPDIR)/liblua_la-luasocket.Tpo -c -o liblua_la-luasocket.lo `test -f 'socket/luasocket.c' || echo '$(srcdir)/'`socket/luasocket.c + $(am__mv) $(DEPDIR)/liblua_la-luasocket.Tpo $(DEPDIR)/liblua_la-luasocket.Plo +# source='socket/luasocket.c' object='liblua_la-luasocket.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-luasocket.lo `test -f 'socket/luasocket.c' || echo '$(srcdir)/'`socket/luasocket.c + +liblua_la-mime.lo: socket/mime.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-mime.lo -MD -MP -MF $(DEPDIR)/liblua_la-mime.Tpo -c -o liblua_la-mime.lo `test -f 'socket/mime.c' || echo '$(srcdir)/'`socket/mime.c + $(am__mv) $(DEPDIR)/liblua_la-mime.Tpo $(DEPDIR)/liblua_la-mime.Plo +# source='socket/mime.c' object='liblua_la-mime.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-mime.lo `test -f 'socket/mime.c' || echo '$(srcdir)/'`socket/mime.c + +liblua_la-options.lo: socket/options.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-options.lo -MD -MP -MF $(DEPDIR)/liblua_la-options.Tpo -c -o liblua_la-options.lo `test -f 'socket/options.c' || echo '$(srcdir)/'`socket/options.c + $(am__mv) $(DEPDIR)/liblua_la-options.Tpo $(DEPDIR)/liblua_la-options.Plo +# source='socket/options.c' object='liblua_la-options.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-options.lo `test -f 'socket/options.c' || echo '$(srcdir)/'`socket/options.c + +liblua_la-select.lo: socket/select.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-select.lo -MD -MP -MF $(DEPDIR)/liblua_la-select.Tpo -c -o liblua_la-select.lo `test -f 'socket/select.c' || echo '$(srcdir)/'`socket/select.c + $(am__mv) $(DEPDIR)/liblua_la-select.Tpo $(DEPDIR)/liblua_la-select.Plo +# source='socket/select.c' object='liblua_la-select.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-select.lo `test -f 'socket/select.c' || echo '$(srcdir)/'`socket/select.c + +liblua_la-tcp.lo: socket/tcp.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-tcp.lo -MD -MP -MF $(DEPDIR)/liblua_la-tcp.Tpo -c -o liblua_la-tcp.lo `test -f 'socket/tcp.c' || echo '$(srcdir)/'`socket/tcp.c + $(am__mv) $(DEPDIR)/liblua_la-tcp.Tpo $(DEPDIR)/liblua_la-tcp.Plo +# source='socket/tcp.c' object='liblua_la-tcp.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-tcp.lo `test -f 'socket/tcp.c' || echo '$(srcdir)/'`socket/tcp.c + +liblua_la-timeout.lo: socket/timeout.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-timeout.lo -MD -MP -MF $(DEPDIR)/liblua_la-timeout.Tpo -c -o liblua_la-timeout.lo `test -f 'socket/timeout.c' || echo '$(srcdir)/'`socket/timeout.c + $(am__mv) $(DEPDIR)/liblua_la-timeout.Tpo $(DEPDIR)/liblua_la-timeout.Plo +# source='socket/timeout.c' object='liblua_la-timeout.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-timeout.lo `test -f 'socket/timeout.c' || echo '$(srcdir)/'`socket/timeout.c + +liblua_la-udp.lo: socket/udp.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-udp.lo -MD -MP -MF $(DEPDIR)/liblua_la-udp.Tpo -c -o liblua_la-udp.lo `test -f 'socket/udp.c' || echo '$(srcdir)/'`socket/udp.c + $(am__mv) $(DEPDIR)/liblua_la-udp.Tpo $(DEPDIR)/liblua_la-udp.Plo +# source='socket/udp.c' object='liblua_la-udp.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-udp.lo `test -f 'socket/udp.c' || echo '$(srcdir)/'`socket/udp.c + +liblua_la-unix.lo: socket/unix.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-unix.lo -MD -MP -MF $(DEPDIR)/liblua_la-unix.Tpo -c -o liblua_la-unix.lo `test -f 'socket/unix.c' || echo '$(srcdir)/'`socket/unix.c + $(am__mv) $(DEPDIR)/liblua_la-unix.Tpo $(DEPDIR)/liblua_la-unix.Plo +# source='socket/unix.c' object='liblua_la-unix.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-unix.lo `test -f 'socket/unix.c' || echo '$(srcdir)/'`socket/unix.c + +liblua_la-usocket.lo: socket/usocket.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-usocket.lo -MD -MP -MF $(DEPDIR)/liblua_la-usocket.Tpo -c -o liblua_la-usocket.lo `test -f 'socket/usocket.c' || echo '$(srcdir)/'`socket/usocket.c + $(am__mv) $(DEPDIR)/liblua_la-usocket.Tpo $(DEPDIR)/liblua_la-usocket.Plo +# source='socket/usocket.c' object='liblua_la-usocket.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-usocket.lo `test -f 'socket/usocket.c' || echo '$(srcdir)/'`socket/usocket.c + +liblua_la-wsocket.lo: socket/wsocket.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-wsocket.lo -MD -MP -MF $(DEPDIR)/liblua_la-wsocket.Tpo -c -o liblua_la-wsocket.lo `test -f 'socket/wsocket.c' || echo '$(srcdir)/'`socket/wsocket.c + $(am__mv) $(DEPDIR)/liblua_la-wsocket.Tpo $(DEPDIR)/liblua_la-wsocket.Plo +# source='socket/wsocket.c' object='liblua_la-wsocket.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-wsocket.lo `test -f 'socket/wsocket.c' || echo '$(srcdir)/'`socket/wsocket.c + +liblua_la-commonio.lo: shadow/commonio.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-commonio.lo -MD -MP -MF $(DEPDIR)/liblua_la-commonio.Tpo -c -o liblua_la-commonio.lo `test -f 'shadow/commonio.c' || echo '$(srcdir)/'`shadow/commonio.c + $(am__mv) $(DEPDIR)/liblua_la-commonio.Tpo $(DEPDIR)/liblua_la-commonio.Plo +# source='shadow/commonio.c' object='liblua_la-commonio.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-commonio.lo `test -f 'shadow/commonio.c' || echo '$(srcdir)/'`shadow/commonio.c + +liblua_la-copydir.lo: shadow/copydir.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-copydir.lo -MD -MP -MF $(DEPDIR)/liblua_la-copydir.Tpo -c -o liblua_la-copydir.lo `test -f 'shadow/copydir.c' || echo '$(srcdir)/'`shadow/copydir.c + $(am__mv) $(DEPDIR)/liblua_la-copydir.Tpo $(DEPDIR)/liblua_la-copydir.Plo +# source='shadow/copydir.c' object='liblua_la-copydir.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-copydir.lo `test -f 'shadow/copydir.c' || echo '$(srcdir)/'`shadow/copydir.c + +liblua_la-fputsx.lo: shadow/fputsx.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-fputsx.lo -MD -MP -MF $(DEPDIR)/liblua_la-fputsx.Tpo -c -o liblua_la-fputsx.lo `test -f 'shadow/fputsx.c' || echo '$(srcdir)/'`shadow/fputsx.c + $(am__mv) $(DEPDIR)/liblua_la-fputsx.Tpo $(DEPDIR)/liblua_la-fputsx.Plo +# source='shadow/fputsx.c' object='liblua_la-fputsx.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-fputsx.lo `test -f 'shadow/fputsx.c' || echo '$(srcdir)/'`shadow/fputsx.c + +liblua_la-getdef.lo: shadow/getdef.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-getdef.lo -MD -MP -MF $(DEPDIR)/liblua_la-getdef.Tpo -c -o liblua_la-getdef.lo `test -f 'shadow/getdef.c' || echo '$(srcdir)/'`shadow/getdef.c + $(am__mv) $(DEPDIR)/liblua_la-getdef.Tpo $(DEPDIR)/liblua_la-getdef.Plo +# source='shadow/getdef.c' object='liblua_la-getdef.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-getdef.lo `test -f 'shadow/getdef.c' || echo '$(srcdir)/'`shadow/getdef.c + +liblua_la-groupadd.lo: shadow/groupadd.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-groupadd.lo -MD -MP -MF $(DEPDIR)/liblua_la-groupadd.Tpo -c -o liblua_la-groupadd.lo `test -f 'shadow/groupadd.c' || echo '$(srcdir)/'`shadow/groupadd.c + $(am__mv) $(DEPDIR)/liblua_la-groupadd.Tpo $(DEPDIR)/liblua_la-groupadd.Plo +# source='shadow/groupadd.c' object='liblua_la-groupadd.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-groupadd.lo `test -f 'shadow/groupadd.c' || echo '$(srcdir)/'`shadow/groupadd.c + +liblua_la-groupio.lo: shadow/groupio.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-groupio.lo -MD -MP -MF $(DEPDIR)/liblua_la-groupio.Tpo -c -o liblua_la-groupio.lo `test -f 'shadow/groupio.c' || echo '$(srcdir)/'`shadow/groupio.c + $(am__mv) $(DEPDIR)/liblua_la-groupio.Tpo $(DEPDIR)/liblua_la-groupio.Plo +# source='shadow/groupio.c' object='liblua_la-groupio.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-groupio.lo `test -f 'shadow/groupio.c' || echo '$(srcdir)/'`shadow/groupio.c + +liblua_la-gshadow.lo: shadow/gshadow.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-gshadow.lo -MD -MP -MF $(DEPDIR)/liblua_la-gshadow.Tpo -c -o liblua_la-gshadow.lo `test -f 'shadow/gshadow.c' || echo '$(srcdir)/'`shadow/gshadow.c + $(am__mv) $(DEPDIR)/liblua_la-gshadow.Tpo $(DEPDIR)/liblua_la-gshadow.Plo +# source='shadow/gshadow.c' object='liblua_la-gshadow.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-gshadow.lo `test -f 'shadow/gshadow.c' || echo '$(srcdir)/'`shadow/gshadow.c + +liblua_la-list.lo: shadow/list.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-list.lo -MD -MP -MF $(DEPDIR)/liblua_la-list.Tpo -c -o liblua_la-list.lo `test -f 'shadow/list.c' || echo '$(srcdir)/'`shadow/list.c + $(am__mv) $(DEPDIR)/liblua_la-list.Tpo $(DEPDIR)/liblua_la-list.Plo +# source='shadow/list.c' object='liblua_la-list.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-list.lo `test -f 'shadow/list.c' || echo '$(srcdir)/'`shadow/list.c + +liblua_la-pwio.lo: shadow/pwio.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-pwio.lo -MD -MP -MF $(DEPDIR)/liblua_la-pwio.Tpo -c -o liblua_la-pwio.lo `test -f 'shadow/pwio.c' || echo '$(srcdir)/'`shadow/pwio.c + $(am__mv) $(DEPDIR)/liblua_la-pwio.Tpo $(DEPDIR)/liblua_la-pwio.Plo +# source='shadow/pwio.c' object='liblua_la-pwio.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-pwio.lo `test -f 'shadow/pwio.c' || echo '$(srcdir)/'`shadow/pwio.c + +liblua_la-sgroupio.lo: shadow/sgroupio.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-sgroupio.lo -MD -MP -MF $(DEPDIR)/liblua_la-sgroupio.Tpo -c -o liblua_la-sgroupio.lo `test -f 'shadow/sgroupio.c' || echo '$(srcdir)/'`shadow/sgroupio.c + $(am__mv) $(DEPDIR)/liblua_la-sgroupio.Tpo $(DEPDIR)/liblua_la-sgroupio.Plo +# source='shadow/sgroupio.c' object='liblua_la-sgroupio.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-sgroupio.lo `test -f 'shadow/sgroupio.c' || echo '$(srcdir)/'`shadow/sgroupio.c + +liblua_la-sgetgrent.lo: shadow/sgetgrent.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-sgetgrent.lo -MD -MP -MF $(DEPDIR)/liblua_la-sgetgrent.Tpo -c -o liblua_la-sgetgrent.lo `test -f 'shadow/sgetgrent.c' || echo '$(srcdir)/'`shadow/sgetgrent.c + $(am__mv) $(DEPDIR)/liblua_la-sgetgrent.Tpo $(DEPDIR)/liblua_la-sgetgrent.Plo +# source='shadow/sgetgrent.c' object='liblua_la-sgetgrent.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-sgetgrent.lo `test -f 'shadow/sgetgrent.c' || echo '$(srcdir)/'`shadow/sgetgrent.c + +liblua_la-sgetpwent.lo: shadow/sgetpwent.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-sgetpwent.lo -MD -MP -MF $(DEPDIR)/liblua_la-sgetpwent.Tpo -c -o liblua_la-sgetpwent.lo `test -f 'shadow/sgetpwent.c' || echo '$(srcdir)/'`shadow/sgetpwent.c + $(am__mv) $(DEPDIR)/liblua_la-sgetpwent.Tpo $(DEPDIR)/liblua_la-sgetpwent.Plo +# source='shadow/sgetpwent.c' object='liblua_la-sgetpwent.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-sgetpwent.lo `test -f 'shadow/sgetpwent.c' || echo '$(srcdir)/'`shadow/sgetpwent.c + +liblua_la-shadowio.lo: shadow/shadowio.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-shadowio.lo -MD -MP -MF $(DEPDIR)/liblua_la-shadowio.Tpo -c -o liblua_la-shadowio.lo `test -f 'shadow/shadowio.c' || echo '$(srcdir)/'`shadow/shadowio.c + $(am__mv) $(DEPDIR)/liblua_la-shadowio.Tpo $(DEPDIR)/liblua_la-shadowio.Plo +# source='shadow/shadowio.c' object='liblua_la-shadowio.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-shadowio.lo `test -f 'shadow/shadowio.c' || echo '$(srcdir)/'`shadow/shadowio.c + +liblua_la-strtoday.lo: shadow/strtoday.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-strtoday.lo -MD -MP -MF $(DEPDIR)/liblua_la-strtoday.Tpo -c -o liblua_la-strtoday.lo `test -f 'shadow/strtoday.c' || echo '$(srcdir)/'`shadow/strtoday.c + $(am__mv) $(DEPDIR)/liblua_la-strtoday.Tpo $(DEPDIR)/liblua_la-strtoday.Plo +# source='shadow/strtoday.c' object='liblua_la-strtoday.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-strtoday.lo `test -f 'shadow/strtoday.c' || echo '$(srcdir)/'`shadow/strtoday.c + +liblua_la-useradd.lo: shadow/useradd.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-useradd.lo -MD -MP -MF $(DEPDIR)/liblua_la-useradd.Tpo -c -o liblua_la-useradd.lo `test -f 'shadow/useradd.c' || echo '$(srcdir)/'`shadow/useradd.c + $(am__mv) $(DEPDIR)/liblua_la-useradd.Tpo $(DEPDIR)/liblua_la-useradd.Plo +# source='shadow/useradd.c' object='liblua_la-useradd.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-useradd.lo `test -f 'shadow/useradd.c' || echo '$(srcdir)/'`shadow/useradd.c + +liblua_la-chkconfig.lo: chkconfig/chkconfig.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-chkconfig.lo -MD -MP -MF $(DEPDIR)/liblua_la-chkconfig.Tpo -c -o liblua_la-chkconfig.lo `test -f 'chkconfig/chkconfig.c' || echo '$(srcdir)/'`chkconfig/chkconfig.c + $(am__mv) $(DEPDIR)/liblua_la-chkconfig.Tpo $(DEPDIR)/liblua_la-chkconfig.Plo +# source='chkconfig/chkconfig.c' object='liblua_la-chkconfig.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-chkconfig.lo `test -f 'chkconfig/chkconfig.c' || echo '$(srcdir)/'`chkconfig/chkconfig.c + +liblua_la-leveldb.lo: chkconfig/leveldb.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-leveldb.lo -MD -MP -MF $(DEPDIR)/liblua_la-leveldb.Tpo -c -o liblua_la-leveldb.lo `test -f 'chkconfig/leveldb.c' || echo '$(srcdir)/'`chkconfig/leveldb.c + $(am__mv) $(DEPDIR)/liblua_la-leveldb.Tpo $(DEPDIR)/liblua_la-leveldb.Plo +# source='chkconfig/leveldb.c' object='liblua_la-leveldb.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-leveldb.lo `test -f 'chkconfig/leveldb.c' || echo '$(srcdir)/'`chkconfig/leveldb.c + +liblua_la-llocal.lo: local/llocal.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-llocal.lo -MD -MP -MF $(DEPDIR)/liblua_la-llocal.Tpo -c -o liblua_la-llocal.lo `test -f 'local/llocal.c' || echo '$(srcdir)/'`local/llocal.c + $(am__mv) $(DEPDIR)/liblua_la-llocal.Tpo $(DEPDIR)/liblua_la-llocal.Plo +# source='local/llocal.c' object='liblua_la-llocal.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-llocal.lo `test -f 'local/llocal.c' || echo '$(srcdir)/'`local/llocal.c + +liblua_la-lposix.lo: local/lposix.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lposix.lo -MD -MP -MF $(DEPDIR)/liblua_la-lposix.Tpo -c -o liblua_la-lposix.lo `test -f 'local/lposix.c' || echo '$(srcdir)/'`local/lposix.c + $(am__mv) $(DEPDIR)/liblua_la-lposix.Tpo $(DEPDIR)/liblua_la-lposix.Plo +# source='local/lposix.c' object='liblua_la-lposix.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lposix.lo `test -f 'local/lposix.c' || echo '$(srcdir)/'`local/lposix.c + +liblua_la-lrexlib_common.lo: local/lrexlib_common.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lrexlib_common.lo -MD -MP -MF $(DEPDIR)/liblua_la-lrexlib_common.Tpo -c -o liblua_la-lrexlib_common.lo `test -f 'local/lrexlib_common.c' || echo '$(srcdir)/'`local/lrexlib_common.c + $(am__mv) $(DEPDIR)/liblua_la-lrexlib_common.Tpo $(DEPDIR)/liblua_la-lrexlib_common.Plo +# source='local/lrexlib_common.c' object='liblua_la-lrexlib_common.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lrexlib_common.lo `test -f 'local/lrexlib_common.c' || echo '$(srcdir)/'`local/lrexlib_common.c + +liblua_la-lrexlib_lpcre.lo: local/lrexlib_lpcre.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lrexlib_lpcre.lo -MD -MP -MF $(DEPDIR)/liblua_la-lrexlib_lpcre.Tpo -c -o liblua_la-lrexlib_lpcre.lo `test -f 'local/lrexlib_lpcre.c' || echo '$(srcdir)/'`local/lrexlib_lpcre.c + $(am__mv) $(DEPDIR)/liblua_la-lrexlib_lpcre.Tpo $(DEPDIR)/liblua_la-lrexlib_lpcre.Plo +# source='local/lrexlib_lpcre.c' object='liblua_la-lrexlib_lpcre.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lrexlib_lpcre.lo `test -f 'local/lrexlib_lpcre.c' || echo '$(srcdir)/'`local/lrexlib_lpcre.c + +liblua_la-lrexlib_lpcre_f.lo: local/lrexlib_lpcre_f.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lrexlib_lpcre_f.lo -MD -MP -MF $(DEPDIR)/liblua_la-lrexlib_lpcre_f.Tpo -c -o liblua_la-lrexlib_lpcre_f.lo `test -f 'local/lrexlib_lpcre_f.c' || echo '$(srcdir)/'`local/lrexlib_lpcre_f.c + $(am__mv) $(DEPDIR)/liblua_la-lrexlib_lpcre_f.Tpo $(DEPDIR)/liblua_la-lrexlib_lpcre_f.Plo +# source='local/lrexlib_lpcre_f.c' object='liblua_la-lrexlib_lpcre_f.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lrexlib_lpcre_f.lo `test -f 'local/lrexlib_lpcre_f.c' || echo '$(srcdir)/'`local/lrexlib_lpcre_f.c + +liblua_la-lrexlib_lposix.lo: local/lrexlib_lposix.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lrexlib_lposix.lo -MD -MP -MF $(DEPDIR)/liblua_la-lrexlib_lposix.Tpo -c -o liblua_la-lrexlib_lposix.lo `test -f 'local/lrexlib_lposix.c' || echo '$(srcdir)/'`local/lrexlib_lposix.c + $(am__mv) $(DEPDIR)/liblua_la-lrexlib_lposix.Tpo $(DEPDIR)/liblua_la-lrexlib_lposix.Plo +# source='local/lrexlib_lposix.c' object='liblua_la-lrexlib_lposix.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lrexlib_lposix.lo `test -f 'local/lrexlib_lposix.c' || echo '$(srcdir)/'`local/lrexlib_lposix.c + +liblua_la-lshadow.lo: local/lshadow.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lshadow.lo -MD -MP -MF $(DEPDIR)/liblua_la-lshadow.Tpo -c -o liblua_la-lshadow.lo `test -f 'local/lshadow.c' || echo '$(srcdir)/'`local/lshadow.c + $(am__mv) $(DEPDIR)/liblua_la-lshadow.Tpo $(DEPDIR)/liblua_la-lshadow.Plo +# source='local/lshadow.c' object='liblua_la-lshadow.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lshadow.lo `test -f 'local/lshadow.c' || echo '$(srcdir)/'`local/lshadow.c + +liblua_la-luuid.lo: local/luuid.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-luuid.lo -MD -MP -MF $(DEPDIR)/liblua_la-luuid.Tpo -c -o liblua_la-luuid.lo `test -f 'local/luuid.c' || echo '$(srcdir)/'`local/luuid.c + $(am__mv) $(DEPDIR)/liblua_la-luuid.Tpo $(DEPDIR)/liblua_la-luuid.Plo +# source='local/luuid.c' object='liblua_la-luuid.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-luuid.lo `test -f 'local/luuid.c' || echo '$(srcdir)/'`local/luuid.c + +liblua_la-lwrs.lo: local/lwrs.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lwrs.lo -MD -MP -MF $(DEPDIR)/liblua_la-lwrs.Tpo -c -o liblua_la-lwrs.lo `test -f 'local/lwrs.c' || echo '$(srcdir)/'`local/lwrs.c + $(am__mv) $(DEPDIR)/liblua_la-lwrs.Tpo $(DEPDIR)/liblua_la-lwrs.Plo +# source='local/lwrs.c' object='liblua_la-lwrs.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lwrs.lo `test -f 'local/lwrs.c' || echo '$(srcdir)/'`local/lwrs.c + +liblua_la-linit.lo: linit.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-linit.lo -MD -MP -MF $(DEPDIR)/liblua_la-linit.Tpo -c -o liblua_la-linit.lo `test -f 'linit.c' || echo '$(srcdir)/'`linit.c + $(am__mv) $(DEPDIR)/liblua_la-linit.Tpo $(DEPDIR)/liblua_la-linit.Plo +# source='linit.c' object='liblua_la-linit.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-linit.lo `test -f 'linit.c' || echo '$(srcdir)/'`linit.c + +liblua_la-lauxlib.lo: lauxlib.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lauxlib.lo -MD -MP -MF $(DEPDIR)/liblua_la-lauxlib.Tpo -c -o liblua_la-lauxlib.lo `test -f 'lauxlib.c' || echo '$(srcdir)/'`lauxlib.c + $(am__mv) $(DEPDIR)/liblua_la-lauxlib.Tpo $(DEPDIR)/liblua_la-lauxlib.Plo +# source='lauxlib.c' object='liblua_la-lauxlib.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lauxlib.lo `test -f 'lauxlib.c' || echo '$(srcdir)/'`lauxlib.c + +liblua_la-lbaselib.lo: lbaselib.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lbaselib.lo -MD -MP -MF $(DEPDIR)/liblua_la-lbaselib.Tpo -c -o liblua_la-lbaselib.lo `test -f 'lbaselib.c' || echo '$(srcdir)/'`lbaselib.c + $(am__mv) $(DEPDIR)/liblua_la-lbaselib.Tpo $(DEPDIR)/liblua_la-lbaselib.Plo +# source='lbaselib.c' object='liblua_la-lbaselib.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lbaselib.lo `test -f 'lbaselib.c' || echo '$(srcdir)/'`lbaselib.c + +liblua_la-ldblib.lo: ldblib.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-ldblib.lo -MD -MP -MF $(DEPDIR)/liblua_la-ldblib.Tpo -c -o liblua_la-ldblib.lo `test -f 'ldblib.c' || echo '$(srcdir)/'`ldblib.c + $(am__mv) $(DEPDIR)/liblua_la-ldblib.Tpo $(DEPDIR)/liblua_la-ldblib.Plo +# source='ldblib.c' object='liblua_la-ldblib.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-ldblib.lo `test -f 'ldblib.c' || echo '$(srcdir)/'`ldblib.c + +liblua_la-liolib.lo: liolib.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-liolib.lo -MD -MP -MF $(DEPDIR)/liblua_la-liolib.Tpo -c -o liblua_la-liolib.lo `test -f 'liolib.c' || echo '$(srcdir)/'`liolib.c + $(am__mv) $(DEPDIR)/liblua_la-liolib.Tpo $(DEPDIR)/liblua_la-liolib.Plo +# source='liolib.c' object='liblua_la-liolib.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-liolib.lo `test -f 'liolib.c' || echo '$(srcdir)/'`liolib.c + +liblua_la-loslib.lo: loslib.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-loslib.lo -MD -MP -MF $(DEPDIR)/liblua_la-loslib.Tpo -c -o liblua_la-loslib.lo `test -f 'loslib.c' || echo '$(srcdir)/'`loslib.c + $(am__mv) $(DEPDIR)/liblua_la-loslib.Tpo $(DEPDIR)/liblua_la-loslib.Plo +# source='loslib.c' object='liblua_la-loslib.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-loslib.lo `test -f 'loslib.c' || echo '$(srcdir)/'`loslib.c + +liblua_la-lmathlib.lo: lmathlib.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lmathlib.lo -MD -MP -MF $(DEPDIR)/liblua_la-lmathlib.Tpo -c -o liblua_la-lmathlib.lo `test -f 'lmathlib.c' || echo '$(srcdir)/'`lmathlib.c + $(am__mv) $(DEPDIR)/liblua_la-lmathlib.Tpo $(DEPDIR)/liblua_la-lmathlib.Plo +# source='lmathlib.c' object='liblua_la-lmathlib.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lmathlib.lo `test -f 'lmathlib.c' || echo '$(srcdir)/'`lmathlib.c + +liblua_la-loadlib.lo: loadlib.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-loadlib.lo -MD -MP -MF $(DEPDIR)/liblua_la-loadlib.Tpo -c -o liblua_la-loadlib.lo `test -f 'loadlib.c' || echo '$(srcdir)/'`loadlib.c + $(am__mv) $(DEPDIR)/liblua_la-loadlib.Tpo $(DEPDIR)/liblua_la-loadlib.Plo +# source='loadlib.c' object='liblua_la-loadlib.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-loadlib.lo `test -f 'loadlib.c' || echo '$(srcdir)/'`loadlib.c + +liblua_la-lstrlib.lo: lstrlib.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lstrlib.lo -MD -MP -MF $(DEPDIR)/liblua_la-lstrlib.Tpo -c -o liblua_la-lstrlib.lo `test -f 'lstrlib.c' || echo '$(srcdir)/'`lstrlib.c + $(am__mv) $(DEPDIR)/liblua_la-lstrlib.Tpo $(DEPDIR)/liblua_la-lstrlib.Plo +# source='lstrlib.c' object='liblua_la-lstrlib.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lstrlib.lo `test -f 'lstrlib.c' || echo '$(srcdir)/'`lstrlib.c + +liblua_la-ltablib.lo: ltablib.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-ltablib.lo -MD -MP -MF $(DEPDIR)/liblua_la-ltablib.Tpo -c -o liblua_la-ltablib.lo `test -f 'ltablib.c' || echo '$(srcdir)/'`ltablib.c + $(am__mv) $(DEPDIR)/liblua_la-ltablib.Tpo $(DEPDIR)/liblua_la-ltablib.Plo +# source='ltablib.c' object='liblua_la-ltablib.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-ltablib.lo `test -f 'ltablib.c' || echo '$(srcdir)/'`ltablib.c + +liblua_la-lapi.lo: lapi.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lapi.lo -MD -MP -MF $(DEPDIR)/liblua_la-lapi.Tpo -c -o liblua_la-lapi.lo `test -f 'lapi.c' || echo '$(srcdir)/'`lapi.c + $(am__mv) $(DEPDIR)/liblua_la-lapi.Tpo $(DEPDIR)/liblua_la-lapi.Plo +# source='lapi.c' object='liblua_la-lapi.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lapi.lo `test -f 'lapi.c' || echo '$(srcdir)/'`lapi.c + +liblua_la-lcode.lo: lcode.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lcode.lo -MD -MP -MF $(DEPDIR)/liblua_la-lcode.Tpo -c -o liblua_la-lcode.lo `test -f 'lcode.c' || echo '$(srcdir)/'`lcode.c + $(am__mv) $(DEPDIR)/liblua_la-lcode.Tpo $(DEPDIR)/liblua_la-lcode.Plo +# source='lcode.c' object='liblua_la-lcode.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lcode.lo `test -f 'lcode.c' || echo '$(srcdir)/'`lcode.c + +liblua_la-ldebug.lo: ldebug.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-ldebug.lo -MD -MP -MF $(DEPDIR)/liblua_la-ldebug.Tpo -c -o liblua_la-ldebug.lo `test -f 'ldebug.c' || echo '$(srcdir)/'`ldebug.c + $(am__mv) $(DEPDIR)/liblua_la-ldebug.Tpo $(DEPDIR)/liblua_la-ldebug.Plo +# source='ldebug.c' object='liblua_la-ldebug.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-ldebug.lo `test -f 'ldebug.c' || echo '$(srcdir)/'`ldebug.c + +liblua_la-ldo.lo: ldo.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-ldo.lo -MD -MP -MF $(DEPDIR)/liblua_la-ldo.Tpo -c -o liblua_la-ldo.lo `test -f 'ldo.c' || echo '$(srcdir)/'`ldo.c + $(am__mv) $(DEPDIR)/liblua_la-ldo.Tpo $(DEPDIR)/liblua_la-ldo.Plo +# source='ldo.c' object='liblua_la-ldo.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-ldo.lo `test -f 'ldo.c' || echo '$(srcdir)/'`ldo.c + +liblua_la-ldump.lo: ldump.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-ldump.lo -MD -MP -MF $(DEPDIR)/liblua_la-ldump.Tpo -c -o liblua_la-ldump.lo `test -f 'ldump.c' || echo '$(srcdir)/'`ldump.c + $(am__mv) $(DEPDIR)/liblua_la-ldump.Tpo $(DEPDIR)/liblua_la-ldump.Plo +# source='ldump.c' object='liblua_la-ldump.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-ldump.lo `test -f 'ldump.c' || echo '$(srcdir)/'`ldump.c + +liblua_la-lfunc.lo: lfunc.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lfunc.lo -MD -MP -MF $(DEPDIR)/liblua_la-lfunc.Tpo -c -o liblua_la-lfunc.lo `test -f 'lfunc.c' || echo '$(srcdir)/'`lfunc.c + $(am__mv) $(DEPDIR)/liblua_la-lfunc.Tpo $(DEPDIR)/liblua_la-lfunc.Plo +# source='lfunc.c' object='liblua_la-lfunc.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lfunc.lo `test -f 'lfunc.c' || echo '$(srcdir)/'`lfunc.c + +liblua_la-lgc.lo: lgc.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lgc.lo -MD -MP -MF $(DEPDIR)/liblua_la-lgc.Tpo -c -o liblua_la-lgc.lo `test -f 'lgc.c' || echo '$(srcdir)/'`lgc.c + $(am__mv) $(DEPDIR)/liblua_la-lgc.Tpo $(DEPDIR)/liblua_la-lgc.Plo +# source='lgc.c' object='liblua_la-lgc.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lgc.lo `test -f 'lgc.c' || echo '$(srcdir)/'`lgc.c + +liblua_la-llex.lo: llex.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-llex.lo -MD -MP -MF $(DEPDIR)/liblua_la-llex.Tpo -c -o liblua_la-llex.lo `test -f 'llex.c' || echo '$(srcdir)/'`llex.c + $(am__mv) $(DEPDIR)/liblua_la-llex.Tpo $(DEPDIR)/liblua_la-llex.Plo +# source='llex.c' object='liblua_la-llex.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-llex.lo `test -f 'llex.c' || echo '$(srcdir)/'`llex.c + +liblua_la-lmem.lo: lmem.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lmem.lo -MD -MP -MF $(DEPDIR)/liblua_la-lmem.Tpo -c -o liblua_la-lmem.lo `test -f 'lmem.c' || echo '$(srcdir)/'`lmem.c + $(am__mv) $(DEPDIR)/liblua_la-lmem.Tpo $(DEPDIR)/liblua_la-lmem.Plo +# source='lmem.c' object='liblua_la-lmem.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lmem.lo `test -f 'lmem.c' || echo '$(srcdir)/'`lmem.c + +liblua_la-lobject.lo: lobject.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lobject.lo -MD -MP -MF $(DEPDIR)/liblua_la-lobject.Tpo -c -o liblua_la-lobject.lo `test -f 'lobject.c' || echo '$(srcdir)/'`lobject.c + $(am__mv) $(DEPDIR)/liblua_la-lobject.Tpo $(DEPDIR)/liblua_la-lobject.Plo +# source='lobject.c' object='liblua_la-lobject.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lobject.lo `test -f 'lobject.c' || echo '$(srcdir)/'`lobject.c + +liblua_la-lopcodes.lo: lopcodes.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lopcodes.lo -MD -MP -MF $(DEPDIR)/liblua_la-lopcodes.Tpo -c -o liblua_la-lopcodes.lo `test -f 'lopcodes.c' || echo '$(srcdir)/'`lopcodes.c + $(am__mv) $(DEPDIR)/liblua_la-lopcodes.Tpo $(DEPDIR)/liblua_la-lopcodes.Plo +# source='lopcodes.c' object='liblua_la-lopcodes.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lopcodes.lo `test -f 'lopcodes.c' || echo '$(srcdir)/'`lopcodes.c + +liblua_la-lparser.lo: lparser.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lparser.lo -MD -MP -MF $(DEPDIR)/liblua_la-lparser.Tpo -c -o liblua_la-lparser.lo `test -f 'lparser.c' || echo '$(srcdir)/'`lparser.c + $(am__mv) $(DEPDIR)/liblua_la-lparser.Tpo $(DEPDIR)/liblua_la-lparser.Plo +# source='lparser.c' object='liblua_la-lparser.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lparser.lo `test -f 'lparser.c' || echo '$(srcdir)/'`lparser.c + +liblua_la-lstate.lo: lstate.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lstate.lo -MD -MP -MF $(DEPDIR)/liblua_la-lstate.Tpo -c -o liblua_la-lstate.lo `test -f 'lstate.c' || echo '$(srcdir)/'`lstate.c + $(am__mv) $(DEPDIR)/liblua_la-lstate.Tpo $(DEPDIR)/liblua_la-lstate.Plo +# source='lstate.c' object='liblua_la-lstate.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lstate.lo `test -f 'lstate.c' || echo '$(srcdir)/'`lstate.c + +liblua_la-lstring.lo: lstring.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lstring.lo -MD -MP -MF $(DEPDIR)/liblua_la-lstring.Tpo -c -o liblua_la-lstring.lo `test -f 'lstring.c' || echo '$(srcdir)/'`lstring.c + $(am__mv) $(DEPDIR)/liblua_la-lstring.Tpo $(DEPDIR)/liblua_la-lstring.Plo +# source='lstring.c' object='liblua_la-lstring.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lstring.lo `test -f 'lstring.c' || echo '$(srcdir)/'`lstring.c + +liblua_la-ltable.lo: ltable.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-ltable.lo -MD -MP -MF $(DEPDIR)/liblua_la-ltable.Tpo -c -o liblua_la-ltable.lo `test -f 'ltable.c' || echo '$(srcdir)/'`ltable.c + $(am__mv) $(DEPDIR)/liblua_la-ltable.Tpo $(DEPDIR)/liblua_la-ltable.Plo +# source='ltable.c' object='liblua_la-ltable.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-ltable.lo `test -f 'ltable.c' || echo '$(srcdir)/'`ltable.c + +liblua_la-ltests.lo: ltests.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-ltests.lo -MD -MP -MF $(DEPDIR)/liblua_la-ltests.Tpo -c -o liblua_la-ltests.lo `test -f 'ltests.c' || echo '$(srcdir)/'`ltests.c + $(am__mv) $(DEPDIR)/liblua_la-ltests.Tpo $(DEPDIR)/liblua_la-ltests.Plo +# source='ltests.c' object='liblua_la-ltests.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-ltests.lo `test -f 'ltests.c' || echo '$(srcdir)/'`ltests.c + +liblua_la-ltm.lo: ltm.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-ltm.lo -MD -MP -MF $(DEPDIR)/liblua_la-ltm.Tpo -c -o liblua_la-ltm.lo `test -f 'ltm.c' || echo '$(srcdir)/'`ltm.c + $(am__mv) $(DEPDIR)/liblua_la-ltm.Tpo $(DEPDIR)/liblua_la-ltm.Plo +# source='ltm.c' object='liblua_la-ltm.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-ltm.lo `test -f 'ltm.c' || echo '$(srcdir)/'`ltm.c + +liblua_la-lundump.lo: lundump.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lundump.lo -MD -MP -MF $(DEPDIR)/liblua_la-lundump.Tpo -c -o liblua_la-lundump.lo `test -f 'lundump.c' || echo '$(srcdir)/'`lundump.c + $(am__mv) $(DEPDIR)/liblua_la-lundump.Tpo $(DEPDIR)/liblua_la-lundump.Plo +# source='lundump.c' object='liblua_la-lundump.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lundump.lo `test -f 'lundump.c' || echo '$(srcdir)/'`lundump.c + +liblua_la-lvm.lo: lvm.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lvm.lo -MD -MP -MF $(DEPDIR)/liblua_la-lvm.Tpo -c -o liblua_la-lvm.lo `test -f 'lvm.c' || echo '$(srcdir)/'`lvm.c + $(am__mv) $(DEPDIR)/liblua_la-lvm.Tpo $(DEPDIR)/liblua_la-lvm.Plo +# source='lvm.c' object='liblua_la-lvm.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lvm.lo `test -f 'lvm.c' || echo '$(srcdir)/'`lvm.c + +liblua_la-lzio.lo: lzio.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lzio.lo -MD -MP -MF $(DEPDIR)/liblua_la-lzio.Tpo -c -o liblua_la-lzio.lo `test -f 'lzio.c' || echo '$(srcdir)/'`lzio.c + $(am__mv) $(DEPDIR)/liblua_la-lzio.Tpo $(DEPDIR)/liblua_la-lzio.Plo +# source='lzio.c' object='liblua_la-lzio.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lzio.lo `test -f 'lzio.c' || echo '$(srcdir)/'`lzio.c + +rpmlua-lua.o: lua.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmlua_CFLAGS) $(CFLAGS) -MT rpmlua-lua.o -MD -MP -MF $(DEPDIR)/rpmlua-lua.Tpo -c -o rpmlua-lua.o `test -f 'lua.c' || echo '$(srcdir)/'`lua.c + $(am__mv) $(DEPDIR)/rpmlua-lua.Tpo $(DEPDIR)/rpmlua-lua.Po +# source='lua.c' object='rpmlua-lua.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmlua_CFLAGS) $(CFLAGS) -c -o rpmlua-lua.o `test -f 'lua.c' || echo '$(srcdir)/'`lua.c + +rpmlua-lua.obj: lua.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmlua_CFLAGS) $(CFLAGS) -MT rpmlua-lua.obj -MD -MP -MF $(DEPDIR)/rpmlua-lua.Tpo -c -o rpmlua-lua.obj `if test -f 'lua.c'; then $(CYGPATH_W) 'lua.c'; else $(CYGPATH_W) '$(srcdir)/lua.c'; fi` + $(am__mv) $(DEPDIR)/rpmlua-lua.Tpo $(DEPDIR)/rpmlua-lua.Po +# source='lua.c' object='rpmlua-lua.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmlua_CFLAGS) $(CFLAGS) -c -o rpmlua-lua.obj `if test -f 'lua.c'; then $(CYGPATH_W) 'lua.c'; else $(CYGPATH_W) '$(srcdir)/lua.c'; fi` + +rpmluac-luac.o: luac.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmluac_CFLAGS) $(CFLAGS) -MT rpmluac-luac.o -MD -MP -MF $(DEPDIR)/rpmluac-luac.Tpo -c -o rpmluac-luac.o `test -f 'luac.c' || echo '$(srcdir)/'`luac.c + $(am__mv) $(DEPDIR)/rpmluac-luac.Tpo $(DEPDIR)/rpmluac-luac.Po +# source='luac.c' object='rpmluac-luac.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmluac_CFLAGS) $(CFLAGS) -c -o rpmluac-luac.o `test -f 'luac.c' || echo '$(srcdir)/'`luac.c + +rpmluac-luac.obj: luac.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmluac_CFLAGS) $(CFLAGS) -MT rpmluac-luac.obj -MD -MP -MF $(DEPDIR)/rpmluac-luac.Tpo -c -o rpmluac-luac.obj `if test -f 'luac.c'; then $(CYGPATH_W) 'luac.c'; else $(CYGPATH_W) '$(srcdir)/luac.c'; fi` + $(am__mv) $(DEPDIR)/rpmluac-luac.Tpo $(DEPDIR)/rpmluac-luac.Po +# source='luac.c' object='rpmluac-luac.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmluac_CFLAGS) $(CFLAGS) -c -o rpmluac-luac.obj `if test -f 'luac.c'; then $(CYGPATH_W) 'luac.c'; else $(CYGPATH_W) '$(srcdir)/luac.c'; fi` + +rpmluac-print.o: print.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmluac_CFLAGS) $(CFLAGS) -MT rpmluac-print.o -MD -MP -MF $(DEPDIR)/rpmluac-print.Tpo -c -o rpmluac-print.o `test -f 'print.c' || echo '$(srcdir)/'`print.c + $(am__mv) $(DEPDIR)/rpmluac-print.Tpo $(DEPDIR)/rpmluac-print.Po +# source='print.c' object='rpmluac-print.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmluac_CFLAGS) $(CFLAGS) -c -o rpmluac-print.o `test -f 'print.c' || echo '$(srcdir)/'`print.c + +rpmluac-print.obj: print.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmluac_CFLAGS) $(CFLAGS) -MT rpmluac-print.obj -MD -MP -MF $(DEPDIR)/rpmluac-print.Tpo -c -o rpmluac-print.obj `if test -f 'print.c'; then $(CYGPATH_W) 'print.c'; else $(CYGPATH_W) '$(srcdir)/print.c'; fi` + $(am__mv) $(DEPDIR)/rpmluac-print.Tpo $(DEPDIR)/rpmluac-print.Po +# source='print.c' object='rpmluac-print.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmluac_CFLAGS) $(CFLAGS) -c -o rpmluac-print.obj `if test -f 'print.c'; then $(CYGPATH_W) 'print.c'; else $(CYGPATH_W) '$(srcdir)/print.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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 +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(pkgbindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-local clean-noinstPROGRAMS \ + clean-pkgbinPROGRAMS clean-pkglibLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-pkgbinPROGRAMS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-pkglibLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkgbinPROGRAMS uninstall-pkglibLTLIBRARIES + +.MAKE: install-am install-exec-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-local clean-noinstPROGRAMS \ + clean-pkgbinPROGRAMS clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-exec-hook \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-pkgbinPROGRAMS \ + install-pkglibLTLIBRARIES install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-pkgbinPROGRAMS uninstall-pkglibLTLIBRARIES + + +# --- bin2c doesn't need anything but a compiler +bin2c$(EXEEXT): bin2c.c + $(CC) -o $@ $< +liblua.la: $(liblua_la_OBJECTS) $(liblua_la_DEPENDENCIES) + $(liblua_la_LINK) $(liblua_la_OBJECTS) $(liblua_la_LIBADD) + -ln -sf ../liblua.la .libs/liblua.lai #XXX HACK ALERT + +$(builddir)/local/llocal.c: $(builddir)/local/llocal_lua.c + +#$(builddir)/local/llocal_lua.c: $(builddir)/bin2c $(srcdir)/local/llocal.lua $(srcdir)/local/lom.lua +# mkdir -p $(builddir)/local +# $(builddir)/bin2c $(srcdir)/local/llocal.lua $(srcdir)/local/lom.lua > $(builddir)/local/llocal_lua.c +$(builddir)/local/llocal_lua.c: $(builddir)/bin2c $(srcdir)/local/llocal.lua + mkdir -p $(builddir)/local + $(builddir)/bin2c $(srcdir)/local/llocal.lua > $(builddir)/local/llocal_lua.c + +clean-local: + -rm -f $(builddir)/local/llocal_lua.c + +# XXX Build & install as rpmlua/rpmluac with hardlinks to lua/luac post install. +# XXX CVS has lua/luac sub-directories in the Attic that collide with the +# XXX lua/luac executable names when using cvs update. +install-exec-hook: install-pkgbinPROGRAMS + mkdir -p $(DESTDIR)$(pkgbindir) + $(__RM) -f $(DESTDIR)$(pkgbindir)/lua + $(__LN) $(DESTDIR)$(pkgbindir)/rpmlua $(DESTDIR)$(pkgbindir)/lua + $(__RM) -f $(DESTDIR)$(pkgbindir)/luac + $(__LN) $(DESTDIR)$(pkgbindir)/rpmluac $(DESTDIR)$(pkgbindir)/luac + +# 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/rpm-5.4.9/lua/Makefile.am b/rpm-5.4.9/lua/Makefile.am new file mode 100644 index 0000000..3b6ecf9 --- /dev/null +++ b/rpm-5.4.9/lua/Makefile.am @@ -0,0 +1,328 @@ + +EXTRA_DIST = \ + COPYRIGHT \ + HISTORY \ + local/lom.lua \ + local/llocal.lua + +AM_CPPFLAGS = \ + -I$(top_srcdir) \ + -I$(srcdir)/local \ + -I$(builddir)/local \ + @WITH_PCRE_CPPFLAGS@ +if USE_LUA_CHKCONFIG +AM_CPPFLAGS += \ + -I$(srcdir)/chkconfig \ + -I$(builddir)/chkconfig \ + $(WITH_POPT_CPPFLAGS) +endif +if USE_LUA_SHADOW +AM_CPPFLAGS += \ + -I$(srcdir)/shadow \ + -I$(builddir)/shadow +endif +AM_CPPFLAGS += \ + -I$(srcdir) + +pkgbindir = @USRLIBRPM@/bin +pkgbin_PROGRAMS = rpmlua rpmluac +noinst_PROGRAMS = bin2c + +pkglibdir = @USRLIBRPM@/lib +pkglib_LTLIBRARIES = liblua.la + +rpmlua_SOURCES = lua.c +rpmlua_CFLAGS = +rpmlua_LDADD = liblua.la +rpmluac_SOURCES = luac.c print.c +rpmluac_CFLAGS = +rpmluac_LDADD = liblua.la + +# --- bin2c doesn't need anything but a compiler +bin2c$(EXEEXT): bin2c.c + $(CC) -o $@ $< + +liblua_la_SOURCES = +liblua_la_CFLAGS = @WITH_LUA_SUBDIR_DEF@ + +if USE_LUA_CRYPTO +liblua_la_CFLAGS += \ + -DCRYPTO_OPENSSL +liblua_la_SOURCES += \ + local/lcrypto.c \ + local/lcrypto.h \ + local/lxplib.c \ + local/lxplib.h +else +EXTRA_DIST += \ + local/lcrypto.c \ + local/lcrypto.h \ + local/lxplib.c \ + local/lxplib.h +endif + +if USE_LUA_SOCKET +liblua_la_SOURCES += \ + socket/auxiliar.c \ + socket/auxiliar.h \ + socket/buffer.c \ + socket/buffer.h \ + socket/except.c \ + socket/except.h \ + socket/ftp.lua \ + socket/http.lua \ + socket/inet.c \ + socket/inet.h \ + socket/io.c \ + socket/io.h \ + socket/ltn12.lua \ + socket/luasocket.c \ + socket/luasocket.h \ + socket/mime.c \ + socket/mime.h \ + socket/mime.lua \ + socket/options.c \ + socket/options.h \ + socket/select.c \ + socket/select.h \ + socket/smtp.lua \ + socket/socket.h \ + socket/socket.lua \ + socket/tcp.c \ + socket/tcp.h \ + socket/timeout.c \ + socket/timeout.h \ + socket/tp.lua \ + socket/udp.c \ + socket/udp.h \ + socket/unix.c \ + socket/unix.h \ + socket/url.lua \ + socket/usocket.c \ + socket/usocket.h \ + socket/wsocket.c \ + socket/wsocket.h +else +EXTRA_DIST += \ + socket/auxiliar.c \ + socket/auxiliar.h \ + socket/buffer.c \ + socket/buffer.h \ + socket/except.c \ + socket/except.h \ + socket/ftp.lua \ + socket/http.lua \ + socket/inet.c \ + socket/inet.h \ + socket/io.c \ + socket/io.h \ + socket/ltn12.lua \ + socket/luasocket.c \ + socket/luasocket.h \ + socket/mime.c \ + socket/mime.h \ + socket/mime.lua \ + socket/options.c \ + socket/options.h \ + socket/select.c \ + socket/select.h \ + socket/smtp.lua \ + socket/socket.h \ + socket/socket.lua \ + socket/tcp.c \ + socket/tcp.h \ + socket/timeout.c \ + socket/timeout.h \ + socket/tp.lua \ + socket/udp.c \ + socket/udp.h \ + socket/unix.c \ + socket/unix.h \ + socket/url.lua \ + socket/usocket.c \ + socket/usocket.h \ + socket/wsocket.c \ + socket/wsocket.h +endif + +if USE_LUA_SHADOW +liblua_la_CFLAGS += \ + -DUSE_LUA_SHADOW +liblua_la_SOURCES += \ + shadow/chkname.h \ + shadow/commonio.h \ + shadow/commonio.c \ + shadow/shadow_config.h \ + shadow/copydir.c \ + shadow/defines.h \ + shadow/faillog.h \ + shadow/fputsx.c \ + shadow/getdef.h \ + shadow/getdef.c \ + shadow/groupadd.c \ + shadow/groupio.h \ + shadow/groupio.c \ + shadow/gshadow_.h \ + shadow/gshadow.c \ + shadow/list.c \ + shadow/nscd.h \ + shadow/prototypes.h \ + shadow/pwauth.h \ + shadow/pwio.h \ + shadow/pwio.c \ + shadow/sgroupio.h \ + shadow/sgroupio.c \ + shadow/sgetgrent.c \ + shadow/sgetpwent.c \ + shadow/shadowio.h \ + shadow/shadowio.c \ + shadow/strtoday.c \ + shadow/useradd.c +else +EXTRA_DIST += \ + shadow/chkname.h \ + shadow/commonio.c \ + shadow/commonio.h \ + shadow/copydir.c \ + shadow/defines.h \ + shadow/faillog.h \ + shadow/fputsx.c \ + shadow/getdef.c \ + shadow/getdef.h \ + shadow/groupadd.c \ + shadow/groupio.c \ + shadow/groupio.h \ + shadow/gshadow.c \ + shadow/gshadow_.h \ + shadow/list.c \ + shadow/nscd.h \ + shadow/prototypes.h \ + shadow/pwauth.h \ + shadow/pwio.c \ + shadow/pwio.h \ + shadow/sgetgrent.c \ + shadow/sgetpwent.c \ + shadow/sgroupio.c \ + shadow/sgroupio.h \ + shadow/shadow_config.h \ + shadow/shadowio.c \ + shadow/shadowio.h \ + shadow/strtoday.c \ + shadow/useradd.c +endif +if USE_LUA_CHKCONFIG +liblua_la_CFLAGS += \ + -DUSE_LUA_CHKCONFIG +liblua_la_SOURCES += \ + chkconfig/chkconfig.c \ + chkconfig/leveldb.h \ + chkconfig/leveldb.c +else +EXTRA_DIST += \ + chkconfig/chkconfig.c \ + chkconfig/leveldb.c \ + chkconfig/leveldb.h +endif + +liblua_la_LIBADD = @WITH_LUA_SUBDIR_LIB@ -lm -lexpat +liblua_la_SOURCES += \ + local/llocal.c \ + local/llocal.h \ + local/lposix.h \ + local/lposix.c \ + local/lrexlib.h \ + local/lrexlib_algo.h \ + local/lrexlib_common.h \ + local/lrexlib_common.c \ + local/lrexlib_lpcre.c \ + local/lrexlib_lpcre_f.c \ + local/lrexlib_lposix.c \ + local/lshadow.h \ + local/lshadow.c \ + local/luuid.h \ + local/luuid.c \ + local/lwrs.h \ + local/lwrs.c + +liblua_la_SOURCES += \ + linit.c \ + lauxlib.h \ + lauxlib.c \ + lua.h \ + luaconf.h \ + lualib.h \ + lbaselib.c \ + ldblib.c \ + liolib.c \ + loslib.c \ + lmathlib.c \ + loadlib.c \ + lstrlib.c \ + ltablib.c \ + lapi.c \ + lapi.h \ + lcode.c \ + lcode.h \ + ldebug.c \ + ldebug.h \ + ldo.c \ + ldo.h \ + ldump.c \ + lfunc.c \ + lfunc.h \ + lgc.c \ + lgc.h \ + llex.c \ + llex.h \ + llimits.h \ + lmem.c \ + lmem.h \ + lobject.c \ + lobject.h \ + lopcodes.c \ + lopcodes.h \ + lparser.c \ + lparser.h \ + lstate.c \ + lstate.h \ + lstring.c \ + lstring.h \ + ltable.c \ + ltable.h \ + ltests.c \ + ltm.c \ + ltm.h \ + lundump.c \ + lundump.h \ + lvm.c \ + lvm.h \ + lzio.c \ + lzio.h +liblua.la: $(liblua_la_OBJECTS) $(liblua_la_DEPENDENCIES) + $(liblua_la_LINK) $(liblua_la_OBJECTS) $(liblua_la_LIBADD) + -ln -sf ../liblua.la .libs/liblua.lai #XXX HACK ALERT + +$(builddir)/local/llocal.c: $(builddir)/local/llocal_lua.c + +if USE_LUA_CRYPTO +$(builddir)/local/llocal_lua.c: $(builddir)/bin2c $(srcdir)/local/llocal.lua $(srcdir)/local/lom.lua + mkdir -p $(builddir)/local + $(builddir)/bin2c $(srcdir)/local/llocal.lua $(srcdir)/local/lom.lua > $(builddir)/local/llocal_lua.c +else +$(builddir)/local/llocal_lua.c: $(builddir)/bin2c $(srcdir)/local/llocal.lua + mkdir -p $(builddir)/local + $(builddir)/bin2c $(srcdir)/local/llocal.lua > $(builddir)/local/llocal_lua.c +endif + +clean-local: + -rm -f $(builddir)/local/llocal_lua.c + +# XXX Build & install as rpmlua/rpmluac with hardlinks to lua/luac post install. +# XXX CVS has lua/luac sub-directories in the Attic that collide with the +# XXX lua/luac executable names when using cvs update. +install-exec-hook: install-pkgbinPROGRAMS + mkdir -p $(DESTDIR)$(pkgbindir) + $(__RM) -f $(DESTDIR)$(pkgbindir)/lua + $(__LN) $(DESTDIR)$(pkgbindir)/rpmlua $(DESTDIR)$(pkgbindir)/lua + $(__RM) -f $(DESTDIR)$(pkgbindir)/luac + $(__LN) $(DESTDIR)$(pkgbindir)/rpmluac $(DESTDIR)$(pkgbindir)/luac diff --git a/rpm-5.4.9/lua/Makefile.in b/rpm-5.4.9/lua/Makefile.in new file mode 100644 index 0000000..635c523 --- /dev/null +++ b/rpm-5.4.9/lua/Makefile.in @@ -0,0 +1,1915 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@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@ +target_triplet = @target@ +@USE_LUA_CHKCONFIG_TRUE@am__append_1 = \ +@USE_LUA_CHKCONFIG_TRUE@ -I$(srcdir)/chkconfig \ +@USE_LUA_CHKCONFIG_TRUE@ -I$(builddir)/chkconfig \ +@USE_LUA_CHKCONFIG_TRUE@ $(WITH_POPT_CPPFLAGS) + +@USE_LUA_SHADOW_TRUE@am__append_2 = \ +@USE_LUA_SHADOW_TRUE@ -I$(srcdir)/shadow \ +@USE_LUA_SHADOW_TRUE@ -I$(builddir)/shadow + +pkgbin_PROGRAMS = rpmlua$(EXEEXT) rpmluac$(EXEEXT) +noinst_PROGRAMS = bin2c$(EXEEXT) +@USE_LUA_CRYPTO_TRUE@am__append_3 = \ +@USE_LUA_CRYPTO_TRUE@ -DCRYPTO_OPENSSL + +@USE_LUA_CRYPTO_TRUE@am__append_4 = \ +@USE_LUA_CRYPTO_TRUE@ local/lcrypto.c \ +@USE_LUA_CRYPTO_TRUE@ local/lcrypto.h \ +@USE_LUA_CRYPTO_TRUE@ local/lxplib.c \ +@USE_LUA_CRYPTO_TRUE@ local/lxplib.h + +@USE_LUA_CRYPTO_FALSE@am__append_5 = \ +@USE_LUA_CRYPTO_FALSE@ local/lcrypto.c \ +@USE_LUA_CRYPTO_FALSE@ local/lcrypto.h \ +@USE_LUA_CRYPTO_FALSE@ local/lxplib.c \ +@USE_LUA_CRYPTO_FALSE@ local/lxplib.h + +@USE_LUA_SOCKET_TRUE@am__append_6 = \ +@USE_LUA_SOCKET_TRUE@ socket/auxiliar.c \ +@USE_LUA_SOCKET_TRUE@ socket/auxiliar.h \ +@USE_LUA_SOCKET_TRUE@ socket/buffer.c \ +@USE_LUA_SOCKET_TRUE@ socket/buffer.h \ +@USE_LUA_SOCKET_TRUE@ socket/except.c \ +@USE_LUA_SOCKET_TRUE@ socket/except.h \ +@USE_LUA_SOCKET_TRUE@ socket/ftp.lua \ +@USE_LUA_SOCKET_TRUE@ socket/http.lua \ +@USE_LUA_SOCKET_TRUE@ socket/inet.c \ +@USE_LUA_SOCKET_TRUE@ socket/inet.h \ +@USE_LUA_SOCKET_TRUE@ socket/io.c \ +@USE_LUA_SOCKET_TRUE@ socket/io.h \ +@USE_LUA_SOCKET_TRUE@ socket/ltn12.lua \ +@USE_LUA_SOCKET_TRUE@ socket/luasocket.c \ +@USE_LUA_SOCKET_TRUE@ socket/luasocket.h \ +@USE_LUA_SOCKET_TRUE@ socket/mime.c \ +@USE_LUA_SOCKET_TRUE@ socket/mime.h \ +@USE_LUA_SOCKET_TRUE@ socket/mime.lua \ +@USE_LUA_SOCKET_TRUE@ socket/options.c \ +@USE_LUA_SOCKET_TRUE@ socket/options.h \ +@USE_LUA_SOCKET_TRUE@ socket/select.c \ +@USE_LUA_SOCKET_TRUE@ socket/select.h \ +@USE_LUA_SOCKET_TRUE@ socket/smtp.lua \ +@USE_LUA_SOCKET_TRUE@ socket/socket.h \ +@USE_LUA_SOCKET_TRUE@ socket/socket.lua \ +@USE_LUA_SOCKET_TRUE@ socket/tcp.c \ +@USE_LUA_SOCKET_TRUE@ socket/tcp.h \ +@USE_LUA_SOCKET_TRUE@ socket/timeout.c \ +@USE_LUA_SOCKET_TRUE@ socket/timeout.h \ +@USE_LUA_SOCKET_TRUE@ socket/tp.lua \ +@USE_LUA_SOCKET_TRUE@ socket/udp.c \ +@USE_LUA_SOCKET_TRUE@ socket/udp.h \ +@USE_LUA_SOCKET_TRUE@ socket/unix.c \ +@USE_LUA_SOCKET_TRUE@ socket/unix.h \ +@USE_LUA_SOCKET_TRUE@ socket/url.lua \ +@USE_LUA_SOCKET_TRUE@ socket/usocket.c \ +@USE_LUA_SOCKET_TRUE@ socket/usocket.h \ +@USE_LUA_SOCKET_TRUE@ socket/wsocket.c \ +@USE_LUA_SOCKET_TRUE@ socket/wsocket.h + +@USE_LUA_SOCKET_FALSE@am__append_7 = \ +@USE_LUA_SOCKET_FALSE@ socket/auxiliar.c \ +@USE_LUA_SOCKET_FALSE@ socket/auxiliar.h \ +@USE_LUA_SOCKET_FALSE@ socket/buffer.c \ +@USE_LUA_SOCKET_FALSE@ socket/buffer.h \ +@USE_LUA_SOCKET_FALSE@ socket/except.c \ +@USE_LUA_SOCKET_FALSE@ socket/except.h \ +@USE_LUA_SOCKET_FALSE@ socket/ftp.lua \ +@USE_LUA_SOCKET_FALSE@ socket/http.lua \ +@USE_LUA_SOCKET_FALSE@ socket/inet.c \ +@USE_LUA_SOCKET_FALSE@ socket/inet.h \ +@USE_LUA_SOCKET_FALSE@ socket/io.c \ +@USE_LUA_SOCKET_FALSE@ socket/io.h \ +@USE_LUA_SOCKET_FALSE@ socket/ltn12.lua \ +@USE_LUA_SOCKET_FALSE@ socket/luasocket.c \ +@USE_LUA_SOCKET_FALSE@ socket/luasocket.h \ +@USE_LUA_SOCKET_FALSE@ socket/mime.c \ +@USE_LUA_SOCKET_FALSE@ socket/mime.h \ +@USE_LUA_SOCKET_FALSE@ socket/mime.lua \ +@USE_LUA_SOCKET_FALSE@ socket/options.c \ +@USE_LUA_SOCKET_FALSE@ socket/options.h \ +@USE_LUA_SOCKET_FALSE@ socket/select.c \ +@USE_LUA_SOCKET_FALSE@ socket/select.h \ +@USE_LUA_SOCKET_FALSE@ socket/smtp.lua \ +@USE_LUA_SOCKET_FALSE@ socket/socket.h \ +@USE_LUA_SOCKET_FALSE@ socket/socket.lua \ +@USE_LUA_SOCKET_FALSE@ socket/tcp.c \ +@USE_LUA_SOCKET_FALSE@ socket/tcp.h \ +@USE_LUA_SOCKET_FALSE@ socket/timeout.c \ +@USE_LUA_SOCKET_FALSE@ socket/timeout.h \ +@USE_LUA_SOCKET_FALSE@ socket/tp.lua \ +@USE_LUA_SOCKET_FALSE@ socket/udp.c \ +@USE_LUA_SOCKET_FALSE@ socket/udp.h \ +@USE_LUA_SOCKET_FALSE@ socket/unix.c \ +@USE_LUA_SOCKET_FALSE@ socket/unix.h \ +@USE_LUA_SOCKET_FALSE@ socket/url.lua \ +@USE_LUA_SOCKET_FALSE@ socket/usocket.c \ +@USE_LUA_SOCKET_FALSE@ socket/usocket.h \ +@USE_LUA_SOCKET_FALSE@ socket/wsocket.c \ +@USE_LUA_SOCKET_FALSE@ socket/wsocket.h + +@USE_LUA_SHADOW_TRUE@am__append_8 = \ +@USE_LUA_SHADOW_TRUE@ -DUSE_LUA_SHADOW + +@USE_LUA_SHADOW_TRUE@am__append_9 = \ +@USE_LUA_SHADOW_TRUE@ shadow/chkname.h \ +@USE_LUA_SHADOW_TRUE@ shadow/commonio.h \ +@USE_LUA_SHADOW_TRUE@ shadow/commonio.c \ +@USE_LUA_SHADOW_TRUE@ shadow/shadow_config.h \ +@USE_LUA_SHADOW_TRUE@ shadow/copydir.c \ +@USE_LUA_SHADOW_TRUE@ shadow/defines.h \ +@USE_LUA_SHADOW_TRUE@ shadow/faillog.h \ +@USE_LUA_SHADOW_TRUE@ shadow/fputsx.c \ +@USE_LUA_SHADOW_TRUE@ shadow/getdef.h \ +@USE_LUA_SHADOW_TRUE@ shadow/getdef.c \ +@USE_LUA_SHADOW_TRUE@ shadow/groupadd.c \ +@USE_LUA_SHADOW_TRUE@ shadow/groupio.h \ +@USE_LUA_SHADOW_TRUE@ shadow/groupio.c \ +@USE_LUA_SHADOW_TRUE@ shadow/gshadow_.h \ +@USE_LUA_SHADOW_TRUE@ shadow/gshadow.c \ +@USE_LUA_SHADOW_TRUE@ shadow/list.c \ +@USE_LUA_SHADOW_TRUE@ shadow/nscd.h \ +@USE_LUA_SHADOW_TRUE@ shadow/prototypes.h \ +@USE_LUA_SHADOW_TRUE@ shadow/pwauth.h \ +@USE_LUA_SHADOW_TRUE@ shadow/pwio.h \ +@USE_LUA_SHADOW_TRUE@ shadow/pwio.c \ +@USE_LUA_SHADOW_TRUE@ shadow/sgroupio.h \ +@USE_LUA_SHADOW_TRUE@ shadow/sgroupio.c \ +@USE_LUA_SHADOW_TRUE@ shadow/sgetgrent.c \ +@USE_LUA_SHADOW_TRUE@ shadow/sgetpwent.c \ +@USE_LUA_SHADOW_TRUE@ shadow/shadowio.h \ +@USE_LUA_SHADOW_TRUE@ shadow/shadowio.c \ +@USE_LUA_SHADOW_TRUE@ shadow/strtoday.c \ +@USE_LUA_SHADOW_TRUE@ shadow/useradd.c + +@USE_LUA_SHADOW_FALSE@am__append_10 = \ +@USE_LUA_SHADOW_FALSE@ shadow/chkname.h \ +@USE_LUA_SHADOW_FALSE@ shadow/commonio.c \ +@USE_LUA_SHADOW_FALSE@ shadow/commonio.h \ +@USE_LUA_SHADOW_FALSE@ shadow/copydir.c \ +@USE_LUA_SHADOW_FALSE@ shadow/defines.h \ +@USE_LUA_SHADOW_FALSE@ shadow/faillog.h \ +@USE_LUA_SHADOW_FALSE@ shadow/fputsx.c \ +@USE_LUA_SHADOW_FALSE@ shadow/getdef.c \ +@USE_LUA_SHADOW_FALSE@ shadow/getdef.h \ +@USE_LUA_SHADOW_FALSE@ shadow/groupadd.c \ +@USE_LUA_SHADOW_FALSE@ shadow/groupio.c \ +@USE_LUA_SHADOW_FALSE@ shadow/groupio.h \ +@USE_LUA_SHADOW_FALSE@ shadow/gshadow.c \ +@USE_LUA_SHADOW_FALSE@ shadow/gshadow_.h \ +@USE_LUA_SHADOW_FALSE@ shadow/list.c \ +@USE_LUA_SHADOW_FALSE@ shadow/nscd.h \ +@USE_LUA_SHADOW_FALSE@ shadow/prototypes.h \ +@USE_LUA_SHADOW_FALSE@ shadow/pwauth.h \ +@USE_LUA_SHADOW_FALSE@ shadow/pwio.c \ +@USE_LUA_SHADOW_FALSE@ shadow/pwio.h \ +@USE_LUA_SHADOW_FALSE@ shadow/sgetgrent.c \ +@USE_LUA_SHADOW_FALSE@ shadow/sgetpwent.c \ +@USE_LUA_SHADOW_FALSE@ shadow/sgroupio.c \ +@USE_LUA_SHADOW_FALSE@ shadow/sgroupio.h \ +@USE_LUA_SHADOW_FALSE@ shadow/shadow_config.h \ +@USE_LUA_SHADOW_FALSE@ shadow/shadowio.c \ +@USE_LUA_SHADOW_FALSE@ shadow/shadowio.h \ +@USE_LUA_SHADOW_FALSE@ shadow/strtoday.c \ +@USE_LUA_SHADOW_FALSE@ shadow/useradd.c + +@USE_LUA_CHKCONFIG_TRUE@am__append_11 = \ +@USE_LUA_CHKCONFIG_TRUE@ -DUSE_LUA_CHKCONFIG + +@USE_LUA_CHKCONFIG_TRUE@am__append_12 = \ +@USE_LUA_CHKCONFIG_TRUE@ chkconfig/chkconfig.c \ +@USE_LUA_CHKCONFIG_TRUE@ chkconfig/leveldb.h \ +@USE_LUA_CHKCONFIG_TRUE@ chkconfig/leveldb.c + +@USE_LUA_CHKCONFIG_FALSE@am__append_13 = \ +@USE_LUA_CHKCONFIG_FALSE@ chkconfig/chkconfig.c \ +@USE_LUA_CHKCONFIG_FALSE@ chkconfig/leveldb.c \ +@USE_LUA_CHKCONFIG_FALSE@ chkconfig/leveldb.h + +subdir = lua +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(pkgbindir)" +LTLIBRARIES = $(pkglib_LTLIBRARIES) +liblua_la_DEPENDENCIES = +am__liblua_la_SOURCES_DIST = local/lcrypto.c local/lcrypto.h \ + local/lxplib.c local/lxplib.h socket/auxiliar.c \ + socket/auxiliar.h socket/buffer.c socket/buffer.h \ + socket/except.c socket/except.h socket/ftp.lua socket/http.lua \ + socket/inet.c socket/inet.h socket/io.c socket/io.h \ + socket/ltn12.lua socket/luasocket.c socket/luasocket.h \ + socket/mime.c socket/mime.h socket/mime.lua socket/options.c \ + socket/options.h socket/select.c socket/select.h \ + socket/smtp.lua socket/socket.h socket/socket.lua socket/tcp.c \ + socket/tcp.h socket/timeout.c socket/timeout.h socket/tp.lua \ + socket/udp.c socket/udp.h socket/unix.c socket/unix.h \ + socket/url.lua socket/usocket.c socket/usocket.h \ + socket/wsocket.c socket/wsocket.h shadow/chkname.h \ + shadow/commonio.h shadow/commonio.c shadow/shadow_config.h \ + shadow/copydir.c shadow/defines.h shadow/faillog.h \ + shadow/fputsx.c shadow/getdef.h shadow/getdef.c \ + shadow/groupadd.c shadow/groupio.h shadow/groupio.c \ + shadow/gshadow_.h shadow/gshadow.c shadow/list.c shadow/nscd.h \ + shadow/prototypes.h shadow/pwauth.h shadow/pwio.h \ + shadow/pwio.c shadow/sgroupio.h shadow/sgroupio.c \ + shadow/sgetgrent.c shadow/sgetpwent.c shadow/shadowio.h \ + shadow/shadowio.c shadow/strtoday.c shadow/useradd.c \ + chkconfig/chkconfig.c chkconfig/leveldb.h chkconfig/leveldb.c \ + local/llocal.c local/llocal.h local/lposix.h local/lposix.c \ + local/lrexlib.h local/lrexlib_algo.h local/lrexlib_common.h \ + local/lrexlib_common.c local/lrexlib_lpcre.c \ + local/lrexlib_lpcre_f.c local/lrexlib_lposix.c local/lshadow.h \ + local/lshadow.c local/luuid.h local/luuid.c local/lwrs.h \ + local/lwrs.c linit.c lauxlib.h lauxlib.c lua.h luaconf.h \ + lualib.h lbaselib.c ldblib.c liolib.c loslib.c lmathlib.c \ + loadlib.c lstrlib.c ltablib.c lapi.c lapi.h lcode.c lcode.h \ + ldebug.c ldebug.h ldo.c ldo.h ldump.c lfunc.c lfunc.h lgc.c \ + lgc.h llex.c llex.h llimits.h lmem.c lmem.h lobject.c \ + lobject.h lopcodes.c lopcodes.h lparser.c lparser.h lstate.c \ + lstate.h lstring.c lstring.h ltable.c ltable.h ltests.c ltm.c \ + ltm.h lundump.c lundump.h lvm.c lvm.h lzio.c lzio.h +@USE_LUA_CRYPTO_TRUE@am__objects_1 = liblua_la-lcrypto.lo \ +@USE_LUA_CRYPTO_TRUE@ liblua_la-lxplib.lo +@USE_LUA_SOCKET_TRUE@am__objects_2 = liblua_la-auxiliar.lo \ +@USE_LUA_SOCKET_TRUE@ liblua_la-buffer.lo liblua_la-except.lo \ +@USE_LUA_SOCKET_TRUE@ liblua_la-inet.lo liblua_la-io.lo \ +@USE_LUA_SOCKET_TRUE@ liblua_la-luasocket.lo liblua_la-mime.lo \ +@USE_LUA_SOCKET_TRUE@ liblua_la-options.lo liblua_la-select.lo \ +@USE_LUA_SOCKET_TRUE@ liblua_la-tcp.lo liblua_la-timeout.lo \ +@USE_LUA_SOCKET_TRUE@ liblua_la-udp.lo liblua_la-unix.lo \ +@USE_LUA_SOCKET_TRUE@ liblua_la-usocket.lo liblua_la-wsocket.lo +@USE_LUA_SHADOW_TRUE@am__objects_3 = liblua_la-commonio.lo \ +@USE_LUA_SHADOW_TRUE@ liblua_la-copydir.lo liblua_la-fputsx.lo \ +@USE_LUA_SHADOW_TRUE@ liblua_la-getdef.lo liblua_la-groupadd.lo \ +@USE_LUA_SHADOW_TRUE@ liblua_la-groupio.lo liblua_la-gshadow.lo \ +@USE_LUA_SHADOW_TRUE@ liblua_la-list.lo liblua_la-pwio.lo \ +@USE_LUA_SHADOW_TRUE@ liblua_la-sgroupio.lo \ +@USE_LUA_SHADOW_TRUE@ liblua_la-sgetgrent.lo \ +@USE_LUA_SHADOW_TRUE@ liblua_la-sgetpwent.lo \ +@USE_LUA_SHADOW_TRUE@ liblua_la-shadowio.lo \ +@USE_LUA_SHADOW_TRUE@ liblua_la-strtoday.lo \ +@USE_LUA_SHADOW_TRUE@ liblua_la-useradd.lo +@USE_LUA_CHKCONFIG_TRUE@am__objects_4 = liblua_la-chkconfig.lo \ +@USE_LUA_CHKCONFIG_TRUE@ liblua_la-leveldb.lo +am_liblua_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) $(am__objects_4) liblua_la-llocal.lo \ + liblua_la-lposix.lo liblua_la-lrexlib_common.lo \ + liblua_la-lrexlib_lpcre.lo liblua_la-lrexlib_lpcre_f.lo \ + liblua_la-lrexlib_lposix.lo liblua_la-lshadow.lo \ + liblua_la-luuid.lo liblua_la-lwrs.lo liblua_la-linit.lo \ + liblua_la-lauxlib.lo liblua_la-lbaselib.lo liblua_la-ldblib.lo \ + liblua_la-liolib.lo liblua_la-loslib.lo liblua_la-lmathlib.lo \ + liblua_la-loadlib.lo liblua_la-lstrlib.lo liblua_la-ltablib.lo \ + liblua_la-lapi.lo liblua_la-lcode.lo liblua_la-ldebug.lo \ + liblua_la-ldo.lo liblua_la-ldump.lo liblua_la-lfunc.lo \ + liblua_la-lgc.lo liblua_la-llex.lo liblua_la-lmem.lo \ + liblua_la-lobject.lo liblua_la-lopcodes.lo \ + liblua_la-lparser.lo liblua_la-lstate.lo liblua_la-lstring.lo \ + liblua_la-ltable.lo liblua_la-ltests.lo liblua_la-ltm.lo \ + liblua_la-lundump.lo liblua_la-lvm.lo liblua_la-lzio.lo +liblua_la_OBJECTS = $(am_liblua_la_OBJECTS) +liblua_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(liblua_la_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +PROGRAMS = $(noinst_PROGRAMS) $(pkgbin_PROGRAMS) +bin2c_SOURCES = bin2c.c +bin2c_OBJECTS = bin2c.$(OBJEXT) +bin2c_LDADD = $(LDADD) +am_rpmlua_OBJECTS = rpmlua-lua.$(OBJEXT) +rpmlua_OBJECTS = $(am_rpmlua_OBJECTS) +rpmlua_DEPENDENCIES = liblua.la +rpmlua_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(rpmlua_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_rpmluac_OBJECTS = rpmluac-luac.$(OBJEXT) rpmluac-print.$(OBJEXT) +rpmluac_OBJECTS = $(am_rpmluac_OBJECTS) +rpmluac_DEPENDENCIES = liblua.la +rpmluac_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(rpmluac_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(liblua_la_SOURCES) bin2c.c $(rpmlua_SOURCES) \ + $(rpmluac_SOURCES) +DIST_SOURCES = $(am__liblua_la_SOURCES_DIST) bin2c.c $(rpmlua_SOURCES) \ + $(rpmluac_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkglibdir = @USRLIBRPM@/lib +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDROOTDIR_MACRO = @BUILDROOTDIR_MACRO@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBAPI = @DBAPI@ +DBLIBOBJS = @DBLIBOBJS@ +DBLIBSRCS = @DBLIBSRCS@ +DBPATH = @DBPATH@ +DBPATH_MACRO = @DBPATH_MACRO@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTRO_MACROS = @DISTRO_MACROS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIXPERMS = @FIXPERMS@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GPSEE_MODULES_PATH = @GPSEE_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_STATIC = @LDFLAGS_STATIC@ +LD_VERSION_SCRIPT_FLAG = @LD_VERSION_SCRIPT_FLAG@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOLIZE = @LIBTOOLIZE@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MACROFILES = @MACROFILES@ +MAGIC_MACRO = @MAGIC_MACRO@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR = @MKDIR@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NCPUS_COMMAND = @NCPUS_COMMAND@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENMP_CFLAGS = @OPENMP_CFLAGS@ +OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_INSTALLDIRS = @PERL_INSTALLDIRS@ +PERL_URPM_INSTALLDIRS = @PERL_URPM_INSTALLDIRS@ +PKGSRCDIR = @PKGSRCDIR@ +PKGSRCDIR_MACRO = @PKGSRCDIR_MACRO@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +ROOT_GROUP = @ROOT_GROUP@ +RPMCANONARCH = @RPMCANONARCH@ +RPMCANONCOLOR = @RPMCANONCOLOR@ +RPMCANONGNU = @RPMCANONGNU@ +RPMCANONOS = @RPMCANONOS@ +RPMCANONVENDOR = @RPMCANONVENDOR@ +RPMGID = @RPMGID@ +RPMGROUP = @RPMGROUP@ +RPMLUAFILES = @RPMLUAFILES@ +RPMPOPTFILES = @RPMPOPTFILES@ +RPMUID = @RPMUID@ +RPMUSER = @RPMUSER@ +RPM_TIMESTAMP = @RPM_TIMESTAMP@ +RPM_VENDOR = @RPM_VENDOR@ +RPM_VERSION = @RPM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFIGDIR = @SYSCONFIGDIR@ +USE_NLS = @USE_NLS@ +USRLIBRPM = @USRLIBRPM@ +VERSION = @VERSION@ +WITH_ACL = @WITH_ACL@ +WITH_APIDOCS = @WITH_APIDOCS@ +WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ +WITH_APR = @WITH_APR@ +WITH_ATERM = @WITH_ATERM@ +WITH_ATTR = @WITH_ATTR@ +WITH_AUGEAS = @WITH_AUGEAS@ +WITH_AUGEAS_AUGTOOL = @WITH_AUGEAS_AUGTOOL@ +WITH_BASH = @WITH_BASH@ +WITH_BASH_CPPFLAGS = @WITH_BASH_CPPFLAGS@ +WITH_BASH_LDFLAGS = @WITH_BASH_LDFLAGS@ +WITH_BASH_LIBS = @WITH_BASH_LIBS@ +WITH_BASH_SUBDIR = @WITH_BASH_SUBDIR@ +WITH_BEECRYPT = @WITH_BEECRYPT@ +WITH_BEECRYPT_CPPFLAGS = @WITH_BEECRYPT_CPPFLAGS@ +WITH_BEECRYPT_LDFLAGS = @WITH_BEECRYPT_LDFLAGS@ +WITH_BEECRYPT_LIBS = @WITH_BEECRYPT_LIBS@ +WITH_BEECRYPT_SUBDIR = @WITH_BEECRYPT_SUBDIR@ +WITH_BZIP2 = @WITH_BZIP2@ +WITH_CPUINFO = @WITH_CPUINFO@ +WITH_CUDF = @WITH_CUDF@ +WITH_CUDF_CUDFTOOL = @WITH_CUDF_CUDFTOOL@ +WITH_DB = @WITH_DB@ +WITH_DBSQL = @WITH_DBSQL@ +WITH_DBSQL_CPPFLAGS = @WITH_DBSQL_CPPFLAGS@ +WITH_DBSQL_LDFLAGS = @WITH_DBSQL_LDFLAGS@ +WITH_DBSQL_LIBS = @WITH_DBSQL_LIBS@ +WITH_DBSQL_SUBDIR = @WITH_DBSQL_SUBDIR@ +WITH_DB_CPPFLAGS = @WITH_DB_CPPFLAGS@ +WITH_DB_LDFLAGS = @WITH_DB_LDFLAGS@ +WITH_DB_LIBS = @WITH_DB_LIBS@ +WITH_DB_SUBDIR = @WITH_DB_SUBDIR@ +WITH_DMALLOC = @WITH_DMALLOC@ +WITH_EFENCE = @WITH_EFENCE@ +WITH_EXPAT = @WITH_EXPAT@ +WITH_FICL = @WITH_FICL@ +WITH_FICL_CPPFLAGS = @WITH_FICL_CPPFLAGS@ +WITH_FICL_LDFLAGS = @WITH_FICL_LDFLAGS@ +WITH_FICL_LIBS = @WITH_FICL_LIBS@ +WITH_FICL_SUBDIR = @WITH_FICL_SUBDIR@ +WITH_FILE = @WITH_FILE@ +WITH_FILE_CPPFLAGS = @WITH_FILE_CPPFLAGS@ +WITH_FILE_LDFLAGS = @WITH_FILE_LDFLAGS@ +WITH_FILE_LIBS = @WITH_FILE_LIBS@ +WITH_FILE_SUBDIR = @WITH_FILE_SUBDIR@ +WITH_GCRYPT = @WITH_GCRYPT@ +WITH_GNUTLS = @WITH_GNUTLS@ +WITH_GPSEE = @WITH_GPSEE@ +WITH_GPSEE_CPPFLAGS = @WITH_GPSEE_CPPFLAGS@ +WITH_GPSEE_LDFLAGS = @WITH_GPSEE_LDFLAGS@ +WITH_GPSEE_LIBS = @WITH_GPSEE_LIBS@ +WITH_GPSEE_SUBDIR = @WITH_GPSEE_SUBDIR@ +WITH_JS_SUBDIR = @WITH_JS_SUBDIR@ +WITH_KEYUTILS = @WITH_KEYUTILS@ +WITH_KEYUTILS_RPMKEY = @WITH_KEYUTILS_RPMKEY@ +WITH_LIBELF_DEBUGEDIT = @WITH_LIBELF_DEBUGEDIT@ +WITH_LIBGIT2 = @WITH_LIBGIT2@ +WITH_LIBGIT2_CPPFLAGS = @WITH_LIBGIT2_CPPFLAGS@ +WITH_LIBGIT2_LDFLAGS = @WITH_LIBGIT2_LDFLAGS@ +WITH_LIBGIT2_LIBS = @WITH_LIBGIT2_LIBS@ +WITH_LIBGIT2_SUBDIR = @WITH_LIBGIT2_SUBDIR@ +WITH_LIBTASN1 = @WITH_LIBTASN1@ +WITH_LUA = @WITH_LUA@ +WITH_LUA_CPPFLAGS = @WITH_LUA_CPPFLAGS@ +WITH_LUA_LDFLAGS = @WITH_LUA_LDFLAGS@ +WITH_LUA_LIBS = @WITH_LUA_LIBS@ +WITH_LUA_SUBDIR = @WITH_LUA_SUBDIR@ +WITH_LUA_SUBDIR_DEF = @WITH_LUA_SUBDIR_DEF@ +WITH_LUA_SUBDIR_LIB = @WITH_LUA_SUBDIR_LIB@ +WITH_MOZJS185 = @WITH_MOZJS185@ +WITH_MOZJS185_CPPFLAGS = @WITH_MOZJS185_CPPFLAGS@ +WITH_MOZJS185_LDFLAGS = @WITH_MOZJS185_LDFLAGS@ +WITH_MOZJS185_LIBS = @WITH_MOZJS185_LIBS@ +WITH_MOZJS185_SUBDIR = @WITH_MOZJS185_SUBDIR@ +WITH_NEON = @WITH_NEON@ +WITH_NEON_CPPFLAGS = @WITH_NEON_CPPFLAGS@ +WITH_NEON_LDFLAGS = @WITH_NEON_LDFLAGS@ +WITH_NEON_LIBS = @WITH_NEON_LIBS@ +WITH_NEON_SUBDIR = @WITH_NEON_SUBDIR@ +WITH_NIX = @WITH_NIX@ +WITH_NSS = @WITH_NSS@ +WITH_OPENSSL = @WITH_OPENSSL@ +WITH_PAKCHOIS = @WITH_PAKCHOIS@ +WITH_PATH_VERSIONED = @WITH_PATH_VERSIONED@ +WITH_PATH_VERSIONED_SUFFIX = @WITH_PATH_VERSIONED_SUFFIX@ +WITH_PCRE = @WITH_PCRE@ +WITH_PCRE_CPPFLAGS = @WITH_PCRE_CPPFLAGS@ +WITH_PCRE_LDFLAGS = @WITH_PCRE_LDFLAGS@ +WITH_PCRE_LIBS = @WITH_PCRE_LIBS@ +WITH_PCRE_SUBDIR = @WITH_PCRE_SUBDIR@ +WITH_PERLEMBED = @WITH_PERLEMBED@ +WITH_PERL_LIBS = @WITH_PERL_LIBS@ +WITH_PERL_SUBDIR = @WITH_PERL_SUBDIR@ +WITH_PERL_SUBPACKAGE = @WITH_PERL_SUBPACKAGE@ +WITH_PERL_URPM_LIBS = @WITH_PERL_URPM_LIBS@ +WITH_PERL_URPM_SUBDIR = @WITH_PERL_URPM_SUBDIR@ +WITH_PERL_URPM_SUBPACKAGE = @WITH_PERL_URPM_SUBPACKAGE@ +WITH_POPT = @WITH_POPT@ +WITH_POPT_CPPFLAGS = @WITH_POPT_CPPFLAGS@ +WITH_POPT_LDFLAGS = @WITH_POPT_LDFLAGS@ +WITH_POPT_LIBS = @WITH_POPT_LIBS@ +WITH_POPT_SUBDIR = @WITH_POPT_SUBDIR@ +WITH_PYTHONEMBED = @WITH_PYTHONEMBED@ +WITH_PYTHON_INCDIR = @WITH_PYTHON_INCDIR@ +WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ +WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ +WITH_RC = @WITH_RC@ +WITH_RC_CPPFLAGS = @WITH_RC_CPPFLAGS@ +WITH_RC_LDFLAGS = @WITH_RC_LDFLAGS@ +WITH_RC_LIBS = @WITH_RC_LIBS@ +WITH_RC_SUBDIR = @WITH_RC_SUBDIR@ +WITH_READLINE = @WITH_READLINE@ +WITH_RUBY = @WITH_RUBY@ +WITH_RUBY_CPPFLAGS = @WITH_RUBY_CPPFLAGS@ +WITH_RUBY_SUBDIR = @WITH_RUBY_SUBDIR@ +WITH_RUBY_VENDORARCHDIR = @WITH_RUBY_VENDORARCHDIR@ +WITH_SELINUX = @WITH_SELINUX@ +WITH_SEMANAGE = @WITH_SEMANAGE@ +WITH_SEMANAGE_SEMODULE = @WITH_SEMANAGE_SEMODULE@ +WITH_SEPOL = @WITH_SEPOL@ +WITH_SPIDERMONKEY_SUBDIR = @WITH_SPIDERMONKEY_SUBDIR@ +WITH_SQLITE = @WITH_SQLITE@ +WITH_SQLITE_CPPFLAGS = @WITH_SQLITE_CPPFLAGS@ +WITH_SQLITE_LDFLAGS = @WITH_SQLITE_LDFLAGS@ +WITH_SQLITE_LIBS = @WITH_SQLITE_LIBS@ +WITH_SQLITE_SUBDIR = @WITH_SQLITE_SUBDIR@ +WITH_SQUIRREL = @WITH_SQUIRREL@ +WITH_SUBVERSION = @WITH_SUBVERSION@ +WITH_SYCK = @WITH_SYCK@ +WITH_SYCK_CPPFLAGS = @WITH_SYCK_CPPFLAGS@ +WITH_SYCK_LDFLAGS = @WITH_SYCK_LDFLAGS@ +WITH_SYCK_LIBS = @WITH_SYCK_LIBS@ +WITH_SYCK_SUBDIR = @WITH_SYCK_SUBDIR@ +WITH_TCL = @WITH_TCL@ +WITH_TCL_SUBDIR = @WITH_TCL_SUBDIR@ +WITH_TOMCRYPT = @WITH_TOMCRYPT@ +WITH_TPM = @WITH_TPM@ +WITH_UNIXODBC = @WITH_UNIXODBC@ +WITH_UUID = @WITH_UUID@ +WITH_XAR = @WITH_XAR@ +WITH_XAR_CPPFLAGS = @WITH_XAR_CPPFLAGS@ +WITH_XAR_LDFLAGS = @WITH_XAR_LDFLAGS@ +WITH_XAR_LIBS = @WITH_XAR_LIBS@ +WITH_XAR_SUBDIR = @WITH_XAR_SUBDIR@ +WITH_XZ = @WITH_XZ@ +WITH_XZ_CPPFLAGS = @WITH_XZ_CPPFLAGS@ +WITH_XZ_LDFLAGS = @WITH_XZ_LDFLAGS@ +WITH_XZ_LIBS = @WITH_XZ_LIBS@ +WITH_XZ_SUBDIR = @WITH_XZ_SUBDIR@ +WITH_ZLIB = @WITH_ZLIB@ +WITH_ZLIB_CPPFLAGS = @WITH_ZLIB_CPPFLAGS@ +WITH_ZLIB_LDFLAGS = @WITH_ZLIB_LDFLAGS@ +WITH_ZLIB_LIBS = @WITH_ZLIB_LIBS@ +WITH_ZLIB_SUBDIR = @WITH_ZLIB_SUBDIR@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__BASH = @__BASH@ +__BZIP2 = @__BZIP2@ +__CAT = @__CAT@ +__CHATTR = @__CHATTR@ +__CHGRP = @__CHGRP@ +__CHGRP_RHF = @__CHGRP_RHF@ +__CHMOD = @__CHMOD@ +__CHOWN = @__CHOWN@ +__CHOWN_RHF = @__CHOWN_RHF@ +__CMAKE = @__CMAKE@ +__CPIO = @__CPIO@ +__CURL = @__CURL@ +__CVS = @__CVS@ +__DBSQL = @__DBSQL@ +__DB_ARCHIVE = @__DB_ARCHIVE@ +__DB_CHECKPOINT = @__DB_CHECKPOINT@ +__DB_DEADLOCK = @__DB_DEADLOCK@ +__DB_DUMP = @__DB_DUMP@ +__DB_HOTBACKUP = @__DB_HOTBACKUP@ +__DB_LOAD = @__DB_LOAD@ +__DB_LOG_VERIFY = @__DB_LOG_VERIFY@ +__DB_PRINTLOG = @__DB_PRINTLOG@ +__DB_RECOVER = @__DB_RECOVER@ +__DB_REPLICATE = @__DB_REPLICATE@ +__DB_SQL_CODEGEN = @__DB_SQL_CODEGEN@ +__DB_STAT = @__DB_STAT@ +__DB_TUNER = @__DB_TUNER@ +__DB_UPGRADE = @__DB_UPGRADE@ +__DB_VERIFY = @__DB_VERIFY@ +__DIFF = @__DIFF@ +__DITTO = @__DITTO@ +__DOXYGEN = @__DOXYGEN@ +__FILE = @__FILE@ +__GIT = @__GIT@ +__GPG = @__GPG@ +__GSR = @__GSR@ +__GST_INSPECT = @__GST_INSPECT@ +__GZIP = @__GZIP@ +__HG = @__HG@ +__ID = @__ID@ +__ID_U = @__ID_U@ +__INSTALL = @__INSTALL@ +__INSTALL_INFO = @__INSTALL_INFO@ +__LD = @__LD@ +__LDCONFIG = @__LDCONFIG@ +__LN = @__LN@ +__LRZIP = @__LRZIP@ +__LSATTR = @__LSATTR@ +__LZIP = @__LZIP@ +__LZMA = @__LZMA@ +__LZOP = @__LZOP@ +__MAKE = @__MAKE@ +__MKDIR = @__MKDIR@ +__MKDIR_P = @__MKDIR_P@ +__MODINFO = @__MODINFO@ +__MONGO = @__MONGO@ +__MV = @__MV@ +__NM = @__NM@ +__OBJCOPY = @__OBJCOPY@ +__OBJDUMP = @__OBJDUMP@ +__PATCH = @__PATCH@ +__PAX = @__PAX@ +__PERL = @__PERL@ +__PGP = @__PGP@ +__PHP = @__PHP@ +__PYTHON = @__PYTHON@ +__RM = @__RM@ +__RMDIR = @__RMDIR@ +__RSH = @__RSH@ +__RUBY = @__RUBY@ +__SED = @__SED@ +__SH = @__SH@ +__SQLITE3 = @__SQLITE3@ +__SSH = @__SSH@ +__STRIP = @__STRIP@ +__SVN = @__SVN@ +__TAR = @__TAR@ +__TCLSH = @__TCLSH@ +__UNZIP = @__UNZIP@ +__XZ = @__XZ@ +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_CXX = @ac_ct_CXX@ +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@ +autorelocate_dcolor = @autorelocate_dcolor@ +autorelocate_path = @autorelocate_path@ +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@ +exeext = @exeext@ +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@ +libext = @libext@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +objext = @objext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +shlibext = @shlibext@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +testdir = @testdir@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrprefix = @usrprefix@ +varprefix = @varprefix@ +EXTRA_DIST = COPYRIGHT HISTORY local/lom.lua local/llocal.lua \ + $(am__append_5) $(am__append_7) $(am__append_10) \ + $(am__append_13) +AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir)/local -I$(builddir)/local \ + @WITH_PCRE_CPPFLAGS@ $(am__append_1) $(am__append_2) \ + -I$(srcdir) +pkgbindir = @USRLIBRPM@/bin +pkglib_LTLIBRARIES = liblua.la +rpmlua_SOURCES = lua.c +rpmlua_CFLAGS = +rpmlua_LDADD = liblua.la +rpmluac_SOURCES = luac.c print.c +rpmluac_CFLAGS = +rpmluac_LDADD = liblua.la +liblua_la_SOURCES = $(am__append_4) $(am__append_6) $(am__append_9) \ + $(am__append_12) local/llocal.c local/llocal.h local/lposix.h \ + local/lposix.c local/lrexlib.h local/lrexlib_algo.h \ + local/lrexlib_common.h local/lrexlib_common.c \ + local/lrexlib_lpcre.c local/lrexlib_lpcre_f.c \ + local/lrexlib_lposix.c local/lshadow.h local/lshadow.c \ + local/luuid.h local/luuid.c local/lwrs.h local/lwrs.c linit.c \ + lauxlib.h lauxlib.c lua.h luaconf.h lualib.h lbaselib.c \ + ldblib.c liolib.c loslib.c lmathlib.c loadlib.c lstrlib.c \ + ltablib.c lapi.c lapi.h lcode.c lcode.h ldebug.c ldebug.h \ + ldo.c ldo.h ldump.c lfunc.c lfunc.h lgc.c lgc.h llex.c llex.h \ + llimits.h lmem.c lmem.h lobject.c lobject.h lopcodes.c \ + lopcodes.h lparser.c lparser.h lstate.c lstate.h lstring.c \ + lstring.h ltable.c ltable.h ltests.c ltm.c ltm.h lundump.c \ + lundump.h lvm.c lvm.h lzio.c lzio.h +liblua_la_CFLAGS = @WITH_LUA_SUBDIR_DEF@ $(am__append_3) \ + $(am__append_8) $(am__append_11) +liblua_la_LIBADD = @WITH_LUA_SUBDIR_LIB@ -lm -lexpat +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 lua/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign lua/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || 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)$(pkglibdir)'"; \ + $(MKDIR_P) '$(DESTDIR)$(pkglibdir)' || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ + } + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +install-pkgbinPROGRAMS: $(pkgbin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(pkgbin_PROGRAMS)'; test -n "$(pkgbindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgbindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgbindir)" || 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)$(pkgbindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkgbindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-pkgbinPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(pkgbin_PROGRAMS)'; test -n "$(pkgbindir)" || 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)$(pkgbindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgbindir)" && rm -f $$files + +clean-pkgbinPROGRAMS: + @list='$(pkgbin_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 +rpmlua$(EXEEXT): $(rpmlua_OBJECTS) $(rpmlua_DEPENDENCIES) $(EXTRA_rpmlua_DEPENDENCIES) + @rm -f rpmlua$(EXEEXT) + $(rpmlua_LINK) $(rpmlua_OBJECTS) $(rpmlua_LDADD) $(LIBS) +rpmluac$(EXEEXT): $(rpmluac_OBJECTS) $(rpmluac_DEPENDENCIES) $(EXTRA_rpmluac_DEPENDENCIES) + @rm -f rpmluac$(EXEEXT) + $(rpmluac_LINK) $(rpmluac_OBJECTS) $(rpmluac_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bin2c.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-auxiliar.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-buffer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-chkconfig.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-commonio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-copydir.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-except.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-fputsx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-getdef.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-groupadd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-groupio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-gshadow.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-inet.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-io.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lapi.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lauxlib.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lbaselib.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lcode.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lcrypto.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-ldblib.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-ldebug.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-ldo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-ldump.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-leveldb.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lfunc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lgc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-linit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-liolib.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-list.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-llex.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-llocal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lmathlib.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lmem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-loadlib.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lobject.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lopcodes.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-loslib.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lparser.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lposix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lrexlib_common.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lrexlib_lpcre.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lrexlib_lpcre_f.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lrexlib_lposix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lshadow.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lstate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lstring.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lstrlib.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-ltable.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-ltablib.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-ltests.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-ltm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-luasocket.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lundump.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-luuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lvm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lwrs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lxplib.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-lzio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-mime.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-options.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-pwio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-select.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-sgetgrent.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-sgetpwent.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-sgroupio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-shadowio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-strtoday.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-tcp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-timeout.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-udp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-unix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-useradd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-usocket.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblua_la-wsocket.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmlua-lua.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmluac-luac.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmluac-print.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +liblua_la-lcrypto.lo: local/lcrypto.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lcrypto.lo -MD -MP -MF $(DEPDIR)/liblua_la-lcrypto.Tpo -c -o liblua_la-lcrypto.lo `test -f 'local/lcrypto.c' || echo '$(srcdir)/'`local/lcrypto.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lcrypto.Tpo $(DEPDIR)/liblua_la-lcrypto.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='local/lcrypto.c' object='liblua_la-lcrypto.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lcrypto.lo `test -f 'local/lcrypto.c' || echo '$(srcdir)/'`local/lcrypto.c + +liblua_la-lxplib.lo: local/lxplib.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lxplib.lo -MD -MP -MF $(DEPDIR)/liblua_la-lxplib.Tpo -c -o liblua_la-lxplib.lo `test -f 'local/lxplib.c' || echo '$(srcdir)/'`local/lxplib.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lxplib.Tpo $(DEPDIR)/liblua_la-lxplib.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='local/lxplib.c' object='liblua_la-lxplib.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lxplib.lo `test -f 'local/lxplib.c' || echo '$(srcdir)/'`local/lxplib.c + +liblua_la-auxiliar.lo: socket/auxiliar.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-auxiliar.lo -MD -MP -MF $(DEPDIR)/liblua_la-auxiliar.Tpo -c -o liblua_la-auxiliar.lo `test -f 'socket/auxiliar.c' || echo '$(srcdir)/'`socket/auxiliar.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-auxiliar.Tpo $(DEPDIR)/liblua_la-auxiliar.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='socket/auxiliar.c' object='liblua_la-auxiliar.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-auxiliar.lo `test -f 'socket/auxiliar.c' || echo '$(srcdir)/'`socket/auxiliar.c + +liblua_la-buffer.lo: socket/buffer.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-buffer.lo -MD -MP -MF $(DEPDIR)/liblua_la-buffer.Tpo -c -o liblua_la-buffer.lo `test -f 'socket/buffer.c' || echo '$(srcdir)/'`socket/buffer.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-buffer.Tpo $(DEPDIR)/liblua_la-buffer.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='socket/buffer.c' object='liblua_la-buffer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-buffer.lo `test -f 'socket/buffer.c' || echo '$(srcdir)/'`socket/buffer.c + +liblua_la-except.lo: socket/except.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-except.lo -MD -MP -MF $(DEPDIR)/liblua_la-except.Tpo -c -o liblua_la-except.lo `test -f 'socket/except.c' || echo '$(srcdir)/'`socket/except.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-except.Tpo $(DEPDIR)/liblua_la-except.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='socket/except.c' object='liblua_la-except.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-except.lo `test -f 'socket/except.c' || echo '$(srcdir)/'`socket/except.c + +liblua_la-inet.lo: socket/inet.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-inet.lo -MD -MP -MF $(DEPDIR)/liblua_la-inet.Tpo -c -o liblua_la-inet.lo `test -f 'socket/inet.c' || echo '$(srcdir)/'`socket/inet.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-inet.Tpo $(DEPDIR)/liblua_la-inet.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='socket/inet.c' object='liblua_la-inet.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-inet.lo `test -f 'socket/inet.c' || echo '$(srcdir)/'`socket/inet.c + +liblua_la-io.lo: socket/io.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-io.lo -MD -MP -MF $(DEPDIR)/liblua_la-io.Tpo -c -o liblua_la-io.lo `test -f 'socket/io.c' || echo '$(srcdir)/'`socket/io.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-io.Tpo $(DEPDIR)/liblua_la-io.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='socket/io.c' object='liblua_la-io.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-io.lo `test -f 'socket/io.c' || echo '$(srcdir)/'`socket/io.c + +liblua_la-luasocket.lo: socket/luasocket.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-luasocket.lo -MD -MP -MF $(DEPDIR)/liblua_la-luasocket.Tpo -c -o liblua_la-luasocket.lo `test -f 'socket/luasocket.c' || echo '$(srcdir)/'`socket/luasocket.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-luasocket.Tpo $(DEPDIR)/liblua_la-luasocket.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='socket/luasocket.c' object='liblua_la-luasocket.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-luasocket.lo `test -f 'socket/luasocket.c' || echo '$(srcdir)/'`socket/luasocket.c + +liblua_la-mime.lo: socket/mime.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-mime.lo -MD -MP -MF $(DEPDIR)/liblua_la-mime.Tpo -c -o liblua_la-mime.lo `test -f 'socket/mime.c' || echo '$(srcdir)/'`socket/mime.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-mime.Tpo $(DEPDIR)/liblua_la-mime.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='socket/mime.c' object='liblua_la-mime.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-mime.lo `test -f 'socket/mime.c' || echo '$(srcdir)/'`socket/mime.c + +liblua_la-options.lo: socket/options.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-options.lo -MD -MP -MF $(DEPDIR)/liblua_la-options.Tpo -c -o liblua_la-options.lo `test -f 'socket/options.c' || echo '$(srcdir)/'`socket/options.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-options.Tpo $(DEPDIR)/liblua_la-options.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='socket/options.c' object='liblua_la-options.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-options.lo `test -f 'socket/options.c' || echo '$(srcdir)/'`socket/options.c + +liblua_la-select.lo: socket/select.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-select.lo -MD -MP -MF $(DEPDIR)/liblua_la-select.Tpo -c -o liblua_la-select.lo `test -f 'socket/select.c' || echo '$(srcdir)/'`socket/select.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-select.Tpo $(DEPDIR)/liblua_la-select.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='socket/select.c' object='liblua_la-select.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-select.lo `test -f 'socket/select.c' || echo '$(srcdir)/'`socket/select.c + +liblua_la-tcp.lo: socket/tcp.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-tcp.lo -MD -MP -MF $(DEPDIR)/liblua_la-tcp.Tpo -c -o liblua_la-tcp.lo `test -f 'socket/tcp.c' || echo '$(srcdir)/'`socket/tcp.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-tcp.Tpo $(DEPDIR)/liblua_la-tcp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='socket/tcp.c' object='liblua_la-tcp.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-tcp.lo `test -f 'socket/tcp.c' || echo '$(srcdir)/'`socket/tcp.c + +liblua_la-timeout.lo: socket/timeout.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-timeout.lo -MD -MP -MF $(DEPDIR)/liblua_la-timeout.Tpo -c -o liblua_la-timeout.lo `test -f 'socket/timeout.c' || echo '$(srcdir)/'`socket/timeout.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-timeout.Tpo $(DEPDIR)/liblua_la-timeout.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='socket/timeout.c' object='liblua_la-timeout.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-timeout.lo `test -f 'socket/timeout.c' || echo '$(srcdir)/'`socket/timeout.c + +liblua_la-udp.lo: socket/udp.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-udp.lo -MD -MP -MF $(DEPDIR)/liblua_la-udp.Tpo -c -o liblua_la-udp.lo `test -f 'socket/udp.c' || echo '$(srcdir)/'`socket/udp.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-udp.Tpo $(DEPDIR)/liblua_la-udp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='socket/udp.c' object='liblua_la-udp.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-udp.lo `test -f 'socket/udp.c' || echo '$(srcdir)/'`socket/udp.c + +liblua_la-unix.lo: socket/unix.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-unix.lo -MD -MP -MF $(DEPDIR)/liblua_la-unix.Tpo -c -o liblua_la-unix.lo `test -f 'socket/unix.c' || echo '$(srcdir)/'`socket/unix.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-unix.Tpo $(DEPDIR)/liblua_la-unix.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='socket/unix.c' object='liblua_la-unix.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-unix.lo `test -f 'socket/unix.c' || echo '$(srcdir)/'`socket/unix.c + +liblua_la-usocket.lo: socket/usocket.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-usocket.lo -MD -MP -MF $(DEPDIR)/liblua_la-usocket.Tpo -c -o liblua_la-usocket.lo `test -f 'socket/usocket.c' || echo '$(srcdir)/'`socket/usocket.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-usocket.Tpo $(DEPDIR)/liblua_la-usocket.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='socket/usocket.c' object='liblua_la-usocket.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-usocket.lo `test -f 'socket/usocket.c' || echo '$(srcdir)/'`socket/usocket.c + +liblua_la-wsocket.lo: socket/wsocket.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-wsocket.lo -MD -MP -MF $(DEPDIR)/liblua_la-wsocket.Tpo -c -o liblua_la-wsocket.lo `test -f 'socket/wsocket.c' || echo '$(srcdir)/'`socket/wsocket.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-wsocket.Tpo $(DEPDIR)/liblua_la-wsocket.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='socket/wsocket.c' object='liblua_la-wsocket.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-wsocket.lo `test -f 'socket/wsocket.c' || echo '$(srcdir)/'`socket/wsocket.c + +liblua_la-commonio.lo: shadow/commonio.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-commonio.lo -MD -MP -MF $(DEPDIR)/liblua_la-commonio.Tpo -c -o liblua_la-commonio.lo `test -f 'shadow/commonio.c' || echo '$(srcdir)/'`shadow/commonio.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-commonio.Tpo $(DEPDIR)/liblua_la-commonio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shadow/commonio.c' object='liblua_la-commonio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-commonio.lo `test -f 'shadow/commonio.c' || echo '$(srcdir)/'`shadow/commonio.c + +liblua_la-copydir.lo: shadow/copydir.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-copydir.lo -MD -MP -MF $(DEPDIR)/liblua_la-copydir.Tpo -c -o liblua_la-copydir.lo `test -f 'shadow/copydir.c' || echo '$(srcdir)/'`shadow/copydir.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-copydir.Tpo $(DEPDIR)/liblua_la-copydir.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shadow/copydir.c' object='liblua_la-copydir.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-copydir.lo `test -f 'shadow/copydir.c' || echo '$(srcdir)/'`shadow/copydir.c + +liblua_la-fputsx.lo: shadow/fputsx.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-fputsx.lo -MD -MP -MF $(DEPDIR)/liblua_la-fputsx.Tpo -c -o liblua_la-fputsx.lo `test -f 'shadow/fputsx.c' || echo '$(srcdir)/'`shadow/fputsx.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-fputsx.Tpo $(DEPDIR)/liblua_la-fputsx.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shadow/fputsx.c' object='liblua_la-fputsx.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-fputsx.lo `test -f 'shadow/fputsx.c' || echo '$(srcdir)/'`shadow/fputsx.c + +liblua_la-getdef.lo: shadow/getdef.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-getdef.lo -MD -MP -MF $(DEPDIR)/liblua_la-getdef.Tpo -c -o liblua_la-getdef.lo `test -f 'shadow/getdef.c' || echo '$(srcdir)/'`shadow/getdef.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-getdef.Tpo $(DEPDIR)/liblua_la-getdef.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shadow/getdef.c' object='liblua_la-getdef.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-getdef.lo `test -f 'shadow/getdef.c' || echo '$(srcdir)/'`shadow/getdef.c + +liblua_la-groupadd.lo: shadow/groupadd.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-groupadd.lo -MD -MP -MF $(DEPDIR)/liblua_la-groupadd.Tpo -c -o liblua_la-groupadd.lo `test -f 'shadow/groupadd.c' || echo '$(srcdir)/'`shadow/groupadd.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-groupadd.Tpo $(DEPDIR)/liblua_la-groupadd.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shadow/groupadd.c' object='liblua_la-groupadd.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-groupadd.lo `test -f 'shadow/groupadd.c' || echo '$(srcdir)/'`shadow/groupadd.c + +liblua_la-groupio.lo: shadow/groupio.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-groupio.lo -MD -MP -MF $(DEPDIR)/liblua_la-groupio.Tpo -c -o liblua_la-groupio.lo `test -f 'shadow/groupio.c' || echo '$(srcdir)/'`shadow/groupio.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-groupio.Tpo $(DEPDIR)/liblua_la-groupio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shadow/groupio.c' object='liblua_la-groupio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-groupio.lo `test -f 'shadow/groupio.c' || echo '$(srcdir)/'`shadow/groupio.c + +liblua_la-gshadow.lo: shadow/gshadow.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-gshadow.lo -MD -MP -MF $(DEPDIR)/liblua_la-gshadow.Tpo -c -o liblua_la-gshadow.lo `test -f 'shadow/gshadow.c' || echo '$(srcdir)/'`shadow/gshadow.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-gshadow.Tpo $(DEPDIR)/liblua_la-gshadow.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shadow/gshadow.c' object='liblua_la-gshadow.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-gshadow.lo `test -f 'shadow/gshadow.c' || echo '$(srcdir)/'`shadow/gshadow.c + +liblua_la-list.lo: shadow/list.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-list.lo -MD -MP -MF $(DEPDIR)/liblua_la-list.Tpo -c -o liblua_la-list.lo `test -f 'shadow/list.c' || echo '$(srcdir)/'`shadow/list.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-list.Tpo $(DEPDIR)/liblua_la-list.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shadow/list.c' object='liblua_la-list.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-list.lo `test -f 'shadow/list.c' || echo '$(srcdir)/'`shadow/list.c + +liblua_la-pwio.lo: shadow/pwio.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-pwio.lo -MD -MP -MF $(DEPDIR)/liblua_la-pwio.Tpo -c -o liblua_la-pwio.lo `test -f 'shadow/pwio.c' || echo '$(srcdir)/'`shadow/pwio.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-pwio.Tpo $(DEPDIR)/liblua_la-pwio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shadow/pwio.c' object='liblua_la-pwio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-pwio.lo `test -f 'shadow/pwio.c' || echo '$(srcdir)/'`shadow/pwio.c + +liblua_la-sgroupio.lo: shadow/sgroupio.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-sgroupio.lo -MD -MP -MF $(DEPDIR)/liblua_la-sgroupio.Tpo -c -o liblua_la-sgroupio.lo `test -f 'shadow/sgroupio.c' || echo '$(srcdir)/'`shadow/sgroupio.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-sgroupio.Tpo $(DEPDIR)/liblua_la-sgroupio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shadow/sgroupio.c' object='liblua_la-sgroupio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-sgroupio.lo `test -f 'shadow/sgroupio.c' || echo '$(srcdir)/'`shadow/sgroupio.c + +liblua_la-sgetgrent.lo: shadow/sgetgrent.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-sgetgrent.lo -MD -MP -MF $(DEPDIR)/liblua_la-sgetgrent.Tpo -c -o liblua_la-sgetgrent.lo `test -f 'shadow/sgetgrent.c' || echo '$(srcdir)/'`shadow/sgetgrent.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-sgetgrent.Tpo $(DEPDIR)/liblua_la-sgetgrent.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shadow/sgetgrent.c' object='liblua_la-sgetgrent.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-sgetgrent.lo `test -f 'shadow/sgetgrent.c' || echo '$(srcdir)/'`shadow/sgetgrent.c + +liblua_la-sgetpwent.lo: shadow/sgetpwent.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-sgetpwent.lo -MD -MP -MF $(DEPDIR)/liblua_la-sgetpwent.Tpo -c -o liblua_la-sgetpwent.lo `test -f 'shadow/sgetpwent.c' || echo '$(srcdir)/'`shadow/sgetpwent.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-sgetpwent.Tpo $(DEPDIR)/liblua_la-sgetpwent.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shadow/sgetpwent.c' object='liblua_la-sgetpwent.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-sgetpwent.lo `test -f 'shadow/sgetpwent.c' || echo '$(srcdir)/'`shadow/sgetpwent.c + +liblua_la-shadowio.lo: shadow/shadowio.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-shadowio.lo -MD -MP -MF $(DEPDIR)/liblua_la-shadowio.Tpo -c -o liblua_la-shadowio.lo `test -f 'shadow/shadowio.c' || echo '$(srcdir)/'`shadow/shadowio.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-shadowio.Tpo $(DEPDIR)/liblua_la-shadowio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shadow/shadowio.c' object='liblua_la-shadowio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-shadowio.lo `test -f 'shadow/shadowio.c' || echo '$(srcdir)/'`shadow/shadowio.c + +liblua_la-strtoday.lo: shadow/strtoday.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-strtoday.lo -MD -MP -MF $(DEPDIR)/liblua_la-strtoday.Tpo -c -o liblua_la-strtoday.lo `test -f 'shadow/strtoday.c' || echo '$(srcdir)/'`shadow/strtoday.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-strtoday.Tpo $(DEPDIR)/liblua_la-strtoday.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shadow/strtoday.c' object='liblua_la-strtoday.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-strtoday.lo `test -f 'shadow/strtoday.c' || echo '$(srcdir)/'`shadow/strtoday.c + +liblua_la-useradd.lo: shadow/useradd.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-useradd.lo -MD -MP -MF $(DEPDIR)/liblua_la-useradd.Tpo -c -o liblua_la-useradd.lo `test -f 'shadow/useradd.c' || echo '$(srcdir)/'`shadow/useradd.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-useradd.Tpo $(DEPDIR)/liblua_la-useradd.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shadow/useradd.c' object='liblua_la-useradd.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-useradd.lo `test -f 'shadow/useradd.c' || echo '$(srcdir)/'`shadow/useradd.c + +liblua_la-chkconfig.lo: chkconfig/chkconfig.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-chkconfig.lo -MD -MP -MF $(DEPDIR)/liblua_la-chkconfig.Tpo -c -o liblua_la-chkconfig.lo `test -f 'chkconfig/chkconfig.c' || echo '$(srcdir)/'`chkconfig/chkconfig.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-chkconfig.Tpo $(DEPDIR)/liblua_la-chkconfig.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='chkconfig/chkconfig.c' object='liblua_la-chkconfig.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-chkconfig.lo `test -f 'chkconfig/chkconfig.c' || echo '$(srcdir)/'`chkconfig/chkconfig.c + +liblua_la-leveldb.lo: chkconfig/leveldb.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-leveldb.lo -MD -MP -MF $(DEPDIR)/liblua_la-leveldb.Tpo -c -o liblua_la-leveldb.lo `test -f 'chkconfig/leveldb.c' || echo '$(srcdir)/'`chkconfig/leveldb.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-leveldb.Tpo $(DEPDIR)/liblua_la-leveldb.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='chkconfig/leveldb.c' object='liblua_la-leveldb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-leveldb.lo `test -f 'chkconfig/leveldb.c' || echo '$(srcdir)/'`chkconfig/leveldb.c + +liblua_la-llocal.lo: local/llocal.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-llocal.lo -MD -MP -MF $(DEPDIR)/liblua_la-llocal.Tpo -c -o liblua_la-llocal.lo `test -f 'local/llocal.c' || echo '$(srcdir)/'`local/llocal.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-llocal.Tpo $(DEPDIR)/liblua_la-llocal.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='local/llocal.c' object='liblua_la-llocal.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-llocal.lo `test -f 'local/llocal.c' || echo '$(srcdir)/'`local/llocal.c + +liblua_la-lposix.lo: local/lposix.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lposix.lo -MD -MP -MF $(DEPDIR)/liblua_la-lposix.Tpo -c -o liblua_la-lposix.lo `test -f 'local/lposix.c' || echo '$(srcdir)/'`local/lposix.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lposix.Tpo $(DEPDIR)/liblua_la-lposix.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='local/lposix.c' object='liblua_la-lposix.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lposix.lo `test -f 'local/lposix.c' || echo '$(srcdir)/'`local/lposix.c + +liblua_la-lrexlib_common.lo: local/lrexlib_common.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lrexlib_common.lo -MD -MP -MF $(DEPDIR)/liblua_la-lrexlib_common.Tpo -c -o liblua_la-lrexlib_common.lo `test -f 'local/lrexlib_common.c' || echo '$(srcdir)/'`local/lrexlib_common.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lrexlib_common.Tpo $(DEPDIR)/liblua_la-lrexlib_common.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='local/lrexlib_common.c' object='liblua_la-lrexlib_common.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lrexlib_common.lo `test -f 'local/lrexlib_common.c' || echo '$(srcdir)/'`local/lrexlib_common.c + +liblua_la-lrexlib_lpcre.lo: local/lrexlib_lpcre.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lrexlib_lpcre.lo -MD -MP -MF $(DEPDIR)/liblua_la-lrexlib_lpcre.Tpo -c -o liblua_la-lrexlib_lpcre.lo `test -f 'local/lrexlib_lpcre.c' || echo '$(srcdir)/'`local/lrexlib_lpcre.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lrexlib_lpcre.Tpo $(DEPDIR)/liblua_la-lrexlib_lpcre.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='local/lrexlib_lpcre.c' object='liblua_la-lrexlib_lpcre.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lrexlib_lpcre.lo `test -f 'local/lrexlib_lpcre.c' || echo '$(srcdir)/'`local/lrexlib_lpcre.c + +liblua_la-lrexlib_lpcre_f.lo: local/lrexlib_lpcre_f.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lrexlib_lpcre_f.lo -MD -MP -MF $(DEPDIR)/liblua_la-lrexlib_lpcre_f.Tpo -c -o liblua_la-lrexlib_lpcre_f.lo `test -f 'local/lrexlib_lpcre_f.c' || echo '$(srcdir)/'`local/lrexlib_lpcre_f.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lrexlib_lpcre_f.Tpo $(DEPDIR)/liblua_la-lrexlib_lpcre_f.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='local/lrexlib_lpcre_f.c' object='liblua_la-lrexlib_lpcre_f.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lrexlib_lpcre_f.lo `test -f 'local/lrexlib_lpcre_f.c' || echo '$(srcdir)/'`local/lrexlib_lpcre_f.c + +liblua_la-lrexlib_lposix.lo: local/lrexlib_lposix.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lrexlib_lposix.lo -MD -MP -MF $(DEPDIR)/liblua_la-lrexlib_lposix.Tpo -c -o liblua_la-lrexlib_lposix.lo `test -f 'local/lrexlib_lposix.c' || echo '$(srcdir)/'`local/lrexlib_lposix.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lrexlib_lposix.Tpo $(DEPDIR)/liblua_la-lrexlib_lposix.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='local/lrexlib_lposix.c' object='liblua_la-lrexlib_lposix.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lrexlib_lposix.lo `test -f 'local/lrexlib_lposix.c' || echo '$(srcdir)/'`local/lrexlib_lposix.c + +liblua_la-lshadow.lo: local/lshadow.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lshadow.lo -MD -MP -MF $(DEPDIR)/liblua_la-lshadow.Tpo -c -o liblua_la-lshadow.lo `test -f 'local/lshadow.c' || echo '$(srcdir)/'`local/lshadow.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lshadow.Tpo $(DEPDIR)/liblua_la-lshadow.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='local/lshadow.c' object='liblua_la-lshadow.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lshadow.lo `test -f 'local/lshadow.c' || echo '$(srcdir)/'`local/lshadow.c + +liblua_la-luuid.lo: local/luuid.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-luuid.lo -MD -MP -MF $(DEPDIR)/liblua_la-luuid.Tpo -c -o liblua_la-luuid.lo `test -f 'local/luuid.c' || echo '$(srcdir)/'`local/luuid.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-luuid.Tpo $(DEPDIR)/liblua_la-luuid.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='local/luuid.c' object='liblua_la-luuid.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-luuid.lo `test -f 'local/luuid.c' || echo '$(srcdir)/'`local/luuid.c + +liblua_la-lwrs.lo: local/lwrs.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lwrs.lo -MD -MP -MF $(DEPDIR)/liblua_la-lwrs.Tpo -c -o liblua_la-lwrs.lo `test -f 'local/lwrs.c' || echo '$(srcdir)/'`local/lwrs.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lwrs.Tpo $(DEPDIR)/liblua_la-lwrs.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='local/lwrs.c' object='liblua_la-lwrs.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lwrs.lo `test -f 'local/lwrs.c' || echo '$(srcdir)/'`local/lwrs.c + +liblua_la-linit.lo: linit.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-linit.lo -MD -MP -MF $(DEPDIR)/liblua_la-linit.Tpo -c -o liblua_la-linit.lo `test -f 'linit.c' || echo '$(srcdir)/'`linit.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-linit.Tpo $(DEPDIR)/liblua_la-linit.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='linit.c' object='liblua_la-linit.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-linit.lo `test -f 'linit.c' || echo '$(srcdir)/'`linit.c + +liblua_la-lauxlib.lo: lauxlib.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lauxlib.lo -MD -MP -MF $(DEPDIR)/liblua_la-lauxlib.Tpo -c -o liblua_la-lauxlib.lo `test -f 'lauxlib.c' || echo '$(srcdir)/'`lauxlib.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lauxlib.Tpo $(DEPDIR)/liblua_la-lauxlib.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lauxlib.c' object='liblua_la-lauxlib.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lauxlib.lo `test -f 'lauxlib.c' || echo '$(srcdir)/'`lauxlib.c + +liblua_la-lbaselib.lo: lbaselib.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lbaselib.lo -MD -MP -MF $(DEPDIR)/liblua_la-lbaselib.Tpo -c -o liblua_la-lbaselib.lo `test -f 'lbaselib.c' || echo '$(srcdir)/'`lbaselib.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lbaselib.Tpo $(DEPDIR)/liblua_la-lbaselib.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lbaselib.c' object='liblua_la-lbaselib.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lbaselib.lo `test -f 'lbaselib.c' || echo '$(srcdir)/'`lbaselib.c + +liblua_la-ldblib.lo: ldblib.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-ldblib.lo -MD -MP -MF $(DEPDIR)/liblua_la-ldblib.Tpo -c -o liblua_la-ldblib.lo `test -f 'ldblib.c' || echo '$(srcdir)/'`ldblib.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-ldblib.Tpo $(DEPDIR)/liblua_la-ldblib.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ldblib.c' object='liblua_la-ldblib.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-ldblib.lo `test -f 'ldblib.c' || echo '$(srcdir)/'`ldblib.c + +liblua_la-liolib.lo: liolib.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-liolib.lo -MD -MP -MF $(DEPDIR)/liblua_la-liolib.Tpo -c -o liblua_la-liolib.lo `test -f 'liolib.c' || echo '$(srcdir)/'`liolib.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-liolib.Tpo $(DEPDIR)/liblua_la-liolib.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='liolib.c' object='liblua_la-liolib.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-liolib.lo `test -f 'liolib.c' || echo '$(srcdir)/'`liolib.c + +liblua_la-loslib.lo: loslib.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-loslib.lo -MD -MP -MF $(DEPDIR)/liblua_la-loslib.Tpo -c -o liblua_la-loslib.lo `test -f 'loslib.c' || echo '$(srcdir)/'`loslib.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-loslib.Tpo $(DEPDIR)/liblua_la-loslib.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loslib.c' object='liblua_la-loslib.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-loslib.lo `test -f 'loslib.c' || echo '$(srcdir)/'`loslib.c + +liblua_la-lmathlib.lo: lmathlib.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lmathlib.lo -MD -MP -MF $(DEPDIR)/liblua_la-lmathlib.Tpo -c -o liblua_la-lmathlib.lo `test -f 'lmathlib.c' || echo '$(srcdir)/'`lmathlib.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lmathlib.Tpo $(DEPDIR)/liblua_la-lmathlib.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lmathlib.c' object='liblua_la-lmathlib.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lmathlib.lo `test -f 'lmathlib.c' || echo '$(srcdir)/'`lmathlib.c + +liblua_la-loadlib.lo: loadlib.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-loadlib.lo -MD -MP -MF $(DEPDIR)/liblua_la-loadlib.Tpo -c -o liblua_la-loadlib.lo `test -f 'loadlib.c' || echo '$(srcdir)/'`loadlib.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-loadlib.Tpo $(DEPDIR)/liblua_la-loadlib.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loadlib.c' object='liblua_la-loadlib.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-loadlib.lo `test -f 'loadlib.c' || echo '$(srcdir)/'`loadlib.c + +liblua_la-lstrlib.lo: lstrlib.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lstrlib.lo -MD -MP -MF $(DEPDIR)/liblua_la-lstrlib.Tpo -c -o liblua_la-lstrlib.lo `test -f 'lstrlib.c' || echo '$(srcdir)/'`lstrlib.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lstrlib.Tpo $(DEPDIR)/liblua_la-lstrlib.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lstrlib.c' object='liblua_la-lstrlib.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lstrlib.lo `test -f 'lstrlib.c' || echo '$(srcdir)/'`lstrlib.c + +liblua_la-ltablib.lo: ltablib.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-ltablib.lo -MD -MP -MF $(DEPDIR)/liblua_la-ltablib.Tpo -c -o liblua_la-ltablib.lo `test -f 'ltablib.c' || echo '$(srcdir)/'`ltablib.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-ltablib.Tpo $(DEPDIR)/liblua_la-ltablib.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ltablib.c' object='liblua_la-ltablib.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-ltablib.lo `test -f 'ltablib.c' || echo '$(srcdir)/'`ltablib.c + +liblua_la-lapi.lo: lapi.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lapi.lo -MD -MP -MF $(DEPDIR)/liblua_la-lapi.Tpo -c -o liblua_la-lapi.lo `test -f 'lapi.c' || echo '$(srcdir)/'`lapi.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lapi.Tpo $(DEPDIR)/liblua_la-lapi.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lapi.c' object='liblua_la-lapi.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lapi.lo `test -f 'lapi.c' || echo '$(srcdir)/'`lapi.c + +liblua_la-lcode.lo: lcode.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lcode.lo -MD -MP -MF $(DEPDIR)/liblua_la-lcode.Tpo -c -o liblua_la-lcode.lo `test -f 'lcode.c' || echo '$(srcdir)/'`lcode.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lcode.Tpo $(DEPDIR)/liblua_la-lcode.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lcode.c' object='liblua_la-lcode.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lcode.lo `test -f 'lcode.c' || echo '$(srcdir)/'`lcode.c + +liblua_la-ldebug.lo: ldebug.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-ldebug.lo -MD -MP -MF $(DEPDIR)/liblua_la-ldebug.Tpo -c -o liblua_la-ldebug.lo `test -f 'ldebug.c' || echo '$(srcdir)/'`ldebug.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-ldebug.Tpo $(DEPDIR)/liblua_la-ldebug.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ldebug.c' object='liblua_la-ldebug.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-ldebug.lo `test -f 'ldebug.c' || echo '$(srcdir)/'`ldebug.c + +liblua_la-ldo.lo: ldo.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-ldo.lo -MD -MP -MF $(DEPDIR)/liblua_la-ldo.Tpo -c -o liblua_la-ldo.lo `test -f 'ldo.c' || echo '$(srcdir)/'`ldo.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-ldo.Tpo $(DEPDIR)/liblua_la-ldo.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ldo.c' object='liblua_la-ldo.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-ldo.lo `test -f 'ldo.c' || echo '$(srcdir)/'`ldo.c + +liblua_la-ldump.lo: ldump.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-ldump.lo -MD -MP -MF $(DEPDIR)/liblua_la-ldump.Tpo -c -o liblua_la-ldump.lo `test -f 'ldump.c' || echo '$(srcdir)/'`ldump.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-ldump.Tpo $(DEPDIR)/liblua_la-ldump.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ldump.c' object='liblua_la-ldump.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-ldump.lo `test -f 'ldump.c' || echo '$(srcdir)/'`ldump.c + +liblua_la-lfunc.lo: lfunc.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lfunc.lo -MD -MP -MF $(DEPDIR)/liblua_la-lfunc.Tpo -c -o liblua_la-lfunc.lo `test -f 'lfunc.c' || echo '$(srcdir)/'`lfunc.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lfunc.Tpo $(DEPDIR)/liblua_la-lfunc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lfunc.c' object='liblua_la-lfunc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lfunc.lo `test -f 'lfunc.c' || echo '$(srcdir)/'`lfunc.c + +liblua_la-lgc.lo: lgc.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lgc.lo -MD -MP -MF $(DEPDIR)/liblua_la-lgc.Tpo -c -o liblua_la-lgc.lo `test -f 'lgc.c' || echo '$(srcdir)/'`lgc.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lgc.Tpo $(DEPDIR)/liblua_la-lgc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lgc.c' object='liblua_la-lgc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lgc.lo `test -f 'lgc.c' || echo '$(srcdir)/'`lgc.c + +liblua_la-llex.lo: llex.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-llex.lo -MD -MP -MF $(DEPDIR)/liblua_la-llex.Tpo -c -o liblua_la-llex.lo `test -f 'llex.c' || echo '$(srcdir)/'`llex.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-llex.Tpo $(DEPDIR)/liblua_la-llex.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='llex.c' object='liblua_la-llex.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-llex.lo `test -f 'llex.c' || echo '$(srcdir)/'`llex.c + +liblua_la-lmem.lo: lmem.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lmem.lo -MD -MP -MF $(DEPDIR)/liblua_la-lmem.Tpo -c -o liblua_la-lmem.lo `test -f 'lmem.c' || echo '$(srcdir)/'`lmem.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lmem.Tpo $(DEPDIR)/liblua_la-lmem.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lmem.c' object='liblua_la-lmem.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lmem.lo `test -f 'lmem.c' || echo '$(srcdir)/'`lmem.c + +liblua_la-lobject.lo: lobject.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lobject.lo -MD -MP -MF $(DEPDIR)/liblua_la-lobject.Tpo -c -o liblua_la-lobject.lo `test -f 'lobject.c' || echo '$(srcdir)/'`lobject.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lobject.Tpo $(DEPDIR)/liblua_la-lobject.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lobject.c' object='liblua_la-lobject.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lobject.lo `test -f 'lobject.c' || echo '$(srcdir)/'`lobject.c + +liblua_la-lopcodes.lo: lopcodes.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lopcodes.lo -MD -MP -MF $(DEPDIR)/liblua_la-lopcodes.Tpo -c -o liblua_la-lopcodes.lo `test -f 'lopcodes.c' || echo '$(srcdir)/'`lopcodes.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lopcodes.Tpo $(DEPDIR)/liblua_la-lopcodes.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lopcodes.c' object='liblua_la-lopcodes.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lopcodes.lo `test -f 'lopcodes.c' || echo '$(srcdir)/'`lopcodes.c + +liblua_la-lparser.lo: lparser.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lparser.lo -MD -MP -MF $(DEPDIR)/liblua_la-lparser.Tpo -c -o liblua_la-lparser.lo `test -f 'lparser.c' || echo '$(srcdir)/'`lparser.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lparser.Tpo $(DEPDIR)/liblua_la-lparser.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lparser.c' object='liblua_la-lparser.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lparser.lo `test -f 'lparser.c' || echo '$(srcdir)/'`lparser.c + +liblua_la-lstate.lo: lstate.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lstate.lo -MD -MP -MF $(DEPDIR)/liblua_la-lstate.Tpo -c -o liblua_la-lstate.lo `test -f 'lstate.c' || echo '$(srcdir)/'`lstate.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lstate.Tpo $(DEPDIR)/liblua_la-lstate.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lstate.c' object='liblua_la-lstate.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lstate.lo `test -f 'lstate.c' || echo '$(srcdir)/'`lstate.c + +liblua_la-lstring.lo: lstring.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lstring.lo -MD -MP -MF $(DEPDIR)/liblua_la-lstring.Tpo -c -o liblua_la-lstring.lo `test -f 'lstring.c' || echo '$(srcdir)/'`lstring.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lstring.Tpo $(DEPDIR)/liblua_la-lstring.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lstring.c' object='liblua_la-lstring.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lstring.lo `test -f 'lstring.c' || echo '$(srcdir)/'`lstring.c + +liblua_la-ltable.lo: ltable.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-ltable.lo -MD -MP -MF $(DEPDIR)/liblua_la-ltable.Tpo -c -o liblua_la-ltable.lo `test -f 'ltable.c' || echo '$(srcdir)/'`ltable.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-ltable.Tpo $(DEPDIR)/liblua_la-ltable.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ltable.c' object='liblua_la-ltable.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-ltable.lo `test -f 'ltable.c' || echo '$(srcdir)/'`ltable.c + +liblua_la-ltests.lo: ltests.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-ltests.lo -MD -MP -MF $(DEPDIR)/liblua_la-ltests.Tpo -c -o liblua_la-ltests.lo `test -f 'ltests.c' || echo '$(srcdir)/'`ltests.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-ltests.Tpo $(DEPDIR)/liblua_la-ltests.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ltests.c' object='liblua_la-ltests.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-ltests.lo `test -f 'ltests.c' || echo '$(srcdir)/'`ltests.c + +liblua_la-ltm.lo: ltm.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-ltm.lo -MD -MP -MF $(DEPDIR)/liblua_la-ltm.Tpo -c -o liblua_la-ltm.lo `test -f 'ltm.c' || echo '$(srcdir)/'`ltm.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-ltm.Tpo $(DEPDIR)/liblua_la-ltm.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ltm.c' object='liblua_la-ltm.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-ltm.lo `test -f 'ltm.c' || echo '$(srcdir)/'`ltm.c + +liblua_la-lundump.lo: lundump.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lundump.lo -MD -MP -MF $(DEPDIR)/liblua_la-lundump.Tpo -c -o liblua_la-lundump.lo `test -f 'lundump.c' || echo '$(srcdir)/'`lundump.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lundump.Tpo $(DEPDIR)/liblua_la-lundump.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lundump.c' object='liblua_la-lundump.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lundump.lo `test -f 'lundump.c' || echo '$(srcdir)/'`lundump.c + +liblua_la-lvm.lo: lvm.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lvm.lo -MD -MP -MF $(DEPDIR)/liblua_la-lvm.Tpo -c -o liblua_la-lvm.lo `test -f 'lvm.c' || echo '$(srcdir)/'`lvm.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lvm.Tpo $(DEPDIR)/liblua_la-lvm.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lvm.c' object='liblua_la-lvm.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lvm.lo `test -f 'lvm.c' || echo '$(srcdir)/'`lvm.c + +liblua_la-lzio.lo: lzio.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -MT liblua_la-lzio.lo -MD -MP -MF $(DEPDIR)/liblua_la-lzio.Tpo -c -o liblua_la-lzio.lo `test -f 'lzio.c' || echo '$(srcdir)/'`lzio.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblua_la-lzio.Tpo $(DEPDIR)/liblua_la-lzio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lzio.c' object='liblua_la-lzio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblua_la_CFLAGS) $(CFLAGS) -c -o liblua_la-lzio.lo `test -f 'lzio.c' || echo '$(srcdir)/'`lzio.c + +rpmlua-lua.o: lua.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmlua_CFLAGS) $(CFLAGS) -MT rpmlua-lua.o -MD -MP -MF $(DEPDIR)/rpmlua-lua.Tpo -c -o rpmlua-lua.o `test -f 'lua.c' || echo '$(srcdir)/'`lua.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmlua-lua.Tpo $(DEPDIR)/rpmlua-lua.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lua.c' object='rpmlua-lua.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmlua_CFLAGS) $(CFLAGS) -c -o rpmlua-lua.o `test -f 'lua.c' || echo '$(srcdir)/'`lua.c + +rpmlua-lua.obj: lua.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmlua_CFLAGS) $(CFLAGS) -MT rpmlua-lua.obj -MD -MP -MF $(DEPDIR)/rpmlua-lua.Tpo -c -o rpmlua-lua.obj `if test -f 'lua.c'; then $(CYGPATH_W) 'lua.c'; else $(CYGPATH_W) '$(srcdir)/lua.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmlua-lua.Tpo $(DEPDIR)/rpmlua-lua.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lua.c' object='rpmlua-lua.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmlua_CFLAGS) $(CFLAGS) -c -o rpmlua-lua.obj `if test -f 'lua.c'; then $(CYGPATH_W) 'lua.c'; else $(CYGPATH_W) '$(srcdir)/lua.c'; fi` + +rpmluac-luac.o: luac.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmluac_CFLAGS) $(CFLAGS) -MT rpmluac-luac.o -MD -MP -MF $(DEPDIR)/rpmluac-luac.Tpo -c -o rpmluac-luac.o `test -f 'luac.c' || echo '$(srcdir)/'`luac.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmluac-luac.Tpo $(DEPDIR)/rpmluac-luac.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='luac.c' object='rpmluac-luac.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmluac_CFLAGS) $(CFLAGS) -c -o rpmluac-luac.o `test -f 'luac.c' || echo '$(srcdir)/'`luac.c + +rpmluac-luac.obj: luac.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmluac_CFLAGS) $(CFLAGS) -MT rpmluac-luac.obj -MD -MP -MF $(DEPDIR)/rpmluac-luac.Tpo -c -o rpmluac-luac.obj `if test -f 'luac.c'; then $(CYGPATH_W) 'luac.c'; else $(CYGPATH_W) '$(srcdir)/luac.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmluac-luac.Tpo $(DEPDIR)/rpmluac-luac.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='luac.c' object='rpmluac-luac.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmluac_CFLAGS) $(CFLAGS) -c -o rpmluac-luac.obj `if test -f 'luac.c'; then $(CYGPATH_W) 'luac.c'; else $(CYGPATH_W) '$(srcdir)/luac.c'; fi` + +rpmluac-print.o: print.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmluac_CFLAGS) $(CFLAGS) -MT rpmluac-print.o -MD -MP -MF $(DEPDIR)/rpmluac-print.Tpo -c -o rpmluac-print.o `test -f 'print.c' || echo '$(srcdir)/'`print.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmluac-print.Tpo $(DEPDIR)/rpmluac-print.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='print.c' object='rpmluac-print.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmluac_CFLAGS) $(CFLAGS) -c -o rpmluac-print.o `test -f 'print.c' || echo '$(srcdir)/'`print.c + +rpmluac-print.obj: print.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmluac_CFLAGS) $(CFLAGS) -MT rpmluac-print.obj -MD -MP -MF $(DEPDIR)/rpmluac-print.Tpo -c -o rpmluac-print.obj `if test -f 'print.c'; then $(CYGPATH_W) 'print.c'; else $(CYGPATH_W) '$(srcdir)/print.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rpmluac-print.Tpo $(DEPDIR)/rpmluac-print.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='print.c' object='rpmluac-print.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpmluac_CFLAGS) $(CFLAGS) -c -o rpmluac-print.obj `if test -f 'print.c'; then $(CYGPATH_W) 'print.c'; else $(CYGPATH_W) '$(srcdir)/print.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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 +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(pkgbindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-local clean-noinstPROGRAMS \ + clean-pkgbinPROGRAMS clean-pkglibLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-pkgbinPROGRAMS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-pkglibLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkgbinPROGRAMS uninstall-pkglibLTLIBRARIES + +.MAKE: install-am install-exec-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-local clean-noinstPROGRAMS \ + clean-pkgbinPROGRAMS clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-exec-hook \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-pkgbinPROGRAMS \ + install-pkglibLTLIBRARIES install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-pkgbinPROGRAMS uninstall-pkglibLTLIBRARIES + + +# --- bin2c doesn't need anything but a compiler +bin2c$(EXEEXT): bin2c.c + $(CC) -o $@ $< +liblua.la: $(liblua_la_OBJECTS) $(liblua_la_DEPENDENCIES) + $(liblua_la_LINK) $(liblua_la_OBJECTS) $(liblua_la_LIBADD) + -ln -sf ../liblua.la .libs/liblua.lai #XXX HACK ALERT + +$(builddir)/local/llocal.c: $(builddir)/local/llocal_lua.c + +@USE_LUA_CRYPTO_TRUE@$(builddir)/local/llocal_lua.c: $(builddir)/bin2c $(srcdir)/local/llocal.lua $(srcdir)/local/lom.lua +@USE_LUA_CRYPTO_TRUE@ mkdir -p $(builddir)/local +@USE_LUA_CRYPTO_TRUE@ $(builddir)/bin2c $(srcdir)/local/llocal.lua $(srcdir)/local/lom.lua > $(builddir)/local/llocal_lua.c +@USE_LUA_CRYPTO_FALSE@$(builddir)/local/llocal_lua.c: $(builddir)/bin2c $(srcdir)/local/llocal.lua +@USE_LUA_CRYPTO_FALSE@ mkdir -p $(builddir)/local +@USE_LUA_CRYPTO_FALSE@ $(builddir)/bin2c $(srcdir)/local/llocal.lua > $(builddir)/local/llocal_lua.c + +clean-local: + -rm -f $(builddir)/local/llocal_lua.c + +# XXX Build & install as rpmlua/rpmluac with hardlinks to lua/luac post install. +# XXX CVS has lua/luac sub-directories in the Attic that collide with the +# XXX lua/luac executable names when using cvs update. +install-exec-hook: install-pkgbinPROGRAMS + mkdir -p $(DESTDIR)$(pkgbindir) + $(__RM) -f $(DESTDIR)$(pkgbindir)/lua + $(__LN) $(DESTDIR)$(pkgbindir)/rpmlua $(DESTDIR)$(pkgbindir)/lua + $(__RM) -f $(DESTDIR)$(pkgbindir)/luac + $(__LN) $(DESTDIR)$(pkgbindir)/rpmluac $(DESTDIR)$(pkgbindir)/luac + +# 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/rpm-5.4.9/lua/README b/rpm-5.4.9/lua/README new file mode 100644 index 0000000..11b4dff --- /dev/null +++ b/rpm-5.4.9/lua/README @@ -0,0 +1,37 @@ +README for Lua 5.1 + +See INSTALL for installation instructions. +See HISTORY for a summary of changes since the last released version. + +* What is Lua? + ------------ + Lua is a powerful, light-weight programming language designed for extending + applications. Lua is also frequently used as a general-purpose, stand-alone + language. Lua is free software. + + For complete information, visit Lua's web site at http://www.lua.org/ . + For an executive summary, see http://www.lua.org/about.html . + + Lua has been used in many different projects around the world. + For a short list, see http://www.lua.org/uses.html . + +* Availability + ------------ + Lua is freely available for both academic and commercial purposes. + See COPYRIGHT and http://www.lua.org/license.html for details. + Lua can be downloaded at http://www.lua.org/download.html . + +* Installation + ------------ + Lua is implemented in pure ANSI C, and compiles unmodified in all known + platforms that have an ANSI C compiler. In most Unix-like platforms, simply + do "make" with a suitable target. See INSTALL for detailed instructions. + +* Origin + ------ + Lua is developed at Lua.org, a laboratory of the Department of Computer + Science of PUC-Rio (the Pontifical Catholic University of Rio de Janeiro + in Brazil). + For more information about the authors, see http://www.lua.org/authors.html . + +(end of README) diff --git a/rpm-5.4.9/lua/bin2c.c b/rpm-5.4.9/lua/bin2c.c new file mode 100644 index 0000000..1c1e25f --- /dev/null +++ b/rpm-5.4.9/lua/bin2c.c @@ -0,0 +1,75 @@ +/* +* bin2c.c +* convert files to byte arrays for automatic loading +* Luiz Henrique de Figueiredo (lhf@tecgraf.puc-rio.br) +* Fixed to Lua 5.1. Antonio Scuri (scuri@tecgraf.puc-rio.br) +* Generated files will work also for Lua 5.0 +* 08 Dec 2005 +*/ + +#include +#include +#include + +static void dump(FILE* f, int n) +{ + printf("static const unsigned char B%d[]={\n",n); + for (n=1;;n++) + { + int c=getc(f); + if (c==EOF) break; + printf("%3u,",c); + if (n==20) { putchar('\n'); n=0; } + } + printf("\n};\n\n"); +} + +static void fdump(const char* fn, int n) +{ + FILE* f= fopen(fn,"rb"); /* must open in binary mode */ + if (f==NULL) + { + fprintf(stderr,"bin2c: cannot open "); + perror(fn); + exit(1); + } + else + { + printf("/* %s */\n",fn); + dump(f,n); + fclose(f); + } +} + +static void emit(const char* fn, int n) +{ + static int oneshot = 0; + if (!oneshot) { + printf(" int error;\n"); + oneshot++; + } + printf(" error = luaL_loadbuffer(L,(const char*)B%d,sizeof(B%d),\"%s\") || lua_pcall(L, 0, 0, 0);\n", n, n, fn); + printf(" if (error) { fprintf(stderr, \"error: Lua script failed: %%s\", lua_tostring(L, -1)); lua_pop(L, 1); }\n"); +} + +int main(int argc, char* argv[]) +{ + printf("/* code automatically generated by bin2c -- DO NOT EDIT */\n"); + printf("{\n"); + if (argc<2) + { + dump(stdin,0); + emit("=stdin",0); + } + else + { + int i; + printf("/* #include'ing this file in a C program is equivalent to calling\n"); + for (i=1; i +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const char *progname = "rpm:lua:chkconfig"; + +#define _(String) gettext((String)) + +#include "leveldb.h" + +static void usage(void) { +#if 0 + fprintf(stderr, _("%s version %s - Copyright (C) 1997-2000 Red Hat, Inc.\n"), progname, VERSION); +#endif + fprintf(stderr, _("This may be freely redistributed under the terms of " + "the GNU Public License.\n")); + fprintf(stderr, "\n"); + fprintf(stderr, _("usage: %s --list [name]\n"), progname); + fprintf(stderr, _(" %s --add \n"), progname); + fprintf(stderr, _(" %s --del \n"), progname); + fprintf(stderr, _(" %s --override \n"), progname); + fprintf(stderr, _(" %s [--level ] %s\n"), progname, ""); + +} + +static void readServiceError(int rc, char * name) { + if (rc == 2) { + fprintf(stderr, _("service %s supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add %s')\n"), name, name); + } else if (rc == 1) { + fprintf(stderr, _("service %s does not support chkconfig\n"), name); + } else { + fprintf(stderr, _("error reading information on service %s: %s\n"), + name, strerror(errno)); + } + + exit(1); +} + +static int delServiceOne(char *name, int level) { + int i, rc; + glob_t globres; + struct service s; + + if ((rc = readServiceInfo(name, &s, 0))) { + readServiceError(rc, name); + return 1; + } + if (s.type == TYPE_XINETD) return 0; + + + if (!findServiceEntries(name, level, &globres)) { + for (i = 0; i < (int)globres.gl_pathc; i++) + unlink(globres.gl_pathv[i]); + if (globres.gl_pathc) globfree(&globres); + } + return 0; +} + +static int delService(char * name) { + int level, i, rc; + glob_t globres; + struct service s; + + if ((rc = readServiceInfo(name, &s, 0))) { + readServiceError(rc, name); + return 1; + } + if (s.type == TYPE_XINETD) return 0; + + for (level = 0; level < 7; level++) { + if (!findServiceEntries(name, level, &globres)) { + for (i = 0; i < (int)globres.gl_pathc; i++) + unlink(globres.gl_pathv[i]); + if (globres.gl_pathc) globfree(&globres); + } + } + return 0; +} + + +static inline int laterThan(int i, int j) { + if (i <= j) { + i = j+1; + if (i > 99) + i = 99; + } + return i; +} + +static inline int earlierThan(int i, int j) { + if (i >= j) { + i = j -1; + if (i < 0) + i = 0; + } + return i; +} + +static int frobOneDependencies(struct service *s, struct service *servs, int numservs, int target) { + int i, j, k; + int s0 = s->sPriority; + int k0 = s->kPriority; + + if (s->sPriority < 0) s->sPriority = 50; + if (s->kPriority < 0) s->kPriority = 50; + for (i = 0; i < numservs ; i++) { + if (s->startDeps) { + for (j = 0; s->startDeps[j] ; j++) { + if (!strcmp(s->startDeps[j], servs[i].name)) + s->sPriority = laterThan(s->sPriority, servs[i].sPriority); + if (servs[i].provides) { + for (k = 0; servs[i].provides[k]; k++) { + if (!strcmp(s->startDeps[j], servs[i].provides[k])) + s->sPriority = laterThan(s->sPriority, servs[i].sPriority); + } + } + } + } + if (s->stopDeps) { + for (j = 0; s->stopDeps[j] ; j++) { + if (!strcmp(s->stopDeps[j], servs[i].name)) + s->kPriority = earlierThan(s->kPriority, servs[i].kPriority); + if (servs[i].provides) { + for (k = 0; servs[i].provides[k]; k++) { + if (!strcmp(s->stopDeps[j], servs[i].provides[k])) + s->kPriority = earlierThan(s->kPriority, servs[i].kPriority); + } + } + } + } + } + + if (target || ((s0 != s->sPriority) || (k0 != s->kPriority))) { + for (i = 0; i < 7; i++) { + if (isConfigured(s->name, i, NULL, NULL)) { + int on = isOn(s->name, i); + delServiceOne(s->name,i); + doSetService(*s, i, on); + } else if (target) { + delServiceOne(s->name,i); + doSetService(*s, i, ((1<levels)); + } + } + return 1; /* Resolved something */ + } + return 0; /* Didn't resolve anything */ +} + + +/* LSB-style dependency frobber. Calculates a usable start priority + * and stop priority. + * This algorithm will almost certainly break horribly at some point. */ +static void frobDependencies(struct service *s) { + DIR * dir; + struct dirent * ent; + struct stat sb; + struct service *servs = NULL; + int numservs = 0; + char fn[1024]; + int nResolved = 0; + + if (!(dir = opendir(RUNLEVELS "/init.d"))) { + fprintf(stderr, _("failed to open %s/init.d: %s\n"), RUNLEVELS, + strerror(errno)); + return; + } + + while ((ent = readdir(dir))) { + const char *dn; + + /* Skip any file starting with a . */ + if (ent->d_name[0] == '.') continue; + + /* Skip files with known bad extensions */ + if ((dn = strrchr(ent->d_name, '.')) != NULL && + (!strcmp(dn, ".rpmsave") || !strcmp(dn, ".rpmnew") || !strcmp(dn, ".rpmorig") || !strcmp(dn, ".swp"))) + continue; + + dn = ent->d_name + strlen(ent->d_name) - 1; + if (*dn == '~' || *dn == ',') + continue; + + sprintf(fn, RUNLEVELS "/init.d/%s", ent->d_name); + if (stat(fn, &sb)) { + continue; + } + if (!S_ISREG(sb.st_mode)) continue; + if (!strcmp(ent->d_name, s->name)) continue; + servs = (struct service *) realloc(servs, (numservs+1) * sizeof(struct service)); + if (!readServiceInfo(ent->d_name, servs + numservs, 0)) + numservs++; + } + + /* Resolve recursively the other dependancies */ + do { + nResolved = 0; + int i; + + for (i = 0; i < numservs ; i++) { + if ((servs+i)->isLSB) + nResolved += frobOneDependencies(servs+i, servs, numservs, 0); + } + } while (nResolved); + + /* Resolve our target */ + frobOneDependencies(s, servs, numservs, 1); +} + +static int addService(char * name) { + int i, rc; + struct service s; + + if ((rc = readServiceInfo(name, &s, 0))) { + readServiceError(rc, name); + return 1; + } + + if (s.type == TYPE_XINETD) return 0; + if (s.isLSB) + frobDependencies(&s); + else + for (i = 0; i < 7; i++) { + if (!isConfigured(name, i, NULL, NULL)) { + if ((1 << i) & s.levels) + doSetService(s, i, 1); + else + doSetService(s, i, 0); + } + } + + return 0; +} + +static int overrideService(char * name) { + /* Apply overrides if available; no available overrides is no error */ + int level, i, rc; + glob_t globres; + struct service s; + struct service o; + int priority; + char type; + int doChange = 1; + int configured = 0; + int thisLevelAdded, thisLevelOn; + + if ((rc = readServiceDifferences(name, &s, &o, 0))) { + return 0; + } + + if (s.type == TYPE_XINETD) return 0; + + if ((s.levels == o.levels) && + (s.kPriority == o.kPriority) && + (s.sPriority == o.sPriority)) { + /* no relevant changes in the override file */ + return 0; + } + + if (s.isLSB && (s.sPriority <= -1) && (s.kPriority <= -1)) + frobDependencies(&s); + if ((s.isLSB || o.isLSB) && (o.sPriority <= -1) && (o.kPriority <= -1)) + frobDependencies(&o); + + /* Apply overrides only if the service has not been changed since + * being added, and not if the service has never been configured + * at all. + */ + + for (level = 0; level < 7; level++) { + thisLevelAdded = isConfigured(name, level, &priority, &type); + thisLevelOn = s.levels & 1<name, second->name); +} + + + +static int listService(char * item) { + DIR * dir; + struct dirent * ent; + struct stat sb; + char fn[1024]; + char **services; + int i; + int numServices = 0; + int numServicesAlloced; + int err = 0; + + if (item) return showServiceInfo(item, 0); + + numServicesAlloced = 10; + services = (char **) malloc(sizeof(*services) * numServicesAlloced); + + if (!(dir = opendir(RUNLEVELS "/init.d"))) { + fprintf(stderr, _("failed to open %s/init.d: %s\n"), RUNLEVELS, + strerror(errno)); + return 1; + } + + while ((ent = readdir(dir))) { + const char *dn; + + /* Skip any file starting with a . */ + if (ent->d_name[0] == '.') continue; + + /* Skip files with known bad extensions */ + if ((dn = strrchr(ent->d_name, '.')) != NULL && + (!strcmp(dn, ".rpmsave") || !strcmp(dn, ".rpmnew") || !strcmp(dn, ".rpmorig") || !strcmp(dn, ".swp"))) + continue; + + dn = ent->d_name + strlen(ent->d_name) - 1; + if (*dn == '~' || *dn == ',') + continue; + + sprintf(fn, RUNLEVELS "/init.d/%s", ent->d_name); + if (stat(fn, &sb)) { + fprintf(stderr, _("error reading info for service %s: %s\n"), + ent->d_name, strerror(errno)); + continue; + } + if (!S_ISREG(sb.st_mode)) continue; + + if (numServices == numServicesAlloced) { + numServicesAlloced += 10; + services = (char **) realloc(services, numServicesAlloced * sizeof(*services)); + } + + services[numServices] = (char *) alloca(strlen(ent->d_name) + 1); + strncpy(services[numServices++], ent->d_name, strlen(ent->d_name) + 1); + } + + qsort(services, numServices, sizeof(*services), serviceNameCmp); + + for (i = 0; i < numServices ; i++) { + if (showServiceInfo(services[i], 1)) { + free(services); + closedir(dir); + return 1; + } + } + + free(services); + + closedir(dir); + + if (isXinetdEnabled()) { + struct service *s, *t; + + printf("\n"); + printf(_("xinetd based services:\n")); + if (!(dir = opendir(XINETDDIR))) { + fprintf(stderr, _("failed to open directory %s: %s\n"), + XINETDDIR, strerror(err)); + return 1; + } + numServices = 0; + numServicesAlloced = 10; + s = (struct service *) malloc(sizeof (*s) * numServicesAlloced); + + while ((ent = readdir(dir))) { + const char *dn; + + /* Skip any file starting with a . */ + if (ent->d_name[0] == '.') continue; + + /* Skip files with known bad extensions */ + if ((dn = strrchr(ent->d_name, '.')) != NULL && + (!strcmp(dn, ".rpmsave") || !strcmp(dn, ".rpmnew") || !strcmp(dn, ".rpmorig") || !strcmp(dn, ".swp"))) + continue; + + dn = ent->d_name + strlen(ent->d_name) - 1; + if (*dn == '~' || *dn == ',') + continue; + + if (numServices == numServicesAlloced) { + numServicesAlloced += 10; + s = (struct service *) realloc(s, numServicesAlloced * sizeof (*s)); + } + if (readXinetdServiceInfo(ent->d_name, s + numServices, 0) != -1) + numServices ++; + } + + qsort(s, numServices, sizeof(*s), xinetdNameCmp); + t = s; + for (i = 0; i < numServices; i++, s++) { + char *tmp = (char *) malloc(strlen(s->name) + 5); + sprintf(tmp,"%s:",s->name); + printf("\t%-15s\t%s\n", tmp, s->levels ? _("on") : _("off")); + } + closedir(dir); + free(t); + } + return 0; +} + +static int setService(char * name, int where, int state) { + int i, rc; + int what; + struct service s; + + if (!where && state != -1) { + /* levels 2, 3, 4, 5 */ + where = (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5); + } else if (!where) { + where = (1 << 0) | (1 << 1) | (1 << 2) | + (1 << 3) | (1 << 4) | (1 << 5) | (1 << 6); + } + + if ((rc = readServiceInfo(name, &s, 0))) { + readServiceError(rc, name); + return 1; + } + + if (s.type == TYPE_INIT_D) { + int rc = 0; + + if (s.isLSB) + frobDependencies(&s); + for (i = 0; i < 7; i++) { + + if (!((1 << i) & where)) continue; + + if (state == 1 || state == 0) + what = state; + else if (state == -2) + what = isOn(name, i); + else if (s.levels & (1 << i)) + what = 1; + else + what = 0; + rc |= doSetService(s, i, what); + } + return rc; + } else if (s.type == TYPE_XINETD) { + int xx; + if (setXinetdService(s, state)) { + return 1; + } + xx =system("/etc/init.d/xinetd reload >/dev/null 2>&1"); + } + + return 0; +} + +int chkconfig_main(int argc, const char ** argv); +int chkconfig_main(int argc, const char ** argv) +{ + int listItem = 0, addItem = 0, delItem = 0, overrideItem = 0; + int rc, i, x; + int LSB = 0; + char * levels = NULL; + int help=0, version=0; + struct service s; + poptContext optCon; + struct poptOption optionsTable[] = { + { "add", '\0', 0, &addItem, 0 }, + { "del", '\0', 0, &delItem, 0 }, + { "override", '\0', 0, &overrideItem, 0 }, + { "list", '\0', 0, &listItem, 0 }, + { "level", '\0', POPT_ARG_STRING, &levels, 0 }, + { "levels", '\0', POPT_ARG_STRING, &levels, 0 }, + { "help", 'h', POPT_ARG_NONE, &help, 0 }, + { "version", 'v', POPT_ARG_NONE, &version, 0 }, + { 0, 0, 0, 0, 0 } + }; + +#if 0 + if ((progname = strrchr(argv[0], '/')) != NULL) + progname++; + else + progname = argv[0]; + if (!strcmp(progname,"install_initd")) { + addItem++; + LSB++; + } + if (!strcmp(progname,"remove_initd")) { + delItem++; + LSB++; + } + + setlocale(LC_ALL, ""); + bindtextdomain("chkconfig","/usr/share/locale"); + textdomain("chkconfig"); +#endif + + optCon = poptGetContext("chkconfig", argc, argv, optionsTable, 0); + poptReadDefaultConfig(optCon, 1); + + if ((rc = poptGetNextOpt(optCon)) < -1) { + fprintf(stderr, "%s: %s\n", + poptBadOption(optCon, POPT_BADOPTION_NOALIAS), + poptStrerror(rc)); + return 1; + } + + if (version) { + fprintf(stdout, _("%s version %s\n"), progname, "no version!"); + return 0; + } + + if (help || argc == 1) { usage(); return 1; } + + if ((listItem + addItem + delItem + overrideItem) > 1) { + fprintf(stderr, _("only one of --list, --add, --del, or --override" + " may be specified\n")); + return 1; + } + + if (addItem) { + char * name = (char *)poptGetArg(optCon); + + if (!name || !*name || poptGetArg(optCon)) + { usage(); return 1; } + + if (LSB) + name = basename(name); + return addService(name); + } else if (delItem) { + char * name = (char *)poptGetArg(optCon); + + if (!name || !*name || poptGetArg(optCon)) { usage(); return 1; } + + if (LSB) + name = basename(name); + return delService(name); + } else if (overrideItem) { + char * name = (char *)poptGetArg(optCon); + + if (!name || !*name || poptGetArg(optCon)) { usage(); return 1; } + + name = basename(name); + return overrideService(name); + } else if (listItem) { + char * item = (char *)poptGetArg(optCon); + + if (item && poptGetArg(optCon)) { usage(); return 1; } + + return listService(item); + } else { + char * name = (char *)poptGetArg(optCon); + char * state = (char *)poptGetArg(optCon); + int where = 0, level = -1; + + if (!name) { + usage(); + return 1; + } + if (levels) { + where = parseLevels(levels, 0); + if (where == -1) { usage(); return 1; } + } + + if (!state) { + if (where) { + rc = x = 0; + i = where; + while (i) { + if (i & 1) { + rc++; + level = x; + } + i >>= 1; + x++; + } + + if (rc > 1) { + fprintf(stderr, _("only one runlevel may be specified for " + "a chkconfig query\n")); + return 1; + } + } + rc = readServiceInfo(name, &s, 0); + if (rc) + return 1; + if (s.type == TYPE_XINETD) { + if (isOn("xinetd",level)) + return !s.levels; + else + return 1; + } else + return isOn(name, level) ? 0 : 1; + } else if (!strcmp(state, "on")) + return setService(name, where, 1); + else if (!strcmp(state, "off")) + return setService(name, where, 0); + else if (!strcmp(state, "reset")) + return setService(name, where, -1); + else if (!strcmp(state, "resetpriorities")) + return setService(name, where, -2); + else + { usage(); return 1; } + } + + usage(); + + return 1; +} diff --git a/rpm-5.4.9/lua/chkconfig/leveldb.c b/rpm-5.4.9/lua/chkconfig/leveldb.c new file mode 100644 index 0000000..2e44b25 --- /dev/null +++ b/rpm-5.4.9/lua/chkconfig/leveldb.c @@ -0,0 +1,741 @@ +/* + * This file was originally distributed as part of + * chkconfig-1.3.34-1.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* Copyright 1997-2006 Red Hat, Inc. + * + * This software may be freely redistributed under the terms of the GNU + * public license. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Changes + 1998-09-22 - Arnaldo Carvalho de Melo + i18n for init.d scripts (eg.: description(pt_BR) is a brazilian + portuguese description for the package) +*/ + +#define _(String) gettext((String)) + +#include "leveldb.h" + +int parseLevels(char * str, int emptyOk) { + char * chptr = str; + int rc = 0; + + if (!str || !strlen(str)) + return emptyOk ? 0 : -1; + + while (*chptr) { + if (!isdigit(*chptr) || *chptr > '6') return -1; + rc |= 1 << (*chptr - '0'); + chptr++; + } + + return rc; +} + +static int readDescription(char *start, char *bufstop, char **english_desc, char **serv_desc) { + char english; + char my_lang_loaded = 0; + char is_my_lang = 0; + char * lang = getenv ("LANG"); + char * final_parenthesis; + char * end, *next; + int i; + + english = *start == ':'; + end = strchr(start, '\n'); + if (!end) + next = end = bufstop; + else + next = end + 1; + + if (!english) { + if (*start != '(') { + return 1; + } + + ++start; + final_parenthesis = strchr (start, ')'); + + if (final_parenthesis == NULL || final_parenthesis - start > 5) { + return 1; + } + + is_my_lang = lang ? strncmp (lang, start, strlen (lang)) == 0 : 0; + start = final_parenthesis + 2; + } else ++start; + + while (isspace(*start) && start < end) start++; + if (start == end) { + return 1; + } + { + char* desc = (char *) malloc(end - start + 1); + strncpy(desc, start, end - start); + desc[end - start] = '\0'; + + start = next; + + while (desc[strlen(desc) - 1] == '\\') { + desc[strlen(desc) - 1] = '\0'; + start = next; + + while (isspace(*start) && start < bufstop) start++; + if (start == bufstop || *start != '#') { + return 1; + } + + start++; + + while (isspace(*start) && start < bufstop) start++; + if (start == bufstop) { + return 1; + } + + end = strchr(start, '\n'); + if (!end) + next = end = bufstop; + else + next = end + 1; + + i = strlen(desc); + desc = (char *) realloc(desc, i + end - start + 1); + strncat(desc, start, end - start); + desc[i + end - start] = '\0'; + + start = next; + } + + if (desc) { + if (my_lang_loaded) { + free(desc); + } else if (is_my_lang) { + if (*serv_desc) + free(*serv_desc); + + *serv_desc = desc; + return 0; + } else if (english) { + if (*serv_desc) + free(*serv_desc); + + if (*english_desc) + free (*english_desc); + + *english_desc = desc; + } else free (desc); + } + } + return 0; +} + +int readXinetdServiceInfo(char *name, struct service * service, int honorHide) { + char * filename = (char *) alloca(strlen(name) + strlen(XINETDDIR) + 50); + int fd; + struct service serv = { + name: NULL, + levels: -1, + kPriority: -1, + sPriority: -1, + desc: NULL, + startDeps: NULL, + stopDeps: NULL, + provides: NULL, + type: TYPE_XINETD, + isLSB: 0, + enabled: -1 + }; + struct stat sb; + char * buf, *ptr; + char * eng_desc = NULL, *start; + + snprintf(filename, strlen(name)+strlen(XINETDDIR)+50, XINETDDIR "/%s", name); + + if ((fd = open(filename, O_RDONLY)) < 0) return -1; + fstat(fd,&sb); + if (! S_ISREG(sb.st_mode)) return -1; + buf = (char *) malloc(sb.st_size+1); + if (read(fd,buf,sb.st_size)!=sb.st_size) { + close(fd); + free(buf); + return -1; + } + close(fd); + serv.name = strdup(name); + buf[sb.st_size] = '\0'; + start = buf; + while (buf) { + ptr = strchr(buf,'\n'); + if (*buf == '#') { + buf++; + while (isspace(*buf) && buf < ptr) buf++; + if (!strncmp(buf,"default:", 9)) { + buf+=8; + while(isspace(*buf)) buf++; + if (!strncmp(buf+9,"on",2)) { + serv.enabled = 1; + } else { + serv.enabled = 0; + } + } else if (!strncmp(buf,"description:",12)) { + buf+=11; + if (readDescription(buf,start+sb.st_size, + &serv.desc,&eng_desc)) { + if (serv.desc) free(serv.desc); + } + if (!serv.desc) { + if (eng_desc) + serv.desc = eng_desc; + } else if (eng_desc) + free (eng_desc); + } + if (ptr) { + *ptr = '\0'; + ptr++; + } + buf = ptr; + continue; + } + while (isspace(*buf) && buf < ptr) buf++; + if (!strncmp(buf,"disable", 7)) { + buf = strstr(buf,"="); + if (buf) + do { + buf++; + } while(isspace(*buf)); + + if (buf && strncmp(buf,"yes",3)) { + serv.levels = parseLevels("0123456",0); + if (serv.enabled == -1) + serv.enabled = 1; + } else { + serv.levels = 0; + if (serv.enabled == -1) + serv.enabled = 0; + } + } + if (ptr) { + *ptr = '\0'; + ptr++; + } + buf = ptr; + } + *service = serv; + return 0; +} + +int readServiceInfo(char * name, struct service * service, int honorHide) { + char * filename = (char *) alloca(strlen(name) + strlen(RUNLEVELS) + 50); + int fd; + struct service serv, serv_overrides; + int parseret; + + sprintf(filename, RUNLEVELS "/init.d/%s", name); + + if ((fd = open(filename, O_RDONLY)) < 0) { + return readXinetdServiceInfo(name,service,honorHide); + } + + parseret = parseServiceInfo(fd, name, &serv, honorHide, 0); + if (parseret) { + return parseret; + } + + sprintf(filename, RUNLEVELS "/chkconfig.d/%s", name); + if ((fd = open(filename, O_RDONLY)) >= 0) { + parseret = parseServiceInfo(fd, name, &serv_overrides, honorHide, 1); + if (parseret >= 0) { + if (serv_overrides.name) serv.name = serv_overrides.name; + if (serv_overrides.levels != -1) serv.levels = serv_overrides.levels; + if (serv_overrides.kPriority != -2) serv.kPriority = serv_overrides.kPriority; + if (serv_overrides.sPriority != -2) serv.sPriority = serv_overrides.sPriority; + if (serv_overrides.desc) serv.desc = serv_overrides.desc; + if (serv_overrides.startDeps) serv.startDeps = serv_overrides.startDeps; + if (serv_overrides.stopDeps) serv.stopDeps = serv_overrides.stopDeps; + if (serv_overrides.provides) serv.provides = serv_overrides.provides; + if (serv_overrides.isLSB || serv.isLSB) serv.isLSB = 1; + } + } + + *service = serv; + return 0; +} + +int readServiceDifferences(char * name, struct service * service, struct service * service_overrides, int honorHide) { + char * filename = (char *) alloca(strlen(name) + strlen(RUNLEVELS) + 50); + int fd; + struct service serv, serv_overrides; + int parseret; + + sprintf(filename, RUNLEVELS "/init.d/%s", name); + + if ((fd = open(filename, O_RDONLY)) < 0) { + return readXinetdServiceInfo(name,service,honorHide); + } + + parseret = parseServiceInfo(fd, name, &serv, honorHide, 0); + if (parseret) { + return parseret; + } + + sprintf(filename, RUNLEVELS "/chkconfig.d/%s", name); + if ((fd = open(filename, O_RDONLY)) >= 0) { + parseret = parseServiceInfo(fd, name, &serv_overrides, honorHide, 1); + } else { + return 1; + } + if (parseret) { + return 1; + } + + *service = serv; + *service_overrides = serv_overrides; + return 0; +} + + +int parseServiceInfo(int fd, char * name, struct service * service, int honorHide, int partialOk) { + struct stat sb; + char * bufstart, * bufstop, * start, * end, * next, *tmpbufstart; + struct service serv = { + name: NULL, + levels: -1, + kPriority: -1, + sPriority: -1, + desc: NULL, + startDeps: NULL, + stopDeps: NULL, + provides: NULL, + type: TYPE_INIT_D, + isLSB: 0, + enabled: 0 + }; + char overflow; + char levelbuf[20]; + char * english_desc = NULL; + + fstat(fd, &sb); + + bufstart = (char *) mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0); + if (bufstart == ((caddr_t) -1)) { + close(fd); + return -1; + } + + tmpbufstart = (char*)malloc(sb.st_size+1); + if (tmpbufstart == NULL) { + close(fd); + return -1; + } + + memcpy(tmpbufstart, bufstart, sb.st_size); + munmap(bufstart, sb.st_size); + + bufstart = tmpbufstart; + bufstop = bufstart + sb.st_size; + *bufstop = 0; + + close(fd); + + next = bufstart; + while (next < bufstop && (serv.levels == -1 || !serv.desc)) { + start = next; + + while (isspace(*start) && start < bufstop) start++; + if (start == bufstop) break; + + end = strchr(start, '\n'); + if (!end) + next = end = bufstop; + else + next = end + 1; + + if (*start != '#') continue; + + start++; + if (!strncmp(start, "## BEGIN INIT INFO", 18)) + serv.isLSB = 1; + + while (isspace(*start) && start < end) start++; + if (start == end) continue; + if (honorHide && !strncmp(start, "hide:", 5)) { + start += 5; + while (isspace(*start) && start < end) start++; + if (start == end || !strncmp(start, "true", 4)) { + if (serv.desc) free(serv.desc); + free(bufstart); + return 1; + } + } + + if (!strncmp(start, "chkconfig:", 10)) { + int spri, kpri; + + start += 10; + while (isspace(*start) && start < end) start++; + if (start == end) { + if (serv.desc) free(serv.desc); + free(bufstart); + return 1; + } + + if ((sscanf(start, "%s %d %d%c", levelbuf, + &spri, &kpri, &overflow) != 4) || + !isspace(overflow)) { + if (serv.desc) free(serv.desc); + free(bufstart); + return 1; + } + if (spri > 99 || kpri > 99 || kpri < 0 || spri < 0) { + if (serv.desc) free(serv.desc); + free(bufstart); + return 1; + } + if (serv.sPriority == -1) + serv.sPriority = spri; + if (serv.kPriority == -1) + serv.kPriority = kpri; + + if (serv.levels == -1) { + if (!strcmp(levelbuf, "-")) + serv.levels = 0; + else + serv.levels = parseLevels(levelbuf, 0); + } + if (serv.levels == -1) { + if (serv.desc) free(serv.desc); + free(bufstart); + return 1; + } + } else if (!strncmp(start, "description", 11) || + !strncmp(start, "Description:", 12) || + !strncmp(start, "Short-Description:", 18)) { + if (readDescription(start+11, bufstop, &english_desc, &serv.desc)) { + if (serv.desc) free(serv.desc); + } + } else if (!strncmp(start, "Default-Start:", 14)) { + char *t; + + start+=14; + while (1) { + int lev; + + lev = strtol(start, &t, 10); + if (t && t != start) + start = t; + else + break; + if (serv.levels == -1) + serv.levels = 0; + serv.levels |= 1 << lev; + } + } else if (!strncmp(start, "Default-Stop:", 13)) { + char *t; + + start+=13; + while (1) { + int lev; + + lev = strtol(start, &t, 10); + if (t && t != start) + start = t; + else + break; + if (serv.levels == -1) + serv.levels = 0; + serv.levels &= ~(1 << lev); + } + } else if (!strncmp(start, "Required-Start:", 15)) { + char *t; + int numdeps = 0; + + start+=15; + while (1) { + while (*start && isspace(*start) && start < end) start++; + if (start == end) + break; + t = start; + while (*t && !isspace(*t) && t < end) t++; + if (isspace(*t)) { + *t = '\0'; + t++; + } + numdeps++; + serv.startDeps = (char **) realloc(serv.startDeps, + (numdeps + 1) * sizeof(char *)); + serv.startDeps[numdeps-1] = strdup(start); + serv.startDeps[numdeps] = NULL; + if (!t || t >= end) + break; + else + start = t; + } + } else if (!strncmp(start, "Required-Stop:", 14)) { + char *t; + int numdeps = 0; + + start+=14; + while (1) { + while (*start && isspace(*start) && start < end) start++; + if (start == end) + break; + t = start; + while (*t && !isspace(*t) && t < end) t++; + if (isspace(*t)) { + *t = '\0'; + t++; + } + numdeps++; + serv.stopDeps = (char **) realloc(serv.stopDeps, + (numdeps + 1) * sizeof(char *)); + serv.stopDeps[numdeps-1] = strdup(start); + serv.stopDeps[numdeps] = NULL; + if (!t || t >= end) + break; + else + start = t; + } + } else if (!strncmp(start, "Provides:", 9)) { + char *t; + int numdeps = 0; + + start+=9; + while (1) { + while (*start && isspace(*start) && start < end) start++; + if (start == end) + break; + t = start; + while (*t && !isspace(*t) && t < end) t++; + if (isspace(*t)) { + *t = '\0'; + t++; + } + numdeps++; + serv.provides = (char **) realloc(serv.provides, + (numdeps + 1) * sizeof(char *)); + serv.provides[numdeps-1] = strdup(start); + serv.provides[numdeps] = NULL; + if (!t || t >= end) + break; + else + start = t; + } + + } + } + + free(bufstart); + + if (!serv.desc) { + if (english_desc) + serv.desc = english_desc; + } else if (english_desc) + free (english_desc); + + if (!partialOk && ((serv.levels == -1) || !serv.desc)) { + return 1; + } + + serv.name = strdup(name); + if (!serv.provides) { + serv.provides = (char **) malloc(2 * sizeof(char *)); + serv.provides[0] = strdup(name); + serv.provides[1] = NULL; + } + + *service = serv; + return 0; +} + +/* returns -1 on error */ +int currentRunlevel(void) { + FILE * p; + char response[50]; + + p = popen("/sbin/runlevel", "r"); + if (!p) return -1; + + if (!fgets(response, sizeof(response), p)) { + pclose(p); + return -1; + } + + pclose(p); + + if (response[1] != ' ' || !isdigit(response[2]) || response[3] != '\n') + return -1; + + return response[2] - '0'; +} + +int findServiceEntries(char * name, int level, glob_t * globresptr) { + char match[200]; + glob_t globres; + int rc; + + sprintf(match, "%s/rc%d.d/[SK][0-9][0-9]%s", RUNLEVELS, level, name); + + rc = glob(match, GLOB_ERR | GLOB_NOSORT, NULL, &globres); + + if (rc && rc != GLOB_NOMATCH) { + fprintf(stderr, _("failed to glob pattern %s: %s\n"), match, + strerror(errno)); + return 1; + } else if (rc == GLOB_NOMATCH) { + globresptr->gl_pathc = 0; + return 0; + } + + *globresptr = globres; + return 0; +} + +int isConfigured(char * name, int level, int *priority, char *type) { + glob_t globres; + char *pri_string; + + if (findServiceEntries(name, level, &globres)) + exit(1); + + if (!globres.gl_pathc) + return 0; + + if (type) { + *type = globres.gl_pathv[0][11]; + } + + if (priority) { + pri_string = strndup(globres.gl_pathv[0]+12, 2); + if (!pri_string) return 0; + sscanf(pri_string, "%d", priority); + free(pri_string); + } + + globfree(&globres); + return 1; +} + +int isOn(char * name, int level) { + glob_t globres; + + if (level == -1) { + level = currentRunlevel(); + if (level == -1) { + fprintf(stderr, _("cannot determine current run level\n")); + return 0; + } + } + + if (findServiceEntries(name, level, &globres)) + exit(1); + + if (!globres.gl_pathc || !strstr(globres.gl_pathv[0], "/S")) + return 0; + + globfree(&globres); + return 1; +} + +int setXinetdService(struct service s, int on) { + int oldfd, newfd; + char oldfname[100], newfname[100]; + char tmpstr[50]; + char *buf, *ptr, *tmp; + struct stat sb; + + if (on == -1) { + on = s.enabled ? 1 : 0; + } + snprintf(oldfname,100,"%s/%s",XINETDDIR,s.name); + if ( (oldfd = open(oldfname,O_RDONLY)) == -1 ) { + return -1; + } + fstat(oldfd,&sb); + buf = (char *) malloc(sb.st_size+1); + if (read(oldfd,buf,sb.st_size)!=sb.st_size) { + close(oldfd); + free(buf); + return -1; + } + close(oldfd); + buf[sb.st_size] = '\0'; + snprintf(newfname,100,"%s/%s.XXXXXX",XINETDDIR,s.name); + newfd = mkstemp(newfname); + if (newfd == -1) { + free(buf); + return -1; + } + while (buf) { + tmp = buf; + ptr = strchr(buf,'\n'); + if (ptr) { + *ptr = '\0'; + ptr++; + } + while (isspace(*buf)) buf++; + if (strncmp(buf,"disable", 7) && strlen(buf)) { + int xx; + xx = write(newfd,tmp,strlen(tmp)); + xx = write(newfd,"\n",1); + if (buf[0] == '{') { + snprintf(tmpstr,50,"\tdisable\t= %s", on ? "no" : "yes"); + xx = write(newfd,tmpstr,strlen(tmpstr)); + xx = write(newfd,"\n",1); + } + } + buf = ptr; + } + close(newfd); + chmod(newfname,0644); + unlink(oldfname); + return(rename(newfname,oldfname)); +} + +int doSetService(struct service s, int level, int on) { + int priority = on ? s.sPriority : s.kPriority; + char linkname[200]; + char linkto[200]; + glob_t globres; + int i; + + if (!findServiceEntries(s.name, level, &globres)) { + for (i = 0; i < (int)globres.gl_pathc; i++) + unlink(globres.gl_pathv[i]); + if (globres.gl_pathc) globfree(&globres); + } + + sprintf(linkname, "%s/rc%d.d/%c%02d%s", RUNLEVELS, level, + on ? 'S' : 'K', priority, s.name); + sprintf(linkto, "../init.d/%s", s.name); + + unlink(linkname); /* just in case */ + if (symlink(linkto, linkname)) { + fprintf(stderr, _("failed to make symlink %s: %s\n"), linkname, + strerror(errno)); + return 1; + } + + return 0; +} + diff --git a/rpm-5.4.9/lua/chkconfig/leveldb.h b/rpm-5.4.9/lua/chkconfig/leveldb.h new file mode 100644 index 0000000..78220d9 --- /dev/null +++ b/rpm-5.4.9/lua/chkconfig/leveldb.h @@ -0,0 +1,55 @@ +/* + * This file was originally distributed as part of + * chkconfig-1.3.34-1.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* Copyright 1997-2006 Red Hat, Inc. + * + * This software may be freely redistributed under the terms of the GNU + * public license. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ +#ifndef H_LEVELDB +#define H_LEVELDB + +#define RUNLEVELS "/etc/rc.d" +#define XINETDDIR "/etc/xinetd.d" + +#include + +#define TYPE_INIT_D 0 +#define TYPE_XINETD 1 + +struct service { + char * name; + int levels, kPriority, sPriority; + char * desc; + char **startDeps; + char **stopDeps; + char **provides; + int type; + int isLSB; + int enabled; +}; + +int parseLevels(char * str, int emptyOk); + +/* returns 0 on success, 1 if the service is not chkconfig-able, -1 if an + I/O error occurs (in which case errno can be checked) */ +int readServiceInfo(char * name, struct service * service, int honorHide); +int readServiceDifferences(char * name, struct service * service, struct service * service_overrides, int honorHide); +int parseServiceInfo(int fd, char * name, struct service * service, int honorHide, int partialOk); +int currentRunlevel(void); +int isOn(char * name, int where); +int isConfigured(char * name, int level, int *priority, char *type); +int doSetService(struct service s, int level, int on); +int findServiceEntries(char * name, int level, glob_t * globresptr); +int readXinetdServiceInfo(char *name, struct service *service, int honorHide); +int setXinetdService(struct service s, int on); + +#endif diff --git a/rpm-5.4.9/lua/lapi.c b/rpm-5.4.9/lua/lapi.c new file mode 100644 index 0000000..5d5145d --- /dev/null +++ b/rpm-5.4.9/lua/lapi.c @@ -0,0 +1,1087 @@ +/* +** $Id: lapi.c,v 2.55.1.5 2008/07/04 18:41:18 roberto Exp $ +** Lua API +** See Copyright Notice in lua.h +*/ + + +#include +#include +#include +#include + +#define lapi_c +#define LUA_CORE + +#include "lua.h" + +#include "lapi.h" +#include "ldebug.h" +#include "ldo.h" +#include "lfunc.h" +#include "lgc.h" +#include "lmem.h" +#include "lobject.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" +#include "ltm.h" +#include "lundump.h" +#include "lvm.h" + + + +const char lua_ident[] = + "$Lua: " LUA_RELEASE " " LUA_COPYRIGHT " $\n" + "$Authors: " LUA_AUTHORS " $\n" + "$URL: www.lua.org $\n"; + + + +#define api_checknelems(L, n) api_check(L, (n) <= (L->top - L->base)) + +#define api_checkvalidindex(L, i) api_check(L, (i) != luaO_nilobject) + +#define api_incr_top(L) {api_check(L, L->top < L->ci->top); L->top++;} + + + +static TValue *index2adr (lua_State *L, int idx) { + if (idx > 0) { + TValue *o = L->base + (idx - 1); + api_check(L, idx <= L->ci->top - L->base); + if (o >= L->top) return cast(TValue *, luaO_nilobject); + else return o; + } + else if (idx > LUA_REGISTRYINDEX) { + api_check(L, idx != 0 && -idx <= L->top - L->base); + return L->top + idx; + } + else switch (idx) { /* pseudo-indices */ + case LUA_REGISTRYINDEX: return registry(L); + case LUA_ENVIRONINDEX: { + Closure *func = curr_func(L); + sethvalue(L, &L->env, func->c.env); + return &L->env; + } + case LUA_GLOBALSINDEX: return gt(L); + default: { + Closure *func = curr_func(L); + idx = LUA_GLOBALSINDEX - idx; + return (idx <= func->c.nupvalues) + ? &func->c.upvalue[idx-1] + : cast(TValue *, luaO_nilobject); + } + } +} + + +static Table *getcurrenv (lua_State *L) { + if (L->ci == L->base_ci) /* no enclosing function? */ + return hvalue(gt(L)); /* use global table as environment */ + else { + Closure *func = curr_func(L); + return func->c.env; + } +} + + +void luaA_pushobject (lua_State *L, const TValue *o) { + setobj2s(L, L->top, o); + api_incr_top(L); +} + + +LUA_API int lua_checkstack (lua_State *L, int size) { + int res = 1; + lua_lock(L); + if (size > LUAI_MAXCSTACK || (L->top - L->base + size) > LUAI_MAXCSTACK) + res = 0; /* stack overflow */ + else if (size > 0) { + luaD_checkstack(L, size); + if (L->ci->top < L->top + size) + L->ci->top = L->top + size; + } + lua_unlock(L); + return res; +} + + +LUA_API void lua_xmove (lua_State *from, lua_State *to, int n) { + int i; + if (from == to) return; + lua_lock(to); + api_checknelems(from, n); + api_check(from, G(from) == G(to)); + api_check(from, to->ci->top - to->top >= n); + from->top -= n; + for (i = 0; i < n; i++) { + setobj2s(to, to->top++, from->top + i); + } + lua_unlock(to); +} + + +LUA_API void lua_setlevel (lua_State *from, lua_State *to) { + to->nCcalls = from->nCcalls; +} + + +LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf) { + lua_CFunction old; + lua_lock(L); + old = G(L)->panic; + G(L)->panic = panicf; + lua_unlock(L); + return old; +} + + +LUA_API lua_State *lua_newthread (lua_State *L) { + lua_State *L1; + lua_lock(L); + luaC_checkGC(L); + L1 = luaE_newthread(L); + setthvalue(L, L->top, L1); + api_incr_top(L); + lua_unlock(L); + luai_userstatethread(L, L1); + return L1; +} + + + +/* +** basic stack manipulation +*/ + + +LUA_API int lua_gettop (lua_State *L) { + return cast_int(L->top - L->base); +} + + +LUA_API void lua_settop (lua_State *L, int idx) { + lua_lock(L); + if (idx >= 0) { + api_check(L, idx <= L->stack_last - L->base); + while (L->top < L->base + idx) + setnilvalue(L->top++); + L->top = L->base + idx; + } + else { + api_check(L, -(idx+1) <= (L->top - L->base)); + L->top += idx+1; /* `subtract' index (index is negative) */ + } + lua_unlock(L); +} + + +LUA_API void lua_remove (lua_State *L, int idx) { + StkId p; + lua_lock(L); + p = index2adr(L, idx); + api_checkvalidindex(L, p); + while (++p < L->top) setobjs2s(L, p-1, p); + L->top--; + lua_unlock(L); +} + + +LUA_API void lua_insert (lua_State *L, int idx) { + StkId p; + StkId q; + lua_lock(L); + p = index2adr(L, idx); + api_checkvalidindex(L, p); + for (q = L->top; q>p; q--) setobjs2s(L, q, q-1); + setobjs2s(L, p, L->top); + lua_unlock(L); +} + + +LUA_API void lua_replace (lua_State *L, int idx) { + StkId o; + lua_lock(L); + /* explicit test for incompatible code */ + if (idx == LUA_ENVIRONINDEX && L->ci == L->base_ci) + luaG_runerror(L, "no calling environment"); + api_checknelems(L, 1); + o = index2adr(L, idx); + api_checkvalidindex(L, o); + if (idx == LUA_ENVIRONINDEX) { + Closure *func = curr_func(L); + api_check(L, ttistable(L->top - 1)); + func->c.env = hvalue(L->top - 1); + luaC_barrier(L, func, L->top - 1); + } + else { + setobj(L, o, L->top - 1); + if (idx < LUA_GLOBALSINDEX) /* function upvalue? */ + luaC_barrier(L, curr_func(L), L->top - 1); + } + L->top--; + lua_unlock(L); +} + + +LUA_API void lua_pushvalue (lua_State *L, int idx) { + lua_lock(L); + setobj2s(L, L->top, index2adr(L, idx)); + api_incr_top(L); + lua_unlock(L); +} + + + +/* +** access functions (stack -> C) +*/ + + +LUA_API int lua_type (lua_State *L, int idx) { + StkId o = index2adr(L, idx); + return (o == luaO_nilobject) ? LUA_TNONE : ttype(o); +} + + +LUA_API const char *lua_typename (lua_State *L, int t) { + UNUSED(L); + return (t == LUA_TNONE) ? "no value" : luaT_typenames[t]; +} + + +LUA_API int lua_iscfunction (lua_State *L, int idx) { + StkId o = index2adr(L, idx); + return iscfunction(o); +} + + +LUA_API int lua_isnumber (lua_State *L, int idx) { + TValue n; + const TValue *o = index2adr(L, idx); + return tonumber(o, &n); +} + + +LUA_API int lua_isstring (lua_State *L, int idx) { + int t = lua_type(L, idx); + return (t == LUA_TSTRING || t == LUA_TNUMBER); +} + + +LUA_API int lua_isuserdata (lua_State *L, int idx) { + const TValue *o = index2adr(L, idx); + return (ttisuserdata(o) || ttislightuserdata(o)); +} + + +LUA_API int lua_rawequal (lua_State *L, int index1, int index2) { + StkId o1 = index2adr(L, index1); + StkId o2 = index2adr(L, index2); + return (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0 + : luaO_rawequalObj(o1, o2); +} + + +LUA_API int lua_equal (lua_State *L, int index1, int index2) { + StkId o1, o2; + int i; + lua_lock(L); /* may call tag method */ + o1 = index2adr(L, index1); + o2 = index2adr(L, index2); + i = (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0 : equalobj(L, o1, o2); + lua_unlock(L); + return i; +} + + +LUA_API int lua_lessthan (lua_State *L, int index1, int index2) { + StkId o1, o2; + int i; + lua_lock(L); /* may call tag method */ + o1 = index2adr(L, index1); + o2 = index2adr(L, index2); + i = (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0 + : luaV_lessthan(L, o1, o2); + lua_unlock(L); + return i; +} + + + +LUA_API lua_Number lua_tonumber (lua_State *L, int idx) { + TValue n; + const TValue *o = index2adr(L, idx); + if (tonumber(o, &n)) + return nvalue(o); + else + return 0; +} + + +LUA_API lua_Integer lua_tointeger (lua_State *L, int idx) { + TValue n; + const TValue *o = index2adr(L, idx); + if (tonumber(o, &n)) { + lua_Integer res; + lua_Number num = nvalue(o); + lua_number2integer(res, num); + return res; + } + else + return 0; +} + + +LUA_API int lua_toboolean (lua_State *L, int idx) { + const TValue *o = index2adr(L, idx); + return !l_isfalse(o); +} + + +LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) { + StkId o = index2adr(L, idx); + if (!ttisstring(o)) { + lua_lock(L); /* `luaV_tostring' may create a new string */ + if (!luaV_tostring(L, o)) { /* conversion failed? */ + if (len != NULL) *len = 0; + lua_unlock(L); + return NULL; + } + luaC_checkGC(L); + o = index2adr(L, idx); /* previous call may reallocate the stack */ + lua_unlock(L); + } + if (len != NULL) *len = tsvalue(o)->len; + return svalue(o); +} + + +LUA_API size_t lua_objlen (lua_State *L, int idx) { + StkId o = index2adr(L, idx); + switch (ttype(o)) { + case LUA_TSTRING: return tsvalue(o)->len; + case LUA_TUSERDATA: return uvalue(o)->len; + case LUA_TTABLE: return luaH_getn(hvalue(o)); + case LUA_TNUMBER: { + size_t l; + lua_lock(L); /* `luaV_tostring' may create a new string */ + l = (luaV_tostring(L, o) ? tsvalue(o)->len : 0); + lua_unlock(L); + return l; + } + default: return 0; + } +} + + +LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) { + StkId o = index2adr(L, idx); + return (!iscfunction(o)) ? NULL : clvalue(o)->c.f; +} + + +LUA_API void *lua_touserdata (lua_State *L, int idx) { + StkId o = index2adr(L, idx); + switch (ttype(o)) { + case LUA_TUSERDATA: return (rawuvalue(o) + 1); + case LUA_TLIGHTUSERDATA: return pvalue(o); + default: return NULL; + } +} + + +LUA_API lua_State *lua_tothread (lua_State *L, int idx) { + StkId o = index2adr(L, idx); + return (!ttisthread(o)) ? NULL : thvalue(o); +} + + +LUA_API const void *lua_topointer (lua_State *L, int idx) { + StkId o = index2adr(L, idx); + switch (ttype(o)) { + case LUA_TTABLE: return hvalue(o); + case LUA_TFUNCTION: return clvalue(o); + case LUA_TTHREAD: return thvalue(o); + case LUA_TUSERDATA: + case LUA_TLIGHTUSERDATA: + return lua_touserdata(L, idx); + default: return NULL; + } +} + + + +/* +** push functions (C -> stack) +*/ + + +LUA_API void lua_pushnil (lua_State *L) { + lua_lock(L); + setnilvalue(L->top); + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API void lua_pushnumber (lua_State *L, lua_Number n) { + lua_lock(L); + setnvalue(L->top, n); + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API void lua_pushinteger (lua_State *L, lua_Integer n) { + lua_lock(L); + setnvalue(L->top, cast_num(n)); + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len) { + lua_lock(L); + luaC_checkGC(L); + setsvalue2s(L, L->top, luaS_newlstr(L, s, len)); + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API void lua_pushstring (lua_State *L, const char *s) { + if (s == NULL) + lua_pushnil(L); + else + lua_pushlstring(L, s, strlen(s)); +} + + +LUA_API const char *lua_pushvfstring (lua_State *L, const char *fmt, + va_list argp) { + const char *ret; + lua_lock(L); + luaC_checkGC(L); + ret = luaO_pushvfstring(L, fmt, argp); + lua_unlock(L); + return ret; +} + + +LUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...) { + const char *ret; + va_list argp; + lua_lock(L); + luaC_checkGC(L); + va_start(argp, fmt); + ret = luaO_pushvfstring(L, fmt, argp); + va_end(argp); + lua_unlock(L); + return ret; +} + + +LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) { + Closure *cl; + lua_lock(L); + luaC_checkGC(L); + api_checknelems(L, n); + cl = luaF_newCclosure(L, n, getcurrenv(L)); + cl->c.f = fn; + L->top -= n; + while (n--) + setobj2n(L, &cl->c.upvalue[n], L->top+n); + setclvalue(L, L->top, cl); + lua_assert(iswhite(obj2gco(cl))); + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API void lua_pushboolean (lua_State *L, int b) { + lua_lock(L); + setbvalue(L->top, (b != 0)); /* ensure that true is 1 */ + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API void lua_pushlightuserdata (lua_State *L, void *p) { + lua_lock(L); + setpvalue(L->top, p); + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API int lua_pushthread (lua_State *L) { + lua_lock(L); + setthvalue(L, L->top, L); + api_incr_top(L); + lua_unlock(L); + return (G(L)->mainthread == L); +} + + + +/* +** get functions (Lua -> stack) +*/ + + +LUA_API void lua_gettable (lua_State *L, int idx) { + StkId t; + lua_lock(L); + t = index2adr(L, idx); + api_checkvalidindex(L, t); + luaV_gettable(L, t, L->top - 1, L->top - 1); + lua_unlock(L); +} + + +LUA_API void lua_getfield (lua_State *L, int idx, const char *k) { + StkId t; + TValue key; + lua_lock(L); + t = index2adr(L, idx); + api_checkvalidindex(L, t); + setsvalue(L, &key, luaS_new(L, k)); + luaV_gettable(L, t, &key, L->top); + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API void lua_rawget (lua_State *L, int idx) { + StkId t; + lua_lock(L); + t = index2adr(L, idx); + api_check(L, ttistable(t)); + setobj2s(L, L->top - 1, luaH_get(hvalue(t), L->top - 1)); + lua_unlock(L); +} + + +LUA_API void lua_rawgeti (lua_State *L, int idx, int n) { + StkId o; + lua_lock(L); + o = index2adr(L, idx); + api_check(L, ttistable(o)); + setobj2s(L, L->top, luaH_getnum(hvalue(o), n)); + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API void lua_createtable (lua_State *L, int narray, int nrec) { + lua_lock(L); + luaC_checkGC(L); + sethvalue(L, L->top, luaH_new(L, narray, nrec)); + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API int lua_getmetatable (lua_State *L, int objindex) { + const TValue *obj; + Table *mt = NULL; + int res; + lua_lock(L); + obj = index2adr(L, objindex); + switch (ttype(obj)) { + case LUA_TTABLE: + mt = hvalue(obj)->metatable; + break; + case LUA_TUSERDATA: + mt = uvalue(obj)->metatable; + break; + default: + mt = G(L)->mt[ttype(obj)]; + break; + } + if (mt == NULL) + res = 0; + else { + sethvalue(L, L->top, mt); + api_incr_top(L); + res = 1; + } + lua_unlock(L); + return res; +} + + +LUA_API void lua_getfenv (lua_State *L, int idx) { + StkId o; + lua_lock(L); + o = index2adr(L, idx); + api_checkvalidindex(L, o); + switch (ttype(o)) { + case LUA_TFUNCTION: + sethvalue(L, L->top, clvalue(o)->c.env); + break; + case LUA_TUSERDATA: + sethvalue(L, L->top, uvalue(o)->env); + break; + case LUA_TTHREAD: + setobj2s(L, L->top, gt(thvalue(o))); + break; + default: + setnilvalue(L->top); + break; + } + api_incr_top(L); + lua_unlock(L); +} + + +/* +** set functions (stack -> Lua) +*/ + + +LUA_API void lua_settable (lua_State *L, int idx) { + StkId t; + lua_lock(L); + api_checknelems(L, 2); + t = index2adr(L, idx); + api_checkvalidindex(L, t); + luaV_settable(L, t, L->top - 2, L->top - 1); + L->top -= 2; /* pop index and value */ + lua_unlock(L); +} + + +LUA_API void lua_setfield (lua_State *L, int idx, const char *k) { + StkId t; + TValue key; + lua_lock(L); + api_checknelems(L, 1); + t = index2adr(L, idx); + api_checkvalidindex(L, t); + setsvalue(L, &key, luaS_new(L, k)); + luaV_settable(L, t, &key, L->top - 1); + L->top--; /* pop value */ + lua_unlock(L); +} + + +LUA_API void lua_rawset (lua_State *L, int idx) { + StkId t; + lua_lock(L); + api_checknelems(L, 2); + t = index2adr(L, idx); + api_check(L, ttistable(t)); + setobj2t(L, luaH_set(L, hvalue(t), L->top-2), L->top-1); + luaC_barriert(L, hvalue(t), L->top-1); + L->top -= 2; + lua_unlock(L); +} + + +LUA_API void lua_rawseti (lua_State *L, int idx, int n) { + StkId o; + lua_lock(L); + api_checknelems(L, 1); + o = index2adr(L, idx); + api_check(L, ttistable(o)); + setobj2t(L, luaH_setnum(L, hvalue(o), n), L->top-1); + luaC_barriert(L, hvalue(o), L->top-1); + L->top--; + lua_unlock(L); +} + + +LUA_API int lua_setmetatable (lua_State *L, int objindex) { + TValue *obj; + Table *mt; + lua_lock(L); + api_checknelems(L, 1); + obj = index2adr(L, objindex); + api_checkvalidindex(L, obj); + if (ttisnil(L->top - 1)) + mt = NULL; + else { + api_check(L, ttistable(L->top - 1)); + mt = hvalue(L->top - 1); + } + switch (ttype(obj)) { + case LUA_TTABLE: { + hvalue(obj)->metatable = mt; + if (mt) + luaC_objbarriert(L, hvalue(obj), mt); + break; + } + case LUA_TUSERDATA: { + uvalue(obj)->metatable = mt; + if (mt) + luaC_objbarrier(L, rawuvalue(obj), mt); + break; + } + default: { + G(L)->mt[ttype(obj)] = mt; + break; + } + } + L->top--; + lua_unlock(L); + return 1; +} + + +LUA_API int lua_setfenv (lua_State *L, int idx) { + StkId o; + int res = 1; + lua_lock(L); + api_checknelems(L, 1); + o = index2adr(L, idx); + api_checkvalidindex(L, o); + api_check(L, ttistable(L->top - 1)); + switch (ttype(o)) { + case LUA_TFUNCTION: + clvalue(o)->c.env = hvalue(L->top - 1); + break; + case LUA_TUSERDATA: + uvalue(o)->env = hvalue(L->top - 1); + break; + case LUA_TTHREAD: + sethvalue(L, gt(thvalue(o)), hvalue(L->top - 1)); + break; + default: + res = 0; + break; + } + if (res) luaC_objbarrier(L, gcvalue(o), hvalue(L->top - 1)); + L->top--; + lua_unlock(L); + return res; +} + + +/* +** `load' and `call' functions (run Lua code) +*/ + + +#define adjustresults(L,nres) \ + { if (nres == LUA_MULTRET && L->top >= L->ci->top) L->ci->top = L->top; } + + +#define checkresults(L,na,nr) \ + api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na))) + + +LUA_API void lua_call (lua_State *L, int nargs, int nresults) { + StkId func; + lua_lock(L); + api_checknelems(L, nargs+1); + checkresults(L, nargs, nresults); + func = L->top - (nargs+1); + luaD_call(L, func, nresults); + adjustresults(L, nresults); + lua_unlock(L); +} + + + +/* +** Execute a protected call. +*/ +struct CallS { /* data to `f_call' */ + StkId func; + int nresults; +}; + + +static void f_call (lua_State *L, void *ud) { + struct CallS *c = cast(struct CallS *, ud); + luaD_call(L, c->func, c->nresults); +} + + + +LUA_API int lua_pcall (lua_State *L, int nargs, int nresults, int errfunc) { + struct CallS c; + int status; + ptrdiff_t func; + lua_lock(L); + api_checknelems(L, nargs+1); + checkresults(L, nargs, nresults); + if (errfunc == 0) + func = 0; + else { + StkId o = index2adr(L, errfunc); + api_checkvalidindex(L, o); + func = savestack(L, o); + } + c.func = L->top - (nargs+1); /* function to be called */ + c.nresults = nresults; + status = luaD_pcall(L, f_call, &c, savestack(L, c.func), func); + adjustresults(L, nresults); + lua_unlock(L); + return status; +} + + +/* +** Execute a protected C call. +*/ +struct CCallS { /* data to `f_Ccall' */ + lua_CFunction func; + void *ud; +}; + + +static void f_Ccall (lua_State *L, void *ud) { + struct CCallS *c = cast(struct CCallS *, ud); + Closure *cl; + cl = luaF_newCclosure(L, 0, getcurrenv(L)); + cl->c.f = c->func; + setclvalue(L, L->top, cl); /* push function */ + api_incr_top(L); + setpvalue(L->top, c->ud); /* push only argument */ + api_incr_top(L); + luaD_call(L, L->top - 2, 0); +} + + +LUA_API int lua_cpcall (lua_State *L, lua_CFunction func, void *ud) { + struct CCallS c; + int status; + lua_lock(L); + c.func = func; + c.ud = ud; + status = luaD_pcall(L, f_Ccall, &c, savestack(L, L->top), 0); + lua_unlock(L); + return status; +} + + +LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data, + const char *chunkname) { + ZIO z; + int status; + lua_lock(L); + if (!chunkname) chunkname = "?"; + luaZ_init(L, &z, reader, data); + status = luaD_protectedparser(L, &z, chunkname); + lua_unlock(L); + return status; +} + + +LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data) { + int status; + TValue *o; + lua_lock(L); + api_checknelems(L, 1); + o = L->top - 1; + if (isLfunction(o)) + status = luaU_dump(L, clvalue(o)->l.p, writer, data, 0); + else + status = 1; + lua_unlock(L); + return status; +} + + +LUA_API int lua_status (lua_State *L) { + return L->status; +} + + +/* +** Garbage-collection function +*/ + +LUA_API int lua_gc (lua_State *L, int what, int data) { + int res = 0; + global_State *g; + lua_lock(L); + g = G(L); + switch (what) { + case LUA_GCSTOP: { + g->GCthreshold = MAX_LUMEM; + break; + } + case LUA_GCRESTART: { + g->GCthreshold = g->totalbytes; + break; + } + case LUA_GCCOLLECT: { + luaC_fullgc(L); + break; + } + case LUA_GCCOUNT: { + /* GC values are expressed in Kbytes: #bytes/2^10 */ + res = cast_int(g->totalbytes >> 10); + break; + } + case LUA_GCCOUNTB: { + res = cast_int(g->totalbytes & 0x3ff); + break; + } + case LUA_GCSTEP: { + lu_mem a = (cast(lu_mem, data) << 10); + if (a <= g->totalbytes) + g->GCthreshold = g->totalbytes - a; + else + g->GCthreshold = 0; + while (g->GCthreshold <= g->totalbytes) { + luaC_step(L); + if (g->gcstate == GCSpause) { /* end of cycle? */ + res = 1; /* signal it */ + break; + } + } + break; + } + case LUA_GCSETPAUSE: { + res = g->gcpause; + g->gcpause = data; + break; + } + case LUA_GCSETSTEPMUL: { + res = g->gcstepmul; + g->gcstepmul = data; + break; + } + default: res = -1; /* invalid option */ + } + lua_unlock(L); + return res; +} + + + +/* +** miscellaneous functions +*/ + + +LUA_API int lua_error (lua_State *L) { + lua_lock(L); + api_checknelems(L, 1); + luaG_errormsg(L); + lua_unlock(L); + return 0; /* to avoid warnings */ +} + + +LUA_API int lua_next (lua_State *L, int idx) { + StkId t; + int more; + lua_lock(L); + t = index2adr(L, idx); + api_check(L, ttistable(t)); + more = luaH_next(L, hvalue(t), L->top - 1); + if (more) { + api_incr_top(L); + } + else /* no more elements */ + L->top -= 1; /* remove key */ + lua_unlock(L); + return more; +} + + +LUA_API void lua_concat (lua_State *L, int n) { + lua_lock(L); + api_checknelems(L, n); + if (n >= 2) { + luaC_checkGC(L); + luaV_concat(L, n, cast_int(L->top - L->base) - 1); + L->top -= (n-1); + } + else if (n == 0) { /* push empty string */ + setsvalue2s(L, L->top, luaS_newlstr(L, "", 0)); + api_incr_top(L); + } + /* else n == 1; nothing to do */ + lua_unlock(L); +} + + +LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud) { + lua_Alloc f; + lua_lock(L); + if (ud) *ud = G(L)->ud; + f = G(L)->frealloc; + lua_unlock(L); + return f; +} + + +LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud) { + lua_lock(L); + G(L)->ud = ud; + G(L)->frealloc = f; + lua_unlock(L); +} + + +LUA_API void *lua_newuserdata (lua_State *L, size_t size) { + Udata *u; + lua_lock(L); + luaC_checkGC(L); + u = luaS_newudata(L, size, getcurrenv(L)); + setuvalue(L, L->top, u); + api_incr_top(L); + lua_unlock(L); + return u + 1; +} + + + + +static const char *aux_upvalue (StkId fi, int n, TValue **val) { + Closure *f; + if (!ttisfunction(fi)) return NULL; + f = clvalue(fi); + if (f->c.isC) { + if (!(1 <= n && n <= f->c.nupvalues)) return NULL; + *val = &f->c.upvalue[n-1]; + return ""; + } + else { + Proto *p = f->l.p; + if (!(1 <= n && n <= p->sizeupvalues)) return NULL; + *val = f->l.upvals[n-1]->v; + return getstr(p->upvalues[n-1]); + } +} + + +LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n) { + const char *name; + TValue *val; + lua_lock(L); + name = aux_upvalue(index2adr(L, funcindex), n, &val); + if (name) { + setobj2s(L, L->top, val); + api_incr_top(L); + } + lua_unlock(L); + return name; +} + + +LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) { + const char *name; + TValue *val; + StkId fi; + lua_lock(L); + fi = index2adr(L, funcindex); + api_checknelems(L, 1); + name = aux_upvalue(fi, n, &val); + if (name) { + L->top--; + setobj(L, val, L->top); + luaC_barrier(L, clvalue(fi), L->top); + } + lua_unlock(L); + return name; +} + diff --git a/rpm-5.4.9/lua/lapi.h b/rpm-5.4.9/lua/lapi.h new file mode 100644 index 0000000..2c3fab2 --- /dev/null +++ b/rpm-5.4.9/lua/lapi.h @@ -0,0 +1,16 @@ +/* +** $Id: lapi.h,v 2.2.1.1 2007/12/27 13:02:25 roberto Exp $ +** Auxiliary functions from Lua API +** See Copyright Notice in lua.h +*/ + +#ifndef lapi_h +#define lapi_h + + +#include "lobject.h" + + +LUAI_FUNC void luaA_pushobject (lua_State *L, const TValue *o); + +#endif diff --git a/rpm-5.4.9/lua/lauxlib.c b/rpm-5.4.9/lua/lauxlib.c new file mode 100644 index 0000000..10f14e2 --- /dev/null +++ b/rpm-5.4.9/lua/lauxlib.c @@ -0,0 +1,652 @@ +/* +** $Id: lauxlib.c,v 1.159.1.3 2008/01/21 13:20:51 roberto Exp $ +** Auxiliary functions for building Lua libraries +** See Copyright Notice in lua.h +*/ + + +#include +#include +#include +#include +#include +#include + + +/* This file uses only the official API of Lua. +** Any function declared here could be written as an application function. +*/ + +#define lauxlib_c +#define LUA_LIB + +#include "lua.h" + +#include "lauxlib.h" + + +#define FREELIST_REF 0 /* free list of references */ + + +/* convert a stack index to positive */ +#define abs_index(L, i) ((i) > 0 || (i) <= LUA_REGISTRYINDEX ? (i) : \ + lua_gettop(L) + (i) + 1) + + +/* +** {====================================================== +** Error-report functions +** ======================================================= +*/ + + +LUALIB_API int luaL_argerror (lua_State *L, int narg, const char *extramsg) { + lua_Debug ar; + if (!lua_getstack(L, 0, &ar)) /* no stack frame? */ + return luaL_error(L, "bad argument #%d (%s)", narg, extramsg); + lua_getinfo(L, "n", &ar); + if (strcmp(ar.namewhat, "method") == 0) { + narg--; /* do not count `self' */ + if (narg == 0) /* error is in the self argument itself? */ + return luaL_error(L, "calling " LUA_QS " on bad self (%s)", + ar.name, extramsg); + } + if (ar.name == NULL) + ar.name = "?"; + return luaL_error(L, "bad argument #%d to " LUA_QS " (%s)", + narg, ar.name, extramsg); +} + + +LUALIB_API int luaL_typerror (lua_State *L, int narg, const char *tname) { + const char *msg = lua_pushfstring(L, "%s expected, got %s", + tname, luaL_typename(L, narg)); + return luaL_argerror(L, narg, msg); +} + + +static void tag_error (lua_State *L, int narg, int tag) { + luaL_typerror(L, narg, lua_typename(L, tag)); +} + + +LUALIB_API void luaL_where (lua_State *L, int level) { + lua_Debug ar; + if (lua_getstack(L, level, &ar)) { /* check function at level */ + lua_getinfo(L, "Sl", &ar); /* get info about it */ + if (ar.currentline > 0) { /* is there info? */ + lua_pushfstring(L, "%s:%d: ", ar.short_src, ar.currentline); + return; + } + } + lua_pushliteral(L, ""); /* else, no information available... */ +} + + +LUALIB_API int luaL_error (lua_State *L, const char *fmt, ...) { + va_list argp; + va_start(argp, fmt); + luaL_where(L, 1); + lua_pushvfstring(L, fmt, argp); + va_end(argp); + lua_concat(L, 2); + return lua_error(L); +} + +/* }====================================================== */ + + +LUALIB_API int luaL_checkoption (lua_State *L, int narg, const char *def, + const char *const lst[]) { + const char *name = (def) ? luaL_optstring(L, narg, def) : + luaL_checkstring(L, narg); + int i; + for (i=0; lst[i]; i++) + if (strcmp(lst[i], name) == 0) + return i; + return luaL_argerror(L, narg, + lua_pushfstring(L, "invalid option " LUA_QS, name)); +} + + +LUALIB_API int luaL_newmetatable (lua_State *L, const char *tname) { + lua_getfield(L, LUA_REGISTRYINDEX, tname); /* get registry.name */ + if (!lua_isnil(L, -1)) /* name already in use? */ + return 0; /* leave previous value on top, but return 0 */ + lua_pop(L, 1); + lua_newtable(L); /* create metatable */ + lua_pushvalue(L, -1); + lua_setfield(L, LUA_REGISTRYINDEX, tname); /* registry.name = metatable */ + return 1; +} + + +LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname) { + void *p = lua_touserdata(L, ud); + if (p != NULL) { /* value is a userdata? */ + if (lua_getmetatable(L, ud)) { /* does it have a metatable? */ + lua_getfield(L, LUA_REGISTRYINDEX, tname); /* get correct metatable */ + if (lua_rawequal(L, -1, -2)) { /* does it have the correct mt? */ + lua_pop(L, 2); /* remove both metatables */ + return p; + } + } + } + luaL_typerror(L, ud, tname); /* else error */ + return NULL; /* to avoid warnings */ +} + + +LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *mes) { + if (!lua_checkstack(L, space)) + luaL_error(L, "stack overflow (%s)", mes); +} + + +LUALIB_API void luaL_checktype (lua_State *L, int narg, int t) { + if (lua_type(L, narg) != t) + tag_error(L, narg, t); +} + + +LUALIB_API void luaL_checkany (lua_State *L, int narg) { + if (lua_type(L, narg) == LUA_TNONE) + luaL_argerror(L, narg, "value expected"); +} + + +LUALIB_API const char *luaL_checklstring (lua_State *L, int narg, size_t *len) { + const char *s = lua_tolstring(L, narg, len); + if (!s) tag_error(L, narg, LUA_TSTRING); + return s; +} + + +LUALIB_API const char *luaL_optlstring (lua_State *L, int narg, + const char *def, size_t *len) { + if (lua_isnoneornil(L, narg)) { + if (len) + *len = (def ? strlen(def) : 0); + return def; + } + else return luaL_checklstring(L, narg, len); +} + + +LUALIB_API lua_Number luaL_checknumber (lua_State *L, int narg) { + lua_Number d = lua_tonumber(L, narg); + if (d == 0 && !lua_isnumber(L, narg)) /* avoid extra test when d is not 0 */ + tag_error(L, narg, LUA_TNUMBER); + return d; +} + + +LUALIB_API lua_Number luaL_optnumber (lua_State *L, int narg, lua_Number def) { + return luaL_opt(L, luaL_checknumber, narg, def); +} + + +LUALIB_API lua_Integer luaL_checkinteger (lua_State *L, int narg) { + lua_Integer d = lua_tointeger(L, narg); + if (d == 0 && !lua_isnumber(L, narg)) /* avoid extra test when d is not 0 */ + tag_error(L, narg, LUA_TNUMBER); + return d; +} + + +LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int narg, + lua_Integer def) { + return luaL_opt(L, luaL_checkinteger, narg, def); +} + + +LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) { + if (!lua_getmetatable(L, obj)) /* no metatable? */ + return 0; + lua_pushstring(L, event); + lua_rawget(L, -2); + if (lua_isnil(L, -1)) { + lua_pop(L, 2); /* remove metatable and metafield */ + return 0; + } + else { + lua_remove(L, -2); /* remove only metatable */ + return 1; + } +} + + +LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) { + obj = abs_index(L, obj); + if (!luaL_getmetafield(L, obj, event)) /* no metafield? */ + return 0; + lua_pushvalue(L, obj); + lua_call(L, 1, 1); + return 1; +} + + +LUALIB_API void (luaL_register) (lua_State *L, const char *libname, + const luaL_Reg *l) { + luaI_openlib(L, libname, l, 0); +} + + +static int libsize (const luaL_Reg *l) { + int size = 0; + for (; l->name; l++) size++; + return size; +} + + +LUALIB_API void luaI_openlib (lua_State *L, const char *libname, + const luaL_Reg *l, int nup) { + if (libname) { + int size = libsize(l); + /* check whether lib already exists */ + luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 1); + lua_getfield(L, -1, libname); /* get _LOADED[libname] */ + if (!lua_istable(L, -1)) { /* not found? */ + lua_pop(L, 1); /* remove previous result */ + /* try global variable (and create one if it does not exist) */ + if (luaL_findtable(L, LUA_GLOBALSINDEX, libname, size) != NULL) + luaL_error(L, "name conflict for module " LUA_QS, libname); + lua_pushvalue(L, -1); + lua_setfield(L, -3, libname); /* _LOADED[libname] = new table */ + } + lua_remove(L, -2); /* remove _LOADED table */ + lua_insert(L, -(nup+1)); /* move library table to below upvalues */ + } + for (; l->name; l++) { + int i; + for (i=0; ifunc, nup); + lua_setfield(L, -(nup+2), l->name); + } + lua_pop(L, nup); /* remove upvalues */ +} + + + +/* +** {====================================================== +** getn-setn: size for arrays +** ======================================================= +*/ + +#if defined(LUA_COMPAT_GETN) + +static int checkint (lua_State *L, int topop) { + int n = (lua_type(L, -1) == LUA_TNUMBER) ? lua_tointeger(L, -1) : -1; + lua_pop(L, topop); + return n; +} + + +static void getsizes (lua_State *L) { + lua_getfield(L, LUA_REGISTRYINDEX, "LUA_SIZES"); + if (lua_isnil(L, -1)) { /* no `size' table? */ + lua_pop(L, 1); /* remove nil */ + lua_newtable(L); /* create it */ + lua_pushvalue(L, -1); /* `size' will be its own metatable */ + lua_setmetatable(L, -2); + lua_pushliteral(L, "kv"); + lua_setfield(L, -2, "__mode"); /* metatable(N).__mode = "kv" */ + lua_pushvalue(L, -1); + lua_setfield(L, LUA_REGISTRYINDEX, "LUA_SIZES"); /* store in register */ + } +} + + +LUALIB_API void luaL_setn (lua_State *L, int t, int n) { + t = abs_index(L, t); + lua_pushliteral(L, "n"); + lua_rawget(L, t); + if (checkint(L, 1) >= 0) { /* is there a numeric field `n'? */ + lua_pushliteral(L, "n"); /* use it */ + lua_pushinteger(L, n); + lua_rawset(L, t); + } + else { /* use `sizes' */ + getsizes(L); + lua_pushvalue(L, t); + lua_pushinteger(L, n); + lua_rawset(L, -3); /* sizes[t] = n */ + lua_pop(L, 1); /* remove `sizes' */ + } +} + + +LUALIB_API int luaL_getn (lua_State *L, int t) { + int n; + t = abs_index(L, t); + lua_pushliteral(L, "n"); /* try t.n */ + lua_rawget(L, t); + if ((n = checkint(L, 1)) >= 0) return n; + getsizes(L); /* else try sizes[t] */ + lua_pushvalue(L, t); + lua_rawget(L, -2); + if ((n = checkint(L, 2)) >= 0) return n; + return (int)lua_objlen(L, t); +} + +#endif + +/* }====================================================== */ + + + +LUALIB_API const char *luaL_gsub (lua_State *L, const char *s, const char *p, + const char *r) { + const char *wild; + size_t l = strlen(p); + luaL_Buffer b; + luaL_buffinit(L, &b); + while ((wild = strstr(s, p)) != NULL) { + luaL_addlstring(&b, s, wild - s); /* push prefix */ + luaL_addstring(&b, r); /* push replacement in place of pattern */ + s = wild + l; /* continue after `p' */ + } + luaL_addstring(&b, s); /* push last suffix */ + luaL_pushresult(&b); + return lua_tostring(L, -1); +} + + +LUALIB_API const char *luaL_findtable (lua_State *L, int idx, + const char *fname, int szhint) { + const char *e; + lua_pushvalue(L, idx); + do { + e = strchr(fname, '.'); + if (e == NULL) e = fname + strlen(fname); + lua_pushlstring(L, fname, e - fname); + lua_rawget(L, -2); + if (lua_isnil(L, -1)) { /* no such field? */ + lua_pop(L, 1); /* remove this nil */ + lua_createtable(L, 0, (*e == '.' ? 1 : szhint)); /* new table for field */ + lua_pushlstring(L, fname, e - fname); + lua_pushvalue(L, -2); + lua_settable(L, -4); /* set new table into field */ + } + else if (!lua_istable(L, -1)) { /* field has a non-table value? */ + lua_pop(L, 2); /* remove table and value */ + return fname; /* return problematic part of the name */ + } + lua_remove(L, -2); /* remove previous table */ + fname = e + 1; + } while (*e == '.'); + return NULL; +} + + + +/* +** {====================================================== +** Generic Buffer manipulation +** ======================================================= +*/ + + +#define bufflen(B) ((B)->p - (B)->buffer) +#define bufffree(B) ((size_t)(LUAL_BUFFERSIZE - bufflen(B))) + +#define LIMIT (LUA_MINSTACK/2) + + +static int emptybuffer (luaL_Buffer *B) { + size_t l = bufflen(B); + if (l == 0) return 0; /* put nothing on stack */ + else { + lua_pushlstring(B->L, B->buffer, l); + B->p = B->buffer; + B->lvl++; + return 1; + } +} + + +static void adjuststack (luaL_Buffer *B) { + if (B->lvl > 1) { + lua_State *L = B->L; + int toget = 1; /* number of levels to concat */ + size_t toplen = lua_strlen(L, -1); + do { + size_t l = lua_strlen(L, -(toget+1)); + if (B->lvl - toget + 1 >= LIMIT || toplen > l) { + toplen += l; + toget++; + } + else break; + } while (toget < B->lvl); + lua_concat(L, toget); + B->lvl = B->lvl - toget + 1; + } +} + + +LUALIB_API char *luaL_prepbuffer (luaL_Buffer *B) { + if (emptybuffer(B)) + adjuststack(B); + return B->buffer; +} + + +LUALIB_API void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l) { + while (l--) + luaL_addchar(B, *s++); +} + + +LUALIB_API void luaL_addstring (luaL_Buffer *B, const char *s) { + luaL_addlstring(B, s, strlen(s)); +} + + +LUALIB_API void luaL_pushresult (luaL_Buffer *B) { + emptybuffer(B); + lua_concat(B->L, B->lvl); + B->lvl = 1; +} + + +LUALIB_API void luaL_addvalue (luaL_Buffer *B) { + lua_State *L = B->L; + size_t vl; + const char *s = lua_tolstring(L, -1, &vl); + if (vl <= bufffree(B)) { /* fit into buffer? */ + memcpy(B->p, s, vl); /* put it there */ + B->p += vl; + lua_pop(L, 1); /* remove from stack */ + } + else { + if (emptybuffer(B)) + lua_insert(L, -2); /* put buffer before new value */ + B->lvl++; /* add new value into B stack */ + adjuststack(B); + } +} + + +LUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B) { + B->L = L; + B->p = B->buffer; + B->lvl = 0; +} + +/* }====================================================== */ + + +LUALIB_API int luaL_ref (lua_State *L, int t) { + int ref; + t = abs_index(L, t); + if (lua_isnil(L, -1)) { + lua_pop(L, 1); /* remove from stack */ + return LUA_REFNIL; /* `nil' has a unique fixed reference */ + } + lua_rawgeti(L, t, FREELIST_REF); /* get first free element */ + ref = (int)lua_tointeger(L, -1); /* ref = t[FREELIST_REF] */ + lua_pop(L, 1); /* remove it from stack */ + if (ref != 0) { /* any free element? */ + lua_rawgeti(L, t, ref); /* remove it from list */ + lua_rawseti(L, t, FREELIST_REF); /* (t[FREELIST_REF] = t[ref]) */ + } + else { /* no free elements */ + ref = (int)lua_objlen(L, t); + ref++; /* create new reference */ + } + lua_rawseti(L, t, ref); + return ref; +} + + +LUALIB_API void luaL_unref (lua_State *L, int t, int ref) { + if (ref >= 0) { + t = abs_index(L, t); + lua_rawgeti(L, t, FREELIST_REF); + lua_rawseti(L, t, ref); /* t[ref] = t[FREELIST_REF] */ + lua_pushinteger(L, ref); + lua_rawseti(L, t, FREELIST_REF); /* t[FREELIST_REF] = ref */ + } +} + + + +/* +** {====================================================== +** Load functions +** ======================================================= +*/ + +typedef struct LoadF { + int extraline; + FILE *f; + char buff[LUAL_BUFFERSIZE]; +} LoadF; + + +static const char *getF (lua_State *L, void *ud, size_t *size) { + LoadF *lf = (LoadF *)ud; + (void)L; + if (lf->extraline) { + lf->extraline = 0; + *size = 1; + return "\n"; + } + if (feof(lf->f)) return NULL; + *size = fread(lf->buff, 1, sizeof(lf->buff), lf->f); + return (*size > 0) ? lf->buff : NULL; +} + + +static int errfile (lua_State *L, const char *what, int fnameindex) { + const char *serr = strerror(errno); + const char *filename = lua_tostring(L, fnameindex) + 1; + lua_pushfstring(L, "cannot %s %s: %s", what, filename, serr); + lua_remove(L, fnameindex); + return LUA_ERRFILE; +} + + +LUALIB_API int luaL_loadfile (lua_State *L, const char *filename) { + LoadF lf; + int status, readstatus; + int c; + int fnameindex = lua_gettop(L) + 1; /* index of filename on the stack */ + lf.extraline = 0; + if (filename == NULL) { + lua_pushliteral(L, "=stdin"); + lf.f = stdin; + } + else { + lua_pushfstring(L, "@%s", filename); + lf.f = fopen(filename, "r"); + if (lf.f == NULL) return errfile(L, "open", fnameindex); + } + c = getc(lf.f); + if (c == '#') { /* Unix exec. file? */ + lf.extraline = 1; + while ((c = getc(lf.f)) != EOF && c != '\n') ; /* skip first line */ + if (c == '\n') c = getc(lf.f); + } + if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */ + lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */ + if (lf.f == NULL) return errfile(L, "reopen", fnameindex); + /* skip eventual `#!...' */ + while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ; + lf.extraline = 0; + } + ungetc(c, lf.f); + status = lua_load(L, getF, &lf, lua_tostring(L, -1)); + readstatus = ferror(lf.f); + if (filename) fclose(lf.f); /* close file (even in case of errors) */ + if (readstatus) { + lua_settop(L, fnameindex); /* ignore results from `lua_load' */ + return errfile(L, "read", fnameindex); + } + lua_remove(L, fnameindex); + return status; +} + + +typedef struct LoadS { + const char *s; + size_t size; +} LoadS; + + +static const char *getS (lua_State *L, void *ud, size_t *size) { + LoadS *ls = (LoadS *)ud; + (void)L; + if (ls->size == 0) return NULL; + *size = ls->size; + ls->size = 0; + return ls->s; +} + + +LUALIB_API int luaL_loadbuffer (lua_State *L, const char *buff, size_t size, + const char *name) { + LoadS ls; + ls.s = buff; + ls.size = size; + return lua_load(L, getS, &ls, name); +} + + +LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s) { + return luaL_loadbuffer(L, s, strlen(s), s); +} + + + +/* }====================================================== */ + + +static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { + (void)ud; + (void)osize; + if (nsize == 0) { + free(ptr); + return NULL; + } + else + return realloc(ptr, nsize); +} + + +static int panic (lua_State *L) { + (void)L; /* to avoid warnings */ + fprintf(stderr, "PANIC: unprotected error in call to Lua API (%s)\n", + lua_tostring(L, -1)); + return 0; +} + + +LUALIB_API lua_State *luaL_newstate (void) { + lua_State *L = lua_newstate(l_alloc, NULL); + if (L) lua_atpanic(L, &panic); + return L; +} + diff --git a/rpm-5.4.9/lua/lauxlib.h b/rpm-5.4.9/lua/lauxlib.h new file mode 100644 index 0000000..3425823 --- /dev/null +++ b/rpm-5.4.9/lua/lauxlib.h @@ -0,0 +1,174 @@ +/* +** $Id: lauxlib.h,v 1.88.1.1 2007/12/27 13:02:25 roberto Exp $ +** Auxiliary functions for building Lua libraries +** See Copyright Notice in lua.h +*/ + + +#ifndef lauxlib_h +#define lauxlib_h + + +#include +#include + +#include "lua.h" + + +#if defined(LUA_COMPAT_GETN) +LUALIB_API int (luaL_getn) (lua_State *L, int t); +LUALIB_API void (luaL_setn) (lua_State *L, int t, int n); +#else +#define luaL_getn(L,i) ((int)lua_objlen(L, i)) +#define luaL_setn(L,i,j) ((void)0) /* no op! */ +#endif + +#if defined(LUA_COMPAT_OPENLIB) +#define luaI_openlib luaL_openlib +#endif + + +/* extra error code for `luaL_load' */ +#define LUA_ERRFILE (LUA_ERRERR+1) + + +typedef struct luaL_Reg { + const char *name; + lua_CFunction func; +} luaL_Reg; + + + +LUALIB_API void (luaI_openlib) (lua_State *L, const char *libname, + const luaL_Reg *l, int nup); +LUALIB_API void (luaL_register) (lua_State *L, const char *libname, + const luaL_Reg *l); +LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e); +LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e); +LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname); +LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg); +LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg, + size_t *l); +LUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg, + const char *def, size_t *l); +LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg); +LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def); + +LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg); +LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg, + lua_Integer def); + +LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg); +LUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t); +LUALIB_API void (luaL_checkany) (lua_State *L, int narg); + +LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname); +LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname); + +LUALIB_API void (luaL_where) (lua_State *L, int lvl); +LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...); + +LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def, + const char *const lst[]); + +LUALIB_API int (luaL_ref) (lua_State *L, int t); +LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref); + +LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename); +LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz, + const char *name); +LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s); + +LUALIB_API lua_State *(luaL_newstate) (void); + + +LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p, + const char *r); + +LUALIB_API const char *(luaL_findtable) (lua_State *L, int idx, + const char *fname, int szhint); + + + + +/* +** =============================================================== +** some useful macros +** =============================================================== +*/ + +#define luaL_argcheck(L, cond,numarg,extramsg) \ + ((void)((cond) || luaL_argerror(L, (numarg), (extramsg)))) +#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL)) +#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL)) +#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n))) +#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d))) +#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n))) +#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d))) + +#define luaL_typename(L,i) lua_typename(L, lua_type(L,(i))) + +#define luaL_dofile(L, fn) \ + (luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0)) + +#define luaL_dostring(L, s) \ + (luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0)) + +#define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n))) + +#define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n))) + +/* +** {====================================================== +** Generic Buffer manipulation +** ======================================================= +*/ + + + +typedef struct luaL_Buffer { + char *p; /* current position in buffer */ + int lvl; /* number of strings in the stack (level) */ + lua_State *L; + char buffer[LUAL_BUFFERSIZE]; +} luaL_Buffer; + +#define luaL_addchar(B,c) \ + ((void)((B)->p < ((B)->buffer+LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \ + (*(B)->p++ = (char)(c))) + +/* compatibility only */ +#define luaL_putchar(B,c) luaL_addchar(B,c) + +#define luaL_addsize(B,n) ((B)->p += (n)) + +LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B); +LUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B); +LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l); +LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s); +LUALIB_API void (luaL_addvalue) (luaL_Buffer *B); +LUALIB_API void (luaL_pushresult) (luaL_Buffer *B); + + +/* }====================================================== */ + + +/* compatibility with ref system */ + +/* pre-defined references */ +#define LUA_NOREF (-2) +#define LUA_REFNIL (-1) + +#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \ + (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0)) + +#define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref)) + +#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref)) + + +#define luaL_reg luaL_Reg + +#endif + + diff --git a/rpm-5.4.9/lua/lbaselib.c b/rpm-5.4.9/lua/lbaselib.c new file mode 100644 index 0000000..2a4c079 --- /dev/null +++ b/rpm-5.4.9/lua/lbaselib.c @@ -0,0 +1,653 @@ +/* +** $Id: lbaselib.c,v 1.191.1.6 2008/02/14 16:46:22 roberto Exp $ +** Basic library +** See Copyright Notice in lua.h +*/ + + + +#include +#include +#include +#include + +#define lbaselib_c +#define LUA_LIB + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + + + +/* +** If your system does not support `stdout', you can just remove this function. +** If you need, you can define your own `print' function, following this +** model but changing `fputs' to put the strings at a proper place +** (a console window or a log file, for instance). +*/ +static int luaB_print (lua_State *L) { + int n = lua_gettop(L); /* number of arguments */ + int i; + lua_getglobal(L, "tostring"); + for (i=1; i<=n; i++) { + const char *s; + lua_pushvalue(L, -1); /* function to be called */ + lua_pushvalue(L, i); /* value to print */ + lua_call(L, 1, 1); + s = lua_tostring(L, -1); /* get result */ + if (s == NULL) + return luaL_error(L, LUA_QL("tostring") " must return a string to " + LUA_QL("print")); + if (i>1) fputs("\t", stdout); + fputs(s, stdout); + lua_pop(L, 1); /* pop result */ + } + fputs("\n", stdout); + return 0; +} + + +static int luaB_tonumber (lua_State *L) { + int base = luaL_optint(L, 2, 10); + if (base == 10) { /* standard conversion */ + luaL_checkany(L, 1); + if (lua_isnumber(L, 1)) { + lua_pushnumber(L, lua_tonumber(L, 1)); + return 1; + } + } + else { + const char *s1 = luaL_checkstring(L, 1); + char *s2; + unsigned long n; + luaL_argcheck(L, 2 <= base && base <= 36, 2, "base out of range"); + n = strtoul(s1, &s2, base); + if (s1 != s2) { /* at least one valid digit? */ + while (isspace((unsigned char)(*s2))) s2++; /* skip trailing spaces */ + if (*s2 == '\0') { /* no invalid trailing characters? */ + lua_pushnumber(L, (lua_Number)n); + return 1; + } + } + } + lua_pushnil(L); /* else not a number */ + return 1; +} + + +static int luaB_error (lua_State *L) { + int level = luaL_optint(L, 2, 1); + lua_settop(L, 1); + if (lua_isstring(L, 1) && level > 0) { /* add extra information? */ + luaL_where(L, level); + lua_pushvalue(L, 1); + lua_concat(L, 2); + } + return lua_error(L); +} + + +static int luaB_getmetatable (lua_State *L) { + luaL_checkany(L, 1); + if (!lua_getmetatable(L, 1)) { + lua_pushnil(L); + return 1; /* no metatable */ + } + luaL_getmetafield(L, 1, "__metatable"); + return 1; /* returns either __metatable field (if present) or metatable */ +} + + +static int luaB_setmetatable (lua_State *L) { + int t = lua_type(L, 2); + luaL_checktype(L, 1, LUA_TTABLE); + luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2, + "nil or table expected"); + if (luaL_getmetafield(L, 1, "__metatable")) + luaL_error(L, "cannot change a protected metatable"); + lua_settop(L, 2); + lua_setmetatable(L, 1); + return 1; +} + + +static void getfunc (lua_State *L, int opt) { + if (lua_isfunction(L, 1)) lua_pushvalue(L, 1); + else { + lua_Debug ar; + int level = opt ? luaL_optint(L, 1, 1) : luaL_checkint(L, 1); + luaL_argcheck(L, level >= 0, 1, "level must be non-negative"); + if (lua_getstack(L, level, &ar) == 0) + luaL_argerror(L, 1, "invalid level"); + lua_getinfo(L, "f", &ar); + if (lua_isnil(L, -1)) + luaL_error(L, "no function environment for tail call at level %d", + level); + } +} + + +static int luaB_getfenv (lua_State *L) { + getfunc(L, 1); + if (lua_iscfunction(L, -1)) /* is a C function? */ + lua_pushvalue(L, LUA_GLOBALSINDEX); /* return the thread's global env. */ + else + lua_getfenv(L, -1); + return 1; +} + + +static int luaB_setfenv (lua_State *L) { + luaL_checktype(L, 2, LUA_TTABLE); + getfunc(L, 0); + lua_pushvalue(L, 2); + if (lua_isnumber(L, 1) && lua_tonumber(L, 1) == 0) { + /* change environment of current thread */ + lua_pushthread(L); + lua_insert(L, -2); + lua_setfenv(L, -2); + return 0; + } + else if (lua_iscfunction(L, -2) || lua_setfenv(L, -2) == 0) + luaL_error(L, + LUA_QL("setfenv") " cannot change environment of given object"); + return 1; +} + + +static int luaB_rawequal (lua_State *L) { + luaL_checkany(L, 1); + luaL_checkany(L, 2); + lua_pushboolean(L, lua_rawequal(L, 1, 2)); + return 1; +} + + +static int luaB_rawget (lua_State *L) { + luaL_checktype(L, 1, LUA_TTABLE); + luaL_checkany(L, 2); + lua_settop(L, 2); + lua_rawget(L, 1); + return 1; +} + +static int luaB_rawset (lua_State *L) { + luaL_checktype(L, 1, LUA_TTABLE); + luaL_checkany(L, 2); + luaL_checkany(L, 3); + lua_settop(L, 3); + lua_rawset(L, 1); + return 1; +} + + +static int luaB_gcinfo (lua_State *L) { + lua_pushinteger(L, lua_getgccount(L)); + return 1; +} + + +static int luaB_collectgarbage (lua_State *L) { + static const char *const opts[] = {"stop", "restart", "collect", + "count", "step", "setpause", "setstepmul", NULL}; + static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT, + LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL}; + int o = luaL_checkoption(L, 1, "collect", opts); + int ex = luaL_optint(L, 2, 0); + int res = lua_gc(L, optsnum[o], ex); + switch (optsnum[o]) { + case LUA_GCCOUNT: { + int b = lua_gc(L, LUA_GCCOUNTB, 0); + lua_pushnumber(L, res + ((lua_Number)b/1024)); + return 1; + } + case LUA_GCSTEP: { + lua_pushboolean(L, res); + return 1; + } + default: { + lua_pushnumber(L, res); + return 1; + } + } +} + + +static int luaB_type (lua_State *L) { + luaL_checkany(L, 1); + lua_pushstring(L, luaL_typename(L, 1)); + return 1; +} + + +static int luaB_next (lua_State *L) { + luaL_checktype(L, 1, LUA_TTABLE); + lua_settop(L, 2); /* create a 2nd argument if there isn't one */ + if (lua_next(L, 1)) + return 2; + else { + lua_pushnil(L); + return 1; + } +} + + +static int luaB_pairs (lua_State *L) { + luaL_checktype(L, 1, LUA_TTABLE); + lua_pushvalue(L, lua_upvalueindex(1)); /* return generator, */ + lua_pushvalue(L, 1); /* state, */ + lua_pushnil(L); /* and initial value */ + return 3; +} + + +static int ipairsaux (lua_State *L) { + int i = luaL_checkint(L, 2); + luaL_checktype(L, 1, LUA_TTABLE); + i++; /* next value */ + lua_pushinteger(L, i); + lua_rawgeti(L, 1, i); + return (lua_isnil(L, -1)) ? 0 : 2; +} + + +static int luaB_ipairs (lua_State *L) { + luaL_checktype(L, 1, LUA_TTABLE); + lua_pushvalue(L, lua_upvalueindex(1)); /* return generator, */ + lua_pushvalue(L, 1); /* state, */ + lua_pushinteger(L, 0); /* and initial value */ + return 3; +} + + +static int load_aux (lua_State *L, int status) { + if (status == 0) /* OK? */ + return 1; + else { + lua_pushnil(L); + lua_insert(L, -2); /* put before error message */ + return 2; /* return nil plus error message */ + } +} + + +static int luaB_loadstring (lua_State *L) { + size_t l; + const char *s = luaL_checklstring(L, 1, &l); + const char *chunkname = luaL_optstring(L, 2, s); + return load_aux(L, luaL_loadbuffer(L, s, l, chunkname)); +} + + +static int luaB_loadfile (lua_State *L) { + const char *fname = luaL_optstring(L, 1, NULL); + return load_aux(L, luaL_loadfile(L, fname)); +} + + +/* +** Reader for generic `load' function: `lua_load' uses the +** stack for internal stuff, so the reader cannot change the +** stack top. Instead, it keeps its resulting string in a +** reserved slot inside the stack. +*/ +static const char *generic_reader (lua_State *L, void *ud, size_t *size) { + (void)ud; /* to avoid warnings */ + luaL_checkstack(L, 2, "too many nested functions"); + lua_pushvalue(L, 1); /* get function */ + lua_call(L, 0, 1); /* call it */ + if (lua_isnil(L, -1)) { + *size = 0; + return NULL; + } + else if (lua_isstring(L, -1)) { + lua_replace(L, 3); /* save string in a reserved stack slot */ + return lua_tolstring(L, 3, size); + } + else luaL_error(L, "reader function must return a string"); + return NULL; /* to avoid warnings */ +} + + +static int luaB_load (lua_State *L) { + int status; + const char *cname = luaL_optstring(L, 2, "=(load)"); + luaL_checktype(L, 1, LUA_TFUNCTION); + lua_settop(L, 3); /* function, eventual name, plus one reserved slot */ + status = lua_load(L, generic_reader, NULL, cname); + return load_aux(L, status); +} + + +static int luaB_dofile (lua_State *L) { + const char *fname = luaL_optstring(L, 1, NULL); + int n = lua_gettop(L); + if (luaL_loadfile(L, fname) != 0) lua_error(L); + lua_call(L, 0, LUA_MULTRET); + return lua_gettop(L) - n; +} + + +static int luaB_assert (lua_State *L) { + luaL_checkany(L, 1); + if (!lua_toboolean(L, 1)) + return luaL_error(L, "%s", luaL_optstring(L, 2, "assertion failed!")); + return lua_gettop(L); +} + + +static int luaB_unpack (lua_State *L) { + int i, e, n; + luaL_checktype(L, 1, LUA_TTABLE); + i = luaL_optint(L, 2, 1); + e = luaL_opt(L, luaL_checkint, 3, luaL_getn(L, 1)); + if (i > e) return 0; /* empty range */ + n = e - i + 1; /* number of elements */ + if (n <= 0 || !lua_checkstack(L, n)) /* n <= 0 means arith. overflow */ + return luaL_error(L, "too many results to unpack"); + lua_rawgeti(L, 1, i); /* push arg[i] (avoiding overflow problems) */ + while (i++ < e) /* push arg[i + 1...e] */ + lua_rawgeti(L, 1, i); + return n; +} + + +static int luaB_select (lua_State *L) { + int n = lua_gettop(L); + if (lua_type(L, 1) == LUA_TSTRING && *lua_tostring(L, 1) == '#') { + lua_pushinteger(L, n-1); + return 1; + } + else { + int i = luaL_checkint(L, 1); + if (i < 0) i = n + i; + else if (i > n) i = n; + luaL_argcheck(L, 1 <= i, 1, "index out of range"); + return n - i; + } +} + + +static int luaB_pcall (lua_State *L) { + int status; + luaL_checkany(L, 1); + status = lua_pcall(L, lua_gettop(L) - 1, LUA_MULTRET, 0); + lua_pushboolean(L, (status == 0)); + lua_insert(L, 1); + return lua_gettop(L); /* return status + all results */ +} + + +static int luaB_xpcall (lua_State *L) { + int status; + luaL_checkany(L, 2); + lua_settop(L, 2); + lua_insert(L, 1); /* put error function under function to be called */ + status = lua_pcall(L, 0, LUA_MULTRET, 1); + lua_pushboolean(L, (status == 0)); + lua_replace(L, 1); + return lua_gettop(L); /* return status + all results */ +} + + +static int luaB_tostring (lua_State *L) { + luaL_checkany(L, 1); + if (luaL_callmeta(L, 1, "__tostring")) /* is there a metafield? */ + return 1; /* use its value */ + switch (lua_type(L, 1)) { + case LUA_TNUMBER: + lua_pushstring(L, lua_tostring(L, 1)); + break; + case LUA_TSTRING: + lua_pushvalue(L, 1); + break; + case LUA_TBOOLEAN: + lua_pushstring(L, (lua_toboolean(L, 1) ? "true" : "false")); + break; + case LUA_TNIL: + lua_pushliteral(L, "nil"); + break; + default: + lua_pushfstring(L, "%s: %p", luaL_typename(L, 1), lua_topointer(L, 1)); + break; + } + return 1; +} + + +static int luaB_newproxy (lua_State *L) { + lua_settop(L, 1); + lua_newuserdata(L, 0); /* create proxy */ + if (lua_toboolean(L, 1) == 0) + return 1; /* no metatable */ + else if (lua_isboolean(L, 1)) { + lua_newtable(L); /* create a new metatable `m' ... */ + lua_pushvalue(L, -1); /* ... and mark `m' as a valid metatable */ + lua_pushboolean(L, 1); + lua_rawset(L, lua_upvalueindex(1)); /* weaktable[m] = true */ + } + else { + int validproxy = 0; /* to check if weaktable[metatable(u)] == true */ + if (lua_getmetatable(L, 1)) { + lua_rawget(L, lua_upvalueindex(1)); + validproxy = lua_toboolean(L, -1); + lua_pop(L, 1); /* remove value */ + } + luaL_argcheck(L, validproxy, 1, "boolean or proxy expected"); + lua_getmetatable(L, 1); /* metatable is valid; get it */ + } + lua_setmetatable(L, 2); + return 1; +} + + +static const luaL_Reg base_funcs[] = { + {"assert", luaB_assert}, + {"collectgarbage", luaB_collectgarbage}, + {"dofile", luaB_dofile}, + {"error", luaB_error}, + {"gcinfo", luaB_gcinfo}, + {"getfenv", luaB_getfenv}, + {"getmetatable", luaB_getmetatable}, + {"loadfile", luaB_loadfile}, + {"load", luaB_load}, + {"loadstring", luaB_loadstring}, + {"next", luaB_next}, + {"pcall", luaB_pcall}, + {"print", luaB_print}, + {"rawequal", luaB_rawequal}, + {"rawget", luaB_rawget}, + {"rawset", luaB_rawset}, + {"select", luaB_select}, + {"setfenv", luaB_setfenv}, + {"setmetatable", luaB_setmetatable}, + {"tonumber", luaB_tonumber}, + {"tostring", luaB_tostring}, + {"type", luaB_type}, + {"unpack", luaB_unpack}, + {"xpcall", luaB_xpcall}, + {NULL, NULL} +}; + + +/* +** {====================================================== +** Coroutine library +** ======================================================= +*/ + +#define CO_RUN 0 /* running */ +#define CO_SUS 1 /* suspended */ +#define CO_NOR 2 /* 'normal' (it resumed another coroutine) */ +#define CO_DEAD 3 + +static const char *const statnames[] = + {"running", "suspended", "normal", "dead"}; + +static int costatus (lua_State *L, lua_State *co) { + if (L == co) return CO_RUN; + switch (lua_status(co)) { + case LUA_YIELD: + return CO_SUS; + case 0: { + lua_Debug ar; + if (lua_getstack(co, 0, &ar) > 0) /* does it have frames? */ + return CO_NOR; /* it is running */ + else if (lua_gettop(co) == 0) + return CO_DEAD; + else + return CO_SUS; /* initial state */ + } + default: /* some error occured */ + return CO_DEAD; + } +} + + +static int luaB_costatus (lua_State *L) { + lua_State *co = lua_tothread(L, 1); + luaL_argcheck(L, co, 1, "coroutine expected"); + lua_pushstring(L, statnames[costatus(L, co)]); + return 1; +} + + +static int auxresume (lua_State *L, lua_State *co, int narg) { + int status = costatus(L, co); + if (!lua_checkstack(co, narg)) + luaL_error(L, "too many arguments to resume"); + if (status != CO_SUS) { + lua_pushfstring(L, "cannot resume %s coroutine", statnames[status]); + return -1; /* error flag */ + } + lua_xmove(L, co, narg); + lua_setlevel(L, co); + status = lua_resume(co, narg); + if (status == 0 || status == LUA_YIELD) { + int nres = lua_gettop(co); + if (!lua_checkstack(L, nres + 1)) + luaL_error(L, "too many results to resume"); + lua_xmove(co, L, nres); /* move yielded values */ + return nres; + } + else { + lua_xmove(co, L, 1); /* move error message */ + return -1; /* error flag */ + } +} + + +static int luaB_coresume (lua_State *L) { + lua_State *co = lua_tothread(L, 1); + int r; + luaL_argcheck(L, co, 1, "coroutine expected"); + r = auxresume(L, co, lua_gettop(L) - 1); + if (r < 0) { + lua_pushboolean(L, 0); + lua_insert(L, -2); + return 2; /* return false + error message */ + } + else { + lua_pushboolean(L, 1); + lua_insert(L, -(r + 1)); + return r + 1; /* return true + `resume' returns */ + } +} + + +static int luaB_auxwrap (lua_State *L) { + lua_State *co = lua_tothread(L, lua_upvalueindex(1)); + int r = auxresume(L, co, lua_gettop(L)); + if (r < 0) { + if (lua_isstring(L, -1)) { /* error object is a string? */ + luaL_where(L, 1); /* add extra info */ + lua_insert(L, -2); + lua_concat(L, 2); + } + lua_error(L); /* propagate error */ + } + return r; +} + + +static int luaB_cocreate (lua_State *L) { + lua_State *NL = lua_newthread(L); + luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), 1, + "Lua function expected"); + lua_pushvalue(L, 1); /* move function to top */ + lua_xmove(L, NL, 1); /* move function from L to NL */ + return 1; +} + + +static int luaB_cowrap (lua_State *L) { + luaB_cocreate(L); + lua_pushcclosure(L, luaB_auxwrap, 1); + return 1; +} + + +static int luaB_yield (lua_State *L) { + return lua_yield(L, lua_gettop(L)); +} + + +static int luaB_corunning (lua_State *L) { + if (lua_pushthread(L)) + lua_pushnil(L); /* main thread is not a coroutine */ + return 1; +} + + +static const luaL_Reg co_funcs[] = { + {"create", luaB_cocreate}, + {"resume", luaB_coresume}, + {"running", luaB_corunning}, + {"status", luaB_costatus}, + {"wrap", luaB_cowrap}, + {"yield", luaB_yield}, + {NULL, NULL} +}; + +/* }====================================================== */ + + +static void auxopen (lua_State *L, const char *name, + lua_CFunction f, lua_CFunction u) { + lua_pushcfunction(L, u); + lua_pushcclosure(L, f, 1); + lua_setfield(L, -2, name); +} + + +static void base_open (lua_State *L) { + /* set global _G */ + lua_pushvalue(L, LUA_GLOBALSINDEX); + lua_setglobal(L, "_G"); + /* open lib into global table */ + luaL_register(L, "_G", base_funcs); + lua_pushliteral(L, LUA_VERSION); + lua_setglobal(L, "_VERSION"); /* set global _VERSION */ + /* `ipairs' and `pairs' need auxliliary functions as upvalues */ + auxopen(L, "ipairs", luaB_ipairs, ipairsaux); + auxopen(L, "pairs", luaB_pairs, luaB_next); + /* `newproxy' needs a weaktable as upvalue */ + lua_createtable(L, 0, 1); /* new table `w' */ + lua_pushvalue(L, -1); /* `w' will be its own metatable */ + lua_setmetatable(L, -2); + lua_pushliteral(L, "kv"); + lua_setfield(L, -2, "__mode"); /* metatable(w).__mode = "kv" */ + lua_pushcclosure(L, luaB_newproxy, 1); + lua_setglobal(L, "newproxy"); /* set global `newproxy' */ +} + + +LUALIB_API int luaopen_base (lua_State *L) { + base_open(L); + luaL_register(L, LUA_COLIBNAME, co_funcs); + return 2; +} + diff --git a/rpm-5.4.9/lua/lcode.c b/rpm-5.4.9/lua/lcode.c new file mode 100644 index 0000000..cff626b --- /dev/null +++ b/rpm-5.4.9/lua/lcode.c @@ -0,0 +1,839 @@ +/* +** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $ +** Code generator for Lua +** See Copyright Notice in lua.h +*/ + + +#include + +#define lcode_c +#define LUA_CORE + +#include "lua.h" + +#include "lcode.h" +#include "ldebug.h" +#include "ldo.h" +#include "lgc.h" +#include "llex.h" +#include "lmem.h" +#include "lobject.h" +#include "lopcodes.h" +#include "lparser.h" +#include "ltable.h" + + +#define hasjumps(e) ((e)->t != (e)->f) + + +static int isnumeral(expdesc *e) { + return (e->k == VKNUM && e->t == NO_JUMP && e->f == NO_JUMP); +} + + +void luaK_nil (FuncState *fs, int from, int n) { + Instruction *previous; + if (fs->pc > fs->lasttarget) { /* no jumps to current position? */ + if (fs->pc == 0) { /* function start? */ + if (from >= fs->nactvar) + return; /* positions are already clean */ + } + else { + previous = &fs->f->code[fs->pc-1]; + if (GET_OPCODE(*previous) == OP_LOADNIL) { + int pfrom = GETARG_A(*previous); + int pto = GETARG_B(*previous); + if (pfrom <= from && from <= pto+1) { /* can connect both? */ + if (from+n-1 > pto) + SETARG_B(*previous, from+n-1); + return; + } + } + } + } + luaK_codeABC(fs, OP_LOADNIL, from, from+n-1, 0); /* else no optimization */ +} + + +int luaK_jump (FuncState *fs) { + int jpc = fs->jpc; /* save list of jumps to here */ + int j; + fs->jpc = NO_JUMP; + j = luaK_codeAsBx(fs, OP_JMP, 0, NO_JUMP); + luaK_concat(fs, &j, jpc); /* keep them on hold */ + return j; +} + + +void luaK_ret (FuncState *fs, int first, int nret) { + luaK_codeABC(fs, OP_RETURN, first, nret+1, 0); +} + + +static int condjump (FuncState *fs, OpCode op, int A, int B, int C) { + luaK_codeABC(fs, op, A, B, C); + return luaK_jump(fs); +} + + +static void fixjump (FuncState *fs, int pc, int dest) { + Instruction *jmp = &fs->f->code[pc]; + int offset = dest-(pc+1); + lua_assert(dest != NO_JUMP); + if (abs(offset) > MAXARG_sBx) + luaX_syntaxerror(fs->ls, "control structure too long"); + SETARG_sBx(*jmp, offset); +} + + +/* +** returns current `pc' and marks it as a jump target (to avoid wrong +** optimizations with consecutive instructions not in the same basic block). +*/ +int luaK_getlabel (FuncState *fs) { + fs->lasttarget = fs->pc; + return fs->pc; +} + + +static int getjump (FuncState *fs, int pc) { + int offset = GETARG_sBx(fs->f->code[pc]); + if (offset == NO_JUMP) /* point to itself represents end of list */ + return NO_JUMP; /* end of list */ + else + return (pc+1)+offset; /* turn offset into absolute position */ +} + + +static Instruction *getjumpcontrol (FuncState *fs, int pc) { + Instruction *pi = &fs->f->code[pc]; + if (pc >= 1 && testTMode(GET_OPCODE(*(pi-1)))) + return pi-1; + else + return pi; +} + + +/* +** check whether list has any jump that do not produce a value +** (or produce an inverted value) +*/ +static int need_value (FuncState *fs, int list) { + for (; list != NO_JUMP; list = getjump(fs, list)) { + Instruction i = *getjumpcontrol(fs, list); + if (GET_OPCODE(i) != OP_TESTSET) return 1; + } + return 0; /* not found */ +} + + +static int patchtestreg (FuncState *fs, int node, int reg) { + Instruction *i = getjumpcontrol(fs, node); + if (GET_OPCODE(*i) != OP_TESTSET) + return 0; /* cannot patch other instructions */ + if (reg != NO_REG && reg != GETARG_B(*i)) + SETARG_A(*i, reg); + else /* no register to put value or register already has the value */ + *i = CREATE_ABC(OP_TEST, GETARG_B(*i), 0, GETARG_C(*i)); + + return 1; +} + + +static void removevalues (FuncState *fs, int list) { + for (; list != NO_JUMP; list = getjump(fs, list)) + patchtestreg(fs, list, NO_REG); +} + + +static void patchlistaux (FuncState *fs, int list, int vtarget, int reg, + int dtarget) { + while (list != NO_JUMP) { + int next = getjump(fs, list); + if (patchtestreg(fs, list, reg)) + fixjump(fs, list, vtarget); + else + fixjump(fs, list, dtarget); /* jump to default target */ + list = next; + } +} + + +static void dischargejpc (FuncState *fs) { + patchlistaux(fs, fs->jpc, fs->pc, NO_REG, fs->pc); + fs->jpc = NO_JUMP; +} + + +void luaK_patchlist (FuncState *fs, int list, int target) { + if (target == fs->pc) + luaK_patchtohere(fs, list); + else { + lua_assert(target < fs->pc); + patchlistaux(fs, list, target, NO_REG, target); + } +} + + +void luaK_patchtohere (FuncState *fs, int list) { + luaK_getlabel(fs); + luaK_concat(fs, &fs->jpc, list); +} + + +void luaK_concat (FuncState *fs, int *l1, int l2) { + if (l2 == NO_JUMP) return; + else if (*l1 == NO_JUMP) + *l1 = l2; + else { + int list = *l1; + int next; + while ((next = getjump(fs, list)) != NO_JUMP) /* find last element */ + list = next; + fixjump(fs, list, l2); + } +} + + +void luaK_checkstack (FuncState *fs, int n) { + int newstack = fs->freereg + n; + if (newstack > fs->f->maxstacksize) { + if (newstack >= MAXSTACK) + luaX_syntaxerror(fs->ls, "function or expression too complex"); + fs->f->maxstacksize = cast_byte(newstack); + } +} + + +void luaK_reserveregs (FuncState *fs, int n) { + luaK_checkstack(fs, n); + fs->freereg += n; +} + + +static void freereg (FuncState *fs, int reg) { + if (!ISK(reg) && reg >= fs->nactvar) { + fs->freereg--; + lua_assert(reg == fs->freereg); + } +} + + +static void freeexp (FuncState *fs, expdesc *e) { + if (e->k == VNONRELOC) + freereg(fs, e->u.s.info); +} + + +static int addk (FuncState *fs, TValue *k, TValue *v) { + lua_State *L = fs->L; + TValue *idx = luaH_set(L, fs->h, k); + Proto *f = fs->f; + int oldsize = f->sizek; + if (ttisnumber(idx)) { + lua_assert(luaO_rawequalObj(&fs->f->k[cast_int(nvalue(idx))], v)); + return cast_int(nvalue(idx)); + } + else { /* constant not found; create a new entry */ + setnvalue(idx, cast_num(fs->nk)); + luaM_growvector(L, f->k, fs->nk, f->sizek, TValue, + MAXARG_Bx, "constant table overflow"); + while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]); + setobj(L, &f->k[fs->nk], v); + luaC_barrier(L, f, v); + return fs->nk++; + } +} + + +int luaK_stringK (FuncState *fs, TString *s) { + TValue o; + setsvalue(fs->L, &o, s); + return addk(fs, &o, &o); +} + + +int luaK_numberK (FuncState *fs, lua_Number r) { + TValue o; + setnvalue(&o, r); + return addk(fs, &o, &o); +} + + +static int boolK (FuncState *fs, int b) { + TValue o; + setbvalue(&o, b); + return addk(fs, &o, &o); +} + + +static int nilK (FuncState *fs) { + TValue k, v; + setnilvalue(&v); + /* cannot use nil as key; instead use table itself to represent nil */ + sethvalue(fs->L, &k, fs->h); + return addk(fs, &k, &v); +} + + +void luaK_setreturns (FuncState *fs, expdesc *e, int nresults) { + if (e->k == VCALL) { /* expression is an open function call? */ + SETARG_C(getcode(fs, e), nresults+1); + } + else if (e->k == VVARARG) { + SETARG_B(getcode(fs, e), nresults+1); + SETARG_A(getcode(fs, e), fs->freereg); + luaK_reserveregs(fs, 1); + } +} + + +void luaK_setoneret (FuncState *fs, expdesc *e) { + if (e->k == VCALL) { /* expression is an open function call? */ + e->k = VNONRELOC; + e->u.s.info = GETARG_A(getcode(fs, e)); + } + else if (e->k == VVARARG) { + SETARG_B(getcode(fs, e), 2); + e->k = VRELOCABLE; /* can relocate its simple result */ + } +} + + +void luaK_dischargevars (FuncState *fs, expdesc *e) { + switch (e->k) { + case VLOCAL: { + e->k = VNONRELOC; + break; + } + case VUPVAL: { + e->u.s.info = luaK_codeABC(fs, OP_GETUPVAL, 0, e->u.s.info, 0); + e->k = VRELOCABLE; + break; + } + case VGLOBAL: { + e->u.s.info = luaK_codeABx(fs, OP_GETGLOBAL, 0, e->u.s.info); + e->k = VRELOCABLE; + break; + } + case VINDEXED: { + freereg(fs, e->u.s.aux); + freereg(fs, e->u.s.info); + e->u.s.info = luaK_codeABC(fs, OP_GETTABLE, 0, e->u.s.info, e->u.s.aux); + e->k = VRELOCABLE; + break; + } + case VVARARG: + case VCALL: { + luaK_setoneret(fs, e); + break; + } + default: break; /* there is one value available (somewhere) */ + } +} + + +static int code_label (FuncState *fs, int A, int b, int jump) { + luaK_getlabel(fs); /* those instructions may be jump targets */ + return luaK_codeABC(fs, OP_LOADBOOL, A, b, jump); +} + + +static void discharge2reg (FuncState *fs, expdesc *e, int reg) { + luaK_dischargevars(fs, e); + switch (e->k) { + case VNIL: { + luaK_nil(fs, reg, 1); + break; + } + case VFALSE: case VTRUE: { + luaK_codeABC(fs, OP_LOADBOOL, reg, e->k == VTRUE, 0); + break; + } + case VK: { + luaK_codeABx(fs, OP_LOADK, reg, e->u.s.info); + break; + } + case VKNUM: { + luaK_codeABx(fs, OP_LOADK, reg, luaK_numberK(fs, e->u.nval)); + break; + } + case VRELOCABLE: { + Instruction *pc = &getcode(fs, e); + SETARG_A(*pc, reg); + break; + } + case VNONRELOC: { + if (reg != e->u.s.info) + luaK_codeABC(fs, OP_MOVE, reg, e->u.s.info, 0); + break; + } + default: { + lua_assert(e->k == VVOID || e->k == VJMP); + return; /* nothing to do... */ + } + } + e->u.s.info = reg; + e->k = VNONRELOC; +} + + +static void discharge2anyreg (FuncState *fs, expdesc *e) { + if (e->k != VNONRELOC) { + luaK_reserveregs(fs, 1); + discharge2reg(fs, e, fs->freereg-1); + } +} + + +static void exp2reg (FuncState *fs, expdesc *e, int reg) { + discharge2reg(fs, e, reg); + if (e->k == VJMP) + luaK_concat(fs, &e->t, e->u.s.info); /* put this jump in `t' list */ + if (hasjumps(e)) { + int final; /* position after whole expression */ + int p_f = NO_JUMP; /* position of an eventual LOAD false */ + int p_t = NO_JUMP; /* position of an eventual LOAD true */ + if (need_value(fs, e->t) || need_value(fs, e->f)) { + int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs); + p_f = code_label(fs, reg, 0, 1); + p_t = code_label(fs, reg, 1, 0); + luaK_patchtohere(fs, fj); + } + final = luaK_getlabel(fs); + patchlistaux(fs, e->f, final, reg, p_f); + patchlistaux(fs, e->t, final, reg, p_t); + } + e->f = e->t = NO_JUMP; + e->u.s.info = reg; + e->k = VNONRELOC; +} + + +void luaK_exp2nextreg (FuncState *fs, expdesc *e) { + luaK_dischargevars(fs, e); + freeexp(fs, e); + luaK_reserveregs(fs, 1); + exp2reg(fs, e, fs->freereg - 1); +} + + +int luaK_exp2anyreg (FuncState *fs, expdesc *e) { + luaK_dischargevars(fs, e); + if (e->k == VNONRELOC) { + if (!hasjumps(e)) return e->u.s.info; /* exp is already in a register */ + if (e->u.s.info >= fs->nactvar) { /* reg. is not a local? */ + exp2reg(fs, e, e->u.s.info); /* put value on it */ + return e->u.s.info; + } + } + luaK_exp2nextreg(fs, e); /* default */ + return e->u.s.info; +} + + +void luaK_exp2val (FuncState *fs, expdesc *e) { + if (hasjumps(e)) + luaK_exp2anyreg(fs, e); + else + luaK_dischargevars(fs, e); +} + + +int luaK_exp2RK (FuncState *fs, expdesc *e) { + luaK_exp2val(fs, e); + switch (e->k) { + case VKNUM: + case VTRUE: + case VFALSE: + case VNIL: { + if (fs->nk <= MAXINDEXRK) { /* constant fit in RK operand? */ + e->u.s.info = (e->k == VNIL) ? nilK(fs) : + (e->k == VKNUM) ? luaK_numberK(fs, e->u.nval) : + boolK(fs, (e->k == VTRUE)); + e->k = VK; + return RKASK(e->u.s.info); + } + else break; + } + case VK: { + if (e->u.s.info <= MAXINDEXRK) /* constant fit in argC? */ + return RKASK(e->u.s.info); + else break; + } + default: break; + } + /* not a constant in the right range: put it in a register */ + return luaK_exp2anyreg(fs, e); +} + + +void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) { + switch (var->k) { + case VLOCAL: { + freeexp(fs, ex); + exp2reg(fs, ex, var->u.s.info); + return; + } + case VUPVAL: { + int e = luaK_exp2anyreg(fs, ex); + luaK_codeABC(fs, OP_SETUPVAL, e, var->u.s.info, 0); + break; + } + case VGLOBAL: { + int e = luaK_exp2anyreg(fs, ex); + luaK_codeABx(fs, OP_SETGLOBAL, e, var->u.s.info); + break; + } + case VINDEXED: { + int e = luaK_exp2RK(fs, ex); + luaK_codeABC(fs, OP_SETTABLE, var->u.s.info, var->u.s.aux, e); + break; + } + default: { + lua_assert(0); /* invalid var kind to store */ + break; + } + } + freeexp(fs, ex); +} + + +void luaK_self (FuncState *fs, expdesc *e, expdesc *key) { + int func; + luaK_exp2anyreg(fs, e); + freeexp(fs, e); + func = fs->freereg; + luaK_reserveregs(fs, 2); + luaK_codeABC(fs, OP_SELF, func, e->u.s.info, luaK_exp2RK(fs, key)); + freeexp(fs, key); + e->u.s.info = func; + e->k = VNONRELOC; +} + + +static void invertjump (FuncState *fs, expdesc *e) { + Instruction *pc = getjumpcontrol(fs, e->u.s.info); + lua_assert(testTMode(GET_OPCODE(*pc)) && GET_OPCODE(*pc) != OP_TESTSET && + GET_OPCODE(*pc) != OP_TEST); + SETARG_A(*pc, !(GETARG_A(*pc))); +} + + +static int jumponcond (FuncState *fs, expdesc *e, int cond) { + if (e->k == VRELOCABLE) { + Instruction ie = getcode(fs, e); + if (GET_OPCODE(ie) == OP_NOT) { + fs->pc--; /* remove previous OP_NOT */ + return condjump(fs, OP_TEST, GETARG_B(ie), 0, !cond); + } + /* else go through */ + } + discharge2anyreg(fs, e); + freeexp(fs, e); + return condjump(fs, OP_TESTSET, NO_REG, e->u.s.info, cond); +} + + +void luaK_goiftrue (FuncState *fs, expdesc *e) { + int pc; /* pc of last jump */ + luaK_dischargevars(fs, e); + switch (e->k) { + case VK: case VKNUM: case VTRUE: { + pc = NO_JUMP; /* always true; do nothing */ + break; + } + case VFALSE: { + pc = luaK_jump(fs); /* always jump */ + break; + } + case VJMP: { + invertjump(fs, e); + pc = e->u.s.info; + break; + } + default: { + pc = jumponcond(fs, e, 0); + break; + } + } + luaK_concat(fs, &e->f, pc); /* insert last jump in `f' list */ + luaK_patchtohere(fs, e->t); + e->t = NO_JUMP; +} + + +static void luaK_goiffalse (FuncState *fs, expdesc *e) { + int pc; /* pc of last jump */ + luaK_dischargevars(fs, e); + switch (e->k) { + case VNIL: case VFALSE: { + pc = NO_JUMP; /* always false; do nothing */ + break; + } + case VTRUE: { + pc = luaK_jump(fs); /* always jump */ + break; + } + case VJMP: { + pc = e->u.s.info; + break; + } + default: { + pc = jumponcond(fs, e, 1); + break; + } + } + luaK_concat(fs, &e->t, pc); /* insert last jump in `t' list */ + luaK_patchtohere(fs, e->f); + e->f = NO_JUMP; +} + + +static void codenot (FuncState *fs, expdesc *e) { + luaK_dischargevars(fs, e); + switch (e->k) { + case VNIL: case VFALSE: { + e->k = VTRUE; + break; + } + case VK: case VKNUM: case VTRUE: { + e->k = VFALSE; + break; + } + case VJMP: { + invertjump(fs, e); + break; + } + case VRELOCABLE: + case VNONRELOC: { + discharge2anyreg(fs, e); + freeexp(fs, e); + e->u.s.info = luaK_codeABC(fs, OP_NOT, 0, e->u.s.info, 0); + e->k = VRELOCABLE; + break; + } + default: { + lua_assert(0); /* cannot happen */ + break; + } + } + /* interchange true and false lists */ + { int temp = e->f; e->f = e->t; e->t = temp; } + removevalues(fs, e->f); + removevalues(fs, e->t); +} + + +void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { + t->u.s.aux = luaK_exp2RK(fs, k); + t->k = VINDEXED; +} + + +static int constfolding (OpCode op, expdesc *e1, expdesc *e2) { + lua_Number v1, v2, r; + if (!isnumeral(e1) || !isnumeral(e2)) return 0; + v1 = e1->u.nval; + v2 = e2->u.nval; + switch (op) { + case OP_ADD: r = luai_numadd(v1, v2); break; + case OP_SUB: r = luai_numsub(v1, v2); break; + case OP_MUL: r = luai_nummul(v1, v2); break; + case OP_DIV: + if (v2 == 0) return 0; /* do not attempt to divide by 0 */ + r = luai_numdiv(v1, v2); break; + case OP_MOD: + if (v2 == 0) return 0; /* do not attempt to divide by 0 */ + r = luai_nummod(v1, v2); break; + case OP_POW: r = luai_numpow(v1, v2); break; + case OP_UNM: r = luai_numunm(v1); break; + case OP_LEN: return 0; /* no constant folding for 'len' */ + default: lua_assert(0); r = 0; break; + } + if (luai_numisnan(r)) return 0; /* do not attempt to produce NaN */ + e1->u.nval = r; + return 1; +} + + +static void codearith (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2) { + if (constfolding(op, e1, e2)) + return; + else { + int o2 = (op != OP_UNM && op != OP_LEN) ? luaK_exp2RK(fs, e2) : 0; + int o1 = luaK_exp2RK(fs, e1); + if (o1 > o2) { + freeexp(fs, e1); + freeexp(fs, e2); + } + else { + freeexp(fs, e2); + freeexp(fs, e1); + } + e1->u.s.info = luaK_codeABC(fs, op, 0, o1, o2); + e1->k = VRELOCABLE; + } +} + + +static void codecomp (FuncState *fs, OpCode op, int cond, expdesc *e1, + expdesc *e2) { + int o1 = luaK_exp2RK(fs, e1); + int o2 = luaK_exp2RK(fs, e2); + freeexp(fs, e2); + freeexp(fs, e1); + if (cond == 0 && op != OP_EQ) { + int temp; /* exchange args to replace by `<' or `<=' */ + temp = o1; o1 = o2; o2 = temp; /* o1 <==> o2 */ + cond = 1; + } + e1->u.s.info = condjump(fs, op, cond, o1, o2); + e1->k = VJMP; +} + + +void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e) { + expdesc e2; + e2.t = e2.f = NO_JUMP; e2.k = VKNUM; e2.u.nval = 0; + switch (op) { + case OPR_MINUS: { + if (!isnumeral(e)) + luaK_exp2anyreg(fs, e); /* cannot operate on non-numeric constants */ + codearith(fs, OP_UNM, e, &e2); + break; + } + case OPR_NOT: codenot(fs, e); break; + case OPR_LEN: { + luaK_exp2anyreg(fs, e); /* cannot operate on constants */ + codearith(fs, OP_LEN, e, &e2); + break; + } + default: lua_assert(0); + } +} + + +void luaK_infix (FuncState *fs, BinOpr op, expdesc *v) { + switch (op) { + case OPR_AND: { + luaK_goiftrue(fs, v); + break; + } + case OPR_OR: { + luaK_goiffalse(fs, v); + break; + } + case OPR_CONCAT: { + luaK_exp2nextreg(fs, v); /* operand must be on the `stack' */ + break; + } + case OPR_ADD: case OPR_SUB: case OPR_MUL: case OPR_DIV: + case OPR_MOD: case OPR_POW: { + if (!isnumeral(v)) luaK_exp2RK(fs, v); + break; + } + default: { + luaK_exp2RK(fs, v); + break; + } + } +} + + +void luaK_posfix (FuncState *fs, BinOpr op, expdesc *e1, expdesc *e2) { + switch (op) { + case OPR_AND: { + lua_assert(e1->t == NO_JUMP); /* list must be closed */ + luaK_dischargevars(fs, e2); + luaK_concat(fs, &e2->f, e1->f); + *e1 = *e2; + break; + } + case OPR_OR: { + lua_assert(e1->f == NO_JUMP); /* list must be closed */ + luaK_dischargevars(fs, e2); + luaK_concat(fs, &e2->t, e1->t); + *e1 = *e2; + break; + } + case OPR_CONCAT: { + luaK_exp2val(fs, e2); + if (e2->k == VRELOCABLE && GET_OPCODE(getcode(fs, e2)) == OP_CONCAT) { + lua_assert(e1->u.s.info == GETARG_B(getcode(fs, e2))-1); + freeexp(fs, e1); + SETARG_B(getcode(fs, e2), e1->u.s.info); + e1->k = VRELOCABLE; e1->u.s.info = e2->u.s.info; + } + else { + luaK_exp2nextreg(fs, e2); /* operand must be on the 'stack' */ + codearith(fs, OP_CONCAT, e1, e2); + } + break; + } + case OPR_ADD: codearith(fs, OP_ADD, e1, e2); break; + case OPR_SUB: codearith(fs, OP_SUB, e1, e2); break; + case OPR_MUL: codearith(fs, OP_MUL, e1, e2); break; + case OPR_DIV: codearith(fs, OP_DIV, e1, e2); break; + case OPR_MOD: codearith(fs, OP_MOD, e1, e2); break; + case OPR_POW: codearith(fs, OP_POW, e1, e2); break; + case OPR_EQ: codecomp(fs, OP_EQ, 1, e1, e2); break; + case OPR_NE: codecomp(fs, OP_EQ, 0, e1, e2); break; + case OPR_LT: codecomp(fs, OP_LT, 1, e1, e2); break; + case OPR_LE: codecomp(fs, OP_LE, 1, e1, e2); break; + case OPR_GT: codecomp(fs, OP_LT, 0, e1, e2); break; + case OPR_GE: codecomp(fs, OP_LE, 0, e1, e2); break; + default: lua_assert(0); + } +} + + +void luaK_fixline (FuncState *fs, int line) { + fs->f->lineinfo[fs->pc - 1] = line; +} + + +static int luaK_code (FuncState *fs, Instruction i, int line) { + Proto *f = fs->f; + dischargejpc(fs); /* `pc' will change */ + /* put new instruction in code array */ + luaM_growvector(fs->L, f->code, fs->pc, f->sizecode, Instruction, + MAX_INT, "code size overflow"); + f->code[fs->pc] = i; + /* save corresponding line information */ + luaM_growvector(fs->L, f->lineinfo, fs->pc, f->sizelineinfo, int, + MAX_INT, "code size overflow"); + f->lineinfo[fs->pc] = line; + return fs->pc++; +} + + +int luaK_codeABC (FuncState *fs, OpCode o, int a, int b, int c) { + lua_assert(getOpMode(o) == iABC); + lua_assert(getBMode(o) != OpArgN || b == 0); + lua_assert(getCMode(o) != OpArgN || c == 0); + return luaK_code(fs, CREATE_ABC(o, a, b, c), fs->ls->lastline); +} + + +int luaK_codeABx (FuncState *fs, OpCode o, int a, unsigned int bc) { + lua_assert(getOpMode(o) == iABx || getOpMode(o) == iAsBx); + lua_assert(getCMode(o) == OpArgN); + return luaK_code(fs, CREATE_ABx(o, a, bc), fs->ls->lastline); +} + + +void luaK_setlist (FuncState *fs, int base, int nelems, int tostore) { + int c = (nelems - 1)/LFIELDS_PER_FLUSH + 1; + int b = (tostore == LUA_MULTRET) ? 0 : tostore; + lua_assert(tostore != 0); + if (c <= MAXARG_C) + luaK_codeABC(fs, OP_SETLIST, base, b, c); + else { + luaK_codeABC(fs, OP_SETLIST, base, b, 0); + luaK_code(fs, cast(Instruction, c), fs->ls->lastline); + } + fs->freereg = base + 1; /* free registers with list values */ +} + diff --git a/rpm-5.4.9/lua/lcode.h b/rpm-5.4.9/lua/lcode.h new file mode 100644 index 0000000..b941c60 --- /dev/null +++ b/rpm-5.4.9/lua/lcode.h @@ -0,0 +1,76 @@ +/* +** $Id: lcode.h,v 1.48.1.1 2007/12/27 13:02:25 roberto Exp $ +** Code generator for Lua +** See Copyright Notice in lua.h +*/ + +#ifndef lcode_h +#define lcode_h + +#include "llex.h" +#include "lobject.h" +#include "lopcodes.h" +#include "lparser.h" + + +/* +** Marks the end of a patch list. It is an invalid value both as an absolute +** address, and as a list link (would link an element to itself). +*/ +#define NO_JUMP (-1) + + +/* +** grep "ORDER OPR" if you change these enums +*/ +typedef enum BinOpr { + OPR_ADD, OPR_SUB, OPR_MUL, OPR_DIV, OPR_MOD, OPR_POW, + OPR_CONCAT, + OPR_NE, OPR_EQ, + OPR_LT, OPR_LE, OPR_GT, OPR_GE, + OPR_AND, OPR_OR, + OPR_NOBINOPR +} BinOpr; + + +typedef enum UnOpr { OPR_MINUS, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr; + + +#define getcode(fs,e) ((fs)->f->code[(e)->u.s.info]) + +#define luaK_codeAsBx(fs,o,A,sBx) luaK_codeABx(fs,o,A,(sBx)+MAXARG_sBx) + +#define luaK_setmultret(fs,e) luaK_setreturns(fs, e, LUA_MULTRET) + +LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx); +LUAI_FUNC int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C); +LUAI_FUNC void luaK_fixline (FuncState *fs, int line); +LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n); +LUAI_FUNC void luaK_reserveregs (FuncState *fs, int n); +LUAI_FUNC void luaK_checkstack (FuncState *fs, int n); +LUAI_FUNC int luaK_stringK (FuncState *fs, TString *s); +LUAI_FUNC int luaK_numberK (FuncState *fs, lua_Number r); +LUAI_FUNC void luaK_dischargevars (FuncState *fs, expdesc *e); +LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e); +LUAI_FUNC void luaK_exp2nextreg (FuncState *fs, expdesc *e); +LUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e); +LUAI_FUNC int luaK_exp2RK (FuncState *fs, expdesc *e); +LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key); +LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k); +LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e); +LUAI_FUNC void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e); +LUAI_FUNC void luaK_setreturns (FuncState *fs, expdesc *e, int nresults); +LUAI_FUNC void luaK_setoneret (FuncState *fs, expdesc *e); +LUAI_FUNC int luaK_jump (FuncState *fs); +LUAI_FUNC void luaK_ret (FuncState *fs, int first, int nret); +LUAI_FUNC void luaK_patchlist (FuncState *fs, int list, int target); +LUAI_FUNC void luaK_patchtohere (FuncState *fs, int list); +LUAI_FUNC void luaK_concat (FuncState *fs, int *l1, int l2); +LUAI_FUNC int luaK_getlabel (FuncState *fs); +LUAI_FUNC void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v); +LUAI_FUNC void luaK_infix (FuncState *fs, BinOpr op, expdesc *v); +LUAI_FUNC void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2); +LUAI_FUNC void luaK_setlist (FuncState *fs, int base, int nelems, int tostore); + + +#endif diff --git a/rpm-5.4.9/lua/ldblib.c b/rpm-5.4.9/lua/ldblib.c new file mode 100644 index 0000000..67de122 --- /dev/null +++ b/rpm-5.4.9/lua/ldblib.c @@ -0,0 +1,397 @@ +/* +** $Id: ldblib.c,v 1.104.1.3 2008/01/21 13:11:21 roberto Exp $ +** Interface from Lua to its debug API +** See Copyright Notice in lua.h +*/ + + +#include +#include +#include + +#define ldblib_c +#define LUA_LIB + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + + +static int db_getregistry (lua_State *L) { + lua_pushvalue(L, LUA_REGISTRYINDEX); + return 1; +} + + +static int db_getmetatable (lua_State *L) { + luaL_checkany(L, 1); + if (!lua_getmetatable(L, 1)) { + lua_pushnil(L); /* no metatable */ + } + return 1; +} + + +static int db_setmetatable (lua_State *L) { + int t = lua_type(L, 2); + luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2, + "nil or table expected"); + lua_settop(L, 2); + lua_pushboolean(L, lua_setmetatable(L, 1)); + return 1; +} + + +static int db_getfenv (lua_State *L) { + lua_getfenv(L, 1); + return 1; +} + + +static int db_setfenv (lua_State *L) { + luaL_checktype(L, 2, LUA_TTABLE); + lua_settop(L, 2); + if (lua_setfenv(L, 1) == 0) + luaL_error(L, LUA_QL("setfenv") + " cannot change environment of given object"); + return 1; +} + + +static void settabss (lua_State *L, const char *i, const char *v) { + lua_pushstring(L, v); + lua_setfield(L, -2, i); +} + + +static void settabsi (lua_State *L, const char *i, int v) { + lua_pushinteger(L, v); + lua_setfield(L, -2, i); +} + + +static lua_State *getthread (lua_State *L, int *arg) { + if (lua_isthread(L, 1)) { + *arg = 1; + return lua_tothread(L, 1); + } + else { + *arg = 0; + return L; + } +} + + +static void treatstackoption (lua_State *L, lua_State *L1, const char *fname) { + if (L == L1) { + lua_pushvalue(L, -2); + lua_remove(L, -3); + } + else + lua_xmove(L1, L, 1); + lua_setfield(L, -2, fname); +} + + +static int db_getinfo (lua_State *L) { + lua_Debug ar; + int arg; + lua_State *L1 = getthread(L, &arg); + const char *options = luaL_optstring(L, arg+2, "flnSu"); + if (lua_isnumber(L, arg+1)) { + if (!lua_getstack(L1, (int)lua_tointeger(L, arg+1), &ar)) { + lua_pushnil(L); /* level out of range */ + return 1; + } + } + else if (lua_isfunction(L, arg+1)) { + lua_pushfstring(L, ">%s", options); + options = lua_tostring(L, -1); + lua_pushvalue(L, arg+1); + lua_xmove(L, L1, 1); + } + else + return luaL_argerror(L, arg+1, "function or level expected"); + if (!lua_getinfo(L1, options, &ar)) + return luaL_argerror(L, arg+2, "invalid option"); + lua_createtable(L, 0, 2); + if (strchr(options, 'S')) { + settabss(L, "source", ar.source); + settabss(L, "short_src", ar.short_src); + settabsi(L, "linedefined", ar.linedefined); + settabsi(L, "lastlinedefined", ar.lastlinedefined); + settabss(L, "what", ar.what); + } + if (strchr(options, 'l')) + settabsi(L, "currentline", ar.currentline); + if (strchr(options, 'u')) + settabsi(L, "nups", ar.nups); + if (strchr(options, 'n')) { + settabss(L, "name", ar.name); + settabss(L, "namewhat", ar.namewhat); + } + if (strchr(options, 'L')) + treatstackoption(L, L1, "activelines"); + if (strchr(options, 'f')) + treatstackoption(L, L1, "func"); + return 1; /* return table */ +} + + +static int db_getlocal (lua_State *L) { + int arg; + lua_State *L1 = getthread(L, &arg); + lua_Debug ar; + const char *name; + if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar)) /* out of range? */ + return luaL_argerror(L, arg+1, "level out of range"); + name = lua_getlocal(L1, &ar, luaL_checkint(L, arg+2)); + if (name) { + lua_xmove(L1, L, 1); + lua_pushstring(L, name); + lua_pushvalue(L, -2); + return 2; + } + else { + lua_pushnil(L); + return 1; + } +} + + +static int db_setlocal (lua_State *L) { + int arg; + lua_State *L1 = getthread(L, &arg); + lua_Debug ar; + if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar)) /* out of range? */ + return luaL_argerror(L, arg+1, "level out of range"); + luaL_checkany(L, arg+3); + lua_settop(L, arg+3); + lua_xmove(L, L1, 1); + lua_pushstring(L, lua_setlocal(L1, &ar, luaL_checkint(L, arg+2))); + return 1; +} + + +static int auxupvalue (lua_State *L, int get) { + const char *name; + int n = luaL_checkint(L, 2); + luaL_checktype(L, 1, LUA_TFUNCTION); + if (lua_iscfunction(L, 1)) return 0; /* cannot touch C upvalues from Lua */ + name = get ? lua_getupvalue(L, 1, n) : lua_setupvalue(L, 1, n); + if (name == NULL) return 0; + lua_pushstring(L, name); + lua_insert(L, -(get+1)); + return get + 1; +} + + +static int db_getupvalue (lua_State *L) { + return auxupvalue(L, 1); +} + + +static int db_setupvalue (lua_State *L) { + luaL_checkany(L, 3); + return auxupvalue(L, 0); +} + + + +static const char KEY_HOOK = 'h'; + + +static void hookf (lua_State *L, lua_Debug *ar) { + static const char *const hooknames[] = + {"call", "return", "line", "count", "tail return"}; + lua_pushlightuserdata(L, (void *)&KEY_HOOK); + lua_rawget(L, LUA_REGISTRYINDEX); + lua_pushlightuserdata(L, L); + lua_rawget(L, -2); + if (lua_isfunction(L, -1)) { + lua_pushstring(L, hooknames[(int)ar->event]); + if (ar->currentline >= 0) + lua_pushinteger(L, ar->currentline); + else lua_pushnil(L); + lua_assert(lua_getinfo(L, "lS", ar)); + lua_call(L, 2, 0); + } +} + + +static int makemask (const char *smask, int count) { + int mask = 0; + if (strchr(smask, 'c')) mask |= LUA_MASKCALL; + if (strchr(smask, 'r')) mask |= LUA_MASKRET; + if (strchr(smask, 'l')) mask |= LUA_MASKLINE; + if (count > 0) mask |= LUA_MASKCOUNT; + return mask; +} + + +static char *unmakemask (int mask, char *smask) { + int i = 0; + if (mask & LUA_MASKCALL) smask[i++] = 'c'; + if (mask & LUA_MASKRET) smask[i++] = 'r'; + if (mask & LUA_MASKLINE) smask[i++] = 'l'; + smask[i] = '\0'; + return smask; +} + + +static void gethooktable (lua_State *L) { + lua_pushlightuserdata(L, (void *)&KEY_HOOK); + lua_rawget(L, LUA_REGISTRYINDEX); + if (!lua_istable(L, -1)) { + lua_pop(L, 1); + lua_createtable(L, 0, 1); + lua_pushlightuserdata(L, (void *)&KEY_HOOK); + lua_pushvalue(L, -2); + lua_rawset(L, LUA_REGISTRYINDEX); + } +} + + +static int db_sethook (lua_State *L) { + int arg, mask, count; + lua_Hook func; + lua_State *L1 = getthread(L, &arg); + if (lua_isnoneornil(L, arg+1)) { + lua_settop(L, arg+1); + func = NULL; mask = 0; count = 0; /* turn off hooks */ + } + else { + const char *smask = luaL_checkstring(L, arg+2); + luaL_checktype(L, arg+1, LUA_TFUNCTION); + count = luaL_optint(L, arg+3, 0); + func = hookf; mask = makemask(smask, count); + } + gethooktable(L); + lua_pushlightuserdata(L, L1); + lua_pushvalue(L, arg+1); + lua_rawset(L, -3); /* set new hook */ + lua_pop(L, 1); /* remove hook table */ + lua_sethook(L1, func, mask, count); /* set hooks */ + return 0; +} + + +static int db_gethook (lua_State *L) { + int arg; + lua_State *L1 = getthread(L, &arg); + char buff[5]; + int mask = lua_gethookmask(L1); + lua_Hook hook = lua_gethook(L1); + if (hook != NULL && hook != hookf) /* external hook? */ + lua_pushliteral(L, "external hook"); + else { + gethooktable(L); + lua_pushlightuserdata(L, L1); + lua_rawget(L, -2); /* get hook */ + lua_remove(L, -2); /* remove hook table */ + } + lua_pushstring(L, unmakemask(mask, buff)); + lua_pushinteger(L, lua_gethookcount(L1)); + return 3; +} + + +static int db_debug (lua_State *L) { + for (;;) { + char buffer[250]; + fputs("lua_debug> ", stderr); + if (fgets(buffer, sizeof(buffer), stdin) == 0 || + strcmp(buffer, "cont\n") == 0) + return 0; + if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") || + lua_pcall(L, 0, 0, 0)) { + fputs(lua_tostring(L, -1), stderr); + fputs("\n", stderr); + } + lua_settop(L, 0); /* remove eventual returns */ + } +} + + +#define LEVELS1 12 /* size of the first part of the stack */ +#define LEVELS2 10 /* size of the second part of the stack */ + +static int db_errorfb (lua_State *L) { + int level; + int firstpart = 1; /* still before eventual `...' */ + int arg; + lua_State *L1 = getthread(L, &arg); + lua_Debug ar; + if (lua_isnumber(L, arg+2)) { + level = (int)lua_tointeger(L, arg+2); + lua_pop(L, 1); + } + else + level = (L == L1) ? 1 : 0; /* level 0 may be this own function */ + if (lua_gettop(L) == arg) + lua_pushliteral(L, ""); + else if (!lua_isstring(L, arg+1)) return 1; /* message is not a string */ + else lua_pushliteral(L, "\n"); + lua_pushliteral(L, "stack traceback:"); + while (lua_getstack(L1, level++, &ar)) { + if (level > LEVELS1 && firstpart) { + /* no more than `LEVELS2' more levels? */ + if (!lua_getstack(L1, level+LEVELS2, &ar)) + level--; /* keep going */ + else { + lua_pushliteral(L, "\n\t..."); /* too many levels */ + while (lua_getstack(L1, level+LEVELS2, &ar)) /* find last levels */ + level++; + } + firstpart = 0; + continue; + } + lua_pushliteral(L, "\n\t"); + lua_getinfo(L1, "Snl", &ar); + lua_pushfstring(L, "%s:", ar.short_src); + if (ar.currentline > 0) + lua_pushfstring(L, "%d:", ar.currentline); + if (*ar.namewhat != '\0') /* is there a name? */ + lua_pushfstring(L, " in function " LUA_QS, ar.name); + else { + if (*ar.what == 'm') /* main? */ + lua_pushfstring(L, " in main chunk"); + else if (*ar.what == 'C' || *ar.what == 't') + lua_pushliteral(L, " ?"); /* C function or tail call */ + else + lua_pushfstring(L, " in function <%s:%d>", + ar.short_src, ar.linedefined); + } + lua_concat(L, lua_gettop(L) - arg); + } + lua_concat(L, lua_gettop(L) - arg); + return 1; +} + + +static const luaL_Reg dblib[] = { + {"debug", db_debug}, + {"getfenv", db_getfenv}, + {"gethook", db_gethook}, + {"getinfo", db_getinfo}, + {"getlocal", db_getlocal}, + {"getregistry", db_getregistry}, + {"getmetatable", db_getmetatable}, + {"getupvalue", db_getupvalue}, + {"setfenv", db_setfenv}, + {"sethook", db_sethook}, + {"setlocal", db_setlocal}, + {"setmetatable", db_setmetatable}, + {"setupvalue", db_setupvalue}, + {"traceback", db_errorfb}, + {NULL, NULL} +}; + + +LUALIB_API int luaopen_debug (lua_State *L) { + luaL_register(L, LUA_DBLIBNAME, dblib); + return 1; +} + diff --git a/rpm-5.4.9/lua/ldebug.c b/rpm-5.4.9/lua/ldebug.c new file mode 100644 index 0000000..50ad3d3 --- /dev/null +++ b/rpm-5.4.9/lua/ldebug.c @@ -0,0 +1,638 @@ +/* +** $Id: ldebug.c,v 2.29.1.6 2008/05/08 16:56:26 roberto Exp $ +** Debug Interface +** See Copyright Notice in lua.h +*/ + + +#include +#include +#include + + +#define ldebug_c +#define LUA_CORE + +#include "lua.h" + +#include "lapi.h" +#include "lcode.h" +#include "ldebug.h" +#include "ldo.h" +#include "lfunc.h" +#include "lobject.h" +#include "lopcodes.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" +#include "ltm.h" +#include "lvm.h" + + + +static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name); + + +static int currentpc (lua_State *L, CallInfo *ci) { + if (!isLua(ci)) return -1; /* function is not a Lua function? */ + if (ci == L->ci) + ci->savedpc = L->savedpc; + return pcRel(ci->savedpc, ci_func(ci)->l.p); +} + + +static int currentline (lua_State *L, CallInfo *ci) { + int pc = currentpc(L, ci); + if (pc < 0) + return -1; /* only active lua functions have current-line information */ + else + return getline(ci_func(ci)->l.p, pc); +} + + +/* +** this function can be called asynchronous (e.g. during a signal) +*/ +LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count) { + if (func == NULL || mask == 0) { /* turn off hooks? */ + mask = 0; + func = NULL; + } + L->hook = func; + L->basehookcount = count; + resethookcount(L); + L->hookmask = cast_byte(mask); + return 1; +} + + +LUA_API lua_Hook lua_gethook (lua_State *L) { + return L->hook; +} + + +LUA_API int lua_gethookmask (lua_State *L) { + return L->hookmask; +} + + +LUA_API int lua_gethookcount (lua_State *L) { + return L->basehookcount; +} + + +LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar) { + int status; + CallInfo *ci; + lua_lock(L); + for (ci = L->ci; level > 0 && ci > L->base_ci; ci--) { + level--; + if (f_isLua(ci)) /* Lua function? */ + level -= ci->tailcalls; /* skip lost tail calls */ + } + if (level == 0 && ci > L->base_ci) { /* level found? */ + status = 1; + ar->i_ci = cast_int(ci - L->base_ci); + } + else if (level < 0) { /* level is of a lost tail call? */ + status = 1; + ar->i_ci = 0; + } + else status = 0; /* no such level */ + lua_unlock(L); + return status; +} + + +static Proto *getluaproto (CallInfo *ci) { + return (isLua(ci) ? ci_func(ci)->l.p : NULL); +} + + +static const char *findlocal (lua_State *L, CallInfo *ci, int n) { + const char *name; + Proto *fp = getluaproto(ci); + if (fp && (name = luaF_getlocalname(fp, n, currentpc(L, ci))) != NULL) + return name; /* is a local variable in a Lua function */ + else { + StkId limit = (ci == L->ci) ? L->top : (ci+1)->func; + if (limit - ci->base >= n && n > 0) /* is 'n' inside 'ci' stack? */ + return "(*temporary)"; + else + return NULL; + } +} + + +LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) { + CallInfo *ci = L->base_ci + ar->i_ci; + const char *name = findlocal(L, ci, n); + lua_lock(L); + if (name) + luaA_pushobject(L, ci->base + (n - 1)); + lua_unlock(L); + return name; +} + + +LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) { + CallInfo *ci = L->base_ci + ar->i_ci; + const char *name = findlocal(L, ci, n); + lua_lock(L); + if (name) + setobjs2s(L, ci->base + (n - 1), L->top - 1); + L->top--; /* pop value */ + lua_unlock(L); + return name; +} + + +static void funcinfo (lua_Debug *ar, Closure *cl) { + if (cl->c.isC) { + ar->source = "=[C]"; + ar->linedefined = -1; + ar->lastlinedefined = -1; + ar->what = "C"; + } + else { + ar->source = getstr(cl->l.p->source); + ar->linedefined = cl->l.p->linedefined; + ar->lastlinedefined = cl->l.p->lastlinedefined; + ar->what = (ar->linedefined == 0) ? "main" : "Lua"; + } + luaO_chunkid(ar->short_src, ar->source, LUA_IDSIZE); +} + + +static void info_tailcall (lua_Debug *ar) { + ar->name = ar->namewhat = ""; + ar->what = "tail"; + ar->lastlinedefined = ar->linedefined = ar->currentline = -1; + ar->source = "=(tail call)"; + luaO_chunkid(ar->short_src, ar->source, LUA_IDSIZE); + ar->nups = 0; +} + + +static void collectvalidlines (lua_State *L, Closure *f) { + if (f == NULL || f->c.isC) { + setnilvalue(L->top); + } + else { + Table *t = luaH_new(L, 0, 0); + int *lineinfo = f->l.p->lineinfo; + int i; + for (i=0; il.p->sizelineinfo; i++) + setbvalue(luaH_setnum(L, t, lineinfo[i]), 1); + sethvalue(L, L->top, t); + } + incr_top(L); +} + + +static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar, + Closure *f, CallInfo *ci) { + int status = 1; + if (f == NULL) { + info_tailcall(ar); + return status; + } + for (; *what; what++) { + switch (*what) { + case 'S': { + funcinfo(ar, f); + break; + } + case 'l': { + ar->currentline = (ci) ? currentline(L, ci) : -1; + break; + } + case 'u': { + ar->nups = f->c.nupvalues; + break; + } + case 'n': { + ar->namewhat = (ci) ? getfuncname(L, ci, &ar->name) : NULL; + if (ar->namewhat == NULL) { + ar->namewhat = ""; /* not found */ + ar->name = NULL; + } + break; + } + case 'L': + case 'f': /* handled by lua_getinfo */ + break; + default: status = 0; /* invalid option */ + } + } + return status; +} + + +LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) { + int status; + Closure *f = NULL; + CallInfo *ci = NULL; + lua_lock(L); + if (*what == '>') { + StkId func = L->top - 1; + luai_apicheck(L, ttisfunction(func)); + what++; /* skip the '>' */ + f = clvalue(func); + L->top--; /* pop function */ + } + else if (ar->i_ci != 0) { /* no tail call? */ + ci = L->base_ci + ar->i_ci; + lua_assert(ttisfunction(ci->func)); + f = clvalue(ci->func); + } + status = auxgetinfo(L, what, ar, f, ci); + if (strchr(what, 'f')) { + if (f == NULL) setnilvalue(L->top); + else setclvalue(L, L->top, f); + incr_top(L); + } + if (strchr(what, 'L')) + collectvalidlines(L, f); + lua_unlock(L); + return status; +} + + +/* +** {====================================================== +** Symbolic Execution and code checker +** ======================================================= +*/ + +#define check(x) if (!(x)) return 0; + +#define checkjump(pt,pc) check(0 <= pc && pc < pt->sizecode) + +#define checkreg(pt,reg) check((reg) < (pt)->maxstacksize) + + + +static int precheck (const Proto *pt) { + check(pt->maxstacksize <= MAXSTACK); + check(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize); + check(!(pt->is_vararg & VARARG_NEEDSARG) || + (pt->is_vararg & VARARG_HASARG)); + check(pt->sizeupvalues <= pt->nups); + check(pt->sizelineinfo == pt->sizecode || pt->sizelineinfo == 0); + check(pt->sizecode > 0 && GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN); + return 1; +} + + +#define checkopenop(pt,pc) luaG_checkopenop((pt)->code[(pc)+1]) + +int luaG_checkopenop (Instruction i) { + switch (GET_OPCODE(i)) { + case OP_CALL: + case OP_TAILCALL: + case OP_RETURN: + case OP_SETLIST: { + check(GETARG_B(i) == 0); + return 1; + } + default: return 0; /* invalid instruction after an open call */ + } +} + + +static int checkArgMode (const Proto *pt, int r, enum OpArgMask mode) { + switch (mode) { + case OpArgN: check(r == 0); break; + case OpArgU: break; + case OpArgR: checkreg(pt, r); break; + case OpArgK: + check(ISK(r) ? INDEXK(r) < pt->sizek : r < pt->maxstacksize); + break; + } + return 1; +} + + +static Instruction symbexec (const Proto *pt, int lastpc, int reg) { + int pc; + int last; /* stores position of last instruction that changed `reg' */ + last = pt->sizecode-1; /* points to final return (a `neutral' instruction) */ + check(precheck(pt)); + for (pc = 0; pc < lastpc; pc++) { + Instruction i = pt->code[pc]; + OpCode op = GET_OPCODE(i); + int a = GETARG_A(i); + int b = 0; + int c = 0; + check(op < NUM_OPCODES); + checkreg(pt, a); + switch (getOpMode(op)) { + case iABC: { + b = GETARG_B(i); + c = GETARG_C(i); + check(checkArgMode(pt, b, getBMode(op))); + check(checkArgMode(pt, c, getCMode(op))); + break; + } + case iABx: { + b = GETARG_Bx(i); + if (getBMode(op) == OpArgK) check(b < pt->sizek); + break; + } + case iAsBx: { + b = GETARG_sBx(i); + if (getBMode(op) == OpArgR) { + int dest = pc+1+b; + check(0 <= dest && dest < pt->sizecode); + if (dest > 0) { + int j; + /* check that it does not jump to a setlist count; this + is tricky, because the count from a previous setlist may + have the same value of an invalid setlist; so, we must + go all the way back to the first of them (if any) */ + for (j = 0; j < dest; j++) { + Instruction d = pt->code[dest-1-j]; + if (!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0)) break; + } + /* if 'j' is even, previous value is not a setlist (even if + it looks like one) */ + check((j&1) == 0); + } + } + break; + } + } + if (testAMode(op)) { + if (a == reg) last = pc; /* change register `a' */ + } + if (testTMode(op)) { + check(pc+2 < pt->sizecode); /* check skip */ + check(GET_OPCODE(pt->code[pc+1]) == OP_JMP); + } + switch (op) { + case OP_LOADBOOL: { + if (c == 1) { /* does it jump? */ + check(pc+2 < pt->sizecode); /* check its jump */ + check(GET_OPCODE(pt->code[pc+1]) != OP_SETLIST || + GETARG_C(pt->code[pc+1]) != 0); + } + break; + } + case OP_LOADNIL: { + if (a <= reg && reg <= b) + last = pc; /* set registers from `a' to `b' */ + break; + } + case OP_GETUPVAL: + case OP_SETUPVAL: { + check(b < pt->nups); + break; + } + case OP_GETGLOBAL: + case OP_SETGLOBAL: { + check(ttisstring(&pt->k[b])); + break; + } + case OP_SELF: { + checkreg(pt, a+1); + if (reg == a+1) last = pc; + break; + } + case OP_CONCAT: { + check(b < c); /* at least two operands */ + break; + } + case OP_TFORLOOP: { + check(c >= 1); /* at least one result (control variable) */ + checkreg(pt, a+2+c); /* space for results */ + if (reg >= a+2) last = pc; /* affect all regs above its base */ + break; + } + case OP_FORLOOP: + case OP_FORPREP: + checkreg(pt, a+3); + /* go through */ + case OP_JMP: { + int dest = pc+1+b; + /* not full check and jump is forward and do not skip `lastpc'? */ + if (reg != NO_REG && pc < dest && dest <= lastpc) + pc += b; /* do the jump */ + break; + } + case OP_CALL: + case OP_TAILCALL: { + if (b != 0) { + checkreg(pt, a+b-1); + } + c--; /* c = num. returns */ + if (c == LUA_MULTRET) { + check(checkopenop(pt, pc)); + } + else if (c != 0) + checkreg(pt, a+c-1); + if (reg >= a) last = pc; /* affect all registers above base */ + break; + } + case OP_RETURN: { + b--; /* b = num. returns */ + if (b > 0) checkreg(pt, a+b-1); + break; + } + case OP_SETLIST: { + if (b > 0) checkreg(pt, a + b); + if (c == 0) { + pc++; + check(pc < pt->sizecode - 1); + } + break; + } + case OP_CLOSURE: { + int nup, j; + check(b < pt->sizep); + nup = pt->p[b]->nups; + check(pc + nup < pt->sizecode); + for (j = 1; j <= nup; j++) { + OpCode op1 = GET_OPCODE(pt->code[pc + j]); + check(op1 == OP_GETUPVAL || op1 == OP_MOVE); + } + if (reg != NO_REG) /* tracing? */ + pc += nup; /* do not 'execute' these pseudo-instructions */ + break; + } + case OP_VARARG: { + check((pt->is_vararg & VARARG_ISVARARG) && + !(pt->is_vararg & VARARG_NEEDSARG)); + b--; + if (b == LUA_MULTRET) check(checkopenop(pt, pc)); + checkreg(pt, a+b-1); + break; + } + default: break; + } + } + return pt->code[last]; +} + +#undef check +#undef checkjump +#undef checkreg + +/* }====================================================== */ + + +int luaG_checkcode (const Proto *pt) { + return (symbexec(pt, pt->sizecode, NO_REG) != 0); +} + + +static const char *kname (Proto *p, int c) { + if (ISK(c) && ttisstring(&p->k[INDEXK(c)])) + return svalue(&p->k[INDEXK(c)]); + else + return "?"; +} + + +static const char *getobjname (lua_State *L, CallInfo *ci, int stackpos, + const char **name) { + if (isLua(ci)) { /* a Lua function? */ + Proto *p = ci_func(ci)->l.p; + int pc = currentpc(L, ci); + Instruction i; + *name = luaF_getlocalname(p, stackpos+1, pc); + if (*name) /* is a local? */ + return "local"; + i = symbexec(p, pc, stackpos); /* try symbolic execution */ + lua_assert(pc != -1); + switch (GET_OPCODE(i)) { + case OP_GETGLOBAL: { + int g = GETARG_Bx(i); /* global index */ + lua_assert(ttisstring(&p->k[g])); + *name = svalue(&p->k[g]); + return "global"; + } + case OP_MOVE: { + int a = GETARG_A(i); + int b = GETARG_B(i); /* move from `b' to `a' */ + if (b < a) + return getobjname(L, ci, b, name); /* get name for `b' */ + break; + } + case OP_GETTABLE: { + int k = GETARG_C(i); /* key index */ + *name = kname(p, k); + return "field"; + } + case OP_GETUPVAL: { + int u = GETARG_B(i); /* upvalue index */ + *name = p->upvalues ? getstr(p->upvalues[u]) : "?"; + return "upvalue"; + } + case OP_SELF: { + int k = GETARG_C(i); /* key index */ + *name = kname(p, k); + return "method"; + } + default: break; + } + } + return NULL; /* no useful name found */ +} + + +static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) { + Instruction i; + if ((isLua(ci) && ci->tailcalls > 0) || !isLua(ci - 1)) + return NULL; /* calling function is not Lua (or is unknown) */ + ci--; /* calling function */ + i = ci_func(ci)->l.p->code[currentpc(L, ci)]; + if (GET_OPCODE(i) == OP_CALL || GET_OPCODE(i) == OP_TAILCALL || + GET_OPCODE(i) == OP_TFORLOOP) + return getobjname(L, ci, GETARG_A(i), name); + else + return NULL; /* no useful name can be found */ +} + + +/* only ANSI way to check whether a pointer points to an array */ +static int isinstack (CallInfo *ci, const TValue *o) { + StkId p; + for (p = ci->base; p < ci->top; p++) + if (o == p) return 1; + return 0; +} + + +void luaG_typeerror (lua_State *L, const TValue *o, const char *op) { + const char *name = NULL; + const char *t = luaT_typenames[ttype(o)]; + const char *kind = (isinstack(L->ci, o)) ? + getobjname(L, L->ci, cast_int(o - L->base), &name) : + NULL; + if (kind) + luaG_runerror(L, "attempt to %s %s " LUA_QS " (a %s value)", + op, kind, name, t); + else + luaG_runerror(L, "attempt to %s a %s value", op, t); +} + + +void luaG_concaterror (lua_State *L, StkId p1, StkId p2) { + if (ttisstring(p1) || ttisnumber(p1)) p1 = p2; + lua_assert(!ttisstring(p1) && !ttisnumber(p1)); + luaG_typeerror(L, p1, "concatenate"); +} + + +void luaG_aritherror (lua_State *L, const TValue *p1, const TValue *p2) { + TValue temp; + if (luaV_tonumber(p1, &temp) == NULL) + p2 = p1; /* first operand is wrong */ + luaG_typeerror(L, p2, "perform arithmetic on"); +} + + +int luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2) { + const char *t1 = luaT_typenames[ttype(p1)]; + const char *t2 = luaT_typenames[ttype(p2)]; + if (t1[2] == t2[2]) + luaG_runerror(L, "attempt to compare two %s values", t1); + else + luaG_runerror(L, "attempt to compare %s with %s", t1, t2); + return 0; +} + + +static void addinfo (lua_State *L, const char *msg) { + CallInfo *ci = L->ci; + if (isLua(ci)) { /* is Lua code? */ + char buff[LUA_IDSIZE]; /* add file:line information */ + int line = currentline(L, ci); + luaO_chunkid(buff, getstr(getluaproto(ci)->source), LUA_IDSIZE); + luaO_pushfstring(L, "%s:%d: %s", buff, line, msg); + } +} + + +void luaG_errormsg (lua_State *L) { + if (L->errfunc != 0) { /* is there an error handling function? */ + StkId errfunc = restorestack(L, L->errfunc); + if (!ttisfunction(errfunc)) luaD_throw(L, LUA_ERRERR); + setobjs2s(L, L->top, L->top - 1); /* move argument */ + setobjs2s(L, L->top - 1, errfunc); /* push function */ + incr_top(L); + luaD_call(L, L->top - 2, 1); /* call it */ + } + luaD_throw(L, LUA_ERRRUN); +} + + +void luaG_runerror (lua_State *L, const char *fmt, ...) { + va_list argp; + va_start(argp, fmt); + addinfo(L, luaO_pushvfstring(L, fmt, argp)); + va_end(argp); + luaG_errormsg(L); +} + diff --git a/rpm-5.4.9/lua/ldebug.h b/rpm-5.4.9/lua/ldebug.h new file mode 100644 index 0000000..ba28a97 --- /dev/null +++ b/rpm-5.4.9/lua/ldebug.h @@ -0,0 +1,33 @@ +/* +** $Id: ldebug.h,v 2.3.1.1 2007/12/27 13:02:25 roberto Exp $ +** Auxiliary functions from Debug Interface module +** See Copyright Notice in lua.h +*/ + +#ifndef ldebug_h +#define ldebug_h + + +#include "lstate.h" + + +#define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1) + +#define getline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0) + +#define resethookcount(L) (L->hookcount = L->basehookcount) + + +LUAI_FUNC void luaG_typeerror (lua_State *L, const TValue *o, + const char *opname); +LUAI_FUNC void luaG_concaterror (lua_State *L, StkId p1, StkId p2); +LUAI_FUNC void luaG_aritherror (lua_State *L, const TValue *p1, + const TValue *p2); +LUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1, + const TValue *p2); +LUAI_FUNC void luaG_runerror (lua_State *L, const char *fmt, ...); +LUAI_FUNC void luaG_errormsg (lua_State *L); +LUAI_FUNC int luaG_checkcode (const Proto *pt); +LUAI_FUNC int luaG_checkopenop (Instruction i); + +#endif diff --git a/rpm-5.4.9/lua/ldo.c b/rpm-5.4.9/lua/ldo.c new file mode 100644 index 0000000..8de05f7 --- /dev/null +++ b/rpm-5.4.9/lua/ldo.c @@ -0,0 +1,518 @@ +/* +** $Id: ldo.c,v 2.38.1.3 2008/01/18 22:31:22 roberto Exp $ +** Stack and Call structure of Lua +** See Copyright Notice in lua.h +*/ + + +#include +#include +#include + +#define ldo_c +#define LUA_CORE + +#include "lua.h" + +#include "ldebug.h" +#include "ldo.h" +#include "lfunc.h" +#include "lgc.h" +#include "lmem.h" +#include "lobject.h" +#include "lopcodes.h" +#include "lparser.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" +#include "ltm.h" +#include "lundump.h" +#include "lvm.h" +#include "lzio.h" + + + + +/* +** {====================================================== +** Error-recovery functions +** ======================================================= +*/ + + +/* chain list of long jump buffers */ +struct lua_longjmp { + struct lua_longjmp *previous; + luai_jmpbuf b; + volatile int status; /* error code */ +}; + + +void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop) { + switch (errcode) { + case LUA_ERRMEM: { + setsvalue2s(L, oldtop, luaS_newliteral(L, MEMERRMSG)); + break; + } + case LUA_ERRERR: { + setsvalue2s(L, oldtop, luaS_newliteral(L, "error in error handling")); + break; + } + case LUA_ERRSYNTAX: + case LUA_ERRRUN: { + setobjs2s(L, oldtop, L->top - 1); /* error message on current top */ + break; + } + } + L->top = oldtop + 1; +} + + +static void restore_stack_limit (lua_State *L) { + lua_assert(L->stack_last - L->stack == L->stacksize - EXTRA_STACK - 1); + if (L->size_ci > LUAI_MAXCALLS) { /* there was an overflow? */ + int inuse = cast_int(L->ci - L->base_ci); + if (inuse + 1 < LUAI_MAXCALLS) /* can `undo' overflow? */ + luaD_reallocCI(L, LUAI_MAXCALLS); + } +} + + +static void resetstack (lua_State *L, int status) { + L->ci = L->base_ci; + L->base = L->ci->base; + luaF_close(L, L->base); /* close eventual pending closures */ + luaD_seterrorobj(L, status, L->base); + L->nCcalls = L->baseCcalls; + L->allowhook = 1; + restore_stack_limit(L); + L->errfunc = 0; + L->errorJmp = NULL; +} + + +void luaD_throw (lua_State *L, int errcode) { + if (L->errorJmp) { + L->errorJmp->status = errcode; + LUAI_THROW(L, L->errorJmp); + } + else { + L->status = cast_byte(errcode); + if (G(L)->panic) { + resetstack(L, errcode); + lua_unlock(L); + G(L)->panic(L); + } + exit(EXIT_FAILURE); + } +} + + +int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) { + struct lua_longjmp lj; + lj.status = 0; + lj.previous = L->errorJmp; /* chain new error handler */ + L->errorJmp = &lj; + LUAI_TRY(L, &lj, + (*f)(L, ud); + ); + L->errorJmp = lj.previous; /* restore old error handler */ + return lj.status; +} + +/* }====================================================== */ + + +static void correctstack (lua_State *L, TValue *oldstack) { + CallInfo *ci; + GCObject *up; + L->top = (L->top - oldstack) + L->stack; + for (up = L->openupval; up != NULL; up = up->gch.next) + gco2uv(up)->v = (gco2uv(up)->v - oldstack) + L->stack; + for (ci = L->base_ci; ci <= L->ci; ci++) { + ci->top = (ci->top - oldstack) + L->stack; + ci->base = (ci->base - oldstack) + L->stack; + ci->func = (ci->func - oldstack) + L->stack; + } + L->base = (L->base - oldstack) + L->stack; +} + + +void luaD_reallocstack (lua_State *L, int newsize) { + TValue *oldstack = L->stack; + int realsize = newsize + 1 + EXTRA_STACK; + lua_assert(L->stack_last - L->stack == L->stacksize - EXTRA_STACK - 1); + luaM_reallocvector(L, L->stack, L->stacksize, realsize, TValue); + L->stacksize = realsize; + L->stack_last = L->stack+newsize; + correctstack(L, oldstack); +} + + +void luaD_reallocCI (lua_State *L, int newsize) { + CallInfo *oldci = L->base_ci; + luaM_reallocvector(L, L->base_ci, L->size_ci, newsize, CallInfo); + L->size_ci = newsize; + L->ci = (L->ci - oldci) + L->base_ci; + L->end_ci = L->base_ci + L->size_ci - 1; +} + + +void luaD_growstack (lua_State *L, int n) { + if (n <= L->stacksize) /* double size is enough? */ + luaD_reallocstack(L, 2*L->stacksize); + else + luaD_reallocstack(L, L->stacksize + n); +} + + +static CallInfo *growCI (lua_State *L) { + if (L->size_ci > LUAI_MAXCALLS) /* overflow while handling overflow? */ + luaD_throw(L, LUA_ERRERR); + else { + luaD_reallocCI(L, 2*L->size_ci); + if (L->size_ci > LUAI_MAXCALLS) + luaG_runerror(L, "stack overflow"); + } + return ++L->ci; +} + + +void luaD_callhook (lua_State *L, int event, int line) { + lua_Hook hook = L->hook; + if (hook && L->allowhook) { + ptrdiff_t top = savestack(L, L->top); + ptrdiff_t ci_top = savestack(L, L->ci->top); + lua_Debug ar; + ar.event = event; + ar.currentline = line; + if (event == LUA_HOOKTAILRET) + ar.i_ci = 0; /* tail call; no debug information about it */ + else + ar.i_ci = cast_int(L->ci - L->base_ci); + luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ + L->ci->top = L->top + LUA_MINSTACK; + lua_assert(L->ci->top <= L->stack_last); + L->allowhook = 0; /* cannot call hooks inside a hook */ + lua_unlock(L); + (*hook)(L, &ar); + lua_lock(L); + lua_assert(!L->allowhook); + L->allowhook = 1; + L->ci->top = restorestack(L, ci_top); + L->top = restorestack(L, top); + } +} + + +static StkId adjust_varargs (lua_State *L, Proto *p, int actual) { + int i; + int nfixargs = p->numparams; + Table *htab = NULL; + StkId base, fixed; + for (; actual < nfixargs; ++actual) + setnilvalue(L->top++); +#if defined(LUA_COMPAT_VARARG) + if (p->is_vararg & VARARG_NEEDSARG) { /* compat. with old-style vararg? */ + int nvar = actual - nfixargs; /* number of extra arguments */ + lua_assert(p->is_vararg & VARARG_HASARG); + luaC_checkGC(L); + htab = luaH_new(L, nvar, 1); /* create `arg' table */ + for (i=0; itop - nvar + i); + /* store counter in field `n' */ + setnvalue(luaH_setstr(L, htab, luaS_newliteral(L, "n")), cast_num(nvar)); + } +#endif + /* move fixed parameters to final position */ + fixed = L->top - actual; /* first fixed argument */ + base = L->top; /* final position of first argument */ + for (i=0; itop++, fixed+i); + setnilvalue(fixed+i); + } + /* add `arg' parameter */ + if (htab) { + sethvalue(L, L->top++, htab); + lua_assert(iswhite(obj2gco(htab))); + } + return base; +} + + +static StkId tryfuncTM (lua_State *L, StkId func) { + const TValue *tm = luaT_gettmbyobj(L, func, TM_CALL); + StkId p; + ptrdiff_t funcr = savestack(L, func); + if (!ttisfunction(tm)) + luaG_typeerror(L, func, "call"); + /* Open a hole inside the stack at `func' */ + for (p = L->top; p > func; p--) setobjs2s(L, p, p-1); + incr_top(L); + func = restorestack(L, funcr); /* previous call may change stack */ + setobj2s(L, func, tm); /* tag method is the new function to be called */ + return func; +} + + + +#define inc_ci(L) \ + ((L->ci == L->end_ci) ? growCI(L) : \ + (condhardstacktests(luaD_reallocCI(L, L->size_ci)), ++L->ci)) + + +int luaD_precall (lua_State *L, StkId func, int nresults) { + LClosure *cl; + ptrdiff_t funcr; + if (!ttisfunction(func)) /* `func' is not a function? */ + func = tryfuncTM(L, func); /* check the `function' tag method */ + funcr = savestack(L, func); + cl = &clvalue(func)->l; + L->ci->savedpc = L->savedpc; + if (!cl->isC) { /* Lua function? prepare its call */ + CallInfo *ci; + StkId st, base; + Proto *p = cl->p; + luaD_checkstack(L, p->maxstacksize); + func = restorestack(L, funcr); + if (!p->is_vararg) { /* no varargs? */ + base = func + 1; + if (L->top > base + p->numparams) + L->top = base + p->numparams; + } + else { /* vararg function */ + int nargs = cast_int(L->top - func) - 1; + base = adjust_varargs(L, p, nargs); + func = restorestack(L, funcr); /* previous call may change the stack */ + } + ci = inc_ci(L); /* now `enter' new function */ + ci->func = func; + L->base = ci->base = base; + ci->top = L->base + p->maxstacksize; + lua_assert(ci->top <= L->stack_last); + L->savedpc = p->code; /* starting point */ + ci->tailcalls = 0; + ci->nresults = nresults; + for (st = L->top; st < ci->top; st++) + setnilvalue(st); + L->top = ci->top; + if (L->hookmask & LUA_MASKCALL) { + L->savedpc++; /* hooks assume 'pc' is already incremented */ + luaD_callhook(L, LUA_HOOKCALL, -1); + L->savedpc--; /* correct 'pc' */ + } + return PCRLUA; + } + else { /* if is a C function, call it */ + CallInfo *ci; + int n; + luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ + ci = inc_ci(L); /* now `enter' new function */ + ci->func = restorestack(L, funcr); + L->base = ci->base = ci->func + 1; + ci->top = L->top + LUA_MINSTACK; + lua_assert(ci->top <= L->stack_last); + ci->nresults = nresults; + if (L->hookmask & LUA_MASKCALL) + luaD_callhook(L, LUA_HOOKCALL, -1); + lua_unlock(L); + n = (*curr_func(L)->c.f)(L); /* do the actual call */ + lua_lock(L); + if (n < 0) /* yielding? */ + return PCRYIELD; + else { + luaD_poscall(L, L->top - n); + return PCRC; + } + } +} + + +static StkId callrethooks (lua_State *L, StkId firstResult) { + ptrdiff_t fr = savestack(L, firstResult); /* next call may change stack */ + luaD_callhook(L, LUA_HOOKRET, -1); + if (f_isLua(L->ci)) { /* Lua function? */ + while ((L->hookmask & LUA_MASKRET) && L->ci->tailcalls--) /* tail calls */ + luaD_callhook(L, LUA_HOOKTAILRET, -1); + } + return restorestack(L, fr); +} + + +int luaD_poscall (lua_State *L, StkId firstResult) { + StkId res; + int wanted, i; + CallInfo *ci; + if (L->hookmask & LUA_MASKRET) + firstResult = callrethooks(L, firstResult); + ci = L->ci--; + res = ci->func; /* res == final position of 1st result */ + wanted = ci->nresults; + L->base = (ci - 1)->base; /* restore base */ + L->savedpc = (ci - 1)->savedpc; /* restore savedpc */ + /* move results to correct place */ + for (i = wanted; i != 0 && firstResult < L->top; i--) + setobjs2s(L, res++, firstResult++); + while (i-- > 0) + setnilvalue(res++); + L->top = res; + return (wanted - LUA_MULTRET); /* 0 iff wanted == LUA_MULTRET */ +} + + +/* +** Call a function (C or Lua). The function to be called is at *func. +** The arguments are on the stack, right after the function. +** When returns, all the results are on the stack, starting at the original +** function position. +*/ +void luaD_call (lua_State *L, StkId func, int nResults) { + if (++L->nCcalls >= LUAI_MAXCCALLS) { + if (L->nCcalls == LUAI_MAXCCALLS) + luaG_runerror(L, "C stack overflow"); + else if (L->nCcalls >= (LUAI_MAXCCALLS + (LUAI_MAXCCALLS>>3))) + luaD_throw(L, LUA_ERRERR); /* error while handing stack error */ + } + if (luaD_precall(L, func, nResults) == PCRLUA) /* is a Lua function? */ + luaV_execute(L, 1); /* call it */ + L->nCcalls--; + luaC_checkGC(L); +} + + +static void resume (lua_State *L, void *ud) { + StkId firstArg = cast(StkId, ud); + CallInfo *ci = L->ci; + if (L->status == 0) { /* start coroutine? */ + lua_assert(ci == L->base_ci && firstArg > L->base); + if (luaD_precall(L, firstArg - 1, LUA_MULTRET) != PCRLUA) + return; + } + else { /* resuming from previous yield */ + lua_assert(L->status == LUA_YIELD); + L->status = 0; + if (!f_isLua(ci)) { /* `common' yield? */ + /* finish interrupted execution of `OP_CALL' */ + lua_assert(GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_CALL || + GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_TAILCALL); + if (luaD_poscall(L, firstArg)) /* complete it... */ + L->top = L->ci->top; /* and correct top if not multiple results */ + } + else /* yielded inside a hook: just continue its execution */ + L->base = L->ci->base; + } + luaV_execute(L, cast_int(L->ci - L->base_ci)); +} + + +static int resume_error (lua_State *L, const char *msg) { + L->top = L->ci->base; + setsvalue2s(L, L->top, luaS_new(L, msg)); + incr_top(L); + lua_unlock(L); + return LUA_ERRRUN; +} + + +LUA_API int lua_resume (lua_State *L, int nargs) { + int status; + lua_lock(L); + if (L->status != LUA_YIELD && (L->status != 0 || L->ci != L->base_ci)) + return resume_error(L, "cannot resume non-suspended coroutine"); + if (L->nCcalls >= LUAI_MAXCCALLS) + return resume_error(L, "C stack overflow"); + luai_userstateresume(L, nargs); + lua_assert(L->errfunc == 0); + L->baseCcalls = ++L->nCcalls; + status = luaD_rawrunprotected(L, resume, L->top - nargs); + if (status != 0) { /* error? */ + L->status = cast_byte(status); /* mark thread as `dead' */ + luaD_seterrorobj(L, status, L->top); + L->ci->top = L->top; + } + else { + lua_assert(L->nCcalls == L->baseCcalls); + status = L->status; + } + --L->nCcalls; + lua_unlock(L); + return status; +} + + +LUA_API int lua_yield (lua_State *L, int nresults) { + luai_userstateyield(L, nresults); + lua_lock(L); + if (L->nCcalls > L->baseCcalls) + luaG_runerror(L, "attempt to yield across metamethod/C-call boundary"); + L->base = L->top - nresults; /* protect stack slots below */ + L->status = LUA_YIELD; + lua_unlock(L); + return -1; +} + + +int luaD_pcall (lua_State *L, Pfunc func, void *u, + ptrdiff_t old_top, ptrdiff_t ef) { + int status; + unsigned short oldnCcalls = L->nCcalls; + ptrdiff_t old_ci = saveci(L, L->ci); + lu_byte old_allowhooks = L->allowhook; + ptrdiff_t old_errfunc = L->errfunc; + L->errfunc = ef; + status = luaD_rawrunprotected(L, func, u); + if (status != 0) { /* an error occurred? */ + StkId oldtop = restorestack(L, old_top); + luaF_close(L, oldtop); /* close eventual pending closures */ + luaD_seterrorobj(L, status, oldtop); + L->nCcalls = oldnCcalls; + L->ci = restoreci(L, old_ci); + L->base = L->ci->base; + L->savedpc = L->ci->savedpc; + L->allowhook = old_allowhooks; + restore_stack_limit(L); + } + L->errfunc = old_errfunc; + return status; +} + + + +/* +** Execute a protected parser. +*/ +struct SParser { /* data to `f_parser' */ + ZIO *z; + Mbuffer buff; /* buffer to be used by the scanner */ + const char *name; +}; + +static void f_parser (lua_State *L, void *ud) { + int i; + Proto *tf; + Closure *cl; + struct SParser *p = cast(struct SParser *, ud); + int c = luaZ_lookahead(p->z); + luaC_checkGC(L); + tf = ((c == LUA_SIGNATURE[0]) ? luaU_undump : luaY_parser)(L, p->z, + &p->buff, p->name); + cl = luaF_newLclosure(L, tf->nups, hvalue(gt(L))); + cl->l.p = tf; + for (i = 0; i < tf->nups; i++) /* initialize eventual upvalues */ + cl->l.upvals[i] = luaF_newupval(L); + setclvalue(L, L->top, cl); + incr_top(L); +} + + +int luaD_protectedparser (lua_State *L, ZIO *z, const char *name) { + struct SParser p; + int status; + p.z = z; p.name = name; + luaZ_initbuffer(L, &p.buff); + status = luaD_pcall(L, f_parser, &p, savestack(L, L->top), L->errfunc); + luaZ_freebuffer(L, &p.buff); + return status; +} + + diff --git a/rpm-5.4.9/lua/ldo.h b/rpm-5.4.9/lua/ldo.h new file mode 100644 index 0000000..98fddac --- /dev/null +++ b/rpm-5.4.9/lua/ldo.h @@ -0,0 +1,57 @@ +/* +** $Id: ldo.h,v 2.7.1.1 2007/12/27 13:02:25 roberto Exp $ +** Stack and Call structure of Lua +** See Copyright Notice in lua.h +*/ + +#ifndef ldo_h +#define ldo_h + + +#include "lobject.h" +#include "lstate.h" +#include "lzio.h" + + +#define luaD_checkstack(L,n) \ + if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \ + luaD_growstack(L, n); \ + else condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); + + +#define incr_top(L) {luaD_checkstack(L,1); L->top++;} + +#define savestack(L,p) ((char *)(p) - (char *)L->stack) +#define restorestack(L,n) ((TValue *)((char *)L->stack + (n))) + +#define saveci(L,p) ((char *)(p) - (char *)L->base_ci) +#define restoreci(L,n) ((CallInfo *)((char *)L->base_ci + (n))) + + +/* results from luaD_precall */ +#define PCRLUA 0 /* initiated a call to a Lua function */ +#define PCRC 1 /* did a call to a C function */ +#define PCRYIELD 2 /* C funtion yielded */ + + +/* type of protected functions, to be ran by `runprotected' */ +typedef void (*Pfunc) (lua_State *L, void *ud); + +LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name); +LUAI_FUNC void luaD_callhook (lua_State *L, int event, int line); +LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults); +LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults); +LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u, + ptrdiff_t oldtop, ptrdiff_t ef); +LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult); +LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize); +LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize); +LUAI_FUNC void luaD_growstack (lua_State *L, int n); + +LUAI_FUNC void luaD_throw (lua_State *L, int errcode); +LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); + +LUAI_FUNC void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop); + +#endif + diff --git a/rpm-5.4.9/lua/ldump.c b/rpm-5.4.9/lua/ldump.c new file mode 100644 index 0000000..c9d3d48 --- /dev/null +++ b/rpm-5.4.9/lua/ldump.c @@ -0,0 +1,164 @@ +/* +** $Id: ldump.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $ +** save precompiled Lua chunks +** See Copyright Notice in lua.h +*/ + +#include + +#define ldump_c +#define LUA_CORE + +#include "lua.h" + +#include "lobject.h" +#include "lstate.h" +#include "lundump.h" + +typedef struct { + lua_State* L; + lua_Writer writer; + void* data; + int strip; + int status; +} DumpState; + +#define DumpMem(b,n,size,D) DumpBlock(b,(n)*(size),D) +#define DumpVar(x,D) DumpMem(&x,1,sizeof(x),D) + +static void DumpBlock(const void* b, size_t size, DumpState* D) +{ + if (D->status==0) + { + lua_unlock(D->L); + D->status=(*D->writer)(D->L,b,size,D->data); + lua_lock(D->L); + } +} + +static void DumpChar(int y, DumpState* D) +{ + char x=(char)y; + DumpVar(x,D); +} + +static void DumpInt(int x, DumpState* D) +{ + DumpVar(x,D); +} + +static void DumpNumber(lua_Number x, DumpState* D) +{ + DumpVar(x,D); +} + +static void DumpVector(const void* b, int n, size_t size, DumpState* D) +{ + DumpInt(n,D); + DumpMem(b,n,size,D); +} + +static void DumpString(const TString* s, DumpState* D) +{ + if (s==NULL || getstr(s)==NULL) + { + size_t size=0; + DumpVar(size,D); + } + else + { + size_t size=s->tsv.len+1; /* include trailing '\0' */ + DumpVar(size,D); + DumpBlock(getstr(s),size,D); + } +} + +#define DumpCode(f,D) DumpVector(f->code,f->sizecode,sizeof(Instruction),D) + +static void DumpFunction(const Proto* f, const TString* p, DumpState* D); + +static void DumpConstants(const Proto* f, DumpState* D) +{ + int i,n=f->sizek; + DumpInt(n,D); + for (i=0; ik[i]; + DumpChar(ttype(o),D); + switch (ttype(o)) + { + case LUA_TNIL: + break; + case LUA_TBOOLEAN: + DumpChar(bvalue(o),D); + break; + case LUA_TNUMBER: + DumpNumber(nvalue(o),D); + break; + case LUA_TSTRING: + DumpString(rawtsvalue(o),D); + break; + default: + lua_assert(0); /* cannot happen */ + break; + } + } + n=f->sizep; + DumpInt(n,D); + for (i=0; ip[i],f->source,D); +} + +static void DumpDebug(const Proto* f, DumpState* D) +{ + int i,n; + n= (D->strip) ? 0 : f->sizelineinfo; + DumpVector(f->lineinfo,n,sizeof(int),D); + n= (D->strip) ? 0 : f->sizelocvars; + DumpInt(n,D); + for (i=0; ilocvars[i].varname,D); + DumpInt(f->locvars[i].startpc,D); + DumpInt(f->locvars[i].endpc,D); + } + n= (D->strip) ? 0 : f->sizeupvalues; + DumpInt(n,D); + for (i=0; iupvalues[i],D); +} + +static void DumpFunction(const Proto* f, const TString* p, DumpState* D) +{ + DumpString((f->source==p || D->strip) ? NULL : f->source,D); + DumpInt(f->linedefined,D); + DumpInt(f->lastlinedefined,D); + DumpChar(f->nups,D); + DumpChar(f->numparams,D); + DumpChar(f->is_vararg,D); + DumpChar(f->maxstacksize,D); + DumpCode(f,D); + DumpConstants(f,D); + DumpDebug(f,D); +} + +static void DumpHeader(DumpState* D) +{ + char h[LUAC_HEADERSIZE]; + luaU_header(h); + DumpBlock(h,LUAC_HEADERSIZE,D); +} + +/* +** dump Lua function as precompiled chunk +*/ +int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip) +{ + DumpState D; + D.L=L; + D.writer=w; + D.data=data; + D.strip=strip; + D.status=0; + DumpHeader(&D); + DumpFunction(f,NULL,&D); + return D.status; +} diff --git a/rpm-5.4.9/lua/lfunc.c b/rpm-5.4.9/lua/lfunc.c new file mode 100644 index 0000000..813e88f --- /dev/null +++ b/rpm-5.4.9/lua/lfunc.c @@ -0,0 +1,174 @@ +/* +** $Id: lfunc.c,v 2.12.1.2 2007/12/28 14:58:43 roberto Exp $ +** Auxiliary functions to manipulate prototypes and closures +** See Copyright Notice in lua.h +*/ + + +#include + +#define lfunc_c +#define LUA_CORE + +#include "lua.h" + +#include "lfunc.h" +#include "lgc.h" +#include "lmem.h" +#include "lobject.h" +#include "lstate.h" + + + +Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e) { + Closure *c = cast(Closure *, luaM_malloc(L, sizeCclosure(nelems))); + luaC_link(L, obj2gco(c), LUA_TFUNCTION); + c->c.isC = 1; + c->c.env = e; + c->c.nupvalues = cast_byte(nelems); + return c; +} + + +Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e) { + Closure *c = cast(Closure *, luaM_malloc(L, sizeLclosure(nelems))); + luaC_link(L, obj2gco(c), LUA_TFUNCTION); + c->l.isC = 0; + c->l.env = e; + c->l.nupvalues = cast_byte(nelems); + while (nelems--) c->l.upvals[nelems] = NULL; + return c; +} + + +UpVal *luaF_newupval (lua_State *L) { + UpVal *uv = luaM_new(L, UpVal); + luaC_link(L, obj2gco(uv), LUA_TUPVAL); + uv->v = &uv->u.value; + setnilvalue(uv->v); + return uv; +} + + +UpVal *luaF_findupval (lua_State *L, StkId level) { + global_State *g = G(L); + GCObject **pp = &L->openupval; + UpVal *p; + UpVal *uv; + while (*pp != NULL && (p = ngcotouv(*pp))->v >= level) { + lua_assert(p->v != &p->u.value); + if (p->v == level) { /* found a corresponding upvalue? */ + if (isdead(g, obj2gco(p))) /* is it dead? */ + changewhite(obj2gco(p)); /* ressurect it */ + return p; + } + pp = &p->next; + } + uv = luaM_new(L, UpVal); /* not found: create a new one */ + uv->tt = LUA_TUPVAL; + uv->marked = luaC_white(g); + uv->v = level; /* current value lives in the stack */ + uv->next = *pp; /* chain it in the proper position */ + *pp = obj2gco(uv); + uv->u.l.prev = &g->uvhead; /* double link it in `uvhead' list */ + uv->u.l.next = g->uvhead.u.l.next; + uv->u.l.next->u.l.prev = uv; + g->uvhead.u.l.next = uv; + lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); + return uv; +} + + +static void unlinkupval (UpVal *uv) { + lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); + uv->u.l.next->u.l.prev = uv->u.l.prev; /* remove from `uvhead' list */ + uv->u.l.prev->u.l.next = uv->u.l.next; +} + + +void luaF_freeupval (lua_State *L, UpVal *uv) { + if (uv->v != &uv->u.value) /* is it open? */ + unlinkupval(uv); /* remove from open list */ + luaM_free(L, uv); /* free upvalue */ +} + + +void luaF_close (lua_State *L, StkId level) { + UpVal *uv; + global_State *g = G(L); + while (L->openupval != NULL && (uv = ngcotouv(L->openupval))->v >= level) { + GCObject *o = obj2gco(uv); + lua_assert(!isblack(o) && uv->v != &uv->u.value); + L->openupval = uv->next; /* remove from `open' list */ + if (isdead(g, o)) + luaF_freeupval(L, uv); /* free upvalue */ + else { + unlinkupval(uv); + setobj(L, &uv->u.value, uv->v); + uv->v = &uv->u.value; /* now current value lives here */ + luaC_linkupval(L, uv); /* link upvalue into `gcroot' list */ + } + } +} + + +Proto *luaF_newproto (lua_State *L) { + Proto *f = luaM_new(L, Proto); + luaC_link(L, obj2gco(f), LUA_TPROTO); + f->k = NULL; + f->sizek = 0; + f->p = NULL; + f->sizep = 0; + f->code = NULL; + f->sizecode = 0; + f->sizelineinfo = 0; + f->sizeupvalues = 0; + f->nups = 0; + f->upvalues = NULL; + f->numparams = 0; + f->is_vararg = 0; + f->maxstacksize = 0; + f->lineinfo = NULL; + f->sizelocvars = 0; + f->locvars = NULL; + f->linedefined = 0; + f->lastlinedefined = 0; + f->source = NULL; + return f; +} + + +void luaF_freeproto (lua_State *L, Proto *f) { + luaM_freearray(L, f->code, f->sizecode, Instruction); + luaM_freearray(L, f->p, f->sizep, Proto *); + luaM_freearray(L, f->k, f->sizek, TValue); + luaM_freearray(L, f->lineinfo, f->sizelineinfo, int); + luaM_freearray(L, f->locvars, f->sizelocvars, struct LocVar); + luaM_freearray(L, f->upvalues, f->sizeupvalues, TString *); + luaM_free(L, f); +} + + +void luaF_freeclosure (lua_State *L, Closure *c) { + int size = (c->c.isC) ? sizeCclosure(c->c.nupvalues) : + sizeLclosure(c->l.nupvalues); + luaM_freemem(L, c, size); +} + + +/* +** Look for n-th local variable at line `line' in function `func'. +** Returns NULL if not found. +*/ +const char *luaF_getlocalname (const Proto *f, int local_number, int pc) { + int i; + for (i = 0; isizelocvars && f->locvars[i].startpc <= pc; i++) { + if (pc < f->locvars[i].endpc) { /* is variable active? */ + local_number--; + if (local_number == 0) + return getstr(f->locvars[i].varname); + } + } + return NULL; /* not found */ +} + diff --git a/rpm-5.4.9/lua/lfunc.h b/rpm-5.4.9/lua/lfunc.h new file mode 100644 index 0000000..a68cf51 --- /dev/null +++ b/rpm-5.4.9/lua/lfunc.h @@ -0,0 +1,34 @@ +/* +** $Id: lfunc.h,v 2.4.1.1 2007/12/27 13:02:25 roberto Exp $ +** Auxiliary functions to manipulate prototypes and closures +** See Copyright Notice in lua.h +*/ + +#ifndef lfunc_h +#define lfunc_h + + +#include "lobject.h" + + +#define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \ + cast(int, sizeof(TValue)*((n)-1))) + +#define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \ + cast(int, sizeof(TValue *)*((n)-1))) + + +LUAI_FUNC Proto *luaF_newproto (lua_State *L); +LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e); +LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e); +LUAI_FUNC UpVal *luaF_newupval (lua_State *L); +LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); +LUAI_FUNC void luaF_close (lua_State *L, StkId level); +LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); +LUAI_FUNC void luaF_freeclosure (lua_State *L, Closure *c); +LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv); +LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, + int pc); + + +#endif diff --git a/rpm-5.4.9/lua/lgc.c b/rpm-5.4.9/lua/lgc.c new file mode 100644 index 0000000..d9e0b78 --- /dev/null +++ b/rpm-5.4.9/lua/lgc.c @@ -0,0 +1,711 @@ +/* +** $Id: lgc.c,v 2.38.1.1 2007/12/27 13:02:25 roberto Exp $ +** Garbage Collector +** See Copyright Notice in lua.h +*/ + +#include + +#define lgc_c +#define LUA_CORE + +#include "lua.h" + +#include "ldebug.h" +#include "ldo.h" +#include "lfunc.h" +#include "lgc.h" +#include "lmem.h" +#include "lobject.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" +#include "ltm.h" + + +#define GCSTEPSIZE 1024u +#define GCSWEEPMAX 40 +#define GCSWEEPCOST 10 +#define GCFINALIZECOST 100 + + +#define maskmarks cast_byte(~(bitmask(BLACKBIT)|WHITEBITS)) + +#define makewhite(g,x) \ + ((x)->gch.marked = cast_byte(((x)->gch.marked & maskmarks) | luaC_white(g))) + +#define white2gray(x) reset2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT) +#define black2gray(x) resetbit((x)->gch.marked, BLACKBIT) + +#define stringmark(s) reset2bits((s)->tsv.marked, WHITE0BIT, WHITE1BIT) + + +#define isfinalized(u) testbit((u)->marked, FINALIZEDBIT) +#define markfinalized(u) l_setbit((u)->marked, FINALIZEDBIT) + + +#define KEYWEAK bitmask(KEYWEAKBIT) +#define VALUEWEAK bitmask(VALUEWEAKBIT) + + + +#define markvalue(g,o) { checkconsistency(o); \ + if (iscollectable(o) && iswhite(gcvalue(o))) reallymarkobject(g,gcvalue(o)); } + +#define markobject(g,t) { if (iswhite(obj2gco(t))) \ + reallymarkobject(g, obj2gco(t)); } + + +#define setthreshold(g) (g->GCthreshold = (g->estimate/100) * g->gcpause) + + +static void removeentry (Node *n) { + lua_assert(ttisnil(gval(n))); + if (iscollectable(gkey(n))) + setttype(gkey(n), LUA_TDEADKEY); /* dead key; remove it */ +} + + +static void reallymarkobject (global_State *g, GCObject *o) { + lua_assert(iswhite(o) && !isdead(g, o)); + white2gray(o); + switch (o->gch.tt) { + case LUA_TSTRING: { + return; + } + case LUA_TUSERDATA: { + Table *mt = gco2u(o)->metatable; + gray2black(o); /* udata are never gray */ + if (mt) markobject(g, mt); + markobject(g, gco2u(o)->env); + return; + } + case LUA_TUPVAL: { + UpVal *uv = gco2uv(o); + markvalue(g, uv->v); + if (uv->v == &uv->u.value) /* closed? */ + gray2black(o); /* open upvalues are never black */ + return; + } + case LUA_TFUNCTION: { + gco2cl(o)->c.gclist = g->gray; + g->gray = o; + break; + } + case LUA_TTABLE: { + gco2h(o)->gclist = g->gray; + g->gray = o; + break; + } + case LUA_TTHREAD: { + gco2th(o)->gclist = g->gray; + g->gray = o; + break; + } + case LUA_TPROTO: { + gco2p(o)->gclist = g->gray; + g->gray = o; + break; + } + default: lua_assert(0); + } +} + + +static void marktmu (global_State *g) { + GCObject *u = g->tmudata; + if (u) { + do { + u = u->gch.next; + makewhite(g, u); /* may be marked, if left from previous GC */ + reallymarkobject(g, u); + } while (u != g->tmudata); + } +} + + +/* move `dead' udata that need finalization to list `tmudata' */ +size_t luaC_separateudata (lua_State *L, int all) { + global_State *g = G(L); + size_t deadmem = 0; + GCObject **p = &g->mainthread->next; + GCObject *curr; + while ((curr = *p) != NULL) { + if (!(iswhite(curr) || all) || isfinalized(gco2u(curr))) + p = &curr->gch.next; /* don't bother with them */ + else if (fasttm(L, gco2u(curr)->metatable, TM_GC) == NULL) { + markfinalized(gco2u(curr)); /* don't need finalization */ + p = &curr->gch.next; + } + else { /* must call its gc method */ + deadmem += sizeudata(gco2u(curr)); + markfinalized(gco2u(curr)); + *p = curr->gch.next; + /* link `curr' at the end of `tmudata' list */ + if (g->tmudata == NULL) /* list is empty? */ + g->tmudata = curr->gch.next = curr; /* creates a circular list */ + else { + curr->gch.next = g->tmudata->gch.next; + g->tmudata->gch.next = curr; + g->tmudata = curr; + } + } + } + return deadmem; +} + + +static int traversetable (global_State *g, Table *h) { + int i; + int weakkey = 0; + int weakvalue = 0; + const TValue *mode; + if (h->metatable) + markobject(g, h->metatable); + mode = gfasttm(g, h->metatable, TM_MODE); + if (mode && ttisstring(mode)) { /* is there a weak mode? */ + weakkey = (strchr(svalue(mode), 'k') != NULL); + weakvalue = (strchr(svalue(mode), 'v') != NULL); + if (weakkey || weakvalue) { /* is really weak? */ + h->marked &= ~(KEYWEAK | VALUEWEAK); /* clear bits */ + h->marked |= cast_byte((weakkey << KEYWEAKBIT) | + (weakvalue << VALUEWEAKBIT)); + h->gclist = g->weak; /* must be cleared after GC, ... */ + g->weak = obj2gco(h); /* ... so put in the appropriate list */ + } + } + if (weakkey && weakvalue) return 1; + if (!weakvalue) { + i = h->sizearray; + while (i--) + markvalue(g, &h->array[i]); + } + i = sizenode(h); + while (i--) { + Node *n = gnode(h, i); + lua_assert(ttype(gkey(n)) != LUA_TDEADKEY || ttisnil(gval(n))); + if (ttisnil(gval(n))) + removeentry(n); /* remove empty entries */ + else { + lua_assert(!ttisnil(gkey(n))); + if (!weakkey) markvalue(g, gkey(n)); + if (!weakvalue) markvalue(g, gval(n)); + } + } + return weakkey || weakvalue; +} + + +/* +** All marks are conditional because a GC may happen while the +** prototype is still being created +*/ +static void traverseproto (global_State *g, Proto *f) { + int i; + if (f->source) stringmark(f->source); + for (i=0; isizek; i++) /* mark literals */ + markvalue(g, &f->k[i]); + for (i=0; isizeupvalues; i++) { /* mark upvalue names */ + if (f->upvalues[i]) + stringmark(f->upvalues[i]); + } + for (i=0; isizep; i++) { /* mark nested protos */ + if (f->p[i]) + markobject(g, f->p[i]); + } + for (i=0; isizelocvars; i++) { /* mark local-variable names */ + if (f->locvars[i].varname) + stringmark(f->locvars[i].varname); + } +} + + + +static void traverseclosure (global_State *g, Closure *cl) { + markobject(g, cl->c.env); + if (cl->c.isC) { + int i; + for (i=0; ic.nupvalues; i++) /* mark its upvalues */ + markvalue(g, &cl->c.upvalue[i]); + } + else { + int i; + lua_assert(cl->l.nupvalues == cl->l.p->nups); + markobject(g, cl->l.p); + for (i=0; il.nupvalues; i++) /* mark its upvalues */ + markobject(g, cl->l.upvals[i]); + } +} + + +static void checkstacksizes (lua_State *L, StkId max) { + int ci_used = cast_int(L->ci - L->base_ci); /* number of `ci' in use */ + int s_used = cast_int(max - L->stack); /* part of stack in use */ + if (L->size_ci > LUAI_MAXCALLS) /* handling overflow? */ + return; /* do not touch the stacks */ + if (4*ci_used < L->size_ci && 2*BASIC_CI_SIZE < L->size_ci) + luaD_reallocCI(L, L->size_ci/2); /* still big enough... */ + condhardstacktests(luaD_reallocCI(L, ci_used + 1)); + if (4*s_used < L->stacksize && + 2*(BASIC_STACK_SIZE+EXTRA_STACK) < L->stacksize) + luaD_reallocstack(L, L->stacksize/2); /* still big enough... */ + condhardstacktests(luaD_reallocstack(L, s_used)); +} + + +static void traversestack (global_State *g, lua_State *l) { + StkId o, lim; + CallInfo *ci; + markvalue(g, gt(l)); + lim = l->top; + for (ci = l->base_ci; ci <= l->ci; ci++) { + lua_assert(ci->top <= l->stack_last); + if (lim < ci->top) lim = ci->top; + } + for (o = l->stack; o < l->top; o++) + markvalue(g, o); + for (; o <= lim; o++) + setnilvalue(o); + checkstacksizes(l, lim); +} + + +/* +** traverse one gray object, turning it to black. +** Returns `quantity' traversed. +*/ +static l_mem propagatemark (global_State *g) { + GCObject *o = g->gray; + lua_assert(isgray(o)); + gray2black(o); + switch (o->gch.tt) { + case LUA_TTABLE: { + Table *h = gco2h(o); + g->gray = h->gclist; + if (traversetable(g, h)) /* table is weak? */ + black2gray(o); /* keep it gray */ + return sizeof(Table) + sizeof(TValue) * h->sizearray + + sizeof(Node) * sizenode(h); + } + case LUA_TFUNCTION: { + Closure *cl = gco2cl(o); + g->gray = cl->c.gclist; + traverseclosure(g, cl); + return (cl->c.isC) ? sizeCclosure(cl->c.nupvalues) : + sizeLclosure(cl->l.nupvalues); + } + case LUA_TTHREAD: { + lua_State *th = gco2th(o); + g->gray = th->gclist; + th->gclist = g->grayagain; + g->grayagain = o; + black2gray(o); + traversestack(g, th); + return sizeof(lua_State) + sizeof(TValue) * th->stacksize + + sizeof(CallInfo) * th->size_ci; + } + case LUA_TPROTO: { + Proto *p = gco2p(o); + g->gray = p->gclist; + traverseproto(g, p); + return sizeof(Proto) + sizeof(Instruction) * p->sizecode + + sizeof(Proto *) * p->sizep + + sizeof(TValue) * p->sizek + + sizeof(int) * p->sizelineinfo + + sizeof(LocVar) * p->sizelocvars + + sizeof(TString *) * p->sizeupvalues; + } + default: lua_assert(0); return 0; + } +} + + +static size_t propagateall (global_State *g) { + size_t m = 0; + while (g->gray) m += propagatemark(g); + return m; +} + + +/* +** The next function tells whether a key or value can be cleared from +** a weak table. Non-collectable objects are never removed from weak +** tables. Strings behave as `values', so are never removed too. for +** other objects: if really collected, cannot keep them; for userdata +** being finalized, keep them in keys, but not in values +*/ +static int iscleared (const TValue *o, int iskey) { + if (!iscollectable(o)) return 0; + if (ttisstring(o)) { + stringmark(rawtsvalue(o)); /* strings are `values', so are never weak */ + return 0; + } + return iswhite(gcvalue(o)) || + (ttisuserdata(o) && (!iskey && isfinalized(uvalue(o)))); +} + + +/* +** clear collected entries from weaktables +*/ +static void cleartable (GCObject *l) { + while (l) { + Table *h = gco2h(l); + int i = h->sizearray; + lua_assert(testbit(h->marked, VALUEWEAKBIT) || + testbit(h->marked, KEYWEAKBIT)); + if (testbit(h->marked, VALUEWEAKBIT)) { + while (i--) { + TValue *o = &h->array[i]; + if (iscleared(o, 0)) /* value was collected? */ + setnilvalue(o); /* remove value */ + } + } + i = sizenode(h); + while (i--) { + Node *n = gnode(h, i); + if (!ttisnil(gval(n)) && /* non-empty entry? */ + (iscleared(key2tval(n), 1) || iscleared(gval(n), 0))) { + setnilvalue(gval(n)); /* remove value ... */ + removeentry(n); /* remove entry from table */ + } + } + l = h->gclist; + } +} + + +static void freeobj (lua_State *L, GCObject *o) { + switch (o->gch.tt) { + case LUA_TPROTO: luaF_freeproto(L, gco2p(o)); break; + case LUA_TFUNCTION: luaF_freeclosure(L, gco2cl(o)); break; + case LUA_TUPVAL: luaF_freeupval(L, gco2uv(o)); break; + case LUA_TTABLE: luaH_free(L, gco2h(o)); break; + case LUA_TTHREAD: { + lua_assert(gco2th(o) != L && gco2th(o) != G(L)->mainthread); + luaE_freethread(L, gco2th(o)); + break; + } + case LUA_TSTRING: { + G(L)->strt.nuse--; + luaM_freemem(L, o, sizestring(gco2ts(o))); + break; + } + case LUA_TUSERDATA: { + luaM_freemem(L, o, sizeudata(gco2u(o))); + break; + } + default: lua_assert(0); + } +} + + + +#define sweepwholelist(L,p) sweeplist(L,p,MAX_LUMEM) + + +static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) { + GCObject *curr; + global_State *g = G(L); + int deadmask = otherwhite(g); + while ((curr = *p) != NULL && count-- > 0) { + if (curr->gch.tt == LUA_TTHREAD) /* sweep open upvalues of each thread */ + sweepwholelist(L, &gco2th(curr)->openupval); + if ((curr->gch.marked ^ WHITEBITS) & deadmask) { /* not dead? */ + lua_assert(!isdead(g, curr) || testbit(curr->gch.marked, FIXEDBIT)); + makewhite(g, curr); /* make it white (for next cycle) */ + p = &curr->gch.next; + } + else { /* must erase `curr' */ + lua_assert(isdead(g, curr) || deadmask == bitmask(SFIXEDBIT)); + *p = curr->gch.next; + if (curr == g->rootgc) /* is the first element of the list? */ + g->rootgc = curr->gch.next; /* adjust first */ + freeobj(L, curr); + } + } + return p; +} + + +static void checkSizes (lua_State *L) { + global_State *g = G(L); + /* check size of string hash */ + if (g->strt.nuse < cast(lu_int32, g->strt.size/4) && + g->strt.size > MINSTRTABSIZE*2) + luaS_resize(L, g->strt.size/2); /* table is too big */ + /* check size of buffer */ + if (luaZ_sizebuffer(&g->buff) > LUA_MINBUFFER*2) { /* buffer too big? */ + size_t newsize = luaZ_sizebuffer(&g->buff) / 2; + luaZ_resizebuffer(L, &g->buff, newsize); + } +} + + +static void GCTM (lua_State *L) { + global_State *g = G(L); + GCObject *o = g->tmudata->gch.next; /* get first element */ + Udata *udata = rawgco2u(o); + const TValue *tm; + /* remove udata from `tmudata' */ + if (o == g->tmudata) /* last element? */ + g->tmudata = NULL; + else + g->tmudata->gch.next = udata->uv.next; + udata->uv.next = g->mainthread->next; /* return it to `root' list */ + g->mainthread->next = o; + makewhite(g, o); + tm = fasttm(L, udata->uv.metatable, TM_GC); + if (tm != NULL) { + lu_byte oldah = L->allowhook; + lu_mem oldt = g->GCthreshold; + L->allowhook = 0; /* stop debug hooks during GC tag method */ + g->GCthreshold = 2*g->totalbytes; /* avoid GC steps */ + setobj2s(L, L->top, tm); + setuvalue(L, L->top+1, udata); + L->top += 2; + luaD_call(L, L->top - 2, 0); + L->allowhook = oldah; /* restore hooks */ + g->GCthreshold = oldt; /* restore threshold */ + } +} + + +/* +** Call all GC tag methods +*/ +void luaC_callGCTM (lua_State *L) { + while (G(L)->tmudata) + GCTM(L); +} + + +void luaC_freeall (lua_State *L) { + global_State *g = G(L); + int i; + g->currentwhite = WHITEBITS | bitmask(SFIXEDBIT); /* mask to collect all elements */ + sweepwholelist(L, &g->rootgc); + for (i = 0; i < g->strt.size; i++) /* free all string lists */ + sweepwholelist(L, &g->strt.hash[i]); +} + + +static void markmt (global_State *g) { + int i; + for (i=0; imt[i]) markobject(g, g->mt[i]); +} + + +/* mark root set */ +static void markroot (lua_State *L) { + global_State *g = G(L); + g->gray = NULL; + g->grayagain = NULL; + g->weak = NULL; + markobject(g, g->mainthread); + /* make global table be traversed before main stack */ + markvalue(g, gt(g->mainthread)); + markvalue(g, registry(L)); + markmt(g); + g->gcstate = GCSpropagate; +} + + +static void remarkupvals (global_State *g) { + UpVal *uv; + for (uv = g->uvhead.u.l.next; uv != &g->uvhead; uv = uv->u.l.next) { + lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); + if (isgray(obj2gco(uv))) + markvalue(g, uv->v); + } +} + + +static void atomic (lua_State *L) { + global_State *g = G(L); + size_t udsize; /* total size of userdata to be finalized */ + /* remark occasional upvalues of (maybe) dead threads */ + remarkupvals(g); + /* traverse objects cautch by write barrier and by 'remarkupvals' */ + propagateall(g); + /* remark weak tables */ + g->gray = g->weak; + g->weak = NULL; + lua_assert(!iswhite(obj2gco(g->mainthread))); + markobject(g, L); /* mark running thread */ + markmt(g); /* mark basic metatables (again) */ + propagateall(g); + /* remark gray again */ + g->gray = g->grayagain; + g->grayagain = NULL; + propagateall(g); + udsize = luaC_separateudata(L, 0); /* separate userdata to be finalized */ + marktmu(g); /* mark `preserved' userdata */ + udsize += propagateall(g); /* remark, to propagate `preserveness' */ + cleartable(g->weak); /* remove collected objects from weak tables */ + /* flip current white */ + g->currentwhite = cast_byte(otherwhite(g)); + g->sweepstrgc = 0; + g->sweepgc = &g->rootgc; + g->gcstate = GCSsweepstring; + g->estimate = g->totalbytes - udsize; /* first estimate */ +} + + +static l_mem singlestep (lua_State *L) { + global_State *g = G(L); + /*lua_checkmemory(L);*/ + switch (g->gcstate) { + case GCSpause: { + markroot(L); /* start a new collection */ + return 0; + } + case GCSpropagate: { + if (g->gray) + return propagatemark(g); + else { /* no more `gray' objects */ + atomic(L); /* finish mark phase */ + return 0; + } + } + case GCSsweepstring: { + lu_mem old = g->totalbytes; + sweepwholelist(L, &g->strt.hash[g->sweepstrgc++]); + if (g->sweepstrgc >= g->strt.size) /* nothing more to sweep? */ + g->gcstate = GCSsweep; /* end sweep-string phase */ + lua_assert(old >= g->totalbytes); + g->estimate -= old - g->totalbytes; + return GCSWEEPCOST; + } + case GCSsweep: { + lu_mem old = g->totalbytes; + g->sweepgc = sweeplist(L, g->sweepgc, GCSWEEPMAX); + if (*g->sweepgc == NULL) { /* nothing more to sweep? */ + checkSizes(L); + g->gcstate = GCSfinalize; /* end sweep phase */ + } + lua_assert(old >= g->totalbytes); + g->estimate -= old - g->totalbytes; + return GCSWEEPMAX*GCSWEEPCOST; + } + case GCSfinalize: { + if (g->tmudata) { + GCTM(L); + if (g->estimate > GCFINALIZECOST) + g->estimate -= GCFINALIZECOST; + return GCFINALIZECOST; + } + else { + g->gcstate = GCSpause; /* end collection */ + g->gcdept = 0; + return 0; + } + } + default: lua_assert(0); return 0; + } +} + + +void luaC_step (lua_State *L) { + global_State *g = G(L); + l_mem lim = (GCSTEPSIZE/100) * g->gcstepmul; + if (lim == 0) + lim = (MAX_LUMEM-1)/2; /* no limit */ + g->gcdept += g->totalbytes - g->GCthreshold; + do { + lim -= singlestep(L); + if (g->gcstate == GCSpause) + break; + } while (lim > 0); + if (g->gcstate != GCSpause) { + if (g->gcdept < GCSTEPSIZE) + g->GCthreshold = g->totalbytes + GCSTEPSIZE; /* - lim/g->gcstepmul;*/ + else { + g->gcdept -= GCSTEPSIZE; + g->GCthreshold = g->totalbytes; + } + } + else { + lua_assert(g->totalbytes >= g->estimate); + setthreshold(g); + } +} + + +void luaC_fullgc (lua_State *L) { + global_State *g = G(L); + if (g->gcstate <= GCSpropagate) { + /* reset sweep marks to sweep all elements (returning them to white) */ + g->sweepstrgc = 0; + g->sweepgc = &g->rootgc; + /* reset other collector lists */ + g->gray = NULL; + g->grayagain = NULL; + g->weak = NULL; + g->gcstate = GCSsweepstring; + } + lua_assert(g->gcstate != GCSpause && g->gcstate != GCSpropagate); + /* finish any pending sweep phase */ + while (g->gcstate != GCSfinalize) { + lua_assert(g->gcstate == GCSsweepstring || g->gcstate == GCSsweep); + singlestep(L); + } + markroot(L); + while (g->gcstate != GCSpause) { + singlestep(L); + } + setthreshold(g); +} + + +void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v) { + global_State *g = G(L); + lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o)); + lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause); + lua_assert(ttype(&o->gch) != LUA_TTABLE); + /* must keep invariant? */ + if (g->gcstate == GCSpropagate) + reallymarkobject(g, v); /* restore invariant */ + else /* don't mind */ + makewhite(g, o); /* mark as white just to avoid other barriers */ +} + + +void luaC_barrierback (lua_State *L, Table *t) { + global_State *g = G(L); + GCObject *o = obj2gco(t); + lua_assert(isblack(o) && !isdead(g, o)); + lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause); + black2gray(o); /* make table gray (again) */ + t->gclist = g->grayagain; + g->grayagain = o; +} + + +void luaC_link (lua_State *L, GCObject *o, lu_byte tt) { + global_State *g = G(L); + o->gch.next = g->rootgc; + g->rootgc = o; + o->gch.marked = luaC_white(g); + o->gch.tt = tt; +} + + +void luaC_linkupval (lua_State *L, UpVal *uv) { + global_State *g = G(L); + GCObject *o = obj2gco(uv); + o->gch.next = g->rootgc; /* link upvalue into `rootgc' list */ + g->rootgc = o; + if (isgray(o)) { + if (g->gcstate == GCSpropagate) { + gray2black(o); /* closed upvalues need barrier */ + luaC_barrier(L, uv, uv->v); + } + else { /* sweep phase: sweep it (turning it into white) */ + makewhite(g, o); + lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause); + } + } +} + diff --git a/rpm-5.4.9/lua/lgc.h b/rpm-5.4.9/lua/lgc.h new file mode 100644 index 0000000..5a8dc60 --- /dev/null +++ b/rpm-5.4.9/lua/lgc.h @@ -0,0 +1,110 @@ +/* +** $Id: lgc.h,v 2.15.1.1 2007/12/27 13:02:25 roberto Exp $ +** Garbage Collector +** See Copyright Notice in lua.h +*/ + +#ifndef lgc_h +#define lgc_h + + +#include "lobject.h" + + +/* +** Possible states of the Garbage Collector +*/ +#define GCSpause 0 +#define GCSpropagate 1 +#define GCSsweepstring 2 +#define GCSsweep 3 +#define GCSfinalize 4 + + +/* +** some userful bit tricks +*/ +#define resetbits(x,m) ((x) &= cast(lu_byte, ~(m))) +#define setbits(x,m) ((x) |= (m)) +#define testbits(x,m) ((x) & (m)) +#define bitmask(b) (1<<(b)) +#define bit2mask(b1,b2) (bitmask(b1) | bitmask(b2)) +#define l_setbit(x,b) setbits(x, bitmask(b)) +#define resetbit(x,b) resetbits(x, bitmask(b)) +#define testbit(x,b) testbits(x, bitmask(b)) +#define set2bits(x,b1,b2) setbits(x, (bit2mask(b1, b2))) +#define reset2bits(x,b1,b2) resetbits(x, (bit2mask(b1, b2))) +#define test2bits(x,b1,b2) testbits(x, (bit2mask(b1, b2))) + + + +/* +** Layout for bit use in `marked' field: +** bit 0 - object is white (type 0) +** bit 1 - object is white (type 1) +** bit 2 - object is black +** bit 3 - for userdata: has been finalized +** bit 3 - for tables: has weak keys +** bit 4 - for tables: has weak values +** bit 5 - object is fixed (should not be collected) +** bit 6 - object is "super" fixed (only the main thread) +*/ + + +#define WHITE0BIT 0 +#define WHITE1BIT 1 +#define BLACKBIT 2 +#define FINALIZEDBIT 3 +#define KEYWEAKBIT 3 +#define VALUEWEAKBIT 4 +#define FIXEDBIT 5 +#define SFIXEDBIT 6 +#define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT) + + +#define iswhite(x) test2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT) +#define isblack(x) testbit((x)->gch.marked, BLACKBIT) +#define isgray(x) (!isblack(x) && !iswhite(x)) + +#define otherwhite(g) (g->currentwhite ^ WHITEBITS) +#define isdead(g,v) ((v)->gch.marked & otherwhite(g) & WHITEBITS) + +#define changewhite(x) ((x)->gch.marked ^= WHITEBITS) +#define gray2black(x) l_setbit((x)->gch.marked, BLACKBIT) + +#define valiswhite(x) (iscollectable(x) && iswhite(gcvalue(x))) + +#define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS) + + +#define luaC_checkGC(L) { \ + condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); \ + if (G(L)->totalbytes >= G(L)->GCthreshold) \ + luaC_step(L); } + + +#define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \ + luaC_barrierf(L,obj2gco(p),gcvalue(v)); } + +#define luaC_barriert(L,t,v) { if (valiswhite(v) && isblack(obj2gco(t))) \ + luaC_barrierback(L,t); } + +#define luaC_objbarrier(L,p,o) \ + { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \ + luaC_barrierf(L,obj2gco(p),obj2gco(o)); } + +#define luaC_objbarriert(L,t,o) \ + { if (iswhite(obj2gco(o)) && isblack(obj2gco(t))) luaC_barrierback(L,t); } + +LUAI_FUNC size_t luaC_separateudata (lua_State *L, int all); +LUAI_FUNC void luaC_callGCTM (lua_State *L); +LUAI_FUNC void luaC_freeall (lua_State *L); +LUAI_FUNC void luaC_step (lua_State *L); +LUAI_FUNC void luaC_fullgc (lua_State *L); +LUAI_FUNC void luaC_link (lua_State *L, GCObject *o, lu_byte tt); +LUAI_FUNC void luaC_linkupval (lua_State *L, UpVal *uv); +LUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v); +LUAI_FUNC void luaC_barrierback (lua_State *L, Table *t); + + +#endif diff --git a/rpm-5.4.9/lua/linit.c b/rpm-5.4.9/lua/linit.c new file mode 100644 index 0000000..c1f90df --- /dev/null +++ b/rpm-5.4.9/lua/linit.c @@ -0,0 +1,38 @@ +/* +** $Id: linit.c,v 1.14.1.1 2007/12/27 13:02:25 roberto Exp $ +** Initialization of libraries for lua.c +** See Copyright Notice in lua.h +*/ + + +#define linit_c +#define LUA_LIB + +#include "lua.h" + +#include "lualib.h" +#include "lauxlib.h" + + +static const luaL_Reg lualibs[] = { + {"", luaopen_base}, + {LUA_LOADLIBNAME, luaopen_package}, + {LUA_TABLIBNAME, luaopen_table}, + {LUA_IOLIBNAME, luaopen_io}, + {LUA_OSLIBNAME, luaopen_os}, + {LUA_STRLIBNAME, luaopen_string}, + {LUA_MATHLIBNAME, luaopen_math}, + {LUA_DBLIBNAME, luaopen_debug}, + {NULL, NULL} +}; + + +LUALIB_API void luaL_openlibs (lua_State *L) { + const luaL_Reg *lib = lualibs; + for (; lib->func; lib++) { + lua_pushcfunction(L, lib->func); + lua_pushstring(L, lib->name); + lua_call(L, 1, 0); + } +} + diff --git a/rpm-5.4.9/lua/liolib.c b/rpm-5.4.9/lua/liolib.c new file mode 100644 index 0000000..e79ed1c --- /dev/null +++ b/rpm-5.4.9/lua/liolib.c @@ -0,0 +1,553 @@ +/* +** $Id: liolib.c,v 2.73.1.3 2008/01/18 17:47:43 roberto Exp $ +** Standard I/O (and system) library +** See Copyright Notice in lua.h +*/ + + +#include +#include +#include +#include + +#define liolib_c +#define LUA_LIB + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + + +#define IO_INPUT 1 +#define IO_OUTPUT 2 + + +static const char *const fnames[] = {"input", "output"}; + + +static int pushresult (lua_State *L, int i, const char *filename) { + int en = errno; /* calls to Lua API may change this value */ + if (i) { + lua_pushboolean(L, 1); + return 1; + } + else { + lua_pushnil(L); + if (filename) + lua_pushfstring(L, "%s: %s", filename, strerror(en)); + else + lua_pushfstring(L, "%s", strerror(en)); + lua_pushinteger(L, en); + return 3; + } +} + + +static void fileerror (lua_State *L, int arg, const char *filename) { + lua_pushfstring(L, "%s: %s", filename, strerror(errno)); + luaL_argerror(L, arg, lua_tostring(L, -1)); +} + + +#define tofilep(L) ((FILE **)luaL_checkudata(L, 1, LUA_FILEHANDLE)) + + +static int io_type (lua_State *L) { + void *ud; + luaL_checkany(L, 1); + ud = lua_touserdata(L, 1); + lua_getfield(L, LUA_REGISTRYINDEX, LUA_FILEHANDLE); + if (ud == NULL || !lua_getmetatable(L, 1) || !lua_rawequal(L, -2, -1)) + lua_pushnil(L); /* not a file */ + else if (*((FILE **)ud) == NULL) + lua_pushliteral(L, "closed file"); + else + lua_pushliteral(L, "file"); + return 1; +} + + +static FILE *tofile (lua_State *L) { + FILE **f = tofilep(L); + if (*f == NULL) + luaL_error(L, "attempt to use a closed file"); + return *f; +} + + + +/* +** When creating file handles, always creates a `closed' file handle +** before opening the actual file; so, if there is a memory error, the +** file is not left opened. +*/ +static FILE **newfile (lua_State *L) { + FILE **pf = (FILE **)lua_newuserdata(L, sizeof(FILE *)); + *pf = NULL; /* file handle is currently `closed' */ + luaL_getmetatable(L, LUA_FILEHANDLE); + lua_setmetatable(L, -2); + return pf; +} + + +/* +** function to (not) close the standard files stdin, stdout, and stderr +*/ +static int io_noclose (lua_State *L) { + lua_pushnil(L); + lua_pushliteral(L, "cannot close standard file"); + return 2; +} + + +/* +** function to close 'popen' files +*/ +static int io_pclose (lua_State *L) { + FILE **p = tofilep(L); + int ok = lua_pclose(L, *p); + *p = NULL; + return pushresult(L, ok, NULL); +} + + +/* +** function to close regular files +*/ +static int io_fclose (lua_State *L) { + FILE **p = tofilep(L); + int ok = (fclose(*p) == 0); + *p = NULL; + return pushresult(L, ok, NULL); +} + + +static int aux_close (lua_State *L) { + lua_getfenv(L, 1); + lua_getfield(L, -1, "__close"); + return (lua_tocfunction(L, -1))(L); +} + + +static int io_close (lua_State *L) { + if (lua_isnone(L, 1)) + lua_rawgeti(L, LUA_ENVIRONINDEX, IO_OUTPUT); + tofile(L); /* make sure argument is a file */ + return aux_close(L); +} + + +static int io_gc (lua_State *L) { + FILE *f = *tofilep(L); + /* ignore closed files */ + if (f != NULL) + aux_close(L); + return 0; +} + + +static int io_tostring (lua_State *L) { + FILE *f = *tofilep(L); + if (f == NULL) + lua_pushliteral(L, "file (closed)"); + else + lua_pushfstring(L, "file (%p)", f); + return 1; +} + + +static int io_open (lua_State *L) { + const char *filename = luaL_checkstring(L, 1); + const char *mode = luaL_optstring(L, 2, "r"); + FILE **pf = newfile(L); + *pf = fopen(filename, mode); + return (*pf == NULL) ? pushresult(L, 0, filename) : 1; +} + + +/* +** this function has a separated environment, which defines the +** correct __close for 'popen' files +*/ +static int io_popen (lua_State *L) { + const char *filename = luaL_checkstring(L, 1); + const char *mode = luaL_optstring(L, 2, "r"); + FILE **pf = newfile(L); + *pf = lua_popen(L, filename, mode); + return (*pf == NULL) ? pushresult(L, 0, filename) : 1; +} + + +static int io_tmpfile (lua_State *L) { + FILE **pf = newfile(L); + *pf = tmpfile(); + return (*pf == NULL) ? pushresult(L, 0, NULL) : 1; +} + + +static FILE *getiofile (lua_State *L, int findex) { + FILE *f; + lua_rawgeti(L, LUA_ENVIRONINDEX, findex); + f = *(FILE **)lua_touserdata(L, -1); + if (f == NULL) + luaL_error(L, "standard %s file is closed", fnames[findex - 1]); + return f; +} + + +static int g_iofile (lua_State *L, int f, const char *mode) { + if (!lua_isnoneornil(L, 1)) { + const char *filename = lua_tostring(L, 1); + if (filename) { + FILE **pf = newfile(L); + *pf = fopen(filename, mode); + if (*pf == NULL) + fileerror(L, 1, filename); + } + else { + tofile(L); /* check that it's a valid file handle */ + lua_pushvalue(L, 1); + } + lua_rawseti(L, LUA_ENVIRONINDEX, f); + } + /* return current value */ + lua_rawgeti(L, LUA_ENVIRONINDEX, f); + return 1; +} + + +static int io_input (lua_State *L) { + return g_iofile(L, IO_INPUT, "r"); +} + + +static int io_output (lua_State *L) { + return g_iofile(L, IO_OUTPUT, "w"); +} + + +static int io_readline (lua_State *L); + + +static void aux_lines (lua_State *L, int idx, int toclose) { + lua_pushvalue(L, idx); + lua_pushboolean(L, toclose); /* close/not close file when finished */ + lua_pushcclosure(L, io_readline, 2); +} + + +static int f_lines (lua_State *L) { + tofile(L); /* check that it's a valid file handle */ + aux_lines(L, 1, 0); + return 1; +} + + +static int io_lines (lua_State *L) { + if (lua_isnoneornil(L, 1)) { /* no arguments? */ + /* will iterate over default input */ + lua_rawgeti(L, LUA_ENVIRONINDEX, IO_INPUT); + return f_lines(L); + } + else { + const char *filename = luaL_checkstring(L, 1); + FILE **pf = newfile(L); + *pf = fopen(filename, "r"); + if (*pf == NULL) + fileerror(L, 1, filename); + aux_lines(L, lua_gettop(L), 1); + return 1; + } +} + + +/* +** {====================================================== +** READ +** ======================================================= +*/ + + +static int read_number (lua_State *L, FILE *f) { + lua_Number d; + if (fscanf(f, LUA_NUMBER_SCAN, &d) == 1) { + lua_pushnumber(L, d); + return 1; + } + else return 0; /* read fails */ +} + + +static int test_eof (lua_State *L, FILE *f) { + int c = getc(f); + ungetc(c, f); + lua_pushlstring(L, NULL, 0); + return (c != EOF); +} + + +static int read_line (lua_State *L, FILE *f) { + luaL_Buffer b; + luaL_buffinit(L, &b); + for (;;) { + size_t l; + char *p = luaL_prepbuffer(&b); + if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) { /* eof? */ + luaL_pushresult(&b); /* close buffer */ + return (lua_objlen(L, -1) > 0); /* check whether read something */ + } + l = strlen(p); + if (l == 0 || p[l-1] != '\n') + luaL_addsize(&b, l); + else { + luaL_addsize(&b, l - 1); /* do not include `eol' */ + luaL_pushresult(&b); /* close buffer */ + return 1; /* read at least an `eol' */ + } + } +} + + +static int read_chars (lua_State *L, FILE *f, size_t n) { + size_t rlen; /* how much to read */ + size_t nr; /* number of chars actually read */ + luaL_Buffer b; + luaL_buffinit(L, &b); + rlen = LUAL_BUFFERSIZE; /* try to read that much each time */ + do { + char *p = luaL_prepbuffer(&b); + if (rlen > n) rlen = n; /* cannot read more than asked */ + nr = fread(p, sizeof(char), rlen, f); + luaL_addsize(&b, nr); + n -= nr; /* still have to read `n' chars */ + } while (n > 0 && nr == rlen); /* until end of count or eof */ + luaL_pushresult(&b); /* close buffer */ + return (n == 0 || lua_objlen(L, -1) > 0); +} + + +static int g_read (lua_State *L, FILE *f, int first) { + int nargs = lua_gettop(L) - 1; + int success; + int n; + clearerr(f); + if (nargs == 0) { /* no arguments? */ + success = read_line(L, f); + n = first+1; /* to return 1 result */ + } + else { /* ensure stack space for all results and for auxlib's buffer */ + luaL_checkstack(L, nargs+LUA_MINSTACK, "too many arguments"); + success = 1; + for (n = first; nargs-- && success; n++) { + if (lua_type(L, n) == LUA_TNUMBER) { + size_t l = (size_t)lua_tointeger(L, n); + success = (l == 0) ? test_eof(L, f) : read_chars(L, f, l); + } + else { + const char *p = lua_tostring(L, n); + luaL_argcheck(L, p && p[0] == '*', n, "invalid option"); + switch (p[1]) { + case 'n': /* number */ + success = read_number(L, f); + break; + case 'l': /* line */ + success = read_line(L, f); + break; + case 'a': /* file */ + read_chars(L, f, ~((size_t)0)); /* read MAX_SIZE_T chars */ + success = 1; /* always success */ + break; + default: + return luaL_argerror(L, n, "invalid format"); + } + } + } + } + if (ferror(f)) + return pushresult(L, 0, NULL); + if (!success) { + lua_pop(L, 1); /* remove last result */ + lua_pushnil(L); /* push nil instead */ + } + return n - first; +} + + +static int io_read (lua_State *L) { + return g_read(L, getiofile(L, IO_INPUT), 1); +} + + +static int f_read (lua_State *L) { + return g_read(L, tofile(L), 2); +} + + +static int io_readline (lua_State *L) { + FILE *f = *(FILE **)lua_touserdata(L, lua_upvalueindex(1)); + int sucess; + if (f == NULL) /* file is already closed? */ + luaL_error(L, "file is already closed"); + sucess = read_line(L, f); + if (ferror(f)) + return luaL_error(L, "%s", strerror(errno)); + if (sucess) return 1; + else { /* EOF */ + if (lua_toboolean(L, lua_upvalueindex(2))) { /* generator created file? */ + lua_settop(L, 0); + lua_pushvalue(L, lua_upvalueindex(1)); + aux_close(L); /* close it */ + } + return 0; + } +} + +/* }====================================================== */ + + +static int g_write (lua_State *L, FILE *f, int arg) { + int nargs = lua_gettop(L) - 1; + int status = 1; + for (; nargs--; arg++) { + if (lua_type(L, arg) == LUA_TNUMBER) { + /* optimization: could be done exactly as for strings */ + status = status && + fprintf(f, LUA_NUMBER_FMT, lua_tonumber(L, arg)) > 0; + } + else { + size_t l; + const char *s = luaL_checklstring(L, arg, &l); + status = status && (fwrite(s, sizeof(char), l, f) == l); + } + } + return pushresult(L, status, NULL); +} + + +static int io_write (lua_State *L) { + return g_write(L, getiofile(L, IO_OUTPUT), 1); +} + + +static int f_write (lua_State *L) { + return g_write(L, tofile(L), 2); +} + + +static int f_seek (lua_State *L) { + static const int mode[] = {SEEK_SET, SEEK_CUR, SEEK_END}; + static const char *const modenames[] = {"set", "cur", "end", NULL}; + FILE *f = tofile(L); + int op = luaL_checkoption(L, 2, "cur", modenames); + long offset = luaL_optlong(L, 3, 0); + op = fseek(f, offset, mode[op]); + if (op) + return pushresult(L, 0, NULL); /* error */ + else { + lua_pushinteger(L, ftell(f)); + return 1; + } +} + + +static int f_setvbuf (lua_State *L) { + static const int mode[] = {_IONBF, _IOFBF, _IOLBF}; + static const char *const modenames[] = {"no", "full", "line", NULL}; + FILE *f = tofile(L); + int op = luaL_checkoption(L, 2, NULL, modenames); + lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE); + int res = setvbuf(f, NULL, mode[op], sz); + return pushresult(L, res == 0, NULL); +} + + + +static int io_flush (lua_State *L) { + return pushresult(L, fflush(getiofile(L, IO_OUTPUT)) == 0, NULL); +} + + +static int f_flush (lua_State *L) { + return pushresult(L, fflush(tofile(L)) == 0, NULL); +} + + +static const luaL_Reg iolib[] = { + {"close", io_close}, + {"flush", io_flush}, + {"input", io_input}, + {"lines", io_lines}, + {"open", io_open}, + {"output", io_output}, + {"popen", io_popen}, + {"read", io_read}, + {"tmpfile", io_tmpfile}, + {"type", io_type}, + {"write", io_write}, + {NULL, NULL} +}; + + +static const luaL_Reg flib[] = { + {"close", io_close}, + {"flush", f_flush}, + {"lines", f_lines}, + {"read", f_read}, + {"seek", f_seek}, + {"setvbuf", f_setvbuf}, + {"write", f_write}, + {"__gc", io_gc}, + {"__tostring", io_tostring}, + {NULL, NULL} +}; + + +static void createmeta (lua_State *L) { + luaL_newmetatable(L, LUA_FILEHANDLE); /* create metatable for file handles */ + lua_pushvalue(L, -1); /* push metatable */ + lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */ + luaL_register(L, NULL, flib); /* file methods */ +} + + +static void createstdfile (lua_State *L, FILE *f, int k, const char *fname) { + *newfile(L) = f; + if (k > 0) { + lua_pushvalue(L, -1); + lua_rawseti(L, LUA_ENVIRONINDEX, k); + } + lua_pushvalue(L, -2); /* copy environment */ + lua_setfenv(L, -2); /* set it */ + lua_setfield(L, -3, fname); +} + + +static void newfenv (lua_State *L, lua_CFunction cls) { + lua_createtable(L, 0, 1); + lua_pushcfunction(L, cls); + lua_setfield(L, -2, "__close"); +} + + +LUALIB_API int luaopen_io (lua_State *L) { + createmeta(L); + /* create (private) environment (with fields IO_INPUT, IO_OUTPUT, __close) */ + newfenv(L, io_fclose); + lua_replace(L, LUA_ENVIRONINDEX); + /* open library */ + luaL_register(L, LUA_IOLIBNAME, iolib); + /* create (and set) default files */ + newfenv(L, io_noclose); /* close function for default files */ + createstdfile(L, stdin, IO_INPUT, "stdin"); + createstdfile(L, stdout, IO_OUTPUT, "stdout"); + createstdfile(L, stderr, 0, "stderr"); + lua_pop(L, 1); /* pop environment for default files */ + lua_getfield(L, -1, "popen"); + newfenv(L, io_pclose); /* create environment for 'popen' */ + lua_setfenv(L, -2); /* set fenv for 'popen' */ + lua_pop(L, 1); /* pop 'popen' */ + return 1; +} + diff --git a/rpm-5.4.9/lua/llex.c b/rpm-5.4.9/lua/llex.c new file mode 100644 index 0000000..6dc3193 --- /dev/null +++ b/rpm-5.4.9/lua/llex.c @@ -0,0 +1,461 @@ +/* +** $Id: llex.c,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $ +** Lexical Analyzer +** See Copyright Notice in lua.h +*/ + + +#include +#include +#include + +#define llex_c +#define LUA_CORE + +#include "lua.h" + +#include "ldo.h" +#include "llex.h" +#include "lobject.h" +#include "lparser.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" +#include "lzio.h" + + + +#define next(ls) (ls->current = zgetc(ls->z)) + + + + +#define currIsNewline(ls) (ls->current == '\n' || ls->current == '\r') + + +/* ORDER RESERVED */ +const char *const luaX_tokens [] = { + "and", "break", "do", "else", "elseif", + "end", "false", "for", "function", "if", + "in", "local", "nil", "not", "or", "repeat", + "return", "then", "true", "until", "while", + "..", "...", "==", ">=", "<=", "~=", + "", "", "", "", + NULL +}; + + +#define save_and_next(ls) (save(ls, ls->current), next(ls)) + + +static void save (LexState *ls, int c) { + Mbuffer *b = ls->buff; + if (b->n + 1 > b->buffsize) { + size_t newsize; + if (b->buffsize >= MAX_SIZET/2) + luaX_lexerror(ls, "lexical element too long", 0); + newsize = b->buffsize * 2; + luaZ_resizebuffer(ls->L, b, newsize); + } + b->buffer[b->n++] = cast(char, c); +} + + +void luaX_init (lua_State *L) { + int i; + for (i=0; itsv.reserved = cast_byte(i+1); /* reserved word */ + } +} + + +#define MAXSRC 80 + + +const char *luaX_token2str (LexState *ls, int token) { + if (token < FIRST_RESERVED) { + lua_assert(token == cast(unsigned char, token)); + return (iscntrl(token)) ? luaO_pushfstring(ls->L, "char(%d)", token) : + luaO_pushfstring(ls->L, "%c", token); + } + else + return luaX_tokens[token-FIRST_RESERVED]; +} + + +static const char *txtToken (LexState *ls, int token) { + switch (token) { + case TK_NAME: + case TK_STRING: + case TK_NUMBER: + save(ls, '\0'); + return luaZ_buffer(ls->buff); + default: + return luaX_token2str(ls, token); + } +} + + +void luaX_lexerror (LexState *ls, const char *msg, int token) { + char buff[MAXSRC]; + luaO_chunkid(buff, getstr(ls->source), MAXSRC); + msg = luaO_pushfstring(ls->L, "%s:%d: %s", buff, ls->linenumber, msg); + if (token) + luaO_pushfstring(ls->L, "%s near " LUA_QS, msg, txtToken(ls, token)); + luaD_throw(ls->L, LUA_ERRSYNTAX); +} + + +void luaX_syntaxerror (LexState *ls, const char *msg) { + luaX_lexerror(ls, msg, ls->t.token); +} + + +TString *luaX_newstring (LexState *ls, const char *str, size_t l) { + lua_State *L = ls->L; + TString *ts = luaS_newlstr(L, str, l); + TValue *o = luaH_setstr(L, ls->fs->h, ts); /* entry for `str' */ + if (ttisnil(o)) + setbvalue(o, 1); /* make sure `str' will not be collected */ + return ts; +} + + +static void inclinenumber (LexState *ls) { + int old = ls->current; + lua_assert(currIsNewline(ls)); + next(ls); /* skip `\n' or `\r' */ + if (currIsNewline(ls) && ls->current != old) + next(ls); /* skip `\n\r' or `\r\n' */ + if (++ls->linenumber >= MAX_INT) + luaX_syntaxerror(ls, "chunk has too many lines"); +} + + +void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source) { + ls->decpoint = '.'; + ls->L = L; + ls->lookahead.token = TK_EOS; /* no look-ahead token */ + ls->z = z; + ls->fs = NULL; + ls->linenumber = 1; + ls->lastline = 1; + ls->source = source; + luaZ_resizebuffer(ls->L, ls->buff, LUA_MINBUFFER); /* initialize buffer */ + next(ls); /* read first char */ +} + + + +/* +** ======================================================= +** LEXICAL ANALYZER +** ======================================================= +*/ + + + +static int check_next (LexState *ls, const char *set) { + if (!strchr(set, ls->current)) + return 0; + save_and_next(ls); + return 1; +} + + +static void buffreplace (LexState *ls, char from, char to) { + size_t n = luaZ_bufflen(ls->buff); + char *p = luaZ_buffer(ls->buff); + while (n--) + if (p[n] == from) p[n] = to; +} + + +static void trydecpoint (LexState *ls, SemInfo *seminfo) { + /* format error: try to update decimal point separator */ + struct lconv *cv = localeconv(); + char old = ls->decpoint; + ls->decpoint = (cv ? cv->decimal_point[0] : '.'); + buffreplace(ls, old, ls->decpoint); /* try updated decimal separator */ + if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) { + /* format error with correct decimal point: no more options */ + buffreplace(ls, ls->decpoint, '.'); /* undo change (for error message) */ + luaX_lexerror(ls, "malformed number", TK_NUMBER); + } +} + + +/* LUA_NUMBER */ +static void read_numeral (LexState *ls, SemInfo *seminfo) { + lua_assert(isdigit(ls->current)); + do { + save_and_next(ls); + } while (isdigit(ls->current) || ls->current == '.'); + if (check_next(ls, "Ee")) /* `E'? */ + check_next(ls, "+-"); /* optional exponent sign */ + while (isalnum(ls->current) || ls->current == '_') + save_and_next(ls); + save(ls, '\0'); + buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */ + if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) /* format error? */ + trydecpoint(ls, seminfo); /* try to update decimal point separator */ +} + + +static int skip_sep (LexState *ls) { + int count = 0; + int s = ls->current; + lua_assert(s == '[' || s == ']'); + save_and_next(ls); + while (ls->current == '=') { + save_and_next(ls); + count++; + } + return (ls->current == s) ? count : (-count) - 1; +} + + +static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) { + int cont = 0; + (void)(cont); /* avoid warnings when `cont' is not used */ + save_and_next(ls); /* skip 2nd `[' */ + if (currIsNewline(ls)) /* string starts with a newline? */ + inclinenumber(ls); /* skip it */ + for (;;) { + switch (ls->current) { + case EOZ: + luaX_lexerror(ls, (seminfo) ? "unfinished long string" : + "unfinished long comment", TK_EOS); + break; /* to avoid warnings */ +#if defined(LUA_COMPAT_LSTR) + case '[': { + if (skip_sep(ls) == sep) { + save_and_next(ls); /* skip 2nd `[' */ + cont++; +#if LUA_COMPAT_LSTR == 1 + if (sep == 0) + luaX_lexerror(ls, "nesting of [[...]] is deprecated", '['); +#endif + } + break; + } +#endif + case ']': { + if (skip_sep(ls) == sep) { + save_and_next(ls); /* skip 2nd `]' */ +#if defined(LUA_COMPAT_LSTR) && LUA_COMPAT_LSTR == 2 + cont--; + if (sep == 0 && cont >= 0) break; +#endif + goto endloop; + } + break; + } + case '\n': + case '\r': { + save(ls, '\n'); + inclinenumber(ls); + if (!seminfo) luaZ_resetbuffer(ls->buff); /* avoid wasting space */ + break; + } + default: { + if (seminfo) save_and_next(ls); + else next(ls); + } + } + } endloop: + if (seminfo) + seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + (2 + sep), + luaZ_bufflen(ls->buff) - 2*(2 + sep)); +} + + +static void read_string (LexState *ls, int del, SemInfo *seminfo) { + save_and_next(ls); + while (ls->current != del) { + switch (ls->current) { + case EOZ: + luaX_lexerror(ls, "unfinished string", TK_EOS); + continue; /* to avoid warnings */ + case '\n': + case '\r': + luaX_lexerror(ls, "unfinished string", TK_STRING); + continue; /* to avoid warnings */ + case '\\': { + int c; + next(ls); /* do not save the `\' */ + switch (ls->current) { + case 'a': c = '\a'; break; + case 'b': c = '\b'; break; + case 'f': c = '\f'; break; + case 'n': c = '\n'; break; + case 'r': c = '\r'; break; + case 't': c = '\t'; break; + case 'v': c = '\v'; break; + case '\n': /* go through */ + case '\r': save(ls, '\n'); inclinenumber(ls); continue; + case EOZ: continue; /* will raise an error next loop */ + default: { + if (!isdigit(ls->current)) + save_and_next(ls); /* handles \\, \", \', and \? */ + else { /* \xxx */ + int i = 0; + c = 0; + do { + c = 10*c + (ls->current-'0'); + next(ls); + } while (++i<3 && isdigit(ls->current)); + if (c > UCHAR_MAX) + luaX_lexerror(ls, "escape sequence too large", TK_STRING); + save(ls, c); + } + continue; + } + } + save(ls, c); + next(ls); + continue; + } + default: + save_and_next(ls); + } + } + save_and_next(ls); /* skip delimiter */ + seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + 1, + luaZ_bufflen(ls->buff) - 2); +} + + +static int llex (LexState *ls, SemInfo *seminfo) { + luaZ_resetbuffer(ls->buff); + for (;;) { + switch (ls->current) { + case '\n': + case '\r': { + inclinenumber(ls); + continue; + } + case '-': { + next(ls); + if (ls->current != '-') return '-'; + /* else is a comment */ + next(ls); + if (ls->current == '[') { + int sep = skip_sep(ls); + luaZ_resetbuffer(ls->buff); /* `skip_sep' may dirty the buffer */ + if (sep >= 0) { + read_long_string(ls, NULL, sep); /* long comment */ + luaZ_resetbuffer(ls->buff); + continue; + } + } + /* else short comment */ + while (!currIsNewline(ls) && ls->current != EOZ) + next(ls); + continue; + } + case '[': { + int sep = skip_sep(ls); + if (sep >= 0) { + read_long_string(ls, seminfo, sep); + return TK_STRING; + } + else if (sep == -1) return '['; + else luaX_lexerror(ls, "invalid long string delimiter", TK_STRING); + } + case '=': { + next(ls); + if (ls->current != '=') return '='; + else { next(ls); return TK_EQ; } + } + case '<': { + next(ls); + if (ls->current != '=') return '<'; + else { next(ls); return TK_LE; } + } + case '>': { + next(ls); + if (ls->current != '=') return '>'; + else { next(ls); return TK_GE; } + } + case '~': { + next(ls); + if (ls->current != '=') return '~'; + else { next(ls); return TK_NE; } + } + case '"': + case '\'': { + read_string(ls, ls->current, seminfo); + return TK_STRING; + } + case '.': { + save_and_next(ls); + if (check_next(ls, ".")) { + if (check_next(ls, ".")) + return TK_DOTS; /* ... */ + else return TK_CONCAT; /* .. */ + } + else if (!isdigit(ls->current)) return '.'; + else { + read_numeral(ls, seminfo); + return TK_NUMBER; + } + } + case EOZ: { + return TK_EOS; + } + default: { + if (isspace(ls->current)) { + lua_assert(!currIsNewline(ls)); + next(ls); + continue; + } + else if (isdigit(ls->current)) { + read_numeral(ls, seminfo); + return TK_NUMBER; + } + else if (isalpha(ls->current) || ls->current == '_') { + /* identifier or reserved word */ + TString *ts; + do { + save_and_next(ls); + } while (isalnum(ls->current) || ls->current == '_'); + ts = luaX_newstring(ls, luaZ_buffer(ls->buff), + luaZ_bufflen(ls->buff)); + if (ts->tsv.reserved > 0) /* reserved word? */ + return ts->tsv.reserved - 1 + FIRST_RESERVED; + else { + seminfo->ts = ts; + return TK_NAME; + } + } + else { + int c = ls->current; + next(ls); + return c; /* single-char tokens (+ - / ...) */ + } + } + } + } +} + + +void luaX_next (LexState *ls) { + ls->lastline = ls->linenumber; + if (ls->lookahead.token != TK_EOS) { /* is there a look-ahead token? */ + ls->t = ls->lookahead; /* use this one */ + ls->lookahead.token = TK_EOS; /* and discharge it */ + } + else + ls->t.token = llex(ls, &ls->t.seminfo); /* read next token */ +} + + +void luaX_lookahead (LexState *ls) { + lua_assert(ls->lookahead.token == TK_EOS); + ls->lookahead.token = llex(ls, &ls->lookahead.seminfo); +} + diff --git a/rpm-5.4.9/lua/llex.h b/rpm-5.4.9/lua/llex.h new file mode 100644 index 0000000..a9201ce --- /dev/null +++ b/rpm-5.4.9/lua/llex.h @@ -0,0 +1,81 @@ +/* +** $Id: llex.h,v 1.58.1.1 2007/12/27 13:02:25 roberto Exp $ +** Lexical Analyzer +** See Copyright Notice in lua.h +*/ + +#ifndef llex_h +#define llex_h + +#include "lobject.h" +#include "lzio.h" + + +#define FIRST_RESERVED 257 + +/* maximum length of a reserved word */ +#define TOKEN_LEN (sizeof("function")/sizeof(char)) + + +/* +* WARNING: if you change the order of this enumeration, +* grep "ORDER RESERVED" +*/ +enum RESERVED { + /* terminal symbols denoted by reserved words */ + TK_AND = FIRST_RESERVED, TK_BREAK, + TK_DO, TK_ELSE, TK_ELSEIF, TK_END, TK_FALSE, TK_FOR, TK_FUNCTION, + TK_IF, TK_IN, TK_LOCAL, TK_NIL, TK_NOT, TK_OR, TK_REPEAT, + TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE, + /* other terminal symbols */ + TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LE, TK_NE, TK_NUMBER, + TK_NAME, TK_STRING, TK_EOS +}; + +/* number of reserved words */ +#define NUM_RESERVED (cast(int, TK_WHILE-FIRST_RESERVED+1)) + + +/* array with token `names' */ +LUAI_DATA const char *const luaX_tokens []; + + +typedef union { + lua_Number r; + TString *ts; +} SemInfo; /* semantics information */ + + +typedef struct Token { + int token; + SemInfo seminfo; +} Token; + + +typedef struct LexState { + int current; /* current character (charint) */ + int linenumber; /* input line counter */ + int lastline; /* line of last token `consumed' */ + Token t; /* current token */ + Token lookahead; /* look ahead token */ + struct FuncState *fs; /* `FuncState' is private to the parser */ + struct lua_State *L; + ZIO *z; /* input stream */ + Mbuffer *buff; /* buffer for tokens */ + TString *source; /* current source name */ + char decpoint; /* locale decimal point */ +} LexState; + + +LUAI_FUNC void luaX_init (lua_State *L); +LUAI_FUNC void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, + TString *source); +LUAI_FUNC TString *luaX_newstring (LexState *ls, const char *str, size_t l); +LUAI_FUNC void luaX_next (LexState *ls); +LUAI_FUNC void luaX_lookahead (LexState *ls); +LUAI_FUNC void luaX_lexerror (LexState *ls, const char *msg, int token); +LUAI_FUNC void luaX_syntaxerror (LexState *ls, const char *s); +LUAI_FUNC const char *luaX_token2str (LexState *ls, int token); + + +#endif diff --git a/rpm-5.4.9/lua/llimits.h b/rpm-5.4.9/lua/llimits.h new file mode 100644 index 0000000..ca8dcb7 --- /dev/null +++ b/rpm-5.4.9/lua/llimits.h @@ -0,0 +1,128 @@ +/* +** $Id: llimits.h,v 1.69.1.1 2007/12/27 13:02:25 roberto Exp $ +** Limits, basic types, and some other `installation-dependent' definitions +** See Copyright Notice in lua.h +*/ + +#ifndef llimits_h +#define llimits_h + + +#include +#include + + +#include "lua.h" + + +typedef LUAI_UINT32 lu_int32; + +typedef LUAI_UMEM lu_mem; + +typedef LUAI_MEM l_mem; + + + +/* chars used as small naturals (so that `char' is reserved for characters) */ +typedef unsigned char lu_byte; + + +#define MAX_SIZET ((size_t)(~(size_t)0)-2) + +#define MAX_LUMEM ((lu_mem)(~(lu_mem)0)-2) + + +#define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */ + +/* +** conversion of pointer to integer +** this is for hashing only; there is no problem if the integer +** cannot hold the whole pointer value +*/ +#define IntPoint(p) ((unsigned int)(lu_mem)(p)) + + + +/* type to ensure maximum alignment */ +typedef LUAI_USER_ALIGNMENT_T L_Umaxalign; + + +/* result of a `usual argument conversion' over lua_Number */ +typedef LUAI_UACNUMBER l_uacNumber; + + +/* internal assertions for in-house debugging */ +#ifdef lua_assert + +#define check_exp(c,e) (lua_assert(c), (e)) +#define api_check(l,e) lua_assert(e) + +#else + +#define lua_assert(c) ((void)0) +#define check_exp(c,e) (e) +#define api_check luai_apicheck + +#endif + + +#ifndef UNUSED +#define UNUSED(x) ((void)(x)) /* to avoid warnings */ +#endif + + +#ifndef cast +#define cast(t, exp) ((t)(exp)) +#endif + +#define cast_byte(i) cast(lu_byte, (i)) +#define cast_num(i) cast(lua_Number, (i)) +#define cast_int(i) cast(int, (i)) + + + +/* +** type for virtual-machine instructions +** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h) +*/ +typedef lu_int32 Instruction; + + + +/* maximum stack for a Lua function */ +#define MAXSTACK 250 + + + +/* minimum size for the string table (must be power of 2) */ +#ifndef MINSTRTABSIZE +#define MINSTRTABSIZE 32 +#endif + + +/* minimum size for string buffer */ +#ifndef LUA_MINBUFFER +#define LUA_MINBUFFER 32 +#endif + + +#ifndef lua_lock +#define lua_lock(L) ((void) 0) +#define lua_unlock(L) ((void) 0) +#endif + +#ifndef luai_threadyield +#define luai_threadyield(L) {lua_unlock(L); lua_lock(L);} +#endif + + +/* +** macro to control inclusion of some hard tests on stack reallocation +*/ +#ifndef HARDSTACKTESTS +#define condhardstacktests(x) ((void)0) +#else +#define condhardstacktests(x) x +#endif + +#endif diff --git a/rpm-5.4.9/lua/lmathlib.c b/rpm-5.4.9/lua/lmathlib.c new file mode 100644 index 0000000..441fbf7 --- /dev/null +++ b/rpm-5.4.9/lua/lmathlib.c @@ -0,0 +1,263 @@ +/* +** $Id: lmathlib.c,v 1.67.1.1 2007/12/27 13:02:25 roberto Exp $ +** Standard mathematical library +** See Copyright Notice in lua.h +*/ + + +#include +#include + +#define lmathlib_c +#define LUA_LIB + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + +#undef PI +#define PI (3.14159265358979323846) +#define RADIANS_PER_DEGREE (PI/180.0) + + + +static int math_abs (lua_State *L) { + lua_pushnumber(L, fabs(luaL_checknumber(L, 1))); + return 1; +} + +static int math_sin (lua_State *L) { + lua_pushnumber(L, sin(luaL_checknumber(L, 1))); + return 1; +} + +static int math_sinh (lua_State *L) { + lua_pushnumber(L, sinh(luaL_checknumber(L, 1))); + return 1; +} + +static int math_cos (lua_State *L) { + lua_pushnumber(L, cos(luaL_checknumber(L, 1))); + return 1; +} + +static int math_cosh (lua_State *L) { + lua_pushnumber(L, cosh(luaL_checknumber(L, 1))); + return 1; +} + +static int math_tan (lua_State *L) { + lua_pushnumber(L, tan(luaL_checknumber(L, 1))); + return 1; +} + +static int math_tanh (lua_State *L) { + lua_pushnumber(L, tanh(luaL_checknumber(L, 1))); + return 1; +} + +static int math_asin (lua_State *L) { + lua_pushnumber(L, asin(luaL_checknumber(L, 1))); + return 1; +} + +static int math_acos (lua_State *L) { + lua_pushnumber(L, acos(luaL_checknumber(L, 1))); + return 1; +} + +static int math_atan (lua_State *L) { + lua_pushnumber(L, atan(luaL_checknumber(L, 1))); + return 1; +} + +static int math_atan2 (lua_State *L) { + lua_pushnumber(L, atan2(luaL_checknumber(L, 1), luaL_checknumber(L, 2))); + return 1; +} + +static int math_ceil (lua_State *L) { + lua_pushnumber(L, ceil(luaL_checknumber(L, 1))); + return 1; +} + +static int math_floor (lua_State *L) { + lua_pushnumber(L, floor(luaL_checknumber(L, 1))); + return 1; +} + +static int math_fmod (lua_State *L) { + lua_pushnumber(L, fmod(luaL_checknumber(L, 1), luaL_checknumber(L, 2))); + return 1; +} + +static int math_modf (lua_State *L) { + double ip; + double fp = modf(luaL_checknumber(L, 1), &ip); + lua_pushnumber(L, ip); + lua_pushnumber(L, fp); + return 2; +} + +static int math_sqrt (lua_State *L) { + lua_pushnumber(L, sqrt(luaL_checknumber(L, 1))); + return 1; +} + +static int math_pow (lua_State *L) { + lua_pushnumber(L, pow(luaL_checknumber(L, 1), luaL_checknumber(L, 2))); + return 1; +} + +static int math_log (lua_State *L) { + lua_pushnumber(L, log(luaL_checknumber(L, 1))); + return 1; +} + +static int math_log10 (lua_State *L) { + lua_pushnumber(L, log10(luaL_checknumber(L, 1))); + return 1; +} + +static int math_exp (lua_State *L) { + lua_pushnumber(L, exp(luaL_checknumber(L, 1))); + return 1; +} + +static int math_deg (lua_State *L) { + lua_pushnumber(L, luaL_checknumber(L, 1)/RADIANS_PER_DEGREE); + return 1; +} + +static int math_rad (lua_State *L) { + lua_pushnumber(L, luaL_checknumber(L, 1)*RADIANS_PER_DEGREE); + return 1; +} + +static int math_frexp (lua_State *L) { + int e; + lua_pushnumber(L, frexp(luaL_checknumber(L, 1), &e)); + lua_pushinteger(L, e); + return 2; +} + +static int math_ldexp (lua_State *L) { + lua_pushnumber(L, ldexp(luaL_checknumber(L, 1), luaL_checkint(L, 2))); + return 1; +} + + + +static int math_min (lua_State *L) { + int n = lua_gettop(L); /* number of arguments */ + lua_Number dmin = luaL_checknumber(L, 1); + int i; + for (i=2; i<=n; i++) { + lua_Number d = luaL_checknumber(L, i); + if (d < dmin) + dmin = d; + } + lua_pushnumber(L, dmin); + return 1; +} + + +static int math_max (lua_State *L) { + int n = lua_gettop(L); /* number of arguments */ + lua_Number dmax = luaL_checknumber(L, 1); + int i; + for (i=2; i<=n; i++) { + lua_Number d = luaL_checknumber(L, i); + if (d > dmax) + dmax = d; + } + lua_pushnumber(L, dmax); + return 1; +} + + +static int math_random (lua_State *L) { + /* the `%' avoids the (rare) case of r==1, and is needed also because on + some systems (SunOS!) `rand()' may return a value larger than RAND_MAX */ + lua_Number r = (lua_Number)(rand()%RAND_MAX) / (lua_Number)RAND_MAX; + switch (lua_gettop(L)) { /* check number of arguments */ + case 0: { /* no arguments */ + lua_pushnumber(L, r); /* Number between 0 and 1 */ + break; + } + case 1: { /* only upper limit */ + int u = luaL_checkint(L, 1); + luaL_argcheck(L, 1<=u, 1, "interval is empty"); + lua_pushnumber(L, floor(r*u)+1); /* int between 1 and `u' */ + break; + } + case 2: { /* lower and upper limits */ + int l = luaL_checkint(L, 1); + int u = luaL_checkint(L, 2); + luaL_argcheck(L, l<=u, 2, "interval is empty"); + lua_pushnumber(L, floor(r*(u-l+1))+l); /* int between `l' and `u' */ + break; + } + default: return luaL_error(L, "wrong number of arguments"); + } + return 1; +} + + +static int math_randomseed (lua_State *L) { + srand(luaL_checkint(L, 1)); + return 0; +} + + +static const luaL_Reg mathlib[] = { + {"abs", math_abs}, + {"acos", math_acos}, + {"asin", math_asin}, + {"atan2", math_atan2}, + {"atan", math_atan}, + {"ceil", math_ceil}, + {"cosh", math_cosh}, + {"cos", math_cos}, + {"deg", math_deg}, + {"exp", math_exp}, + {"floor", math_floor}, + {"fmod", math_fmod}, + {"frexp", math_frexp}, + {"ldexp", math_ldexp}, + {"log10", math_log10}, + {"log", math_log}, + {"max", math_max}, + {"min", math_min}, + {"modf", math_modf}, + {"pow", math_pow}, + {"rad", math_rad}, + {"random", math_random}, + {"randomseed", math_randomseed}, + {"sinh", math_sinh}, + {"sin", math_sin}, + {"sqrt", math_sqrt}, + {"tanh", math_tanh}, + {"tan", math_tan}, + {NULL, NULL} +}; + + +/* +** Open math library +*/ +LUALIB_API int luaopen_math (lua_State *L) { + luaL_register(L, LUA_MATHLIBNAME, mathlib); + lua_pushnumber(L, PI); + lua_setfield(L, -2, "pi"); + lua_pushnumber(L, HUGE_VAL); + lua_setfield(L, -2, "huge"); +#if defined(LUA_COMPAT_MOD) + lua_getfield(L, -1, "fmod"); + lua_setfield(L, -2, "mod"); +#endif + return 1; +} + diff --git a/rpm-5.4.9/lua/lmem.c b/rpm-5.4.9/lua/lmem.c new file mode 100644 index 0000000..ae7d8c9 --- /dev/null +++ b/rpm-5.4.9/lua/lmem.c @@ -0,0 +1,86 @@ +/* +** $Id: lmem.c,v 1.70.1.1 2007/12/27 13:02:25 roberto Exp $ +** Interface to Memory Manager +** See Copyright Notice in lua.h +*/ + + +#include + +#define lmem_c +#define LUA_CORE + +#include "lua.h" + +#include "ldebug.h" +#include "ldo.h" +#include "lmem.h" +#include "lobject.h" +#include "lstate.h" + + + +/* +** About the realloc function: +** void * frealloc (void *ud, void *ptr, size_t osize, size_t nsize); +** (`osize' is the old size, `nsize' is the new size) +** +** Lua ensures that (ptr == NULL) iff (osize == 0). +** +** * frealloc(ud, NULL, 0, x) creates a new block of size `x' +** +** * frealloc(ud, p, x, 0) frees the block `p' +** (in this specific case, frealloc must return NULL). +** particularly, frealloc(ud, NULL, 0, 0) does nothing +** (which is equivalent to free(NULL) in ANSI C) +** +** frealloc returns NULL if it cannot create or reallocate the area +** (any reallocation to an equal or smaller size cannot fail!) +*/ + + + +#define MINSIZEARRAY 4 + + +void *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elems, + int limit, const char *errormsg) { + void *newblock; + int newsize; + if (*size >= limit/2) { /* cannot double it? */ + if (*size >= limit) /* cannot grow even a little? */ + luaG_runerror(L, errormsg); + newsize = limit; /* still have at least one free place */ + } + else { + newsize = (*size)*2; + if (newsize < MINSIZEARRAY) + newsize = MINSIZEARRAY; /* minimum size */ + } + newblock = luaM_reallocv(L, block, *size, newsize, size_elems); + *size = newsize; /* update only when everything else is OK */ + return newblock; +} + + +void *luaM_toobig (lua_State *L) { + luaG_runerror(L, "memory allocation error: block too big"); + return NULL; /* to avoid warnings */ +} + + + +/* +** generic allocation routine. +*/ +void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) { + global_State *g = G(L); + lua_assert((osize == 0) == (block == NULL)); + block = (*g->frealloc)(g->ud, block, osize, nsize); + if (block == NULL && nsize > 0) + luaD_throw(L, LUA_ERRMEM); + lua_assert((nsize == 0) == (block == NULL)); + g->totalbytes = (g->totalbytes - osize) + nsize; + return block; +} + diff --git a/rpm-5.4.9/lua/lmem.h b/rpm-5.4.9/lua/lmem.h new file mode 100644 index 0000000..7c2dcb3 --- /dev/null +++ b/rpm-5.4.9/lua/lmem.h @@ -0,0 +1,49 @@ +/* +** $Id: lmem.h,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $ +** Interface to Memory Manager +** See Copyright Notice in lua.h +*/ + +#ifndef lmem_h +#define lmem_h + + +#include + +#include "llimits.h" +#include "lua.h" + +#define MEMERRMSG "not enough memory" + + +#define luaM_reallocv(L,b,on,n,e) \ + ((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \ + luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \ + luaM_toobig(L)) + +#define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0) +#define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0) +#define luaM_freearray(L, b, n, t) luaM_reallocv(L, (b), n, 0, sizeof(t)) + +#define luaM_malloc(L,t) luaM_realloc_(L, NULL, 0, (t)) +#define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t))) +#define luaM_newvector(L,n,t) \ + cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t))) + +#define luaM_growvector(L,v,nelems,size,t,limit,e) \ + if ((nelems)+1 > (size)) \ + ((v)=cast(t *, luaM_growaux_(L,v,&(size),sizeof(t),limit,e))) + +#define luaM_reallocvector(L, v,oldn,n,t) \ + ((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t)))) + + +LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize, + size_t size); +LUAI_FUNC void *luaM_toobig (lua_State *L); +LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size, + size_t size_elem, int limit, + const char *errormsg); + +#endif + diff --git a/rpm-5.4.9/lua/loadlib.c b/rpm-5.4.9/lua/loadlib.c new file mode 100644 index 0000000..0d401eb --- /dev/null +++ b/rpm-5.4.9/lua/loadlib.c @@ -0,0 +1,666 @@ +/* +** $Id: loadlib.c,v 1.52.1.3 2008/08/06 13:29:28 roberto Exp $ +** Dynamic library loader for Lua +** See Copyright Notice in lua.h +** +** This module contains an implementation of loadlib for Unix systems +** that have dlfcn, an implementation for Darwin (Mac OS X), an +** implementation for Windows, and a stub for other systems. +*/ + + +#include +#include + + +#define loadlib_c +#define LUA_LIB + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + +/* prefix for open functions in C libraries */ +#define LUA_POF "luaopen_" + +/* separator for open functions in C libraries */ +#define LUA_OFSEP "_" + + +#define LIBPREFIX "LOADLIB: " + +#define POF LUA_POF +#define LIB_FAIL "open" + + +/* error codes for ll_loadfunc */ +#define ERRLIB 1 +#define ERRFUNC 2 + +#define setprogdir(L) ((void)0) + + +static void ll_unloadlib (void *lib); +static void *ll_load (lua_State *L, const char *path); +static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym); + + + +#if defined(LUA_DL_DLOPEN) +/* +** {======================================================================== +** This is an implementation of loadlib based on the dlfcn interface. +** The dlfcn interface is available in Linux, SunOS, Solaris, IRIX, FreeBSD, +** NetBSD, AIX 4.2, HPUX 11, and probably most other Unix flavors, at least +** as an emulation layer on top of native functions. +** ========================================================================= +*/ + +#include + +static void ll_unloadlib (void *lib) { + dlclose(lib); +} + + +static void *ll_load (lua_State *L, const char *path) { + void *lib = dlopen(path, RTLD_NOW); + if (lib == NULL) lua_pushstring(L, dlerror()); + return lib; +} + + +static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { + lua_CFunction f = (lua_CFunction)dlsym(lib, sym); + if (f == NULL) lua_pushstring(L, dlerror()); + return f; +} + +/* }====================================================== */ + + + +#elif defined(LUA_DL_DLL) +/* +** {====================================================================== +** This is an implementation of loadlib for Windows using native functions. +** ======================================================================= +*/ + +#include + + +#undef setprogdir + +static void setprogdir (lua_State *L) { + char buff[MAX_PATH + 1]; + char *lb; + DWORD nsize = sizeof(buff)/sizeof(char); + DWORD n = GetModuleFileNameA(NULL, buff, nsize); + if (n == 0 || n == nsize || (lb = strrchr(buff, '\\')) == NULL) + luaL_error(L, "unable to get ModuleFileName"); + else { + *lb = '\0'; + luaL_gsub(L, lua_tostring(L, -1), LUA_EXECDIR, buff); + lua_remove(L, -2); /* remove original string */ + } +} + + +static void pusherror (lua_State *L) { + int error = GetLastError(); + char buffer[128]; + if (FormatMessageA(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, error, 0, buffer, sizeof(buffer), NULL)) + lua_pushstring(L, buffer); + else + lua_pushfstring(L, "system error %d\n", error); +} + +static void ll_unloadlib (void *lib) { + FreeLibrary((HINSTANCE)lib); +} + + +static void *ll_load (lua_State *L, const char *path) { + HINSTANCE lib = LoadLibraryA(path); + if (lib == NULL) pusherror(L); + return lib; +} + + +static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { + lua_CFunction f = (lua_CFunction)GetProcAddress((HINSTANCE)lib, sym); + if (f == NULL) pusherror(L); + return f; +} + +/* }====================================================== */ + + + +#elif defined(LUA_DL_DYLD) +/* +** {====================================================================== +** Native Mac OS X / Darwin Implementation +** ======================================================================= +*/ + +#include + + +/* Mac appends a `_' before C function names */ +#undef POF +#define POF "_" LUA_POF + + +static void pusherror (lua_State *L) { + const char *err_str; + const char *err_file; + NSLinkEditErrors err; + int err_num; + NSLinkEditError(&err, &err_num, &err_file, &err_str); + lua_pushstring(L, err_str); +} + + +static const char *errorfromcode (NSObjectFileImageReturnCode ret) { + switch (ret) { + case NSObjectFileImageInappropriateFile: + return "file is not a bundle"; + case NSObjectFileImageArch: + return "library is for wrong CPU type"; + case NSObjectFileImageFormat: + return "bad format"; + case NSObjectFileImageAccess: + return "cannot access file"; + case NSObjectFileImageFailure: + default: + return "unable to load library"; + } +} + + +static void ll_unloadlib (void *lib) { + NSUnLinkModule((NSModule)lib, NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES); +} + + +static void *ll_load (lua_State *L, const char *path) { + NSObjectFileImage img; + NSObjectFileImageReturnCode ret; + /* this would be a rare case, but prevents crashing if it happens */ + if(!_dyld_present()) { + lua_pushliteral(L, "dyld not present"); + return NULL; + } + ret = NSCreateObjectFileImageFromFile(path, &img); + if (ret == NSObjectFileImageSuccess) { + NSModule mod = NSLinkModule(img, path, NSLINKMODULE_OPTION_PRIVATE | + NSLINKMODULE_OPTION_RETURN_ON_ERROR); + NSDestroyObjectFileImage(img); + if (mod == NULL) pusherror(L); + return mod; + } + lua_pushstring(L, errorfromcode(ret)); + return NULL; +} + + +static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { + NSSymbol nss = NSLookupSymbolInModule((NSModule)lib, sym); + if (nss == NULL) { + lua_pushfstring(L, "symbol " LUA_QS " not found", sym); + return NULL; + } + return (lua_CFunction)NSAddressOfSymbol(nss); +} + +/* }====================================================== */ + + + +#else +/* +** {====================================================== +** Fallback for other systems +** ======================================================= +*/ + +#undef LIB_FAIL +#define LIB_FAIL "absent" + + +#define DLMSG "dynamic libraries not enabled; check your Lua installation" + + +static void ll_unloadlib (void *lib) { + (void)lib; /* to avoid warnings */ +} + + +static void *ll_load (lua_State *L, const char *path) { + (void)path; /* to avoid warnings */ + lua_pushliteral(L, DLMSG); + return NULL; +} + + +static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { + (void)lib; (void)sym; /* to avoid warnings */ + lua_pushliteral(L, DLMSG); + return NULL; +} + +/* }====================================================== */ +#endif + + + +static void **ll_register (lua_State *L, const char *path) { + void **plib; + lua_pushfstring(L, "%s%s", LIBPREFIX, path); + lua_gettable(L, LUA_REGISTRYINDEX); /* check library in registry? */ + if (!lua_isnil(L, -1)) /* is there an entry? */ + plib = (void **)lua_touserdata(L, -1); + else { /* no entry yet; create one */ + lua_pop(L, 1); + plib = (void **)lua_newuserdata(L, sizeof(const void *)); + *plib = NULL; + luaL_getmetatable(L, "_LOADLIB"); + lua_setmetatable(L, -2); + lua_pushfstring(L, "%s%s", LIBPREFIX, path); + lua_pushvalue(L, -2); + lua_settable(L, LUA_REGISTRYINDEX); + } + return plib; +} + + +/* +** __gc tag method: calls library's `ll_unloadlib' function with the lib +** handle +*/ +static int gctm (lua_State *L) { + void **lib = (void **)luaL_checkudata(L, 1, "_LOADLIB"); + if (*lib) ll_unloadlib(*lib); + *lib = NULL; /* mark library as closed */ + return 0; +} + + +static int ll_loadfunc (lua_State *L, const char *path, const char *sym) { + void **reg = ll_register(L, path); + if (*reg == NULL) *reg = ll_load(L, path); + if (*reg == NULL) + return ERRLIB; /* unable to load library */ + else { + lua_CFunction f = ll_sym(L, *reg, sym); + if (f == NULL) + return ERRFUNC; /* unable to find function */ + lua_pushcfunction(L, f); + return 0; /* return function */ + } +} + + +static int ll_loadlib (lua_State *L) { + const char *path = luaL_checkstring(L, 1); + const char *init = luaL_checkstring(L, 2); + int stat = ll_loadfunc(L, path, init); + if (stat == 0) /* no errors? */ + return 1; /* return the loaded function */ + else { /* error; error message is on stack top */ + lua_pushnil(L); + lua_insert(L, -2); + lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init"); + return 3; /* return nil, error message, and where */ + } +} + + + +/* +** {====================================================== +** 'require' function +** ======================================================= +*/ + + +static int readable (const char *filename) { + FILE *f = fopen(filename, "r"); /* try to open file */ + if (f == NULL) return 0; /* open failed */ + fclose(f); + return 1; +} + + +static const char *pushnexttemplate (lua_State *L, const char *path) { + const char *l; + while (*path == *LUA_PATHSEP) path++; /* skip separators */ + if (*path == '\0') return NULL; /* no more templates */ + l = strchr(path, *LUA_PATHSEP); /* find next separator */ + if (l == NULL) l = path + strlen(path); + lua_pushlstring(L, path, l - path); /* template */ + return l; +} + + +static const char *findfile (lua_State *L, const char *name, + const char *pname) { + const char *path; + name = luaL_gsub(L, name, ".", LUA_DIRSEP); + lua_getfield(L, LUA_ENVIRONINDEX, pname); + path = lua_tostring(L, -1); + if (path == NULL) + luaL_error(L, LUA_QL("package.%s") " must be a string", pname); + lua_pushliteral(L, ""); /* error accumulator */ + while ((path = pushnexttemplate(L, path)) != NULL) { + const char *filename; + filename = luaL_gsub(L, lua_tostring(L, -1), LUA_PATH_MARK, name); + lua_remove(L, -2); /* remove path template */ + if (readable(filename)) /* does file exist and is readable? */ + return filename; /* return that file name */ + lua_pushfstring(L, "\n\tno file " LUA_QS, filename); + lua_remove(L, -2); /* remove file name */ + lua_concat(L, 2); /* add entry to possible error message */ + } + return NULL; /* not found */ +} + + +static void loaderror (lua_State *L, const char *filename) { + luaL_error(L, "error loading module " LUA_QS " from file " LUA_QS ":\n\t%s", + lua_tostring(L, 1), filename, lua_tostring(L, -1)); +} + + +static int loader_Lua (lua_State *L) { + const char *filename; + const char *name = luaL_checkstring(L, 1); + filename = findfile(L, name, "path"); + if (filename == NULL) return 1; /* library not found in this path */ + if (luaL_loadfile(L, filename) != 0) + loaderror(L, filename); + return 1; /* library loaded successfully */ +} + + +static const char *mkfuncname (lua_State *L, const char *modname) { + const char *funcname; + const char *mark = strchr(modname, *LUA_IGMARK); + if (mark) modname = mark + 1; + funcname = luaL_gsub(L, modname, ".", LUA_OFSEP); + funcname = lua_pushfstring(L, POF"%s", funcname); + lua_remove(L, -2); /* remove 'gsub' result */ + return funcname; +} + + +static int loader_C (lua_State *L) { + const char *funcname; + const char *name = luaL_checkstring(L, 1); + const char *filename = findfile(L, name, "cpath"); + if (filename == NULL) return 1; /* library not found in this path */ + funcname = mkfuncname(L, name); + if (ll_loadfunc(L, filename, funcname) != 0) + loaderror(L, filename); + return 1; /* library loaded successfully */ +} + + +static int loader_Croot (lua_State *L) { + const char *funcname; + const char *filename; + const char *name = luaL_checkstring(L, 1); + const char *p = strchr(name, '.'); + int stat; + if (p == NULL) return 0; /* is root */ + lua_pushlstring(L, name, p - name); + filename = findfile(L, lua_tostring(L, -1), "cpath"); + if (filename == NULL) return 1; /* root not found */ + funcname = mkfuncname(L, name); + if ((stat = ll_loadfunc(L, filename, funcname)) != 0) { + if (stat != ERRFUNC) loaderror(L, filename); /* real error */ + lua_pushfstring(L, "\n\tno module " LUA_QS " in file " LUA_QS, + name, filename); + return 1; /* function not found */ + } + return 1; +} + + +static int loader_preload (lua_State *L) { + const char *name = luaL_checkstring(L, 1); + lua_getfield(L, LUA_ENVIRONINDEX, "preload"); + if (!lua_istable(L, -1)) + luaL_error(L, LUA_QL("package.preload") " must be a table"); + lua_getfield(L, -1, name); + if (lua_isnil(L, -1)) /* not found? */ + lua_pushfstring(L, "\n\tno field package.preload['%s']", name); + return 1; +} + + +static const int sentinel_ = 0; +#define sentinel ((void *)&sentinel_) + + +static int ll_require (lua_State *L) { + const char *name = luaL_checkstring(L, 1); + int i; + lua_settop(L, 1); /* _LOADED table will be at index 2 */ + lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); + lua_getfield(L, 2, name); + if (lua_toboolean(L, -1)) { /* is it there? */ + if (lua_touserdata(L, -1) == sentinel) /* check loops */ + luaL_error(L, "loop or previous error loading module " LUA_QS, name); + return 1; /* package is already loaded */ + } + /* else must load it; iterate over available loaders */ + lua_getfield(L, LUA_ENVIRONINDEX, "loaders"); + if (!lua_istable(L, -1)) + luaL_error(L, LUA_QL("package.loaders") " must be a table"); + lua_pushliteral(L, ""); /* error message accumulator */ + for (i=1; ; i++) { + lua_rawgeti(L, -2, i); /* get a loader */ + if (lua_isnil(L, -1)) + luaL_error(L, "module " LUA_QS " not found:%s", + name, lua_tostring(L, -2)); + lua_pushstring(L, name); + lua_call(L, 1, 1); /* call it */ + if (lua_isfunction(L, -1)) /* did it find module? */ + break; /* module loaded successfully */ + else if (lua_isstring(L, -1)) /* loader returned error message? */ + lua_concat(L, 2); /* accumulate it */ + else + lua_pop(L, 1); + } + lua_pushlightuserdata(L, sentinel); + lua_setfield(L, 2, name); /* _LOADED[name] = sentinel */ + lua_pushstring(L, name); /* pass name as argument to module */ + lua_call(L, 1, 1); /* run loaded module */ + if (!lua_isnil(L, -1)) /* non-nil return? */ + lua_setfield(L, 2, name); /* _LOADED[name] = returned value */ + lua_getfield(L, 2, name); + if (lua_touserdata(L, -1) == sentinel) { /* module did not set a value? */ + lua_pushboolean(L, 1); /* use true as result */ + lua_pushvalue(L, -1); /* extra copy to be returned */ + lua_setfield(L, 2, name); /* _LOADED[name] = true */ + } + return 1; +} + +/* }====================================================== */ + + + +/* +** {====================================================== +** 'module' function +** ======================================================= +*/ + + +static void setfenv (lua_State *L) { + lua_Debug ar; + if (lua_getstack(L, 1, &ar) == 0 || + lua_getinfo(L, "f", &ar) == 0 || /* get calling function */ + lua_iscfunction(L, -1)) + luaL_error(L, LUA_QL("module") " not called from a Lua function"); + lua_pushvalue(L, -2); + lua_setfenv(L, -2); + lua_pop(L, 1); +} + + +static void dooptions (lua_State *L, int n) { + int i; + for (i = 2; i <= n; i++) { + lua_pushvalue(L, i); /* get option (a function) */ + lua_pushvalue(L, -2); /* module */ + lua_call(L, 1, 0); + } +} + + +static void modinit (lua_State *L, const char *modname) { + const char *dot; + lua_pushvalue(L, -1); + lua_setfield(L, -2, "_M"); /* module._M = module */ + lua_pushstring(L, modname); + lua_setfield(L, -2, "_NAME"); + dot = strrchr(modname, '.'); /* look for last dot in module name */ + if (dot == NULL) dot = modname; + else dot++; + /* set _PACKAGE as package name (full module name minus last part) */ + lua_pushlstring(L, modname, dot - modname); + lua_setfield(L, -2, "_PACKAGE"); +} + + +static int ll_module (lua_State *L) { + const char *modname = luaL_checkstring(L, 1); + int loaded = lua_gettop(L) + 1; /* index of _LOADED table */ + lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); + lua_getfield(L, loaded, modname); /* get _LOADED[modname] */ + if (!lua_istable(L, -1)) { /* not found? */ + lua_pop(L, 1); /* remove previous result */ + /* try global variable (and create one if it does not exist) */ + if (luaL_findtable(L, LUA_GLOBALSINDEX, modname, 1) != NULL) + return luaL_error(L, "name conflict for module " LUA_QS, modname); + lua_pushvalue(L, -1); + lua_setfield(L, loaded, modname); /* _LOADED[modname] = new table */ + } + /* check whether table already has a _NAME field */ + lua_getfield(L, -1, "_NAME"); + if (!lua_isnil(L, -1)) /* is table an initialized module? */ + lua_pop(L, 1); + else { /* no; initialize it */ + lua_pop(L, 1); + modinit(L, modname); + } + lua_pushvalue(L, -1); + setfenv(L); + dooptions(L, loaded - 1); + return 0; +} + + +static int ll_seeall (lua_State *L) { + luaL_checktype(L, 1, LUA_TTABLE); + if (!lua_getmetatable(L, 1)) { + lua_createtable(L, 0, 1); /* create new metatable */ + lua_pushvalue(L, -1); + lua_setmetatable(L, 1); + } + lua_pushvalue(L, LUA_GLOBALSINDEX); + lua_setfield(L, -2, "__index"); /* mt.__index = _G */ + return 0; +} + + +/* }====================================================== */ + + + +/* auxiliary mark (for internal use) */ +#define AUXMARK "\1" + +static void setpath (lua_State *L, const char *fieldname, const char *envname, + const char *def) { + const char *path = getenv(envname); + if (path == NULL) /* no environment variable? */ + lua_pushstring(L, def); /* use default */ + else { + /* replace ";;" by ";AUXMARK;" and then AUXMARK by default path */ + path = luaL_gsub(L, path, LUA_PATHSEP LUA_PATHSEP, + LUA_PATHSEP AUXMARK LUA_PATHSEP); + luaL_gsub(L, path, AUXMARK, def); + lua_remove(L, -2); + } + setprogdir(L); + lua_setfield(L, -2, fieldname); +} + + +static const luaL_Reg pk_funcs[] = { + {"loadlib", ll_loadlib}, + {"seeall", ll_seeall}, + {NULL, NULL} +}; + + +static const luaL_Reg ll_funcs[] = { + {"module", ll_module}, + {"require", ll_require}, + {NULL, NULL} +}; + + +static const lua_CFunction loaders[] = + {loader_preload, loader_Lua, loader_C, loader_Croot, NULL}; + + +LUALIB_API int luaopen_package (lua_State *L) { + int i; + /* create new type _LOADLIB */ + luaL_newmetatable(L, "_LOADLIB"); + lua_pushcfunction(L, gctm); + lua_setfield(L, -2, "__gc"); + /* create `package' table */ + luaL_register(L, LUA_LOADLIBNAME, pk_funcs); +#if defined(LUA_COMPAT_LOADLIB) + lua_getfield(L, -1, "loadlib"); + lua_setfield(L, LUA_GLOBALSINDEX, "loadlib"); +#endif + lua_pushvalue(L, -1); + lua_replace(L, LUA_ENVIRONINDEX); + /* create `loaders' table */ + lua_createtable(L, 0, sizeof(loaders)/sizeof(loaders[0]) - 1); + /* fill it with pre-defined loaders */ + for (i=0; loaders[i] != NULL; i++) { + lua_pushcfunction(L, loaders[i]); + lua_rawseti(L, -2, i+1); + } + lua_setfield(L, -2, "loaders"); /* put it in field `loaders' */ + setpath(L, "path", LUA_PATH, LUA_PATH_DEFAULT); /* set field `path' */ + setpath(L, "cpath", LUA_CPATH, LUA_CPATH_DEFAULT); /* set field `cpath' */ + /* store config information */ + lua_pushliteral(L, LUA_DIRSEP "\n" LUA_PATHSEP "\n" LUA_PATH_MARK "\n" + LUA_EXECDIR "\n" LUA_IGMARK); + lua_setfield(L, -2, "config"); + /* set field `loaded' */ + luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 2); + lua_setfield(L, -2, "loaded"); + /* set field `preload' */ + lua_newtable(L); + lua_setfield(L, -2, "preload"); + lua_pushvalue(L, LUA_GLOBALSINDEX); + luaL_register(L, NULL, ll_funcs); /* open lib into global table */ + lua_pop(L, 1); + return 1; /* return 'package' table */ +} + diff --git a/rpm-5.4.9/lua/lobject.c b/rpm-5.4.9/lua/lobject.c new file mode 100644 index 0000000..4ff5073 --- /dev/null +++ b/rpm-5.4.9/lua/lobject.c @@ -0,0 +1,214 @@ +/* +** $Id: lobject.c,v 2.22.1.1 2007/12/27 13:02:25 roberto Exp $ +** Some generic functions over Lua objects +** See Copyright Notice in lua.h +*/ + +#include +#include +#include +#include +#include + +#define lobject_c +#define LUA_CORE + +#include "lua.h" + +#include "ldo.h" +#include "lmem.h" +#include "lobject.h" +#include "lstate.h" +#include "lstring.h" +#include "lvm.h" + + + +const TValue luaO_nilobject_ = {{NULL}, LUA_TNIL}; + + +/* +** converts an integer to a "floating point byte", represented as +** (eeeeexxx), where the real value is (1xxx) * 2^(eeeee - 1) if +** eeeee != 0 and (xxx) otherwise. +*/ +int luaO_int2fb (unsigned int x) { + int e = 0; /* expoent */ + while (x >= 16) { + x = (x+1) >> 1; + e++; + } + if (x < 8) return x; + else return ((e+1) << 3) | (cast_int(x) - 8); +} + + +/* converts back */ +int luaO_fb2int (int x) { + int e = (x >> 3) & 31; + if (e == 0) return x; + else return ((x & 7)+8) << (e - 1); +} + + +int luaO_log2 (unsigned int x) { + static const lu_byte log_2[256] = { + 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 + }; + int l = -1; + while (x >= 256) { l += 8; x >>= 8; } + return l + log_2[x]; + +} + + +int luaO_rawequalObj (const TValue *t1, const TValue *t2) { + if (ttype(t1) != ttype(t2)) return 0; + else switch (ttype(t1)) { + case LUA_TNIL: + return 1; + case LUA_TNUMBER: + return luai_numeq(nvalue(t1), nvalue(t2)); + case LUA_TBOOLEAN: + return bvalue(t1) == bvalue(t2); /* boolean true must be 1 !! */ + case LUA_TLIGHTUSERDATA: + return pvalue(t1) == pvalue(t2); + default: + lua_assert(iscollectable(t1)); + return gcvalue(t1) == gcvalue(t2); + } +} + + +int luaO_str2d (const char *s, lua_Number *result) { + char *endptr; + *result = lua_str2number(s, &endptr); + if (endptr == s) return 0; /* conversion failed */ + if (*endptr == 'x' || *endptr == 'X') /* maybe an hexadecimal constant? */ + *result = cast_num(strtoul(s, &endptr, 16)); + if (*endptr == '\0') return 1; /* most common case */ + while (isspace(cast(unsigned char, *endptr))) endptr++; + if (*endptr != '\0') return 0; /* invalid trailing characters? */ + return 1; +} + + + +static void pushstr (lua_State *L, const char *str) { + setsvalue2s(L, L->top, luaS_new(L, str)); + incr_top(L); +} + + +/* this function handles only `%d', `%c', %f, %p, and `%s' formats */ +const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) { + int n = 1; + pushstr(L, ""); + for (;;) { + const char *e = strchr(fmt, '%'); + if (e == NULL) break; + setsvalue2s(L, L->top, luaS_newlstr(L, fmt, e-fmt)); + incr_top(L); + switch (*(e+1)) { + case 's': { + const char *s = va_arg(argp, char *); + if (s == NULL) s = "(null)"; + pushstr(L, s); + break; + } + case 'c': { + char buff[2]; + buff[0] = cast(char, va_arg(argp, int)); + buff[1] = '\0'; + pushstr(L, buff); + break; + } + case 'd': { + setnvalue(L->top, cast_num(va_arg(argp, int))); + incr_top(L); + break; + } + case 'f': { + setnvalue(L->top, cast_num(va_arg(argp, l_uacNumber))); + incr_top(L); + break; + } + case 'p': { + char buff[4*sizeof(void *) + 8]; /* should be enough space for a `%p' */ + sprintf(buff, "%p", va_arg(argp, void *)); + pushstr(L, buff); + break; + } + case '%': { + pushstr(L, "%"); + break; + } + default: { + char buff[3]; + buff[0] = '%'; + buff[1] = *(e+1); + buff[2] = '\0'; + pushstr(L, buff); + break; + } + } + n += 2; + fmt = e+2; + } + pushstr(L, fmt); + luaV_concat(L, n+1, cast_int(L->top - L->base) - 1); + L->top -= n; + return svalue(L->top - 1); +} + + +const char *luaO_pushfstring (lua_State *L, const char *fmt, ...) { + const char *msg; + va_list argp; + va_start(argp, fmt); + msg = luaO_pushvfstring(L, fmt, argp); + va_end(argp); + return msg; +} + + +void luaO_chunkid (char *out, const char *source, size_t bufflen) { + if (*source == '=') { + strncpy(out, source+1, bufflen); /* remove first char */ + out[bufflen-1] = '\0'; /* ensures null termination */ + } + else { /* out = "source", or "...source" */ + if (*source == '@') { + size_t l; + source++; /* skip the `@' */ + bufflen -= sizeof(" '...' "); + l = strlen(source); + strcpy(out, ""); + if (l > bufflen) { + source += (l-bufflen); /* get last part of file name */ + strcat(out, "..."); + } + strcat(out, source); + } + else { /* out = [string "string"] */ + size_t len = strcspn(source, "\n\r"); /* stop at first newline */ + bufflen -= sizeof(" [string \"...\"] "); + if (len > bufflen) len = bufflen; + strcpy(out, "[string \""); + if (source[len] != '\0') { /* must truncate? */ + strncat(out, source, len); + strcat(out, "..."); + } + else + strcat(out, source); + strcat(out, "\"]"); + } + } +} diff --git a/rpm-5.4.9/lua/lobject.h b/rpm-5.4.9/lua/lobject.h new file mode 100644 index 0000000..f1e447e --- /dev/null +++ b/rpm-5.4.9/lua/lobject.h @@ -0,0 +1,381 @@ +/* +** $Id: lobject.h,v 2.20.1.2 2008/08/06 13:29:48 roberto Exp $ +** Type definitions for Lua objects +** See Copyright Notice in lua.h +*/ + + +#ifndef lobject_h +#define lobject_h + + +#include + + +#include "llimits.h" +#include "lua.h" + + +/* tags for values visible from Lua */ +#define LAST_TAG LUA_TTHREAD + +#define NUM_TAGS (LAST_TAG+1) + + +/* +** Extra tags for non-values +*/ +#define LUA_TPROTO (LAST_TAG+1) +#define LUA_TUPVAL (LAST_TAG+2) +#define LUA_TDEADKEY (LAST_TAG+3) + + +/* +** Union of all collectable objects +*/ +typedef union GCObject GCObject; + + +/* +** Common Header for all collectable objects (in macro form, to be +** included in other objects) +*/ +#define CommonHeader GCObject *next; lu_byte tt; lu_byte marked + + +/* +** Common header in struct form +*/ +typedef struct GCheader { + CommonHeader; +} GCheader; + + + + +/* +** Union of all Lua values +*/ +typedef union { + GCObject *gc; + void *p; + lua_Number n; + int b; +} Value; + + +/* +** Tagged Values +*/ + +#define TValuefields Value value; int tt + +typedef struct lua_TValue { + TValuefields; +} TValue; + + +/* Macros to test type */ +#define ttisnil(o) (ttype(o) == LUA_TNIL) +#define ttisnumber(o) (ttype(o) == LUA_TNUMBER) +#define ttisstring(o) (ttype(o) == LUA_TSTRING) +#define ttistable(o) (ttype(o) == LUA_TTABLE) +#define ttisfunction(o) (ttype(o) == LUA_TFUNCTION) +#define ttisboolean(o) (ttype(o) == LUA_TBOOLEAN) +#define ttisuserdata(o) (ttype(o) == LUA_TUSERDATA) +#define ttisthread(o) (ttype(o) == LUA_TTHREAD) +#define ttislightuserdata(o) (ttype(o) == LUA_TLIGHTUSERDATA) + +/* Macros to access values */ +#define ttype(o) ((o)->tt) +#define gcvalue(o) check_exp(iscollectable(o), (o)->value.gc) +#define pvalue(o) check_exp(ttislightuserdata(o), (o)->value.p) +#define nvalue(o) check_exp(ttisnumber(o), (o)->value.n) +#define rawtsvalue(o) check_exp(ttisstring(o), &(o)->value.gc->ts) +#define tsvalue(o) (&rawtsvalue(o)->tsv) +#define rawuvalue(o) check_exp(ttisuserdata(o), &(o)->value.gc->u) +#define uvalue(o) (&rawuvalue(o)->uv) +#define clvalue(o) check_exp(ttisfunction(o), &(o)->value.gc->cl) +#define hvalue(o) check_exp(ttistable(o), &(o)->value.gc->h) +#define bvalue(o) check_exp(ttisboolean(o), (o)->value.b) +#define thvalue(o) check_exp(ttisthread(o), &(o)->value.gc->th) + +#define l_isfalse(o) (ttisnil(o) || (ttisboolean(o) && bvalue(o) == 0)) + +/* +** for internal debug only +*/ +#define checkconsistency(obj) \ + lua_assert(!iscollectable(obj) || (ttype(obj) == (obj)->value.gc->gch.tt)) + +#define checkliveness(g,obj) \ + lua_assert(!iscollectable(obj) || \ + ((ttype(obj) == (obj)->value.gc->gch.tt) && !isdead(g, (obj)->value.gc))) + + +/* Macros to set values */ +#define setnilvalue(obj) ((obj)->tt=LUA_TNIL) + +#define setnvalue(obj,x) \ + { TValue *i_o=(obj); i_o->value.n=(x); i_o->tt=LUA_TNUMBER; } + +#define setpvalue(obj,x) \ + { TValue *i_o=(obj); i_o->value.p=(x); i_o->tt=LUA_TLIGHTUSERDATA; } + +#define setbvalue(obj,x) \ + { TValue *i_o=(obj); i_o->value.b=(x); i_o->tt=LUA_TBOOLEAN; } + +#define setsvalue(L,obj,x) \ + { TValue *i_o=(obj); \ + i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TSTRING; \ + checkliveness(G(L),i_o); } + +#define setuvalue(L,obj,x) \ + { TValue *i_o=(obj); \ + i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TUSERDATA; \ + checkliveness(G(L),i_o); } + +#define setthvalue(L,obj,x) \ + { TValue *i_o=(obj); \ + i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTHREAD; \ + checkliveness(G(L),i_o); } + +#define setclvalue(L,obj,x) \ + { TValue *i_o=(obj); \ + i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TFUNCTION; \ + checkliveness(G(L),i_o); } + +#define sethvalue(L,obj,x) \ + { TValue *i_o=(obj); \ + i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTABLE; \ + checkliveness(G(L),i_o); } + +#define setptvalue(L,obj,x) \ + { TValue *i_o=(obj); \ + i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TPROTO; \ + checkliveness(G(L),i_o); } + + + + +#define setobj(L,obj1,obj2) \ + { const TValue *o2=(obj2); TValue *o1=(obj1); \ + o1->value = o2->value; o1->tt=o2->tt; \ + checkliveness(G(L),o1); } + + +/* +** different types of sets, according to destination +*/ + +/* from stack to (same) stack */ +#define setobjs2s setobj +/* to stack (not from same stack) */ +#define setobj2s setobj +#define setsvalue2s setsvalue +#define sethvalue2s sethvalue +#define setptvalue2s setptvalue +/* from table to same table */ +#define setobjt2t setobj +/* to table */ +#define setobj2t setobj +/* to new object */ +#define setobj2n setobj +#define setsvalue2n setsvalue + +#define setttype(obj, tt) (ttype(obj) = (tt)) + + +#define iscollectable(o) (ttype(o) >= LUA_TSTRING) + + + +typedef TValue *StkId; /* index to stack elements */ + + +/* +** String headers for string table +*/ +typedef union TString { + L_Umaxalign dummy; /* ensures maximum alignment for strings */ + struct { + CommonHeader; + lu_byte reserved; + unsigned int hash; + size_t len; + } tsv; +} TString; + + +#define getstr(ts) cast(const char *, (ts) + 1) +#define svalue(o) getstr(rawtsvalue(o)) + + + +typedef union Udata { + L_Umaxalign dummy; /* ensures maximum alignment for `local' udata */ + struct { + CommonHeader; + struct Table *metatable; + struct Table *env; + size_t len; + } uv; +} Udata; + + + + +/* +** Function Prototypes +*/ +typedef struct Proto { + CommonHeader; + TValue *k; /* constants used by the function */ + Instruction *code; + struct Proto **p; /* functions defined inside the function */ + int *lineinfo; /* map from opcodes to source lines */ + struct LocVar *locvars; /* information about local variables */ + TString **upvalues; /* upvalue names */ + TString *source; + int sizeupvalues; + int sizek; /* size of `k' */ + int sizecode; + int sizelineinfo; + int sizep; /* size of `p' */ + int sizelocvars; + int linedefined; + int lastlinedefined; + GCObject *gclist; + lu_byte nups; /* number of upvalues */ + lu_byte numparams; + lu_byte is_vararg; + lu_byte maxstacksize; +} Proto; + + +/* masks for new-style vararg */ +#define VARARG_HASARG 1 +#define VARARG_ISVARARG 2 +#define VARARG_NEEDSARG 4 + + +typedef struct LocVar { + TString *varname; + int startpc; /* first point where variable is active */ + int endpc; /* first point where variable is dead */ +} LocVar; + + + +/* +** Upvalues +*/ + +typedef struct UpVal { + CommonHeader; + TValue *v; /* points to stack or to its own value */ + union { + TValue value; /* the value (when closed) */ + struct { /* double linked list (when open) */ + struct UpVal *prev; + struct UpVal *next; + } l; + } u; +} UpVal; + + +/* +** Closures +*/ + +#define ClosureHeader \ + CommonHeader; lu_byte isC; lu_byte nupvalues; GCObject *gclist; \ + struct Table *env + +typedef struct CClosure { + ClosureHeader; + lua_CFunction f; + TValue upvalue[1]; +} CClosure; + + +typedef struct LClosure { + ClosureHeader; + struct Proto *p; + UpVal *upvals[1]; +} LClosure; + + +typedef union Closure { + CClosure c; + LClosure l; +} Closure; + + +#define iscfunction(o) (ttype(o) == LUA_TFUNCTION && clvalue(o)->c.isC) +#define isLfunction(o) (ttype(o) == LUA_TFUNCTION && !clvalue(o)->c.isC) + + +/* +** Tables +*/ + +typedef union TKey { + struct { + TValuefields; + struct Node *next; /* for chaining */ + } nk; + TValue tvk; +} TKey; + + +typedef struct Node { + TValue i_val; + TKey i_key; +} Node; + + +typedef struct Table { + CommonHeader; + lu_byte flags; /* 1<

lsizenode)) + + +#define luaO_nilobject (&luaO_nilobject_) + +LUAI_DATA const TValue luaO_nilobject_; + +#define ceillog2(x) (luaO_log2((x)-1) + 1) + +LUAI_FUNC int luaO_log2 (unsigned int x); +LUAI_FUNC int luaO_int2fb (unsigned int x); +LUAI_FUNC int luaO_fb2int (int x); +LUAI_FUNC int luaO_rawequalObj (const TValue *t1, const TValue *t2); +LUAI_FUNC int luaO_str2d (const char *s, lua_Number *result); +LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt, + va_list argp); +LUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...); +LUAI_FUNC void luaO_chunkid (char *out, const char *source, size_t len); + + +#endif + diff --git a/rpm-5.4.9/lua/local/.cvsignore b/rpm-5.4.9/lua/local/.cvsignore new file mode 100644 index 0000000..c024f2e --- /dev/null +++ b/rpm-5.4.9/lua/local/.cvsignore @@ -0,0 +1,2 @@ +llocal_lua.c +.libs diff --git a/rpm-5.4.9/lua/local/lcrypto.c b/rpm-5.4.9/lua/local/lcrypto.c new file mode 100644 index 0000000..8a7be2f --- /dev/null +++ b/rpm-5.4.9/lua/local/lcrypto.c @@ -0,0 +1,725 @@ +/* + * $Id: lcrypto.c,v 1.2 2008/10/24 21:44:33 jbj Exp $ + * + * Copyright © 2006 Keith Howe. + * + * 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + +#include +#include +#include +#include +#include + +#include "lua.h" +#include "lauxlib.h" +#if ! defined (LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 +#include "compat-5.1.h" +#endif + +#include "lcrypto.h" + +#if CRYPTO_OPENSSL + #define LUACRYPTO_ENGINE "OpenSSL" + #include + #include + #include + #include + #define HANDLER_EVP EVP_MD_CTX + #define HANDLER_HMAC HMAC_CTX + #define DIGEST_TYPE const EVP_MD* + #define DIGEST_BY_NAME(s) EVP_get_digestbyname(s) + #define IS_DIGEST_INVALID(x) (x==NULL) + #define EVP_UPDATE(c,s,len) EVP_DigestUpdate(c, s, len) + #define HMAC_UPDATE(c,s,len) HMAC_Update(c, (unsigned char *)s, len); + #define EVP_CLEANUP(c) EVP_MD_CTX_cleanup(c); + #define HMAC_CLEANUP(c) HMAC_CTX_cleanup(c); +#elif CRYPTO_GCRYPT + #define LUACRYPTO_ENGINE "gcrypt" + #include + #define HANDLER_EVP gcry_md_hd_t + #define HANDLER_HMAC gcry_md_hd_t + #define DIGEST_TYPE int + #define DIGEST_BY_NAME(s) gcry_md_map_name(s) + #define IS_DIGEST_INVALID(x) (x==0) + #define EVP_UPDATE(c,s,len) gcry_md_write(*c, s, len) + #define HMAC_UPDATE(c,s,len) gcry_md_write(*c, s, len) + #define EVP_CLEANUP(c) gcry_md_close(*c) + #define HMAC_CLEANUP(c) gcry_md_close(*c) +#else + #error "LUACRYPTO_DRIVER not supported" +#endif + +LUACRYPTO_API int luaopen_crypto(lua_State *L); + +static char* bin2hex(const unsigned char *digest, size_t written) +{ + char * hex = calloc(sizeof(char), written*2 + 1); + unsigned int i; + for (i = 0; i < written; i++) + sprintf(hex + 2*i, "%02x", digest[i]); + return hex; +} + +#if CRYPTO_OPENSSL +static int crypto_error(lua_State *L) +{ + char buf[120]; + unsigned long e = ERR_get_error(); + ERR_load_crypto_strings(); + lua_pushnil(L); + lua_pushstring(L, ERR_error_string(e, buf)); + return 2; +} +#endif + +static HANDLER_EVP *evp_pget(lua_State *L, int i) +{ + if (luaL_checkudata(L, i, LUACRYPTO_EVPNAME) == NULL) + luaL_typerror(L, i, LUACRYPTO_EVPNAME); + return lua_touserdata(L, i); +} + +static HANDLER_EVP *evp_pnew(lua_State *L) +{ + HANDLER_EVP *c = lua_newuserdata(L, sizeof(HANDLER_EVP)); + luaL_getmetatable(L, LUACRYPTO_EVPNAME); + lua_setmetatable(L, -2); + return c; +} + +static int evp_fnew(lua_State *L) +{ + HANDLER_EVP *c = NULL; + const char *s = luaL_checkstring(L, 1); + DIGEST_TYPE type = DIGEST_BY_NAME(s); + + if (IS_DIGEST_INVALID(type)) { + luaL_argerror(L, 1, "invalid digest type"); + return 0; + } + + c = evp_pnew(L); + +#if CRYPTO_OPENSSL + EVP_MD_CTX_init(c); + EVP_DigestInit_ex(c, type, NULL); //must return 1 (not checked!) +#elif CRYPTO_GCRYPT + gcry_md_open(c, type, 0); //returns a gcry_error_t (not checked!) +#endif + + return 1; +} + +static int evp_clone(lua_State *L) +{ + HANDLER_EVP *c = evp_pget(L, 1); + HANDLER_EVP *d = evp_pnew(L); + +#if CRYPTO_OPENSSL + EVP_MD_CTX_init(d); + EVP_MD_CTX_copy_ex(d, c); +#elif CRYPTO_GCRYPT + gcry_md_copy(d, *c); +#endif + + return 1; +} + +static int evp_reset(lua_State *L) +{ + HANDLER_EVP *c = evp_pget(L, 1); + +#if CRYPTO_OPENSSL + const EVP_MD *t = EVP_MD_CTX_md(c); + EVP_MD_CTX_cleanup(c); + EVP_MD_CTX_init(c); + EVP_DigestInit_ex(c, t, NULL); +#elif CRYPTO_GCRYPT + gcry_md_reset(*c); +#endif + + return 0; +} + +static int evp_update(lua_State *L) +{ + HANDLER_EVP *c = evp_pget(L, 1); + size_t s_len; + const char *s = luaL_checklstring(L, 2, &s_len); + + EVP_UPDATE(c, s, s_len); + + lua_settop(L, 1); + return 1; +} + +static int evp_digest(lua_State *L) +{ + HANDLER_EVP *c = evp_pget(L, 1); +#if CRYPTO_OPENSSL + HANDLER_EVP *d = NULL; + unsigned char digest[EVP_MAX_MD_SIZE]; +#elif CRYPTO_GCRYPT + HANDLER_EVP d = NULL; + unsigned char *digest; + int algo; +#endif + size_t written = 0; + + if (lua_isstring(L, 2)) + { + size_t s_len; + const char *s = luaL_checklstring(L, 2, &s_len); + EVP_UPDATE(c, s, s_len); + } + +#if CRYPTO_OPENSSL + d = EVP_MD_CTX_create(); + EVP_MD_CTX_copy_ex(d, c); + EVP_DigestFinal_ex(d, digest, &written); + EVP_MD_CTX_destroy(d); +#elif CRYPTO_GCRYPT + algo = gcry_md_get_algo(*c); + gcry_md_copy(&d, *c); + gcry_md_final(d); + digest = gcry_md_read(d, algo); + written = gcry_md_get_algo_dlen(algo); +#endif + + if (lua_toboolean(L, 3)) + lua_pushlstring(L, (char *)digest, written); + else + { + char *hex = bin2hex(digest, written); + lua_pushlstring(L, hex, written*2); + free(hex); + } + +#if CRYPTO_GCRYPT + gcry_md_close(d); +#endif + + return 1; +} + +static int evp_tostring(lua_State *L) +{ + HANDLER_EVP *c = evp_pget(L, 1); + char s[64]; + sprintf(s, "%s %p", LUACRYPTO_EVPNAME, (void *)c); + lua_pushstring(L, s); + return 1; +} + +static int evp_gc(lua_State *L) +{ + HANDLER_EVP *c = evp_pget(L, 1); + EVP_CLEANUP(c); + return 1; +} + +static int evp_fdigest(lua_State *L) +{ + const char *type_name = luaL_checkstring(L, 1); + const char *s = luaL_checkstring(L, 2); + DIGEST_TYPE type = DIGEST_BY_NAME(type_name); + size_t written = 0; +#if CRYPTO_OPENSSL + HANDLER_EVP *c = NULL; + unsigned char digest[EVP_MAX_MD_SIZE]; +#elif CRYPTO_GCRYPT + unsigned char digest[gcry_md_get_algo_dlen(type)]; +#endif + + if (IS_DIGEST_INVALID(type)) { + luaL_argerror(L, 1, "invalid digest type"); + return 0; + } + +#if CRYPTO_OPENSSL + c = EVP_MD_CTX_create(); + EVP_DigestInit_ex(c, type, NULL); + EVP_DigestUpdate(c, s, lua_strlen(L, 2)); + EVP_DigestFinal_ex(c, digest, &written); +#elif CRYPTO_GCRYPT + gcry_md_hash_buffer(type,digest,s,lua_strlen(L, 2)); + written = gcry_md_get_algo_dlen(type); +#endif + + if (lua_toboolean(L, 3)) + lua_pushlstring(L, (char *)digest, written); + else + { + char *hex = bin2hex(digest, written); + lua_pushlstring(L, hex, written*2); + free(hex); + } + + return 1; +} + +static HANDLER_HMAC *hmac_pget(lua_State *L, int i) +{ + if (luaL_checkudata(L, i, LUACRYPTO_HMACNAME) == NULL) + luaL_typerror(L, i, LUACRYPTO_HMACNAME); + return lua_touserdata(L, i); +} + +static HANDLER_HMAC *hmac_pnew(lua_State *L) +{ + HANDLER_HMAC *c = lua_newuserdata(L, sizeof(HANDLER_HMAC)); + luaL_getmetatable(L, LUACRYPTO_HMACNAME); + lua_setmetatable(L, -2); + return c; +} + +static int hmac_fnew(lua_State *L) +{ + HANDLER_HMAC *c = hmac_pnew(L); + const char *s = luaL_checkstring(L, 1); + size_t k_len; + const char *k = luaL_checklstring(L, 2, &k_len); + DIGEST_TYPE type = DIGEST_BY_NAME(s); + + if (IS_DIGEST_INVALID(type)) { + luaL_argerror(L, 1, "invalid digest type"); + return 0; + } + +#if CRYPTO_OPENSSL + HMAC_CTX_init(c); + HMAC_Init_ex(c, k, k_len, type, NULL); +#elif CRYPTO_GCRYPT + gcry_md_open(c, type, GCRY_MD_FLAG_HMAC); + gcry_md_setkey(*c, k, k_len); +#endif + + return 1; +} + +static int hmac_clone(lua_State *L) +{ + HANDLER_HMAC *c = hmac_pget(L, 1); + HANDLER_HMAC *d = hmac_pnew(L); + +#if CRYPTO_OPENSSL + *d = *c; +#elif CRYPTO_GCRYPT + gcry_md_copy(d, *c); +#endif + + return 1; +} + +static int hmac_reset(lua_State *L) +{ + HANDLER_HMAC *c = hmac_pget(L, 1); + +#if CRYPTO_OPENSSL + HMAC_Init_ex(c, NULL, 0, NULL, NULL); +#elif CRYPTO_GCRYPT + gcry_md_reset(*c); +#endif + + return 0; +} + +static int hmac_update(lua_State *L) +{ + HANDLER_HMAC *c = hmac_pget(L, 1); + size_t s_len; + const char *s = luaL_checklstring(L, 2, &s_len); + + HMAC_UPDATE(c, s, s_len); + + lua_settop(L, 1); + return 1; +} + +static int hmac_digest(lua_State *L) +{ + HANDLER_HMAC *c = hmac_pget(L, 1); + size_t written = 0; +#if CRYPTO_OPENSSL + unsigned char digest[EVP_MAX_MD_SIZE]; +#elif CRYPTO_GCRYPT + HANDLER_HMAC d; + unsigned char *digest; + int algo; +#endif + + if (lua_isstring(L, 2)) + { + size_t s_len; + const char *s = luaL_checklstring(L, 2, &s_len); + HMAC_UPDATE(c, s, s_len); + } + +#if CRYPTO_OPENSSL + HMAC_Final(c, digest, &written); +#elif CRYPTO_GCRYPT + algo = gcry_md_get_algo(*c); + gcry_md_copy(&d, *c); + gcry_md_final(d); + digest = gcry_md_read(d, algo); + written = gcry_md_get_algo_dlen(algo); +#endif + + if (lua_toboolean(L, 3)) + lua_pushlstring(L, (char *)digest, written); + else + { + char *hex = bin2hex(digest, written); + lua_pushlstring(L, hex, written*2); + free(hex); + } + +#if CRYPTO_GCRYPT + gcry_md_close(d); +#endif + + return 1; +} + +static int hmac_tostring(lua_State *L) +{ + HANDLER_HMAC *c = hmac_pget(L, 1); + char s[64]; + sprintf(s, "%s %p", LUACRYPTO_HMACNAME, (void *)c); + lua_pushstring(L, s); + return 1; +} + +static int hmac_gc(lua_State *L) +{ + HANDLER_HMAC *c = hmac_pget(L, 1); + HMAC_CLEANUP(c); + return 1; +} + +static int hmac_fdigest(lua_State *L) +{ + HANDLER_HMAC c; + size_t written = 0; + const char *t = luaL_checkstring(L, 1); + size_t s_len; + const char *s = luaL_checklstring(L, 2, &s_len); + size_t k_len; + const char *k = luaL_checklstring(L, 3, &k_len); + DIGEST_TYPE type = DIGEST_BY_NAME(t); +#if CRYPTO_OPENSSL + unsigned char digest[EVP_MAX_MD_SIZE]; +#elif CRYPTO_GCRYPT + unsigned char *digest; +#endif + + if (IS_DIGEST_INVALID(type)) { + luaL_argerror(L, 1, "invalid digest type"); + return 0; + } + +#if CRYPTO_OPENSSL + HMAC_CTX_init(&c); + HMAC_Init_ex(&c, k, k_len, type, NULL); + HMAC_Update(&c, (unsigned char *)s, s_len); + HMAC_Final(&c, digest, &written); +#elif CRYPTO_GCRYPT + gcry_md_open(&c, type, GCRY_MD_FLAG_HMAC); + gcry_md_setkey(c, k, k_len); + gcry_md_write(c, s, s_len); + gcry_md_final(c); + digest = gcry_md_read(c,type); + written = gcry_md_get_algo_dlen(type); +#endif + + if (lua_toboolean(L, 4)) + lua_pushlstring(L, (char *)digest, written); + else + { + char *hex = bin2hex(digest,written); + lua_pushlstring(L, hex, written*2); + free(hex); + } + +#if CRYPTO_GCRYPT + gcry_md_close(c); +#endif + + return 1; +} + +#if CRYPTO_OPENSSL +static int rand_do_bytes(lua_State *L, int (*bytes)(unsigned char *, int)) +{ + size_t count = luaL_checkint(L, 1); + unsigned char tmp[256], *buf = tmp; + if (count > sizeof tmp) + buf = malloc(count); + if (!buf) + return luaL_error(L, "out of memory"); + else if (!bytes(buf, count)) + return crypto_error(L); + lua_pushlstring(L, (char *)buf, count); + if (buf != tmp) + free(buf); + return 1; +} + +static int rand_bytes(lua_State *L) +{ + return rand_do_bytes(L, RAND_bytes); +} + +static int rand_pseudo_bytes(lua_State *L) +{ + return rand_do_bytes(L, RAND_pseudo_bytes); +} +#elif CRYPTO_GCRYPT +static int rand_do_bytes(lua_State *L, enum gcry_random_level level) +{ + size_t count = luaL_checkint(L, 1); + void* buf = gcry_random_bytes/*_secure*/(count, level); + + gcry_fast_random_poll(); + + lua_pushlstring(L, (char *)buf, count); + + return 1; +} + +static int rand_bytes(lua_State *L) +{ + return rand_do_bytes(L, GCRY_VERY_STRONG_RANDOM); +} + +static int rand_pseudo_bytes(lua_State *L) +{ + return rand_do_bytes(L, GCRY_STRONG_RANDOM); +} +#endif + +static int rand_add(lua_State *L) +{ + size_t num; + const void *buf = luaL_checklstring(L, 1, &num); +#if CRYPTO_OPENSSL + double entropy = (double)luaL_optnumber(L, 2, num); + RAND_add(buf, num, entropy); +#elif CRYPTO_GCRYPT + gcry_random_add_bytes(buf, num, -1); // unknown quality +#endif + return 0; +} + +static int rand_status(lua_State *L) +{ +#if CRYPTO_OPENSSL + lua_pushboolean(L, RAND_status()); +#elif CRYPTO_GCRYPT + lua_pushboolean(L, 1); //feature not available AFAIK +#endif + return 1; +} + +enum { WRITE_FILE_COUNT = 1024 }; +static int rand_load(lua_State *L) +{ + const char *name = luaL_optstring(L, 1, NULL); +#if CRYPTO_OPENSSL + char tmp[256]; + int n; + if (!name && !(name = RAND_file_name(tmp, sizeof tmp))) + return crypto_error(L); + n = RAND_load_file(name, WRITE_FILE_COUNT); + if (n == 0) + return crypto_error(L); + lua_pushnumber(L, n); +#elif CRYPTO_GCRYPT + if (name != NULL) + gcry_control(GCRYCTL_SET_RANDOM_SEED_FILE, name); + lua_pushnumber(L, 0.0); +#endif + return 1; +} + +static int rand_write(lua_State *L) +{ + const char *name = luaL_optstring(L, 1, NULL); +#if CRYPTO_OPENSSL + char tmp[256]; + int n; + if (!name && !(name = RAND_file_name(tmp, sizeof tmp))) + return crypto_error(L); + n = RAND_write_file(name); + if (n == 0) + return crypto_error(L); + lua_pushnumber(L, n); +#elif CRYPTO_GCRYPT + /* this is a BUG() in gcrypt. not sure if it refers to the lib or to + the caller, but it does not work (to set twice this file) */ + /* + if (name != NULL) + gcry_control(GCRYCTL_SET_RANDOM_SEED_FILE,name); + */ + gcry_control(GCRYCTL_UPDATE_RANDOM_SEED_FILE); + lua_pushnumber(L, 0.0); +#endif + return 1; +} + +static int rand_cleanup(lua_State *L) +{ +#if CRYPTO_OPENSSL + RAND_cleanup(); +#elif CRYPTO_GCRYPT + /* not completely sure there is nothing to do here... */ +#endif + return 0; +} + +/* +** Create a metatable and leave it on top of the stack. +*/ +LUACRYPTO_API int luacrypto_createmeta (lua_State *L, const char *name, const luaL_reg *methods) { + if (!luaL_newmetatable (L, name)) + return 0; + + /* define methods */ + luaL_openlib (L, NULL, methods, 0); + + /* define metamethods */ + lua_pushliteral (L, "__index"); + lua_pushvalue (L, -2); + lua_settable (L, -3); + + lua_pushliteral (L, "__metatable"); + lua_pushliteral (L, LUACRYPTO_PREFIX"you're not allowed to get this metatable"); + lua_settable (L, -3); + + return 1; +} + +/* +** Create metatables for each class of object. +*/ +static void create_metatables (lua_State *L) +{ + struct luaL_reg evp_functions[] = { + { "digest", evp_fdigest }, + { "new", evp_fnew }, + {NULL, NULL}, + }; + struct luaL_reg evp_methods[] = { + { "__tostring", evp_tostring }, + { "__gc", evp_gc }, + { "clone", evp_clone }, + { "digest", evp_digest }, + { "reset", evp_reset }, + { "tostring", evp_tostring }, + { "update", evp_update }, + {NULL, NULL}, + }; + struct luaL_reg hmac_functions[] = { + { "digest", hmac_fdigest }, + { "new", hmac_fnew }, + { NULL, NULL } + }; + struct luaL_reg hmac_methods[] = { + { "__tostring", hmac_tostring }, + { "__gc", hmac_gc }, + { "clone", hmac_clone }, + { "digest", hmac_digest }, + { "reset", hmac_reset }, + { "tostring", hmac_tostring }, + { "update", hmac_update }, + { NULL, NULL } + }; + struct luaL_reg rand_functions[] = { + { "bytes", rand_bytes }, + { "pseudo_bytes", rand_pseudo_bytes }, + { "add", rand_add }, + { "seed", rand_add }, + { "load", rand_load }, + { "write", rand_write }, + { "status", rand_status }, + { "cleanup", rand_cleanup }, + { NULL, NULL } + }; + + luaL_openlib (L, LUACRYPTO_EVPNAME, evp_functions, 0); + luacrypto_createmeta(L, LUACRYPTO_EVPNAME, evp_methods); + luaL_openlib (L, LUACRYPTO_HMACNAME, hmac_functions, 0); + luacrypto_createmeta(L, LUACRYPTO_HMACNAME, hmac_methods); + luaL_openlib (L, LUACRYPTO_RANDNAME, rand_functions, 0); + lua_pop (L, 3); +} + +/* +** Define the metatable for the object on top of the stack +*/ +LUACRYPTO_API void luacrypto_setmeta (lua_State *L, const char *name) { + luaL_getmetatable (L, name); + lua_setmetatable (L, -2); +} + +/* +** Assumes the table is on top of the stack. +*/ +LUACRYPTO_API void luacrypto_set_info (lua_State *L) { + lua_pushliteral (L, "_COPYRIGHT"); + lua_pushliteral (L, "Copyright (C) 2005-2006 Keith Howe"); + lua_settable (L, -3); + lua_pushliteral (L, "_DESCRIPTION"); + lua_pushliteral (L, "LuaCrypto is a Lua wrapper for OpenSSL/gcrypt"); + lua_settable (L, -3); + lua_pushliteral (L, "_VERSION"); + lua_pushliteral (L, "LuaCrypto 0.3.0"); + lua_settable (L, -3); + lua_pushliteral (L, "_ENGINE"); + lua_pushliteral (L, LUACRYPTO_ENGINE); + lua_settable (L, -3); +} + +/* +** Creates the metatables for the objects and registers the +** driver open method. +*/ +LUACRYPTO_API int luaopen_crypto(lua_State *L) +{ +#if CRYPTO_OPENSSL + if (OPENSSL_VERSION_NUMBER < 0x000907000L) + return luaL_error(L, "OpenSSL version is too old; requires 0.9.7 or higher"); + OpenSSL_add_all_digests(); +#elif CRYPTO_GCRYPT + gcry_check_version("1.2.2"); + gcry_control (GCRYCTL_DISABLE_SECMEM, 0); + gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); +#endif + + struct luaL_reg core[] = { + {NULL, NULL}, + }; + create_metatables (L); + luaL_openlib (L, LUACRYPTO_CORENAME, core, 0); + luacrypto_set_info (L); + return 1; +} diff --git a/rpm-5.4.9/lua/local/lcrypto.h b/rpm-5.4.9/lua/local/lcrypto.h new file mode 100644 index 0000000..afed25e --- /dev/null +++ b/rpm-5.4.9/lua/local/lcrypto.h @@ -0,0 +1,51 @@ +/* + * cal/lcrypto.h \ + * + * $Id: lcrypto.h,v 1.3 2008/10/27 03:01:38 jbj Exp $ + * + * Copyright © 2006 Keith Howe. + * + * 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef _LUACRYPTO_ +#define _LUACRYPTO_ + +#ifndef LUACRYPTO_API +#define LUACRYPTO_API LUA_API +#endif + +#define LUACRYPTO_PREFIX "LuaCrypto: " +#define LUACRYPTO_CORENAME "crypto" +#define LUACRYPTO_EVPNAME "crypto.evp" +#define LUACRYPTO_HMACNAME "crypto.hmac" +#define LUACRYPTO_RANDNAME "crypto.rand" + +LUACRYPTO_API int luacrypto_createmeta (lua_State *L, const char *name, const luaL_reg *methods); +LUACRYPTO_API void luacrypto_setmeta (lua_State *L, const char *name); +LUACRYPTO_API void luacrypto_set_info (lua_State *L); + + +int luaopen_crypto(lua_State * L) + /*@modifies L @*/; + +#define CRYPTO_OPENSSL 1 + +#endif diff --git a/rpm-5.4.9/lua/local/llocal.c b/rpm-5.4.9/lua/local/llocal.c new file mode 100644 index 0000000..821b8df --- /dev/null +++ b/rpm-5.4.9/lua/local/llocal.c @@ -0,0 +1,10 @@ +#include "lua.h" +#include "lauxlib.h" +#include "llocal.h" + +LUA_API int luaopen_local(lua_State *L) +{ +#include "llocal_lua.c" + return 0; +} + diff --git a/rpm-5.4.9/lua/local/llocal.h b/rpm-5.4.9/lua/local/llocal.h new file mode 100644 index 0000000..8458b76 --- /dev/null +++ b/rpm-5.4.9/lua/local/llocal.h @@ -0,0 +1,7 @@ +#ifndef LLUA_H +#define LLUA_H + +int luaopen_local (lua_State *L) + /*@modifies L @*/; + +#endif diff --git a/rpm-5.4.9/lua/local/llocal.lua b/rpm-5.4.9/lua/local/llocal.lua new file mode 100644 index 0000000..d9c375f --- /dev/null +++ b/rpm-5.4.9/lua/local/llocal.lua @@ -0,0 +1,331 @@ + +-- ----------------------------------------------------------------------- -- +-- GLOBAL HACKS +-- ----------------------------------------------------------------------- -- + +-- provide a generic regular expression constructor +-- based on the most powerful regular expression engine +rex = rex_posix +if rex_pcre ~= nil then + rex = rex_pcre +end + +-- provide additional "util" namespace +util = {} + +-- ----------------------------------------------------------------------- -- +-- UNIX grep(1) EMULATIONS +-- ----------------------------------------------------------------------- -- + +-- "global regular expression print" on file content +function util.grep(expr, filename) + if not posix.stat(filename, "mode") then + return nil + end + local lines = {} + local pat = rex.new(expr) + local pos = 1 + for line in io.lines(filename) do + if pat:tfind(line) then + table.insert(lines, pos, line) + end + pos = pos + 1 + end + if table.getn(lines) == 0 then + return nil + end + return lines +end + +-- iterator version +function util.igrep(expr, filename) + return ipairs(rex.grep(expr, filename)) +end + +-- boolean version +function util.bgrep(expr, filename) + if not posix.stat(filename, "mode") then + return nil + end + local pat = rex.new(expr) + for line in io.lines(filename) do + if pat:tfind(line) then + return true + end + end + return false +end + +-- ----------------------------------------------------------------------- -- +-- REGULAR EXPRESSION MATCHING/SUBSTITUTION +-- ----------------------------------------------------------------------- -- + +-- regular expression based string matching +function util.rmatch(str, regex, i, cf) + return rex.new(regex, cf):tfind(str, i) +end + +-- regular expression based string substitution +function util.rsubst(str, regex, subst, n, cf) + return rex.gsub(str, regex, subst, n, cf) +end + +-- regular expression based string splitting +function util.rsplit(str, regex, n, cf) + local result = {} + if str ~= "" then + for section, _ in rex.split(str, regex, cf) do + if n ~= nil then + if n <= 0 then + break + end + n = n - 1 + end + table.insert(result, section) + end + end + return result +end + +-- ----------------------------------------------------------------------- -- +-- RECURSIVE DATA DUMPING +-- ----------------------------------------------------------------------- -- + +-- WORK HORSE: +-- dump a single object recursively into a string +function util.dump_object(obj, compact) + local dump = "" + if type(obj) == "nil" then + dump = "nil" + elseif type(obj) == "number" then + dump = string.format("%d", obj) + elseif type(obj) == "string" then + local str = obj + str = string.gsub(str, "\\\\", "\\\\") + str = string.gsub(str, "\"", "\\\"") + str = string.gsub(str, "\r", "\\r") + str = string.gsub(str, "\n", "\\n") + str = string.gsub(str, ".", + function(c) + local n = string.byte(c) + if n < 32 or n >= 127 then + c = string.format("\\%03d", n) + end + return c + end + ) + dump = "\"" .. str .. "\"" + elseif type(obj) == "boolean" then + if obj then + dump = "true" + else + dump = "false" + end + elseif type(obj) == "table" then + local space = " " + if compact ~= nil and compact == true then + space = "" + end + dump = "{" + local first = true + for k, v in pairs(obj) do + if not first then + dump = dump .. "," + end + if string.match(k, "^[a-zA-Z_][a-zA-Z0-9_]*$") == nil then + k = "[" .. util.dump_object(k, true) .. "]" + end + dump = dump .. space .. k .. space .. "=" .. space + dump = dump .. util.dump_object(v, compact) + first = false + end + dump = dump .. space .. "}" + elseif type(obj) == "function" then + dump = "" + elseif type(obj) == "thread" then + dump = "" + elseif type(obj) == "userdata" then + dump = "" + end + return dump +end + +-- CONVENIENCE FRONTEND: +-- dump one or more objects recursively, one per line +function util.dump(obj1, ...) + local dump = util.dump_object(obj1) .. "\n" + for _, obj in ipairs(arg) do + dump = dump .. util.dump_object(obj) .. "\n" + end + return dump +end + +-- CONVENIENCE FRONTEND: +-- dump one or more objects recursively, one per line, to stderr +function util.dump_stderr(obj1, ...) + io.stderr:write(util.dump(obj1, unpack(arg))) +end + +-- ----------------------------------------------------------------------- -- +-- TEXT FORMATTING +-- ----------------------------------------------------------------------- -- + +function util.textwrap(prefix, text, col_min, col_max) + if col_min == nil then col_min = 78 end + if col_max == nil then col_max = col_min end + text = text .. " " + text = util.rsubst(text, "(?s)\\r?\\n[ \\t]*", " ") + text = util.rsubst(text, + "(?s)(" .. + ".{" .. col_min .. "," .. col_max .. "}?([ \\t])" .. + "|" .. + ".{" .. col_max .. "}" .. + ")", + function (s, ws) + if ws then + return s .. "\n" + else + return s .. "-\n" + end + end + ) + text = util.rsubst(text, "(?s)([ \\t]*)$", "") + text = util.rsubst(text, "(?s)([^\\n])$", "%1\n") + text = util.rsubst(text, "(?m)^", prefix) + return text +end + +-- ----------------------------------------------------------------------- -- +-- I/O UTILITIES +-- ----------------------------------------------------------------------- -- + +-- slurp in all data of a file +function util.slurp(filename) + local data = nil + if filename ~= nil then + local fp, error = io.open(filename, "r") + if fp ~= nil then + data = fp:read("*all") + io.close(fp) + end + end + return data +end + +-- ----------------------------------------------------------------------- -- +-- INTEGRITY PROCESSOR GLUE CODE +-- ----------------------------------------------------------------------- -- + +-- provide additional "integrity" namespace +integrity = {} + +-- extract plaintext from a PGP clearsigned text +function integrity.plaintext(text) + local s, _, m = util.rmatch( + text, + "(?s)" .. + "^\\s*" .. + "-----BEGIN PGP SIGNED MESSAGE-----" .. + ".*?" .. + "\\r?\\n" .. + "\\r?\\n" .. + "(.+?\\r?\\n)" .. + "-----BEGIN PGP SIGNATURE-----" .. + "\\r?\\n" .. + ".*" .. + "$" + ) + if s == nil then + return nil + else + local plaintext = m[1] + plaintext = util.rsubst(plaintext, "(?m)^- ", "") + return plaintext + end +end + +-- integrity processor +function integrity.processor(progname, progmode, spec_fn, spec_cfg, proc_fn, proc_lua, proc_minver) + -- optionally read integrity configuration specification + if spec_cfg == nil then + local fp, error = io.open(spec_fn, "r") + if fp == nil then + return "ERROR: unable to read Integrity Configuration Specification file: " .. error + end + spec_cfg = fp:read("*all") + io.close(fp) + end + + -- optionally read integrity validation processor + if proc_lua == nil then + local fp, error = io.open(proc_fn, "r") + if fp == nil then + return "ERROR: unable to read Integrity Validation Processor file: " .. error + end + proc_lua = fp:read("*all") + io.close(fp) + end + + -- extract plaintext from "clearsigned" integrity configuration specification + spec_cfg = integrity.plaintext(spec_cfg) + if spec_cfg == nil then + return "ERROR: failed to extract Integrity Configuration Specification plaintext from clearsigned text" + end + + -- extract plaintext from "clearsigned" integrity validation processor + proc_lua = integrity.plaintext(proc_lua) + if proc_lua == nil then + return "ERROR: failed to extract Integrity Validation Processor plaintext from clearsigned text" + end + + -- parse integrity configuration specification + local cfg = {} + util.rsubst(spec_cfg, + "(?s)" .. + "([A-Za-z0-9][A-Za-z0-9-]*):[ \\t]*" .. + "([^\\r\\n]*" .. + "(?:\\r?\\n(?:[ \\t]*|[ \\t]+[^\\r\\n]+))*" .. + ")\\r?\\n", + function (key, value) + value = util.rsubst(value, "(?s)^\\s*(.*?)\\s*$", "%1") + cfg[key] = value + end + ) + + -- create validation context object + local ctx = {} + ctx.rpm = {} + ctx.rpm.name = progname; + ctx.rpm.mode = progmode; + + -- load integrity validation processor + integrity.version = nil + integrity.validate = nil + local f, e = loadstring(proc_lua) + if f == nil then + return "ERROR: failed to load Integrity Validation Processor (syntax problem):\n" .. + "rpm: Lua: " .. e + end + f(); + if type(integrity.validate) ~= "function" then + return "ERROR: failed to load Integrity Validation Processor (semantic problem)" + end + + -- ensure that integrity validation processor is at least of the minimum required version + if type(integrity.version) ~= "string" then + return "ERROR: invalid Integrity Validation Processor version (syntax problem)" + end + if rpm.vercmp(integrity.version, proc_minver) < 0 then + return "ERROR: too old Integrity Validation Processor version (semantic problem)" + end + + -- call integrity validation processor + local result = integrity.validate(ctx, cfg) + + -- return validation result + if type(result) ~= "string" then + result = "ERROR: invalid result from Integrity Validation Processor" + end + return result +end + diff --git a/rpm-5.4.9/lua/local/lom.lua b/rpm-5.4.9/lua/local/lom.lua new file mode 100644 index 0000000..a60e439 --- /dev/null +++ b/rpm-5.4.9/lua/local/lom.lua @@ -0,0 +1,80 @@ +-- +-- Copyright © 2003-2007 The Kepler Project. +-- +-- 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +-- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +-- DEALINGS IN THE SOFTWARE. +-- +-- $Id: lom.lua,v 1.1 2008/10/24 22:25:45 jbj Exp $ + +require "lxp" + +local tinsert, tremove, getn = table.insert, table.remove, table.getn +local assert, type, print = assert, type, print +local lxp = lxp + +module ("lxp.lom") + +local function starttag (p, tag, attr) + local stack = p:getcallbacks().stack + local newelement = {tag = tag, attr = attr} + tinsert(stack, newelement) +end + +local function endtag (p, tag) + local stack = p:getcallbacks().stack + local element = tremove(stack) + assert(element.tag == tag) + local level = getn(stack) + tinsert(stack[level], element) +end + +local function text (p, txt) + local stack = p:getcallbacks().stack + local element = stack[getn(stack)] + local n = getn(element) + if type(element[n]) == "string" then + element[n] = element[n] .. txt + else + tinsert(element, txt) + end +end + +function parse (o) + local c = { StartElement = starttag, + EndElement = endtag, + CharacterData = text, + _nonstrict = true, + stack = {{}} + } + local p = lxp.new(c) + local status, err + if type(o) == "string" then + status, err = p:parse(o) + if not status then return nil, err end + else + for l in o do + status, err = p:parse(l) + if not status then return nil, err end + end + end + status, err = p:parse() + if not status then return nil, err end + p:close() + return c.stack[1][1] +end + diff --git a/rpm-5.4.9/lua/local/lposix.c b/rpm-5.4.9/lua/local/lposix.c new file mode 100644 index 0000000..0bd626f --- /dev/null +++ b/rpm-5.4.9/lua/local/lposix.c @@ -0,0 +1,1264 @@ +/* +* lposix.c +* POSIX library for Lua 5.0. Based on original by Claudio Terra for Lua 3.x. +* Luiz Henrique de Figueiredo +* 05 Nov 2003 22:09:10 +*/ + +#include "system.h" /* setenv/unsetenv/glob/etc */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MYNAME "posix" +#define MYVERSION MYNAME " library for " LUA_VERSION " / Nov 2003" + +#include "lua.h" +#include "lauxlib.h" +#include "lposix.h" + +/*@access DIR @*/ + +#ifndef MYBUFSIZ +#define MYBUFSIZ 512 +#endif + +/* BEGIN modemuncher */ + +/* + Mode Muncher -- modemuncher.c + 961110 Claudio Terra + + munch vb + [ME monchen, perh. influenced by MF mangier to eat --more at MANGER] + :to chew with a crunching sound: eat with relish + :to chew food with a crunching sound: eat food with relish + --munch-er n + + The NeXT Digital Edition of Webster's Ninth New Collegiate Dictionary + and Webster's Collegiate Thesaurus +*/ + +/* struct for rwx <-> POSIX constant lookup tables */ +struct modeLookup +{ + char rwx; + mode_t bits; +}; + +typedef struct modeLookup modeLookup; + +/*@observer@*/ /*@unchecked@*/ +static modeLookup modesel[] = +{ + /* RWX char Posix Constant */ + {'r', S_IRUSR}, + {'w', S_IWUSR}, + {'x', S_IXUSR}, + + {'r', S_IRGRP}, + {'w', S_IWGRP}, + {'x', S_IXGRP}, + + {'r', S_IROTH}, + {'w', S_IWOTH}, + {'x', S_IXOTH}, + {'\0', (mode_t)-1} /* do not delete this line */ +}; + +static int rwxrwxrwx(mode_t *mode, const char *p) + /*@modifies *mode @*/ +{ + int count; + mode_t tmp_mode = *mode; + + tmp_mode &= ~(S_ISUID | S_ISGID); /* turn off suid and sgid flags */ + for (count=0; count<9; count ++) + { + if (*p == modesel[count].rwx) tmp_mode |= modesel[count].bits; /* set a bit */ + else if (*p == '-') tmp_mode &= ~modesel[count].bits; /* clear a bit */ + else if (*p=='s') switch(count) + { + case 2: /* turn on suid flag */ + tmp_mode |= S_ISUID | S_IXUSR; + break; + + case 5: /* turn on sgid flag */ + tmp_mode |= S_ISGID | S_IXGRP; + break; + + default: + return -4; /* failed! -- bad rwxrwxrwx mode change */ + /*@notreached@*/ + break; + } + p++; + } + *mode = tmp_mode; + return 0; +} + +static void modechopper(mode_t mode, char *p) + /*@modifies *p @*/ +{ + /* requires char p[10] */ + int count; + char *pp; + + pp=p; + + for (count=0; count<9; count ++) + { + if (mode & modesel[count].bits) *p = modesel[count].rwx; + else *p='-'; + + p++; + } + *p=0; /* to finish the string */ + + /* dealing with suid and sgid flags */ + if (mode & S_ISUID) pp[2] = (mode & S_IXUSR) ? 's' : 'S'; + if (mode & S_ISGID) pp[5] = (mode & S_IXGRP) ? 's' : 'S'; + +} + +static int mode_munch(mode_t *mode, const char* p) + /*@modifies *mode @*/ +{ + + char op=0; + mode_t affected_bits, ch_mode; + int doneFlag = 0; +#ifdef DEBUG +char tmp[10]; +#endif + +#ifdef DEBUG +modechopper(*mode, tmp); +printf("modemuncher: got base mode = %s\n", tmp); +#endif + + while (!doneFlag) + { + /* step 0 -- clear temporary variables */ + affected_bits=0; + ch_mode=0; + + /* step 1 -- who's affected? */ + +#ifdef DEBUG +printf("modemuncher step 1\n"); +#endif + + /* mode string given in rwxrwxrwx format */ + if (*p== 'r' || *p == '-') return rwxrwxrwx(mode, p); + + /* mode string given in 0644 format */ + if (*p >= '0' && *p <= '7') { + char *e; + mode_t tmp_mode = strtol(p, &e, 8); + if (*p == 0 || *e != 0) + return -5; + *mode = tmp_mode; + return 0; + } + + /* mode string given in ugoa+-=rwx format */ + for ( ; ; p++) + switch (*p) + { + case 'u': + affected_bits |= 04700; + break; + + case 'g': + affected_bits |= 02070; + break; + + case 'o': + affected_bits |= 01007; + break; + + case 'a': + affected_bits |= 07777; + break; + + /* ignore spaces */ + case ' ': + break; + + + default: + goto no_more_affected; + } + + no_more_affected: + /* If none specified, affect all bits. */ + if (affected_bits == 0) affected_bits = 07777; + + /* step 2 -- how is it changed? */ + +#ifdef DEBUG +printf("modemuncher step 2 (*p='%c')\n", *p); +#endif + + switch (*p) + { + case '+': + case '-': + case '=': + op = *p; + break; + + /* ignore spaces */ + case ' ': + break; + + default: + return -1; /* failed! -- bad operator */ + } + + + /* step 3 -- what are the changes? */ + +#ifdef DEBUG +printf("modemuncher step 3\n"); +#endif + + for (p++ ; *p!=0 ; p++) + switch (*p) + { + case 'r': + ch_mode |= 00444; + break; + + case 'w': + ch_mode |= 00222; + break; + + case 'x': + ch_mode |= 00111; + break; + + case 's': + /* Set the setuid/gid bits if `u' or `g' is selected. */ + ch_mode |= 06000; + break; + + /* ignore spaces */ + case ' ': + break; + + default: + goto specs_done; + } + + specs_done: + /* step 4 -- apply the changes */ + +#ifdef DEBUG + printf("modemuncher step 4\n"); +#endif + if (*p != ',') doneFlag = 1; + if (*p != 0 && *p != ' ' && *p != ',') + { + +#ifdef DEBUG +printf("modemuncher: comma error!\n"); +printf("modemuncher: doneflag = %u\n", doneFlag); +#endif + return -2; /* failed! -- bad mode change */ + + } + p++; + /*if (!ch_mode) return -2;*/ /* failed! -- bad mode change */ + if (ch_mode) switch (op) + { + case '+': + *mode = *mode |= ch_mode & affected_bits; + break; + + case '-': + *mode = *mode &= ~(ch_mode & affected_bits); + break; + + case '=': + *mode = ch_mode & affected_bits; + break; + + default: + return -3; /* failed! -- unknown error */ + } + } +#ifdef DEBUG +modechopper(*mode, tmp); +printf("modemuncher: returning mode = %s\n", tmp); +#endif + + return 0; /* successful call */ +} + +/* END modemuncher */ + +/*@observer@*/ +static const char *filetype(mode_t m) + /*@*/ +{ + if (S_ISREG(m)) return "regular"; + else if (S_ISLNK(m)) return "link"; + else if (S_ISDIR(m)) return "directory"; + else if (S_ISCHR(m)) return "character device"; + else if (S_ISBLK(m)) return "block device"; + else if (S_ISFIFO(m)) return "fifo"; + else if (S_ISSOCK(m)) return "socket"; + else return "?"; +} + +typedef int (*Selector)(lua_State *L, int i, const void *data); + +static int doselection(lua_State *L, int i, const char *const S[], Selector F, const void *data) + /*@modifies L @*/ +{ + if (lua_isnone(L, i)) + { + lua_newtable(L); + for (i=0; S[i]!=NULL; i++) + { + lua_pushstring(L, S[i]); + F(L, i, data); + lua_settable(L, -3); + } + return 1; + } + else + { + int j=luaL_checkoption(L, i, NULL, S); + if (j==-1) luaL_argerror(L, i, "unknown selector"); + return F(L, j, data); + } +} + +static void storeindex(lua_State *L, int i, const char *value) + /*@modifies L @*/ +{ + lua_pushstring(L, value); + lua_rawseti(L, -2, i); +} + +static void storestring(lua_State *L, const char *name, const char *value) + /*@modifies L @*/ +{ + lua_pushstring(L, name); + lua_pushstring(L, value); + lua_settable(L, -3); +} + +static void storenumber(lua_State *L, const char *name, lua_Number value) + /*@modifies L @*/ +{ + lua_pushstring(L, name); + lua_pushnumber(L, value); + lua_settable(L, -3); +} + +static int pusherror(lua_State *L, const char *info) + /*@modifies L @*/ +{ + lua_pushnil(L); + if (info==NULL) + lua_pushstring(L, strerror(errno)); + else + lua_pushfstring(L, "%s: %s", info, strerror(errno)); + lua_pushnumber(L, errno); + return 3; +} + +static int pushresult(lua_State *L, int i, const char *info) + /*@modifies L @*/ +{ + if (i != -1) + { + lua_pushnumber(L, i); + return 1; + } + else + return pusherror(L, info); +} + +static void badoption(lua_State *L, /*@unused@*/ int i, const char *what, int option) + /*@modifies L @*/ +{ + i = i; /* XXX keep gcc happy. */ + luaL_argerror(L, 2, + lua_pushfstring(L, "unknown %s option `%c'", what, option)); +} + +static uid_t mygetuid(lua_State *L, int i) + /*@modifies L @*/ +{ + if (lua_isnone(L, i)) + return -1; + else if (lua_isnumber(L, i)) + return (uid_t) lua_tonumber(L, i); + else if (lua_isstring(L, i)) + { + struct passwd *p=getpwnam(lua_tostring(L, i)); + return (p==NULL) ? (uid_t)-1 : p->pw_uid; + } + else + return luaL_typerror(L, i, "string or number"); +} + +static gid_t mygetgid(lua_State *L, int i) + /*@modifies L @*/ +{ + if (lua_isnone(L, i)) + return -1; + else if (lua_isnumber(L, i)) + return (gid_t) lua_tonumber(L, i); + else if (lua_isstring(L, i)) + { + struct group *g=getgrnam(lua_tostring(L, i)); + return (g==NULL) ? (gid_t)-1 : g->gr_gid; + } + else + return luaL_typerror(L, i, "string or number"); +} + + + +static int Perrno(lua_State *L) /** errno() */ + /*@modifies L @*/ +{ + lua_pushstring(L, strerror(errno)); + lua_pushnumber(L, errno); + return 2; +} + + +static int Pdir(lua_State *L) /** dir([path]) */ + /*@globals fileSystem @*/ + /*@modifies L, fileSystem @*/ +{ + const char *path = luaL_optstring(L, 1, "."); + DIR *d = opendir(path); + if (d == NULL) + return pusherror(L, path); + else + { + int i; + struct dirent *entry; + lua_newtable(L); + for (i=1; (entry = readdir(d)) != NULL; i++) + storeindex(L, i, entry->d_name); + closedir(d); + return 1; + } +} + + +static int aux_files(lua_State *L) + /*@modifies L @*/ +{ + DIR *d = (DIR *) lua_touserdata(L, lua_upvalueindex(1)); + struct dirent *entry; + if (d == NULL) luaL_error(L, "attempt to use closed dir"); + entry = readdir(d); + if (entry == NULL) + { + closedir(d); + lua_pushnil(L); + lua_replace(L, lua_upvalueindex(1)); + lua_pushnil(L); + } + else + { + lua_pushstring(L, entry->d_name); +#if 0 +#ifdef _DIRENT_HAVE_D_TYPE + lua_pushstring(L, filetype(DTTOIF(entry->d_type))); + return 2; +#endif +#endif + } + return 1; +} + +static int Pfiles(lua_State *L) /** files([path]) */ + /*@globals fileSystem @*/ + /*@modifies L, fileSystem @*/ +{ + const char *path = luaL_optstring(L, 1, "."); + DIR *d = opendir(path); + if (d == NULL) + return pusherror(L, path); + else + { + lua_pushlightuserdata(L, d); + lua_pushcclosure(L, aux_files, 1); + return 1; + } +} + + +static int Pgetcwd(lua_State *L) /** getcwd() */ + /*@modifies L @*/ +{ + char buf[MYBUFSIZ]; + if (getcwd(buf, sizeof(buf)) == NULL) + return pusherror(L, "."); + else + { + lua_pushstring(L, buf); + return 1; + } +} + + +static int Pmkdir(lua_State *L) /** mkdir(path) */ + /*@globals fileSystem @*/ + /*@modifies L, fileSystem @*/ +{ + const char *path = luaL_checkstring(L, 1); + return pushresult(L, mkdir(path, 0777), path); +} + +static int Pmkdtemp(lua_State *L) /** mkdtemp(template) */ + /*@globals fileSystem @*/ + /*@modifies L, fileSystem @*/ +{ + const char *_template = luaL_checkstring(L, 1); + const char *path; + char buf[MYBUFSIZ]; + (void) strncpy(buf, _template, sizeof(buf)); + buf[sizeof(buf)-1] = '\0'; + if ((path = mkdtemp(buf)) == NULL) + return pusherror(L, _template); + else + { + lua_pushstring(L, path); + return 1; + } +} + + +static int Pchdir(lua_State *L) /** chdir(path) */ + /*@globals internalState @*/ + /*@modifies L, internalState @*/ +{ + const char *path = luaL_checkstring(L, 1); + return pushresult(L, chdir(path), path); +} + + +static int Prmdir(lua_State *L) /** rmdir(path) */ + /*@globals fileSystem @*/ + /*@modifies L, fileSystem @*/ +{ + const char *path = luaL_checkstring(L, 1); + return pushresult(L, rmdir(path), path); +} + + +static int Punlink(lua_State *L) /** unlink(path) */ + /*@globals fileSystem @*/ + /*@modifies L, fileSystem @*/ +{ + const char *path = luaL_checkstring(L, 1); + return pushresult(L, unlink(path), path); +} + + +static int Plink(lua_State *L) /** link(oldpath,newpath) */ + /*@globals fileSystem @*/ + /*@modifies L, fileSystem @*/ +{ + const char *oldpath = luaL_checkstring(L, 1); + const char *newpath = luaL_checkstring(L, 2); + return pushresult(L, link(oldpath, newpath), NULL); +} + + +static int Psymlink(lua_State *L) /** symlink(oldpath,newpath) */ + /*@globals fileSystem @*/ + /*@modifies L, fileSystem @*/ +{ + const char *oldpath = luaL_checkstring(L, 1); + const char *newpath = luaL_checkstring(L, 2); + return pushresult(L, symlink(oldpath, newpath), NULL); +} + + +static int Preadlink(lua_State *L) /** readlink(path) */ + /*@globals fileSystem @*/ + /*@modifies L, fileSystem @*/ +{ + char buf[MYBUFSIZ]; + const char *path = luaL_checkstring(L, 1); + int n = readlink(path, buf, sizeof(buf)); + if (n==-1) return pusherror(L, path); + lua_pushlstring(L, buf, n); + return 1; +} + + +static int Paccess(lua_State *L) /** access(path,[mode]) */ + /*@modifies L @*/ +{ + int mode=F_OK; + const char *path=luaL_checkstring(L, 1); + const char *s; + for (s=luaL_optstring(L, 2, "f"); *s!=0 ; s++) + switch (*s) + { + case ' ': break; + case 'r': mode |= R_OK; break; + case 'w': mode |= W_OK; break; + case 'x': mode |= X_OK; break; + case 'f': mode |= F_OK; break; + default: badoption(L, 2, "mode", *s); break; + } + return pushresult(L, access(path, mode), path); +} + + +static int Pmkfifo(lua_State *L) /** mkfifo(path) */ + /*@globals fileSystem @*/ + /*@modifies L, fileSystem @*/ +{ + const char *path = luaL_checkstring(L, 1); + return pushresult(L, mkfifo(path, 0777), path); +} + + +static int Pexec(lua_State *L) /** exec(path,[args]) */ + /*@globals internalState @*/ + /*@modifies L, internalState @*/ +{ + const char *path = luaL_checkstring(L, 1); + int i,n=lua_gettop(L); + char **argv = (char **) malloc((n+1)*sizeof(char*)); + if (argv==NULL) luaL_error(L,"not enough memory"); + argv[0] = (char*)path; + for (i=1; i + #define environ (*_NSGetEnviron()) + #else + extern char **environ; + #endif /* __APPLE__ */ +/*@=nestedextern =shadow@*/ + char **e; + if (*environ==NULL) lua_pushnil(L); else lua_newtable(L); + for (e=environ; *e!=NULL; e++) + { + char *s=*e; + char *eq=strchr(s, '='); + if (eq==NULL) /* will this ever happen? */ + { + lua_pushstring(L,s); + lua_pushboolean(L,0); + } + else + { + lua_pushlstring(L,s,eq-s); + lua_pushstring(L,eq+1); + } + lua_settable(L,-3); + } + } + else + lua_pushstring(L, getenv(luaL_checkstring(L, 1))); + return 1; +} + + +static int Pumask(lua_State *L) /** umask([mode]) */ + /*@globals fileSystem @*/ + /*@modifies L, fileSystem @*/ +{ + char m[10]; + mode_t mode; + umask(mode=umask(0)); + mode=(~mode)&0777; + if (!lua_isnone(L, 1)) + { + if (mode_munch(&mode, luaL_checkstring(L, 1))) + { + lua_pushnil(L); + return 1; + } + mode&=0777; + umask(~mode); + } + modechopper(mode, m); + lua_pushstring(L, m); + return 1; +} + + +static int Pchmod(lua_State *L) /** chmod(path,mode) */ + /*@globals fileSystem @*/ + /*@modifies L, fileSystem @*/ +{ + mode_t mode; + struct stat s; + const char *path = luaL_checkstring(L, 1); + const char *modestr = luaL_checkstring(L, 2); + if (stat(path, &s)) return pusherror(L, path); + mode = s.st_mode; + if (mode_munch(&mode, modestr)) luaL_argerror(L, 2, "bad mode"); + return pushresult(L, chmod(path, mode), path); +} + + +static int Pchown(lua_State *L) /** chown(path,uid,gid) */ + /*@globals fileSystem, internalState @*/ + /*@modifies L, fileSystem, internalState @*/ +{ + const char *path = luaL_checkstring(L, 1); + uid_t uid = mygetuid(L, 2); + gid_t gid = mygetgid(L, 3); + return pushresult(L, chown(path, uid, gid), path); +} + + +static int Putime(lua_State *L) /** utime(path,[mtime,atime]) */ + /*@globals fileSystem @*/ + /*@modifies L, fileSystem @*/ +{ + struct utimbuf times; + time_t currtime = time(NULL); + const char *path = luaL_checkstring(L, 1); + times.modtime = luaL_optnumber(L, 2, currtime); + times.actime = luaL_optnumber(L, 3, currtime); + return pushresult(L, utime(path, ×), path); +} + + +static int FgetID(lua_State *L, int i, /*@unused@*/ const void *data) + /*@modifies L @*/ +{ + data = data; /* XXX keep gcc happy. */ + switch (i) + { + case 0: lua_pushnumber(L, getegid()); break; + case 1: lua_pushnumber(L, geteuid()); break; + case 2: lua_pushnumber(L, getgid()); break; + case 3: lua_pushnumber(L, getuid()); break; + case 4: lua_pushnumber(L, getpgrp()); break; + case 5: lua_pushnumber(L, getpid()); break; + case 6: lua_pushnumber(L, getppid()); break; + } + return 1; +} + +/*@observer@*/ /*@unchecked@*/ +static const char *const SgetID[] = +{ + "egid", "euid", "gid", "uid", "pgrp", "pid", "ppid", NULL +}; + +static int Pgetprocessid(lua_State *L) /** getprocessid([selector]) */ + /*@modifies L @*/ +{ + return doselection(L, 1, SgetID, FgetID, NULL); +} + +static int Pglob(lua_State *L) /** glob(pattern) */ +{ + const char *pattern; + glob_t g; + int i; + int rc; + + pattern = luaL_optstring(L, 1, "."); + rc = glob(pattern, 0, NULL, &g); + if (rc == 0) { + lua_newtable(L); + for (i = 1; i <= (int)g.gl_pathc; i++) + storeindex(L, i, g.gl_pathv[i - 1]); + globfree(&g); + return 1; + } + else if (rc == GLOB_NOMATCH) { + lua_newtable(L); + return 1; + } + else + return pusherror(L, pattern); +} + +static int Pttyname(lua_State *L) /** ttyname(fd) */ + /*@modifies L @*/ +{ + int fd=luaL_optint(L, 1, 0); + lua_pushstring(L, ttyname(fd)); + return 1; +} + +static int Pctermid(lua_State *L) /** ctermid() */ + /*@globals fileSystem @*/ + /*@modifies L, fileSystem @*/ +{ + char b[L_ctermid]; + lua_pushstring(L, ctermid(b)); + return 1; +} + + +static int Pgetlogin(lua_State *L) /** getlogin() */ + /*@modifies L @*/ +{ + lua_pushstring(L, getlogin()); + return 1; +} + + +static int Fgetpasswd(lua_State *L, int i, const void *data) + /*@modifies L @*/ +{ + const struct passwd *p = (const struct passwd *) data; + switch (i) + { + case 0: lua_pushstring(L, p->pw_name); break; + case 1: lua_pushnumber(L, p->pw_uid); break; + case 2: lua_pushnumber(L, p->pw_gid); break; + case 3: lua_pushstring(L, p->pw_dir); break; + case 4: lua_pushstring(L, p->pw_shell); break; +/* not strictly POSIX */ + case 5: lua_pushstring(L, p->pw_gecos); break; + case 6: lua_pushstring(L, p->pw_passwd); break; + } + return 1; +} + +/*@observer@*/ /*@unchecked@*/ +static const char *const Sgetpasswd[] = +{ + "name", "uid", "gid", "dir", "shell", "gecos", "passwd", NULL +}; + + +static int Pgetpasswd(lua_State *L) /** getpasswd(name or id) */ + /*@modifies L @*/ +{ + struct passwd *p=NULL; + if (lua_isnoneornil(L, 1)) + p = getpwuid(geteuid()); + else if (lua_isnumber(L, 1)) + p = getpwuid((uid_t)lua_tonumber(L, 1)); + else if (lua_isstring(L, 1)) + p = getpwnam(lua_tostring(L, 1)); + else + luaL_typerror(L, 1, "string or number"); + if (p==NULL) + lua_pushnil(L); + else + doselection(L, 2, Sgetpasswd, Fgetpasswd, p); + return 1; +} + + +static int Pgetgroup(lua_State *L) /** getgroup(name or id) */ + /*@modifies L @*/ +{ + struct group *g=NULL; + if (lua_isnumber(L, 1)) + g = getgrgid((gid_t)lua_tonumber(L, 1)); + else if (lua_isstring(L, 1)) + g = getgrnam(lua_tostring(L, 1)); + else + luaL_typerror(L, 1, "string or number"); + if (g==NULL) + lua_pushnil(L); + else + { + int i; + lua_newtable(L); + storestring(L, "name", g->gr_name); + storenumber(L, "gid", g->gr_gid); + for (i=0; g->gr_mem[i] != NULL; i++) + storeindex(L, i+1, g->gr_mem[i]); + } + return 1; +} + + +static int Psetuid(lua_State *L) /** setuid(name or id) */ + /*@globals fileSystem, internalState @*/ + /*@modifies L, fileSystem, internalState @*/ +{ + return pushresult(L, setuid(mygetuid(L, 1)), NULL); +} + + +static int Psetgid(lua_State *L) /** setgid(name or id) */ + /*@globals fileSystem @*/ + /*@modifies L, fileSystem @*/ +{ + return pushresult(L, setgid(mygetgid(L, 1)), NULL); +} + +struct mytimes +{ + struct tms t; + clock_t elapsed; +}; + +#define pushtime(L,x) lua_pushnumber(L,((lua_Number)x)/CLOCKS_PER_SEC) + +static int Ftimes(lua_State *L, int i, const void *data) + /*@modifies L @*/ +{ + const struct mytimes *t = (const struct mytimes *) data; + switch (i) + { + case 0: pushtime(L, t->t.tms_utime); break; + case 1: pushtime(L, t->t.tms_stime); break; + case 2: pushtime(L, t->t.tms_cutime); break; + case 3: pushtime(L, t->t.tms_cstime); break; + case 4: pushtime(L, t->elapsed); break; + } + return 1; +} + +/*@observer@*/ /*@unchecked@*/ +static const char *const Stimes[] = +{ + "utime", "stime", "cutime", "cstime", "elapsed", NULL +}; + +#define storetime(L,name,x) storenumber(L,name,(lua_Number)x/CLOCKS_PER_SEC) + +static int Ptimes(lua_State *L) /** times() */ + /*@modifies L @*/ +{ + struct mytimes t; + t.elapsed = times(&t.t); + return doselection(L, 1, Stimes, Ftimes, &t); +} + + +struct mystat +{ + struct stat s; + char mode[10]; +/*@observer@*/ + const char *type; +}; + +static int Fstat(lua_State *L, int i, const void *data) + /*@modifies L @*/ +{ + const struct mystat *s = (const struct mystat *) data; + switch (i) + { + case 0: lua_pushstring(L, s->mode); break; + case 1: lua_pushnumber(L, s->s.st_ino); break; + case 2: lua_pushnumber(L, s->s.st_dev); break; + case 3: lua_pushnumber(L, s->s.st_nlink); break; + case 4: lua_pushnumber(L, s->s.st_uid); break; + case 5: lua_pushnumber(L, s->s.st_gid); break; + case 6: lua_pushnumber(L, s->s.st_size); break; + case 7: lua_pushnumber(L, s->s.st_atime); break; + case 8: lua_pushnumber(L, s->s.st_mtime); break; + case 9: lua_pushnumber(L, s->s.st_ctime); break; + case 10:lua_pushstring(L, s->type); break; + case 11:lua_pushnumber(L, s->s.st_mode); break; + } + return 1; +} + +/*@observer@*/ /*@unchecked@*/ +static const char *const Sstat[] = +{ + "mode", "ino", "dev", "nlink", "uid", "gid", + "size", "atime", "mtime", "ctime", "type", "_mode", + NULL +}; + +static int Pstat(lua_State *L) /** stat(path,[selector]) */ + /*@modifies L @*/ +{ + struct mystat s; + const char *path=luaL_checkstring(L, 1); + if (lstat(path,&s.s)==-1) return pusherror(L, path); + s.type=filetype(s.s.st_mode); + modechopper(s.s.st_mode, s.mode); + return doselection(L, 2, Sstat, Fstat, &s); +} + + +static int Puname(lua_State *L) /** uname([string]) */ + /*@modifies L @*/ +{ + struct utsname u; + luaL_Buffer b; + const char *s; + if (uname(&u) == -1) return pusherror(L, NULL); + luaL_buffinit(L, &b); + for (s=luaL_optstring(L, 1, "%s %n %r %v %m"); *s; s++) + if (*s!='%') + luaL_putchar(&b, *s); + else switch (*++s) + { + case '%': luaL_putchar(&b, *s); break; + case 'm': luaL_addstring(&b,u.machine); break; + case 'n': luaL_addstring(&b,u.nodename); break; + case 'r': luaL_addstring(&b,u.release); break; + case 's': luaL_addstring(&b,u.sysname); break; + case 'v': luaL_addstring(&b,u.version); break; + default: badoption(L, 2, "format", *s); break; + } + luaL_pushresult(&b); + return 1; +} + + +/*@observer@*/ /*@unchecked@*/ +static const int Kpathconf[] = +{ + _PC_LINK_MAX, _PC_MAX_CANON, _PC_MAX_INPUT, _PC_NAME_MAX, _PC_PATH_MAX, + _PC_PIPE_BUF, _PC_CHOWN_RESTRICTED, _PC_NO_TRUNC, _PC_VDISABLE, + -1 +}; + +static int Fpathconf(lua_State *L, int i, const void *data) + /*@globals internalState @*/ + /*@modifies L, internalState @*/ +{ + const char *path = (const char *) data; + lua_pushnumber(L, pathconf(path, Kpathconf[i])); + return 1; +} + +/*@observer@*/ /*@unchecked@*/ +static const char *const Spathconf[] = +{ + "link_max", "max_canon", "max_input", "name_max", "path_max", + "pipe_buf", "chown_restricted", "no_trunc", "vdisable", + NULL +}; + +static int Ppathconf(lua_State *L) /** pathconf(path,[selector]) */ + /*@modifies L @*/ +{ + const char *path=luaL_checkstring(L, 1); + return doselection(L, 2, Spathconf, Fpathconf, path); +} + + +/*@observer@*/ /*@unchecked@*/ +static const int Ksysconf[] = +{ + _SC_ARG_MAX, _SC_CHILD_MAX, _SC_CLK_TCK, _SC_NGROUPS_MAX, _SC_STREAM_MAX, + _SC_TZNAME_MAX, _SC_OPEN_MAX, _SC_JOB_CONTROL, _SC_SAVED_IDS, _SC_VERSION, + -1 +}; + +static int Fsysconf(lua_State *L, int i, /*@unused@*/ const void *data) + /*@modifies L @*/ +{ + data = data; /* XXX keep gcc happy. */ + lua_pushnumber(L, sysconf(Ksysconf[i])); + return 1; +} + +/*@observer@*/ /*@unchecked@*/ +static const char *const Ssysconf[] = +{ + "arg_max", "child_max", "clk_tck", "ngroups_max", "stream_max", + "tzname_max", "open_max", "job_control", "saved_ids", "version", + NULL +}; + +static int Psysconf(lua_State *L) /** sysconf([selector]) */ + /*@modifies L @*/ +{ + return doselection(L, 1, Ssysconf, Fsysconf, NULL); +} + +static int Pmkstemp(lua_State *L) + /*@modifies L @*/ +{ + const char *path; + char *dynpath; + int fd; + FILE **f; + + path = luaL_checkstring(L, 1); + if (path == NULL) + return 0; + dynpath = strdup(path); + fd = mkstemp(dynpath); + f = (FILE**)lua_newuserdata(L, sizeof(FILE*)); + if (f == NULL) { + close(fd); + free(dynpath); + return 0; + } + *f = fdopen(fd, "a+"); + lua_pushstring(L, dynpath); + free(dynpath); + luaL_getmetatable(L, "FILE*"); + if (lua_isnil(L, -1)) { + lua_pop(L, 1); + luaL_error(L, "FILE* metatable not available " + "(io not loaded?)"); + } else { + lua_setmetatable(L, -3); + } + return 2; +} + +/*@-readonlytrans@*/ +/*@observer@*/ /*@unchecked@*/ +static const luaL_reg R[] = +{ + {"access", Paccess}, + {"chdir", Pchdir}, + {"chmod", Pchmod}, + {"chown", Pchown}, + {"ctermid", Pctermid}, + {"dir", Pdir}, + {"errno", Perrno}, + {"exec", Pexec}, + {"files", Pfiles}, + {"fork", Pfork}, + {"getcwd", Pgetcwd}, + {"getenv", Pgetenv}, + {"getgroup", Pgetgroup}, + {"getlogin", Pgetlogin}, + {"getpasswd", Pgetpasswd}, + {"getprocessid", Pgetprocessid}, + {"glob", Pglob}, + {"kill", Pkill}, + {"link", Plink}, + {"mkdir", Pmkdir}, + {"mkdtemp", Pmkdtemp}, + {"mkfifo", Pmkfifo}, + {"mkstemp", Pmkstemp}, + {"pathconf", Ppathconf}, + {"putenv", Pputenv}, + {"readlink", Preadlink}, + {"rmdir", Prmdir}, + {"setgid", Psetgid}, + {"setuid", Psetuid}, + {"sleep", Psleep}, + {"stat", Pstat}, + {"symlink", Psymlink}, + {"sysconf", Psysconf}, + {"times", Ptimes}, + {"ttyname", Pttyname}, + {"umask", Pumask}, + {"uname", Puname}, + {"unlink", Punlink}, + {"utime", Putime}, + {"wait", Pwait}, + {"setenv", Psetenv}, + {"unsetenv", Punsetenv}, + {NULL, NULL} +}; +/*@=readonlytrans@*/ + +LUALIB_API int luaopen_posix (lua_State *L) +{ + luaL_openlib(L, MYNAME, R, 0); + lua_pushliteral(L,"version"); /** version */ + lua_pushliteral(L,MYVERSION); + lua_settable(L,-3); + return 1; +} diff --git a/rpm-5.4.9/lua/local/lposix.h b/rpm-5.4.9/lua/local/lposix.h new file mode 100644 index 0000000..9f42414 --- /dev/null +++ b/rpm-5.4.9/lua/local/lposix.h @@ -0,0 +1,7 @@ +#ifndef LPOSIX_H +#define LPOSIX_H + +int luaopen_posix (lua_State *L) + /*@modifies L @*/; + +#endif diff --git a/rpm-5.4.9/lua/local/lrexlib.h b/rpm-5.4.9/lua/local/lrexlib.h new file mode 100644 index 0000000..d9f34ad --- /dev/null +++ b/rpm-5.4.9/lua/local/lrexlib.h @@ -0,0 +1,9 @@ +#ifndef LREXLIB_H +#define LREXLIB_H + +int luaopen_rex_pcre(lua_State *L) + /*@modifies L @*/; +int luaopen_rex_posix(lua_State *L) + /*@modifies L @*/; + +#endif diff --git a/rpm-5.4.9/lua/local/lrexlib.txt b/rpm-5.4.9/lua/local/lrexlib.txt new file mode 100644 index 0000000..ed1afb7 --- /dev/null +++ b/rpm-5.4.9/lua/local/lrexlib.txt @@ -0,0 +1,669 @@ +Lrexlib 2.3 Reference Manual + +Table of Contents + + * Introduction + * Notes + * Common (PCRE and POSIX) functions and methods + + match + + find + + gmatch + + gsub + + split + + flags + + new + + tfind + + exec + * PCRE-only functions and methods + + dfa_exec + + maketables + + config + + version + * Other functions + + plainfind + * Incompatibilities with the Previous Versions + +------------------------------------------------------------------------------- + +Introduction + +Lrexlib provides bindings of the two principal regular expression library +interfaces (POSIX and PCRE) to Lua 5.1. + +Lrexlib builds into shared libraries called by default rex_posix.so and +rex_pcre.so, which can be used with require. + +Lrexlib is copyright Reuben Thomas 2000-2008 and copyright Shmuel Zeigerman +2004-2008, and is released under the MIT license. + +------------------------------------------------------------------------------- + +Notes + + 1. Most functions and methods in Lrexlib have mandatory and optional + arguments. There are no dependencies between arguments in Lrexlib's + functions and methods. Any optional argument can be supplied as nil (or + omitted if it is trailing one), the library will then use the default value + for that argument. + + 2. This document uses the following syntax for optional arguments: they are + bracketed separately, and commas are left outside brackets, e.g.: + + MyFunc (arg1, arg2, [arg3], [arg4]) + + 3. Throughout this document, the identifier rex is used in place of either + rex_posix or rex_pcre, that are the default namespaces for the + corresponding libraries. + + 4. All functions receiving a regular expression pattern as an argument will + generate an error if that pattern is found invalid by the used POSIX / PCRE + library. + + 5. The default value for compilation flags (cf) that Lrexlib uses when the + parameter is not supplied or nil, is: + + o 0 for PCRE + o REG_EXTENDED for POSIX regex library + + For PCRE, cf may also be supplied as a string, whose characters stand for + PCRE compilation flags. Combinations of the following characters (case + sensitive) are supported: + + +-------------------------+ + |Character| PCRE flag | + |---------+---------------| + |i |PCRE_CASELESS | + |---------+---------------| + |m |PCRE_MULTILINE | + |---------+---------------| + |s |PCRE_DOTALL | + |---------+---------------| + |x |PCRE_EXTENDED | + |---------+---------------| + |U |PCRE_UNGREEDY | + |---------+---------------| + |X |PCRE_EXTRA | + +-------------------------+ + + 6. The default value for execution flags (ef) that Lrexlib uses when the + parameter is not supplied or nil, is: + + o 0 for PCRE + o 0 for standard POSIX regex library + o REG_STARTEND for those POSIX regex libraries that support it, e.g. + Spencer's. + + 7. Parameter locale (lo) can be either a string (e.g., "French_France.1252"), + or a userdata obtained from a call to maketables. The default value, used + when the parameter is not supplied or nil, is the built-in PCRE set of + character tables. + +------------------------------------------------------------------------------- + +Common (PCRE and POSIX) functions and methods + +match + +rex.match (subj, patt, [init], [cf], [ef], [lo]) + +or + +r:match (subj, [init], [ef]) + +The function searches for the first match of the regexp patt in the string subj +, starting from offset init, subject to flags cf and ef. + +PCRE: A locale lo may be specified. + + +-------------------------------------------------------------------------+ + |Parameter| Description | Type | Default | + | | | | Value | + |---------+------------------------------------+---------------+----------| + |r |regex object produced by new |userdata |n/a | + |---------+------------------------------------+---------------+----------| + |subj |subject |string |n/a | + |---------+------------------------------------+---------------+----------| + |patt |regular expression pattern |string |n/a | + |---------+------------------------------------+---------------+----------| + |[init] |start offset in the subject (can be |number |1 | + | |negative) | | | + |---------+------------------------------------+---------------+----------| + |[cf] |compilation flags (bitwise OR) |number |cf | + |---------+------------------------------------+---------------+----------| + |[ef] |execution flags (bitwise OR) |number |ef | + |---------+------------------------------------+---------------+----------| + |[lo] |[PCRE] locale |string or |locale | + | | |userdata | | + +-------------------------------------------------------------------------+ + +Returns on success: + 1. All substring matches ("captures"), in the order they appear in the + pattern. false is returned for sub-patterns that did not participate in + the match. If the pattern specified no captures then the whole matched + substring is returned. +Returns on failure: + 1. nil + +------------------------------------------------------------------------------- + +find + +rex.find (subj, patt, [init], [cf], [ef], [lo]) + +or + +r:find (subj, [init], [ef]) + +The function searches for the first match of the regexp patt in the string subj +, starting from offset init, subject to flags cf and ef. + +PCRE: A locale lo may be specified. + + +-------------------------------------------------------------------------+ + |Parameter| Description | Type | Default | + | | | | Value | + |---------+------------------------------------+---------------+----------| + |r |regex object produced by new |userdata |n/a | + |---------+------------------------------------+---------------+----------| + |subj |subject |string |n/a | + |---------+------------------------------------+---------------+----------| + |patt |regular expression pattern |string |n/a | + |---------+------------------------------------+---------------+----------| + |[init] |start offset in the subject (can be |number |1 | + | |negative) | | | + |---------+------------------------------------+---------------+----------| + |[cf] |compilation flags (bitwise OR) |number |cf | + |---------+------------------------------------+---------------+----------| + |[ef] |execution flags (bitwise OR) |number |ef | + |---------+------------------------------------+---------------+----------| + |[lo] |[PCRE] locale |string or |locale | + | | |userdata | | + +-------------------------------------------------------------------------+ + +Returns on success: + 1. The start point of the match (a number). + 2. The end point of the match (a number). + 3. All substring matches ("captures"), in the order they appear in the + pattern. false is returned for sub-patterns that did not participate in + the match. +Returns on failure: + 1. nil + +------------------------------------------------------------------------------- + +gmatch + +rex.gmatch (subj, patt, [cf], [ef], [lo]) + +The function is intended for use in the generic for Lua construct. It returns +an iterator for repeated matching of the pattern patt in the string subj, +subject to flags cf and ef. + +PCRE: A locale lo may be specified. + + +-------------------------------------------------------------------------+ + |Parameter| Description | Type |Default Value| + |---------+------------------------------+------------------+-------------| + |subj |subject |string |n/a | + |---------+------------------------------+------------------+-------------| + |patt |regular expression pattern |string |n/a | + |---------+------------------------------+------------------+-------------| + |[cf] |compilation flags (bitwise OR)|number |cf | + |---------+------------------------------+------------------+-------------| + |[ef] |execution flags (bitwise OR) |number |ef | + |---------+------------------------------+------------------+-------------| + |[lo] |[PCRE] locale |string or userdata|locale | + +-------------------------------------------------------------------------+ + +The iterator function is called by Lua. On every iteration (that is, on every +match), it returns all captures in the order they appear in the pattern (or the +entire match if the pattern specified no captures). The iteration will continue +till the subject fails to match. + +------------------------------------------------------------------------------- + +gsub + +rex.gsub (subj, patt, repl, [n], [cf], [ef], [lo]) + +This function searches for all matches of the pattern patt in the string subj +and replaces them according to the parameters repl and n (see details below). + +PCRE: A locale lo may be specified. + + +-------------------------------------------------------------------------+ + |Parameter| Description | Type |Default | + | | | | Value | + |---------+---------------------------------------+--------------+--------| + |subj |subject |string |n/a | + |---------+---------------------------------------+--------------+--------| + |patt |regular expression pattern |string |n/a | + |---------+---------------------------------------+--------------+--------| + | | |string, | | + |repl |substitution source |function or |n/a | + | | |table | | + |---------+---------------------------------------+--------------+--------| + |[n] |maximum number of matches to search |number or |nil | + | |for, or control function, or nil |function | | + |---------+---------------------------------------+--------------+--------| + |[cf] |compilation flags (bitwise OR) |number |cf | + |---------+---------------------------------------+--------------+--------| + |[ef] |execution flags (bitwise OR) |number |ef | + |---------+---------------------------------------+--------------+--------| + |[lo] |[PCRE] locale |string or |locale | + | | |userdata | | + +-------------------------------------------------------------------------+ + +Returns: + 1. The subject string with the substitutions made. + 2. Number of matches found. + 3. Number of substitutions made. +Details: + + The parameter repl can be either a string, a function or a table. On each + match made, it is converted into a value repl_out that may be used for the + replacement. + + repl_out is generated differently depending on the type of repl: + + 1. If repl is a string then it is treated as a template for substitution, + where the %X occurences in repl are handled in a special way, depending + on the value of the character X: + + o if X represents a digit, then each %X occurence is substituted by + the value of the X-th submatch (capture), with the following cases + handled specially: + # each %0 is substituted by the entire match + # if the pattern contains no captures, then each %1 is + substituted by the entire match + # any other %X where X is greater than the number of captures in + the pattern will generate an error ("invalid capture index") + # if the pattern does contain a capture with number X but that + capture didn't participate in the match, then %X is substituted + by an empty string + o if X is any non-digit character then %X is substituted by X + + All parts of repl other than %X are copied to repl_out verbatim. + + 2. If repl is a function then it is called on each match with the + submatches passed as parameters (if there are no submatches then the + entire match is passed as the only parameter). repl_out is the return + value of the repl call, and is interpreted as follows: + + o if it is a string or a number (coerced to a string), then the + replacement value is that string; + o if it is a nil or a false, then no replacement is to be done; + + 3. If repl is a table then repl_out is repl [m1], where m1 is the first + submatch (or the entire match if there are no submatches), following + the same rules as for the return value of repl call, described in the + above paragraph. + + Note: Under some circumstances, the value of repl_out may be ignored; see + below. + + gsub behaves differently depending on the type of n: + + 1. If n is a number then it is treated as the maximum number of matches to + search for (an omitted or nil value means an unlimited number of + matches). On each match, the replacement value is the repl_out string + (see above). + + 2. If n is a function, then it is called on each match, after repl_out is + produced (so if repl is a function, it will be called prior to the n + call). + + n receives 3 arguments and returns 2 values. Its arguments are: + + 1. The start offset of the match (a number) + 2. The end offset of the match (a number) + 3. repl_out + + The type of its first return controls the replacement produced by gsub + for the current match: + + # true -- replace/don't replace, according to repl_out; + # nil/false -- don't replace; + # a string (or a number coerced to a string) -- replace by that + string; + + The type of its second return controls gsub behavior after the current + match is handled: + + # nil/false -- no changes: n will be called on the next match; + # true -- search for an unlimited number of matches; n will not + be called again; + # a number -- maximum number of matches to search for, beginning + from the next match; n will not be called again; + +------------------------------------------------------------------------------- + +split + +rex.split (subj, sep, [cf], [ef], [lo]) + +The function is intended for use in the generic for Lua construct. It is used +for splitting a subject string subj into parts (sections). The sep parameter is +a regular expression pattern representing separators between the sections. + +The function returns an iterator for repeated matching of the pattern sep in +the string subj, subject to flags cf and ef. + +PCRE: A locale lo may be specified. + + +-------------------------------------------------------------------------+ + |Parameter| Description | Type | Default | + | | | | Value | + |---------+----------------------------------+----------------+-----------| + |subj |subject |string |n/a | + |---------+----------------------------------+----------------+-----------| + |sep |separator (regular expression |string |n/a | + | |pattern) | | | + |---------+----------------------------------+----------------+-----------| + |[cf] |compilation flags (bitwise OR) |number |cf | + |---------+----------------------------------+----------------+-----------| + |[ef] |execution flags (bitwise OR) |number |ef | + |---------+----------------------------------+----------------+-----------| + |[lo] |[PCRE] locale |string or |locale | + | | |userdata | | + +-------------------------------------------------------------------------+ + +On every iteration pass, the iterator returns: + + 1. A subject section (can be an empty string), followed by + 2. All captures in the order they appear in the sep pattern (or the entire + match if the sep pattern specified no captures). If there is no match + (this can occur only in the last iteration), then nothing is returned + after the subject section. + +The iteration will continue till the end of the subject. Unlike gmatch, there +will always be at least one iteration pass, even if there are no matches in the +subject. + +------------------------------------------------------------------------------- + +flags + +rex.flags ([tb]) + +This function returns a table containing numeric values of the constants +defined by the used regex library (either PCRE or POSIX). Those constants are +keyed by their names (strings). If the table argument tb is supplied then it is +used as the output table, else a new table is created. + +The constants contained in the returned table can then be used in most +functions and methods where compilation flags or execution flags can be +specified. They can also be used for comparing with return codes of some +functions and methods for determining the reason of failure. For details, see +PCRE and POSIX documentation. + + +--------------------------------------------------------------+ + |Parameter| Description |Type |Default Value| + |---------+--------------------------------+-----+-------------| + |[tb] |a table for placing results into|table|nil | + +--------------------------------------------------------------+ + +Returns: + 1. A table filled with the results. + +------------------------------------------------------------------------------- + +new + +rex.new (patt, [cf], [lo]) + +The functions compiles regular expression patt into a regular expression object +whose internal representation is correspondent to the library used (PCRE or +POSIX regex). The returned result then can be used by the methods tfind, exec +and dfa_exec. Regular expression objects are automatically garbage collected. + +PCRE: A locale lo may be specified. + + +-------------------------------------------------------------------------+ + |Parameter| Description | Type |Default Value| + |---------+------------------------------+------------------+-------------| + |patt |regular expression pattern |string |n/a | + |---------+------------------------------+------------------+-------------| + |[cf] |compilation flags (bitwise OR)|number |cf | + |---------+------------------------------+------------------+-------------| + |[lo] |[PCRE] locale |string or userdata|locale | + +-------------------------------------------------------------------------+ + +Returns: + 1. Compiled regular expression (a userdata). + +------------------------------------------------------------------------------- + +tfind + +r:tfind (subj, [init], [ef]) + +The method searches for the first match of the compiled regexp r in the string +subj, starting from offset init, subject to execution flags ef. + + +-------------------------------------------------------------------------+ + |Parameter| Description | Type | Default | + | | | | Value | + |---------+-----------------------------------------+--------+------------| + |r |regex object produced by new |userdata|n/a | + |---------+-----------------------------------------+--------+------------| + |subj |subject |string |n/a | + |---------+-----------------------------------------+--------+------------| + |[init] |start offset in the subject (can be |number |1 | + | |negative) | | | + |---------+-----------------------------------------+--------+------------| + |[ef] |execution flags (bitwise OR) |number |ef | + +-------------------------------------------------------------------------+ + +Returns on success: + 1. The start point of the match (a number). + 2. The end point of the match (a number). + 3. Substring matches ("captures" in Lua terminology) are returned as a + third result, in a table. This table contains false in the positions + where the corresponding sub-pattern did not participate in the match. + 1. PCRE: if named subpatterns are used then the table also contains + substring matches keyed by their correspondent subpattern names + (strings). +Returns on failure: + 1. nil +Notes: + 1. If named subpatterns (see PCRE docs) are used then the returned table + also contains substring matches keyed by their correspondent subpattern + names (strings). + +------------------------------------------------------------------------------- + +exec + +r:exec (subj, [init], [ef]) + +The method searches for the first match of the compiled regexp r in the string +subj, starting from offset init, subject to execution flags ef. + + +-------------------------------------------------------------------------+ + |Parameter| Description | Type | Default | + | | | | Value | + |---------+-----------------------------------------+--------+------------| + |r |regex object produced by new |userdata|n/a | + |---------+-----------------------------------------+--------+------------| + |subj |subject |string |n/a | + |---------+-----------------------------------------+--------+------------| + |[init] |start offset in the subject (can be |number |1 | + | |negative) | | | + |---------+-----------------------------------------+--------+------------| + |[ef] |execution flags (bitwise OR) |number |ef | + +-------------------------------------------------------------------------+ + +Returns on success: + 1. The start point of the first match (a number). + 2. The end point of the first match (a number). + 3. The offsets of substring matches ("captures" in Lua terminology) are + returned as a third result, in a table. This table contains false in + the positions where the corresponding sub-pattern did not participate + in the match. + 1. PCRE: if named subpatterns are used then the table also contains + substring matches keyed by their correspondent subpattern names + (strings). +Returns on failure: + 1. nil +Example: + If the whole match is at offsets 10,20 and substring matches are at offsets + 12,14 and 16,19 then the function returns the following: 10, 20, { + 12,14,16,19 }. + +------------------------------------------------------------------------------- + +PCRE-only functions and methods + +dfa_exec + +[PCRE 6.0 and later. See pcre_dfa_exec in the PCRE docs.] + +r:dfa_exec (subj, [init], [ef], [ovecsize], [wscount]) + +The method matches a compiled regular expression r against a given subject +string subj, using a DFA matching algorithm. + + +-------------------------------------------------------------------------+ + |Parameter | Description | Type | Default | + | | | | Value | + |----------+----------------------------------------+--------+------------| + |r |regex object produced by new |userdata|n/a | + |----------+----------------------------------------+--------+------------| + |subj |subject |string |n/a | + |----------+----------------------------------------+--------+------------| + |[init] |start offset in the subject (can be |number |1 | + | |negative) | | | + |----------+----------------------------------------+--------+------------| + |[ef] |execution flags (bitwise OR) |number |ef | + |----------+----------------------------------------+--------+------------| + |[ovecsize]|size of the array for result offsets |number |100 | + |----------+----------------------------------------+--------+------------| + |[wscount] |number of elements in the working space |number |50 | + | |array | | | + +-------------------------------------------------------------------------+ + +Returns on success (either full or partial match): + 1. The start point of the matches found (a number). + 2. A table containing the end points of the matches found, the longer + matches first. + 3. The return value of the underlying pcre_dfa_exec call (a number). +Returns on failure (no match): + 1. nil +Example: + If there are 3 matches found starting at offset 10 and ending at offsets + 15, 20 and 25 then the function returns the following: 10, { 25,20,15 }, 3. + +------------------------------------------------------------------------------- + +maketables + +[PCRE only. See pcre_maketables in the PCRE docs.] + +rex.maketables () + +Creates a set of character tables corresponding to the current locale and +returns it as a userdata. The returned value can be passed to any Lrexlib +function accepting the locale parameter. + +------------------------------------------------------------------------------- + +config + +[PCRE 4.0 and later. See pcre_config in the PCRE docs.] + +rex.config ([tb]) + +This function returns a table containing the values of the configuration +parameters used at PCRE library build-time. Those parameters (numbers) are +keyed by their names (strings). If the table argument tb is supplied then it is +used as the output table, else a new table is created. + + +--------------------------------------------------------------+ + |Parameter| Description |Type |Default Value| + |---------+--------------------------------+-----+-------------| + |[tb] |a table for placing results into|table|nil | + +--------------------------------------------------------------+ + +Returns: + 1. A table filled with the results. + +------------------------------------------------------------------------------- + +version + +[PCRE only. See pcre_version in the PCRE docs.] + +rex.version () + +This function returns a string containing the version of the used PCRE library +and its release date. + +------------------------------------------------------------------------------- + +Other functions + +plainfind + +rex.plainfind (subj, patt, [init], [ci]) + +The function searches for the first match of the string patt in the subject +subj, starting from offset init. + + + The string patt is not regular expression, all its characters stand for + themselves. + + Both strings subj and patt can have embedded zeros. + + The flag ci specifies case-insensitive search (current locale is used). + + This function uses neither PCRE nor POSIX regex library. + +-------------------------------------------------------------------------+ + |Parameter| Description | Type | Default | + | | | | Value | + |---------+------------------------------------------+-------+------------| + |subj |subject |string |n/a | + |---------+------------------------------------------+-------+------------| + |patt |text to find |string |n/a | + |---------+------------------------------------------+-------+------------| + |[init] |start offset in the subject (can be |number |1 | + | |negative) | | | + |---------+------------------------------------------+-------+------------| + |[ci] |case insensitive search |boolean|false | + +-------------------------------------------------------------------------+ + +Returns on success: + 1. The start point of the match (a number). + 2. The end point of the match (a number). +Returns on failure: + 1. nil + +------------------------------------------------------------------------------- + +Incompatibilities with the Previous Versions + +Incompatibilities between the versions 2.0 and 1.19: + + 1. Lua 5.1 is required + 2. Functions newPCRE and newPOSIX renamed to new + 3. Functions flagsPCRE and flagsPOSIX renamed to flags + 4. Function versionPCRE renamed to version + 5. Method match renamed to tfind + 6. Method gmatch removed (similar functionality is provided by function + gmatch) + 7. Methods tfind and exec: 2 values are returned on failure + 8. (PCRE) exec: the returned table may additionally contain named + subpatterns + +Incompatibilities between the versions 2.1 and 2.0: + + 1. match, find, tfind, exec, dfa_exec: only one value (a nil) is returned + when the subject does not match the pattern. Any other failure + generates an error. + +Incompatibilities between the versions 2.2 and 2.1: + + 1. gsub: a special "break" return of repl function is deprecated. + 2. (PCRE) gsub, gmatch: after finding an empty match at the current + position, the functions try to find a non-empty match anchored to the + same position. + +------------------------------------------------------------------------------- +Generated on: 2008-05-30 18:47 UTC. diff --git a/rpm-5.4.9/lua/local/lrexlib_algo.h b/rpm-5.4.9/lua/local/lrexlib_algo.h new file mode 100644 index 0000000..872234c --- /dev/null +++ b/rpm-5.4.9/lua/local/lrexlib_algo.h @@ -0,0 +1,666 @@ +/* algo.h */ +/* See Copyright Notice in the file LICENSE */ + +#include "lrexlib_common.h" + +#define REX_VERSION "Lrexlib 2.3.0" + +/* Forward declarations */ +static void gmatch_pushsubject (lua_State *L, TArgExec *argE); +static int findmatch_exec (TUserdata *ud, TArgExec *argE); +static int split_exec (TUserdata *ud, TArgExec *argE, int offset); +static int compile_regex (lua_State *L, const TArgComp *argC, TUserdata **pud); +static int generate_error (lua_State *L, const TUserdata *ud, int errcode); + +#ifndef ALG_OPTLOCALE +# define ALG_OPTLOCALE(a,b,c) +#endif + +#ifndef DO_NAMED_SUBPATTERNS +#define DO_NAMED_SUBPATTERNS(a,b,c) +#endif + +/* When doing an iterative search, there can occur a situation of a zero-length + * match at the current position, that prevents further advance on the subject + * string. + * There are two ways to handle that (AFAIK): + * a) Advance by one character (continue the search from the next position), + * or + * b) Search for a non-zero-length match that begins from the current + * position ("retry" the search). If the match is not found then advance + * by one character. + * The "b)" seems more correct, but most regex libraries expose no API for that. + * The known exception is PCRE that has flags PCRE_NOTEMPTY and PCRE_ANCHORED. + */ +#ifdef ALG_USERETRY + #define SET_RETRY(a,b) (a=b) + static int gsub_exec (TUserdata *ud, TArgExec *argE, int offset, int retry); + static int gmatch_exec (TUserdata *ud, TArgExec *argE, int retry); + #define GSUB_EXEC gsub_exec + #define GMATCH_EXEC gmatch_exec +#else + #define SET_RETRY(a,b) ((void)a) + static int gsub_exec (TUserdata *ud, TArgExec *argE, int offset); + static int gmatch_exec (TUserdata *ud, TArgExec *argE); + #define GSUB_EXEC(a,b,c,d) gsub_exec(a,b,c) + #define GMATCH_EXEC(a,b,c) gmatch_exec(a,b) +#endif + + +#define METHOD_FIND 0 +#define METHOD_MATCH 1 +#define METHOD_EXEC 2 +#define METHOD_TFIND 3 + + +static int OptLimit (lua_State *L, int pos) { + if (lua_isnoneornil (L, pos)) + return GSUB_UNLIMITED; + if (lua_isfunction (L, pos)) + return GSUB_CONDITIONAL; + if (lua_isnumber (L, pos)) { + int a = lua_tointeger (L, pos); + return a < 0 ? 0 : a; + } + return luaL_argerror (L, pos, "number or function expected"); +} + + +static int get_startoffset(lua_State *L, int stackpos, size_t len) { + int startoffset = luaL_optint(L, stackpos, 1); + if(startoffset > 0) + startoffset--; + else if(startoffset < 0) { + startoffset += len; + if(startoffset < 0) + startoffset = 0; + } + return startoffset; +} + + +static TUserdata* check_ud (lua_State *L) +{ + TUserdata *ud; + if (lua_getmetatable(L, 1) && + lua_rawequal(L, -1, LUA_ENVIRONINDEX) && + (ud = (TUserdata *)lua_touserdata(L, 1)) != NULL) { + lua_pop(L, 1); + return ud; + } + luaL_argerror(L, 1, "incorrect type"); + return NULL; +} + + +static void checkarg_new (lua_State *L, TArgComp *argC) { + argC->pattern = luaL_checklstring (L, 1, &argC->patlen); + argC->cflags = ALG_GETCFLAGS (L, 2); + ALG_OPTLOCALE (argC, L, 3); +} + + +/* function gsub (s, patt, f, [n], [cf], [ef], [lo]) */ +static void checkarg_gsub (lua_State *L, TArgComp *argC, TArgExec *argE) { + argE->text = luaL_checklstring (L, 1, &argE->textlen); + argC->pattern = luaL_checklstring (L, 2, &argC->patlen); + lua_tostring (L, 3); /* converts number (if any) to string */ + argE->reptype = lua_type (L, 3); + if (argE->reptype != LUA_TSTRING && argE->reptype != LUA_TTABLE && + argE->reptype != LUA_TFUNCTION) { + luaL_argerror (L, 3, "must be string, table or function"); + } + argE->funcpos = 3; + argE->funcpos2 = 4; + argE->maxmatch = OptLimit (L, 4); + argC->cflags = ALG_GETCFLAGS (L, 5); + argE->eflags = luaL_optint (L, 6, ALG_EFLAGS_DFLT); + ALG_OPTLOCALE (argC, L, 7); +} + + +/* function find (s, patt, [st], [cf], [ef], [lo]) */ +/* function match (s, patt, [st], [cf], [ef], [lo]) */ +static void checkarg_find_func (lua_State *L, TArgComp *argC, TArgExec *argE) { + argE->text = luaL_checklstring (L, 1, &argE->textlen); + argC->pattern = luaL_checklstring (L, 2, &argC->patlen); + argE->startoffset = get_startoffset (L, 3, argE->textlen); + argC->cflags = ALG_GETCFLAGS (L, 4); + argE->eflags = luaL_optint (L, 5, ALG_EFLAGS_DFLT); + ALG_OPTLOCALE (argC, L, 6); +} + + +/* function gmatch (s, patt, [cf], [ef], [lo]) */ +/* function split (s, patt, [cf], [ef], [lo]) */ +static void checkarg_gmatch_split (lua_State *L, TArgComp *argC, TArgExec *argE) { + argE->text = luaL_checklstring (L, 1, &argE->textlen); + argC->pattern = luaL_checklstring (L, 2, &argC->patlen); + argC->cflags = ALG_GETCFLAGS (L, 3); + argE->eflags = luaL_optint (L, 4, ALG_EFLAGS_DFLT); + ALG_OPTLOCALE (argC, L, 5); +} + + +/* method r:tfind (s, [st], [ef]) */ +/* method r:exec (s, [st], [ef]) */ +/* method r:find (s, [st], [ef]) */ +/* method r:match (s, [st], [ef]) */ +static void checkarg_find_method (lua_State *L, TArgExec *argE, TUserdata **ud) { + *ud = check_ud (L); + argE->text = luaL_checklstring (L, 2, &argE->textlen); + argE->startoffset = get_startoffset (L, 3, argE->textlen); + argE->eflags = luaL_optint (L, 4, ALG_EFLAGS_DFLT); +} + + +static int ud_new (lua_State *L) { + TArgComp argC; + checkarg_new (L, &argC); + return compile_regex (L, &argC, NULL); +} + +static void push_substrings (lua_State *L, TUserdata *ud, const char *text, + TFreeList *freelist) { + int i; + if (lua_checkstack (L, ALG_NSUB(ud)) == 0) { + if (freelist) + freelist_free (freelist); + luaL_error (L, "cannot add %d stack slots", ALG_NSUB(ud)); + } + for (i = 1; i <= ALG_NSUB(ud); i++) { + ALG_PUSHSUB_OR_FALSE (L, ud, text, i); + } +} + +static int gsub (lua_State *L) { + TUserdata *ud; + TArgComp argC; + TArgExec argE; + int n_match = 0, n_subst = 0, st = 0, retry; + TBuffer BufOut, BufRep, BufTemp, *pBuf = &BufOut; + TFreeList freelist; + /*------------------------------------------------------------------*/ + checkarg_gsub (L, &argC, &argE); + compile_regex (L, &argC, &ud); + freelist_init (&freelist); + /*------------------------------------------------------------------*/ + if (argE.reptype == LUA_TSTRING) { + rex_buffer_init (&BufRep, 256, L, &freelist); + bufferZ_putrepstring (&BufRep, argE.funcpos, ALG_NSUB(ud)); + } + /*------------------------------------------------------------------*/ + if (argE.maxmatch == GSUB_CONDITIONAL) { + rex_buffer_init (&BufTemp, 1024, L, &freelist); + pBuf = &BufTemp; + } + /*------------------------------------------------------------------*/ + rex_buffer_init (&BufOut, 1024, L, &freelist); + SET_RETRY (retry, 0); + while ((argE.maxmatch < 0 || n_match < argE.maxmatch) && st <= (int)argE.textlen) { + int from, to, res; + int curr_subst = 0; + res = GSUB_EXEC (ud, &argE, st, retry); + if (res == ALG_NOMATCH) { +#ifdef ALG_USERETRY + if (retry) { + if (st < (int)argE.textlen) { /* advance by 1 char (not replaced) */ + buffer_addlstring (&BufOut, argE.text + st, 1); + ++st; + retry = 0; + continue; + } + } +#endif + break; + } + else if (!ALG_ISMATCH (res)) { + freelist_free (&freelist); + return generate_error (L, ud, res); + } + ++n_match; + from = ALG_BASE(st) + ALG_SUBBEG(ud,0); + to = ALG_BASE(st) + ALG_SUBEND(ud,0); + if (st < from) { + buffer_addlstring (&BufOut, argE.text + st, from - st); +#ifdef ALG_PULL + st = from; +#endif + } + /*----------------------------------------------------------------*/ + if (argE.reptype == LUA_TSTRING) { + size_t iter = 0, num; + const char *str; + while (bufferZ_next (&BufRep, &iter, &num, &str)) { + if (str) + buffer_addlstring (pBuf, str, num); + else if (num == 0 || ALG_SUBVALID (ud,num)) + buffer_addlstring (pBuf, argE.text + ALG_BASE(st) + ALG_SUBBEG(ud,num), ALG_SUBLEN(ud,num)); + } + curr_subst = 1; + } + /*----------------------------------------------------------------*/ + else if (argE.reptype == LUA_TTABLE) { + if (ALG_NSUB(ud) > 0) + ALG_PUSHSUB_OR_FALSE (L, ud, argE.text + ALG_BASE(st), 1); + else + lua_pushlstring (L, argE.text + from, to - from); + lua_gettable (L, argE.funcpos); + } + /*----------------------------------------------------------------*/ + else if (argE.reptype == LUA_TFUNCTION) { + int narg; + lua_pushvalue (L, argE.funcpos); + if (ALG_NSUB(ud) > 0) { + push_substrings (L, ud, argE.text + ALG_BASE(st), &freelist); + narg = ALG_NSUB(ud); + } + else { + lua_pushlstring (L, argE.text + from, to - from); + narg = 1; + } + if (0 != lua_pcall (L, narg, 1, 0)) { + freelist_free (&freelist); + return lua_error (L); /* re-raise the error */ + } + } + /*----------------------------------------------------------------*/ + if (argE.reptype != LUA_TSTRING) { + if (lua_tostring (L, -1)) { + buffer_addvalue (pBuf, -1); + curr_subst = 1; + } + else if (!lua_toboolean (L, -1)) + buffer_addlstring (pBuf, argE.text + from, to - from); + else { + freelist_free (&freelist); + luaL_error (L, "invalid replacement value (a %s)", luaL_typename (L, -1)); + } + if (argE.maxmatch != GSUB_CONDITIONAL) + lua_pop (L, 1); + } + /*----------------------------------------------------------------*/ + if (argE.maxmatch == GSUB_CONDITIONAL) { + /* Call the function */ + lua_pushvalue (L, argE.funcpos2); + lua_pushinteger (L, from + 1); + lua_pushinteger (L, to); + if (argE.reptype == LUA_TSTRING) + buffer_pushresult (&BufTemp); + else { + lua_pushvalue (L, -4); + lua_remove (L, -5); + } + if (0 != lua_pcall (L, 3, 2, 0)) { + freelist_free (&freelist); + lua_error (L); /* re-raise the error */ + } + /* Handle the 1-st return value */ + if (lua_isstring (L, -2)) { /* coercion is allowed here */ + buffer_addvalue (&BufOut, -2); /* rep2 */ + curr_subst = 1; + } + else if (lua_toboolean (L, -2)) + buffer_addbuffer (&BufOut, &BufTemp); /* rep1 */ + else { + buffer_addlstring (&BufOut, argE.text + from, to - from); /* "no" */ + curr_subst = 0; + } + /* Handle the 2-nd return value */ + if (lua_type (L, -1) == LUA_TNUMBER) { /* no coercion is allowed here */ + int n = lua_tointeger (L, -1); + if (n < 0) /* n */ + n = 0; + argE.maxmatch = n_match + n; + } + else if (lua_toboolean (L, -1)) /* "yes to all" */ + argE.maxmatch = GSUB_UNLIMITED; + else + buffer_clear (&BufTemp); + + lua_pop (L, 2); + if (argE.maxmatch != GSUB_CONDITIONAL) + pBuf = &BufOut; + } + /*----------------------------------------------------------------*/ + n_subst += curr_subst; + if (st < to) { + st = to; + SET_RETRY (retry, 0); + } + else if (st < (int)argE.textlen) { +#ifdef ALG_USERETRY + retry = 1; +#else + /* advance by 1 char (not replaced) */ + buffer_addlstring (&BufOut, argE.text + st, 1); + ++st; +#endif + } + else break; + } + /*------------------------------------------------------------------*/ + buffer_addlstring (&BufOut, argE.text + st, argE.textlen - st); + buffer_pushresult (&BufOut); + lua_pushinteger (L, n_match); + lua_pushinteger (L, n_subst); + freelist_free (&freelist); + return 3; +} + + +static int finish_generic_find (lua_State *L, TUserdata *ud, TArgExec *argE, + int method, int res) +{ + if (ALG_ISMATCH (res)) { + if (method == METHOD_FIND) + ALG_PUSHOFFSETS (L, ud, ALG_BASE(argE->startoffset), 0); + if (ALG_NSUB(ud)) /* push captures */ + push_substrings (L, ud, argE->text, NULL); + else if (method != METHOD_FIND) { + ALG_PUSHSUB (L, ud, argE->text, 0); + return 1; + } + return (method == METHOD_FIND) ? ALG_NSUB(ud) + 2 : ALG_NSUB(ud); + } + else if (res == ALG_NOMATCH) + return lua_pushnil (L), 1; + else + return generate_error (L, ud, res); +} + + +static int generic_find_func (lua_State *L, int method) { + TUserdata *ud; + TArgComp argC; + TArgExec argE; + int res; + + checkarg_find_func (L, &argC, &argE); + if (argE.startoffset > (int)argE.textlen) + return lua_pushnil(L), 1; + + compile_regex (L, &argC, &ud); + res = findmatch_exec (ud, &argE); + return finish_generic_find (L, ud, &argE, method, res); +} + + +static int find (lua_State *L) { + return generic_find_func (L, METHOD_FIND); +} + + +static int match (lua_State *L) { + return generic_find_func (L, METHOD_MATCH); +} + + +static int gmatch_iter (lua_State *L) { + int retry; + TArgExec argE; + TUserdata *ud = (TUserdata*) lua_touserdata (L, lua_upvalueindex (1)); + argE.text = lua_tolstring (L, lua_upvalueindex (2), &argE.textlen); + argE.eflags = lua_tointeger (L, lua_upvalueindex (3)); + argE.startoffset = lua_tointeger (L, lua_upvalueindex (4)); +#ifdef ALG_USERETRY + retry = lua_tointeger (L, lua_upvalueindex (5)); +#endif + + if (argE.startoffset > (int)argE.textlen) + return 0; + + while (1) { + int res = GMATCH_EXEC (ud, &argE, retry); + if (ALG_ISMATCH (res)) { + int incr = 0; + if (ALG_SUBLEN(ud,0)) { + SET_RETRY (retry, 0); + } + else { /* no progress: prevent endless loop */ +#ifdef ALG_USERETRY + SET_RETRY (retry, 1); +#else + incr = 1; +#endif + } + ALG_PUSHEND (L, ud, ALG_BASE(argE.startoffset)+incr, 0); /* update start offset */ + lua_replace (L, lua_upvalueindex (4)); +#ifdef ALG_USERETRY + lua_pushinteger (L, retry); + lua_replace (L, lua_upvalueindex (5)); /* update retry */ +#endif + /* push either captures or entire match */ + if (ALG_NSUB(ud)) { + push_substrings (L, ud, argE.text, NULL); + return ALG_NSUB(ud); + } + else { + ALG_PUSHSUB (L, ud, argE.text, 0); + return 1; + } + } + else if (res == ALG_NOMATCH) { +#ifdef ALG_USERETRY + if (retry) { + if (argE.startoffset < (int)argE.textlen) { + ++argE.startoffset; /* advance by 1 char */ + SET_RETRY (retry, 0); + continue; + } + } +#endif + return 0; + } + else + return generate_error (L, ud, res); + } +} + + +static int split_iter (lua_State *L) { + int incr, newoffset, res; + TArgExec argE; + TUserdata *ud = (TUserdata*) lua_touserdata (L, lua_upvalueindex (1)); + argE.text = lua_tolstring (L, lua_upvalueindex (2), &argE.textlen); + argE.eflags = lua_tointeger (L, lua_upvalueindex (3)); + argE.startoffset = lua_tointeger (L, lua_upvalueindex (4)); + incr = lua_tointeger (L, lua_upvalueindex (5)); + + if (argE.startoffset > (int)argE.textlen) + return 0; + + newoffset = argE.startoffset + incr; + res = split_exec (ud, &argE, newoffset); + if (ALG_ISMATCH (res)) { + ALG_PUSHEND (L, ud, ALG_BASE(newoffset), 0); /* update start offset */ + lua_replace (L, lua_upvalueindex (4)); + lua_pushinteger (L, ALG_SUBLEN(ud,0) ? 0 : 1); /* update incr */ + lua_replace (L, lua_upvalueindex (5)); + /* push text preceding the match */ + lua_pushlstring (L, argE.text + argE.startoffset, + ALG_SUBBEG(ud,0) + ALG_BASE(newoffset) - argE.startoffset); + /* push either captures or entire match */ + if (ALG_NSUB(ud)) { + push_substrings (L, ud, argE.text + ALG_BASE(newoffset), NULL); + return 1 + ALG_NSUB(ud); + } + else { + ALG_PUSHSUB (L, ud, argE.text + ALG_BASE(newoffset), 0); + return 2; + } + } + else if (res == ALG_NOMATCH) { + lua_pushinteger (L, argE.textlen + 1); /* mark as last iteration */ + lua_replace (L, lua_upvalueindex (4)); /* update start offset */ + lua_pushlstring (L, argE.text+argE.startoffset, argE.textlen-argE.startoffset); + return 1; + } + else + return generate_error (L, ud, res); +} + + +static int gmatch (lua_State *L) +{ + TArgComp argC; + TArgExec argE; + TUserdata *ud; + checkarg_gmatch_split (L, &argC, &argE); + compile_regex (L, &argC, &ud); /* 1-st upvalue: ud */ + gmatch_pushsubject (L, &argE); /* 2-nd upvalue: s */ + lua_pushinteger (L, argE.eflags); /* 3-rd upvalue: ef */ + lua_pushinteger (L, 0); /* 4-th upvalue: startoffset */ +#ifdef ALG_USERETRY + lua_pushinteger (L, 0); /* 5-th upvalue: retry */ + lua_pushcclosure (L, gmatch_iter, 5); +#else + lua_pushcclosure (L, gmatch_iter, 4); +#endif + return 1; +} + +static int split (lua_State *L) +{ + TArgComp argC; + TArgExec argE; + TUserdata *ud; + checkarg_gmatch_split (L, &argC, &argE); + compile_regex (L, &argC, &ud); /* 1-st upvalue: ud */ + gmatch_pushsubject (L, &argE); /* 2-nd upvalue: s */ + lua_pushinteger (L, argE.eflags); /* 3-rd upvalue: ef */ + lua_pushinteger (L, 0); /* 4-th upvalue: startoffset */ + lua_pushinteger (L, 0); /* 5-th upvalue: incr */ + lua_pushcclosure (L, split_iter, 5); + return 1; +} + + +static void push_substring_table (lua_State *L, TUserdata *ud, const char *text) { + int i; + lua_newtable (L); + for (i = 1; i <= ALG_NSUB(ud); i++) { + ALG_PUSHSUB_OR_FALSE (L, ud, text, i); + lua_rawseti (L, -2, i); + } +} + + +static void push_offset_table (lua_State *L, TUserdata *ud, int startoffset) { + int i, j; + lua_newtable (L); + for (i=1, j=1; i <= ALG_NSUB(ud); i++) { + if (ALG_SUBVALID (ud,i)) { + ALG_PUSHSTART (L, ud, startoffset, i); + lua_rawseti (L, -2, j++); + ALG_PUSHEND (L, ud, startoffset, i); + lua_rawseti (L, -2, j++); + } + else { + lua_pushboolean (L, 0); + lua_rawseti (L, -2, j++); + lua_pushboolean (L, 0); + lua_rawseti (L, -2, j++); + } + } +} + + +static int generic_find_method (lua_State *L, int method) { + TUserdata *ud; + TArgExec argE; + int res; + + checkarg_find_method (L, &argE, &ud); + if (argE.startoffset > (int)argE.textlen) + return lua_pushnil(L), 1; + + res = findmatch_exec (ud, &argE); + if (ALG_ISMATCH (res)) { + switch (method) { + case METHOD_EXEC: + ALG_PUSHOFFSETS (L, ud, ALG_BASE(argE.startoffset), 0); + push_offset_table (L, ud, ALG_BASE(argE.startoffset)); + DO_NAMED_SUBPATTERNS (L, ud, argE.text); + return 3; + case METHOD_TFIND: + ALG_PUSHOFFSETS (L, ud, ALG_BASE(argE.startoffset), 0); + push_substring_table (L, ud, argE.text); + DO_NAMED_SUBPATTERNS (L, ud, argE.text); + return 3; + case METHOD_MATCH: + return finish_generic_find (L, ud, &argE, METHOD_MATCH, res); + case METHOD_FIND: + return finish_generic_find (L, ud, &argE, METHOD_FIND, res); + } + return 0; + } + else if (res == ALG_NOMATCH) + return lua_pushnil (L), 1; + else + return generate_error(L, ud, res); +} + + +static int ud_find (lua_State *L) { + return generic_find_method (L, METHOD_FIND); +} +static int ud_match (lua_State *L) { + return generic_find_method (L, METHOD_MATCH); +} +static int ud_tfind (lua_State *L) { + return generic_find_method (L, METHOD_TFIND); +} +static int ud_exec (lua_State *L) { + return generic_find_method (L, METHOD_EXEC); +} + + +/* function plainfind (s, p, [st], [ci]) */ +/* (optimized for performance at the expense of code size) */ +static int plainfind_func (lua_State *L) { + size_t textlen, patlen; + const char *text = luaL_checklstring (L, 1, &textlen); + const char *pattern = luaL_checklstring (L, 2, &patlen); + const char *from = text + get_startoffset (L, 3, textlen); + int ci = lua_toboolean (L, 4); + const char *end = text + textlen - patlen; + + if (patlen == 0 && from <= end) + goto found; + if (ci ) { + for (; from <= end; ++from) { + if (toupper(*from) == toupper(*pattern)) { + const char *f = from, *p = pattern; + size_t len = patlen; + while (--len) { + if (toupper (*++f) != toupper (*++p)) + break; + } + if (len == 0) + goto found; + } + } + } + else { + for (; from <= end; ++from) { + if (*from == *pattern) { + const char *f = from, *p = pattern; + size_t len = patlen; + while (--len) { + if (*++f != *++p) + break; + } + if (len == 0) + goto found; + } + } + } + lua_pushnil (L); + return 1; +found: + lua_pushinteger (L, from - text + 1); + lua_pushinteger (L, from - text + patlen); + return 2; +} + diff --git a/rpm-5.4.9/lua/local/lrexlib_common.c b/rpm-5.4.9/lua/local/lrexlib_common.c new file mode 100644 index 0000000..dd252af --- /dev/null +++ b/rpm-5.4.9/lua/local/lrexlib_common.c @@ -0,0 +1,244 @@ +/* common.c */ +/* See Copyright Notice in the file LICENSE */ + +#if defined(LUA_USE_POSIX) || defined(LUA_USE_PCRE) + +#include +#include +#include +#include "lua.h" +#include "lauxlib.h" +#include "lrexlib_common.h" + +/* the table must be on Lua stack top */ +int get_int_field (lua_State *L, const char* field) +{ + int val; + lua_getfield (L, -1, field); + val = lua_tointeger (L, -1); + lua_pop (L, 1); + return val; +} + +/* the table must be on Lua stack top */ +void set_int_field (lua_State *L, const char* field, int val) +{ + lua_pushinteger (L, val); + lua_setfield (L, -2, field); +} + +void *Lmalloc(lua_State *L, size_t size) { + void *p = malloc(size); + if(p == NULL) + luaL_error(L, "malloc failed"); + return p; +} + +/* This function fills a table with string-number pairs. + The table can be passed as the 1-st lua-function parameter, + otherwise it is created. The return value is the filled table. +*/ +int get_flags (lua_State *L, const flag_pair **arrs) { + const flag_pair *p; + const flag_pair **pp; + int nparams = lua_gettop(L); + + if(nparams == 0) + lua_newtable(L); + else { + if(!lua_istable(L, 1)) + luaL_argerror(L, 1, "not a table"); + if(nparams > 1) + lua_pushvalue(L, 1); + } + + for(pp=arrs; *pp; ++pp) { + for(p=*pp; p->key; ++p) { + lua_pushstring(L, p->key); + lua_pushinteger(L, p->val); + lua_rawset(L, -3); + } + } + return 1; +} + +const char *get_flag_key (const flag_pair *fp, int val) { + for (; fp->key; ++fp) { + if (fp->val == val) + return fp->key; + } + return NULL; +} + +/* Classes */ + +/* + * class TFreeList + * *************** + * Simple array of pointers to TBuffer's. + * The array has fixed capacity (not expanded automatically). + */ + +void freelist_init (TFreeList *fl) { + fl->top = 0; +} + +void freelist_add (TFreeList *fl, TBuffer *buf) { + fl->list[fl->top++] = buf; +} + +void freelist_free (TFreeList *fl) { + while (fl->top > 0) + buffer_free (fl->list[--fl->top]); +} + +/* + * class TBuffer + * ************* + * Auto-extensible array of characters for building long strings incrementally. + * * Differs from luaL_Buffer in that: + * * it does not use Lua facilities (except luaL_error when malloc fails) + * * its operations do not change Lua stack top position + * * buffer_addvalue does not extract the value from Lua stack + * * buffer_pushresult does not have to be the last operation + * * Uses TFreeList class: + * * for inserting itself into a TFreeList instance for future clean-up + * * calls freelist_free prior to calling luaL_error. + * * Has specialized "Z-operations" for maintaining mixed string/integer + * array: bufferZ_addlstring, bufferZ_addnum and bufferZ_next. + * * if the array is intended to be "mixed", then the methods + * buffer_addlstring and buffer_addvalue must not be used + * (the application will crash on bufferZ_next). + * * conversely, if the array is not intended to be "mixed", + * then the method bufferZ_next must not be used. + */ + +enum { ID_NUMBER, ID_STRING }; + +void rex_buffer_init (TBuffer *buf, size_t sz, lua_State *L, TFreeList *fl) { + buf->arr = (char*) malloc (sz); + if (!buf->arr) { + freelist_free (fl); + luaL_error (L, "malloc failed"); + } + buf->size = sz; + buf->top = 0; + buf->L = L; + buf->freelist = fl; + freelist_add (fl, buf); +} + +void buffer_free (TBuffer *buf) { + free (buf->arr); +} + +void buffer_clear (TBuffer *buf) { + buf->top = 0; +} + +void buffer_pushresult (TBuffer *buf) { + lua_pushlstring (buf->L, buf->arr, buf->top); +} + +void buffer_addbuffer (TBuffer *trg, TBuffer *src) { + buffer_addlstring (trg, src->arr, src->top); +} + +void buffer_addlstring (TBuffer *buf, const void *src, size_t sz) { + size_t newtop = buf->top + sz; + if (newtop > buf->size) { + char *p = (char*) realloc (buf->arr, 2 * newtop); /* 2x expansion */ + if (!p) { + freelist_free (buf->freelist); + luaL_error (buf->L, "realloc failed"); + } + buf->arr = p; + buf->size = 2 * newtop; + } + memcpy (buf->arr + buf->top, src, sz); + buf->top = newtop; +} + +void buffer_addvalue (TBuffer *buf, int stackpos) { + size_t len; + const char *p = lua_tolstring (buf->L, stackpos, &len); + buffer_addlstring (buf, p, len); +} + +static void bufferZ_addlstring (TBuffer *buf, const void *src, size_t len) { + size_t header[2] = { ID_STRING }; + header[1] = len; + buffer_addlstring (buf, header, sizeof (header)); + buffer_addlstring (buf, src, len); +} + +static void bufferZ_addnum (TBuffer *buf, size_t num) { + size_t header[2] = { ID_NUMBER }; + header[1] = num; + buffer_addlstring (buf, header, sizeof (header)); +} + +/* 1. When called repeatedly on the same TBuffer, its existing data + is discarded and overwritten by the new data. + 2. The TBuffer's array is never shrunk by this function. +*/ +void bufferZ_putrepstring (TBuffer *BufRep, int reppos, int nsub) { + char dbuf[] = { 0, 0 }; + size_t replen; + const char *p = lua_tolstring (BufRep->L, reppos, &replen); + const char *end = p + replen; + BufRep->top = 0; + while (p < end) { + const char *q; + for (q = p; q < end && *q != '%'; ++q) + {} + if (q != p) + bufferZ_addlstring (BufRep, p, q - p); + if (q < end) { + if (++q < end) { /* skip % */ + if (isdigit (*q)) { + int num; + *dbuf = *q; + num = atoi (dbuf); + if (num == 1 && nsub == 0) + num = 0; + else if (num > nsub) { + freelist_free (BufRep->freelist); + luaL_error (BufRep->L, "invalid capture index"); + } + bufferZ_addnum (BufRep, num); + } + else bufferZ_addlstring (BufRep, q, 1); + } + p = q + 1; + } + else break; + } +} + +/****************************************************************************** + The intended use of this function is as follows: + size_t iter = 0; + while (bufferZ_next (buf, &iter, &num, &str)) { + if (str) do_something_with_string (str, num); + else do_something_with_number (num); + } +******************************************************************************* +*/ +int bufferZ_next (TBuffer *buf, size_t *iter, size_t *num, const char **str) { + if (*iter < buf->top) { + size_t *ptr_header = (size_t*)(buf->arr + *iter); + *num = ptr_header[1]; + *iter += 2 * sizeof (size_t); + *str = NULL; + if (*ptr_header == ID_STRING) { + *str = buf->arr + *iter; + *iter += *num; + } + return 1; + } + return 0; +} + +#endif + diff --git a/rpm-5.4.9/lua/local/lrexlib_common.h b/rpm-5.4.9/lua/local/lrexlib_common.h new file mode 100644 index 0000000..e2d0dd4 --- /dev/null +++ b/rpm-5.4.9/lua/local/lrexlib_common.h @@ -0,0 +1,86 @@ +/* common.h */ +/* See Copyright Notice in the file LICENSE */ + +#ifndef COMMON_H +#define COMMON_H + +#include "lua.h" + +/* REX_API can be overridden from the command line or Makefile */ +#ifndef REX_API +# define REX_API LUALIB_API +#endif + +/* Special values for maxmatch in gsub. They all must be negative. */ +#define GSUB_UNLIMITED -1 +#define GSUB_CONDITIONAL -2 + +/* Common structs and functions */ + +typedef struct { + const char* key; + int val; +} flag_pair; + +typedef struct { /* compile arguments */ + const char * pattern; + size_t patlen; + int cflags; + const char * locale; + const unsigned char * tables; + int tablespos; +} TArgComp; + +typedef struct { /* exec arguments */ + const char * text; + size_t textlen; + int startoffset; + int eflags; + int funcpos; + int maxmatch; + int funcpos2; /* used with gsub */ + int reptype; /* used with gsub */ + size_t ovecsize; /* used with dfa_exec */ + size_t wscount; /* used with dfa_exec */ +} TArgExec; + +struct tagFreeList; /* forward declaration */ + +struct tagBuffer { + size_t size; + size_t top; + char * arr; + lua_State * L; + struct tagFreeList * freelist; +}; + +struct tagFreeList { + struct tagBuffer * list[16]; + int top; +}; + +typedef struct tagBuffer TBuffer; +typedef struct tagFreeList TFreeList; + +void freelist_init (TFreeList *fl); +void freelist_add (TFreeList *fl, TBuffer *buf); +void freelist_free (TFreeList *fl); + +void rex_buffer_init (TBuffer *buf, size_t sz, lua_State *L, TFreeList *fl); +void buffer_free (TBuffer *buf); +void buffer_clear (TBuffer *buf); +void buffer_addbuffer (TBuffer *trg, TBuffer *src); +void buffer_addlstring (TBuffer *buf, const void *src, size_t sz); +void buffer_addvalue (TBuffer *buf, int stackpos); +void buffer_pushresult (TBuffer *buf); + +void bufferZ_putrepstring (TBuffer *buf, int reppos, int nsub); +int bufferZ_next (TBuffer *buf, size_t *iter, size_t *len, const char **str); + +int get_int_field (lua_State *L, const char* field); +void set_int_field (lua_State *L, const char* field, int val); +int get_flags (lua_State *L, const flag_pair **arr); +const char *get_flag_key (const flag_pair *fp, int val); +void *Lmalloc (lua_State *L, size_t size); + +#endif diff --git a/rpm-5.4.9/lua/local/lrexlib_lpcre.c b/rpm-5.4.9/lua/local/lrexlib_lpcre.c new file mode 100644 index 0000000..2a92352 --- /dev/null +++ b/rpm-5.4.9/lua/local/lrexlib_lpcre.c @@ -0,0 +1,443 @@ +/* lpcre.c - Lua binding of PCRE library */ +/* See Copyright Notice in the file LICENSE */ + +#ifndef REX_LIBNAME +# define REX_LIBNAME "rex_pcre" +#endif +#ifndef REX_OPENLIB +# define REX_OPENLIB luaopen_rex_pcre +#endif + +#include +#include +#include +#include + +#include "lua.h" +#include "lauxlib.h" +#include "lrexlib.h" +#include "lrexlib_common.h" + +#if defined(LUA_USE_PCRE) + +#include + +extern int Lpcre_get_flags (lua_State *L); +extern int Lpcre_config (lua_State *L); +extern flag_pair pcre_error_flags[]; + +#define ALG_CFLAGS_DFLT 0 +#define ALG_EFLAGS_DFLT 0 + +static int getcflags (lua_State *L, int pos); +#define ALG_GETCFLAGS(L,pos) getcflags(L, pos) + +static void optlocale (TArgComp *argC, lua_State *L, int pos); +#define ALG_OPTLOCALE(a,b,c) optlocale(a,b,c) + +#define ALG_NOMATCH PCRE_ERROR_NOMATCH +#define ALG_ISMATCH(res) ((res) >= 0) +#define ALG_SUBBEG(ud,n) ud->match[n+n] +#define ALG_SUBEND(ud,n) ud->match[n+n+1] +#define ALG_SUBLEN(ud,n) (ALG_SUBEND(ud,n) - ALG_SUBBEG(ud,n)) +#define ALG_SUBVALID(ud,n) (ALG_SUBBEG(ud,n) >= 0) +#define ALG_NSUB(ud) ((int)ud->ncapt) + +#define ALG_PUSHSUB(L,ud,text,n) \ + lua_pushlstring (L, (text) + ALG_SUBBEG(ud,n), ALG_SUBLEN(ud,n)) + +#define ALG_PUSHSUB_OR_FALSE(L,ud,text,n) \ + (ALG_SUBVALID(ud,n) ? ALG_PUSHSUB (L,ud,text,n) : lua_pushboolean (L,0)) + +#define ALG_PUSHSTART(L,ud,offs,n) lua_pushinteger(L, (offs) + ALG_SUBBEG(ud,n) + 1) +#define ALG_PUSHEND(L,ud,offs,n) lua_pushinteger(L, (offs) + ALG_SUBEND(ud,n)) +#define ALG_PUSHOFFSETS(L,ud,offs,n) \ + (ALG_PUSHSTART(L,ud,offs,n), ALG_PUSHEND(L,ud,offs,n)) + +#define ALG_BASE(st) 0 +#define ALG_PULL +#define ALG_USERETRY + +typedef struct { + pcre * pr; + pcre_extra * extra; + int * match; + int ncapt; + const unsigned char * tables; + int freed; +} TPcre; + +#define TUserdata TPcre + +#if PCRE_MAJOR >= 4 +static void do_named_subpatterns (lua_State *L, TPcre *ud, const char *text); +# define DO_NAMED_SUBPATTERNS do_named_subpatterns +#endif + +const char pcre_typename[] = REX_LIBNAME"_regex"; + +#include "lrexlib_algo.h" + +/* Locations of the 2 permanent tables in the function environment */ +#define INDEX_CHARTABLES_META 1 /* chartables type's metatable */ +#define INDEX_CHARTABLES_LINK 2 /* link chartables to compiled regex */ + +const char chartables_typename[] = "chartables"; + +/* Functions + ****************************************************************************** + */ + +static void push_chartables_meta (lua_State *L) { + lua_pushinteger (L, INDEX_CHARTABLES_META); + lua_rawget (L, LUA_ENVIRONINDEX); +} + +static int getcflags (lua_State *L, int pos) { + switch (lua_type (L, pos)) { + case LUA_TNONE: + case LUA_TNIL: + return ALG_CFLAGS_DFLT; + case LUA_TNUMBER: + return lua_tointeger (L, pos); + case LUA_TSTRING: { + const char *s = lua_tostring (L, pos); + int res = 0, ch; + while ((ch = *s++) != '\0') { + if (ch == 'i') res |= PCRE_CASELESS; + else if (ch == 'm') res |= PCRE_MULTILINE; + else if (ch == 's') res |= PCRE_DOTALL; + else if (ch == 'x') res |= PCRE_EXTENDED; + else if (ch == 'U') res |= PCRE_UNGREEDY; + else if (ch == 'X') res |= PCRE_EXTRA; + } + return res; + } + default: + return luaL_argerror (L, pos, "number or string expected"); + } +} + +static int generate_error (lua_State *L, const TPcre *ud, int errcode) { + const char *key = get_flag_key (pcre_error_flags, errcode); + (void) ud; + if (key) + return luaL_error (L, "error PCRE_%s", key); + else + return luaL_error (L, "PCRE error code %d", errcode); +} + +#if PCRE_MAJOR >= 6 +/* method r:dfa_exec (s, [st], [ef], [ovecsize], [wscount]) */ +static void checkarg_dfa_exec (lua_State *L, TArgExec *argE, TPcre **ud) { + *ud = check_ud (L); + argE->text = luaL_checklstring (L, 2, &argE->textlen); + argE->startoffset = get_startoffset (L, 3, argE->textlen); + argE->eflags = luaL_optint (L, 4, ALG_EFLAGS_DFLT); + argE->ovecsize = luaL_optint (L, 5, 100); + argE->wscount = luaL_optint (L, 6, 50); +} +#endif + +static int Lpcre_maketables (lua_State *L) { + *(const void**)lua_newuserdata (L, sizeof(void*)) = pcre_maketables(); + push_chartables_meta (L); + lua_setmetatable (L, -2); + return 1; +} + +static void **check_chartables (lua_State *L, int pos) { + void **q; + /* Compare the metatable against the C function environment. */ + if (lua_getmetatable(L, pos)) { + push_chartables_meta (L); + if (lua_rawequal(L, -1, -2) && + (q = (void **)lua_touserdata(L, pos)) != NULL) { + lua_pop(L, 2); + return q; + } + } + luaL_argerror(L, pos, lua_pushfstring (L, "not a %s", chartables_typename)); + return NULL; +} + +static int chartables_gc (lua_State *L) { + void **ud = check_chartables (L, 1); + if (*ud) { + pcre_free (*ud); + *ud = NULL; + } + return 0; +} + +static void optlocale (TArgComp *argC, lua_State *L, int pos) { + argC->locale = NULL; + argC->tables = NULL; + if (!lua_isnoneornil (L, pos)) { + if (lua_isstring (L, pos)) + argC->locale = lua_tostring (L, pos); + else { + argC->tablespos = pos; + argC->tables = (const unsigned char *) *check_chartables (L, pos); + } + } +} + +static int compile_regex (lua_State *L, const TArgComp *argC, TPcre **pud) { + const char *error; + int erroffset; + TPcre *ud; + const unsigned char *tables = NULL; + + ud = (TPcre*)lua_newuserdata (L, sizeof (TPcre)); + memset (ud, 0, sizeof (TPcre)); /* initialize all members to 0 */ + lua_pushvalue (L, LUA_ENVIRONINDEX); + lua_setmetatable (L, -2); + + if (argC->locale) { + char old_locale[256]; + strcpy (old_locale, setlocale (LC_CTYPE, NULL)); /* store the locale */ + if (NULL == setlocale (LC_CTYPE, argC->locale)) /* set new locale */ + return luaL_error (L, "cannot set locale"); + ud->tables = tables = pcre_maketables (); /* make tables with new locale */ + setlocale (LC_CTYPE, old_locale); /* restore the old locale */ + } + else if (argC->tables) { + tables = argC->tables; + lua_pushinteger (L, INDEX_CHARTABLES_LINK); + lua_rawget (L, LUA_ENVIRONINDEX); + lua_pushvalue (L, -2); + lua_pushvalue (L, argC->tablespos); + lua_rawset (L, -3); + lua_pop (L, 1); + } + + ud->pr = pcre_compile (argC->pattern, argC->cflags, &error, &erroffset, tables); + if (!ud->pr) + return luaL_error (L, "%s (pattern offset: %d)", error, erroffset + 1); + + ud->extra = pcre_study (ud->pr, 0, &error); + if (error) return luaL_error (L, "%s", error); + + pcre_fullinfo (ud->pr, ud->extra, PCRE_INFO_CAPTURECOUNT, &ud->ncapt); + /* need (2 ints per capture, plus one for substring match) * 3/2 */ + ud->match = (int *) Lmalloc (L, (ALG_NSUB(ud) + 1) * 3 * sizeof (int)); + + if (pud) *pud = ud; + return 1; +} + +#if PCRE_MAJOR >= 4 +/* the target table must be on lua stack top */ +static void do_named_subpatterns (lua_State *L, TPcre *ud, const char *text) { + int i, namecount, name_entry_size; + unsigned char *name_table, *tabptr; + + /* do named subpatterns - NJG */ + pcre_fullinfo (ud->pr, ud->extra, PCRE_INFO_NAMECOUNT, &namecount); + if (namecount <= 0) + return; + pcre_fullinfo (ud->pr, ud->extra, PCRE_INFO_NAMETABLE, &name_table); + pcre_fullinfo (ud->pr, ud->extra, PCRE_INFO_NAMEENTRYSIZE, &name_entry_size); + tabptr = name_table; + for (i = 0; i < namecount; i++) { + int n = (tabptr[0] << 8) | tabptr[1]; /* number of the capturing parenthesis */ + if (n > 0 && n <= ALG_NSUB(ud)) { /* check range */ + lua_pushstring (L, (char *)tabptr + 2); /* name of the capture, zero terminated */ + ALG_PUSHSUB_OR_FALSE (L, ud, text, n); + lua_rawset (L, -3); + } + tabptr += name_entry_size; + } +} +#endif /* #if PCRE_MAJOR >= 4 */ + +#if PCRE_MAJOR >= 6 +static int Lpcre_dfa_exec (lua_State *L) +{ + TArgExec argE; + TPcre *ud; + int res; + int *buf, *ovector, *wspace; + + checkarg_dfa_exec (L, &argE, &ud); + buf = (int*) Lmalloc (L, (argE.ovecsize + argE.wscount) * sizeof(int)); + ovector = buf; + wspace = buf + argE.ovecsize; + + res = pcre_dfa_exec (ud->pr, ud->extra, argE.text, (int)argE.textlen, + argE.startoffset, argE.eflags, ovector, argE.ovecsize, wspace, argE.wscount); + + if (ALG_ISMATCH (res) || res == PCRE_ERROR_PARTIAL) { + int i; + int max = (res>0) ? res : (res==0) ? (int)argE.ovecsize/2 : 1; + lua_pushinteger (L, ovector[0] + 1); /* 1-st return value */ + lua_newtable (L); /* 2-nd return value */ + for (i=0; i= 6 */ + +#ifdef ALG_USERETRY + static int gmatch_exec (TUserdata *ud, TArgExec *argE, int retry) { + int eflags = retry ? (argE->eflags|PCRE_NOTEMPTY|PCRE_ANCHORED) : argE->eflags; + return pcre_exec (ud->pr, ud->extra, argE->text, argE->textlen, + argE->startoffset, eflags, ud->match, (ALG_NSUB(ud) + 1) * 3); + } +#else + static int gmatch_exec (TUserdata *ud, TArgExec *argE) { + return pcre_exec (ud->pr, ud->extra, argE->text, argE->textlen, + argE->startoffset, argE->eflags, ud->match, (ALG_NSUB(ud) + 1) * 3); + } +#endif + +static void gmatch_pushsubject (lua_State *L, TArgExec *argE) { + lua_pushlstring (L, argE->text, argE->textlen); +} + +static int findmatch_exec (TPcre *ud, TArgExec *argE) { + return pcre_exec (ud->pr, ud->extra, argE->text, argE->textlen, + argE->startoffset, argE->eflags, ud->match, (ALG_NSUB(ud) + 1) * 3); +} + +#ifdef ALG_USERETRY + static int gsub_exec (TPcre *ud, TArgExec *argE, int st, int retry) { + int eflags = retry ? (argE->eflags|PCRE_NOTEMPTY|PCRE_ANCHORED) : argE->eflags; + return pcre_exec (ud->pr, ud->extra, argE->text, argE->textlen, + st, eflags, ud->match, (ALG_NSUB(ud) + 1) * 3); + } +#else + static int gsub_exec (TPcre *ud, TArgExec *argE, int st) { + return pcre_exec (ud->pr, ud->extra, argE->text, argE->textlen, + st, argE->eflags, ud->match, (ALG_NSUB(ud) + 1) * 3); + } +#endif + +static int split_exec (TPcre *ud, TArgExec *argE, int offset) { + return pcre_exec (ud->pr, ud->extra, argE->text, argE->textlen, offset, + argE->eflags, ud->match, (ALG_NSUB(ud) + 1) * 3); +} + +static int Lpcre_gc (lua_State *L) { + TPcre *ud = check_ud (L); + if (ud->freed == 0) { /* precaution against "manual" __gc calling */ + ud->freed = 1; + if (ud->pr) pcre_free (ud->pr); + if (ud->extra) pcre_free (ud->extra); + if (ud->tables) pcre_free ((void *)ud->tables); + if (ud->match) free (ud->match); + } + return 0; +} + +static int Lpcre_tostring (lua_State *L) { + TPcre *ud = check_ud (L); + if (ud->freed == 0) + lua_pushfstring (L, "%s (%p)", pcre_typename, (void*)ud); + else + lua_pushfstring (L, "%s (deleted)", pcre_typename); + return 1; +} + +static int chartables_tostring (lua_State *L) { + void **ud = check_chartables (L, 1); + lua_pushfstring (L, "%s (%p)", chartables_typename, ud); + return 1; +} + +static int Lpcre_version (lua_State *L) { + lua_pushstring (L, pcre_version ()); + return 1; +} + +static const luaL_reg chartables_meta[] = { + { "__gc", chartables_gc }, + { "__tostring", chartables_tostring }, + { NULL, NULL } +}; + +static const luaL_reg regex_meta[] = { + { "exec", ud_exec }, + { "tfind", ud_tfind }, /* old name: match */ + { "find", ud_find }, + { "match", ud_match }, +#if PCRE_MAJOR >= 6 + { "dfa_exec", Lpcre_dfa_exec }, +#endif + { "__gc", Lpcre_gc }, + { "__tostring", Lpcre_tostring }, + { NULL, NULL } +}; + +static const luaL_reg rexlib[] = { + { "match", match }, + { "find", find }, + { "gmatch", gmatch }, + { "gsub", gsub }, + { "split", split }, + { "new", ud_new }, + { "plainfind", plainfind_func }, + { "flags", Lpcre_get_flags }, + { "version", Lpcre_version }, + { "maketables", Lpcre_maketables }, +#if PCRE_MAJOR >= 4 + { "config", Lpcre_config }, +#endif + { NULL, NULL } +}; + +#endif + +/* Open the library */ +REX_API int REX_OPENLIB (lua_State *L) { +#if defined(LUA_USE_PCRE) + if (PCRE_MAJOR > atoi (pcre_version ())) { + return luaL_error (L, "%s requires at least version %d of PCRE library", + REX_LIBNAME, (int)PCRE_MAJOR); + } + /* create a new function environment to serve as a metatable for methods */ + lua_newtable (L); + lua_pushvalue (L, -1); + lua_replace (L, LUA_ENVIRONINDEX); + lua_pushvalue(L, -1); /* mt.__index = mt */ + lua_setfield(L, -2, "__index"); + luaL_register (L, NULL, regex_meta); + + /* register functions */ + luaL_register (L, REX_LIBNAME, rexlib); + lua_pushliteral (L, REX_VERSION" (for PCRE)"); + lua_setfield (L, -2, "_VERSION"); + + /* create a table and register it as a metatable for "chartables" userdata */ + lua_pushinteger (L, INDEX_CHARTABLES_META); + lua_newtable (L); + lua_pushliteral (L, "access denied"); + lua_setfield (L, -2, "__metatable"); + luaL_register (L, NULL, chartables_meta); + lua_rawset (L, LUA_ENVIRONINDEX); + + /* create a table for connecting "chartables" userdata to "regex" userdata */ + lua_pushinteger (L, INDEX_CHARTABLES_LINK); + lua_newtable (L); + lua_pushliteral (L, "k"); /* weak keys */ + lua_setfield (L, -2, "__mode"); + lua_pushvalue (L, -1); /* setmetatable (tb, tb) */ + lua_setmetatable (L, -2); + lua_rawset (L, LUA_ENVIRONINDEX); +#endif + return 1; +} + diff --git a/rpm-5.4.9/lua/local/lrexlib_lpcre_f.c b/rpm-5.4.9/lua/local/lrexlib_lpcre_f.c new file mode 100644 index 0000000..fe0761b --- /dev/null +++ b/rpm-5.4.9/lua/local/lrexlib_lpcre_f.c @@ -0,0 +1,196 @@ +/* lpcre.c - PCRE regular expression library */ +/* See Copyright Notice in the file LICENSE */ + +#if defined(LUA_USE_PCRE) + +#include +#include "lua.h" +#include "lauxlib.h" +#include "lrexlib_common.h" + +int Lpcre_get_flags (lua_State *L); +int Lpcre_config (lua_State *L); + +#define VERSION_PCRE (PCRE_MAJOR*100 + PCRE_MINOR) + +static flag_pair pcre_flags[] = { + { "MAJOR", PCRE_MAJOR }, + { "MINOR", PCRE_MINOR }, +/*---------------------------------------------------------------------------*/ + { "CASELESS", PCRE_CASELESS }, + { "MULTILINE", PCRE_MULTILINE }, + { "DOTALL", PCRE_DOTALL }, + { "EXTENDED", PCRE_EXTENDED }, + { "ANCHORED", PCRE_ANCHORED }, + { "DOLLAR_ENDONLY", PCRE_DOLLAR_ENDONLY }, + { "EXTRA", PCRE_EXTRA }, + { "NOTBOL", PCRE_NOTBOL }, + { "NOTEOL", PCRE_NOTEOL }, + { "UNGREEDY", PCRE_UNGREEDY }, + { "NOTEMPTY", PCRE_NOTEMPTY }, + { "UTF8", PCRE_UTF8 }, +#if VERSION_PCRE >= 400 + { "NO_AUTO_CAPTURE", PCRE_NO_AUTO_CAPTURE }, + { "NO_UTF8_CHECK", PCRE_NO_UTF8_CHECK }, +#endif +#if VERSION_PCRE >= 500 + { "AUTO_CALLOUT", PCRE_AUTO_CALLOUT }, + { "PARTIAL", PCRE_PARTIAL }, +#endif +#if VERSION_PCRE >= 600 + { "DFA_SHORTEST", PCRE_DFA_SHORTEST }, + { "DFA_RESTART", PCRE_DFA_RESTART }, + { "FIRSTLINE", PCRE_FIRSTLINE }, +#endif +#if VERSION_PCRE >= 607 + { "DUPNAMES", PCRE_DUPNAMES }, + { "NEWLINE_CR", PCRE_NEWLINE_CR }, + { "NEWLINE_LF", PCRE_NEWLINE_LF }, + { "NEWLINE_CRLF", PCRE_NEWLINE_CRLF }, +#endif +#if VERSION_PCRE >= 700 + { "NEWLINE_ANY", PCRE_NEWLINE_ANY }, +#endif +#if VERSION_PCRE >= 701 + { "NEWLINE_ANYCRLF", PCRE_NEWLINE_ANYCRLF }, +#endif +#if VERSION_PCRE >= 704 + { "BSR_ANYCRLF", PCRE_BSR_ANYCRLF }, + { "BSR_UNICODE", PCRE_BSR_UNICODE }, +#endif +#if VERSION_PCRE >= 707 + { "JAVASCRIPT_COMPAT", PCRE_JAVASCRIPT_COMPAT }, +#endif +/*---------------------------------------------------------------------------*/ + { "INFO_OPTIONS", PCRE_INFO_OPTIONS }, + { "INFO_SIZE", PCRE_INFO_SIZE }, + { "INFO_CAPTURECOUNT", PCRE_INFO_CAPTURECOUNT }, + { "INFO_BACKREFMAX", PCRE_INFO_BACKREFMAX }, +#if VERSION_PCRE >= 400 + { "INFO_FIRSTBYTE", PCRE_INFO_FIRSTBYTE }, +#endif + { "INFO_FIRSTCHAR", PCRE_INFO_FIRSTCHAR }, + { "INFO_FIRSTTABLE", PCRE_INFO_FIRSTTABLE }, + { "INFO_LASTLITERAL", PCRE_INFO_LASTLITERAL }, +#if VERSION_PCRE >= 400 + { "INFO_NAMEENTRYSIZE", PCRE_INFO_NAMEENTRYSIZE }, + { "INFO_NAMECOUNT", PCRE_INFO_NAMECOUNT }, + { "INFO_NAMETABLE", PCRE_INFO_NAMETABLE }, + { "INFO_STUDYSIZE", PCRE_INFO_STUDYSIZE }, +#endif +#if VERSION_PCRE >= 500 + { "INFO_DEFAULT_TABLES", PCRE_INFO_DEFAULT_TABLES }, +#endif +#ifdef PCRE_INFO_OKPARTIAL + { "INFO_OKPARTIAL", PCRE_INFO_OKPARTIAL }, +#endif +#ifdef PCRE_INFO_JCHANGED + { "INFO_JCHANGED", PCRE_INFO_JCHANGED }, +#endif +#ifdef PCRE_INFO_HASCRORLF + { "INFO_HASCRORLF", PCRE_INFO_HASCRORLF }, +#endif +/*---------------------------------------------------------------------------*/ +#if VERSION_PCRE >= 400 + { "EXTRA_STUDY_DATA", PCRE_EXTRA_STUDY_DATA }, + { "EXTRA_MATCH_LIMIT", PCRE_EXTRA_MATCH_LIMIT }, + { "EXTRA_CALLOUT_DATA", PCRE_EXTRA_CALLOUT_DATA }, +#endif +#if VERSION_PCRE >= 500 + { "EXTRA_TABLES", PCRE_EXTRA_TABLES }, +#endif +#ifdef PCRE_EXTRA_MATCH_LIMIT_RECURSION + { "EXTRA_MATCH_LIMIT_RECURSION", PCRE_EXTRA_MATCH_LIMIT_RECURSION }, +#endif +/*---------------------------------------------------------------------------*/ + { NULL, 0 } +}; + +flag_pair pcre_error_flags[] = { + { "ERROR_NOMATCH", PCRE_ERROR_NOMATCH }, + { "ERROR_NULL", PCRE_ERROR_NULL }, + { "ERROR_BADOPTION", PCRE_ERROR_BADOPTION }, + { "ERROR_BADMAGIC", PCRE_ERROR_BADMAGIC }, +#if VERSION_PCRE >= 700 + { "ERROR_UNKNOWN_OPCODE", PCRE_ERROR_UNKNOWN_OPCODE }, +#endif + { "ERROR_UNKNOWN_NODE", PCRE_ERROR_UNKNOWN_NODE }, + { "ERROR_NOMEMORY", PCRE_ERROR_NOMEMORY }, + { "ERROR_NOSUBSTRING", PCRE_ERROR_NOSUBSTRING }, +#if VERSION_PCRE >= 400 + { "ERROR_MATCHLIMIT", PCRE_ERROR_MATCHLIMIT }, + { "ERROR_CALLOUT", PCRE_ERROR_CALLOUT }, + { "ERROR_BADUTF8", PCRE_ERROR_BADUTF8 }, + { "ERROR_BADUTF8_OFFSET", PCRE_ERROR_BADUTF8_OFFSET }, +#endif +#if VERSION_PCRE >= 500 + { "ERROR_PARTIAL", PCRE_ERROR_PARTIAL }, + { "ERROR_BADPARTIAL", PCRE_ERROR_BADPARTIAL }, + { "ERROR_INTERNAL", PCRE_ERROR_INTERNAL }, + { "ERROR_BADCOUNT", PCRE_ERROR_BADCOUNT }, +#endif +#if VERSION_PCRE >= 600 + { "ERROR_DFA_UITEM", PCRE_ERROR_DFA_UITEM }, + { "ERROR_DFA_UCOND", PCRE_ERROR_DFA_UCOND }, + { "ERROR_DFA_UMLIMIT", PCRE_ERROR_DFA_UMLIMIT }, + { "ERROR_DFA_WSSIZE", PCRE_ERROR_DFA_WSSIZE }, + { "ERROR_DFA_RECURSE", PCRE_ERROR_DFA_RECURSE }, +#endif +#if VERSION_PCRE >= 607 + { "ERROR_RECURSIONLIMIT", PCRE_ERROR_RECURSIONLIMIT }, +#endif +#if VERSION_PCRE >= 700 + { "ERROR_BADNEWLINE", PCRE_ERROR_BADNEWLINE }, +#endif +#ifdef PCRE_ERROR_NULLWSLIMIT + { "ERROR_NULLWSLIMIT", PCRE_ERROR_NULLWSLIMIT }, +#endif +/*---------------------------------------------------------------------------*/ + { NULL, 0 } +}; + +#if VERSION_PCRE >= 400 +static flag_pair pcre_config_flags[] = { + { "CONFIG_UTF8", PCRE_CONFIG_UTF8 }, + { "CONFIG_NEWLINE", PCRE_CONFIG_NEWLINE }, + { "CONFIG_LINK_SIZE", PCRE_CONFIG_LINK_SIZE }, + { "CONFIG_POSIX_MALLOC_THRESHOLD", PCRE_CONFIG_POSIX_MALLOC_THRESHOLD }, + { "CONFIG_MATCH_LIMIT", PCRE_CONFIG_MATCH_LIMIT }, + { "CONFIG_STACKRECURSE", PCRE_CONFIG_STACKRECURSE }, +#if VERSION_PCRE >= 500 + { "CONFIG_UNICODE_PROPERTIES", PCRE_CONFIG_UNICODE_PROPERTIES }, +#endif +#if VERSION_PCRE >= 650 + { "CONFIG_MATCH_LIMIT_RECURSION", PCRE_CONFIG_MATCH_LIMIT_RECURSION }, +#endif +#if VERSION_PCRE >= 704 + { "CONFIG_BSR", PCRE_CONFIG_BSR }, +#endif +/*---------------------------------------------------------------------------*/ + { NULL, 0 } +}; + +int Lpcre_config (lua_State *L) { + int val; + flag_pair *fp; + if (lua_istable (L, 1)) + lua_settop (L, 1); + else + lua_newtable (L); + for (fp = pcre_config_flags; fp->key; ++fp) { + if (0 == pcre_config (fp->val, &val)) { + lua_pushinteger (L, val); + lua_setfield (L, -2, fp->key); + } + } + return 1; +} +#endif /* #if VERSION_PCRE >= 400 */ + +int Lpcre_get_flags (lua_State *L) { + const flag_pair* fps[] = { pcre_flags, pcre_error_flags, NULL }; + return get_flags (L, fps); +} + +#endif + diff --git a/rpm-5.4.9/lua/local/lrexlib_lposix.c b/rpm-5.4.9/lua/local/lrexlib_lposix.c new file mode 100644 index 0000000..64d5771 --- /dev/null +++ b/rpm-5.4.9/lua/local/lrexlib_lposix.c @@ -0,0 +1,301 @@ +/* lposix.c - Lua binding of POSIX regular expressions library */ +/* See Copyright Notice in the file LICENSE */ + +#ifndef REX_LIBNAME +# define REX_LIBNAME "rex_posix" +#endif +#ifndef REX_OPENLIB +# define REX_OPENLIB luaopen_rex_posix +#endif + +#include +#include +#include + +#include "lua.h" +#include "lauxlib.h" +#include "lrexlib.h" +#include "lrexlib_common.h" + +#if defined(LUA_USE_POSIX) + +#ifndef REX_POSIX_INCLUDE +# include +#else +# include REX_POSIX_INCLUDE +#endif + +/* Test if regex.h corresponds to the extended POSIX library, i.e. H.Spencer's. + This test may not work as intended if regex.h introduced REG_BASIC, etc. + via enum rather than #define. + If that's the case, add -DREX_POSIX_EXT in the makefile/command line. +*/ +#ifndef REX_POSIX_EXT +# if defined(REG_BASIC) && defined(REG_STARTEND) +# define REX_POSIX_EXT +# endif +#endif + +#define ALG_CFLAGS_DFLT REG_EXTENDED +#ifdef REX_POSIX_EXT +# define ALG_EFLAGS_DFLT REG_STARTEND +#else +# define ALG_EFLAGS_DFLT 0 +#endif + +#define ALG_NOMATCH REG_NOMATCH +#define ALG_ISMATCH(res) ((res) == 0) +#define ALG_SUBBEG(ud,n) ud->match[n].rm_so +#define ALG_SUBEND(ud,n) ud->match[n].rm_eo +#define ALG_SUBLEN(ud,n) (ALG_SUBEND(ud,n) - ALG_SUBBEG(ud,n)) +#define ALG_SUBVALID(ud,n) (ALG_SUBBEG(ud,n) >= 0) +#ifdef REX_NSUB_BASE1 +# define ALG_NSUB(ud) ((int)ud->r.re_nsub - 1) +#else +# define ALG_NSUB(ud) ((int)ud->r.re_nsub) +#endif + +#define ALG_PUSHSUB(L,ud,text,n) \ + lua_pushlstring (L, (text) + ALG_SUBBEG(ud,n), ALG_SUBLEN(ud,n)) + +#define ALG_PUSHSUB_OR_FALSE(L,ud,text,n) \ + (ALG_SUBVALID(ud,n) ? ALG_PUSHSUB (L,ud,text,n) : lua_pushboolean (L,0)) + +#define ALG_PUSHSTART(L,ud,offs,n) lua_pushinteger(L, (offs) + ALG_SUBBEG(ud,n) + 1) +#define ALG_PUSHEND(L,ud,offs,n) lua_pushinteger(L, (offs) + ALG_SUBEND(ud,n)) +#define ALG_PUSHOFFSETS(L,ud,offs,n) \ + (ALG_PUSHSTART(L,ud,offs,n), ALG_PUSHEND(L,ud,offs,n)) + +#define ALG_BASE(st) (st) +#define ALG_GETCFLAGS(L,pos) luaL_optint(L, pos, ALG_CFLAGS_DFLT) + +typedef struct { + regex_t r; + regmatch_t * match; + int freed; +} TPosix; + +#define TUserdata TPosix + +const char posix_typename[] = REX_LIBNAME"_regex"; + +#include "lrexlib_algo.h" + +/* Functions + ****************************************************************************** + */ + +static int generate_error (lua_State *L, const TPosix *ud, int errcode) { + char errbuf[80]; + regerror (errcode, &ud->r, errbuf, sizeof (errbuf)); + return luaL_error (L, "%s", errbuf); +} + +static int compile_regex (lua_State *L, const TArgComp *argC, TPosix **pud) { + int res; + TPosix *ud; + + ud = (TPosix *)lua_newuserdata (L, sizeof (TPosix)); + memset (ud, 0, sizeof (TPosix)); /* initialize all members to 0 */ + +#ifdef REX_POSIX_EXT + if (argC->cflags & REG_PEND) + ud->r.re_endp = argC->pattern + argC->patlen; +#endif + + res = regcomp (&ud->r, argC->pattern, argC->cflags); + if (res != 0) + return generate_error (L, ud, res); + + if (argC->cflags & REG_NOSUB) + ud->r.re_nsub = 0; + ud->match = (regmatch_t *) Lmalloc (L, (ALG_NSUB(ud) + 1) * sizeof (regmatch_t)); + lua_pushvalue (L, LUA_ENVIRONINDEX); + lua_setmetatable (L, -2); + + if (pud) *pud = ud; + return 1; +} + +#ifdef REX_POSIX_EXT +static void CheckStartEnd (TArgExec *argE, TPosix *ud) { + if (argE->eflags & REG_STARTEND) { + ud->match[0].rm_so = argE->startoffset; + ud->match[0].rm_eo = argE->textlen; + argE->startoffset = 0; + } + else + argE->text += argE->startoffset; +} +#endif + +static int gmatch_exec (TUserdata *ud, TArgExec *argE) { + if (argE->startoffset > 0) + argE->eflags |= REG_NOTBOL; + +#ifdef REX_POSIX_EXT + if (argE->eflags & REG_STARTEND) { + ALG_SUBBEG(ud,0) = 0; + ALG_SUBEND(ud,0) = argE->textlen - argE->startoffset; + } +#endif + + argE->text += argE->startoffset; + return regexec (&ud->r, argE->text, ALG_NSUB(ud) + 1, ud->match, argE->eflags); +} + +static void gmatch_pushsubject (lua_State *L, TArgExec *argE) { +#ifdef REX_POSIX_EXT + if (argE->eflags & REG_STARTEND) + lua_pushlstring (L, argE->text, argE->textlen); + else + lua_pushlstring (L, argE->text, strlen (argE->text)); +#else + lua_pushlstring (L, argE->text, strlen (argE->text)); +#endif +} + +static int findmatch_exec (TPosix *ud, TArgExec *argE) { +#ifdef REX_POSIX_EXT + CheckStartEnd (argE, ud); +#else + argE->text += argE->startoffset; +#endif + return regexec (&ud->r, argE->text, ALG_NSUB(ud) + 1, ud->match, argE->eflags); +} + +static int gsub_exec (TPosix *ud, TArgExec *argE, int st) { +#ifdef REX_POSIX_EXT + if(argE->eflags & REG_STARTEND) { + ALG_SUBBEG(ud,0) = 0; + ALG_SUBEND(ud,0) = argE->textlen - st; + } +#endif + if (st > 0) + argE->eflags |= REG_NOTBOL; + return regexec (&ud->r, argE->text+st, ALG_NSUB(ud)+1, ud->match, argE->eflags); +} + +static int split_exec (TPosix *ud, TArgExec *argE, int offset) { +#ifdef REX_POSIX_EXT + if (argE->eflags & REG_STARTEND) { + ALG_SUBBEG(ud,0) = 0; + ALG_SUBEND(ud,0) = argE->textlen - offset; + } +#endif + if (offset > 0) + argE->eflags |= REG_NOTBOL; + + return regexec (&ud->r, argE->text + offset, ALG_NSUB(ud) + 1, ud->match, argE->eflags); +} + +static int Posix_gc (lua_State *L) { + TPosix *ud = check_ud (L); + if (ud->freed == 0) { /* precaution against "manual" __gc calling */ + ud->freed = 1; + regfree (&ud->r); + if (ud->match) + free (ud->match); + } + return 0; +} + +static int Posix_tostring (lua_State *L) { + TPosix *ud = check_ud (L); + if (ud->freed == 0) + lua_pushfstring (L, "%s (%p)", posix_typename, (void*)ud); + else + lua_pushfstring (L, "%s (deleted)", posix_typename); + return 1; +} + +static flag_pair posix_flags[] = +{ +#ifdef REX_POSIX_EXT + { "BASIC", REG_BASIC }, + { "NOSPEC", REG_NOSPEC }, + { "PEND", REG_PEND }, + { "STARTEND", REG_STARTEND }, +#endif + { "EXTENDED", REG_EXTENDED }, + { "ICASE", REG_ICASE }, + { "NOSUB", REG_NOSUB }, + { "NEWLINE", REG_NEWLINE }, + { "NOTBOL", REG_NOTBOL }, + { "NOTEOL", REG_NOTEOL }, +/*---------------------------------------------------------------------------*/ + { NULL, 0 } +}; + +static flag_pair posix_error_flags[] = { + { "NOMATCH", REG_NOMATCH }, + { "BADPAT", REG_BADPAT }, + { "ECOLLATE", REG_ECOLLATE }, + { "ECTYPE", REG_ECTYPE }, + { "EESCAPE", REG_EESCAPE }, + { "ESUBREG", REG_ESUBREG }, + { "EBRACK", REG_EBRACK }, + { "EPAREN", REG_EPAREN }, + { "EBRACE", REG_EBRACE }, + { "BADBR", REG_BADBR }, + { "ERANGE", REG_ERANGE }, + { "ESPACE", REG_ESPACE }, + { "BADRPT", REG_BADRPT }, +#ifdef REX_POSIX_EXT + { "EMPTY", REG_EMPTY }, + { "ASSERT", REG_ASSERT }, + { "INVARG", REG_INVARG }, +#endif +/*---------------------------------------------------------------------------*/ + { NULL, 0 } +}; + +static int Posix_get_flags (lua_State *L) { + const flag_pair* fps[] = { posix_flags, posix_error_flags, NULL }; + return get_flags (L, fps); +} + +static const luaL_reg posixmeta[] = { + { "exec", ud_exec }, + { "tfind", ud_tfind }, /* old match */ + { "find", ud_find }, + { "match", ud_match }, + { "__gc", Posix_gc }, + { "__tostring", Posix_tostring }, + { NULL, NULL} +}; + +static const luaL_reg rexlib[] = { + { "match", match }, + { "find", find }, + { "gmatch", gmatch }, + { "gsub", gsub }, + { "split", split }, + { "new", ud_new }, + { "flags", Posix_get_flags }, + { "plainfind", plainfind_func }, + { NULL, NULL } +}; + +#endif + +/* Open the library */ +REX_API int REX_OPENLIB (lua_State *L) +{ +#if defined(LUA_USE_POSIX) + /* create a new function environment to serve as a metatable for methods */ + lua_newtable (L); + lua_pushvalue (L, -1); + lua_replace (L, LUA_ENVIRONINDEX); + lua_pushvalue(L, -1); /* mt.__index = mt */ + lua_setfield(L, -2, "__index"); + luaL_register (L, NULL, posixmeta); + + /* register functions */ + luaL_register (L, REX_LIBNAME, rexlib); + lua_pushliteral (L, REX_VERSION" (for POSIX regexes)"); + lua_setfield (L, -2, "_VERSION"); +#endif + return 1; +} + diff --git a/rpm-5.4.9/lua/local/lshadow.c b/rpm-5.4.9/lua/local/lshadow.c new file mode 100644 index 0000000..fb36dc2 --- /dev/null +++ b/rpm-5.4.9/lua/local/lshadow.c @@ -0,0 +1,151 @@ +/* +** $Id: lshadow.c,v 1.6 2008/08/20 07:08:28 rse Exp $ +** Shadow utilities +*/ + + +#include +#include +#include + +#define lshadow_c + +#include "lua.h" + +#include "lauxlib.h" +#include "lshadow.h" + +extern int useradd_main (int argc, char **argv); +extern int chkconfig_main (int argc, char **argv); + +#if defined(USE_LUA_SHADOW) || defined(USE_LUA_CHKCONFIG) +static int lcl_makeArgv(char *in, char **argv, int max) + { + int i; + char delim = ' '; + char *start = NULL; + char c; + + printf("Parsing [%s]\n", in); + + for ( i=0; i < max; ++i) + { + while (*in == ' ') ++in; /* skip spaces */ + if (!*in) return i; /* ignore traing spaces */ + if (*in == '"') delim = *in++; /* begin a quoted string */ + start = in; /* beginning of token */ + for ( c = *in; c != delim && c; c = *in) ++in; /* find end of token */ + *in++ = '\0'; /* mark end */ + *(argv+i) = start; /* might be 0 length! */ + if (!c) return i+1; /* end of input string */ + delim = ' '; + } + return -1; + } +#endif + +static int shadow_version (lua_State *L) + /*@globals internalState @*/ + /*@modifies L, internalState @*/ +{ + printf("version 6\n"); + return 0; +} + +#ifdef USE_LUA_SHADOW +static int shadow_groupadd (lua_State *L) + /*@globals internalState @*/ + /*@modifies L, internalState @*/ +{ + int argc; + char *argv[32]; /* yeah, well, this is big enough */ + char *cmdline; /* copy string from lua just to be safe */ + + argc = lua_gettop(L); /* number of arguments */ + if (argc != 1) return luaL_error(L, "One argument is required!"); + + cmdline = strdup(luaL_checklstring(L, 1, NULL)); /* we don't need the size */ + + argc = 1 + lcl_makeArgv(cmdline, argv+1, 31); + + argv[0] = "rpm_lua"; /* make up a program name */ + + useradd_main(argc, argv); + + free(cmdline); + return 0; +} + +static int shadow_useradd (lua_State *L) + /*@globals internalState @*/ + /*@modifies L, internalState @*/ +{ + int argc; + char *argv[32]; /* yeah, well, this is big enough */ + char *cmdline; /* copy string from lua just to be safe */ + + argc = lua_gettop(L); /* number of arguments */ + if (argc != 1) return luaL_error(L, "One argument is required!"); + + cmdline = strdup(luaL_checklstring(L, 1, NULL)); /* we don't need the size */ + + argc = 1 + lcl_makeArgv(cmdline, argv+1, 31); + + argv[0] = "rpm_lua"; /* make up a program name */ + + useradd_main(argc, argv); + + free(cmdline); + return 0; +} +#endif /* USE_LUA_SHADOW */ + +#ifdef USE_LUA_CHKCONFIG +static int shadow_chkconfig (lua_State *L) + /*@globals internalState @*/ + /*@modifies L, internalState @*/ +{ + int argc; + char *argv[32]; /* yeah, well, this is big enough */ + char *cmdline; /* copy string from lua just to be safe */ + + argc = lua_gettop(L); /* number of arguments */ + if (argc != 1) return luaL_error(L, "One argument is required!"); + + cmdline = strdup(luaL_checklstring(L, 1, NULL)); /* we don't need the size */ + + argc = 1 + lcl_makeArgv(cmdline, argv+1, 31); + + argv[0] = "rpm_lua"; /* make up a program name */ + + chkconfig_main(argc, argv); + + free(cmdline); + return 0; +} +#endif /* USE_LUA_CHKCONFIG */ + +/*@-readonlytrans@*/ +/*@unchecked@*/ +static const luaL_reg shadow[] = { + {"version", shadow_version}, +#ifdef USE_LUA_SHADOW + {"groupadd", shadow_groupadd}, + {"useradd", shadow_useradd}, +#endif +#ifdef USE_LUA_CHKCONFIG + {"chkconfig", shadow_chkconfig}, +#endif + {NULL, NULL} +}; +/*@=readonlytrans@*/ + + +/* +** Open shadow library +*/ +LUALIB_API int luaopen_shadow (lua_State *L) { + luaL_openlib(L, "shadow", shadow, 0); + return 1; +} + diff --git a/rpm-5.4.9/lua/local/lshadow.h b/rpm-5.4.9/lua/local/lshadow.h new file mode 100644 index 0000000..f75bd3a --- /dev/null +++ b/rpm-5.4.9/lua/local/lshadow.h @@ -0,0 +1,7 @@ +#ifndef LSHADOW_H +#define LSHADOW_H + +int luaopen_shadow(lua_State *L) + /*@modifies L @*/; + +#endif diff --git a/rpm-5.4.9/lua/local/lsyck.c b/rpm-5.4.9/lua/local/lsyck.c new file mode 100644 index 0000000..f38e8ce --- /dev/null +++ b/rpm-5.4.9/lua/local/lsyck.c @@ -0,0 +1,256 @@ +/* + * lsyck.c + * + * Copyright (C) 2005 Zachary P. Landau + */ + +#include +#include +#include + +#include "lauxlib.h" +#include "lua.h" +#include "lualib.h" +#include "lsyck.h" + +struct emitter_xtra { + lua_State *L; + luaL_Buffer output; + int id; +}; + +struct parser_xtra { + lua_State *L; +}; + +SYMID +lua_syck_parser_handler(SyckParser *p, SyckNode *n) +{ + struct parser_xtra *bonus = (struct parser_xtra *)p->bonus; + int o, o2, o3 = -1; + SYMID oid; + int i; + + switch (n->kind) { + case syck_str_kind: + if (n->type_id == NULL || strcmp(n->type_id, "str") == 0) { + lua_pushlstring(bonus->L, n->data.str->ptr, n->data.str->len); + o = lua_gettop(bonus->L); + } + else if (strcmp(n->type_id, "null") == 0) + { + lua_pushnil(bonus->L); + o = lua_gettop(bonus->L); + } + else if (strcmp(n->type_id, "bool#yes") == 0) + { + lua_pushboolean(bonus->L, 1); + o = lua_gettop(bonus->L); + } + else if (strcmp(n->type_id, "bool#no") == 0) + { + lua_pushboolean(bonus->L, 0); + o = lua_gettop(bonus->L); + } + else if (strcmp(n->type_id, "int#hex") == 0) + { + long intVal = strtol(n->data.str->ptr, NULL, 16); + lua_pushnumber(bonus->L, intVal); + o = lua_gettop(bonus->L); + } + else if (strcmp(n->type_id, "int") == 0) + { + long intVal = strtol(n->data.str->ptr, NULL, 10); + lua_pushnumber(bonus->L, intVal); + o = lua_gettop(bonus->L); + } + else + { + lua_pushlstring(bonus->L, n->data.str->ptr, n->data.str->len); + o = lua_gettop(bonus->L); + } + break; + + case syck_seq_kind: + lua_newtable(bonus->L); + o = lua_gettop(bonus->L); + for ( i=0; i < n->data.list->idx; i++ ) + { + oid = syck_seq_read(n, i); + syck_lookup_sym(p, oid, (char **)&o2); + lua_pushvalue(bonus->L, o2); + lua_rawseti(bonus->L, o, i+1); + } + break; + + case syck_map_kind: + lua_newtable(bonus->L); + o = lua_gettop(bonus->L); + for ( i=0; i < n->data.pairs->idx; i++ ) + { + oid = syck_map_read(n, map_key, i); + syck_lookup_sym(p, oid, (char **)&o2); + oid = syck_map_read(n, map_value, i); + syck_lookup_sym(p, oid, (char **)&o3); + + lua_pushvalue(bonus->L, o2); + lua_pushvalue(bonus->L, o3); + lua_settable(bonus->L, o); + } + break; + } + oid = syck_add_sym(p, (char *)o); + return oid; +} + +void lua_syck_emitter_handler(SyckEmitter *e, st_data_t data) +{ + struct emitter_xtra *bonus = (struct emitter_xtra *)e->bonus; + int type = lua_type(bonus->L, -1); + char buf[30]; /* find a better way, if possible */ + + switch (type) + { + case LUA_TBOOLEAN: + if (lua_toboolean(bonus->L, -1)) + strcpy(buf, "true"); + else + strcpy(buf, "false"); + syck_emit_scalar(e, "boolean", scalar_none, 0, 0, 0, (char *)buf, strlen(buf)); + break; + case LUA_TSTRING: + syck_emit_scalar(e, "string", scalar_none, 0, 0, 0, (char *)lua_tostring(bonus->L, -1), lua_strlen(bonus->L, -1)); + break; + case LUA_TNUMBER: + /* should handle floats as well */ + snprintf(buf, sizeof(buf), "%i", (int)lua_tonumber(bonus->L, -1)); + syck_emit_scalar(e, "number", scalar_none, 0, 0, 0, buf, strlen(buf)); + break; + case LUA_TTABLE: + if (luaL_getn(bonus->L, -1) > 0) { /* treat it as an array */ + syck_emit_seq(e, "table", seq_none); + lua_pushnil(bonus->L); /* first key */ + while (lua_next(bonus->L, -2) != 0) { + /* `key' is at index -2 and `value' at index -1 */ + syck_emit_item(e, bonus->id++); + lua_pop(bonus->L, 1); /* removes `value'; keeps `key' for next iteration */ + + } + syck_emit_end(e); + } else { /* treat it as a map */ + syck_emit_map(e, "table", map_none); + lua_pushnil(bonus->L); + while (lua_next(bonus->L, -2) != 0) { + lua_pushvalue(bonus->L, -2); + syck_emit_item(e, bonus->id++); + lua_pop(bonus->L, 1); + syck_emit_item(e, bonus->id++); + lua_pop(bonus->L, 1); + } + syck_emit_end(e); + } + break; + } + + bonus->id++; +} + +static void lua_syck_mark_emitter(SyckEmitter *e, int idx) +{ + struct emitter_xtra *bonus = (struct emitter_xtra *)e->bonus; + int type = lua_type(bonus->L, idx); + + switch (type) { + case LUA_TTABLE: + lua_pushnil(bonus->L); /* first key */ + while (lua_next(bonus->L, -2) != 0) { + /* `key' is at index -2 and `value' at index -1 */ + //syck_emitter_mark_node(e, bonus->id++); + syck_emitter_mark_node(e, bonus->id++); + lua_syck_mark_emitter(e, -1); + lua_pop(bonus->L, 1); + } + break; + default: + syck_emitter_mark_node(e, bonus->id++); + break; + } +} + + +void lua_syck_output_handler(SyckEmitter *e, char *str, long len) +{ + struct emitter_xtra *bonus = (struct emitter_xtra *)e->bonus; + luaL_addlstring(&bonus->output, str, len); +} + +static int syck_load(lua_State *L) +{ + struct parser_xtra *bonus; + SyckParser *parser; + SYMID v; + int obj; + + if (!luaL_checkstring(L, 1)) + luaL_typerror(L, 1, "string"); + + parser = syck_new_parser(); + parser->bonus = S_ALLOC_N(struct emitter_xtra, 1); + + bonus = (struct parser_xtra *)parser->bonus; + bonus->L = lua_newthread(L); + + syck_parser_str(parser, (char *)lua_tostring(L, 1), lua_strlen(L, 1), NULL); + syck_parser_handler(parser, lua_syck_parser_handler); + v = syck_parse(parser); + syck_lookup_sym(parser, v, (char **)&obj); + + syck_free_parser(parser); + + lua_xmove(bonus->L, L, 1); + + return 1; +} + +static int syck_dump(lua_State *L) +{ + SyckEmitter *emitter; + struct emitter_xtra *bonus; + + emitter = syck_new_emitter(); + emitter->bonus = S_ALLOC_N(struct emitter_xtra, 1); + + bonus = (struct emitter_xtra *)emitter->bonus; + bonus->L = lua_newthread(L); + luaL_buffinit(L, &bonus->output); + + syck_emitter_handler(emitter, lua_syck_emitter_handler); + syck_output_handler(emitter, lua_syck_output_handler); + + lua_pushvalue(L, -2); + lua_xmove(L, bonus->L, 1); + + bonus->id = 1; + lua_syck_mark_emitter(emitter, bonus->id); + + bonus->id = 1; + syck_emit(emitter, bonus->id); + syck_emitter_flush(emitter, 0); + + luaL_pushresult(&bonus->output); + syck_free_emitter(emitter); + + return 1; +} + +static const luaL_reg sycklib[] = { + {"load", syck_load }, + {"dump", syck_dump }, + {NULL, NULL} +}; + +LUALIB_API int luaopen_syck(lua_State *L) +{ + luaL_openlib(L, "syck", sycklib, 0); + return 1; +} diff --git a/rpm-5.4.9/lua/local/lsyck.h b/rpm-5.4.9/lua/local/lsyck.h new file mode 100644 index 0000000..8638c46 --- /dev/null +++ b/rpm-5.4.9/lua/local/lsyck.h @@ -0,0 +1,7 @@ +#ifndef LSYCK_H +#define LSYCK_H + +int luaopen_syck(lua_State *L) + /*@modifies L @*/; + +#endif diff --git a/rpm-5.4.9/lua/local/luuid.c b/rpm-5.4.9/lua/local/luuid.c new file mode 100644 index 0000000..9823a09 --- /dev/null +++ b/rpm-5.4.9/lua/local/luuid.c @@ -0,0 +1,156 @@ +/* + * luuid.c -- minimum OSSP uuid based UUID extension for RPM Lua + * Copyright (C) 2008 Ralf S. Engelschall + * Licensed under LGPL. + */ + +/* NOTICE: This is NOT a general Lua binding for OSSP uuid! + Instead it provides just the minimum functionality to generate a + UUID (output in string representation) and to retrieve a textual + description of a UUID (input in string representation). */ + +#include "config.h" + +#include +#include +#include + +#include "lua.h" +#include "lauxlib.h" +#include "luuid.h" + +#ifdef LUA_USE_UUID + +#include "uuid.h" + +/* Lua method: = uuid.generate([, , ]) */ +static int luuid_generate(lua_State *L) +{ + uuid_t *uuid; + uuid_t *uuid_ns = NULL; + const char *uuid_ns_str; + const char *data = NULL; + uuid_rc_t rc; + int version; + char result_buf[UUID_LEN_STR+1]; + char *result_ptr; + size_t result_len; + + /* fetch arguments */ + if (lua_isnumber(L, 1)) + version = lua_tointeger(L, 1); + else + return luaL_argerror(L, 1, "UUID version number"); + if (!(version == 1 || (version >= 3 && version <= 5))) + return luaL_argerror(L, 1, "UUID version number"); + if (version == 3 || version == 5) { + if (lua_isstring(L, 2)) + uuid_ns_str = lua_tostring(L, 2); + else + return luaL_argerror(L, 2, "namespace UUID"); + if (lua_isstring(L, 3)) + data = lua_tostring(L, 3); + else + return luaL_argerror(L, 3, "plaintext data"); + if ((rc = uuid_create(&uuid_ns)) != UUID_RC_OK) + return luaL_error(L, "failed to create UUID NS object: %s", uuid_error(rc)); + if ((rc = uuid_load(uuid_ns, uuid_ns_str)) != UUID_RC_OK) + if ((rc = uuid_import(uuid_ns, UUID_FMT_STR, uuid_ns_str, strlen(uuid_ns_str))) != UUID_RC_OK) + return luaL_error(L, "failed to import UUID NS object: %s", uuid_error(rc)); + } + + /* create UUID object */ + if ((rc = uuid_create(&uuid)) != UUID_RC_OK) + return luaL_error(L, "failed to create UUID object: %s", uuid_error(rc)); + + /* generate UUID */ + if (version == 1) + rc = uuid_make(uuid, UUID_MAKE_V1); + else if (version == 3) + rc = uuid_make(uuid, UUID_MAKE_V3, uuid_ns, data); + else if (version == 4) + rc = uuid_make(uuid, UUID_MAKE_V4); + else if (version == 5) + rc = uuid_make(uuid, UUID_MAKE_V5, uuid_ns, data); + if (rc != UUID_RC_OK) { + uuid_destroy(uuid); + if (uuid_ns != NULL) + uuid_destroy(uuid_ns); + return luaL_error(L, "failed to make UUID object: %s", uuid_error(rc)); + } + + /* export UUID in string representation */ + result_ptr = result_buf; + result_len = sizeof(result_buf); + if ((rc = uuid_export(uuid, UUID_FMT_STR, &result_ptr, &result_len)) != UUID_RC_OK) { + uuid_destroy(uuid); + if (uuid_ns != NULL) + uuid_destroy(uuid_ns); + return luaL_error(L, "failed to export UUID object: %s", uuid_error(rc)); + } + + /* destroy UUID object(s) */ + uuid_destroy(uuid); + if (uuid_ns != NULL) + uuid_destroy(uuid_ns); + + /* provide result */ + lua_pushstring(L, result_buf); + return 1; +} + +/* Lua method: = uuid.describe() */ +static int luuid_describe(lua_State *L) +{ + uuid_t *uuid; + const char *uuid_str; + uuid_rc_t rc; + char *result_ptr; + + /* fetch arguments */ + if (lua_isstring(L, 1)) + uuid_str = lua_tostring(L, 1); + else + return luaL_argerror(L, 1, "UUID string representation"); + + /* create UUID object */ + if ((rc = uuid_create(&uuid)) != UUID_RC_OK) + return luaL_error(L, "failed to create UUID object: %s", uuid_error(rc)); + + /* import UUID */ + if ((rc = uuid_import(uuid, UUID_FMT_STR, uuid_str, strlen(uuid_str))) != UUID_RC_OK) + return luaL_error(L, "failed to import UUID object: %s", uuid_error(rc)); + + /* export UUID in text description */ + result_ptr = NULL; + if ((rc = uuid_export(uuid, UUID_FMT_TXT, &result_ptr, NULL)) != UUID_RC_OK) { + uuid_destroy(uuid); + return luaL_error(L, "failed to export UUID object: %s", uuid_error(rc)); + } + + /* destroy UUID object(s) */ + uuid_destroy(uuid); + + /* provide result */ + lua_pushstring(L, result_ptr); + return 1; +} + +/* Lua uuid.* method dispatch table */ +static const luaL_reg uuid_meta[] = { + { "generate", luuid_generate }, + { "describe", luuid_describe }, + { NULL, NULL } +}; + +#endif + +/* Lua extension initialization */ +LUALIB_API int luaopen_uuid(lua_State *L) +{ +#ifdef LUA_USE_UUID + luaL_openlib(L, "uuid", uuid_meta, 0); +#endif + return 1; +} + diff --git a/rpm-5.4.9/lua/local/luuid.h b/rpm-5.4.9/lua/local/luuid.h new file mode 100644 index 0000000..9a78ee9 --- /dev/null +++ b/rpm-5.4.9/lua/local/luuid.h @@ -0,0 +1,7 @@ +#ifndef LUUID_H +#define LUUID_H + +int luaopen_uuid(lua_State *L) + /*@modifies L @*/; + +#endif diff --git a/rpm-5.4.9/lua/local/lwrs.c b/rpm-5.4.9/lua/local/lwrs.c new file mode 100644 index 0000000..631e0fb --- /dev/null +++ b/rpm-5.4.9/lua/local/lwrs.c @@ -0,0 +1,148 @@ +/* +** $Id: lwrs.c,v 1.5 2008/08/20 07:08:28 rse Exp $ +** WRLinux utilities +*/ + + +#include +#include + +#define lwrs_c + +#include "lua.h" + +#include "lualib.h" +#include "lauxlib.h" +#include "lwrs.h" + +extern int useradd_main (int argc, char **argv); +extern int chkconfig_main (int argc, char **argv); + +#if defined(USE_LUA_SHADOW) || defined(USE_LUA_CHKCONFIG) +static int lcl_makeArgv(char *in, char **argv, int max) + { + int i; + char delim = ' '; + char *start = NULL; + char c; + + for ( i=0; i < max; ++i) + { + while (*in == ' ') ++in; /* skip spaces */ + if (!*in) return i; /* ignore traing spaces */ + if (*in == '"') delim = *in++; /* begin a quoted string */ + start = in; /* beginning of token */ + for ( c = *in; c != delim && c; c = *in) ++in; /* find end of token */ + *in++ = '\0'; /* mark end */ + *(argv+i) = start; /* might be 0 length! */ + if (!c) return i+1; /* end of input string */ + delim = ' '; + } + return -1; + } +#endif + +static int wrs_version (lua_State *L) + /*@globals internalState @*/ + /*@modifies L, internalState @*/ +{ + printf("version 8\n"); + return 0; +} + +#ifdef USE_LUA_SHADOW +static int wrs_groupadd (lua_State *L) + /*@globals internalState @*/ + /*@modifies L, internalState @*/ +{ + int argc; + char *argv[32]; /* yeah, well, this is big enough */ + char *cmdline; /* copy string from lua just to be safe */ + + argc = lua_gettop(L); /* number of arguments */ + if (argc != 1) return luaL_error(L, "One argument is required!"); + + cmdline = strdup(luaL_checklstring(L, 1, NULL)); /* we don't need the size */ + + argc = 1 + lcl_makeArgv(cmdline, argv+1, 31); + + argv[0] = "rpm_lua"; /* make up a program name */ + + useradd_main(argc, argv); + + free(cmdline); + return 0; +} + +static int wrs_useradd (lua_State *L) + /*@globals internalState @*/ + /*@modifies L, internalState @*/ +{ + int argc; + char *argv[32]; /* yeah, well, this is big enough */ + char *cmdline; /* copy string from lua just to be safe */ + + argc = lua_gettop(L); /* number of arguments */ + if (argc != 1) return luaL_error(L, "One argument is required!"); + + cmdline = strdup(luaL_checklstring(L, 1, NULL)); /* we don't need the size */ + + argc = 1 + lcl_makeArgv(cmdline, argv+1, 31); + + argv[0] = "rpm_lua"; /* make up a program name */ + + useradd_main(argc, argv); + + free(cmdline); + return 0; +} +#endif /* USE_LUA_SHADOW */ + +#ifdef USE_LUA_CHKCONFIG +static int wrs_chkconfig (lua_State *L) + /*@globals internalState @*/ + /*@modifies L, internalState @*/ +{ + int argc; + char *argv[32]; /* yeah, well, this is big enough */ + char *cmdline; /* copy string from lua just to be safe */ + + argc = lua_gettop(L); /* number of arguments */ + if (argc != 1) return luaL_error(L, "One argument is required!"); + + cmdline = strdup(luaL_checklstring(L, 1, NULL)); /* we don't need the size */ + + argc = 1 + lcl_makeArgv(cmdline, argv+1, 31); + + argv[0] = "rpm_lua"; /* make up a program name */ + + chkconfig_main(argc, argv); + + free(cmdline); + return 0; +} +#endif /* USE_LUA_CHKCONFIG */ + +/*@-readonlytrans@*/ +/*@unchecked@*/ +static const luaL_reg wrs[] = { + {"version", wrs_version}, +#ifdef USE_LUA_SHADOW + {"groupadd", wrs_groupadd}, + {"useradd", wrs_useradd}, +#endif +#ifdef USE_LUA_CHKCONFIG + {"chkconfig", wrs_chkconfig}, +#endif + {NULL, NULL} +}; +/*@=readonlytrans@*/ + + +/* +** Open wrs library +*/ +LUALIB_API int luaopen_wrs (lua_State *L) { + luaL_openlib(L, "wrs", wrs, 0); + return 1; +} diff --git a/rpm-5.4.9/lua/local/lwrs.h b/rpm-5.4.9/lua/local/lwrs.h new file mode 100644 index 0000000..a177e3f --- /dev/null +++ b/rpm-5.4.9/lua/local/lwrs.h @@ -0,0 +1,7 @@ +#ifndef LWRS_H +#define LWRS_H + +int luaopen_wrs(lua_State *L) + /*@modifies L @*/; + +#endif diff --git a/rpm-5.4.9/lua/local/lxplib.c b/rpm-5.4.9/lua/local/lxplib.c new file mode 100644 index 0000000..74fc77e --- /dev/null +++ b/rpm-5.4.9/lua/local/lxplib.c @@ -0,0 +1,565 @@ +/* + * $Id: lxplib.c,v 1.2 2008/10/24 22:25:45 jbj Exp $ + * + * LuaExpat: Lua bind for Expat library + * + * Copyright © 2003-2007 The Kepler Project. + * + * 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + + +#include +#include +#include + +#include "expat.h" + +#include "lua.h" +#include "lauxlib.h" +#if ! defined (LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 +#include "compat-5.1.h" +#endif + + +#include "lxplib.h" + + + +enum XPState { + XPSpre, /* parser just initialized */ + XPSok, /* state while parsing */ + XPSfinished, /* state after finished parsing */ + XPSerror, + XPSstring /* state while reading a string */ +}; + +struct lxp_userdata { + lua_State *L; + XML_Parser parser; /* associated expat parser */ + int tableref; /* table with callbacks for this parser */ + enum XPState state; + luaL_Buffer *b; /* to concatenate sequences of cdata pieces */ +}; + +typedef struct lxp_userdata lxp_userdata; + + +static int reporterror (lxp_userdata *xpu) { + lua_State *L = xpu->L; + XML_Parser p = xpu->parser; + lua_pushnil(L); + lua_pushstring(L, XML_ErrorString(XML_GetErrorCode(p))); + lua_pushnumber(L, XML_GetCurrentLineNumber(p)); + lua_pushnumber(L, XML_GetCurrentColumnNumber(p) + 1); + lua_pushnumber(L, XML_GetCurrentByteIndex(p) + 1); + return 5; +} + + +static lxp_userdata *createlxp (lua_State *L) { + lxp_userdata *xpu = (lxp_userdata *)lua_newuserdata(L, sizeof(lxp_userdata)); + xpu->tableref = LUA_REFNIL; /* in case of errors... */ + xpu->parser = NULL; + xpu->L = NULL; + xpu->state = XPSpre; + luaL_getmetatable(L, ParserType); + lua_setmetatable(L, -2); + return xpu; +} + + +static void lxpclose (lua_State *L, lxp_userdata *xpu) { + lua_unref(L, xpu->tableref); + xpu->tableref = LUA_REFNIL; + if (xpu->parser) + XML_ParserFree(xpu->parser); + xpu->parser = NULL; +} + + + + +/* +** Auxiliary function to call a Lua handle +*/ +static void docall (lxp_userdata *xpu, int nargs, int nres) { + lua_State *L = xpu->L; + assert(xpu->state == XPSok); + if (lua_pcall(L, nargs + 1, nres, 0) != 0) { + xpu->state = XPSerror; + luaL_unref(L, LUA_REGISTRYINDEX, xpu->tableref); + xpu->tableref = luaL_ref(L, LUA_REGISTRYINDEX); /* error message */ + } +} + + +/* +** Check whether there is pending Cdata, and call its handle if necessary +*/ +static void dischargestring (lxp_userdata *xpu) { + assert(xpu->state == XPSstring); + xpu->state = XPSok; + luaL_pushresult(xpu->b); + docall(xpu, 1, 0); +} + + +/* +** Check whether there is a Lua handle for a given event: If so, +** put it on the stack (to be called later), and also push `self' +*/ +static int getHandle (lxp_userdata *xpu, const char *handle) { + lua_State *L = xpu->L; + if (xpu->state == XPSstring) dischargestring(xpu); + if (xpu->state == XPSerror) + return 0; /* some error happened before; skip all handles */ + lua_pushstring(L, handle); + lua_gettable(L, 3); + if (lua_toboolean(L, -1) == 0) { + lua_pop(L, 1); + return 0; + } + if (!lua_isfunction(L, -1)) { + luaL_error(L, "lxp `%s' callback is not a function", handle); + } + lua_pushvalue(L, 1); /* first argument in every call (self) */ + return 1; +} + + + +/* +** {====================================================== +** Handles +** ======================================================= +*/ + + +static void f_StartCdata (void *ud) { + lxp_userdata *xpu = (lxp_userdata *)ud; + if (getHandle(xpu, StartCdataKey) == 0) return; /* no handle */ + docall(xpu, 0, 0); +} + + +static void f_EndCdataKey (void *ud) { + lxp_userdata *xpu = (lxp_userdata *)ud; + if (getHandle(xpu, EndCdataKey) == 0) return; /* no handle */ + docall(xpu, 0, 0); +} + + +static void f_CharData (void *ud, const char *s, int len) { + lxp_userdata *xpu = (lxp_userdata *)ud; + if (xpu->state == XPSok) { + if (getHandle(xpu, CharDataKey) == 0) return; /* no handle */ + xpu->state = XPSstring; + luaL_buffinit(xpu->L, xpu->b); + } + if (xpu->state == XPSstring) + luaL_addlstring(xpu->b, s, len); +} + + +static void f_Comment (void *ud, const char *data) { + lxp_userdata *xpu = (lxp_userdata *)ud; + if (getHandle(xpu, CommentKey) == 0) return; /* no handle */ + lua_pushstring(xpu->L, data); + docall(xpu, 1, 0); +} + + +static void f_Default (void *ud, const char *data, int len) { + lxp_userdata *xpu = (lxp_userdata *)ud; + if (getHandle(xpu, DefaultKey) == 0) return; /* no handle */ + lua_pushlstring(xpu->L, data, len); + docall(xpu, 1, 0); +} + + +static void f_DefaultExpand (void *ud, const char *data, int len) { + lxp_userdata *xpu = (lxp_userdata *)ud; + if (getHandle(xpu, DefaultExpandKey) == 0) return; /* no handle */ + lua_pushlstring(xpu->L, data, len); + docall(xpu, 1, 0); +} + + +static void f_StartElement (void *ud, const char *name, const char **attrs) { + lxp_userdata *xpu = (lxp_userdata *)ud; + lua_State *L = xpu->L; + int lastspec = XML_GetSpecifiedAttributeCount(xpu->parser) / 2; + int i = 1; + if (getHandle(xpu, StartElementKey) == 0) return; /* no handle */ + lua_pushstring(L, name); + lua_newtable(L); + while (*attrs) { + if (i <= lastspec) { + lua_pushnumber(L, i++); + lua_pushstring(L, *attrs); + lua_settable(L, -3); + } + lua_pushstring(L, *attrs++); + lua_pushstring(L, *attrs++); + lua_settable(L, -3); + } + docall(xpu, 2, 0); /* call function with self, name, and attributes */ +} + + +static void f_EndElement (void *ud, const char *name) { + lxp_userdata *xpu = (lxp_userdata *)ud; + if (getHandle(xpu, EndElementKey) == 0) return; /* no handle */ + lua_pushstring(xpu->L, name); + docall(xpu, 1, 0); +} + + +static int f_ExternaEntity (XML_Parser p, const char *context, + const char *base, + const char *systemId, + const char *publicId) { + lxp_userdata *xpu = (lxp_userdata *)XML_GetUserData(p); + lua_State *L = xpu->L; + lxp_userdata *child; + int status; + if (getHandle(xpu, ExternalEntityKey) == 0) return 1; /* no handle */ + child = createlxp(L); + child->parser = XML_ExternalEntityParserCreate(p, context, NULL); + if (!child->parser) + luaL_error(L, "XML_ParserCreate failed"); + lua_getref(L, xpu->tableref); /* child uses the same table of its father */ + child->tableref = luaL_ref(L, LUA_REGISTRYINDEX); + lua_pushstring(L, base); + lua_pushstring(L, systemId); + lua_pushstring(L, publicId); + docall(xpu, 4, 1); + status = lua_toboolean(L, -1); + lua_pop(L, 1); + lxpclose(L, child); + return status; +} + + +static void f_StartNamespaceDecl (void *ud, const char *prefix, + const char *uri) { + lxp_userdata *xpu = (lxp_userdata *)ud; + lua_State *L = xpu->L; + if (getHandle(xpu, StartNamespaceDeclKey) == 0) return; /* no handle */ + lua_pushstring(L, prefix); + lua_pushstring(L, uri); + docall(xpu, 2, 0); +} + + +static void f_EndNamespaceDecl (void *ud, const char *prefix) { + lxp_userdata *xpu = (lxp_userdata *)ud; + if (getHandle(xpu, EndNamespaceDeclKey) == 0) return; /* no handle */ + lua_pushstring(xpu->L, prefix); + docall(xpu, 1, 0); +} + + +static void f_NotationDecl (void *ud, const char *notationName, + const char *base, + const char *systemId, + const char *publicId) { + lxp_userdata *xpu = (lxp_userdata *)ud; + lua_State *L = xpu->L; + if (getHandle(xpu, NotationDeclKey) == 0) return; /* no handle */ + lua_pushstring(L, notationName); + lua_pushstring(L, base); + lua_pushstring(L, systemId); + lua_pushstring(L, publicId); + docall(xpu, 4, 0); +} + + +static int f_NotStandalone (void *ud) { + int status; + lxp_userdata *xpu = (lxp_userdata *)ud; + lua_State *L = xpu->L; + if (getHandle(xpu, NotStandaloneKey) == 0) return 1; /* no handle */ + docall(xpu, 0, 1); + status = lua_toboolean(L, -1); + lua_pop(L, 1); + return status; +} + + +static void f_ProcessingInstruction (void *ud, const char *target, + const char *data) { + lxp_userdata *xpu = (lxp_userdata *)ud; + lua_State *L = xpu->L; + if (getHandle(xpu, ProcessingInstructionKey) == 0) return; /* no handle */ + lua_pushstring(L, target); + lua_pushstring(L, data); + docall(xpu, 2, 0); +} + + +static void f_UnparsedEntityDecl (void *ud, const char *entityName, + const char *base, + const char *systemId, + const char *publicId, + const char *notationName) { + lxp_userdata *xpu = (lxp_userdata *)ud; + lua_State *L = xpu->L; + if (getHandle(xpu, UnparsedEntityDeclKey) == 0) return; /* no handle */ + lua_pushstring(L, entityName); + lua_pushstring(L, base); + lua_pushstring(L, systemId); + lua_pushstring(L, publicId); + lua_pushstring(L, notationName); + docall(xpu, 5, 0); +} + +/* }====================================================== */ + + + +static int hasfield (lua_State *L, const char *fname) { + int res; + lua_pushstring(L, fname); + lua_gettable(L, 1); + res = !lua_isnil(L, -1); + lua_pop(L, 1); + return res; +} + + +static void checkcallbacks (lua_State *L) { + static const char *const validkeys[] = { + "StartCdataSection", "EndCdataSection", "CharacterData", "Comment", + "Default", "DefaultExpand", "StartElement", "EndElement", + "ExternalEntityRef", "StartNamespaceDecl", "EndNamespaceDecl", + "NotationDecl", "NotStandalone", "ProcessingInstruction", + "UnparsedEntityDecl", NULL}; + if (hasfield(L, "_nonstrict")) return; + lua_pushnil(L); + while (lua_next(L, 1)) { + lua_pop(L, 1); /* remove value */ +#if ! defined (LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 + if (lua_type(L, -1) != LUA_TSTRING || + luaL_findstring(lua_tostring(L, -1), validkeys) < 0) + luaL_error(L, "invalid key `%s' in callback table", lua_tostring(L, -1)); +#else + luaL_checkoption(L, -1, NULL, validkeys); +#endif + } +} + + +static int lxp_make_parser (lua_State *L) { + XML_Parser p; + char sep = *luaL_optstring(L, 2, ""); + lxp_userdata *xpu = createlxp(L); + p = xpu->parser = (sep == '\0') ? XML_ParserCreate(NULL) : + XML_ParserCreateNS(NULL, sep); + if (!p) + luaL_error(L, "XML_ParserCreate failed"); + luaL_checktype(L, 1, LUA_TTABLE); + checkcallbacks(L); + lua_pushvalue(L, 1); + xpu->tableref = luaL_ref(L, LUA_REGISTRYINDEX); + XML_SetUserData(p, xpu); + if (hasfield(L, StartCdataKey) || hasfield(L, EndCdataKey)) + XML_SetCdataSectionHandler(p, f_StartCdata, f_EndCdataKey); + if (hasfield(L, CharDataKey)) + XML_SetCharacterDataHandler(p, f_CharData); + if (hasfield(L, CommentKey)) + XML_SetCommentHandler(p, f_Comment); + if (hasfield(L, DefaultKey)) + XML_SetDefaultHandler(p, f_Default); + if (hasfield(L, DefaultExpandKey)) + XML_SetDefaultHandlerExpand(p, f_DefaultExpand); + if (hasfield(L, StartElementKey) || hasfield(L, EndElementKey)) + XML_SetElementHandler(p, f_StartElement, f_EndElement); + if (hasfield(L, ExternalEntityKey)) + XML_SetExternalEntityRefHandler(p, f_ExternaEntity); + if (hasfield(L, StartNamespaceDeclKey) || hasfield(L, EndNamespaceDeclKey)) + XML_SetNamespaceDeclHandler(p, f_StartNamespaceDecl, f_EndNamespaceDecl); + if (hasfield(L, NotationDeclKey)) + XML_SetNotationDeclHandler(p, f_NotationDecl); + if (hasfield(L, NotStandaloneKey)) + XML_SetNotStandaloneHandler(p, f_NotStandalone); + if (hasfield(L, ProcessingInstructionKey)) + XML_SetProcessingInstructionHandler(p, f_ProcessingInstruction); + if (hasfield(L, UnparsedEntityDeclKey)) + XML_SetUnparsedEntityDeclHandler(p, f_UnparsedEntityDecl); + return 1; +} + + +static lxp_userdata *checkparser (lua_State *L, int idx) { + lxp_userdata *xpu = (lxp_userdata *)luaL_checkudata(L, idx, ParserType); + luaL_argcheck(L, xpu, idx, "expat parser expected"); + luaL_argcheck(L, xpu->parser, idx, "parser is closed"); + return xpu; +} + + +static int parser_gc (lua_State *L) { + lxp_userdata *xpu = (lxp_userdata *)luaL_checkudata(L, 1, ParserType); + luaL_argcheck(L, xpu, 1, "expat parser expected"); + lxpclose(L, xpu); + return 0; +} + + +static int setbase (lua_State *L) { + lxp_userdata *xpu = checkparser(L, 1); + if (XML_SetBase(xpu->parser, luaL_checkstring(L, 2)) == 0) + luaL_error(L, "no memory to store base"); + return 0; +} + + +static int getbase (lua_State *L) { + lxp_userdata *xpu = checkparser(L, 1); + lua_pushstring(L, XML_GetBase(xpu->parser)); + return 1; +} + + +static int getcallbacks (lua_State *L) { + lxp_userdata *xpu = checkparser(L, 1); + lua_rawgeti(L, LUA_REGISTRYINDEX, xpu->tableref); + return 1; +} + + +static int parse_aux (lua_State *L, lxp_userdata *xpu, const char *s, + size_t len) { + luaL_Buffer b; + int status; + xpu->L = L; + xpu->state = XPSok; + xpu->b = &b; + lua_settop(L, 2); + lua_getref(L, xpu->tableref); /* to be used by handlers */ + status = XML_Parse(xpu->parser, s, (int)len, s == NULL); + if (xpu->state == XPSstring) dischargestring(xpu); + if (xpu->state == XPSerror) { /* callback error? */ + lua_rawgeti(L, LUA_REGISTRYINDEX, xpu->tableref); /* get original msg. */ + lua_error(L); + } + if (s == NULL) xpu->state = XPSfinished; + if (status) { + lua_pushboolean(L, 1); + return 1; + } + else { /* error */ + return reporterror(xpu); + } +} + + +static int lxp_parse (lua_State *L) { + lxp_userdata *xpu = checkparser(L, 1); + size_t len; + const char *s = luaL_optlstring(L, 2, NULL, &len); + if (xpu->state == XPSfinished && s != NULL) { + lua_pushnil(L); + lua_pushliteral(L, "cannot parse - document is finished"); + return 2; + } + return parse_aux(L, xpu, s, len); +} + + +static int lxp_close (lua_State *L) { + int status = 1; + lxp_userdata *xpu = (lxp_userdata *)luaL_checkudata(L, 1, ParserType); + luaL_argcheck(L, xpu, 1, "expat parser expected"); + if (xpu->state != XPSfinished) + status = parse_aux(L, xpu, NULL, 0); + lxpclose(L, xpu); + if (status > 1) luaL_error(L, "error closing parser: %s", + lua_tostring(L, -status+1)); + return 0; +} + + +static int lxp_pos (lua_State *L) { + lxp_userdata *xpu = checkparser(L, 1); + XML_Parser p = xpu->parser; + lua_pushnumber(L, XML_GetCurrentLineNumber(p)); + lua_pushnumber(L, XML_GetCurrentColumnNumber(p) + 1); + lua_pushnumber(L, XML_GetCurrentByteIndex(p) + 1); + return 3; +} + + +static int lxp_setencoding (lua_State *L) { + lxp_userdata *xpu = checkparser(L, 1); + const char *encoding = luaL_checkstring(L, 2); + luaL_argcheck(L, xpu->state == XPSpre, 1, "invalid parser state"); + XML_SetEncoding(xpu->parser, encoding); + return 0; +} + + +static const struct luaL_reg lxp_meths[] = { + {"parse", lxp_parse}, + {"close", lxp_close}, + {"__gc", parser_gc}, + {"pos", lxp_pos}, + {"setencoding", lxp_setencoding}, + {"getcallbacks", getcallbacks}, + {"getbase", getbase}, + {"setbase", setbase}, + {NULL, NULL} +}; + +static const struct luaL_reg lxp_funcs[] = { + {"new", lxp_make_parser}, + {NULL, NULL} +}; + + +/* +** Assumes the table is on top of the stack. +*/ +static void set_info (lua_State *L) { + lua_pushliteral (L, "_COPYRIGHT"); + lua_pushliteral (L, "Copyright (C) 2003-2007 Kepler Project"); + lua_settable (L, -3); + lua_pushliteral (L, "_DESCRIPTION"); + lua_pushliteral (L, "LuaExpat is a SAX XML parser based on the Expat library"); + lua_settable (L, -3); + lua_pushliteral (L, "_VERSION"); + lua_pushliteral (L, "LuaExpat 1.1.0"); + lua_settable (L, -3); +} + + +int luaopen_lxp (lua_State *L) { + luaL_newmetatable(L, ParserType); + lua_pushliteral(L, "__index"); + lua_pushvalue(L, -2); + lua_rawset(L, -3); + luaL_openlib (L, NULL, lxp_meths, 0); + luaL_openlib (L, "lxp", lxp_funcs, 0); + set_info (L); + + return 1; +} diff --git a/rpm-5.4.9/lua/local/lxplib.h b/rpm-5.4.9/lua/local/lxplib.h new file mode 100644 index 0000000..76f418c --- /dev/null +++ b/rpm-5.4.9/lua/local/lxplib.h @@ -0,0 +1,48 @@ +/* + * Copyright © 2003-2007 The Kepler Project. + * + * 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef LXPLIB_H +#define LXPLIB_H + +#define ParserType "Expat" + +#define StartCdataKey "StartCdataSection" +#define EndCdataKey "EndCdataSection" +#define CharDataKey "CharacterData" +#define CommentKey "Comment" +#define DefaultKey "Default" +#define DefaultExpandKey "DefaultExpand" +#define StartElementKey "StartElement" +#define EndElementKey "EndElement" +#define ExternalEntityKey "ExternalEntityRef" +#define StartNamespaceDeclKey "StartNamespaceDecl" +#define EndNamespaceDeclKey "EndNamespaceDecl" +#define NotationDeclKey "NotationDecl" +#define NotStandaloneKey "NotStandalone" +#define ProcessingInstructionKey "ProcessingInstruction" +#define UnparsedEntityDeclKey "UnparsedEntityDecl" + +int luaopen_lxp (lua_State * L) + /*@modifies L @*/; + +#endif /* LXPLIB_H */ diff --git a/rpm-5.4.9/lua/lopcodes.c b/rpm-5.4.9/lua/lopcodes.c new file mode 100644 index 0000000..4cc7452 --- /dev/null +++ b/rpm-5.4.9/lua/lopcodes.c @@ -0,0 +1,102 @@ +/* +** $Id: lopcodes.c,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $ +** See Copyright Notice in lua.h +*/ + + +#define lopcodes_c +#define LUA_CORE + + +#include "lopcodes.h" + + +/* ORDER OP */ + +const char *const luaP_opnames[NUM_OPCODES+1] = { + "MOVE", + "LOADK", + "LOADBOOL", + "LOADNIL", + "GETUPVAL", + "GETGLOBAL", + "GETTABLE", + "SETGLOBAL", + "SETUPVAL", + "SETTABLE", + "NEWTABLE", + "SELF", + "ADD", + "SUB", + "MUL", + "DIV", + "MOD", + "POW", + "UNM", + "NOT", + "LEN", + "CONCAT", + "JMP", + "EQ", + "LT", + "LE", + "TEST", + "TESTSET", + "CALL", + "TAILCALL", + "RETURN", + "FORLOOP", + "FORPREP", + "TFORLOOP", + "SETLIST", + "CLOSE", + "CLOSURE", + "VARARG", + NULL +}; + + +#define opmode(t,a,b,c,m) (((t)<<7) | ((a)<<6) | ((b)<<4) | ((c)<<2) | (m)) + +const lu_byte luaP_opmodes[NUM_OPCODES] = { +/* T A B C mode opcode */ + opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */ + ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_LOADK */ + ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_LOADBOOL */ + ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LOADNIL */ + ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_GETUPVAL */ + ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_GETGLOBAL */ + ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_GETTABLE */ + ,opmode(0, 0, OpArgK, OpArgN, iABx) /* OP_SETGLOBAL */ + ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_SETUPVAL */ + ,opmode(0, 0, OpArgK, OpArgK, iABC) /* OP_SETTABLE */ + ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_NEWTABLE */ + ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_SELF */ + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_ADD */ + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_SUB */ + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MUL */ + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_DIV */ + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MOD */ + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_POW */ + ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_UNM */ + ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_NOT */ + ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LEN */ + ,opmode(0, 1, OpArgR, OpArgR, iABC) /* OP_CONCAT */ + ,opmode(0, 0, OpArgR, OpArgN, iAsBx) /* OP_JMP */ + ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_EQ */ + ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LT */ + ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LE */ + ,opmode(1, 1, OpArgR, OpArgU, iABC) /* OP_TEST */ + ,opmode(1, 1, OpArgR, OpArgU, iABC) /* OP_TESTSET */ + ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_CALL */ + ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_TAILCALL */ + ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RETURN */ + ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORLOOP */ + ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORPREP */ + ,opmode(1, 0, OpArgN, OpArgU, iABC) /* OP_TFORLOOP */ + ,opmode(0, 0, OpArgU, OpArgU, iABC) /* OP_SETLIST */ + ,opmode(0, 0, OpArgN, OpArgN, iABC) /* OP_CLOSE */ + ,opmode(0, 1, OpArgU, OpArgN, iABx) /* OP_CLOSURE */ + ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_VARARG */ +}; + diff --git a/rpm-5.4.9/lua/lopcodes.h b/rpm-5.4.9/lua/lopcodes.h new file mode 100644 index 0000000..41224d6 --- /dev/null +++ b/rpm-5.4.9/lua/lopcodes.h @@ -0,0 +1,268 @@ +/* +** $Id: lopcodes.h,v 1.125.1.1 2007/12/27 13:02:25 roberto Exp $ +** Opcodes for Lua virtual machine +** See Copyright Notice in lua.h +*/ + +#ifndef lopcodes_h +#define lopcodes_h + +#include "llimits.h" + + +/*=========================================================================== + We assume that instructions are unsigned numbers. + All instructions have an opcode in the first 6 bits. + Instructions can have the following fields: + `A' : 8 bits + `B' : 9 bits + `C' : 9 bits + `Bx' : 18 bits (`B' and `C' together) + `sBx' : signed Bx + + A signed argument is represented in excess K; that is, the number + value is the unsigned value minus K. K is exactly the maximum value + for that argument (so that -max is represented by 0, and +max is + represented by 2*max), which is half the maximum for the corresponding + unsigned argument. +===========================================================================*/ + + +enum OpMode {iABC, iABx, iAsBx}; /* basic instruction format */ + + +/* +** size and position of opcode arguments. +*/ +#define SIZE_C 9 +#define SIZE_B 9 +#define SIZE_Bx (SIZE_C + SIZE_B) +#define SIZE_A 8 + +#define SIZE_OP 6 + +#define POS_OP 0 +#define POS_A (POS_OP + SIZE_OP) +#define POS_C (POS_A + SIZE_A) +#define POS_B (POS_C + SIZE_C) +#define POS_Bx POS_C + + +/* +** limits for opcode arguments. +** we use (signed) int to manipulate most arguments, +** so they must fit in LUAI_BITSINT-1 bits (-1 for sign) +*/ +#if SIZE_Bx < LUAI_BITSINT-1 +#define MAXARG_Bx ((1<>1) /* `sBx' is signed */ +#else +#define MAXARG_Bx MAX_INT +#define MAXARG_sBx MAX_INT +#endif + + +#define MAXARG_A ((1<>POS_OP) & MASK1(SIZE_OP,0))) +#define SET_OPCODE(i,o) ((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \ + ((cast(Instruction, o)<>POS_A) & MASK1(SIZE_A,0))) +#define SETARG_A(i,u) ((i) = (((i)&MASK0(SIZE_A,POS_A)) | \ + ((cast(Instruction, u)<>POS_B) & MASK1(SIZE_B,0))) +#define SETARG_B(i,b) ((i) = (((i)&MASK0(SIZE_B,POS_B)) | \ + ((cast(Instruction, b)<>POS_C) & MASK1(SIZE_C,0))) +#define SETARG_C(i,b) ((i) = (((i)&MASK0(SIZE_C,POS_C)) | \ + ((cast(Instruction, b)<>POS_Bx) & MASK1(SIZE_Bx,0))) +#define SETARG_Bx(i,b) ((i) = (((i)&MASK0(SIZE_Bx,POS_Bx)) | \ + ((cast(Instruction, b)< C) then pc++ */ +OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */ + +OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */ +OP_TAILCALL,/* A B C return R(A)(R(A+1), ... ,R(A+B-1)) */ +OP_RETURN,/* A B return R(A), ... ,R(A+B-2) (see note) */ + +OP_FORLOOP,/* A sBx R(A)+=R(A+2); + if R(A) =) R(A)*/ +OP_CLOSURE,/* A Bx R(A) := closure(KPROTO[Bx], R(A), ... ,R(A+n)) */ + +OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */ +} OpCode; + + +#define NUM_OPCODES (cast(int, OP_VARARG) + 1) + + + +/*=========================================================================== + Notes: + (*) In OP_CALL, if (B == 0) then B = top. C is the number of returns - 1, + and can be 0: OP_CALL then sets `top' to last_result+1, so + next open instruction (OP_CALL, OP_RETURN, OP_SETLIST) may use `top'. + + (*) In OP_VARARG, if (B == 0) then use actual number of varargs and + set top (like in OP_CALL with C == 0). + + (*) In OP_RETURN, if (B == 0) then return up to `top' + + (*) In OP_SETLIST, if (B == 0) then B = `top'; + if (C == 0) then next `instruction' is real C + + (*) For comparisons, A specifies what condition the test should accept + (true or false). + + (*) All `skips' (pc++) assume that next instruction is a jump +===========================================================================*/ + + +/* +** masks for instruction properties. The format is: +** bits 0-1: op mode +** bits 2-3: C arg mode +** bits 4-5: B arg mode +** bit 6: instruction set register A +** bit 7: operator is a test +*/ + +enum OpArgMask { + OpArgN, /* argument is not used */ + OpArgU, /* argument is used */ + OpArgR, /* argument is a register or a jump offset */ + OpArgK /* argument is a constant or register/constant */ +}; + +LUAI_DATA const lu_byte luaP_opmodes[NUM_OPCODES]; + +#define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 3)) +#define getBMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3)) +#define getCMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 2) & 3)) +#define testAMode(m) (luaP_opmodes[m] & (1 << 6)) +#define testTMode(m) (luaP_opmodes[m] & (1 << 7)) + + +LUAI_DATA const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */ + + +/* number of list items to accumulate before a SETLIST instruction */ +#define LFIELDS_PER_FLUSH 50 + + +#endif diff --git a/rpm-5.4.9/lua/loslib.c b/rpm-5.4.9/lua/loslib.c new file mode 100644 index 0000000..da06a57 --- /dev/null +++ b/rpm-5.4.9/lua/loslib.c @@ -0,0 +1,243 @@ +/* +** $Id: loslib.c,v 1.19.1.3 2008/01/18 16:38:18 roberto Exp $ +** Standard Operating System library +** See Copyright Notice in lua.h +*/ + + +#include +#include +#include +#include +#include + +#define loslib_c +#define LUA_LIB + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + +static int os_pushresult (lua_State *L, int i, const char *filename) { + int en = errno; /* calls to Lua API may change this value */ + if (i) { + lua_pushboolean(L, 1); + return 1; + } + else { + lua_pushnil(L); + lua_pushfstring(L, "%s: %s", filename, strerror(en)); + lua_pushinteger(L, en); + return 3; + } +} + + +static int os_execute (lua_State *L) { + lua_pushinteger(L, system(luaL_optstring(L, 1, NULL))); + return 1; +} + + +static int os_remove (lua_State *L) { + const char *filename = luaL_checkstring(L, 1); + return os_pushresult(L, remove(filename) == 0, filename); +} + + +static int os_rename (lua_State *L) { + const char *fromname = luaL_checkstring(L, 1); + const char *toname = luaL_checkstring(L, 2); + return os_pushresult(L, rename(fromname, toname) == 0, fromname); +} + + +static int os_tmpname (lua_State *L) { + char buff[LUA_TMPNAMBUFSIZE]; + int err; + lua_tmpnam(buff, err); + if (err) + return luaL_error(L, "unable to generate a unique filename"); + lua_pushstring(L, buff); + return 1; +} + + +static int os_getenv (lua_State *L) { + lua_pushstring(L, getenv(luaL_checkstring(L, 1))); /* if NULL push nil */ + return 1; +} + + +static int os_clock (lua_State *L) { + lua_pushnumber(L, ((lua_Number)clock())/(lua_Number)CLOCKS_PER_SEC); + return 1; +} + + +/* +** {====================================================== +** Time/Date operations +** { year=%Y, month=%m, day=%d, hour=%H, min=%M, sec=%S, +** wday=%w+1, yday=%j, isdst=? } +** ======================================================= +*/ + +static void setfield (lua_State *L, const char *key, int value) { + lua_pushinteger(L, value); + lua_setfield(L, -2, key); +} + +static void setboolfield (lua_State *L, const char *key, int value) { + if (value < 0) /* undefined? */ + return; /* does not set field */ + lua_pushboolean(L, value); + lua_setfield(L, -2, key); +} + +static int getboolfield (lua_State *L, const char *key) { + int res; + lua_getfield(L, -1, key); + res = lua_isnil(L, -1) ? -1 : lua_toboolean(L, -1); + lua_pop(L, 1); + return res; +} + + +static int getfield (lua_State *L, const char *key, int d) { + int res; + lua_getfield(L, -1, key); + if (lua_isnumber(L, -1)) + res = (int)lua_tointeger(L, -1); + else { + if (d < 0) + return luaL_error(L, "field " LUA_QS " missing in date table", key); + res = d; + } + lua_pop(L, 1); + return res; +} + + +static int os_date (lua_State *L) { + const char *s = luaL_optstring(L, 1, "%c"); + time_t t = luaL_opt(L, (time_t)luaL_checknumber, 2, time(NULL)); + struct tm *stm; + if (*s == '!') { /* UTC? */ + stm = gmtime(&t); + s++; /* skip `!' */ + } + else + stm = localtime(&t); + if (stm == NULL) /* invalid date? */ + lua_pushnil(L); + else if (strcmp(s, "*t") == 0) { + lua_createtable(L, 0, 9); /* 9 = number of fields */ + setfield(L, "sec", stm->tm_sec); + setfield(L, "min", stm->tm_min); + setfield(L, "hour", stm->tm_hour); + setfield(L, "day", stm->tm_mday); + setfield(L, "month", stm->tm_mon+1); + setfield(L, "year", stm->tm_year+1900); + setfield(L, "wday", stm->tm_wday+1); + setfield(L, "yday", stm->tm_yday+1); + setboolfield(L, "isdst", stm->tm_isdst); + } + else { + char cc[3]; + luaL_Buffer b; + cc[0] = '%'; cc[2] = '\0'; + luaL_buffinit(L, &b); + for (; *s; s++) { + if (*s != '%' || *(s + 1) == '\0') /* no conversion specifier? */ + luaL_addchar(&b, *s); + else { + size_t reslen; + char buff[200]; /* should be big enough for any conversion result */ + cc[1] = *(++s); + reslen = strftime(buff, sizeof(buff), cc, stm); + luaL_addlstring(&b, buff, reslen); + } + } + luaL_pushresult(&b); + } + return 1; +} + + +static int os_time (lua_State *L) { + time_t t; + if (lua_isnoneornil(L, 1)) /* called without args? */ + t = time(NULL); /* get current time */ + else { + struct tm ts; + luaL_checktype(L, 1, LUA_TTABLE); + lua_settop(L, 1); /* make sure table is at the top */ + ts.tm_sec = getfield(L, "sec", 0); + ts.tm_min = getfield(L, "min", 0); + ts.tm_hour = getfield(L, "hour", 12); + ts.tm_mday = getfield(L, "day", -1); + ts.tm_mon = getfield(L, "month", -1) - 1; + ts.tm_year = getfield(L, "year", -1) - 1900; + ts.tm_isdst = getboolfield(L, "isdst"); + t = mktime(&ts); + } + if (t == (time_t)(-1)) + lua_pushnil(L); + else + lua_pushnumber(L, (lua_Number)t); + return 1; +} + + +static int os_difftime (lua_State *L) { + lua_pushnumber(L, difftime((time_t)(luaL_checknumber(L, 1)), + (time_t)(luaL_optnumber(L, 2, 0)))); + return 1; +} + +/* }====================================================== */ + + +static int os_setlocale (lua_State *L) { + static const int cat[] = {LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, + LC_NUMERIC, LC_TIME}; + static const char *const catnames[] = {"all", "collate", "ctype", "monetary", + "numeric", "time", NULL}; + const char *l = luaL_optstring(L, 1, NULL); + int op = luaL_checkoption(L, 2, "all", catnames); + lua_pushstring(L, setlocale(cat[op], l)); + return 1; +} + + +static int os_exit (lua_State *L) { + exit(luaL_optint(L, 1, EXIT_SUCCESS)); +} + +static const luaL_Reg syslib[] = { + {"clock", os_clock}, + {"date", os_date}, + {"difftime", os_difftime}, + {"execute", os_execute}, + {"exit", os_exit}, + {"getenv", os_getenv}, + {"remove", os_remove}, + {"rename", os_rename}, + {"setlocale", os_setlocale}, + {"time", os_time}, + {"tmpname", os_tmpname}, + {NULL, NULL} +}; + +/* }====================================================== */ + + + +LUALIB_API int luaopen_os (lua_State *L) { + luaL_register(L, LUA_OSLIBNAME, syslib); + return 1; +} + diff --git a/rpm-5.4.9/lua/lparser.c b/rpm-5.4.9/lua/lparser.c new file mode 100644 index 0000000..1e2a9a8 --- /dev/null +++ b/rpm-5.4.9/lua/lparser.c @@ -0,0 +1,1339 @@ +/* +** $Id: lparser.c,v 2.42.1.3 2007/12/28 15:32:23 roberto Exp $ +** Lua Parser +** See Copyright Notice in lua.h +*/ + + +#include + +#define lparser_c +#define LUA_CORE + +#include "lua.h" + +#include "lcode.h" +#include "ldebug.h" +#include "ldo.h" +#include "lfunc.h" +#include "llex.h" +#include "lmem.h" +#include "lobject.h" +#include "lopcodes.h" +#include "lparser.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" + + + +#define hasmultret(k) ((k) == VCALL || (k) == VVARARG) + +#define getlocvar(fs, i) ((fs)->f->locvars[(fs)->actvar[i]]) + +#define luaY_checklimit(fs,v,l,m) if ((v)>(l)) errorlimit(fs,l,m) + + +/* +** nodes for block list (list of active blocks) +*/ +typedef struct BlockCnt { + struct BlockCnt *previous; /* chain */ + int breaklist; /* list of jumps out of this loop */ + lu_byte nactvar; /* # active locals outside the breakable structure */ + lu_byte upval; /* true if some variable in the block is an upvalue */ + lu_byte isbreakable; /* true if `block' is a loop */ +} BlockCnt; + + + +/* +** prototypes for recursive non-terminal functions +*/ +static void chunk (LexState *ls); +static void expr (LexState *ls, expdesc *v); + + +static void anchor_token (LexState *ls) { + if (ls->t.token == TK_NAME || ls->t.token == TK_STRING) { + TString *ts = ls->t.seminfo.ts; + luaX_newstring(ls, getstr(ts), ts->tsv.len); + } +} + + +static void error_expected (LexState *ls, int token) { + luaX_syntaxerror(ls, + luaO_pushfstring(ls->L, LUA_QS " expected", luaX_token2str(ls, token))); +} + + +static void errorlimit (FuncState *fs, int limit, const char *what) { + const char *msg = (fs->f->linedefined == 0) ? + luaO_pushfstring(fs->L, "main function has more than %d %s", limit, what) : + luaO_pushfstring(fs->L, "function at line %d has more than %d %s", + fs->f->linedefined, limit, what); + luaX_lexerror(fs->ls, msg, 0); +} + + +static int testnext (LexState *ls, int c) { + if (ls->t.token == c) { + luaX_next(ls); + return 1; + } + else return 0; +} + + +static void check (LexState *ls, int c) { + if (ls->t.token != c) + error_expected(ls, c); +} + +static void checknext (LexState *ls, int c) { + check(ls, c); + luaX_next(ls); +} + + +#define check_condition(ls,c,msg) { if (!(c)) luaX_syntaxerror(ls, msg); } + + + +static void check_match (LexState *ls, int what, int who, int where) { + if (!testnext(ls, what)) { + if (where == ls->linenumber) + error_expected(ls, what); + else { + luaX_syntaxerror(ls, luaO_pushfstring(ls->L, + LUA_QS " expected (to close " LUA_QS " at line %d)", + luaX_token2str(ls, what), luaX_token2str(ls, who), where)); + } + } +} + + +static TString *str_checkname (LexState *ls) { + TString *ts; + check(ls, TK_NAME); + ts = ls->t.seminfo.ts; + luaX_next(ls); + return ts; +} + + +static void init_exp (expdesc *e, expkind k, int i) { + e->f = e->t = NO_JUMP; + e->k = k; + e->u.s.info = i; +} + + +static void codestring (LexState *ls, expdesc *e, TString *s) { + init_exp(e, VK, luaK_stringK(ls->fs, s)); +} + + +static void checkname(LexState *ls, expdesc *e) { + codestring(ls, e, str_checkname(ls)); +} + + +static int registerlocalvar (LexState *ls, TString *varname) { + FuncState *fs = ls->fs; + Proto *f = fs->f; + int oldsize = f->sizelocvars; + luaM_growvector(ls->L, f->locvars, fs->nlocvars, f->sizelocvars, + LocVar, SHRT_MAX, "too many local variables"); + while (oldsize < f->sizelocvars) f->locvars[oldsize++].varname = NULL; + f->locvars[fs->nlocvars].varname = varname; + luaC_objbarrier(ls->L, f, varname); + return fs->nlocvars++; +} + + +#define new_localvarliteral(ls,v,n) \ + new_localvar(ls, luaX_newstring(ls, "" v, (sizeof(v)/sizeof(char))-1), n) + + +static void new_localvar (LexState *ls, TString *name, int n) { + FuncState *fs = ls->fs; + luaY_checklimit(fs, fs->nactvar+n+1, LUAI_MAXVARS, "local variables"); + fs->actvar[fs->nactvar+n] = cast(unsigned short, registerlocalvar(ls, name)); +} + + +static void adjustlocalvars (LexState *ls, int nvars) { + FuncState *fs = ls->fs; + fs->nactvar = cast_byte(fs->nactvar + nvars); + for (; nvars; nvars--) { + getlocvar(fs, fs->nactvar - nvars).startpc = fs->pc; + } +} + + +static void removevars (LexState *ls, int tolevel) { + FuncState *fs = ls->fs; + while (fs->nactvar > tolevel) + getlocvar(fs, --fs->nactvar).endpc = fs->pc; +} + + +static int indexupvalue (FuncState *fs, TString *name, expdesc *v) { + int i; + Proto *f = fs->f; + int oldsize = f->sizeupvalues; + for (i=0; inups; i++) { + if (fs->upvalues[i].k == v->k && fs->upvalues[i].info == v->u.s.info) { + lua_assert(f->upvalues[i] == name); + return i; + } + } + /* new one */ + luaY_checklimit(fs, f->nups + 1, LUAI_MAXUPVALUES, "upvalues"); + luaM_growvector(fs->L, f->upvalues, f->nups, f->sizeupvalues, + TString *, MAX_INT, ""); + while (oldsize < f->sizeupvalues) f->upvalues[oldsize++] = NULL; + f->upvalues[f->nups] = name; + luaC_objbarrier(fs->L, f, name); + lua_assert(v->k == VLOCAL || v->k == VUPVAL); + fs->upvalues[f->nups].k = cast_byte(v->k); + fs->upvalues[f->nups].info = cast_byte(v->u.s.info); + return f->nups++; +} + + +static int searchvar (FuncState *fs, TString *n) { + int i; + for (i=fs->nactvar-1; i >= 0; i--) { + if (n == getlocvar(fs, i).varname) + return i; + } + return -1; /* not found */ +} + + +static void markupval (FuncState *fs, int level) { + BlockCnt *bl = fs->bl; + while (bl && bl->nactvar > level) bl = bl->previous; + if (bl) bl->upval = 1; +} + + +static int singlevaraux (FuncState *fs, TString *n, expdesc *var, int base) { + if (fs == NULL) { /* no more levels? */ + init_exp(var, VGLOBAL, NO_REG); /* default is global variable */ + return VGLOBAL; + } + else { + int v = searchvar(fs, n); /* look up at current level */ + if (v >= 0) { + init_exp(var, VLOCAL, v); + if (!base) + markupval(fs, v); /* local will be used as an upval */ + return VLOCAL; + } + else { /* not found at current level; try upper one */ + if (singlevaraux(fs->prev, n, var, 0) == VGLOBAL) + return VGLOBAL; + var->u.s.info = indexupvalue(fs, n, var); /* else was LOCAL or UPVAL */ + var->k = VUPVAL; /* upvalue in this level */ + return VUPVAL; + } + } +} + + +static void singlevar (LexState *ls, expdesc *var) { + TString *varname = str_checkname(ls); + FuncState *fs = ls->fs; + if (singlevaraux(fs, varname, var, 1) == VGLOBAL) + var->u.s.info = luaK_stringK(fs, varname); /* info points to global name */ +} + + +static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) { + FuncState *fs = ls->fs; + int extra = nvars - nexps; + if (hasmultret(e->k)) { + extra++; /* includes call itself */ + if (extra < 0) extra = 0; + luaK_setreturns(fs, e, extra); /* last exp. provides the difference */ + if (extra > 1) luaK_reserveregs(fs, extra-1); + } + else { + if (e->k != VVOID) luaK_exp2nextreg(fs, e); /* close last expression */ + if (extra > 0) { + int reg = fs->freereg; + luaK_reserveregs(fs, extra); + luaK_nil(fs, reg, extra); + } + } +} + + +static void enterlevel (LexState *ls) { + if (++ls->L->nCcalls > LUAI_MAXCCALLS) + luaX_lexerror(ls, "chunk has too many syntax levels", 0); +} + + +#define leavelevel(ls) ((ls)->L->nCcalls--) + + +static void enterblock (FuncState *fs, BlockCnt *bl, lu_byte isbreakable) { + bl->breaklist = NO_JUMP; + bl->isbreakable = isbreakable; + bl->nactvar = fs->nactvar; + bl->upval = 0; + bl->previous = fs->bl; + fs->bl = bl; + lua_assert(fs->freereg == fs->nactvar); +} + + +static void leaveblock (FuncState *fs) { + BlockCnt *bl = fs->bl; + fs->bl = bl->previous; + removevars(fs->ls, bl->nactvar); + if (bl->upval) + luaK_codeABC(fs, OP_CLOSE, bl->nactvar, 0, 0); + /* a block either controls scope or breaks (never both) */ + lua_assert(!bl->isbreakable || !bl->upval); + lua_assert(bl->nactvar == fs->nactvar); + fs->freereg = fs->nactvar; /* free registers */ + luaK_patchtohere(fs, bl->breaklist); +} + + +static void pushclosure (LexState *ls, FuncState *func, expdesc *v) { + FuncState *fs = ls->fs; + Proto *f = fs->f; + int oldsize = f->sizep; + int i; + luaM_growvector(ls->L, f->p, fs->np, f->sizep, Proto *, + MAXARG_Bx, "constant table overflow"); + while (oldsize < f->sizep) f->p[oldsize++] = NULL; + f->p[fs->np++] = func->f; + luaC_objbarrier(ls->L, f, func->f); + init_exp(v, VRELOCABLE, luaK_codeABx(fs, OP_CLOSURE, 0, fs->np-1)); + for (i=0; if->nups; i++) { + OpCode o = (func->upvalues[i].k == VLOCAL) ? OP_MOVE : OP_GETUPVAL; + luaK_codeABC(fs, o, 0, func->upvalues[i].info, 0); + } +} + + +static void open_func (LexState *ls, FuncState *fs) { + lua_State *L = ls->L; + Proto *f = luaF_newproto(L); + fs->f = f; + fs->prev = ls->fs; /* linked list of funcstates */ + fs->ls = ls; + fs->L = L; + ls->fs = fs; + fs->pc = 0; + fs->lasttarget = -1; + fs->jpc = NO_JUMP; + fs->freereg = 0; + fs->nk = 0; + fs->np = 0; + fs->nlocvars = 0; + fs->nactvar = 0; + fs->bl = NULL; + f->source = ls->source; + f->maxstacksize = 2; /* registers 0/1 are always valid */ + fs->h = luaH_new(L, 0, 0); + /* anchor table of constants and prototype (to avoid being collected) */ + sethvalue2s(L, L->top, fs->h); + incr_top(L); + setptvalue2s(L, L->top, f); + incr_top(L); +} + + +static void close_func (LexState *ls) { + lua_State *L = ls->L; + FuncState *fs = ls->fs; + Proto *f = fs->f; + removevars(ls, 0); + luaK_ret(fs, 0, 0); /* final return */ + luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction); + f->sizecode = fs->pc; + luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->pc, int); + f->sizelineinfo = fs->pc; + luaM_reallocvector(L, f->k, f->sizek, fs->nk, TValue); + f->sizek = fs->nk; + luaM_reallocvector(L, f->p, f->sizep, fs->np, Proto *); + f->sizep = fs->np; + luaM_reallocvector(L, f->locvars, f->sizelocvars, fs->nlocvars, LocVar); + f->sizelocvars = fs->nlocvars; + luaM_reallocvector(L, f->upvalues, f->sizeupvalues, f->nups, TString *); + f->sizeupvalues = f->nups; + lua_assert(luaG_checkcode(f)); + lua_assert(fs->bl == NULL); + ls->fs = fs->prev; + L->top -= 2; /* remove table and prototype from the stack */ + /* last token read was anchored in defunct function; must reanchor it */ + if (fs) anchor_token(ls); +} + + +Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) { + struct LexState lexstate; + struct FuncState funcstate; + lexstate.buff = buff; + luaX_setinput(L, &lexstate, z, luaS_new(L, name)); + open_func(&lexstate, &funcstate); + funcstate.f->is_vararg = VARARG_ISVARARG; /* main func. is always vararg */ + luaX_next(&lexstate); /* read first token */ + chunk(&lexstate); + check(&lexstate, TK_EOS); + close_func(&lexstate); + lua_assert(funcstate.prev == NULL); + lua_assert(funcstate.f->nups == 0); + lua_assert(lexstate.fs == NULL); + return funcstate.f; +} + + + +/*============================================================*/ +/* GRAMMAR RULES */ +/*============================================================*/ + + +static void field (LexState *ls, expdesc *v) { + /* field -> ['.' | ':'] NAME */ + FuncState *fs = ls->fs; + expdesc key; + luaK_exp2anyreg(fs, v); + luaX_next(ls); /* skip the dot or colon */ + checkname(ls, &key); + luaK_indexed(fs, v, &key); +} + + +static void yindex (LexState *ls, expdesc *v) { + /* index -> '[' expr ']' */ + luaX_next(ls); /* skip the '[' */ + expr(ls, v); + luaK_exp2val(ls->fs, v); + checknext(ls, ']'); +} + + +/* +** {====================================================================== +** Rules for Constructors +** ======================================================================= +*/ + + +struct ConsControl { + expdesc v; /* last list item read */ + expdesc *t; /* table descriptor */ + int nh; /* total number of `record' elements */ + int na; /* total number of array elements */ + int tostore; /* number of array elements pending to be stored */ +}; + + +static void recfield (LexState *ls, struct ConsControl *cc) { + /* recfield -> (NAME | `['exp1`]') = exp1 */ + FuncState *fs = ls->fs; + int reg = ls->fs->freereg; + expdesc key, val; + int rkkey; + if (ls->t.token == TK_NAME) { + luaY_checklimit(fs, cc->nh, MAX_INT, "items in a constructor"); + checkname(ls, &key); + } + else /* ls->t.token == '[' */ + yindex(ls, &key); + cc->nh++; + checknext(ls, '='); + rkkey = luaK_exp2RK(fs, &key); + expr(ls, &val); + luaK_codeABC(fs, OP_SETTABLE, cc->t->u.s.info, rkkey, luaK_exp2RK(fs, &val)); + fs->freereg = reg; /* free registers */ +} + + +static void closelistfield (FuncState *fs, struct ConsControl *cc) { + if (cc->v.k == VVOID) return; /* there is no list item */ + luaK_exp2nextreg(fs, &cc->v); + cc->v.k = VVOID; + if (cc->tostore == LFIELDS_PER_FLUSH) { + luaK_setlist(fs, cc->t->u.s.info, cc->na, cc->tostore); /* flush */ + cc->tostore = 0; /* no more items pending */ + } +} + + +static void lastlistfield (FuncState *fs, struct ConsControl *cc) { + if (cc->tostore == 0) return; + if (hasmultret(cc->v.k)) { + luaK_setmultret(fs, &cc->v); + luaK_setlist(fs, cc->t->u.s.info, cc->na, LUA_MULTRET); + cc->na--; /* do not count last expression (unknown number of elements) */ + } + else { + if (cc->v.k != VVOID) + luaK_exp2nextreg(fs, &cc->v); + luaK_setlist(fs, cc->t->u.s.info, cc->na, cc->tostore); + } +} + + +static void listfield (LexState *ls, struct ConsControl *cc) { + expr(ls, &cc->v); + luaY_checklimit(ls->fs, cc->na, MAX_INT, "items in a constructor"); + cc->na++; + cc->tostore++; +} + + +static void constructor (LexState *ls, expdesc *t) { + /* constructor -> ?? */ + FuncState *fs = ls->fs; + int line = ls->linenumber; + int pc = luaK_codeABC(fs, OP_NEWTABLE, 0, 0, 0); + struct ConsControl cc; + cc.na = cc.nh = cc.tostore = 0; + cc.t = t; + init_exp(t, VRELOCABLE, pc); + init_exp(&cc.v, VVOID, 0); /* no value (yet) */ + luaK_exp2nextreg(ls->fs, t); /* fix it at stack top (for gc) */ + checknext(ls, '{'); + do { + lua_assert(cc.v.k == VVOID || cc.tostore > 0); + if (ls->t.token == '}') break; + closelistfield(fs, &cc); + switch(ls->t.token) { + case TK_NAME: { /* may be listfields or recfields */ + luaX_lookahead(ls); + if (ls->lookahead.token != '=') /* expression? */ + listfield(ls, &cc); + else + recfield(ls, &cc); + break; + } + case '[': { /* constructor_item -> recfield */ + recfield(ls, &cc); + break; + } + default: { /* constructor_part -> listfield */ + listfield(ls, &cc); + break; + } + } + } while (testnext(ls, ',') || testnext(ls, ';')); + check_match(ls, '}', '{', line); + lastlistfield(fs, &cc); + SETARG_B(fs->f->code[pc], luaO_int2fb(cc.na)); /* set initial array size */ + SETARG_C(fs->f->code[pc], luaO_int2fb(cc.nh)); /* set initial table size */ +} + +/* }====================================================================== */ + + + +static void parlist (LexState *ls) { + /* parlist -> [ param { `,' param } ] */ + FuncState *fs = ls->fs; + Proto *f = fs->f; + int nparams = 0; + f->is_vararg = 0; + if (ls->t.token != ')') { /* is `parlist' not empty? */ + do { + switch (ls->t.token) { + case TK_NAME: { /* param -> NAME */ + new_localvar(ls, str_checkname(ls), nparams++); + break; + } + case TK_DOTS: { /* param -> `...' */ + luaX_next(ls); +#if defined(LUA_COMPAT_VARARG) + /* use `arg' as default name */ + new_localvarliteral(ls, "arg", nparams++); + f->is_vararg = VARARG_HASARG | VARARG_NEEDSARG; +#endif + f->is_vararg |= VARARG_ISVARARG; + break; + } + default: luaX_syntaxerror(ls, " or " LUA_QL("...") " expected"); + } + } while (!f->is_vararg && testnext(ls, ',')); + } + adjustlocalvars(ls, nparams); + f->numparams = cast_byte(fs->nactvar - (f->is_vararg & VARARG_HASARG)); + luaK_reserveregs(fs, fs->nactvar); /* reserve register for parameters */ +} + + +static void body (LexState *ls, expdesc *e, int needself, int line) { + /* body -> `(' parlist `)' chunk END */ + FuncState new_fs; + open_func(ls, &new_fs); + new_fs.f->linedefined = line; + checknext(ls, '('); + if (needself) { + new_localvarliteral(ls, "self", 0); + adjustlocalvars(ls, 1); + } + parlist(ls); + checknext(ls, ')'); + chunk(ls); + new_fs.f->lastlinedefined = ls->linenumber; + check_match(ls, TK_END, TK_FUNCTION, line); + close_func(ls); + pushclosure(ls, &new_fs, e); +} + + +static int explist1 (LexState *ls, expdesc *v) { + /* explist1 -> expr { `,' expr } */ + int n = 1; /* at least one expression */ + expr(ls, v); + while (testnext(ls, ',')) { + luaK_exp2nextreg(ls->fs, v); + expr(ls, v); + n++; + } + return n; +} + + +static void funcargs (LexState *ls, expdesc *f) { + FuncState *fs = ls->fs; + expdesc args; + int base, nparams; + int line = ls->linenumber; + switch (ls->t.token) { + case '(': { /* funcargs -> `(' [ explist1 ] `)' */ + if (line != ls->lastline) + luaX_syntaxerror(ls,"ambiguous syntax (function call x new statement)"); + luaX_next(ls); + if (ls->t.token == ')') /* arg list is empty? */ + args.k = VVOID; + else { + explist1(ls, &args); + luaK_setmultret(fs, &args); + } + check_match(ls, ')', '(', line); + break; + } + case '{': { /* funcargs -> constructor */ + constructor(ls, &args); + break; + } + case TK_STRING: { /* funcargs -> STRING */ + codestring(ls, &args, ls->t.seminfo.ts); + luaX_next(ls); /* must use `seminfo' before `next' */ + break; + } + default: { + luaX_syntaxerror(ls, "function arguments expected"); + return; + } + } + lua_assert(f->k == VNONRELOC); + base = f->u.s.info; /* base register for call */ + if (hasmultret(args.k)) + nparams = LUA_MULTRET; /* open call */ + else { + if (args.k != VVOID) + luaK_exp2nextreg(fs, &args); /* close last argument */ + nparams = fs->freereg - (base+1); + } + init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, nparams+1, 2)); + luaK_fixline(fs, line); + fs->freereg = base+1; /* call remove function and arguments and leaves + (unless changed) one result */ +} + + + + +/* +** {====================================================================== +** Expression parsing +** ======================================================================= +*/ + + +static void prefixexp (LexState *ls, expdesc *v) { + /* prefixexp -> NAME | '(' expr ')' */ + switch (ls->t.token) { + case '(': { + int line = ls->linenumber; + luaX_next(ls); + expr(ls, v); + check_match(ls, ')', '(', line); + luaK_dischargevars(ls->fs, v); + return; + } + case TK_NAME: { + singlevar(ls, v); + return; + } + default: { + luaX_syntaxerror(ls, "unexpected symbol"); + return; + } + } +} + + +static void primaryexp (LexState *ls, expdesc *v) { + /* primaryexp -> + prefixexp { `.' NAME | `[' exp `]' | `:' NAME funcargs | funcargs } */ + FuncState *fs = ls->fs; + prefixexp(ls, v); + for (;;) { + switch (ls->t.token) { + case '.': { /* field */ + field(ls, v); + break; + } + case '[': { /* `[' exp1 `]' */ + expdesc key; + luaK_exp2anyreg(fs, v); + yindex(ls, &key); + luaK_indexed(fs, v, &key); + break; + } + case ':': { /* `:' NAME funcargs */ + expdesc key; + luaX_next(ls); + checkname(ls, &key); + luaK_self(fs, v, &key); + funcargs(ls, v); + break; + } + case '(': case TK_STRING: case '{': { /* funcargs */ + luaK_exp2nextreg(fs, v); + funcargs(ls, v); + break; + } + default: return; + } + } +} + + +static void simpleexp (LexState *ls, expdesc *v) { + /* simpleexp -> NUMBER | STRING | NIL | true | false | ... | + constructor | FUNCTION body | primaryexp */ + switch (ls->t.token) { + case TK_NUMBER: { + init_exp(v, VKNUM, 0); + v->u.nval = ls->t.seminfo.r; + break; + } + case TK_STRING: { + codestring(ls, v, ls->t.seminfo.ts); + break; + } + case TK_NIL: { + init_exp(v, VNIL, 0); + break; + } + case TK_TRUE: { + init_exp(v, VTRUE, 0); + break; + } + case TK_FALSE: { + init_exp(v, VFALSE, 0); + break; + } + case TK_DOTS: { /* vararg */ + FuncState *fs = ls->fs; + check_condition(ls, fs->f->is_vararg, + "cannot use " LUA_QL("...") " outside a vararg function"); + fs->f->is_vararg &= ~VARARG_NEEDSARG; /* don't need 'arg' */ + init_exp(v, VVARARG, luaK_codeABC(fs, OP_VARARG, 0, 1, 0)); + break; + } + case '{': { /* constructor */ + constructor(ls, v); + return; + } + case TK_FUNCTION: { + luaX_next(ls); + body(ls, v, 0, ls->linenumber); + return; + } + default: { + primaryexp(ls, v); + return; + } + } + luaX_next(ls); +} + + +static UnOpr getunopr (int op) { + switch (op) { + case TK_NOT: return OPR_NOT; + case '-': return OPR_MINUS; + case '#': return OPR_LEN; + default: return OPR_NOUNOPR; + } +} + + +static BinOpr getbinopr (int op) { + switch (op) { + case '+': return OPR_ADD; + case '-': return OPR_SUB; + case '*': return OPR_MUL; + case '/': return OPR_DIV; + case '%': return OPR_MOD; + case '^': return OPR_POW; + case TK_CONCAT: return OPR_CONCAT; + case TK_NE: return OPR_NE; + case TK_EQ: return OPR_EQ; + case '<': return OPR_LT; + case TK_LE: return OPR_LE; + case '>': return OPR_GT; + case TK_GE: return OPR_GE; + case TK_AND: return OPR_AND; + case TK_OR: return OPR_OR; + default: return OPR_NOBINOPR; + } +} + + +static const struct { + lu_byte left; /* left priority for each binary operator */ + lu_byte right; /* right priority */ +} priority[] = { /* ORDER OPR */ + {6, 6}, {6, 6}, {7, 7}, {7, 7}, {7, 7}, /* `+' `-' `/' `%' */ + {10, 9}, {5, 4}, /* power and concat (right associative) */ + {3, 3}, {3, 3}, /* equality and inequality */ + {3, 3}, {3, 3}, {3, 3}, {3, 3}, /* order */ + {2, 2}, {1, 1} /* logical (and/or) */ +}; + +#define UNARY_PRIORITY 8 /* priority for unary operators */ + + +/* +** subexpr -> (simpleexp | unop subexpr) { binop subexpr } +** where `binop' is any binary operator with a priority higher than `limit' +*/ +static BinOpr subexpr (LexState *ls, expdesc *v, unsigned int limit) { + BinOpr op; + UnOpr uop; + enterlevel(ls); + uop = getunopr(ls->t.token); + if (uop != OPR_NOUNOPR) { + luaX_next(ls); + subexpr(ls, v, UNARY_PRIORITY); + luaK_prefix(ls->fs, uop, v); + } + else simpleexp(ls, v); + /* expand while operators have priorities higher than `limit' */ + op = getbinopr(ls->t.token); + while (op != OPR_NOBINOPR && priority[op].left > limit) { + expdesc v2; + BinOpr nextop; + luaX_next(ls); + luaK_infix(ls->fs, op, v); + /* read sub-expression with higher priority */ + nextop = subexpr(ls, &v2, priority[op].right); + luaK_posfix(ls->fs, op, v, &v2); + op = nextop; + } + leavelevel(ls); + return op; /* return first untreated operator */ +} + + +static void expr (LexState *ls, expdesc *v) { + subexpr(ls, v, 0); +} + +/* }==================================================================== */ + + + +/* +** {====================================================================== +** Rules for Statements +** ======================================================================= +*/ + + +static int block_follow (int token) { + switch (token) { + case TK_ELSE: case TK_ELSEIF: case TK_END: + case TK_UNTIL: case TK_EOS: + return 1; + default: return 0; + } +} + + +static void block (LexState *ls) { + /* block -> chunk */ + FuncState *fs = ls->fs; + BlockCnt bl; + enterblock(fs, &bl, 0); + chunk(ls); + lua_assert(bl.breaklist == NO_JUMP); + leaveblock(fs); +} + + +/* +** structure to chain all variables in the left-hand side of an +** assignment +*/ +struct LHS_assign { + struct LHS_assign *prev; + expdesc v; /* variable (global, local, upvalue, or indexed) */ +}; + + +/* +** check whether, in an assignment to a local variable, the local variable +** is needed in a previous assignment (to a table). If so, save original +** local value in a safe place and use this safe copy in the previous +** assignment. +*/ +static void check_conflict (LexState *ls, struct LHS_assign *lh, expdesc *v) { + FuncState *fs = ls->fs; + int extra = fs->freereg; /* eventual position to save local variable */ + int conflict = 0; + for (; lh; lh = lh->prev) { + if (lh->v.k == VINDEXED) { + if (lh->v.u.s.info == v->u.s.info) { /* conflict? */ + conflict = 1; + lh->v.u.s.info = extra; /* previous assignment will use safe copy */ + } + if (lh->v.u.s.aux == v->u.s.info) { /* conflict? */ + conflict = 1; + lh->v.u.s.aux = extra; /* previous assignment will use safe copy */ + } + } + } + if (conflict) { + luaK_codeABC(fs, OP_MOVE, fs->freereg, v->u.s.info, 0); /* make copy */ + luaK_reserveregs(fs, 1); + } +} + + +static void assignment (LexState *ls, struct LHS_assign *lh, int nvars) { + expdesc e; + check_condition(ls, VLOCAL <= lh->v.k && lh->v.k <= VINDEXED, + "syntax error"); + if (testnext(ls, ',')) { /* assignment -> `,' primaryexp assignment */ + struct LHS_assign nv; + nv.prev = lh; + primaryexp(ls, &nv.v); + if (nv.v.k == VLOCAL) + check_conflict(ls, lh, &nv.v); + luaY_checklimit(ls->fs, nvars, LUAI_MAXCCALLS - ls->L->nCcalls, + "variables in assignment"); + assignment(ls, &nv, nvars+1); + } + else { /* assignment -> `=' explist1 */ + int nexps; + checknext(ls, '='); + nexps = explist1(ls, &e); + if (nexps != nvars) { + adjust_assign(ls, nvars, nexps, &e); + if (nexps > nvars) + ls->fs->freereg -= nexps - nvars; /* remove extra values */ + } + else { + luaK_setoneret(ls->fs, &e); /* close last expression */ + luaK_storevar(ls->fs, &lh->v, &e); + return; /* avoid default */ + } + } + init_exp(&e, VNONRELOC, ls->fs->freereg-1); /* default assignment */ + luaK_storevar(ls->fs, &lh->v, &e); +} + + +static int cond (LexState *ls) { + /* cond -> exp */ + expdesc v; + expr(ls, &v); /* read condition */ + if (v.k == VNIL) v.k = VFALSE; /* `falses' are all equal here */ + luaK_goiftrue(ls->fs, &v); + return v.f; +} + + +static void breakstat (LexState *ls) { + FuncState *fs = ls->fs; + BlockCnt *bl = fs->bl; + int upval = 0; + while (bl && !bl->isbreakable) { + upval |= bl->upval; + bl = bl->previous; + } + if (!bl) + luaX_syntaxerror(ls, "no loop to break"); + if (upval) + luaK_codeABC(fs, OP_CLOSE, bl->nactvar, 0, 0); + luaK_concat(fs, &bl->breaklist, luaK_jump(fs)); +} + + +static void whilestat (LexState *ls, int line) { + /* whilestat -> WHILE cond DO block END */ + FuncState *fs = ls->fs; + int whileinit; + int condexit; + BlockCnt bl; + luaX_next(ls); /* skip WHILE */ + whileinit = luaK_getlabel(fs); + condexit = cond(ls); + enterblock(fs, &bl, 1); + checknext(ls, TK_DO); + block(ls); + luaK_patchlist(fs, luaK_jump(fs), whileinit); + check_match(ls, TK_END, TK_WHILE, line); + leaveblock(fs); + luaK_patchtohere(fs, condexit); /* false conditions finish the loop */ +} + + +static void repeatstat (LexState *ls, int line) { + /* repeatstat -> REPEAT block UNTIL cond */ + int condexit; + FuncState *fs = ls->fs; + int repeat_init = luaK_getlabel(fs); + BlockCnt bl1, bl2; + enterblock(fs, &bl1, 1); /* loop block */ + enterblock(fs, &bl2, 0); /* scope block */ + luaX_next(ls); /* skip REPEAT */ + chunk(ls); + check_match(ls, TK_UNTIL, TK_REPEAT, line); + condexit = cond(ls); /* read condition (inside scope block) */ + if (!bl2.upval) { /* no upvalues? */ + leaveblock(fs); /* finish scope */ + luaK_patchlist(ls->fs, condexit, repeat_init); /* close the loop */ + } + else { /* complete semantics when there are upvalues */ + breakstat(ls); /* if condition then break */ + luaK_patchtohere(ls->fs, condexit); /* else... */ + leaveblock(fs); /* finish scope... */ + luaK_patchlist(ls->fs, luaK_jump(fs), repeat_init); /* and repeat */ + } + leaveblock(fs); /* finish loop */ +} + + +static int exp1 (LexState *ls) { + expdesc e; + int k; + expr(ls, &e); + k = e.k; + luaK_exp2nextreg(ls->fs, &e); + return k; +} + + +static void forbody (LexState *ls, int base, int line, int nvars, int isnum) { + /* forbody -> DO block */ + BlockCnt bl; + FuncState *fs = ls->fs; + int prep, endfor; + adjustlocalvars(ls, 3); /* control variables */ + checknext(ls, TK_DO); + prep = isnum ? luaK_codeAsBx(fs, OP_FORPREP, base, NO_JUMP) : luaK_jump(fs); + enterblock(fs, &bl, 0); /* scope for declared variables */ + adjustlocalvars(ls, nvars); + luaK_reserveregs(fs, nvars); + block(ls); + leaveblock(fs); /* end of scope for declared variables */ + luaK_patchtohere(fs, prep); + endfor = (isnum) ? luaK_codeAsBx(fs, OP_FORLOOP, base, NO_JUMP) : + luaK_codeABC(fs, OP_TFORLOOP, base, 0, nvars); + luaK_fixline(fs, line); /* pretend that `OP_FOR' starts the loop */ + luaK_patchlist(fs, (isnum ? endfor : luaK_jump(fs)), prep + 1); +} + + +static void fornum (LexState *ls, TString *varname, int line) { + /* fornum -> NAME = exp1,exp1[,exp1] forbody */ + FuncState *fs = ls->fs; + int base = fs->freereg; + new_localvarliteral(ls, "(for index)", 0); + new_localvarliteral(ls, "(for limit)", 1); + new_localvarliteral(ls, "(for step)", 2); + new_localvar(ls, varname, 3); + checknext(ls, '='); + exp1(ls); /* initial value */ + checknext(ls, ','); + exp1(ls); /* limit */ + if (testnext(ls, ',')) + exp1(ls); /* optional step */ + else { /* default step = 1 */ + luaK_codeABx(fs, OP_LOADK, fs->freereg, luaK_numberK(fs, 1)); + luaK_reserveregs(fs, 1); + } + forbody(ls, base, line, 1, 1); +} + + +static void forlist (LexState *ls, TString *indexname) { + /* forlist -> NAME {,NAME} IN explist1 forbody */ + FuncState *fs = ls->fs; + expdesc e; + int nvars = 0; + int line; + int base = fs->freereg; + /* create control variables */ + new_localvarliteral(ls, "(for generator)", nvars++); + new_localvarliteral(ls, "(for state)", nvars++); + new_localvarliteral(ls, "(for control)", nvars++); + /* create declared variables */ + new_localvar(ls, indexname, nvars++); + while (testnext(ls, ',')) + new_localvar(ls, str_checkname(ls), nvars++); + checknext(ls, TK_IN); + line = ls->linenumber; + adjust_assign(ls, 3, explist1(ls, &e), &e); + luaK_checkstack(fs, 3); /* extra space to call generator */ + forbody(ls, base, line, nvars - 3, 0); +} + + +static void forstat (LexState *ls, int line) { + /* forstat -> FOR (fornum | forlist) END */ + FuncState *fs = ls->fs; + TString *varname; + BlockCnt bl; + enterblock(fs, &bl, 1); /* scope for loop and control variables */ + luaX_next(ls); /* skip `for' */ + varname = str_checkname(ls); /* first variable name */ + switch (ls->t.token) { + case '=': fornum(ls, varname, line); break; + case ',': case TK_IN: forlist(ls, varname); break; + default: luaX_syntaxerror(ls, LUA_QL("=") " or " LUA_QL("in") " expected"); + } + check_match(ls, TK_END, TK_FOR, line); + leaveblock(fs); /* loop scope (`break' jumps to this point) */ +} + + +static int test_then_block (LexState *ls) { + /* test_then_block -> [IF | ELSEIF] cond THEN block */ + int condexit; + luaX_next(ls); /* skip IF or ELSEIF */ + condexit = cond(ls); + checknext(ls, TK_THEN); + block(ls); /* `then' part */ + return condexit; +} + + +static void ifstat (LexState *ls, int line) { + /* ifstat -> IF cond THEN block {ELSEIF cond THEN block} [ELSE block] END */ + FuncState *fs = ls->fs; + int flist; + int escapelist = NO_JUMP; + flist = test_then_block(ls); /* IF cond THEN block */ + while (ls->t.token == TK_ELSEIF) { + luaK_concat(fs, &escapelist, luaK_jump(fs)); + luaK_patchtohere(fs, flist); + flist = test_then_block(ls); /* ELSEIF cond THEN block */ + } + if (ls->t.token == TK_ELSE) { + luaK_concat(fs, &escapelist, luaK_jump(fs)); + luaK_patchtohere(fs, flist); + luaX_next(ls); /* skip ELSE (after patch, for correct line info) */ + block(ls); /* `else' part */ + } + else + luaK_concat(fs, &escapelist, flist); + luaK_patchtohere(fs, escapelist); + check_match(ls, TK_END, TK_IF, line); +} + + +static void localfunc (LexState *ls) { + expdesc v, b; + FuncState *fs = ls->fs; + new_localvar(ls, str_checkname(ls), 0); + init_exp(&v, VLOCAL, fs->freereg); + luaK_reserveregs(fs, 1); + adjustlocalvars(ls, 1); + body(ls, &b, 0, ls->linenumber); + luaK_storevar(fs, &v, &b); + /* debug information will only see the variable after this point! */ + getlocvar(fs, fs->nactvar - 1).startpc = fs->pc; +} + + +static void localstat (LexState *ls) { + /* stat -> LOCAL NAME {`,' NAME} [`=' explist1] */ + int nvars = 0; + int nexps; + expdesc e; + do { + new_localvar(ls, str_checkname(ls), nvars++); + } while (testnext(ls, ',')); + if (testnext(ls, '=')) + nexps = explist1(ls, &e); + else { + e.k = VVOID; + nexps = 0; + } + adjust_assign(ls, nvars, nexps, &e); + adjustlocalvars(ls, nvars); +} + + +static int funcname (LexState *ls, expdesc *v) { + /* funcname -> NAME {field} [`:' NAME] */ + int needself = 0; + singlevar(ls, v); + while (ls->t.token == '.') + field(ls, v); + if (ls->t.token == ':') { + needself = 1; + field(ls, v); + } + return needself; +} + + +static void funcstat (LexState *ls, int line) { + /* funcstat -> FUNCTION funcname body */ + int needself; + expdesc v, b; + luaX_next(ls); /* skip FUNCTION */ + needself = funcname(ls, &v); + body(ls, &b, needself, line); + luaK_storevar(ls->fs, &v, &b); + luaK_fixline(ls->fs, line); /* definition `happens' in the first line */ +} + + +static void exprstat (LexState *ls) { + /* stat -> func | assignment */ + FuncState *fs = ls->fs; + struct LHS_assign v; + primaryexp(ls, &v.v); + if (v.v.k == VCALL) /* stat -> func */ + SETARG_C(getcode(fs, &v.v), 1); /* call statement uses no results */ + else { /* stat -> assignment */ + v.prev = NULL; + assignment(ls, &v, 1); + } +} + + +static void retstat (LexState *ls) { + /* stat -> RETURN explist */ + FuncState *fs = ls->fs; + expdesc e; + int first, nret; /* registers with returned values */ + luaX_next(ls); /* skip RETURN */ + if (block_follow(ls->t.token) || ls->t.token == ';') + first = nret = 0; /* return no values */ + else { + nret = explist1(ls, &e); /* optional return values */ + if (hasmultret(e.k)) { + luaK_setmultret(fs, &e); + if (e.k == VCALL && nret == 1) { /* tail call? */ + SET_OPCODE(getcode(fs,&e), OP_TAILCALL); + lua_assert(GETARG_A(getcode(fs,&e)) == fs->nactvar); + } + first = fs->nactvar; + nret = LUA_MULTRET; /* return all values */ + } + else { + if (nret == 1) /* only one single value? */ + first = luaK_exp2anyreg(fs, &e); + else { + luaK_exp2nextreg(fs, &e); /* values must go to the `stack' */ + first = fs->nactvar; /* return all `active' values */ + lua_assert(nret == fs->freereg - first); + } + } + } + luaK_ret(fs, first, nret); +} + + +static int statement (LexState *ls) { + int line = ls->linenumber; /* may be needed for error messages */ + switch (ls->t.token) { + case TK_IF: { /* stat -> ifstat */ + ifstat(ls, line); + return 0; + } + case TK_WHILE: { /* stat -> whilestat */ + whilestat(ls, line); + return 0; + } + case TK_DO: { /* stat -> DO block END */ + luaX_next(ls); /* skip DO */ + block(ls); + check_match(ls, TK_END, TK_DO, line); + return 0; + } + case TK_FOR: { /* stat -> forstat */ + forstat(ls, line); + return 0; + } + case TK_REPEAT: { /* stat -> repeatstat */ + repeatstat(ls, line); + return 0; + } + case TK_FUNCTION: { + funcstat(ls, line); /* stat -> funcstat */ + return 0; + } + case TK_LOCAL: { /* stat -> localstat */ + luaX_next(ls); /* skip LOCAL */ + if (testnext(ls, TK_FUNCTION)) /* local function? */ + localfunc(ls); + else + localstat(ls); + return 0; + } + case TK_RETURN: { /* stat -> retstat */ + retstat(ls); + return 1; /* must be last statement */ + } + case TK_BREAK: { /* stat -> breakstat */ + luaX_next(ls); /* skip BREAK */ + breakstat(ls); + return 1; /* must be last statement */ + } + default: { + exprstat(ls); + return 0; /* to avoid warnings */ + } + } +} + + +static void chunk (LexState *ls) { + /* chunk -> { stat [`;'] } */ + int islast = 0; + enterlevel(ls); + while (!islast && !block_follow(ls->t.token)) { + islast = statement(ls); + testnext(ls, ';'); + lua_assert(ls->fs->f->maxstacksize >= ls->fs->freereg && + ls->fs->freereg >= ls->fs->nactvar); + ls->fs->freereg = ls->fs->nactvar; /* free registers */ + } + leavelevel(ls); +} + +/* }====================================================================== */ diff --git a/rpm-5.4.9/lua/lparser.h b/rpm-5.4.9/lua/lparser.h new file mode 100644 index 0000000..18836af --- /dev/null +++ b/rpm-5.4.9/lua/lparser.h @@ -0,0 +1,82 @@ +/* +** $Id: lparser.h,v 1.57.1.1 2007/12/27 13:02:25 roberto Exp $ +** Lua Parser +** See Copyright Notice in lua.h +*/ + +#ifndef lparser_h +#define lparser_h + +#include "llimits.h" +#include "lobject.h" +#include "lzio.h" + + +/* +** Expression descriptor +*/ + +typedef enum { + VVOID, /* no value */ + VNIL, + VTRUE, + VFALSE, + VK, /* info = index of constant in `k' */ + VKNUM, /* nval = numerical value */ + VLOCAL, /* info = local register */ + VUPVAL, /* info = index of upvalue in `upvalues' */ + VGLOBAL, /* info = index of table; aux = index of global name in `k' */ + VINDEXED, /* info = table register; aux = index register (or `k') */ + VJMP, /* info = instruction pc */ + VRELOCABLE, /* info = instruction pc */ + VNONRELOC, /* info = result register */ + VCALL, /* info = instruction pc */ + VVARARG /* info = instruction pc */ +} expkind; + +typedef struct expdesc { + expkind k; + union { + struct { int info, aux; } s; + lua_Number nval; + } u; + int t; /* patch list of `exit when true' */ + int f; /* patch list of `exit when false' */ +} expdesc; + + +typedef struct upvaldesc { + lu_byte k; + lu_byte info; +} upvaldesc; + + +struct BlockCnt; /* defined in lparser.c */ + + +/* state needed to generate code for a given function */ +typedef struct FuncState { + Proto *f; /* current function header */ + Table *h; /* table to find (and reuse) elements in `k' */ + struct FuncState *prev; /* enclosing function */ + struct LexState *ls; /* lexical state */ + struct lua_State *L; /* copy of the Lua state */ + struct BlockCnt *bl; /* chain of current blocks */ + int pc; /* next position to code (equivalent to `ncode') */ + int lasttarget; /* `pc' of last `jump target' */ + int jpc; /* list of pending jumps to `pc' */ + int freereg; /* first free register */ + int nk; /* number of elements in `k' */ + int np; /* number of elements in `p' */ + short nlocvars; /* number of elements in `locvars' */ + lu_byte nactvar; /* number of active local variables */ + upvaldesc upvalues[LUAI_MAXUPVALUES]; /* upvalues */ + unsigned short actvar[LUAI_MAXVARS]; /* declared-variable stack */ +} FuncState; + + +LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, + const char *name); + + +#endif diff --git a/rpm-5.4.9/lua/lstate.c b/rpm-5.4.9/lua/lstate.c new file mode 100644 index 0000000..4313b83 --- /dev/null +++ b/rpm-5.4.9/lua/lstate.c @@ -0,0 +1,214 @@ +/* +** $Id: lstate.c,v 2.36.1.2 2008/01/03 15:20:39 roberto Exp $ +** Global State +** See Copyright Notice in lua.h +*/ + + +#include + +#define lstate_c +#define LUA_CORE + +#include "lua.h" + +#include "ldebug.h" +#include "ldo.h" +#include "lfunc.h" +#include "lgc.h" +#include "llex.h" +#include "lmem.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" +#include "ltm.h" + + +#define state_size(x) (sizeof(x) + LUAI_EXTRASPACE) +#define fromstate(l) (cast(lu_byte *, (l)) - LUAI_EXTRASPACE) +#define tostate(l) (cast(lua_State *, cast(lu_byte *, l) + LUAI_EXTRASPACE)) + + +/* +** Main thread combines a thread state and the global state +*/ +typedef struct LG { + lua_State l; + global_State g; +} LG; + + + +static void stack_init (lua_State *L1, lua_State *L) { + /* initialize CallInfo array */ + L1->base_ci = luaM_newvector(L, BASIC_CI_SIZE, CallInfo); + L1->ci = L1->base_ci; + L1->size_ci = BASIC_CI_SIZE; + L1->end_ci = L1->base_ci + L1->size_ci - 1; + /* initialize stack array */ + L1->stack = luaM_newvector(L, BASIC_STACK_SIZE + EXTRA_STACK, TValue); + L1->stacksize = BASIC_STACK_SIZE + EXTRA_STACK; + L1->top = L1->stack; + L1->stack_last = L1->stack+(L1->stacksize - EXTRA_STACK)-1; + /* initialize first ci */ + L1->ci->func = L1->top; + setnilvalue(L1->top++); /* `function' entry for this `ci' */ + L1->base = L1->ci->base = L1->top; + L1->ci->top = L1->top + LUA_MINSTACK; +} + + +static void freestack (lua_State *L, lua_State *L1) { + luaM_freearray(L, L1->base_ci, L1->size_ci, CallInfo); + luaM_freearray(L, L1->stack, L1->stacksize, TValue); +} + + +/* +** open parts that may cause memory-allocation errors +*/ +static void f_luaopen (lua_State *L, void *ud) { + global_State *g = G(L); + UNUSED(ud); + stack_init(L, L); /* init stack */ + sethvalue(L, gt(L), luaH_new(L, 0, 2)); /* table of globals */ + sethvalue(L, registry(L), luaH_new(L, 0, 2)); /* registry */ + luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */ + luaT_init(L); + luaX_init(L); + luaS_fix(luaS_newliteral(L, MEMERRMSG)); + g->GCthreshold = 4*g->totalbytes; +} + + +static void preinit_state (lua_State *L, global_State *g) { + G(L) = g; + L->stack = NULL; + L->stacksize = 0; + L->errorJmp = NULL; + L->hook = NULL; + L->hookmask = 0; + L->basehookcount = 0; + L->allowhook = 1; + resethookcount(L); + L->openupval = NULL; + L->size_ci = 0; + L->nCcalls = L->baseCcalls = 0; + L->status = 0; + L->base_ci = L->ci = NULL; + L->savedpc = NULL; + L->errfunc = 0; + setnilvalue(gt(L)); +} + + +static void close_state (lua_State *L) { + global_State *g = G(L); + luaF_close(L, L->stack); /* close all upvalues for this thread */ + luaC_freeall(L); /* collect all objects */ + lua_assert(g->rootgc == obj2gco(L)); + lua_assert(g->strt.nuse == 0); + luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size, TString *); + luaZ_freebuffer(L, &g->buff); + freestack(L, L); + lua_assert(g->totalbytes == sizeof(LG)); + (*g->frealloc)(g->ud, fromstate(L), state_size(LG), 0); +} + + +lua_State *luaE_newthread (lua_State *L) { + lua_State *L1 = tostate(luaM_malloc(L, state_size(lua_State))); + luaC_link(L, obj2gco(L1), LUA_TTHREAD); + preinit_state(L1, G(L)); + stack_init(L1, L); /* init stack */ + setobj2n(L, gt(L1), gt(L)); /* share table of globals */ + L1->hookmask = L->hookmask; + L1->basehookcount = L->basehookcount; + L1->hook = L->hook; + resethookcount(L1); + lua_assert(iswhite(obj2gco(L1))); + return L1; +} + + +void luaE_freethread (lua_State *L, lua_State *L1) { + luaF_close(L1, L1->stack); /* close all upvalues for this thread */ + lua_assert(L1->openupval == NULL); + luai_userstatefree(L1); + freestack(L, L1); + luaM_freemem(L, fromstate(L1), state_size(lua_State)); +} + + +LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { + int i; + lua_State *L; + global_State *g; + void *l = (*f)(ud, NULL, 0, state_size(LG)); + if (l == NULL) return NULL; + L = tostate(l); + g = &((LG *)L)->g; + L->next = NULL; + L->tt = LUA_TTHREAD; + g->currentwhite = bit2mask(WHITE0BIT, FIXEDBIT); + L->marked = luaC_white(g); + set2bits(L->marked, FIXEDBIT, SFIXEDBIT); + preinit_state(L, g); + g->frealloc = f; + g->ud = ud; + g->mainthread = L; + g->uvhead.u.l.prev = &g->uvhead; + g->uvhead.u.l.next = &g->uvhead; + g->GCthreshold = 0; /* mark it as unfinished state */ + g->strt.size = 0; + g->strt.nuse = 0; + g->strt.hash = NULL; + setnilvalue(registry(L)); + luaZ_initbuffer(L, &g->buff); + g->panic = NULL; + g->gcstate = GCSpause; + g->rootgc = obj2gco(L); + g->sweepstrgc = 0; + g->sweepgc = &g->rootgc; + g->gray = NULL; + g->grayagain = NULL; + g->weak = NULL; + g->tmudata = NULL; + g->totalbytes = sizeof(LG); + g->gcpause = LUAI_GCPAUSE; + g->gcstepmul = LUAI_GCMUL; + g->gcdept = 0; + for (i=0; imt[i] = NULL; + if (luaD_rawrunprotected(L, f_luaopen, NULL) != 0) { + /* memory allocation error: free partial state */ + close_state(L); + L = NULL; + } + else + luai_userstateopen(L); + return L; +} + + +static void callallgcTM (lua_State *L, void *ud) { + UNUSED(ud); + luaC_callGCTM(L); /* call GC metamethods for all udata */ +} + + +LUA_API void lua_close (lua_State *L) { + L = G(L)->mainthread; /* only the main thread can be closed */ + lua_lock(L); + luaF_close(L, L->stack); /* close all upvalues for this thread */ + luaC_separateudata(L, 1); /* separate udata that have GC metamethods */ + L->errfunc = 0; /* no error function during GC metamethods */ + do { /* repeat until no more errors */ + L->ci = L->base_ci; + L->base = L->top = L->ci->base; + L->nCcalls = L->baseCcalls = 0; + } while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0); + lua_assert(G(L)->tmudata == NULL); + luai_userstateclose(L); + close_state(L); +} + diff --git a/rpm-5.4.9/lua/lstate.h b/rpm-5.4.9/lua/lstate.h new file mode 100644 index 0000000..3bc575b --- /dev/null +++ b/rpm-5.4.9/lua/lstate.h @@ -0,0 +1,169 @@ +/* +** $Id: lstate.h,v 2.24.1.2 2008/01/03 15:20:39 roberto Exp $ +** Global State +** See Copyright Notice in lua.h +*/ + +#ifndef lstate_h +#define lstate_h + +#include "lua.h" + +#include "lobject.h" +#include "ltm.h" +#include "lzio.h" + + + +struct lua_longjmp; /* defined in ldo.c */ + + +/* table of globals */ +#define gt(L) (&L->l_gt) + +/* registry */ +#define registry(L) (&G(L)->l_registry) + + +/* extra stack space to handle TM calls and some other extras */ +#define EXTRA_STACK 5 + + +#define BASIC_CI_SIZE 8 + +#define BASIC_STACK_SIZE (2*LUA_MINSTACK) + + + +typedef struct stringtable { + GCObject **hash; + lu_int32 nuse; /* number of elements */ + int size; +} stringtable; + + +/* +** informations about a call +*/ +typedef struct CallInfo { + StkId base; /* base for this function */ + StkId func; /* function index in the stack */ + StkId top; /* top for this function */ + const Instruction *savedpc; + int nresults; /* expected number of results from this function */ + int tailcalls; /* number of tail calls lost under this entry */ +} CallInfo; + + + +#define curr_func(L) (clvalue(L->ci->func)) +#define ci_func(ci) (clvalue((ci)->func)) +#define f_isLua(ci) (!ci_func(ci)->c.isC) +#define isLua(ci) (ttisfunction((ci)->func) && f_isLua(ci)) + + +/* +** `global state', shared by all threads of this state +*/ +typedef struct global_State { + stringtable strt; /* hash table for strings */ + lua_Alloc frealloc; /* function to reallocate memory */ + void *ud; /* auxiliary data to `frealloc' */ + lu_byte currentwhite; + lu_byte gcstate; /* state of garbage collector */ + int sweepstrgc; /* position of sweep in `strt' */ + GCObject *rootgc; /* list of all collectable objects */ + GCObject **sweepgc; /* position of sweep in `rootgc' */ + GCObject *gray; /* list of gray objects */ + GCObject *grayagain; /* list of objects to be traversed atomically */ + GCObject *weak; /* list of weak tables (to be cleared) */ + GCObject *tmudata; /* last element of list of userdata to be GC */ + Mbuffer buff; /* temporary buffer for string concatentation */ + lu_mem GCthreshold; + lu_mem totalbytes; /* number of bytes currently allocated */ + lu_mem estimate; /* an estimate of number of bytes actually in use */ + lu_mem gcdept; /* how much GC is `behind schedule' */ + int gcpause; /* size of pause between successive GCs */ + int gcstepmul; /* GC `granularity' */ + lua_CFunction panic; /* to be called in unprotected errors */ + TValue l_registry; + struct lua_State *mainthread; + UpVal uvhead; /* head of double-linked list of all open upvalues */ + struct Table *mt[NUM_TAGS]; /* metatables for basic types */ + TString *tmname[TM_N]; /* array with tag-method names */ +} global_State; + + +/* +** `per thread' state +*/ +struct lua_State { + CommonHeader; + lu_byte status; + StkId top; /* first free slot in the stack */ + StkId base; /* base of current function */ + global_State *l_G; + CallInfo *ci; /* call info for current function */ + const Instruction *savedpc; /* `savedpc' of current function */ + StkId stack_last; /* last free slot in the stack */ + StkId stack; /* stack base */ + CallInfo *end_ci; /* points after end of ci array*/ + CallInfo *base_ci; /* array of CallInfo's */ + int stacksize; + int size_ci; /* size of array `base_ci' */ + unsigned short nCcalls; /* number of nested C calls */ + unsigned short baseCcalls; /* nested C calls when resuming coroutine */ + lu_byte hookmask; + lu_byte allowhook; + int basehookcount; + int hookcount; + lua_Hook hook; + TValue l_gt; /* table of globals */ + TValue env; /* temporary place for environments */ + GCObject *openupval; /* list of open upvalues in this stack */ + GCObject *gclist; + struct lua_longjmp *errorJmp; /* current error recover point */ + ptrdiff_t errfunc; /* current error handling function (stack index) */ +}; + + +#define G(L) (L->l_G) + + +/* +** Union of all collectable objects +*/ +union GCObject { + GCheader gch; + union TString ts; + union Udata u; + union Closure cl; + struct Table h; + struct Proto p; + struct UpVal uv; + struct lua_State th; /* thread */ +}; + + +/* macros to convert a GCObject into a specific value */ +#define rawgco2ts(o) check_exp((o)->gch.tt == LUA_TSTRING, &((o)->ts)) +#define gco2ts(o) (&rawgco2ts(o)->tsv) +#define rawgco2u(o) check_exp((o)->gch.tt == LUA_TUSERDATA, &((o)->u)) +#define gco2u(o) (&rawgco2u(o)->uv) +#define gco2cl(o) check_exp((o)->gch.tt == LUA_TFUNCTION, &((o)->cl)) +#define gco2h(o) check_exp((o)->gch.tt == LUA_TTABLE, &((o)->h)) +#define gco2p(o) check_exp((o)->gch.tt == LUA_TPROTO, &((o)->p)) +#define gco2uv(o) check_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv)) +#define ngcotouv(o) \ + check_exp((o) == NULL || (o)->gch.tt == LUA_TUPVAL, &((o)->uv)) +#define gco2th(o) check_exp((o)->gch.tt == LUA_TTHREAD, &((o)->th)) + +/* macro to convert any Lua object into a GCObject */ +#define obj2gco(v) (cast(GCObject *, (v))) + + +LUAI_FUNC lua_State *luaE_newthread (lua_State *L); +LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1); + +#endif + diff --git a/rpm-5.4.9/lua/lstring.c b/rpm-5.4.9/lua/lstring.c new file mode 100644 index 0000000..4911315 --- /dev/null +++ b/rpm-5.4.9/lua/lstring.c @@ -0,0 +1,111 @@ +/* +** $Id: lstring.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $ +** String table (keeps all strings handled by Lua) +** See Copyright Notice in lua.h +*/ + + +#include + +#define lstring_c +#define LUA_CORE + +#include "lua.h" + +#include "lmem.h" +#include "lobject.h" +#include "lstate.h" +#include "lstring.h" + + + +void luaS_resize (lua_State *L, int newsize) { + GCObject **newhash; + stringtable *tb; + int i; + if (G(L)->gcstate == GCSsweepstring) + return; /* cannot resize during GC traverse */ + newhash = luaM_newvector(L, newsize, GCObject *); + tb = &G(L)->strt; + for (i=0; isize; i++) { + GCObject *p = tb->hash[i]; + while (p) { /* for each node in the list */ + GCObject *next = p->gch.next; /* save next */ + unsigned int h = gco2ts(p)->hash; + int h1 = lmod(h, newsize); /* new position */ + lua_assert(cast_int(h%newsize) == lmod(h, newsize)); + p->gch.next = newhash[h1]; /* chain it */ + newhash[h1] = p; + p = next; + } + } + luaM_freearray(L, tb->hash, tb->size, TString *); + tb->size = newsize; + tb->hash = newhash; +} + + +static TString *newlstr (lua_State *L, const char *str, size_t l, + unsigned int h) { + TString *ts; + stringtable *tb; + if (l+1 > (MAX_SIZET - sizeof(TString))/sizeof(char)) + luaM_toobig(L); + ts = cast(TString *, luaM_malloc(L, (l+1)*sizeof(char)+sizeof(TString))); + ts->tsv.len = l; + ts->tsv.hash = h; + ts->tsv.marked = luaC_white(G(L)); + ts->tsv.tt = LUA_TSTRING; + ts->tsv.reserved = 0; + memcpy(ts+1, str, l*sizeof(char)); + ((char *)(ts+1))[l] = '\0'; /* ending 0 */ + tb = &G(L)->strt; + h = lmod(h, tb->size); + ts->tsv.next = tb->hash[h]; /* chain new entry */ + tb->hash[h] = obj2gco(ts); + tb->nuse++; + if (tb->nuse > cast(lu_int32, tb->size) && tb->size <= MAX_INT/2) + luaS_resize(L, tb->size*2); /* too crowded */ + return ts; +} + + +TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { + GCObject *o; + unsigned int h = cast(unsigned int, l); /* seed */ + size_t step = (l>>5)+1; /* if string is too long, don't hash all its chars */ + size_t l1; + for (l1=l; l1>=step; l1-=step) /* compute hash */ + h = h ^ ((h<<5)+(h>>2)+cast(unsigned char, str[l1-1])); + for (o = G(L)->strt.hash[lmod(h, G(L)->strt.size)]; + o != NULL; + o = o->gch.next) { + TString *ts = rawgco2ts(o); + if (ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0)) { + /* string may be dead */ + if (isdead(G(L), o)) changewhite(o); + return ts; + } + } + return newlstr(L, str, l, h); /* not found */ +} + + +Udata *luaS_newudata (lua_State *L, size_t s, Table *e) { + Udata *u; + if (s > MAX_SIZET - sizeof(Udata)) + luaM_toobig(L); + u = cast(Udata *, luaM_malloc(L, s + sizeof(Udata))); + u->uv.marked = luaC_white(G(L)); /* is not finalized */ + u->uv.tt = LUA_TUSERDATA; + u->uv.len = s; + u->uv.metatable = NULL; + u->uv.env = e; + /* chain it on udata list (after main thread) */ + u->uv.next = G(L)->mainthread->next; + G(L)->mainthread->next = obj2gco(u); + return u; +} + diff --git a/rpm-5.4.9/lua/lstring.h b/rpm-5.4.9/lua/lstring.h new file mode 100644 index 0000000..73a2ff8 --- /dev/null +++ b/rpm-5.4.9/lua/lstring.h @@ -0,0 +1,31 @@ +/* +** $Id: lstring.h,v 1.43.1.1 2007/12/27 13:02:25 roberto Exp $ +** String table (keep all strings handled by Lua) +** See Copyright Notice in lua.h +*/ + +#ifndef lstring_h +#define lstring_h + + +#include "lgc.h" +#include "lobject.h" +#include "lstate.h" + + +#define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char)) + +#define sizeudata(u) (sizeof(union Udata)+(u)->len) + +#define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s))) +#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ + (sizeof(s)/sizeof(char))-1)) + +#define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT) + +LUAI_FUNC void luaS_resize (lua_State *L, int newsize); +LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e); +LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); + + +#endif diff --git a/rpm-5.4.9/lua/lstrlib.c b/rpm-5.4.9/lua/lstrlib.c new file mode 100644 index 0000000..1b4763d --- /dev/null +++ b/rpm-5.4.9/lua/lstrlib.c @@ -0,0 +1,869 @@ +/* +** $Id: lstrlib.c,v 1.132.1.4 2008/07/11 17:27:21 roberto Exp $ +** Standard library for string operations and pattern-matching +** See Copyright Notice in lua.h +*/ + + +#include +#include +#include +#include +#include + +#define lstrlib_c +#define LUA_LIB + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + +/* macro to `unsign' a character */ +#define uchar(c) ((unsigned char)(c)) + + + +static int str_len (lua_State *L) { + size_t l; + luaL_checklstring(L, 1, &l); + lua_pushinteger(L, l); + return 1; +} + + +static ptrdiff_t posrelat (ptrdiff_t pos, size_t len) { + /* relative string position: negative means back from end */ + if (pos < 0) pos += (ptrdiff_t)len + 1; + return (pos >= 0) ? pos : 0; +} + + +static int str_sub (lua_State *L) { + size_t l; + const char *s = luaL_checklstring(L, 1, &l); + ptrdiff_t start = posrelat(luaL_checkinteger(L, 2), l); + ptrdiff_t end = posrelat(luaL_optinteger(L, 3, -1), l); + if (start < 1) start = 1; + if (end > (ptrdiff_t)l) end = (ptrdiff_t)l; + if (start <= end) + lua_pushlstring(L, s+start-1, end-start+1); + else lua_pushliteral(L, ""); + return 1; +} + + +static int str_reverse (lua_State *L) { + size_t l; + luaL_Buffer b; + const char *s = luaL_checklstring(L, 1, &l); + luaL_buffinit(L, &b); + while (l--) luaL_addchar(&b, s[l]); + luaL_pushresult(&b); + return 1; +} + + +static int str_lower (lua_State *L) { + size_t l; + size_t i; + luaL_Buffer b; + const char *s = luaL_checklstring(L, 1, &l); + luaL_buffinit(L, &b); + for (i=0; i 0) + luaL_addlstring(&b, s, l); + luaL_pushresult(&b); + return 1; +} + + +static int str_byte (lua_State *L) { + size_t l; + const char *s = luaL_checklstring(L, 1, &l); + ptrdiff_t posi = posrelat(luaL_optinteger(L, 2, 1), l); + ptrdiff_t pose = posrelat(luaL_optinteger(L, 3, posi), l); + int n, i; + if (posi <= 0) posi = 1; + if ((size_t)pose > l) pose = l; + if (posi > pose) return 0; /* empty interval; return no values */ + n = (int)(pose - posi + 1); + if (posi + n <= pose) /* overflow? */ + luaL_error(L, "string slice too long"); + luaL_checkstack(L, n, "string slice too long"); + for (i=0; i= ms->level || ms->capture[l].len == CAP_UNFINISHED) + return luaL_error(ms->L, "invalid capture index"); + return l; +} + + +static int capture_to_close (MatchState *ms) { + int level = ms->level; + for (level--; level>=0; level--) + if (ms->capture[level].len == CAP_UNFINISHED) return level; + return luaL_error(ms->L, "invalid pattern capture"); +} + + +static const char *classend (MatchState *ms, const char *p) { + switch (*p++) { + case L_ESC: { + if (*p == '\0') + luaL_error(ms->L, "malformed pattern (ends with " LUA_QL("%%") ")"); + return p+1; + } + case '[': { + if (*p == '^') p++; + do { /* look for a `]' */ + if (*p == '\0') + luaL_error(ms->L, "malformed pattern (missing " LUA_QL("]") ")"); + if (*(p++) == L_ESC && *p != '\0') + p++; /* skip escapes (e.g. `%]') */ + } while (*p != ']'); + return p+1; + } + default: { + return p; + } + } +} + + +static int match_class (int c, int cl) { + int res; + switch (tolower(cl)) { + case 'a' : res = isalpha(c); break; + case 'c' : res = iscntrl(c); break; + case 'd' : res = isdigit(c); break; + case 'l' : res = islower(c); break; + case 'p' : res = ispunct(c); break; + case 's' : res = isspace(c); break; + case 'u' : res = isupper(c); break; + case 'w' : res = isalnum(c); break; + case 'x' : res = isxdigit(c); break; + case 'z' : res = (c == 0); break; + default: return (cl == c); + } + return (islower(cl) ? res : !res); +} + + +static int matchbracketclass (int c, const char *p, const char *ec) { + int sig = 1; + if (*(p+1) == '^') { + sig = 0; + p++; /* skip the `^' */ + } + while (++p < ec) { + if (*p == L_ESC) { + p++; + if (match_class(c, uchar(*p))) + return sig; + } + else if ((*(p+1) == '-') && (p+2 < ec)) { + p+=2; + if (uchar(*(p-2)) <= c && c <= uchar(*p)) + return sig; + } + else if (uchar(*p) == c) return sig; + } + return !sig; +} + + +static int singlematch (int c, const char *p, const char *ep) { + switch (*p) { + case '.': return 1; /* matches any char */ + case L_ESC: return match_class(c, uchar(*(p+1))); + case '[': return matchbracketclass(c, p, ep-1); + default: return (uchar(*p) == c); + } +} + + +static const char *match (MatchState *ms, const char *s, const char *p); + + +static const char *matchbalance (MatchState *ms, const char *s, + const char *p) { + if (*p == 0 || *(p+1) == 0) + luaL_error(ms->L, "unbalanced pattern"); + if (*s != *p) return NULL; + else { + int b = *p; + int e = *(p+1); + int cont = 1; + while (++s < ms->src_end) { + if (*s == e) { + if (--cont == 0) return s+1; + } + else if (*s == b) cont++; + } + } + return NULL; /* string ends out of balance */ +} + + +static const char *max_expand (MatchState *ms, const char *s, + const char *p, const char *ep) { + ptrdiff_t i = 0; /* counts maximum expand for item */ + while ((s+i)src_end && singlematch(uchar(*(s+i)), p, ep)) + i++; + /* keeps trying to match with the maximum repetitions */ + while (i>=0) { + const char *res = match(ms, (s+i), ep+1); + if (res) return res; + i--; /* else didn't match; reduce 1 repetition to try again */ + } + return NULL; +} + + +static const char *min_expand (MatchState *ms, const char *s, + const char *p, const char *ep) { + for (;;) { + const char *res = match(ms, s, ep+1); + if (res != NULL) + return res; + else if (ssrc_end && singlematch(uchar(*s), p, ep)) + s++; /* try with one more repetition */ + else return NULL; + } +} + + +static const char *start_capture (MatchState *ms, const char *s, + const char *p, int what) { + const char *res; + int level = ms->level; + if (level >= LUA_MAXCAPTURES) luaL_error(ms->L, "too many captures"); + ms->capture[level].init = s; + ms->capture[level].len = what; + ms->level = level+1; + if ((res=match(ms, s, p)) == NULL) /* match failed? */ + ms->level--; /* undo capture */ + return res; +} + + +static const char *end_capture (MatchState *ms, const char *s, + const char *p) { + int l = capture_to_close(ms); + const char *res; + ms->capture[l].len = s - ms->capture[l].init; /* close capture */ + if ((res = match(ms, s, p)) == NULL) /* match failed? */ + ms->capture[l].len = CAP_UNFINISHED; /* undo capture */ + return res; +} + + +static const char *match_capture (MatchState *ms, const char *s, int l) { + size_t len; + l = check_capture(ms, l); + len = ms->capture[l].len; + if ((size_t)(ms->src_end-s) >= len && + memcmp(ms->capture[l].init, s, len) == 0) + return s+len; + else return NULL; +} + + +static const char *match (MatchState *ms, const char *s, const char *p) { + init: /* using goto's to optimize tail recursion */ + switch (*p) { + case '(': { /* start capture */ + if (*(p+1) == ')') /* position capture? */ + return start_capture(ms, s, p+2, CAP_POSITION); + else + return start_capture(ms, s, p+1, CAP_UNFINISHED); + } + case ')': { /* end capture */ + return end_capture(ms, s, p+1); + } + case L_ESC: { + switch (*(p+1)) { + case 'b': { /* balanced string? */ + s = matchbalance(ms, s, p+2); + if (s == NULL) return NULL; + p+=4; goto init; /* else return match(ms, s, p+4); */ + } + case 'f': { /* frontier? */ + const char *ep; char previous; + p += 2; + if (*p != '[') + luaL_error(ms->L, "missing " LUA_QL("[") " after " + LUA_QL("%%f") " in pattern"); + ep = classend(ms, p); /* points to what is next */ + previous = (s == ms->src_init) ? '\0' : *(s-1); + if (matchbracketclass(uchar(previous), p, ep-1) || + !matchbracketclass(uchar(*s), p, ep-1)) return NULL; + p=ep; goto init; /* else return match(ms, s, ep); */ + } + default: { + if (isdigit(uchar(*(p+1)))) { /* capture results (%0-%9)? */ + s = match_capture(ms, s, uchar(*(p+1))); + if (s == NULL) return NULL; + p+=2; goto init; /* else return match(ms, s, p+2) */ + } + goto dflt; /* case default */ + } + } + } + case '\0': { /* end of pattern */ + return s; /* match succeeded */ + } + case '$': { + if (*(p+1) == '\0') /* is the `$' the last char in pattern? */ + return (s == ms->src_end) ? s : NULL; /* check end of string */ + else goto dflt; + } + default: dflt: { /* it is a pattern item */ + const char *ep = classend(ms, p); /* points to what is next */ + int m = ssrc_end && singlematch(uchar(*s), p, ep); + switch (*ep) { + case '?': { /* optional */ + const char *res; + if (m && ((res=match(ms, s+1, ep+1)) != NULL)) + return res; + p=ep+1; goto init; /* else return match(ms, s, ep+1); */ + } + case '*': { /* 0 or more repetitions */ + return max_expand(ms, s, p, ep); + } + case '+': { /* 1 or more repetitions */ + return (m ? max_expand(ms, s+1, p, ep) : NULL); + } + case '-': { /* 0 or more repetitions (minimum) */ + return min_expand(ms, s, p, ep); + } + default: { + if (!m) return NULL; + s++; p=ep; goto init; /* else return match(ms, s+1, ep); */ + } + } + } + } +} + + + +static const char *lmemfind (const char *s1, size_t l1, + const char *s2, size_t l2) { + if (l2 == 0) return s1; /* empty strings are everywhere */ + else if (l2 > l1) return NULL; /* avoids a negative `l1' */ + else { + const char *init; /* to search for a `*s2' inside `s1' */ + l2--; /* 1st char will be checked by `memchr' */ + l1 = l1-l2; /* `s2' cannot be found after that */ + while (l1 > 0 && (init = (const char *)memchr(s1, *s2, l1)) != NULL) { + init++; /* 1st char is already checked */ + if (memcmp(init, s2+1, l2) == 0) + return init-1; + else { /* correct `l1' and `s1' to try again */ + l1 -= init-s1; + s1 = init; + } + } + return NULL; /* not found */ + } +} + + +static void push_onecapture (MatchState *ms, int i, const char *s, + const char *e) { + if (i >= ms->level) { + if (i == 0) /* ms->level == 0, too */ + lua_pushlstring(ms->L, s, e - s); /* add whole match */ + else + luaL_error(ms->L, "invalid capture index"); + } + else { + ptrdiff_t l = ms->capture[i].len; + if (l == CAP_UNFINISHED) luaL_error(ms->L, "unfinished capture"); + if (l == CAP_POSITION) + lua_pushinteger(ms->L, ms->capture[i].init - ms->src_init + 1); + else + lua_pushlstring(ms->L, ms->capture[i].init, l); + } +} + + +static int push_captures (MatchState *ms, const char *s, const char *e) { + int i; + int nlevels = (ms->level == 0 && s) ? 1 : ms->level; + luaL_checkstack(ms->L, nlevels, "too many captures"); + for (i = 0; i < nlevels; i++) + push_onecapture(ms, i, s, e); + return nlevels; /* number of strings pushed */ +} + + +static int str_find_aux (lua_State *L, int find) { + size_t l1, l2; + const char *s = luaL_checklstring(L, 1, &l1); + const char *p = luaL_checklstring(L, 2, &l2); + ptrdiff_t init = posrelat(luaL_optinteger(L, 3, 1), l1) - 1; + if (init < 0) init = 0; + else if ((size_t)(init) > l1) init = (ptrdiff_t)l1; + if (find && (lua_toboolean(L, 4) || /* explicit request? */ + strpbrk(p, SPECIALS) == NULL)) { /* or no special characters? */ + /* do a plain search */ + const char *s2 = lmemfind(s+init, l1-init, p, l2); + if (s2) { + lua_pushinteger(L, s2-s+1); + lua_pushinteger(L, s2-s+l2); + return 2; + } + } + else { + MatchState ms; + int anchor = (*p == '^') ? (p++, 1) : 0; + const char *s1=s+init; + ms.L = L; + ms.src_init = s; + ms.src_end = s+l1; + do { + const char *res; + ms.level = 0; + if ((res=match(&ms, s1, p)) != NULL) { + if (find) { + lua_pushinteger(L, s1-s+1); /* start */ + lua_pushinteger(L, res-s); /* end */ + return push_captures(&ms, NULL, 0) + 2; + } + else + return push_captures(&ms, s1, res); + } + } while (s1++ < ms.src_end && !anchor); + } + lua_pushnil(L); /* not found */ + return 1; +} + + +static int str_find (lua_State *L) { + return str_find_aux(L, 1); +} + + +static int str_match (lua_State *L) { + return str_find_aux(L, 0); +} + + +static int gmatch_aux (lua_State *L) { + MatchState ms; + size_t ls; + const char *s = lua_tolstring(L, lua_upvalueindex(1), &ls); + const char *p = lua_tostring(L, lua_upvalueindex(2)); + const char *src; + ms.L = L; + ms.src_init = s; + ms.src_end = s+ls; + for (src = s + (size_t)lua_tointeger(L, lua_upvalueindex(3)); + src <= ms.src_end; + src++) { + const char *e; + ms.level = 0; + if ((e = match(&ms, src, p)) != NULL) { + lua_Integer newstart = e-s; + if (e == src) newstart++; /* empty match? go at least one position */ + lua_pushinteger(L, newstart); + lua_replace(L, lua_upvalueindex(3)); + return push_captures(&ms, src, e); + } + } + return 0; /* not found */ +} + + +static int gmatch (lua_State *L) { + luaL_checkstring(L, 1); + luaL_checkstring(L, 2); + lua_settop(L, 2); + lua_pushinteger(L, 0); + lua_pushcclosure(L, gmatch_aux, 3); + return 1; +} + + +static int gfind_nodef (lua_State *L) { + return luaL_error(L, LUA_QL("string.gfind") " was renamed to " + LUA_QL("string.gmatch")); +} + + +static void add_s (MatchState *ms, luaL_Buffer *b, const char *s, + const char *e) { + size_t l, i; + const char *news = lua_tolstring(ms->L, 3, &l); + for (i = 0; i < l; i++) { + if (news[i] != L_ESC) + luaL_addchar(b, news[i]); + else { + i++; /* skip ESC */ + if (!isdigit(uchar(news[i]))) + luaL_addchar(b, news[i]); + else if (news[i] == '0') + luaL_addlstring(b, s, e - s); + else { + push_onecapture(ms, news[i] - '1', s, e); + luaL_addvalue(b); /* add capture to accumulated result */ + } + } + } +} + + +static void add_value (MatchState *ms, luaL_Buffer *b, const char *s, + const char *e) { + lua_State *L = ms->L; + switch (lua_type(L, 3)) { + case LUA_TNUMBER: + case LUA_TSTRING: { + add_s(ms, b, s, e); + return; + } + case LUA_TFUNCTION: { + int n; + lua_pushvalue(L, 3); + n = push_captures(ms, s, e); + lua_call(L, n, 1); + break; + } + case LUA_TTABLE: { + push_onecapture(ms, 0, s, e); + lua_gettable(L, 3); + break; + } + } + if (!lua_toboolean(L, -1)) { /* nil or false? */ + lua_pop(L, 1); + lua_pushlstring(L, s, e - s); /* keep original text */ + } + else if (!lua_isstring(L, -1)) + luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1)); + luaL_addvalue(b); /* add result to accumulator */ +} + + +static int str_gsub (lua_State *L) { + size_t srcl; + const char *src = luaL_checklstring(L, 1, &srcl); + const char *p = luaL_checkstring(L, 2); + int tr = lua_type(L, 3); + int max_s = luaL_optint(L, 4, srcl+1); + int anchor = (*p == '^') ? (p++, 1) : 0; + int n = 0; + MatchState ms; + luaL_Buffer b; + luaL_argcheck(L, tr == LUA_TNUMBER || tr == LUA_TSTRING || + tr == LUA_TFUNCTION || tr == LUA_TTABLE, 3, + "string/function/table expected"); + luaL_buffinit(L, &b); + ms.L = L; + ms.src_init = src; + ms.src_end = src+srcl; + while (n < max_s) { + const char *e; + ms.level = 0; + e = match(&ms, src, p); + if (e) { + n++; + add_value(&ms, &b, src, e); + } + if (e && e>src) /* non empty match? */ + src = e; /* skip it */ + else if (src < ms.src_end) + luaL_addchar(&b, *src++); + else break; + if (anchor) break; + } + luaL_addlstring(&b, src, ms.src_end-src); + luaL_pushresult(&b); + lua_pushinteger(L, n); /* number of substitutions */ + return 2; +} + +/* }====================================================== */ + + +/* maximum size of each formatted item (> len(format('%99.99f', -1e308))) */ +#define MAX_ITEM 512 +/* valid flags in a format specification */ +#define FLAGS "-+ #0" +/* +** maximum size of each format specification (such as '%-099.99d') +** (+10 accounts for %99.99x plus margin of error) +*/ +#define MAX_FORMAT (sizeof(FLAGS) + sizeof(LUA_INTFRMLEN) + 10) + + +static void addquoted (lua_State *L, luaL_Buffer *b, int arg) { + size_t l; + const char *s = luaL_checklstring(L, arg, &l); + luaL_addchar(b, '"'); + while (l--) { + switch (*s) { + case '"': case '\\': case '\n': { + luaL_addchar(b, '\\'); + luaL_addchar(b, *s); + break; + } + case '\r': { + luaL_addlstring(b, "\\r", 2); + break; + } + case '\0': { + luaL_addlstring(b, "\\000", 4); + break; + } + default: { + luaL_addchar(b, *s); + break; + } + } + s++; + } + luaL_addchar(b, '"'); +} + +static const char *scanformat (lua_State *L, const char *strfrmt, char *form) { + const char *p = strfrmt; + while (*p != '\0' && strchr(FLAGS, *p) != NULL) p++; /* skip flags */ + if ((size_t)(p - strfrmt) >= sizeof(FLAGS)) + luaL_error(L, "invalid format (repeated flags)"); + if (isdigit(uchar(*p))) p++; /* skip width */ + if (isdigit(uchar(*p))) p++; /* (2 digits at most) */ + if (*p == '.') { + p++; + if (isdigit(uchar(*p))) p++; /* skip precision */ + if (isdigit(uchar(*p))) p++; /* (2 digits at most) */ + } + if (isdigit(uchar(*p))) + luaL_error(L, "invalid format (width or precision too long)"); + *(form++) = '%'; + strncpy(form, strfrmt, p - strfrmt + 1); + form += p - strfrmt + 1; + *form = '\0'; + return p; +} + + +static void addintlen (char *form) { + size_t l = strlen(form); + char spec = form[l - 1]; + strcpy(form + l - 1, LUA_INTFRMLEN); + form[l + sizeof(LUA_INTFRMLEN) - 2] = spec; + form[l + sizeof(LUA_INTFRMLEN) - 1] = '\0'; +} + + +static int str_format (lua_State *L) { + int arg = 1; + size_t sfl; + const char *strfrmt = luaL_checklstring(L, arg, &sfl); + const char *strfrmt_end = strfrmt+sfl; + luaL_Buffer b; + luaL_buffinit(L, &b); + while (strfrmt < strfrmt_end) { + if (*strfrmt != L_ESC) + luaL_addchar(&b, *strfrmt++); + else if (*++strfrmt == L_ESC) + luaL_addchar(&b, *strfrmt++); /* %% */ + else { /* format item */ + char form[MAX_FORMAT]; /* to store the format (`%...') */ + char buff[MAX_ITEM]; /* to store the formatted item */ + arg++; + strfrmt = scanformat(L, strfrmt, form); + switch (*strfrmt++) { + case 'c': { + sprintf(buff, form, (int)luaL_checknumber(L, arg)); + break; + } + case 'd': case 'i': { + addintlen(form); + sprintf(buff, form, (LUA_INTFRM_T)luaL_checknumber(L, arg)); + break; + } + case 'o': case 'u': case 'x': case 'X': { + addintlen(form); + sprintf(buff, form, (unsigned LUA_INTFRM_T)luaL_checknumber(L, arg)); + break; + } + case 'e': case 'E': case 'f': + case 'g': case 'G': { + sprintf(buff, form, (double)luaL_checknumber(L, arg)); + break; + } + case 'q': { + addquoted(L, &b, arg); + continue; /* skip the 'addsize' at the end */ + } + case 's': { + size_t l; + const char *s = luaL_checklstring(L, arg, &l); + if (!strchr(form, '.') && l >= 100) { + /* no precision and string is too long to be formatted; + keep original string */ + lua_pushvalue(L, arg); + luaL_addvalue(&b); + continue; /* skip the `addsize' at the end */ + } + else { + sprintf(buff, form, s); + break; + } + } + default: { /* also treat cases `pnLlh' */ + return luaL_error(L, "invalid option " LUA_QL("%%%c") " to " + LUA_QL("format"), *(strfrmt - 1)); + } + } + luaL_addlstring(&b, buff, strlen(buff)); + } + } + luaL_pushresult(&b); + return 1; +} + + +static const luaL_Reg strlib[] = { + {"byte", str_byte}, + {"char", str_char}, + {"dump", str_dump}, + {"find", str_find}, + {"format", str_format}, + {"gfind", gfind_nodef}, + {"gmatch", gmatch}, + {"gsub", str_gsub}, + {"len", str_len}, + {"lower", str_lower}, + {"match", str_match}, + {"rep", str_rep}, + {"reverse", str_reverse}, + {"sub", str_sub}, + {"upper", str_upper}, + {NULL, NULL} +}; + + +static void createmetatable (lua_State *L) { + lua_createtable(L, 0, 1); /* create metatable for strings */ + lua_pushliteral(L, ""); /* dummy string */ + lua_pushvalue(L, -2); + lua_setmetatable(L, -2); /* set string metatable */ + lua_pop(L, 1); /* pop dummy string */ + lua_pushvalue(L, -2); /* string library... */ + lua_setfield(L, -2, "__index"); /* ...is the __index metamethod */ + lua_pop(L, 1); /* pop metatable */ +} + + +/* +** Open string library +*/ +LUALIB_API int luaopen_string (lua_State *L) { + luaL_register(L, LUA_STRLIBNAME, strlib); +#if defined(LUA_COMPAT_GFIND) + lua_getfield(L, -1, "gmatch"); + lua_setfield(L, -2, "gfind"); +#endif + createmetatable(L); + return 1; +} + diff --git a/rpm-5.4.9/lua/ltable.c b/rpm-5.4.9/lua/ltable.c new file mode 100644 index 0000000..ec84f4f --- /dev/null +++ b/rpm-5.4.9/lua/ltable.c @@ -0,0 +1,588 @@ +/* +** $Id: ltable.c,v 2.32.1.2 2007/12/28 15:32:23 roberto Exp $ +** Lua tables (hash) +** See Copyright Notice in lua.h +*/ + + +/* +** Implementation of tables (aka arrays, objects, or hash tables). +** Tables keep its elements in two parts: an array part and a hash part. +** Non-negative integer keys are all candidates to be kept in the array +** part. The actual size of the array is the largest `n' such that at +** least half the slots between 0 and n are in use. +** Hash uses a mix of chained scatter table with Brent's variation. +** A main invariant of these tables is that, if an element is not +** in its main position (i.e. the `original' position that its hash gives +** to it), then the colliding element is in its own main position. +** Hence even when the load factor reaches 100%, performance remains good. +*/ + +#include +#include + +#define ltable_c +#define LUA_CORE + +#include "lua.h" + +#include "ldebug.h" +#include "ldo.h" +#include "lgc.h" +#include "lmem.h" +#include "lobject.h" +#include "lstate.h" +#include "ltable.h" + + +/* +** max size of array part is 2^MAXBITS +*/ +#if LUAI_BITSINT > 26 +#define MAXBITS 26 +#else +#define MAXBITS (LUAI_BITSINT-2) +#endif + +#define MAXASIZE (1 << MAXBITS) + + +#define hashpow2(t,n) (gnode(t, lmod((n), sizenode(t)))) + +#define hashstr(t,str) hashpow2(t, (str)->tsv.hash) +#define hashboolean(t,p) hashpow2(t, p) + + +/* +** for some types, it is better to avoid modulus by power of 2, as +** they tend to have many 2 factors. +*/ +#define hashmod(t,n) (gnode(t, ((n) % ((sizenode(t)-1)|1)))) + + +#define hashpointer(t,p) hashmod(t, IntPoint(p)) + + +/* +** number of ints inside a lua_Number +*/ +#define numints cast_int(sizeof(lua_Number)/sizeof(int)) + + + +#define dummynode (&dummynode_) + +static const Node dummynode_ = { + {{NULL}, LUA_TNIL}, /* value */ + {{{NULL}, LUA_TNIL, NULL}} /* key */ +}; + + +/* +** hash for lua_Numbers +*/ +static Node *hashnum (const Table *t, lua_Number n) { + unsigned int a[numints]; + int i; + if (luai_numeq(n, 0)) /* avoid problems with -0 */ + return gnode(t, 0); + memcpy(a, &n, sizeof(a)); + for (i = 1; i < numints; i++) a[0] += a[i]; + return hashmod(t, a[0]); +} + + + +/* +** returns the `main' position of an element in a table (that is, the index +** of its hash value) +*/ +static Node *mainposition (const Table *t, const TValue *key) { + switch (ttype(key)) { + case LUA_TNUMBER: + return hashnum(t, nvalue(key)); + case LUA_TSTRING: + return hashstr(t, rawtsvalue(key)); + case LUA_TBOOLEAN: + return hashboolean(t, bvalue(key)); + case LUA_TLIGHTUSERDATA: + return hashpointer(t, pvalue(key)); + default: + return hashpointer(t, gcvalue(key)); + } +} + + +/* +** returns the index for `key' if `key' is an appropriate key to live in +** the array part of the table, -1 otherwise. +*/ +static int arrayindex (const TValue *key) { + if (ttisnumber(key)) { + lua_Number n = nvalue(key); + int k; + lua_number2int(k, n); + if (luai_numeq(cast_num(k), n)) + return k; + } + return -1; /* `key' did not match some condition */ +} + + +/* +** returns the index of a `key' for table traversals. First goes all +** elements in the array part, then elements in the hash part. The +** beginning of a traversal is signalled by -1. +*/ +static int findindex (lua_State *L, Table *t, StkId key) { + int i; + if (ttisnil(key)) return -1; /* first iteration */ + i = arrayindex(key); + if (0 < i && i <= t->sizearray) /* is `key' inside array part? */ + return i-1; /* yes; that's the index (corrected to C) */ + else { + Node *n = mainposition(t, key); + do { /* check whether `key' is somewhere in the chain */ + /* key may be dead already, but it is ok to use it in `next' */ + if (luaO_rawequalObj(key2tval(n), key) || + (ttype(gkey(n)) == LUA_TDEADKEY && iscollectable(key) && + gcvalue(gkey(n)) == gcvalue(key))) { + i = cast_int(n - gnode(t, 0)); /* key index in hash table */ + /* hash elements are numbered after array ones */ + return i + t->sizearray; + } + else n = gnext(n); + } while (n); + luaG_runerror(L, "invalid key to " LUA_QL("next")); /* key not found */ + return 0; /* to avoid warnings */ + } +} + + +int luaH_next (lua_State *L, Table *t, StkId key) { + int i = findindex(L, t, key); /* find original element */ + for (i++; i < t->sizearray; i++) { /* try first array part */ + if (!ttisnil(&t->array[i])) { /* a non-nil value? */ + setnvalue(key, cast_num(i+1)); + setobj2s(L, key+1, &t->array[i]); + return 1; + } + } + for (i -= t->sizearray; i < sizenode(t); i++) { /* then hash part */ + if (!ttisnil(gval(gnode(t, i)))) { /* a non-nil value? */ + setobj2s(L, key, key2tval(gnode(t, i))); + setobj2s(L, key+1, gval(gnode(t, i))); + return 1; + } + } + return 0; /* no more elements */ +} + + +/* +** {============================================================= +** Rehash +** ============================================================== +*/ + + +static int computesizes (int nums[], int *narray) { + int i; + int twotoi; /* 2^i */ + int a = 0; /* number of elements smaller than 2^i */ + int na = 0; /* number of elements to go to array part */ + int n = 0; /* optimal size for array part */ + for (i = 0, twotoi = 1; twotoi/2 < *narray; i++, twotoi *= 2) { + if (nums[i] > 0) { + a += nums[i]; + if (a > twotoi/2) { /* more than half elements present? */ + n = twotoi; /* optimal size (till now) */ + na = a; /* all elements smaller than n will go to array part */ + } + } + if (a == *narray) break; /* all elements already counted */ + } + *narray = n; + lua_assert(*narray/2 <= na && na <= *narray); + return na; +} + + +static int countint (const TValue *key, int *nums) { + int k = arrayindex(key); + if (0 < k && k <= MAXASIZE) { /* is `key' an appropriate array index? */ + nums[ceillog2(k)]++; /* count as such */ + return 1; + } + else + return 0; +} + + +static int numusearray (const Table *t, int *nums) { + int lg; + int ttlg; /* 2^lg */ + int ause = 0; /* summation of `nums' */ + int i = 1; /* count to traverse all array keys */ + for (lg=0, ttlg=1; lg<=MAXBITS; lg++, ttlg*=2) { /* for each slice */ + int lc = 0; /* counter */ + int lim = ttlg; + if (lim > t->sizearray) { + lim = t->sizearray; /* adjust upper limit */ + if (i > lim) + break; /* no more elements to count */ + } + /* count elements in range (2^(lg-1), 2^lg] */ + for (; i <= lim; i++) { + if (!ttisnil(&t->array[i-1])) + lc++; + } + nums[lg] += lc; + ause += lc; + } + return ause; +} + + +static int numusehash (const Table *t, int *nums, int *pnasize) { + int totaluse = 0; /* total number of elements */ + int ause = 0; /* summation of `nums' */ + int i = sizenode(t); + while (i--) { + Node *n = &t->node[i]; + if (!ttisnil(gval(n))) { + ause += countint(key2tval(n), nums); + totaluse++; + } + } + *pnasize += ause; + return totaluse; +} + + +static void setarrayvector (lua_State *L, Table *t, int size) { + int i; + luaM_reallocvector(L, t->array, t->sizearray, size, TValue); + for (i=t->sizearray; iarray[i]); + t->sizearray = size; +} + + +static void setnodevector (lua_State *L, Table *t, int size) { + int lsize; + if (size == 0) { /* no elements to hash part? */ + t->node = cast(Node *, dummynode); /* use common `dummynode' */ + lsize = 0; + } + else { + int i; + lsize = ceillog2(size); + if (lsize > MAXBITS) + luaG_runerror(L, "table overflow"); + size = twoto(lsize); + t->node = luaM_newvector(L, size, Node); + for (i=0; ilsizenode = cast_byte(lsize); + t->lastfree = gnode(t, size); /* all positions are free */ +} + + +static void resize (lua_State *L, Table *t, int nasize, int nhsize) { + int i; + int oldasize = t->sizearray; + int oldhsize = t->lsizenode; + Node *nold = t->node; /* save old hash ... */ + if (nasize > oldasize) /* array part must grow? */ + setarrayvector(L, t, nasize); + /* create new hash part with appropriate size */ + setnodevector(L, t, nhsize); + if (nasize < oldasize) { /* array part must shrink? */ + t->sizearray = nasize; + /* re-insert elements from vanishing slice */ + for (i=nasize; iarray[i])) + setobjt2t(L, luaH_setnum(L, t, i+1), &t->array[i]); + } + /* shrink array */ + luaM_reallocvector(L, t->array, oldasize, nasize, TValue); + } + /* re-insert elements from hash part */ + for (i = twoto(oldhsize) - 1; i >= 0; i--) { + Node *old = nold+i; + if (!ttisnil(gval(old))) + setobjt2t(L, luaH_set(L, t, key2tval(old)), gval(old)); + } + if (nold != dummynode) + luaM_freearray(L, nold, twoto(oldhsize), Node); /* free old array */ +} + + +void luaH_resizearray (lua_State *L, Table *t, int nasize) { + int nsize = (t->node == dummynode) ? 0 : sizenode(t); + resize(L, t, nasize, nsize); +} + + +static void rehash (lua_State *L, Table *t, const TValue *ek) { + int nasize, na; + int nums[MAXBITS+1]; /* nums[i] = number of keys between 2^(i-1) and 2^i */ + int i; + int totaluse; + for (i=0; i<=MAXBITS; i++) nums[i] = 0; /* reset counts */ + nasize = numusearray(t, nums); /* count keys in array part */ + totaluse = nasize; /* all those keys are integer keys */ + totaluse += numusehash(t, nums, &nasize); /* count keys in hash part */ + /* count extra key */ + nasize += countint(ek, nums); + totaluse++; + /* compute new size for array part */ + na = computesizes(nums, &nasize); + /* resize the table to new computed sizes */ + resize(L, t, nasize, totaluse - na); +} + + + +/* +** }============================================================= +*/ + + +Table *luaH_new (lua_State *L, int narray, int nhash) { + Table *t = luaM_new(L, Table); + luaC_link(L, obj2gco(t), LUA_TTABLE); + t->metatable = NULL; + t->flags = cast_byte(~0); + /* temporary values (kept only if some malloc fails) */ + t->array = NULL; + t->sizearray = 0; + t->lsizenode = 0; + t->node = cast(Node *, dummynode); + setarrayvector(L, t, narray); + setnodevector(L, t, nhash); + return t; +} + + +void luaH_free (lua_State *L, Table *t) { + if (t->node != dummynode) + luaM_freearray(L, t->node, sizenode(t), Node); + luaM_freearray(L, t->array, t->sizearray, TValue); + luaM_free(L, t); +} + + +static Node *getfreepos (Table *t) { + while (t->lastfree-- > t->node) { + if (ttisnil(gkey(t->lastfree))) + return t->lastfree; + } + return NULL; /* could not find a free place */ +} + + + +/* +** inserts a new key into a hash table; first, check whether key's main +** position is free. If not, check whether colliding node is in its main +** position or not: if it is not, move colliding node to an empty place and +** put new key in its main position; otherwise (colliding node is in its main +** position), new key goes to an empty position. +*/ +static TValue *newkey (lua_State *L, Table *t, const TValue *key) { + Node *mp = mainposition(t, key); + if (!ttisnil(gval(mp)) || mp == dummynode) { + Node *othern; + Node *n = getfreepos(t); /* get a free place */ + if (n == NULL) { /* cannot find a free place? */ + rehash(L, t, key); /* grow table */ + return luaH_set(L, t, key); /* re-insert key into grown table */ + } + lua_assert(n != dummynode); + othern = mainposition(t, key2tval(mp)); + if (othern != mp) { /* is colliding node out of its main position? */ + /* yes; move colliding node into free position */ + while (gnext(othern) != mp) othern = gnext(othern); /* find previous */ + gnext(othern) = n; /* redo the chain with `n' in place of `mp' */ + *n = *mp; /* copy colliding node into free pos. (mp->next also goes) */ + gnext(mp) = NULL; /* now `mp' is free */ + setnilvalue(gval(mp)); + } + else { /* colliding node is in its own main position */ + /* new node will go into free position */ + gnext(n) = gnext(mp); /* chain new position */ + gnext(mp) = n; + mp = n; + } + } + gkey(mp)->value = key->value; gkey(mp)->tt = key->tt; + luaC_barriert(L, t, key); + lua_assert(ttisnil(gval(mp))); + return gval(mp); +} + + +/* +** search function for integers +*/ +const TValue *luaH_getnum (Table *t, int key) { + /* (1 <= key && key <= t->sizearray) */ + if (cast(unsigned int, key-1) < cast(unsigned int, t->sizearray)) + return &t->array[key-1]; + else { + lua_Number nk = cast_num(key); + Node *n = hashnum(t, nk); + do { /* check whether `key' is somewhere in the chain */ + if (ttisnumber(gkey(n)) && luai_numeq(nvalue(gkey(n)), nk)) + return gval(n); /* that's it */ + else n = gnext(n); + } while (n); + return luaO_nilobject; + } +} + + +/* +** search function for strings +*/ +const TValue *luaH_getstr (Table *t, TString *key) { + Node *n = hashstr(t, key); + do { /* check whether `key' is somewhere in the chain */ + if (ttisstring(gkey(n)) && rawtsvalue(gkey(n)) == key) + return gval(n); /* that's it */ + else n = gnext(n); + } while (n); + return luaO_nilobject; +} + + +/* +** main search function +*/ +const TValue *luaH_get (Table *t, const TValue *key) { + switch (ttype(key)) { + case LUA_TNIL: return luaO_nilobject; + case LUA_TSTRING: return luaH_getstr(t, rawtsvalue(key)); + case LUA_TNUMBER: { + int k; + lua_Number n = nvalue(key); + lua_number2int(k, n); + if (luai_numeq(cast_num(k), nvalue(key))) /* index is int? */ + return luaH_getnum(t, k); /* use specialized version */ + /* else go through */ + } + default: { + Node *n = mainposition(t, key); + do { /* check whether `key' is somewhere in the chain */ + if (luaO_rawequalObj(key2tval(n), key)) + return gval(n); /* that's it */ + else n = gnext(n); + } while (n); + return luaO_nilobject; + } + } +} + + +TValue *luaH_set (lua_State *L, Table *t, const TValue *key) { + const TValue *p = luaH_get(t, key); + t->flags = 0; + if (p != luaO_nilobject) + return cast(TValue *, p); + else { + if (ttisnil(key)) luaG_runerror(L, "table index is nil"); + else if (ttisnumber(key) && luai_numisnan(nvalue(key))) + luaG_runerror(L, "table index is NaN"); + return newkey(L, t, key); + } +} + + +TValue *luaH_setnum (lua_State *L, Table *t, int key) { + const TValue *p = luaH_getnum(t, key); + if (p != luaO_nilobject) + return cast(TValue *, p); + else { + TValue k; + setnvalue(&k, cast_num(key)); + return newkey(L, t, &k); + } +} + + +TValue *luaH_setstr (lua_State *L, Table *t, TString *key) { + const TValue *p = luaH_getstr(t, key); + if (p != luaO_nilobject) + return cast(TValue *, p); + else { + TValue k; + setsvalue(L, &k, key); + return newkey(L, t, &k); + } +} + + +static int unbound_search (Table *t, unsigned int j) { + unsigned int i = j; /* i is zero or a present index */ + j++; + /* find `i' and `j' such that i is present and j is not */ + while (!ttisnil(luaH_getnum(t, j))) { + i = j; + j *= 2; + if (j > cast(unsigned int, MAX_INT)) { /* overflow? */ + /* table was built with bad purposes: resort to linear search */ + i = 1; + while (!ttisnil(luaH_getnum(t, i))) i++; + return i - 1; + } + } + /* now do a binary search between them */ + while (j - i > 1) { + unsigned int m = (i+j)/2; + if (ttisnil(luaH_getnum(t, m))) j = m; + else i = m; + } + return i; +} + + +/* +** Try to find a boundary in table `t'. A `boundary' is an integer index +** such that t[i] is non-nil and t[i+1] is nil (and 0 if t[1] is nil). +*/ +int luaH_getn (Table *t) { + unsigned int j = t->sizearray; + if (j > 0 && ttisnil(&t->array[j - 1])) { + /* there is a boundary in the array part: (binary) search for it */ + unsigned int i = 0; + while (j - i > 1) { + unsigned int m = (i+j)/2; + if (ttisnil(&t->array[m - 1])) j = m; + else i = m; + } + return i; + } + /* else must find a boundary in hash part */ + else if (t->node == dummynode) /* hash part is empty? */ + return j; /* that is easy... */ + else return unbound_search(t, j); +} + + + +#if defined(LUA_DEBUG) + +Node *luaH_mainposition (const Table *t, const TValue *key) { + return mainposition(t, key); +} + +int luaH_isdummy (Node *n) { return n == dummynode; } + +#endif diff --git a/rpm-5.4.9/lua/ltable.h b/rpm-5.4.9/lua/ltable.h new file mode 100644 index 0000000..f5b9d5e --- /dev/null +++ b/rpm-5.4.9/lua/ltable.h @@ -0,0 +1,40 @@ +/* +** $Id: ltable.h,v 2.10.1.1 2007/12/27 13:02:25 roberto Exp $ +** Lua tables (hash) +** See Copyright Notice in lua.h +*/ + +#ifndef ltable_h +#define ltable_h + +#include "lobject.h" + + +#define gnode(t,i) (&(t)->node[i]) +#define gkey(n) (&(n)->i_key.nk) +#define gval(n) (&(n)->i_val) +#define gnext(n) ((n)->i_key.nk.next) + +#define key2tval(n) (&(n)->i_key.tvk) + + +LUAI_FUNC const TValue *luaH_getnum (Table *t, int key); +LUAI_FUNC TValue *luaH_setnum (lua_State *L, Table *t, int key); +LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); +LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key); +LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); +LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key); +LUAI_FUNC Table *luaH_new (lua_State *L, int narray, int lnhash); +LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize); +LUAI_FUNC void luaH_free (lua_State *L, Table *t); +LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key); +LUAI_FUNC int luaH_getn (Table *t); + + +#if defined(LUA_DEBUG) +LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key); +LUAI_FUNC int luaH_isdummy (Node *n); +#endif + + +#endif diff --git a/rpm-5.4.9/lua/ltablib.c b/rpm-5.4.9/lua/ltablib.c new file mode 100644 index 0000000..b6d9cb4 --- /dev/null +++ b/rpm-5.4.9/lua/ltablib.c @@ -0,0 +1,287 @@ +/* +** $Id: ltablib.c,v 1.38.1.3 2008/02/14 16:46:58 roberto Exp $ +** Library for Table Manipulation +** See Copyright Notice in lua.h +*/ + + +#include + +#define ltablib_c +#define LUA_LIB + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + +#define aux_getn(L,n) (luaL_checktype(L, n, LUA_TTABLE), luaL_getn(L, n)) + + +static int foreachi (lua_State *L) { + int i; + int n = aux_getn(L, 1); + luaL_checktype(L, 2, LUA_TFUNCTION); + for (i=1; i <= n; i++) { + lua_pushvalue(L, 2); /* function */ + lua_pushinteger(L, i); /* 1st argument */ + lua_rawgeti(L, 1, i); /* 2nd argument */ + lua_call(L, 2, 1); + if (!lua_isnil(L, -1)) + return 1; + lua_pop(L, 1); /* remove nil result */ + } + return 0; +} + + +static int foreach (lua_State *L) { + luaL_checktype(L, 1, LUA_TTABLE); + luaL_checktype(L, 2, LUA_TFUNCTION); + lua_pushnil(L); /* first key */ + while (lua_next(L, 1)) { + lua_pushvalue(L, 2); /* function */ + lua_pushvalue(L, -3); /* key */ + lua_pushvalue(L, -3); /* value */ + lua_call(L, 2, 1); + if (!lua_isnil(L, -1)) + return 1; + lua_pop(L, 2); /* remove value and result */ + } + return 0; +} + + +static int maxn (lua_State *L) { + lua_Number max = 0; + luaL_checktype(L, 1, LUA_TTABLE); + lua_pushnil(L); /* first key */ + while (lua_next(L, 1)) { + lua_pop(L, 1); /* remove value */ + if (lua_type(L, -1) == LUA_TNUMBER) { + lua_Number v = lua_tonumber(L, -1); + if (v > max) max = v; + } + } + lua_pushnumber(L, max); + return 1; +} + + +static int getn (lua_State *L) { + lua_pushinteger(L, aux_getn(L, 1)); + return 1; +} + + +static int setn (lua_State *L) { + luaL_checktype(L, 1, LUA_TTABLE); +#ifndef luaL_setn + luaL_setn(L, 1, luaL_checkint(L, 2)); +#else + luaL_error(L, LUA_QL("setn") " is obsolete"); +#endif + lua_pushvalue(L, 1); + return 1; +} + + +static int tinsert (lua_State *L) { + int e = aux_getn(L, 1) + 1; /* first empty element */ + int pos; /* where to insert new element */ + switch (lua_gettop(L)) { + case 2: { /* called with only 2 arguments */ + pos = e; /* insert new element at the end */ + break; + } + case 3: { + int i; + pos = luaL_checkint(L, 2); /* 2nd argument is the position */ + if (pos > e) e = pos; /* `grow' array if necessary */ + for (i = e; i > pos; i--) { /* move up elements */ + lua_rawgeti(L, 1, i-1); + lua_rawseti(L, 1, i); /* t[i] = t[i-1] */ + } + break; + } + default: { + return luaL_error(L, "wrong number of arguments to " LUA_QL("insert")); + } + } + luaL_setn(L, 1, e); /* new size */ + lua_rawseti(L, 1, pos); /* t[pos] = v */ + return 0; +} + + +static int tremove (lua_State *L) { + int e = aux_getn(L, 1); + int pos = luaL_optint(L, 2, e); + if (!(1 <= pos && pos <= e)) /* position is outside bounds? */ + return 0; /* nothing to remove */ + luaL_setn(L, 1, e - 1); /* t.n = n-1 */ + lua_rawgeti(L, 1, pos); /* result = t[pos] */ + for ( ;pos= P */ + while (lua_rawgeti(L, 1, ++i), sort_comp(L, -1, -2)) { + if (i>u) luaL_error(L, "invalid order function for sorting"); + lua_pop(L, 1); /* remove a[i] */ + } + /* repeat --j until a[j] <= P */ + while (lua_rawgeti(L, 1, --j), sort_comp(L, -3, -1)) { + if (j +#include +#include +#include +#include + +#define ltests_c + +#include "lua.h" + +#include "lapi.h" +#include "lauxlib.h" +#include "lcode.h" +#include "ldebug.h" +#include "ldo.h" +#include "lfunc.h" +#include "lmem.h" +#include "lopcodes.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" +#include "lualib.h" + + + +/* +** The whole module only makes sense with LUA_DEBUG on +*/ +#ifdef LUA_DEBUG + + +#define lua_pushintegral(L,i) lua_pushnumber(L, cast(lua_Number, (i))) + + +static lua_State *lua_state = NULL; + +int islocked = 0; + + +#define func_at(L,k) (L->ci->base+(k) - 1) + + +static void setnameval (lua_State *L, const char *name, int val) + /*@*/ +{ + lua_pushstring(L, name); + lua_pushintegral(L, val); + lua_settable(L, -3); +} + + +/* +** {====================================================================== +** Controlled version for realloc. +** ======================================================================= +*/ + +#define MARK 0x55 /* 01010101 (a nice pattern) */ + +#ifndef EXTERNMEMCHECK +/* full memory check */ +#define HEADER (sizeof(L_Umaxalign)) /* ensures maximum alignment for HEADER */ +#define MARKSIZE 16 /* size of marks after each block */ +#define blockhead(b) (cast(char *, b) - HEADER) +#define setsize(newblock, size) (*cast(size_t *, newblock) = size) +#define checkblocksize(b, size) (size == (*cast(size_t *, blockhead(b)))) +#define fillmem(mem,size) memset(mem, -MARK, size) +#else +/* external memory check: don't do it twice */ +#define HEADER 0 +#define MARKSIZE 0 +#define blockhead(b) (b) +#define setsize(newblock, size) /* empty */ +#define checkblocksize(b,size) (1) +#define fillmem(mem,size) /* empty */ +#endif + +unsigned long memdebug_numblocks = 0; +unsigned long memdebug_total = 0; +unsigned long memdebug_maxmem = 0; +unsigned long memdebug_memlimit = ULONG_MAX; + + +static void *checkblock (void *block, size_t size) + /*@*/ +{ + void *b = blockhead(block); + int i; + for (i=0;i 0); + if (size == 0) { + freeblock(block, oldsize); + return NULL; + } + else if (size > oldsize && memdebug_total+size-oldsize > memdebug_memlimit) + return NULL; /* to test memory allocation errors */ + else { + void *newblock; + int i; + size_t realsize = HEADER+size+MARKSIZE; + size_t commonsize = (oldsize < size) ? oldsize : size; + if (realsize < size) return NULL; /* overflow! */ + newblock = malloc(realsize); /* alloc a new block */ + if (newblock == NULL) return NULL; + if (block) { + memcpy(cast(char *, newblock)+HEADER, block, commonsize); + freeblock(block, oldsize); /* erase (and check) old copy */ + } + /* initialize new part of the block with something `weird' */ + fillmem(cast(char *, newblock)+HEADER+commonsize, size-commonsize); + memdebug_total += size; + if (memdebug_total > memdebug_maxmem) + memdebug_maxmem = memdebug_total; + memdebug_numblocks++; + setsize(newblock, size); + for (i=0;icode[pc]; + OpCode o = GET_OPCODE(i); + const char *name = luaP_opnames[o]; + int line = getline(p, pc); + sprintf(buff, "(%4d) %4d - ", line, pc); + switch (getOpMode(o)) { + case iABC: + sprintf(buff+strlen(buff), "%-12s%4d %4d %4d", name, + GETARG_A(i), GETARG_B(i), GETARG_C(i)); + break; + case iABx: + sprintf(buff+strlen(buff), "%-12s%4d %4d", name, GETARG_A(i), GETARG_Bx(i)); + break; + case iAsBx: + sprintf(buff+strlen(buff), "%-12s%4d %4d", name, GETARG_A(i), GETARG_sBx(i)); + break; + } + return buff; +} + + +#if 0 +void luaI_printcode (Proto *pt, int size) { + int pc; + for (pc=0; pcl.p; + lua_newtable(L); + setnameval(L, "maxstack", p->maxstacksize); + setnameval(L, "numparams", p->numparams); + for (pc=0; pcsizecode; pc++) { + char buff[100]; + lua_pushintegral(L, pc+1); + lua_pushstring(L, buildop(p, pc, buff)); + lua_settable(L, -3); + } + return 1; +} + + +static int listk (lua_State *L) + /*@*/ +{ + Proto *p; + int i; + luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), + 1, "Lua function expected"); + p = clvalue(func_at(L, 1))->l.p; + lua_newtable(L); + for (i=0; isizek; i++) { + lua_pushintegral(L, i+1); + luaA_pushobject(L, p->k+i); + lua_settable(L, -3); + } + return 1; +} + + +static int listlocals (lua_State *L) + /*@*/ +{ + Proto *p; + int pc = luaL_checkint(L, 2) - 1; + int i = 0; + const char *name; + luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), + 1, "Lua function expected"); + p = clvalue(func_at(L, 1))->l.p; + while ((name = luaF_getlocalname(p, ++i, pc)) != NULL) + lua_pushstring(L, name); + return i-1; +} + +/* }====================================================== */ + + + + +static int get_limits (lua_State *L) + /*@*/ +{ + lua_newtable(L); + setnameval(L, "BITS_INT", BITS_INT); + setnameval(L, "LFPF", LFIELDS_PER_FLUSH); + setnameval(L, "MAXVARS", MAXVARS); + setnameval(L, "MAXPARAMS", MAXPARAMS); + setnameval(L, "MAXSTACK", MAXSTACK); + setnameval(L, "MAXUPVALUES", MAXUPVALUES); + return 1; +} + + +static int mem_query (lua_State *L) + /*@*/ +{ + if (lua_isnone(L, 1)) { + lua_pushintegral(L, memdebug_total); + lua_pushintegral(L, memdebug_numblocks); + lua_pushintegral(L, memdebug_maxmem); + return 3; + } + else { + memdebug_memlimit = luaL_checkint(L, 1); + return 0; + } +} + + +static int hash_query (lua_State *L) + /*@*/ +{ + if (lua_isnone(L, 2)) { + luaL_argcheck(L, lua_type(L, 1) == LUA_TSTRING, 1, "string expected"); + lua_pushintegral(L, tsvalue(func_at(L, 1))->tsv.hash); + } + else { + TObject *o = func_at(L, 1); + Table *t; + luaL_checktype(L, 2, LUA_TTABLE); + t = hvalue(func_at(L, 2)); + lua_pushintegral(L, luaH_mainposition(t, o) - t->node); + } + return 1; +} + + +static int stacklevel (lua_State *L) + /*@*/ +{ + unsigned long a = 0; + lua_pushintegral(L, (int)(L->top - L->stack)); + lua_pushintegral(L, (int)(L->stack_last - L->stack)); + lua_pushintegral(L, (int)(L->ci - L->base_ci)); + lua_pushintegral(L, (int)(L->end_ci - L->base_ci)); + lua_pushintegral(L, (unsigned long)&a); + return 5; +} + + +static int table_query (lua_State *L) + /*@*/ +{ + const Table *t; + int i = luaL_optint(L, 2, -1); + luaL_checktype(L, 1, LUA_TTABLE); + t = hvalue(func_at(L, 1)); + if (i == -1) { + lua_pushintegral(L, t->sizearray); + lua_pushintegral(L, sizenode(t)); + lua_pushintegral(L, t->firstfree - t->node); + } + else if (i < t->sizearray) { + lua_pushintegral(L, i); + luaA_pushobject(L, &t->array[i]); + lua_pushnil(L); + } + else if ((i -= t->sizearray) < sizenode(t)) { + if (!ttisnil(gval(gnode(t, i))) || + ttisnil(gkey(gnode(t, i))) || + ttisnumber(gkey(gnode(t, i)))) { + luaA_pushobject(L, gkey(gnode(t, i))); + } + else + lua_pushstring(L, ""); + luaA_pushobject(L, gval(gnode(t, i))); + if (t->node[i].next) + lua_pushintegral(L, t->node[i].next - t->node); + else + lua_pushnil(L); + } + return 3; +} + + +static int string_query (lua_State *L) + /*@*/ +{ + stringtable *tb = &G(L)->strt; + int s = luaL_optint(L, 2, 0) - 1; + if (s==-1) { + lua_pushintegral(L ,tb->nuse); + lua_pushintegral(L ,tb->size); + return 2; + } + else if (s < tb->size) { + GCObject *ts; + int n = 0; + for (ts = tb->hash[s]; ts; ts = ts->gch.next) { + setsvalue2s(L->top, gcotots(ts)); + incr_top(L); + n++; + } + return n; + } + return 0; +} + + +static int tref (lua_State *L) + /*@*/ +{ + int level = lua_gettop(L); + int lock = luaL_optint(L, 2, 1); + luaL_checkany(L, 1); + lua_pushvalue(L, 1); + lua_pushintegral(L, lua_ref(L, lock)); + assert(lua_gettop(L) == level+1); /* +1 for result */ + return 1; +} + +static int getref (lua_State *L) + /*@*/ +{ + int level = lua_gettop(L); + lua_getref(L, luaL_checkint(L, 1)); + assert(lua_gettop(L) == level+1); + return 1; +} + +static int unref (lua_State *L) + /*@*/ +{ + int level = lua_gettop(L); + lua_unref(L, luaL_checkint(L, 1)); + assert(lua_gettop(L) == level); + return 0; +} + +static int metatable (lua_State *L) + /*@*/ +{ + luaL_checkany(L, 1); + if (lua_isnone(L, 2)) { + if (lua_getmetatable(L, 1) == 0) + lua_pushnil(L); + } + else { + lua_settop(L, 2); + luaL_checktype(L, 2, LUA_TTABLE); + lua_setmetatable(L, 1); + } + return 1; +} + + +static int upvalue (lua_State *L) + /*@*/ +{ + int n = luaL_checkint(L, 2); + luaL_checktype(L, 1, LUA_TFUNCTION); + if (lua_isnone(L, 3)) { + const char *name = lua_getupvalue(L, 1, n); + if (name == NULL) return 0; + lua_pushstring(L, name); + return 2; + } + else { + const char *name = lua_setupvalue(L, 1, n); + lua_pushstring(L, name); + return 1; + } +} + + +static int newuserdata (lua_State *L) + /*@*/ +{ + size_t size = luaL_checkint(L, 1); + char *p = cast(char *, lua_newuserdata(L, size)); + while (size--) *p++ = '\0'; + return 1; +} + + +static int pushuserdata (lua_State *L) + /*@*/ +{ + lua_pushlightuserdata(L, cast(void *, luaL_checkint(L, 1))); + return 1; +} + + +static int udataval (lua_State *L) + /*@*/ +{ + lua_pushintegral(L, cast(int, lua_touserdata(L, 1))); + return 1; +} + + +static int doonnewstack (lua_State *L) + /*@*/ +{ + lua_State *L1 = lua_newthread(L); + size_t l; + const char *s = luaL_checklstring(L, 1, &l); + int status = luaL_loadbuffer(L1, s, l, s); + if (status == 0) + status = lua_pcall(L1, 0, 0, 0); + lua_pushintegral(L, status); + return 1; +} + + +static int s2d (lua_State *L) + /*@*/ +{ + lua_pushnumber(L, *cast(const double *, luaL_checkstring(L, 1))); + return 1; +} + +static int d2s (lua_State *L) + /*@*/ +{ + double d = luaL_checknumber(L, 1); + lua_pushlstring(L, cast(char *, &d), sizeof(d)); + return 1; +} + + +static int newstate (lua_State *L) + /*@*/ +{ + lua_State *L1 = lua_open(); + if (L1) { + lua_userstateopen(L1); /* init lock */ + lua_pushintegral(L, (unsigned long)L1); + } + else + lua_pushnil(L); + return 1; +} + + +static int loadlib (lua_State *L) + /*@*/ +{ + static const luaL_reg libs[] = { + {"mathlibopen", luaopen_math}, + {"strlibopen", luaopen_string}, + {"iolibopen", luaopen_io}, + {"tablibopen", luaopen_table}, + {"dblibopen", luaopen_debug}, + {"baselibopen", luaopen_base}, + {NULL, NULL} + }; + lua_State *L1 = cast(lua_State *, + cast(unsigned long, luaL_checknumber(L, 1))); + lua_pushvalue(L1, LUA_GLOBALSINDEX); + luaL_openlib(L1, NULL, libs, 0); + return 0; +} + +static int closestate (lua_State *L) + /*@*/ +{ + lua_State *L1 = cast(lua_State *, cast(unsigned long, luaL_checknumber(L, 1))); + lua_close(L1); + lua_unlock(L); /* close cannot unlock that */ + return 0; +} + +static int doremote (lua_State *L) + /*@*/ +{ + lua_State *L1 = cast(lua_State *,cast(unsigned long,luaL_checknumber(L, 1))); + size_t lcode; + const char *code = luaL_checklstring(L, 2, &lcode); + int status; + lua_settop(L1, 0); + status = luaL_loadbuffer(L1, code, lcode, code); + if (status == 0) + status = lua_pcall(L1, 0, LUA_MULTRET, 0); + if (status != 0) { + lua_pushnil(L); + lua_pushintegral(L, status); + lua_pushstring(L, lua_tostring(L1, -1)); + return 3; + } + else { + int i = 0; + while (!lua_isnone(L1, ++i)) + lua_pushstring(L, lua_tostring(L1, i)); + lua_pop(L1, i-1); + return i-1; + } +} + + +static int log2_aux (lua_State *L) + /*@*/ +{ + lua_pushintegral(L, luaO_log2(luaL_checkint(L, 1))); + return 1; +} + +static int int2fb_aux (lua_State *L) + /*@*/ +{ + int b = luaO_int2fb(luaL_checkint(L, 1)); + lua_pushintegral(L, b); + lua_pushintegral(L, fb2int(b)); + return 2; +} + + +static int test_do (lua_State *L) + /*@*/ +{ + const char *p = luaL_checkstring(L, 1); + if (*p == '@') + lua_dofile(L, p+1); + else + lua_dostring(L, p); + return lua_gettop(L); +} + + + +/* +** {====================================================== +** function to test the API with C. It interprets a kind of assembler +** language with calls to the API, so the test can be driven by Lua code +** ======================================================= +*/ + +static const char *const delimits = " \t\n,;"; + +static void skip (const char **pc) + /*@*/ +{ + while (**pc != '\0' && strchr(delimits, **pc)) (*pc)++; +} + +static int getnum_aux (lua_State *L, const char **pc) + /*@*/ +{ + int res = 0; + int sig = 1; + skip(pc); + if (**pc == '.') { + res = cast(int, lua_tonumber(L, -1)); + lua_pop(L, 1); + (*pc)++; + return res; + } + else if (**pc == '-') { + sig = -1; + (*pc)++; + } + while (isdigit(cast(int, **pc))) res = res*10 + (*(*pc)++) - '0'; + return sig*res; +} + +static const char *getname_aux (char *buff, const char **pc) + /*@*/ +{ + int i = 0; + skip(pc); + while (**pc != '\0' && !strchr(delimits, **pc)) + buff[i++] = *(*pc)++; + buff[i] = '\0'; + return buff; +} + + +#define EQ(s1) (strcmp(s1, inst) == 0) + +#define getnum (getnum_aux(L, &pc)) +#define getname (getname_aux(buff, &pc)) + + +static int testC (lua_State *L) + /*@*/ +{ + char buff[30]; + const char *pc = luaL_checkstring(L, 1); + for (;;) { + const char *inst = getname; + if EQ("") return 0; + else if EQ("isnumber") { + lua_pushintegral(L, lua_isnumber(L, getnum)); + } + else if EQ("isstring") { + lua_pushintegral(L, lua_isstring(L, getnum)); + } + else if EQ("istable") { + lua_pushintegral(L, lua_istable(L, getnum)); + } + else if EQ("iscfunction") { + lua_pushintegral(L, lua_iscfunction(L, getnum)); + } + else if EQ("isfunction") { + lua_pushintegral(L, lua_isfunction(L, getnum)); + } + else if EQ("isuserdata") { + lua_pushintegral(L, lua_isuserdata(L, getnum)); + } + else if EQ("isudataval") { + lua_pushintegral(L, lua_islightuserdata(L, getnum)); + } + else if EQ("isnil") { + lua_pushintegral(L, lua_isnil(L, getnum)); + } + else if EQ("isnull") { + lua_pushintegral(L, lua_isnone(L, getnum)); + } + else if EQ("tonumber") { + lua_pushnumber(L, lua_tonumber(L, getnum)); + } + else if EQ("tostring") { + const char *s = lua_tostring(L, getnum); + lua_pushstring(L, s); + } + else if EQ("strlen") { + lua_pushintegral(L, lua_strlen(L, getnum)); + } + else if EQ("tocfunction") { + lua_pushcfunction(L, lua_tocfunction(L, getnum)); + } + else if EQ("return") { + return getnum; + } + else if EQ("gettop") { + lua_pushintegral(L, lua_gettop(L)); + } + else if EQ("settop") { + lua_settop(L, getnum); + } + else if EQ("pop") { + lua_pop(L, getnum); + } + else if EQ("pushnum") { + lua_pushintegral(L, getnum); + } + else if EQ("pushnil") { + lua_pushnil(L); + } + else if EQ("pushbool") { + lua_pushboolean(L, getnum); + } + else if EQ("tobool") { + lua_pushintegral(L, lua_toboolean(L, getnum)); + } + else if EQ("pushvalue") { + lua_pushvalue(L, getnum); + } + else if EQ("pushcclosure") { + lua_pushcclosure(L, testC, getnum); + } + else if EQ("pushupvalues") { + lua_pushupvalues(L); + } + else if EQ("remove") { + lua_remove(L, getnum); + } + else if EQ("insert") { + lua_insert(L, getnum); + } + else if EQ("replace") { + lua_replace(L, getnum); + } + else if EQ("gettable") { + lua_gettable(L, getnum); + } + else if EQ("settable") { + lua_settable(L, getnum); + } + else if EQ("next") { + lua_next(L, -2); + } + else if EQ("concat") { + lua_concat(L, getnum); + } + else if EQ("lessthan") { + int a = getnum; + lua_pushboolean(L, lua_lessthan(L, a, getnum)); + } + else if EQ("equal") { + int a = getnum; + lua_pushboolean(L, lua_equal(L, a, getnum)); + } + else if EQ("rawcall") { + int narg = getnum; + int nres = getnum; + lua_call(L, narg, nres); + } + else if EQ("call") { + int narg = getnum; + int nres = getnum; + lua_pcall(L, narg, nres, 0); + } + else if EQ("loadstring") { + size_t sl; + const char *s = luaL_checklstring(L, getnum, &sl); + luaL_loadbuffer(L, s, sl, s); + } + else if EQ("loadfile") { + luaL_loadfile(L, luaL_checkstring(L, getnum)); + } + else if EQ("setmetatable") { + lua_setmetatable(L, getnum); + } + else if EQ("getmetatable") { + if (lua_getmetatable(L, getnum) == 0) + lua_pushnil(L); + } + else if EQ("type") { + lua_pushstring(L, lua_typename(L, lua_type(L, getnum))); + } + else if EQ("getn") { + int i = getnum; + lua_pushintegral(L, luaL_getn(L, i)); + } + else if EQ("setn") { + int i = getnum; + int n = cast(int, lua_tonumber(L, -1)); + luaL_setn(L, i, n); + lua_pop(L, 1); + } + else luaL_error(L, "unknown instruction %s", buff); + } + return 0; +} + +/* }====================================================== */ + + +/* +** {====================================================== +** tests for yield inside hooks +** ======================================================= +*/ + +static void yieldf (lua_State *L, lua_Debug *ar) + /*@*/ +{ + lua_yield(L, 0); +} + +static int setyhook (lua_State *L) + /*@*/ +{ + if (lua_isnoneornil(L, 1)) + lua_sethook(L, NULL, 0, 0); /* turn off hooks */ + else { + const char *smask = luaL_checkstring(L, 1); + int count = luaL_optint(L, 2, 0); + int mask = 0; + if (strchr(smask, 'l')) mask |= LUA_MASKLINE; + if (count > 0) mask |= LUA_MASKCOUNT; + lua_sethook(L, yieldf, mask, count); + } + return 0; +} + + +static int coresume (lua_State *L) + /*@*/ +{ + int status; + lua_State *co = lua_tothread(L, 1); + luaL_argcheck(L, co, 1, "coroutine expected"); + status = lua_resume(co, 0); + if (status != 0) { + lua_pushboolean(L, 0); + lua_insert(L, -2); + return 2; /* return false + error message */ + } + else { + lua_pushboolean(L, 1); + return 1; + } +} + +/* }====================================================== */ + + + +static const struct luaL_reg tests_funcs[] = { + {"hash", hash_query}, + {"limits", get_limits}, + {"listcode", listcode}, + {"listk", listk}, + {"listlocals", listlocals}, + {"loadlib", loadlib}, + {"stacklevel", stacklevel}, + {"querystr", string_query}, + {"querytab", table_query}, + {"doit", test_do}, + {"testC", testC}, + {"ref", tref}, + {"getref", getref}, + {"unref", unref}, + {"d2s", d2s}, + {"s2d", s2d}, + {"metatable", metatable}, + {"upvalue", upvalue}, + {"newuserdata", newuserdata}, + {"pushuserdata", pushuserdata}, + {"udataval", udataval}, + {"doonnewstack", doonnewstack}, + {"newstate", newstate}, + {"closestate", closestate}, + {"doremote", doremote}, + {"log2", log2_aux}, + {"int2fb", int2fb_aux}, + {"totalmem", mem_query}, + {"resume", coresume}, + {"setyhook", setyhook}, + {NULL, NULL} +}; + + +static void fim (void) + /*@*/ +{ + if (!islocked) + lua_close(lua_state); + lua_assert(memdebug_numblocks == 0); + lua_assert(memdebug_total == 0); +} + + +static int l_panic (lua_State *L) + /*@*/ +{ + UNUSED(L); + fprintf(stderr, "unable to recover; exiting\n"); + return 0; +} + + +int luaB_opentests (lua_State *L) { + lua_atpanic(L, l_panic); + lua_userstateopen(L); /* init lock */ + lua_state = L; /* keep first state to be opened */ + luaL_openlib(L, "T", tests_funcs, 0); + atexit(fim); + return 0; +} + + +#undef main +int main (int argc, char *argv[]) { + char *limit = getenv("MEMLIMIT"); + if (limit) + memdebug_memlimit = strtoul(limit, NULL, 10); + l_main(argc, argv); + return 0; +} + +#endif diff --git a/rpm-5.4.9/lua/ltm.c b/rpm-5.4.9/lua/ltm.c new file mode 100644 index 0000000..c27f0f6 --- /dev/null +++ b/rpm-5.4.9/lua/ltm.c @@ -0,0 +1,75 @@ +/* +** $Id: ltm.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $ +** Tag methods +** See Copyright Notice in lua.h +*/ + + +#include + +#define ltm_c +#define LUA_CORE + +#include "lua.h" + +#include "lobject.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" +#include "ltm.h" + + + +const char *const luaT_typenames[] = { + "nil", "boolean", "userdata", "number", + "string", "table", "function", "userdata", "thread", + "proto", "upval" +}; + + +void luaT_init (lua_State *L) { + static const char *const luaT_eventname[] = { /* ORDER TM */ + "__index", "__newindex", + "__gc", "__mode", "__eq", + "__add", "__sub", "__mul", "__div", "__mod", + "__pow", "__unm", "__len", "__lt", "__le", + "__concat", "__call" + }; + int i; + for (i=0; itmname[i] = luaS_new(L, luaT_eventname[i]); + luaS_fix(G(L)->tmname[i]); /* never collect these names */ + } +} + + +/* +** function to be used with macro "fasttm": optimized for absence of +** tag methods +*/ +const TValue *luaT_gettm (Table *events, TMS event, TString *ename) { + const TValue *tm = luaH_getstr(events, ename); + lua_assert(event <= TM_EQ); + if (ttisnil(tm)) { /* no tag method? */ + events->flags |= cast_byte(1u<metatable; + break; + case LUA_TUSERDATA: + mt = uvalue(o)->metatable; + break; + default: + mt = G(L)->mt[ttype(o)]; + } + return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject); +} + diff --git a/rpm-5.4.9/lua/ltm.h b/rpm-5.4.9/lua/ltm.h new file mode 100644 index 0000000..64343b7 --- /dev/null +++ b/rpm-5.4.9/lua/ltm.h @@ -0,0 +1,54 @@ +/* +** $Id: ltm.h,v 2.6.1.1 2007/12/27 13:02:25 roberto Exp $ +** Tag methods +** See Copyright Notice in lua.h +*/ + +#ifndef ltm_h +#define ltm_h + + +#include "lobject.h" + + +/* +* WARNING: if you change the order of this enumeration, +* grep "ORDER TM" +*/ +typedef enum { + TM_INDEX, + TM_NEWINDEX, + TM_GC, + TM_MODE, + TM_EQ, /* last tag method with `fast' access */ + TM_ADD, + TM_SUB, + TM_MUL, + TM_DIV, + TM_MOD, + TM_POW, + TM_UNM, + TM_LEN, + TM_LT, + TM_LE, + TM_CONCAT, + TM_CALL, + TM_N /* number of elements in the enum */ +} TMS; + + + +#define gfasttm(g,et,e) ((et) == NULL ? NULL : \ + ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e])) + +#define fasttm(l,et,e) gfasttm(G(l), et, e) + +LUAI_DATA const char *const luaT_typenames[]; + + +LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename); +LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, + TMS event); +LUAI_FUNC void luaT_init (lua_State *L); + +#endif diff --git a/rpm-5.4.9/lua/lua.c b/rpm-5.4.9/lua/lua.c new file mode 100644 index 0000000..3a46609 --- /dev/null +++ b/rpm-5.4.9/lua/lua.c @@ -0,0 +1,392 @@ +/* +** $Id: lua.c,v 1.160.1.2 2007/12/28 15:32:23 roberto Exp $ +** Lua stand-alone interpreter +** See Copyright Notice in lua.h +*/ + + +#include +#include +#include +#include + +#define lua_c + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + + +static lua_State *globalL = NULL; + +static const char *progname = LUA_PROGNAME; + + + +static void lstop (lua_State *L, lua_Debug *ar) { + (void)ar; /* unused arg. */ + lua_sethook(L, NULL, 0, 0); + luaL_error(L, "interrupted!"); +} + + +static void laction (int i) { + signal(i, SIG_DFL); /* if another SIGINT happens before lstop, + terminate process (default action) */ + lua_sethook(globalL, lstop, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1); +} + + +static void print_usage (void) { + fprintf(stderr, + "usage: %s [options] [script [args]].\n" + "Available options are:\n" + " -e stat execute string " LUA_QL("stat") "\n" + " -l name require library " LUA_QL("name") "\n" + " -i enter interactive mode after executing " LUA_QL("script") "\n" + " -v show version information\n" + " -- stop handling options\n" + " - execute stdin and stop handling options\n" + , + progname); + fflush(stderr); +} + + +static void l_message (const char *pname, const char *msg) { + if (pname) fprintf(stderr, "%s: ", pname); + fprintf(stderr, "%s\n", msg); + fflush(stderr); +} + + +static int report (lua_State *L, int status) { + if (status && !lua_isnil(L, -1)) { + const char *msg = lua_tostring(L, -1); + if (msg == NULL) msg = "(error object is not a string)"; + l_message(progname, msg); + lua_pop(L, 1); + } + return status; +} + + +static int traceback (lua_State *L) { + if (!lua_isstring(L, 1)) /* 'message' not a string? */ + return 1; /* keep it intact */ + lua_getfield(L, LUA_GLOBALSINDEX, "debug"); + if (!lua_istable(L, -1)) { + lua_pop(L, 1); + return 1; + } + lua_getfield(L, -1, "traceback"); + if (!lua_isfunction(L, -1)) { + lua_pop(L, 2); + return 1; + } + lua_pushvalue(L, 1); /* pass error message */ + lua_pushinteger(L, 2); /* skip this function and traceback */ + lua_call(L, 2, 1); /* call debug.traceback */ + return 1; +} + + +static int docall (lua_State *L, int narg, int clear) { + int status; + int base = lua_gettop(L) - narg; /* function index */ + lua_pushcfunction(L, traceback); /* push traceback function */ + lua_insert(L, base); /* put it under chunk and args */ + signal(SIGINT, laction); + status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base); + signal(SIGINT, SIG_DFL); + lua_remove(L, base); /* remove traceback function */ + /* force a complete garbage collection in case of errors */ + if (status != 0) lua_gc(L, LUA_GCCOLLECT, 0); + return status; +} + + +static void print_version (void) { + l_message(NULL, LUA_RELEASE " " LUA_COPYRIGHT); +} + + +static int getargs (lua_State *L, char **argv, int n) { + int narg; + int i; + int argc = 0; + while (argv[argc]) argc++; /* count total number of arguments */ + narg = argc - (n + 1); /* number of arguments to the script */ + luaL_checkstack(L, narg + 3, "too many arguments to script"); + for (i=n+1; i < argc; i++) + lua_pushstring(L, argv[i]); + lua_createtable(L, narg, n + 1); + for (i=0; i < argc; i++) { + lua_pushstring(L, argv[i]); + lua_rawseti(L, -2, i - n); + } + return narg; +} + + +static int dofile (lua_State *L, const char *name) { + int status = luaL_loadfile(L, name) || docall(L, 0, 1); + return report(L, status); +} + + +static int dostring (lua_State *L, const char *s, const char *name) { + int status = luaL_loadbuffer(L, s, strlen(s), name) || docall(L, 0, 1); + return report(L, status); +} + + +static int dolibrary (lua_State *L, const char *name) { + lua_getglobal(L, "require"); + lua_pushstring(L, name); + return report(L, docall(L, 1, 1)); +} + + +static const char *get_prompt (lua_State *L, int firstline) { + const char *p; + lua_getfield(L, LUA_GLOBALSINDEX, firstline ? "_PROMPT" : "_PROMPT2"); + p = lua_tostring(L, -1); + if (p == NULL) p = (firstline ? LUA_PROMPT : LUA_PROMPT2); + lua_pop(L, 1); /* remove global */ + return p; +} + + +static int incomplete (lua_State *L, int status) { + if (status == LUA_ERRSYNTAX) { + size_t lmsg; + const char *msg = lua_tolstring(L, -1, &lmsg); + const char *tp = msg + lmsg - (sizeof(LUA_QL("")) - 1); + if (strstr(msg, LUA_QL("")) == tp) { + lua_pop(L, 1); + return 1; + } + } + return 0; /* else... */ +} + + +static int pushline (lua_State *L, int firstline) { + char buffer[LUA_MAXINPUT]; + char *b = buffer; + size_t l; + const char *prmt = get_prompt(L, firstline); + if (lua_readline(L, b, prmt) == 0) + return 0; /* no input */ + l = strlen(b); + if (l > 0 && b[l-1] == '\n') /* line ends with newline? */ + b[l-1] = '\0'; /* remove it */ + if (firstline && b[0] == '=') /* first line starts with `=' ? */ + lua_pushfstring(L, "return %s", b+1); /* change it to `return' */ + else + lua_pushstring(L, b); + lua_freeline(L, b); + return 1; +} + + +static int loadline (lua_State *L) { + int status; + lua_settop(L, 0); + if (!pushline(L, 1)) + return -1; /* no input */ + for (;;) { /* repeat until gets a complete line */ + status = luaL_loadbuffer(L, lua_tostring(L, 1), lua_strlen(L, 1), "=stdin"); + if (!incomplete(L, status)) break; /* cannot try to add lines? */ + if (!pushline(L, 0)) /* no more input? */ + return -1; + lua_pushliteral(L, "\n"); /* add a new line... */ + lua_insert(L, -2); /* ...between the two lines */ + lua_concat(L, 3); /* join them */ + } + lua_saveline(L, 1); + lua_remove(L, 1); /* remove line */ + return status; +} + + +static void dotty (lua_State *L) { + int status; + const char *oldprogname = progname; + progname = NULL; + while ((status = loadline(L)) != -1) { + if (status == 0) status = docall(L, 0, 0); + report(L, status); + if (status == 0 && lua_gettop(L) > 0) { /* any result to print? */ + lua_getglobal(L, "print"); + lua_insert(L, 1); + if (lua_pcall(L, lua_gettop(L)-1, 0, 0) != 0) + l_message(progname, lua_pushfstring(L, + "error calling " LUA_QL("print") " (%s)", + lua_tostring(L, -1))); + } + } + lua_settop(L, 0); /* clear stack */ + fputs("\n", stdout); + fflush(stdout); + progname = oldprogname; +} + + +static int handle_script (lua_State *L, char **argv, int n) { + int status; + const char *fname; + int narg = getargs(L, argv, n); /* collect arguments */ + lua_setglobal(L, "arg"); + fname = argv[n]; + if (strcmp(fname, "-") == 0 && strcmp(argv[n-1], "--") != 0) + fname = NULL; /* stdin */ + status = luaL_loadfile(L, fname); + lua_insert(L, -(narg+1)); + if (status == 0) + status = docall(L, narg, 0); + else + lua_pop(L, narg); + return report(L, status); +} + + +/* check that argument has no extra characters at the end */ +#define notail(x) {if ((x)[2] != '\0') return -1;} + + +static int collectargs (char **argv, int *pi, int *pv, int *pe) { + int i; + for (i = 1; argv[i] != NULL; i++) { + if (argv[i][0] != '-') /* not an option? */ + return i; + switch (argv[i][1]) { /* option */ + case '-': + notail(argv[i]); + return (argv[i+1] != NULL ? i+1 : 0); + case '\0': + return i; + case 'i': + notail(argv[i]); + *pi = 1; /* go through */ + case 'v': + notail(argv[i]); + *pv = 1; + break; + case 'e': + *pe = 1; /* go through */ + case 'l': + if (argv[i][2] == '\0') { + i++; + if (argv[i] == NULL) return -1; + } + break; + default: return -1; /* invalid option */ + } + } + return 0; +} + + +static int runargs (lua_State *L, char **argv, int n) { + int i; + for (i = 1; i < n; i++) { + if (argv[i] == NULL) continue; + lua_assert(argv[i][0] == '-'); + switch (argv[i][1]) { /* option */ + case 'e': { + const char *chunk = argv[i] + 2; + if (*chunk == '\0') chunk = argv[++i]; + lua_assert(chunk != NULL); + if (dostring(L, chunk, "=(command line)") != 0) + return 1; + break; + } + case 'l': { + const char *filename = argv[i] + 2; + if (*filename == '\0') filename = argv[++i]; + lua_assert(filename != NULL); + if (dolibrary(L, filename)) + return 1; /* stop if file fails */ + break; + } + default: break; + } + } + return 0; +} + + +static int handle_luainit (lua_State *L) { + const char *init = getenv(LUA_INIT); + if (init == NULL) return 0; /* status OK */ + else if (init[0] == '@') + return dofile(L, init+1); + else + return dostring(L, init, "=" LUA_INIT); +} + + +struct Smain { + int argc; + char **argv; + int status; +}; + + +static int pmain (lua_State *L) { + struct Smain *s = (struct Smain *)lua_touserdata(L, 1); + char **argv = s->argv; + int script; + int has_i = 0, has_v = 0, has_e = 0; + globalL = L; + if (argv[0] && argv[0][0]) progname = argv[0]; + lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */ + luaL_openlibs(L); /* open libraries */ + lua_gc(L, LUA_GCRESTART, 0); + s->status = handle_luainit(L); + if (s->status != 0) return 0; + script = collectargs(argv, &has_i, &has_v, &has_e); + if (script < 0) { /* invalid args? */ + print_usage(); + s->status = 1; + return 0; + } + if (has_v) print_version(); + s->status = runargs(L, argv, (script > 0) ? script : s->argc); + if (s->status != 0) return 0; + if (script) + s->status = handle_script(L, argv, script); + if (s->status != 0) return 0; + if (has_i) + dotty(L); + else if (script == 0 && !has_e && !has_v) { + if (lua_stdin_is_tty()) { + print_version(); + dotty(L); + } + else dofile(L, NULL); /* executes stdin as a file */ + } + return 0; +} + + +int main (int argc, char **argv) { + int status; + struct Smain s; + lua_State *L = lua_open(); /* create state */ + if (L == NULL) { + l_message(argv[0], "cannot create state: not enough memory"); + return EXIT_FAILURE; + } + s.argc = argc; + s.argv = argv; + status = lua_cpcall(L, &pmain, &s); + report(L, status); + lua_close(L); + return (status || s.status) ? EXIT_FAILURE : EXIT_SUCCESS; +} + diff --git a/rpm-5.4.9/lua/lua.h b/rpm-5.4.9/lua/lua.h new file mode 100644 index 0000000..e4bdfd3 --- /dev/null +++ b/rpm-5.4.9/lua/lua.h @@ -0,0 +1,388 @@ +/* +** $Id: lua.h,v 1.218.1.5 2008/08/06 13:30:12 roberto Exp $ +** Lua - An Extensible Extension Language +** Lua.org, PUC-Rio, Brazil (http://www.lua.org) +** See Copyright Notice at the end of this file +*/ + + +#ifndef lua_h +#define lua_h + +#include +#include + + +#include "luaconf.h" + + +#define LUA_VERSION "Lua 5.1" +#define LUA_RELEASE "Lua 5.1.4" +#define LUA_VERSION_NUM 501 +#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio" +#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" + + +/* mark for precompiled code (`Lua') */ +#define LUA_SIGNATURE "\033Lua" + +/* option for multiple returns in `lua_pcall' and `lua_call' */ +#define LUA_MULTRET (-1) + + +/* +** pseudo-indices +*/ +#define LUA_REGISTRYINDEX (-10000) +#define LUA_ENVIRONINDEX (-10001) +#define LUA_GLOBALSINDEX (-10002) +#define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i)) + + +/* thread status; 0 is OK */ +#define LUA_YIELD 1 +#define LUA_ERRRUN 2 +#define LUA_ERRSYNTAX 3 +#define LUA_ERRMEM 4 +#define LUA_ERRERR 5 + + +typedef struct lua_State lua_State; + +typedef int (*lua_CFunction) (lua_State *L); + + +/* +** functions that read/write blocks when loading/dumping Lua chunks +*/ +typedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz); + +typedef int (*lua_Writer) (lua_State *L, const void* p, size_t sz, void* ud); + + +/* +** prototype for memory-allocation functions +*/ +typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); + + +/* +** basic types +*/ +#define LUA_TNONE (-1) + +#define LUA_TNIL 0 +#define LUA_TBOOLEAN 1 +#define LUA_TLIGHTUSERDATA 2 +#define LUA_TNUMBER 3 +#define LUA_TSTRING 4 +#define LUA_TTABLE 5 +#define LUA_TFUNCTION 6 +#define LUA_TUSERDATA 7 +#define LUA_TTHREAD 8 + + + +/* minimum Lua stack available to a C function */ +#define LUA_MINSTACK 20 + + +/* +** generic extra include file +*/ +#if defined(LUA_USER_H) +#include LUA_USER_H +#endif + + +/* type of numbers in Lua */ +typedef LUA_NUMBER lua_Number; + + +/* type for integer functions */ +typedef LUA_INTEGER lua_Integer; + + + +/* +** state manipulation +*/ +LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud); +LUA_API void (lua_close) (lua_State *L); +LUA_API lua_State *(lua_newthread) (lua_State *L); + +LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf); + + +/* +** basic stack manipulation +*/ +LUA_API int (lua_gettop) (lua_State *L); +LUA_API void (lua_settop) (lua_State *L, int idx); +LUA_API void (lua_pushvalue) (lua_State *L, int idx); +LUA_API void (lua_remove) (lua_State *L, int idx); +LUA_API void (lua_insert) (lua_State *L, int idx); +LUA_API void (lua_replace) (lua_State *L, int idx); +LUA_API int (lua_checkstack) (lua_State *L, int sz); + +LUA_API void (lua_xmove) (lua_State *from, lua_State *to, int n); + + +/* +** access functions (stack -> C) +*/ + +LUA_API int (lua_isnumber) (lua_State *L, int idx); +LUA_API int (lua_isstring) (lua_State *L, int idx); +LUA_API int (lua_iscfunction) (lua_State *L, int idx); +LUA_API int (lua_isuserdata) (lua_State *L, int idx); +LUA_API int (lua_type) (lua_State *L, int idx); +LUA_API const char *(lua_typename) (lua_State *L, int tp); + +LUA_API int (lua_equal) (lua_State *L, int idx1, int idx2); +LUA_API int (lua_rawequal) (lua_State *L, int idx1, int idx2); +LUA_API int (lua_lessthan) (lua_State *L, int idx1, int idx2); + +LUA_API lua_Number (lua_tonumber) (lua_State *L, int idx); +LUA_API lua_Integer (lua_tointeger) (lua_State *L, int idx); +LUA_API int (lua_toboolean) (lua_State *L, int idx); +LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len); +LUA_API size_t (lua_objlen) (lua_State *L, int idx); +LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx); +LUA_API void *(lua_touserdata) (lua_State *L, int idx); +LUA_API lua_State *(lua_tothread) (lua_State *L, int idx); +LUA_API const void *(lua_topointer) (lua_State *L, int idx); + + +/* +** push functions (C -> stack) +*/ +LUA_API void (lua_pushnil) (lua_State *L); +LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n); +LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n); +LUA_API void (lua_pushlstring) (lua_State *L, const char *s, size_t l); +LUA_API void (lua_pushstring) (lua_State *L, const char *s); +LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt, + va_list argp); +LUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...); +LUA_API void (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n); +LUA_API void (lua_pushboolean) (lua_State *L, int b); +LUA_API void (lua_pushlightuserdata) (lua_State *L, void *p); +LUA_API int (lua_pushthread) (lua_State *L); + + +/* +** get functions (Lua -> stack) +*/ +LUA_API void (lua_gettable) (lua_State *L, int idx); +LUA_API void (lua_getfield) (lua_State *L, int idx, const char *k); +LUA_API void (lua_rawget) (lua_State *L, int idx); +LUA_API void (lua_rawgeti) (lua_State *L, int idx, int n); +LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); +LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); +LUA_API int (lua_getmetatable) (lua_State *L, int objindex); +LUA_API void (lua_getfenv) (lua_State *L, int idx); + + +/* +** set functions (stack -> Lua) +*/ +LUA_API void (lua_settable) (lua_State *L, int idx); +LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k); +LUA_API void (lua_rawset) (lua_State *L, int idx); +LUA_API void (lua_rawseti) (lua_State *L, int idx, int n); +LUA_API int (lua_setmetatable) (lua_State *L, int objindex); +LUA_API int (lua_setfenv) (lua_State *L, int idx); + + +/* +** `load' and `call' functions (load and run Lua code) +*/ +LUA_API void (lua_call) (lua_State *L, int nargs, int nresults); +LUA_API int (lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc); +LUA_API int (lua_cpcall) (lua_State *L, lua_CFunction func, void *ud); +LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt, + const char *chunkname); + +LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data); + + +/* +** coroutine functions +*/ +LUA_API int (lua_yield) (lua_State *L, int nresults); +LUA_API int (lua_resume) (lua_State *L, int narg); +LUA_API int (lua_status) (lua_State *L); + +/* +** garbage-collection function and options +*/ + +#define LUA_GCSTOP 0 +#define LUA_GCRESTART 1 +#define LUA_GCCOLLECT 2 +#define LUA_GCCOUNT 3 +#define LUA_GCCOUNTB 4 +#define LUA_GCSTEP 5 +#define LUA_GCSETPAUSE 6 +#define LUA_GCSETSTEPMUL 7 + +LUA_API int (lua_gc) (lua_State *L, int what, int data); + + +/* +** miscellaneous functions +*/ + +LUA_API int (lua_error) (lua_State *L); + +LUA_API int (lua_next) (lua_State *L, int idx); + +LUA_API void (lua_concat) (lua_State *L, int n); + +LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud); +LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud); + + + +/* +** =============================================================== +** some useful macros +** =============================================================== +*/ + +#define lua_pop(L,n) lua_settop(L, -(n)-1) + +#define lua_newtable(L) lua_createtable(L, 0, 0) + +#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n))) + +#define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0) + +#define lua_strlen(L,i) lua_objlen(L, (i)) + +#define lua_isfunction(L,n) (lua_type(L, (n)) == LUA_TFUNCTION) +#define lua_istable(L,n) (lua_type(L, (n)) == LUA_TTABLE) +#define lua_islightuserdata(L,n) (lua_type(L, (n)) == LUA_TLIGHTUSERDATA) +#define lua_isnil(L,n) (lua_type(L, (n)) == LUA_TNIL) +#define lua_isboolean(L,n) (lua_type(L, (n)) == LUA_TBOOLEAN) +#define lua_isthread(L,n) (lua_type(L, (n)) == LUA_TTHREAD) +#define lua_isnone(L,n) (lua_type(L, (n)) == LUA_TNONE) +#define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0) + +#define lua_pushliteral(L, s) \ + lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1) + +#define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, (s)) +#define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, (s)) + +#define lua_tostring(L,i) lua_tolstring(L, (i), NULL) + + + +/* +** compatibility macros and functions +*/ + +#define lua_open() luaL_newstate() + +#define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX) + +#define lua_getgccount(L) lua_gc(L, LUA_GCCOUNT, 0) + +#define lua_Chunkreader lua_Reader +#define lua_Chunkwriter lua_Writer + + +/* hack */ +LUA_API void lua_setlevel (lua_State *from, lua_State *to); + + +/* +** {====================================================================== +** Debug API +** ======================================================================= +*/ + + +/* +** Event codes +*/ +#define LUA_HOOKCALL 0 +#define LUA_HOOKRET 1 +#define LUA_HOOKLINE 2 +#define LUA_HOOKCOUNT 3 +#define LUA_HOOKTAILRET 4 + + +/* +** Event masks +*/ +#define LUA_MASKCALL (1 << LUA_HOOKCALL) +#define LUA_MASKRET (1 << LUA_HOOKRET) +#define LUA_MASKLINE (1 << LUA_HOOKLINE) +#define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT) + +typedef struct lua_Debug lua_Debug; /* activation record */ + + +/* Functions to be called by the debuger in specific events */ +typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); + + +LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar); +LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar); +LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n); +LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n); +LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n); +LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n); + +LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count); +LUA_API lua_Hook lua_gethook (lua_State *L); +LUA_API int lua_gethookmask (lua_State *L); +LUA_API int lua_gethookcount (lua_State *L); + + +struct lua_Debug { + int event; + const char *name; /* (n) */ + const char *namewhat; /* (n) `global', `local', `field', `method' */ + const char *what; /* (S) `Lua', `C', `main', `tail' */ + const char *source; /* (S) */ + int currentline; /* (l) */ + int nups; /* (u) number of upvalues */ + int linedefined; /* (S) */ + int lastlinedefined; /* (S) */ + char short_src[LUA_IDSIZE]; /* (S) */ + /* private part */ + int i_ci; /* active function */ +}; + +/* }====================================================================== */ + + +/****************************************************************************** +* Copyright (C) 1994-2008 Lua.org, PUC-Rio. All rights reserved. +* +* 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +******************************************************************************/ + + +#endif diff --git a/rpm-5.4.9/lua/luac.c b/rpm-5.4.9/lua/luac.c new file mode 100644 index 0000000..d070173 --- /dev/null +++ b/rpm-5.4.9/lua/luac.c @@ -0,0 +1,200 @@ +/* +** $Id: luac.c,v 1.54 2006/06/02 17:37:11 lhf Exp $ +** Lua compiler (saves bytecodes to files; also list bytecodes) +** See Copyright Notice in lua.h +*/ + +#include +#include +#include +#include + +#define luac_c +#define LUA_CORE + +#include "lua.h" +#include "lauxlib.h" + +#include "ldo.h" +#include "lfunc.h" +#include "lmem.h" +#include "lobject.h" +#include "lopcodes.h" +#include "lstring.h" +#include "lundump.h" + +#define PROGNAME "luac" /* default program name */ +#define OUTPUT PROGNAME ".out" /* default output file */ + +static int listing=0; /* list bytecodes? */ +static int dumping=1; /* dump bytecodes? */ +static int stripping=0; /* strip debug information? */ +static char Output[]={ OUTPUT }; /* default output file name */ +static const char* output=Output; /* actual output file name */ +static const char* progname=PROGNAME; /* actual program name */ + +static void fatal(const char* message) +{ + fprintf(stderr,"%s: %s\n",progname,message); + exit(EXIT_FAILURE); +} + +static void cannot(const char* what) +{ + fprintf(stderr,"%s: cannot %s %s: %s\n",progname,what,output,strerror(errno)); + exit(EXIT_FAILURE); +} + +static void usage(const char* message) +{ + if (*message=='-') + fprintf(stderr,"%s: unrecognized option " LUA_QS "\n",progname,message); + else + fprintf(stderr,"%s: %s\n",progname,message); + fprintf(stderr, + "usage: %s [options] [filenames].\n" + "Available options are:\n" + " - process stdin\n" + " -l list\n" + " -o name output to file " LUA_QL("name") " (default is \"%s\")\n" + " -p parse only\n" + " -s strip debug information\n" + " -v show version information\n" + " -- stop handling options\n", + progname,Output); + exit(EXIT_FAILURE); +} + +#define IS(s) (strcmp(argv[i],s)==0) + +static int doargs(int argc, char* argv[]) +{ + int i; + int version=0; + if (argv[0]!=NULL && *argv[0]!=0) progname=argv[0]; + for (i=1; itop+(i))->l.p) + +static const Proto* combine(lua_State* L, int n) +{ + if (n==1) + return toproto(L,-1); + else + { + int i,pc; + Proto* f=luaF_newproto(L); + setptvalue2s(L,L->top,f); incr_top(L); + f->source=luaS_newliteral(L,"=(" PROGNAME ")"); + f->maxstacksize=1; + pc=2*n+1; + f->code=luaM_newvector(L,pc,Instruction); + f->sizecode=pc; + f->p=luaM_newvector(L,n,Proto*); + f->sizep=n; + pc=0; + for (i=0; ip[i]=toproto(L,i-n-1); + f->code[pc++]=CREATE_ABx(OP_CLOSURE,0,i); + f->code[pc++]=CREATE_ABC(OP_CALL,0,1,1); + } + f->code[pc++]=CREATE_ABC(OP_RETURN,0,1,0); + return f; + } +} + +static int writer(lua_State* L, const void* p, size_t size, void* u) +{ + UNUSED(L); + return (fwrite(p,size,1,(FILE*)u)!=1) && (size!=0); +} + +struct Smain { + int argc; + char** argv; +}; + +static int pmain(lua_State* L) +{ + struct Smain* s = (struct Smain*)lua_touserdata(L, 1); + int argc=s->argc; + char** argv=s->argv; + const Proto* f; + int i; + if (!lua_checkstack(L,argc)) fatal("too many input files"); + for (i=0; i1); + if (dumping) + { + FILE* D= (output==NULL) ? stdout : fopen(output,"wb"); + if (D==NULL) cannot("open"); + lua_lock(L); + luaU_dump(L,f,writer,D,stripping); + lua_unlock(L); + if (ferror(D)) cannot("write"); + if (fclose(D)) cannot("close"); + } + return 0; +} + +int main(int argc, char* argv[]) +{ + lua_State* L; + struct Smain s; + int i=doargs(argc,argv); + argc-=i; argv+=i; + if (argc<=0) usage("no input files given"); + L=lua_open(); + if (L==NULL) fatal("not enough memory for state"); + s.argc=argc; + s.argv=argv; + if (lua_cpcall(L,pmain,&s)!=0) fatal(lua_tostring(L,-1)); + lua_close(L); + return EXIT_SUCCESS; +} diff --git a/rpm-5.4.9/lua/luaconf.h b/rpm-5.4.9/lua/luaconf.h new file mode 100644 index 0000000..4248570 --- /dev/null +++ b/rpm-5.4.9/lua/luaconf.h @@ -0,0 +1,774 @@ +/* +** $Id: luaconf.h,v 1.82.1.7 2008/02/11 16:25:08 roberto Exp $ +** Configuration file for Lua +** See Copyright Notice in lua.h +*/ + + +#ifndef lconfig_h +#define lconfig_h + +#include +#include + + +/* +** ================================================================== +** Search for "@@" to find all configurable definitions. +** =================================================================== +*/ + + +/* +@@ LUA_ANSI controls the use of non-ansi features. +** CHANGE it (define it) if you want Lua to avoid the use of any +** non-ansi feature or library. +*/ +#if defined(__STRICT_ANSI__) +#define LUA_ANSI +#endif + + +#if !defined(LUA_ANSI) && defined(_WIN32) +#define LUA_WIN +#endif + +#if defined(LUA_USE_LINUX) +#define LUA_USE_POSIX +#define LUA_USE_DLOPEN /* needs an extra library: -ldl */ +#define LUA_USE_READLINE /* needs some extra libraries */ +#endif + +#if defined(LUA_USE_MACOSX) +#define LUA_USE_POSIX +#define LUA_DL_DYLD /* does not need extra library */ +#endif + + + +/* +@@ LUA_USE_POSIX includes all functionallity listed as X/Open System +@* Interfaces Extension (XSI). +** CHANGE it (define it) if your system is XSI compatible. +*/ +#if defined(LUA_USE_POSIX) +#define LUA_USE_MKSTEMP +#define LUA_USE_ISATTY +#define LUA_USE_POPEN +#define LUA_USE_ULONGJMP +#endif + + +/* +@@ LUA_PATH and LUA_CPATH are the names of the environment variables that +@* Lua check to set its paths. +@@ LUA_INIT is the name of the environment variable that Lua +@* checks for initialization code. +** CHANGE them if you want different names. +*/ +#define LUA_PATH "LUA_PATH" +#define LUA_CPATH "LUA_CPATH" +#define LUA_INIT "LUA_INIT" + + +/* +@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for +@* Lua libraries. +@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for +@* C libraries. +** CHANGE them if your machine has a non-conventional directory +** hierarchy or if you want to install your libraries in +** non-conventional directories. +*/ +#if defined(_WIN32) +/* +** In Windows, any exclamation mark ('!') in the path is replaced by the +** path of the directory of the executable file of the current process. +*/ +#define LUA_LDIR "!\\lua\\" +#define LUA_CDIR "!\\" +#define LUA_PATH_DEFAULT \ + ".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \ + LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua" +#define LUA_CPATH_DEFAULT \ + ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll" + +#else +#if defined(__linux__) +#define LUA_ROOT "/usr/" +#define LUA_LDIR LUA_ROOT "share/lua/5.1/" +#define LUA_CDIR LUA_ROOT "lib/lua/5.1/" +#define LUA_PATH_DEFAULT \ + "./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ + LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua" +#define LUA_CPATH_DEFAULT \ + "./?.so;" LUA_CDIR"?.so;" LUA_CDIR"loadall.so" +#else +#define LUA_ROOT "/usr/local/" +#define LUA_LDIR LUA_ROOT "share/lua/5.1/" +#define LUA_CDIR LUA_ROOT "lib/lua/5.1/" +#define LUA_PATH_DEFAULT \ + "./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ + LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua" +#define LUA_CPATH_DEFAULT \ + "./?.so;" LUA_CDIR"?.so;" LUA_CDIR"loadall.so" +#endif +#endif + + +/* +@@ LUA_DIRSEP is the directory separator (for submodules). +** CHANGE it if your machine does not use "/" as the directory separator +** and is not Windows. (On Windows Lua automatically uses "\".) +*/ +#if defined(_WIN32) +#define LUA_DIRSEP "\\" +#else +#define LUA_DIRSEP "/" +#endif + + +/* +@@ LUA_PATHSEP is the character that separates templates in a path. +@@ LUA_PATH_MARK is the string that marks the substitution points in a +@* template. +@@ LUA_EXECDIR in a Windows path is replaced by the executable's +@* directory. +@@ LUA_IGMARK is a mark to ignore all before it when bulding the +@* luaopen_ function name. +** CHANGE them if for some reason your system cannot use those +** characters. (E.g., if one of those characters is a common character +** in file/directory names.) Probably you do not need to change them. +*/ +#define LUA_PATHSEP ";" +#define LUA_PATH_MARK "?" +#define LUA_EXECDIR "!" +#define LUA_IGMARK "-" + + +/* +@@ LUA_INTEGER is the integral type used by lua_pushinteger/lua_tointeger. +** CHANGE that if ptrdiff_t is not adequate on your machine. (On most +** machines, ptrdiff_t gives a good choice between int or long.) +*/ +#define LUA_INTEGER ptrdiff_t + + +/* +@@ LUA_API is a mark for all core API functions. +@@ LUALIB_API is a mark for all standard library functions. +** CHANGE them if you need to define those functions in some special way. +** For instance, if you want to create one Windows DLL with the core and +** the libraries, you may want to use the following definition (define +** LUA_BUILD_AS_DLL to get it). +*/ +#if defined(LUA_BUILD_AS_DLL) + +#if defined(LUA_CORE) || defined(LUA_LIB) +#define LUA_API __declspec(dllexport) +#else +#define LUA_API __declspec(dllimport) +#endif + +#else + +#define LUA_API extern + +#endif + +/* more often than not the libs go together with the core */ +#define LUALIB_API LUA_API + + +/* +@@ LUAI_FUNC is a mark for all extern functions that are not to be +@* exported to outside modules. +@@ LUAI_DATA is a mark for all extern (const) variables that are not to +@* be exported to outside modules. +** CHANGE them if you need to mark them in some special way. Elf/gcc +** (versions 3.2 and later) mark them as "hidden" to optimize access +** when Lua is compiled as a shared library. +*/ +#if defined(luaall_c) +#define LUAI_FUNC static +#define LUAI_DATA /* empty */ + +#elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ + defined(__ELF__) +#define LUAI_FUNC __attribute__((visibility("hidden"))) extern +#define LUAI_DATA LUAI_FUNC + +#else +#define LUAI_FUNC extern +#define LUAI_DATA extern +#endif + + + +/* +@@ LUA_QL describes how error messages quote program elements. +** CHANGE it if you want a different appearance. +*/ +#define LUA_QL(x) "'" x "'" +#define LUA_QS LUA_QL("%s") + + +/* +@@ LUA_IDSIZE gives the maximum size for the description of the source +@* of a function in debug information. +** CHANGE it if you want a different size. +*/ +#define LUA_IDSIZE 60 + + +/* +** {================================================================== +** Stand-alone configuration +** =================================================================== +*/ + +#if defined(lua_c) || defined(luaall_c) + +/* +@@ lua_stdin_is_tty detects whether the standard input is a 'tty' (that +@* is, whether we're running lua interactively). +** CHANGE it if you have a better definition for non-POSIX/non-Windows +** systems. +*/ +#if defined(LUA_USE_ISATTY) +#include +#define lua_stdin_is_tty() isatty(0) +#elif defined(LUA_WIN) +#include +#include +#define lua_stdin_is_tty() _isatty(_fileno(stdin)) +#else +#define lua_stdin_is_tty() 1 /* assume stdin is a tty */ +#endif + + +/* +@@ LUA_PROMPT is the default prompt used by stand-alone Lua. +@@ LUA_PROMPT2 is the default continuation prompt used by stand-alone Lua. +** CHANGE them if you want different prompts. (You can also change the +** prompts dynamically, assigning to globals _PROMPT/_PROMPT2.) +*/ +#define LUA_PROMPT "> " +#define LUA_PROMPT2 ">> " + + +/* +@@ LUA_PROGNAME is the default name for the stand-alone Lua program. +** CHANGE it if your stand-alone interpreter has a different name and +** your system is not able to detect that name automatically. +*/ +#define LUA_PROGNAME "lua" + + +/* +@@ LUA_MAXINPUT is the maximum length for an input line in the +@* stand-alone interpreter. +** CHANGE it if you need longer lines. +*/ +#define LUA_MAXINPUT 512 + + +/* +@@ lua_readline defines how to show a prompt and then read a line from +@* the standard input. +@@ lua_saveline defines how to "save" a read line in a "history". +@@ lua_freeline defines how to free a line read by lua_readline. +** CHANGE them if you want to improve this functionality (e.g., by using +** GNU readline and history facilities). +*/ +#if defined(LUA_USE_READLINE) +#include +#include +#include +#define lua_readline(L,b,p) ((void)L, ((b)=readline(p)) != NULL) +#define lua_saveline(L,idx) \ + if (lua_strlen(L,idx) > 0) /* non-empty line? */ \ + add_history(lua_tostring(L, idx)); /* add it to history */ +#define lua_freeline(L,b) ((void)L, free(b)) +#else +#define lua_readline(L,b,p) \ + ((void)L, fputs(p, stdout), fflush(stdout), /* show prompt */ \ + fgets(b, LUA_MAXINPUT, stdin) != NULL) /* get line */ +#define lua_saveline(L,idx) { (void)L; (void)idx; } +#define lua_freeline(L,b) { (void)L; (void)b; } +#endif + +#endif + +/* }================================================================== */ + + +/* +@@ LUAI_GCPAUSE defines the default pause between garbage-collector cycles +@* as a percentage. +** CHANGE it if you want the GC to run faster or slower (higher values +** mean larger pauses which mean slower collection.) You can also change +** this value dynamically. +*/ +#define LUAI_GCPAUSE 200 /* 200% (wait memory to double before next GC) */ + + +/* +@@ LUAI_GCMUL defines the default speed of garbage collection relative to +@* memory allocation as a percentage. +** CHANGE it if you want to change the granularity of the garbage +** collection. (Higher values mean coarser collections. 0 represents +** infinity, where each step performs a full collection.) You can also +** change this value dynamically. +*/ +#define LUAI_GCMUL 200 /* GC runs 'twice the speed' of memory allocation */ + + + +/* +@@ LUA_COMPAT_GETN controls compatibility with old getn behavior. +** CHANGE it (define it) if you want exact compatibility with the +** behavior of setn/getn in Lua 5.0. +*/ +#undef LUA_COMPAT_GETN + +/* +@@ LUA_COMPAT_LOADLIB controls compatibility about global loadlib. +** CHANGE it to undefined as soon as you do not need a global 'loadlib' +** function (the function is still available as 'package.loadlib'). +*/ +#undef LUA_COMPAT_LOADLIB + +/* +@@ LUA_COMPAT_VARARG controls compatibility with old vararg feature. +** CHANGE it to undefined as soon as your programs use only '...' to +** access vararg parameters (instead of the old 'arg' table). +*/ +#define LUA_COMPAT_VARARG + +/* +@@ LUA_COMPAT_MOD controls compatibility with old math.mod function. +** CHANGE it to undefined as soon as your programs use 'math.fmod' or +** the new '%' operator instead of 'math.mod'. +*/ +#define LUA_COMPAT_MOD + +/* +@@ LUA_COMPAT_LSTR controls compatibility with old long string nesting +@* facility. +** CHANGE it to 2 if you want the old behaviour, or undefine it to turn +** off the advisory error when nesting [[...]]. +*/ +#define LUA_COMPAT_LSTR 1 + +/* +@@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name. +** CHANGE it to undefined as soon as you rename 'string.gfind' to +** 'string.gmatch'. +*/ +#define LUA_COMPAT_GFIND + +/* +@@ LUA_COMPAT_OPENLIB controls compatibility with old 'luaL_openlib' +@* behavior. +** CHANGE it to undefined as soon as you replace to 'luaL_register' +** your uses of 'luaL_openlib' +*/ +#define LUA_COMPAT_OPENLIB + + + +/* +@@ luai_apicheck is the assert macro used by the Lua-C API. +** CHANGE luai_apicheck if you want Lua to perform some checks in the +** parameters it gets from API calls. This may slow down the interpreter +** a bit, but may be quite useful when debugging C code that interfaces +** with Lua. A useful redefinition is to use assert.h. +*/ +#if defined(LUA_USE_APICHECK) +#include +#define luai_apicheck(L,o) { (void)L; assert(o); } +#else +#define luai_apicheck(L,o) { (void)L; } +#endif + + +/* +@@ LUAI_BITSINT defines the number of bits in an int. +** CHANGE here if Lua cannot automatically detect the number of bits of +** your machine. Probably you do not need to change this. +*/ +/* avoid overflows in comparison */ +#if INT_MAX-20 < 32760 +#define LUAI_BITSINT 16 +#elif INT_MAX > 2147483640L +/* int has at least 32 bits */ +#define LUAI_BITSINT 32 +#else +#error "you must define LUA_BITSINT with number of bits in an integer" +#endif + + +/* +@@ LUAI_UINT32 is an unsigned integer with at least 32 bits. +@@ LUAI_INT32 is an signed integer with at least 32 bits. +@@ LUAI_UMEM is an unsigned integer big enough to count the total +@* memory used by Lua. +@@ LUAI_MEM is a signed integer big enough to count the total memory +@* used by Lua. +** CHANGE here if for some weird reason the default definitions are not +** good enough for your machine. (The definitions in the 'else' +** part always works, but may waste space on machines with 64-bit +** longs.) Probably you do not need to change this. +*/ +#if LUAI_BITSINT >= 32 +#define LUAI_UINT32 unsigned int +#define LUAI_INT32 int +#define LUAI_MAXINT32 INT_MAX +#define LUAI_UMEM size_t +#define LUAI_MEM ptrdiff_t +#else +/* 16-bit ints */ +#define LUAI_UINT32 unsigned long +#define LUAI_INT32 long +#define LUAI_MAXINT32 LONG_MAX +#define LUAI_UMEM unsigned long +#define LUAI_MEM long +#endif + + +/* +@@ LUAI_MAXCALLS limits the number of nested calls. +** CHANGE it if you need really deep recursive calls. This limit is +** arbitrary; its only purpose is to stop infinite recursion before +** exhausting memory. +*/ +#define LUAI_MAXCALLS 20000 + + +/* +@@ LUAI_MAXCSTACK limits the number of Lua stack slots that a C function +@* can use. +** CHANGE it if you need lots of (Lua) stack space for your C +** functions. This limit is arbitrary; its only purpose is to stop C +** functions to consume unlimited stack space. (must be smaller than +** -LUA_REGISTRYINDEX) +*/ +#define LUAI_MAXCSTACK 8000 + + + +/* +** {================================================================== +** CHANGE (to smaller values) the following definitions if your system +** has a small C stack. (Or you may want to change them to larger +** values if your system has a large C stack and these limits are +** too rigid for you.) Some of these constants control the size of +** stack-allocated arrays used by the compiler or the interpreter, while +** others limit the maximum number of recursive calls that the compiler +** or the interpreter can perform. Values too large may cause a C stack +** overflow for some forms of deep constructs. +** =================================================================== +*/ + + +/* +@@ LUAI_MAXCCALLS is the maximum depth for nested C calls (short) and +@* syntactical nested non-terminals in a program. +*/ +#define LUAI_MAXCCALLS 200 + + +/* +@@ LUAI_MAXVARS is the maximum number of local variables per function +@* (must be smaller than 250). +*/ +#define LUAI_MAXVARS 200 + + +/* +@@ LUAI_MAXUPVALUES is the maximum number of upvalues per function +@* (must be smaller than 250). +*/ +#define LUAI_MAXUPVALUES 60 + + +/* +@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system. +*/ +#define LUAL_BUFFERSIZE BUFSIZ + +/* }================================================================== */ + + + + +/* +** {================================================================== +@@ LUA_NUMBER is the type of numbers in Lua. +** CHANGE the following definitions only if you want to build Lua +** with a number type different from double. You may also need to +** change lua_number2int & lua_number2integer. +** =================================================================== +*/ + +#define LUA_NUMBER_DOUBLE +#define LUA_NUMBER double + +/* +@@ LUAI_UACNUMBER is the result of an 'usual argument conversion' +@* over a number. +*/ +#define LUAI_UACNUMBER double + + +/* +@@ LUA_NUMBER_SCAN is the format for reading numbers. +@@ LUA_NUMBER_FMT is the format for writing numbers. +@@ lua_number2str converts a number to a string. +@@ LUAI_MAXNUMBER2STR is maximum size of previous conversion. +@@ lua_str2number converts a string to a number. +*/ +#define LUA_NUMBER_SCAN "%lf" +#define LUA_NUMBER_FMT "%.14g" +#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) +#define LUAI_MAXNUMBER2STR 32 /* 16 digits, sign, point, and \0 */ +#define lua_str2number(s,p) strtod((s), (p)) + + +/* +@@ The luai_num* macros define the primitive operations over numbers. +*/ +#if defined(LUA_CORE) +#include +#define luai_numadd(a,b) ((a)+(b)) +#define luai_numsub(a,b) ((a)-(b)) +#define luai_nummul(a,b) ((a)*(b)) +#define luai_numdiv(a,b) ((a)/(b)) +#define luai_nummod(a,b) ((a) - floor((a)/(b))*(b)) +#define luai_numpow(a,b) (pow(a,b)) +#define luai_numunm(a) (-(a)) +#define luai_numeq(a,b) ((a)==(b)) +#define luai_numlt(a,b) ((a)<(b)) +#define luai_numle(a,b) ((a)<=(b)) +#define luai_numisnan(a) (!luai_numeq((a), (a))) +#endif + + +/* +@@ lua_number2int is a macro to convert lua_Number to int. +@@ lua_number2integer is a macro to convert lua_Number to lua_Integer. +** CHANGE them if you know a faster way to convert a lua_Number to +** int (with any rounding method and without throwing errors) in your +** system. In Pentium machines, a naive typecast from double to int +** in C is extremely slow, so any alternative is worth trying. +*/ + +/* On a Pentium, resort to a trick */ +#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \ + (defined(__i386) || defined (_M_IX86) || defined(__i386__)) + +/* On a Microsoft compiler, use assembler */ +#if defined(_MSC_VER) + +#define lua_number2int(i,d) __asm fld d __asm fistp i +#define lua_number2integer(i,n) lua_number2int(i, n) + +/* the next trick should work on any Pentium, but sometimes clashes + with a DirectX idiosyncrasy */ +#else + +union luai_Cast { double l_d; long l_l; }; +#define lua_number2int(i,d) \ + { volatile union luai_Cast u; u.l_d = (d) + 6755399441055744.0; (i) = u.l_l; } +#define lua_number2integer(i,n) lua_number2int(i, n) + +#endif + + +/* this option always works, but may be slow */ +#else +#define lua_number2int(i,d) ((i)=(int)(d)) +#define lua_number2integer(i,d) ((i)=(lua_Integer)(d)) + +#endif + +/* }================================================================== */ + + +/* +@@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment. +** CHANGE it if your system requires alignments larger than double. (For +** instance, if your system supports long doubles and they must be +** aligned in 16-byte boundaries, then you should add long double in the +** union.) Probably you do not need to change this. +*/ +#define LUAI_USER_ALIGNMENT_T union { double u; void *s; long l; } + + +/* +@@ LUAI_THROW/LUAI_TRY define how Lua does exception handling. +** CHANGE them if you prefer to use longjmp/setjmp even with C++ +** or if want/don't to use _longjmp/_setjmp instead of regular +** longjmp/setjmp. By default, Lua handles errors with exceptions when +** compiling as C++ code, with _longjmp/_setjmp when asked to use them, +** and with longjmp/setjmp otherwise. +*/ +#if defined(__cplusplus) +/* C++ exceptions */ +#define LUAI_THROW(L,c) throw(c) +#define LUAI_TRY(L,c,a) try { a } catch(...) \ + { if ((c)->status == 0) (c)->status = -1; } +#define luai_jmpbuf int /* dummy variable */ + +#elif defined(LUA_USE_ULONGJMP) +/* in Unix, try _longjmp/_setjmp (more efficient) */ +#define LUAI_THROW(L,c) _longjmp((c)->b, 1) +#define LUAI_TRY(L,c,a) if (_setjmp((c)->b) == 0) { a } +#define luai_jmpbuf jmp_buf + +#else +/* default handling with long jumps */ +#define LUAI_THROW(L,c) longjmp((c)->b, 1) +#define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a } +#define luai_jmpbuf jmp_buf + +#endif + + +/* +@@ LUA_MAXCAPTURES is the maximum number of captures that a pattern +@* can do during pattern-matching. +** CHANGE it if you need more captures. This limit is arbitrary. +*/ +#define LUA_MAXCAPTURES 32 + + +/* +@@ lua_tmpnam is the function that the OS library uses to create a +@* temporary name. +@@ LUA_TMPNAMBUFSIZE is the maximum size of a name created by lua_tmpnam. +** CHANGE them if you have an alternative to tmpnam (which is considered +** insecure) or if you want the original tmpnam anyway. By default, Lua +** uses tmpnam except when POSIX is available, where it uses mkstemp. +*/ +#if defined(loslib_c) || defined(luaall_c) + +#if defined(LUA_USE_MKSTEMP) +#include +#define LUA_TMPNAMBUFSIZE 32 +#define lua_tmpnam(b,e) { \ + strcpy(b, "/tmp/lua_XXXXXX"); \ + e = mkstemp(b); \ + if (e != -1) close(e); \ + e = (e == -1); } + +#else +#define LUA_TMPNAMBUFSIZE L_tmpnam +#define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); } +#endif + +#endif + + +/* +@@ lua_popen spawns a new process connected to the current one through +@* the file streams. +** CHANGE it if you have a way to implement it in your system. +*/ +#if defined(LUA_USE_POPEN) + +#define lua_popen(L,c,m) ((void)L, fflush(NULL), popen(c,m)) +#define lua_pclose(L,file) ((void)L, (pclose(file) != -1)) + +#elif defined(LUA_WIN) + +#define lua_popen(L,c,m) ((void)L, _popen(c,m)) +#define lua_pclose(L,file) ((void)L, (_pclose(file) != -1)) + +#else + +#define lua_popen(L,c,m) ((void)((void)c, m), \ + luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0) +#define lua_pclose(L,file) ((void)((void)L, file), 0) + +#endif + +/* +@@ LUA_DL_* define which dynamic-library system Lua should use. +** CHANGE here if Lua has problems choosing the appropriate +** dynamic-library system for your platform (either Windows' DLL, Mac's +** dyld, or Unix's dlopen). If your system is some kind of Unix, there +** is a good chance that it has dlopen, so LUA_DL_DLOPEN will work for +** it. To use dlopen you also need to adapt the src/Makefile (probably +** adding -ldl to the linker options), so Lua does not select it +** automatically. (When you change the makefile to add -ldl, you must +** also add -DLUA_USE_DLOPEN.) +** If you do not want any kind of dynamic library, undefine all these +** options. +** By default, _WIN32 gets LUA_DL_DLL and MAC OS X gets LUA_DL_DYLD. +*/ +#if defined(LUA_USE_DLOPEN) +#define LUA_DL_DLOPEN +#endif + +#if defined(LUA_WIN) +#define LUA_DL_DLL +#endif + + +/* +@@ LUAI_EXTRASPACE allows you to add user-specific data in a lua_State +@* (the data goes just *before* the lua_State pointer). +** CHANGE (define) this if you really need that. This value must be +** a multiple of the maximum alignment required for your machine. +*/ +#define LUAI_EXTRASPACE 0 + + +/* +@@ luai_userstate* allow user-specific actions on threads. +** CHANGE them if you defined LUAI_EXTRASPACE and need to do something +** extra when a thread is created/deleted/resumed/yielded. +*/ +#define luai_userstateopen(L) ((void)L) +#define luai_userstateclose(L) ((void)L) +#define luai_userstatethread(L,L1) ((void)L) +#define luai_userstatefree(L) ((void)L) +#define luai_userstateresume(L,n) ((void)L) +#define luai_userstateyield(L,n) ((void)L) + + +/* +@@ LUA_INTFRMLEN is the length modifier for integer conversions +@* in 'string.format'. +@@ LUA_INTFRM_T is the integer type correspoding to the previous length +@* modifier. +** CHANGE them if your system supports long long or does not support long. +*/ + +#if defined(LUA_USELONGLONG) + +#define LUA_INTFRMLEN "ll" +#define LUA_INTFRM_T long long + +#else + +#define LUA_INTFRMLEN "l" +#define LUA_INTFRM_T long + +#endif + + + +/* =================================================================== */ + +/* +** Local configuration. You can use this space to add your redefinitions +** without modifying the main part of the file. +*/ + + + +#endif + diff --git a/rpm-5.4.9/lua/lualib.h b/rpm-5.4.9/lua/lualib.h new file mode 100644 index 0000000..469417f --- /dev/null +++ b/rpm-5.4.9/lua/lualib.h @@ -0,0 +1,53 @@ +/* +** $Id: lualib.h,v 1.36.1.1 2007/12/27 13:02:25 roberto Exp $ +** Lua standard libraries +** See Copyright Notice in lua.h +*/ + + +#ifndef lualib_h +#define lualib_h + +#include "lua.h" + + +/* Key to file-handle type */ +#define LUA_FILEHANDLE "FILE*" + + +#define LUA_COLIBNAME "coroutine" +LUALIB_API int (luaopen_base) (lua_State *L); + +#define LUA_TABLIBNAME "table" +LUALIB_API int (luaopen_table) (lua_State *L); + +#define LUA_IOLIBNAME "io" +LUALIB_API int (luaopen_io) (lua_State *L); + +#define LUA_OSLIBNAME "os" +LUALIB_API int (luaopen_os) (lua_State *L); + +#define LUA_STRLIBNAME "string" +LUALIB_API int (luaopen_string) (lua_State *L); + +#define LUA_MATHLIBNAME "math" +LUALIB_API int (luaopen_math) (lua_State *L); + +#define LUA_DBLIBNAME "debug" +LUALIB_API int (luaopen_debug) (lua_State *L); + +#define LUA_LOADLIBNAME "package" +LUALIB_API int (luaopen_package) (lua_State *L); + + +/* open all previous libraries */ +LUALIB_API void (luaL_openlibs) (lua_State *L); + + + +#ifndef lua_assert +#define lua_assert(x) ((void)0) +#endif + + +#endif diff --git a/rpm-5.4.9/lua/lundump.c b/rpm-5.4.9/lua/lundump.c new file mode 100644 index 0000000..8010a45 --- /dev/null +++ b/rpm-5.4.9/lua/lundump.c @@ -0,0 +1,227 @@ +/* +** $Id: lundump.c,v 2.7.1.4 2008/04/04 19:51:41 roberto Exp $ +** load precompiled Lua chunks +** See Copyright Notice in lua.h +*/ + +#include + +#define lundump_c +#define LUA_CORE + +#include "lua.h" + +#include "ldebug.h" +#include "ldo.h" +#include "lfunc.h" +#include "lmem.h" +#include "lobject.h" +#include "lstring.h" +#include "lundump.h" +#include "lzio.h" + +typedef struct { + lua_State* L; + ZIO* Z; + Mbuffer* b; + const char* name; +} LoadState; + +#ifdef LUAC_TRUST_BINARIES +#define IF(c,s) +#define error(S,s) +#else +#define IF(c,s) if (c) error(S,s) + +static void error(LoadState* S, const char* why) +{ + luaO_pushfstring(S->L,"%s: %s in precompiled chunk",S->name,why); + luaD_throw(S->L,LUA_ERRSYNTAX); +} +#endif + +#define LoadMem(S,b,n,size) LoadBlock(S,b,(n)*(size)) +#define LoadByte(S) (lu_byte)LoadChar(S) +#define LoadVar(S,x) LoadMem(S,&x,1,sizeof(x)) +#define LoadVector(S,b,n,size) LoadMem(S,b,n,size) + +static void LoadBlock(LoadState* S, void* b, size_t size) +{ + size_t r=luaZ_read(S->Z,b,size); + IF (r!=0, "unexpected end"); +} + +static int LoadChar(LoadState* S) +{ + char x; + LoadVar(S,x); + return x; +} + +static int LoadInt(LoadState* S) +{ + int x; + LoadVar(S,x); + IF (x<0, "bad integer"); + return x; +} + +static lua_Number LoadNumber(LoadState* S) +{ + lua_Number x; + LoadVar(S,x); + return x; +} + +static TString* LoadString(LoadState* S) +{ + size_t size; + LoadVar(S,size); + if (size==0) + return NULL; + else + { + char* s=luaZ_openspace(S->L,S->b,size); + LoadBlock(S,s,size); + return luaS_newlstr(S->L,s,size-1); /* remove trailing '\0' */ + } +} + +static void LoadCode(LoadState* S, Proto* f) +{ + int n=LoadInt(S); + f->code=luaM_newvector(S->L,n,Instruction); + f->sizecode=n; + LoadVector(S,f->code,n,sizeof(Instruction)); +} + +static Proto* LoadFunction(LoadState* S, TString* p); + +static void LoadConstants(LoadState* S, Proto* f) +{ + int i,n; + n=LoadInt(S); + f->k=luaM_newvector(S->L,n,TValue); + f->sizek=n; + for (i=0; ik[i]); + for (i=0; ik[i]; + int t=LoadChar(S); + switch (t) + { + case LUA_TNIL: + setnilvalue(o); + break; + case LUA_TBOOLEAN: + setbvalue(o,LoadChar(S)!=0); + break; + case LUA_TNUMBER: + setnvalue(o,LoadNumber(S)); + break; + case LUA_TSTRING: + setsvalue2n(S->L,o,LoadString(S)); + break; + default: + error(S,"bad constant"); + break; + } + } + n=LoadInt(S); + f->p=luaM_newvector(S->L,n,Proto*); + f->sizep=n; + for (i=0; ip[i]=NULL; + for (i=0; ip[i]=LoadFunction(S,f->source); +} + +static void LoadDebug(LoadState* S, Proto* f) +{ + int i,n; + n=LoadInt(S); + f->lineinfo=luaM_newvector(S->L,n,int); + f->sizelineinfo=n; + LoadVector(S,f->lineinfo,n,sizeof(int)); + n=LoadInt(S); + f->locvars=luaM_newvector(S->L,n,LocVar); + f->sizelocvars=n; + for (i=0; ilocvars[i].varname=NULL; + for (i=0; ilocvars[i].varname=LoadString(S); + f->locvars[i].startpc=LoadInt(S); + f->locvars[i].endpc=LoadInt(S); + } + n=LoadInt(S); + f->upvalues=luaM_newvector(S->L,n,TString*); + f->sizeupvalues=n; + for (i=0; iupvalues[i]=NULL; + for (i=0; iupvalues[i]=LoadString(S); +} + +static Proto* LoadFunction(LoadState* S, TString* p) +{ + Proto* f; + if (++S->L->nCcalls > LUAI_MAXCCALLS) error(S,"code too deep"); + f=luaF_newproto(S->L); + setptvalue2s(S->L,S->L->top,f); incr_top(S->L); + f->source=LoadString(S); if (f->source==NULL) f->source=p; + f->linedefined=LoadInt(S); + f->lastlinedefined=LoadInt(S); + f->nups=LoadByte(S); + f->numparams=LoadByte(S); + f->is_vararg=LoadByte(S); + f->maxstacksize=LoadByte(S); + LoadCode(S,f); + LoadConstants(S,f); + LoadDebug(S,f); + IF (!luaG_checkcode(f), "bad code"); + S->L->top--; + S->L->nCcalls--; + return f; +} + +static void LoadHeader(LoadState* S) +{ + char h[LUAC_HEADERSIZE]; + char s[LUAC_HEADERSIZE]; + luaU_header(h); + LoadBlock(S,s,LUAC_HEADERSIZE); + IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, "bad header"); +} + +/* +** load precompiled chunk +*/ +Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name) +{ + LoadState S; + if (*name=='@' || *name=='=') + S.name=name+1; + else if (*name==LUA_SIGNATURE[0]) + S.name="binary string"; + else + S.name=name; + S.L=L; + S.Z=Z; + S.b=buff; + LoadHeader(&S); + return LoadFunction(&S,luaS_newliteral(L,"=?")); +} + +/* +* make header +*/ +void luaU_header (char* h) +{ + int x=1; + memcpy(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-1); + h+=sizeof(LUA_SIGNATURE)-1; + *h++=(char)LUAC_VERSION; + *h++=(char)LUAC_FORMAT; + *h++=(char)*(char*)&x; /* endianness */ + *h++=(char)sizeof(int); + *h++=(char)sizeof(size_t); + *h++=(char)sizeof(Instruction); + *h++=(char)sizeof(lua_Number); + *h++=(char)(((lua_Number)0.5)==0); /* is lua_Number integral? */ +} diff --git a/rpm-5.4.9/lua/lundump.h b/rpm-5.4.9/lua/lundump.h new file mode 100644 index 0000000..c80189d --- /dev/null +++ b/rpm-5.4.9/lua/lundump.h @@ -0,0 +1,36 @@ +/* +** $Id: lundump.h,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $ +** load precompiled Lua chunks +** See Copyright Notice in lua.h +*/ + +#ifndef lundump_h +#define lundump_h + +#include "lobject.h" +#include "lzio.h" + +/* load one chunk; from lundump.c */ +LUAI_FUNC Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name); + +/* make header; from lundump.c */ +LUAI_FUNC void luaU_header (char* h); + +/* dump one chunk; from ldump.c */ +LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip); + +#ifdef luac_c +/* print one chunk; from print.c */ +LUAI_FUNC void luaU_print (const Proto* f, int full); +#endif + +/* for header of binary files -- this is Lua 5.1 */ +#define LUAC_VERSION 0x51 + +/* for header of binary files -- this is the official format */ +#define LUAC_FORMAT 0 + +/* size of header of binary files */ +#define LUAC_HEADERSIZE 12 + +#endif diff --git a/rpm-5.4.9/lua/lvm.c b/rpm-5.4.9/lua/lvm.c new file mode 100644 index 0000000..ee3256a --- /dev/null +++ b/rpm-5.4.9/lua/lvm.c @@ -0,0 +1,763 @@ +/* +** $Id: lvm.c,v 2.63.1.3 2007/12/28 15:32:23 roberto Exp $ +** Lua virtual machine +** See Copyright Notice in lua.h +*/ + + +#include +#include +#include + +#define lvm_c +#define LUA_CORE + +#include "lua.h" + +#include "ldebug.h" +#include "ldo.h" +#include "lfunc.h" +#include "lgc.h" +#include "lobject.h" +#include "lopcodes.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" +#include "ltm.h" +#include "lvm.h" + + + +/* limit for table tag-method chains (to avoid loops) */ +#define MAXTAGLOOP 100 + + +const TValue *luaV_tonumber (const TValue *obj, TValue *n) { + lua_Number num; + if (ttisnumber(obj)) return obj; + if (ttisstring(obj) && luaO_str2d(svalue(obj), &num)) { + setnvalue(n, num); + return n; + } + else + return NULL; +} + + +int luaV_tostring (lua_State *L, StkId obj) { + if (!ttisnumber(obj)) + return 0; + else { + char s[LUAI_MAXNUMBER2STR]; + lua_Number n = nvalue(obj); + lua_number2str(s, n); + setsvalue2s(L, obj, luaS_new(L, s)); + return 1; + } +} + + +static void traceexec (lua_State *L, const Instruction *pc) { + lu_byte mask = L->hookmask; + const Instruction *oldpc = L->savedpc; + L->savedpc = pc; + if ((mask & LUA_MASKCOUNT) && L->hookcount == 0) { + resethookcount(L); + luaD_callhook(L, LUA_HOOKCOUNT, -1); + } + if (mask & LUA_MASKLINE) { + Proto *p = ci_func(L->ci)->l.p; + int npc = pcRel(pc, p); + int newline = getline(p, npc); + /* call linehook when enter a new function, when jump back (loop), + or when enter a new line */ + if (npc == 0 || pc <= oldpc || newline != getline(p, pcRel(oldpc, p))) + luaD_callhook(L, LUA_HOOKLINE, newline); + } +} + + +static void callTMres (lua_State *L, StkId res, const TValue *f, + const TValue *p1, const TValue *p2) { + ptrdiff_t result = savestack(L, res); + setobj2s(L, L->top, f); /* push function */ + setobj2s(L, L->top+1, p1); /* 1st argument */ + setobj2s(L, L->top+2, p2); /* 2nd argument */ + luaD_checkstack(L, 3); + L->top += 3; + luaD_call(L, L->top - 3, 1); + res = restorestack(L, result); + L->top--; + setobjs2s(L, res, L->top); +} + + + +static void callTM (lua_State *L, const TValue *f, const TValue *p1, + const TValue *p2, const TValue *p3) { + setobj2s(L, L->top, f); /* push function */ + setobj2s(L, L->top+1, p1); /* 1st argument */ + setobj2s(L, L->top+2, p2); /* 2nd argument */ + setobj2s(L, L->top+3, p3); /* 3th argument */ + luaD_checkstack(L, 4); + L->top += 4; + luaD_call(L, L->top - 4, 0); +} + + +void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) { + int loop; + for (loop = 0; loop < MAXTAGLOOP; loop++) { + const TValue *tm; + if (ttistable(t)) { /* `t' is a table? */ + Table *h = hvalue(t); + const TValue *res = luaH_get(h, key); /* do a primitive get */ + if (!ttisnil(res) || /* result is no nil? */ + (tm = fasttm(L, h->metatable, TM_INDEX)) == NULL) { /* or no TM? */ + setobj2s(L, val, res); + return; + } + /* else will try the tag method */ + } + else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX))) + luaG_typeerror(L, t, "index"); + if (ttisfunction(tm)) { + callTMres(L, val, tm, t, key); + return; + } + t = tm; /* else repeat with `tm' */ + } + luaG_runerror(L, "loop in gettable"); +} + + +void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) { + int loop; + for (loop = 0; loop < MAXTAGLOOP; loop++) { + const TValue *tm; + if (ttistable(t)) { /* `t' is a table? */ + Table *h = hvalue(t); + TValue *oldval = luaH_set(L, h, key); /* do a primitive set */ + if (!ttisnil(oldval) || /* result is no nil? */ + (tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */ + setobj2t(L, oldval, val); + luaC_barriert(L, h, val); + return; + } + /* else will try the tag method */ + } + else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX))) + luaG_typeerror(L, t, "index"); + if (ttisfunction(tm)) { + callTM(L, tm, t, key, val); + return; + } + t = tm; /* else repeat with `tm' */ + } + luaG_runerror(L, "loop in settable"); +} + + +static int call_binTM (lua_State *L, const TValue *p1, const TValue *p2, + StkId res, TMS event) { + const TValue *tm = luaT_gettmbyobj(L, p1, event); /* try first operand */ + if (ttisnil(tm)) + tm = luaT_gettmbyobj(L, p2, event); /* try second operand */ + if (ttisnil(tm)) return 0; + callTMres(L, res, tm, p1, p2); + return 1; +} + + +static const TValue *get_compTM (lua_State *L, Table *mt1, Table *mt2, + TMS event) { + const TValue *tm1 = fasttm(L, mt1, event); + const TValue *tm2; + if (tm1 == NULL) return NULL; /* no metamethod */ + if (mt1 == mt2) return tm1; /* same metatables => same metamethods */ + tm2 = fasttm(L, mt2, event); + if (tm2 == NULL) return NULL; /* no metamethod */ + if (luaO_rawequalObj(tm1, tm2)) /* same metamethods? */ + return tm1; + return NULL; +} + + +static int call_orderTM (lua_State *L, const TValue *p1, const TValue *p2, + TMS event) { + const TValue *tm1 = luaT_gettmbyobj(L, p1, event); + const TValue *tm2; + if (ttisnil(tm1)) return -1; /* no metamethod? */ + tm2 = luaT_gettmbyobj(L, p2, event); + if (!luaO_rawequalObj(tm1, tm2)) /* different metamethods? */ + return -1; + callTMres(L, L->top, tm1, p1, p2); + return !l_isfalse(L->top); +} + + +static int l_strcmp (const TString *ls, const TString *rs) { + const char *l = getstr(ls); + size_t ll = ls->tsv.len; + const char *r = getstr(rs); + size_t lr = rs->tsv.len; + for (;;) { + int temp = strcoll(l, r); + if (temp != 0) return temp; + else { /* strings are equal up to a `\0' */ + size_t len = strlen(l); /* index of first `\0' in both strings */ + if (len == lr) /* r is finished? */ + return (len == ll) ? 0 : 1; + else if (len == ll) /* l is finished? */ + return -1; /* l is smaller than r (because r is not finished) */ + /* both strings longer than `len'; go on comparing (after the `\0') */ + len++; + l += len; ll -= len; r += len; lr -= len; + } + } +} + + +int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) { + int res; + if (ttype(l) != ttype(r)) + return luaG_ordererror(L, l, r); + else if (ttisnumber(l)) + return luai_numlt(nvalue(l), nvalue(r)); + else if (ttisstring(l)) + return l_strcmp(rawtsvalue(l), rawtsvalue(r)) < 0; + else if ((res = call_orderTM(L, l, r, TM_LT)) != -1) + return res; + return luaG_ordererror(L, l, r); +} + + +static int lessequal (lua_State *L, const TValue *l, const TValue *r) { + int res; + if (ttype(l) != ttype(r)) + return luaG_ordererror(L, l, r); + else if (ttisnumber(l)) + return luai_numle(nvalue(l), nvalue(r)); + else if (ttisstring(l)) + return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0; + else if ((res = call_orderTM(L, l, r, TM_LE)) != -1) /* first try `le' */ + return res; + else if ((res = call_orderTM(L, r, l, TM_LT)) != -1) /* else try `lt' */ + return !res; + return luaG_ordererror(L, l, r); +} + + +int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2) { + const TValue *tm; + lua_assert(ttype(t1) == ttype(t2)); + switch (ttype(t1)) { + case LUA_TNIL: return 1; + case LUA_TNUMBER: return luai_numeq(nvalue(t1), nvalue(t2)); + case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2); /* true must be 1 !! */ + case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2); + case LUA_TUSERDATA: { + if (uvalue(t1) == uvalue(t2)) return 1; + tm = get_compTM(L, uvalue(t1)->metatable, uvalue(t2)->metatable, + TM_EQ); + break; /* will try TM */ + } + case LUA_TTABLE: { + if (hvalue(t1) == hvalue(t2)) return 1; + tm = get_compTM(L, hvalue(t1)->metatable, hvalue(t2)->metatable, TM_EQ); + break; /* will try TM */ + } + default: return gcvalue(t1) == gcvalue(t2); + } + if (tm == NULL) return 0; /* no TM? */ + callTMres(L, L->top, tm, t1, t2); /* call TM */ + return !l_isfalse(L->top); +} + + +void luaV_concat (lua_State *L, int total, int last) { + do { + StkId top = L->base + last + 1; + int n = 2; /* number of elements handled in this pass (at least 2) */ + if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) { + if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT)) + luaG_concaterror(L, top-2, top-1); + } else if (tsvalue(top-1)->len == 0) /* second op is empty? */ + (void)tostring(L, top - 2); /* result is first op (as string) */ + else { + /* at least two string values; get as many as possible */ + size_t tl = tsvalue(top-1)->len; + char *buffer; + int i; + /* collect total length */ + for (n = 1; n < total && tostring(L, top-n-1); n++) { + size_t l = tsvalue(top-n-1)->len; + if (l >= MAX_SIZET - tl) luaG_runerror(L, "string length overflow"); + tl += l; + } + buffer = luaZ_openspace(L, &G(L)->buff, tl); + tl = 0; + for (i=n; i>0; i--) { /* concat all strings */ + size_t l = tsvalue(top-i)->len; + memcpy(buffer+tl, svalue(top-i), l); + tl += l; + } + setsvalue2s(L, top-n, luaS_newlstr(L, buffer, tl)); + } + total -= n-1; /* got `n' strings to create 1 new */ + last -= n-1; + } while (total > 1); /* repeat until only 1 result left */ +} + + +static void Arith (lua_State *L, StkId ra, const TValue *rb, + const TValue *rc, TMS op) { + TValue tempb, tempc; + const TValue *b, *c; + if ((b = luaV_tonumber(rb, &tempb)) != NULL && + (c = luaV_tonumber(rc, &tempc)) != NULL) { + lua_Number nb = nvalue(b), nc = nvalue(c); + switch (op) { + case TM_ADD: setnvalue(ra, luai_numadd(nb, nc)); break; + case TM_SUB: setnvalue(ra, luai_numsub(nb, nc)); break; + case TM_MUL: setnvalue(ra, luai_nummul(nb, nc)); break; + case TM_DIV: setnvalue(ra, luai_numdiv(nb, nc)); break; + case TM_MOD: setnvalue(ra, luai_nummod(nb, nc)); break; + case TM_POW: setnvalue(ra, luai_numpow(nb, nc)); break; + case TM_UNM: setnvalue(ra, luai_numunm(nb)); break; + default: lua_assert(0); break; + } + } + else if (!call_binTM(L, rb, rc, ra, op)) + luaG_aritherror(L, rb, rc); +} + + + +/* +** some macros for common tasks in `luaV_execute' +*/ + +#define runtime_check(L, c) { if (!(c)) break; } + +#define RA(i) (base+GETARG_A(i)) +/* to be used after possible stack reallocation */ +#define RB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i)) +#define RC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgR, base+GETARG_C(i)) +#define RKB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, \ + ISK(GETARG_B(i)) ? k+INDEXK(GETARG_B(i)) : base+GETARG_B(i)) +#define RKC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgK, \ + ISK(GETARG_C(i)) ? k+INDEXK(GETARG_C(i)) : base+GETARG_C(i)) +#define KBx(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, k+GETARG_Bx(i)) + + +#define dojump(L,pc,i) {(pc) += (i); luai_threadyield(L);} + + +#define Protect(x) { L->savedpc = pc; {x;}; base = L->base; } + + +#define arith_op(op,tm) { \ + TValue *rb = RKB(i); \ + TValue *rc = RKC(i); \ + if (ttisnumber(rb) && ttisnumber(rc)) { \ + lua_Number nb = nvalue(rb), nc = nvalue(rc); \ + setnvalue(ra, op(nb, nc)); \ + } \ + else \ + Protect(Arith(L, ra, rb, rc, tm)); \ + } + + + +void luaV_execute (lua_State *L, int nexeccalls) { + LClosure *cl; + StkId base; + TValue *k; + const Instruction *pc; + reentry: /* entry point */ + lua_assert(isLua(L->ci)); + pc = L->savedpc; + cl = &clvalue(L->ci->func)->l; + base = L->base; + k = cl->p->k; + /* main loop of interpreter */ + for (;;) { + const Instruction i = *pc++; + StkId ra; + if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) && + (--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) { + traceexec(L, pc); + if (L->status == LUA_YIELD) { /* did hook yield? */ + L->savedpc = pc - 1; + return; + } + base = L->base; + } + /* warning!! several calls may realloc the stack and invalidate `ra' */ + ra = RA(i); + lua_assert(base == L->base && L->base == L->ci->base); + lua_assert(base <= L->top && L->top <= L->stack + L->stacksize); + lua_assert(L->top == L->ci->top || luaG_checkopenop(i)); + switch (GET_OPCODE(i)) { + case OP_MOVE: { + setobjs2s(L, ra, RB(i)); + continue; + } + case OP_LOADK: { + setobj2s(L, ra, KBx(i)); + continue; + } + case OP_LOADBOOL: { + setbvalue(ra, GETARG_B(i)); + if (GETARG_C(i)) pc++; /* skip next instruction (if C) */ + continue; + } + case OP_LOADNIL: { + TValue *rb = RB(i); + do { + setnilvalue(rb--); + } while (rb >= ra); + continue; + } + case OP_GETUPVAL: { + int b = GETARG_B(i); + setobj2s(L, ra, cl->upvals[b]->v); + continue; + } + case OP_GETGLOBAL: { + TValue g; + TValue *rb = KBx(i); + sethvalue(L, &g, cl->env); + lua_assert(ttisstring(rb)); + Protect(luaV_gettable(L, &g, rb, ra)); + continue; + } + case OP_GETTABLE: { + Protect(luaV_gettable(L, RB(i), RKC(i), ra)); + continue; + } + case OP_SETGLOBAL: { + TValue g; + sethvalue(L, &g, cl->env); + lua_assert(ttisstring(KBx(i))); + Protect(luaV_settable(L, &g, KBx(i), ra)); + continue; + } + case OP_SETUPVAL: { + UpVal *uv = cl->upvals[GETARG_B(i)]; + setobj(L, uv->v, ra); + luaC_barrier(L, uv, ra); + continue; + } + case OP_SETTABLE: { + Protect(luaV_settable(L, ra, RKB(i), RKC(i))); + continue; + } + case OP_NEWTABLE: { + int b = GETARG_B(i); + int c = GETARG_C(i); + sethvalue(L, ra, luaH_new(L, luaO_fb2int(b), luaO_fb2int(c))); + Protect(luaC_checkGC(L)); + continue; + } + case OP_SELF: { + StkId rb = RB(i); + setobjs2s(L, ra+1, rb); + Protect(luaV_gettable(L, rb, RKC(i), ra)); + continue; + } + case OP_ADD: { + arith_op(luai_numadd, TM_ADD); + continue; + } + case OP_SUB: { + arith_op(luai_numsub, TM_SUB); + continue; + } + case OP_MUL: { + arith_op(luai_nummul, TM_MUL); + continue; + } + case OP_DIV: { + arith_op(luai_numdiv, TM_DIV); + continue; + } + case OP_MOD: { + arith_op(luai_nummod, TM_MOD); + continue; + } + case OP_POW: { + arith_op(luai_numpow, TM_POW); + continue; + } + case OP_UNM: { + TValue *rb = RB(i); + if (ttisnumber(rb)) { + lua_Number nb = nvalue(rb); + setnvalue(ra, luai_numunm(nb)); + } + else { + Protect(Arith(L, ra, rb, rb, TM_UNM)); + } + continue; + } + case OP_NOT: { + int res = l_isfalse(RB(i)); /* next assignment may change this value */ + setbvalue(ra, res); + continue; + } + case OP_LEN: { + const TValue *rb = RB(i); + switch (ttype(rb)) { + case LUA_TTABLE: { + setnvalue(ra, cast_num(luaH_getn(hvalue(rb)))); + break; + } + case LUA_TSTRING: { + setnvalue(ra, cast_num(tsvalue(rb)->len)); + break; + } + default: { /* try metamethod */ + Protect( + if (!call_binTM(L, rb, luaO_nilobject, ra, TM_LEN)) + luaG_typeerror(L, rb, "get length of"); + ) + } + } + continue; + } + case OP_CONCAT: { + int b = GETARG_B(i); + int c = GETARG_C(i); + Protect(luaV_concat(L, c-b+1, c); luaC_checkGC(L)); + setobjs2s(L, RA(i), base+b); + continue; + } + case OP_JMP: { + dojump(L, pc, GETARG_sBx(i)); + continue; + } + case OP_EQ: { + TValue *rb = RKB(i); + TValue *rc = RKC(i); + Protect( + if (equalobj(L, rb, rc) == GETARG_A(i)) + dojump(L, pc, GETARG_sBx(*pc)); + ) + pc++; + continue; + } + case OP_LT: { + Protect( + if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i)) + dojump(L, pc, GETARG_sBx(*pc)); + ) + pc++; + continue; + } + case OP_LE: { + Protect( + if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i)) + dojump(L, pc, GETARG_sBx(*pc)); + ) + pc++; + continue; + } + case OP_TEST: { + if (l_isfalse(ra) != GETARG_C(i)) + dojump(L, pc, GETARG_sBx(*pc)); + pc++; + continue; + } + case OP_TESTSET: { + TValue *rb = RB(i); + if (l_isfalse(rb) != GETARG_C(i)) { + setobjs2s(L, ra, rb); + dojump(L, pc, GETARG_sBx(*pc)); + } + pc++; + continue; + } + case OP_CALL: { + int b = GETARG_B(i); + int nresults = GETARG_C(i) - 1; + if (b != 0) L->top = ra+b; /* else previous instruction set top */ + L->savedpc = pc; + switch (luaD_precall(L, ra, nresults)) { + case PCRLUA: { + nexeccalls++; + goto reentry; /* restart luaV_execute over new Lua function */ + } + case PCRC: { + /* it was a C function (`precall' called it); adjust results */ + if (nresults >= 0) L->top = L->ci->top; + base = L->base; + continue; + } + default: { + return; /* yield */ + } + } + } + case OP_TAILCALL: { + int b = GETARG_B(i); + if (b != 0) L->top = ra+b; /* else previous instruction set top */ + L->savedpc = pc; + lua_assert(GETARG_C(i) - 1 == LUA_MULTRET); + switch (luaD_precall(L, ra, LUA_MULTRET)) { + case PCRLUA: { + /* tail call: put new frame in place of previous one */ + CallInfo *ci = L->ci - 1; /* previous frame */ + int aux; + StkId func = ci->func; + StkId pfunc = (ci+1)->func; /* previous function index */ + if (L->openupval) luaF_close(L, ci->base); + L->base = ci->base = ci->func + ((ci+1)->base - pfunc); + for (aux = 0; pfunc+aux < L->top; aux++) /* move frame down */ + setobjs2s(L, func+aux, pfunc+aux); + ci->top = L->top = func+aux; /* correct top */ + lua_assert(L->top == L->base + clvalue(func)->l.p->maxstacksize); + ci->savedpc = L->savedpc; + ci->tailcalls++; /* one more call lost */ + L->ci--; /* remove new frame */ + goto reentry; + } + case PCRC: { /* it was a C function (`precall' called it) */ + base = L->base; + continue; + } + default: { + return; /* yield */ + } + } + } + case OP_RETURN: { + int b = GETARG_B(i); + if (b != 0) L->top = ra+b-1; + if (L->openupval) luaF_close(L, base); + L->savedpc = pc; + b = luaD_poscall(L, ra); + if (--nexeccalls == 0) /* was previous function running `here'? */ + return; /* no: return */ + else { /* yes: continue its execution */ + if (b) L->top = L->ci->top; + lua_assert(isLua(L->ci)); + lua_assert(GET_OPCODE(*((L->ci)->savedpc - 1)) == OP_CALL); + goto reentry; + } + } + case OP_FORLOOP: { + lua_Number step = nvalue(ra+2); + lua_Number idx = luai_numadd(nvalue(ra), step); /* increment index */ + lua_Number limit = nvalue(ra+1); + if (luai_numlt(0, step) ? luai_numle(idx, limit) + : luai_numle(limit, idx)) { + dojump(L, pc, GETARG_sBx(i)); /* jump back */ + setnvalue(ra, idx); /* update internal index... */ + setnvalue(ra+3, idx); /* ...and external index */ + } + continue; + } + case OP_FORPREP: { + const TValue *init = ra; + const TValue *plimit = ra+1; + const TValue *pstep = ra+2; + L->savedpc = pc; /* next steps may throw errors */ + if (!tonumber(init, ra)) + luaG_runerror(L, LUA_QL("for") " initial value must be a number"); + else if (!tonumber(plimit, ra+1)) + luaG_runerror(L, LUA_QL("for") " limit must be a number"); + else if (!tonumber(pstep, ra+2)) + luaG_runerror(L, LUA_QL("for") " step must be a number"); + setnvalue(ra, luai_numsub(nvalue(ra), nvalue(pstep))); + dojump(L, pc, GETARG_sBx(i)); + continue; + } + case OP_TFORLOOP: { + StkId cb = ra + 3; /* call base */ + setobjs2s(L, cb+2, ra+2); + setobjs2s(L, cb+1, ra+1); + setobjs2s(L, cb, ra); + L->top = cb+3; /* func. + 2 args (state and index) */ + Protect(luaD_call(L, cb, GETARG_C(i))); + L->top = L->ci->top; + cb = RA(i) + 3; /* previous call may change the stack */ + if (!ttisnil(cb)) { /* continue loop? */ + setobjs2s(L, cb-1, cb); /* save control variable */ + dojump(L, pc, GETARG_sBx(*pc)); /* jump back */ + } + pc++; + continue; + } + case OP_SETLIST: { + int n = GETARG_B(i); + int c = GETARG_C(i); + int last; + Table *h; + if (n == 0) { + n = cast_int(L->top - ra) - 1; + L->top = L->ci->top; + } + if (c == 0) c = cast_int(*pc++); + runtime_check(L, ttistable(ra)); + h = hvalue(ra); + last = ((c-1)*LFIELDS_PER_FLUSH) + n; + if (last > h->sizearray) /* needs more space? */ + luaH_resizearray(L, h, last); /* pre-alloc it at once */ + for (; n > 0; n--) { + TValue *val = ra+n; + setobj2t(L, luaH_setnum(L, h, last--), val); + luaC_barriert(L, h, val); + } + continue; + } + case OP_CLOSE: { + luaF_close(L, ra); + continue; + } + case OP_CLOSURE: { + Proto *p; + Closure *ncl; + int nup, j; + p = cl->p->p[GETARG_Bx(i)]; + nup = p->nups; + ncl = luaF_newLclosure(L, nup, cl->env); + ncl->l.p = p; + for (j=0; jl.upvals[j] = cl->upvals[GETARG_B(*pc)]; + else { + lua_assert(GET_OPCODE(*pc) == OP_MOVE); + ncl->l.upvals[j] = luaF_findupval(L, base + GETARG_B(*pc)); + } + } + setclvalue(L, ra, ncl); + Protect(luaC_checkGC(L)); + continue; + } + case OP_VARARG: { + int b = GETARG_B(i) - 1; + int j; + CallInfo *ci = L->ci; + int n = cast_int(ci->base - ci->func) - cl->p->numparams - 1; + if (b == LUA_MULTRET) { + Protect(luaD_checkstack(L, n)); + ra = RA(i); /* previous call may change the stack */ + b = n; + L->top = ra + n; + } + for (j = 0; j < b; j++) { + if (j < n) { + setobjs2s(L, ra + j, ci->base - n + j); + } + else { + setnilvalue(ra + j); + } + } + continue; + } + } + } +} + diff --git a/rpm-5.4.9/lua/lvm.h b/rpm-5.4.9/lua/lvm.h new file mode 100644 index 0000000..bfe4f56 --- /dev/null +++ b/rpm-5.4.9/lua/lvm.h @@ -0,0 +1,36 @@ +/* +** $Id: lvm.h,v 2.5.1.1 2007/12/27 13:02:25 roberto Exp $ +** Lua virtual machine +** See Copyright Notice in lua.h +*/ + +#ifndef lvm_h +#define lvm_h + + +#include "ldo.h" +#include "lobject.h" +#include "ltm.h" + + +#define tostring(L,o) ((ttype(o) == LUA_TSTRING) || (luaV_tostring(L, o))) + +#define tonumber(o,n) (ttype(o) == LUA_TNUMBER || \ + (((o) = luaV_tonumber(o,n)) != NULL)) + +#define equalobj(L,o1,o2) \ + (ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2)) + + +LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); +LUAI_FUNC int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2); +LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n); +LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj); +LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key, + StkId val); +LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key, + StkId val); +LUAI_FUNC void luaV_execute (lua_State *L, int nexeccalls); +LUAI_FUNC void luaV_concat (lua_State *L, int total, int last); + +#endif diff --git a/rpm-5.4.9/lua/lzio.c b/rpm-5.4.9/lua/lzio.c new file mode 100644 index 0000000..293edd5 --- /dev/null +++ b/rpm-5.4.9/lua/lzio.c @@ -0,0 +1,82 @@ +/* +** $Id: lzio.c,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $ +** a generic input stream interface +** See Copyright Notice in lua.h +*/ + + +#include + +#define lzio_c +#define LUA_CORE + +#include "lua.h" + +#include "llimits.h" +#include "lmem.h" +#include "lstate.h" +#include "lzio.h" + + +int luaZ_fill (ZIO *z) { + size_t size; + lua_State *L = z->L; + const char *buff; + lua_unlock(L); + buff = z->reader(L, z->data, &size); + lua_lock(L); + if (buff == NULL || size == 0) return EOZ; + z->n = size - 1; + z->p = buff; + return char2int(*(z->p++)); +} + + +int luaZ_lookahead (ZIO *z) { + if (z->n == 0) { + if (luaZ_fill(z) == EOZ) + return EOZ; + else { + z->n++; /* luaZ_fill removed first byte; put back it */ + z->p--; + } + } + return char2int(*z->p); +} + + +void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data) { + z->L = L; + z->reader = reader; + z->data = data; + z->n = 0; + z->p = NULL; +} + + +/* --------------------------------------------------------------- read --- */ +size_t luaZ_read (ZIO *z, void *b, size_t n) { + while (n) { + size_t m; + if (luaZ_lookahead(z) == EOZ) + return n; /* return number of missing bytes */ + m = (n <= z->n) ? n : z->n; /* min. between n and z->n */ + memcpy(b, z->p, m); + z->n -= m; + z->p += m; + b = (char *)b + m; + n -= m; + } + return 0; +} + +/* ------------------------------------------------------------------------ */ +char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n) { + if (n > buff->buffsize) { + if (n < LUA_MINBUFFER) n = LUA_MINBUFFER; + luaZ_resizebuffer(L, buff, n); + } + return buff->buffer; +} + + diff --git a/rpm-5.4.9/lua/lzio.h b/rpm-5.4.9/lua/lzio.h new file mode 100644 index 0000000..51d695d --- /dev/null +++ b/rpm-5.4.9/lua/lzio.h @@ -0,0 +1,67 @@ +/* +** $Id: lzio.h,v 1.21.1.1 2007/12/27 13:02:25 roberto Exp $ +** Buffered streams +** See Copyright Notice in lua.h +*/ + + +#ifndef lzio_h +#define lzio_h + +#include "lua.h" + +#include "lmem.h" + + +#define EOZ (-1) /* end of stream */ + +typedef struct Zio ZIO; + +#define char2int(c) cast(int, cast(unsigned char, (c))) + +#define zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z)) + +typedef struct Mbuffer { + char *buffer; + size_t n; + size_t buffsize; +} Mbuffer; + +#define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0) + +#define luaZ_buffer(buff) ((buff)->buffer) +#define luaZ_sizebuffer(buff) ((buff)->buffsize) +#define luaZ_bufflen(buff) ((buff)->n) + +#define luaZ_resetbuffer(buff) ((buff)->n = 0) + + +#define luaZ_resizebuffer(L, buff, size) \ + (luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \ + (buff)->buffsize = size) + +#define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0) + + +LUAI_FUNC char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n); +LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, + void *data); +LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */ +LUAI_FUNC int luaZ_lookahead (ZIO *z); + + + +/* --------- Private Part ------------------ */ + +struct Zio { + size_t n; /* bytes still unread */ + const char *p; /* current position in buffer */ + lua_Reader reader; + void* data; /* additional data */ + lua_State *L; /* Lua state (for reader) */ +}; + + +LUAI_FUNC int luaZ_fill (ZIO *z); + +#endif diff --git a/rpm-5.4.9/lua/print.c b/rpm-5.4.9/lua/print.c new file mode 100644 index 0000000..e240cfc --- /dev/null +++ b/rpm-5.4.9/lua/print.c @@ -0,0 +1,227 @@ +/* +** $Id: print.c,v 1.55a 2006/05/31 13:30:05 lhf Exp $ +** print bytecodes +** See Copyright Notice in lua.h +*/ + +#include +#include + +#define luac_c +#define LUA_CORE + +#include "ldebug.h" +#include "lobject.h" +#include "lopcodes.h" +#include "lundump.h" + +#define PrintFunction luaU_print + +#define Sizeof(x) ((int)sizeof(x)) +#define VOID(p) ((const void*)(p)) + +static void PrintString(const TString* ts) +{ + const char* s=getstr(ts); + size_t i,n=ts->tsv.len; + putchar('"'); + for (i=0; ik[i]; + switch (ttype(o)) + { + case LUA_TNIL: + printf("nil"); + break; + case LUA_TBOOLEAN: + printf(bvalue(o) ? "true" : "false"); + break; + case LUA_TNUMBER: + printf(LUA_NUMBER_FMT,nvalue(o)); + break; + case LUA_TSTRING: + PrintString(rawtsvalue(o)); + break; + default: /* cannot happen */ + printf("? type=%d",ttype(o)); + break; + } +} + +static void PrintCode(const Proto* f) +{ + const Instruction* code=f->code; + int pc,n=f->sizecode; + for (pc=0; pc0) printf("[%d]\t",line); else printf("[-]\t"); + printf("%-9s\t",luaP_opnames[o]); + switch (getOpMode(o)) + { + case iABC: + printf("%d",a); + if (getBMode(o)!=OpArgN) printf(" %d",ISK(b) ? (-1-INDEXK(b)) : b); + if (getCMode(o)!=OpArgN) printf(" %d",ISK(c) ? (-1-INDEXK(c)) : c); + break; + case iABx: + if (getBMode(o)==OpArgK) printf("%d %d",a,-1-bx); else printf("%d %d",a,bx); + break; + case iAsBx: + if (o==OP_JMP) printf("%d",sbx); else printf("%d %d",a,sbx); + break; + } + switch (o) + { + case OP_LOADK: + printf("\t; "); PrintConstant(f,bx); + break; + case OP_GETUPVAL: + case OP_SETUPVAL: + printf("\t; %s", (f->sizeupvalues>0) ? getstr(f->upvalues[b]) : "-"); + break; + case OP_GETGLOBAL: + case OP_SETGLOBAL: + printf("\t; %s",svalue(&f->k[bx])); + break; + case OP_GETTABLE: + case OP_SELF: + if (ISK(c)) { printf("\t; "); PrintConstant(f,INDEXK(c)); } + break; + case OP_SETTABLE: + case OP_ADD: + case OP_SUB: + case OP_MUL: + case OP_DIV: + case OP_POW: + case OP_EQ: + case OP_LT: + case OP_LE: + if (ISK(b) || ISK(c)) + { + printf("\t; "); + if (ISK(b)) PrintConstant(f,INDEXK(b)); else printf("-"); + printf(" "); + if (ISK(c)) PrintConstant(f,INDEXK(c)); else printf("-"); + } + break; + case OP_JMP: + case OP_FORLOOP: + case OP_FORPREP: + printf("\t; to %d",sbx+pc+2); + break; + case OP_CLOSURE: + printf("\t; %p",VOID(f->p[bx])); + break; + case OP_SETLIST: + if (c==0) printf("\t; %d",(int)code[++pc]); + else printf("\t; %d",c); + break; + default: + break; + } + printf("\n"); + } +} + +#define SS(x) (x==1)?"":"s" +#define S(x) x,SS(x) + +static void PrintHeader(const Proto* f) +{ + const char* s=getstr(f->source); + if (*s=='@' || *s=='=') + s++; + else if (*s==LUA_SIGNATURE[0]) + s="(bstring)"; + else + s="(string)"; + printf("\n%s <%s:%d,%d> (%d instruction%s, %d bytes at %p)\n", + (f->linedefined==0)?"main":"function",s, + f->linedefined,f->lastlinedefined, + S(f->sizecode),f->sizecode*Sizeof(Instruction),VOID(f)); + printf("%d%s param%s, %d slot%s, %d upvalue%s, ", + f->numparams,f->is_vararg?"+":"",SS(f->numparams), + S(f->maxstacksize),S(f->nups)); + printf("%d local%s, %d constant%s, %d function%s\n", + S(f->sizelocvars),S(f->sizek),S(f->sizep)); +} + +static void PrintConstants(const Proto* f) +{ + int i,n=f->sizek; + printf("constants (%d) for %p:\n",n,VOID(f)); + for (i=0; isizelocvars; + printf("locals (%d) for %p:\n",n,VOID(f)); + for (i=0; ilocvars[i].varname),f->locvars[i].startpc+1,f->locvars[i].endpc+1); + } +} + +static void PrintUpvalues(const Proto* f) +{ + int i,n=f->sizeupvalues; + printf("upvalues (%d) for %p:\n",n,VOID(f)); + if (f->upvalues==NULL) return; + for (i=0; iupvalues[i])); + } +} + +void PrintFunction(const Proto* f, int full) +{ + int i,n=f->sizep; + PrintHeader(f); + PrintCode(f); + if (full) + { + PrintConstants(f); + PrintLocals(f); + PrintUpvalues(f); + } + for (i=0; ip[i],full); +} diff --git a/rpm-5.4.9/lua/shadow/chkname.h b/rpm-5.4.9/lua/shadow/chkname.h new file mode 100644 index 0000000..7e3db62 --- /dev/null +++ b/rpm-5.4.9/lua/shadow/chkname.h @@ -0,0 +1,21 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* $Id: chkname.h,v 1.1 2008/08/17 18:31:35 jbj Exp $ */ +#ifndef _CHKNAME_H_ +#define _CHKNAME_H_ + +/* + * check_user_name(), check_group_name() - check the new user/group + * name for validity; return value: 1 - OK, 0 - bad name + */ + +#include "defines.h" + +extern int check_user_name (const char *); +extern int check_group_name (const char *name); + +#endif diff --git a/rpm-5.4.9/lua/shadow/commonio.c b/rpm-5.4.9/lua/shadow/commonio.c new file mode 100644 index 0000000..2c9b97e --- /dev/null +++ b/rpm-5.4.9/lua/shadow/commonio.c @@ -0,0 +1,946 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + + +#include "system.h" +#include "shadow_config.h" + +#ident "$Id: commonio.c,v 1.3 2010/03/21 14:56:59 jbj Exp $" + +#include "defines.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "nscd.h" +#ifdef HAVE_SHADOW_H +#include +#endif +#ifdef WITH_SELINUX +#include +static security_context_t old_context = NULL; +#endif +#include "commonio.h" + +/* local function prototypes */ +static int lrename (const char *, const char *); +static int check_link_count (const char *); +static int do_lock_file (const char *, const char *); +static FILE *fopen_set_perms (const char *, const char *, const struct stat *); +static int create_backup (const char *, FILE *); +static void free_linked_list (struct commonio_db *); +static void add_one_entry (struct commonio_db *, struct commonio_entry *); +static int name_is_nis (const char *); +static int write_all (const struct commonio_db *); +static struct commonio_entry *find_entry_by_name (struct commonio_db *, + const char *); + +static int lock_count = 0; +static int nscd_need_reload = 0; + +/* + * Simple rename(P) alternative that attempts to rename to symlink + * target. + */ +int lrename (const char *_old, const char *_new) +{ + + char resolved_path[PATH_MAX]; + int res; + +#if defined(S_ISLNK) + struct stat sb = { 0 }; + if (lstat (_new, &sb) == 0 && S_ISLNK (sb.st_mode)) { + if (realpath (_new, resolved_path) == NULL) { + perror ("realpath in lrename()"); + } else { + _new = resolved_path; + } + } +#endif + res = rename (_old, _new); + return res; +} + +static int check_link_count (const char *file) +{ + struct stat sb; + + if (stat (file, &sb) != 0) + return 0; + + if (sb.st_nlink != 2) + return 0; + + return 1; +} + + +static int do_lock_file (const char *file, const char *lock) +{ + int fd; + int pid; + int len; + int retval; + char buf[32]; + + if ((fd = open (file, O_CREAT | O_EXCL | O_WRONLY, 0600)) == -1) + return 0; + + pid = getpid (); + snprintf (buf, sizeof buf, "%d", pid); + len = strlen (buf) + 1; + if (write (fd, buf, len) != len) { + close (fd); + unlink (file); + return 0; + } + close (fd); + + if (link (file, lock) == 0) { + retval = check_link_count (file); + unlink (file); + return retval; + } + + if ((fd = open (lock, O_RDWR)) == -1) { + unlink (file); + errno = EINVAL; + return 0; + } + len = read (fd, buf, sizeof (buf) - 1); + close (fd); + if (len <= 0) { + unlink (file); + errno = EINVAL; + return 0; + } + buf[len] = '\0'; + if ((pid = strtol (buf, (char **) 0, 10)) == 0) { + unlink (file); + errno = EINVAL; + return 0; + } + if (kill (pid, 0) == 0) { + unlink (file); + errno = EEXIST; + return 0; + } + if (unlink (lock) != 0) { + unlink (file); + return 0; + } + + retval = 0; + if (link (file, lock) == 0 && check_link_count (file)) + retval = 1; + + unlink (file); + return retval; +} + + +static FILE *fopen_set_perms (const char *name, const char *mode, + const struct stat *sb) +{ + FILE *fp; + mode_t mask; + + mask = umask (0777); + fp = fopen (name, mode); + umask (mask); + if (!fp) + return NULL; + +#ifdef HAVE_FCHOWN + if (fchown (fileno (fp), sb->st_uid, sb->st_gid)) + goto fail; +#else + if (chown (name, sb->st_mode)) + goto fail; +#endif + +#ifdef HAVE_FCHMOD + if (fchmod (fileno (fp), sb->st_mode & 0664)) + goto fail; +#else + if (chmod (name, sb->st_mode & 0664)) + goto fail; +#endif + return fp; + + fail: + fclose (fp); + unlink (name); + return NULL; +} + + +static int create_backup (const char *backup, FILE * fp) +{ + struct stat sb; + struct utimbuf ub; + FILE *bkfp; + int c; + mode_t mask; + + if (fstat (fileno (fp), &sb)) + return -1; + + mask = umask (077); + bkfp = fopen (backup, "w"); + umask (mask); + if (!bkfp) + return -1; + + /* TODO: faster copy, not one-char-at-a-time. --marekm */ + c = 0; + if (fseek (fp, 0, SEEK_SET) == 0) + while ((c = getc (fp)) != EOF) { + if (putc (c, bkfp) == EOF) + break; + } + if (c != EOF || ferror (fp) || fflush (bkfp)) { + fclose (bkfp); + return -1; + } + if (fclose (bkfp)) + return -1; + + ub.actime = sb.st_atime; + ub.modtime = sb.st_mtime; + utime (backup, &ub); + return 0; +} + + +static void free_linked_list (struct commonio_db *db) +{ + struct commonio_entry *p; + + while (db->head) { + p = db->head; + db->head = p->next; + + if (p->line) + free (p->line); + + if (p->eptr) + db->ops->free (p->eptr); + + free (p); + } + db->tail = NULL; +} + + +int commonio_setname (struct commonio_db *db, const char *name) +{ + snprintf (db->filename, sizeof (db->filename), "%s", name); + return 1; +} + + +int commonio_present (const struct commonio_db *db) +{ + return (access (db->filename, F_OK) == 0); +} + + +int commonio_lock_nowait (struct commonio_db *db) +{ + char file[1024]; + char lock[1024]; + + if (db->locked) + return 1; + + snprintf (file, sizeof file, "%s.%ld", db->filename, (long) getpid ()); + snprintf (lock, sizeof lock, "%s.lock", db->filename); + if (do_lock_file (file, lock)) { + db->locked = 1; + lock_count++; + return 1; + } + return 0; +} + + +int commonio_lock (struct commonio_db *db) +{ + + +#ifdef HAVE_LCKPWDF +#if 0 + printf("Locking file with LCKPWDF %s\n", db->filename); +#endif + /* + * only if the system libc has a real lckpwdf() - the one from + * lockpw.c calls us and would cause infinite recursion! + */ + + /* + * Call lckpwdf() on the first lock. + * If it succeeds, call *_lock() only once + * (no retries, it should always succeed). + */ + if (lock_count == 0) { + if (lckpwdf () == -1) + return 0; /* failure */ + } + + if (commonio_lock_nowait (db)) + return 1; /* success */ + + ulckpwdf (); + return 0; /* failure */ +#else + int i; + + printf("Locking file without LCKPWDF %s\n", db->filename); + + /* + * lckpwdf() not used - do it the old way. + */ +#ifndef LOCK_TRIES +#define LOCK_TRIES 15 +#endif + +#ifndef LOCK_SLEEP +#define LOCK_SLEEP 1 +#endif + for (i = 0; i < LOCK_TRIES; i++) { + if (i > 0) + sleep (LOCK_SLEEP); /* delay between retries */ + if (commonio_lock_nowait (db)) + return 1; /* success */ + /* no unnecessary retries on "permission denied" errors */ + if (geteuid () != 0) + return 0; + } + return 0; /* failure */ +#endif +} + +static void dec_lock_count (void) +{ + if (lock_count > 0) { + lock_count--; + if (lock_count == 0) { + /* Tell nscd when lock count goes to zero, + if any of the files were changed. */ + if (nscd_need_reload) { +#if 0 /* no cache flushin' */ + nscd_flush_cache ("passwd"); + nscd_flush_cache ("group"); +#endif + nscd_need_reload = 0; + } +#ifdef HAVE_LCKPWDF + ulckpwdf (); +#endif + } + } +} + + +int commonio_unlock (struct commonio_db *db) +{ + char lock[1024]; + + if (db->isopen) { + db->readonly = 1; + if (!commonio_close (db)) { + if (db->locked) + dec_lock_count (); + return 0; + } + } + if (db->locked) { + /* + * Unlock in reverse order: remove the lock file, + * then call ulckpwdf() (if used) on last unlock. + */ + db->locked = 0; + snprintf (lock, sizeof lock, "%s.lock", db->filename); + unlink (lock); + dec_lock_count (); + return 1; + } + return 0; +} + + +static void add_one_entry (struct commonio_db *db, struct commonio_entry *p) +{ + p->next = NULL; + p->prev = db->tail; + if (!db->head) + db->head = p; + if (db->tail) + db->tail->next = p; + db->tail = p; +} + + +static int name_is_nis (const char *n) +{ + return (n[0] == '+' || n[0] == '-'); +} + + +/* + * New entries are inserted before the first NIS entry. Order is preserved + * when db is written out. + */ +#ifndef KEEP_NIS_AT_END +#define KEEP_NIS_AT_END 1 +#endif + +#if KEEP_NIS_AT_END +static void add_one_entry_nis (struct commonio_db *, struct commonio_entry *); + +static void +add_one_entry_nis (struct commonio_db *db, struct commonio_entry *newp) +{ + struct commonio_entry *p; + + for (p = db->head; p; p = p->next) { + if (name_is_nis + (p->eptr ? db->ops->getname (p->eptr) : p->line)) { + newp->next = p; + newp->prev = p->prev; + if (p->prev) + p->prev->next = newp; + else + db->head = newp; + p->prev = newp; + return; + } + } + add_one_entry (db, newp); +} +#endif /* KEEP_NIS_AT_END */ + +/* Initial buffer size, as well as increment if not sufficient + (for reading very long lines in group files). */ +#define BUFLEN 4096 + +int commonio_open (struct commonio_db *db, int mode) +{ + char *buf; + char *cp; + char *line; + struct commonio_entry *p; + void *eptr; + int flags = mode; + int buflen; + int saved_errno; + + mode &= ~O_CREAT; + + if (db->isopen || (mode != O_RDONLY && mode != O_RDWR)) { + errno = EINVAL; + return 0; + } + db->readonly = (mode == O_RDONLY); + if (!db->readonly && !db->locked) { + errno = EACCES; + return 0; + } + + db->head = db->tail = db->cursor = NULL; + db->changed = 0; + + db->fp = fopen (db->filename, db->readonly ? "r" : "r+"); + + /* + * If O_CREAT was specified and the file didn't exist, it will be + * created by commonio_close(). We have no entries to read yet. --marekm + */ + if (!db->fp) { + if ((flags & O_CREAT) && errno == ENOENT) { + db->isopen = 1; + return 1; + } + return 0; + } + + /* not not inherit fd */ + fcntl(fileno(db->fp), F_SETFD, FD_CLOEXEC); + +#ifdef WITH_SELINUX + db->scontext = NULL; + if ((is_selinux_enabled () > 0) && (!db->readonly)) { + if (fgetfilecon (fileno (db->fp), &db->scontext) < 0) { + goto cleanup_errno; + } + } +#endif + + buflen = BUFLEN; + buf = (char *) malloc (buflen); + if (!buf) + goto cleanup_ENOMEM; + + while (db->ops->fgets (buf, buflen, db->fp)) { +#if 0 + printf("Reading from %s\n",db->filename); +#endif + while (!(cp = strrchr (buf, '\n')) && !feof (db->fp)) { + int len; + + buflen += BUFLEN; + cp = (char *) realloc (buf, buflen); + if (!cp) + goto cleanup_buf; + buf = cp; + len = strlen (buf); + db->ops->fgets (buf + len, buflen - len, db->fp); + } + if ((cp = strrchr (buf, '\n'))) + *cp = '\0'; + + if (!(line = strdup (buf))) + goto cleanup_buf; + + if (name_is_nis (line)) { + eptr = NULL; + } else if ((eptr = db->ops->parse (line))) { + eptr = db->ops->dup (eptr); + if (!eptr) + goto cleanup_line; + } + + p = (struct commonio_entry *) malloc (sizeof *p); + if (!p) + goto cleanup_entry; + + p->eptr = eptr; + p->line = line; + p->changed = 0; + + add_one_entry (db, p); + } + + free (buf); + + if (ferror (db->fp)) + goto cleanup_errno; + + db->isopen = 1; + return 1; + + cleanup_entry: + if (eptr) + db->ops->free (eptr); + cleanup_line: + free (line); + cleanup_buf: + free (buf); + cleanup_ENOMEM: + errno = ENOMEM; + cleanup_errno: + saved_errno = errno; + free_linked_list (db); +#ifdef WITH_SELINUX + if (db->scontext != NULL) { + freecon (db->scontext); + db->scontext = NULL; + } +#endif + fclose (db->fp); + db->fp = NULL; + errno = saved_errno; + return 0; +} + +/* + * Sort given db according to cmp function (usually compares uids) + */ +int +commonio_sort (struct commonio_db *db, int (*cmp) (const void *, const void *)) +{ + struct commonio_entry **entries, *ptr; + int n = 0, i; + + for (ptr = db->head; ptr; ptr = ptr->next) + n++; + + if (n <= 1) + return 0; + + entries = (struct commonio_entry **) malloc (n * sizeof (*entries)); + if (entries == NULL) + return -1; + + n = 0; + for (ptr = db->head; ptr; ptr = ptr->next) + entries[n++] = ptr; + qsort (entries, n, sizeof (struct commonio_entry *), cmp); + + db->head = entries[0]; + db->tail = entries[--n]; + db->head->prev = NULL; + db->head->next = entries[1]; + db->tail->prev = entries[n - 1]; + db->tail->next = NULL; + + for (i = 1; i < n; i++) { + entries[i]->prev = entries[i - 1]; + entries[i]->next = entries[i + 1]; + } + + free (entries); + db->changed = 1; + + return 0; +} + +/* + * Sort entries in db according to order in another. + */ +int commonio_sort_wrt (struct commonio_db *shadow, struct commonio_db *passwd) +{ + struct commonio_entry *head = NULL, *pw_ptr, *spw_ptr; + const char *name; + + if (!shadow || !shadow->head) + return 0; + + for (pw_ptr = passwd->head; pw_ptr; pw_ptr = pw_ptr->next) { + if (pw_ptr->eptr == NULL) + continue; + name = passwd->ops->getname (pw_ptr->eptr); + for (spw_ptr = shadow->head; spw_ptr; spw_ptr = spw_ptr->next) + if (strcmp (name, shadow->ops->getname (spw_ptr->eptr)) + == 0) + break; + if (spw_ptr == NULL) + continue; + commonio_del_entry (shadow, spw_ptr); + spw_ptr->next = head; + head = spw_ptr; + } + + for (spw_ptr = head; spw_ptr; spw_ptr = head) { + head = head->next; + + if (shadow->head) + shadow->head->prev = spw_ptr; + spw_ptr->next = shadow->head; + shadow->head = spw_ptr; + } + + shadow->head->prev = NULL; + shadow->changed = 1; + + return 0; +} + +static int write_all (const struct commonio_db *db) +{ + const struct commonio_entry *p; + void *eptr; + + for (p = db->head; p; p = p->next) { + if (p->changed) { + eptr = p->eptr; + if (db->ops->put (eptr, db->fp)) + return -1; + } else if (p->line) { + if (db->ops->fputs (p->line, db->fp) == EOF) + return -1; + if (putc ('\n', db->fp) == EOF) + return -1; + } + } + return 0; +} + + +int commonio_close (struct commonio_db *db) +{ + char buf[1024]; + int errors = 0; + struct stat sb; + + if (!db->isopen) { + errno = EINVAL; + return 0; + } + db->isopen = 0; + + if (!db->changed || db->readonly) { + fclose (db->fp); + db->fp = NULL; + goto success; + } + + memzero (&sb, sizeof sb); + if (db->fp) { + if (fstat (fileno (db->fp), &sb)) { + fclose (db->fp); + db->fp = NULL; + goto fail; + } +#ifdef WITH_SELINUX + if (db->scontext != NULL) { + int stat = getfscreatecon (&old_context); + + if (stat < 0) { + errors++; + goto fail; + } + if (setfscreatecon (db->scontext) < 0) { + errors++; + goto fail; + } + } +#endif + /* + * Create backup file. + */ + snprintf (buf, sizeof buf, "%s-", db->filename); + + if (create_backup (buf, db->fp)) + errors++; + + if (fclose (db->fp)) + errors++; + + if (errors) { + db->fp = NULL; + goto fail; + } + } else { + /* + * Default permissions for new [g]shadow files. + * (passwd and group always exist...) + */ + sb.st_mode = 0400; + sb.st_uid = 0; + sb.st_gid = 0; + } + + snprintf (buf, sizeof buf, "%s+", db->filename); + + db->fp = fopen_set_perms (buf, "w", &sb); + if (!db->fp) + goto fail; + + if (write_all (db)) + errors++; + + if (fflush (db->fp)) + errors++; +#ifdef HAVE_FSYNC + if (fsync (fileno (db->fp))) + errors++; +#else + sync (); +#endif + if (fclose (db->fp)) + errors++; + + db->fp = NULL; + + if (errors) { + unlink (buf); + goto fail; + } + + if (lrename (buf, db->filename)) + goto fail; + + nscd_need_reload = 1; + goto success; + fail: + errors++; + success: + +#ifdef WITH_SELINUX + if (db->scontext != NULL) { + if (setfscreatecon (old_context) < 0) { + errors++; + } + if (old_context != NULL) { + freecon (old_context); + old_context = NULL; + } + freecon (db->scontext); + db->scontext = NULL; + } +#endif + free_linked_list (db); + return errors == 0; +} + + +static struct commonio_entry *find_entry_by_name (struct commonio_db *db, + const char *name) +{ + struct commonio_entry *p; + void *ep; + + for (p = db->head; p; p = p->next) { + ep = p->eptr; + if (ep && strcmp (db->ops->getname (ep), name) == 0) + break; + } + return p; +} + + +int commonio_update (struct commonio_db *db, const void *eptr) +{ + struct commonio_entry *p; + void *nentry; + + if (!db->isopen || db->readonly) { + errno = EINVAL; + return 0; + } + if (!(nentry = db->ops->dup (eptr))) { + errno = ENOMEM; + return 0; + } + p = find_entry_by_name (db, db->ops->getname (eptr)); + if (p) { + db->ops->free (p->eptr); + p->eptr = nentry; + p->changed = 1; + db->cursor = p; + + db->changed = 1; + return 1; + } + /* not found, new entry */ + p = (struct commonio_entry *) malloc (sizeof *p); + if (!p) { + db->ops->free (nentry); + errno = ENOMEM; + return 0; + } + + p->eptr = nentry; + p->line = NULL; + p->changed = 1; + +#if KEEP_NIS_AT_END + add_one_entry_nis (db, p); +#else + add_one_entry (db, p); +#endif +#if 0 + printf("Entry added to db\n"); +#endif + db->changed = 1; + return 1; +} + + +void commonio_del_entry (struct commonio_db *db, const struct commonio_entry *p) +{ + if (p == db->cursor) + db->cursor = p->next; + + if (p->prev) + p->prev->next = p->next; + else + db->head = p->next; + + if (p->next) + p->next->prev = p->prev; + else + db->tail = p->prev; + + db->changed = 1; +} + + +int commonio_remove (struct commonio_db *db, const char *name) +{ + struct commonio_entry *p; + + if (!db->isopen || db->readonly) { + errno = EINVAL; + return 0; + } + p = find_entry_by_name (db, name); + if (!p) { + errno = ENOENT; + return 0; + } + + commonio_del_entry (db, p); + + if (p->line) + free (p->line); + + if (p->eptr) + db->ops->free (p->eptr); + + return 1; +} + + +const void *commonio_locate (struct commonio_db *db, const char *name) +{ + struct commonio_entry *p; + + if (!db->isopen) { + errno = EINVAL; + return NULL; + } + p = find_entry_by_name (db, name); + if (!p) { + errno = ENOENT; + return NULL; + } + db->cursor = p; + return p->eptr; +} + + +int commonio_rewind (struct commonio_db *db) +{ + if (!db->isopen) { + errno = EINVAL; + return 0; + } + db->cursor = NULL; + return 1; +} + + +const void *commonio_next (struct commonio_db *db) +{ + void *eptr; + + if (!db->isopen) { + errno = EINVAL; + return 0; + } + if (db->cursor == NULL) + db->cursor = db->head; + else + db->cursor = db->cursor->next; + + while (db->cursor) { + eptr = db->cursor->eptr; + if (eptr) + return eptr; + + db->cursor = db->cursor->next; + } + return NULL; +} diff --git a/rpm-5.4.9/lua/shadow/commonio.h b/rpm-5.4.9/lua/shadow/commonio.h new file mode 100644 index 0000000..92692db --- /dev/null +++ b/rpm-5.4.9/lua/shadow/commonio.h @@ -0,0 +1,116 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* $Id: commonio.h,v 1.1 2008/08/17 18:31:35 jbj Exp $ */ + +#ifdef WITH_SELINUX +#include +#endif +/* + * Linked list entry. + */ +struct commonio_entry { + char *line; + void *eptr; /* struct passwd, struct spwd, ... */ + struct commonio_entry *prev, *next; + int changed:1; +}; + +/* + * Operations depending on database type: passwd, group, shadow etc. + */ +struct commonio_ops { + /* + * Make a copy of the object (for example, struct passwd) + * and all strings pointed by it, in malloced memory. + */ + void *(*dup) (const void *); + + /* + * free() the object including any strings pointed by it. + */ + void (*free) (void *); + + /* + * Return the name of the object (for example, pw_name + * for struct passwd). + */ + const char *(*getname) (const void *); + + /* + * Parse a string, return object (in static area - + * should be copied using the dup operation above). + */ + void *(*parse) (const char *); + + /* + * Write the object to the file (this calls putpwent() + * for struct passwd, for example). + */ + int (*put) (const void *, FILE *); + + /* + * fgets and fputs (can be replaced by versions that + * understand line continuation conventions). + */ + char *(*fgets) (char *, int, FILE *); + int (*fputs) (const char *, FILE *); +}; + +/* + * Database structure. + */ +struct commonio_db { + /* + * Name of the data file. + */ + char filename[1024]; + + /* + * Operations from above. + */ + struct commonio_ops *ops; + + /* + * Currently open file stream. + */ + FILE *fp; + +#ifdef WITH_SELINUX + security_context_t scontext; +#endif + /* + * Head, tail, current position in linked list. + */ + struct commonio_entry *head, *tail, *cursor; + + /* + * Various flags. + */ + int changed:1; + int isopen:1; + int locked:1; + int readonly:1; +}; + +extern int commonio_setname (struct commonio_db *, const char *); +extern int commonio_present (const struct commonio_db *); +extern int commonio_lock (struct commonio_db *); +extern int commonio_lock_nowait (struct commonio_db *); +extern int commonio_open (struct commonio_db *, int); +extern const void *commonio_locate (struct commonio_db *, const char *); +extern int commonio_update (struct commonio_db *, const void *); +extern int commonio_remove (struct commonio_db *, const char *); +extern int commonio_rewind (struct commonio_db *); +extern const void *commonio_next (struct commonio_db *); +extern int commonio_close (struct commonio_db *); +extern int commonio_unlock (struct commonio_db *); +extern void commonio_del_entry (struct commonio_db *, + const struct commonio_entry *); +extern int commonio_sort_wrt (struct commonio_db *shadow, + struct commonio_db *passwd); +extern int commonio_sort (struct commonio_db *db, + int (*cmp) (const void *, const void *)); diff --git a/rpm-5.4.9/lua/shadow/copydir.c b/rpm-5.4.9/lua/shadow/copydir.c new file mode 100644 index 0000000..ac68a3f --- /dev/null +++ b/rpm-5.4.9/lua/shadow/copydir.c @@ -0,0 +1,455 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* + * Copyright 1991 - 1994, Julianne Frances Haugh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Julianne F. Haugh nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "system.h" +#include "shadow_config.h" + +#ident "$Id: copydir.c,v 1.4 2010/03/21 14:56:59 jbj Exp $" + +#include +#include "prototypes.h" +#include "defines.h" +#ifdef WITH_SELINUX +#include +static int selinux_enabled = -1; +#endif + +#include "debug.h" + +static const char *src_orig; +static const char *dst_orig; + +struct link_name { + dev_t ln_dev; + ino_t ln_ino; + int ln_count; + char *ln_name; + struct link_name *ln_next; +}; +static struct link_name *links; + +#ifdef WITH_SELINUX +static int selinux_file_context (const char *dst_name) +{ + security_context_t scontext = NULL; + + if (selinux_enabled < 0) + selinux_enabled = is_selinux_enabled () > 0; + if (selinux_enabled) { + if (matchpathcon (dst_name, 0, &scontext) < 0) + if (security_getenforce ()) + return 1; + if (setfscreatecon (scontext) < 0) + if (security_getenforce ()) + return 1; + freecon (scontext); + } + return 0; +} +#endif + +/* + * remove_link - delete a link from the link list + */ + +static void remove_link (struct link_name *ln) +{ + struct link_name *lp; + + if (links == ln) { + links = ln->ln_next; + free (ln->ln_name); + free (ln); + return; + } + for (lp = links; lp; lp = lp->ln_next) + if (lp->ln_next == ln) + break; + + if (!lp) + return; + + lp->ln_next = lp->ln_next->ln_next; + free (ln->ln_name); + free (ln); +} + +/* + * check_link - see if a file is really a link + */ + +static struct link_name *check_link (const char *name, const struct stat *sb) +{ + struct link_name *lp; + int src_len; + int dst_len; + int name_len; + int len; + + for (lp = links; lp; lp = lp->ln_next) + if (lp->ln_dev == sb->st_dev && lp->ln_ino == sb->st_ino) + return lp; + + if (sb->st_nlink == 1) + return 0; + + lp = (struct link_name *) malloc (sizeof *lp); +assert(lp != NULL); + src_len = strlen (src_orig); + dst_len = strlen (dst_orig); + name_len = strlen (name); + lp->ln_dev = sb->st_dev; + lp->ln_ino = sb->st_ino; + lp->ln_count = sb->st_nlink; + len = name_len - src_len + dst_len + 1; + lp->ln_name = (char *) malloc (len); +assert(lp->ln_name != NULL); + snprintf (lp->ln_name, len, "%s%s", dst_orig, name + src_len); + lp->ln_next = links; + links = lp; + + return 0; +} + +/* + * copy_tree - copy files in a directory tree + * + * copy_tree() walks a directory tree and copies ordinary files + * as it goes. + */ + +int copy_tree (const char *src_root, const char *dst_root, uid_t uid, gid_t gid) +{ + char src_name[1024]; + char dst_name[1024]; + char buf[1024]; + int ifd; + int ofd; + int err = 0; + int cnt; + int set_orig = 0; + struct DIRECT *ent; + struct stat sb; + struct link_name *lp; + DIR *dir; + + /* + * Make certain both directories exist. This routine is called + * after the home directory is created, or recursively after the + * target is created. It assumes the target directory exists. + */ + + if (access (src_root, F_OK) != 0 || access (dst_root, F_OK) != 0) + return -1; + + /* + * Open the source directory and read each entry. Every file + * entry in the directory is copied with the UID and GID set + * to the provided values. As an added security feature only + * regular files (and directories ...) are copied, and no file + * is made set-ID. + */ + + if (!(dir = opendir (src_root))) + return -1; + + if (src_orig == 0) { + src_orig = src_root; + dst_orig = dst_root; + set_orig++; + } + while ((ent = readdir (dir))) { + + /* + * Skip the "." and ".." entries + */ + + if (strcmp (ent->d_name, ".") == 0 || + strcmp (ent->d_name, "..") == 0) + continue; + + /* + * Make the filename for both the source and the + * destination files. + */ + + if (strlen (src_root) + strlen (ent->d_name) + 2 > + sizeof src_name) { + err++; + break; + } + snprintf (src_name, sizeof src_name, "%s/%s", src_root, + ent->d_name); + + if (strlen (dst_root) + strlen (ent->d_name) + 2 > + sizeof dst_name) { + err++; + break; + } + snprintf (dst_name, sizeof dst_name, "%s/%s", dst_root, + ent->d_name); + + if (LSTAT (src_name, &sb) == -1) + continue; + + if (S_ISDIR (sb.st_mode)) { + + /* + * Create a new target directory, make it owned by + * the user and then recursively copy that directory. + */ + +#ifdef WITH_SELINUX + selinux_file_context (dst_name); +#endif + if (mkdir (dst_name, sb.st_mode) + || chown (dst_name, + uid == (uid_t) - 1 ? sb.st_uid : uid, + gid == (gid_t) - 1 ? sb.st_gid : gid) + || chmod (dst_name, sb.st_mode) + || copy_tree (src_name, dst_name, uid, gid)) { + err++; + break; + } + continue; + } +#ifdef S_IFLNK + /* + * Copy any symbolic links + */ + + if (S_ISLNK (sb.st_mode)) { + char oldlink[1024]; + char dummy[1024]; + int len; + + /* + * Get the name of the file which the link points + * to. If that name begins with the original + * source directory name, that part of the link + * name will be replaced with the original + * destinateion directory name. + */ + + if ((len = + readlink (src_name, oldlink, + sizeof (oldlink) - 1)) < 0) { + err++; + break; + } + oldlink[len] = '\0'; /* readlink() does not NUL-terminate */ + if (!strncmp (oldlink, src_orig, strlen (src_orig))) { + snprintf (dummy, sizeof dummy, "%s%s", + dst_orig, + oldlink + strlen (src_orig)); + strcpy (oldlink, dummy); + } +#ifdef WITH_SELINUX + selinux_file_context (dst_name); +#endif + if (symlink (oldlink, dst_name) || + lchown (dst_name, + uid == (uid_t) - 1 ? sb.st_uid : uid, + gid == (gid_t) - 1 ? sb.st_gid : gid)) { + err++; + break; + } + continue; + } +#endif + + /* + * See if this is a previously copied link + */ + + if ((lp = check_link (src_name, &sb))) { + if (link (lp->ln_name, dst_name)) { + err++; + break; + } + if (unlink (src_name)) { + err++; + break; + } + if (--lp->ln_count <= 0) + remove_link (lp); + + continue; + } + + /* + * Deal with FIFOs and special files. The user really + * shouldn't have any of these, but it seems like it + * would be nice to copy everything ... + */ + + if (!S_ISREG (sb.st_mode)) { +#ifdef WITH_SELINUX + selinux_file_context (dst_name); +#endif + if (mknod (dst_name, sb.st_mode & ~07777, sb.st_rdev) + || chown (dst_name, + uid == (uid_t) - 1 ? sb.st_uid : uid, + gid == (gid_t) - 1 ? sb.st_gid : gid) + || chmod (dst_name, sb.st_mode & 07777)) { + err++; + break; + } + continue; + } + + /* + * Create the new file and copy the contents. The new + * file will be owned by the provided UID and GID values. + */ + + if ((ifd = open (src_name, O_RDONLY)) < 0) { + err++; + break; + } +#ifdef WITH_SELINUX + selinux_file_context (dst_name); +#endif + if ((ofd = + open (dst_name, O_WRONLY | O_CREAT | O_TRUNC, 0)) < 0 + || chown (dst_name, + uid == (uid_t) - 1 ? sb.st_uid : uid, + gid == (gid_t) - 1 ? sb.st_gid : gid) + || chmod (dst_name, sb.st_mode & 07777)) { + close (ifd); + err++; + break; + } + while ((cnt = read (ifd, buf, sizeof buf)) > 0) { + if (write (ofd, buf, cnt) != cnt) { + cnt = -1; + break; + } + } + close (ifd); + close (ofd); + + if (cnt == -1) { + err++; + break; + } + } + closedir (dir); + + if (set_orig) { + src_orig = 0; + dst_orig = 0; + } + return err ? -1 : 0; +} + +/* + * remove_tree - remove files in a directory tree + * + * remove_tree() walks a directory tree and deletes all the files + * and directories. + */ + +int remove_tree (const char *root) +{ + char new_name[1024]; + int err = 0; + struct DIRECT *ent; + struct stat sb; + DIR *dir; + + /* + * Make certain the directory exists. + */ + + if (access (root, F_OK) != 0) + return -1; + + /* + * Open the source directory and read each entry. Every file + * entry in the directory is copied with the UID and GID set + * to the provided values. As an added security feature only + * regular files (and directories ...) are copied, and no file + * is made set-ID. + */ + + if (!(dir = opendir (root))) + return -1; + + while ((ent = readdir (dir))) { + + /* + * Skip the "." and ".." entries + */ + + if (strcmp (ent->d_name, ".") == 0 || + strcmp (ent->d_name, "..") == 0) + continue; + + /* + * Make the filename for the current entry. + */ + + if (strlen (root) + strlen (ent->d_name) + 2 > sizeof new_name) { + err++; + break; + } + snprintf (new_name, sizeof new_name, "%s/%s", root, + ent->d_name); + if (LSTAT (new_name, &sb) == -1) + continue; + + if (S_ISDIR (sb.st_mode)) { + + /* + * Recursively delete this directory. + */ + + if (remove_tree (new_name)) { + err++; + break; + } + if (rmdir (new_name)) { + err++; + break; + } + continue; + } + unlink (new_name); + } + closedir (dir); + + return err ? -1 : 0; +} diff --git a/rpm-5.4.9/lua/shadow/defines.h b/rpm-5.4.9/lua/shadow/defines.h new file mode 100644 index 0000000..540b8c4 --- /dev/null +++ b/rpm-5.4.9/lua/shadow/defines.h @@ -0,0 +1,285 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* $Id: defines.h,v 1.3 2008/08/18 18:19:30 jbj Exp $ */ +/* some useful defines */ + +#ifndef _DEFINES_H_ +#define _DEFINES_H_ + +#define ISDIGIT_LOCALE(c) (IN_CTYPE_DOMAIN (c) && isdigit (c)) + +#define gettext_noop(String) (String) +/* #define gettext_def(String) "#define String" */ + +#if STDC_HEADERS +#else /* not STDC_HEADERS */ +# ifndef HAVE_STRCHR +# define strchr index +# define strrchr rindex +char *strchr (), *strrchr (), *strtok (); +# endif + +# ifndef HAVE_MEMCPY +# define memcpy(d, s, n) bcopy((s), (d), (n)) +# endif +#endif /* not STDC_HEADERS */ + +#if HAVE_ERRNO_H +# include +#endif + +#ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +#endif +#ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif + +#ifdef HAVE_MEMSET +# define memzero(ptr, size) memset((void *)(ptr), 0, (size)) +#else +# define memzero(ptr, size) bzero((char *)(ptr), (size)) +#endif +#define strzero(s) memzero(s, strlen(s)) /* warning: evaluates twice */ + +#ifdef HAVE_DIRENT_H /* DIR_SYSV */ +# define DIRECT dirent +#else +# define DIRECT direct +#endif + +/* + * Possible cases: + * - /usr/include/shadow.h exists and includes the shadow group stuff. + * - /usr/include/shadow.h exists, but we use our own gshadow.h. + * - /usr/include/shadow.h doesn't exist, use our own shadow.h and gshadow.h. + */ +#if HAVE_SHADOW_H +#include +#if defined(SHADOWGRP) && !defined(GSHADOW) +#include "gshadow_.h" +#endif +#else /* not HAVE_SHADOW_H */ +#include "shadow_.h" +#ifdef SHADOWGRP +#include "gshadow_.h" +#endif +#endif /* not HAVE_SHADOW_H */ + +#ifndef NGROUPS_MAX +#ifdef NGROUPS +#define NGROUPS_MAX NGROUPS +#else +#define NGROUPS_MAX 64 +#endif +#endif + +#ifdef USE_SYSLOG +#include + +#ifndef LOG_WARN +#define LOG_WARN LOG_WARNING +#endif + +/* LOG_NOWAIT is deprecated */ +#ifndef LOG_NOWAIT +#define LOG_NOWAIT 0 +#endif + +/* LOG_AUTH is deprecated, use LOG_AUTHPRIV instead */ +#ifndef LOG_AUTHPRIV +#define LOG_AUTHPRIV LOG_AUTH +#endif + +/* cleaner than lots of #ifdefs everywhere - use this as follows: + SYSLOG((LOG_CRIT, "user %s cracked root", user)); */ +#if ENABLE_NLS +/* Temporarily set LC_TIME to "C" to avoid strange dates in syslog. + This is a workaround for a more general syslog(d) design problem - + syslogd should log the current system time for each event, and not + trust the formatted time received from the unix domain (or worse, + UDP) socket. -MM */ +#define SYSLOG(x) \ + do { \ + char *saved_locale = setlocale(LC_ALL, NULL); \ + if (saved_locale) \ + saved_locale = strdup(saved_locale); \ + if (saved_locale) \ + setlocale(LC_TIME, "C"); \ + syslog x ; \ + if (saved_locale) { \ + setlocale(LC_ALL, saved_locale); \ + free(saved_locale); \ + } \ + } while (0) +#else /* !ENABLE_NLS */ +#define SYSLOG(x) syslog x +#endif /* !ENABLE_NLS */ + +#else /* !USE_SYSLOG */ + +#define SYSLOG(x) /* empty */ +#define openlog(a,b,c) /* empty */ +#define closelog() /* empty */ + +#endif /* !USE_SYSLOG */ + +/* The default syslog settings can now be changed here, + in just one place. */ + +#ifndef SYSLOG_OPTIONS +/* #define SYSLOG_OPTIONS (LOG_PID | LOG_CONS | LOG_NOWAIT) */ +#define SYSLOG_OPTIONS (LOG_PID) +#endif + +#ifndef SYSLOG_FACILITY +#define SYSLOG_FACILITY LOG_AUTHPRIV +#endif + +#define OPENLOG(progname) openlog(progname, SYSLOG_OPTIONS, SYSLOG_FACILITY) + +#ifdef STAT_MACROS_BROKEN +# define S_ISDIR(x) ((x) & S_IFMT) == S_IFDIR) +# define S_ISREG(x) ((x) & S_IFMT) == S_IFREG) +# ifdef S_IFLNK +# define S_ISLNK(x) ((x) & S_IFMT) == S_IFLNK) +# endif +#endif + +#ifndef S_ISLNK +#define S_ISLNK(x) (0) +#endif + +#if HAVE_LCHOWN +#define LCHOWN lchown +#else +#define LCHOWN chown +#endif + +#if HAVE_LSTAT +#define LSTAT lstat +#else +#define LSTAT stat +#endif + +#if HAVE_TERMIOS_H +# include +# define STTY(fd, termio) tcsetattr(fd, TCSANOW, termio) +# define GTTY(fd, termio) tcgetattr(fd, termio) +# define TERMIO struct termios +# define USE_TERMIOS +#else /* assumed HAVE_TERMIO_H */ +# include +# include +# define STTY(fd, termio) ioctl(fd, TCSETA, termio) +# define GTTY(fd, termio) ioctl(fd, TCGETA, termio) +# define TEMRIO struct termio +# define USE_TERMIO +#endif + +/* + * Password aging constants + * + * DAY - seconds / day + * WEEK - seconds / week + * SCALE - seconds / aging unit + */ + +/* Solaris defines this in shadow.h */ +#ifndef DAY +#define DAY (24L*3600L) +#endif + +#define WEEK (7*DAY) + +#ifdef ITI_AGING +#define SCALE 1 +#else +#define SCALE DAY +#endif + +/* Copy string pointed by B to array A with size checking. It was originally + in lmain.c but is _very_ useful elsewhere. Some setuid root programs with + very sloppy coding used to assume that BUFSIZ will always be enough... */ + + /* danger - side effects */ +#define STRFCPY(A,B) \ + (strncpy((A), (B), sizeof(A) - 1), (A)[sizeof(A) - 1] = '\0') + +/* get rid of a few ugly repeated #ifdefs in pwent.c and grent.c */ +/* XXX - this is ugly too, configure should test it and not check for + any hardcoded system names, if possible. --marekm */ +#if defined(AIX) || defined(__linux__) +#define SETXXENT_TYPE void +#define SETXXENT_RET(x) return +#define SETXXENT_TEST(x) x; if (0) /* compiler should optimize this away */ +#else +#define SETXXENT_TYPE int +#define SETXXENT_RET(x) return(x) +#define SETXXENT_TEST(x) if (x) +#endif + +#ifndef PASSWD_FILE +#define PASSWD_FILE "/etc/passwd" +#endif + +#ifndef GROUP_FILE +#define GROUP_FILE "/etc/group" +#endif + +#ifndef SHADOW_FILE +#define SHADOW_FILE "/etc/shadow" +#endif + +#ifdef SHADOWGRP +#ifndef SGROUP_FILE +#define SGROUP_FILE "/etc/gshadow" +#endif +#endif + +#define PASSWD_PAG_FILE PASSWD_FILE ".pag" +#define GROUP_PAG_FILE GROUP_FILE ".pag" +#define SHADOW_PAG_FILE SHADOW_FILE ".pag" +#define SGROUP_PAG_FILE SGROUP_FILE ".pag" + +#ifndef NULL +#define NULL ((void *) 0) +#endif + +#ifdef sun /* hacks for compiling on SunOS */ +# ifndef SOLARIS +extern int fputs (); +extern char *strdup (); +extern char *strerror (); +# endif +#endif + +#ifndef HAVE_SNPRINTF +#include "snprintf.h" +#endif + +/* + * string to use for the pw_passwd field in /etc/passwd when using + * shadow passwords - most systems use "x" but there are a few + * exceptions, so it can be changed here if necessary. --marekm + */ +#ifndef SHADOW_PASSWD_STRING +#define SHADOW_PASSWD_STRING "x" +#endif + +#ifdef WITH_AUDIT +#ifdef __u8 /* in case we use pam < 0.80 */ +#undef __u8 +#endif +#ifdef __u32 +#undef __u32 +#endif + +#include +#endif + +#endif /* _DEFINES_H_ */ diff --git a/rpm-5.4.9/lua/shadow/faillog.h b/rpm-5.4.9/lua/shadow/faillog.h new file mode 100644 index 0000000..faf67aa --- /dev/null +++ b/rpm-5.4.9/lua/shadow/faillog.h @@ -0,0 +1,61 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* + * Copyright 1989 - 1994, Julianne Frances Haugh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Julianne F. Haugh nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * faillog.h - login failure logging file format + * + * $Id: faillog.h,v 1.1 2008/08/17 18:31:35 jbj Exp $ + * + * The login failure file is maintained by login(1) and faillog(8) + * Each record in the file represents a separate UID and the file + * is indexed in that fashion. + */ + +#ifndef _FAILLOG_H +#define _FAILLOG_H + +struct faillog { + short fail_cnt; /* failures since last success */ + short fail_max; /* failures before turning account off */ + char fail_line[12]; /* last failure occured here */ + time_t fail_time; /* last failure occured then */ + /* + * If nonzero, the account will be re-enabled if there are no + * failures for fail_locktime seconds since last failure. + */ + long fail_locktime; +}; + +#endif diff --git a/rpm-5.4.9/lua/shadow/fputsx.c b/rpm-5.4.9/lua/shadow/fputsx.c new file mode 100644 index 0000000..c4a81e5 --- /dev/null +++ b/rpm-5.4.9/lua/shadow/fputsx.c @@ -0,0 +1,86 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* + * Copyright 1990 - 1994, Julianne Frances Haugh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Julianne F. Haugh nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "system.h" +#include "shadow_config.h" +#include "defines.h" +#include "prototypes.h" + +#include + +#ident "$Id: fputsx.c,v 1.3 2008/08/18 19:16:10 jbj Exp $" + + +char *fgetsx (char *buf, int cnt, FILE * f) +{ + char *cp = buf; + char *ep; + + while (cnt > 0) { + if (fgets (cp, cnt, f) == 0) { + if (cp == buf) + return 0; + else + break; + } + if ((ep = strrchr (cp, '\\')) && *(ep + 1) == '\n') { + if ((cnt -= ep - cp) > 0) + *(cp = ep) = '\0'; + } else + break; + } + return buf; +} + +int fputsx (const char *s, FILE * stream) +{ + int i; + + for (i = 0; *s; i++, s++) { + if (putc (*s, stream) == EOF) + return EOF; + +#if 0 /* The standard getgr*() can't handle that. --marekm */ + if (i > (BUFSIZ / 2)) { + if (putc ('\\', stream) == EOF || + putc ('\n', stream) == EOF) + return EOF; + + i = 0; + } +#endif + } + return 0; +} diff --git a/rpm-5.4.9/lua/shadow/getdef.c b/rpm-5.4.9/lua/shadow/getdef.c new file mode 100644 index 0000000..1b348dc --- /dev/null +++ b/rpm-5.4.9/lua/shadow/getdef.c @@ -0,0 +1,420 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* + * Copyright 1991 - 1994, Julianne Frances Haugh and Chip Rosenthal + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Julianne F. Haugh nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "system.h" +#include "shadow_config.h" + +#ident "$Id: getdef.c,v 1.2 2008/08/18 17:27:43 jbj Exp $" + +#include "prototypes.h" +#include "defines.h" +#include +#include +#include +#include "getdef.h" +/* + * A configuration item definition. + */ +struct itemdef { + const char *name; /* name of the item */ + char *value; /* value given, or NULL if no value */ +}; + +#define NUMDEFS (sizeof(def_table)/sizeof(def_table[0])) +static struct itemdef def_table[] = { + {"CHFN_RESTRICT", NULL}, + {"CONSOLE_GROUPS", NULL}, + {"CONSOLE", NULL}, + {"CREATE_HOME", NULL}, + {"DEFAULT_HOME", NULL}, + {"ENV_PATH", NULL}, + {"ENV_SUPATH", NULL}, + {"ERASECHAR", NULL}, + {"FAIL_DELAY", NULL}, + {"FAKE_SHELL", NULL}, + {"GID_MAX", NULL}, + {"GID_MIN", NULL}, + {"HUSHLOGIN_FILE", NULL}, + {"KILLCHAR", NULL}, + {"LOGIN_RETRIES", NULL}, + {"LOGIN_TIMEOUT", NULL}, + {"LOG_OK_LOGINS", NULL}, + {"LOG_UNKFAIL_ENAB", NULL}, + {"MAIL_DIR", NULL}, + {"MAIL_FILE", NULL}, + {"PASS_MAX_DAYS", NULL}, + {"PASS_MIN_DAYS", NULL}, + {"PASS_WARN_AGE", NULL}, + {"SULOG_FILE", NULL}, + {"SU_NAME", NULL}, + {"TTYGROUP", NULL}, + {"TTYPERM", NULL}, + {"TTYTYPE_FILE", NULL}, + {"UID_MAX", NULL}, + {"UID_MIN", NULL}, + {"UMASK", NULL}, + {"USERDEL_CMD", NULL}, + {"USERGROUPS_ENAB", NULL}, +#ifndef USE_PAM + {"CHFN_AUTH", NULL}, + {"CHSH_AUTH", NULL}, + {"CRACKLIB_DICTPATH", NULL}, + {"ENV_HZ", NULL}, + {"ENVIRON_FILE", NULL}, + {"ENV_TZ", NULL}, + {"FAILLOG_ENAB", NULL}, + {"FTMP_FILE", NULL}, + {"ISSUE_FILE", NULL}, + {"LASTLOG_ENAB", NULL}, + {"LOGIN_STRING", NULL}, + {"MAIL_CHECK_ENAB", NULL}, + {"MD5_CRYPT_ENAB", NULL}, + {"MOTD_FILE", NULL}, + {"NOLOGINS_FILE", NULL}, + {"OBSCURE_CHECKS_ENAB", NULL}, + {"PASS_ALWAYS_WARN", NULL}, + {"PASS_CHANGE_TRIES", NULL}, + {"PASS_MAX_LEN", NULL}, + {"PASS_MIN_LEN", NULL}, + {"PORTTIME_CHECKS_ENAB", NULL}, + {"QUOTAS_ENAB", NULL}, + {"SU_WHEEL_ONLY", NULL}, + {"ULIMIT", NULL}, +#endif +#ifdef USE_SYSLOG + {"SYSLOG_SG_ENAB", NULL}, + {"SYSLOG_SU_ENAB", NULL}, +#endif + {NULL, NULL} +}; + +#ifndef LOGINDEFS +#define LOGINDEFS "/etc/login.defs" +#endif + +static char def_fname[] = LOGINDEFS; /* login config defs file */ +static int def_loaded = 0; /* are defs already loaded? */ + +/* local function prototypes */ +static struct itemdef *def_find (const char *); +static void def_load (void); + + +/* + * getdef_str - get string value from table of definitions. + * + * Return point to static data for specified item, or NULL if item is not + * defined. First time invoked, will load definitions from the file. + */ + +char *getdef_str (const char *item) +{ + struct itemdef *d; + + if (!def_loaded) + def_load (); + + if (!def_loaded) return NULL; + + return ((d = def_find (item)) == NULL ? (char *) NULL : d->value); +} + + +/* + * getdef_bool - get boolean value from table of definitions. + * + * Return TRUE if specified item is defined as "yes", else FALSE. + */ + +int getdef_bool (const char *item) +{ + struct itemdef *d; + + if (!def_loaded) + def_load (); + + if (!def_loaded) return 0; + + if ((d = def_find (item)) == NULL || d->value == NULL) + return 0; + + return (strcasecmp (d->value, "yes") == 0); +} + + +/* + * getdef_num - get numerical value from table of definitions + * + * Returns numeric value of specified item, else the "dflt" value if + * the item is not defined. Octal (leading "0") and hex (leading "0x") + * values are handled. + */ + +int getdef_num (const char *item, int dflt) +{ + struct itemdef *d; + + if (!def_loaded) + def_load (); + + if (!def_loaded) return dflt; + + if ((d = def_find (item)) == NULL || d->value == NULL) + return dflt; + + return (int) strtol (d->value, (char **) NULL, 0); +} + + +/* + * getdef_unum - get unsigned numerical value from table of definitions + * + * Returns numeric value of specified item, else the "dflt" value if + * the item is not defined. Octal (leading "0") and hex (leading "0x") + * values are handled. + */ + +unsigned int getdef_unum (const char *item, unsigned int dflt) +{ + struct itemdef *d; + + if (!def_loaded) + def_load (); + + if (!def_loaded) return dflt; + + if ((d = def_find (item)) == NULL || d->value == NULL) + return dflt; + + return (unsigned int) strtoul (d->value, (char **) NULL, 0); +} + + +/* + * getdef_long - get long integer value from table of definitions + * + * Returns numeric value of specified item, else the "dflt" value if + * the item is not defined. Octal (leading "0") and hex (leading "0x") + * values are handled. + */ + +long getdef_long (const char *item, long dflt) +{ + struct itemdef *d; + + if (!def_loaded) + def_load (); + + if (!def_loaded) return dflt; + + if ((d = def_find (item)) == NULL || d->value == NULL) + return dflt; + + return strtol (d->value, (char **) NULL, 0); +} + + +/* + * putdef_str - override the value read from /etc/login.defs + * (also used when loading the initial defaults) + */ + +int putdef_str (const char *name, const char *value) +{ + struct itemdef *d; + char *cp; + + if (!def_loaded) + def_load (); + + if (!def_loaded) return -1; + + /* + * Locate the slot to save the value. If this parameter + * is unknown then "def_find" will print an err message. + */ + if ((d = def_find (name)) == NULL) + return -1; + + /* + * Save off the value. + */ + if ((cp = strdup (value)) == NULL) { + fprintf (stderr, + _("Could not allocate space for config info.\n")); + SYSLOG ((LOG_ERR, "could not allocate space for config info")); + return -1; + } + + if (d->value) + free (d->value); + + d->value = cp; + return 0; +} + + +/* + * def_find - locate named item in table + * + * Search through a table of configurable items to locate the + * specified configuration option. + */ + +static struct itemdef *def_find (const char *name) +{ + int n; + struct itemdef *ptr; + + + /* + * Search into the table. + */ + + for (ptr = def_table; ptr->name; ptr++) { + if (!(n = strcmp (ptr->name, name))) + return ptr; + } + + /* + * Item was never found. + */ + + fprintf (stderr, + _ + ("configuration error - unknown item '%s' (notify administrator)\n"), + name); + SYSLOG ((LOG_CRIT, "unknown configuration item `%s'", name)); + return (struct itemdef *) NULL; +} + +/* + * def_load - load configuration table + * + * Loads the user-configured options from the default configuration file + */ + +static void def_load (void) +{ + int i; + FILE *fp; + char buf[1024], *name, *value, *s; + + /* + * Open the configuration definitions file. + */ + if ((fp = fopen (def_fname, "r")) == NULL) { + SYSLOG ((LOG_CRIT, "cannot open login definitions %s [%m]", + def_fname)); + def_loaded = 0; /* redundant */ + return; + } + + /* + * Set the initialized flag. + * (do it early to prevent recursion in putdef_str()) + */ + ++def_loaded; + + /* + * Go through all of the lines in the file. + */ + while (fgets (buf, sizeof (buf), fp) != NULL) { + + /* + * Trim trailing whitespace. + */ + for (i = strlen (buf) - 1; i >= 0; --i) { + if (!isspace (buf[i])) + break; + } + buf[++i] = '\0'; + + /* + * Break the line into two fields. + */ + name = buf + strspn (buf, " \t"); /* first nonwhite */ + if (*name == '\0' || *name == '#') + continue; /* comment or empty */ + + s = name + strcspn (name, " \t"); /* end of field */ + if (*s == '\0') + continue; /* only 1 field?? */ + + *s++ = '\0'; + value = s + strspn (s, " \"\t"); /* next nonwhite */ + *(value + strcspn (value, "\"")) = '\0'; + + /* + * Store the value in def_table. + */ + putdef_str (name, value); + } + + if (ferror (fp)) { + SYSLOG ((LOG_CRIT, "cannot read login definitions %s [%m]", + def_fname)); + def_loaded = 0; + } + + (void) fclose (fp); +} + + +#ifdef CKDEFS +int main (int argc, char **argv) +{ + int i; + char *cp; + struct itemdef *d; + + def_load (); + + for (i = 0; i < NUMDEFS; ++i) { + if ((d = def_find (def_table[i].name)) == NULL) + printf ("error - lookup '%s' failed\n", + def_table[i].name); + else + printf ("%4d %-24s %s\n", i + 1, d->name, d->value); + } + for (i = 1; i < argc; i++) { + if ((cp = getdef_str (argv[1])) != NULL) + printf ("%s `%s'\n", argv[1], cp); + else + printf ("%s not found\n", argv[1]); + } + exit (0); +} +#endif diff --git a/rpm-5.4.9/lua/shadow/getdef.h b/rpm-5.4.9/lua/shadow/getdef.h new file mode 100644 index 0000000..0397070 --- /dev/null +++ b/rpm-5.4.9/lua/shadow/getdef.h @@ -0,0 +1,21 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +#ifndef _GETDEF_H +#define _GETDEF_H + +/* getdef.c */ +extern int getdef_bool (const char *); +extern long getdef_long (const char *, long); +extern int getdef_num (const char *, int); +extern unsigned int getdef_unum (const char *, unsigned int); +extern char *getdef_str (const char *); +extern int putdef_str (const char *, const char *); + +/* default UMASK value if not specified in /etc/login.defs */ +#define GETDEF_DEFAULT_UMASK 022 + +#endif /* _GETDEF_H */ diff --git a/rpm-5.4.9/lua/shadow/groupadd.c b/rpm-5.4.9/lua/shadow/groupadd.c new file mode 100644 index 0000000..7a9aca1 --- /dev/null +++ b/rpm-5.4.9/lua/shadow/groupadd.c @@ -0,0 +1,651 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* + * Copyright 1991 - 1993, Julianne Frances Haugh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Julianne F. Haugh nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "system.h" +#include "shadow_config.h" + +#ident "$Id: groupadd.c,v 1.7 2010/10/18 16:29:16 jbj Exp $" + +#include +#include +#include +#include +#include +#include +#include +#ifdef USE_PAM +#include "pam_defs.h" +#include +#endif /* USE_PAM */ +#include "chkname.h" +#include "defines.h" +#include "getdef.h" +#include "groupio.h" +#include "nscd.h" +#include "prototypes.h" +#ifdef SHADOWGRP +#include "sgroupio.h" +static int is_shadow_grp; +#endif + +/* + * exit status values + */ +#define E_SUCCESS 0 /* success */ +#define E_USAGE 2 /* invalid command syntax */ +#define E_BAD_ARG 3 /* invalid argument to option */ +#define E_GID_IN_USE 4 /* gid not unique (when -o not used) */ +#define E_NAME_IN_USE 9 /* group name not unique */ +#define E_GRP_UPDATE 10 /* can't update group file */ + +#define NO_GETGRENT 1 + +/* + * Global variables + */ + +static jmp_buf lclack; /* longjmp() instead of exit()'ing in local functions! */ + +extern char *optarg; +extern int optind; + +static char *group_name; +static gid_t group_id; +static char *empty_list = NULL; + +static char *Prog = "rpm:lua:wrs.groupadd"; + +static int oflg = 0; /* permit non-unique group ID to be specified with -g */ +static int gflg = 0; /* ID value for the new group */ +static int fflg = 0; /* if group already exists, do nothing and exit(0) */ +static int rflg = 0; /* for adding system accounts (Red Hat) */ + +/* local function prototypes */ +static void usage (void); +static void new_grent (struct group *); + +#ifdef SHADOWGRP +static void new_sgent (struct sgrp *); +#endif +static void grp_update (void); +static void find_new_gid (void); +static void check_new_name (void); +static void close_files (void); +static void open_files (void); +static void fail_exit (int); +static gid_t get_gid (const char *gidstr); + +/* + * usage - display usage message and exit + */ +static void usage (void) +{ + fprintf (stderr, _("Usage: groupadd [options] group\n" + "\n" + "Options:\n" + " -f, --force force exit with success status if the specified\n" + " group already exists\n" + " -r, create system account\n" + " -g, --gid GID use GID for the new group\n" + " -h, --help display this help message and exit\n" + " -K, --key KEY=VALUE overrides /etc/login.defs defaults\n" + " -o, --non-unique allow create group with duplicate\n" + " (non-unique) GID\n" + "\n")); + fail_exit (E_USAGE); +} + +/* + * new_grent - initialize the values in a group file entry + * + * new_grent() takes all of the values that have been entered and fills + * in a (struct group) with them. + */ +static void new_grent (struct group *grent) +{ + memzero (grent, sizeof *grent); + grent->gr_name = group_name; + grent->gr_passwd = SHADOW_PASSWD_STRING; /* XXX warning: const */ + grent->gr_gid = group_id; + grent->gr_mem = &empty_list; +} + +#ifdef SHADOWGRP +/* + * new_sgent - initialize the values in a shadow group file entry + * + * new_sgent() takes all of the values that have been entered and fills + * in a (struct sgrp) with them. + */ +static void new_sgent (struct sgrp *sgent) +{ + memzero (sgent, sizeof *sgent); + sgent->sg_name = group_name; + sgent->sg_passwd = "!"; /* XXX warning: const */ + sgent->sg_adm = &empty_list; + sgent->sg_mem = &empty_list; +} +#endif /* SHADOWGRP */ + +/* + * grp_update - add new group file entries + * + * grp_update() writes the new records to the group files. + */ +static void grp_update (void) +{ + struct group grp; + +#ifdef SHADOWGRP + struct sgrp sgrp; +#endif /* SHADOWGRP */ + + /* + * Create the initial entries for this new group. + */ + new_grent (&grp); +#ifdef SHADOWGRP + new_sgent (&sgrp); +#endif /* SHADOWGRP */ + + /* + * Write out the new group file entry. + */ + if (!gr_update (&grp)) { + fprintf (stderr, _("%s: error adding new group entry\n"), Prog); + fail_exit (E_GRP_UPDATE); + } +#ifdef SHADOWGRP + /* + * Write out the new shadow group entries as well. + */ + if (is_shadow_grp && !sgr_update (&sgrp)) { + fprintf (stderr, _("%s: error adding new group entry\n"), Prog); + fail_exit (E_GRP_UPDATE); + } +#endif /* SHADOWGRP */ +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "adding group", group_name, + group_id, 1); +#endif + SYSLOG ((LOG_INFO, "new group: name=%s, GID=%u", + group_name, (unsigned int) group_id)); +} + +/* + * find_new_gid - find the next available GID + * + * find_new_gid() locates the next highest unused GID in the group + * file, or checks the given group ID against the existing ones for + * uniqueness. + */ +static void find_new_gid (void) +{ + const struct group *grp; + gid_t gid_min, gid_max; + +#if 1 + if (!rflg) { + gid_min = 500; + gid_max = 60000; + } else { + gid_min = 1; + gid_max = 499; + } +#else + if (!rflg) { + gid_min = getdef_unum ("GID_MIN", 500); + gid_max = getdef_unum ("GID_MAX", 60000); + } else { + gid_min = 1; + gid_max = getdef_unum ("GID_MIN", 500) - 1; + } +#endif + /* + * Start with some GID value if the user didn't provide us with + * one already. + */ + + if (!gflg) + group_id = gid_min; + +#if 0 /* defeat the file search!! */ + return; +#endif + + /* + * Search the entire group file, either looking for this GID (if the + * user specified one with -g) or looking for the largest unused + * value. + */ +#ifdef NO_GETGRENT + gr_rewind (); + while ((grp = gr_next ())) { +#else + setgrent (); + while ((grp = getgrent ())) { +#endif + printf("Comparing to %s (%d)\n", grp->gr_name, grp->gr_gid); + + if (strcmp (group_name, grp->gr_name) == 0) { + if (fflg) { + fail_exit (E_SUCCESS); /* This should not be possible!! */ + } + fprintf (stderr, _("%s: name %s is not unique\n"), + Prog, group_name); + fail_exit (E_NAME_IN_USE); + } + if (gflg && group_id == grp->gr_gid) { + if (fflg) { + /* turn off -g and search again */ + gflg = 0; +#ifdef NO_GETGRENT + gr_rewind (); +#else + setgrent (); +#endif + continue; + } + fprintf (stderr, _("%s: GID %u is not unique\n"), + Prog, (unsigned int) group_id); + fail_exit (E_GID_IN_USE); + } + if (!gflg && grp->gr_gid >= group_id) { + if (grp->gr_gid > gid_max) + continue; + group_id = grp->gr_gid + 1; + } + } + if (!gflg && group_id == gid_max + 1) { + for (group_id = gid_min; group_id < gid_max; group_id++) { +#ifdef NO_GETGRENT + gr_rewind (); + while ((grp = gr_next ()) + && grp->gr_gid != group_id); + if (!grp) + break; +#else + if (!getgrgid (group_id)) + break; +#endif + } + if (group_id == gid_max) { + fprintf (stderr, _("%s: can't get unique GID\n"), Prog); + fail_exit (E_GID_IN_USE); + } + } +} + +/* + * check_new_name - check the new name for validity + * + * check_new_name() insures that the new name doesn't contain any + * illegal characters. + */ +static void check_new_name (void) +{ +#if 0 /* skip this check, for now */ + if (check_group_name (group_name)) +#endif + return; + + /* + * All invalid group names land here. + */ + + fprintf (stderr, _("%s: %s is not a valid group name\n"), + Prog, group_name); + + fail_exit (E_BAD_ARG); +} + +/* + * close_files - close all of the files that were opened + * + * close_files() closes all of the files that were opened for this new + * group. This causes any modified entries to be written out. + */ +static void close_files (void) +{ + if (!gr_close ()) { + fprintf (stderr, _("%s: cannot rewrite group file\n"), Prog); + fail_exit (E_GRP_UPDATE); + } + gr_unlock (); +#ifdef SHADOWGRP + if (is_shadow_grp && !sgr_close ()) { + fprintf (stderr, + _("%s: cannot rewrite shadow group file\n"), Prog); + fail_exit (E_GRP_UPDATE); + } + if (is_shadow_grp) + sgr_unlock (); +#endif /* SHADOWGRP */ +} + +/* + * open_files - lock and open the group files + * + * open_files() opens the two group files. + */ +static void open_files (void) +{ + if (!gr_lock ()) { + fprintf (stderr, _("%s: unable to lock group file\n"), Prog); +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "locking group file", + group_name, -1, 0); +#endif + fail_exit (E_GRP_UPDATE); + } + if (!gr_open (O_RDWR)) { + fprintf (stderr, _("%s: unable to open group file\n"), Prog); +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "opening group file", + group_name, -1, 0); +#endif + fail_exit (E_GRP_UPDATE); + } +#ifdef SHADOWGRP + if (is_shadow_grp && !sgr_lock ()) { + fprintf (stderr, + _("%s: unable to lock shadow group file\n"), Prog); + fail_exit (E_GRP_UPDATE); + } + if (is_shadow_grp && !sgr_open (O_RDWR)) { + fprintf (stderr, + _("%s: unable to open shadow group file\n"), Prog); + fail_exit (E_GRP_UPDATE); + } +#endif /* SHADOWGRP */ +} + +/* + * fail_exit - exit with an error code after unlocking files + */ +static void fail_exit (int code) +{ + (void) gr_unlock (); +#ifdef SHADOWGRP + if (is_shadow_grp) + sgr_unlock (); +#endif + if (code != E_SUCCESS) +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "adding group", + group_name, -1, 0); +#endif + longjmp(lclack,code); +} + +/* + * get_id - validate and get group ID + */ +static gid_t get_gid (const char *gidstr) +{ + long val; + char *errptr; + + val = strtol (gidstr, &errptr, 10); + if (*errptr || errno == ERANGE || val < 0) { + fprintf (stderr, _("%s: invalid numeric argument '%s'\n"), Prog, + gidstr); + fail_exit (E_BAD_ARG); + } + return val; +} + +/* + * main - groupadd command + */ + +int groupadd_main (int argc, char **argv); +int groupadd_main (int argc, char **argv) +{ + struct stat s; + int retval; +#ifdef USE_PAM + pam_handle_t *pamh = NULL; + struct passwd *pampw; +#endif + +/* init various things in case we are called more than once */ + + empty_list = NULL; + + oflg = 0; + gflg = 0; + fflg = 0; + rflg = 0; + + optind = 0; + + +#ifdef WITH_AUDIT + audit_help_open (); +#endif + /* + * Get my name so that I can use it to report errors. + */ +#if 0 + Prog = Basename (argv[0]); + + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + OPENLOG ("groupadd"); +#endif + + /* field all lower level errors and exit */ + + if (setjmp(lclack) != 0) return -1; + + { + /* + * Parse the command line options. + */ + char *cp; + int option_index = 0; + int c; + static struct option long_options[] = { + {"force", no_argument, NULL, 'f'}, + {"gid", required_argument, NULL, 'g'}, + {"help", no_argument, NULL, 'h'}, + {"key", required_argument, NULL, 'K'}, + {"non-unique", required_argument, NULL, 'o'}, + {NULL, 0, NULL, '\0'} + }; + + while ((c = + getopt_long (argc, argv, "frg:hK:o", long_options, + &option_index)) != -1) { + switch (c) { + case 'f': + /* + * "force" - do nothing, just exit(0), if the + * specified group already exists. With -g, if + * specified gid already exists, choose another + * (unique) gid (turn off -g). Based on the RedHat's + * patch from shadow-utils-970616-9. + */ + fflg++; + break; + case 'r': + /* + * create a system group + */ + rflg++; + break; + case 'g': + gflg++; + group_id = get_gid (optarg); + break; + case 'h': + usage (); + break; + case 'K': + /* + * override login.defs defaults (-K name=value) + * example: -K GID_MIN=100 -K GID_MAX=499 + * note: -K GID_MIN=10,GID_MAX=499 doesn't work yet + */ + cp = strchr (optarg, '='); + if (!cp) { + fprintf (stderr, + _ + ("%s: -K requires KEY=VALUE\n"), + Prog); + return (E_BAD_ARG); + } + /* terminate name, point to value */ + *cp++ = '\0'; +#if 0 /* no login.defs changin' */ + if (putdef_str (optarg, cp) < 0) + return (E_BAD_ARG); +#endif + break; + case 'o': + oflg++; + break; + default: + usage (); + } + } + } + + if (oflg && !gflg) + usage (); + + if (optind != argc - 1) + usage (); + + group_name = argv[argc - 1]; + check_new_name (); + +#ifdef USE_PAM + retval = PAM_SUCCESS; + + pampw = getpwuid (getuid ()); + if (pampw == NULL) { + retval = PAM_USER_UNKNOWN; + } + + if (retval == PAM_SUCCESS) { + retval = pam_start ("groupadd", pampw->pw_name, &conv, &pamh); + } + + if (retval == PAM_SUCCESS) { + retval = pam_authenticate (pamh, 0); + if (retval != PAM_SUCCESS) { + pam_end (pamh, retval); + } + } + + if (retval == PAM_SUCCESS) { + retval = pam_acct_mgmt (pamh, 0); + if (retval != PAM_SUCCESS) { + pam_end (pamh, retval); + } + } + + if (retval != PAM_SUCCESS) { + fprintf (stderr, _("%s: PAM authentication failed\n"), Prog); + fail_exit (1); + } +#endif /* USE_PAM */ + + if (stat("/etc/gtmp", &s) == 0) { + fputs("vigr lockfile (/etc/gtmp) is present.\n", stderr); + fail_exit(1); + } + +#ifdef SHADOWGRP + is_shadow_grp = sgr_file_present (); +#endif + + /* + * Start with a quick check to see if the group exists. + */ + if (getgrnam (group_name)) { + if (fflg) { + return (E_SUCCESS); + } +#if 0 /* wrs - suppress this warning */ + fprintf (stderr, _("%s: group %s exists\n"), Prog, group_name); +#endif +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "adding group", + group_name, -1, 0); +#endif + fail_exit (E_NAME_IN_USE); + } + + /* + * Do the hard stuff - open the files, create the group entries, + * then close and update the files. + */ + open_files (); + + if ((retval=setjmp(lclack)) != 0) /* move longjump() target */ + { + int r; + + if ((r=setjmp(lclack)) != 0) return r; /* failed doing next line */ + close_files(); + return retval; + } + + if (!gflg || !oflg) + { + find_new_gid (); + } + + grp_update (); + +#if 0 /* no cache flushin' */ + nscd_flush_cache ("group"); + printf("Group cache flushed\n"); +#endif + + close_files (); + +#ifdef USE_PAM + if (retval == PAM_SUCCESS) + pam_end (pamh, PAM_SUCCESS); +#endif /* USE_PAM */ + return (E_SUCCESS); + /* NOT REACHED */ +} diff --git a/rpm-5.4.9/lua/shadow/groupio.c b/rpm-5.4.9/lua/shadow/groupio.c new file mode 100644 index 0000000..331090d --- /dev/null +++ b/rpm-5.4.9/lua/shadow/groupio.c @@ -0,0 +1,205 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + + +#include "system.h" +#include "shadow_config.h" + +#ident "$Id: groupio.c,v 1.4 2010/03/21 14:56:59 jbj Exp $" + +#include "prototypes.h" +#include "defines.h" +#include "commonio.h" +#include "groupio.h" +extern int putgrent (const struct group *, FILE *); +extern struct group *sgetgrent (const char *); + +struct group *__gr_dup (const struct group *grent) +{ + struct group *gr; + int i; + + if (!(gr = (struct group *) malloc (sizeof *gr))) + return NULL; + *gr = *grent; + if (!(gr->gr_name = strdup (grent->gr_name))) + return NULL; + if (!(gr->gr_passwd = strdup (grent->gr_passwd))) + return NULL; + + for (i = 0; grent->gr_mem[i]; i++); + gr->gr_mem = (char **) malloc ((i + 1) * sizeof (char *)); + if (!gr->gr_mem) + return NULL; + for (i = 0; grent->gr_mem[i]; i++) { + gr->gr_mem[i] = strdup (grent->gr_mem[i]); + if (!gr->gr_mem[i]) + return NULL; + } + gr->gr_mem[i] = NULL; + return gr; +} + +static void *group_dup (const void *ent) +{ + const struct group *gr = (const struct group *) ent; + + return __gr_dup (gr); +} + +static void group_free (void *ent) +{ + struct group *gr = (struct group *) ent; + + free (gr->gr_name); + free (gr->gr_passwd); + while (*(gr->gr_mem)) { + free (*(gr->gr_mem)); + gr->gr_mem++; + } + free (gr); +} + +static const char *group_getname (const void *ent) +{ + const struct group *gr = (const struct group *) ent; + + return gr->gr_name; +} + +static void *group_parse (const char *line) +{ + return (void *) sgetgrent (line); +} + +static int group_put (const void *ent, FILE * file) +{ + const struct group *gr = (const struct group *) ent; + + return (putgrent (gr, file) == -1) ? -1 : 0; +} + +static struct commonio_ops group_ops = { + group_dup, + group_free, + group_getname, + group_parse, + group_put, + fgetsx, + fputsx +}; + +static struct commonio_db group_db = { + GROUP_FILE, /* filename */ + &group_ops, /* ops */ + NULL, /* fp */ + NULL, /* head */ + NULL, /* tail */ + NULL, /* cursor */ + 0, /* changed */ + 0, /* isopen */ + 0, /* locked */ + 0 /* readonly */ +}; + +int gr_name (const char *filename) +{ + return commonio_setname (&group_db, filename); +} + +int gr_lock (void) +{ + return commonio_lock (&group_db); +} + +int gr_open (int mode) +{ + return commonio_open (&group_db, mode); +} + +const struct group *gr_locate (const char *name) +{ + return (const struct group *) commonio_locate (&group_db, name); +} + +int gr_update (const struct group *gr) +{ + return commonio_update (&group_db, (const void *) gr); +} + +int gr_remove (const char *name) +{ + return commonio_remove (&group_db, name); +} + +int gr_rewind (void) +{ + return commonio_rewind (&group_db); +} + +const struct group *gr_next (void) +{ + return (const struct group *) commonio_next (&group_db); +} + +int gr_close (void) +{ + return commonio_close (&group_db); +} + +int gr_unlock (void) +{ + return commonio_unlock (&group_db); +} + +void __gr_set_changed (void) +{ + group_db.changed = 1; +} + +struct commonio_entry *__gr_get_head (void); /* XXX gcc warning. */ +struct commonio_entry *__gr_get_head (void) +{ + return group_db.head; +} + +struct commonio_db *__gr_get_db (void); /* XXX gcc warning. */ +struct commonio_db *__gr_get_db (void) +{ + return &group_db; +} + +void __gr_del_entry (const struct commonio_entry *ent); /* XXX gcc warning. */ +void __gr_del_entry (const struct commonio_entry *ent) +{ + commonio_del_entry (&group_db, ent); +} + +static int gr_cmp (const void *p1, const void *p2) +{ + gid_t u1, u2; + + if ((*(struct commonio_entry **) p1)->eptr == NULL) + return 1; + if ((*(struct commonio_entry **) p2)->eptr == NULL) + return -1; + + u1 = ((struct group *) (*(struct commonio_entry **) p1)->eptr)->gr_gid; + u2 = ((struct group *) (*(struct commonio_entry **) p2)->eptr)->gr_gid; + + if (u1 < u2) + return -1; + else if (u1 > u2) + return 1; + else + return 0; +} + +/* Sort entries by GID */ +int gr_sort () +{ + return commonio_sort (&group_db, gr_cmp); +} diff --git a/rpm-5.4.9/lua/shadow/groupio.h b/rpm-5.4.9/lua/shadow/groupio.h new file mode 100644 index 0000000..67b4195 --- /dev/null +++ b/rpm-5.4.9/lua/shadow/groupio.h @@ -0,0 +1,19 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +extern struct group *__gr_dup (const struct group *); +extern void __gr_set_changed (void); +extern int gr_close (void); +extern const struct group *gr_locate (const char *); +extern int gr_lock (void); +extern int gr_name (const char *); +extern const struct group *gr_next (void); +extern int gr_open (int); +extern int gr_remove (const char *); +extern int gr_rewind (void); +extern int gr_unlock (void); +extern int gr_update (const struct group *); +extern int gr_sort (void); diff --git a/rpm-5.4.9/lua/shadow/gshadow.c b/rpm-5.4.9/lua/shadow/gshadow.c new file mode 100644 index 0000000..fba2300 --- /dev/null +++ b/rpm-5.4.9/lua/shadow/gshadow.c @@ -0,0 +1,472 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* + * Copyright 1990 - 1994, Julianne Frances Haugh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Julianne F. Haugh nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "system.h" +#include "shadow_config.h" + +/* Newer versions of Linux libc already have shadow support. */ +#if defined(SHADOWGRP) && !defined(HAVE_SHADOWGRP) /*{ */ + +#ident "$Id: gshadow.c,v 1.4 2010/03/21 14:56:59 jbj Exp $" + +#include +#include "prototypes.h" +#include "defines.h" +static FILE *shadow; +static char sgrbuf[BUFSIZ * 4]; +static char **members = NULL; +static size_t nmembers = 0; +static char **admins = NULL; +static size_t nadmins = 0; +static struct sgrp sgroup; + +#define FIELDS 4 + +#ifdef USE_NIS +static int nis_used; +static int nis_ignore; +static enum { native, start, middle, native2 } nis_state; +static int nis_bound; +static char *nis_domain; +static char *nis_key; +static int nis_keylen; +static char *nis_val; +static int nis_vallen; + +#define IS_NISCHAR(c) ((c)=='+') +#endif + +#ifdef USE_NIS + +/* + * __setsgNIS - turn on or off NIS searches + */ + +void __setsgNIS (int flag) +{ + nis_ignore = !flag; + + if (nis_ignore) + nis_used = 0; +} + +/* + * bind_nis - bind to NIS server + */ + +static int bind_nis (void) +{ + if (yp_get_default_domain (&nis_domain)) + return -1; + + nis_bound = 1; + return 0; +} +#endif + +static char **list (char *s, char **list[], size_t * nlist) +{ + char **ptr = *list; + size_t nelem = *nlist, size; + + while (s != NULL && *s != '\0') { + size = (nelem + 1) * sizeof (ptr); + if ((ptr = (char **) realloc (*list, size)) != NULL) { + ptr[nelem++] = s; + *list = ptr; + *nlist = nelem; + if ((s = strchr (s, ','))) + *s++ = '\0'; + } + } + size = (nelem + 1) * sizeof (ptr); + if ((ptr = (char **) realloc (*list, size)) != NULL) { + ptr[nelem] = '\0'; + *list = ptr; + } + return ptr; +} + +void setsgent (void) +{ +#ifdef USE_NIS + nis_state = native; +#endif + if (shadow) + rewind (shadow); + else + shadow = fopen (SGROUP_FILE, "r"); +} + +void endsgent (void) +{ + if (shadow) + (void) fclose (shadow); + + shadow = (FILE *) 0; +} + +struct sgrp *sgetsgent (const char *string) +{ + char *fields[FIELDS]; + char *cp; + int i; + + strncpy (sgrbuf, string, (int) sizeof sgrbuf - 1); + sgrbuf[sizeof sgrbuf - 1] = '\0'; + + if ((cp = strrchr (sgrbuf, '\n'))) + *cp = '\0'; + + /* + * There should be exactly 4 colon separated fields. Find + * all 4 of them and save the starting addresses in fields[]. + */ + + for (cp = sgrbuf, i = 0; i < FIELDS && cp; i++) { + fields[i] = cp; + if ((cp = strchr (cp, ':'))) + *cp++ = '\0'; + } + + /* + * If there was an extra field somehow, or perhaps not enough, + * the line is invalid. + */ + + if (cp || i != FIELDS) +#ifdef USE_NIS + if (!IS_NISCHAR (fields[0][0])) + return 0; + else + nis_used = 1; +#else + return 0; +#endif + + sgroup.sg_name = fields[0]; + sgroup.sg_passwd = fields[1]; + if (nadmins) { + nadmins = 0; + free (admins); + admins = NULL; + } + if (nmembers) { + nmembers = 0; + free (members); + members = NULL; + } + sgroup.sg_adm = list (fields[2], &admins, &nadmins); + sgroup.sg_mem = list (fields[3], &members, &nmembers); + + return &sgroup; +} + +/* + * fgetsgent - convert next line in stream to (struct sgrp) + * + * fgetsgent() reads the next line from the provided stream and + * converts it to a (struct sgrp). NULL is returned on EOF. + */ + +struct sgrp *fgetsgent (FILE * fp) +{ + char buf[sizeof sgrbuf]; + char *cp; + + if (!fp) + return (0); + +#ifdef USE_NIS + while (fgetsx (buf, sizeof buf, fp) != (char *) 0) +#else + if (fgetsx (buf, sizeof buf, fp) != (char *) 0) +#endif + { + if ((cp = strchr (buf, '\n'))) + *cp = '\0'; +#ifdef USE_NIS + if (nis_ignore && IS_NISCHAR (buf[0])) + continue; +#endif + return (sgetsgent (buf)); + } + return 0; +} + +/* + * getsgent - get a single shadow group entry + */ + +struct sgrp *getsgent (void) +{ +#ifdef USE_NIS + int nis_1_group = 0; + struct sgrp *val; + char buf[BUFSIZ]; +#endif + if (!shadow) + setsgent (); + +#ifdef USE_NIS + again: + /* + * See if we are reading from the local file. + */ + + if (nis_state == native || nis_state == native2) { + + /* + * Get the next entry from the shadow group file. Return + * NULL right away if there is none. + */ + + if (!(val = fgetsgent (shadow))) + return 0; + + /* + * If this entry began with a NIS escape character, we have + * to see if this is just a single group, or if the entire + * map is being asked for. + */ + + if (IS_NISCHAR (val->sg_name[0])) { + if (val->sg_name[1]) + nis_1_group = 1; + else + nis_state = start; + } + + /* + * If this isn't a NIS group and this isn't an escape to go + * use a NIS map, it must be a regular local group. + */ + + if (nis_1_group == 0 && nis_state != start) + return val; + + /* + * If this is an escape to use an NIS map, switch over to + * that bunch of code. + */ + + if (nis_state == start) + goto again; + + /* + * NEEDSWORK. Here we substitute pieces-parts of this entry. + */ + + return 0; + } else { + if (nis_bound == 0) { + if (bind_nis ()) { + nis_state = native2; + goto again; + } + } + if (nis_state == start) { + if (yp_first (nis_domain, "gshadow.byname", &nis_key, + &nis_keylen, &nis_val, &nis_vallen)) { + nis_state = native2; + goto again; + } + nis_state = middle; + } else if (nis_state == middle) { + if (yp_next (nis_domain, "gshadow.byname", nis_key, + nis_keylen, &nis_key, &nis_keylen, + &nis_val, &nis_vallen)) { + nis_state = native2; + goto again; + } + } + return sgetsgent (nis_val); + } +#else + return (fgetsgent (shadow)); +#endif +} + +/* + * getsgnam - get a shadow group entry by name + */ + +struct sgrp *getsgnam (const char *name) +{ + struct sgrp *sgrp; + +#ifdef USE_NIS + char buf[BUFSIZ]; + static char save_name[16]; + int nis_disabled = 0; +#endif + + setsgent (); + +#ifdef USE_NIS + if (nis_used) { + again: + + /* + * Search the gshadow.byname map for this group. + */ + + if (!nis_bound) + bind_nis (); + + if (nis_bound) { + char *cp; + + if (yp_match (nis_domain, "gshadow.byname", name, + strlen (name), &nis_val, + &nis_vallen) == 0) { + if (cp = strchr (nis_val, '\n')) + *cp = '\0'; + + nis_state = middle; + if (sgrp = sgetsgent (nis_val)) { + strcpy (save_name, sgrp->sg_name); + nis_key = save_name; + nis_keylen = strlen (save_name); + } + return sgrp; + } + } + nis_state = native2; + } +#endif +#ifdef USE_NIS + if (nis_used) { + nis_ignore++; + nis_disabled++; + } +#endif + while ((sgrp = getsgent ()) != (struct sgrp *) 0) { + if (strcmp (name, sgrp->sg_name) == 0) + break; + } +#ifdef USE_NIS + nis_ignore--; +#endif + if (sgrp) + return sgrp; + return (0); +} + +/* + * putsgent - output shadow group entry in text form + * + * putsgent() converts the contents of a (struct sgrp) to text and + * writes the result to the given stream. This is the logical + * opposite of fgetsgent. + */ + +int putsgent (const struct sgrp *sgrp, FILE * fp) +{ + char *buf, *cp; + int i; + size_t size; + + if (!fp || !sgrp) + return -1; + + /* calculate the required buffer size */ + size = strlen (sgrp->sg_name) + strlen (sgrp->sg_passwd) + 10; + for (i = 0; sgrp->sg_adm && sgrp->sg_adm[i]; i++) + size += strlen (sgrp->sg_adm[i]) + 1; + for (i = 0; sgrp->sg_mem && sgrp->sg_mem[i]; i++) + size += strlen (sgrp->sg_mem[i]) + 1; + + buf = (char *) malloc (size); + if (!buf) + return -1; + cp = buf; + + /* + * Copy the group name and passwd. + */ + + strcpy (cp, sgrp->sg_name); + cp += strlen (cp); + *cp++ = ':'; + + strcpy (cp, sgrp->sg_passwd); + cp += strlen (cp); + *cp++ = ':'; + + /* + * Copy the administrators, separating each from the other + * with a ",". + */ + + for (i = 0; sgrp->sg_adm[i]; i++) { + if (i > 0) + *cp++ = ','; + + strcpy (cp, sgrp->sg_adm[i]); + cp += strlen (cp); + } + *cp++ = ':'; + + /* + * Now do likewise with the group members. + */ + + for (i = 0; sgrp->sg_mem[i]; i++) { + if (i > 0) + *cp++ = ','; + + strcpy (cp, sgrp->sg_mem[i]); + cp += strlen (cp); + } + *cp++ = '\n'; + *cp = '\0'; + + /* + * Output using the function which understands the line + * continuation conventions. + */ + + if (fputsx (buf, fp) == EOF) { + free (buf); + return -1; + } + + free (buf); + return 0; +} +#else +extern int errno; /* warning: ANSI C forbids an empty source file */ +#endif /*} SHADOWGRP */ diff --git a/rpm-5.4.9/lua/shadow/gshadow_.h b/rpm-5.4.9/lua/shadow/gshadow_.h new file mode 100644 index 0000000..c9563c6 --- /dev/null +++ b/rpm-5.4.9/lua/shadow/gshadow_.h @@ -0,0 +1,77 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* + * Copyright 1988 - 1994, Julianne Frances Haugh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Julianne F. Haugh nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Id: gshadow_.h,v 1.1 2008/08/17 18:31:35 jbj Exp $ + */ + +#ifndef _H_GSHADOW +#define _H_GSHADOW + +/* + * Shadow group security file structure + */ + +struct sgrp { + char *sg_name; /* group name */ + char *sg_passwd; /* group password */ + char **sg_adm; /* group administator list */ + char **sg_mem; /* group membership list */ +}; + +/* + * Shadow group security file functions. + */ + +#include /* for FILE */ + +#if __STDC__ +struct sgrp *getsgent (void); +struct sgrp *getsgnam (const char *); +struct sgrp *sgetsgent (const char *); +struct sgrp *fgetsgent (FILE *); +void setsgent (void); +void endsgent (void); +int putsgent (const struct sgrp *, FILE *); +#else +struct sgrp *getsgent (); +struct sgrp *getsgnam (); +struct sgrp *sgetsgent (); +struct sgrp *fgetsgent (); +void setsgent (); +void endsgent (); +int putsgent (); +#endif + +#define GSHADOW "/etc/gshadow" +#endif /* ifndef _H_GSHADOW */ diff --git a/rpm-5.4.9/lua/shadow/list.c b/rpm-5.4.9/lua/shadow/list.c new file mode 100644 index 0000000..c13eae6 --- /dev/null +++ b/rpm-5.4.9/lua/shadow/list.c @@ -0,0 +1,246 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* + * Copyright 1991 - 1994, Julianne Frances Haugh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Julianne F. Haugh nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* Removed duplicated code from gpmain.c, useradd.c, userdel.c and + usermod.c. --marekm */ + +#include "system.h" +#include "shadow_config.h" + +#ident "$Id: list.c,v 1.5 2008/11/28 18:34:59 jbj Exp $" + +#include "prototypes.h" +#include "defines.h" + +#include "debug.h" + +/* + * add_list - add a member to a list of group members + * + * the array of member names is searched for the new member + * name, and if not present it is added to a freshly allocated + * list of users. + */ +char **add_list (char **list, const char *member) +{ + int i; + char **tmp; + + /* + * Scan the list for the new name. Return the original list + * pointer if it is present. + */ + + for (i = 0; list[i] != (char *) 0; i++) + if (strcmp (list[i], member) == 0) + return list; + + /* + * Allocate a new list pointer large enough to hold all the + * old entries, and the new entries as well. + */ + + tmp = (char **) malloc ((i + 2) * sizeof member); +assert(tmp != NULL); + + /* + * Copy the original list to the new list, then append the + * new member and NULL terminate the result. This new list + * is returned to the invoker. + */ + + for (i = 0; list[i] != (char *) 0; i++) + tmp[i] = list[i]; + + tmp[i] = strdup (member); +assert(tmp[i] != NULL); + i++; + tmp[i] = (char *) 0; + + return tmp; +} + +/* + * del_list - delete a member from a list of group members + * + * the array of member names is searched for the old member + * name, and if present it is deleted from a freshly allocated + * list of users. + */ + +char **del_list (char **list, const char *member) +{ + int i, j; + char **tmp; + + /* + * Scan the list for the old name. Return the original list + * pointer if it is not present. + */ + + for (i = j = 0; list[i] != (char *) 0; i++) + if (strcmp (list[i], member)) + j++; + + if (j == i) + return list; + + /* + * Allocate a new list pointer large enough to hold all the + * old entries. + */ + + tmp = (char **) malloc ((j + 1) * sizeof member); +assert(tmp != NULL); + + /* + * Copy the original list except the deleted members to the + * new list, then NULL terminate the result. This new list + * is returned to the invoker. + */ + + for (i = j = 0; list[i] != (char *) 0; i++) + if (strcmp (list[i], member)) + tmp[j++] = list[i]; + + tmp[j] = (char *) 0; + + return tmp; +} + +char **dup_list (char *const *list) +{ + int i; + char **tmp; + + for (i = 0; list[i]; i++); + + tmp = (char **) malloc ((i + 1) * sizeof (char *)); +assert(tmp != NULL); + + i = 0; + while (*list) { + tmp[i] = strdup (*list); +assert(tmp[i] != NULL); + i++; + list++; + } + + tmp[i] = (char *) 0; + return tmp; +} + +int is_on_list (char *const *list, const char *member) +{ + while (*list) { + if (strcmp (*list, member) == 0) + return 1; + list++; + } + return 0; +} + +/* + * comma_to_list - convert comma-separated list to (char *) array + */ + +char **comma_to_list (const char *comma) +{ + char *members; + char **array; + int i; + char *cp, *cp2; + + /* + * Make a copy since we are going to be modifying the list + */ + + members = strdup (comma); +assert(members != NULL); + + /* + * Count the number of commas in the list + */ + + for (cp = members, i = 0;; i++) + if ((cp2 = strchr (cp, ','))) + cp = cp2 + 1; + else + break; + + /* + * Add 2 - one for the ending NULL, the other for the last item + */ + + i += 2; + + /* + * Allocate the array we're going to store the pointers into. + */ + + array = (char **) malloc (sizeof (char *) * i); +assert(array != NULL); + + /* + * Empty list is special - 0 members, not 1 empty member. --marekm + */ + + if (!*members) { + *array = (char *) 0; + return array; + } + + /* + * Now go walk that list all over again, this time building the + * array of pointers. + */ + + for (cp = members, i = 0;; i++) { + array[i] = cp; + if ((cp2 = strchr (cp, ','))) { + *cp2++ = '\0'; + cp = cp2; + } else { + array[i + 1] = (char *) 0; + break; + } + } + + /* + * Return the new array of pointers + */ + + return array; +} diff --git a/rpm-5.4.9/lua/shadow/nscd.h b/rpm-5.4.9/lua/shadow/nscd.h new file mode 100644 index 0000000..bd8c961 --- /dev/null +++ b/rpm-5.4.9/lua/shadow/nscd.h @@ -0,0 +1,18 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* Copyright (c) 1999 SuSE GmbH Nuerenberg, Germany + Author: Thorsten Kukuk */ + +#ifndef _FAILURE_H_ +#define _FAILURE_H_ + +/* + * nscd_flush_cache - flush specyfied service bufor in nscd cache + */ +extern int nscd_flush_cache (char *service); + +#endif diff --git a/rpm-5.4.9/lua/shadow/prototypes.h b/rpm-5.4.9/lua/shadow/prototypes.h new file mode 100644 index 0000000..31d7ab2 --- /dev/null +++ b/rpm-5.4.9/lua/shadow/prototypes.h @@ -0,0 +1,190 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* + * prototypes.h + * + * Missing function prototypes + * + * Juha Virtanen, ; November 1995 + */ +/* + * $Id: prototypes.h,v 1.3 2008/08/18 19:16:10 jbj Exp $ + * + * Added a macro to work around ancient (non-ANSI) compilers, just in case + * someone ever tries to compile this with SunOS cc... --marekm + */ + +#ifndef _PROTOTYPES_H +#define _PROTOTYPES_H + +#include +#if HAVE_UTMPX_H +#include +#else +#include +#endif +#include +#include + +#include "defines.h" + +/* addgrps.c */ +extern int add_groups (const char *); +extern void add_cons_grps (void); + +/* age.c */ +extern void agecheck (const struct passwd *, const struct spwd *); +extern int expire (const struct passwd *, const struct spwd *); +extern int isexpired (const struct passwd *, const struct spwd *); + +/* basename() renamed to Basename() to avoid libc name space confusion */ +/* basename.c */ +extern char *Basename (char *str); + +/* chowndir.c */ +extern int chown_tree (const char *, uid_t, uid_t, gid_t, gid_t); + +/* chowntty.c */ +extern void chown_tty (const char *, const struct passwd *); + +/* console.c */ +extern int console (const char *); +extern int is_listed (const char *, const char *, int); + +/* copydir.c */ +extern int copy_tree (const char *, const char *, uid_t, gid_t); +extern int remove_tree (const char *); + +/* encrypt.c */ +extern char *pw_encrypt (const char *, const char *); + +/* entry.c */ +extern void pw_entry (const char *, struct passwd *); + +/* env.c */ +extern void addenv (const char *, const char *); +extern void initenv (void); +extern void set_env (int, char *const *); +extern void sanitize_env (void); + +/* fields.c */ +extern void change_field (char *, size_t, const char *); +extern int valid_field (const char *, const char *); + +/* fputsx.c */ +extern char *fgetsx (char *, int, FILE *); +extern int fputsx (const char *, FILE *); + +/* grent.c */ +extern int putgrent (const struct group *, FILE *); + +/* hushed.c */ +extern int hushed (const struct passwd *); + +/* audit_help.c */ +#ifdef WITH_AUDIT +extern int audit_fd; +extern void audit_help_open (void); +extern void audit_logger (int type, const char *pgname, const char *op, + const char *name, unsigned int id, int result); +#endif + +/* limits.c */ +extern void setup_limits (const struct passwd *); + +/* list.c */ +extern char **add_list (char **, const char *); +extern char **del_list (char **, const char *); +extern char **dup_list (char *const *); +extern int is_on_list (char *const *, const char *); +extern char **comma_to_list (const char *); + +/* login.c */ +extern void login_prompt (const char *, char *, int); + +/* mail.c */ +extern void mailcheck (void); + +/* motd.c */ +extern void motd (void); + +/* myname.c */ +extern struct passwd *get_my_pwent (void); + +/* obscure.c */ +extern int obscure (const char *, const char *, const struct passwd *); + +/* pam_pass.c */ +extern int do_pam_passwd (const char *, int, int); + +/* port.c */ +extern int isttytime (const char *, const char *, time_t); + +/* pwd2spwd.c */ +extern struct spwd *pwd_to_spwd (const struct passwd *); + +/* pwdcheck.c */ +extern void passwd_check (const char *, const char *, const char *); + +/* pwd_init.c */ +extern void pwd_init (void); + +/* rlogin.c */ +extern int do_rlogin (const char *, char *, int, char *, int); + +/* salt.c */ +extern char *crypt_make_salt (void); + +/* setugid.c */ +extern int setup_groups (const struct passwd *); +extern int change_uid (const struct passwd *); +extern int setup_uid_gid (const struct passwd *, int); + +/* setup.c */ +extern void setup (struct passwd *); + +/* setupenv.c */ +extern void setup_env (struct passwd *); + +/* sgetgrent.c */ +extern struct group *sgetgrent (const char *buf); + +/* sgetpwent.c */ +extern struct passwd *sgetpwent (const char *buf); + +/* shell.c */ +extern int shell (const char *, const char *, char *const *); + +/* strtoday.c */ +extern long strtoday (const char *); + +/* suauth.c */ +extern int check_su_auth (const char *, const char *); + +/* sulog.c */ +extern void sulog (const char *, int, const char *, const char *); + +/* sub.c */ +extern void subsystem (const struct passwd *); + +/* ttytype.c */ +extern void ttytype (const char *); + +/* tz.c */ +extern char *tz (const char *); + +/* ulimit.c */ +extern void set_filesize_limit (int); + +/* utmp.c */ +extern void checkutmp (int); +extern void setutmp (const char *, const char *, const char *); + +/* valid.c */ +extern int valid (const char *, const struct passwd *); + +#endif /* _PROTOTYPES_H */ diff --git a/rpm-5.4.9/lua/shadow/pwauth.h b/rpm-5.4.9/lua/shadow/pwauth.h new file mode 100644 index 0000000..82ffa5c --- /dev/null +++ b/rpm-5.4.9/lua/shadow/pwauth.h @@ -0,0 +1,64 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* + * Copyright 1992 - 1993, Julianne Frances Haugh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Julianne F. Haugh nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Id: pwauth.h,v 1.1 2008/08/17 18:31:36 jbj Exp $ + */ + +#ifndef USE_PAM +int pw_auth (const char *cipher, const char *user, int flag, const char *input); +#endif /* !USE_PAM */ + +/* + * Local access + */ + +#define PW_SU 1 +#define PW_LOGIN 2 + +/* + * Administrative functions + */ + +#define PW_ADD 101 +#define PW_CHANGE 102 +#define PW_DELETE 103 + +/* + * Network access + */ + +#define PW_TELNET 201 +#define PW_RLOGIN 202 +#define PW_FTP 203 +#define PW_REXEC 204 diff --git a/rpm-5.4.9/lua/shadow/pwio.c b/rpm-5.4.9/lua/shadow/pwio.c new file mode 100644 index 0000000..e245b77 --- /dev/null +++ b/rpm-5.4.9/lua/shadow/pwio.c @@ -0,0 +1,195 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + + +#include "system.h" +#include "shadow_config.h" + +#ident "$Id: pwio.c,v 1.4 2010/03/21 14:56:59 jbj Exp $" + +#include "prototypes.h" +#include "defines.h" +#include +#include +#include "commonio.h" +#include "pwio.h" +extern struct passwd *sgetpwent (const char *); +extern int putpwent (const struct passwd *, FILE *); + +struct passwd *__pw_dup (const struct passwd *pwent) +{ + struct passwd *pw; + + if (!(pw = (struct passwd *) malloc (sizeof *pw))) + return NULL; + *pw = *pwent; + if (!(pw->pw_name = strdup (pwent->pw_name))) + return NULL; + if (!(pw->pw_passwd = strdup (pwent->pw_passwd))) + return NULL; + if (!(pw->pw_gecos = strdup (pwent->pw_gecos))) + return NULL; + if (!(pw->pw_dir = strdup (pwent->pw_dir))) + return NULL; + if (!(pw->pw_shell = strdup (pwent->pw_shell))) + return NULL; + return pw; +} + +static void *passwd_dup (const void *ent) +{ + const struct passwd *pw = (const struct passwd *) ent; + + return __pw_dup (pw); +} + +static void passwd_free (void *ent) +{ + struct passwd *pw = (struct passwd *) ent; + + free (pw->pw_name); + free (pw->pw_passwd); + free (pw->pw_gecos); + free (pw->pw_dir); + free (pw->pw_shell); + free (pw); +} + +static const char *passwd_getname (const void *ent) +{ + const struct passwd *pw = (const struct passwd *) ent; + + return pw->pw_name; +} + +static void *passwd_parse (const char *line) +{ + return (void *) sgetpwent (line); +} + +static int passwd_put (const void *ent, FILE * file) +{ + const struct passwd *pw = (const struct passwd *) ent; + + return (putpwent (pw, file) == -1) ? -1 : 0; +} + +static struct commonio_ops passwd_ops = { + passwd_dup, + passwd_free, + passwd_getname, + passwd_parse, + passwd_put, + fgets, + fputs +}; + +static struct commonio_db passwd_db = { + PASSWD_FILE, /* filename */ + &passwd_ops, /* ops */ + NULL, /* fp */ + NULL, /* head */ + NULL, /* tail */ + NULL, /* cursor */ + 0, /* changed */ + 0, /* isopen */ + 0, /* locked */ + 0 /* readonly */ +}; + +int pw_name (const char *filename) +{ + return commonio_setname (&passwd_db, filename); +} + +int pw_lock (void) +{ + return commonio_lock (&passwd_db); +} + +int pw_open (int mode) +{ + return commonio_open (&passwd_db, mode); +} + +const struct passwd *pw_locate (const char *name) +{ + return (const struct passwd *) commonio_locate (&passwd_db, name); +} + +int pw_update (const struct passwd *pw) +{ + return commonio_update (&passwd_db, (const void *) pw); +} + +int pw_remove (const char *name) +{ + return commonio_remove (&passwd_db, name); +} + +int pw_rewind (void) +{ + return commonio_rewind (&passwd_db); +} + +const struct passwd *pw_next (void) +{ + return (const struct passwd *) commonio_next (&passwd_db); +} + +int pw_close (void) +{ + return commonio_close (&passwd_db); +} + +int pw_unlock (void) +{ + return commonio_unlock (&passwd_db); +} + +struct commonio_entry *__pw_get_head (void); /* XXX gcc warning */ +struct commonio_entry *__pw_get_head (void) +{ + return passwd_db.head; +} + +void __pw_del_entry (const struct commonio_entry *ent); /* XXX gcc warning */ +void __pw_del_entry (const struct commonio_entry *ent) +{ + commonio_del_entry (&passwd_db, ent); +} + +struct commonio_db *__pw_get_db (void); /* XXX gcc warning */ +struct commonio_db *__pw_get_db (void) +{ + return &passwd_db; +} + +static int pw_cmp (const void *p1, const void *p2) +{ + uid_t u1, u2; + + if ((*(struct commonio_entry **) p1)->eptr == NULL) + return 1; + if ((*(struct commonio_entry **) p2)->eptr == NULL) + return -1; + + u1 = ((struct passwd *) (*(struct commonio_entry **) p1)->eptr)->pw_uid; + u2 = ((struct passwd *) (*(struct commonio_entry **) p2)->eptr)->pw_uid; + + if (u1 < u2) + return -1; + else if (u1 > u2) + return 1; + else + return 0; +} + +/* Sort entries by UID */ +int pw_sort () +{ + return commonio_sort (&passwd_db, pw_cmp); +} diff --git a/rpm-5.4.9/lua/shadow/pwio.h b/rpm-5.4.9/lua/shadow/pwio.h new file mode 100644 index 0000000..678f8ea --- /dev/null +++ b/rpm-5.4.9/lua/shadow/pwio.h @@ -0,0 +1,19 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +extern struct passwd *__pw_dup (const struct passwd *); +extern void __pw_set_changed (void); +extern int pw_close (void); +extern const struct passwd *pw_locate (const char *); +extern int pw_lock (void); +extern int pw_name (const char *); +extern const struct passwd *pw_next (void); +extern int pw_open (int); +extern int pw_remove (const char *); +extern int pw_rewind (void); +extern int pw_unlock (void); +extern int pw_update (const struct passwd *); +extern int pw_sort (void); diff --git a/rpm-5.4.9/lua/shadow/sgetgrent.c b/rpm-5.4.9/lua/shadow/sgetgrent.c new file mode 100644 index 0000000..5575b92 --- /dev/null +++ b/rpm-5.4.9/lua/shadow/sgetgrent.c @@ -0,0 +1,144 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* + * Copyright 1990 - 1994, Julianne Frances Haugh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Julianne F. Haugh nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "system.h" +#include "shadow_config.h" +#include "defines.h" +#include "prototypes.h" + +#ident "$Id: sgetgrent.c,v 1.4 2010/03/21 14:56:59 jbj Exp $" + +#include +#include + +#define NFIELDS 4 +/* + * list - turn a comma-separated string into an array of (char *)'s + * + * list() converts the comma-separated list of member names into + * an array of character pointers. + * + * WARNING: I profiled this once with and without strchr() calls + * and found that using a register variable and an explicit loop + * works best. For large /etc/group files, this is a major win. + * + * FINALLY added dynamic allocation. Still need to fix sgetsgent(). + * --marekm + */ +static char **list (char *s) +{ + static char **members = 0; + static int size = 0; /* max members + 1 */ + int i; + char **rbuf; + + i = 0; + for (;;) { + /* check if there is room for another pointer (to a group + member name, or terminating NULL). */ + if (i >= size) { + size = i + 100; /* at least: i + 1 */ + if (members) { + rbuf = (char **) + realloc (members, size * sizeof (*rbuf)); + } else { + /* for old (before ANSI C) implementations of + realloc() that don't handle NULL properly */ + rbuf = (char **) malloc (size * sizeof (*rbuf)); + } + if (!rbuf) { + if (members) + free (members); + members = 0; + size = 0; + return (char **) 0; + } + members = rbuf; + } + if (!s || s[0] == '\0') + break; + members[i++] = s; + while (*s && *s != ',') + s++; + if (*s) + *s++ = '\0'; + } + members[i] = (char *) 0; + return members; +} + + +struct group *sgetgrent (const char *buf) +{ + static char *grpbuf = 0; + static size_t size = 0; + static char *grpfields[NFIELDS]; + static struct group grent; + int i; + char *cp; + + if (strlen (buf) + 1 > size) { + /* no need to use realloc() here - just free it and + allocate a larger block */ + if (grpbuf) + free (grpbuf); + size = strlen (buf) + 1000; /* at least: strlen(buf) + 1 */ + grpbuf = (char *) malloc (size); + if (!grpbuf) { + size = 0; + return 0; + } + } + strcpy (grpbuf, buf); + + if ((cp = strrchr (grpbuf, '\n'))) + *cp = '\0'; + + for (cp = grpbuf, i = 0; i < NFIELDS && cp; i++) { + grpfields[i] = cp; + if ((cp = strchr (cp, ':'))) + *cp++ = 0; + } + if (i < (NFIELDS - 1) || *grpfields[2] == '\0') + return 0; + grent.gr_name = grpfields[0]; + grent.gr_passwd = grpfields[1]; + grent.gr_gid = atoi (grpfields[2]); + grent.gr_mem = list (grpfields[3]); + if (!grent.gr_mem) + return (struct group *) 0; /* out of memory */ + + return &grent; +} diff --git a/rpm-5.4.9/lua/shadow/sgetpwent.c b/rpm-5.4.9/lua/shadow/sgetpwent.c new file mode 100644 index 0000000..3308b12 --- /dev/null +++ b/rpm-5.4.9/lua/shadow/sgetpwent.c @@ -0,0 +1,123 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* + * Copyright 1989 - 1994, Julianne Frances Haugh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Julianne F. Haugh nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "system.h" +#include "shadow_config.h" +#include "defines.h" +#include "prototypes.h" + +#ident "$Id: sgetpwent.c,v 1.3 2008/08/18 19:16:10 jbj Exp $" + +#include +#include +#include +#define NFIELDS 7 +/* + * sgetpwent - convert a string to a (struct passwd) + * + * sgetpwent() parses a string into the parts required for a password + * structure. Strict checking is made for the UID and GID fields and + * presence of the correct number of colons. Any failing tests result + * in a NULL pointer being returned. + * + * NOTE: This function uses hard-coded string scanning functions for + * performance reasons. I am going to come up with some conditional + * compilation glarp to improve on this in the future. + */ +struct passwd *sgetpwent (const char *buf) +{ + static struct passwd pwent; + static char pwdbuf[1024]; + register int i; + register char *cp; + char *ep; + char *fields[NFIELDS]; + + /* + * Copy the string to a static buffer so the pointers into + * the password structure remain valid. + */ + + if (strlen (buf) >= sizeof pwdbuf) + return 0; /* fail if too long */ + strcpy (pwdbuf, buf); + + /* + * Save a pointer to the start of each colon separated + * field. The fields are converted into NUL terminated strings. + */ + + for (cp = pwdbuf, i = 0; i < NFIELDS && cp; i++) { + fields[i] = cp; + while (*cp && *cp != ':') + ++cp; + + if (*cp) + *cp++ = '\0'; + else + cp = 0; + } + + /* + * There must be exactly NFIELDS colon separated fields or + * the entry is invalid. Also, the UID and GID must be non-blank. + */ + + if (i != NFIELDS || *fields[2] == '\0' || *fields[3] == '\0') + return 0; + + /* + * Each of the fields is converted the appropriate data type + * and the result assigned to the password structure. If the + * UID or GID does not convert to an integer value, a NULL + * pointer is returned. + */ + + pwent.pw_name = fields[0]; + pwent.pw_passwd = fields[1]; + if (fields[2][0] == '\0' || + ((pwent.pw_uid = strtol (fields[2], &ep, 10)) == 0 && *ep)) { + return 0; + } + if (fields[3][0] == '\0' || + ((pwent.pw_gid = strtol (fields[3], &ep, 10)) == 0 && *ep)) { + return 0; + } + pwent.pw_gecos = fields[4]; + pwent.pw_dir = fields[5]; + pwent.pw_shell = fields[6]; + + return &pwent; +} diff --git a/rpm-5.4.9/lua/shadow/sgroupio.c b/rpm-5.4.9/lua/shadow/sgroupio.c new file mode 100644 index 0000000..fed6af3 --- /dev/null +++ b/rpm-5.4.9/lua/shadow/sgroupio.c @@ -0,0 +1,207 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + + +#include "system.h" +#include "shadow_config.h" + +#ifdef SHADOWGRP + +#ident "$Id: sgroupio.c,v 1.4 2010/03/21 14:56:59 jbj Exp $" + +#include "prototypes.h" +#include "defines.h" +#include "commonio.h" +#include "sgroupio.h" +extern int putsgent (const struct sgrp *, FILE *); +extern struct sgrp *sgetsgent (const char *); + +struct sgrp *__sgr_dup (const struct sgrp *sgent) +{ + struct sgrp *sg; + int i; + + if (!(sg = (struct sgrp *) malloc (sizeof *sg))) + return NULL; + *sg = *sgent; + if (!(sg->sg_name = strdup (sgent->sg_name))) + return NULL; + if (!(sg->sg_passwd = strdup (sgent->sg_passwd))) + return NULL; + + for (i = 0; sgent->sg_adm[i]; i++); + sg->sg_adm = (char **) malloc ((i + 1) * sizeof (char *)); + if (!sg->sg_adm) + return NULL; + for (i = 0; sgent->sg_adm[i]; i++) { + sg->sg_adm[i] = strdup (sgent->sg_adm[i]); + if (!sg->sg_adm[i]) + return NULL; + } + sg->sg_adm[i] = NULL; + + for (i = 0; sgent->sg_mem[i]; i++); + sg->sg_mem = (char **) malloc ((i + 1) * sizeof (char *)); + if (!sg->sg_mem) + return NULL; + for (i = 0; sgent->sg_mem[i]; i++) { + sg->sg_mem[i] = strdup (sgent->sg_mem[i]); + if (!sg->sg_mem[i]) + return NULL; + } + sg->sg_mem[i] = NULL; + + return sg; +} + +static void *gshadow_dup (const void *ent) +{ + const struct sgrp *sg = (const struct sgrp *) ent; + + return __sgr_dup (sg); +} + +static void gshadow_free (void *ent) +{ + struct sgrp *sg = (struct sgrp *) ent; + + free (sg->sg_name); + free (sg->sg_passwd); + while (*(sg->sg_adm)) { + free (*(sg->sg_adm)); + sg->sg_adm++; + } + while (*(sg->sg_mem)) { + free (*(sg->sg_mem)); + sg->sg_mem++; + } + free (sg); +} + +static const char *gshadow_getname (const void *ent) +{ + const struct sgrp *gr = (const struct sgrp *) ent; + + return gr->sg_name; +} + +static void *gshadow_parse (const char *line) +{ + return (void *) sgetsgent (line); +} + +static int gshadow_put (const void *ent, FILE * file) +{ + const struct sgrp *sg = (const struct sgrp *) ent; + + return (putsgent (sg, file) == -1) ? -1 : 0; +} + +static struct commonio_ops gshadow_ops = { + gshadow_dup, + gshadow_free, + gshadow_getname, + gshadow_parse, + gshadow_put, + fgetsx, + fputsx +}; + +static struct commonio_db gshadow_db = { + SGROUP_FILE, /* filename */ + &gshadow_ops, /* ops */ + NULL, /* fp */ + NULL, /* head */ + NULL, /* tail */ + NULL, /* cursor */ + 0, /* changed */ + 0, /* isopen */ + 0, /* locked */ + 0 /* readonly */ +}; + +int sgr_name (const char *filename) +{ + return commonio_setname (&gshadow_db, filename); +} + +int sgr_file_present (void) +{ + return commonio_present (&gshadow_db); +} + +int sgr_lock (void) +{ + return commonio_lock (&gshadow_db); +} + +int sgr_open (int mode) +{ + return commonio_open (&gshadow_db, mode); +} + +const struct sgrp *sgr_locate (const char *name) +{ + return (const struct sgrp *) commonio_locate (&gshadow_db, name); +} + +int sgr_update (const struct sgrp *sg) +{ + return commonio_update (&gshadow_db, (const void *) sg); +} + +int sgr_remove (const char *name) +{ + return commonio_remove (&gshadow_db, name); +} + +int sgr_rewind (void) +{ + return commonio_rewind (&gshadow_db); +} + +const struct sgrp *sgr_next (void) +{ + return (const struct sgrp *) commonio_next (&gshadow_db); +} + +int sgr_close (void) +{ + return commonio_close (&gshadow_db); +} + +int sgr_unlock (void) +{ + return commonio_unlock (&gshadow_db); +} + +void __sgr_set_changed (void) +{ + gshadow_db.changed = 1; +} + +struct commonio_entry *__sgr_get_head (void); /* XXX gcc warning */ +struct commonio_entry *__sgr_get_head (void) +{ + return gshadow_db.head; +} + +void __sgr_del_entry (const struct commonio_entry *ent); /* XXX gcc warning */ +void __sgr_del_entry (const struct commonio_entry *ent) +{ + commonio_del_entry (&gshadow_db, ent); +} + +/* Sort with respect to group ordering. */ +int sgr_sort () +{ + extern struct commonio_db *__gr_get_db (void); + + return commonio_sort_wrt (&gshadow_db, __gr_get_db ()); +} +#else +extern int errno; /* warning: ANSI C forbids an empty source file */ +#endif diff --git a/rpm-5.4.9/lua/shadow/sgroupio.h b/rpm-5.4.9/lua/shadow/sgroupio.h new file mode 100644 index 0000000..6a43189 --- /dev/null +++ b/rpm-5.4.9/lua/shadow/sgroupio.h @@ -0,0 +1,20 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +extern struct sgrp *__sgr_dup (const struct sgrp *); +extern void __sgr_set_changed (void); +extern int sgr_close (void); +extern int sgr_file_present (void); +extern const struct sgrp *sgr_locate (const char *); +extern int sgr_lock (void); +extern int sgr_name (const char *); +extern const struct sgrp *sgr_next (void); +extern int sgr_open (int); +extern int sgr_remove (const char *); +extern int sgr_rewind (void); +extern int sgr_unlock (void); +extern int sgr_update (const struct sgrp *); +extern int sgr_sort (void); diff --git a/rpm-5.4.9/lua/shadow/shadow_config.h b/rpm-5.4.9/lua/shadow/shadow_config.h new file mode 100644 index 0000000..61c5a99 --- /dev/null +++ b/rpm-5.4.9/lua/shadow/shadow_config.h @@ -0,0 +1,260 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* config.h. Generated by configure. */ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* Path for faillog file. */ +#define FAILLOG_FILE "/var/log/faillog" + +/* Define to the type of elements in the array set by `getgroups'. Usually + this is either `int' or `gid_t'. */ +#define GETGROUPS_T gid_t + +/* Define to 1 if you have the `a64l' function. */ +#define HAVE_A64L 1 + +/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the `fchmod' function. */ +#define HAVE_FCHMOD 1 + +/* Define to 1 if you have the `fchown' function. */ +#define HAVE_FCHOWN 1 + +/* Define to 1 if you have the `fsync' function. */ +#define HAVE_FSYNC 1 + +/* Define to 1 if you have the `getgroups' function. */ +#define HAVE_GETGROUPS 1 + +/* Define to 1 if you have the `gethostname' function. */ +#define HAVE_GETHOSTNAME 1 + +/* Define to 1 if you have the `getspnam' function. */ +#define HAVE_GETSPNAM 1 + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the `getusershell' function. */ +#define HAVE_GETUSERSHELL 1 + +/* Define to 1 if you have the `getutent' function. */ +#define HAVE_GETUTENT 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_GSHADOW_H */ + +/* Define to 1 if you have the `initgroups' function. */ +#define HAVE_INITGROUPS 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LASTLOG_H 1 + +/* Define to 1 if you have the `lckpwdf' function. */ +#define HAVE_LCKPWDF 1 + +/* Defined if you have libcrack. */ +/* #undef HAVE_LIBCRACK */ + +/* Defined if you have the ts&szs cracklib. */ +/* #undef HAVE_LIBCRACK_HIST */ + +/* Defined if it includes *Pw functions. */ +/* #undef HAVE_LIBCRACK_PW */ + +/* Define if struct lastlog has ll_host */ +#define HAVE_LL_HOST 1 + +/* Define to 1 if you have the `lstat' function. */ +#define HAVE_LSTAT 1 + +/* Define to 1 if you have the `memcpy' function. */ +#define HAVE_MEMCPY 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if you have the `mkdir' function. */ +#define HAVE_MKDIR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_PATHS_H 1 + +/* Define to 1 if you have the `putgrent' function. */ +#define HAVE_PUTGRENT 1 + +/* Define to 1 if you have the `putpwent' function. */ +#define HAVE_PUTPWENT 1 + +/* Define to 1 if you have the `putspent' function. */ +#define HAVE_PUTSPENT 1 + +/* Define to 1 if you have the `rename' function. */ +#define HAVE_RENAME 1 + +/* Define to 1 if you have the `rmdir' function. */ +#define HAVE_RMDIR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_RPC_KEY_PROT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SELINUX_SELINUX_H */ + +/* Define to 1 if you have the `setgroups' function. */ +#define HAVE_SETGROUPS 1 + +/* Define to 1 if you have the `sgetgrent' function. */ +/* #undef HAVE_SGETGRENT */ + +/* Define to 1 if you have the `sgetpwent' function. */ +/* #undef HAVE_SGETPWENT */ + +/* Define to 1 if you have the `sgetspent' function. */ +#define HAVE_SGETSPENT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SGTTY_H 1 + +/* Have working shadow group support in libc */ +/* #undef HAVE_SHADOWGRP */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SHADOW_H 1 + +/* Define to 1 if you have the `sigaction' function. */ +#define HAVE_SIGACTION 1 + +/* Define to 1 if you have the `strcasecmp' function. */ +#define HAVE_STRCASECMP 1 + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + +/* Define to 1 if you have the `strftime' function. */ +#define HAVE_STRFTIME 1 + +/* Define to 1 if `st_rdev' is member of `struct stat'. */ +#define HAVE_STRUCT_STAT_ST_RDEV 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYSLOG_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TERMIOS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TERMIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ULIMIT_H 1 + +/* Define to 1 if you have the `updwtmp' function. */ +#define HAVE_UPDWTMP 1 + +/* Define to 1 if you have the `updwtmpx' function. */ +#define HAVE_UPDWTMPX 1 + +/* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */ +#define HAVE_UTIME_NULL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UTMPX_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UTMP_H 1 + +/* Path for lastlog file. */ +#define LASTLOG_FILE "/var/log/lastlog" + +/* Location of system mail spool directory. */ +#define MAIL_SPOOL_DIR "/var/mail" + +/* Name of user's mail spool file if stored in user's home directory. */ +/* #undef MAIL_SPOOL_FILE */ + +/* Path to passwd program. */ +#define PASSWD_PROGRAM "/usr/bin/passwd" + +/* Define as the return type of signal handlers (`int' or `void'). */ +#define RETSIGTYPE void + +/* Define if login should support the -r flag for rlogind. */ +#define RLOGIN 1 + +/* Define to the ruserok() "success" return value (0 or 1). */ +#define RUSEROK 0 + +/* Define to 1 if the `setpgrp' function takes no argument. */ +#define SETPGRP_VOID 1 + +/* Define to support the shadow group file. */ +#define SHADOWGRP 1 + +/* Define to support S/Key logins. */ +/* #undef SKEY */ + +/* Define to support newer BSD S/Key API */ +/* #undef SKEY_BSD_STYLE */ + +/* Define to 1 if the `S_IS*' macros in do not work properly. */ +/* #undef STAT_MACROS_BROKEN */ + +/* Define to support /etc/suauth su access control. */ +#define SU_ACCESS 1 + +/* Define to 1 if your declares `struct tm'. */ +/* #undef TM_IN_SYS_TIME */ + +/* Define to support Pluggable Authentication Modules */ +/* #undef USE_PAM */ + +/* Define to use syslog(). */ +#define USE_SYSLOG 1 + +/* Define if you have ut_host in struct utmp. */ +#define UT_HOST 1 + +/* Define if you want to enable Audit messages */ +/* #undef WITH_AUDIT */ + +/* Path for utmp file. */ +#define _UTMP_FILE "/var/run/utmp" + +/* Path for wtmp file. */ +#define _WTMP_FILE "/var/log/wtmp" + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to libshadow_getpass to use our own version of getpass(). */ +/* #undef getpass */ + +/* Define to `int' if doesn't define. */ +/* #undef gid_t */ + +/* Define to `int' if doesn't define. */ +/* #undef uid_t */ + +/* Define to ut_name if struct utmp has ut_name (not ut_user). */ +/* #undef ut_user */ diff --git a/rpm-5.4.9/lua/shadow/shadowio.c b/rpm-5.4.9/lua/shadow/shadowio.c new file mode 100644 index 0000000..e1054d1 --- /dev/null +++ b/rpm-5.4.9/lua/shadow/shadowio.c @@ -0,0 +1,166 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + + +#include "system.h" +#include "shadow_config.h" + +#ident "$Id: shadowio.c,v 1.4 2010/03/21 14:56:59 jbj Exp $" + +#include "prototypes.h" +#include "defines.h" +#ifdef HAVE_SHADOW_H +# include +#endif +#include +#include "commonio.h" +#include "shadowio.h" +struct spwd *__spw_dup (const struct spwd *spent) +{ + struct spwd *sp; + + if (!(sp = (struct spwd *) malloc (sizeof *sp))) + return NULL; + *sp = *spent; + if (!(sp->sp_namp = strdup (spent->sp_namp))) + return NULL; + if (!(sp->sp_pwdp = strdup (spent->sp_pwdp))) + return NULL; + return sp; +} + +static void *shadow_dup (const void *ent) +{ + const struct spwd *sp = (const struct spwd *) ent; + + return __spw_dup (sp); +} + +static void shadow_free (void *ent) +{ + struct spwd *sp = (struct spwd *) ent; + + free (sp->sp_namp); + free (sp->sp_pwdp); + free (sp); +} + +static const char *shadow_getname (const void *ent) +{ + const struct spwd *sp = (const struct spwd *) ent; + + return sp->sp_namp; +} + +static void *shadow_parse (const char *line) +{ + return (void *) sgetspent (line); +} + +static int shadow_put (const void *ent, FILE * file) +{ + const struct spwd *sp = (const struct spwd *) ent; + + return (putspent (sp, file) == -1) ? -1 : 0; +} + +static struct commonio_ops shadow_ops = { + shadow_dup, + shadow_free, + shadow_getname, + shadow_parse, + shadow_put, + fgets, + fputs +}; + +static struct commonio_db shadow_db = { + SHADOW_FILE, /* filename */ + &shadow_ops, /* ops */ + NULL, /* fp */ + NULL, /* head */ + NULL, /* tail */ + NULL, /* cursor */ + 0, /* changed */ + 0, /* isopen */ + 0, /* locked */ + 0 /* readonly */ +}; + +int spw_name (const char *filename) +{ + return commonio_setname (&shadow_db, filename); +} + +int spw_file_present (void) +{ + return commonio_present (&shadow_db); +} + +int spw_lock (void) +{ + return commonio_lock (&shadow_db); +} + +int spw_open (int mode) +{ + return commonio_open (&shadow_db, mode); +} + +const struct spwd *spw_locate (const char *name) +{ + return (const struct spwd *) commonio_locate (&shadow_db, name); +} + +int spw_update (const struct spwd *sp) +{ + return commonio_update (&shadow_db, (const void *) sp); +} + +int spw_remove (const char *name) +{ + return commonio_remove (&shadow_db, name); +} + +int spw_rewind (void) +{ + return commonio_rewind (&shadow_db); +} + +const struct spwd *spw_next (void) +{ + return (const struct spwd *) commonio_next (&shadow_db); +} + +int spw_close (void) +{ + return commonio_close (&shadow_db); +} + +int spw_unlock (void) +{ + return commonio_unlock (&shadow_db); +} + +struct commonio_entry *__spw_get_head (void); /* XXX gcc warning */ +struct commonio_entry *__spw_get_head (void) +{ + return shadow_db.head; +} + +void __spw_del_entry (const struct commonio_entry *ent); /* XXX gcc warning */ +void __spw_del_entry (const struct commonio_entry *ent) +{ + commonio_del_entry (&shadow_db, ent); +} + +/* Sort with respect to passwd ordering. */ +int spw_sort () +{ + extern struct commonio_db *__pw_get_db (void); + + return commonio_sort_wrt (&shadow_db, __pw_get_db ()); +} diff --git a/rpm-5.4.9/lua/shadow/shadowio.h b/rpm-5.4.9/lua/shadow/shadowio.h new file mode 100644 index 0000000..8c6418d --- /dev/null +++ b/rpm-5.4.9/lua/shadow/shadowio.h @@ -0,0 +1,20 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +extern struct spwd *__spw_dup (const struct spwd *); +extern void __spw_set_changed (void); +extern int spw_close (void); +extern int spw_file_present (void); +extern const struct spwd *spw_locate (const char *); +extern int spw_lock (void); +extern int spw_name (const char *); +extern const struct spwd *spw_next (void); +extern int spw_open (int); +extern int spw_remove (const char *); +extern int spw_rewind (void); +extern int spw_unlock (void); +extern int spw_update (const struct spwd *); +extern int spw_sort (void); diff --git a/rpm-5.4.9/lua/shadow/strtoday.c b/rpm-5.4.9/lua/shadow/strtoday.c new file mode 100644 index 0000000..df9c1af --- /dev/null +++ b/rpm-5.4.9/lua/shadow/strtoday.c @@ -0,0 +1,1855 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* + * Copyright 1991 - 1994, Julianne Frances Haugh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Julianne F. Haugh nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if !defined(__GLIBC__) +#define _XOPEN_SOURCE 500 +#endif + +#include "system.h" +#include "shadow_config.h" +#include "defines.h" +#include "prototypes.h" + +#ident "$Id: strtoday.c,v 1.8 2010/04/04 08:06:01 afb Exp $" + +#ifndef USE_GETDATE +#define USE_GETDATE 1 +#endif + +#if USE_GETDATE + +#define get_date shadow_get_date + +/*@-globstate -statictrans -unqualifiedtrans -noparams @*/ +/*@-retvalint -usedef -varuse -nullderef -nullassign @*/ +/*@-readonlytrans -modunconnomods -compdef -noeffectuncon @*/ +/*@-globs -evalorderuncon -modobserveruncon -modnomods @*/ +/*@-noeffect -branchstate -sizeoftype -usereleased @*/ +/*@+charint -exportheader +longunsignedintegral -redecl -type -warnlintcomments @*/ +/*@unused@*/ +#ifndef lint +static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; +#endif + +#include +#include + +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 +#define YYPATCH 20070509 + +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING (yyerrflag != 0) + +extern int yyparse(void); + +static int yygrowstack(void); +#define YYPREFIX "yy" +#line 2 "./getdate.y" +/* +** Originally written by Steven M. Bellovin while +** at the University of North Carolina at Chapel Hill. Later tweaked by +** a couple of people on Usenet. Completely overhauled by Rich $alz +** and Jim Berets in August, 1990; +** +** This grammar has 10 shift/reduce conflicts. +** +** This code is in the public domain and has no copyright. +*/ +/* SUPPRESS 287 on yaccpar_sccsid *//* Unused static variable */ +/* SUPPRESS 288 on yyerrlab *//* Label unused */ + +#ifdef HAVE_CONFIG_H +#if defined (emacs) || defined (CONFIG_BROKETS) +#include +#else +#include "config.h" +#endif +#endif + +/* Since the code of getdate.y is not included in the Emacs executable + itself, there is no need to #define static in this file. Even if + the code were included in the Emacs executable, it probably + wouldn't do any harm to #undef it here; this will only cause + problems if we try to write to a static variable, which I don't + think this code needs to do. */ +#ifdef emacs +#undef static +#endif + +#include +#include + +/* The code at the top of get_date which figures out the offset of the + current time zone checks various CPP symbols to see if special + tricks are need, but defaults to using the gettimeofday system call. + Include if that will be used. */ + +#if defined(vms) + +#include +#include + +#else + +#include + +#ifdef TIME_WITH_SYS_TIME +#include +#include +#else +#ifdef HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif + +#ifdef timezone +#undef timezone /* needed for sgi */ +#endif + +#if defined(HAVE_SYS_TIMEB_H) +#include +#else +/* +** We use the obsolete `struct timeb' as part of our interface! +** Since the system doesn't have it, we define it here; +** our callers must do likewise. +*/ +struct timeb { + time_t time; /* Seconds since the epoch */ +/*@unused@*/ unsigned short millitm; /* Field not used */ + short timezone; /* Minutes west of GMT */ +/*@unused@*/ short dstflag; /* Field not used */ +}; +#endif /* defined(HAVE_SYS_TIMEB_H) */ + +#endif /* defined(vms) */ + +#if defined (STDC_HEADERS) || defined (USG) +#include +#endif + +/* Some old versions of bison generate parsers that use bcopy. + That loses on systems that don't provide the function, so we have + to redefine it here. */ +#if !defined (HAVE_BCOPY) && defined (HAVE_MEMCPY) && !defined (bcopy) +#define bcopy(from, to, len) memcpy ((to), (from), (len)) +#endif + +#if defined (STDC_HEADERS) +#include +#endif + +/* NOTES on rebuilding getdate.c (particularly for inclusion in CVS + releases): + + We don't want to mess with all the portability hassles of alloca. + In particular, most (all?) versions of bison will use alloca in + their parser. If bison works on your system (e.g. it should work + with gcc), then go ahead and use it, but the more general solution + is to use byacc instead of bison, which should generate a portable + parser. I played with adding "#define alloca dont_use_alloca", to + give an error if the parser generator uses alloca (and thus detect + unportable getdate.c's), but that seems to cause as many problems + as it solves. */ + +#if 0 +extern struct tm *gmtime(); +extern struct tm *localtime(); +#endif + +#define EPOCH 1970 +#define HOUR(x) ((time_t)(x) * 60) +#define SECSPERDAY (24L * 60L * 60L) + +/* +** An entry in the lexical lookup table. +*/ +typedef struct _TABLE { +/*@observer@*/ /*@relnull@*/ + char *name; + int type; + time_t value; +} TABLE; + + +/* +** Daylight-savings mode: on, off, or not yet known. +*/ +typedef enum _DSTMODE { + DSTon, DSToff, DSTmaybe +} DSTMODE; + +/* +** Meridian: am, pm, or 24-hour style. +*/ +typedef enum _MERIDIAN { + MERam, MERpm, MER24 +} MERIDIAN; + + +/* +** Global variables. We could get rid of most of these by using a good +** union as the yacc stack. (This routine was originally written before +** yacc had the %union construct.) Maybe someday; right now we only use +** the %union very rarely. +*/ +/*@unchecked@*/ +static char *yyInput; +/*@unchecked@*/ +static DSTMODE yyDSTmode; +/*@unchecked@*/ +static time_t yyDayOrdinal; +/*@unchecked@*/ +static time_t yyDayNumber; +/*@unchecked@*/ +static int yyHaveDate; +/*@unchecked@*/ +static int yyHaveDay; +/*@unchecked@*/ +static int yyHaveRel; +/*@unchecked@*/ +static int yyHaveTime; +/*@unchecked@*/ +static int yyHaveZone; +/*@unchecked@*/ +static time_t yyTimezone; +/*@unchecked@*/ +static time_t yyDay; +/*@unchecked@*/ +static time_t yyHour; +/*@unchecked@*/ +static time_t yyMinutes; +/*@unchecked@*/ +static time_t yyMonth; +/*@unchecked@*/ +static time_t yySeconds; +/*@unchecked@*/ +static time_t yyYear; +/*@unchecked@*/ +static MERIDIAN yyMeridian; +/*@unchecked@*/ +static time_t yyRelMonth; +/*@unchecked@*/ +static time_t yyRelSeconds; + +#define yyparse getdate_yyparse +#define yylex getdate_yylex +#define yyerror getdate_yyerror + +static int yyparse (void); +static int yylex (void); +static int yyerror(const char * s) + /*@*/; + +/*@-exportheader@*/ +extern time_t get_date(char * p, struct timeb * now); +/*@=exportheader@*/ + +#line 206 "./getdate.y" +typedef union { + time_t Number; + enum _MERIDIAN Meridian; +} YYSTYPE; +#line 231 "getdate.c" +#define tAGO 257 +#define tDAY 258 +#define tDAYZONE 259 +#define tID 260 +#define tMERIDIAN 261 +#define tMINUTE_UNIT 262 +#define tMONTH 263 +#define tMONTH_UNIT 264 +#define tSEC_UNIT 265 +#define tSNUMBER 266 +#define tUNUMBER 267 +#define tZONE 268 +#define tDST 269 +#define YYERRCODE 256 +static short yylhs[] = { -1, + 0, 0, 2, 2, 2, 2, 2, 2, 3, 3, + 3, 3, 3, 4, 4, 4, 6, 6, 6, 5, + 5, 5, 5, 5, 5, 5, 5, 7, 7, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 8, 1, + 1, +}; +static short yylen[] = { 2, + 0, 2, 1, 1, 1, 1, 1, 1, 2, 4, + 4, 6, 6, 1, 1, 2, 1, 2, 2, 3, + 5, 3, 3, 2, 4, 2, 3, 2, 1, 2, + 2, 1, 2, 2, 1, 2, 2, 1, 1, 0, + 1, +}; +static short yydefred[] = { 1, + 0, 0, 15, 32, 0, 38, 35, 0, 0, 0, + 2, 3, 4, 5, 6, 7, 8, 0, 18, 0, + 31, 36, 33, 19, 9, 30, 0, 37, 34, 0, + 0, 0, 16, 28, 0, 23, 27, 22, 0, 0, + 25, 41, 11, 0, 10, 0, 0, 21, 13, 12, +}; +static short yydgoto[] = { 1, + 45, 11, 12, 13, 14, 15, 16, 17, 18, +}; +static short yysindex[] = { 0, + -249, -38, 0, 0, -260, 0, 0, -240, -47, -248, + 0, 0, 0, 0, 0, 0, 0, -237, 0, -18, + 0, 0, 0, 0, 0, 0, -262, 0, 0, -239, + -238, -236, 0, 0, -235, 0, 0, 0, -56, -19, + 0, 0, 0, -234, 0, -232, -258, 0, 0, 0, +}; +static short yyrindex[] = { 0, + 0, 1, 0, 0, 0, 0, 0, 0, 69, 12, + 0, 0, 0, 0, 0, 0, 0, 23, 0, 34, + 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 56, 45, + 0, 0, 0, 0, 0, 0, 56, 0, 0, 0, +}; +static short yygindex[] = { 0, + -17, 0, 0, 0, 0, 0, 0, 0, 0, +}; +#define YYTABLESIZE 337 +static short yytable[] = { 32, + 17, 44, 42, 36, 37, 19, 20, 49, 2, 3, + 31, 14, 4, 5, 6, 7, 8, 9, 10, 34, + 33, 21, 29, 22, 23, 35, 38, 46, 39, 50, + 40, 41, 47, 24, 48, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 26, 0, 39, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 42, 0, 0, 0, 0, 43, + 24, 0, 0, 25, 26, 27, 28, 29, 30, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, + 0, 0, 17, 17, 17, 17, 17, 17, 17, 14, + 14, 0, 0, 14, 14, 14, 14, 14, 14, 14, + 29, 29, 0, 0, 29, 29, 29, 29, 29, 29, + 29, 24, 24, 0, 0, 24, 24, 24, 24, 24, + 24, 24, 20, 20, 0, 0, 20, 20, 20, 20, + 20, 20, 20, 40, 40, 0, 0, 40, 40, 40, + 40, 0, 40, 40, 26, 26, 0, 39, 26, 26, + 26, 26, 0, 0, 26, 39, 39, +}; +static short yycheck[] = { 47, + 0, 58, 261, 266, 267, 44, 267, 266, 258, 259, + 58, 0, 262, 263, 264, 265, 266, 267, 268, 257, + 269, 262, 0, 264, 265, 44, 266, 47, 267, 47, + 267, 267, 267, 0, 267, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 261, -1, -1, -1, -1, 266, + 258, -1, -1, 261, 262, 263, 264, 265, 266, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 258, 259, + -1, -1, 262, 263, 264, 265, 266, 267, 268, 258, + 259, -1, -1, 262, 263, 264, 265, 266, 267, 268, + 258, 259, -1, -1, 262, 263, 264, 265, 266, 267, + 268, 258, 259, -1, -1, 262, 263, 264, 265, 266, + 267, 268, 258, 259, -1, -1, 262, 263, 264, 265, + 266, 267, 268, 258, 259, -1, -1, 262, 263, 264, + 265, -1, 267, 268, 258, 259, -1, 259, 262, 263, + 264, 265, -1, -1, 268, 267, 268, +}; +#define YYFINAL 1 +#ifndef YYDEBUG +#define YYDEBUG 0 +#endif +#define YYMAXTOKEN 269 +#if YYDEBUG +char *yyname[] = { +"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,"','",0,0,"'/'",0,0,0,0,0,0,0,0,0,0,"':'",0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"tAGO","tDAY", +"tDAYZONE","tID","tMERIDIAN","tMINUTE_UNIT","tMONTH","tMONTH_UNIT","tSEC_UNIT", +"tSNUMBER","tUNUMBER","tZONE","tDST", +}; +char *yyrule[] = { +"$accept : spec", +"spec :", +"spec : spec item", +"item : time", +"item : zone", +"item : date", +"item : day", +"item : rel", +"item : number", +"time : tUNUMBER tMERIDIAN", +"time : tUNUMBER ':' tUNUMBER o_merid", +"time : tUNUMBER ':' tUNUMBER tSNUMBER", +"time : tUNUMBER ':' tUNUMBER ':' tUNUMBER o_merid", +"time : tUNUMBER ':' tUNUMBER ':' tUNUMBER tSNUMBER", +"zone : tZONE", +"zone : tDAYZONE", +"zone : tZONE tDST", +"day : tDAY", +"day : tDAY ','", +"day : tUNUMBER tDAY", +"date : tUNUMBER '/' tUNUMBER", +"date : tUNUMBER '/' tUNUMBER '/' tUNUMBER", +"date : tUNUMBER tSNUMBER tSNUMBER", +"date : tUNUMBER tMONTH tSNUMBER", +"date : tMONTH tUNUMBER", +"date : tMONTH tUNUMBER ',' tUNUMBER", +"date : tUNUMBER tMONTH", +"date : tUNUMBER tMONTH tUNUMBER", +"rel : relunit tAGO", +"rel : relunit", +"relunit : tUNUMBER tMINUTE_UNIT", +"relunit : tSNUMBER tMINUTE_UNIT", +"relunit : tMINUTE_UNIT", +"relunit : tSNUMBER tSEC_UNIT", +"relunit : tUNUMBER tSEC_UNIT", +"relunit : tSEC_UNIT", +"relunit : tSNUMBER tMONTH_UNIT", +"relunit : tUNUMBER tMONTH_UNIT", +"relunit : tMONTH_UNIT", +"number : tUNUMBER", +"o_merid :", +"o_merid : tMERIDIAN", +}; +#endif +#if YYDEBUG +#include +#endif + +/* define the initial stack-sizes */ +#ifdef YYSTACKSIZE +#undef YYMAXDEPTH +#define YYMAXDEPTH YYSTACKSIZE +#else +#ifdef YYMAXDEPTH +#define YYSTACKSIZE YYMAXDEPTH +#else +#define YYSTACKSIZE 500 +#define YYMAXDEPTH 500 +#endif +#endif + +#define YYINITSTACKSIZE 500 + +static int yydebug; +static int yynerrs; +static int yyerrflag; +static int yychar; +static short *yyssp; +static YYSTYPE *yyvsp; +static YYSTYPE yyval; +static YYSTYPE yylval; + +/* variables for the parser stack */ +static short *yyss; +static short *yysslim; +static YYSTYPE *yyvs; +static int yystacksize; +#line 425 "./getdate.y" + +/* Month and day table. */ +/*@unchecked@*/ /*@observer@*/ +static TABLE const MonthDayTable[] = { + { "january", tMONTH, 1 }, + { "february", tMONTH, 2 }, + { "march", tMONTH, 3 }, + { "april", tMONTH, 4 }, + { "may", tMONTH, 5 }, + { "june", tMONTH, 6 }, + { "july", tMONTH, 7 }, + { "august", tMONTH, 8 }, + { "september", tMONTH, 9 }, + { "sept", tMONTH, 9 }, + { "october", tMONTH, 10 }, + { "november", tMONTH, 11 }, + { "december", tMONTH, 12 }, + { "sunday", tDAY, 0 }, + { "monday", tDAY, 1 }, + { "tuesday", tDAY, 2 }, + { "tues", tDAY, 2 }, + { "wednesday", tDAY, 3 }, + { "wednes", tDAY, 3 }, + { "thursday", tDAY, 4 }, + { "thur", tDAY, 4 }, + { "thurs", tDAY, 4 }, + { "friday", tDAY, 5 }, + { "saturday", tDAY, 6 }, + { NULL, 0, 0 } +}; + +/* Time units table. */ +/*@unchecked@*/ /*@observer@*/ +static TABLE const UnitsTable[] = { + { "year", tMONTH_UNIT, 12 }, + { "month", tMONTH_UNIT, 1 }, + { "fortnight", tMINUTE_UNIT, 14 * 24 * 60 }, + { "week", tMINUTE_UNIT, 7 * 24 * 60 }, + { "day", tMINUTE_UNIT, 1 * 24 * 60 }, + { "hour", tMINUTE_UNIT, 60 }, + { "minute", tMINUTE_UNIT, 1 }, + { "min", tMINUTE_UNIT, 1 }, + { "second", tSEC_UNIT, 1 }, + { "sec", tSEC_UNIT, 1 }, + { NULL, 0, 0 } +}; + +/* Assorted relative-time words. */ +/*@unchecked@*/ /*@observer@*/ +static TABLE const OtherTable[] = { + { "tomorrow", tMINUTE_UNIT, 1 * 24 * 60 }, + { "yesterday", tMINUTE_UNIT, -1 * 24 * 60 }, + { "today", tMINUTE_UNIT, 0 }, + { "now", tMINUTE_UNIT, 0 }, + { "last", tUNUMBER, -1 }, + { "this", tMINUTE_UNIT, 0 }, + { "next", tUNUMBER, 2 }, + { "first", tUNUMBER, 1 }, +/* { "second", tUNUMBER, 2 }, */ + { "third", tUNUMBER, 3 }, + { "fourth", tUNUMBER, 4 }, + { "fifth", tUNUMBER, 5 }, + { "sixth", tUNUMBER, 6 }, + { "seventh", tUNUMBER, 7 }, + { "eighth", tUNUMBER, 8 }, + { "ninth", tUNUMBER, 9 }, + { "tenth", tUNUMBER, 10 }, + { "eleventh", tUNUMBER, 11 }, + { "twelfth", tUNUMBER, 12 }, + { "ago", tAGO, 1 }, + { NULL, 0, 0 } +}; + +/* The timezone table. */ +/* Some of these are commented out because a time_t can't store a float. */ +/*@unchecked@*/ /*@observer@*/ +static TABLE const TimezoneTable[] = { + { "gmt", tZONE, HOUR( 0) }, /* Greenwich Mean */ + { "ut", tZONE, HOUR( 0) }, /* Universal (Coordinated) */ + { "utc", tZONE, HOUR( 0) }, + { "wet", tZONE, HOUR( 0) }, /* Western European */ + { "bst", tDAYZONE, HOUR( 0) }, /* British Summer */ + { "wat", tZONE, HOUR( 1) }, /* West Africa */ + { "at", tZONE, HOUR( 2) }, /* Azores */ +#if 0 + /* For completeness. BST is also British Summer, and GST is + * also Guam Standard. */ + { "bst", tZONE, HOUR( 3) }, /* Brazil Standard */ + { "gst", tZONE, HOUR( 3) }, /* Greenland Standard */ +#endif +#if 0 + { "nft", tZONE, HOUR(3.5) }, /* Newfoundland */ + { "nst", tZONE, HOUR(3.5) }, /* Newfoundland Standard */ + { "ndt", tDAYZONE, HOUR(3.5) }, /* Newfoundland Daylight */ +#endif + { "ast", tZONE, HOUR( 4) }, /* Atlantic Standard */ + { "adt", tDAYZONE, HOUR( 4) }, /* Atlantic Daylight */ + { "est", tZONE, HOUR( 5) }, /* Eastern Standard */ + { "edt", tDAYZONE, HOUR( 5) }, /* Eastern Daylight */ + { "cst", tZONE, HOUR( 6) }, /* Central Standard */ + { "cdt", tDAYZONE, HOUR( 6) }, /* Central Daylight */ + { "mst", tZONE, HOUR( 7) }, /* Mountain Standard */ + { "mdt", tDAYZONE, HOUR( 7) }, /* Mountain Daylight */ + { "pst", tZONE, HOUR( 8) }, /* Pacific Standard */ + { "pdt", tDAYZONE, HOUR( 8) }, /* Pacific Daylight */ + { "yst", tZONE, HOUR( 9) }, /* Yukon Standard */ + { "ydt", tDAYZONE, HOUR( 9) }, /* Yukon Daylight */ + { "hst", tZONE, HOUR(10) }, /* Hawaii Standard */ + { "hdt", tDAYZONE, HOUR(10) }, /* Hawaii Daylight */ + { "cat", tZONE, HOUR(10) }, /* Central Alaska */ + { "ahst", tZONE, HOUR(10) }, /* Alaska-Hawaii Standard */ + { "nt", tZONE, HOUR(11) }, /* Nome */ + { "idlw", tZONE, HOUR(12) }, /* International Date Line West */ + { "cet", tZONE, -HOUR(1) }, /* Central European */ + { "met", tZONE, -HOUR(1) }, /* Middle European */ + { "mewt", tZONE, -HOUR(1) }, /* Middle European Winter */ + { "mest", tDAYZONE, -HOUR(1) }, /* Middle European Summer */ + { "swt", tZONE, -HOUR(1) }, /* Swedish Winter */ + { "sst", tDAYZONE, -HOUR(1) }, /* Swedish Summer */ + { "fwt", tZONE, -HOUR(1) }, /* French Winter */ + { "fst", tDAYZONE, -HOUR(1) }, /* French Summer */ + { "eet", tZONE, -HOUR(2) }, /* Eastern Europe, USSR Zone 1 */ + { "bt", tZONE, -HOUR(3) }, /* Baghdad, USSR Zone 2 */ +#if 0 + { "it", tZONE, -HOUR(3.5) },/* Iran */ +#endif + { "zp4", tZONE, -HOUR(4) }, /* USSR Zone 3 */ + { "zp5", tZONE, -HOUR(5) }, /* USSR Zone 4 */ +#if 0 + { "ist", tZONE, -HOUR(5.5) },/* Indian Standard */ +#endif + { "zp6", tZONE, -HOUR(6) }, /* USSR Zone 5 */ +#if 0 + /* For completeness. NST is also Newfoundland Stanard, and SST is + * also Swedish Summer. */ + { "nst", tZONE, -HOUR(6.5) },/* North Sumatra */ + { "sst", tZONE, -HOUR(7) }, /* South Sumatra, USSR Zone 6 */ +#endif /* 0 */ + { "wast", tZONE, -HOUR(7) }, /* West Australian Standard */ + { "wadt", tDAYZONE, -HOUR(7) }, /* West Australian Daylight */ +#if 0 + { "jt", tZONE, -HOUR(7.5) },/* Java (3pm in Cronusland!) */ +#endif + { "cct", tZONE, -HOUR(8) }, /* China Coast, USSR Zone 7 */ + { "jst", tZONE, -HOUR(9) }, /* Japan Standard, USSR Zone 8 */ +#if 0 + { "cast", tZONE, -HOUR(9.5) },/* Central Australian Standard */ + { "cadt", tDAYZONE, -HOUR(9.5) },/* Central Australian Daylight */ +#endif + { "east", tZONE, -HOUR(10) }, /* Eastern Australian Standard */ + { "eadt", tDAYZONE, -HOUR(10) }, /* Eastern Australian Daylight */ + { "gst", tZONE, -HOUR(10) }, /* Guam Standard, USSR Zone 9 */ + { "nzt", tZONE, -HOUR(12) }, /* New Zealand */ + { "nzst", tZONE, -HOUR(12) }, /* New Zealand Standard */ + { "nzdt", tDAYZONE, -HOUR(12) }, /* New Zealand Daylight */ + { "idle", tZONE, -HOUR(12) }, /* International Date Line East */ + { NULL, 0, 0 } +}; + +/* Military timezone table. */ +/*@unchecked@*/ /*@observer@*/ +static TABLE const MilitaryTable[] = { + { "a", tZONE, HOUR( 1) }, + { "b", tZONE, HOUR( 2) }, + { "c", tZONE, HOUR( 3) }, + { "d", tZONE, HOUR( 4) }, + { "e", tZONE, HOUR( 5) }, + { "f", tZONE, HOUR( 6) }, + { "g", tZONE, HOUR( 7) }, + { "h", tZONE, HOUR( 8) }, + { "i", tZONE, HOUR( 9) }, + { "k", tZONE, HOUR( 10) }, + { "l", tZONE, HOUR( 11) }, + { "m", tZONE, HOUR( 12) }, + { "n", tZONE, HOUR(- 1) }, + { "o", tZONE, HOUR(- 2) }, + { "p", tZONE, HOUR(- 3) }, + { "q", tZONE, HOUR(- 4) }, + { "r", tZONE, HOUR(- 5) }, + { "s", tZONE, HOUR(- 6) }, + { "t", tZONE, HOUR(- 7) }, + { "u", tZONE, HOUR(- 8) }, + { "v", tZONE, HOUR(- 9) }, + { "w", tZONE, HOUR(-10) }, + { "x", tZONE, HOUR(-11) }, + { "y", tZONE, HOUR(-12) }, + { "z", tZONE, HOUR( 0) }, + { NULL, 0, 0 } +}; + + + + +/* ARGSUSED */ +static int +yyerror(/*@unused@*/ const char * s) +{ + s = s; /* XXX keep gcc happy */ + return 0; +} + + +static time_t +ToSeconds(time_t Hours, time_t Minutes, time_t Seconds, MERIDIAN Meridian) + /*@*/ +{ + if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 59) + return -1; + switch (Meridian) { + case MER24: + if (Hours < 0 || Hours > 23) + return -1; + return (Hours * 60L + Minutes) * 60L + Seconds; + case MERam: + if (Hours < 1 || Hours > 12) + return -1; + if (Hours == 12) + Hours = 0; + return (Hours * 60L + Minutes) * 60L + Seconds; + case MERpm: + if (Hours < 1 || Hours > 12) + return -1; + if (Hours == 12) + Hours = 0; + return ((Hours + 12) * 60L + Minutes) * 60L + Seconds; + default: + abort (); + } + /* NOTREACHED */ +} + + +/* Year is either + * A negative number, which means to use its absolute value (why?) + * A number from 0 to 99, which means a year from 1900 to 1999, or + * The actual year (>=100). */ +static time_t +Convert(time_t Month, time_t Day, time_t Year, + time_t Hours, time_t Minutes, time_t Seconds, + MERIDIAN Meridian, DSTMODE DSTmode) + /*@*/ +{ + static int DaysInMonth[12] = { + 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 + }; + time_t tod; + time_t Julian; + int i; + + if (Year < 0) + Year = -Year; + if (Year < 69) + Year += 2000; + else if (Year < 100) + Year += 1900; + DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0) + ? 29 : 28; + /* Checking for 2038 bogusly assumes that time_t is 32 bits. But + I'm too lazy to try to check for time_t overflow in another way. */ + if (Year < EPOCH || Year > 2038 + || Month < 1 || Month > 12 + /* Lint fluff: "conversion from long may lose accuracy" */ + || Day < 1 || Day > DaysInMonth[(int)--Month]) + return -1; + + for (Julian = Day - 1, i = 0; i < Month; i++) + Julian += DaysInMonth[i]; + for (i = EPOCH; i < Year; i++) + Julian += 365 + (i % 4 == 0); + Julian *= SECSPERDAY; + Julian += yyTimezone * 60L; + if ((tod = ToSeconds(Hours, Minutes, Seconds, Meridian)) < 0) + return -1; + Julian += tod; + if (DSTmode == DSTon + || (DSTmode == DSTmaybe && localtime(&Julian)->tm_isdst)) + Julian -= 60 * 60; + return Julian; +} + + +static time_t +DSTcorrect(time_t Start, time_t Future) + /*@*/ +{ + time_t StartDay; + time_t FutureDay; + + StartDay = (localtime(&Start)->tm_hour + 1) % 24; + FutureDay = (localtime(&Future)->tm_hour + 1) % 24; + return (Future - Start) + (StartDay - FutureDay) * 60L * 60L; +} + + +static time_t +RelativeDate(time_t Start, time_t DayOrdinal, time_t DayNumber) + /*@*/ +{ + struct tm *tm; + time_t now; + + now = Start; + tm = localtime(&now); + now += SECSPERDAY * ((DayNumber - tm->tm_wday + 7) % 7); + now += 7 * SECSPERDAY * (DayOrdinal <= 0 ? DayOrdinal : DayOrdinal - 1); + return DSTcorrect(Start, now); +} + + +static time_t +RelativeMonth(time_t Start, time_t RelMonth) + /*@*/ +{ + struct tm *tm; + time_t Month; + time_t Year; + + if (RelMonth == 0) + return 0; + tm = localtime(&Start); + Month = 12 * (tm->tm_year + 1900) + tm->tm_mon + RelMonth; + Year = Month / 12; + Month = Month % 12 + 1; + return DSTcorrect(Start, + Convert(Month, (time_t)tm->tm_mday, Year, + (time_t)tm->tm_hour, (time_t)tm->tm_min, (time_t)tm->tm_sec, + MER24, DSTmaybe)); +} + + +static int +LookupWord(char * buff) + /*@globals yylval @*/ + /*@modifies *buff, yylval @*/ +{ + register char *p; + register char *q; + register const TABLE *tp; + int i; + int abbrev; + + /* Make it lowercase. */ + for (p = buff; *p != '\0'; p++) + if (isupper(*p)) + *p = tolower(*p); + + if (strcmp(buff, "am") == 0 || strcmp(buff, "a.m.") == 0) { + yylval.Meridian = MERam; + return tMERIDIAN; + } + if (strcmp(buff, "pm") == 0 || strcmp(buff, "p.m.") == 0) { + yylval.Meridian = MERpm; + return tMERIDIAN; + } + + /* See if we have an abbreviation for a month. */ + if (strlen(buff) == 3) + abbrev = 1; + else if (strlen(buff) == 4 && buff[3] == '.') { + abbrev = 1; + buff[3] = '\0'; + } + else + abbrev = 0; + + for (tp = MonthDayTable; tp->name; tp++) { + if (abbrev) { + if (strncmp(buff, tp->name, 3) == 0) { + yylval.Number = tp->value; + return tp->type; + } + } + else if (strcmp(buff, tp->name) == 0) { + yylval.Number = tp->value; + return tp->type; + } + } + + for (tp = TimezoneTable; tp->name; tp++) + if (strcmp(buff, tp->name) == 0) { + yylval.Number = tp->value; + return tp->type; + } + + if (strcmp(buff, "dst") == 0) + return tDST; + + for (tp = UnitsTable; tp->name; tp++) + if (strcmp(buff, tp->name) == 0) { + yylval.Number = tp->value; + return tp->type; + } + + /* Strip off any plural and try the units table again. */ + i = strlen(buff) - 1; + if (buff[i] == 's') { + buff[i] = '\0'; + for (tp = UnitsTable; tp->name; tp++) + if (strcmp(buff, tp->name) == 0) { + yylval.Number = tp->value; + return tp->type; + } + buff[i] = 's'; /* Put back for "this" in OtherTable. */ + } + + for (tp = OtherTable; tp->name; tp++) + if (strcmp(buff, tp->name) == 0) { + yylval.Number = tp->value; + return tp->type; + } + + /* Military timezones. */ + if (buff[1] == '\0' && isalpha(*buff)) { + for (tp = MilitaryTable; tp->name; tp++) + if (strcmp(buff, tp->name) == 0) { + yylval.Number = tp->value; + return tp->type; + } + } + + /* Drop out any periods and try the timezone table again. */ + for (i = 0, p = q = buff; *q != '\0'; q++) + if (*q != '.') + *p++ = *q; + else + i++; + *p = '\0'; + if (i) + for (tp = TimezoneTable; tp->name; tp++) + if (strcmp(buff, tp->name) == 0) { + yylval.Number = tp->value; + return tp->type; + } + + return tID; +} + + +/*@-incondefs@*/ +static int +yylex(void) + /*@globals yyInput, yylval @*/ + /*@modifies yyInput, yylval @*/ +{ + register char c; + register char *p; + char buff[20]; + int Count; + int sign; + + for ( ; ; ) { + while (isspace(*yyInput)) + yyInput++; + + if (isdigit(c = *yyInput) || c == '-' || c == '+') { + if (c == '-' || c == '+') { + sign = c == '-' ? -1 : 1; + if (!isdigit(*++yyInput)) + /* skip the '-' sign */ + continue; + } + else + sign = 0; + for (yylval.Number = 0; isdigit(c = *yyInput++); ) + yylval.Number = 10 * yylval.Number + c - '0'; + yyInput--; + if (sign < 0) + yylval.Number = -yylval.Number; + return sign ? tSNUMBER : tUNUMBER; + } + if (isalpha(c)) { + for (p = buff; isalpha(c = *yyInput++) || c == '.'; ) + if (p < &buff[sizeof buff - 1]) + *p++ = c; + *p = '\0'; + yyInput--; + return LookupWord(buff); + } + if (c != '(') + return *yyInput++; + Count = 0; + do { + c = *yyInput++; + if (c == '\0') + return c; + if (c == '(') + Count++; + else if (c == ')') + Count--; + } while (Count > 0); + } + /*@notreached@*/ + return 0; +} +/*@=incondefs@*/ + +#define TM_YEAR_ORIGIN 1900 + +/* Yield A - B, measured in seconds. */ +static long +difftm (const struct tm * a, const struct tm * b) + /*@*/ +{ + unsigned ay = a->tm_year + (TM_YEAR_ORIGIN - 1); + unsigned by = b->tm_year + (TM_YEAR_ORIGIN - 1); + int days = ( + /* difference in day of year */ + a->tm_yday - b->tm_yday + /* + intervening leap days */ + + ((ay >> 2) - (by >> 2)) + - (ay/100 - by/100) + + ((ay/100 >> 2) - (by/100 >> 2)) + /* + difference in years * 365 */ + + (long)(ay-by) * 365 + ); + return (60*(60*(24*days + (a->tm_hour - b->tm_hour)) + + (a->tm_min - b->tm_min)) + + (a->tm_sec - b->tm_sec)); +} + +time_t +get_date(char * p, struct timeb * now) +{ + struct tm *tm, gmt; + struct timeb ftz; + time_t Start; + time_t tod; + time_t nowtime; + + yyInput = p; + memset(&gmt, 0, sizeof(gmt)); + if (now == NULL) { + struct tm *gmt_ptr; + + now = &ftz; + (void)time (&nowtime); + + gmt_ptr = gmtime (&nowtime); + if (gmt_ptr != NULL) + { + /* Make a copy, in case localtime modifies *tm (I think + that comment now applies to *gmt_ptr, but I am too + lazy to dig into how gmtime and locatime allocate the + structures they return pointers to). */ + gmt = *gmt_ptr; + } + + if (! (tm = localtime (&nowtime))) + return -1; + + if (gmt_ptr != NULL) + /*@-observertrans -dependenttrans@*/ + ftz.timezone = difftm (&gmt, tm) / 60; + /*@=observertrans =dependenttrans@*/ + else + /* We are on a system like VMS, where the system clock is + in local time and the system has no concept of timezones. + Hopefully we can fake this out (for the case in which the + user specifies no timezone) by just saying the timezone + is zero. */ + ftz.timezone = 0; + + if (tm->tm_isdst) + ftz.timezone += 60; + } + else + { + nowtime = now->time; + } + + tm = localtime(&nowtime); + yyYear = tm->tm_year + 1900; + yyMonth = tm->tm_mon + 1; + yyDay = tm->tm_mday; + yyTimezone = now->timezone; + yyDSTmode = DSTmaybe; + yyHour = 0; + yyMinutes = 0; + yySeconds = 0; + yyMeridian = MER24; + yyRelSeconds = 0; + yyRelMonth = 0; + yyHaveDate = 0; + yyHaveDay = 0; + yyHaveRel = 0; + yyHaveTime = 0; + yyHaveZone = 0; + + /*@-unrecog@*/ + if (yyparse() + || yyHaveTime > 1 || yyHaveZone > 1 || yyHaveDate > 1 || yyHaveDay > 1) + return -1; + /*@=unrecog@*/ + + if (yyHaveDate || yyHaveTime || yyHaveDay) { + Start = Convert(yyMonth, yyDay, yyYear, yyHour, yyMinutes, yySeconds, + yyMeridian, yyDSTmode); + if (Start < 0) + return -1; + } + else { + Start = nowtime; + if (!yyHaveRel) + Start -= ((tm->tm_hour * 60L + tm->tm_min) * 60L) + tm->tm_sec; + } + + Start += yyRelSeconds; + Start += RelativeMonth(Start, yyRelMonth); + + if (yyHaveDay && !yyHaveDate) { + tod = RelativeDate(Start, yyDayOrdinal, yyDayNumber); + Start += tod; + } + + /* Have to do *something* with a legitimate -1 so it's distinguishable + * from the error return value. (Alternately could set errno on error.) */ + return Start == -1 ? 0 : Start; +} + + +#if defined(TEST) + +/* ARGSUSED */ +int +main(ac, av) + int ac; + char *av[]; +{ + char buff[128]; + time_t d; + + (void)printf("Enter date, or blank line to exit.\n\t> "); + (void)fflush(stdout); + while (gets(buff) && buff[0]) { + d = get_date(buff, (struct timeb *)NULL); + if (d == -1) + (void)printf("Bad format - couldn't convert.\n"); + else + (void)printf("%s", ctime(&d)); + (void)printf("\t> "); + (void)fflush(stdout); + } + exit(0); + /* NOTREACHED */ +} +#endif /* defined(TEST) */ +#line 1102 "getdate.c" +/* allocate initial stack or double stack size, up to YYMAXDEPTH */ +static int yygrowstack(void) +{ + int newsize, i; + short *newss; + YYSTYPE *newvs; + + if ((newsize = yystacksize) == 0) + newsize = YYINITSTACKSIZE; + else if (newsize >= YYMAXDEPTH) + return -1; + else if ((newsize *= 2) > YYMAXDEPTH) + newsize = YYMAXDEPTH; + + i = yyssp - yyss; + newss = (yyss != 0) + ? (short *)realloc(yyss, newsize * sizeof(*newss)) + : (short *)malloc(newsize * sizeof(*newss)); + if (newss == 0) + return -1; + + yyss = newss; + yyssp = newss + i; + newvs = (yyvs != 0) + ? (YYSTYPE *)realloc(yyvs, newsize * sizeof(*newvs)) + : (YYSTYPE *)malloc(newsize * sizeof(*newvs)); + if (newvs == 0) + return -1; + + yyvs = newvs; + yyvsp = newvs + i; + yystacksize = newsize; + yysslim = yyss + newsize - 1; + return 0; +} + +#define YYABORT goto yyabort +#define YYREJECT goto yyabort +#define YYACCEPT goto yyaccept +#define YYERROR goto yyerrlab +int +yyparse(void) +{ + register int yym, yyn, yystate; +#if YYDEBUG + register const char *yys; + + if ((yys = getenv("YYDEBUG")) != 0) + { + yyn = *yys; + if (yyn >= '0' && yyn <= '9') + yydebug = yyn - '0'; + } +#endif + + yynerrs = 0; + yyerrflag = 0; + yychar = YYEMPTY; + + if (yyss == NULL && yygrowstack()) goto yyoverflow; + yyssp = yyss; + yyvsp = yyvs; + *yyssp = yystate = 0; + +yyloop: + if ((yyn = yydefred[yystate]) != 0) goto yyreduce; + if (yychar < 0) + { + if ((yychar = yylex()) < 0) yychar = 0; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("%sdebug: state %d, reading %d (%s)\n", + YYPREFIX, yystate, yychar, yys); + } +#endif + } + if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yychar) + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, shifting to state %d\n", + YYPREFIX, yystate, yytable[yyn]); +#endif + if (yyssp >= yysslim && yygrowstack()) + { + goto yyoverflow; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; + yychar = YYEMPTY; + if (yyerrflag > 0) --yyerrflag; + goto yyloop; + } + if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yychar) + { + yyn = yytable[yyn]; + goto yyreduce; + } + if (yyerrflag) goto yyinrecovery; + + yyerror("syntax error"); + +#ifdef lint + goto yyerrlab; +#endif + +yyerrlab: + ++yynerrs; + +yyinrecovery: + if (yyerrflag < 3) + { + yyerrflag = 3; + for (;;) + { + if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, error recovery shifting\ + to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); +#endif + if (yyssp >= yysslim && yygrowstack()) + { + goto yyoverflow; + } + *++yyssp = yystate = yytable[yyn]; + *++yyvsp = yylval; + goto yyloop; + } + else + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: error recovery discarding state %d\n", + YYPREFIX, *yyssp); +#endif + if (yyssp <= yyss) goto yyabort; + --yyssp; + --yyvsp; + } + } + } + else + { + if (yychar == 0) goto yyabort; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("%sdebug: state %d, error recovery discards token %d (%s)\n", + YYPREFIX, yystate, yychar, yys); + } +#endif + yychar = YYEMPTY; + goto yyloop; + } + +yyreduce: +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, reducing by rule %d (%s)\n", + YYPREFIX, yystate, yyn, yyrule[yyn]); +#endif + yym = yylen[yyn]; + if (yym) + yyval = yyvsp[1-yym]; + else + memset(&yyval, 0, sizeof yyval); + switch (yyn) + { +case 3: +#line 224 "./getdate.y" +{ + yyHaveTime++; + } +break; +case 4: +#line 227 "./getdate.y" +{ + yyHaveZone++; + } +break; +case 5: +#line 230 "./getdate.y" +{ + yyHaveDate++; + } +break; +case 6: +#line 233 "./getdate.y" +{ + yyHaveDay++; + } +break; +case 7: +#line 236 "./getdate.y" +{ + yyHaveRel++; + } +break; +case 9: +#line 242 "./getdate.y" +{ + yyHour = yyvsp[-1].Number; + yyMinutes = 0; + yySeconds = 0; + yyMeridian = yyvsp[0].Meridian; + } +break; +case 10: +#line 248 "./getdate.y" +{ + yyHour = yyvsp[-3].Number; + yyMinutes = yyvsp[-1].Number; + yySeconds = 0; + yyMeridian = yyvsp[0].Meridian; + } +break; +case 11: +#line 254 "./getdate.y" +{ + yyHour = yyvsp[-3].Number; + yyMinutes = yyvsp[-1].Number; + yyMeridian = MER24; + yyDSTmode = DSToff; + yyTimezone = - (yyvsp[0].Number % 100 + (yyvsp[0].Number / 100) * 60); + } +break; +case 12: +#line 261 "./getdate.y" +{ + yyHour = yyvsp[-5].Number; + yyMinutes = yyvsp[-3].Number; + yySeconds = yyvsp[-1].Number; + yyMeridian = yyvsp[0].Meridian; + } +break; +case 13: +#line 267 "./getdate.y" +{ + yyHour = yyvsp[-5].Number; + yyMinutes = yyvsp[-3].Number; + yySeconds = yyvsp[-1].Number; + yyMeridian = MER24; + yyDSTmode = DSToff; + yyTimezone = - (yyvsp[0].Number % 100 + (yyvsp[0].Number / 100) * 60); + } +break; +case 14: +#line 277 "./getdate.y" +{ + yyTimezone = yyvsp[0].Number; + yyDSTmode = DSToff; + } +break; +case 15: +#line 281 "./getdate.y" +{ + yyTimezone = yyvsp[0].Number; + yyDSTmode = DSTon; + } +break; +case 16: +#line 286 "./getdate.y" +{ + yyTimezone = yyvsp[-1].Number; + yyDSTmode = DSTon; + } +break; +case 17: +#line 292 "./getdate.y" +{ + yyDayOrdinal = 1; + yyDayNumber = yyvsp[0].Number; + } +break; +case 18: +#line 296 "./getdate.y" +{ + yyDayOrdinal = 1; + yyDayNumber = yyvsp[-1].Number; + } +break; +case 19: +#line 300 "./getdate.y" +{ + yyDayOrdinal = yyvsp[-1].Number; + yyDayNumber = yyvsp[0].Number; + } +break; +case 20: +#line 306 "./getdate.y" +{ + yyMonth = yyvsp[-2].Number; + yyDay = yyvsp[0].Number; + } +break; +case 21: +#line 310 "./getdate.y" +{ + if (yyvsp[-4].Number >= 100) { + yyYear = yyvsp[-4].Number; + yyMonth = yyvsp[-2].Number; + yyDay = yyvsp[0].Number; + } else { + yyMonth = yyvsp[-4].Number; + yyDay = yyvsp[-2].Number; + yyYear = yyvsp[0].Number; + } + } +break; +case 22: +#line 321 "./getdate.y" +{ + /* ISO 8601 format. yyyy-mm-dd. */ + yyYear = yyvsp[-2].Number; + yyMonth = -yyvsp[-1].Number; + yyDay = -yyvsp[0].Number; + } +break; +case 23: +#line 327 "./getdate.y" +{ + /* e.g. 17-JUN-1992. */ + yyDay = yyvsp[-2].Number; + yyMonth = yyvsp[-1].Number; + yyYear = -yyvsp[0].Number; + } +break; +case 24: +#line 333 "./getdate.y" +{ + yyMonth = yyvsp[-1].Number; + yyDay = yyvsp[0].Number; + } +break; +case 25: +#line 337 "./getdate.y" +{ + yyMonth = yyvsp[-3].Number; + yyDay = yyvsp[-2].Number; + yyYear = yyvsp[0].Number; + } +break; +case 26: +#line 342 "./getdate.y" +{ + yyMonth = yyvsp[0].Number; + yyDay = yyvsp[-1].Number; + } +break; +case 27: +#line 346 "./getdate.y" +{ + yyMonth = yyvsp[-1].Number; + yyDay = yyvsp[-2].Number; + yyYear = yyvsp[0].Number; + } +break; +case 28: +#line 353 "./getdate.y" +{ + yyRelSeconds = -yyRelSeconds; + yyRelMonth = -yyRelMonth; + } +break; +case 30: +#line 360 "./getdate.y" +{ + yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number * 60L; + } +break; +case 31: +#line 363 "./getdate.y" +{ + yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number * 60L; + } +break; +case 32: +#line 366 "./getdate.y" +{ + yyRelSeconds += yyvsp[0].Number * 60L; + } +break; +case 33: +#line 369 "./getdate.y" +{ + yyRelSeconds += yyvsp[-1].Number; + } +break; +case 34: +#line 372 "./getdate.y" +{ + yyRelSeconds += yyvsp[-1].Number; + } +break; +case 35: +#line 375 "./getdate.y" +{ + yyRelSeconds++; + } +break; +case 36: +#line 378 "./getdate.y" +{ + yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number; + } +break; +case 37: +#line 381 "./getdate.y" +{ + yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number; + } +break; +case 38: +#line 384 "./getdate.y" +{ + yyRelMonth += yyvsp[0].Number; + } +break; +case 39: +#line 389 "./getdate.y" +{ + if (yyHaveTime && yyHaveDate && !yyHaveRel) + yyYear = yyvsp[0].Number; + else { + if (yyvsp[0].Number>10000) { + yyHaveDate++; + yyDay= (yyvsp[0].Number)%100; + yyMonth= (yyvsp[0].Number/100)%100; + yyYear = yyvsp[0].Number/10000; + } + else { + yyHaveTime++; + if (yyvsp[0].Number < 100) { + yyHour = yyvsp[0].Number; + yyMinutes = 0; + } + else { + yyHour = yyvsp[0].Number / 100; + yyMinutes = yyvsp[0].Number % 100; + } + yySeconds = 0; + yyMeridian = MER24; + } + } + } +break; +case 40: +#line 416 "./getdate.y" +{ + yyval.Meridian = MER24; + } +break; +case 41: +#line 419 "./getdate.y" +{ + yyval.Meridian = yyvsp[0].Meridian; + } +break; +#line 1573 "getdate.c" + } + yyssp -= yym; + yystate = *yyssp; + yyvsp -= yym; + yym = yylhs[yyn]; + if (yystate == 0 && yym == 0) + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: after reduction, shifting from state 0 to\ + state %d\n", YYPREFIX, YYFINAL); +#endif + yystate = YYFINAL; + *++yyssp = YYFINAL; + *++yyvsp = yyval; + if (yychar < 0) + { + if ((yychar = yylex()) < 0) yychar = 0; +#if YYDEBUG + if (yydebug) + { + yys = 0; + if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; + if (!yys) yys = "illegal-symbol"; + printf("%sdebug: state %d, reading %d (%s)\n", + YYPREFIX, YYFINAL, yychar, yys); + } +#endif + } + if (yychar == 0) goto yyaccept; + goto yyloop; + } + if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == yystate) + yystate = yytable[yyn]; + else + yystate = yydgoto[yym]; +#if YYDEBUG + if (yydebug) + printf("%sdebug: after reduction, shifting from state %d \ +to state %d\n", YYPREFIX, *yyssp, yystate); +#endif + if (yyssp >= yysslim && yygrowstack()) + { + goto yyoverflow; + } + *++yyssp = yystate; + *++yyvsp = yyval; + goto yyloop; + +yyoverflow: + yyerror("yacc stack overflow"); + +yyabort: + return (1); + +yyaccept: + return (0); +} +/*@=charint =exportheader =longunsignedintegral =redecl =type =warnlintcomments @*/ +/*@=noeffect =branchstate =sizeoftype =usereleased @*/ +/*@=globs =evalorderuncon =modobserveruncon =modnomods @*/ +/*@=readonlytrans =modunconnomods =compdef =noeffectuncon @*/ +/*@=retvalint =usedef =varuse =nullderef =nullassign @*/ +/*@=globstate =statictrans =unqualifiedtrans =noparams @*/ + +/* + * strtoday() now uses get_date() (borrowed from GNU shellutils) + * which can handle many date formats, for example: + * 1970-09-17 # ISO 8601. + * 70-9-17 # This century assumed by default. + * 70-09-17 # Leading zeros are ignored. + * 9/17/72 # Common U.S. writing. + * 24 September 1972 + * 24 Sept 72 # September has a special abbreviation. + * 24 Sep 72 # Three-letter abbreviations always allowed. + * Sep 24, 1972 + * 24-sep-72 + * 24sep72 + */ +long strtoday (const char *str) +{ + time_t t; + + /* + * get_date() interprets an empty string as the current date, + * which is not what we expect, unless you're a BOFH :-). + * (useradd sets sp_expire = current date for new lusers) + */ + if (!str || *str == '\0') + return -1; + + t = get_date ((char *) str, (struct timeb *) 0); + if (t == (time_t) - 1) + return -1; + /* convert seconds to days since 1970-01-01 */ + return (t + DAY / 2) / DAY; +} + +#else /* !USE_GETDATE */ +/* + * Old code, just in case get_date() doesn't work as expected... + */ +#include +#ifdef HAVE_STRPTIME +/* + * for now we allow just one format, but we can define more later + * (we try them all until one succeeds). --marekm + */ +static char *date_formats[] = { + "%Y-%m-%d", + (char *) 0 +}; +#else +/* + * days and juldays are used to compute the number of days in the + * current month, and the cummulative number of days in the preceding + * months. they are declared so that january is 1, not 0. + */ +static short days[13] = { 0, + 31, 28, 31, 30, 31, 30, /* JAN - JUN */ + 31, 31, 30, 31, 30, 31 +}; /* JUL - DEC */ + +static short juldays[13] = { 0, + 0, 31, 59, 90, 120, 151, /* JAN - JUN */ + 181, 212, 243, 273, 304, 334 +}; /* JUL - DEC */ +#endif + +/* + * strtoday - compute the number of days since 1970. + * + * the total number of days prior to the current date is + * computed. january 1, 1970 is used as the origin with + * it having a day number of 0. + */ + +long strtoday (const char *str) +{ +#ifdef HAVE_STRPTIME + struct tm tp; + char *const *fmt; + char *cp; + time_t result; + + memzero (&tp, sizeof tp); + for (fmt = date_formats; *fmt; fmt++) { + cp = strptime ((char *) str, *fmt, &tp); + if (!cp || *cp != '\0') + continue; + + result = mktime (&tp); + if (result == (time_t) - 1) + continue; + + return result / DAY; /* success */ + } + return -1; +#else + char slop[2]; + int month; + int day; + int year; + long total; + + /* + * start by separating the month, day and year. the order + * is compiled in ... + */ + + if (sscanf (str, "%d/%d/%d%c", &year, &month, &day, slop) != 3) + return -1; + + /* + * the month, day of the month, and year are checked for + * correctness and the year adjusted so it falls between + * 1970 and 2069. + */ + + if (month < 1 || month > 12) + return -1; + + if (day < 1) + return -1; + + if ((month != 2 || (year % 4) != 0) && day > days[month]) + return -1; + else if ((month == 2 && (year % 4) == 0) && day > 29) + return -1; + + if (year < 0) + return -1; + else if (year <= 69) + year += 2000; + else if (year <= 99) + year += 1900; + + /* + * On systems with 32-bit signed time_t, time wraps around in 2038 + * - for now we just limit the year to 2037 (instead of 2069). + * This limit can be removed once no one is using 32-bit systems + * anymore :-). --marekm + */ + if (year < 1970 || year > 2037) + return -1; + + /* + * the total number of days is the total number of days in all + * the whole years, plus the number of leap days, plus the + * number of days in the whole months preceding, plus the number + * of days so far in the month. + */ + + total = (long) ((year - 1970) * 365L) + (((year + 1) - 1970) / 4); + total += (long) juldays[month] + (month > 2 && (year % 4) == 0 ? 1 : 0); + total += (long) day - 1; + + return total; +#endif /* HAVE_STRPTIME */ +} +#endif /* !USE_GETDATE */ diff --git a/rpm-5.4.9/lua/shadow/useradd.c b/rpm-5.4.9/lua/shadow/useradd.c new file mode 100644 index 0000000..8b60b53 --- /dev/null +++ b/rpm-5.4.9/lua/shadow/useradd.c @@ -0,0 +1,2014 @@ +/* + * This file was originally distributed as part of + * shadow-utils-4.0.17-12.fc6.src.rpm and has been modified + * in WRLinux for inclusion in rpm. + */ + +/* + * Copyright 1991 - 1994, Julianne Frances Haugh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Julianne F. Haugh nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "system.h" +#include "shadow_config.h" + +#ident "$Id: useradd.c,v 1.10 2010/10/18 16:29:16 jbj Exp $" + +#include +#include +#include +#include +#ifdef USE_PAM +#include "pam_defs.h" +#endif /* USE_PAM */ +#include +#include "chkname.h" +#include "defines.h" +#include "faillog.h" +#include "getdef.h" +#include "groupio.h" +#include "nscd.h" +#include "prototypes.h" +#include "pwauth.h" +#include "pwio.h" +#ifdef SHADOWGRP +#include "sgroupio.h" +#endif +#include "shadowio.h" + +#include "debug.h" + +#ifndef SKEL_DIR +#define SKEL_DIR "/etc/skel" +#endif +#ifndef USER_DEFAULTS_FILE +#define USER_DEFAULTS_FILE "/etc/default/useradd" +#define NEW_USER_FILE "/etc/default/nuaddXXXXXX" +#endif +/* + * Needed for MkLinux DR1/2/2.1 - J. + */ +#ifndef LASTLOG_FILE +#define LASTLOG_FILE "/var/log/lastlog" +#endif +/* + * Global variables + */ + +static jmp_buf lclack; /* longjmp() instead of exit()'ing in local functions! */ + +/* + * These defaults are used if there is no defaults file. + */ +static gid_t def_group = 100; +static const char *def_gname = "other"; +static const char *def_home = "/home"; +static const char *def_shell = "/sbin/nologin"; +static const char *def_template = SKEL_DIR; +static const char *def_create_mail_spool = "no"; + +static long def_inactive = -1; +static const char *def_expire = ""; + +static char def_file[] = USER_DEFAULTS_FILE; + +#define VALID(s) (strcspn (s, ":\n") == strlen (s)) + +static const char *user_name = ""; +static const char *user_pass = "!!"; +static uid_t user_id; +static gid_t user_gid; +static const char *user_comment = ""; +static const char *user_home = ""; +static const char *user_shell = ""; +static const char *create_mail_spool = ""; + +static long user_expire = -1; +static int is_shadow_pwd; + +#ifdef SHADOWGRP +static int is_shadow_grp; +#endif +static char **user_groups; /* NULL-terminated list */ +static long sys_ngroups; +static int do_grp_update = 0; /* group files need to be updated */ + +static char *Prog = "rpm:lua:wrs.useradd"; + +static int + bflg = 0, /* new default root of home directory */ + cflg = 0, /* comment (GECOS) field for new account */ + dflg = 0, /* home directory for new account */ + Dflg = 0, /* set/show new user default values */ + eflg = 0, /* days since 1970-01-01 when account is locked */ + fflg = 0, /* days until account with expired password is locked */ + gflg = 0, /* primary group ID for new account */ + Gflg = 0, /* secondary group set for new account */ + kflg = 0, /* specify a directory to fill new user directory */ + mflg = 0, /* create user's home directory if it doesn't exist */ + lflg = 0, /* do not add user to lastlog database file */ + Mflg = 0, /* do NOT create user's home directory no matter what */ + nflg = 0, /* do NOT create a group having the same name as the user */ + oflg = 0, /* permit non-unique user ID to be specified with -u */ + rflg = 0, /* create a system account */ + sflg = 0, /* shell program for new account */ + uflg = 0; /* specify user ID for new account */ + +extern char *optarg; +extern int optind; + +static int home_added; + +/* + * exit status values + */ +#define E_SUCCESS 0 /* success */ +#define E_PW_UPDATE 1 /* can't update password file */ +#define E_USAGE 2 /* invalid command syntax */ +#define E_BAD_ARG 3 /* invalid argument to option */ +#define E_UID_IN_USE 4 /* UID already in use (and no -o) */ +#define E_NOTFOUND 6 /* specified group doesn't exist */ +#define E_NAME_IN_USE 9 /* username already in use */ +#define E_GRP_UPDATE 10 /* can't update group file */ +#define E_HOMEDIR 12 /* can't create home directory */ +#define E_MAIL_SPOOL 13 /* can't create mail spool */ + +#define DGROUP "GROUP=" +#define HOME "HOME=" +#define SHELL "SHELL=" +#define INACT "INACTIVE=" +#define EXPIRE "EXPIRE=" +#define SKEL "SKEL=" +#define CREATE_MAIL_SPOOL "CREATE_MAIL_SPOOL=" + +#define NO_GETGRENT 1 +#define NO_GETPWENT 1 + +/* local function prototypes */ +static void fail_exit (int); +static const struct group *getgr_nam_gid (const char *); +static long get_number (const char *); +static uid_t get_uid (const char *); +static void get_defaults (void); +static void show_defaults (void); +static int set_defaults (void); +static int get_groups (char *); +static void usage (void); +static void new_pwent (struct passwd *); + +static long scale_age (long); +static void new_spent (struct spwd *); +static void grp_update (void); +static void find_new_uid (void); + +static void process_flags (int argc, char **argv); +static void close_files (void); +static void open_files (void); +static void faillog_reset (uid_t); +static void lastlog_reset (uid_t); +static void usr_update (void); +static void create_home (void); +static void create_mail (void); + +/* + * fail_exit - undo as much as possible + */ +static void fail_exit (int code) +{ + if (home_added) + rmdir (user_home); + +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "adding user", user_name, -1, + 0); +#endif + SYSLOG ((LOG_INFO, "failed adding user `%s', data deleted", user_name)); + + longjmp(lclack,code); /* must be non-zero! */ +} + +static const struct group *lcl_getgrnam (const char *grname) + { + const struct group *grp; + + open_files(); + +#ifdef NO_GETGRENT + gr_rewind (); + while ((grp = gr_next ())) +#else + setgrent (); + while ((grp = getgrent ())) +#endif + { + if (strcmp (grname, grp->gr_name) == 0) { + close_files(); + return grp; + } + } + + close_files(); + + return NULL; + } + +static const struct group *lcl_getgrgid (long gid) + { + const struct group *grp; + + open_files(); + +#ifdef NO_GETGRENT + gr_rewind (); + while ((grp = gr_next ())) +#else + setgrent (); + while ((grp = getgrent ())) +#endif + { + if (grp->gr_gid == (gid_t)gid) { + close_files(); + return grp; + } + } + close_files(); + + return NULL; + } + +static const struct group *getgr_nam_gid (const char *grname) +{ + long gid; + char *errptr; + + const struct group* grp = lcl_getgrnam(grname); + if (grp) + return grp; + + gid = strtol (grname, &errptr, 10); + if (*errptr || errno == ERANGE || gid < 0) { + fprintf (stderr, + _("%s: invalid numeric argument '%s'\n"), Prog, grname); + fail_exit (E_BAD_ARG); + } + return lcl_getgrgid (gid); +} + +static long get_number (const char *numstr) +{ + long val; + char *errptr; + + val = strtol (numstr, &errptr, 10); + if (*errptr || errno == ERANGE) { + fprintf (stderr, _("%s: invalid numeric argument '%s'\n"), Prog, + numstr); + fail_exit (E_BAD_ARG); + } + return val; +} + +static uid_t get_uid (const char *uidstr) +{ + long val; + char *errptr; + + val = strtol (uidstr, &errptr, 10); + if (*errptr || errno == ERANGE || val < 0) { + fprintf (stderr, + _("%s: invalid numeric argument '%s'\n"), Prog, + uidstr); + fail_exit (E_BAD_ARG); + } + return val; +} + +#define MATCH(x,y) (strncmp((x),(y),strlen(y)) == 0) + +/* + * get_defaults - read the defaults file + * + * get_defaults() reads the defaults file for this command. It sets the + * various values from the file, or uses built-in default values if the + * file does not exist. + */ +static void get_defaults (void) +{ + FILE *fp; + char buf[1024]; + char *cp, *ep; + const struct group *grp; + + /* + * Open the defaults file for reading. + */ + + if (!(fp = fopen (def_file, "r"))) + return; + + /* + * Read the file a line at a time. Only the lines that have relevant + * values are used, everything else can be ignored. + */ + while (fgets (buf, sizeof buf, fp)) { + if ((cp = strrchr (buf, '\n'))) + *cp = '\0'; + + if (!(cp = strchr (buf, '='))) + continue; + + cp++; + + /* + * Primary GROUP identifier + */ + if (MATCH (buf, DGROUP)) { + unsigned int val = (unsigned int) strtoul (cp, &ep, 10); + + if (*cp != '\0' && *ep == '\0') { /* valid number */ + def_group = val; + if ((grp = lcl_getgrgid (def_group))) { + def_gname = strdup (grp->gr_name); +assert(def_gname != NULL); + } else { + fprintf (stderr, + _("%s: unknown GID %s\n"), + Prog, cp); + } + } else if ((grp = lcl_getgrnam (cp))) { + def_group = grp->gr_gid; + def_gname = strdup (cp); +assert(def_gname != NULL); + } else { + fprintf (stderr, + _("%s: unknown group %s\n"), Prog, cp); + } + } + + /* + * Default HOME filesystem + */ + else if (MATCH (buf, HOME)) { + def_home = strdup (cp); +assert(def_home != NULL); + } + + /* + * Default Login Shell command + */ + else if (MATCH (buf, SHELL)) { + def_shell = strdup (cp); +assert(def_shell != NULL); + } + + /* + * Default Password Inactive value + */ + else if (MATCH (buf, INACT)) { + long val = strtol (cp, &ep, 10); + + if (*cp != '\0' && *ep == '\0') /* valid number */ + def_inactive = val; + else + def_inactive = -1; + } + + /* + * Default account expiration date + */ + else if (MATCH (buf, EXPIRE)) { + def_expire = strdup (cp); +assert(def_expire != NULL); + } + + /* + * Default Skeleton information + */ + else if (MATCH (buf, SKEL)) { + if (*cp == '\0') + cp = SKEL_DIR; /* XXX warning: const */ + + def_template = strdup (cp); +assert(def_template != NULL); + } + + /* + * Create by default user mail spool or not ? + */ + else if (MATCH (buf, CREATE_MAIL_SPOOL)) { + if (*cp == '\0') + cp = CREATE_MAIL_SPOOL; /* XXX warning: const */ + + def_create_mail_spool = strdup (cp); +assert(def_create_mail_spool != NULL); + } + } +} + +/* + * show_defaults - show the contents of the defaults file + * + * show_defaults() displays the values that are used from the default + * file and the built-in values. + */ +static void show_defaults (void) +{ + printf ("GROUP=%u\n", (unsigned int) def_group); + printf ("HOME=%s\n", def_home); + printf ("INACTIVE=%ld\n", def_inactive); + printf ("EXPIRE=%s\n", def_expire); + printf ("SHELL=%s\n", def_shell); + printf ("SKEL=%s\n", def_template); + printf ("CREATE_MAIL_SPOOL=%s\n", def_create_mail_spool); +} + +/* + * set_defaults - write new defaults file + * + * set_defaults() re-writes the defaults file using the values that + * are currently set. Duplicated lines are pruned, missing lines are + * added, and unrecognized lines are copied as is. + */ +static int set_defaults (void) +{ + FILE *ifp; + FILE *ofp; + char buf[1024]; + static char new_file[] = NEW_USER_FILE; + char *cp; + int ofd; + int out_group = 0; + int out_home = 0; + int out_inactive = 0; + int out_expire = 0; + int out_shell = 0; + int out_skel = 0; + int out_create_mail_spool = 0; + + /* + * Create a temporary file to copy the new output to. + */ + if ((ofd = mkstemp (new_file)) == -1) { + fprintf (stderr, + _("%s: cannot create new defaults file\n"), Prog); + return -1; + } + + if (!(ofp = fdopen (ofd, "w"))) { + fprintf (stderr, _("%s: cannot open new defaults file\n"), + Prog); + return -1; + } + + /* + * Open the existing defaults file and copy the lines to the + * temporary file, using any new values. Each line is checked + * to insure that it is not output more than once. + */ + if (!(ifp = fopen (def_file, "r"))) { + fprintf (ofp, "# useradd defaults file\n"); + goto skip; + } + + while (fgets (buf, sizeof buf, ifp)) { + if ((cp = strrchr (buf, '\n'))) + *cp = '\0'; + + if (!out_group && MATCH (buf, DGROUP)) { + fprintf (ofp, DGROUP "%u\n", (unsigned int) def_group); + out_group++; + } else if (!out_home && MATCH (buf, HOME)) { + fprintf (ofp, HOME "%s\n", def_home); + out_home++; + } else if (!out_inactive && MATCH (buf, INACT)) { + fprintf (ofp, INACT "%ld\n", def_inactive); + out_inactive++; + } else if (!out_expire && MATCH (buf, EXPIRE)) { + fprintf (ofp, EXPIRE "%s\n", def_expire); + out_expire++; + } else if (!out_shell && MATCH (buf, SHELL)) { + fprintf (ofp, SHELL "%s\n", def_shell); + out_shell++; + } else if (!out_skel && MATCH (buf, SKEL)) { + fprintf (ofp, SKEL "%s\n", def_template); + out_skel++; + } else if (!out_create_mail_spool + && MATCH (buf, CREATE_MAIL_SPOOL)) { + fprintf (ofp, CREATE_MAIL_SPOOL "%s\n", + def_create_mail_spool); + out_create_mail_spool++; + } else + fprintf (ofp, "%s\n", buf); + } + fclose (ifp); + + skip: + /* + * Check each line to insure that every line was output. This + * causes new values to be added to a file which did not previously + * have an entry for that value. + */ + if (!out_group) + fprintf (ofp, DGROUP "%u\n", (unsigned int) def_group); + if (!out_home) + fprintf (ofp, HOME "%s\n", def_home); + if (!out_inactive) + fprintf (ofp, INACT "%ld\n", def_inactive); + if (!out_expire) + fprintf (ofp, EXPIRE "%s\n", def_expire); + if (!out_shell) + fprintf (ofp, SHELL "%s\n", def_shell); + if (!out_skel) + fprintf (ofp, SKEL "%s\n", def_template); + + if (!out_create_mail_spool) + fprintf (ofp, CREATE_MAIL_SPOOL "%s\n", def_create_mail_spool); + + /* + * Flush and close the file. Check for errors to make certain + * the new file is intact. + */ + fflush (ofp); + if (ferror (ofp) || fclose (ofp)) { + unlink (new_file); + return -1; + } + + /* + * Rename the current default file to its backup name. + */ + snprintf (buf, sizeof buf, "%s-", def_file); + if (rename (def_file, buf) && errno != ENOENT) { + snprintf (buf, sizeof buf, _("%s: rename: %s"), Prog, def_file); + perror (buf); + unlink (new_file); + return -1; + } + + /* + * Rename the new default file to its correct name. + */ + if (rename (new_file, def_file)) { + snprintf (buf, sizeof buf, _("%s: rename: %s"), Prog, new_file); + perror (buf); + return -1; + } +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "changing user defaults", + NULL, -1, 1); +#endif + SYSLOG ((LOG_INFO, + "useradd defaults: GROUP=%u, HOME=%s, SHELL=%s, INACTIVE=%ld, " + "EXPIRE=%s, SKEL=%s, CREATE_MAIL_SPOOL=%s", + (unsigned int) def_group, def_home, def_shell, + def_inactive, def_expire, def_template, + def_create_mail_spool)); + return 0; +} + +/* + * get_groups - convert a list of group names to an array of group IDs + * + * get_groups() takes a comma-separated list of group names and + * converts it to a NULL-terminated array. Any unknown group + * names are reported as errors. + */ +static int get_groups (char *list) +{ + char *cp; + const struct group *grp; + int errors = 0; + int ngroups = 0; + + if (!*list) + return 0; + + /* + * So long as there is some data to be converted, strip off + * each name and look it up. A mix of numerical and string + * values for group identifiers is permitted. + */ + do { + /* + * Strip off a single name from the list + */ + if ((cp = strchr (list, ','))) + *cp++ = '\0'; + + /* + * Names starting with digits are treated as numerical + * GID values, otherwise the string is looked up as is. + */ + grp = getgr_nam_gid (list); + + /* + * There must be a match, either by GID value or by + * string name. + */ + if (!grp) { + fprintf (stderr, _("%s: unknown group %s\n"), + Prog, list); + errors++; + } + list = cp; + + /* + * If the group doesn't exist, don't dump core... + * Instead, try the next one. --marekm + */ + if (!grp) + continue; + +#ifdef USE_NIS + /* + * Don't add this group if they are an NIS group. Tell + * the user to go to the server for this group. + */ + if (__isgrNIS ()) { + fprintf (stderr, + _("%s: group '%s' is a NIS group.\n"), + Prog, grp->gr_name); + continue; + } +#endif + + if (ngroups == sys_ngroups) { + fprintf (stderr, + _ + ("%s: too many groups specified (max %d).\n"), + Prog, ngroups); + break; + } + + /* + * Add the group name to the user's list of groups. + */ + user_groups[ngroups] = strdup (grp->gr_name); +assert(user_groups[ngroups] != NULL); + ngroups++; + } while (list); + + user_groups[ngroups] = (char *) 0; + + /* + * Any errors in finding group names are fatal + */ + if (errors) + return -1; + + return 0; +} + +/* + * usage - display usage message and exit + */ +static void usage (void) +{ + fprintf (stderr, _("Usage: useradd [options] LOGIN\n" + "\n" + "Options:\n" + " -b, --base-dir BASE_DIR base directory for the new user account\n" + " home directory\n" + " -c, --comment COMMENT set the GECOS field for the new user account\n" + " -d, --home-dir HOME_DIR home directory for the new user account\n" + " -D, --defaults print or save modified default useradd\n" + " configuration\n" + " -e, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE\n" + " -f, --inactive INACTIVE set password inactive after expiration\n" + " to INACTIVE\n" + " -g, --gid GROUP force use GROUP for the new user account\n" + " -G, --groups GROUPS list of supplementary groups for the new\n" + " user account\n" + " -h, --help display this help message and exit\n" + " -k, --skel SKEL_DIR specify an alternative skel directory\n" + " -K, --key KEY=VALUE overrides /etc/login.defs defaults\n" + " -m, --create-home create home directory for the new user\n" + " account\n" + " -l, do not add user to lastlog database file\n" + " -M, do not create user's home directory(overrides /etc/login.defs)\n" + " -r, create system account\n" + " -o, --non-unique allow create user with duplicate\n" + " (non-unique) UID\n" + " -p, --password PASSWORD use encrypted password for the new user\n" + " account\n" + " -s, --shell SHELL the login shell for the new user account\n" + " -u, --uid UID force use the UID for the new user account\n" + "\n")); + fail_exit (E_USAGE); +} + +/* + * new_pwent - initialize the values in a password file entry + * + * new_pwent() takes all of the values that have been entered and + * fills in a (struct passwd) with them. + */ +static void new_pwent (struct passwd *pwent) +{ + memzero (pwent, sizeof *pwent); + pwent->pw_name = (char *) user_name; + if (is_shadow_pwd) + pwent->pw_passwd = (char *) SHADOW_PASSWD_STRING; + else + pwent->pw_passwd = (char *) user_pass; + + pwent->pw_uid = user_id; + pwent->pw_gid = user_gid; + pwent->pw_gecos = (char *) user_comment; + pwent->pw_dir = (char *) user_home; + pwent->pw_shell = (char *) user_shell; +} + +static long scale_age (long x) +{ + if (x <= 0) + return x; + + return x * (DAY / SCALE); +} + +/* + * new_spent - initialize the values in a shadow password file entry + * + * new_spent() takes all of the values that have been entered and + * fills in a (struct spwd) with them. + */ +static void new_spent (struct spwd *spent) +{ + memzero (spent, sizeof *spent); + spent->sp_namp = (char *) user_name; + spent->sp_pwdp = (char *) user_pass; + spent->sp_lstchg = time ((time_t *) 0) / SCALE; + if (!rflg) { + spent->sp_min = scale_age (getdef_num ("PASS_MIN_DAYS", -1)); + spent->sp_max = scale_age (getdef_num ("PASS_MAX_DAYS", -1)); + spent->sp_warn = scale_age (getdef_num ("PASS_WARN_AGE", -1)); + spent->sp_inact = scale_age (def_inactive); + spent->sp_expire = scale_age (user_expire); + } + else { + spent->sp_min = scale_age(-1); + spent->sp_max = scale_age(-1); + spent->sp_warn = scale_age(-1); + spent->sp_inact = scale_age(-1); + spent->sp_expire = scale_age(-1); + } + spent->sp_flag = -1; +} + +/* + * grp_update - add user to secondary group set + * + * grp_update() takes the secondary group set given in user_groups + * and adds the user to each group given by that set. + */ +static void grp_update (void) +{ + const struct group *grp; + struct group *ngrp; + +#ifdef SHADOWGRP + const struct sgrp *sgrp; + struct sgrp *nsgrp; +#endif + + /* + * Test for unique entries of user_groups in /etc/group + * pvrabec@redhat.com + */ + char **user_groups_tmp = user_groups; + + while (*user_groups_tmp) { + int count = 0; + + for (gr_rewind (), grp = gr_next (); grp && count < 2; + grp = gr_next ()) { + if (strcmp (*user_groups_tmp, grp->gr_name) == 0) { + count++; + } + } + if (count > 1) { + fprintf (stderr, + "%s: error not unique group names in group file\n", + Prog); + fail_exit (E_GRP_UPDATE); + } + user_groups_tmp++; + } + + /* Locking and opening of the group files moved to open_files() --gafton */ + + /* + * Scan through the entire group file looking for the groups that + * the user is a member of. + */ + for (gr_rewind (), grp = gr_next (); grp; grp = gr_next ()) { + + /* + * See if the user specified this group as one of their + * concurrent groups. + */ + if (!is_on_list (user_groups, grp->gr_name)) + continue; + + /* + * Make a copy - gr_update() will free() everything + * from the old entry, and we need it later. + */ + ngrp = __gr_dup (grp); + if (!ngrp) { + fail_exit (E_GRP_UPDATE); /* XXX */ + } + + /* + * Add the username to the list of group members and + * update the group entry to reflect the change. + */ + ngrp->gr_mem = add_list (ngrp->gr_mem, user_name); + if (!gr_update (ngrp)) { + fprintf (stderr, + _("%s: error adding new group entry\n"), Prog); + fail_exit (E_GRP_UPDATE); + } +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, + "adding user to group", user_name, -1, 1); +#endif + SYSLOG ((LOG_INFO, "add `%s' to group `%s'", + user_name, ngrp->gr_name)); + } + +#ifdef SHADOWGRP + if (!is_shadow_grp) + return; + + /* + * Scan through the entire shadow group file looking for the groups + * that the user is a member of. The administrative list isn't + * modified. + */ + for (sgr_rewind (), sgrp = sgr_next (); sgrp; sgrp = sgr_next ()) { + + /* + * See if the user specified this group as one of their + * concurrent groups. + */ + if (!gr_locate (sgrp->sg_name)) + continue; + + if (!is_on_list (user_groups, sgrp->sg_name)) + continue; + + /* + * Make a copy - sgr_update() will free() everything + * from the old entry, and we need it later. + */ + nsgrp = __sgr_dup (sgrp); + if (!nsgrp) { + fail_exit (E_GRP_UPDATE); /* XXX */ + } + + /* + * Add the username to the list of group members and + * update the group entry to reflect the change. + */ + nsgrp->sg_mem = add_list (nsgrp->sg_mem, user_name); + if (!sgr_update (nsgrp)) { + fprintf (stderr, + _("%s: error adding new group entry\n"), Prog); + fail_exit (E_GRP_UPDATE); + } +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, + "adding user to shadow group", user_name, -1, 1); +#endif + SYSLOG ((LOG_INFO, "add `%s' to shadow group `%s'", + user_name, nsgrp->sg_name)); + } +#endif /* SHADOWGRP */ + + return; +} + +/* + * find_new_uid - find the next available UID + * + * find_new_uid() locates the next highest unused UID in the password + * file, or checks the given user ID against the existing ones for + * uniqueness. + */ +static void find_new_uid (void) +{ + const struct passwd *pwd; + uid_t uid_min, uid_max; + + if (!rflg) { + uid_min = getdef_unum ("UID_MIN", 500); + uid_max = getdef_unum ("UID_MAX", 60000); + } + else { + uid_min = 1; + uid_max = getdef_unum ("UID_MIN", 500) - 1; + } + + /* + * Start with some UID value if the user didn't provide us with + * one already. + */ + if (!uflg) + user_id = uid_min; + + /* + * Search the entire password file, either looking for this + * UID (if the user specified one with -u) or looking for the + * largest unused value. + */ +#ifdef NO_GETPWENT + pw_rewind (); + while ((pwd = pw_next ())) { +#else /* using getpwent() we can check against NIS users etc. */ + setpwent (); + while ((pwd = getpwent ())) { +#endif + if (strcmp (user_name, pwd->pw_name) == 0) { + fprintf (stderr, _("%s: name %s is not unique\n"), + Prog, user_name); +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "adding user", + user_name, user_id, 0); +#endif + fail_exit (E_NAME_IN_USE); + } + if (!oflg && uflg && user_id == pwd->pw_uid) { + fprintf (stderr, _("%s: UID %u is not unique\n"), + Prog, (unsigned int) user_id); +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "adding user", + user_name, user_id, 0); +#endif + fail_exit (E_UID_IN_USE); + } + if (!uflg && pwd->pw_uid >= user_id) { + if (pwd->pw_uid > uid_max) + continue; + user_id = pwd->pw_uid + 1; + } + } + + /* + * If a user with UID equal to UID_MAX exists, the above algorithm + * will give us UID_MAX+1 even if not unique. Search for the first + * free UID starting with UID_MIN (it's O(n*n) but can be avoided + * by not having users with UID equal to UID_MAX). --marekm + */ + if (!uflg && user_id == uid_max + 1) { + for (user_id = uid_min; user_id < uid_max; user_id++) { +#ifdef NO_GETPWENT + pw_rewind (); + while ((pwd = pw_next ()) + && pwd->pw_uid != user_id); + if (!pwd) + break; +#else + if (!getpwuid (user_id)) + break; +#endif + } + if (user_id == uid_max) { + fprintf (stderr, _("%s: can't get unique UID\n"), Prog); + fail_exit (E_UID_IN_USE); + } + } +} + + /* + * find_new_gid - find the next available GID + * + * find_new_gid() locates the next highest unused GID in the group + * file, or checks the given group ID against the existing ones for + * uniqueness. + */ + +static void find_new_gid (void) +{ + const struct group *grp; + gid_t gid_min, gid_max; + + if (!rflg) { + gid_min = getdef_unum ("GID_MIN", 500); + gid_max = getdef_unum ("GID_MAX", 60000); + } else { + gid_min = 1; + gid_max = getdef_unum ("GID_MIN", 500) - 1; + } + + /* + * Start with some GID value if the user didn't provide us with + * one already. + */ + user_gid = gid_min; + + /* + * Search the entire group file, either looking for this + * GID (if the user specified one with -g) or looking for the + * largest unused value. + */ +#ifdef NO_GETGRENT + gr_rewind (); + while ((grp = gr_next ())) +#else + setgrent (); + while ((grp = getgrent ())) +#endif + { + if (strcmp (user_name, grp->gr_name) == 0) { + user_gid = grp->gr_gid; + return; + } + if (grp->gr_gid >= user_gid) { + if (grp->gr_gid > gid_max) + continue; + user_gid = grp->gr_gid + 1; + } + } +#ifndef NO_GETGRENT /* glibc does have this, so ... */ + /* A quick test gets here: if the UID is available + * as a GID, go ahead and use it */ + if (!lcl_getgrgid (user_id)) { + user_gid = user_id; + return; + } +#endif + if (user_gid == gid_max + 1) { + for (user_gid = gid_min; user_gid < gid_max; user_gid++) { +#ifdef NO_GETGRENT + gr_rewind (); + while ((grp = gr_next ()) && grp->gr_gid != user_gid); + if (!grp) + break; +#else + if (!lcl_getgrgid (user_gid)) + break; +#endif + } + if (user_gid == gid_max) { + fprintf (stderr, + "%s: can't get unique gid (run out of GIDs)\n", + Prog); + fail_exit (4); + } + } +} + +/* + * process_flags - perform command line argument setting + * + * process_flags() interprets the command line arguments and sets + * the values that the user will be created with accordingly. The + * values are checked for sanity. + */ +static void process_flags (int argc, char **argv) +{ + const struct group *grp; + int anyflag = 0; + char *cp; + + { + /* + * Parse the command line options. + */ + int c; + static struct option long_options[] = { + {"base-dir", required_argument, NULL, 'b'}, + {"comment", required_argument, NULL, 'c'}, + {"home-dir", required_argument, NULL, 'd'}, + {"defaults", required_argument, NULL, 'D'}, + {"expiredate", required_argument, NULL, 'e'}, + {"inactive", required_argument, NULL, 'f'}, + {"gid", required_argument, NULL, 'g'}, + {"groups", required_argument, NULL, 'G'}, + {"help", no_argument, NULL, 'h'}, + {"skel", required_argument, NULL, 'k'}, + {"key", required_argument, NULL, 'K'}, + {"create-home", no_argument, NULL, 'm'}, + {"non-unique", no_argument, NULL, 'o'}, + {"password", required_argument, NULL, 'p'}, + {"shell", required_argument, NULL, 's'}, + {"uid", required_argument, NULL, 'u'}, + {NULL, 0, NULL, '\0'} + }; + while ((c = + getopt_long (argc, argv, "b:c:d:De:f:g:G:k:K:mlMnrop:s:u:", + long_options, NULL)) != -1) { + switch (c) { + case 'b': + if (!Dflg) + usage (); + + if (!VALID (optarg) + || optarg[0] != '/') { + fprintf (stderr, + _ + ("%s: invalid base directory '%s'\n"), + Prog, optarg); + fail_exit (E_BAD_ARG); + } + def_home = optarg; + bflg++; + break; + case 'c': + if (!VALID (optarg)) { + fprintf (stderr, + _ + ("%s: invalid comment '%s'\n"), + Prog, optarg); + fail_exit (E_BAD_ARG); + } + user_comment = optarg; + cflg++; + break; + case 'd': + if (!VALID (optarg) + || optarg[0] != '/') { + fprintf (stderr, + _ + ("%s: invalid home directory '%s'\n"), + Prog, optarg); + fail_exit (E_BAD_ARG); + } + user_home = optarg; + dflg++; + break; + case 'D': + if (anyflag) + usage (); + Dflg++; + break; + case 'e': + if (*optarg) { + user_expire = strtoday (optarg); + if (user_expire == -1) { + fprintf (stderr, + _ + ("%s: invalid date '%s'\n"), + Prog, optarg); + fail_exit (E_BAD_ARG); + } + } else + user_expire = -1; + + /* + * -e "" is allowed - it's a no-op without /etc/shadow + */ + if (*optarg && !is_shadow_pwd) { + fprintf (stderr, + _ + ("%s: shadow passwords required for -e\n"), + Prog); + fail_exit (E_USAGE); + } + if (Dflg) + def_expire = optarg; + eflg++; + break; + case 'f': + def_inactive = get_number (optarg); + /* + * -f -1 is allowed - it's a no-op without /etc/shadow + */ + if (def_inactive != -1 && !is_shadow_pwd) { + fprintf (stderr, + _ + ("%s: shadow passwords required for -f\n"), + Prog); + fail_exit (E_USAGE); + } + fflg++; + break; + case 'g': + grp = getgr_nam_gid (optarg); + if (!grp) { + fprintf (stderr, + _ + ("%s: unknown group %s\n"), + Prog, optarg); + fail_exit (E_NOTFOUND); + } + if (Dflg) { + def_group = grp->gr_gid; + def_gname = optarg; + } else { + user_gid = grp->gr_gid; + } + gflg++; + break; + case 'G': + if (get_groups (optarg)) + fail_exit (E_NOTFOUND); + if (user_groups[0]) + do_grp_update++; + Gflg++; + break; + case 'h': + usage (); + break; + case 'k': + def_template = optarg; + kflg++; + break; + case 'K': + /* + * override login.defs defaults (-K name=value) + * example: -K UID_MIN=100 -K UID_MAX=499 + * note: -K UID_MIN=10,UID_MAX=499 doesn't work yet + */ + cp = strchr (optarg, '='); + if (!cp) { + fprintf (stderr, + _ + ("%s: -K requires KEY=VALUE\n"), + Prog); + fail_exit (E_BAD_ARG); + } + /* terminate name, point to value */ + *cp++ = '\0'; + if (putdef_str (optarg, cp) < 0) + fail_exit (E_BAD_ARG); + break; + case 'm': + mflg++; + break; + case 'l': + lflg++; + break; + case 'o': + oflg++; + break; + case 'p': /* set encrypted password */ + if (!VALID (optarg)) { + fprintf (stderr, + _ + ("%s: invalid field '%s'\n"), + Prog, optarg); + fail_exit (E_BAD_ARG); + } + user_pass = optarg; + break; + case 's': + if (!VALID (optarg) + || (optarg[0] + && (optarg[0] != '/' + && optarg[0] != '*'))) { + fprintf (stderr, + _ + ("%s: invalid shell '%s'\n"), + Prog, optarg); + fail_exit (E_BAD_ARG); + } + user_shell = optarg; + def_shell = optarg; + sflg++; + break; + case 'u': + user_id = get_uid (optarg); + uflg++; + break; + case 'n': + nflg++; + break; + case 'r': + rflg++; + break; + case 'M': + Mflg++; + break; + default: + usage (); + } + anyflag++; + } + } + + if (mflg && Mflg) /* the admin is not decided .. create or not ? */ + usage(); + + /* + * Certain options are only valid in combination with others. + * Check it here so that they can be specified in any order. + */ + if ((oflg && !uflg) || (kflg && !mflg)) + usage (); + + /* + * Either -D or username is required. Defaults can be set with -D + * for the -b, -e, -f, -g, -s options only. + */ + if (Dflg) { + if (optind != argc) + usage (); + + if (uflg || oflg || Gflg || dflg || cflg || mflg) + usage (); + } else { + if (optind != argc - 1) + usage (); + + user_name = argv[optind]; +#if 0 /* no user name checking */ + if (!check_user_name (user_name)) { + fprintf (stderr, + _ + ("%s: invalid user name '%s'\n"), + Prog, user_name); +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "adding user", + user_name, -1, 0); +#endif + fail_exit (E_BAD_ARG); + } +#endif + if (!dflg) { + char *uh; + + uh = (char *) malloc (strlen (def_home) + + strlen (user_name) + 2); +assert(uh != NULL); + sprintf (uh, "%s/%s", def_home, user_name); + user_home = uh; + } + } + + if (!eflg) + user_expire = strtoday (def_expire); + + if (!gflg) + user_gid = def_group; + + if (!sflg) + user_shell = def_shell; + + /* TODO: add handle change default spool mail creation by + -K CREATE_MAIL_SPOOL={yes,no}. It need rewrite internal API for handle + shadow tools configuration */ + create_mail_spool = def_create_mail_spool; +} + +/* + * close_files - close all of the files that were opened + * + * close_files() closes all of the files that were opened for this + * new user. This causes any modified entries to be written out. + */ +static void close_files (void) +{ + if (!pw_close ()) { + fprintf (stderr, _("%s: cannot rewrite password file\n"), Prog); + fail_exit (E_PW_UPDATE); + } + if (is_shadow_pwd && !spw_close ()) { + fprintf (stderr, + _("%s: cannot rewrite shadow password file\n"), Prog); + fail_exit (E_PW_UPDATE); + } + if (do_grp_update) { + if (!gr_close ()) { + fprintf (stderr, + _("%s: cannot rewrite group file\n"), Prog); + fail_exit (E_GRP_UPDATE); + } +#ifdef SHADOWGRP + if (is_shadow_grp && !sgr_close ()) { + fprintf (stderr, + _ + ("%s: cannot rewrite shadow group file\n"), + Prog); + fail_exit (E_GRP_UPDATE); + } +#endif + } + if (is_shadow_pwd) + spw_unlock (); + pw_unlock (); + gr_unlock (); +#ifdef SHADOWGRP + if (is_shadow_grp) + sgr_unlock (); +#endif +} + +/* + * open_files - lock and open the password files + * + * open_files() opens the two password files. + */ +static void open_files (void) +{ + if (!pw_lock ()) { + fprintf (stderr, _("%s: unable to lock password file\n"), Prog); +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, + "locking password file", user_name, user_id, 0); +#endif + fail_exit (E_PW_UPDATE); + } + if (!pw_open (O_RDWR)) { + fprintf (stderr, _("%s: unable to open password file\n"), Prog); +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, + "opening password file", user_name, user_id, 0); +#endif + pw_unlock (); + fail_exit (E_PW_UPDATE); + } + if (is_shadow_pwd && !spw_lock ()) { + fprintf (stderr, + _("%s: cannot lock shadow password file\n"), Prog); +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, + "locking shadow password file", user_name, + user_id, 0); +#endif + pw_unlock (); + fail_exit (E_PW_UPDATE); + } + if (is_shadow_pwd && !spw_open (O_RDWR)) { + fprintf (stderr, + _("%s: cannot open shadow password file\n"), Prog); +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, + "opening shadow password file", user_name, + user_id, 0); +#endif + spw_unlock (); + pw_unlock (); + fail_exit (E_PW_UPDATE); + } + /* + * Lock and open the group file. + */ + + if (!gr_lock ()) { + fprintf (stderr, _("%s: error locking group file\n"), Prog); + fail_exit (E_GRP_UPDATE); + } + if (!gr_open (O_RDWR)) { + fprintf (stderr, _("%s: error opening group file\n"), Prog); + fail_exit (E_GRP_UPDATE); + } +#ifdef SHADOWGRP + if (is_shadow_grp && !sgr_lock ()) { + fprintf (stderr, + _("%s: error locking shadow group file\n"), Prog); + fail_exit (E_GRP_UPDATE); + } + if (is_shadow_grp && !sgr_open (O_RDWR)) { + fprintf (stderr, + _("%s: error opening shadow group file\n"), Prog); + fail_exit (E_GRP_UPDATE); + } +#endif +} + +static char *empty_list = NULL; + +/* + * new_grent - initialize the values in a group file entry + * + * new_grent() takes all of the values that have been entered and fills + * in a (struct group) with them. + */ + +static void new_grent (struct group *grent) +{ + memzero (grent, sizeof *grent); + grent->gr_name = (char *) user_name; + grent->gr_passwd = SHADOW_PASSWD_STRING; /* XXX warning: const */ + grent->gr_gid = user_gid; + grent->gr_mem = &empty_list; +} + +#ifdef SHADOWGRP +/* + * new_sgent - initialize the values in a shadow group file entry + * + * new_sgent() takes all of the values that have been entered and fills + * in a (struct sgrp) with them. + */ + +static void new_sgent (struct sgrp *sgent) +{ + memzero (sgent, sizeof *sgent); + sgent->sg_name = (char *) user_name; + sgent->sg_passwd = "!"; /* XXX warning: const */ + sgent->sg_adm = &empty_list; + sgent->sg_mem = &empty_list; +} +#endif /* SHADOWGRP */ + + +/* + * grp_add - add new group file entries + * + * grp_add() writes the new records to the group files. + */ + +static void grp_add (void) +{ + struct group grp; + +#ifdef SHADOWGRP + struct sgrp sgrp; +#endif /* SHADOWGRP */ + + /* + * Create the initial entries for this new group. + */ + new_grent (&grp); +#ifdef SHADOWGRP + new_sgent (&sgrp); +#endif /* SHADOWGRP */ + + /* + * Write out the new group file entry. + */ + if (!gr_update (&grp)) { + fprintf (stderr, _("%s: error adding new group entry\n"), Prog); + fail_exit (E_GRP_UPDATE); + } +#ifdef SHADOWGRP + /* + * Write out the new shadow group entries as well. + */ + if (is_shadow_grp && !sgr_update (&sgrp)) { + fprintf (stderr, _("%s: error adding new group entry\n"), Prog); + fail_exit (E_GRP_UPDATE); + } +#endif /* SHADOWGRP */ + SYSLOG ((LOG_INFO, "new group: name=%s, GID=%u", user_name, user_gid)); + do_grp_update++; +} + +static void faillog_reset (uid_t uid) +{ + struct faillog fl; + int fd; + + fd = open (FAILLOG_FILE, O_RDWR); + if (fd >= 0) { + int xx; + memzero (&fl, sizeof (fl)); + lseek (fd, (off_t) sizeof (fl) * uid, SEEK_SET); + xx = write (fd, &fl, sizeof (fl)); + close (fd); + } +} + +static void lastlog_reset (uid_t uid) +{ + struct lastlog ll; + int fd; + + fd = open (LASTLOG_FILE, O_RDWR); + if (fd >= 0) { + int xx; + memzero (&ll, sizeof (ll)); + lseek (fd, (off_t) sizeof (ll) * uid, SEEK_SET); + xx = write (fd, &ll, sizeof (ll)); + close (fd); + } +} + +/* + * usr_update - create the user entries + * + * usr_update() creates the password file entries for this user + * and will update the group entries if required. + */ +static void usr_update (void) +{ + struct passwd pwent; + struct spwd spent; + + if (!oflg) + find_new_uid (); + + /* + * Fill in the password structure with any new fields, making + * copies of strings. + */ + new_pwent (&pwent); + new_spent (&spent); + + /* + * Create a syslog entry. We need to do this now in case anything + * happens so we know what we were trying to accomplish. + */ + SYSLOG ((LOG_INFO, + "new user: name=%s, UID=%u, GID=%u, home=%s, shell=%s", + user_name, (unsigned int) user_id, + (unsigned int) user_gid, user_home, user_shell)); + + /* + * Initialize faillog and lastlog entries for this UID in case + * it belongs to a previously deleted user. We do it only if + * no user with this UID exists yet (entries for shared UIDs + * are left unchanged). --marekm + */ + if (!getpwuid (user_id) && !lflg) { + faillog_reset (user_id); + lastlog_reset (user_id); + } + + /* + * Put the new (struct passwd) in the table. + */ + if (!pw_update (&pwent)) { + fprintf (stderr, + _("%s: error adding new password entry\n"), Prog); + fail_exit (E_PW_UPDATE); + } + + /* + * Put the new (struct spwd) in the table. + */ + if (is_shadow_pwd && !spw_update (&spent)) { + fprintf (stderr, + _ + ("%s: error adding new shadow password entry\n"), + Prog); +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, + "adding shadow password", user_name, user_id, 0); +#endif + fail_exit (E_PW_UPDATE); + } +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "adding user", user_name, + user_id, 1); +#endif + + /* + * Do any group file updates for this user. + */ + if (do_grp_update) + grp_update (); +} + +/* + * create_home - create the user's home directory + * + * create_home() creates the user's home directory if it does not + * already exist. It will be created mode 755 owned by the user + * with the user's default group. + */ +static void create_home (void) +{ + if (access (user_home, F_OK)) { + int xx; + /* XXX - create missing parent directories. --marekm */ + if (mkdir (user_home, 0)) { + fprintf (stderr, + _ + ("%s: cannot create directory %s\n"), + Prog, user_home); +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, + "adding home directory", user_name, user_id, 0); +#endif + fail_exit (E_HOMEDIR); + } + xx = chown (user_home, user_id, user_gid); + chmod (user_home, + 0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK)); + home_added++; +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, + "adding home directory", user_name, user_id, 1); +#endif + } +} + +/* + * create_mail - create the user's mail spool + * + * create_mail() creates the user's mail spool if it does not already + * exist. It will be created mode 660 owned by the user and group + * 'mail' + */ +static void create_mail (void) +{ + const char *spool; + char *file; + int fd; + const struct group *gr; + gid_t gid; + mode_t mode; + + if (strcasecmp (create_mail_spool, "yes") == 0) { + spool = getdef_str ("MAIL_DIR") ? : "/var/mail"; + file = (char *) alloca (strlen (spool) + strlen (user_name) + 2); + sprintf (file, "%s/%s", spool, user_name); + fd = open (file, O_CREAT | O_WRONLY | O_TRUNC | O_EXCL, 0); + if (fd < 0) { + perror (_("Creating mailbox file")); + return; + } + + gr = lcl_getgrnam ("mail"); + if (!gr) { + fprintf (stderr, + _ + ("Group 'mail' not found. Creating the user mailbox file with 0600 mode.\n")); + gid = user_gid; + mode = 0600; + } else { + gid = gr->gr_gid; + mode = 0660; + } + + if (fchown (fd, user_id, gid) || fchmod (fd, mode)) + perror (_("Setting mailbox file permissions")); + + close (fd); + } +} + +/* + * main - useradd command + */ +int useradd_main (int argc, char **argv); +int useradd_main (int argc, char **argv) +{ + struct stat s; + int retval; +#ifdef USE_PAM + pam_handle_t *pamh = NULL; + struct passwd *pampw; +#endif + +/* init stuff in case we get called more than once */ + + def_inactive = -1; + def_expire = ""; + user_name = ""; + user_pass = "!!"; + user_comment = ""; + user_home = ""; + user_shell = ""; + create_mail_spool = ""; + + user_expire = -1; + home_added = 0; + + do_grp_update = 0; + bflg = 0; + cflg = 0; + dflg = 0; + Dflg = 0; + eflg = 0; + fflg = 0; + gflg = 0; + Gflg = 0; + kflg = 0; + mflg = 0; + lflg = 0; + Mflg = 0; + nflg = 0; + oflg = 0; + rflg = 0; + sflg = 0; + uflg = 0; + + empty_list = NULL; + + optind = 0; + + + /* field all lower level errors and exit */ + + if (setjmp(lclack)) return -1; + +#ifdef WITH_AUDIT + audit_help_open (); +#endif + + /* + * Get my name so that I can use it to report errors. + */ +#if 0 + Prog = Basename (argv[0]); + + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + OPENLOG ("useradd"); +#endif + if (stat("/etc/ptmp", &s) == 0) { + fputs("vipw lockfile (/etc/ptmp) is present.\n", stderr); + fail_exit(1); + } + + sys_ngroups = sysconf (_SC_NGROUPS_MAX); + user_groups = (char **) malloc ((1 + sys_ngroups) * sizeof (char *)); + /* + * Initialize the list to be empty + */ + user_groups[0] = (char *) 0; + + + is_shadow_pwd = spw_file_present (); +#ifdef SHADOWGRP + is_shadow_grp = sgr_file_present (); +#endif + + get_defaults (); + + process_flags (argc, argv); + +#ifdef USE_PAM + retval = PAM_SUCCESS; + + pampw = getpwuid (getuid ()); + if (pampw == NULL) { + retval = PAM_USER_UNKNOWN; + } + + if (retval == PAM_SUCCESS) { + retval = pam_start ("useradd", pampw->pw_name, &conv, &pamh); + } + + if (retval == PAM_SUCCESS) { + retval = pam_authenticate (pamh, 0); + if (retval != PAM_SUCCESS) { + pam_end (pamh, retval); + } + } + + if (retval == PAM_SUCCESS) { + retval = pam_acct_mgmt (pamh, 0); + if (retval != PAM_SUCCESS) { + pam_end (pamh, retval); + } + } + + if (retval != PAM_SUCCESS) { + fprintf (stderr, _("%s: PAM authentication failed\n"), Prog); + return (1); + } +#endif /* USE_PAM */ + + if (!rflg) /* for system accounts defaults are ignored and we + * do not create a home dir -- gafton */ + if (getdef_bool("CREATE_HOME")) + mflg = 1; + + if (Mflg) /* absolutely sure that we do not create home dirs */ + mflg = 0; + + /* + * See if we are messing with the defaults file, or creating + * a new user. + */ + if (Dflg) { + if (gflg || bflg || fflg || eflg || sflg) + return (set_defaults () ? 1 : 0); + + show_defaults (); + return (E_SUCCESS); + } + + /* + * Start with a quick check to see if the user exists. + */ + if (getpwnam (user_name)) { +#if 0 /* wrs - suppress this warning */ + fprintf (stderr, _("%s: user %s exists\n"), Prog, user_name); +#endif +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "adding user", + user_name, -1, 0); +#endif + return (E_NAME_IN_USE); + } + + /* + * Don't blindly overwrite a group when a user is added... + * If you already have a group username, and want to add the user + * to that group, use useradd -g username username. + * --bero + */ + if ( !(nflg || gflg) ) { + if (lcl_getgrnam (user_name)) { + fprintf (stderr, + _ + ("%s: group %s exists - if you want to add this user to that group, use -g.\n"), + Prog, user_name); +#ifdef WITH_AUDIT + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, + "adding group", user_name, -1, 0); +#endif + return (E_NAME_IN_USE); + } + } + + /* + * Do the hard stuff: + * - open the files, + * - create the user entries, + * - create the home directory, + * - create user mail spool, + * - flush nscd caches for passwd and group services, + * - then close and update the files. + */ + open_files (); + + if ((retval=setjmp(lclack)) != 0) /* move longjump() target */ + { + int r; + + if ((r=setjmp(lclack)) != 0) return r; /* failed doing next line */ + close_files(); + return retval; + } + + if (!oflg) { + /* first, seek for a valid uid to use for this user. + * We do this because later we can use the uid we found as + * gid too ... --gafton */ + find_new_uid (); + } + + /* do we have to add a group for that user? This is why we need to + * open the group files in the open_files() function --gafton */ + if (!(nflg || gflg)) { + find_new_gid (); + grp_add (); + } + + usr_update (); + + if (mflg) { + create_home (); + if (home_added) + copy_tree (def_template, user_home, user_id, user_gid); + else + fprintf (stderr, + _ + ("%s: warning: the home directory already exists.\n" + "Not copying any file from skel directory into it.\n"), + Prog); + } + /* Warning removed to protect the innocent. */ + /* + * The whole idea about breaking some stupid scripts by creating a new + * variable is crap - I could care less about the scripts. Historically + * adduser type programs have always created the home directories and + * I don't like the idea of providing a script when we can fix the + * binary itself. And if the scripts are using the right options to the + * useradd then they will not break. If not, they depend on unspecified + * behavior and they will break, but they were broken anyway to begin + * with --gafton + */ + + create_mail (); + +#if 0 /* no flushin' */ + nscd_flush_cache ("passwd"); + nscd_flush_cache ("group"); +#endif + + close_files (); + +#ifdef USE_PAM + if (retval == PAM_SUCCESS) + pam_end (pamh, PAM_SUCCESS); +#endif /* USE_PAM */ + + return (E_SUCCESS); + /* NOT REACHED */ +} diff --git a/rpm-5.4.9/lua/socket/auxiliar.c b/rpm-5.4.9/lua/socket/auxiliar.c new file mode 100644 index 0000000..bfce6a7 --- /dev/null +++ b/rpm-5.4.9/lua/socket/auxiliar.c @@ -0,0 +1,149 @@ +/*=========================================================================*\ +* Auxiliar routines for class hierarchy manipulation +* LuaSocket toolkit +* +* RCS ID: $Id: auxiliar.c,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include +#include + +#include "auxiliar.h" + +/*=========================================================================*\ +* Exported functions +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Initializes the module +\*-------------------------------------------------------------------------*/ +int auxiliar_open(lua_State *L) { + (void) L; + return 0; +} + +/*-------------------------------------------------------------------------*\ +* Creates a new class with given methods +* Methods whose names start with __ are passed directly to the metatable. +\*-------------------------------------------------------------------------*/ +void auxiliar_newclass(lua_State *L, const char *classname, luaL_reg *func) { + luaL_newmetatable(L, classname); /* mt */ + /* create __index table to place methods */ + lua_pushstring(L, "__index"); /* mt,"__index" */ + lua_newtable(L); /* mt,"__index",it */ + /* put class name into class metatable */ + lua_pushstring(L, "class"); /* mt,"__index",it,"class" */ + lua_pushstring(L, classname); /* mt,"__index",it,"class",classname */ + lua_rawset(L, -3); /* mt,"__index",it */ + /* pass all methods that start with _ to the metatable, and all others + * to the index table */ + for (; func->name; func++) { /* mt,"__index",it */ + lua_pushstring(L, func->name); + lua_pushcfunction(L, func->func); + lua_rawset(L, func->name[0] == '_' ? -5: -3); + } + lua_rawset(L, -3); /* mt */ + lua_pop(L, 1); +} + +/*-------------------------------------------------------------------------*\ +* Prints the value of a class in a nice way +\*-------------------------------------------------------------------------*/ +int auxiliar_tostring(lua_State *L) { + char buf[32]; + if (!lua_getmetatable(L, 1)) goto error; + lua_pushstring(L, "__index"); + lua_gettable(L, -2); + if (!lua_istable(L, -1)) goto error; + lua_pushstring(L, "class"); + lua_gettable(L, -2); + if (!lua_isstring(L, -1)) goto error; + sprintf(buf, "%p", lua_touserdata(L, 1)); + lua_pushfstring(L, "%s: %s", lua_tostring(L, -1), buf); + return 1; +error: + lua_pushstring(L, "invalid object passed to 'auxiliar.c:__tostring'"); + lua_error(L); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Insert class into group +\*-------------------------------------------------------------------------*/ +void auxiliar_add2group(lua_State *L, const char *classname, const char *groupname) { + luaL_getmetatable(L, classname); + lua_pushstring(L, groupname); + lua_pushboolean(L, 1); + lua_rawset(L, -3); + lua_pop(L, 1); +} + +/*-------------------------------------------------------------------------*\ +* Make sure argument is a boolean +\*-------------------------------------------------------------------------*/ +int auxiliar_checkboolean(lua_State *L, int objidx) { + if (!lua_isboolean(L, objidx)) + luaL_typerror(L, objidx, lua_typename(L, LUA_TBOOLEAN)); + return lua_toboolean(L, objidx); +} + +/*-------------------------------------------------------------------------*\ +* Return userdata pointer if object belongs to a given class, abort with +* error otherwise +\*-------------------------------------------------------------------------*/ +void *auxiliar_checkclass(lua_State *L, const char *classname, int objidx) { + void *data = auxiliar_getclassudata(L, classname, objidx); + if (!data) { + char msg[45]; + sprintf(msg, "%.35s expected", classname); + luaL_argerror(L, objidx, msg); + } + return data; +} + +/*-------------------------------------------------------------------------*\ +* Return userdata pointer if object belongs to a given group, abort with +* error otherwise +\*-------------------------------------------------------------------------*/ +void *auxiliar_checkgroup(lua_State *L, const char *groupname, int objidx) { + void *data = auxiliar_getgroupudata(L, groupname, objidx); + if (!data) { + char msg[45]; + sprintf(msg, "%.35s expected", groupname); + luaL_argerror(L, objidx, msg); + } + return data; +} + +/*-------------------------------------------------------------------------*\ +* Set object class +\*-------------------------------------------------------------------------*/ +void auxiliar_setclass(lua_State *L, const char *classname, int objidx) { + luaL_getmetatable(L, classname); + if (objidx < 0) objidx--; + lua_setmetatable(L, objidx); +} + +/*-------------------------------------------------------------------------*\ +* Get a userdata pointer if object belongs to a given group. Return NULL +* otherwise +\*-------------------------------------------------------------------------*/ +void *auxiliar_getgroupudata(lua_State *L, const char *groupname, int objidx) { + if (!lua_getmetatable(L, objidx)) + return NULL; + lua_pushstring(L, groupname); + lua_rawget(L, -2); + if (lua_isnil(L, -1)) { + lua_pop(L, 2); + return NULL; + } else { + lua_pop(L, 2); + return lua_touserdata(L, objidx); + } +} + +/*-------------------------------------------------------------------------*\ +* Get a userdata pointer if object belongs to a given class. Return NULL +* otherwise +\*-------------------------------------------------------------------------*/ +void *auxiliar_getclassudata(lua_State *L, const char *classname, int objidx) { + return luaL_checkudata(L, objidx, classname); +} diff --git a/rpm-5.4.9/lua/socket/auxiliar.h b/rpm-5.4.9/lua/socket/auxiliar.h new file mode 100644 index 0000000..74257eb --- /dev/null +++ b/rpm-5.4.9/lua/socket/auxiliar.h @@ -0,0 +1,48 @@ +#ifndef AUXILIAR_H +#define AUXILIAR_H +/*=========================================================================*\ +* Auxiliar routines for class hierarchy manipulation +* LuaSocket toolkit (but completely independent of other LuaSocket modules) +* +* A LuaSocket class is a name associated with Lua metatables. A LuaSocket +* group is a name associated with a class. A class can belong to any number +* of groups. This module provides the functionality to: +* +* - create new classes +* - add classes to groups +* - set the class of objects +* - check if an object belongs to a given class or group +* - get the userdata associated to objects +* - print objects in a pretty way +* +* LuaSocket class names follow the convention {}. Modules +* can define any number of classes and groups. The module tcp.c, for +* example, defines the classes tcp{master}, tcp{client} and tcp{server} and +* the groups tcp{client,server} and tcp{any}. Module functions can then +* perform type-checking on their arguments by either class or group. +* +* LuaSocket metatables define the __index metamethod as being a table. This +* table has one field for each method supported by the class, and a field +* "class" with the class name. +* +* The mapping from class name to the corresponding metatable and the +* reverse mapping are done using lauxlib. +* +* RCS ID: $Id: auxiliar.h,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ + +#include "lua.h" +#include "lauxlib.h" + +int auxiliar_open(lua_State *L); +void auxiliar_newclass(lua_State *L, const char *classname, luaL_reg *func); +void auxiliar_add2group(lua_State *L, const char *classname, const char *group); +void auxiliar_setclass(lua_State *L, const char *classname, int objidx); +void *auxiliar_checkclass(lua_State *L, const char *classname, int objidx); +void *auxiliar_checkgroup(lua_State *L, const char *groupname, int objidx); +void *auxiliar_getclassudata(lua_State *L, const char *groupname, int objidx); +void *auxiliar_getgroupudata(lua_State *L, const char *groupname, int objidx); +int auxiliar_checkboolean(lua_State *L, int objidx); +int auxiliar_tostring(lua_State *L); + +#endif /* AUXILIAR_H */ diff --git a/rpm-5.4.9/lua/socket/buffer.c b/rpm-5.4.9/lua/socket/buffer.c new file mode 100644 index 0000000..4b855e9 --- /dev/null +++ b/rpm-5.4.9/lua/socket/buffer.c @@ -0,0 +1,268 @@ +/*=========================================================================*\ +* Input/Output interface for Lua programs +* LuaSocket toolkit +* +* RCS ID: $Id: buffer.c,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include "lua.h" +#include "lauxlib.h" + +#include "buffer.h" + +/*=========================================================================*\ +* Internal function prototypes +\*=========================================================================*/ +static int recvraw(p_buffer buf, size_t wanted, luaL_Buffer *b); +static int recvline(p_buffer buf, luaL_Buffer *b); +static int recvall(p_buffer buf, luaL_Buffer *b); +static int buffer_get(p_buffer buf, const char **data, size_t *count); +static void buffer_skip(p_buffer buf, size_t count); +static int sendraw(p_buffer buf, const char *data, size_t count, size_t *sent); + +/* min and max macros */ +#ifndef MIN +#define MIN(x, y) ((x) < (y) ? x : y) +#endif +#ifndef MAX +#define MAX(x, y) ((x) > (y) ? x : y) +#endif + +/*=========================================================================*\ +* Exported functions +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Initializes module +\*-------------------------------------------------------------------------*/ +int buffer_open(lua_State *L) { + (void) L; + return 0; +} + +/*-------------------------------------------------------------------------*\ +* Initializes C structure +\*-------------------------------------------------------------------------*/ +void buffer_init(p_buffer buf, p_io io, p_timeout tm) { + buf->first = buf->last = 0; + buf->io = io; + buf->tm = tm; + buf->received = buf->sent = 0; + buf->birthday = timeout_gettime(); +} + +/*-------------------------------------------------------------------------*\ +* object:getstats() interface +\*-------------------------------------------------------------------------*/ +int buffer_meth_getstats(lua_State *L, p_buffer buf) { + lua_pushnumber(L, buf->received); + lua_pushnumber(L, buf->sent); + lua_pushnumber(L, timeout_gettime() - buf->birthday); + return 3; +} + +/*-------------------------------------------------------------------------*\ +* object:setstats() interface +\*-------------------------------------------------------------------------*/ +int buffer_meth_setstats(lua_State *L, p_buffer buf) { + buf->received = (long) luaL_optnumber(L, 2, buf->received); + buf->sent = (long) luaL_optnumber(L, 3, buf->sent); + if (lua_isnumber(L, 4)) buf->birthday = timeout_gettime() - lua_tonumber(L, 4); + lua_pushnumber(L, 1); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* object:send() interface +\*-------------------------------------------------------------------------*/ +int buffer_meth_send(lua_State *L, p_buffer buf) { + int top = lua_gettop(L); + int err = IO_DONE; + size_t size = 0, sent = 0; + const char *data = luaL_checklstring(L, 2, &size); + long start = (long) luaL_optnumber(L, 3, 1); + long end = (long) luaL_optnumber(L, 4, -1); + p_timeout tm = timeout_markstart(buf->tm); + if (start < 0) start = (long) (size+start+1); + if (end < 0) end = (long) (size+end+1); + if (start < 1) start = (long) 1; + if (end > (long) size) end = (long) size; + if (start <= end) err = sendraw(buf, data+start-1, end-start+1, &sent); + /* check if there was an error */ + if (err != IO_DONE) { + lua_pushnil(L); + lua_pushstring(L, buf->io->error(buf->io->ctx, err)); + lua_pushnumber(L, sent+start-1); + } else { + lua_pushnumber(L, sent+start-1); + lua_pushnil(L); + lua_pushnil(L); + } +#ifdef LUASOCKET_DEBUG + /* push time elapsed during operation as the last return value */ + lua_pushnumber(L, timeout_gettime() - timeout_getstart(tm)); +#endif + return lua_gettop(L) - top; +} + +/*-------------------------------------------------------------------------*\ +* object:receive() interface +\*-------------------------------------------------------------------------*/ +int buffer_meth_receive(lua_State *L, p_buffer buf) { + int err = IO_DONE, top = lua_gettop(L); + luaL_Buffer b; + size_t size; + const char *part = luaL_optlstring(L, 3, "", &size); + p_timeout tm = timeout_markstart(buf->tm); + /* initialize buffer with optional extra prefix + * (useful for concatenating previous partial results) */ + luaL_buffinit(L, &b); + luaL_addlstring(&b, part, size); + /* receive new patterns */ + if (!lua_isnumber(L, 2)) { + const char *p= luaL_optstring(L, 2, "*l"); + if (p[0] == '*' && p[1] == 'l') err = recvline(buf, &b); + else if (p[0] == '*' && p[1] == 'a') err = recvall(buf, &b); + else luaL_argcheck(L, 0, 2, "invalid receive pattern"); + /* get a fixed number of bytes (minus what was already partially + * received) */ + } else err = recvraw(buf, (size_t) lua_tonumber(L, 2)-size, &b); + /* check if there was an error */ + if (err != IO_DONE) { + /* we can't push anyting in the stack before pushing the + * contents of the buffer. this is the reason for the complication */ + luaL_pushresult(&b); + lua_pushstring(L, buf->io->error(buf->io->ctx, err)); + lua_pushvalue(L, -2); + lua_pushnil(L); + lua_replace(L, -4); + } else { + luaL_pushresult(&b); + lua_pushnil(L); + lua_pushnil(L); + } +#ifdef LUASOCKET_DEBUG + /* push time elapsed during operation as the last return value */ + lua_pushnumber(L, timeout_gettime() - timeout_getstart(tm)); +#endif + return lua_gettop(L) - top; +} + +/*-------------------------------------------------------------------------*\ +* Determines if there is any data in the read buffer +\*-------------------------------------------------------------------------*/ +int buffer_isempty(p_buffer buf) { + return buf->first >= buf->last; +} + +/*=========================================================================*\ +* Internal functions +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Sends a block of data (unbuffered) +\*-------------------------------------------------------------------------*/ +#define STEPSIZE 8192 +static int sendraw(p_buffer buf, const char *data, size_t count, size_t *sent) { + p_io io = buf->io; + p_timeout tm = buf->tm; + size_t total = 0; + int err = IO_DONE; + while (total < count && err == IO_DONE) { + size_t done; + size_t step = (count-total <= STEPSIZE)? count-total: STEPSIZE; + err = io->send(io->ctx, data+total, step, &done, tm); + total += done; + } + *sent = total; + buf->sent += total; + return err; +} + +/*-------------------------------------------------------------------------*\ +* Reads a fixed number of bytes (buffered) +\*-------------------------------------------------------------------------*/ +static int recvraw(p_buffer buf, size_t wanted, luaL_Buffer *b) { + int err = IO_DONE; + size_t total = 0; + while (err == IO_DONE) { + size_t count; const char *data; + err = buffer_get(buf, &data, &count); + count = MIN(count, wanted - total); + luaL_addlstring(b, data, count); + buffer_skip(buf, count); + total += count; + if (total >= wanted) break; + } + return err; +} + +/*-------------------------------------------------------------------------*\ +* Reads everything until the connection is closed (buffered) +\*-------------------------------------------------------------------------*/ +static int recvall(p_buffer buf, luaL_Buffer *b) { + int err = IO_DONE; + size_t total = 0; + while (err == IO_DONE) { + const char *data; size_t count; + err = buffer_get(buf, &data, &count); + total += count; + luaL_addlstring(b, data, count); + buffer_skip(buf, count); + } + if (err == IO_CLOSED) { + if (total > 0) return IO_DONE; + else return IO_CLOSED; + } else return err; +} + +/*-------------------------------------------------------------------------*\ +* Reads a line terminated by a CR LF pair or just by a LF. The CR and LF +* are not returned by the function and are discarded from the buffer +\*-------------------------------------------------------------------------*/ +static int recvline(p_buffer buf, luaL_Buffer *b) { + int err = IO_DONE; + while (err == IO_DONE) { + size_t count, pos; const char *data; + err = buffer_get(buf, &data, &count); + pos = 0; + while (pos < count && data[pos] != '\n') { + /* we ignore all \r's */ + if (data[pos] != '\r') luaL_putchar(b, data[pos]); + pos++; + } + if (pos < count) { /* found '\n' */ + buffer_skip(buf, pos+1); /* skip '\n' too */ + break; /* we are done */ + } else /* reached the end of the buffer */ + buffer_skip(buf, pos); + } + return err; +} + +/*-------------------------------------------------------------------------*\ +* Skips a given number of bytes from read buffer. No data is read from the +* transport layer +\*-------------------------------------------------------------------------*/ +static void buffer_skip(p_buffer buf, size_t count) { + buf->received += count; + buf->first += count; + if (buffer_isempty(buf)) + buf->first = buf->last = 0; +} + +/*-------------------------------------------------------------------------*\ +* Return any data available in buffer, or get more data from transport layer +* if buffer is empty +\*-------------------------------------------------------------------------*/ +static int buffer_get(p_buffer buf, const char **data, size_t *count) { + int err = IO_DONE; + p_io io = buf->io; + p_timeout tm = buf->tm; + if (buffer_isempty(buf)) { + size_t got; + err = io->recv(io->ctx, buf->data, BUF_SIZE, &got, tm); + buf->first = 0; + buf->last = got; + } + *count = buf->last - buf->first; + *data = buf->data + buf->first; + return err; +} diff --git a/rpm-5.4.9/lua/socket/buffer.h b/rpm-5.4.9/lua/socket/buffer.h new file mode 100644 index 0000000..e33f9dc --- /dev/null +++ b/rpm-5.4.9/lua/socket/buffer.h @@ -0,0 +1,47 @@ +#ifndef BUF_H +#define BUF_H +/*=========================================================================*\ +* Input/Output interface for Lua programs +* LuaSocket toolkit +* +* Line patterns require buffering. Reading one character at a time involves +* too many system calls and is very slow. This module implements the +* LuaSocket interface for input/output on connected objects, as seen by +* Lua programs. +* +* Input is buffered. Output is *not* buffered because there was no simple +* way of making sure the buffered output data would ever be sent. +* +* The module is built on top of the I/O abstraction defined in io.h and the +* timeout management is done with the timeout.h interface. +* +* RCS ID: $Id: buffer.h,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include "lua.h" + +#include "io.h" +#include "timeout.h" + +/* buffer size in bytes */ +#define BUF_SIZE 8192 + +/* buffer control structure */ +typedef struct t_buffer_ { + double birthday; /* throttle support info: creation time, */ + size_t sent, received; /* bytes sent, and bytes received */ + p_io io; /* IO driver used for this buffer */ + p_timeout tm; /* timeout management for this buffer */ + size_t first, last; /* index of first and last bytes of stored data */ + char data[BUF_SIZE]; /* storage space for buffer data */ +} t_buffer; +typedef t_buffer *p_buffer; + +int buffer_open(lua_State *L); +void buffer_init(p_buffer buf, p_io io, p_timeout tm); +int buffer_meth_send(lua_State *L, p_buffer buf); +int buffer_meth_receive(lua_State *L, p_buffer buf); +int buffer_meth_getstats(lua_State *L, p_buffer buf); +int buffer_meth_setstats(lua_State *L, p_buffer buf); +int buffer_isempty(p_buffer buf); + +#endif /* BUF_H */ diff --git a/rpm-5.4.9/lua/socket/except.c b/rpm-5.4.9/lua/socket/except.c new file mode 100644 index 0000000..19bbf2a --- /dev/null +++ b/rpm-5.4.9/lua/socket/except.c @@ -0,0 +1,99 @@ +/*=========================================================================*\ +* Simple exception support +* LuaSocket toolkit +* +* RCS ID: $Id: except.c,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include + +#include "lua.h" +#include "lauxlib.h" + +#include "except.h" + +/*=========================================================================*\ +* Internal function prototypes. +\*=========================================================================*/ +static int global_protect(lua_State *L); +static int global_newtry(lua_State *L); +static int protected_(lua_State *L); +static int finalize(lua_State *L); +static int do_nothing(lua_State *L); + +/* except functions */ +static luaL_reg func[] = { + {"newtry", global_newtry}, + {"protect", global_protect}, + {NULL, NULL} +}; + +/*-------------------------------------------------------------------------*\ +* Try factory +\*-------------------------------------------------------------------------*/ +static void wrap(lua_State *L) { + lua_newtable(L); + lua_pushnumber(L, 1); + lua_pushvalue(L, -3); + lua_settable(L, -3); + lua_insert(L, -2); + lua_pop(L, 1); +} + +static int finalize(lua_State *L) { + if (!lua_toboolean(L, 1)) { + lua_pushvalue(L, lua_upvalueindex(1)); + lua_pcall(L, 0, 0, 0); + lua_settop(L, 2); + wrap(L); + lua_error(L); + return 0; + } else return lua_gettop(L); +} + +static int do_nothing(lua_State *L) { + (void) L; + return 0; +} + +static int global_newtry(lua_State *L) { + lua_settop(L, 1); + if (lua_isnil(L, 1)) lua_pushcfunction(L, do_nothing); + lua_pushcclosure(L, finalize, 1); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Protect factory +\*-------------------------------------------------------------------------*/ +static int unwrap(lua_State *L) { + if (lua_istable(L, -1)) { + lua_pushnumber(L, 1); + lua_gettable(L, -2); + lua_pushnil(L); + lua_insert(L, -2); + return 1; + } else return 0; +} + +static int protected_(lua_State *L) { + lua_pushvalue(L, lua_upvalueindex(1)); + lua_insert(L, 1); + if (lua_pcall(L, lua_gettop(L) - 1, LUA_MULTRET, 0) != 0) { + if (unwrap(L)) return 2; + else lua_error(L); + return 0; + } else return lua_gettop(L); +} + +static int global_protect(lua_State *L) { + lua_pushcclosure(L, protected_, 1); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Init module +\*-------------------------------------------------------------------------*/ +int except_open(lua_State *L) { + luaL_openlib(L, NULL, func, 0); + return 0; +} diff --git a/rpm-5.4.9/lua/socket/except.h b/rpm-5.4.9/lua/socket/except.h new file mode 100644 index 0000000..1441695 --- /dev/null +++ b/rpm-5.4.9/lua/socket/except.h @@ -0,0 +1,35 @@ +#ifndef EXCEPT_H +#define EXCEPT_H +/*=========================================================================*\ +* Exception control +* LuaSocket toolkit (but completely independent from other modules) +* +* This provides support for simple exceptions in Lua. During the +* development of the HTTP/FTP/SMTP support, it became aparent that +* error checking was taking a substantial amount of the coding. These +* function greatly simplify the task of checking errors. +* +* The main idea is that functions should return nil as its first return +* value when it finds an error, and return an error message (or value) +* following nil. In case of success, as long as the first value is not nil, +* the other values don't matter. +* +* The idea is to nest function calls with the "try" function. This function +* checks the first value, and calls "error" on the second if the first is +* nil. Otherwise, it returns all values it received. +* +* The protect function returns a new function that behaves exactly like the +* function it receives, but the new function doesn't throw exceptions: it +* returns nil followed by the error message instead. +* +* With these two function, it's easy to write functions that throw +* exceptions on error, but that don't interrupt the user script. +* +* RCS ID: $Id: except.h,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ + +#include "lua.h" + +int except_open(lua_State *L); + +#endif diff --git a/rpm-5.4.9/lua/socket/ftp.lua b/rpm-5.4.9/lua/socket/ftp.lua new file mode 100644 index 0000000..578f8d7 --- /dev/null +++ b/rpm-5.4.9/lua/socket/ftp.lua @@ -0,0 +1,281 @@ +----------------------------------------------------------------------------- +-- FTP support for the Lua language +-- LuaSocket toolkit. +-- Author: Diego Nehab +-- RCS ID: $Id: ftp.lua,v 1.1 2008/10/24 22:58:40 jbj Exp $ +----------------------------------------------------------------------------- + +----------------------------------------------------------------------------- +-- Declare module and import dependencies +----------------------------------------------------------------------------- +local base = _G +local table = require("table") +local string = require("string") +local math = require("math") +local socket = require("socket") +local url = require("socket.url") +local tp = require("socket.tp") +local ltn12 = require("ltn12") +module("socket.ftp") + +----------------------------------------------------------------------------- +-- Program constants +----------------------------------------------------------------------------- +-- timeout in seconds before the program gives up on a connection +TIMEOUT = 60 +-- default port for ftp service +PORT = 21 +-- this is the default anonymous password. used when no password is +-- provided in url. should be changed to your e-mail. +USER = "ftp" +PASSWORD = "anonymous@anonymous.org" + +----------------------------------------------------------------------------- +-- Low level FTP API +----------------------------------------------------------------------------- +local metat = { __index = {} } + +function open(server, port, create) + local tp = socket.try(tp.connect(server, port or PORT, TIMEOUT, create)) + local f = base.setmetatable({ tp = tp }, metat) + -- make sure everything gets closed in an exception + f.try = socket.newtry(function() f:close() end) + return f +end + +function metat.__index:portconnect() + self.try(self.server:settimeout(TIMEOUT)) + self.data = self.try(self.server:accept()) + self.try(self.data:settimeout(TIMEOUT)) +end + +function metat.__index:pasvconnect() + self.data = self.try(socket.tcp()) + self.try(self.data:settimeout(TIMEOUT)) + self.try(self.data:connect(self.pasvt.ip, self.pasvt.port)) +end + +function metat.__index:login(user, password) + self.try(self.tp:command("user", user or USER)) + local code, reply = self.try(self.tp:check{"2..", 331}) + if code == 331 then + self.try(self.tp:command("pass", password or PASSWORD)) + self.try(self.tp:check("2..")) + end + return 1 +end + +function metat.__index:pasv() + self.try(self.tp:command("pasv")) + local code, reply = self.try(self.tp:check("2..")) + local pattern = "(%d+)%D(%d+)%D(%d+)%D(%d+)%D(%d+)%D(%d+)" + local a, b, c, d, p1, p2 = socket.skip(2, string.find(reply, pattern)) + self.try(a and b and c and d and p1 and p2, reply) + self.pasvt = { + ip = string.format("%d.%d.%d.%d", a, b, c, d), + port = p1*256 + p2 + } + if self.server then + self.server:close() + self.server = nil + end + return self.pasvt.ip, self.pasvt.port +end + +function metat.__index:port(ip, port) + self.pasvt = nil + if not ip then + ip, port = self.try(self.tp:getcontrol():getsockname()) + self.server = self.try(socket.bind(ip, 0)) + ip, port = self.try(self.server:getsockname()) + self.try(self.server:settimeout(TIMEOUT)) + end + local pl = math.mod(port, 256) + local ph = (port - pl)/256 + local arg = string.gsub(string.format("%s,%d,%d", ip, ph, pl), "%.", ",") + self.try(self.tp:command("port", arg)) + self.try(self.tp:check("2..")) + return 1 +end + +function metat.__index:send(sendt) + self.try(self.pasvt or self.server, "need port or pasv first") + -- if there is a pasvt table, we already sent a PASV command + -- we just get the data connection into self.data + if self.pasvt then self:pasvconnect() end + -- get the transfer argument and command + local argument = sendt.argument or + url.unescape(string.gsub(sendt.path or "", "^[/\\]", "")) + if argument == "" then argument = nil end + local command = sendt.command or "stor" + -- send the transfer command and check the reply + self.try(self.tp:command(command, argument)) + local code, reply = self.try(self.tp:check{"2..", "1.."}) + -- if there is not a a pasvt table, then there is a server + -- and we already sent a PORT command + if not self.pasvt then self:portconnect() end + -- get the sink, source and step for the transfer + local step = sendt.step or ltn12.pump.step + local readt = {self.tp.c} + local checkstep = function(src, snk) + -- check status in control connection while downloading + local readyt = socket.select(readt, nil, 0) + if readyt[tp] then code = self.try(self.tp:check("2..")) end + return step(src, snk) + end + local sink = socket.sink("close-when-done", self.data) + -- transfer all data and check error + self.try(ltn12.pump.all(sendt.source, sink, checkstep)) + if string.find(code, "1..") then self.try(self.tp:check("2..")) end + -- done with data connection + self.data:close() + -- find out how many bytes were sent + local sent = socket.skip(1, self.data:getstats()) + self.data = nil + return sent +end + +function metat.__index:receive(recvt) + self.try(self.pasvt or self.server, "need port or pasv first") + if self.pasvt then self:pasvconnect() end + local argument = recvt.argument or + url.unescape(string.gsub(recvt.path or "", "^[/\\]", "")) + if argument == "" then argument = nil end + local command = recvt.command or "retr" + self.try(self.tp:command(command, argument)) + local code = self.try(self.tp:check{"1..", "2.."}) + if not self.pasvt then self:portconnect() end + local source = socket.source("until-closed", self.data) + local step = recvt.step or ltn12.pump.step + self.try(ltn12.pump.all(source, recvt.sink, step)) + if string.find(code, "1..") then self.try(self.tp:check("2..")) end + self.data:close() + self.data = nil + return 1 +end + +function metat.__index:cwd(dir) + self.try(self.tp:command("cwd", dir)) + self.try(self.tp:check(250)) + return 1 +end + +function metat.__index:type(type) + self.try(self.tp:command("type", type)) + self.try(self.tp:check(200)) + return 1 +end + +function metat.__index:greet() + local code = self.try(self.tp:check{"1..", "2.."}) + if string.find(code, "1..") then self.try(self.tp:check("2..")) end + return 1 +end + +function metat.__index:quit() + self.try(self.tp:command("quit")) + self.try(self.tp:check("2..")) + return 1 +end + +function metat.__index:close() + if self.data then self.data:close() end + if self.server then self.server:close() end + return self.tp:close() +end + +----------------------------------------------------------------------------- +-- High level FTP API +----------------------------------------------------------------------------- +local function override(t) + if t.url then + local u = url.parse(t.url) + for i,v in base.pairs(t) do + u[i] = v + end + return u + else return t end +end + +local function tput(putt) + putt = override(putt) + socket.try(putt.host, "missing hostname") + local f = open(putt.host, putt.port, putt.create) + f:greet() + f:login(putt.user, putt.password) + if putt.type then f:type(putt.type) end + f:pasv() + local sent = f:send(putt) + f:quit() + f:close() + return sent +end + +local default = { + path = "/", + scheme = "ftp" +} + +local function parse(u) + local t = socket.try(url.parse(u, default)) + socket.try(t.scheme == "ftp", "wrong scheme '" .. t.scheme .. "'") + socket.try(t.host, "missing hostname") + local pat = "^type=(.)$" + if t.params then + t.type = socket.skip(2, string.find(t.params, pat)) + socket.try(t.type == "a" or t.type == "i", + "invalid type '" .. t.type .. "'") + end + return t +end + +local function sput(u, body) + local putt = parse(u) + putt.source = ltn12.source.string(body) + return tput(putt) +end + +put = socket.protect(function(putt, body) + if base.type(putt) == "string" then return sput(putt, body) + else return tput(putt) end +end) + +local function tget(gett) + gett = override(gett) + socket.try(gett.host, "missing hostname") + local f = open(gett.host, gett.port, gett.create) + f:greet() + f:login(gett.user, gett.password) + if gett.type then f:type(gett.type) end + f:pasv() + f:receive(gett) + f:quit() + return f:close() +end + +local function sget(u) + local gett = parse(u) + local t = {} + gett.sink = ltn12.sink.table(t) + tget(gett) + return table.concat(t) +end + +command = socket.protect(function(cmdt) + cmdt = override(cmdt) + socket.try(cmdt.host, "missing hostname") + socket.try(cmdt.command, "missing command") + local f = open(cmdt.host, cmdt.port, cmdt.create) + f:greet() + f:login(cmdt.user, cmdt.password) + f.try(f.tp:command(cmdt.command, cmdt.argument)) + if cmdt.check then f.try(f.tp:check(cmdt.check)) end + f:quit() + return f:close() +end) + +get = socket.protect(function(gett) + if base.type(gett) == "string" then return sget(gett) + else return tget(gett) end +end) + diff --git a/rpm-5.4.9/lua/socket/http.lua b/rpm-5.4.9/lua/socket/http.lua new file mode 100644 index 0000000..2260293 --- /dev/null +++ b/rpm-5.4.9/lua/socket/http.lua @@ -0,0 +1,350 @@ +----------------------------------------------------------------------------- +-- HTTP/1.1 client support for the Lua language. +-- LuaSocket toolkit. +-- Author: Diego Nehab +-- RCS ID: $Id: http.lua,v 1.1 2008/10/24 22:58:40 jbj Exp $ +----------------------------------------------------------------------------- + +----------------------------------------------------------------------------- +-- Declare module and import dependencies +------------------------------------------------------------------------------- +local socket = require("socket") +local url = require("socket.url") +local ltn12 = require("ltn12") +local mime = require("mime") +local string = require("string") +local base = _G +local table = require("table") +module("socket.http") + +----------------------------------------------------------------------------- +-- Program constants +----------------------------------------------------------------------------- +-- connection timeout in seconds +TIMEOUT = 60 +-- default port for document retrieval +PORT = 80 +-- user agent field sent in request +USERAGENT = socket._VERSION + +----------------------------------------------------------------------------- +-- Reads MIME headers from a connection, unfolding where needed +----------------------------------------------------------------------------- +local function receiveheaders(sock, headers) + local line, name, value, err + headers = headers or {} + -- get first line + line, err = sock:receive() + if err then return nil, err end + -- headers go until a blank line is found + while line ~= "" do + -- get field-name and value + name, value = socket.skip(2, string.find(line, "^(.-):%s*(.*)")) + if not (name and value) then return nil, "malformed reponse headers" end + name = string.lower(name) + -- get next line (value might be folded) + line, err = sock:receive() + if err then return nil, err end + -- unfold any folded values + while string.find(line, "^%s") do + value = value .. line + line = sock:receive() + if err then return nil, err end + end + -- save pair in table + if headers[name] then headers[name] = headers[name] .. ", " .. value + else headers[name] = value end + end + return headers +end + +----------------------------------------------------------------------------- +-- Extra sources and sinks +----------------------------------------------------------------------------- +socket.sourcet["http-chunked"] = function(sock, headers) + return base.setmetatable({ + getfd = function() return sock:getfd() end, + dirty = function() return sock:dirty() end + }, { + __call = function() + -- get chunk size, skip extention + local line, err = sock:receive() + if err then return nil, err end + local size = base.tonumber(string.gsub(line, ";.*", ""), 16) + if not size then return nil, "invalid chunk size" end + -- was it the last chunk? + if size > 0 then + -- if not, get chunk and skip terminating CRLF + local chunk, err, part = sock:receive(size) + if chunk then sock:receive() end + return chunk, err + else + -- if it was, read trailers into headers table + headers, err = receiveheaders(sock, headers) + if not headers then return nil, err end + end + end + }) +end + +socket.sinkt["http-chunked"] = function(sock) + return base.setmetatable({ + getfd = function() return sock:getfd() end, + dirty = function() return sock:dirty() end + }, { + __call = function(self, chunk, err) + if not chunk then return sock:send("0\r\n\r\n") end + local size = string.format("%X\r\n", string.len(chunk)) + return sock:send(size .. chunk .. "\r\n") + end + }) +end + +----------------------------------------------------------------------------- +-- Low level HTTP API +----------------------------------------------------------------------------- +local metat = { __index = {} } + +function open(host, port, create) + -- create socket with user connect function, or with default + local c = socket.try((create or socket.tcp)()) + local h = base.setmetatable({ c = c }, metat) + -- create finalized try + h.try = socket.newtry(function() h:close() end) + -- set timeout before connecting + h.try(c:settimeout(TIMEOUT)) + h.try(c:connect(host, port or PORT)) + -- here everything worked + return h +end + +function metat.__index:sendrequestline(method, uri) + local reqline = string.format("%s %s HTTP/1.1\r\n", method or "GET", uri) + return self.try(self.c:send(reqline)) +end + +function metat.__index:sendheaders(headers) + local h = "\r\n" + for i, v in base.pairs(headers) do + h = i .. ": " .. v .. "\r\n" .. h + end + self.try(self.c:send(h)) + return 1 +end + +function metat.__index:sendbody(headers, source, step) + source = source or ltn12.source.empty() + step = step or ltn12.pump.step + -- if we don't know the size in advance, send chunked and hope for the best + local mode = "http-chunked" + if headers["content-length"] then mode = "keep-open" end + return self.try(ltn12.pump.all(source, socket.sink(mode, self.c), step)) +end + +function metat.__index:receivestatusline() + local status = self.try(self.c:receive(5)) + -- identify HTTP/0.9 responses, which do not contain a status line + -- this is just a heuristic, but is what the RFC recommends + if status ~= "HTTP/" then return nil, status end + -- otherwise proceed reading a status line + status = self.try(self.c:receive("*l", status)) + local code = socket.skip(2, string.find(status, "HTTP/%d*%.%d* (%d%d%d)")) + return self.try(base.tonumber(code), status) +end + +function metat.__index:receiveheaders() + return self.try(receiveheaders(self.c)) +end + +function metat.__index:receivebody(headers, sink, step) + sink = sink or ltn12.sink.null() + step = step or ltn12.pump.step + local length = base.tonumber(headers["content-length"]) + local t = headers["transfer-encoding"] -- shortcut + local mode = "default" -- connection close + if t and t ~= "identity" then mode = "http-chunked" + elseif base.tonumber(headers["content-length"]) then mode = "by-length" end + return self.try(ltn12.pump.all(socket.source(mode, self.c, length), + sink, step)) +end + +function metat.__index:receive09body(status, sink, step) + local source = ltn12.source.rewind(socket.source("until-closed", self.c)) + source(status) + return self.try(ltn12.pump.all(source, sink, step)) +end + +function metat.__index:close() + return self.c:close() +end + +----------------------------------------------------------------------------- +-- High level HTTP API +----------------------------------------------------------------------------- +local function adjusturi(reqt) + local u = reqt + -- if there is a proxy, we need the full url. otherwise, just a part. + if not reqt.proxy and not PROXY then + u = { + path = socket.try(reqt.path, "invalid path 'nil'"), + params = reqt.params, + query = reqt.query, + fragment = reqt.fragment + } + end + return url.build(u) +end + +local function adjustproxy(reqt) + local proxy = reqt.proxy or PROXY + if proxy then + proxy = url.parse(proxy) + return proxy.host, proxy.port or 3128 + else + return reqt.host, reqt.port + end +end + +local function adjustheaders(reqt) + -- default headers + local lower = { + ["user-agent"] = USERAGENT, + ["host"] = reqt.host, + ["connection"] = "close, TE", + ["te"] = "trailers" + } + -- if we have authentication information, pass it along + if reqt.user and reqt.password then + lower["authorization"] = + "Basic " .. (mime.b64(reqt.user .. ":" .. reqt.password)) + end + -- override with user headers + for i,v in base.pairs(reqt.headers or lower) do + lower[string.lower(i)] = v + end + return lower +end + +-- default url parts +local default = { + host = "", + port = PORT, + path ="/", + scheme = "http" +} + +local function adjustrequest(reqt) + -- parse url if provided + local nreqt = reqt.url and url.parse(reqt.url, default) or {} + -- explicit components override url + for i,v in base.pairs(reqt) do nreqt[i] = v end + if nreqt.port == "" then nreqt.port = 80 end + socket.try(nreqt.host and nreqt.host ~= "", + "invalid host '" .. base.tostring(nreqt.host) .. "'") + -- compute uri if user hasn't overriden + nreqt.uri = reqt.uri or adjusturi(nreqt) + -- ajust host and port if there is a proxy + nreqt.host, nreqt.port = adjustproxy(nreqt) + -- adjust headers in request + nreqt.headers = adjustheaders(nreqt) + return nreqt +end + +local function shouldredirect(reqt, code, headers) + return headers.location and + string.gsub(headers.location, "%s", "") ~= "" and + (reqt.redirect ~= false) and + (code == 301 or code == 302) and + (not reqt.method or reqt.method == "GET" or reqt.method == "HEAD") + and (not reqt.nredirects or reqt.nredirects < 5) +end + +local function shouldreceivebody(reqt, code) + if reqt.method == "HEAD" then return nil end + if code == 204 or code == 304 then return nil end + if code >= 100 and code < 200 then return nil end + return 1 +end + +-- forward declarations +local trequest, tredirect + +function tredirect(reqt, location) + local result, code, headers, status = trequest { + -- the RFC says the redirect URL has to be absolute, but some + -- servers do not respect that + url = url.absolute(reqt.url, location), + source = reqt.source, + sink = reqt.sink, + headers = reqt.headers, + proxy = reqt.proxy, + nredirects = (reqt.nredirects or 0) + 1, + create = reqt.create + } + -- pass location header back as a hint we redirected + headers = headers or {} + headers.location = headers.location or location + return result, code, headers, status +end + +function trequest(reqt) + -- we loop until we get what we want, or + -- until we are sure there is no way to get it + local nreqt = adjustrequest(reqt) + local h = open(nreqt.host, nreqt.port, nreqt.create) + -- send request line and headers + h:sendrequestline(nreqt.method, nreqt.uri) + h:sendheaders(nreqt.headers) + -- if there is a body, send it + if nreqt.source then + h:sendbody(nreqt.headers, nreqt.source, nreqt.step) + end + local code, status = h:receivestatusline() + -- if it is an HTTP/0.9 server, simply get the body and we are done + if not code then + h:receive09body(status, nreqt.sink, nreqt.step) + return 1, 200 + end + local headers + -- ignore any 100-continue messages + while code == 100 do + headers = h:receiveheaders() + code, status = h:receivestatusline() + end + headers = h:receiveheaders() + -- at this point we should have a honest reply from the server + -- we can't redirect if we already used the source, so we report the error + if shouldredirect(nreqt, code, headers) and not nreqt.source then + h:close() + return tredirect(reqt, headers.location) + end + -- here we are finally done + if shouldreceivebody(nreqt, code) then + h:receivebody(headers, nreqt.sink, nreqt.step) + end + h:close() + return 1, code, headers, status +end + +local function srequest(u, b) + local t = {} + local reqt = { + url = u, + sink = ltn12.sink.table(t) + } + if b then + reqt.source = ltn12.source.string(b) + reqt.headers = { + ["content-length"] = string.len(b), + ["content-type"] = "application/x-www-form-urlencoded" + } + reqt.method = "POST" + end + local code, headers, status = socket.skip(1, trequest(reqt)) + return table.concat(t), code, headers, status +end + +request = socket.protect(function(reqt, body) + if base.type(reqt) == "string" then return srequest(reqt, body) + else return trequest(reqt) end +end) diff --git a/rpm-5.4.9/lua/socket/inet.c b/rpm-5.4.9/lua/socket/inet.c new file mode 100644 index 0000000..d11c370 --- /dev/null +++ b/rpm-5.4.9/lua/socket/inet.c @@ -0,0 +1,281 @@ +/*=========================================================================*\ +* Internet domain functions +* LuaSocket toolkit +* +* RCS ID: $Id: inet.c,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include +#include + +#include "lua.h" +#include "lauxlib.h" + +#include "inet.h" + +/*=========================================================================*\ +* Internal function prototypes. +\*=========================================================================*/ +static int inet_global_toip(lua_State *L); +static int inet_global_tohostname(lua_State *L); +static void inet_pushresolved(lua_State *L, struct hostent *hp); +static int inet_global_gethostname(lua_State *L); + +/* DNS functions */ +static luaL_reg func[] = { + { "toip", inet_global_toip }, + { "tohostname", inet_global_tohostname }, + { "gethostname", inet_global_gethostname}, + { NULL, NULL} +}; + +/*=========================================================================*\ +* Exported functions +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Initializes module +\*-------------------------------------------------------------------------*/ +int inet_open(lua_State *L) +{ + lua_pushstring(L, "dns"); + lua_newtable(L); + luaL_openlib(L, NULL, func, 0); + lua_settable(L, -3); + return 0; +} + +/*=========================================================================*\ +* Global Lua functions +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Returns all information provided by the resolver given a host name +* or ip address +\*-------------------------------------------------------------------------*/ +static int inet_gethost(const char *address, struct hostent **hp) { + struct in_addr addr; + if (inet_aton(address, &addr)) + return socket_gethostbyaddr((char *) &addr, sizeof(addr), hp); + else + return socket_gethostbyname(address, hp); +} + +/*-------------------------------------------------------------------------*\ +* Returns all information provided by the resolver given a host name +* or ip address +\*-------------------------------------------------------------------------*/ +static int inet_global_tohostname(lua_State *L) { + const char *address = luaL_checkstring(L, 1); + struct hostent *hp = NULL; + int err = inet_gethost(address, &hp); + if (err != IO_DONE) { + lua_pushnil(L); + lua_pushstring(L, socket_hoststrerror(err)); + return 2; + } + lua_pushstring(L, hp->h_name); + inet_pushresolved(L, hp); + return 2; +} + +/*-------------------------------------------------------------------------*\ +* Returns all information provided by the resolver given a host name +* or ip address +\*-------------------------------------------------------------------------*/ +static int inet_global_toip(lua_State *L) +{ + const char *address = luaL_checkstring(L, 1); + struct hostent *hp = NULL; + int err = inet_gethost(address, &hp); + if (err != IO_DONE) { + lua_pushnil(L); + lua_pushstring(L, socket_hoststrerror(err)); + return 2; + } + lua_pushstring(L, inet_ntoa(*((struct in_addr *) hp->h_addr))); + inet_pushresolved(L, hp); + return 2; +} + + +/*-------------------------------------------------------------------------*\ +* Gets the host name +\*-------------------------------------------------------------------------*/ +static int inet_global_gethostname(lua_State *L) +{ + char name[257]; + name[256] = '\0'; + if (gethostname(name, 256) < 0) { + lua_pushnil(L); + lua_pushstring(L, "gethostname failed"); + return 2; + } else { + lua_pushstring(L, name); + return 1; + } +} + + + +/*=========================================================================*\ +* Lua methods +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Retrieves socket peer name +\*-------------------------------------------------------------------------*/ +int inet_meth_getpeername(lua_State *L, p_socket ps) +{ + struct sockaddr_in peer; + socklen_t peer_len = sizeof(peer); + if (getpeername(*ps, (SA *) &peer, &peer_len) < 0) { + lua_pushnil(L); + lua_pushstring(L, "getpeername failed"); + } else { + lua_pushstring(L, inet_ntoa(peer.sin_addr)); + lua_pushnumber(L, ntohs(peer.sin_port)); + } + return 2; +} + +/*-------------------------------------------------------------------------*\ +* Retrieves socket local name +\*-------------------------------------------------------------------------*/ +int inet_meth_getsockname(lua_State *L, p_socket ps) +{ + struct sockaddr_in local; + socklen_t local_len = sizeof(local); + if (getsockname(*ps, (SA *) &local, &local_len) < 0) { + lua_pushnil(L); + lua_pushstring(L, "getsockname failed"); + } else { + lua_pushstring(L, inet_ntoa(local.sin_addr)); + lua_pushnumber(L, ntohs(local.sin_port)); + } + return 2; +} + +/*=========================================================================*\ +* Internal functions +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Passes all resolver information to Lua as a table +\*-------------------------------------------------------------------------*/ +static void inet_pushresolved(lua_State *L, struct hostent *hp) +{ + char **alias; + struct in_addr **addr; + int i, resolved; + lua_newtable(L); resolved = lua_gettop(L); + lua_pushstring(L, "name"); + lua_pushstring(L, hp->h_name); + lua_settable(L, resolved); + lua_pushstring(L, "ip"); + lua_pushstring(L, "alias"); + i = 1; + alias = hp->h_aliases; + lua_newtable(L); + if (alias) { + while (*alias) { + lua_pushnumber(L, i); + lua_pushstring(L, *alias); + lua_settable(L, -3); + i++; alias++; + } + } + lua_settable(L, resolved); + i = 1; + lua_newtable(L); + addr = (struct in_addr **) hp->h_addr_list; + if (addr) { + while (*addr) { + lua_pushnumber(L, i); + lua_pushstring(L, inet_ntoa(**addr)); + lua_settable(L, -3); + i++; addr++; + } + } + lua_settable(L, resolved); +} + +/*-------------------------------------------------------------------------*\ +* Tries to create a new inet socket +\*-------------------------------------------------------------------------*/ +const char *inet_trycreate(p_socket ps, int type) { + return socket_strerror(socket_create(ps, AF_INET, type, 0)); +} + +/*-------------------------------------------------------------------------*\ +* Tries to connect to remote address (address, port) +\*-------------------------------------------------------------------------*/ +const char *inet_tryconnect(p_socket ps, const char *address, + unsigned short port, p_timeout tm) +{ + struct sockaddr_in remote; + int err; + memset(&remote, 0, sizeof(remote)); + remote.sin_family = AF_INET; + remote.sin_port = htons(port); + if (strcmp(address, "*")) { + if (!inet_aton(address, &remote.sin_addr)) { + struct hostent *hp = NULL; + struct in_addr **addr; + err = socket_gethostbyname(address, &hp); + if (err != IO_DONE) return socket_hoststrerror(err); + addr = (struct in_addr **) hp->h_addr_list; + memcpy(&remote.sin_addr, *addr, sizeof(struct in_addr)); + } + } else remote.sin_family = AF_UNSPEC; + err = socket_connect(ps, (SA *) &remote, sizeof(remote), tm); + return socket_strerror(err); +} + +/*-------------------------------------------------------------------------*\ +* Tries to bind socket to (address, port) +\*-------------------------------------------------------------------------*/ +const char *inet_trybind(p_socket ps, const char *address, unsigned short port) +{ + struct sockaddr_in local; + int err; + memset(&local, 0, sizeof(local)); + /* address is either wildcard or a valid ip address */ + local.sin_addr.s_addr = htonl(INADDR_ANY); + local.sin_port = htons(port); + local.sin_family = AF_INET; + if (strcmp(address, "*") && !inet_aton(address, &local.sin_addr)) { + struct hostent *hp = NULL; + struct in_addr **addr; + err = socket_gethostbyname(address, &hp); + if (err != IO_DONE) return socket_hoststrerror(err); + addr = (struct in_addr **) hp->h_addr_list; + memcpy(&local.sin_addr, *addr, sizeof(struct in_addr)); + } + err = socket_bind(ps, (SA *) &local, sizeof(local)); + if (err != IO_DONE) socket_destroy(ps); + return socket_strerror(err); +} + +/*-------------------------------------------------------------------------*\ +* Some systems do not provide this so that we provide our own. It's not +* marvelously fast, but it works just fine. +\*-------------------------------------------------------------------------*/ +#ifdef INET_ATON +int inet_aton(const char *cp, struct in_addr *inp) +{ + unsigned int a = 0, b = 0, c = 0, d = 0; + int n = 0, r; + unsigned long int addr = 0; + r = sscanf(cp, "%u.%u.%u.%u%n", &a, &b, &c, &d, &n); + if (r == 0 || n == 0) return 0; + cp += n; + if (*cp) return 0; + if (a > 255 || b > 255 || c > 255 || d > 255) return 0; + if (inp) { + addr += a; addr <<= 8; + addr += b; addr <<= 8; + addr += c; addr <<= 8; + addr += d; + inp->s_addr = htonl(addr); + } + return 1; +} +#endif + + diff --git a/rpm-5.4.9/lua/socket/inet.h b/rpm-5.4.9/lua/socket/inet.h new file mode 100644 index 0000000..122adfa --- /dev/null +++ b/rpm-5.4.9/lua/socket/inet.h @@ -0,0 +1,42 @@ +#ifndef INET_H +#define INET_H +/*=========================================================================*\ +* Internet domain functions +* LuaSocket toolkit +* +* This module implements the creation and connection of internet domain +* sockets, on top of the socket.h interface, and the interface of with the +* resolver. +* +* The function inet_aton is provided for the platforms where it is not +* available. The module also implements the interface of the internet +* getpeername and getsockname functions as seen by Lua programs. +* +* The Lua functions toip and tohostname are also implemented here. +* +* RCS ID: $Id: inet.h,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include "lua.h" +#include "socket.h" +#include "timeout.h" + +#ifdef _WIN32 +#define INET_ATON +#endif + +int inet_open(lua_State *L); + +const char *inet_trycreate(p_socket ps, int type); +const char *inet_tryconnect(p_socket ps, const char *address, + unsigned short port, p_timeout tm); +const char *inet_trybind(p_socket ps, const char *address, + unsigned short port); + +int inet_meth_getpeername(lua_State *L, p_socket ps); +int inet_meth_getsockname(lua_State *L, p_socket ps); + +#ifdef INET_ATON +int inet_aton(const char *cp, struct in_addr *inp); +#endif + +#endif /* INET_H */ diff --git a/rpm-5.4.9/lua/socket/io.c b/rpm-5.4.9/lua/socket/io.c new file mode 100644 index 0000000..fa142b2 --- /dev/null +++ b/rpm-5.4.9/lua/socket/io.c @@ -0,0 +1,32 @@ +/*=========================================================================*\ +* Input/Output abstraction +* LuaSocket toolkit +* +* RCS ID: $Id: io.c,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include "io.h" + +/*=========================================================================*\ +* Exported functions +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Initializes C structure +\*-------------------------------------------------------------------------*/ +void io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx) { + io->send = send; + io->recv = recv; + io->error = error; + io->ctx = ctx; +} + +/*-------------------------------------------------------------------------*\ +* I/O error strings +\*-------------------------------------------------------------------------*/ +const char *io_strerror(int err) { + switch (err) { + case IO_DONE: return NULL; + case IO_CLOSED: return "closed"; + case IO_TIMEOUT: return "timeout"; + default: return "unknown error"; + } +} diff --git a/rpm-5.4.9/lua/socket/io.h b/rpm-5.4.9/lua/socket/io.h new file mode 100644 index 0000000..9423d1a --- /dev/null +++ b/rpm-5.4.9/lua/socket/io.h @@ -0,0 +1,67 @@ +#ifndef IO_H +#define IO_H +/*=========================================================================*\ +* Input/Output abstraction +* LuaSocket toolkit +* +* This module defines the interface that LuaSocket expects from the +* transport layer for streamed input/output. The idea is that if any +* transport implements this interface, then the buffer.c functions +* automatically work on it. +* +* The module socket.h implements this interface, and thus the module tcp.h +* is very simple. +* +* RCS ID: $Id: io.h,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include +#include "lua.h" + +#include "timeout.h" + +/* IO error codes */ +enum { + IO_DONE = 0, /* operation completed successfully */ + IO_TIMEOUT = -1, /* operation timed out */ + IO_CLOSED = -2, /* the connection has been closed */ + IO_UNKNOWN = -3 +}; + +/* interface to error message function */ +typedef const char *(*p_error) ( + void *ctx, /* context needed by send */ + int err /* error code */ +); + +/* interface to send function */ +typedef int (*p_send) ( + void *ctx, /* context needed by send */ + const char *data, /* pointer to buffer with data to send */ + size_t count, /* number of bytes to send from buffer */ + size_t *sent, /* number of bytes sent uppon return */ + p_timeout tm /* timeout control */ +); + +/* interface to recv function */ +typedef int (*p_recv) ( + void *ctx, /* context needed by recv */ + char *data, /* pointer to buffer where data will be writen */ + size_t count, /* number of bytes to receive into buffer */ + size_t *got, /* number of bytes received uppon return */ + p_timeout tm /* timeout control */ +); + +/* IO driver definition */ +typedef struct t_io_ { + void *ctx; /* context needed by send/recv */ + p_send send; /* send function pointer */ + p_recv recv; /* receive function pointer */ + p_error error; /* strerror function */ +} t_io; +typedef t_io *p_io; + +void io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx); +const char *io_strerror(int err); + +#endif /* IO_H */ + diff --git a/rpm-5.4.9/lua/socket/ltn12.lua b/rpm-5.4.9/lua/socket/ltn12.lua new file mode 100644 index 0000000..abad121 --- /dev/null +++ b/rpm-5.4.9/lua/socket/ltn12.lua @@ -0,0 +1,292 @@ +----------------------------------------------------------------------------- +-- LTN12 - Filters, sources, sinks and pumps. +-- LuaSocket toolkit. +-- Author: Diego Nehab +-- RCS ID: $Id: ltn12.lua,v 1.1 2008/10/24 22:58:40 jbj Exp $ +----------------------------------------------------------------------------- + +----------------------------------------------------------------------------- +-- Declare module +----------------------------------------------------------------------------- +local string = require("string") +local table = require("table") +local base = _G +module("ltn12") + +filter = {} +source = {} +sink = {} +pump = {} + +-- 2048 seems to be better in windows... +BLOCKSIZE = 2048 +_VERSION = "LTN12 1.0.1" + +----------------------------------------------------------------------------- +-- Filter stuff +----------------------------------------------------------------------------- +-- returns a high level filter that cycles a low-level filter +function filter.cycle(low, ctx, extra) + base.assert(low) + return function(chunk) + local ret + ret, ctx = low(ctx, chunk, extra) + return ret + end +end + +-- chains a bunch of filters together +-- (thanks to Wim Couwenberg) +function filter.chain(...) + local n = table.getn(arg) + local top, index = 1, 1 + local retry = "" + return function(chunk) + retry = chunk and retry + while true do + if index == top then + chunk = arg[index](chunk) + if chunk == "" or top == n then return chunk + elseif chunk then index = index + 1 + else + top = top+1 + index = top + end + else + chunk = arg[index](chunk or "") + if chunk == "" then + index = index - 1 + chunk = retry + elseif chunk then + if index == n then return chunk + else index = index + 1 end + else base.error("filter returned inappropriate nil") end + end + end + end +end + +----------------------------------------------------------------------------- +-- Source stuff +----------------------------------------------------------------------------- +-- create an empty source +local function empty() + return nil +end + +function source.empty() + return empty +end + +-- returns a source that just outputs an error +function source.error(err) + return function() + return nil, err + end +end + +-- creates a file source +function source.file(handle, io_err) + if handle then + return function() + local chunk = handle:read(BLOCKSIZE) + if not chunk then handle:close() end + return chunk + end + else return source.error(io_err or "unable to open file") end +end + +-- turns a fancy source into a simple source +function source.simplify(src) + base.assert(src) + return function() + local chunk, err_or_new = src() + src = err_or_new or src + if not chunk then return nil, err_or_new + else return chunk end + end +end + +-- creates string source +function source.string(s) + if s then + local i = 1 + return function() + local chunk = string.sub(s, i, i+BLOCKSIZE-1) + i = i + BLOCKSIZE + if chunk ~= "" then return chunk + else return nil end + end + else return source.empty() end +end + +-- creates rewindable source +function source.rewind(src) + base.assert(src) + local t = {} + return function(chunk) + if not chunk then + chunk = table.remove(t) + if not chunk then return src() + else return chunk end + else + table.insert(t, chunk) + end + end +end + +function source.chain(src, f) + base.assert(src and f) + local last_in, last_out = "", "" + local state = "feeding" + local err + return function() + if not last_out then + base.error('source is empty!', 2) + end + while true do + if state == "feeding" then + last_in, err = src() + if err then return nil, err end + last_out = f(last_in) + if not last_out then + if last_in then + base.error('filter returned inappropriate nil') + else + return nil + end + elseif last_out ~= "" then + state = "eating" + if last_in then last_in = "" end + return last_out + end + else + last_out = f(last_in) + if last_out == "" then + if last_in == "" then + state = "feeding" + else + base.error('filter returned ""') + end + elseif not last_out then + if last_in then + base.error('filter returned inappropriate nil') + else + return nil + end + else + return last_out + end + end + end + end +end + +-- creates a source that produces contents of several sources, one after the +-- other, as if they were concatenated +-- (thanks to Wim Couwenberg) +function source.cat(...) + local src = table.remove(arg, 1) + return function() + while src do + local chunk, err = src() + if chunk then return chunk end + if err then return nil, err end + src = table.remove(arg, 1) + end + end +end + +----------------------------------------------------------------------------- +-- Sink stuff +----------------------------------------------------------------------------- +-- creates a sink that stores into a table +function sink.table(t) + t = t or {} + local f = function(chunk, err) + if chunk then table.insert(t, chunk) end + return 1 + end + return f, t +end + +-- turns a fancy sink into a simple sink +function sink.simplify(snk) + base.assert(snk) + return function(chunk, err) + local ret, err_or_new = snk(chunk, err) + if not ret then return nil, err_or_new end + snk = err_or_new or snk + return 1 + end +end + +-- creates a file sink +function sink.file(handle, io_err) + if handle then + return function(chunk, err) + if not chunk then + handle:close() + return 1 + else return handle:write(chunk) end + end + else return sink.error(io_err or "unable to open file") end +end + +-- creates a sink that discards data +local function null() + return 1 +end + +function sink.null() + return null +end + +-- creates a sink that just returns an error +function sink.error(err) + return function() + return nil, err + end +end + +-- chains a sink with a filter +function sink.chain(f, snk) + base.assert(f and snk) + return function(chunk, err) + if chunk ~= "" then + local filtered = f(chunk) + local done = chunk and "" + while true do + local ret, snkerr = snk(filtered, err) + if not ret then return nil, snkerr end + if filtered == done then return 1 end + filtered = f(done) + end + else return 1 end + end +end + +----------------------------------------------------------------------------- +-- Pump stuff +----------------------------------------------------------------------------- +-- pumps one chunk from the source to the sink +function pump.step(src, snk) + local chunk, src_err = src() + local ret, snk_err = snk(chunk, src_err) + if chunk and ret then return 1 + else return nil, src_err or snk_err end +end + +-- pumps all data from a source to a sink, using a step function +function pump.all(src, snk, step) + base.assert(src and snk) + step = step or pump.step + while true do + local ret, err = step(src, snk) + if not ret then + if err then return nil, err + else return 1 end + end + end +end + diff --git a/rpm-5.4.9/lua/socket/luasocket.c b/rpm-5.4.9/lua/socket/luasocket.c new file mode 100644 index 0000000..f6ceaba --- /dev/null +++ b/rpm-5.4.9/lua/socket/luasocket.c @@ -0,0 +1,118 @@ +/*=========================================================================*\ +* LuaSocket toolkit +* Networking support for the Lua language +* Diego Nehab +* 26/11/1999 +* +* This library is part of an effort to progressively increase the network +* connectivity of the Lua language. The Lua interface to networking +* functions follows the Sockets API closely, trying to simplify all tasks +* involved in setting up both client and server connections. The provided +* IO routines, however, follow the Lua style, being very similar to the +* standard Lua read and write functions. +* +* RCS ID: $Id: luasocket.c,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ + +/*=========================================================================*\ +* Standard include files +\*=========================================================================*/ +#include "lua.h" +#include "lauxlib.h" + +#if !defined(LUA_VERSION_NUM) || (LUA_VERSION_NUM < 501) +#include "compat-5.1.h" +#endif + +/*=========================================================================*\ +* LuaSocket includes +\*=========================================================================*/ +#include "luasocket.h" +#include "auxiliar.h" +#include "except.h" +#include "timeout.h" +#include "buffer.h" +#include "inet.h" +#include "tcp.h" +#include "udp.h" +#include "select.h" + +/*-------------------------------------------------------------------------*\ +* Internal function prototypes +\*-------------------------------------------------------------------------*/ +static int global_skip(lua_State *L); +static int global_unload(lua_State *L); +static int base_open(lua_State *L); + +/*-------------------------------------------------------------------------*\ +* Modules and functions +\*-------------------------------------------------------------------------*/ +static const luaL_reg mod[] = { + {"auxiliar", auxiliar_open}, + {"except", except_open}, + {"timeout", timeout_open}, + {"buffer", buffer_open}, + {"inet", inet_open}, + {"tcp", tcp_open}, + {"udp", udp_open}, + {"select", select_open}, + {NULL, NULL} +}; + +static luaL_reg func[] = { + {"skip", global_skip}, + {"__unload", global_unload}, + {NULL, NULL} +}; + +/*-------------------------------------------------------------------------*\ +* Skip a few arguments +\*-------------------------------------------------------------------------*/ +static int global_skip(lua_State *L) { + int amount = luaL_checkint(L, 1); + int ret = lua_gettop(L) - amount - 1; + return ret >= 0 ? ret : 0; +} + +/*-------------------------------------------------------------------------*\ +* Unloads the library +\*-------------------------------------------------------------------------*/ +static int global_unload(lua_State *L) { + (void) L; + socket_close(); + return 0; +} + +/*-------------------------------------------------------------------------*\ +* Setup basic stuff. +\*-------------------------------------------------------------------------*/ +static int base_open(lua_State *L) { + if (socket_open()) { + /* export functions (and leave namespace table on top of stack) */ + luaL_openlib(L, "socket", func, 0); +#ifdef LUASOCKET_DEBUG + lua_pushstring(L, "_DEBUG"); + lua_pushboolean(L, 1); + lua_rawset(L, -3); +#endif + /* make version string available to scripts */ + lua_pushstring(L, "_VERSION"); + lua_pushstring(L, LUASOCKET_VERSION); + lua_rawset(L, -3); + return 1; + } else { + lua_pushstring(L, "unable to initialize library"); + lua_error(L); + return 0; + } +} + +/*-------------------------------------------------------------------------*\ +* Initializes all library modules. +\*-------------------------------------------------------------------------*/ +LUASOCKET_API int luaopen_socket_core(lua_State *L) { + int i; + base_open(L); + for (i = 0; mod[i].name; i++) mod[i].func(L); + return 1; +} diff --git a/rpm-5.4.9/lua/socket/luasocket.h b/rpm-5.4.9/lua/socket/luasocket.h new file mode 100644 index 0000000..db5e0f5 --- /dev/null +++ b/rpm-5.4.9/lua/socket/luasocket.h @@ -0,0 +1,32 @@ +#ifndef LUASOCKET_H +#define LUASOCKET_H +/*=========================================================================*\ +* LuaSocket toolkit +* Networking support for the Lua language +* Diego Nehab +* 9/11/1999 +* +* RCS ID: $Id: luasocket.h,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include "lua.h" + +/*-------------------------------------------------------------------------*\ +* Current socket library version +\*-------------------------------------------------------------------------*/ +#define LUASOCKET_VERSION "LuaSocket 2.0.2" +#define LUASOCKET_COPYRIGHT "Copyright (C) 2004-2007 Diego Nehab" +#define LUASOCKET_AUTHORS "Diego Nehab" + +/*-------------------------------------------------------------------------*\ +* This macro prefixes all exported API functions +\*-------------------------------------------------------------------------*/ +#ifndef LUASOCKET_API +#define LUASOCKET_API extern +#endif + +/*-------------------------------------------------------------------------*\ +* Initializes the library. +\*-------------------------------------------------------------------------*/ +LUASOCKET_API int luaopen_socket_core(lua_State *L); + +#endif /* LUASOCKET_H */ diff --git a/rpm-5.4.9/lua/socket/mime.c b/rpm-5.4.9/lua/socket/mime.c new file mode 100644 index 0000000..3251687 --- /dev/null +++ b/rpm-5.4.9/lua/socket/mime.c @@ -0,0 +1,711 @@ +/*=========================================================================*\ +* MIME support functions +* LuaSocket toolkit +* +* RCS ID: $Id: mime.c,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include + +#include "lua.h" +#include "lauxlib.h" + +#if !defined(LUA_VERSION_NUM) || (LUA_VERSION_NUM < 501) +#include "compat-5.1.h" +#endif + +#include "mime.h" + +/*=========================================================================*\ +* Don't want to trust escape character constants +\*=========================================================================*/ +typedef unsigned char UC; +static const char CRLF[] = "\r\n"; +static const char EQCRLF[] = "=\r\n"; + +/*=========================================================================*\ +* Internal function prototypes. +\*=========================================================================*/ +static int mime_global_wrp(lua_State *L); +static int mime_global_b64(lua_State *L); +static int mime_global_unb64(lua_State *L); +static int mime_global_qp(lua_State *L); +static int mime_global_unqp(lua_State *L); +static int mime_global_qpwrp(lua_State *L); +static int mime_global_eol(lua_State *L); +static int mime_global_dot(lua_State *L); + +static size_t dot(int c, size_t state, luaL_Buffer *buffer); +static void b64setup(UC *b64unbase); +static size_t b64encode(UC c, UC *input, size_t size, luaL_Buffer *buffer); +static size_t b64pad(const UC *input, size_t size, luaL_Buffer *buffer); +static size_t b64decode(UC c, UC *input, size_t size, luaL_Buffer *buffer); + +static void qpsetup(UC *qpclass, UC *qpunbase); +static void qpquote(UC c, luaL_Buffer *buffer); +static size_t qpdecode(UC c, UC *input, size_t size, luaL_Buffer *buffer); +static size_t qpencode(UC c, UC *input, size_t size, + const char *marker, luaL_Buffer *buffer); +static size_t qppad(UC *input, size_t size, luaL_Buffer *buffer); + +/* code support functions */ +static luaL_reg func[] = { + { "dot", mime_global_dot }, + { "b64", mime_global_b64 }, + { "eol", mime_global_eol }, + { "qp", mime_global_qp }, + { "qpwrp", mime_global_qpwrp }, + { "unb64", mime_global_unb64 }, + { "unqp", mime_global_unqp }, + { "wrp", mime_global_wrp }, + { NULL, NULL } +}; + +/*-------------------------------------------------------------------------*\ +* Quoted-printable globals +\*-------------------------------------------------------------------------*/ +static UC qpclass[256]; +static UC qpbase[] = "0123456789ABCDEF"; +static UC qpunbase[256]; +enum {QP_PLAIN, QP_QUOTED, QP_CR, QP_IF_LAST}; + +/*-------------------------------------------------------------------------*\ +* Base64 globals +\*-------------------------------------------------------------------------*/ +static const UC b64base[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +static UC b64unbase[256]; + +/*=========================================================================*\ +* Exported functions +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Initializes module +\*-------------------------------------------------------------------------*/ +MIME_API int luaopen_mime_core(lua_State *L) +{ + luaL_openlib(L, "mime", func, 0); + /* make version string available to scripts */ + lua_pushstring(L, "_VERSION"); + lua_pushstring(L, MIME_VERSION); + lua_rawset(L, -3); + /* initialize lookup tables */ + qpsetup(qpclass, qpunbase); + b64setup(b64unbase); + return 1; +} + +/*=========================================================================*\ +* Global Lua functions +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Incrementaly breaks a string into lines. The string can have CRLF breaks. +* A, n = wrp(l, B, length) +* A is a copy of B, broken into lines of at most 'length' bytes. +* 'l' is how many bytes are left for the first line of B. +* 'n' is the number of bytes left in the last line of A. +\*-------------------------------------------------------------------------*/ +static int mime_global_wrp(lua_State *L) +{ + size_t size = 0; + int left = (int) luaL_checknumber(L, 1); + const UC *input = (UC *) luaL_optlstring(L, 2, NULL, &size); + const UC *last = input + size; + int length = (int) luaL_optnumber(L, 3, 76); + luaL_Buffer buffer; + /* end of input black-hole */ + if (!input) { + /* if last line has not been terminated, add a line break */ + if (left < length) lua_pushstring(L, CRLF); + /* otherwise, we are done */ + else lua_pushnil(L); + lua_pushnumber(L, length); + return 2; + } + luaL_buffinit(L, &buffer); + while (input < last) { + switch (*input) { + case '\r': + break; + case '\n': + luaL_addstring(&buffer, CRLF); + left = length; + break; + default: + if (left <= 0) { + left = length; + luaL_addstring(&buffer, CRLF); + } + luaL_putchar(&buffer, *input); + left--; + break; + } + input++; + } + luaL_pushresult(&buffer); + lua_pushnumber(L, left); + return 2; +} + +/*-------------------------------------------------------------------------*\ +* Fill base64 decode map. +\*-------------------------------------------------------------------------*/ +static void b64setup(UC *b64unbase) +{ + int i; + for (i = 0; i <= 255; i++) b64unbase[i] = (UC) 255; + for (i = 0; i < 64; i++) b64unbase[b64base[i]] = (UC) i; + b64unbase['='] = 0; +} + +/*-------------------------------------------------------------------------*\ +* Acumulates bytes in input buffer until 3 bytes are available. +* Translate the 3 bytes into Base64 form and append to buffer. +* Returns new number of bytes in buffer. +\*-------------------------------------------------------------------------*/ +static size_t b64encode(UC c, UC *input, size_t size, + luaL_Buffer *buffer) +{ + input[size++] = c; + if (size == 3) { + UC code[4]; + unsigned long value = 0; + value += input[0]; value <<= 8; + value += input[1]; value <<= 8; + value += input[2]; + code[3] = b64base[value & 0x3f]; value >>= 6; + code[2] = b64base[value & 0x3f]; value >>= 6; + code[1] = b64base[value & 0x3f]; value >>= 6; + code[0] = b64base[value]; + luaL_addlstring(buffer, (char *) code, 4); + size = 0; + } + return size; +} + +/*-------------------------------------------------------------------------*\ +* Encodes the Base64 last 1 or 2 bytes and adds padding '=' +* Result, if any, is appended to buffer. +* Returns 0. +\*-------------------------------------------------------------------------*/ +static size_t b64pad(const UC *input, size_t size, + luaL_Buffer *buffer) +{ + unsigned long value = 0; + UC code[4] = {'=', '=', '=', '='}; + switch (size) { + case 1: + value = input[0] << 4; + code[1] = b64base[value & 0x3f]; value >>= 6; + code[0] = b64base[value]; + luaL_addlstring(buffer, (char *) code, 4); + break; + case 2: + value = input[0]; value <<= 8; + value |= input[1]; value <<= 2; + code[2] = b64base[value & 0x3f]; value >>= 6; + code[1] = b64base[value & 0x3f]; value >>= 6; + code[0] = b64base[value]; + luaL_addlstring(buffer, (char *) code, 4); + break; + default: + break; + } + return 0; +} + +/*-------------------------------------------------------------------------*\ +* Acumulates bytes in input buffer until 4 bytes are available. +* Translate the 4 bytes from Base64 form and append to buffer. +* Returns new number of bytes in buffer. +\*-------------------------------------------------------------------------*/ +static size_t b64decode(UC c, UC *input, size_t size, + luaL_Buffer *buffer) +{ + /* ignore invalid characters */ + if (b64unbase[c] > 64) return size; + input[size++] = c; + /* decode atom */ + if (size == 4) { + UC decoded[3]; + int valid, value = 0; + value = b64unbase[input[0]]; value <<= 6; + value |= b64unbase[input[1]]; value <<= 6; + value |= b64unbase[input[2]]; value <<= 6; + value |= b64unbase[input[3]]; + decoded[2] = (UC) (value & 0xff); value >>= 8; + decoded[1] = (UC) (value & 0xff); value >>= 8; + decoded[0] = (UC) value; + /* take care of paddding */ + valid = (input[2] == '=') ? 1 : (input[3] == '=') ? 2 : 3; + luaL_addlstring(buffer, (char *) decoded, valid); + return 0; + /* need more data */ + } else return size; +} + +/*-------------------------------------------------------------------------*\ +* Incrementally applies the Base64 transfer content encoding to a string +* A, B = b64(C, D) +* A is the encoded version of the largest prefix of C .. D that is +* divisible by 3. B has the remaining bytes of C .. D, *without* encoding. +* The easiest thing would be to concatenate the two strings and +* encode the result, but we can't afford that or Lua would dupplicate +* every chunk we received. +\*-------------------------------------------------------------------------*/ +static int mime_global_b64(lua_State *L) +{ + UC atom[3]; + size_t isize = 0, asize = 0; + const UC *input = (UC *) luaL_optlstring(L, 1, NULL, &isize); + const UC *last = input + isize; + luaL_Buffer buffer; + /* end-of-input blackhole */ + if (!input) { + lua_pushnil(L); + lua_pushnil(L); + return 2; + } + /* process first part of the input */ + luaL_buffinit(L, &buffer); + while (input < last) + asize = b64encode(*input++, atom, asize, &buffer); + input = (UC *) luaL_optlstring(L, 2, NULL, &isize); + /* if second part is nil, we are done */ + if (!input) { + asize = b64pad(atom, asize, &buffer); + luaL_pushresult(&buffer); + if (!(*lua_tostring(L, -1))) lua_pushnil(L); + lua_pushnil(L); + return 2; + } + /* otherwise process the second part */ + last = input + isize; + while (input < last) + asize = b64encode(*input++, atom, asize, &buffer); + luaL_pushresult(&buffer); + lua_pushlstring(L, (char *) atom, asize); + return 2; +} + +/*-------------------------------------------------------------------------*\ +* Incrementally removes the Base64 transfer content encoding from a string +* A, B = b64(C, D) +* A is the encoded version of the largest prefix of C .. D that is +* divisible by 4. B has the remaining bytes of C .. D, *without* encoding. +\*-------------------------------------------------------------------------*/ +static int mime_global_unb64(lua_State *L) +{ + UC atom[4]; + size_t isize = 0, asize = 0; + const UC *input = (UC *) luaL_optlstring(L, 1, NULL, &isize); + const UC *last = input + isize; + luaL_Buffer buffer; + /* end-of-input blackhole */ + if (!input) { + lua_pushnil(L); + lua_pushnil(L); + return 2; + } + /* process first part of the input */ + luaL_buffinit(L, &buffer); + while (input < last) + asize = b64decode(*input++, atom, asize, &buffer); + input = (UC *) luaL_optlstring(L, 2, NULL, &isize); + /* if second is nil, we are done */ + if (!input) { + luaL_pushresult(&buffer); + if (!(*lua_tostring(L, -1))) lua_pushnil(L); + lua_pushnil(L); + return 2; + } + /* otherwise, process the rest of the input */ + last = input + isize; + while (input < last) + asize = b64decode(*input++, atom, asize, &buffer); + luaL_pushresult(&buffer); + lua_pushlstring(L, (char *) atom, asize); + return 2; +} + +/*-------------------------------------------------------------------------*\ +* Quoted-printable encoding scheme +* all (except CRLF in text) can be =XX +* CLRL in not text must be =XX=XX +* 33 through 60 inclusive can be plain +* 62 through 126 inclusive can be plain +* 9 and 32 can be plain, unless in the end of a line, where must be =XX +* encoded lines must be no longer than 76 not counting CRLF +* soft line-break are =CRLF +* To encode one byte, we need to see the next two. +* Worst case is when we see a space, and wonder if a CRLF is comming +\*-------------------------------------------------------------------------*/ +/*-------------------------------------------------------------------------*\ +* Split quoted-printable characters into classes +* Precompute reverse map for encoding +\*-------------------------------------------------------------------------*/ +static void qpsetup(UC *qpclass, UC *qpunbase) +{ + int i; + for (i = 0; i < 256; i++) qpclass[i] = QP_QUOTED; + for (i = 33; i <= 60; i++) qpclass[i] = QP_PLAIN; + for (i = 62; i <= 126; i++) qpclass[i] = QP_PLAIN; + qpclass['\t'] = QP_IF_LAST; + qpclass[' '] = QP_IF_LAST; + qpclass['\r'] = QP_CR; + for (i = 0; i < 256; i++) qpunbase[i] = 255; + qpunbase['0'] = 0; qpunbase['1'] = 1; qpunbase['2'] = 2; + qpunbase['3'] = 3; qpunbase['4'] = 4; qpunbase['5'] = 5; + qpunbase['6'] = 6; qpunbase['7'] = 7; qpunbase['8'] = 8; + qpunbase['9'] = 9; qpunbase['A'] = 10; qpunbase['a'] = 10; + qpunbase['B'] = 11; qpunbase['b'] = 11; qpunbase['C'] = 12; + qpunbase['c'] = 12; qpunbase['D'] = 13; qpunbase['d'] = 13; + qpunbase['E'] = 14; qpunbase['e'] = 14; qpunbase['F'] = 15; + qpunbase['f'] = 15; +} + +/*-------------------------------------------------------------------------*\ +* Output one character in form =XX +\*-------------------------------------------------------------------------*/ +static void qpquote(UC c, luaL_Buffer *buffer) +{ + luaL_putchar(buffer, '='); + luaL_putchar(buffer, qpbase[c >> 4]); + luaL_putchar(buffer, qpbase[c & 0x0F]); +} + +/*-------------------------------------------------------------------------*\ +* Accumulate characters until we are sure about how to deal with them. +* Once we are sure, output to the buffer, in the correct form. +\*-------------------------------------------------------------------------*/ +static size_t qpencode(UC c, UC *input, size_t size, + const char *marker, luaL_Buffer *buffer) +{ + input[size++] = c; + /* deal with all characters we can have */ + while (size > 0) { + switch (qpclass[input[0]]) { + /* might be the CR of a CRLF sequence */ + case QP_CR: + if (size < 2) return size; + if (input[1] == '\n') { + luaL_addstring(buffer, marker); + return 0; + } else qpquote(input[0], buffer); + break; + /* might be a space and that has to be quoted if last in line */ + case QP_IF_LAST: + if (size < 3) return size; + /* if it is the last, quote it and we are done */ + if (input[1] == '\r' && input[2] == '\n') { + qpquote(input[0], buffer); + luaL_addstring(buffer, marker); + return 0; + } else luaL_putchar(buffer, input[0]); + break; + /* might have to be quoted always */ + case QP_QUOTED: + qpquote(input[0], buffer); + break; + /* might never have to be quoted */ + default: + luaL_putchar(buffer, input[0]); + break; + } + input[0] = input[1]; input[1] = input[2]; + size--; + } + return 0; +} + +/*-------------------------------------------------------------------------*\ +* Deal with the final characters +\*-------------------------------------------------------------------------*/ +static size_t qppad(UC *input, size_t size, luaL_Buffer *buffer) +{ + size_t i; + for (i = 0; i < size; i++) { + if (qpclass[input[i]] == QP_PLAIN) luaL_putchar(buffer, input[i]); + else qpquote(input[i], buffer); + } + if (size > 0) luaL_addstring(buffer, EQCRLF); + return 0; +} + +/*-------------------------------------------------------------------------*\ +* Incrementally converts a string to quoted-printable +* A, B = qp(C, D, marker) +* Marker is the text to be used to replace CRLF sequences found in A. +* A is the encoded version of the largest prefix of C .. D that +* can be encoded without doubts. +* B has the remaining bytes of C .. D, *without* encoding. +\*-------------------------------------------------------------------------*/ +static int mime_global_qp(lua_State *L) +{ + + size_t asize = 0, isize = 0; + UC atom[3]; + const UC *input = (UC *) luaL_optlstring(L, 1, NULL, &isize); + const UC *last = input + isize; + const char *marker = luaL_optstring(L, 3, CRLF); + luaL_Buffer buffer; + /* end-of-input blackhole */ + if (!input) { + lua_pushnil(L); + lua_pushnil(L); + return 2; + } + /* process first part of input */ + luaL_buffinit(L, &buffer); + while (input < last) + asize = qpencode(*input++, atom, asize, marker, &buffer); + input = (UC *) luaL_optlstring(L, 2, NULL, &isize); + /* if second part is nil, we are done */ + if (!input) { + asize = qppad(atom, asize, &buffer); + luaL_pushresult(&buffer); + if (!(*lua_tostring(L, -1))) lua_pushnil(L); + lua_pushnil(L); + return 2; + } + /* otherwise process rest of input */ + last = input + isize; + while (input < last) + asize = qpencode(*input++, atom, asize, marker, &buffer); + luaL_pushresult(&buffer); + lua_pushlstring(L, (char *) atom, asize); + return 2; +} + +/*-------------------------------------------------------------------------*\ +* Accumulate characters until we are sure about how to deal with them. +* Once we are sure, output the to the buffer, in the correct form. +\*-------------------------------------------------------------------------*/ +static size_t qpdecode(UC c, UC *input, size_t size, luaL_Buffer *buffer) { + int d; + input[size++] = c; + /* deal with all characters we can deal */ + switch (input[0]) { + /* if we have an escape character */ + case '=': + if (size < 3) return size; + /* eliminate soft line break */ + if (input[1] == '\r' && input[2] == '\n') return 0; + /* decode quoted representation */ + c = qpunbase[input[1]]; d = qpunbase[input[2]]; + /* if it is an invalid, do not decode */ + if (c > 15 || d > 15) luaL_addlstring(buffer, (char *)input, 3); + else luaL_putchar(buffer, (c << 4) + d); + return 0; + case '\r': + if (size < 2) return size; + if (input[1] == '\n') luaL_addlstring(buffer, (char *)input, 2); + return 0; + default: + if (input[0] == '\t' || (input[0] > 31 && input[0] < 127)) + luaL_putchar(buffer, input[0]); + return 0; + } +} + +/*-------------------------------------------------------------------------*\ +* Incrementally decodes a string in quoted-printable +* A, B = qp(C, D) +* A is the decoded version of the largest prefix of C .. D that +* can be decoded without doubts. +* B has the remaining bytes of C .. D, *without* decoding. +\*-------------------------------------------------------------------------*/ +static int mime_global_unqp(lua_State *L) +{ + size_t asize = 0, isize = 0; + UC atom[3]; + const UC *input = (UC *) luaL_optlstring(L, 1, NULL, &isize); + const UC *last = input + isize; + luaL_Buffer buffer; + /* end-of-input blackhole */ + if (!input) { + lua_pushnil(L); + lua_pushnil(L); + return 2; + } + /* process first part of input */ + luaL_buffinit(L, &buffer); + while (input < last) + asize = qpdecode(*input++, atom, asize, &buffer); + input = (UC *) luaL_optlstring(L, 2, NULL, &isize); + /* if second part is nil, we are done */ + if (!input) { + luaL_pushresult(&buffer); + if (!(*lua_tostring(L, -1))) lua_pushnil(L); + lua_pushnil(L); + return 2; + } + /* otherwise process rest of input */ + last = input + isize; + while (input < last) + asize = qpdecode(*input++, atom, asize, &buffer); + luaL_pushresult(&buffer); + lua_pushlstring(L, (char *) atom, asize); + return 2; +} + +/*-------------------------------------------------------------------------*\ +* Incrementally breaks a quoted-printed string into lines +* A, n = qpwrp(l, B, length) +* A is a copy of B, broken into lines of at most 'length' bytes. +* 'l' is how many bytes are left for the first line of B. +* 'n' is the number of bytes left in the last line of A. +* There are two complications: lines can't be broken in the middle +* of an encoded =XX, and there might be line breaks already +\*-------------------------------------------------------------------------*/ +static int mime_global_qpwrp(lua_State *L) +{ + size_t size = 0; + int left = (int) luaL_checknumber(L, 1); + const UC *input = (UC *) luaL_optlstring(L, 2, NULL, &size); + const UC *last = input + size; + int length = (int) luaL_optnumber(L, 3, 76); + luaL_Buffer buffer; + /* end-of-input blackhole */ + if (!input) { + if (left < length) lua_pushstring(L, EQCRLF); + else lua_pushnil(L); + lua_pushnumber(L, length); + return 2; + } + /* process all input */ + luaL_buffinit(L, &buffer); + while (input < last) { + switch (*input) { + case '\r': + break; + case '\n': + left = length; + luaL_addstring(&buffer, CRLF); + break; + case '=': + if (left <= 3) { + left = length; + luaL_addstring(&buffer, EQCRLF); + } + luaL_putchar(&buffer, *input); + left--; + break; + default: + if (left <= 1) { + left = length; + luaL_addstring(&buffer, EQCRLF); + } + luaL_putchar(&buffer, *input); + left--; + break; + } + input++; + } + luaL_pushresult(&buffer); + lua_pushnumber(L, left); + return 2; +} + +/*-------------------------------------------------------------------------*\ +* Here is what we do: \n, and \r are considered candidates for line +* break. We issue *one* new line marker if any of them is seen alone, or +* followed by a different one. That is, \n\n and \r\r will issue two +* end of line markers each, but \r\n, \n\r etc will only issue *one* +* marker. This covers Mac OS, Mac OS X, VMS, Unix and DOS, as well as +* probably other more obscure conventions. +* +* c is the current character being processed +* last is the previous character +\*-------------------------------------------------------------------------*/ +#define eolcandidate(c) (c == '\r' || c == '\n') +static int eolprocess(int c, int last, const char *marker, + luaL_Buffer *buffer) +{ + if (eolcandidate(c)) { + if (eolcandidate(last)) { + if (c == last) luaL_addstring(buffer, marker); + return 0; + } else { + luaL_addstring(buffer, marker); + return c; + } + } else { + luaL_putchar(buffer, c); + return 0; + } +} + +/*-------------------------------------------------------------------------*\ +* Converts a string to uniform EOL convention. +* A, n = eol(o, B, marker) +* A is the converted version of the largest prefix of B that can be +* converted unambiguously. 'o' is the context returned by the previous +* call. 'n' is the new context. +\*-------------------------------------------------------------------------*/ +static int mime_global_eol(lua_State *L) +{ + int ctx = luaL_checkint(L, 1); + size_t isize = 0; + const char *input = luaL_optlstring(L, 2, NULL, &isize); + const char *last = input + isize; + const char *marker = luaL_optstring(L, 3, CRLF); + luaL_Buffer buffer; + luaL_buffinit(L, &buffer); + /* end of input blackhole */ + if (!input) { + lua_pushnil(L); + lua_pushnumber(L, 0); + return 2; + } + /* process all input */ + while (input < last) + ctx = eolprocess(*input++, ctx, marker, &buffer); + luaL_pushresult(&buffer); + lua_pushnumber(L, ctx); + return 2; +} + +/*-------------------------------------------------------------------------*\ +* Takes one byte and stuff it if needed. +\*-------------------------------------------------------------------------*/ +static size_t dot(int c, size_t state, luaL_Buffer *buffer) +{ + luaL_putchar(buffer, c); + switch (c) { + case '\r': + return 1; + case '\n': + return (state == 1)? 2: 0; + case '.': + if (state == 2) + luaL_putchar(buffer, '.'); + default: + return 0; + } +} + +/*-------------------------------------------------------------------------*\ +* Incrementally applies smtp stuffing to a string +* A, n = dot(l, D) +\*-------------------------------------------------------------------------*/ +static int mime_global_dot(lua_State *L) +{ + size_t isize = 0, state = (size_t) luaL_checknumber(L, 1); + const char *input = luaL_optlstring(L, 2, NULL, &isize); + const char *last = input + isize; + luaL_Buffer buffer; + /* end-of-input blackhole */ + if (!input) { + lua_pushnil(L); + lua_pushnumber(L, 2); + return 2; + } + /* process all input */ + luaL_buffinit(L, &buffer); + while (input < last) + state = dot(*input++, state, &buffer); + luaL_pushresult(&buffer); + lua_pushnumber(L, state); + return 2; +} + diff --git a/rpm-5.4.9/lua/socket/mime.h b/rpm-5.4.9/lua/socket/mime.h new file mode 100644 index 0000000..efd3c78 --- /dev/null +++ b/rpm-5.4.9/lua/socket/mime.h @@ -0,0 +1,31 @@ +#ifndef MIME_H +#define MIME_H +/*=========================================================================*\ +* Core MIME support +* LuaSocket toolkit +* +* This module provides functions to implement transfer content encodings +* and formatting conforming to RFC 2045. It is used by mime.lua, which +* provide a higher level interface to this functionality. +* +* RCS ID: $Id: mime.h,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include "lua.h" + +/*-------------------------------------------------------------------------*\ +* Current MIME library version +\*-------------------------------------------------------------------------*/ +#define MIME_VERSION "MIME 1.0.2" +#define MIME_COPYRIGHT "Copyright (C) 2004-2007 Diego Nehab" +#define MIME_AUTHORS "Diego Nehab" + +/*-------------------------------------------------------------------------*\ +* This macro prefixes all exported API functions +\*-------------------------------------------------------------------------*/ +#ifndef MIME_API +#define MIME_API extern +#endif + +MIME_API int luaopen_mime_core(lua_State *L); + +#endif /* MIME_H */ diff --git a/rpm-5.4.9/lua/socket/mime.lua b/rpm-5.4.9/lua/socket/mime.lua new file mode 100644 index 0000000..781f390 --- /dev/null +++ b/rpm-5.4.9/lua/socket/mime.lua @@ -0,0 +1,87 @@ +----------------------------------------------------------------------------- +-- MIME support for the Lua language. +-- Author: Diego Nehab +-- Conforming to RFCs 2045-2049 +-- RCS ID: $Id: mime.lua,v 1.1 2008/10/24 22:58:40 jbj Exp $ +----------------------------------------------------------------------------- + +----------------------------------------------------------------------------- +-- Declare module and import dependencies +----------------------------------------------------------------------------- +local base = _G +local ltn12 = require("ltn12") +local mime = require("mime.core") +local io = require("io") +local string = require("string") +module("mime") + +-- encode, decode and wrap algorithm tables +encodet = {} +decodet = {} +wrapt = {} + +-- creates a function that chooses a filter by name from a given table +local function choose(table) + return function(name, opt1, opt2) + if base.type(name) ~= "string" then + name, opt1, opt2 = "default", name, opt1 + end + local f = table[name or "nil"] + if not f then + base.error("unknown key (" .. base.tostring(name) .. ")", 3) + else return f(opt1, opt2) end + end +end + +-- define the encoding filters +encodet['base64'] = function() + return ltn12.filter.cycle(b64, "") +end + +encodet['quoted-printable'] = function(mode) + return ltn12.filter.cycle(qp, "", + (mode == "binary") and "=0D=0A" or "\r\n") +end + +-- define the decoding filters +decodet['base64'] = function() + return ltn12.filter.cycle(unb64, "") +end + +decodet['quoted-printable'] = function() + return ltn12.filter.cycle(unqp, "") +end + +local function format(chunk) + if chunk then + if chunk == "" then return "''" + else return string.len(chunk) end + else return "nil" end +end + +-- define the line-wrap filters +wrapt['text'] = function(length) + length = length or 76 + return ltn12.filter.cycle(wrp, length, length) +end +wrapt['base64'] = wrapt['text'] +wrapt['default'] = wrapt['text'] + +wrapt['quoted-printable'] = function() + return ltn12.filter.cycle(qpwrp, 76, 76) +end + +-- function that choose the encoding, decoding or wrap algorithm +encode = choose(encodet) +decode = choose(decodet) +wrap = choose(wrapt) + +-- define the end-of-line normalization filter +function normalize(marker) + return ltn12.filter.cycle(eol, 0, marker) +end + +-- high level stuffing filter +function stuff() + return ltn12.filter.cycle(dot, 2) +end diff --git a/rpm-5.4.9/lua/socket/options.c b/rpm-5.4.9/lua/socket/options.c new file mode 100644 index 0000000..558bae0 --- /dev/null +++ b/rpm-5.4.9/lua/socket/options.c @@ -0,0 +1,149 @@ +/*=========================================================================*\ +* Common option interface +* LuaSocket toolkit +* +* RCS ID: $Id: options.c,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include + +#include "lauxlib.h" + +#include "auxiliar.h" +#include "options.h" +#include "inet.h" + + +/*=========================================================================*\ +* Internal functions prototypes +\*=========================================================================*/ +static int opt_setmembership(lua_State *L, p_socket ps, int level, int name); +static int opt_setboolean(lua_State *L, p_socket ps, int level, int name); +static int opt_set(lua_State *L, p_socket ps, int level, int name, + void *val, int len); + +/*=========================================================================*\ +* Exported functions +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Calls appropriate option handler +\*-------------------------------------------------------------------------*/ +int opt_meth_setoption(lua_State *L, p_opt opt, p_socket ps) +{ + const char *name = luaL_checkstring(L, 2); /* obj, name, ... */ + while (opt->name && strcmp(name, opt->name)) + opt++; + if (!opt->func) { + char msg[45]; + sprintf(msg, "unsupported option `%.35s'", name); + luaL_argerror(L, 2, msg); + } + return opt->func(L, ps); +} + +/* enables reuse of local address */ +int opt_reuseaddr(lua_State *L, p_socket ps) +{ + return opt_setboolean(L, ps, SOL_SOCKET, SO_REUSEADDR); +} + +/* disables the Naggle algorithm */ +int opt_tcp_nodelay(lua_State *L, p_socket ps) +{ + return opt_setboolean(L, ps, IPPROTO_TCP, TCP_NODELAY); +} + +int opt_keepalive(lua_State *L, p_socket ps) +{ + return opt_setboolean(L, ps, SOL_SOCKET, SO_KEEPALIVE); +} + +int opt_dontroute(lua_State *L, p_socket ps) +{ + return opt_setboolean(L, ps, SOL_SOCKET, SO_DONTROUTE); +} + +int opt_broadcast(lua_State *L, p_socket ps) +{ + return opt_setboolean(L, ps, SOL_SOCKET, SO_BROADCAST); +} + +int opt_ip_multicast_loop(lua_State *L, p_socket ps) +{ + return opt_setboolean(L, ps, IPPROTO_IP, IP_MULTICAST_LOOP); +} + +int opt_linger(lua_State *L, p_socket ps) +{ + struct linger li; /* obj, name, table */ + if (!lua_istable(L, 3)) luaL_typerror(L, 3, lua_typename(L, LUA_TTABLE)); + lua_pushstring(L, "on"); + lua_gettable(L, 3); + if (!lua_isboolean(L, -1)) + luaL_argerror(L, 3, "boolean 'on' field expected"); + li.l_onoff = (u_short) lua_toboolean(L, -1); + lua_pushstring(L, "timeout"); + lua_gettable(L, 3); + if (!lua_isnumber(L, -1)) + luaL_argerror(L, 3, "number 'timeout' field expected"); + li.l_linger = (u_short) lua_tonumber(L, -1); + return opt_set(L, ps, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(li)); +} + +int opt_ip_multicast_ttl(lua_State *L, p_socket ps) +{ + int val = (int) luaL_checknumber(L, 3); /* obj, name, int */ + return opt_set(L, ps, SOL_SOCKET, SO_LINGER, (char *) &val, sizeof(val)); +} + +int opt_ip_add_membership(lua_State *L, p_socket ps) +{ + return opt_setmembership(L, ps, IPPROTO_IP, IP_ADD_MEMBERSHIP); +} + +int opt_ip_drop_membersip(lua_State *L, p_socket ps) +{ + return opt_setmembership(L, ps, IPPROTO_IP, IP_DROP_MEMBERSHIP); +} + +/*=========================================================================*\ +* Auxiliar functions +\*=========================================================================*/ +static int opt_setmembership(lua_State *L, p_socket ps, int level, int name) +{ + struct ip_mreq val; /* obj, name, table */ + if (!lua_istable(L, 3)) luaL_typerror(L, 3, lua_typename(L, LUA_TTABLE)); + lua_pushstring(L, "multiaddr"); + lua_gettable(L, 3); + if (!lua_isstring(L, -1)) + luaL_argerror(L, 3, "string 'multiaddr' field expected"); + if (!inet_aton(lua_tostring(L, -1), &val.imr_multiaddr)) + luaL_argerror(L, 3, "invalid 'multiaddr' ip address"); + lua_pushstring(L, "interface"); + lua_gettable(L, 3); + if (!lua_isstring(L, -1)) + luaL_argerror(L, 3, "string 'interface' field expected"); + val.imr_interface.s_addr = htonl(INADDR_ANY); + if (strcmp(lua_tostring(L, -1), "*") && + !inet_aton(lua_tostring(L, -1), &val.imr_interface)) + luaL_argerror(L, 3, "invalid 'interface' ip address"); + return opt_set(L, ps, level, name, (char *) &val, sizeof(val)); +} + +static +int opt_set(lua_State *L, p_socket ps, int level, int name, void *val, int len) +{ + if (setsockopt(*ps, level, name, (char *) val, len) < 0) { + lua_pushnil(L); + lua_pushstring(L, "setsockopt failed"); + return 2; + } + lua_pushnumber(L, 1); + return 1; +} + +static int opt_setboolean(lua_State *L, p_socket ps, int level, int name) +{ + int val = auxiliar_checkboolean(L, 3); /* obj, name, bool */ + return opt_set(L, ps, level, name, (char *) &val, sizeof(val)); +} + diff --git a/rpm-5.4.9/lua/socket/options.h b/rpm-5.4.9/lua/socket/options.h new file mode 100644 index 0000000..6477588 --- /dev/null +++ b/rpm-5.4.9/lua/socket/options.h @@ -0,0 +1,39 @@ +#ifndef OPTIONS_H +#define OPTIONS_H +/*=========================================================================*\ +* Common option interface +* LuaSocket toolkit +* +* This module provides a common interface to socket options, used mainly by +* modules UDP and TCP. +* +* RCS ID: $Id: options.h,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ + +#include "lua.h" +#include "socket.h" + +/* option registry */ +typedef struct t_opt { + const char *name; + int (*func)(lua_State *L, p_socket ps); +} t_opt; +typedef t_opt *p_opt; + +/* supported options */ +int opt_dontroute(lua_State *L, p_socket ps); +int opt_broadcast(lua_State *L, p_socket ps); +int opt_reuseaddr(lua_State *L, p_socket ps); +int opt_tcp_nodelay(lua_State *L, p_socket ps); +int opt_keepalive(lua_State *L, p_socket ps); +int opt_linger(lua_State *L, p_socket ps); +int opt_reuseaddr(lua_State *L, p_socket ps); +int opt_ip_multicast_ttl(lua_State *L, p_socket ps); +int opt_ip_multicast_loop(lua_State *L, p_socket ps); +int opt_ip_add_membership(lua_State *L, p_socket ps); +int opt_ip_drop_membersip(lua_State *L, p_socket ps); + +/* invokes the appropriate option handler */ +int opt_meth_setoption(lua_State *L, p_opt opt, p_socket ps); + +#endif diff --git a/rpm-5.4.9/lua/socket/select.c b/rpm-5.4.9/lua/socket/select.c new file mode 100644 index 0000000..d4f5b16 --- /dev/null +++ b/rpm-5.4.9/lua/socket/select.c @@ -0,0 +1,200 @@ +/*=========================================================================*\ +* Select implementation +* LuaSocket toolkit +* +* RCS ID: $Id: select.c,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include + +#include "lua.h" +#include "lauxlib.h" + +#include "socket.h" +#include "timeout.h" +#include "select.h" + +/*=========================================================================*\ +* Internal function prototypes. +\*=========================================================================*/ +static t_socket getfd(lua_State *L); +static int dirty(lua_State *L); +static t_socket collect_fd(lua_State *L, int tab, t_socket max_fd, + int itab, fd_set *set); +static int check_dirty(lua_State *L, int tab, int dtab, fd_set *set); +static void return_fd(lua_State *L, fd_set *set, t_socket max_fd, + int itab, int tab, int start); +static void make_assoc(lua_State *L, int tab); +static int global_select(lua_State *L); + +/* functions in library namespace */ +static luaL_reg func[] = { + {"select", global_select}, + {NULL, NULL} +}; + +/*=========================================================================*\ +* Exported functions +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Initializes module +\*-------------------------------------------------------------------------*/ +int select_open(lua_State *L) { + luaL_openlib(L, NULL, func, 0); + return 0; +} + +/*=========================================================================*\ +* Global Lua functions +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Waits for a set of sockets until a condition is met or timeout. +\*-------------------------------------------------------------------------*/ +static int global_select(lua_State *L) { + int rtab, wtab, itab, ret, ndirty; + t_socket max_fd; + fd_set rset, wset; + t_timeout tm; + double t = luaL_optnumber(L, 3, -1); + FD_ZERO(&rset); FD_ZERO(&wset); + lua_settop(L, 3); + lua_newtable(L); itab = lua_gettop(L); + lua_newtable(L); rtab = lua_gettop(L); + lua_newtable(L); wtab = lua_gettop(L); + max_fd = collect_fd(L, 1, SOCKET_INVALID, itab, &rset); + ndirty = check_dirty(L, 1, rtab, &rset); + t = ndirty > 0? 0.0: t; + timeout_init(&tm, t, -1); + timeout_markstart(&tm); + max_fd = collect_fd(L, 2, max_fd, itab, &wset); + ret = socket_select(max_fd+1, &rset, &wset, NULL, &tm); + if (ret > 0 || ndirty > 0) { + return_fd(L, &rset, max_fd+1, itab, rtab, ndirty); + return_fd(L, &wset, max_fd+1, itab, wtab, 0); + make_assoc(L, rtab); + make_assoc(L, wtab); + return 2; + } else if (ret == 0) { + lua_pushstring(L, "timeout"); + return 3; + } else { + lua_pushstring(L, "error"); + return 3; + } +} + +/*=========================================================================*\ +* Internal functions +\*=========================================================================*/ +static t_socket getfd(lua_State *L) { + t_socket fd = SOCKET_INVALID; + lua_pushstring(L, "getfd"); + lua_gettable(L, -2); + if (!lua_isnil(L, -1)) { + lua_pushvalue(L, -2); + lua_call(L, 1, 1); + if (lua_isnumber(L, -1)) + fd = (t_socket) lua_tonumber(L, -1); + } + lua_pop(L, 1); + return fd; +} + +static int dirty(lua_State *L) { + int is = 0; + lua_pushstring(L, "dirty"); + lua_gettable(L, -2); + if (!lua_isnil(L, -1)) { + lua_pushvalue(L, -2); + lua_call(L, 1, 1); + is = lua_toboolean(L, -1); + } + lua_pop(L, 1); + return is; +} + +static t_socket collect_fd(lua_State *L, int tab, t_socket max_fd, + int itab, fd_set *set) { + int i = 1; + if (lua_isnil(L, tab)) + return max_fd; + while (1) { + t_socket fd; + lua_pushnumber(L, i); + lua_gettable(L, tab); + if (lua_isnil(L, -1)) { + lua_pop(L, 1); + break; + } + fd = getfd(L); + if (fd != SOCKET_INVALID) { + FD_SET(fd, set); + if (max_fd == SOCKET_INVALID || max_fd < fd) + max_fd = fd; + lua_pushnumber(L, fd); + lua_pushvalue(L, -2); + lua_settable(L, itab); + } + lua_pop(L, 1); + i = i + 1; + } + return max_fd; +} + +static int check_dirty(lua_State *L, int tab, int dtab, fd_set *set) { + int ndirty = 0, i = 1; + if (lua_isnil(L, tab)) + return 0; + while (1) { + t_socket fd; + lua_pushnumber(L, i); + lua_gettable(L, tab); + if (lua_isnil(L, -1)) { + lua_pop(L, 1); + break; + } + fd = getfd(L); + if (fd != SOCKET_INVALID && dirty(L)) { + lua_pushnumber(L, ++ndirty); + lua_pushvalue(L, -2); + lua_settable(L, dtab); + FD_CLR(fd, set); + } + lua_pop(L, 1); + i = i + 1; + } + return ndirty; +} + +static void return_fd(lua_State *L, fd_set *set, t_socket max_fd, + int itab, int tab, int start) { + t_socket fd; + for (fd = 0; fd < max_fd; fd++) { + if (FD_ISSET(fd, set)) { + lua_pushnumber(L, ++start); + lua_pushnumber(L, fd); + lua_gettable(L, itab); + lua_settable(L, tab); + } + } +} + +static void make_assoc(lua_State *L, int tab) { + int i = 1, atab; + lua_newtable(L); atab = lua_gettop(L); + while (1) { + lua_pushnumber(L, i); + lua_gettable(L, tab); + if (!lua_isnil(L, -1)) { + lua_pushnumber(L, i); + lua_pushvalue(L, -2); + lua_settable(L, atab); + lua_pushnumber(L, i); + lua_settable(L, atab); + } else { + lua_pop(L, 1); + break; + } + i = i+1; + } +} + diff --git a/rpm-5.4.9/lua/socket/select.h b/rpm-5.4.9/lua/socket/select.h new file mode 100644 index 0000000..e6f6077 --- /dev/null +++ b/rpm-5.4.9/lua/socket/select.h @@ -0,0 +1,17 @@ +#ifndef SELECT_H +#define SELECT_H +/*=========================================================================*\ +* Select implementation +* LuaSocket toolkit +* +* Each object that can be passed to the select function has to export +* method getfd() which returns the descriptor to be passed to the +* underlying select function. Another method, dirty(), should return +* true if there is data ready for reading (required for buffered input). +* +* RCS ID: $Id: select.h,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ + +int select_open(lua_State *L); + +#endif /* SELECT_H */ diff --git a/rpm-5.4.9/lua/socket/smtp.lua b/rpm-5.4.9/lua/socket/smtp.lua new file mode 100644 index 0000000..4ef87ac --- /dev/null +++ b/rpm-5.4.9/lua/socket/smtp.lua @@ -0,0 +1,251 @@ +----------------------------------------------------------------------------- +-- SMTP client support for the Lua language. +-- LuaSocket toolkit. +-- Author: Diego Nehab +-- RCS ID: $Id: smtp.lua,v 1.1 2008/10/24 22:58:40 jbj Exp $ +----------------------------------------------------------------------------- + +----------------------------------------------------------------------------- +-- Declare module and import dependencies +----------------------------------------------------------------------------- +local base = _G +local coroutine = require("coroutine") +local string = require("string") +local math = require("math") +local os = require("os") +local socket = require("socket") +local tp = require("socket.tp") +local ltn12 = require("ltn12") +local mime = require("mime") +module("socket.smtp") + +----------------------------------------------------------------------------- +-- Program constants +----------------------------------------------------------------------------- +-- timeout for connection +TIMEOUT = 60 +-- default server used to send e-mails +SERVER = "localhost" +-- default port +PORT = 25 +-- domain used in HELO command and default sendmail +-- If we are under a CGI, try to get from environment +DOMAIN = os.getenv("SERVER_NAME") or "localhost" +-- default time zone (means we don't know) +ZONE = "-0000" + +--------------------------------------------------------------------------- +-- Low level SMTP API +----------------------------------------------------------------------------- +local metat = { __index = {} } + +function metat.__index:greet(domain) + self.try(self.tp:check("2..")) + self.try(self.tp:command("EHLO", domain or DOMAIN)) + return socket.skip(1, self.try(self.tp:check("2.."))) +end + +function metat.__index:mail(from) + self.try(self.tp:command("MAIL", "FROM:" .. from)) + return self.try(self.tp:check("2..")) +end + +function metat.__index:rcpt(to) + self.try(self.tp:command("RCPT", "TO:" .. to)) + return self.try(self.tp:check("2..")) +end + +function metat.__index:data(src, step) + self.try(self.tp:command("DATA")) + self.try(self.tp:check("3..")) + self.try(self.tp:source(src, step)) + self.try(self.tp:send("\r\n.\r\n")) + return self.try(self.tp:check("2..")) +end + +function metat.__index:quit() + self.try(self.tp:command("QUIT")) + return self.try(self.tp:check("2..")) +end + +function metat.__index:close() + return self.tp:close() +end + +function metat.__index:login(user, password) + self.try(self.tp:command("AUTH", "LOGIN")) + self.try(self.tp:check("3..")) + self.try(self.tp:command(mime.b64(user))) + self.try(self.tp:check("3..")) + self.try(self.tp:command(mime.b64(password))) + return self.try(self.tp:check("2..")) +end + +function metat.__index:plain(user, password) + local auth = "PLAIN " .. mime.b64("\0" .. user .. "\0" .. password) + self.try(self.tp:command("AUTH", auth)) + return self.try(self.tp:check("2..")) +end + +function metat.__index:auth(user, password, ext) + if not user or not password then return 1 end + if string.find(ext, "AUTH[^\n]+LOGIN") then + return self:login(user, password) + elseif string.find(ext, "AUTH[^\n]+PLAIN") then + return self:plain(user, password) + else + self.try(nil, "authentication not supported") + end +end + +-- send message or throw an exception +function metat.__index:send(mailt) + self:mail(mailt.from) + if base.type(mailt.rcpt) == "table" then + for i,v in base.ipairs(mailt.rcpt) do + self:rcpt(v) + end + else + self:rcpt(mailt.rcpt) + end + self:data(ltn12.source.chain(mailt.source, mime.stuff()), mailt.step) +end + +function open(server, port, create) + local tp = socket.try(tp.connect(server or SERVER, port or PORT, + TIMEOUT, create)) + local s = base.setmetatable({tp = tp}, metat) + -- make sure tp is closed if we get an exception + s.try = socket.newtry(function() + s:close() + end) + return s +end + +-- convert headers to lowercase +local function lower_headers(headers) + local lower = {} + for i,v in base.pairs(headers or lower) do + lower[string.lower(i)] = v + end + return lower +end + +--------------------------------------------------------------------------- +-- Multipart message source +----------------------------------------------------------------------------- +-- returns a hopefully unique mime boundary +local seqno = 0 +local function newboundary() + seqno = seqno + 1 + return string.format('%s%05d==%05u', os.date('%d%m%Y%H%M%S'), + math.random(0, 99999), seqno) +end + +-- send_message forward declaration +local send_message + +-- yield the headers all at once, it's faster +local function send_headers(headers) + local h = "\r\n" + for i,v in base.pairs(headers) do + h = i .. ': ' .. v .. "\r\n" .. h + end + coroutine.yield(h) +end + +-- yield multipart message body from a multipart message table +local function send_multipart(mesgt) + -- make sure we have our boundary and send headers + local bd = newboundary() + local headers = lower_headers(mesgt.headers or {}) + headers['content-type'] = headers['content-type'] or 'multipart/mixed' + headers['content-type'] = headers['content-type'] .. + '; boundary="' .. bd .. '"' + send_headers(headers) + -- send preamble + if mesgt.body.preamble then + coroutine.yield(mesgt.body.preamble) + coroutine.yield("\r\n") + end + -- send each part separated by a boundary + for i, m in base.ipairs(mesgt.body) do + coroutine.yield("\r\n--" .. bd .. "\r\n") + send_message(m) + end + -- send last boundary + coroutine.yield("\r\n--" .. bd .. "--\r\n\r\n") + -- send epilogue + if mesgt.body.epilogue then + coroutine.yield(mesgt.body.epilogue) + coroutine.yield("\r\n") + end +end + +-- yield message body from a source +local function send_source(mesgt) + -- make sure we have a content-type + local headers = lower_headers(mesgt.headers or {}) + headers['content-type'] = headers['content-type'] or + 'text/plain; charset="iso-8859-1"' + send_headers(headers) + -- send body from source + while true do + local chunk, err = mesgt.body() + if err then coroutine.yield(nil, err) + elseif chunk then coroutine.yield(chunk) + else break end + end +end + +-- yield message body from a string +local function send_string(mesgt) + -- make sure we have a content-type + local headers = lower_headers(mesgt.headers or {}) + headers['content-type'] = headers['content-type'] or + 'text/plain; charset="iso-8859-1"' + send_headers(headers) + -- send body from string + coroutine.yield(mesgt.body) +end + +-- message source +function send_message(mesgt) + if base.type(mesgt.body) == "table" then send_multipart(mesgt) + elseif base.type(mesgt.body) == "function" then send_source(mesgt) + else send_string(mesgt) end +end + +-- set defaul headers +local function adjust_headers(mesgt) + local lower = lower_headers(mesgt.headers) + lower["date"] = lower["date"] or + os.date("!%a, %d %b %Y %H:%M:%S ") .. (mesgt.zone or ZONE) + lower["x-mailer"] = lower["x-mailer"] or socket._VERSION + -- this can't be overriden + lower["mime-version"] = "1.0" + return lower +end + +function message(mesgt) + mesgt.headers = adjust_headers(mesgt) + -- create and return message source + local co = coroutine.create(function() send_message(mesgt) end) + return function() + local ret, a, b = coroutine.resume(co) + if ret then return a, b + else return nil, a end + end +end + +--------------------------------------------------------------------------- +-- High level SMTP API +----------------------------------------------------------------------------- +send = socket.protect(function(mailt) + local s = open(mailt.server, mailt.port, mailt.create) + local ext = s:greet(mailt.domain) + s:auth(mailt.user, mailt.password, ext) + s:send(mailt) + s:quit() + return s:close() +end) diff --git a/rpm-5.4.9/lua/socket/socket.h b/rpm-5.4.9/lua/socket/socket.h new file mode 100644 index 0000000..a92df36 --- /dev/null +++ b/rpm-5.4.9/lua/socket/socket.h @@ -0,0 +1,76 @@ +#ifndef SOCKET_H +#define SOCKET_H +/*=========================================================================*\ +* Socket compatibilization module +* LuaSocket toolkit +* +* BSD Sockets and WinSock are similar, but there are a few irritating +* differences. Also, not all *nix platforms behave the same. This module +* (and the associated usocket.h and wsocket.h) factor these differences and +* creates a interface compatible with the io.h module. +* +* RCS ID: $Id: socket.h,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include "io.h" + +/*=========================================================================*\ +* Platform specific compatibilization +\*=========================================================================*/ +#ifdef _WIN32 +#include "wsocket.h" +#else +#include "usocket.h" +#endif + +/*=========================================================================*\ +* The connect and accept functions accept a timeout and their +* implementations are somewhat complicated. We chose to move +* the timeout control into this module for these functions in +* order to simplify the modules that use them. +\*=========================================================================*/ +#include "timeout.h" + +/* we are lazy... */ +typedef struct sockaddr SA; + +/*=========================================================================*\ +* Functions bellow implement a comfortable platform independent +* interface to sockets +\*=========================================================================*/ +int socket_open(void); +int socket_close(void); +void socket_destroy(p_socket ps); +void socket_shutdown(p_socket ps, int how); +int socket_sendto(p_socket ps, const char *data, size_t count, + size_t *sent, SA *addr, socklen_t addr_len, p_timeout tm); +int socket_recvfrom(p_socket ps, char *data, size_t count, + size_t *got, SA *addr, socklen_t *addr_len, p_timeout tm); + +void socket_setnonblocking(p_socket ps); +void socket_setblocking(p_socket ps); + +int socket_waitfd(p_socket ps, int sw, p_timeout tm); +int socket_select(t_socket n, fd_set *rfds, fd_set *wfds, fd_set *efds, + p_timeout tm); + +int socket_connect(p_socket ps, SA *addr, socklen_t addr_len, p_timeout tm); +int socket_create(p_socket ps, int domain, int type, int protocol); +int socket_bind(p_socket ps, SA *addr, socklen_t addr_len); +int socket_listen(p_socket ps, int backlog); +int socket_accept(p_socket ps, p_socket pa, SA *addr, + socklen_t *addr_len, p_timeout tm); + +const char *socket_hoststrerror(int err); +const char *socket_strerror(int err); + +/* these are perfect to use with the io abstraction module + and the buffered input module */ +int socket_send(p_socket ps, const char *data, size_t count, + size_t *sent, p_timeout tm); +int socket_recv(p_socket ps, char *data, size_t count, size_t *got, p_timeout tm); +const char *socket_ioerror(p_socket ps, int err); + +int socket_gethostbyaddr(const char *addr, socklen_t len, struct hostent **hp); +int socket_gethostbyname(const char *addr, struct hostent **hp); + +#endif /* SOCKET_H */ diff --git a/rpm-5.4.9/lua/socket/socket.lua b/rpm-5.4.9/lua/socket/socket.lua new file mode 100644 index 0000000..6b01e1f --- /dev/null +++ b/rpm-5.4.9/lua/socket/socket.lua @@ -0,0 +1,133 @@ +----------------------------------------------------------------------------- +-- LuaSocket helper module +-- Author: Diego Nehab +-- RCS ID: $Id: socket.lua,v 1.1 2008/10/24 22:58:40 jbj Exp $ +----------------------------------------------------------------------------- + +----------------------------------------------------------------------------- +-- Declare module and import dependencies +----------------------------------------------------------------------------- +local base = _G +local string = require("string") +local math = require("math") +local socket = require("socket.core") +module("socket") + +----------------------------------------------------------------------------- +-- Exported auxiliar functions +----------------------------------------------------------------------------- +function connect(address, port, laddress, lport) + local sock, err = socket.tcp() + if not sock then return nil, err end + if laddress then + local res, err = sock:bind(laddress, lport, -1) + if not res then return nil, err end + end + local res, err = sock:connect(address, port) + if not res then return nil, err end + return sock +end + +function bind(host, port, backlog) + local sock, err = socket.tcp() + if not sock then return nil, err end + sock:setoption("reuseaddr", true) + local res, err = sock:bind(host, port) + if not res then return nil, err end + res, err = sock:listen(backlog) + if not res then return nil, err end + return sock +end + +try = newtry() + +function choose(table) + return function(name, opt1, opt2) + if base.type(name) ~= "string" then + name, opt1, opt2 = "default", name, opt1 + end + local f = table[name or "nil"] + if not f then base.error("unknown key (".. base.tostring(name) ..")", 3) + else return f(opt1, opt2) end + end +end + +----------------------------------------------------------------------------- +-- Socket sources and sinks, conforming to LTN12 +----------------------------------------------------------------------------- +-- create namespaces inside LuaSocket namespace +sourcet = {} +sinkt = {} + +BLOCKSIZE = 2048 + +sinkt["close-when-done"] = function(sock) + return base.setmetatable({ + getfd = function() return sock:getfd() end, + dirty = function() return sock:dirty() end + }, { + __call = function(self, chunk, err) + if not chunk then + sock:close() + return 1 + else return sock:send(chunk) end + end + }) +end + +sinkt["keep-open"] = function(sock) + return base.setmetatable({ + getfd = function() return sock:getfd() end, + dirty = function() return sock:dirty() end + }, { + __call = function(self, chunk, err) + if chunk then return sock:send(chunk) + else return 1 end + end + }) +end + +sinkt["default"] = sinkt["keep-open"] + +sink = choose(sinkt) + +sourcet["by-length"] = function(sock, length) + return base.setmetatable({ + getfd = function() return sock:getfd() end, + dirty = function() return sock:dirty() end + }, { + __call = function() + if length <= 0 then return nil end + local size = math.min(socket.BLOCKSIZE, length) + local chunk, err = sock:receive(size) + if err then return nil, err end + length = length - string.len(chunk) + return chunk + end + }) +end + +sourcet["until-closed"] = function(sock) + local done + return base.setmetatable({ + getfd = function() return sock:getfd() end, + dirty = function() return sock:dirty() end + }, { + __call = function() + if done then return nil end + local chunk, err, partial = sock:receive(socket.BLOCKSIZE) + if not err then return chunk + elseif err == "closed" then + sock:close() + done = 1 + return partial + else return nil, err end + end + }) +end + + +sourcet["default"] = sourcet["until-closed"] + +source = choose(sourcet) + diff --git a/rpm-5.4.9/lua/socket/tcp.c b/rpm-5.4.9/lua/socket/tcp.c new file mode 100644 index 0000000..dcf5ebd --- /dev/null +++ b/rpm-5.4.9/lua/socket/tcp.c @@ -0,0 +1,339 @@ +/*=========================================================================*\ +* TCP object +* LuaSocket toolkit +* +* RCS ID: $Id: tcp.c,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include + +#include "lua.h" +#include "lauxlib.h" + +#include "auxiliar.h" +#include "socket.h" +#include "inet.h" +#include "options.h" +#include "tcp.h" + +/*=========================================================================*\ +* Internal function prototypes +\*=========================================================================*/ +static int global_create(lua_State *L); +static int meth_connect(lua_State *L); +static int meth_listen(lua_State *L); +static int meth_bind(lua_State *L); +static int meth_send(lua_State *L); +static int meth_getstats(lua_State *L); +static int meth_setstats(lua_State *L); +static int meth_getsockname(lua_State *L); +static int meth_getpeername(lua_State *L); +static int meth_shutdown(lua_State *L); +static int meth_receive(lua_State *L); +static int meth_accept(lua_State *L); +static int meth_close(lua_State *L); +static int meth_setoption(lua_State *L); +static int meth_settimeout(lua_State *L); +static int meth_getfd(lua_State *L); +static int meth_setfd(lua_State *L); +static int meth_dirty(lua_State *L); + +/* tcp object methods */ +static luaL_reg tcp[] = { + {"__gc", meth_close}, + {"__tostring", auxiliar_tostring}, + {"accept", meth_accept}, + {"bind", meth_bind}, + {"close", meth_close}, + {"connect", meth_connect}, + {"dirty", meth_dirty}, + {"getfd", meth_getfd}, + {"getpeername", meth_getpeername}, + {"getsockname", meth_getsockname}, + {"getstats", meth_getstats}, + {"setstats", meth_setstats}, + {"listen", meth_listen}, + {"receive", meth_receive}, + {"send", meth_send}, + {"setfd", meth_setfd}, + {"setoption", meth_setoption}, + {"setpeername", meth_connect}, + {"setsockname", meth_bind}, + {"settimeout", meth_settimeout}, + {"shutdown", meth_shutdown}, + {NULL, NULL} +}; + +/* socket option handlers */ +static t_opt opt[] = { + {"keepalive", opt_keepalive}, + {"reuseaddr", opt_reuseaddr}, + {"tcp-nodelay", opt_tcp_nodelay}, + {"linger", opt_linger}, + {NULL, NULL} +}; + +/* functions in library namespace */ +static luaL_reg func[] = { + {"tcp", global_create}, + {NULL, NULL} +}; + +/*-------------------------------------------------------------------------*\ +* Initializes module +\*-------------------------------------------------------------------------*/ +int tcp_open(lua_State *L) +{ + /* create classes */ + auxiliar_newclass(L, "tcp{master}", tcp); + auxiliar_newclass(L, "tcp{client}", tcp); + auxiliar_newclass(L, "tcp{server}", tcp); + /* create class groups */ + auxiliar_add2group(L, "tcp{master}", "tcp{any}"); + auxiliar_add2group(L, "tcp{client}", "tcp{any}"); + auxiliar_add2group(L, "tcp{server}", "tcp{any}"); + /* define library functions */ + luaL_openlib(L, NULL, func, 0); + return 0; +} + +/*=========================================================================*\ +* Lua methods +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Just call buffered IO methods +\*-------------------------------------------------------------------------*/ +static int meth_send(lua_State *L) { + p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1); + return buffer_meth_send(L, &tcp->buf); +} + +static int meth_receive(lua_State *L) { + p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1); + return buffer_meth_receive(L, &tcp->buf); +} + +static int meth_getstats(lua_State *L) { + p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1); + return buffer_meth_getstats(L, &tcp->buf); +} + +static int meth_setstats(lua_State *L) { + p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1); + return buffer_meth_setstats(L, &tcp->buf); +} + +/*-------------------------------------------------------------------------*\ +* Just call option handler +\*-------------------------------------------------------------------------*/ +static int meth_setoption(lua_State *L) +{ + p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1); + return opt_meth_setoption(L, opt, &tcp->sock); +} + +/*-------------------------------------------------------------------------*\ +* Select support methods +\*-------------------------------------------------------------------------*/ +static int meth_getfd(lua_State *L) +{ + p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1); + lua_pushnumber(L, (int) tcp->sock); + return 1; +} + +/* this is very dangerous, but can be handy for those that are brave enough */ +static int meth_setfd(lua_State *L) +{ + p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1); + tcp->sock = (t_socket) luaL_checknumber(L, 2); + return 0; +} + +static int meth_dirty(lua_State *L) +{ + p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1); + lua_pushboolean(L, !buffer_isempty(&tcp->buf)); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Waits for and returns a client object attempting connection to the +* server object +\*-------------------------------------------------------------------------*/ +static int meth_accept(lua_State *L) +{ + p_tcp server = (p_tcp) auxiliar_checkclass(L, "tcp{server}", 1); + p_timeout tm = timeout_markstart(&server->tm); + t_socket sock; + int err = socket_accept(&server->sock, &sock, NULL, NULL, tm); + /* if successful, push client socket */ + if (err == IO_DONE) { + p_tcp clnt = (p_tcp) lua_newuserdata(L, sizeof(t_tcp)); + auxiliar_setclass(L, "tcp{client}", -1); + /* initialize structure fields */ + socket_setnonblocking(&sock); + clnt->sock = sock; + io_init(&clnt->io, (p_send) socket_send, (p_recv) socket_recv, + (p_error) socket_ioerror, &clnt->sock); + timeout_init(&clnt->tm, -1, -1); + buffer_init(&clnt->buf, &clnt->io, &clnt->tm); + return 1; + } else { + lua_pushnil(L); + lua_pushstring(L, socket_strerror(err)); + return 2; + } +} + +/*-------------------------------------------------------------------------*\ +* Binds an object to an address +\*-------------------------------------------------------------------------*/ +static int meth_bind(lua_State *L) +{ + p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{master}", 1); + const char *address = luaL_checkstring(L, 2); + unsigned short port = (unsigned short) luaL_checknumber(L, 3); + const char *err = inet_trybind(&tcp->sock, address, port); + if (err) { + lua_pushnil(L); + lua_pushstring(L, err); + return 2; + } + lua_pushnumber(L, 1); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Turns a master tcp object into a client object. +\*-------------------------------------------------------------------------*/ +static int meth_connect(lua_State *L) +{ + p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1); + const char *address = luaL_checkstring(L, 2); + unsigned short port = (unsigned short) luaL_checknumber(L, 3); + p_timeout tm = timeout_markstart(&tcp->tm); + const char *err = inet_tryconnect(&tcp->sock, address, port, tm); + /* have to set the class even if it failed due to non-blocking connects */ + auxiliar_setclass(L, "tcp{client}", 1); + if (err) { + lua_pushnil(L); + lua_pushstring(L, err); + return 2; + } + /* turn master object into a client object */ + lua_pushnumber(L, 1); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Closes socket used by object +\*-------------------------------------------------------------------------*/ +static int meth_close(lua_State *L) +{ + p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1); + socket_destroy(&tcp->sock); + lua_pushnumber(L, 1); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Puts the sockt in listen mode +\*-------------------------------------------------------------------------*/ +static int meth_listen(lua_State *L) +{ + p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{master}", 1); + int backlog = (int) luaL_optnumber(L, 2, 32); + int err = socket_listen(&tcp->sock, backlog); + if (err != IO_DONE) { + lua_pushnil(L); + lua_pushstring(L, socket_strerror(err)); + return 2; + } + /* turn master object into a server object */ + auxiliar_setclass(L, "tcp{server}", 1); + lua_pushnumber(L, 1); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Shuts the connection down partially +\*-------------------------------------------------------------------------*/ +static int meth_shutdown(lua_State *L) +{ + p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1); + const char *how = luaL_optstring(L, 2, "both"); + switch (how[0]) { + case 'b': + if (strcmp(how, "both")) goto error; + socket_shutdown(&tcp->sock, 2); + break; + case 's': + if (strcmp(how, "send")) goto error; + socket_shutdown(&tcp->sock, 1); + break; + case 'r': + if (strcmp(how, "receive")) goto error; + socket_shutdown(&tcp->sock, 0); + break; + } + lua_pushnumber(L, 1); + return 1; +error: + luaL_argerror(L, 2, "invalid shutdown method"); + return 0; +} + +/*-------------------------------------------------------------------------*\ +* Just call inet methods +\*-------------------------------------------------------------------------*/ +static int meth_getpeername(lua_State *L) +{ + p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1); + return inet_meth_getpeername(L, &tcp->sock); +} + +static int meth_getsockname(lua_State *L) +{ + p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1); + return inet_meth_getsockname(L, &tcp->sock); +} + +/*-------------------------------------------------------------------------*\ +* Just call tm methods +\*-------------------------------------------------------------------------*/ +static int meth_settimeout(lua_State *L) +{ + p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1); + return timeout_meth_settimeout(L, &tcp->tm); +} + +/*=========================================================================*\ +* Library functions +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Creates a master tcp object +\*-------------------------------------------------------------------------*/ +static int global_create(lua_State *L) +{ + t_socket sock; + const char *err = inet_trycreate(&sock, SOCK_STREAM); + /* try to allocate a system socket */ + if (!err) { + /* allocate tcp object */ + p_tcp tcp = (p_tcp) lua_newuserdata(L, sizeof(t_tcp)); + /* set its type as master object */ + auxiliar_setclass(L, "tcp{master}", -1); + /* initialize remaining structure fields */ + socket_setnonblocking(&sock); + tcp->sock = sock; + io_init(&tcp->io, (p_send) socket_send, (p_recv) socket_recv, + (p_error) socket_ioerror, &tcp->sock); + timeout_init(&tcp->tm, -1, -1); + buffer_init(&tcp->buf, &tcp->io, &tcp->tm); + return 1; + } else { + lua_pushnil(L); + lua_pushstring(L, err); + return 2; + } +} diff --git a/rpm-5.4.9/lua/socket/tcp.h b/rpm-5.4.9/lua/socket/tcp.h new file mode 100644 index 0000000..fa876d3 --- /dev/null +++ b/rpm-5.4.9/lua/socket/tcp.h @@ -0,0 +1,36 @@ +#ifndef TCP_H +#define TCP_H +/*=========================================================================*\ +* TCP object +* LuaSocket toolkit +* +* The tcp.h module is basicly a glue that puts together modules buffer.h, +* timeout.h socket.h and inet.h to provide the LuaSocket TCP (AF_INET, +* SOCK_STREAM) support. +* +* Three classes are defined: master, client and server. The master class is +* a newly created tcp object, that has not been bound or connected. Server +* objects are tcp objects bound to some local address. Client objects are +* tcp objects either connected to some address or returned by the accept +* method of a server object. +* +* RCS ID: $Id: tcp.h,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include "lua.h" + +#include "buffer.h" +#include "timeout.h" +#include "socket.h" + +typedef struct t_tcp_ { + t_socket sock; + t_io io; + t_buffer buf; + t_timeout tm; +} t_tcp; + +typedef t_tcp *p_tcp; + +int tcp_open(lua_State *L); + +#endif /* TCP_H */ diff --git a/rpm-5.4.9/lua/socket/timeout.c b/rpm-5.4.9/lua/socket/timeout.c new file mode 100644 index 0000000..f2fc284 --- /dev/null +++ b/rpm-5.4.9/lua/socket/timeout.c @@ -0,0 +1,207 @@ +/*=========================================================================*\ +* Timeout management functions +* LuaSocket toolkit +* +* RCS ID: $Id: timeout.c,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include + +#include "lua.h" +#include "lauxlib.h" + +#include "auxiliar.h" +#include "timeout.h" + +#ifdef _WIN32 +#include +#else +#include +#include +#endif + +/* min and max macros */ +#ifndef MIN +#define MIN(x, y) ((x) < (y) ? x : y) +#endif +#ifndef MAX +#define MAX(x, y) ((x) > (y) ? x : y) +#endif + +/*=========================================================================*\ +* Internal function prototypes +\*=========================================================================*/ +static int timeout_lua_gettime(lua_State *L); +static int timeout_lua_sleep(lua_State *L); + +static luaL_reg func[] = { + { "gettime", timeout_lua_gettime }, + { "sleep", timeout_lua_sleep }, + { NULL, NULL } +}; + +/*=========================================================================*\ +* Exported functions. +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Initialize structure +\*-------------------------------------------------------------------------*/ +void timeout_init(p_timeout tm, double block, double total) { + tm->block = block; + tm->total = total; +} + +/*-------------------------------------------------------------------------*\ +* Determines how much time we have left for the next system call, +* if the previous call was successful +* Input +* tm: timeout control structure +* Returns +* the number of ms left or -1 if there is no time limit +\*-------------------------------------------------------------------------*/ +double timeout_get(p_timeout tm) { + if (tm->block < 0.0 && tm->total < 0.0) { + return -1; + } else if (tm->block < 0.0) { + double t = tm->total - timeout_gettime() + tm->start; + return MAX(t, 0.0); + } else if (tm->total < 0.0) { + return tm->block; + } else { + double t = tm->total - timeout_gettime() + tm->start; + return MIN(tm->block, MAX(t, 0.0)); + } +} + +/*-------------------------------------------------------------------------*\ +* Returns time since start of operation +* Input +* tm: timeout control structure +* Returns +* start field of structure +\*-------------------------------------------------------------------------*/ +double timeout_getstart(p_timeout tm) { + return tm->start; +} + +/*-------------------------------------------------------------------------*\ +* Determines how much time we have left for the next system call, +* if the previous call was a failure +* Input +* tm: timeout control structure +* Returns +* the number of ms left or -1 if there is no time limit +\*-------------------------------------------------------------------------*/ +double timeout_getretry(p_timeout tm) { + if (tm->block < 0.0 && tm->total < 0.0) { + return -1; + } else if (tm->block < 0.0) { + double t = tm->total - timeout_gettime() + tm->start; + return MAX(t, 0.0); + } else if (tm->total < 0.0) { + double t = tm->block - timeout_gettime() + tm->start; + return MAX(t, 0.0); + } else { + double t = tm->total - timeout_gettime() + tm->start; + return MIN(tm->block, MAX(t, 0.0)); + } +} + +/*-------------------------------------------------------------------------*\ +* Marks the operation start time in structure +* Input +* tm: timeout control structure +\*-------------------------------------------------------------------------*/ +p_timeout timeout_markstart(p_timeout tm) { + tm->start = timeout_gettime(); + return tm; +} + +/*-------------------------------------------------------------------------*\ +* Gets time in s, relative to January 1, 1970 (UTC) +* Returns +* time in s. +\*-------------------------------------------------------------------------*/ +#ifdef _WIN32 +double timeout_gettime(void) { + FILETIME ft; + double t; + GetSystemTimeAsFileTime(&ft); + /* Windows file time (time since January 1, 1601 (UTC)) */ + t = ft.dwLowDateTime/1.0e7 + ft.dwHighDateTime*(4294967296.0/1.0e7); + /* convert to Unix Epoch time (time since January 1, 1970 (UTC)) */ + return (t - 11644473600.0); +} +#else +double timeout_gettime(void) { + struct timeval v; + gettimeofday(&v, (struct timezone *) NULL); + /* Unix Epoch time (time since January 1, 1970 (UTC)) */ + return v.tv_sec + v.tv_usec/1.0e6; +} +#endif + +/*-------------------------------------------------------------------------*\ +* Initializes module +\*-------------------------------------------------------------------------*/ +int timeout_open(lua_State *L) { + luaL_openlib(L, NULL, func, 0); + return 0; +} + +/*-------------------------------------------------------------------------*\ +* Sets timeout values for IO operations +* Lua Input: base, time [, mode] +* time: time out value in seconds +* mode: "b" for block timeout, "t" for total timeout. (default: b) +\*-------------------------------------------------------------------------*/ +int timeout_meth_settimeout(lua_State *L, p_timeout tm) { + double t = luaL_optnumber(L, 2, -1); + const char *mode = luaL_optstring(L, 3, "b"); + switch (*mode) { + case 'b': + tm->block = t; + break; + case 'r': case 't': + tm->total = t; + break; + default: + luaL_argcheck(L, 0, 3, "invalid timeout mode"); + break; + } + lua_pushnumber(L, 1); + return 1; +} + +/*=========================================================================*\ +* Test support functions +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Returns the time the system has been up, in secconds. +\*-------------------------------------------------------------------------*/ +static int timeout_lua_gettime(lua_State *L) +{ + lua_pushnumber(L, timeout_gettime()); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Sleep for n seconds. +\*-------------------------------------------------------------------------*/ +int timeout_lua_sleep(lua_State *L) +{ + double n = luaL_checknumber(L, 1); +#ifdef _WIN32 + Sleep((int)(n*1000)); +#else + struct timespec t, r; + t.tv_sec = (int) n; + n -= t.tv_sec; + t.tv_nsec = (int) (n * 1000000000); + if (t.tv_nsec >= 1000000000) t.tv_nsec = 999999999; + while (nanosleep(&t, &r) != 0) { + t.tv_sec = r.tv_sec; + t.tv_nsec = r.tv_nsec; + } +#endif + return 0; +} diff --git a/rpm-5.4.9/lua/socket/timeout.h b/rpm-5.4.9/lua/socket/timeout.h new file mode 100644 index 0000000..153d5cf --- /dev/null +++ b/rpm-5.4.9/lua/socket/timeout.h @@ -0,0 +1,30 @@ +#ifndef TIMEOUT_H +#define TIMEOUT_H +/*=========================================================================*\ +* Timeout management functions +* LuaSocket toolkit +* +* RCS ID: $Id: timeout.h,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include "lua.h" + +/* timeout control structure */ +typedef struct t_timeout_ { + double block; /* maximum time for blocking calls */ + double total; /* total number of miliseconds for operation */ + double start; /* time of start of operation */ +} t_timeout; +typedef t_timeout *p_timeout; + +int timeout_open(lua_State *L); +void timeout_init(p_timeout tm, double block, double total); +double timeout_get(p_timeout tm); +double timeout_getretry(p_timeout tm); +p_timeout timeout_markstart(p_timeout tm); +double timeout_getstart(p_timeout tm); +double timeout_gettime(void); +int timeout_meth_settimeout(lua_State *L, p_timeout tm); + +#define timeout_iszero(tm) ((tm)->block == 0.0) + +#endif /* TIMEOUT_H */ diff --git a/rpm-5.4.9/lua/socket/tp.lua b/rpm-5.4.9/lua/socket/tp.lua new file mode 100644 index 0000000..ba6c58f --- /dev/null +++ b/rpm-5.4.9/lua/socket/tp.lua @@ -0,0 +1,123 @@ +----------------------------------------------------------------------------- +-- Unified SMTP/FTP subsystem +-- LuaSocket toolkit. +-- Author: Diego Nehab +-- RCS ID: $Id: tp.lua,v 1.1 2008/10/24 22:58:40 jbj Exp $ +----------------------------------------------------------------------------- + +----------------------------------------------------------------------------- +-- Declare module and import dependencies +----------------------------------------------------------------------------- +local base = _G +local string = require("string") +local socket = require("socket") +local ltn12 = require("ltn12") +module("socket.tp") + +----------------------------------------------------------------------------- +-- Program constants +----------------------------------------------------------------------------- +TIMEOUT = 60 + +----------------------------------------------------------------------------- +-- Implementation +----------------------------------------------------------------------------- +-- gets server reply (works for SMTP and FTP) +local function get_reply(c) + local code, current, sep + local line, err = c:receive() + local reply = line + if err then return nil, err end + code, sep = socket.skip(2, string.find(line, "^(%d%d%d)(.?)")) + if not code then return nil, "invalid server reply" end + if sep == "-" then -- reply is multiline + repeat + line, err = c:receive() + if err then return nil, err end + current, sep = socket.skip(2, string.find(line, "^(%d%d%d)(.?)")) + reply = reply .. "\n" .. line + -- reply ends with same code + until code == current and sep == " " + end + return code, reply +end + +-- metatable for sock object +local metat = { __index = {} } + +function metat.__index:check(ok) + local code, reply = get_reply(self.c) + if not code then return nil, reply end + if base.type(ok) ~= "function" then + if base.type(ok) == "table" then + for i, v in base.ipairs(ok) do + if string.find(code, v) then + return base.tonumber(code), reply + end + end + return nil, reply + else + if string.find(code, ok) then return base.tonumber(code), reply + else return nil, reply end + end + else return ok(base.tonumber(code), reply) end +end + +function metat.__index:command(cmd, arg) + if arg then + return self.c:send(cmd .. " " .. arg.. "\r\n") + else + return self.c:send(cmd .. "\r\n") + end +end + +function metat.__index:sink(snk, pat) + local chunk, err = c:receive(pat) + return snk(chunk, err) +end + +function metat.__index:send(data) + return self.c:send(data) +end + +function metat.__index:receive(pat) + return self.c:receive(pat) +end + +function metat.__index:getfd() + return self.c:getfd() +end + +function metat.__index:dirty() + return self.c:dirty() +end + +function metat.__index:getcontrol() + return self.c +end + +function metat.__index:source(source, step) + local sink = socket.sink("keep-open", self.c) + local ret, err = ltn12.pump.all(source, sink, step or ltn12.pump.step) + return ret, err +end + +-- closes the underlying c +function metat.__index:close() + self.c:close() + return 1 +end + +-- connect with server and return c object +function connect(host, port, timeout, create) + local c, e = (create or socket.tcp)() + if not c then return nil, e end + c:settimeout(timeout or TIMEOUT) + local r, e = c:connect(host, port) + if not r then + c:close() + return nil, e + end + return base.setmetatable({c = c}, metat) +end + diff --git a/rpm-5.4.9/lua/socket/udp.c b/rpm-5.4.9/lua/socket/udp.c new file mode 100644 index 0000000..1d458e1 --- /dev/null +++ b/rpm-5.4.9/lua/socket/udp.c @@ -0,0 +1,336 @@ +/*=========================================================================*\ +* UDP object +* LuaSocket toolkit +* +* RCS ID: $Id: udp.c,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include + +#include "lua.h" +#include "lauxlib.h" + +#include "auxiliar.h" +#include "socket.h" +#include "inet.h" +#include "options.h" +#include "udp.h" + +/* min and max macros */ +#ifndef MIN +#define MIN(x, y) ((x) < (y) ? x : y) +#endif +#ifndef MAX +#define MAX(x, y) ((x) > (y) ? x : y) +#endif + +/*=========================================================================*\ +* Internal function prototypes +\*=========================================================================*/ +static int global_create(lua_State *L); +static int meth_send(lua_State *L); +static int meth_sendto(lua_State *L); +static int meth_receive(lua_State *L); +static int meth_receivefrom(lua_State *L); +static int meth_getsockname(lua_State *L); +static int meth_getpeername(lua_State *L); +static int meth_setsockname(lua_State *L); +static int meth_setpeername(lua_State *L); +static int meth_close(lua_State *L); +static int meth_setoption(lua_State *L); +static int meth_settimeout(lua_State *L); +static int meth_getfd(lua_State *L); +static int meth_setfd(lua_State *L); +static int meth_dirty(lua_State *L); + +/* udp object methods */ +static luaL_reg udp[] = { + {"__gc", meth_close}, + {"__tostring", auxiliar_tostring}, + {"close", meth_close}, + {"dirty", meth_dirty}, + {"getfd", meth_getfd}, + {"getpeername", meth_getpeername}, + {"getsockname", meth_getsockname}, + {"receive", meth_receive}, + {"receivefrom", meth_receivefrom}, + {"send", meth_send}, + {"sendto", meth_sendto}, + {"setfd", meth_setfd}, + {"setoption", meth_setoption}, + {"setpeername", meth_setpeername}, + {"setsockname", meth_setsockname}, + {"settimeout", meth_settimeout}, + {NULL, NULL} +}; + +/* socket options */ +static t_opt opt[] = { + {"dontroute", opt_dontroute}, + {"broadcast", opt_broadcast}, + {"reuseaddr", opt_reuseaddr}, + {"ip-multicast-ttl", opt_ip_multicast_ttl}, + {"ip-multicast-loop", opt_ip_multicast_loop}, + {"ip-add-membership", opt_ip_add_membership}, + {"ip-drop-membership", opt_ip_drop_membersip}, + {NULL, NULL} +}; + +/* functions in library namespace */ +static luaL_reg func[] = { + {"udp", global_create}, + {NULL, NULL} +}; + +/*-------------------------------------------------------------------------*\ +* Initializes module +\*-------------------------------------------------------------------------*/ +int udp_open(lua_State *L) +{ + /* create classes */ + auxiliar_newclass(L, "udp{connected}", udp); + auxiliar_newclass(L, "udp{unconnected}", udp); + /* create class groups */ + auxiliar_add2group(L, "udp{connected}", "udp{any}"); + auxiliar_add2group(L, "udp{unconnected}", "udp{any}"); + auxiliar_add2group(L, "udp{connected}", "select{able}"); + auxiliar_add2group(L, "udp{unconnected}", "select{able}"); + /* define library functions */ + luaL_openlib(L, NULL, func, 0); + return 0; +} + +/*=========================================================================*\ +* Lua methods +\*=========================================================================*/ +const char *udp_strerror(int err) { + /* a 'closed' error on an unconnected means the target address was not + * accepted by the transport layer */ + if (err == IO_CLOSED) return "refused"; + else return socket_strerror(err); +} + +/*-------------------------------------------------------------------------*\ +* Send data through connected udp socket +\*-------------------------------------------------------------------------*/ +static int meth_send(lua_State *L) { + p_udp udp = (p_udp) auxiliar_checkclass(L, "udp{connected}", 1); + p_timeout tm = &udp->tm; + size_t count, sent = 0; + int err; + const char *data = luaL_checklstring(L, 2, &count); + timeout_markstart(tm); + err = socket_send(&udp->sock, data, count, &sent, tm); + if (err != IO_DONE) { + lua_pushnil(L); + lua_pushstring(L, udp_strerror(err)); + return 2; + } + lua_pushnumber(L, sent); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Send data through unconnected udp socket +\*-------------------------------------------------------------------------*/ +static int meth_sendto(lua_State *L) { + p_udp udp = (p_udp) auxiliar_checkclass(L, "udp{unconnected}", 1); + size_t count, sent = 0; + const char *data = luaL_checklstring(L, 2, &count); + const char *ip = luaL_checkstring(L, 3); + unsigned short port = (unsigned short) luaL_checknumber(L, 4); + p_timeout tm = &udp->tm; + struct sockaddr_in addr; + int err; + memset(&addr, 0, sizeof(addr)); + if (!inet_aton(ip, &addr.sin_addr)) + luaL_argerror(L, 3, "invalid ip address"); + addr.sin_family = AF_INET; + addr.sin_port = htons(port); + timeout_markstart(tm); + err = socket_sendto(&udp->sock, data, count, &sent, + (SA *) &addr, sizeof(addr), tm); + if (err != IO_DONE) { + lua_pushnil(L); + lua_pushstring(L, udp_strerror(err)); + return 2; + } + lua_pushnumber(L, sent); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Receives data from a UDP socket +\*-------------------------------------------------------------------------*/ +static int meth_receive(lua_State *L) { + p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1); + char buffer[UDP_DATAGRAMSIZE]; + size_t got, count = (size_t) luaL_optnumber(L, 2, sizeof(buffer)); + int err; + p_timeout tm = &udp->tm; + count = MIN(count, sizeof(buffer)); + timeout_markstart(tm); + err = socket_recv(&udp->sock, buffer, count, &got, tm); + if (err != IO_DONE) { + lua_pushnil(L); + lua_pushstring(L, udp_strerror(err)); + return 2; + } + lua_pushlstring(L, buffer, got); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Receives data and sender from a UDP socket +\*-------------------------------------------------------------------------*/ +static int meth_receivefrom(lua_State *L) { + p_udp udp = (p_udp) auxiliar_checkclass(L, "udp{unconnected}", 1); + struct sockaddr_in addr; + socklen_t addr_len = sizeof(addr); + char buffer[UDP_DATAGRAMSIZE]; + size_t got, count = (size_t) luaL_optnumber(L, 2, sizeof(buffer)); + int err; + p_timeout tm = &udp->tm; + timeout_markstart(tm); + count = MIN(count, sizeof(buffer)); + err = socket_recvfrom(&udp->sock, buffer, count, &got, + (SA *) &addr, &addr_len, tm); + if (err == IO_DONE) { + lua_pushlstring(L, buffer, got); + lua_pushstring(L, inet_ntoa(addr.sin_addr)); + lua_pushnumber(L, ntohs(addr.sin_port)); + return 3; + } else { + lua_pushnil(L); + lua_pushstring(L, udp_strerror(err)); + return 2; + } +} + +/*-------------------------------------------------------------------------*\ +* Select support methods +\*-------------------------------------------------------------------------*/ +static int meth_getfd(lua_State *L) { + p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1); + lua_pushnumber(L, (int) udp->sock); + return 1; +} + +/* this is very dangerous, but can be handy for those that are brave enough */ +static int meth_setfd(lua_State *L) { + p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1); + udp->sock = (t_socket) luaL_checknumber(L, 2); + return 0; +} + +static int meth_dirty(lua_State *L) { + p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1); + (void) udp; + lua_pushboolean(L, 0); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Just call inet methods +\*-------------------------------------------------------------------------*/ +static int meth_getpeername(lua_State *L) { + p_udp udp = (p_udp) auxiliar_checkclass(L, "udp{connected}", 1); + return inet_meth_getpeername(L, &udp->sock); +} + +static int meth_getsockname(lua_State *L) { + p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1); + return inet_meth_getsockname(L, &udp->sock); +} + +/*-------------------------------------------------------------------------*\ +* Just call option handler +\*-------------------------------------------------------------------------*/ +static int meth_setoption(lua_State *L) { + p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1); + return opt_meth_setoption(L, opt, &udp->sock); +} + +/*-------------------------------------------------------------------------*\ +* Just call tm methods +\*-------------------------------------------------------------------------*/ +static int meth_settimeout(lua_State *L) { + p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1); + return timeout_meth_settimeout(L, &udp->tm); +} + +/*-------------------------------------------------------------------------*\ +* Turns a master udp object into a client object. +\*-------------------------------------------------------------------------*/ +static int meth_setpeername(lua_State *L) { + p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1); + p_timeout tm = &udp->tm; + const char *address = luaL_checkstring(L, 2); + int connecting = strcmp(address, "*"); + unsigned short port = connecting ? + (unsigned short) luaL_checknumber(L, 3) : + (unsigned short) luaL_optnumber(L, 3, 0); + const char *err = inet_tryconnect(&udp->sock, address, port, tm); + if (err) { + lua_pushnil(L); + lua_pushstring(L, err); + return 2; + } + /* change class to connected or unconnected depending on address */ + if (connecting) auxiliar_setclass(L, "udp{connected}", 1); + else auxiliar_setclass(L, "udp{unconnected}", 1); + lua_pushnumber(L, 1); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Closes socket used by object +\*-------------------------------------------------------------------------*/ +static int meth_close(lua_State *L) { + p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1); + socket_destroy(&udp->sock); + lua_pushnumber(L, 1); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Turns a master object into a server object +\*-------------------------------------------------------------------------*/ +static int meth_setsockname(lua_State *L) { + p_udp udp = (p_udp) auxiliar_checkclass(L, "udp{unconnected}", 1); + const char *address = luaL_checkstring(L, 2); + unsigned short port = (unsigned short) luaL_checknumber(L, 3); + const char *err = inet_trybind(&udp->sock, address, port); + if (err) { + lua_pushnil(L); + lua_pushstring(L, err); + return 2; + } + lua_pushnumber(L, 1); + return 1; +} + +/*=========================================================================*\ +* Library functions +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Creates a master udp object +\*-------------------------------------------------------------------------*/ +static int global_create(lua_State *L) { + t_socket sock; + const char *err = inet_trycreate(&sock, SOCK_DGRAM); + /* try to allocate a system socket */ + if (!err) { + /* allocate tcp object */ + p_udp udp = (p_udp) lua_newuserdata(L, sizeof(t_udp)); + auxiliar_setclass(L, "udp{unconnected}", -1); + /* initialize remaining structure fields */ + socket_setnonblocking(&sock); + udp->sock = sock; + timeout_init(&udp->tm, -1, -1); + return 1; + } else { + lua_pushnil(L); + lua_pushstring(L, err); + return 2; + } +} diff --git a/rpm-5.4.9/lua/socket/udp.h b/rpm-5.4.9/lua/socket/udp.h new file mode 100644 index 0000000..23c3244 --- /dev/null +++ b/rpm-5.4.9/lua/socket/udp.h @@ -0,0 +1,33 @@ +#ifndef UDP_H +#define UDP_H +/*=========================================================================*\ +* UDP object +* LuaSocket toolkit +* +* The udp.h module provides LuaSocket with support for UDP protocol +* (AF_INET, SOCK_DGRAM). +* +* Two classes are defined: connected and unconnected. UDP objects are +* originally unconnected. They can be "connected" to a given address +* with a call to the setpeername function. The same function can be used to +* break the connection. +* +* RCS ID: $Id: udp.h,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include "lua.h" + +#include "timeout.h" +#include "socket.h" + +/* can't be larger than wsocket.c MAXCHUNK!!! */ +#define UDP_DATAGRAMSIZE 8192 + +typedef struct t_udp_ { + t_socket sock; + t_timeout tm; +} t_udp; +typedef t_udp *p_udp; + +int udp_open(lua_State *L); + +#endif /* UDP_H */ diff --git a/rpm-5.4.9/lua/socket/unix.c b/rpm-5.4.9/lua/socket/unix.c new file mode 100644 index 0000000..b7c7010 --- /dev/null +++ b/rpm-5.4.9/lua/socket/unix.c @@ -0,0 +1,356 @@ +/*=========================================================================*\ +* Unix domain socket +* LuaSocket toolkit +* +* RCS ID: $Id: unix.c,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include + +#include "lua.h" +#include "lauxlib.h" + +#include "auxiliar.h" +#include "socket.h" +#include "options.h" +#include "unix.h" +#include + +/*=========================================================================*\ +* Internal function prototypes +\*=========================================================================*/ +static int global_create(lua_State *L); +static int meth_connect(lua_State *L); +static int meth_listen(lua_State *L); +static int meth_bind(lua_State *L); +static int meth_send(lua_State *L); +static int meth_shutdown(lua_State *L); +static int meth_receive(lua_State *L); +static int meth_accept(lua_State *L); +static int meth_close(lua_State *L); +static int meth_setoption(lua_State *L); +static int meth_settimeout(lua_State *L); +static int meth_getfd(lua_State *L); +static int meth_setfd(lua_State *L); +static int meth_dirty(lua_State *L); +static int meth_getstats(lua_State *L); +static int meth_setstats(lua_State *L); + +static const char *unix_tryconnect(p_unix un, const char *path); +static const char *unix_trybind(p_unix un, const char *path); + +/* unix object methods */ +static luaL_reg un[] = { + {"__gc", meth_close}, + {"__tostring", auxiliar_tostring}, + {"accept", meth_accept}, + {"bind", meth_bind}, + {"close", meth_close}, + {"connect", meth_connect}, + {"dirty", meth_dirty}, + {"getfd", meth_getfd}, + {"getstats", meth_getstats}, + {"setstats", meth_setstats}, + {"listen", meth_listen}, + {"receive", meth_receive}, + {"send", meth_send}, + {"setfd", meth_setfd}, + {"setoption", meth_setoption}, + {"setpeername", meth_connect}, + {"setsockname", meth_bind}, + {"settimeout", meth_settimeout}, + {"shutdown", meth_shutdown}, + {NULL, NULL} +}; + +/* socket option handlers */ +static t_opt opt[] = { + {"keepalive", opt_keepalive}, + {"reuseaddr", opt_reuseaddr}, + {"linger", opt_linger}, + {NULL, NULL} +}; + +/* our socket creation function */ +static luaL_reg func[] = { + {"unix", global_create}, + {NULL, NULL} +}; + + +/*-------------------------------------------------------------------------*\ +* Initializes module +\*-------------------------------------------------------------------------*/ +int luaopen_socket_unix(lua_State *L) { + /* create classes */ + auxiliar_newclass(L, "unix{master}", un); + auxiliar_newclass(L, "unix{client}", un); + auxiliar_newclass(L, "unix{server}", un); + /* create class groups */ + auxiliar_add2group(L, "unix{master}", "unix{any}"); + auxiliar_add2group(L, "unix{client}", "unix{any}"); + auxiliar_add2group(L, "unix{server}", "unix{any}"); + /* make sure the function ends up in the package table */ + luaL_openlib(L, "socket", func, 0); + /* return the function instead of the 'socket' table */ + lua_pushstring(L, "unix"); + lua_gettable(L, -2); + return 1; +} + +/*=========================================================================*\ +* Lua methods +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Just call buffered IO methods +\*-------------------------------------------------------------------------*/ +static int meth_send(lua_State *L) { + p_unix un = (p_unix) auxiliar_checkclass(L, "unix{client}", 1); + return buffer_meth_send(L, &un->buf); +} + +static int meth_receive(lua_State *L) { + p_unix un = (p_unix) auxiliar_checkclass(L, "unix{client}", 1); + return buffer_meth_receive(L, &un->buf); +} + +static int meth_getstats(lua_State *L) { + p_unix un = (p_unix) auxiliar_checkclass(L, "unix{client}", 1); + return buffer_meth_getstats(L, &un->buf); +} + +static int meth_setstats(lua_State *L) { + p_unix un = (p_unix) auxiliar_checkclass(L, "unix{client}", 1); + return buffer_meth_setstats(L, &un->buf); +} + +/*-------------------------------------------------------------------------*\ +* Just call option handler +\*-------------------------------------------------------------------------*/ +static int meth_setoption(lua_State *L) { + p_unix un = (p_unix) auxiliar_checkgroup(L, "unix{any}", 1); + return opt_meth_setoption(L, opt, &un->sock); +} + +/*-------------------------------------------------------------------------*\ +* Select support methods +\*-------------------------------------------------------------------------*/ +static int meth_getfd(lua_State *L) { + p_unix un = (p_unix) auxiliar_checkgroup(L, "unix{any}", 1); + lua_pushnumber(L, (int) un->sock); + return 1; +} + +/* this is very dangerous, but can be handy for those that are brave enough */ +static int meth_setfd(lua_State *L) { + p_unix un = (p_unix) auxiliar_checkgroup(L, "unix{any}", 1); + un->sock = (t_socket) luaL_checknumber(L, 2); + return 0; +} + +static int meth_dirty(lua_State *L) { + p_unix un = (p_unix) auxiliar_checkgroup(L, "unix{any}", 1); + lua_pushboolean(L, !buffer_isempty(&un->buf)); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Waits for and returns a client object attempting connection to the +* server object +\*-------------------------------------------------------------------------*/ +static int meth_accept(lua_State *L) { + p_unix server = (p_unix) auxiliar_checkclass(L, "unix{server}", 1); + p_timeout tm = timeout_markstart(&server->tm); + t_socket sock; + int err = socket_accept(&server->sock, &sock, NULL, NULL, tm); + /* if successful, push client socket */ + if (err == IO_DONE) { + p_unix clnt = (p_unix) lua_newuserdata(L, sizeof(t_unix)); + auxiliar_setclass(L, "unix{client}", -1); + /* initialize structure fields */ + socket_setnonblocking(&sock); + clnt->sock = sock; + io_init(&clnt->io, (p_send)socket_send, (p_recv)socket_recv, + (p_error) socket_ioerror, &clnt->sock); + timeout_init(&clnt->tm, -1, -1); + buffer_init(&clnt->buf, &clnt->io, &clnt->tm); + return 1; + } else { + lua_pushnil(L); + lua_pushstring(L, socket_strerror(err)); + return 2; + } +} + +/*-------------------------------------------------------------------------*\ +* Binds an object to an address +\*-------------------------------------------------------------------------*/ +static const char *unix_trybind(p_unix un, const char *path) { + struct sockaddr_un local; + size_t len = strlen(path); + int err; + if (len >= sizeof(local.sun_path)) return "path too long"; + memset(&local, 0, sizeof(local)); + strcpy(local.sun_path, path); + local.sun_family = AF_UNIX; +#ifdef UNIX_HAS_SUN_LEN + local.sun_len = sizeof(local.sun_family) + sizeof(local.sun_len) + + len + 1; + err = socket_bind(&un->sock, (SA *) &local, local.sun_len); + +#else + err = socket_bind(&un->sock, (SA *) &local, + sizeof(local.sun_family) + len); +#endif + if (err != IO_DONE) socket_destroy(&un->sock); + return socket_strerror(err); +} + +static int meth_bind(lua_State *L) { + p_unix un = (p_unix) auxiliar_checkclass(L, "unix{master}", 1); + const char *path = luaL_checkstring(L, 2); + const char *err = unix_trybind(un, path); + if (err) { + lua_pushnil(L); + lua_pushstring(L, err); + return 2; + } + lua_pushnumber(L, 1); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Turns a master unix object into a client object. +\*-------------------------------------------------------------------------*/ +static const char *unix_tryconnect(p_unix un, const char *path) +{ + struct sockaddr_un remote; + int err; + size_t len = strlen(path); + if (len >= sizeof(remote.sun_path)) return "path too long"; + memset(&remote, 0, sizeof(remote)); + strcpy(remote.sun_path, path); + remote.sun_family = AF_UNIX; + timeout_markstart(&un->tm); +#ifdef UNIX_HAS_SUN_LEN + remote.sun_len = sizeof(remote.sun_family) + sizeof(remote.sun_len) + + len + 1; + err = socket_connect(&un->sock, (SA *) &remote, remote.sun_len, &un->tm); +#else + err = socket_connect(&un->sock, (SA *) &remote, + sizeof(remote.sun_family) + len, &un->tm); +#endif + if (err != IO_DONE) socket_destroy(&un->sock); + return socket_strerror(err); +} + +static int meth_connect(lua_State *L) +{ + p_unix un = (p_unix) auxiliar_checkclass(L, "unix{master}", 1); + const char *path = luaL_checkstring(L, 2); + const char *err = unix_tryconnect(un, path); + if (err) { + lua_pushnil(L); + lua_pushstring(L, err); + return 2; + } + /* turn master object into a client object */ + auxiliar_setclass(L, "unix{client}", 1); + lua_pushnumber(L, 1); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Closes socket used by object +\*-------------------------------------------------------------------------*/ +static int meth_close(lua_State *L) +{ + p_unix un = (p_unix) auxiliar_checkgroup(L, "unix{any}", 1); + socket_destroy(&un->sock); + lua_pushnumber(L, 1); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Puts the sockt in listen mode +\*-------------------------------------------------------------------------*/ +static int meth_listen(lua_State *L) +{ + p_unix un = (p_unix) auxiliar_checkclass(L, "unix{master}", 1); + int backlog = (int) luaL_optnumber(L, 2, 32); + int err = socket_listen(&un->sock, backlog); + if (err != IO_DONE) { + lua_pushnil(L); + lua_pushstring(L, socket_strerror(err)); + return 2; + } + /* turn master object into a server object */ + auxiliar_setclass(L, "unix{server}", 1); + lua_pushnumber(L, 1); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Shuts the connection down partially +\*-------------------------------------------------------------------------*/ +static int meth_shutdown(lua_State *L) +{ + p_unix un = (p_unix) auxiliar_checkclass(L, "unix{client}", 1); + const char *how = luaL_optstring(L, 2, "both"); + switch (how[0]) { + case 'b': + if (strcmp(how, "both")) goto error; + socket_shutdown(&un->sock, 2); + break; + case 's': + if (strcmp(how, "send")) goto error; + socket_shutdown(&un->sock, 1); + break; + case 'r': + if (strcmp(how, "receive")) goto error; + socket_shutdown(&un->sock, 0); + break; + } + lua_pushnumber(L, 1); + return 1; +error: + luaL_argerror(L, 2, "invalid shutdown method"); + return 0; +} + +/*-------------------------------------------------------------------------*\ +* Just call tm methods +\*-------------------------------------------------------------------------*/ +static int meth_settimeout(lua_State *L) { + p_unix un = (p_unix) auxiliar_checkgroup(L, "unix{any}", 1); + return timeout_meth_settimeout(L, &un->tm); +} + +/*=========================================================================*\ +* Library functions +\*=========================================================================*/ +/*-------------------------------------------------------------------------*\ +* Creates a master unix object +\*-------------------------------------------------------------------------*/ +static int global_create(lua_State *L) { + t_socket sock; + int err = socket_create(&sock, AF_UNIX, SOCK_STREAM, 0); + /* try to allocate a system socket */ + if (err == IO_DONE) { + /* allocate unix object */ + p_unix un = (p_unix) lua_newuserdata(L, sizeof(t_unix)); + /* set its type as master object */ + auxiliar_setclass(L, "unix{master}", -1); + /* initialize remaining structure fields */ + socket_setnonblocking(&sock); + un->sock = sock; + io_init(&un->io, (p_send) socket_send, (p_recv) socket_recv, + (p_error) socket_ioerror, &un->sock); + timeout_init(&un->tm, -1, -1); + buffer_init(&un->buf, &un->io, &un->tm); + return 1; + } else { + lua_pushnil(L); + lua_pushstring(L, socket_strerror(err)); + return 2; + } +} diff --git a/rpm-5.4.9/lua/socket/unix.h b/rpm-5.4.9/lua/socket/unix.h new file mode 100644 index 0000000..d818b2b --- /dev/null +++ b/rpm-5.4.9/lua/socket/unix.h @@ -0,0 +1,28 @@ +#ifndef UNIX_H +#define UNIX_H +/*=========================================================================*\ +* Unix domain object +* LuaSocket toolkit +* +* This module is just an example of how to extend LuaSocket with a new +* domain. +* +* RCS ID: $Id: unix.h,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include "lua.h" + +#include "buffer.h" +#include "timeout.h" +#include "socket.h" + +typedef struct t_unix_ { + t_socket sock; + t_io io; + t_buffer buf; + t_timeout tm; +} t_unix; +typedef t_unix *p_unix; + +int luaopen_socket_unix(lua_State *L); + +#endif /* UNIX_H */ diff --git a/rpm-5.4.9/lua/socket/url.lua b/rpm-5.4.9/lua/socket/url.lua new file mode 100644 index 0000000..2cc66a8 --- /dev/null +++ b/rpm-5.4.9/lua/socket/url.lua @@ -0,0 +1,297 @@ +----------------------------------------------------------------------------- +-- URI parsing, composition and relative URL resolution +-- LuaSocket toolkit. +-- Author: Diego Nehab +-- RCS ID: $Id: url.lua,v 1.1 2008/10/24 22:58:40 jbj Exp $ +----------------------------------------------------------------------------- + +----------------------------------------------------------------------------- +-- Declare module +----------------------------------------------------------------------------- +local string = require("string") +local base = _G +local table = require("table") +module("socket.url") + +----------------------------------------------------------------------------- +-- Module version +----------------------------------------------------------------------------- +_VERSION = "URL 1.0.1" + +----------------------------------------------------------------------------- +-- Encodes a string into its escaped hexadecimal representation +-- Input +-- s: binary string to be encoded +-- Returns +-- escaped representation of string binary +----------------------------------------------------------------------------- +function escape(s) + return string.gsub(s, "([^A-Za-z0-9_])", function(c) + return string.format("%%%02x", string.byte(c)) + end) +end + +----------------------------------------------------------------------------- +-- Protects a path segment, to prevent it from interfering with the +-- url parsing. +-- Input +-- s: binary string to be encoded +-- Returns +-- escaped representation of string binary +----------------------------------------------------------------------------- +local function make_set(t) + local s = {} + for i,v in base.ipairs(t) do + s[t[i]] = 1 + end + return s +end + +-- these are allowed withing a path segment, along with alphanum +-- other characters must be escaped +local segment_set = make_set { + "-", "_", ".", "!", "~", "*", "'", "(", + ")", ":", "@", "&", "=", "+", "$", ",", +} + +local function protect_segment(s) + return string.gsub(s, "([^A-Za-z0-9_])", function (c) + if segment_set[c] then return c + else return string.format("%%%02x", string.byte(c)) end + end) +end + +----------------------------------------------------------------------------- +-- Encodes a string into its escaped hexadecimal representation +-- Input +-- s: binary string to be encoded +-- Returns +-- escaped representation of string binary +----------------------------------------------------------------------------- +function unescape(s) + return string.gsub(s, "%%(%x%x)", function(hex) + return string.char(base.tonumber(hex, 16)) + end) +end + +----------------------------------------------------------------------------- +-- Builds a path from a base path and a relative path +-- Input +-- base_path +-- relative_path +-- Returns +-- corresponding absolute path +----------------------------------------------------------------------------- +local function absolute_path(base_path, relative_path) + if string.sub(relative_path, 1, 1) == "/" then return relative_path end + local path = string.gsub(base_path, "[^/]*$", "") + path = path .. relative_path + path = string.gsub(path, "([^/]*%./)", function (s) + if s ~= "./" then return s else return "" end + end) + path = string.gsub(path, "/%.$", "/") + local reduced + while reduced ~= path do + reduced = path + path = string.gsub(reduced, "([^/]*/%.%./)", function (s) + if s ~= "../../" then return "" else return s end + end) + end + path = string.gsub(reduced, "([^/]*/%.%.)$", function (s) + if s ~= "../.." then return "" else return s end + end) + return path +end + +----------------------------------------------------------------------------- +-- Parses a url and returns a table with all its parts according to RFC 2396 +-- The following grammar describes the names given to the URL parts +-- ::= :///;?# +-- ::= @: +-- ::= [:] +-- :: = {/} +-- Input +-- url: uniform resource locator of request +-- default: table with default values for each field +-- Returns +-- table with the following fields, where RFC naming conventions have +-- been preserved: +-- scheme, authority, userinfo, user, password, host, port, +-- path, params, query, fragment +-- Obs: +-- the leading '/' in {/} is considered part of +----------------------------------------------------------------------------- +function parse(url, default) + -- initialize default parameters + local parsed = {} + for i,v in base.pairs(default or parsed) do parsed[i] = v end + -- empty url is parsed to nil + if not url or url == "" then return nil, "invalid url" end + -- remove whitespace + -- url = string.gsub(url, "%s", "") + -- get fragment + url = string.gsub(url, "#(.*)$", function(f) + parsed.fragment = f + return "" + end) + -- get scheme + url = string.gsub(url, "^([%w][%w%+%-%.]*)%:", + function(s) parsed.scheme = s; return "" end) + -- get authority + url = string.gsub(url, "^//([^/]*)", function(n) + parsed.authority = n + return "" + end) + -- get query stringing + url = string.gsub(url, "%?(.*)", function(q) + parsed.query = q + return "" + end) + -- get params + url = string.gsub(url, "%;(.*)", function(p) + parsed.params = p + return "" + end) + -- path is whatever was left + if url ~= "" then parsed.path = url end + local authority = parsed.authority + if not authority then return parsed end + authority = string.gsub(authority,"^([^@]*)@", + function(u) parsed.userinfo = u; return "" end) + authority = string.gsub(authority, ":([^:]*)$", + function(p) parsed.port = p; return "" end) + if authority ~= "" then parsed.host = authority end + local userinfo = parsed.userinfo + if not userinfo then return parsed end + userinfo = string.gsub(userinfo, ":([^:]*)$", + function(p) parsed.password = p; return "" end) + parsed.user = userinfo + return parsed +end + +----------------------------------------------------------------------------- +-- Rebuilds a parsed URL from its components. +-- Components are protected if any reserved or unallowed characters are found +-- Input +-- parsed: parsed URL, as returned by parse +-- Returns +-- a stringing with the corresponding URL +----------------------------------------------------------------------------- +function build(parsed) + local ppath = parse_path(parsed.path or "") + local url = build_path(ppath) + if parsed.params then url = url .. ";" .. parsed.params end + if parsed.query then url = url .. "?" .. parsed.query end + local authority = parsed.authority + if parsed.host then + authority = parsed.host + if parsed.port then authority = authority .. ":" .. parsed.port end + local userinfo = parsed.userinfo + if parsed.user then + userinfo = parsed.user + if parsed.password then + userinfo = userinfo .. ":" .. parsed.password + end + end + if userinfo then authority = userinfo .. "@" .. authority end + end + if authority then url = "//" .. authority .. url end + if parsed.scheme then url = parsed.scheme .. ":" .. url end + if parsed.fragment then url = url .. "#" .. parsed.fragment end + -- url = string.gsub(url, "%s", "") + return url +end + +----------------------------------------------------------------------------- +-- Builds a absolute URL from a base and a relative URL according to RFC 2396 +-- Input +-- base_url +-- relative_url +-- Returns +-- corresponding absolute url +----------------------------------------------------------------------------- +function absolute(base_url, relative_url) + if base.type(base_url) == "table" then + base_parsed = base_url + base_url = build(base_parsed) + else + base_parsed = parse(base_url) + end + local relative_parsed = parse(relative_url) + if not base_parsed then return relative_url + elseif not relative_parsed then return base_url + elseif relative_parsed.scheme then return relative_url + else + relative_parsed.scheme = base_parsed.scheme + if not relative_parsed.authority then + relative_parsed.authority = base_parsed.authority + if not relative_parsed.path then + relative_parsed.path = base_parsed.path + if not relative_parsed.params then + relative_parsed.params = base_parsed.params + if not relative_parsed.query then + relative_parsed.query = base_parsed.query + end + end + else + relative_parsed.path = absolute_path(base_parsed.path or "", + relative_parsed.path) + end + end + return build(relative_parsed) + end +end + +----------------------------------------------------------------------------- +-- Breaks a path into its segments, unescaping the segments +-- Input +-- path +-- Returns +-- segment: a table with one entry per segment +----------------------------------------------------------------------------- +function parse_path(path) + local parsed = {} + path = path or "" + --path = string.gsub(path, "%s", "") + string.gsub(path, "([^/]+)", function (s) table.insert(parsed, s) end) + for i = 1, table.getn(parsed) do + parsed[i] = unescape(parsed[i]) + end + if string.sub(path, 1, 1) == "/" then parsed.is_absolute = 1 end + if string.sub(path, -1, -1) == "/" then parsed.is_directory = 1 end + return parsed +end + +----------------------------------------------------------------------------- +-- Builds a path component from its segments, escaping protected characters. +-- Input +-- parsed: path segments +-- unsafe: if true, segments are not protected before path is built +-- Returns +-- path: corresponding path stringing +----------------------------------------------------------------------------- +function build_path(parsed, unsafe) + local path = "" + local n = table.getn(parsed) + if unsafe then + for i = 1, n-1 do + path = path .. parsed[i] + path = path .. "/" + end + if n > 0 then + path = path .. parsed[n] + if parsed.is_directory then path = path .. "/" end + end + else + for i = 1, n-1 do + path = path .. protect_segment(parsed[i]) + path = path .. "/" + end + if n > 0 then + path = path .. protect_segment(parsed[n]) + if parsed.is_directory then path = path .. "/" end + end + end + if parsed.is_absolute then path = "/" .. path end + return path +end diff --git a/rpm-5.4.9/lua/socket/usocket.c b/rpm-5.4.9/lua/socket/usocket.c new file mode 100644 index 0000000..c698c07 --- /dev/null +++ b/rpm-5.4.9/lua/socket/usocket.c @@ -0,0 +1,370 @@ +/*=========================================================================*\ +* Socket compatibilization module for Unix +* LuaSocket toolkit +* +* The code is now interrupt-safe. +* The penalty of calling select to avoid busy-wait is only paid when +* the I/O call fail in the first place. +* +* RCS ID: $Id: usocket.c,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include +#include + +#include "socket.h" + +/*-------------------------------------------------------------------------*\ +* Wait for readable/writable/connected socket with timeout +\*-------------------------------------------------------------------------*/ +#ifdef SOCKET_POLL +#include + +#define WAITFD_R POLLIN +#define WAITFD_W POLLOUT +#define WAITFD_C (POLLIN|POLLOUT) +int socket_waitfd(p_socket ps, int sw, p_timeout tm) { + int ret; + struct pollfd pfd; + pfd.fd = *ps; + pfd.events = sw; + pfd.revents = 0; + if (timeout_iszero(tm)) return IO_TIMEOUT; /* optimize timeout == 0 case */ + do { + int t = (int)(timeout_getretry(tm)*1e3); + ret = poll(&pfd, 1, t >= 0? t: -1); + } while (ret == -1 && errno == EINTR); + if (ret == -1) return errno; + if (ret == 0) return IO_TIMEOUT; + if (sw == WAITFD_C && (pfd.revents & (POLLIN|POLLERR))) return IO_CLOSED; + return IO_DONE; +} +#else + +#define WAITFD_R 1 +#define WAITFD_W 2 +#define WAITFD_C (WAITFD_R|WAITFD_W) + +int socket_waitfd(p_socket ps, int sw, p_timeout tm) { + int ret; + fd_set rfds, wfds, *rp, *wp; + struct timeval tv, *tp; + double t; + if (timeout_iszero(tm)) return IO_TIMEOUT; /* optimize timeout == 0 case */ + do { + /* must set bits within loop, because select may have modifed them */ + rp = wp = NULL; + if (sw & WAITFD_R) { FD_ZERO(&rfds); FD_SET(*ps, &rfds); rp = &rfds; } + if (sw & WAITFD_W) { FD_ZERO(&wfds); FD_SET(*ps, &wfds); wp = &wfds; } + t = timeout_getretry(tm); + tp = NULL; + if (t >= 0.0) { + tv.tv_sec = (int)t; + tv.tv_usec = (int)((t-tv.tv_sec)*1.0e6); + tp = &tv; + } + ret = select(*ps+1, rp, wp, NULL, tp); + } while (ret == -1 && errno == EINTR); + if (ret == -1) return errno; + if (ret == 0) return IO_TIMEOUT; + if (sw == WAITFD_C && FD_ISSET(*ps, &rfds)) return IO_CLOSED; + return IO_DONE; +} +#endif + + +/*-------------------------------------------------------------------------*\ +* Initializes module +\*-------------------------------------------------------------------------*/ +int socket_open(void) { + /* instals a handler to ignore sigpipe or it will crash us */ + signal(SIGPIPE, SIG_IGN); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Close module +\*-------------------------------------------------------------------------*/ +int socket_close(void) { + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Close and inutilize socket +\*-------------------------------------------------------------------------*/ +void socket_destroy(p_socket ps) { + if (*ps != SOCKET_INVALID) { + socket_setblocking(ps); + close(*ps); + *ps = SOCKET_INVALID; + } +} + +/*-------------------------------------------------------------------------*\ +* Select with timeout control +\*-------------------------------------------------------------------------*/ +int socket_select(t_socket n, fd_set *rfds, fd_set *wfds, fd_set *efds, + p_timeout tm) { + int ret; + do { + struct timeval tv; + double t = timeout_getretry(tm); + tv.tv_sec = (int) t; + tv.tv_usec = (int) ((t - tv.tv_sec) * 1.0e6); + /* timeout = 0 means no wait */ + ret = select(n, rfds, wfds, efds, t >= 0.0 ? &tv: NULL); + } while (ret < 0 && errno == EINTR); + return ret; +} + +/*-------------------------------------------------------------------------*\ +* Creates and sets up a socket +\*-------------------------------------------------------------------------*/ +int socket_create(p_socket ps, int domain, int type, int protocol) { + *ps = socket(domain, type, protocol); + if (*ps != SOCKET_INVALID) return IO_DONE; + else return errno; +} + +/*-------------------------------------------------------------------------*\ +* Binds or returns error message +\*-------------------------------------------------------------------------*/ +int socket_bind(p_socket ps, SA *addr, socklen_t len) { + int err = IO_DONE; + socket_setblocking(ps); + if (bind(*ps, addr, len) < 0) err = errno; + socket_setnonblocking(ps); + return err; +} + +/*-------------------------------------------------------------------------*\ +* +\*-------------------------------------------------------------------------*/ +int socket_listen(p_socket ps, int backlog) { + int err = IO_DONE; + socket_setblocking(ps); + if (listen(*ps, backlog)) err = errno; + socket_setnonblocking(ps); + return err; +} + +/*-------------------------------------------------------------------------*\ +* +\*-------------------------------------------------------------------------*/ +void socket_shutdown(p_socket ps, int how) { + socket_setblocking(ps); + shutdown(*ps, how); + socket_setnonblocking(ps); +} + +/*-------------------------------------------------------------------------*\ +* Connects or returns error message +\*-------------------------------------------------------------------------*/ +int socket_connect(p_socket ps, SA *addr, socklen_t len, p_timeout tm) { + int err; + /* avoid calling on closed sockets */ + if (*ps == SOCKET_INVALID) return IO_CLOSED; + /* call connect until done or failed without being interrupted */ + do if (connect(*ps, addr, len) == 0) return IO_DONE; + while ((err = errno) == EINTR); + /* if connection failed immediately, return error code */ + if (err != EINPROGRESS && err != EAGAIN) return err; + /* zero timeout case optimization */ + if (timeout_iszero(tm)) return IO_TIMEOUT; + /* wait until we have the result of the connection attempt or timeout */ + err = socket_waitfd(ps, WAITFD_C, tm); + if (err == IO_CLOSED) { + if (recv(*ps, (char *) &err, 0, 0) == 0) return IO_DONE; + else return errno; + } else return err; +} + +/*-------------------------------------------------------------------------*\ +* Accept with timeout +\*-------------------------------------------------------------------------*/ +int socket_accept(p_socket ps, p_socket pa, SA *addr, socklen_t *len, p_timeout tm) { + SA daddr; + socklen_t dlen = sizeof(daddr); + if (*ps == SOCKET_INVALID) return IO_CLOSED; + if (!addr) addr = &daddr; + if (!len) len = &dlen; + for ( ;; ) { + int err; + if ((*pa = accept(*ps, addr, len)) != SOCKET_INVALID) return IO_DONE; + err = errno; + if (err == EINTR) continue; + if (err != EAGAIN && err != ECONNABORTED) return err; + if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err; + } + /* can't reach here */ + return IO_UNKNOWN; +} + +/*-------------------------------------------------------------------------*\ +* Send with timeout +\*-------------------------------------------------------------------------*/ +int socket_send(p_socket ps, const char *data, size_t count, + size_t *sent, p_timeout tm) +{ + int err; + *sent = 0; + /* avoid making system calls on closed sockets */ + if (*ps == SOCKET_INVALID) return IO_CLOSED; + /* loop until we send something or we give up on error */ + for ( ;; ) { + long put = (long) send(*ps, data, count, 0); + /* if we sent anything, we are done */ + if (put > 0) { + *sent = put; + return IO_DONE; + } + err = errno; + /* send can't really return 0, but EPIPE means the connection was + closed */ + if (put == 0 || err == EPIPE) return IO_CLOSED; + /* we call was interrupted, just try again */ + if (err == EINTR) continue; + /* if failed fatal reason, report error */ + if (err != EAGAIN) return err; + /* wait until we can send something or we timeout */ + if ((err = socket_waitfd(ps, WAITFD_W, tm)) != IO_DONE) return err; + } + /* can't reach here */ + return IO_UNKNOWN; +} + +/*-------------------------------------------------------------------------*\ +* Sendto with timeout +\*-------------------------------------------------------------------------*/ +int socket_sendto(p_socket ps, const char *data, size_t count, size_t *sent, + SA *addr, socklen_t len, p_timeout tm) +{ + int err; + *sent = 0; + if (*ps == SOCKET_INVALID) return IO_CLOSED; + for ( ;; ) { + long put = (long) sendto(*ps, data, count, 0, addr, len); + if (put > 0) { + *sent = put; + return IO_DONE; + } + err = errno; + if (put == 0 || err == EPIPE) return IO_CLOSED; + if (err == EINTR) continue; + if (err != EAGAIN) return err; + if ((err = socket_waitfd(ps, WAITFD_W, tm)) != IO_DONE) return err; + } + return IO_UNKNOWN; +} + +/*-------------------------------------------------------------------------*\ +* Receive with timeout +\*-------------------------------------------------------------------------*/ +int socket_recv(p_socket ps, char *data, size_t count, size_t *got, p_timeout tm) { + int err; + *got = 0; + if (*ps == SOCKET_INVALID) return IO_CLOSED; + for ( ;; ) { + long taken = (long) recv(*ps, data, count, 0); + if (taken > 0) { + *got = taken; + return IO_DONE; + } + err = errno; + if (taken == 0) return IO_CLOSED; + if (err == EINTR) continue; + if (err != EAGAIN) return err; + if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err; + } + return IO_UNKNOWN; +} + +/*-------------------------------------------------------------------------*\ +* Recvfrom with timeout +\*-------------------------------------------------------------------------*/ +int socket_recvfrom(p_socket ps, char *data, size_t count, size_t *got, + SA *addr, socklen_t *len, p_timeout tm) { + int err; + *got = 0; + if (*ps == SOCKET_INVALID) return IO_CLOSED; + for ( ;; ) { + long taken = (long) recvfrom(*ps, data, count, 0, addr, len); + if (taken > 0) { + *got = taken; + return IO_DONE; + } + err = errno; + if (taken == 0) return IO_CLOSED; + if (err == EINTR) continue; + if (err != EAGAIN) return err; + if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err; + } + return IO_UNKNOWN; +} + +/*-------------------------------------------------------------------------*\ +* Put socket into blocking mode +\*-------------------------------------------------------------------------*/ +void socket_setblocking(p_socket ps) { + int flags = fcntl(*ps, F_GETFL, 0); + flags &= (~(O_NONBLOCK)); + fcntl(*ps, F_SETFL, flags); +} + +/*-------------------------------------------------------------------------*\ +* Put socket into non-blocking mode +\*-------------------------------------------------------------------------*/ +void socket_setnonblocking(p_socket ps) { + int flags = fcntl(*ps, F_GETFL, 0); + flags |= O_NONBLOCK; + fcntl(*ps, F_SETFL, flags); +} + +/*-------------------------------------------------------------------------*\ +* DNS helpers +\*-------------------------------------------------------------------------*/ +int socket_gethostbyaddr(const char *addr, socklen_t len, struct hostent **hp) { + *hp = gethostbyaddr(addr, len, AF_INET); + if (*hp) return IO_DONE; + else if (h_errno) return h_errno; + else if (errno) return errno; + else return IO_UNKNOWN; +} + +int socket_gethostbyname(const char *addr, struct hostent **hp) { + *hp = gethostbyname(addr); + if (*hp) return IO_DONE; + else if (h_errno) return h_errno; + else if (errno) return errno; + else return IO_UNKNOWN; +} + +/*-------------------------------------------------------------------------*\ +* Error translation functions +* Make sure important error messages are standard +\*-------------------------------------------------------------------------*/ +const char *socket_hoststrerror(int err) { + if (err <= 0) return io_strerror(err); + switch (err) { + case HOST_NOT_FOUND: return "host not found"; + default: return hstrerror(err); + } +} + +const char *socket_strerror(int err) { + if (err <= 0) return io_strerror(err); + switch (err) { + case EADDRINUSE: return "address already in use"; + case EISCONN: return "already connected"; + case EACCES: return "permission denied"; + case ECONNREFUSED: return "connection refused"; + case ECONNABORTED: return "closed"; + case ECONNRESET: return "closed"; + case ETIMEDOUT: return "timeout"; + default: return strerror(errno); + } +} + +const char *socket_ioerror(p_socket ps, int err) { + (void) ps; + return socket_strerror(err); +} diff --git a/rpm-5.4.9/lua/socket/usocket.h b/rpm-5.4.9/lua/socket/usocket.h new file mode 100644 index 0000000..816ef66 --- /dev/null +++ b/rpm-5.4.9/lua/socket/usocket.h @@ -0,0 +1,40 @@ +#ifndef USOCKET_H +#define USOCKET_H +/*=========================================================================*\ +* Socket compatibilization module for Unix +* LuaSocket toolkit +* +* RCS ID: $Id: usocket.h,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ + +/*=========================================================================*\ +* BSD include files +\*=========================================================================*/ +/* error codes */ +#include +/* close function */ +#include +/* fnctnl function and associated constants */ +#include +/* struct sockaddr */ +#include +/* socket function */ +#include +/* struct timeval */ +#include +/* gethostbyname and gethostbyaddr functions */ +#include +/* sigpipe handling */ +#include +/* IP stuff*/ +#include +#include +/* TCP options (nagle algorithm disable) */ +#include + +typedef int t_socket; +typedef t_socket *p_socket; + +#define SOCKET_INVALID (-1) + +#endif /* USOCKET_H */ diff --git a/rpm-5.4.9/lua/socket/wsocket.c b/rpm-5.4.9/lua/socket/wsocket.c new file mode 100644 index 0000000..49e847b --- /dev/null +++ b/rpm-5.4.9/lua/socket/wsocket.c @@ -0,0 +1,401 @@ +/*=========================================================================*\ +* Socket compatibilization module for Win32 +* LuaSocket toolkit +* +* The penalty of calling select to avoid busy-wait is only paid when +* the I/O call fail in the first place. +* +* RCS ID: $Id: wsocket.c,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ +#include + +#include "socket.h" + +/* WinSock doesn't have a strerror... */ +static const char *wstrerror(int err); + +/*-------------------------------------------------------------------------*\ +* Initializes module +\*-------------------------------------------------------------------------*/ +int socket_open(void) { + WSADATA wsaData; + WORD wVersionRequested = MAKEWORD(2, 0); + int err = WSAStartup(wVersionRequested, &wsaData ); + if (err != 0) return 0; + if ((LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 0) && + (LOBYTE(wsaData.wVersion) != 1 || HIBYTE(wsaData.wVersion) != 1)) { + WSACleanup(); + return 0; + } + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Close module +\*-------------------------------------------------------------------------*/ +int socket_close(void) { + WSACleanup(); + return 1; +} + +/*-------------------------------------------------------------------------*\ +* Wait for readable/writable/connected socket with timeout +\*-------------------------------------------------------------------------*/ +#define WAITFD_R 1 +#define WAITFD_W 2 +#define WAITFD_E 4 +#define WAITFD_C (WAITFD_E|WAITFD_W) + +int socket_waitfd(p_socket ps, int sw, p_timeout tm) { + int ret; + fd_set rfds, wfds, efds, *rp = NULL, *wp = NULL, *ep = NULL; + struct timeval tv, *tp = NULL; + double t; + if (timeout_iszero(tm)) return IO_TIMEOUT; /* optimize timeout == 0 case */ + if (sw & WAITFD_R) { + FD_ZERO(&rfds); + FD_SET(*ps, &rfds); + rp = &rfds; + } + if (sw & WAITFD_W) { FD_ZERO(&wfds); FD_SET(*ps, &wfds); wp = &wfds; } + if (sw & WAITFD_C) { FD_ZERO(&efds); FD_SET(*ps, &efds); ep = &efds; } + if ((t = timeout_get(tm)) >= 0.0) { + tv.tv_sec = (int) t; + tv.tv_usec = (int) ((t-tv.tv_sec)*1.0e6); + tp = &tv; + } + ret = select(0, rp, wp, ep, tp); + if (ret == -1) return WSAGetLastError(); + if (ret == 0) return IO_TIMEOUT; + if (sw == WAITFD_C && FD_ISSET(*ps, &efds)) return IO_CLOSED; + return IO_DONE; +} + +/*-------------------------------------------------------------------------*\ +* Select with int timeout in ms +\*-------------------------------------------------------------------------*/ +int socket_select(t_socket n, fd_set *rfds, fd_set *wfds, fd_set *efds, + p_timeout tm) { + struct timeval tv; + double t = timeout_get(tm); + tv.tv_sec = (int) t; + tv.tv_usec = (int) ((t - tv.tv_sec) * 1.0e6); + if (n <= 0) { + Sleep((DWORD) (1000*t)); + return 0; + } else return select(0, rfds, wfds, efds, t >= 0.0? &tv: NULL); +} + +/*-------------------------------------------------------------------------*\ +* Close and inutilize socket +\*-------------------------------------------------------------------------*/ +void socket_destroy(p_socket ps) { + if (*ps != SOCKET_INVALID) { + socket_setblocking(ps); /* close can take a long time on WIN32 */ + closesocket(*ps); + *ps = SOCKET_INVALID; + } +} + +/*-------------------------------------------------------------------------*\ +* +\*-------------------------------------------------------------------------*/ +void socket_shutdown(p_socket ps, int how) { + socket_setblocking(ps); + shutdown(*ps, how); + socket_setnonblocking(ps); +} + +/*-------------------------------------------------------------------------*\ +* Creates and sets up a socket +\*-------------------------------------------------------------------------*/ +int socket_create(p_socket ps, int domain, int type, int protocol) { + *ps = socket(domain, type, protocol); + if (*ps != SOCKET_INVALID) return IO_DONE; + else return WSAGetLastError(); +} + +/*-------------------------------------------------------------------------*\ +* Connects or returns error message +\*-------------------------------------------------------------------------*/ +int socket_connect(p_socket ps, SA *addr, socklen_t len, p_timeout tm) { + int err; + /* don't call on closed socket */ + if (*ps == SOCKET_INVALID) return IO_CLOSED; + /* ask system to connect */ + if (connect(*ps, addr, len) == 0) return IO_DONE; + /* make sure the system is trying to connect */ + err = WSAGetLastError(); + if (err != WSAEWOULDBLOCK && err != WSAEINPROGRESS) return err; + /* zero timeout case optimization */ + if (timeout_iszero(tm)) return IO_TIMEOUT; + /* we wait until something happens */ + err = socket_waitfd(ps, WAITFD_C, tm); + if (err == IO_CLOSED) { + int len = sizeof(err); + /* give windows time to set the error (yes, disgusting) */ + Sleep(10); + /* find out why we failed */ + getsockopt(*ps, SOL_SOCKET, SO_ERROR, (char *)&err, &len); + /* we KNOW there was an error. if 'why' is 0, we will return + * "unknown error", but it's not really our fault */ + return err > 0? err: IO_UNKNOWN; + } else return err; + +} + +/*-------------------------------------------------------------------------*\ +* Binds or returns error message +\*-------------------------------------------------------------------------*/ +int socket_bind(p_socket ps, SA *addr, socklen_t len) { + int err = IO_DONE; + socket_setblocking(ps); + if (bind(*ps, addr, len) < 0) err = WSAGetLastError(); + socket_setnonblocking(ps); + return err; +} + +/*-------------------------------------------------------------------------*\ +* +\*-------------------------------------------------------------------------*/ +int socket_listen(p_socket ps, int backlog) { + int err = IO_DONE; + socket_setblocking(ps); + if (listen(*ps, backlog) < 0) err = WSAGetLastError(); + socket_setnonblocking(ps); + return err; +} + +/*-------------------------------------------------------------------------*\ +* Accept with timeout +\*-------------------------------------------------------------------------*/ +int socket_accept(p_socket ps, p_socket pa, SA *addr, socklen_t *len, + p_timeout tm) { + SA daddr; + socklen_t dlen = sizeof(daddr); + if (*ps == SOCKET_INVALID) return IO_CLOSED; + if (!addr) addr = &daddr; + if (!len) len = &dlen; + for ( ;; ) { + int err; + /* try to get client socket */ + if ((*pa = accept(*ps, addr, len)) != SOCKET_INVALID) return IO_DONE; + /* find out why we failed */ + err = WSAGetLastError(); + /* if we failed because there was no connectoin, keep trying */ + if (err != WSAEWOULDBLOCK && err != WSAECONNABORTED) return err; + /* call select to avoid busy wait */ + if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err; + } + /* can't reach here */ + return IO_UNKNOWN; +} + +/*-------------------------------------------------------------------------*\ +* Send with timeout +* On windows, if you try to send 10MB, the OS will buffer EVERYTHING +* this can take an awful lot of time and we will end up blocked. +* Therefore, whoever calls this function should not pass a huge buffer. +\*-------------------------------------------------------------------------*/ +int socket_send(p_socket ps, const char *data, size_t count, + size_t *sent, p_timeout tm) +{ + int err; + *sent = 0; + /* avoid making system calls on closed sockets */ + if (*ps == SOCKET_INVALID) return IO_CLOSED; + /* loop until we send something or we give up on error */ + for ( ;; ) { + /* try to send something */ + int put = send(*ps, data, (int) count, 0); + /* if we sent something, we are done */ + if (put > 0) { + *sent = put; + return IO_DONE; + } + /* deal with failure */ + err = WSAGetLastError(); + /* we can only proceed if there was no serious error */ + if (err != WSAEWOULDBLOCK) return err; + /* avoid busy wait */ + if ((err = socket_waitfd(ps, WAITFD_W, tm)) != IO_DONE) return err; + } + /* can't reach here */ + return IO_UNKNOWN; +} + +/*-------------------------------------------------------------------------*\ +* Sendto with timeout +\*-------------------------------------------------------------------------*/ +int socket_sendto(p_socket ps, const char *data, size_t count, size_t *sent, + SA *addr, socklen_t len, p_timeout tm) +{ + int err; + *sent = 0; + if (*ps == SOCKET_INVALID) return IO_CLOSED; + for ( ;; ) { + int put = sendto(*ps, data, (int) count, 0, addr, len); + if (put > 0) { + *sent = put; + return IO_DONE; + } + err = WSAGetLastError(); + if (err != WSAEWOULDBLOCK) return err; + if ((err = socket_waitfd(ps, WAITFD_W, tm)) != IO_DONE) return err; + } + return IO_UNKNOWN; +} + +/*-------------------------------------------------------------------------*\ +* Receive with timeout +\*-------------------------------------------------------------------------*/ +int socket_recv(p_socket ps, char *data, size_t count, size_t *got, p_timeout tm) { + int err; + *got = 0; + if (*ps == SOCKET_INVALID) return IO_CLOSED; + for ( ;; ) { + int taken = recv(*ps, data, (int) count, 0); + if (taken > 0) { + *got = taken; + return IO_DONE; + } + if (taken == 0) return IO_CLOSED; + err = WSAGetLastError(); + if (err != WSAEWOULDBLOCK) return err; + if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err; + } + return IO_UNKNOWN; +} + +/*-------------------------------------------------------------------------*\ +* Recvfrom with timeout +\*-------------------------------------------------------------------------*/ +int socket_recvfrom(p_socket ps, char *data, size_t count, size_t *got, + SA *addr, socklen_t *len, p_timeout tm) { + int err; + *got = 0; + if (*ps == SOCKET_INVALID) return IO_CLOSED; + for ( ;; ) { + int taken = recvfrom(*ps, data, (int) count, 0, addr, len); + if (taken > 0) { + *got = taken; + return IO_DONE; + } + if (taken == 0) return IO_CLOSED; + err = WSAGetLastError(); + if (err != WSAEWOULDBLOCK) return err; + if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err; + } + return IO_UNKNOWN; +} + +/*-------------------------------------------------------------------------*\ +* Put socket into blocking mode +\*-------------------------------------------------------------------------*/ +void socket_setblocking(p_socket ps) { + u_long argp = 0; + ioctlsocket(*ps, FIONBIO, &argp); +} + +/*-------------------------------------------------------------------------*\ +* Put socket into non-blocking mode +\*-------------------------------------------------------------------------*/ +void socket_setnonblocking(p_socket ps) { + u_long argp = 1; + ioctlsocket(*ps, FIONBIO, &argp); +} + +/*-------------------------------------------------------------------------*\ +* DNS helpers +\*-------------------------------------------------------------------------*/ +int socket_gethostbyaddr(const char *addr, socklen_t len, struct hostent **hp) { + *hp = gethostbyaddr(addr, len, AF_INET); + if (*hp) return IO_DONE; + else return WSAGetLastError(); +} + +int socket_gethostbyname(const char *addr, struct hostent **hp) { + *hp = gethostbyname(addr); + if (*hp) return IO_DONE; + else return WSAGetLastError(); +} + +/*-------------------------------------------------------------------------*\ +* Error translation functions +\*-------------------------------------------------------------------------*/ +const char *socket_hoststrerror(int err) { + if (err <= 0) return io_strerror(err); + switch (err) { + case WSAHOST_NOT_FOUND: return "host not found"; + default: return wstrerror(err); + } +} + +const char *socket_strerror(int err) { + if (err <= 0) return io_strerror(err); + switch (err) { + case WSAEADDRINUSE: return "address already in use"; + case WSAECONNREFUSED: return "connection refused"; + case WSAEISCONN: return "already connected"; + case WSAEACCES: return "permission denied"; + case WSAECONNABORTED: return "closed"; + case WSAECONNRESET: return "closed"; + case WSAETIMEDOUT: return "timeout"; + default: return wstrerror(err); + } +} + +const char *socket_ioerror(p_socket ps, int err) { + (void) ps; + return socket_strerror(err); +} + +static const char *wstrerror(int err) { + switch (err) { + case WSAEINTR: return "Interrupted function call"; + case WSAEACCES: return "Permission denied"; + case WSAEFAULT: return "Bad address"; + case WSAEINVAL: return "Invalid argument"; + case WSAEMFILE: return "Too many open files"; + case WSAEWOULDBLOCK: return "Resource temporarily unavailable"; + case WSAEINPROGRESS: return "Operation now in progress"; + case WSAEALREADY: return "Operation already in progress"; + case WSAENOTSOCK: return "Socket operation on nonsocket"; + case WSAEDESTADDRREQ: return "Destination address required"; + case WSAEMSGSIZE: return "Message too long"; + case WSAEPROTOTYPE: return "Protocol wrong type for socket"; + case WSAENOPROTOOPT: return "Bad protocol option"; + case WSAEPROTONOSUPPORT: return "Protocol not supported"; + case WSAESOCKTNOSUPPORT: return "Socket type not supported"; + case WSAEOPNOTSUPP: return "Operation not supported"; + case WSAEPFNOSUPPORT: return "Protocol family not supported"; + case WSAEAFNOSUPPORT: + return "Address family not supported by protocol family"; + case WSAEADDRINUSE: return "Address already in use"; + case WSAEADDRNOTAVAIL: return "Cannot assign requested address"; + case WSAENETDOWN: return "Network is down"; + case WSAENETUNREACH: return "Network is unreachable"; + case WSAENETRESET: return "Network dropped connection on reset"; + case WSAECONNABORTED: return "Software caused connection abort"; + case WSAECONNRESET: return "Connection reset by peer"; + case WSAENOBUFS: return "No buffer space available"; + case WSAEISCONN: return "Socket is already connected"; + case WSAENOTCONN: return "Socket is not connected"; + case WSAESHUTDOWN: return "Cannot send after socket shutdown"; + case WSAETIMEDOUT: return "Connection timed out"; + case WSAECONNREFUSED: return "Connection refused"; + case WSAEHOSTDOWN: return "Host is down"; + case WSAEHOSTUNREACH: return "No route to host"; + case WSAEPROCLIM: return "Too many processes"; + case WSASYSNOTREADY: return "Network subsystem is unavailable"; + case WSAVERNOTSUPPORTED: return "Winsock.dll version out of range"; + case WSANOTINITIALISED: + return "Successful WSAStartup not yet performed"; + case WSAEDISCON: return "Graceful shutdown in progress"; + case WSAHOST_NOT_FOUND: return "Host not found"; + case WSATRY_AGAIN: return "Nonauthoritative host not found"; + case WSANO_RECOVERY: return "Nonrecoverable name lookup error"; + case WSANO_DATA: return "Valid name, no data record of requested type"; + default: return "Unknown error"; + } +} diff --git a/rpm-5.4.9/lua/socket/wsocket.h b/rpm-5.4.9/lua/socket/wsocket.h new file mode 100644 index 0000000..680eae4 --- /dev/null +++ b/rpm-5.4.9/lua/socket/wsocket.h @@ -0,0 +1,21 @@ +#ifndef WSOCKET_H +#define WSOCKET_H +/*=========================================================================*\ +* Socket compatibilization module for Win32 +* LuaSocket toolkit +* +* RCS ID: $Id: wsocket.h,v 1.1 2008/10/24 22:58:40 jbj Exp $ +\*=========================================================================*/ + +/*=========================================================================*\ +* WinSock include files +\*=========================================================================*/ +#include + +typedef int socklen_t; +typedef SOCKET t_socket; +typedef t_socket *p_socket; + +#define SOCKET_INVALID (INVALID_SOCKET) + +#endif /* WSOCKET_H */ diff --git a/rpm-5.4.9/m4/gettext.m4 b/rpm-5.4.9/m4/gettext.m4 new file mode 100644 index 0000000..f84e6a5 --- /dev/null +++ b/rpm-5.4.9/m4/gettext.m4 @@ -0,0 +1,383 @@ +# gettext.m4 serial 63 (gettext-0.18) +dnl Copyright (C) 1995-2010 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995-2000. +dnl Bruno Haible , 2000-2006, 2008-2010. + +dnl Macro to add for using GNU gettext. + +dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). +dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The +dnl default (if it is not specified or empty) is 'no-libtool'. +dnl INTLSYMBOL should be 'external' for packages with no intl directory, +dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. +dnl If INTLSYMBOL is 'use-libtool', then a libtool library +dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, +dnl depending on --{enable,disable}-{shared,static} and on the presence of +dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library +dnl $(top_builddir)/intl/libintl.a will be created. +dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext +dnl implementations (in libc or libintl) without the ngettext() function +dnl will be ignored. If NEEDSYMBOL is specified and is +dnl 'need-formatstring-macros', then GNU gettext implementations that don't +dnl support the ISO C 99 formatstring macros will be ignored. +dnl INTLDIR is used to find the intl libraries. If empty, +dnl the value `$(top_builddir)/intl/' is used. +dnl +dnl The result of the configuration is one of three cases: +dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled +dnl and used. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 2) GNU gettext has been found in the system's C library. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 3) No internationalization, always use English msgid. +dnl Catalog format: none +dnl Catalog extension: none +dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. +dnl The use of .gmo is historical (it was needed to avoid overwriting the +dnl GNU format catalogs when building on a platform with an X/Open gettext), +dnl but we keep it in order not to force irrelevant filename changes on the +dnl maintainers. +dnl +AC_DEFUN([AM_GNU_GETTEXT], +[ + dnl Argument checking. + ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , + [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT +])])])])]) + ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old], + [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])]) + ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , + [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT +])])])]) + define([gt_included_intl], + ifelse([$1], [external], + ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), + [yes])) + define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) + gt_NEEDS_INIT + AM_GNU_GETTEXT_NEED([$2]) + + AC_REQUIRE([AM_PO_SUBDIRS])dnl + ifelse(gt_included_intl, yes, [ + AC_REQUIRE([AM_INTL_SUBDIR])dnl + ]) + + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Sometimes libintl requires libiconv, so first search for libiconv. + dnl Ideally we would do this search only after the + dnl if test "$USE_NLS" = "yes"; then + dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT + dnl the configure script would need to contain the same shell code + dnl again, outside any 'if'. There are two solutions: + dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. + dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. + dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not + dnl documented, we avoid it. + ifelse(gt_included_intl, yes, , [ + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + ]) + + dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. + gt_INTL_MACOSX + + dnl Set USE_NLS. + AC_REQUIRE([AM_NLS]) + + ifelse(gt_included_intl, yes, [ + BUILD_INCLUDED_LIBINTL=no + USE_INCLUDED_LIBINTL=no + ]) + LIBINTL= + LTLIBINTL= + POSUB= + + dnl Add a version number to the cache macros. + case " $gt_needs " in + *" need-formatstring-macros "*) gt_api_version=3 ;; + *" need-ngettext "*) gt_api_version=2 ;; + *) gt_api_version=1 ;; + esac + gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" + gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" + + dnl If we use NLS figure out what method + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + ifelse(gt_included_intl, yes, [ + AC_MSG_CHECKING([whether included gettext is requested]) + AC_ARG_WITH([included-gettext], + [ --with-included-gettext use the GNU gettext library included here], + nls_cv_force_use_gnu_gettext=$withval, + nls_cv_force_use_gnu_gettext=no) + AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext]) + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + ]) + dnl User does not insist on using GNU NLS library. Figure out what + dnl to use. If GNU gettext is available we use this. Else we have + dnl to fall back to GNU NLS library. + + if test $gt_api_version -ge 3; then + gt_revision_test_code=' +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +changequote(,)dnl +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +changequote([,])dnl +' + else + gt_revision_test_code= + fi + if test $gt_api_version -ge 2; then + gt_expression_test_code=' + * ngettext ("", "", 0)' + else + gt_expression_test_code= + fi + + AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], + [AC_TRY_LINK([#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings;], + [bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings], + [eval "$gt_func_gnugettext_libc=yes"], + [eval "$gt_func_gnugettext_libc=no"])]) + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + dnl Sometimes libintl requires libiconv, so first search for libiconv. + ifelse(gt_included_intl, yes, , [ + AM_ICONV_LINK + ]) + dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL + dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) + dnl because that would add "-liconv" to LIBINTL and LTLIBINTL + dnl even if libiconv doesn't exist. + AC_LIB_LINKFLAGS_BODY([intl]) + AC_CACHE_CHECK([for GNU gettext in libintl], + [$gt_func_gnugettext_libintl], + [gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + dnl Now see whether libintl exists and does not depend on libiconv. + AC_TRY_LINK([#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *);], + [bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], + [eval "$gt_func_gnugettext_libintl=yes"], + [eval "$gt_func_gnugettext_libintl=no"]) + dnl Now see whether libintl exists and depends on libiconv. + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + AC_TRY_LINK([#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *);], + [bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], + [LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" + ]) + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS"]) + fi + + dnl If an already present or preinstalled GNU gettext() is found, + dnl use it. But if this macro is used in GNU gettext, and GNU + dnl gettext is already preinstalled in libintl, we update this + dnl libintl. (Cf. the install rule in intl/Makefile.in.) + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ + || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + dnl Reset the values set by searching for libintl. + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + ifelse(gt_included_intl, yes, [ + if test "$gt_use_preinstalled_gnugettext" != "yes"; then + dnl GNU gettext is not found in the C library. + dnl Fall back on included GNU gettext library. + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions used to generate GNU NLS library. + BUILD_INCLUDED_LIBINTL=yes + USE_INCLUDED_LIBINTL=yes + LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" + LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + fi + + CATOBJEXT= + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions to use GNU gettext tools. + CATOBJEXT=.gmo + fi + ]) + + if test -n "$INTL_MACOSX_LIBS"; then + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Some extra flags are needed during linking. + LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" + LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" + fi + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + AC_DEFINE([ENABLE_NLS], [1], + [Define to 1 if translation of program messages to the user's native language + is requested.]) + else + USE_NLS=no + fi + fi + + AC_MSG_CHECKING([whether to use NLS]) + AC_MSG_RESULT([$USE_NLS]) + if test "$USE_NLS" = "yes"; then + AC_MSG_CHECKING([where the gettext function comes from]) + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + AC_MSG_RESULT([$gt_source]) + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + AC_MSG_CHECKING([how to link with libintl]) + AC_MSG_RESULT([$LIBINTL]) + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) + fi + + dnl For backward compatibility. Some packages may be using this. + AC_DEFINE([HAVE_GETTEXT], [1], + [Define if the GNU gettext() function is already present or preinstalled.]) + AC_DEFINE([HAVE_DCGETTEXT], [1], + [Define if the GNU dcgettext() function is already present or preinstalled.]) + fi + + dnl We need to process the po/ directory. + POSUB=po + fi + + ifelse(gt_included_intl, yes, [ + dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL + dnl to 'yes' because some of the testsuite requires it. + if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then + BUILD_INCLUDED_LIBINTL=yes + fi + + dnl Make all variables we use known to autoconf. + AC_SUBST([BUILD_INCLUDED_LIBINTL]) + AC_SUBST([USE_INCLUDED_LIBINTL]) + AC_SUBST([CATOBJEXT]) + + dnl For backward compatibility. Some configure.ins may be using this. + nls_cv_header_intl= + nls_cv_header_libgt= + + dnl For backward compatibility. Some Makefiles may be using this. + DATADIRNAME=share + AC_SUBST([DATADIRNAME]) + + dnl For backward compatibility. Some Makefiles may be using this. + INSTOBJEXT=.mo + AC_SUBST([INSTOBJEXT]) + + dnl For backward compatibility. Some Makefiles may be using this. + GENCAT=gencat + AC_SUBST([GENCAT]) + + dnl For backward compatibility. Some Makefiles may be using this. + INTLOBJS= + if test "$USE_INCLUDED_LIBINTL" = yes; then + INTLOBJS="\$(GETTOBJS)" + fi + AC_SUBST([INTLOBJS]) + + dnl Enable libtool support if the surrounding package wishes it. + INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix + AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX]) + ]) + + dnl For backward compatibility. Some Makefiles may be using this. + INTLLIBS="$LIBINTL" + AC_SUBST([INTLLIBS]) + + dnl Make all documented variables known to autoconf. + AC_SUBST([LIBINTL]) + AC_SUBST([LTLIBINTL]) + AC_SUBST([POSUB]) +]) + + +dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. +m4_define([gt_NEEDS_INIT], +[ + m4_divert_text([DEFAULTS], [gt_needs=]) + m4_define([gt_NEEDS_INIT], []) +]) + + +dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) +AC_DEFUN([AM_GNU_GETTEXT_NEED], +[ + m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) +]) + + +dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) +AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) diff --git a/rpm-5.4.9/m4/iconv.m4 b/rpm-5.4.9/m4/iconv.m4 new file mode 100644 index 0000000..e2041b9 --- /dev/null +++ b/rpm-5.4.9/m4/iconv.m4 @@ -0,0 +1,214 @@ +# iconv.m4 serial 11 (gettext-0.18.1) +dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], +[ + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([iconv]) +]) + +AC_DEFUN([AM_ICONV_LINK], +[ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable GNU libiconv installed). + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + + dnl Add $INCICONV to CPPFLAGS before performing the following checks, + dnl because if the user has installed libiconv and not disabled its use + dnl via --without-libiconv-prefix, he wants to use it. The first + dnl AC_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_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ + dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10. + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + AC_TRY_RUN([ +#include +#include +int main () +{ + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static const char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + return 1; + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static const char input[] = "\263"; + char buf[10]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + return 1; + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + return 1; + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + return 1; + return 0; +}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], + [case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac]) + LIBS="$am_save_LIBS" + ]) + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + AC_DEFINE([HAVE_ICONV], [1], + [Define if you have the iconv() function and it works.]) + fi + if test "$am_cv_lib_iconv" = yes; then + AC_MSG_CHECKING([how to link with libiconv]) + AC_MSG_RESULT([$LIBICONV]) + else + dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV + dnl either. + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + AC_SUBST([LIBICONV]) + AC_SUBST([LTLIBICONV]) +]) + +dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to +dnl avoid warnings like +dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". +dnl This is tricky because of the way 'aclocal' is implemented: +dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. +dnl Otherwise aclocal's initial scan pass would miss the macro definition. +dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. +dnl Otherwise aclocal would emit many "Use of uninitialized value $1" +dnl warnings. +m4_define([gl_iconv_AC_DEFUN], + m4_version_prereq([2.64], + [[AC_DEFUN_ONCE( + [$1], [$2])]], + [[AC_DEFUN( + [$1], [$2])]])) +gl_iconv_AC_DEFUN([AM_ICONV], +[ + AM_ICONV_LINK + if test "$am_cv_func_iconv" = yes; then + AC_MSG_CHECKING([for iconv declaration]) + AC_CACHE_VAL([am_cv_proto_iconv], [ + AC_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([ + $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/rpm-5.4.9/m4/intlmacosx.m4 b/rpm-5.4.9/m4/intlmacosx.m4 new file mode 100644 index 0000000..dd91025 --- /dev/null +++ b/rpm-5.4.9/m4/intlmacosx.m4 @@ -0,0 +1,51 @@ +# intlmacosx.m4 serial 3 (gettext-0.18) +dnl Copyright (C) 2004-2010 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Checks for special options needed on MacOS X. +dnl Defines INTL_MACOSX_LIBS. +AC_DEFUN([gt_INTL_MACOSX], +[ + dnl Check for API introduced in MacOS X 10.2. + AC_CACHE_CHECK([for CFPreferencesCopyAppValue], + [gt_cv_func_CFPreferencesCopyAppValue], + [gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + AC_TRY_LINK([#include ], + [CFPreferencesCopyAppValue(NULL, NULL)], + [gt_cv_func_CFPreferencesCopyAppValue=yes], + [gt_cv_func_CFPreferencesCopyAppValue=no]) + LIBS="$gt_save_LIBS"]) + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], + [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) + fi + dnl Check for API introduced in MacOS X 10.3. + AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent], + [gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + AC_TRY_LINK([#include ], [CFLocaleCopyCurrent();], + [gt_cv_func_CFLocaleCopyCurrent=yes], + [gt_cv_func_CFLocaleCopyCurrent=no]) + LIBS="$gt_save_LIBS"]) + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then + AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], + [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) + fi + INTL_MACOSX_LIBS= + if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" + fi + AC_SUBST([INTL_MACOSX_LIBS]) +]) diff --git a/rpm-5.4.9/m4/lib-ld.m4 b/rpm-5.4.9/m4/lib-ld.m4 new file mode 100644 index 0000000..ebb3052 --- /dev/null +++ b/rpm-5.4.9/m4/lib-ld.m4 @@ -0,0 +1,110 @@ +# lib-ld.m4 serial 4 (gettext-0.18) +dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +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/rpm-5.4.9/m4/lib-link.m4 b/rpm-5.4.9/m4/lib-link.m4 new file mode 100644 index 0000000..c73bd8e --- /dev/null +++ b/rpm-5.4.9/m4/lib-link.m4 @@ -0,0 +1,774 @@ +# lib-link.m4 serial 21 (gettext-0.18) +dnl Copyright (C) 2001-2010 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +AC_PREREQ([2.54]) + +dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and +dnl augments the CPPFLAGS variable. +dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname +dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. +AC_DEFUN([AC_LIB_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + pushdef([Name],[translit([$1],[./-], [___])]) + pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + ac_cv_lib[]Name[]_libs="$LIB[]NAME" + ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" + ac_cv_lib[]Name[]_cppflags="$INC[]NAME" + ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" + ]) + LIB[]NAME="$ac_cv_lib[]Name[]_libs" + LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" + INC[]NAME="$ac_cv_lib[]Name[]_cppflags" + LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + AC_SUBST([LIB]NAME[_PREFIX]) + dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the + dnl results of this search when this library appears as a dependency. + HAVE_LIB[]NAME=yes + popdef([NAME]) + popdef([Name]) +]) + +dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message]) +dnl searches for libname and the libraries corresponding to explicit and +dnl implicit dependencies, together with the specified include files and +dnl the ability to compile and link the specified testcode. The missing-message +dnl defaults to 'no' and may contain additional hints for the user. +dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} +dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and +dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs +dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. +dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname +dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. +AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + pushdef([Name],[translit([$1],[./-], [___])]) + pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + + dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME + dnl accordingly. + 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" + dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS, + dnl because these -l options might require -L options that are present in + dnl LIBS. -l options benefit only from the -L options listed before it. + dnl Otherwise, add it to the front of LIBS, because it may be a static + dnl library that depends on another static library that is present in LIBS. + dnl Static libraries benefit only from the static libraries listed after + dnl it. + case " $LIB[]NAME" in + *" -l"*) LIBS="$LIBS $LIB[]NAME" ;; + *) LIBS="$LIB[]NAME $LIBS" ;; + esac + AC_TRY_LINK([$3], [$4], + [ac_cv_lib[]Name=yes], + [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) + LIBS="$ac_save_LIBS" + ]) + if test "$ac_cv_lib[]Name" = yes; then + HAVE_LIB[]NAME=yes + AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$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= + LIB[]NAME[]_PREFIX= + fi + AC_SUBST([HAVE_LIB]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + AC_SUBST([LIB]NAME[_PREFIX]) + popdef([NAME]) + popdef([Name]) +]) + +dnl Determine the platform dependent parameters needed to use rpath: +dnl acl_libext, +dnl acl_shlibext, +dnl acl_hardcode_libdir_flag_spec, +dnl acl_hardcode_libdir_separator, +dnl acl_hardcode_direct, +dnl acl_hardcode_minus_L. +AC_DEFUN([AC_LIB_RPATH], +[ + dnl Tell automake >= 1.10 to complain if config.rpath is missing. + m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) + AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS + AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld + AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host + AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir + AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + ]) + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + dnl Determine whether the user wants rpath handling at all. + AC_ARG_ENABLE([rpath], + [ --disable-rpath do not hardcode runtime library paths], + :, enable_rpath=yes) +]) + +dnl AC_LIB_FROMPACKAGE(name, package) +dnl declares that libname comes from the given package. The configure file +dnl will then not have a --with-libname-prefix option but a +dnl --with-package-prefix option. Several libraries can come from the same +dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar +dnl macro call that searches for libname. +AC_DEFUN([AC_LIB_FROMPACKAGE], +[ + pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + define([acl_frompackage_]NAME, [$2]) + popdef([NAME]) + pushdef([PACK],[$2]) + pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + define([acl_libsinpackage_]PACKUP, + m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1]) + popdef([PACKUP]) + popdef([PACK]) +]) + +dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. +dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found +dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. +AC_DEFUN([AC_LIB_LINKFLAGS_BODY], +[ + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) + pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) + dnl Autoconf >= 2.61 supports dots in --with options. + pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_ARG_WITH(P_A_C_K[-prefix], +[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib + --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi +]) + dnl Search the library and its dependencies in $additional_libdir and + dnl $LDFLAGS. Using breadth-first-seach. + LIB[]NAME= + LTLIB[]NAME= + INC[]NAME= + LIB[]NAME[]_PREFIX= + dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been + dnl computed. So it has to be reset here. + HAVE_LIB[]NAME= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='$1 $2' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + dnl See if it was already located by an earlier AC_LIB_LINKFLAGS + dnl or AC_LIB_HAVE_LINKFLAGS call. + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" + else + dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined + dnl that this library doesn't exist. So just drop it. + : + fi + else + dnl Search the library lib$name in $additional_libdir and $LDFLAGS + dnl and the already constructed $LIBNAME/$LTLIBNAME. + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + dnl The same code as in the loop below: + dnl First look for a shared library. + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + dnl Then look for a static library. + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + dnl First look for a shared library. + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + dnl Then look for a static library. + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + dnl Found the library. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + dnl Linking with a shared library. We attempt to hardcode its + dnl directory into the executable's runpath, unless it's the + dnl standard /usr/lib. + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + dnl No hardcoding is needed. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + dnl The hardcoding into $LIBNAME is system dependent. + if test "$acl_hardcode_direct" = yes; then + dnl Using DIR/libNAME.so during linking hardcodes DIR into the + dnl resulting binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + dnl Rely on "-L$found_dir". + dnl But don't add it if it's already contained in the LDFLAGS + dnl or the already constructed $LIBNAME + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH + dnl here, because this doesn't fit in flags passed to the + dnl compiler. So give up. No hardcoding. This affects only + dnl very old systems. + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + dnl Linking with a static library. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" + else + dnl We shouldn't come here, but anyway it's good to have a + dnl fallback. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" + fi + fi + dnl Assume the include files are nearby. + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = '$1'; then + LIB[]NAME[]_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = '$1'; then + LIB[]NAME[]_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + dnl Potentially add $additional_includedir to $INCNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's /usr/local/include and we are using GCC on Linux, + dnl 3. if it's already present in $CPPFLAGS or the already + dnl constructed $INCNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INC[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $INCNAME. + INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + dnl Look for dependencies. + if test -n "$found_la"; then + dnl Read the .la file. It defines the variables + dnl dlname, library_names, old_library, dependency_libs, current, + dnl age, revision, installed, dlopen, dlpreopen, libdir. + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + dnl We use only dependency_libs. + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's /usr/local/lib and we are using GCC on Linux, + dnl 3. if it's already present in $LDFLAGS or the already + dnl constructed $LIBNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LIBNAME. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LTLIBNAME. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + dnl Handle this in the next round. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + dnl Handle this in the next round. Throw away the .la's + dnl directory; it is already contained in a preceding -L + dnl option. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + dnl Most likely an immediate library name. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" + ;; + esac + done + fi + else + dnl Didn't find the library; assume it is in the system directories + dnl known to the linker and runtime loader. (All the system + dnl directories known to the linker should also be known to the + dnl runtime loader, otherwise the system is severely misconfigured.) + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user must + dnl pass all path elements in one option. We can arrange that for a + dnl single library, but not when more than one $LIBNAMEs are used. + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + else + dnl The -rpath options are cumulative. + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + dnl When using libtool, the option that works for both libraries and + dnl executables is -R. The -R options are cumulative. + for found_dir in $ltrpathdirs; do + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" + done + fi + popdef([P_A_C_K]) + popdef([PACKLIBS]) + popdef([PACKUP]) + popdef([PACK]) + popdef([NAME]) +]) + +dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, +dnl unless already present in VAR. +dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes +dnl contains two or three consecutive elements that belong together. +AC_DEFUN([AC_LIB_APPENDTOVAR], +[ + for element in [$2]; do + haveit= + for x in $[$1]; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + [$1]="${[$1]}${[$1]:+ }$element" + fi + done +]) + +dnl For those cases where a variable contains several -L and -l options +dnl referring to unknown libraries and directories, this macro determines the +dnl necessary additional linker options for the runtime path. +dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) +dnl sets LDADDVAR to linker options needed together with LIBSVALUE. +dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, +dnl otherwise linking without libtool is assumed. +AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], +[ + AC_REQUIRE([AC_LIB_RPATH]) + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + $1= + if test "$enable_rpath" != no; then + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode directories into the resulting + dnl binary. + rpathdirs= + next= + for opt in $2; do + if test -n "$next"; then + dir="$next" + dnl No need to hardcode the standard /usr/lib. + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2"; then + rpathdirs="$rpathdirs $dir" + fi + next= + else + case $opt in + -L) next=yes ;; + -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` + dnl No need to hardcode the standard /usr/lib. + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2"; then + rpathdirs="$rpathdirs $dir" + fi + next= ;; + *) next= ;; + esac + fi + done + if test "X$rpathdirs" != "X"; then + if test -n ""$3""; then + dnl libtool is used for linking. Use -R options. + for dir in $rpathdirs; do + $1="${$1}${$1:+ }-R$dir" + done + else + dnl The linker is used for linking directly. + if test -n "$acl_hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user + dnl must pass all path elements in one option. + alldirs= + for dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + $1="$flag" + else + dnl The -rpath options are cumulative. + for dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + $1="${$1}${$1:+ }$flag" + done + fi + fi + fi + fi + fi + AC_SUBST([$1]) +]) diff --git a/rpm-5.4.9/m4/lib-prefix.m4 b/rpm-5.4.9/m4/lib-prefix.m4 new file mode 100644 index 0000000..1601cea --- /dev/null +++ b/rpm-5.4.9/m4/lib-prefix.m4 @@ -0,0 +1,224 @@ +# lib-prefix.m4 serial 7 (gettext-0.18) +dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and +dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't +dnl require excessive bracketing. +ifdef([AC_HELP_STRING], +[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], +[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) + +dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed +dnl to access previously installed libraries. The basic assumption is that +dnl a user will want packages to use other packages he previously installed +dnl with the same --prefix option. +dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate +dnl libraries, but is otherwise very convenient. +AC_DEFUN([AC_LIB_PREFIX], +[ + AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib-prefix], +[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib + --without-lib-prefix don't search for libraries in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi +]) + if test $use_additional = yes; then + dnl Potentially add $additional_includedir to $CPPFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's already present in $CPPFLAGS, + dnl 3. if it's /usr/local/include and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + for x in $CPPFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $CPPFLAGS. + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" + fi + fi + fi + fi + dnl Potentially add $additional_libdir to $LDFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's already present in $LDFLAGS, + dnl 3. if it's /usr/local/lib and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + for x in $LDFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LDFLAGS. + LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" + fi + fi + fi + fi + fi +]) + +dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, +dnl acl_final_exec_prefix, containing the values to which $prefix and +dnl $exec_prefix will expand at the end of the configure script. +AC_DEFUN([AC_LIB_PREPARE_PREFIX], +[ + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" +]) + +dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the +dnl variables prefix and exec_prefix bound to the values they will have +dnl at the end of the configure script. +AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], +[ + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + $1 + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" +]) + +dnl AC_LIB_PREPARE_MULTILIB creates +dnl - a variable acl_libdirstem, containing the basename of the libdir, either +dnl "lib" or "lib64" or "lib/64", +dnl - a variable acl_libdirstem2, as a secondary possible value for +dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or +dnl "lib/amd64". +AC_DEFUN([AC_LIB_PREPARE_MULTILIB], +[ + dnl There is no formal standard regarding lib and lib64. + dnl On glibc systems, the current practice is that on a system supporting + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under + dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine + dnl the compiler's default mode by looking at the compiler's library search + dnl path. If at least one of its elements ends in /lib64 or points to a + dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. + dnl Otherwise we use the default, namely "lib". + dnl On Solaris systems, the current practice is that on a system supporting + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under + dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or + dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. + AC_REQUIRE([AC_CANONICAL_HOST]) + acl_libdirstem=lib + acl_libdirstem2= + case "$host_os" in + solaris*) + dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment + dnl . + dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." + dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the + dnl symlink is missing, so we set acl_libdirstem2 too. + AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], + [AC_EGREP_CPP([sixtyfour bits], [ +#ifdef _LP64 +sixtyfour bits +#endif + ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) + ]) + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; + esac + fi + ;; + *) + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" +]) diff --git a/rpm-5.4.9/m4/libtool.m4 b/rpm-5.4.9/m4/libtool.m4 new file mode 100644 index 0000000..4a3ea43 --- /dev/null +++ b/rpm-5.4.9/m4/libtool.m4 @@ -0,0 +1,7994 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 57 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_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_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + 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\\"\\\`\\\\\\"" + ;; + *) + 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 $lt_write_fail = 0 && 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 "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_REPLACE_SHELLFNS + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [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 $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; 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 "$lt_cv_ld_force_load" = "yes"; 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*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; 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 "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([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 "${lt_cv_aix_libpath+set}" = 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 which will find a shell with a builtin +# printf (which we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --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 "$GCC" = yes; 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 in which 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 "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; 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 + 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" + # 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 x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "$_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 x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + 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; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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"; 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 $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $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 -fvisbility=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 "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$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 "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + 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` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # 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 "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.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}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[23]].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux # 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=no + hardcode_into_libs=yes + ;; + +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=yes + 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 "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # 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 "$lt_cv_prog_gnu_ld" = yes; 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 + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # 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 "$with_gnu_ld" = yes; 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=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # 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 "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [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], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +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 "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) + +file_magic_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 + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + 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 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 "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# 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 "$GCC" = yes; 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 "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con'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* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_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 "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +# 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_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_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 "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + 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 "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + 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 "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + 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' + ;; + 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 which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_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 AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + 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) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + linux* | k*bsd*-gnu) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _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 "$with_gnu_ld" = yes; 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 "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.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 (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + 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 + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $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' ;; + 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 "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | 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 "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $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 "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + 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) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + _LT_TAGVAR(link_all_deplibs, $1)=no + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$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 "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$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 "$with_gnu_ld" = yes; 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 + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; 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 $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; 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 "$with_gnu_ld" = no; 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 "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $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 "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $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 "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && 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 "$GCC" = yes; 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 "$GCC" = yes; 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 "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_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 which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_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 "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +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 "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_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 "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC $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 "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + _LT_TAGVAR(link_all_deplibs, $1)=no + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$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 "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$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 "$with_gnu_ld" = yes; 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 + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $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 (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + gnu*) + ;; + + 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 $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; 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 $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $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 "$GXX" = yes; then + if test "$with_gnu_ld" = no; 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) + 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 "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; 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 + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=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 "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && 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 "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -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 $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -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 can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(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 "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + 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 "$_lt_caught_CXX_error" != yes + +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 ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; 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 $p = "-L" || + test $p = "-R"; 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 "$pre_test_object_deps_done" = no; 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 "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +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)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_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 "X$F77" = "Xno"; 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 "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + 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 "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" +fi # test "$_lt_disable_F77" != yes + +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 "X$FC" = "Xno"; 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 "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + 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 "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# 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]) + +ac_compile='$CC -c $GCJFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD' +ac_link='$CC -o conftest$ac_exeext --main=conftest $GCJFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD' + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# 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 "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) + + +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) + + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) + + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) + + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi + +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) + + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which 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/rpm-5.4.9/m4/ltoptions.m4 b/rpm-5.4.9/m4/ltoptions.m4 new file mode 100644 index 0000000..5d9acd8 --- /dev/null +++ b/rpm-5.4.9/m4/ltoptions.m4 @@ -0,0 +1,384 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008, 2009 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 7 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## 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_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=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## 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/rpm-5.4.9/m4/ltsugar.m4 b/rpm-5.4.9/m4/ltsugar.m4 new file mode 100644 index 0000000..9000a05 --- /dev/null +++ b/rpm-5.4.9/m4/ltsugar.m4 @@ -0,0 +1,123 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) diff --git a/rpm-5.4.9/m4/ltversion.m4 b/rpm-5.4.9/m4/ltversion.m4 new file mode 100644 index 0000000..07a8602 --- /dev/null +++ b/rpm-5.4.9/m4/ltversion.m4 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# @configure_input@ + +# serial 3337 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.2' +macro_revision='1.3337' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff --git a/rpm-5.4.9/m4/lt~obsolete.m4 b/rpm-5.4.9/m4/lt~obsolete.m4 new file mode 100644 index 0000000..c573da9 --- /dev/null +++ b/rpm-5.4.9/m4/lt~obsolete.m4 @@ -0,0 +1,98 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2009 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/rpm-5.4.9/m4/nls.m4 b/rpm-5.4.9/m4/nls.m4 new file mode 100644 index 0000000..003704c --- /dev/null +++ b/rpm-5.4.9/m4/nls.m4 @@ -0,0 +1,32 @@ +# nls.m4 serial 5 (gettext-0.18) +dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation, +dnl Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995-2000. +dnl Bruno Haible , 2000-2003. + +AC_PREREQ([2.50]) + +AC_DEFUN([AM_NLS], +[ + AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE([nls], + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT([$USE_NLS]) + AC_SUBST([USE_NLS]) +]) diff --git a/rpm-5.4.9/m4/po.m4 b/rpm-5.4.9/m4/po.m4 new file mode 100644 index 0000000..47f36a4 --- /dev/null +++ b/rpm-5.4.9/m4/po.m4 @@ -0,0 +1,449 @@ +# po.m4 serial 17 (gettext-0.18) +dnl Copyright (C) 1995-2010 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995-2000. +dnl Bruno Haible , 2000-2003. + +AC_PREREQ([2.50]) + +dnl Checks for all prerequisites of the po subdirectory. +AC_DEFUN([AM_PO_SUBDIRS], +[ + AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl + AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake + AC_REQUIRE([AM_NLS])dnl + + dnl Release version of the gettext macros. This is used to ensure that + dnl the gettext macros and po/Makefile.in.in are in sync. + AC_SUBST([GETTEXT_MACRO_VERSION], [0.18]) + + dnl Perform the following tests also if --disable-nls has been given, + dnl because they are needed for "make dist" to work. + + dnl Search for GNU msgfmt in the PATH. + dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. + dnl The second test excludes FreeBSD msgfmt. + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) + + dnl Test whether it is GNU msgfmt >= 0.15. +changequote(,)dnl + case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; + *) MSGFMT_015=$MSGFMT ;; + esac +changequote([,])dnl + AC_SUBST([MSGFMT_015]) +changequote(,)dnl + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; + *) GMSGFMT_015=$GMSGFMT ;; + esac +changequote([,])dnl + AC_SUBST([GMSGFMT_015]) + + dnl Search for GNU xgettext 0.12 or newer in the PATH. + dnl The first test excludes Solaris xgettext and early GNU xgettext versions. + dnl The second test excludes FreeBSD xgettext. + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + dnl Remove leftover from FreeBSD xgettext call. + rm -f messages.po + + dnl Test whether it is GNU xgettext >= 0.15. +changequote(,)dnl + case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; + *) XGETTEXT_015=$XGETTEXT ;; + esac +changequote([,])dnl + AC_SUBST([XGETTEXT_015]) + + dnl Search for GNU msgmerge 0.11 or newer in the PATH. + AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, + [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) + + dnl Installation directories. + dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we + dnl have to define it here, so that it can be used in po/Makefile. + test -n "$localedir" || localedir='${datadir}/locale' + AC_SUBST([localedir]) + + dnl Support for AM_XGETTEXT_OPTION. + test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= + AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) + + AC_CONFIG_COMMANDS([po-directories], [[ + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + # Treat a directory as a PO directory if and only if it has a + # POTFILES.in file. This allows packages to have multiple PO + # directories under different names or in different locations. + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + # Hide the ALL_LINGUAS assigment from automake < 1.5. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done]], + [# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it + # from automake < 1.5. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + ]) +]) + +dnl Postprocesses a Makefile in a directory containing PO files. +AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], +[ + # When this code is run, in config.status, two variables have already been + # set: + # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, + # - LINGUAS is the value of the environment variable LINGUAS at configure + # time. + +changequote(,)dnl + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + # Find a way to echo strings without interpreting backslash. + if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then + gt_echo='echo' + else + if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then + gt_echo='printf %s\n' + else + echo_func () { + cat < "$ac_file.tmp" + if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then + # Add dependencies that cannot be formulated as a simple suffix rule. + for lang in $ALL_LINGUAS; do + frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` + cat >> "$ac_file.tmp" < /dev/null; then + # Add dependencies that cannot be formulated as a simple suffix rule. + for lang in $ALL_LINGUAS; do + frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` + cat >> "$ac_file.tmp" <> "$ac_file.tmp" <, 1996. + +AC_PREREQ([2.50]) + +# Search path for a program which passes the given test. + +dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN([AM_PATH_PROG_WITH_TEST], +[ +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL([ac_cv_path_$1], +[case "[$]$1" in + [[\\/]]* | ?:[[\\/]]*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in ifelse([$5], , $PATH, [$5]); do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then + AC_MSG_RESULT([$][$1]) +else + AC_MSG_RESULT([no]) +fi +AC_SUBST([$1])dnl +]) diff --git a/rpm-5.4.9/macros/.cvsignore b/rpm-5.4.9/macros/.cvsignore new file mode 100644 index 0000000..54b0fb2 --- /dev/null +++ b/rpm-5.4.9/macros/.cvsignore @@ -0,0 +1,18 @@ +cmake +fedora +gstreamer +java +kernel +libtool +macros +macros.rpmbuild +mandriva +mono +perl +php +pkgconfig +python +ruby +selinux +suse +tcl diff --git a/rpm-5.4.9/macros/cmake b/rpm-5.4.9/macros/cmake new file mode 100644 index 0000000..4391080 --- /dev/null +++ b/rpm-5.4.9/macros/cmake @@ -0,0 +1,28 @@ +# Ruby specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/cmake} + +%__cmake %{_bindir}/cmake + +%_cmake_lib_suffix64 -DLIB_SUFFIX=64 +%_cmake_skip_rpath -DCMAKE_SKIP_RPATH:BOOL=ON +%_cmake_verbose -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON +%_cmake_version %(%{__cmake} --version|sed -e 's#.* \(\S*\)$#\1#g') + +%cmake \ + CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \ + CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \ + FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \ + %{__cmake} \\\ + %{_cmake_skip_rpath} \\\ + %{_cmake_verbose} \\\ + -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\ + -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \\\ + -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\ + -DLIB_INSTALL_DIR:PATH=%{_libdir} \\\ + -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\ + -DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\ +%if "%{?_lib}" == "lib64" \ + %{?_cmake_lib_suffix64} \\\ +%endif \ + -DBUILD_SHARED_LIBS:BOOL=ON diff --git a/rpm-5.4.9/macros/cmake.in b/rpm-5.4.9/macros/cmake.in new file mode 100644 index 0000000..c0eb3af --- /dev/null +++ b/rpm-5.4.9/macros/cmake.in @@ -0,0 +1,28 @@ +# Ruby specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/cmake} + +%__cmake @__CMAKE@ + +%_cmake_lib_suffix64 -DLIB_SUFFIX=64 +%_cmake_skip_rpath -DCMAKE_SKIP_RPATH:BOOL=ON +%_cmake_verbose -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON +%_cmake_version %(%{__cmake} --version|sed -e 's#.* \(\S*\)$#\1#g') + +%cmake \ + CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \ + CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \ + FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \ + %{__cmake} \\\ + %{_cmake_skip_rpath} \\\ + %{_cmake_verbose} \\\ + -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\ + -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \\\ + -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\ + -DLIB_INSTALL_DIR:PATH=%{_libdir} \\\ + -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\ + -DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\ +%if "%{?_lib}" == "lib64" \ + %{?_cmake_lib_suffix64} \\\ +%endif \ + -DBUILD_SHARED_LIBS:BOOL=ON diff --git a/rpm-5.4.9/macros/fedora b/rpm-5.4.9/macros/fedora new file mode 100644 index 0000000..8b96d22 --- /dev/null +++ b/rpm-5.4.9/macros/fedora @@ -0,0 +1,291 @@ +%distribution mandriva Linux +%vendor mandriva +%bugurl http://bugzilla.redhat.com +%disturl http://software.openmandriva.org +# +# Below are the fedora/redhat macros +# contained in redhat-rpm-config +# +# Per-platform rpm configuration file. + +#============================================================================== +# ---- per-platform macros. +# +%_vendor mandriva +%_os linux +%_target_platform %{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu} + +#============================================================================== +# ---- configure macros. note that most of these are inherited +# from the defaults. +# +%_prefix /usr +%_sysconfdir /etc +%_localstatedir /var +%_infodir /usr/share/info +%_mandir /usr/share/man + +%_defaultdocdir %{_usr}/share/doc + +%_fmoddir %{_libdir}/gfortran/modules + +%_enable_debug_packages 1 + +#============================================================================== +# ---- configure and makeinstall. +# +%_configure ./configure +%configure \ + CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \ + CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \ + FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \ + %{_configure} --build=%{_build} --host=%{_host} \\\ + --program-prefix=%{?_program_prefix} \\\ + --disable-dependency-tracking \\\ + --prefix=%{_prefix} \\\ + --exec-prefix=%{_exec_prefix} \\\ + --bindir=%{_bindir} \\\ + --sbindir=%{_sbindir} \\\ + --sysconfdir=%{_sysconfdir} \\\ + --datadir=%{_datadir} \\\ + --includedir=%{_includedir} \\\ + --libdir=%{_libdir} \\\ + --libexecdir=%{_libexecdir} \\\ + --localstatedir=%{_localstatedir} \\\ + --sharedstatedir=%{_sharedstatedir} \\\ + --mandir=%{_mandir} \\\ + --infodir=%{_infodir} + +%makeinstall \ + %{__make} \\\ + prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\ + exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\ + bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\ + sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\ + sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\ + datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\ + includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\ + libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\ + libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\ + localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\ + sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\ + mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\ + infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\ + install + +%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\ + && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\ + if [ "$RPM_BUILD_NCPUS" -gt 16 ]; then echo "-j16"; \\\ + elif [ "$RPM_BUILD_NCPUS" -gt 1 ]; then echo "-j$RPM_BUILD_NCPUS"; fi) + +#============================================================================== +# ---- Build policy macros. +# +# +#--------------------------------------------------------------------- +# Expanded at beginning of %install scriptlet. +# + +%__spec_install_pre %{___build_pre}\ + [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "${RPM_BUILD_ROOT}"\ + mkdir -p `dirname "$RPM_BUILD_ROOT"`\ + mkdir "$RPM_BUILD_ROOT"\ +%{nil} + +#--------------------------------------------------------------------- +# Expanded at end of %install scriptlet. +# + +%__arch_install_post /usr/lib/rpm/check-buildroot + +%__os_install_post \ + /usr/lib/rpm/redhat/brp-compress \ + %{!?__debug_package:\ + /usr/lib/rpm/redhat/brp-strip %{__strip} \ + /usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \ + } \ + /usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} \ + /usr/lib/rpm/brp-python-bytecompile %{__python} %{?_python_bytecompile_errors_terminate_build} \ + /usr/lib/rpm/redhat/brp-python-hardlink \ + %{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars} \ +%{nil} + +# /usr/lib/rpm/redhat/brp-implant-ident-static + +%__spec_install_post\ + %{?__debug_package:%{__debug_install_post}}\ + %{__arch_install_post}\ + %{__os_install_post}\ +%{nil} + + +# Template for debug information sub-package. +# NOTE: This is a copy from rpm to get the ifnarch noarch fix, it can be removed later +%debug_package \ +%ifnarch noarch\ +%global __debug_package 1\ +%package debuginfo \ +Summary: Debug information for package %{name}\ +Group: Development/Debug\ +AutoReqProv: 0\ +%description debuginfo\ +This package provides debug information for package %{name}.\ +Debug information is useful when developing applications that use this\ +package or when debugging this package.\ +%files debuginfo -f debugfiles.list\ +%defattr(-,root,root)\ +%endif\ +%{nil} + +# Bad hack to set $LANG to C during all RPM builds +%prep \ +%%prep\ +LANG=C\ +export LANG\ +unset DISPLAY\ +%{nil} + +%build %%build\ +LANG=C\ +export LANG\ +unset DISPLAY\ +%{nil} + +%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\ +%%install\ +LANG=C\ +export LANG\ +unset DISPLAY\ +%{nil} + +%check %%check\ +unset DISPLAY\ +%{nil} + +# +# use internal dep generator? +%_use_internal_dependency_generator 1 + +# +# Should missing %doc files terminate a build? +%_missing_doc_files_terminate_build 1 +# +# Should missing buildids terminate a build? +%_missing_build_ids_terminate_build 1 + +# +# Should unpackaged files in a build root terminate a build? +%_unpackaged_files_terminate_build 1 + +# +## Should python bytecompilation errors terminate a build? +%_python_bytecompile_errors_terminate_build 1 + +# Use SHA-256 for FILEDIGESTS instead of default MD5 +%_source_filedigest_algorithm 8 +%_binary_filedigest_algorithm 8 + +# Use XZ compression for binary payloads +%_binary_payload w2.xzdio + +%__find_provides /usr/lib/rpm/redhat/find-provides +%__find_requires /usr/lib/rpm/redhat/find-requires + +%__global_cflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 + +# Use these macros to differentiate between RH and other KMP implementation(s). +redhat_kernel_module_package 1 +kernel_module_package_release 1 + +#kernel_module_package [ -n name ] [ -v version ] [ -r release ] [ -s script ] +# [ -f filelist] [ -x ] [ -p preamble ] flavor flavor ... + +%kernel_module_package_buildreqs %global kmodtool_generate_buildreqs 1 \ + kernel-devel + +%kernel_module_package(n:v:r:s:f:xp:) %{expand:%( \ + %define kmodtool %{-s*}%{!-s:/usr/lib/rpm/redhat/kmodtool} \ + %define kmp_version %{-v*}%{!-v:%{version}} \ + %define kmp_release %{-r*}%{!-r:%{release}} \ + %define latest_kernel %(rpm -q --qf '%{VERSION}-%{RELEASE}\\\\n' `rpm -q kernel-devel | /usr/lib/rpm/redhat/rpmsort -r | head -n 1` | head -n 1) \ + %{!?kernel_version:%{expand:%%global kernel_version %{latest_kernel}}} \ + %global kverrel %(%{kmodtool} verrel %{?kernel_version} 2>/dev/null) \ + flavors="default" \ + if [ "i686" == "%{_target_cpu}" ] || [ "x86_64" == "%{_target_cpu}" ] \ + then \ + xenver=$(rpm -q kernel-xen-devel-%{kverrel}|head -n 1)\ + kdver=$(rpm -q kernel-kdump-devel-%{kverrel}|head -n 1)\ + if [ "kernel-xen-devel-%{kverrel}" == "$xenver" ] \ + then \ + flavors="$flavors xen" \ + fi \ + if [ "kernel-kdump-devel-%{kverrel}" == "$kdver" ] \ + then \ + flavors="$flavors kdump" \ + fi \ + fi \ + if [ -z "%*" ]; then \ + flavors_to_build=$flavors \ + elif [ -z "%{-x}" ]; then \ + flavors_to_build="%*" \ + else \ + flavors_to_build=" $flavors "\ + echo "[$flavors_to_build]" >/tmp/tmp.txt + for i in %* \ + do \ + flavors_to_build=${flavors_to_build//$i /} + done \ + fi \ + echo "%%global flavors_to_build ${flavors_to_build:-%%nil}" \ + echo "%%global kernel_source() /usr/src/kernels/%kverrel-\\\$([ %%%%{1} = default ] || echo "%%%%{1}-")%_target_cpu" \ + if [ ! -z "%{-f*}" ] \ + then \ + filelist="%{-f*}" \ + fi \ + if [ ! -z "%{-p*}" ] \ + then \ + preamble="%{-p*}" \ + fi \ + if [ -z "%{kmodtool_generate_buildreqs}" ] \ + then \ + nobuildreqs="yes" \ + fi \ + kmp_override_filelist="$filelist" kmp_override_preamble="$preamble" kmp_nobuildreqs="$buildreqs" %{kmodtool} rpmtemplate_kmp %{-n*}%{!-n:%name} %{kverrel} $flavors_to_build 2>/dev/null \ +)} + +#============================================================================== +# ---- Generic auto req/prov filtering macros +# +# http://fedoraproject.org/wiki/PackagingDrafts/AutoProvidesAndRequiresFiltering + +# prevent anything matching from being scanned for provides +%filter_provides_in(P) %{expand: \ +%global __filter_prov_cmd %{?__filter_prov_cmd} %{__grep} -v %{-P} '%*' | \ +} + +# prevent anything matching from being scanned for requires +%filter_requires_in(P) %{expand: \ +%global __filter_req_cmd %{?__filter_req_cmd} %{__grep} -v %{-P} '%*' | \ +} + +# filter anything matching out of the provides stream +%filter_from_provides() %{expand: \ +%global __filter_from_prov %{?__filter_from_prov} | %{__sed} -e '%*' \ +} + +# filter anything matching out of the requires stream +%filter_from_requires() %{expand: \ +%global __filter_from_req %{?__filter_from_req} | %{__sed} -e '%*' \ +} + +# actually set up the filtering bits +%filter_setup %{expand: \ +%global _use_internal_dependency_generator 0 \ +%global __deploop() while read FILE; do /usr/lib/rpm/rpmdeps -%{1} ${FILE}; done | /bin/sort -u \ +%global __find_provides /bin/sh -c "%{?__filter_prov_cmd} %{__deploop P} %{?__filter_from_prov}" \ +%global __find_requires /bin/sh -c "%{?__filter_req_cmd} %{__deploop R} %{?__filter_from_req}" \ +} +# +# rpm5 prolog for loading the standard macro +%{load:/etc/rpm/macros.d/*.macros} + diff --git a/rpm-5.4.9/macros/fedora.in b/rpm-5.4.9/macros/fedora.in new file mode 100644 index 0000000..3377f09 --- /dev/null +++ b/rpm-5.4.9/macros/fedora.in @@ -0,0 +1,291 @@ +%distribution @RPMCANONVENDOR@ Linux +%vendor @RPMCANONVENDOR@ +%bugurl http://bugzilla.redhat.com +%disturl http://software.open@RPMCANONVENDOR@.org +# +# Below are the fedora/redhat macros +# contained in redhat-rpm-config +# +# Per-platform rpm configuration file. + +#============================================================================== +# ---- per-platform macros. +# +%_vendor @RPMCANONVENDOR@ +%_os linux +%_target_platform %{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu} + +#============================================================================== +# ---- configure macros. note that most of these are inherited +# from the defaults. +# +%_prefix /usr +%_sysconfdir /etc +%_localstatedir /var +%_infodir /usr/share/info +%_mandir /usr/share/man + +%_defaultdocdir %{_usr}/share/doc + +%_fmoddir %{_libdir}/gfortran/modules + +%_enable_debug_packages 1 + +#============================================================================== +# ---- configure and makeinstall. +# +%_configure ./configure +%configure \ + CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \ + CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \ + FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \ + %{_configure} --build=%{_build} --host=%{_host} \\\ + --program-prefix=%{?_program_prefix} \\\ + --disable-dependency-tracking \\\ + --prefix=%{_prefix} \\\ + --exec-prefix=%{_exec_prefix} \\\ + --bindir=%{_bindir} \\\ + --sbindir=%{_sbindir} \\\ + --sysconfdir=%{_sysconfdir} \\\ + --datadir=%{_datadir} \\\ + --includedir=%{_includedir} \\\ + --libdir=%{_libdir} \\\ + --libexecdir=%{_libexecdir} \\\ + --localstatedir=%{_localstatedir} \\\ + --sharedstatedir=%{_sharedstatedir} \\\ + --mandir=%{_mandir} \\\ + --infodir=%{_infodir} + +%makeinstall \ + %{__make} \\\ + prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\ + exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\ + bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\ + sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\ + sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\ + datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\ + includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\ + libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\ + libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\ + localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\ + sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\ + mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\ + infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\ + install + +%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\ + && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\ + if [ "$RPM_BUILD_NCPUS" -gt 16 ]; then echo "-j16"; \\\ + elif [ "$RPM_BUILD_NCPUS" -gt 1 ]; then echo "-j$RPM_BUILD_NCPUS"; fi) + +#============================================================================== +# ---- Build policy macros. +# +# +#--------------------------------------------------------------------- +# Expanded at beginning of %install scriptlet. +# + +%__spec_install_pre %{___build_pre}\ + [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "${RPM_BUILD_ROOT}"\ + mkdir -p `dirname "$RPM_BUILD_ROOT"`\ + mkdir "$RPM_BUILD_ROOT"\ +%{nil} + +#--------------------------------------------------------------------- +# Expanded at end of %install scriptlet. +# + +%__arch_install_post /usr/lib/rpm/check-buildroot + +%__os_install_post \ + /usr/lib/rpm/redhat/brp-compress \ + %{!?__debug_package:\ + /usr/lib/rpm/redhat/brp-strip %{__strip} \ + /usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \ + } \ + /usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} \ + /usr/lib/rpm/brp-python-bytecompile %{__python} %{?_python_bytecompile_errors_terminate_build} \ + /usr/lib/rpm/redhat/brp-python-hardlink \ + %{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars} \ +%{nil} + +# /usr/lib/rpm/redhat/brp-implant-ident-static + +%__spec_install_post\ + %{?__debug_package:%{__debug_install_post}}\ + %{__arch_install_post}\ + %{__os_install_post}\ +%{nil} + + +# Template for debug information sub-package. +# NOTE: This is a copy from rpm to get the ifnarch noarch fix, it can be removed later +%debug_package \ +%ifnarch noarch\ +%global __debug_package 1\ +%package debuginfo \ +Summary: Debug information for package %{name}\ +Group: Development/Debug\ +AutoReqProv: 0\ +%description debuginfo\ +This package provides debug information for package %{name}.\ +Debug information is useful when developing applications that use this\ +package or when debugging this package.\ +%files debuginfo -f debugfiles.list\ +%defattr(-,root,root)\ +%endif\ +%{nil} + +# Bad hack to set $LANG to C during all RPM builds +%prep \ +%%prep\ +LANG=C\ +export LANG\ +unset DISPLAY\ +%{nil} + +%build %%build\ +LANG=C\ +export LANG\ +unset DISPLAY\ +%{nil} + +%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\ +%%install\ +LANG=C\ +export LANG\ +unset DISPLAY\ +%{nil} + +%check %%check\ +unset DISPLAY\ +%{nil} + +# +# use internal dep generator? +%_use_internal_dependency_generator 1 + +# +# Should missing %doc files terminate a build? +%_missing_doc_files_terminate_build 1 +# +# Should missing buildids terminate a build? +%_missing_build_ids_terminate_build 1 + +# +# Should unpackaged files in a build root terminate a build? +%_unpackaged_files_terminate_build 1 + +# +## Should python bytecompilation errors terminate a build? +%_python_bytecompile_errors_terminate_build 1 + +# Use SHA-256 for FILEDIGESTS instead of default MD5 +%_source_filedigest_algorithm 8 +%_binary_filedigest_algorithm 8 + +# Use XZ compression for binary payloads +%_binary_payload w2.xzdio + +%__find_provides /usr/lib/rpm/redhat/find-provides +%__find_requires /usr/lib/rpm/redhat/find-requires + +%__global_cflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 + +# Use these macros to differentiate between RH and other KMP implementation(s). +redhat_kernel_module_package 1 +kernel_module_package_release 1 + +#kernel_module_package [ -n name ] [ -v version ] [ -r release ] [ -s script ] +# [ -f filelist] [ -x ] [ -p preamble ] flavor flavor ... + +%kernel_module_package_buildreqs %global kmodtool_generate_buildreqs 1 \ + kernel-devel + +%kernel_module_package(n:v:r:s:f:xp:) %{expand:%( \ + %define kmodtool %{-s*}%{!-s:/usr/lib/rpm/redhat/kmodtool} \ + %define kmp_version %{-v*}%{!-v:%{version}} \ + %define kmp_release %{-r*}%{!-r:%{release}} \ + %define latest_kernel %(rpm -q --qf '%{VERSION}-%{RELEASE}\\\\n' `rpm -q kernel-devel | /usr/lib/rpm/redhat/rpmsort -r | head -n 1` | head -n 1) \ + %{!?kernel_version:%{expand:%%global kernel_version %{latest_kernel}}} \ + %global kverrel %(%{kmodtool} verrel %{?kernel_version} 2>/dev/null) \ + flavors="default" \ + if [ "i686" == "%{_target_cpu}" ] || [ "x86_64" == "%{_target_cpu}" ] \ + then \ + xenver=$(rpm -q kernel-xen-devel-%{kverrel}|head -n 1)\ + kdver=$(rpm -q kernel-kdump-devel-%{kverrel}|head -n 1)\ + if [ "kernel-xen-devel-%{kverrel}" == "$xenver" ] \ + then \ + flavors="$flavors xen" \ + fi \ + if [ "kernel-kdump-devel-%{kverrel}" == "$kdver" ] \ + then \ + flavors="$flavors kdump" \ + fi \ + fi \ + if [ -z "%*" ]; then \ + flavors_to_build=$flavors \ + elif [ -z "%{-x}" ]; then \ + flavors_to_build="%*" \ + else \ + flavors_to_build=" $flavors "\ + echo "[$flavors_to_build]" >/tmp/tmp.txt + for i in %* \ + do \ + flavors_to_build=${flavors_to_build//$i /} + done \ + fi \ + echo "%%global flavors_to_build ${flavors_to_build:-%%nil}" \ + echo "%%global kernel_source() /usr/src/kernels/%kverrel-\\\$([ %%%%{1} = default ] || echo "%%%%{1}-")%_target_cpu" \ + if [ ! -z "%{-f*}" ] \ + then \ + filelist="%{-f*}" \ + fi \ + if [ ! -z "%{-p*}" ] \ + then \ + preamble="%{-p*}" \ + fi \ + if [ -z "%{kmodtool_generate_buildreqs}" ] \ + then \ + nobuildreqs="yes" \ + fi \ + kmp_override_filelist="$filelist" kmp_override_preamble="$preamble" kmp_nobuildreqs="$buildreqs" %{kmodtool} rpmtemplate_kmp %{-n*}%{!-n:%name} %{kverrel} $flavors_to_build 2>/dev/null \ +)} + +#============================================================================== +# ---- Generic auto req/prov filtering macros +# +# http://fedoraproject.org/wiki/PackagingDrafts/AutoProvidesAndRequiresFiltering + +# prevent anything matching from being scanned for provides +%filter_provides_in(P) %{expand: \ +%global __filter_prov_cmd %{?__filter_prov_cmd} %{__grep} -v %{-P} '%*' | \ +} + +# prevent anything matching from being scanned for requires +%filter_requires_in(P) %{expand: \ +%global __filter_req_cmd %{?__filter_req_cmd} %{__grep} -v %{-P} '%*' | \ +} + +# filter anything matching out of the provides stream +%filter_from_provides() %{expand: \ +%global __filter_from_prov %{?__filter_from_prov} | %{__sed} -e '%*' \ +} + +# filter anything matching out of the requires stream +%filter_from_requires() %{expand: \ +%global __filter_from_req %{?__filter_from_req} | %{__sed} -e '%*' \ +} + +# actually set up the filtering bits +%filter_setup %{expand: \ +%global _use_internal_dependency_generator 0 \ +%global __deploop() while read FILE; do /usr/lib/rpm/rpmdeps -%{1} ${FILE}; done | /bin/sort -u \ +%global __find_provides /bin/sh -c "%{?__filter_prov_cmd} %{__deploop P} %{?__filter_from_prov}" \ +%global __find_requires /bin/sh -c "%{?__filter_req_cmd} %{__deploop R} %{?__filter_from_req}" \ +} +# +# rpm5 prolog for loading the standard macro +%{load:/etc/rpm/macros.d/*.macros} + diff --git a/rpm-5.4.9/macros/gstreamer b/rpm-5.4.9/macros/gstreamer new file mode 100644 index 0000000..cb2be19 --- /dev/null +++ b/rpm-5.4.9/macros/gstreamer @@ -0,0 +1,12 @@ +# Gstreamer specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/gstreamer} + +%__gst_inspect @__GST_INSPECT + +# Path to scripts to autogenerate gstreamer package dependencies, +# +# Note: Used if _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +%__gstreamer_provides %{_rpmhome}/gstreamer.sh --provides --gst-inspect %__gst_inspect +#%__gstreamer_requires %{_rpmhome}/gstreamer.sh --requires diff --git a/rpm-5.4.9/macros/gstreamer.in b/rpm-5.4.9/macros/gstreamer.in new file mode 100644 index 0000000..cb2be19 --- /dev/null +++ b/rpm-5.4.9/macros/gstreamer.in @@ -0,0 +1,12 @@ +# Gstreamer specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/gstreamer} + +%__gst_inspect @__GST_INSPECT + +# Path to scripts to autogenerate gstreamer package dependencies, +# +# Note: Used if _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +%__gstreamer_provides %{_rpmhome}/gstreamer.sh --provides --gst-inspect %__gst_inspect +#%__gstreamer_requires %{_rpmhome}/gstreamer.sh --requires diff --git a/rpm-5.4.9/macros/java b/rpm-5.4.9/macros/java new file mode 100644 index 0000000..89be8e2 --- /dev/null +++ b/rpm-5.4.9/macros/java @@ -0,0 +1,20 @@ +# Java specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/java} + +# Path to scripts to autogenerate java package dependencies, +# +# Note: Used iff _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +%__java_provides %{_rpmhome}/javadeps.sh --provides +%__java_requires %{_rpmhome}/javadeps.sh --requires + +# The value of CLASSPATH in build scriptlets (iff configured). +# +#%_javaclasspath all + +# Import packaging conventions from jpackage.org (prefixed with _ +# to avoid name collisions). +# +%_javadir %{_datadir}/java +%_javadocdir %{_datadir}/javadoc diff --git a/rpm-5.4.9/macros/java.in b/rpm-5.4.9/macros/java.in new file mode 100644 index 0000000..89be8e2 --- /dev/null +++ b/rpm-5.4.9/macros/java.in @@ -0,0 +1,20 @@ +# Java specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/java} + +# Path to scripts to autogenerate java package dependencies, +# +# Note: Used iff _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +%__java_provides %{_rpmhome}/javadeps.sh --provides +%__java_requires %{_rpmhome}/javadeps.sh --requires + +# The value of CLASSPATH in build scriptlets (iff configured). +# +#%_javaclasspath all + +# Import packaging conventions from jpackage.org (prefixed with _ +# to avoid name collisions). +# +%_javadir %{_datadir}/java +%_javadocdir %{_datadir}/javadoc diff --git a/rpm-5.4.9/macros/kernel b/rpm-5.4.9/macros/kernel new file mode 100644 index 0000000..b21cd95 --- /dev/null +++ b/rpm-5.4.9/macros/kernel @@ -0,0 +1,12 @@ +# Kernel specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/kernel} + +%__modinfo @__MODINFO + +# Path to scripts to autogenerate gstreamer package dependencies, +# +# Note: Used if _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +%__kernel_provides %{_rpmhome}/kmod-deps.sh --provides --modinfo %__modinfo +#%__kernel_requires %{_rpmhome}/kmod-deps.sh --requires --modinfo %__modinfo diff --git a/rpm-5.4.9/macros/kernel.in b/rpm-5.4.9/macros/kernel.in new file mode 100644 index 0000000..b21cd95 --- /dev/null +++ b/rpm-5.4.9/macros/kernel.in @@ -0,0 +1,12 @@ +# Kernel specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/kernel} + +%__modinfo @__MODINFO + +# Path to scripts to autogenerate gstreamer package dependencies, +# +# Note: Used if _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +%__kernel_provides %{_rpmhome}/kmod-deps.sh --provides --modinfo %__modinfo +#%__kernel_requires %{_rpmhome}/kmod-deps.sh --requires --modinfo %__modinfo diff --git a/rpm-5.4.9/macros/libtool b/rpm-5.4.9/macros/libtool new file mode 100644 index 0000000..5438930 --- /dev/null +++ b/rpm-5.4.9/macros/libtool @@ -0,0 +1,10 @@ +# Libtool specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/libtool} + +# Path to scripts to autogenerate libtool package dependencies, +# +# Note: Used iff _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +%__libtool_provides %{_rpmhome}/libtooldeps.sh --provides %{buildroot} %{name} +%__libtool_requires %{_rpmhome}/libtooldeps.sh --requires %{buildroot} %{name} diff --git a/rpm-5.4.9/macros/libtool.in b/rpm-5.4.9/macros/libtool.in new file mode 100644 index 0000000..5438930 --- /dev/null +++ b/rpm-5.4.9/macros/libtool.in @@ -0,0 +1,10 @@ +# Libtool specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/libtool} + +# Path to scripts to autogenerate libtool package dependencies, +# +# Note: Used iff _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +%__libtool_provides %{_rpmhome}/libtooldeps.sh --provides %{buildroot} %{name} +%__libtool_requires %{_rpmhome}/libtooldeps.sh --requires %{buildroot} %{name} diff --git a/rpm-5.4.9/macros/macros b/rpm-5.4.9/macros/macros new file mode 100644 index 0000000..7af18cf --- /dev/null +++ b/rpm-5.4.9/macros/macros @@ -0,0 +1,1055 @@ +#/*! \page config_macros Default configuration: /usr/lib/rpm/macros +# \verbatim +# +# $Id: macros.in,v 1.39.2.32 2012/05/06 22:36:51 jbj Exp $ +# +# This is a global RPM configuration file. All changes made here will +# be lost when the rpm package is upgraded. Any per-system configuration +# should be added to %{_etcrpm}/macros, while per-user configuration should +# be added to ~/.rpmmacros. +# +#============================================================================== +# Macro naming conventions: +# +# Macros that begin with an underscore are "local" in the sense that +# they (if used) will not be exported in rpm headers. Some macros +# that don't start with an underscore (but look like they should) +# are compatible with macros generated by rpm-2.5.x and will be made +# more consistent in a future release. +# +%_rpmversion 5.4.9 + +#============================================================================== +# ---- A macro that expands to nothing. +# +%nil %{!?nil} + +#============================================================================== +# ---- filesystem macros. +# +%_usr /usr +%_usrsrc %{_usr}/src +%_var /var +%_usrlibrpm /usr/lib/rpm +%_etcrpm /etc/rpm + +%__objext o +%__libext a +%__shlibext so +%__exeext %{nil} + +%_rpmhome %{_usrlibrpm} + +#============================================================================== +# ---- RPM specific tool paths +# +%_usrlibrpmbin %{_usrlibrpm}/bin +%__chroot %{_usrlibrpmbin}/chroot +%__cp %{_usrlibrpmbin}/cp +%__find %{_usrlibrpmbin}/find +%__grep %{_usrlibrpmbin}/grep +%__lua %{_usrlibrpmbin}/lua +%__mtree %{_usrlibrpmbin}/mtree +%__rc %{_usrlibrpmbin}/rc +%__wget %{_usrlibrpmbin}/wget +%__xar %{_usrlibrpmbin}/xar + +#============================================================================== +# ---- Generally useful path macros. +# +%__awk gawk +%__bash /bin/bash +%__bzip2 /usr/bin/bzip2 +%__cat /bin/cat +%__chattr /usr/bin/chattr +%__chgrp /bin/chgrp +%__chmod /bin/chmod +%__chown /bin/chown +%__cpio /bin/cpio +%__curl /usr/bin/curl +%__cvs /usr/bin/cvs +%__db_archive /usr/bin/db53_archive +%__db_checkpoint /usr/bin/db53_checkpoint +%__db_deadlock /usr/bin/db53_deadlock +%__db_dump /usr/bin/db53_dump +%__db_hotbackup /usr/bin/db53_hotbackup +%__db_load /usr/bin/db53_load +%__db_log_verify /usr/bin/db53_log_verify +%__db_printlog /usr/bin/db53_printlog +%__db_recover /usr/bin/db53_recover +%__db_replicate /usr/bin/db53_replicate +%__db_stat /usr/bin/db53_stat +%__dbsql %{_bindir}/db53sql +%__db_sql_codegen /usr/bin/db53_sql_codegen +%__db_tuner /usr/bin/db53_tuner +%__db_upgrade /usr/bin/db53_upgrade +%__db_verify /usr/bin/db53_verify +%__diff /usr/bin/diff +%__ditto %{_bindir}/ditto +%__file /usr/bin/file +%__git /usr/bin/git +%__gpg /usr/bin/gpg2 +%__gsr %{_bindir}/gsr +%__gzip /bin/gzip +%__hg /usr/bin/hg +%__id /bin/id +%__install /usr/bin/install +%__install_info /sbin/install-info +%__ldconfig /sbin/ldconfig +%__ln /bin/ln +%__ln_s ln -s +%__lrzip /usr/bin/lrzip +%__lsattr /usr/bin/lsattr +%__lzip /usr/bin/lzip +%__lzma /usr/bin/lzma +%__lzop /usr/bin/lzop +%__make /usr/bin/make +%make %{__make} +%__mkdir /bin/mkdir +%__mkdir_p /bin/mkdir -p +%__mongo %{_bindir}/mongo +%__mv /bin/mv +%__patch /usr/bin/patch +%__pax %{_bindir}/pax +%__pgp %{_bindir}/pgp +%__rm /bin/rm +%__rmdir /bin/rmdir +%__rsh %{_bindir}/rsh +%__sed /bin/sed +%__sh /bin/sh +%__sqlite3 %{_bindir}/sqlite3 +%__ssh /usr/bin/ssh +%__svn /usr/bin/svn +%__tar /bin/tar +%__unzip /usr/bin/unzip +%__vcheck %{__perl} %{_rpmhome}/vcheck +%__xz /usr/bin/xz + +#============================================================================== +# ---- Required macros. +# Macros that used to be initialized as a side effect of parsing. +# These are the default values that can be overridden by other +# (e.g. per-platform, per-system, per-packager, per-package) macros. +# +# The directory where sources/patches will be unpacked and built. +%_builddir %{_topdir}/BUILD + +# The interpreter used for build scriptlets. +%_buildshell /bin/sh + +# The location of the rpm database file(s). +%_dbpath %{_var}/lib/rpm + +# +# Path to script that creates debug symbols in a /usr/lib/debug +# shadow tree. +# +# A spec file can %%define _find_debuginfo_opts to pass options to +# the script. See the script for details. +# +%__debug_install_post \ + %{_rpmhome}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\ +%{nil} + +# Template for debug information sub-package. +%debug_package \ +%ifnarch noarch\ +%global __debug_package 1\ +%package debug\ +Summary: Debug information for package %{name}\ +Group: Development/Debug\ +AutoReqProv: 0\ +%description debug\ +This package provides debug information for package %{name}.\ +Debug information is useful when developing applications that use this\ +package or when debugging this package.\ +%files debug -f debugfiles.list\ +%defattr(-,root,root)\ +%endif\ +%{nil} + +%_defaultdocdir %{_usr}/doc + +# The path to the pgp executable (legacy, use %{__pgp} instead). +%_pgpbin %{__pgp} + +# The directory where newly built binary packages will be written. +%_rpmdir %{_topdir}/RPMS + +# A template used to generate the output binary package file name +# (legacy). +%_rpmfilename %{_build_name_fmt} + +# The default signature type. +%_signature gpg + +# The directories where sources/patches/icons from a source package will +# be installed. This is also where sources/patches/icons are found +# when building. +%_sourcedir %{_topdir}/SOURCES +%_patchdir %{_sourcedir} +%_icondir %{_sourcedir} + +# The directory where the spec file from a source package will be +# installed. +%_specdir %{_topdir}/SPECS + +# The directory where newly built source packages will be written. +%_srcrpmdir %{_topdir}/SRPMS + +# The directory where buildroots will be created. +%_buildrootdir %{_tmppath} + +# Build root path, where %install installs the package during build. +%buildroot %{_buildrootdir}/%{name}-root + +# Directory where temporaray files can be created. +%_tmppath %{_var}/tmp +%tmpdir %{_tmppath} + +# Path to top of build area. +%_topdir %{_usr}/src/rpm + +#============================================================================== +# ---- Optional macros. +# Macros that are initialized as a side effect of spec +# file parsing. +# + +# +# Note: You should not configure with disturl (or build packages with +# the DistURL: tag) unless you are willing to supply content in a +# yet-to-be-determined format at the URL specified. +# +#%disturl + +# Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files +# marked as %doc should be installed. +#%_excludedocs + +# The port and machine name of a FTP proxy host running TIS firewall. +# +#%_ftpport +#%_ftpproxy + +# The signature to use and the location of configuration files for +# signing packages with GNU gpg. +# +#%_gpg_name +#%_gpg_path + +# The port and machine name of an HTTP proxy host. +# +#%_httpport +#%_httpproxy + +# The PATH put into the environment before running %pre/%post et al. +# +%_install_helpers %{rpmhome}/helpers +%_helperpath %{?_install_helpers:%{_install_helpers}:} +%_install_script_path %{_helperpath}/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin + +# A colon separated list of desired locales to be installed; +# "all" means install all locale specific files. +# +%_install_langs all + +# A colon separated list of paths where files should *not* be installed. +# Usually, these are network file system mount points. +# +#%_netsharedpath + +# (experimental) +# The type of pattern match used on rpmdb iterator selectors: +# "default" simple glob-like regex, periods will be escaped, +# splats will have period prepended, full "^...$" match +# required. Also, file path tags will use glob(7). +# "strcmp" compare strings +# "regex" regex(7) patterns using regcomp(3)/regexec(3) +# "glob" glob(7) patterns using fnmatch(3) +# +%_query_selector_match default + +# The signature to use and the location of configuration files for +# signing packages with PGP. +# +#%_pgp_name +#%_pgp_path + +#============================================================================== +# ---- Development macros. +# (Development) Use at your own risk. +%__varlibwdj %{_var}/lib/wdj +%__varcacherpm %{_var}/cache/rpm +%__varcachewdj %{_var}/cache/wdj + +%__gitdir %{__varlibwdj}/git +%__svndir %{__varlibwdj}/svn +%__sqldir %{__varlibwdj}/sql +%__l10ndir %{__varlibwdj}/l10n + +# Elements necessary to construct a mongodb:// URI configurably +# +%__mongodb_user luser +%__mongodb_password %{nil} +%__mongodb_host tempest.mongohq.com +%__mongodb_port 10017 +%__mongodb_database cooker +%_mongodb mongodb://%{__mongodb_user}:%{__mongodb_password}@%{__mongodb_host}:%{__mongodb_port}/%{__mongodb_database} + +# Macros used for mongo shell import spewage templating +# XXX non-functional atm, /usr/lib/rpm/qf *.mongo templates for now. +%__mongodb_collection packages + +#============================================================================== +# ---- Build configuration macros. +# + +# +# Path to magic file used for file classification. +%_rpmfc_magic_path /usr/share/misc/magic + +# +# Colon separated list of permitted arbitrary tag names +%_arbitrary_tags_debian Priority:Essential:Depends:Predepends:Recommends:Suggests:Enhances:Breaks: +$_arbitrary_tags_tests Foo:Bar +%_arbitrary_tags Class:Track:Trackprog:Depflags:Transflags:%{_arbitrary_tags_debian}:%{_arbitrary_tags_tests} + +#============================================================================== +# ---- Database configuration macros. +# Macros used to configure Berkley db parameters. +# +# rpmdb macro configuration values are a colon (or white space) separated +# list of tokens, with an optional '!' negation to explicitly disable bit +# values, or a "=value" if a parameter. A per-tag value is used (e.g. +# %_dbi_config_Packages) if defined, otherwise a per-rpmdb default +# (e.g. %_dbi_config). +# +# The rpmdb configuration tokens are in a popt table in rpmdb/dbconfig.c, +# see that for the latest gory details. Note carefully that, unless you +# are writing an rpm installer, you shouldn't have to touch *any* of these +# parameters. +# + +# Use Berkeley DB transaction logging for rpmdb ACID behavior. +# XXX the %{?__nofsync} is passed from the --nofsync popt alias on the rpm cli. +%__dbi_txn create %{?__nofsync:nofsync} lock log mpool txn auto_commit thread thread_count=64 +%__dbi_perms perms=0644 +%__dbi_tmpdir tmpdir=%{_dbpath}/tmp + +%__dbi_other %{?__dbi_tmpdir} %{?__dbi_txn} + +%__dbi_transient %{?__dbi_rebuild} temporary private + +# database configuration: Berkeley-DB, Hash +%__dbi_htconfig \ + hash \ + %{?__dbi_other}\ + %{?__dbi_perms}\ +%{nil} +%_dbi_htconfig %{__dbi_htconfig} + +# database configuration: Berkeley-DB, Btree +%__dbi_btconfig \ + btree \ + %{?__dbi_other}\ + %{?__dbi_perms}\ +%{nil} +%_dbi_btconfig %{__dbi_btconfig} + +# database configuration: SQLite +%__dbi_sqlconfig %{?__dbi_perms} %{?__dbi_tmpdir} +%_dbi_sqlconfig %{__dbi_sqlconfig} + +# database tag configuration +%_dbi_tags %{expand:%%{_dbi_tags_%{_dbapi_used}}} + +%_bt_dupsort bt_dupsort primary=Packages +%_h_dupsort h_dupsort primary=Packages + +%_dbi_tags_3 Packages:Name:Version:Release:Arch:Os:Basenames:Group:Providename:Requirename:Conflictname:Obsoletename:Triggername:Dirnames:Installtid:Sigmd5:Sha1header:Filedigests:Pubkeys:Packagecolor:Nvra:Sourcepkgid:Filepaths:Seqno:Btree:Hash:Queue:Recno + +%_dbi_tags_4 Packages:Name:Version:Release:Arch:Os:Basenames:Group:Providename:Requirename:Conflictname:Obsoletename:Triggername:Dirnames:Installtid:Sigmd5:Sha1header:Filedigests:Pubkeys:Packagecolor:Nvra:Sourcepkgid:Filepaths:Seqno + +# database configuration: Berkeley-DB [dbapi 3 hooks] +%_dbi_config_3 %{_dbi_btconfig} +%_dbi_config_3_Arch %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Basenames %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Conflictname %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Conflictyamlentry %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Dirnames %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Filedigests %{_dbi_htconfig} %{?_h_dupsort} +%_dbi_config_3_Filepaths %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Group %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Installtid %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Name %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Nvra %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Obsoletename %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Obsoleteyamlentry %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Os %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Packagecolor %{_dbi_htconfig} %{?_h_dupsort} +%_dbi_config_3_Providename %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Provideyamlentry %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Pubkeys %{_dbi_htconfig} %{?_h_dupsort} +%_dbi_config_3_Release %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Removetid %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Requirename %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Requireyamlentry %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Sha1header %{_dbi_htconfig} %{?_h_dupsort} +%_dbi_config_3_Sigmd5 %{_dbi_htconfig} %{?_h_dupsort} +%_dbi_config_3_Sourcepkgid %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Triggername %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Version %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Packages %{_dbi_btconfig} +%_dbi_config_3_Depcache %{_dbi_btconfig} temporary private +%_dbi_config_3_Seqno %{_dbi_btconfig} seq_id=0 +%_dbi_config_3_Btree btree %{?__dbi_perms} debug +%_dbi_config_3_Hash hash %{?__dbi_perms} debug +%_dbi_config_3_Queue queue %{?__dbi_perms} debug +%_dbi_config_3_Recno recno %{?__dbi_perms} debug +%_dbi_config_3_Heap heap %{?__dbi_perms} debug + +# database configuration: SQLite [dbapi 4 hooks] +%_dbi_config_4 %{_dbi_sqlconfig} +%_dbi_config_4_Arch %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Basenames %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Conflictname %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Conflictyamlentry %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Dirnames %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Filedigests %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Filepaths %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Group %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Installtid %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Name %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Nvra %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Obsoletename %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Obsoleteyamlentry %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Os %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Packagecolor %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Providename %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Provideyamlentry %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Pubkeys %{_dbi_sqlconfig} %{?_bt_dupsort} debug +%_dbi_config_4_Release %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Removetid %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Requirename %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Requireyamlentry %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Sha1header %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Sigmd5 %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Sourcepkgid %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Triggername %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Version %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Packages %{_dbi_sqlconfig} +%_dbi_config_4_Depcache %{_dbi_sqlconfig} temporary private +%_dbi_config_4_Seqno %{_dbi_sqlconfig} seq_id=0 + +# database configuration [code entry hooks] +%_dbi_config %{expand:%%{_dbi_config_%{_dbapi_used}}} +%_dbi_config_Arch %{expand:%%{_dbi_config_%{_dbapi_used}_Arch}} +%_dbi_config_Basenames %{expand:%%{_dbi_config_%{_dbapi_used}_Basenames}} +%_dbi_config_Conflictname %{expand:%%{_dbi_config_%{_dbapi_used}_Conflictname}} +%_dbi_config_Conflictyamlentry %{expand:%%{_dbi_config_%{_dbapi_used}_Conflictyamlentry}} + +%_dbi_config_Dirnames %{expand:%%{_dbi_config_%{_dbapi_used}_Dirnames}} +%_dbi_config_Filedigests %{expand:%%{_dbi_config_%{_dbapi_used}_Filedigests}} +%_dbi_config_Filepaths %{expand:%%{_dbi_config_%{_dbapi_used}_Filepaths}} +%_dbi_config_Group %{expand:%%{_dbi_config_%{_dbapi_used}_Group}} +%_dbi_config_Installtid %{expand:%%{_dbi_config_%{_dbapi_used}_Installtid}} +%_dbi_config_Name %{expand:%%{_dbi_config_%{_dbapi_used}_Name}} +%_dbi_config_Nvra %{expand:%%{_dbi_config_%{_dbapi_used}_Nvra}} +%_dbi_config_Obsoletename %{expand:%%{_dbi_config_%{_dbapi_used}_Obsoletename}} +%_dbi_config_Obsoleteyamlentry %{expand:%%{_dbi_config_%{_dbapi_used}_Obsoleteyamlentry}} +%_dbi_config_Os %{expand:%%{_dbi_config_%{_dbapi_used}_Os}} +%_dbi_config_Packagecolor %{expand:%%{_dbi_config_%{_dbapi_used}_Packagecolor}} +%_dbi_config_Providename %{expand:%%{_dbi_config_%{_dbapi_used}_Providename}} +%_dbi_config_Provideyamlentry %{expand:%%{_dbi_config_%{_dbapi_used}_Provideyamlentry}} +%_dbi_config_Pubkeys %{expand:%%{_dbi_config_%{_dbapi_used}_Pubkeys}} +%_dbi_config_Release %{expand:%%{_dbi_config_%{_dbapi_used}_Release}} +%_dbi_config_Removetid %{expand:%%{_dbi_config_%{_dbapi_used}_Removetid}} +%_dbi_config_Requirename %{expand:%%{_dbi_config_%{_dbapi_used}_Requirename}} +%_dbi_config_Requireyamlentry %{expand:%%{_dbi_config_%{_dbapi_used}_Requireyamlentry}} +%_dbi_config_Sha1header %{expand:%%{_dbi_config_%{_dbapi_used}_Sha1header}} +%_dbi_config_Sigmd5 %{expand:%%{_dbi_config_%{_dbapi_used}_Sigmd5}} +%_dbi_config_Sourcepkgid %{expand:%%{_dbi_config_%{_dbapi_used}_Sourcepkgid}} +%_dbi_config_Triggername %{expand:%%{_dbi_config_%{_dbapi_used}_Triggername}} +%_dbi_config_Version %{expand:%%{_dbi_config_%{_dbapi_used}_Version}} +%_dbi_config_Packages %{expand:%%{_dbi_config_%{_dbapi_used}_Packages}} +%_dbi_config_Depcache %{expand:%%{_dbi_config_%{_dbapi_used}_Depcache}} +%_dbi_config_Seqno %{expand:%%{_dbi_config_%{_dbapi_used}_Seqno}} + +# Database API configuration: +# +# 0,1: Berkeley-DB 1.x API (no longer supported) +# 2: Berkeley-DB 2.x API (no longer supported) +# 3: Berkeley-DB 3.x/4.x API (default) +# 4: SQLite 3.x API (alternative) +# +# There are different macros so that --rebuilddb can convert the +# database between formats (usually for upgrading purposes) +# +%_dbapi 3 +%_dbapi_used %{_dbapi} + +# +# Export package NEVRA (stamped with install tid) info for HRMIB on this path. +# +# XXX Note: escaped %% for use in headerSprintf() +#%_hrmib_path /var/cache/hrmib/%{___NVRA} + +#============================================================================== +# ---- GPG/PGP/PGP5 signature macros. +# Macro(s) to hold the arguments passed to GPG/PGP for package +# signing and verification. +# +%__gpg_check_password_cmd %{__gpg} \ + gpg --batch --no-verbose --passphrase-fd 3 -u "%{_gpg_name}" -so - +#%__pgp_check_password_cmd %{__pgp} \ +# pgp +batchmode=on +verbose=0 "%{_pgp_name}" -sf +#%__pgp5_check_password_cmd %{__pgp} \ +# pgps +batchmode=on +verbose=0 +armor=off "%{_pgp_name}" -f + +%__gpg_sign_cmd %{__gpg} \ + gpg --batch --no-verbose --no-armor --passphrase-fd 3 --no-secmem-warning \ + -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename} +#%__pgp_sign_cmd %{__pgp} \ +# pgp +batchmode=on +verbose=0 +armor=off \ +# "+myname=%{_pgp_name}" -sb %{__plaintext_filename} %{__signature_filename} +#%__pgp5_sign_cmd %{__pgp} \ +# pgps +batchmode=on +verbose=0 +armor=off \ +# "+myname=%{_pgp_name}" -b %{__plaintext_filename} -o %{__signature_filename} + +# rpm-5.0 and later verifies signatures internally using beecrypt/NSS/openssl +#%__gpg_verify_cmd %{__gpg} \ +# gpg --batch --no-verbose --verify --no-secmem-warning \ +# %{__signature_filename} %{__plaintext_filename} +#%__pgp_verify_cmd %{__pgp} \ +# pgp +batchmode=on +verbose=0 \ +# %{__signature_filename} %{__plaintext_filename} +#%__pgp5_verify_cmd %{__pgp} \ +# pgpv +batchmode=on +verbose=0 \ +# +OutputInformationFD=1 +OutputWarningFD=1 \ +# -o %{__signature_filename} %{__plaintext_filename} + +# +# XXX rpm-4.1 verifies prelinked libraries using a prelink undo helper. +# Normally this macro is defined in %{_etcrpm}/macros.prelink, installed +# with the prelink package. If the macro is undefined, then prelinked +# shared libraries contents are MD5 digest verified (as usual), rather +# than MD5 verifying the output of the prelink undo helper. +# +# Note: The 2nd token is used as argv[0] and "library" is a +# placeholder that will be deleted and replaced with the appropriate +# library file path. +#%__prelink_undo_cmd /usr/sbin/prelink prelink -y library + +# Horowitz Key Protocol server configuration +# +#%_hkp_keyserver hkp://keys.n3npq.net +%_hkp_keyserver hkp://pool.sks-keyservers.net +%_hkp_keyserver_query %{_hkp_keyserver}/pks/lookup?op=get&search= + + +%_nssdb_path /etc/pki/nssdb +#============================================================================== +# ---- Transaction macros. +# Macro(s) used to parameterize transactions. +# + +# The default transaction color. This value is a set of bits to +# determine file and dependency affinity for this arch. +# 0 uncolored (i.e. use only arch as install hint) +# 1 Elf32 permitted +# 2 Elf64 permitted +# 4 MIPS reserved +%_transaction_color 3 + +# A default autorelocation path prefixed to file paths of packages +# that have an incompatible arch. This is used on ia64 to prefix +# /emul/ia32 to i386 file paths, and nowhere else (yet). +# +# XXX Note: escaped %% for use in headerSprintf() +#%_autorelocate_path %{nil} + +# A default directory color to choose when directories are +# auto-relocated. +#%_autorelocate_dcolor 0 + +# Open all indices before doing chroot(2). +# +#%_openall_before_chroot 0 + +# The path to the dependency universe database. The default value +# is the rpmdb-vendor location. The macro is usually defined in +# %{_etcrpm}/macros.solve, installed with the rpmdb-vendor package. +#%_solve_dbpath /usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/rpm + +# The path to the dependency universe packages. This should +# be a path to the packages contained in the solve database. +# +# XXX Note: needs a pesky trailing / +#%_solve_pkgsdir /mnt/rpm/test/latest-i386/RedHat/RPMS/ + +# The output binary package file name template used when suggesting +# binary packages that solve a dependency. The macro is usually defined +# in %{_etcrpm}/macros.solve, installed with the rpmdb-vendor package. +# +# XXX Note: escaped %% for use in headerSprintf() +#%_solve_name_fmt %{?_solve_pkgsdir}%{___NVRA}.rpm + +# The output binary package file name template used when repackaging +# erased packages. +# +# XXX Note: escaped %% for use in headerSprintf() +%_repackage_name_fmt %{___NVRA}.rpm + +# The "transactional rollback" directory in which erased packages will +# be saved when using the --repackage option. +%_repackage_dir %{_var}/spool/repackage + +# A path (i.e. URL) prefix that is pre-pended to %{_repackage_dir}. +%_repackage_root %{nil} + +# If non-zero, all erasures will be automagically repackaged. +%_repackage_all_erasures 1 + +# Prevent pure erasure transactions with --rollback. Pure +# erasure rollback transactions will undo an anaconda install, +# for example, which %_unsafe_rollbacks tries to prevent. +# +# Set this to non-zero at your own risk, it's dangerous. +%_unsafe_rollbacks 0 + +# Automate transaction rollbacks on upgrade failure. +# +# Set this to non-zero at your own risk, it's dangerous. +%_rollback_transaction_on_failure 0 + +# Verify digest/signature flags for various rpm modes: +# 0x30300 (_RPMVSF_NODIGESTS) --nohdrchk if set, don't check digest(s) +# 0xc0c00 (_RPMVSF_NOSIGNATURES) --nosignature if set, don't check signature(s) +# 0xf0000 (_RPMVSF_NOPAYLOAD) --nolegacy if set, check header+payload (if possible) +# 0x00f00 (_RPMVSF_NOHEADER) --nohdrchk if set, don't check rpmdb headers +# +# For example, the value 0xf0c00 (=0xf0000+0xc0c00) disables legacy +# digest/signature checking, disables signature checking, but attempts +# digest checking, also when retrieving headers from the database. +# +# The checking overhead was ~11ms per header for digests/signatures on +# a 600 Mhz Dell SMP server circa 1998. +# +# Each header from the database is checked only when first encountered +# for each database open. +# +# Note: the %_vsflags_erase applies to --upgrade/--freshen modes as +# well as --erase. +# +%__vsflags 0xf0000 +%_vsflags_build %{__vsflags} +%_vsflags_erase %{__vsflags} +%_vsflags_install %{__vsflags} +%_vsflags_query %{__vsflags} +%_vsflags_verify %{__vsflags} + +# Choose keyutils keyring type: +# +# group KEY_SPEC_GROUP_KEYRING +# process KEY_SPEC_PROCESS_KEYRING +# session KEY_SPEC_SESSION_KEYRING +# thread KEY_SPEC_THREAD_KEYRING +# user KEY_SPEC_USER_KEYRING +# user_session KEY_SPEC_USER_SESSION_KEYRING +# +%_keyutils_keyring process + +# Relations between package names that cause dependency loops +# with legacy packages that cannot be fixed. Relations are +# specified as +# p>q +# where package p has a Requires: on something that package q Provides: +# +# XXX Note: that there cannot be any whitespace within the string "p>q", +# and that both p and q are package names (i.e. no version/release). +# +%_dependency_whiteout_caos_core \ + perl>perl-Filter \ + pam>coreutils \ + pam>initscripts \ + glibc-common>glibc \ + glibc>nscd \ + filesystem>setup + +%_dependency_whiteout \ + %{?_dependency_whiteout_caos_core} \ + %{?_dependency_whiteout_system} \ + %{nil} + +# +# Default path used for serializing transactions with a fcntl lock. +# +# The original, FHS clompliant, path was /var/lock/run/transaction, +# but the transaction lock needs to be finer grained, at least +# per-database, not global, for many rpm operations with transaction sets. +# +# The fcntl lock is now off by default, posix mutexes (or equiv) are sufficient. +# to protect Berkeley DB data, and using multiple databases with concurrent +# access is a more important feature to rpm than serializing transaction +# sets. Change your configuration if you disagree. +# +# XXX Note: the suggested file name is __db.000 to expedite +# support issues, because users typically do "rm -f /var/lib/rpm/__db*", +# which will clean up the fcntl lock at the same time. +#%_rpmlock_path %{_dbpath}/__db.000 + +#============================================================================== +# ---- Query macros. +# +# Default query format string for displaying package names everywhere +%___NVRA %%{NAME}-%%{VERSION}-%%{RELEASE}%%|DISTTAG?{-%%{DISTTAG}%%|DISTEPOCH?{%%{DISTEPOCH}}|}|%%|ARCH?{.%%|SOURCERPM?{%%{ARCH}}:{src}|}:{}| + + +# Default headerSprintf() output format string for rpm -qa +# +# XXX Note: escaped %% for use in headerSprintf() +%_query_all_fmt %{___NVRA} + +# +# Path for rpm -qH (default is /usr/share/comps/%{_arch}/hdlist) +%_query_hdlist_path %{_datadir}/comps/%{_arch}/hdlist + +# +# Permit network access? (".fdio" prohibits network access) +%_rpmgio .fdio + +# +# Pattern matching for installation via "+N-V-R.A" CLI arguments +#%_rpmgi_pattern_glob() %{_rpmdir}/%1-*-*.*.rpm +%_rpmgi_pattern_glob %{_rpmdir}/*/ +%_rpmgi_pattern_regex() ^.+/%1-[^-]+-[^-]+\\.[^.]+\\.rpm$ + +# +# UUIDv3/UUIDv5 namespace URI macros. The complete canonical path is +# %_uuid_uri %{?_uuid_auth}/%{?_uuid_path}/Tagname/Tagvalue +%_uuid_auth http://rpm5.org/ +%_uuid_path /package + +#============================================================================== +# ---- EVRD... dependency tuple comparison macros. +# + +# STEP 1: Match the string and capture regex parts +# 1 2 3 4 +# X ":" X "-"X ":"X +%evr_tuple_match ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$ + +# STEP 2: Assemble tuple from regex parts +# case 1: case 2: case 3: case 4: case 5: case 6: +# X:X-X:X X:X-X X:X X: X-X X +# %evr_tuple_select 1234 123_ 12__ 1___ _23_ _2__ +%evr_tuple_select 123_ + +# STEP 3: Configure the comparison order of the tuple elements +%evr_tuple_order EVR + +# data validation patterns for identifier tags +%pattern_Name ^[A-Za-z0-9][A-Za-z0-9+._-]*$ +%pattern_Epoch ^[0-9]+$ +%pattern_Version ^[A-Za-z0-9+._]+$ +%pattern_Release ^[A-Za-z0-9+._]+$ +%pattern_Disttag ^[A-Za-z0-9]+$ +%pattern_Repotag ^[A-Za-z0-9]+$ +%pattern_Distepoch ^[A-Za-z0-9.]+$ +#%pattern_Url +#%pattern_Cvsid +#%pattern_Group +#%pattern_Summary +#%pattern_Distribution +#%pattern_Vendor +#%pattern_License +#%pattern_Packager +#%pattern_Buildroot +#%pattern_Keywords +#%pattern_Variants +#%pattern_Prefixes +#%pattern_Docdir +#%pattern_Xmajor +#%pattern_Xminor +#%pattern_Autoreqprov +#%pattern_Autoreq +#%pattern_Autoprov +#%pattern_Source +#%pattern_Patch +#%pattern_Icon +#%pattern_Nosource +#%pattern_Nopatch +#%pattern_Buildprereq +#%pattern_Buildprovides +#%pattern_Buildrequires +#%pattern_Buildconflicts +#%pattern_Buildobsoletes +#%pattern_Buildsuggests +#%pattern_Buildenhances +#%pattern_Prereq +#%pattern_Provideflags +#%pattern_Requireflags +#%pattern_Conflictflags +#%pattern_Obsoleteflags +#%pattern_Suggestsflags +#%pattern_Enhancesflags +#%pattern_Buildplatforms +#%pattern_Excludearch +#%pattern_Exclusivearch +#%pattern_Excludeos +#%pattern_Exclusiveos +#%pattern_Buildarchs + +#============================================================================== +# ---- Run-time probe dependency macros. + +# +%_rpmds_filter_name archfilter + +# +%_rpmds_cpuinfo_path /proc/cpuinfo + +# +%_rpmds_sysinfo_path %{_etcrpm}/sysinfo + +# +%_rpmds_ldconfig_cmd /sbin/ldconfig -p +%_rpmds_ldconfig_cache /etc/ld.so.cache + +# A colon-separated list of directories which should match the rld's +# (runtime loader) list of directories it searches for shared objects. +# Only used on platforms that don't have a configurable loader search +# path via ldconfig, crle, or something similar. +#%_rpmds_rld_search_path /lib:/usr/lib + +# +# Full path and arguments to Solaris' command to list what directories +# the runtime loader searches. Needs to include `-64' for LP64 Solaris +# systems. +#%_rpmds_crle_cmd /usr/bin/crle + +# +%_rpmds_getconf_path / + +# +%_rpmds_perldeps_cmd %{__find} %{_libdir}/perl5 | %{_rpmhome}/perl.prov + +# +%_varrun /var/run + +#============================================================================== +# ---- Cache configuration macros. +# Macro(s) used to configure the universe of headers used to +# solve dependencies using rpmcache(8). +# +# Note: These values were specific to my machine, and most certainly +# are incorrect for any other machine. The macros are +# included here only to document the macro names and usage. +#%_bhpath file://localhost/mnt/dist +#%_bhcoll @(7.3|7.2|7.1|7.1sbe|7.1k|7.0|7.01j|7.0j|7.0sbe|7.0tc|6.2|6.2ha|6.2ee|6.1|6.0|5.2|5.1|5.0) +#%_bhN @(SRPMS|i386|alpha|sparc|s390|ia64) +#%_bhVR @(RedHat|Fedora) +#%_bhA RPMS + +# +# A configuration to build an rpmdb from yum package hierarchy +%_bhpath file://%{_varcachewdj} +%_bhcoll @(updates) +%_bhN @(packages) +%_bhVR %{nil} +%_bhA %{nil} + +# The cache database directory. +%_cache_dbpath %{_varcachewdj}/rpmdb + +#============================================================================== +# ---- per-platform macros. +# Macros that are specific to an individual platform. The values here +# will be used if the per-platform macro file does not exist.. +# +%_arch x86_64 +%_build_arch x86_64 +%_vendor mandriva +%_os linux +%_gnu -gnu + +%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu} +%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu} +%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_gnu} + +#============================================================================== +# ---- configure macros. +# Macro(s) slavishly copied from autoconf's config.status. +# +%_prefix /usr +%_exec_prefix %{_prefix} +%_datarootdir %{_prefix}/share +%_bindir %{_exec_prefix}/bin +%_sbindir %{_exec_prefix}/sbin +%_libexecdir %{_exec_prefix}/libexec +%_datadir %{_datarootdir} +%_sysconfdir %{_prefix}/etc +%_sharedstatedir %{_prefix}/com +%_localstatedir %{_prefix}/var +%_lib lib +%_libdir %{_exec_prefix}/%{_lib} +%_includedir %{_prefix}/include +%_oldincludedir /usr/include +%_infodir %{_datarootdir}/info +%_mandir %{_datarootdir}/man +%_localedir %{_datarootdir}/locale +%_lispdir %{_datarootdir}/emacs/site-lisp +%_initddir %{_sysconfdir}/rc.d/init.d +# This is a deprecated misspelling, present for backwards compatibility. +%_initrddir %{_initddir} + +#--------------------------------------------------------------------- +# Multilibs +%_multilibpatt (/%{_lib}|/usr/%{_lib}(|/gconv)|/usr/local/%{_lib}|/usr/X11R6/%{_lib}|/opt/%{_lib})/[^/]*\\.([oa]|la|so[0-9.]*)$ + +#============================================================================== +# ---- config.guess platform macros. +# Macro(s) similar to the tokens used by configure. +# +%_build %{_host} +%_build_alias %{_host_alias} +%_build_cpu %{_host_cpu} +%_build_vendor %{_host_vendor} +%_build_os %{_host_os} +%_host x86_64-unknown-linux-gnu +%_host_alias %{nil} +%_host_cpu x86_64 +%_host_vendor unknown +%_host_os linux-gnu +%_target %{_host} +%_target_alias %{_host_alias} +%_target_cpu %{_host_cpu} +%_target_vendor %{_host_vendor} +%_target_os %{_host_os} + +#------------------------------------------------------------------------ +# lua macros +# +#%rpm_license_check %{expand:%%define rpm_license_check %{lua:\ +#f = io.open("/dev/tty", "w")\ +#if f then\ +# f:write ("\\nJust checking to see who is using rpm-5.4.9.\\nThe RPM Package Manager license is LGPL, as always.\\nRelax ...\\n")\ +# f:close()\ +#end\ +#}1}%{rpm_license_check} + +#------------------------------------------------------------------------ +# executable(...) configuration. +# +# Path to scripts to autogenerate executable(foo) script dependencies, +# +# Note: Used iff _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +#%__executable_provides %{_rpmhome}/executabledeps.sh --provides +#%__executable_requires %{_rpmhome}/executabledeps.sh --requires +%__scriptlet_requires %{__bash} --rpm-requires + +#============================================================================== +# ---- embedded inyterpreter macros. +# +# Embedded interpreter commands run when an interpreter is instantiated. +# + +%_luaI_init %{nil} + +%_tclI_init %{nil} + +%_perlI_init use RPM;\ +%{nil} + +%_rubyI_init %{nil} + +%_pythonI_init import rpm\ +%{nil} + +#============================================================================== +# XXX Caveat: +# XXX With %{load:...} being interpreted immediately -- not lazily -- +# XXX within a macro init file, a failure to load causes immediate loading +# XXX termination silently. +# XXX +# XXX So the order as well as the existence of the %{load:...} macros below +# XXX are critically important. +# XXX +# XXX Note also that loaded macro files can NOT recursively load other +# XXX macro files; only a top-level (i.e. after --macros, or within a *.spec) +# XXX file is permitted to do %{load:...}. The reason for the rule is to +# XXX prevent recursive loops: there's no known need for immediate loading +# XXX EXCEPT as a construction artifact while splitting rpmbuild macros +# XXX from other structural configuration (like paths and booleans) used +# XXX for configuring RPM itself. +# XXX +# XXX Simple example(s): +# XXX If the file %{_usrlibrpm}/macros.d/selinux doesn't exist, +# XXX then %{_usrlibrpm}/macros.rpmbuild will NOT be loaded. +# XXX +# XXX if the file %{_usrlibrpm}/macros.d/cmake attempts another +# XXX %{load:...}, then loading will CEASE at that point in the file. +#============================================================================== +# ---- SELinux configuration macros. +#%%{load:%{_usrlibrpm}/macros.d/selinux} + +#============================================================================== +# ---- rpmbuild macros. +#%%{load:%{_usrlibrpm}/macros.rpmbuild} + +#------------------------------------------------------------------------ +# cmake(...) configuration +#%%{load:%{_usrlibrpm}/macros.d/cmake} + +#------------------------------------------------------------------------ +# gstreamer(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/gstreamer} + +#------------------------------------------------------------------------ +# haskell(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/haskell} + +#------------------------------------------------------------------------ +# perl(...) configuration +#%%{load:%{_usrlibrpm}/macros.d/perl} + +#------------------------------------------------------------------------ +# python(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/python} + +#------------------------------------------------------------------------ +# php(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/php} + +#------------------------------------------------------------------------ +# java(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/java} + +#------------------------------------------------------------------------ +# libtool(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/libtool} + +#------------------------------------------------------------------------ +# pkgconfig(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/pkgconfig} + +#------------------------------------------------------------------------ +# mono(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/mono} + +#------------------------------------------------------------------------ +# ruby(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/ruby} + +#------------------------------------------------------------------------ +# tcl(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/tcl} + +#------------------------------------------------------------------------ +# typelib(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/typelib} + +# \endverbatim +#*/ diff --git a/rpm-5.4.9/macros/macros.in b/rpm-5.4.9/macros/macros.in new file mode 100644 index 0000000..cba8cb1 --- /dev/null +++ b/rpm-5.4.9/macros/macros.in @@ -0,0 +1,1055 @@ +#/*! \page config_macros Default configuration: @USRLIBRPM@/macros +# \verbatim +# +# $Id: macros.in,v 1.39.2.32 2012/05/06 22:36:51 jbj Exp $ +# +# This is a global RPM configuration file. All changes made here will +# be lost when the rpm package is upgraded. Any per-system configuration +# should be added to %{_etcrpm}/macros, while per-user configuration should +# be added to ~/.rpmmacros. +# +#============================================================================== +# Macro naming conventions: +# +# Macros that begin with an underscore are "local" in the sense that +# they (if used) will not be exported in rpm headers. Some macros +# that don't start with an underscore (but look like they should) +# are compatible with macros generated by rpm-2.5.x and will be made +# more consistent in a future release. +# +%_rpmversion @VERSION@ + +#============================================================================== +# ---- A macro that expands to nothing. +# +%nil %{!?nil} + +#============================================================================== +# ---- filesystem macros. +# +%_usr @usrprefix@ +%_usrsrc %{_usr}/src +%_var @varprefix@ +%_usrlibrpm @USRLIBRPM@ +%_etcrpm @SYSCONFIGDIR@ + +%__objext @objext@ +%__libext @libext@ +%__shlibext @shlibext@ +%__exeext @exeext@%{nil} + +%_rpmhome %{_usrlibrpm} + +#============================================================================== +# ---- RPM specific tool paths +# +%_usrlibrpmbin %{_usrlibrpm}/bin +%__chroot %{_usrlibrpmbin}/chroot +%__cp %{_usrlibrpmbin}/cp +%__find %{_usrlibrpmbin}/find +%__grep %{_usrlibrpmbin}/grep +%__lua %{_usrlibrpmbin}/lua +%__mtree %{_usrlibrpmbin}/mtree +%__rc %{_usrlibrpmbin}/rc +%__wget %{_usrlibrpmbin}/wget +%__xar %{_usrlibrpmbin}/xar + +#============================================================================== +# ---- Generally useful path macros. +# +%__awk @AWK@ +%__bash @__BASH@ +%__bzip2 @__BZIP2@ +%__cat @__CAT@ +%__chattr @__CHATTR@ +%__chgrp @__CHGRP@ +%__chmod @__CHMOD@ +%__chown @__CHOWN@ +%__cpio @__CPIO@ +%__curl @__CURL@ +%__cvs @__CVS@ +%__db_archive @__DB_ARCHIVE@ +%__db_checkpoint @__DB_CHECKPOINT@ +%__db_deadlock @__DB_DEADLOCK@ +%__db_dump @__DB_DUMP@ +%__db_hotbackup @__DB_HOTBACKUP@ +%__db_load @__DB_LOAD@ +%__db_log_verify @__DB_LOG_VERIFY@ +%__db_printlog @__DB_PRINTLOG@ +%__db_recover @__DB_RECOVER@ +%__db_replicate @__DB_REPLICATE@ +%__db_stat @__DB_STAT@ +%__dbsql @__DBSQL@ +%__db_sql_codegen @__DB_SQL_CODEGEN@ +%__db_tuner @__DB_TUNER@ +%__db_upgrade @__DB_UPGRADE@ +%__db_verify @__DB_VERIFY@ +%__diff @__DIFF@ +%__ditto @__DITTO@ +%__file @__FILE@ +%__git @__GIT@ +%__gpg @__GPG@ +%__gsr @__GSR@ +%__gzip @__GZIP@ +%__hg @__HG@ +%__id @__ID@ +%__install @__INSTALL@ +%__install_info @__INSTALL_INFO@ +%__ldconfig @__LDCONFIG@ +%__ln @__LN@ +%__ln_s @LN_S@ +%__lrzip @__LRZIP@ +%__lsattr @__LSATTR@ +%__lzip @__LZIP@ +%__lzma @__LZMA@ +%__lzop @__LZOP@ +%__make @__MAKE@ +%make %{__make} +%__mkdir @__MKDIR@ +%__mkdir_p @__MKDIR_P@ +%__mongo @__MONGO@ +%__mv @__MV@ +%__patch @__PATCH@ +%__pax @__PAX@ +%__pgp @__PGP@ +%__rm @__RM@ +%__rmdir @__RMDIR@ +%__rsh @__RSH@ +%__sed @__SED@ +%__sh @__SH@ +%__sqlite3 @__SQLITE3@ +%__ssh @__SSH@ +%__svn @__SVN@ +%__tar @__TAR@ +%__unzip @__UNZIP@ +%__vcheck %{__perl} %{_rpmhome}/vcheck +%__xz @__XZ@ + +#============================================================================== +# ---- Required macros. +# Macros that used to be initialized as a side effect of parsing. +# These are the default values that can be overridden by other +# (e.g. per-platform, per-system, per-packager, per-package) macros. +# +# The directory where sources/patches will be unpacked and built. +%_builddir %{_topdir}/BUILD + +# The interpreter used for build scriptlets. +%_buildshell /bin/sh + +# The location of the rpm database file(s). +%_dbpath @DBPATH_MACRO@ + +# +# Path to script that creates debug symbols in a /usr/lib/debug +# shadow tree. +# +# A spec file can %%define _find_debuginfo_opts to pass options to +# the script. See the script for details. +# +%__debug_install_post \ + %{_rpmhome}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\ +%{nil} + +# Template for debug information sub-package. +%debug_package \ +%ifnarch noarch\ +%global __debug_package 1\ +%package debug\ +Summary: Debug information for package %{name}\ +Group: Development/Debug\ +AutoReqProv: 0\ +%description debug\ +This package provides debug information for package %{name}.\ +Debug information is useful when developing applications that use this\ +package or when debugging this package.\ +%files debug -f debugfiles.list\ +%defattr(-,root,root)\ +%endif\ +%{nil} + +%_defaultdocdir %{_usr}/doc + +# The path to the pgp executable (legacy, use %{__pgp} instead). +%_pgpbin %{__pgp} + +# The directory where newly built binary packages will be written. +%_rpmdir %{_topdir}/RPMS + +# A template used to generate the output binary package file name +# (legacy). +%_rpmfilename %{_build_name_fmt} + +# The default signature type. +%_signature gpg + +# The directories where sources/patches/icons from a source package will +# be installed. This is also where sources/patches/icons are found +# when building. +%_sourcedir %{_topdir}/SOURCES +%_patchdir %{_sourcedir} +%_icondir %{_sourcedir} + +# The directory where the spec file from a source package will be +# installed. +%_specdir %{_topdir}/SPECS + +# The directory where newly built source packages will be written. +%_srcrpmdir %{_topdir}/SRPMS + +# The directory where buildroots will be created. +%_buildrootdir @BUILDROOTDIR_MACRO@ + +# Build root path, where %install installs the package during build. +%buildroot %{_buildrootdir}/%{name}-root + +# Directory where temporaray files can be created. +%_tmppath %{_var}/tmp +%tmpdir %{_tmppath} + +# Path to top of build area. +%_topdir @PKGSRCDIR_MACRO@ + +#============================================================================== +# ---- Optional macros. +# Macros that are initialized as a side effect of spec +# file parsing. +# + +# +# Note: You should not configure with disturl (or build packages with +# the DistURL: tag) unless you are willing to supply content in a +# yet-to-be-determined format at the URL specified. +# +#%disturl + +# Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files +# marked as %doc should be installed. +#%_excludedocs + +# The port and machine name of a FTP proxy host running TIS firewall. +# +#%_ftpport +#%_ftpproxy + +# The signature to use and the location of configuration files for +# signing packages with GNU gpg. +# +#%_gpg_name +#%_gpg_path + +# The port and machine name of an HTTP proxy host. +# +#%_httpport +#%_httpproxy + +# The PATH put into the environment before running %pre/%post et al. +# +%_install_helpers %{rpmhome}/helpers +%_helperpath %{?_install_helpers:%{_install_helpers}:} +%_install_script_path %{_helperpath}/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin + +# A colon separated list of desired locales to be installed; +# "all" means install all locale specific files. +# +%_install_langs all + +# A colon separated list of paths where files should *not* be installed. +# Usually, these are network file system mount points. +# +#%_netsharedpath + +# (experimental) +# The type of pattern match used on rpmdb iterator selectors: +# "default" simple glob-like regex, periods will be escaped, +# splats will have period prepended, full "^...$" match +# required. Also, file path tags will use glob(7). +# "strcmp" compare strings +# "regex" regex(7) patterns using regcomp(3)/regexec(3) +# "glob" glob(7) patterns using fnmatch(3) +# +%_query_selector_match default + +# The signature to use and the location of configuration files for +# signing packages with PGP. +# +#%_pgp_name +#%_pgp_path + +#============================================================================== +# ---- Development macros. +# (Development) Use at your own risk. +%__varlibwdj %{_var}/lib/wdj +%__varcacherpm %{_var}/cache/rpm +%__varcachewdj %{_var}/cache/wdj + +%__gitdir %{__varlibwdj}/git +%__svndir %{__varlibwdj}/svn +%__sqldir %{__varlibwdj}/sql +%__l10ndir %{__varlibwdj}/l10n + +# Elements necessary to construct a mongodb:// URI configurably +# +%__mongodb_user luser +%__mongodb_password %{nil} +%__mongodb_host tempest.mongohq.com +%__mongodb_port 10017 +%__mongodb_database cooker +%_mongodb mongodb://%{__mongodb_user}:%{__mongodb_password}@%{__mongodb_host}:%{__mongodb_port}/%{__mongodb_database} + +# Macros used for mongo shell import spewage templating +# XXX non-functional atm, /usr/lib/rpm/qf *.mongo templates for now. +%__mongodb_collection packages + +#============================================================================== +# ---- Build configuration macros. +# + +# +# Path to magic file used for file classification. +%_rpmfc_magic_path @MAGIC_MACRO@ + +# +# Colon separated list of permitted arbitrary tag names +%_arbitrary_tags_debian Priority:Essential:Depends:Predepends:Recommends:Suggests:Enhances:Breaks: +$_arbitrary_tags_tests Foo:Bar +%_arbitrary_tags Class:Track:Trackprog:Depflags:Transflags:%{_arbitrary_tags_debian}:%{_arbitrary_tags_tests} + +#============================================================================== +# ---- Database configuration macros. +# Macros used to configure Berkley db parameters. +# +# rpmdb macro configuration values are a colon (or white space) separated +# list of tokens, with an optional '!' negation to explicitly disable bit +# values, or a "=value" if a parameter. A per-tag value is used (e.g. +# %_dbi_config_Packages) if defined, otherwise a per-rpmdb default +# (e.g. %_dbi_config). +# +# The rpmdb configuration tokens are in a popt table in rpmdb/dbconfig.c, +# see that for the latest gory details. Note carefully that, unless you +# are writing an rpm installer, you shouldn't have to touch *any* of these +# parameters. +# + +# Use Berkeley DB transaction logging for rpmdb ACID behavior. +# XXX the %{?__nofsync} is passed from the --nofsync popt alias on the rpm cli. +%__dbi_txn create %{?__nofsync:nofsync} lock log mpool txn auto_commit thread thread_count=64 +%__dbi_perms perms=0644 +%__dbi_tmpdir tmpdir=%{_dbpath}/tmp + +%__dbi_other %{?__dbi_tmpdir} %{?__dbi_txn} + +%__dbi_transient %{?__dbi_rebuild} temporary private + +# database configuration: Berkeley-DB, Hash +%__dbi_htconfig \ + hash \ + %{?__dbi_other}\ + %{?__dbi_perms}\ +%{nil} +%_dbi_htconfig %{__dbi_htconfig} + +# database configuration: Berkeley-DB, Btree +%__dbi_btconfig \ + btree \ + %{?__dbi_other}\ + %{?__dbi_perms}\ +%{nil} +%_dbi_btconfig %{__dbi_btconfig} + +# database configuration: SQLite +%__dbi_sqlconfig %{?__dbi_perms} %{?__dbi_tmpdir} +%_dbi_sqlconfig %{__dbi_sqlconfig} + +# database tag configuration +%_dbi_tags %{expand:%%{_dbi_tags_%{_dbapi_used}}} + +%_bt_dupsort bt_dupsort primary=Packages +%_h_dupsort h_dupsort primary=Packages + +%_dbi_tags_3 Packages:Name:Version:Release:Arch:Os:Basenames:Group:Providename:Requirename:Conflictname:Obsoletename:Triggername:Dirnames:Installtid:Sigmd5:Sha1header:Filedigests:Pubkeys:Packagecolor:Nvra:Sourcepkgid:Filepaths:Seqno:Btree:Hash:Queue:Recno + +%_dbi_tags_4 Packages:Name:Version:Release:Arch:Os:Basenames:Group:Providename:Requirename:Conflictname:Obsoletename:Triggername:Dirnames:Installtid:Sigmd5:Sha1header:Filedigests:Pubkeys:Packagecolor:Nvra:Sourcepkgid:Filepaths:Seqno + +# database configuration: Berkeley-DB [dbapi 3 hooks] +%_dbi_config_3 %{_dbi_btconfig} +%_dbi_config_3_Arch %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Basenames %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Conflictname %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Conflictyamlentry %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Dirnames %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Filedigests %{_dbi_htconfig} %{?_h_dupsort} +%_dbi_config_3_Filepaths %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Group %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Installtid %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Name %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Nvra %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Obsoletename %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Obsoleteyamlentry %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Os %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Packagecolor %{_dbi_htconfig} %{?_h_dupsort} +%_dbi_config_3_Providename %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Provideyamlentry %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Pubkeys %{_dbi_htconfig} %{?_h_dupsort} +%_dbi_config_3_Release %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Removetid %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Requirename %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Requireyamlentry %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Sha1header %{_dbi_htconfig} %{?_h_dupsort} +%_dbi_config_3_Sigmd5 %{_dbi_htconfig} %{?_h_dupsort} +%_dbi_config_3_Sourcepkgid %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Triggername %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Version %{_dbi_btconfig} %{?_bt_dupsort} +%_dbi_config_3_Packages %{_dbi_btconfig} +%_dbi_config_3_Depcache %{_dbi_btconfig} temporary private +%_dbi_config_3_Seqno %{_dbi_btconfig} seq_id=0 +%_dbi_config_3_Btree btree %{?__dbi_perms} debug +%_dbi_config_3_Hash hash %{?__dbi_perms} debug +%_dbi_config_3_Queue queue %{?__dbi_perms} debug +%_dbi_config_3_Recno recno %{?__dbi_perms} debug +%_dbi_config_3_Heap heap %{?__dbi_perms} debug + +# database configuration: SQLite [dbapi 4 hooks] +%_dbi_config_4 %{_dbi_sqlconfig} +%_dbi_config_4_Arch %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Basenames %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Conflictname %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Conflictyamlentry %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Dirnames %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Filedigests %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Filepaths %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Group %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Installtid %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Name %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Nvra %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Obsoletename %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Obsoleteyamlentry %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Os %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Packagecolor %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Providename %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Provideyamlentry %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Pubkeys %{_dbi_sqlconfig} %{?_bt_dupsort} debug +%_dbi_config_4_Release %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Removetid %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Requirename %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Requireyamlentry %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Sha1header %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Sigmd5 %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Sourcepkgid %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Triggername %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Version %{_dbi_sqlconfig} %{?_bt_dupsort} +%_dbi_config_4_Packages %{_dbi_sqlconfig} +%_dbi_config_4_Depcache %{_dbi_sqlconfig} temporary private +%_dbi_config_4_Seqno %{_dbi_sqlconfig} seq_id=0 + +# database configuration [code entry hooks] +%_dbi_config %{expand:%%{_dbi_config_%{_dbapi_used}}} +%_dbi_config_Arch %{expand:%%{_dbi_config_%{_dbapi_used}_Arch}} +%_dbi_config_Basenames %{expand:%%{_dbi_config_%{_dbapi_used}_Basenames}} +%_dbi_config_Conflictname %{expand:%%{_dbi_config_%{_dbapi_used}_Conflictname}} +%_dbi_config_Conflictyamlentry %{expand:%%{_dbi_config_%{_dbapi_used}_Conflictyamlentry}} + +%_dbi_config_Dirnames %{expand:%%{_dbi_config_%{_dbapi_used}_Dirnames}} +%_dbi_config_Filedigests %{expand:%%{_dbi_config_%{_dbapi_used}_Filedigests}} +%_dbi_config_Filepaths %{expand:%%{_dbi_config_%{_dbapi_used}_Filepaths}} +%_dbi_config_Group %{expand:%%{_dbi_config_%{_dbapi_used}_Group}} +%_dbi_config_Installtid %{expand:%%{_dbi_config_%{_dbapi_used}_Installtid}} +%_dbi_config_Name %{expand:%%{_dbi_config_%{_dbapi_used}_Name}} +%_dbi_config_Nvra %{expand:%%{_dbi_config_%{_dbapi_used}_Nvra}} +%_dbi_config_Obsoletename %{expand:%%{_dbi_config_%{_dbapi_used}_Obsoletename}} +%_dbi_config_Obsoleteyamlentry %{expand:%%{_dbi_config_%{_dbapi_used}_Obsoleteyamlentry}} +%_dbi_config_Os %{expand:%%{_dbi_config_%{_dbapi_used}_Os}} +%_dbi_config_Packagecolor %{expand:%%{_dbi_config_%{_dbapi_used}_Packagecolor}} +%_dbi_config_Providename %{expand:%%{_dbi_config_%{_dbapi_used}_Providename}} +%_dbi_config_Provideyamlentry %{expand:%%{_dbi_config_%{_dbapi_used}_Provideyamlentry}} +%_dbi_config_Pubkeys %{expand:%%{_dbi_config_%{_dbapi_used}_Pubkeys}} +%_dbi_config_Release %{expand:%%{_dbi_config_%{_dbapi_used}_Release}} +%_dbi_config_Removetid %{expand:%%{_dbi_config_%{_dbapi_used}_Removetid}} +%_dbi_config_Requirename %{expand:%%{_dbi_config_%{_dbapi_used}_Requirename}} +%_dbi_config_Requireyamlentry %{expand:%%{_dbi_config_%{_dbapi_used}_Requireyamlentry}} +%_dbi_config_Sha1header %{expand:%%{_dbi_config_%{_dbapi_used}_Sha1header}} +%_dbi_config_Sigmd5 %{expand:%%{_dbi_config_%{_dbapi_used}_Sigmd5}} +%_dbi_config_Sourcepkgid %{expand:%%{_dbi_config_%{_dbapi_used}_Sourcepkgid}} +%_dbi_config_Triggername %{expand:%%{_dbi_config_%{_dbapi_used}_Triggername}} +%_dbi_config_Version %{expand:%%{_dbi_config_%{_dbapi_used}_Version}} +%_dbi_config_Packages %{expand:%%{_dbi_config_%{_dbapi_used}_Packages}} +%_dbi_config_Depcache %{expand:%%{_dbi_config_%{_dbapi_used}_Depcache}} +%_dbi_config_Seqno %{expand:%%{_dbi_config_%{_dbapi_used}_Seqno}} + +# Database API configuration: +# +# 0,1: Berkeley-DB 1.x API (no longer supported) +# 2: Berkeley-DB 2.x API (no longer supported) +# 3: Berkeley-DB 3.x/4.x API (default) +# 4: SQLite 3.x API (alternative) +# +# There are different macros so that --rebuilddb can convert the +# database between formats (usually for upgrading purposes) +# +%_dbapi @DBAPI@ +%_dbapi_used %{_dbapi} + +# +# Export package NEVRA (stamped with install tid) info for HRMIB on this path. +# +# XXX Note: escaped %% for use in headerSprintf() +#%_hrmib_path /var/cache/hrmib/%{___NVRA} + +#============================================================================== +# ---- GPG/PGP/PGP5 signature macros. +# Macro(s) to hold the arguments passed to GPG/PGP for package +# signing and verification. +# +%__gpg_check_password_cmd %{__gpg} \ + gpg --batch --no-verbose --passphrase-fd 3 -u "%{_gpg_name}" -so - +#%__pgp_check_password_cmd %{__pgp} \ +# pgp +batchmode=on +verbose=0 "%{_pgp_name}" -sf +#%__pgp5_check_password_cmd %{__pgp} \ +# pgps +batchmode=on +verbose=0 +armor=off "%{_pgp_name}" -f + +%__gpg_sign_cmd %{__gpg} \ + gpg --batch --no-verbose --no-armor --passphrase-fd 3 --no-secmem-warning \ + -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename} +#%__pgp_sign_cmd %{__pgp} \ +# pgp +batchmode=on +verbose=0 +armor=off \ +# "+myname=%{_pgp_name}" -sb %{__plaintext_filename} %{__signature_filename} +#%__pgp5_sign_cmd %{__pgp} \ +# pgps +batchmode=on +verbose=0 +armor=off \ +# "+myname=%{_pgp_name}" -b %{__plaintext_filename} -o %{__signature_filename} + +# rpm-5.0 and later verifies signatures internally using beecrypt/NSS/openssl +#%__gpg_verify_cmd %{__gpg} \ +# gpg --batch --no-verbose --verify --no-secmem-warning \ +# %{__signature_filename} %{__plaintext_filename} +#%__pgp_verify_cmd %{__pgp} \ +# pgp +batchmode=on +verbose=0 \ +# %{__signature_filename} %{__plaintext_filename} +#%__pgp5_verify_cmd %{__pgp} \ +# pgpv +batchmode=on +verbose=0 \ +# +OutputInformationFD=1 +OutputWarningFD=1 \ +# -o %{__signature_filename} %{__plaintext_filename} + +# +# XXX rpm-4.1 verifies prelinked libraries using a prelink undo helper. +# Normally this macro is defined in %{_etcrpm}/macros.prelink, installed +# with the prelink package. If the macro is undefined, then prelinked +# shared libraries contents are MD5 digest verified (as usual), rather +# than MD5 verifying the output of the prelink undo helper. +# +# Note: The 2nd token is used as argv[0] and "library" is a +# placeholder that will be deleted and replaced with the appropriate +# library file path. +#%__prelink_undo_cmd /usr/sbin/prelink prelink -y library + +# Horowitz Key Protocol server configuration +# +#%_hkp_keyserver hkp://keys.n3npq.net +%_hkp_keyserver hkp://pool.sks-keyservers.net +%_hkp_keyserver_query %{_hkp_keyserver}/pks/lookup?op=get&search= + + +%_nssdb_path /etc/pki/nssdb +#============================================================================== +# ---- Transaction macros. +# Macro(s) used to parameterize transactions. +# + +# The default transaction color. This value is a set of bits to +# determine file and dependency affinity for this arch. +# 0 uncolored (i.e. use only arch as install hint) +# 1 Elf32 permitted +# 2 Elf64 permitted +# 4 MIPS reserved +%_transaction_color @RPMCANONCOLOR@ + +# A default autorelocation path prefixed to file paths of packages +# that have an incompatible arch. This is used on ia64 to prefix +# /emul/ia32 to i386 file paths, and nowhere else (yet). +# +# XXX Note: escaped %% for use in headerSprintf() +#%_autorelocate_path @autorelocate_path@ + +# A default directory color to choose when directories are +# auto-relocated. +#%_autorelocate_dcolor @autorelocate_dcolor@ + +# Open all indices before doing chroot(2). +# +#%_openall_before_chroot 0 + +# The path to the dependency universe database. The default value +# is the rpmdb-vendor location. The macro is usually defined in +# %{_etcrpm}/macros.solve, installed with the rpmdb-vendor package. +#%_solve_dbpath /usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/rpm + +# The path to the dependency universe packages. This should +# be a path to the packages contained in the solve database. +# +# XXX Note: needs a pesky trailing / +#%_solve_pkgsdir /mnt/rpm/test/latest-i386/RedHat/RPMS/ + +# The output binary package file name template used when suggesting +# binary packages that solve a dependency. The macro is usually defined +# in %{_etcrpm}/macros.solve, installed with the rpmdb-vendor package. +# +# XXX Note: escaped %% for use in headerSprintf() +#%_solve_name_fmt %{?_solve_pkgsdir}%{___NVRA}.rpm + +# The output binary package file name template used when repackaging +# erased packages. +# +# XXX Note: escaped %% for use in headerSprintf() +%_repackage_name_fmt %{___NVRA}.rpm + +# The "transactional rollback" directory in which erased packages will +# be saved when using the --repackage option. +%_repackage_dir %{_var}/spool/repackage + +# A path (i.e. URL) prefix that is pre-pended to %{_repackage_dir}. +%_repackage_root %{nil} + +# If non-zero, all erasures will be automagically repackaged. +%_repackage_all_erasures 1 + +# Prevent pure erasure transactions with --rollback. Pure +# erasure rollback transactions will undo an anaconda install, +# for example, which %_unsafe_rollbacks tries to prevent. +# +# Set this to non-zero at your own risk, it's dangerous. +%_unsafe_rollbacks 0 + +# Automate transaction rollbacks on upgrade failure. +# +# Set this to non-zero at your own risk, it's dangerous. +%_rollback_transaction_on_failure 0 + +# Verify digest/signature flags for various rpm modes: +# 0x30300 (_RPMVSF_NODIGESTS) --nohdrchk if set, don't check digest(s) +# 0xc0c00 (_RPMVSF_NOSIGNATURES) --nosignature if set, don't check signature(s) +# 0xf0000 (_RPMVSF_NOPAYLOAD) --nolegacy if set, check header+payload (if possible) +# 0x00f00 (_RPMVSF_NOHEADER) --nohdrchk if set, don't check rpmdb headers +# +# For example, the value 0xf0c00 (=0xf0000+0xc0c00) disables legacy +# digest/signature checking, disables signature checking, but attempts +# digest checking, also when retrieving headers from the database. +# +# The checking overhead was ~11ms per header for digests/signatures on +# a 600 Mhz Dell SMP server circa 1998. +# +# Each header from the database is checked only when first encountered +# for each database open. +# +# Note: the %_vsflags_erase applies to --upgrade/--freshen modes as +# well as --erase. +# +%__vsflags 0xf0000 +%_vsflags_build %{__vsflags} +%_vsflags_erase %{__vsflags} +%_vsflags_install %{__vsflags} +%_vsflags_query %{__vsflags} +%_vsflags_verify %{__vsflags} + +# Choose keyutils keyring type: +# +# group KEY_SPEC_GROUP_KEYRING +# process KEY_SPEC_PROCESS_KEYRING +# session KEY_SPEC_SESSION_KEYRING +# thread KEY_SPEC_THREAD_KEYRING +# user KEY_SPEC_USER_KEYRING +# user_session KEY_SPEC_USER_SESSION_KEYRING +# +%_keyutils_keyring process + +# Relations between package names that cause dependency loops +# with legacy packages that cannot be fixed. Relations are +# specified as +# p>q +# where package p has a Requires: on something that package q Provides: +# +# XXX Note: that there cannot be any whitespace within the string "p>q", +# and that both p and q are package names (i.e. no version/release). +# +%_dependency_whiteout_caos_core \ + perl>perl-Filter \ + pam>coreutils \ + pam>initscripts \ + glibc-common>glibc \ + glibc>nscd \ + filesystem>setup + +%_dependency_whiteout \ + %{?_dependency_whiteout_caos_core} \ + %{?_dependency_whiteout_system} \ + %{nil} + +# +# Default path used for serializing transactions with a fcntl lock. +# +# The original, FHS clompliant, path was /var/lock/run/transaction, +# but the transaction lock needs to be finer grained, at least +# per-database, not global, for many rpm operations with transaction sets. +# +# The fcntl lock is now off by default, posix mutexes (or equiv) are sufficient. +# to protect Berkeley DB data, and using multiple databases with concurrent +# access is a more important feature to rpm than serializing transaction +# sets. Change your configuration if you disagree. +# +# XXX Note: the suggested file name is __db.000 to expedite +# support issues, because users typically do "rm -f /var/lib/rpm/__db*", +# which will clean up the fcntl lock at the same time. +#%_rpmlock_path %{_dbpath}/__db.000 + +#============================================================================== +# ---- Query macros. +# +# Default query format string for displaying package names everywhere +%___NVRA %%{NAME}-%%{VERSION}-%%{RELEASE}%%|DISTTAG?{-%%{DISTTAG}%%|DISTEPOCH?{%%{DISTEPOCH}}|}|%%|ARCH?{.%%|SOURCERPM?{%%{ARCH}}:{src}|}:{}| + + +# Default headerSprintf() output format string for rpm -qa +# +# XXX Note: escaped %% for use in headerSprintf() +%_query_all_fmt %{___NVRA} + +# +# Path for rpm -qH (default is /usr/share/comps/%{_arch}/hdlist) +%_query_hdlist_path %{_datadir}/comps/%{_arch}/hdlist + +# +# Permit network access? (".fdio" prohibits network access) +%_rpmgio .fdio + +# +# Pattern matching for installation via "+N-V-R.A" CLI arguments +#%_rpmgi_pattern_glob() %{_rpmdir}/%1-*-*.*.rpm +%_rpmgi_pattern_glob %{_rpmdir}/*/ +%_rpmgi_pattern_regex() ^.+/%1-[^-]+-[^-]+\\.[^.]+\\.rpm$ + +# +# UUIDv3/UUIDv5 namespace URI macros. The complete canonical path is +# %_uuid_uri %{?_uuid_auth}/%{?_uuid_path}/Tagname/Tagvalue +%_uuid_auth http://rpm5.org/ +%_uuid_path /package + +#============================================================================== +# ---- EVRD... dependency tuple comparison macros. +# + +# STEP 1: Match the string and capture regex parts +# 1 2 3 4 +# X ":" X "-"X ":"X +%evr_tuple_match ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$ + +# STEP 2: Assemble tuple from regex parts +# case 1: case 2: case 3: case 4: case 5: case 6: +# X:X-X:X X:X-X X:X X: X-X X +# %evr_tuple_select 1234 123_ 12__ 1___ _23_ _2__ +%evr_tuple_select 123_ + +# STEP 3: Configure the comparison order of the tuple elements +%evr_tuple_order EVR + +# data validation patterns for identifier tags +%pattern_Name ^[A-Za-z0-9][A-Za-z0-9+._-]*$ +%pattern_Epoch ^[0-9]+$ +%pattern_Version ^[A-Za-z0-9+._]+$ +%pattern_Release ^[A-Za-z0-9+._]+$ +%pattern_Disttag ^[A-Za-z0-9]+$ +%pattern_Repotag ^[A-Za-z0-9]+$ +%pattern_Distepoch ^[A-Za-z0-9.]+$ +#%pattern_Url +#%pattern_Cvsid +#%pattern_Group +#%pattern_Summary +#%pattern_Distribution +#%pattern_Vendor +#%pattern_License +#%pattern_Packager +#%pattern_Buildroot +#%pattern_Keywords +#%pattern_Variants +#%pattern_Prefixes +#%pattern_Docdir +#%pattern_Xmajor +#%pattern_Xminor +#%pattern_Autoreqprov +#%pattern_Autoreq +#%pattern_Autoprov +#%pattern_Source +#%pattern_Patch +#%pattern_Icon +#%pattern_Nosource +#%pattern_Nopatch +#%pattern_Buildprereq +#%pattern_Buildprovides +#%pattern_Buildrequires +#%pattern_Buildconflicts +#%pattern_Buildobsoletes +#%pattern_Buildsuggests +#%pattern_Buildenhances +#%pattern_Prereq +#%pattern_Provideflags +#%pattern_Requireflags +#%pattern_Conflictflags +#%pattern_Obsoleteflags +#%pattern_Suggestsflags +#%pattern_Enhancesflags +#%pattern_Buildplatforms +#%pattern_Excludearch +#%pattern_Exclusivearch +#%pattern_Excludeos +#%pattern_Exclusiveos +#%pattern_Buildarchs + +#============================================================================== +# ---- Run-time probe dependency macros. + +# +%_rpmds_filter_name archfilter + +# +%_rpmds_cpuinfo_path /proc/cpuinfo + +# +%_rpmds_sysinfo_path %{_etcrpm}/sysinfo + +# +%_rpmds_ldconfig_cmd /sbin/ldconfig -p +%_rpmds_ldconfig_cache /etc/ld.so.cache + +# A colon-separated list of directories which should match the rld's +# (runtime loader) list of directories it searches for shared objects. +# Only used on platforms that don't have a configurable loader search +# path via ldconfig, crle, or something similar. +#%_rpmds_rld_search_path /lib:/usr/lib + +# +# Full path and arguments to Solaris' command to list what directories +# the runtime loader searches. Needs to include `-64' for LP64 Solaris +# systems. +#%_rpmds_crle_cmd /usr/bin/crle + +# +%_rpmds_getconf_path / + +# +%_rpmds_perldeps_cmd %{__find} %{_libdir}/perl5 | %{_rpmhome}/perl.prov + +# +%_varrun /var/run + +#============================================================================== +# ---- Cache configuration macros. +# Macro(s) used to configure the universe of headers used to +# solve dependencies using rpmcache(8). +# +# Note: These values were specific to my machine, and most certainly +# are incorrect for any other machine. The macros are +# included here only to document the macro names and usage. +#%_bhpath file://localhost/mnt/dist +#%_bhcoll @(7.3|7.2|7.1|7.1sbe|7.1k|7.0|7.01j|7.0j|7.0sbe|7.0tc|6.2|6.2ha|6.2ee|6.1|6.0|5.2|5.1|5.0) +#%_bhN @(SRPMS|i386|alpha|sparc|s390|ia64) +#%_bhVR @(RedHat|Fedora) +#%_bhA RPMS + +# +# A configuration to build an rpmdb from yum package hierarchy +%_bhpath file://%{_varcachewdj} +%_bhcoll @(updates) +%_bhN @(packages) +%_bhVR %{nil} +%_bhA %{nil} + +# The cache database directory. +%_cache_dbpath %{_varcachewdj}/rpmdb + +#============================================================================== +# ---- per-platform macros. +# Macros that are specific to an individual platform. The values here +# will be used if the per-platform macro file does not exist.. +# +%_arch @RPMCANONARCH@ +%_build_arch @RPMCANONARCH@ +%_vendor @RPMCANONVENDOR@ +%_os @RPMCANONOS@ +%_gnu @RPMCANONGNU@ + +%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu} +%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu} +%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_gnu} + +#============================================================================== +# ---- configure macros. +# Macro(s) slavishly copied from autoconf's config.status. +# +%_prefix @prefix@ +%_exec_prefix %{_prefix} +%_datarootdir %{_prefix}/share +%_bindir %{_exec_prefix}/bin +%_sbindir %{_exec_prefix}/sbin +%_libexecdir %{_exec_prefix}/libexec +%_datadir %{_datarootdir} +%_sysconfdir %{_prefix}/etc +%_sharedstatedir %{_prefix}/com +%_localstatedir %{_prefix}/var +%_lib lib +%_libdir %{_exec_prefix}/%{_lib} +%_includedir %{_prefix}/include +%_oldincludedir /usr/include +%_infodir %{_datarootdir}/info +%_mandir %{_datarootdir}/man +%_localedir %{_datarootdir}/locale +%_lispdir %{_datarootdir}/emacs/site-lisp +%_initddir %{_sysconfdir}/rc.d/init.d +# This is a deprecated misspelling, present for backwards compatibility. +%_initrddir %{_initddir} + +#--------------------------------------------------------------------- +# Multilibs +%_multilibpatt (/%{_lib}|/usr/%{_lib}(|/gconv)|/usr/local/%{_lib}|/usr/X11R6/%{_lib}|/opt/%{_lib})/[^/]*\\.([oa]|la|so[0-9.]*)$ + +#============================================================================== +# ---- config.guess platform macros. +# Macro(s) similar to the tokens used by configure. +# +%_build %{_host} +%_build_alias %{_host_alias} +%_build_cpu %{_host_cpu} +%_build_vendor %{_host_vendor} +%_build_os %{_host_os} +%_host @host@ +%_host_alias @host_alias@%{nil} +%_host_cpu @host_cpu@ +%_host_vendor @host_vendor@ +%_host_os @host_os@ +%_target %{_host} +%_target_alias %{_host_alias} +%_target_cpu %{_host_cpu} +%_target_vendor %{_host_vendor} +%_target_os %{_host_os} + +#------------------------------------------------------------------------ +# lua macros +# +#%rpm_license_check %{expand:%%define rpm_license_check %{lua:\ +#f = io.open("/dev/tty", "w")\ +#if f then\ +# f:write ("\\nJust checking to see who is using rpm-@VERSION@.\\nThe RPM Package Manager license is LGPL, as always.\\nRelax ...\\n")\ +# f:close()\ +#end\ +#}1}%{rpm_license_check} + +#------------------------------------------------------------------------ +# executable(...) configuration. +# +# Path to scripts to autogenerate executable(foo) script dependencies, +# +# Note: Used iff _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +#%__executable_provides %{_rpmhome}/executabledeps.sh --provides +#%__executable_requires %{_rpmhome}/executabledeps.sh --requires +%__scriptlet_requires %{__bash} --rpm-requires + +#============================================================================== +# ---- embedded inyterpreter macros. +# +# Embedded interpreter commands run when an interpreter is instantiated. +# + +%_luaI_init %{nil} + +%_tclI_init %{nil} + +%_perlI_init use RPM;\ +%{nil} + +%_rubyI_init %{nil} + +%_pythonI_init import rpm\ +%{nil} + +#============================================================================== +# XXX Caveat: +# XXX With %{load:...} being interpreted immediately -- not lazily -- +# XXX within a macro init file, a failure to load causes immediate loading +# XXX termination silently. +# XXX +# XXX So the order as well as the existence of the %{load:...} macros below +# XXX are critically important. +# XXX +# XXX Note also that loaded macro files can NOT recursively load other +# XXX macro files; only a top-level (i.e. after --macros, or within a *.spec) +# XXX file is permitted to do %{load:...}. The reason for the rule is to +# XXX prevent recursive loops: there's no known need for immediate loading +# XXX EXCEPT as a construction artifact while splitting rpmbuild macros +# XXX from other structural configuration (like paths and booleans) used +# XXX for configuring RPM itself. +# XXX +# XXX Simple example(s): +# XXX If the file %{_usrlibrpm}/macros.d/selinux doesn't exist, +# XXX then %{_usrlibrpm}/macros.rpmbuild will NOT be loaded. +# XXX +# XXX if the file %{_usrlibrpm}/macros.d/cmake attempts another +# XXX %{load:...}, then loading will CEASE at that point in the file. +#============================================================================== +# ---- SELinux configuration macros. +#%%{load:%{_usrlibrpm}/macros.d/selinux} + +#============================================================================== +# ---- rpmbuild macros. +#%%{load:%{_usrlibrpm}/macros.rpmbuild} + +#------------------------------------------------------------------------ +# cmake(...) configuration +#%%{load:%{_usrlibrpm}/macros.d/cmake} + +#------------------------------------------------------------------------ +# gstreamer(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/gstreamer} + +#------------------------------------------------------------------------ +# haskell(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/haskell} + +#------------------------------------------------------------------------ +# perl(...) configuration +#%%{load:%{_usrlibrpm}/macros.d/perl} + +#------------------------------------------------------------------------ +# python(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/python} + +#------------------------------------------------------------------------ +# php(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/php} + +#------------------------------------------------------------------------ +# java(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/java} + +#------------------------------------------------------------------------ +# libtool(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/libtool} + +#------------------------------------------------------------------------ +# pkgconfig(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/pkgconfig} + +#------------------------------------------------------------------------ +# mono(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/mono} + +#------------------------------------------------------------------------ +# ruby(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/ruby} + +#------------------------------------------------------------------------ +# tcl(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/tcl} + +#------------------------------------------------------------------------ +# typelib(...) configuration. +#%%{load:%{_usrlibrpm}/macros.d/typelib} + +# \endverbatim +#*/ diff --git a/rpm-5.4.9/macros/macros.rpmbuild b/rpm-5.4.9/macros/macros.rpmbuild new file mode 100644 index 0000000..0fe6320 --- /dev/null +++ b/rpm-5.4.9/macros/macros.rpmbuild @@ -0,0 +1,660 @@ +#/*! \page build_macros Default configuration: /usr/lib/rpm/macros.rpmbuild +# \verbatim +# +# $Id: macros.rpmbuild.in,v 1.4.4.12 2011/10/21 15:39:02 jbj Exp $ +# +# This file contains rpmbuild configuration macros. +# + +#============================================================================== +# ---- Build system path macros. +# +%__ar ar +%__as /usr/bin/as +%__cc gcc +%__cpp gcc -E +%__cxx g++ +%__ld /usr/bin/ld +%__nm /usr/bin/nm +%__objcopy /usr/bin/objcopy +%__objdump /usr/bin/objdump +%__ranlib ranlib +%__remsh %{__rsh} +%__strip /usr/bin/strip + +# XXX avoid failures if tools are not installed when rpm is built. +%__libtoolize libtoolize +%__aclocal aclocal +%__autoheader autoheader +%__automake automake +%__autoconf autoconf + +#============================================================================== +# ---- Conditional build macro templates. + +# Check if symbol is defined. +# Example usage: %if %{defined with_foo} && %{undefined with_bar} ... +%defined() %{expand:%%{?%{1}:1}%%{!?%{1}:0}} +%undefined() %{expand:%%{?%{1}:0}%%{!?%{1}:1}} + +# Shorthand for %{defined with_...} +%with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}} +%without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}} + +# Handle conditional builds. %bcond_with is for case when feature is +# default off and needs to be activated with --with ... command line +# switch. %bcond_without is for the dual case. +# +# %bcond_with foo defines symbol with_foo if --with foo was specified on +# command line. +# %bcond_without foo defines symbol with_foo if --without foo was *not* +# specified on command line. +# +# For example (spec file): +# +# (at the beginning) +# %bcond_with extra_fonts +# %bcond_without static +# (and later) +# %if %{with extra_fonts} +# ... +# %else +# ... +# %endif +# %if ! %{with static} +# ... +# %endif +# %ifdef %{with static} +# ... +# %endif +# %{?with_static: ... } +# %{!?with_static: ... } +# %{?with_extra_fonts: ... } +# %{!?with_extra_fonts: ... } + +# +# The bottom line: never use without_foo, _with_foo nor _without_foo, only +# with_foo. This way changing default set of bconds for given spec is just +# a matter of changing single line in it and syntax is more readable. +%bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}} +%bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}} + +#============================================================================== +# ---- Optional macros. +# Macros that are initialized as a side effect of spec +# file parsing. +# +# The sub-directory (relative to %{_builddir}) where sources are compiled. +# This macro is set after processing %setup, either explicitly from the +# value given to -n or the default name-version. +# +#%buildsubdir + +# Truncate changelogs to no. of entries or date. +# <=0 disables +# <1000 truncates to no. of entries +# Otherwise, a get_date string (e.g. "2 years ago") may be entered, +# and changelog entries older than that date will not be added to headers. +%_changelog_truncate 1 year ago + +# Configurable distribution information, same as Distribution: tag in a +# specfile. +# +#%distribution + +# Configurable bug URL, same as BugURL: tag in a specfile. +# The URL will be used to supply reliable information to where +# to file bugs. +# +#%bugurl + +# +# Deprecated. +# +#%_langpatt + +# Configurable packager information, same as Packager: in a specfile. +# +#%packager + +# Compression type and level for source/binary package payloads. +# "w9.gzdio" gzip level 9 (default). +# "w9.bzdio" bzip2 level 9. +# "w6.lzdio" lzma level 6 (legacy, stable). +# "w6.xzdio" xz level 6 (obsoletes lzma, unstable). +# +#%_source_payload w9.gzdio +#%_binary_payload w9.gzdio + +# Archive formats to use for source/binary package payloads. +# "cpio" cpio archive (default) +# "ustar" tar archive +# +#%_source_payload_format cpio +#%_binary_payload_format cpio + +# Configurable vendor information, same as Vendor: in a specfile. +# +#%vendor + +# Default fuzz level for %patch in spec file. +#%_default_patch_fuzz -1 + +# Default patch flags +%_default_patch_flags -s + +#============================================================================== +# ---- Build configuration macros. +# +# Package version macro. +# The type of package to produce, for compatibility with legacy +# versions of rpm. +# +# This is an rpm version, e.g. 30005 means to produce packaging compatible +# with rpm-3.0.5. At the moment, values < 30005 (i.e. compatibility with +# version before rpm-3.0.5) are not supported. The only incompatible change +# in rpm packaging since rpm-3.0.5 has been to replace a 3 with a 4 in the +# rpmlead, so there's little need to use any value greater than 30005. +# +%_package_version 30005 + +# +# The patch macro writes 1 line of shell code to (optionally) uncompress +# a file and apply using patch(1). +# + +%patch(b:p:P:REz:F:d:) %{shrink:\ +%define __patch_number %{-P:%{-P*}}%{!-P:0} \ +%define __patch_file %{P:%{__patch_number}} \ +%define __patch_suffix %{-b:-b --suffix %{-b*}} %{-z:--suffix %{-z*}} \ +%define __patch_fuzz %{?_default_patch_fuzz:%(test %{_default_patch_fuzz} -ge 0 && echo "--fuzz=%{_default_patch_fuzz} ")} \ +%define __patch_options %{_default_patch_flags} %{-p:-p%{-p*}} %{-F:-F%{-F*}} %{-d:-d%{-d*}} %{-R} %{-E} %{__patch_suffix} \ +echo "Patch #%{__patch_number} (%{basename:%{__patch_file}}):" && ( %{uncompress:%{__patch_file}} | %{__patch} %{__patch_fuzz}%{__patch_options} ) || exit 1\ +} + +# +# Script gets packaged file list on input and buildroot as first parameter. +# Returns list of unpackaged files, i.e. files in $RPM_BUILD_ROOT not packaged. +# +# Note: Disable (by commenting out) for legacy compatibility. +%__check_files %{_rpmhome}/check-files %{buildroot} + +# +# Should unpackaged files in a build root terminate a build? +# +# Note: The default value should be 0 for legacy compatibility. +%_unpackaged_files_terminate_build 1 + +# +# Should missing %doc files in the build directory terminate a build? +# +# Note: The default value should be 0 for legacy compatibility. +%_missing_doc_files_terminate_build 1 + +# +# Should an ELF file processed by find-debuginfo.sh having no build ID +# terminate a build? This is left undefined to disable it and defined to +# enable. +# +#%_missing_build_ids_terminate_build 1 + +# +# Use internal dependency generator rather than external helpers? +# 0 - Use external generator +# 1 - Use internal generator if available +# 2 - Use __scriptlet_requires to process scriptlet dependencies +%_use_internal_dependency_generator 2 + +# +# Disabler for adding /bin/sh scriptlet interpreter dependencies. +%_disable_shell_interpreter_deps 0 + +# +# Filter GLIBC_PRIVATE Provides: and Requires: +%_filter_GLIBC_PRIVATE 0 + +# +# Path to scripts to autogenerate package dependencies, +# +# Note: Used iff _use_internal_dependency_generator is zero. +#%__find_provides %{_rpmhome}/rpmdeps --provides +#%__find_requires %{_rpmhome}/rpmdeps --requires +%__find_provides %{_rpmhome}/find-provides +%__find_requires %{_rpmhome}/find-requires +#%__find_conflicts ??? +#%__find_obsoletes ??? + +# +# fixowner, fixgroup, and fixperms are run at the end of hardcoded setup +# These macros are necessary only for legacy compatibility, and have moved +# to per-platform macro configuration (i.e. %{_usrlibrpm}/arch>-/macros) +# +# Note: These are no longer enabled by default. +#%__id_u %{__id} -u +#%__chown_Rhf %{__chown} -Rhf +#%__chgrp_Rhf %{__chgrp} -Rhf +#%_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root +#%_fixgroup [ `%{__id_u}` = '0' ] && %{__chgrp_Rhf} root +#%_fixperms %{__chmod} -Rf a+rX,u+w,g-w,o-w +# + +# +# Choose metadata file digest algorithm: +# 1 MD5 +# 2 SHA1 +# 3 RIPEMD-160 +# 5 MD2 +# 6 TIGER-192 +# 8 SHA256 +# 9 SHA384 +# 10 SHA512 +# 11 SHA224 +# 104 MD4 +# 105 RIPEMD-128 +# 106 CRC-32 +# 107 ADLER-32 +# 108 CRC-64 (ECMA-182 polynomial, untested uint64_t problems) +# 109 Jenkins lookup3.c hashlittle() +# 111 RIPEMD-256 +# 112 RIPEMD-320 +# +# Note: choosing anything but MD5 introduces instant legacy incompatibility. +%_build_file_digest_algo 1 +%_build_binary_file_digest_algo %{_build_file_digest_algo} +%_build_source_file_digest_algo %{_build_file_digest_algo} + +# +# Byte size of line buffer for .spec file parsing +%_spec_line_buffer_size 100000 + +# +# Maximum Icon: graphic file size (undefined or < 2048 uses 2048). +%_build_iconsize 2048 + +# The output binary package file name template used when building +# binary packages. +# +# XXX Note: escaped %% for use in headerSprintf() +%_build_name_fmt %%{ARCH}/%{___NVRA}.rpm + +#============================================================================== +# ---- per-platform macros. +# Macros that are specific to an individual platform. The values here +# will be used if the per-platform macro file does not exist.. +# + +# +# Define a generic value for optflags. Normally overridden by per-target macros. +%optflags -O2 + +# +# Define per-arch and per-os defaults. Normally overridden by per-target macros. +%__arch_install_post %{nil} +%__os_install_post %{___build_post} + +#============================================================================== +# ---- Scriptlet template templates. +# Global defaults used for building scriptlet templates. +# + +%___build_shell %{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh} +%___build_args -e +%___build_cmd %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args} +%___build_pre \ + RPM_OPT_FLAGS=\"%{optflags}\"\ + export RPM_OPT_FLAGS\ + %{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\ + export RPM_BUILD_ROOT}\ + %{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\ + export CLASSPATH}\ + unset PERL_MM_OPT || :\ + LC_ALL=C\ + export LC_ALL\ + LANG=C\ + export LANG\ + unset DISPLAY || :\ + unset LINGUAS || :\ + unset LANGUAGE || :\ + unset LC_MESSAGES || :\ + \ + %{verbose:set -x}%{!verbose:exec > /dev/null}\ + umask 022\ + cd "%{u2p:%{_builddir}}"\ + + +#%___build_body %{nil} +%___build_post exit 0 + +%___build_template #!%{___build_shell}\ +%{___build_pre}\ +%{nil} + +#%{___build_body}\ +#%{___build_post}\ +#%{nil} + +#============================================================================== +# ---- Scriptlet templates. +# Macro(s) that expand to a command and script that is executed. +# CAVEAT: All macro expansions must fit in a BUFSIZ (8192 byte) buffer. +# +%__spec_prep_shell %{___build_shell} +%__spec_prep_args %{___build_args} +%__spec_prep_cmd %{___build_cmd} +%__spec_prep_pre %{___build_pre} +%__spec_prep_body %{___build_body} +%__spec_prep_post %{___build_post} +%__spec_prep_template #!%{__spec_prep_shell}\ +%{__spec_prep_pre}\ +%{nil} + +#%{__spec_prep_body}\ +#%{__spec_prep_post}\ +#%{nil} + +%__spec_build_shell %{___build_shell} +%__spec_build_args %{___build_args} +%__spec_build_cmd %{___build_cmd} +%__spec_build_pre %{___build_pre} +%__spec_build_body %{___build_body} +%__spec_build_post %{___build_post} +%__spec_build_template #!%{__spec_build_shell}\ +%{__spec_build_pre}\ +%{nil} + +#%{__spec_build_body}\ +#%{__spec_build_post}\ +#%{nil} + +%__spec_install_shell %{___build_shell} +%__spec_install_args %{___build_args} +%__spec_install_cmd %{___build_cmd} +%__spec_install_pre %{___build_pre}\ +%{?buildroot:%{__rm} -rf '%{buildroot}'; %{__mkdir_p} '%{buildroot}'} +%__spec_install_body %{___build_body} +%__spec_install_post\ +%{?__debug_package:%{__debug_install_post}}\ +%{__arch_install_post}\ +%{__os_install_post}\ +%{nil} +%__spec_install_template #!%{__spec_install_shell}\ +%{__spec_install_pre}\ +%{nil} + +#%{__spec_install_body}\ +#%{__spec_install_post}\ +#%{nil} + +%__spec_check_shell %{___build_shell} +%__spec_check_args %{___build_args} +%__spec_check_cmd %{___build_cmd} +%__spec_check_pre %{___build_pre} +%__spec_check_body %{___build_body} +%__spec_check_post %{___build_post} +%__spec_check_template #!%{__spec_check_shell}\ +%{__spec_check_pre}\ +%{?_ispras_check_abi} \ +%{?_ispras_check_autotest} \ +%{nil} + +#%{__spec_check_body}\ +#%{__spec_check_post}\ +#%{nil} + +#%__spec_autodep_shell %{___build_shell} +#%__spec_autodep_args %{___build_args} +#%__spec_autodep_cmd %{___build_cmd} +#%__spec_autodep_pre %{___build_pre} +#%__spec_autodep_body %{___build_body} +#%__spec_autodep_post %{___build_post} +#%__spec_autodep_template #!%{__spec_autodep_shell}\ +#%{__spec_autodep_pre}\ +#%{nil} + +#%{__spec_autodep_body}\ +#%{__spec_autodep_post}\ +#%{nil} + +%__spec_clean_shell %{___build_shell} +%__spec_clean_args %{___build_args} +%__spec_clean_cmd %{___build_cmd} +%__spec_clean_pre %{___build_pre} +%__spec_clean_body %{?buildroot:%{__rm} -rf '%{buildroot}'}\ +%{nil} +%__spec_clean_post %{nil} +%__spec_clean_template #!%{__spec_clean_cmd}\ +%{__spec_clean_pre}\ +%{nil} + +#%{__spec_clean_body}\ +#%{__spec_clean_post}\ +#%{nil} + +%__spec_track_shell %{___build_shell} +%__spec_track_args %{___build_args} +%__spec_track_cmd %{___build_cmd} +%__spec_track_pre %{__vcheck} %{verbose:--verbose}%{!verbose:--noverbose} -f - << GO_SYSIN_DD +%__spec_track_body %{___build_body} +%__spec_track_post GO_SYSIN_DD\ +%{nil} +%__spec_track_template #!%{__spec_track_shell}\ +%{__spec_track_pre}\ +%{nil} + +%__spec_sanitycheck_shell %{___build_shell} +%__spec_sanitycheck_args %{___build_args} +%__spec_sanitycheck_cmd %{___build_cmd} +%__spec_sanitycheck_pre %{___build_pre} +%__spec_sanitycheck_body %{___build_body} +%__spec_sanitycheck_post %{___build_post} +%__spec_sanitycheck_template #!%{__spec_sanitycheck_shell}\ +%{__spec_sanitycheck_pre}\ +%{nil} + +%__spec_rmbuild_shell %{___build_shell} +%__spec_rmbuild_args %{___build_args} +%__spec_rmbuild_cmd %{___build_cmd} +%__spec_rmbuild_pre %{___build_pre} +%__spec_rmbuild_body %{___build_body} +%__spec_rmbuild_post %{___build_post} +%__spec_rmbuild_template #!%{__spec_rmbuild_shell}\ +%{__spec_rmbuild_pre}\ +%{nil} + +#%{__spec_rmbuild_body}\ +#%{__spec_rmbuild_post}\ +#%{nil} + +# XXX We don't expand pre/post install scriptlets (yet). +#%__spec_pre_pre %{nil} +#%__spec_pre_post %{nil} +#%__spec_post_pre %{nil} +#%__spec_post_post %{nil} +#%__spec_preun_pre %{nil} +#%__spec_preun_post %{nil} +#%__spec_postun_pre %{nil} +#%__spec_postun_post %{nil} +#%__spec_triggerpostun_pre %{nil} +#%__spec_triggerpostun_post %{nil} +#%__spec_triggerun_pre %{nil} +#%__spec_triggerun_post %{nil} +#%__spec_triggerin_pre %{nil} +#%__spec_triggerin_post %{nil} + +#============================================================================== +# ---- specfile macros. +# Macro(s) here can be used reliably for reproducible builds. +# (Note: Above is the goal, below are the macros under development) +# +# The configure macro does the following: +# optionally change to a subdirectory (not implemented). +# attempt to update config.guess and config.sub. +# run configure with correct prefix, platform, and CFLAGS. +# optionally restore current directory (not implemented). +# The configure macro should be invoked as %configure (rather than %{configure}) +# because the rest of the arguments will be expanded using %*. +# +# This is the version of %configure used through rpm-3.0.4. +#%configure \ +# %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \ +# CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix} +# +#------------------------------------------------------------------------------ +# This is an improved version of %configure (from PLD team). +%configure \ + CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \ + CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \ + FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \ + ./configure --host=%{_host} --build=%{_build} \\\ + --target=%{_target_platform} \\\ + --program-prefix=%{?_program_prefix} \\\ + --prefix=%{_prefix} \\\ + --exec-prefix=%{_exec_prefix} \\\ + --bindir=%{_bindir} \\\ + --sbindir=%{_sbindir} \\\ + --sysconfdir=%{_sysconfdir} \\\ + --datadir=%{_datadir} \\\ + --includedir=%{_includedir} \\\ + --libdir=%{_libdir} \\\ + --libexecdir=%{_libexecdir} \\\ + --localstatedir=%{_localstatedir} \\\ + --sharedstatedir=%{_sharedstatedir} \\\ + --mandir=%{_mandir} \\\ + --infodir=%{_infodir} + +#------------------------------------------------------------------------------ +# The make install analogue of %configure for modern autotools: +%make_install make install DESTDIR=%{?buildroot} + +#------------------------------------------------------------------------------ +# Former make install analogue, kept for compatibility and for old/broken +# packages that don't support DESTDIR properly. +%makeinstall \ + make \\\ + prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\ + exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\ + bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\ + sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\ + sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\ + datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\ + includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\ + libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\ + libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\ + localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\ + sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\ + mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\ + infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\ + install + +#------------------------------------------------------------------------------ +# The GNUconfigure macro does the following: +# update config.guess and config.sub. +# regenerate all autoconf/automake files +# optionally change to a directory (make the directory if requested). +# run configure with correct prefix, platform, and CFLAGS. +# optionally restore current directory. +# +# Based on autogen.sh from GNOME and orginal GNUconfigure +# +%GNUconfigure(MCs:) \ + CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS; \ + LDFLAGS="${LDFLAGS:-%{-s:-s}}" ; export LDFLAGS; \ + %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p "%{-C*}";} cd "%{-C*}"} \ + dirs="`find ${_mydir} -name 'configure.[ai][cn]' -print`"; export dirs; \ + for coin in `echo ${dirs}` \ +do \ + dr=`dirname ${coin}`; \ +if test -f ${dr}/NO-AUTO-GEN; then \ + : \ +else \ + macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \ + ( cd "${dr}"; \ + aclocalinclude="${ACLOCAL_FLAGS}"; \ + for k in ${macrodirs}; do \ + if test -d ${k}; then \ + aclocalinclude="${aclocalinclude} -I ${k}"; \ + ##else \ + ## echo "**Warning**: No such directory \`${k}'. Ignored." \ + fi \ + done \ + if grep "^AM_GNU_GETTEXT" configure.[ai][cn] >/dev/null; then \ + if grep "sed.*POTFILES" configure.[ai][cn] >/dev/null; then \ + : do nothing -- we still have an old unmodified configure.[ai][cn] \ + else \ + test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \ + echo "no" | gettextize --force --copy; \ + test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \ + fi \ + fi \ + if grep "^AM_PROG_LIBTOOL" configure.[ai][cn] >/dev/null; then \ + %{__libtoolize} --force --copy; \ + fi \ + aclocal ${aclocalinclude}; \ + if grep "^AM_CONFIG_HEADER" configure.[ai][cn] >/dev/null; then \ + %{__autoheader}; \ + fi \ + echo "Running automake --gnu ${am_opt} ..."; \ + %{__automake} --add-missing --gnu ${am_opt}; \ + %{__autoconf}; \ + ); \ + fi \ +done \ + %{-C:${_mydir}}%{!-C:.}/configure %{_target_platform} --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} --infodir=%{_infodir} %* ; \ + %{-C:cd "${_mydir}"; unset _mydir} + +%patches %{lua: for i, p in ipairs(patches) do print(p.." ") end} +%sources %{lua: for i, s in ipairs(sources) do print(s.." ") end} + +#------------------------------------------------------------------------------ +# argument to pass to 'make' to run one job per cpu in parallel on smp systems. +%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\ + && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\ + [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-j$RPM_BUILD_NCPUS") + +#------------------------------------------------------------------------------ +# arch macro for all Intel i?86 compatibile processors +# (Note: This macro (and it's analogues) will probably be obsoleted when +# rpm can use regular expressions against target platforms in macro +# conditionals. +# +%ix86 i386 i486 i586 i686 pentium3 pentium4 athlon + +# arch macro for all EFI-compatible architectures +%efi %{ix86} x86_64 ia64 + +# same thing for arm +%arm arm armv3 armv3l armv3b armv4 armv4l armv4b armv5 armv5l armv5b armv5te armv5tel armv5teb xscale armv6 armv6l armv7l armv7hl armv7lh armv7hln armv7hnl armv7lhn armv7lnh armv7nhl armv7nlh + +# same thing for leg +%leg leg legv3 legv3l legv3b legv4 legv4l legv4b legv5 legv5l legv5b legv5te legv5tel legv5teb xscale legv6 legv6l legv7l legv7hl legv7lh legv7hln legv7hnl legv7lhn legv7lnh legv7nhl legv7nlh + +# same for alpha +%alpha alpha alphaev56 alphaev6 alphaev67 + +# and sparc +%sparc sun4 sun4m sun4c sun4d sun4u sparc sparcv8 sparcv9 sparcv9b sparc9v sparcv9v2 + +# add alternative sparc architectures macro (bugzilla #455972 patch) +%sparcx %sparc sparc64 sparc64v sparc64v2 + +# also for mips +%mips mips mips2 mips3 mips4 octeon +%mipsel mipsel mips2el mips3el mips4el loongson2e loongson2f octeonel + +%mipsx %mips %mipsel mips64 mips64el + +#------------------------------------------------------------------------ +# Use in %install to generate locale specific file lists. For example, +# +# %install +# ... +# %find_lang %{name} +# ... +# %files -f %{name}.lang +# +%find_lang %{_rpmhome}/find-lang.sh %{buildroot} + +%requires_eq() %(echo '%*' | LC_ALL="C" xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not") + +# \endverbatim +#*/ diff --git a/rpm-5.4.9/macros/macros.rpmbuild.in b/rpm-5.4.9/macros/macros.rpmbuild.in new file mode 100644 index 0000000..c03dad6 --- /dev/null +++ b/rpm-5.4.9/macros/macros.rpmbuild.in @@ -0,0 +1,660 @@ +#/*! \page build_macros Default configuration: @USRLIBRPM@/macros.rpmbuild +# \verbatim +# +# $Id: macros.rpmbuild.in,v 1.4.4.12 2011/10/21 15:39:02 jbj Exp $ +# +# This file contains rpmbuild configuration macros. +# + +#============================================================================== +# ---- Build system path macros. +# +%__ar @AR@ +%__as @AS@ +%__cc @CC@ +%__cpp @CPP@ +%__cxx @CXX@ +%__ld @__LD@ +%__nm @__NM@ +%__objcopy @__OBJCOPY@ +%__objdump @__OBJDUMP@ +%__ranlib @RANLIB@ +%__remsh %{__rsh} +%__strip @__STRIP@ + +# XXX avoid failures if tools are not installed when rpm is built. +%__libtoolize @LIBTOOLIZE@ +%__aclocal aclocal +%__autoheader autoheader +%__automake automake +%__autoconf autoconf + +#============================================================================== +# ---- Conditional build macro templates. + +# Check if symbol is defined. +# Example usage: %if %{defined with_foo} && %{undefined with_bar} ... +%defined() %{expand:%%{?%{1}:1}%%{!?%{1}:0}} +%undefined() %{expand:%%{?%{1}:0}%%{!?%{1}:1}} + +# Shorthand for %{defined with_...} +%with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}} +%without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}} + +# Handle conditional builds. %bcond_with is for case when feature is +# default off and needs to be activated with --with ... command line +# switch. %bcond_without is for the dual case. +# +# %bcond_with foo defines symbol with_foo if --with foo was specified on +# command line. +# %bcond_without foo defines symbol with_foo if --without foo was *not* +# specified on command line. +# +# For example (spec file): +# +# (at the beginning) +# %bcond_with extra_fonts +# %bcond_without static +# (and later) +# %if %{with extra_fonts} +# ... +# %else +# ... +# %endif +# %if ! %{with static} +# ... +# %endif +# %ifdef %{with static} +# ... +# %endif +# %{?with_static: ... } +# %{!?with_static: ... } +# %{?with_extra_fonts: ... } +# %{!?with_extra_fonts: ... } + +# +# The bottom line: never use without_foo, _with_foo nor _without_foo, only +# with_foo. This way changing default set of bconds for given spec is just +# a matter of changing single line in it and syntax is more readable. +%bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}} +%bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}} + +#============================================================================== +# ---- Optional macros. +# Macros that are initialized as a side effect of spec +# file parsing. +# +# The sub-directory (relative to %{_builddir}) where sources are compiled. +# This macro is set after processing %setup, either explicitly from the +# value given to -n or the default name-version. +# +#%buildsubdir + +# Truncate changelogs to no. of entries or date. +# <=0 disables +# <1000 truncates to no. of entries +# Otherwise, a get_date string (e.g. "2 years ago") may be entered, +# and changelog entries older than that date will not be added to headers. +%_changelog_truncate 1 year ago + +# Configurable distribution information, same as Distribution: tag in a +# specfile. +# +#%distribution + +# Configurable bug URL, same as BugURL: tag in a specfile. +# The URL will be used to supply reliable information to where +# to file bugs. +# +#%bugurl + +# +# Deprecated. +# +#%_langpatt + +# Configurable packager information, same as Packager: in a specfile. +# +#%packager + +# Compression type and level for source/binary package payloads. +# "w9.gzdio" gzip level 9 (default). +# "w9.bzdio" bzip2 level 9. +# "w6.lzdio" lzma level 6 (legacy, stable). +# "w6.xzdio" xz level 6 (obsoletes lzma, unstable). +# +#%_source_payload w9.gzdio +#%_binary_payload w9.gzdio + +# Archive formats to use for source/binary package payloads. +# "cpio" cpio archive (default) +# "ustar" tar archive +# +#%_source_payload_format cpio +#%_binary_payload_format cpio + +# Configurable vendor information, same as Vendor: in a specfile. +# +#%vendor + +# Default fuzz level for %patch in spec file. +#%_default_patch_fuzz -1 + +# Default patch flags +%_default_patch_flags -s + +#============================================================================== +# ---- Build configuration macros. +# +# Package version macro. +# The type of package to produce, for compatibility with legacy +# versions of rpm. +# +# This is an rpm version, e.g. 30005 means to produce packaging compatible +# with rpm-3.0.5. At the moment, values < 30005 (i.e. compatibility with +# version before rpm-3.0.5) are not supported. The only incompatible change +# in rpm packaging since rpm-3.0.5 has been to replace a 3 with a 4 in the +# rpmlead, so there's little need to use any value greater than 30005. +# +%_package_version 30005 + +# +# The patch macro writes 1 line of shell code to (optionally) uncompress +# a file and apply using patch(1). +# + +%patch(b:p:P:REz:F:d:) %{shrink:\ +%define __patch_number %{-P:%{-P*}}%{!-P:0} \ +%define __patch_file %{P:%{__patch_number}} \ +%define __patch_suffix %{-b:-b --suffix %{-b*}} %{-z:--suffix %{-z*}} \ +%define __patch_fuzz %{?_default_patch_fuzz:%(test %{_default_patch_fuzz} -ge 0 && echo "--fuzz=%{_default_patch_fuzz} ")} \ +%define __patch_options %{_default_patch_flags} %{-p:-p%{-p*}} %{-F:-F%{-F*}} %{-d:-d%{-d*}} %{-R} %{-E} %{__patch_suffix} \ +echo "Patch #%{__patch_number} (%{basename:%{__patch_file}}):" && ( %{uncompress:%{__patch_file}} | %{__patch} %{__patch_fuzz}%{__patch_options} ) || exit 1\ +} + +# +# Script gets packaged file list on input and buildroot as first parameter. +# Returns list of unpackaged files, i.e. files in $RPM_BUILD_ROOT not packaged. +# +# Note: Disable (by commenting out) for legacy compatibility. +%__check_files %{_rpmhome}/check-files %{buildroot} + +# +# Should unpackaged files in a build root terminate a build? +# +# Note: The default value should be 0 for legacy compatibility. +%_unpackaged_files_terminate_build 1 + +# +# Should missing %doc files in the build directory terminate a build? +# +# Note: The default value should be 0 for legacy compatibility. +%_missing_doc_files_terminate_build 1 + +# +# Should an ELF file processed by find-debuginfo.sh having no build ID +# terminate a build? This is left undefined to disable it and defined to +# enable. +# +#%_missing_build_ids_terminate_build 1 + +# +# Use internal dependency generator rather than external helpers? +# 0 - Use external generator +# 1 - Use internal generator if available +# 2 - Use __scriptlet_requires to process scriptlet dependencies +%_use_internal_dependency_generator 2 + +# +# Disabler for adding /bin/sh scriptlet interpreter dependencies. +%_disable_shell_interpreter_deps 0 + +# +# Filter GLIBC_PRIVATE Provides: and Requires: +%_filter_GLIBC_PRIVATE 0 + +# +# Path to scripts to autogenerate package dependencies, +# +# Note: Used iff _use_internal_dependency_generator is zero. +#%__find_provides %{_rpmhome}/rpmdeps --provides +#%__find_requires %{_rpmhome}/rpmdeps --requires +%__find_provides %{_rpmhome}/find-provides +%__find_requires %{_rpmhome}/find-requires +#%__find_conflicts ??? +#%__find_obsoletes ??? + +# +# fixowner, fixgroup, and fixperms are run at the end of hardcoded setup +# These macros are necessary only for legacy compatibility, and have moved +# to per-platform macro configuration (i.e. %{_usrlibrpm}/arch>-/macros) +# +# Note: These are no longer enabled by default. +#%__id_u @__ID_U@ +#%__chown_Rhf @__CHOWN_RHF@ +#%__chgrp_Rhf @__CHGRP_RHF@ +#%_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root +#%_fixgroup [ `%{__id_u}` = '0' ] && %{__chgrp_Rhf} @ROOT_GROUP@ +#%_fixperms %{__chmod} -Rf @FIXPERMS@ +# + +# +# Choose metadata file digest algorithm: +# 1 MD5 +# 2 SHA1 +# 3 RIPEMD-160 +# 5 MD2 +# 6 TIGER-192 +# 8 SHA256 +# 9 SHA384 +# 10 SHA512 +# 11 SHA224 +# 104 MD4 +# 105 RIPEMD-128 +# 106 CRC-32 +# 107 ADLER-32 +# 108 CRC-64 (ECMA-182 polynomial, untested uint64_t problems) +# 109 Jenkins lookup3.c hashlittle() +# 111 RIPEMD-256 +# 112 RIPEMD-320 +# +# Note: choosing anything but MD5 introduces instant legacy incompatibility. +%_build_file_digest_algo 1 +%_build_binary_file_digest_algo %{_build_file_digest_algo} +%_build_source_file_digest_algo %{_build_file_digest_algo} + +# +# Byte size of line buffer for .spec file parsing +%_spec_line_buffer_size 100000 + +# +# Maximum Icon: graphic file size (undefined or < 2048 uses 2048). +%_build_iconsize 2048 + +# The output binary package file name template used when building +# binary packages. +# +# XXX Note: escaped %% for use in headerSprintf() +%_build_name_fmt %%{ARCH}/%{___NVRA}.rpm + +#============================================================================== +# ---- per-platform macros. +# Macros that are specific to an individual platform. The values here +# will be used if the per-platform macro file does not exist.. +# + +# +# Define a generic value for optflags. Normally overridden by per-target macros. +%optflags -O2 + +# +# Define per-arch and per-os defaults. Normally overridden by per-target macros. +%__arch_install_post %{nil} +%__os_install_post %{___build_post} + +#============================================================================== +# ---- Scriptlet template templates. +# Global defaults used for building scriptlet templates. +# + +%___build_shell %{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh} +%___build_args -e +%___build_cmd %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args} +%___build_pre \ + RPM_OPT_FLAGS=\"%{optflags}\"\ + export RPM_OPT_FLAGS\ + %{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\ + export RPM_BUILD_ROOT}\ + %{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\ + export CLASSPATH}\ + unset PERL_MM_OPT || :\ + LC_ALL=C\ + export LC_ALL\ + LANG=C\ + export LANG\ + unset DISPLAY || :\ + unset LINGUAS || :\ + unset LANGUAGE || :\ + unset LC_MESSAGES || :\ + \ + %{verbose:set -x}%{!verbose:exec > /dev/null}\ + umask 022\ + cd "%{u2p:%{_builddir}}"\ + + +#%___build_body %{nil} +%___build_post exit 0 + +%___build_template #!%{___build_shell}\ +%{___build_pre}\ +%{nil} + +#%{___build_body}\ +#%{___build_post}\ +#%{nil} + +#============================================================================== +# ---- Scriptlet templates. +# Macro(s) that expand to a command and script that is executed. +# CAVEAT: All macro expansions must fit in a BUFSIZ (8192 byte) buffer. +# +%__spec_prep_shell %{___build_shell} +%__spec_prep_args %{___build_args} +%__spec_prep_cmd %{___build_cmd} +%__spec_prep_pre %{___build_pre} +%__spec_prep_body %{___build_body} +%__spec_prep_post %{___build_post} +%__spec_prep_template #!%{__spec_prep_shell}\ +%{__spec_prep_pre}\ +%{nil} + +#%{__spec_prep_body}\ +#%{__spec_prep_post}\ +#%{nil} + +%__spec_build_shell %{___build_shell} +%__spec_build_args %{___build_args} +%__spec_build_cmd %{___build_cmd} +%__spec_build_pre %{___build_pre} +%__spec_build_body %{___build_body} +%__spec_build_post %{___build_post} +%__spec_build_template #!%{__spec_build_shell}\ +%{__spec_build_pre}\ +%{nil} + +#%{__spec_build_body}\ +#%{__spec_build_post}\ +#%{nil} + +%__spec_install_shell %{___build_shell} +%__spec_install_args %{___build_args} +%__spec_install_cmd %{___build_cmd} +%__spec_install_pre %{___build_pre}\ +%{?buildroot:%{__rm} -rf '%{buildroot}'; %{__mkdir_p} '%{buildroot}'} +%__spec_install_body %{___build_body} +%__spec_install_post\ +%{?__debug_package:%{__debug_install_post}}\ +%{__arch_install_post}\ +%{__os_install_post}\ +%{nil} +%__spec_install_template #!%{__spec_install_shell}\ +%{__spec_install_pre}\ +%{nil} + +#%{__spec_install_body}\ +#%{__spec_install_post}\ +#%{nil} + +%__spec_check_shell %{___build_shell} +%__spec_check_args %{___build_args} +%__spec_check_cmd %{___build_cmd} +%__spec_check_pre %{___build_pre} +%__spec_check_body %{___build_body} +%__spec_check_post %{___build_post} +%__spec_check_template #!%{__spec_check_shell}\ +%{__spec_check_pre}\ +%{?_ispras_check_abi} \ +%{?_ispras_check_autotest} \ +%{nil} + +#%{__spec_check_body}\ +#%{__spec_check_post}\ +#%{nil} + +#%__spec_autodep_shell %{___build_shell} +#%__spec_autodep_args %{___build_args} +#%__spec_autodep_cmd %{___build_cmd} +#%__spec_autodep_pre %{___build_pre} +#%__spec_autodep_body %{___build_body} +#%__spec_autodep_post %{___build_post} +#%__spec_autodep_template #!%{__spec_autodep_shell}\ +#%{__spec_autodep_pre}\ +#%{nil} + +#%{__spec_autodep_body}\ +#%{__spec_autodep_post}\ +#%{nil} + +%__spec_clean_shell %{___build_shell} +%__spec_clean_args %{___build_args} +%__spec_clean_cmd %{___build_cmd} +%__spec_clean_pre %{___build_pre} +%__spec_clean_body %{?buildroot:%{__rm} -rf '%{buildroot}'}\ +%{nil} +%__spec_clean_post %{nil} +%__spec_clean_template #!%{__spec_clean_cmd}\ +%{__spec_clean_pre}\ +%{nil} + +#%{__spec_clean_body}\ +#%{__spec_clean_post}\ +#%{nil} + +%__spec_track_shell %{___build_shell} +%__spec_track_args %{___build_args} +%__spec_track_cmd %{___build_cmd} +%__spec_track_pre %{__vcheck} %{verbose:--verbose}%{!verbose:--noverbose} -f - << GO_SYSIN_DD +%__spec_track_body %{___build_body} +%__spec_track_post GO_SYSIN_DD\ +%{nil} +%__spec_track_template #!%{__spec_track_shell}\ +%{__spec_track_pre}\ +%{nil} + +%__spec_sanitycheck_shell %{___build_shell} +%__spec_sanitycheck_args %{___build_args} +%__spec_sanitycheck_cmd %{___build_cmd} +%__spec_sanitycheck_pre %{___build_pre} +%__spec_sanitycheck_body %{___build_body} +%__spec_sanitycheck_post %{___build_post} +%__spec_sanitycheck_template #!%{__spec_sanitycheck_shell}\ +%{__spec_sanitycheck_pre}\ +%{nil} + +%__spec_rmbuild_shell %{___build_shell} +%__spec_rmbuild_args %{___build_args} +%__spec_rmbuild_cmd %{___build_cmd} +%__spec_rmbuild_pre %{___build_pre} +%__spec_rmbuild_body %{___build_body} +%__spec_rmbuild_post %{___build_post} +%__spec_rmbuild_template #!%{__spec_rmbuild_shell}\ +%{__spec_rmbuild_pre}\ +%{nil} + +#%{__spec_rmbuild_body}\ +#%{__spec_rmbuild_post}\ +#%{nil} + +# XXX We don't expand pre/post install scriptlets (yet). +#%__spec_pre_pre %{nil} +#%__spec_pre_post %{nil} +#%__spec_post_pre %{nil} +#%__spec_post_post %{nil} +#%__spec_preun_pre %{nil} +#%__spec_preun_post %{nil} +#%__spec_postun_pre %{nil} +#%__spec_postun_post %{nil} +#%__spec_triggerpostun_pre %{nil} +#%__spec_triggerpostun_post %{nil} +#%__spec_triggerun_pre %{nil} +#%__spec_triggerun_post %{nil} +#%__spec_triggerin_pre %{nil} +#%__spec_triggerin_post %{nil} + +#============================================================================== +# ---- specfile macros. +# Macro(s) here can be used reliably for reproducible builds. +# (Note: Above is the goal, below are the macros under development) +# +# The configure macro does the following: +# optionally change to a subdirectory (not implemented). +# attempt to update config.guess and config.sub. +# run configure with correct prefix, platform, and CFLAGS. +# optionally restore current directory (not implemented). +# The configure macro should be invoked as %configure (rather than %{configure}) +# because the rest of the arguments will be expanded using %*. +# +# This is the version of %configure used through rpm-3.0.4. +#%configure \ +# %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \ +# CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix} +# +#------------------------------------------------------------------------------ +# This is an improved version of %configure (from PLD team). +%configure \ + CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \ + CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \ + FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \ + ./configure --host=%{_host} --build=%{_build} \\\ + --target=%{_target_platform} \\\ + --program-prefix=%{?_program_prefix} \\\ + --prefix=%{_prefix} \\\ + --exec-prefix=%{_exec_prefix} \\\ + --bindir=%{_bindir} \\\ + --sbindir=%{_sbindir} \\\ + --sysconfdir=%{_sysconfdir} \\\ + --datadir=%{_datadir} \\\ + --includedir=%{_includedir} \\\ + --libdir=%{_libdir} \\\ + --libexecdir=%{_libexecdir} \\\ + --localstatedir=%{_localstatedir} \\\ + --sharedstatedir=%{_sharedstatedir} \\\ + --mandir=%{_mandir} \\\ + --infodir=%{_infodir} + +#------------------------------------------------------------------------------ +# The make install analogue of %configure for modern autotools: +%make_install make install DESTDIR=%{?buildroot} + +#------------------------------------------------------------------------------ +# Former make install analogue, kept for compatibility and for old/broken +# packages that don't support DESTDIR properly. +%makeinstall \ + make \\\ + prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\ + exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\ + bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\ + sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\ + sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\ + datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\ + includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\ + libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\ + libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\ + localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\ + sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\ + mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\ + infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\ + install + +#------------------------------------------------------------------------------ +# The GNUconfigure macro does the following: +# update config.guess and config.sub. +# regenerate all autoconf/automake files +# optionally change to a directory (make the directory if requested). +# run configure with correct prefix, platform, and CFLAGS. +# optionally restore current directory. +# +# Based on autogen.sh from GNOME and orginal GNUconfigure +# +%GNUconfigure(MCs:) \ + CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS; \ + LDFLAGS="${LDFLAGS:-%{-s:-s}}" ; export LDFLAGS; \ + %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p "%{-C*}";} cd "%{-C*}"} \ + dirs="`find ${_mydir} -name 'configure.[ai][cn]' -print`"; export dirs; \ + for coin in `echo ${dirs}` \ +do \ + dr=`dirname ${coin}`; \ +if test -f ${dr}/NO-AUTO-GEN; then \ + : \ +else \ + macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \ + ( cd "${dr}"; \ + aclocalinclude="${ACLOCAL_FLAGS}"; \ + for k in ${macrodirs}; do \ + if test -d ${k}; then \ + aclocalinclude="${aclocalinclude} -I ${k}"; \ + ##else \ + ## echo "**Warning**: No such directory \`${k}'. Ignored." \ + fi \ + done \ + if grep "^AM_GNU_GETTEXT" configure.[ai][cn] >/dev/null; then \ + if grep "sed.*POTFILES" configure.[ai][cn] >/dev/null; then \ + : do nothing -- we still have an old unmodified configure.[ai][cn] \ + else \ + test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \ + echo "no" | gettextize --force --copy; \ + test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \ + fi \ + fi \ + if grep "^AM_PROG_LIBTOOL" configure.[ai][cn] >/dev/null; then \ + %{__libtoolize} --force --copy; \ + fi \ + aclocal ${aclocalinclude}; \ + if grep "^AM_CONFIG_HEADER" configure.[ai][cn] >/dev/null; then \ + %{__autoheader}; \ + fi \ + echo "Running automake --gnu ${am_opt} ..."; \ + %{__automake} --add-missing --gnu ${am_opt}; \ + %{__autoconf}; \ + ); \ + fi \ +done \ + %{-C:${_mydir}}%{!-C:.}/configure %{_target_platform} --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} --infodir=%{_infodir} %* ; \ + %{-C:cd "${_mydir}"; unset _mydir} + +%patches %{lua: for i, p in ipairs(patches) do print(p.." ") end} +%sources %{lua: for i, s in ipairs(sources) do print(s.." ") end} + +#------------------------------------------------------------------------------ +# argument to pass to 'make' to run one job per cpu in parallel on smp systems. +%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\ + && RPM_BUILD_NCPUS="`@NCPUS_COMMAND@`"; \\\ + [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-j$RPM_BUILD_NCPUS") + +#------------------------------------------------------------------------------ +# arch macro for all Intel i?86 compatibile processors +# (Note: This macro (and it's analogues) will probably be obsoleted when +# rpm can use regular expressions against target platforms in macro +# conditionals. +# +%ix86 i386 i486 i586 i686 pentium3 pentium4 athlon + +# arch macro for all EFI-compatible architectures +%efi %{ix86} x86_64 ia64 + +# same thing for arm +%arm arm armv3 armv3l armv3b armv4 armv4l armv4b armv5 armv5l armv5b armv5te armv5tel armv5teb xscale armv6 armv6l armv7l armv7hl armv7lh armv7hln armv7hnl armv7lhn armv7lnh armv7nhl armv7nlh + +# same thing for leg +%leg leg legv3 legv3l legv3b legv4 legv4l legv4b legv5 legv5l legv5b legv5te legv5tel legv5teb xscale legv6 legv6l legv7l legv7hl legv7lh legv7hln legv7hnl legv7lhn legv7lnh legv7nhl legv7nlh + +# same for alpha +%alpha alpha alphaev56 alphaev6 alphaev67 + +# and sparc +%sparc sun4 sun4m sun4c sun4d sun4u sparc sparcv8 sparcv9 sparcv9b sparc9v sparcv9v2 + +# add alternative sparc architectures macro (bugzilla #455972 patch) +%sparcx %sparc sparc64 sparc64v sparc64v2 + +# also for mips +%mips mips mips2 mips3 mips4 octeon +%mipsel mipsel mips2el mips3el mips4el loongson2e loongson2f octeonel + +%mipsx %mips %mipsel mips64 mips64el + +#------------------------------------------------------------------------ +# Use in %install to generate locale specific file lists. For example, +# +# %install +# ... +# %find_lang %{name} +# ... +# %files -f %{name}.lang +# +%find_lang %{_rpmhome}/find-lang.sh %{buildroot} + +%requires_eq() %(echo '%*' | LC_ALL="C" xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not") + +# \endverbatim +#*/ diff --git a/rpm-5.4.9/macros/mandriva b/rpm-5.4.9/macros/mandriva new file mode 100644 index 0000000..467fb67 --- /dev/null +++ b/rpm-5.4.9/macros/mandriva @@ -0,0 +1,499 @@ +%distribution Mandriva Linux +%vendor Mandriva +%bugurl http://qa.mandriva.com +%disturl http://mandriva.org + +# This macro will disable the transaction lock on /var/lib/rpm/__db.*. +# This lock is of no use to us and will also result in errors when trying to +# install src.rpms as regular user. +%_rpmlock_path %{nil} + +%_upgrade_tag name +%_obsolete_tag name + +# Disable automatic dependencies on parent directory and symlinks for now +%_check_symlink_deps 0 +%_check_dirname_deps 0 + +# The directory where buildroots will be created. +%_buildrootdir %{_topdir}/BUILDROOT + +# Build root path, where %install installs the package during build. +%buildroot %{_buildrootdir}/%{name}-%{version}-%{release}%{?disttag:-%{disttag}%{?distepoch:%{distepoch}}}.%{_target_cpu}-buildroot + +# Path to top of build area. +%_topdir %(echo $HOME)/rpmbuild + +%_docdir_fmt %%{NAME} + +%_changelog_truncate 3 years ago + +# This will die as soon as remaining usage has been phased out... +%mkrel(c:) %{-c: 0.%{-c*}.}%{1}%{?subrel:.%subrel} +%manbo_mkrel() %mkrel +%multiarch() %{1} + +# This will enable the use of distepoch and disttag in stead of polluting +# %release with such. +%evr_tuple_select 1234 +%evr_tuple_order EVRD +%disttag %{!?distsuffix:mdv}%{?distsuffix} +%distepoch %(sed -e 's#.*release\\ \\(\\S*\\).*#\\1#' /etc/release) + +# Dynamic EVRD tags macro for use with versioned provides/requires in place of +# '%{version}-%{release}', ie. to automatically add distepoch or epoch if present +%EVRD %{?epoch:%{epoch}:}%{?version:%{version}}%{?release:-%{release}}%{?distepoch::%{distepoch}} + +%rename() \ +Obsoletes: %{1} < %{EVRD} \ +Provides: %{1} = %{EVRD} + + +%_default_patch_flags -s -U +%_default_patch_fuzz 0 + +%apply_patches %{lua:\ +f = io.open(rpm.expand("%{_specfile}"))\ +if f then\ + for l in f:lines() do\ + match,b,num = string.find(string.lower(l), "^%s*patch(%d+)%s*:.*$")\ + if match then print(rpm.expand("%patch"..num.." -p1 -b "..string.format(".%04d~",num).." \\\n")); end\ + end\ + f:close()\ +end\ +} + + +%make %{__make} %{_smp_mflags} +%makeinstall_std make DESTDIR=%{?buildroot:%{buildroot}} install + +# mdvbz#62322 +%__grep /bin/grep +%__gzip /bin/gzip +%__lua %{_bindir}/lua +%__rc %{_bindir}/rc +%__xar %{_bindir}/xar + +# mdvbz#61851 +%__tar_wildcards --wildcards + +%_loop_detection_loglevel 4 + + +%_sysconfdir /etc +%_defaultdocdir %{_datadir}/doc +%_localstatedir %{_var} +%_logdir %{_var}/log +%_libexecdir %{_libdir} + +# mdvbz#62741 +# standard systemd directories +%_systemdrootdir /lib/systemd +%_systemunitdir %{_systemdrootdir}/system +%_systemgeneratordir %{_systemdrootdir}/system-generators +%_systemshutdowndir %{_systemdrootdir}/system-shutdown + +%_systemddatadir %{_datadir}/systemd +%_userunitdir %{_systemddatadir}/user + +%_systemdlibexecdir %{_libexecdir}/systemd +%_usergeneratordir %{_systemdlibexecdir}/user-generators + +%_systemdconfdir %{_sysconfdir}/systemd + +# +# multiarch is used to deal with situations where headers that contain +# ie. architecture specific parts to solve file conflicts between +# packages of different archs in multilib environments. +# +# Note: more details at http://wiki.mandriva.com/en/Policies/Multiarch +%multiarch_platform multiarch-%{_arch}-%{_target_os} +%multiarch_bindir %{_bindir}/%{multiarch_platform} +%multiarch_includedir %{_includedir}/%{multiarch_platform} +%multiarch_binaries() %{_rpmhome}/mkmultiarch binaries %{1} +%multiarch_includes() %{_rpmhome}/mkmultiarch includes %{1} + +# Check for need of multiarch, terminate build if needed and not used. +# +# Note: The default value should be 0 for legacy compatibility. +# TODO: fix check script and implement support for using +#%_multiarch_required_terminate_build 1 + +# use XZ to compress binary packages: +%_binary_payload w5.xzdio + +%_enable_debug_packages 1 + + +# Default extension to use (for info files) +%_extension .xz + + +%__install_info /sbin/install-info + +%_install_info() if [[ -f %{_infodir}/%{1}%{_extension} ]]; then %{__install_info} %{_infodir}/%{1}%{_extension} --dir=%{_infodir}/dir; fi \ +%{nil} +# (nb: keep the "alone on its line ';'") +%_remove_install_info() if [ "$1" = "0" ]; then if [[ -f %{_infodir}/%{1}%{_extension} ]]; then %{__install_info} %{_infodir}/%{1}%{_extension} --dir=%{_infodir}/dir --remove ; fi; fi \ +%{nil} + + +# Macro: %{mklibname [ []] [-s] [-d]} +# - %{mklibname test} => lib64test, on a lib64 platform +# - %{mklibname test 1 -d} => libtest1-devel +# - %{mklibname test 1 -d 0 -s} => libtest1_0-static-devel +%mklibname(ds) %{_lib}%{1}%{?2:%{2}}%{?3:_%{3}}%{-s:-static}%{-d:-devel} + +%debugcflags %{?_enable_debug_packages:-Wa,--compress-debug-sections -gdwarf-4 -fvar-tracking-assignments -frecord-gcc-switches -Wstrict-aliasing=2} + +# common compilation flags + +%_fortify_cflags -Wp,-D_FORTIFY_SOURCE=2 + +# cf http://wiki.mandriva.com/en/Development/Packaging/Problems#format_not_a_string_literal_and_no_format_arguments +%Werror_cflags -Wformat -Werror=format-security + +%_ssp_cflags -fstack-protector --param=ssp-buffer-size=4%{?_serverbuild_flags: %_serverbuild_flags} +%__common_cflags -O2 %{debugcflags} -pipe %{Werror_cflags} %{?_fortify_cflags} +%__common_cflags_with_ssp %{__common_cflags} %{?_ssp_cflags} + +# Servers opt flags. +# Also set the env variables for backward compatibility (#32050). +%serverbuild %define _serverbuild_flags -fstack-protector-all \ +export CFLAGS="%optflags -fPIE"; export CXXFLAGS="%optflags -fPIE"; export RPM_OPT_FLAGS="%optflags -fPIE" \ +%{nil} + +# Hardened Servers opt flags. +%serverbuild_hardened %define _hardened_flags -Wl,-z,now -pie \ +%serverbuild \ +%{nil} + +#============================================================================== +# ---- GPG/PGP/PGP5 signature macros. +# Macro(s) to hold the arguments passed to GPG/PGP for package +# signing and verification. +# + +# We disable the gpg key automatic querying +%_hkp_keyserver_query %nil + + +# Verify digest/signature flags for various rpm modes: +# 0x30300 (_RPMVSF_NODIGESTS) --nohdrchk if set, don't check digest(s) +# 0xc0c00 (_RPMVSF_NOSIGNATURES) --nosignature if set, don't check signature(s) +# 0xf0000 (_RPMVSF_NOPAYLOAD) --nolegacy if set, check header+payload (if possible) +# 0x00f00 (_RPMVSF_NOHEADER) --nohdrchk if set, don't check rpmdb headers +%_vsflags_query 0xc0c00 + + +# Open all indices before doing chroot(2). +# +%_openall_before_chroot 1 + +%_repackage_all_erasures 0 + +# activate filetriggers (cf http://wiki.mandriva.com/en/Rpm_filetriggers) +%_filetriggers_dir /var/lib/rpm/filetriggers + + +%__gzip /bin/gzip + +%_sys_macros_dir %{_sysconfdir}/rpm/macros.d +%build_sysmacrospath() %{_sys_macros_dir}/%{?1:%{1}}%{?!1:%{name}}.macros + +# when %_with_git_repository is set, these macros modify the behaviour of "%prep" step: +%_after_setup %{?_with_git_repository:GIT_URL="%{?git_url}" GIT_REPOSITORY_CACHE=%{?git_repository_cache} /usr/lib/rpm/mandriva/git-repository--after-tarball} +%_patch %{?_with_git_repository:PKG_NAME=%{name} /usr/lib/rpm/mandriva/git-repository--apply-patch}%{?!_with_git_repository:%__patch -U} + +# used by "git-repository--after-tarball": +%git_repository_cache %_topdir/%{name}.git + + +# Various programs used in rpm scripts +%_update_desktop_database_bin %{_bindir}/update-desktop-database +%_update_mime_database_bin %{_bindir}/update-mime-database +%_update_icon_cache_bin %{_bindir}/gtk-update-icon-cache +%_gconftool_bin %{_bindir}/gconftool-2 +%_scrollkeeper_bin %{_bindir}/scrollkeeper-update + +%__service /sbin/service +%__chkconfig /sbin/chkconfig + +#============================================================================== +# ---- Required rpmrc macros. +# Macros that used to be initialized as a side effect of rpmrc parsing. +# These are the default values that can be overridden by other +# (e.g. per-platform, per-system, per-packager, per-package) macros. +# + +%debug_package_and_restore %{debug_package} \ +%package __restore__\ +Summary: %{summary}\ +Group: %{group}\ +%description __restore__ + +%_arch_tag_suffix (%_lib) +%arch_tagged() %{1}%{_arch_tag_suffix} %{?2:%{2} %{3}%{?!3:%{error:undefined 3rd argument in arch_tagged}}} + +# Games macros +%_gamesdir games +%_gamesbindir %{_prefix}/%{_gamesdir} +%_gamesdatadir %{_datadir}/%{_gamesdir} + +# Menu directories +%_menudir %{_prefix}/lib/menu +%_iconsdir %{_datadir}/icons +%_miconsdir %{_datadir}/icons/mini +%_liconsdir %{_datadir}/icons/large + +%_xfontdir %_datadir/fonts + +%_webconfdir %{_sysconfdir}/httpd/conf +%_webappconfdir %_webconfdir/webapps.d +# compatibility +%webappconfdir %_webappconfdir + +#============================================================================== +# ---- Build configuration macros. +# +# Package version macro. +# The type of package to produce, for compatibility with legacy +# versions of rpm. +# +# Script gets packaged file list on input. +# Returns list of multiarch files that are not marked as such, +# i.e. files in $RPM_BUILD_ROOT that have arch-dependent values +# +# Note: Disable (by commenting out) for legacy compatibility. +#%__check_multiarch_files /usr/lib/rpm/check-multiarch-files %{buildroot} + +# Use internal dependency generator rather than external helpers? +%_use_internal_dependency_generator 1 +# TODO: merge relevant changes into rpm version rather than using our own +%__perl_provides /usr/lib/rpm/mandriva/perl.prov +%__perl_requires /usr/lib/rpm/mandriva/perl.req +%__php_provides /usr/lib/rpm/mandriva/php.prov +%__php_requires /usr/lib/rpm/mandriva/php.req + +%__find_provides /usr/lib/rpm/mandriva/filter.sh '%{?_provides_exceptions:%{_provides_exceptions}}%{!?_provides_exceptions: }' '%{?_exclude_files_from_autoprov:%{_exclude_files_from_autoprov}}%{!?_exclude_files_from_autoprov: }' '%{buildroot}' /usr/lib/rpm/mandriva/find-provides +%__find_requires /usr/lib/rpm/mandriva/filter.sh '%{?_requires_exceptions:%{_requires_exceptions}}%{!?_requires_exceptions: }' '%{?_exclude_files_from_autoreq:%{_exclude_files_from_autoreq}}%{!?_exclude_files_from_autoreq: }' '%{buildroot}' /usr/lib/rpm/mandriva/find-requires %{?buildroot:%{buildroot}} %{?_target_cpu:%{_target_cpu}} + +# Update Menu +%_update_menus_bin %{_bindir}/update-menus + +# Update Window Managers session. +%_fndsession_bin %{_sbindir}/fndSession +%make_session %{nil} +%make_dm_session if [ -x %{_fndsession_bin} ]; then %{_fndsession_bin} || true ; fi \ +%{nil} + +# For rebuilding gcj-db +%_rebuildgcjdb_bin %{_bindir}/rebuild-gcj-db +%update_gcjdb if [ -x %{_rebuildgcjdb_bin} ]; then %{_rebuildgcjdb_bin} || true ; fi \ +%{nil} + +%clean_gcjdb if [ -x %{_rebuildgcjdb_bin} ]; then %{_rebuildgcjdb_bin} || true ; fi \ +%{nil} + +# Rebuild icon cache +%update_icon_cache() if [ -x %{_update_icon_cache_bin} ]; then \ +%{_update_icon_cache_bin} --force --quiet %{_iconsdir}/%{1} || true; fi \ +%{nil} + +%clean_icon_cache() if [ -x %{_update_icon_cache_bin} -a -r %{_iconsdir}/%{1}/index.theme ]; then \ +%{_update_icon_cache_bin} --force --quiet %{_iconsdir}/%{1} || true ; fi \ +%{nil} + +# GConf schemas: +# installation is handled by filetriggers +%post_install_gconf_schemas() %{nil} +# but uninstall still need to be done in %preun: +%preun_uninstall_gconf_schemas() if [ "$1" = "0" -a -x %{_gconftool_bin} ]; then \ +SCHEMAS="" \ +for SCHEMA in %{*} ; do \ + SCHEMAS="$SCHEMAS %{_sysconfdir}/gconf/schemas/$SCHEMA.schemas" \ +done \ +GCONF_CONFIG_SOURCE=`%{_gconftool_bin} --get-default-source` %{_gconftool_bin} --makefile-uninstall-rule $SCHEMAS > /dev/null || true ; fi \ +%{nil} + +# Mandriva Linux version +# - "9.1" => 910 +# - "10.2.2" => 1022 +# (user may copy the following line in specfile) +%mdkversion %(perl -pe '/(\\d+)\\.(\\d)\\.?(\\d)?/; $_="$1$2".($3||0)' /etc/mandriva-release) + +#============================================================================== +# ---- Build policy macros. +# +#--------------------------------------------------------------------- +# Expanded at end of %install scriptlet. +# + +%__os_install_post \ + %{?__spec_helper_post}%{?!__spec_helper_post:/usr/share/spec-helper/spec-helper} \ +%{nil} + +#============================================================================== +# ---- specfile macros. +# Macro(s) here can be used reliably for reproducible builds. +# (Note: Above is the goal, below are the macros under development) +# + +%__fix_libtool_ltmain_from_overlinking /usr/lib/rpm/mandriva/fix-libtool-ltmain-from-overlinking +%__fix_libtool_from_moving_options_after_libs /usr/lib/rpm/mandriva/fix-libtool-from-moving-options-after-libs +%__fix_dlsearch_path_in_libtool_for_multilib /usr/lib/rpm/mandriva/fix-dlsearch-path-in-libtool-for-multilib + +%__cputoolize cputoolize + +%__libtoolize_configure %{?__libtoolize:(cd $CONFIGURE_TOP; [ ! -f configure.in -a ! -f configure.ac ] || %{__libtoolize} --copy --force)} + +%ldflags %{?!_disable_ld_as_needed: -Wl,--as-needed}%{?!_disable_ld_no_undefined: -Wl,--no-undefined}%{?!_disable_ld_relro: -Wl,-z,relro}%{?!_disable_ld_O1: -Wl,-O1}%{?!_disable_ld_build_id: -Wl,--build-id}%{?!_disable_ld_enable_new_dtags: -Wl,--enable-new-dtags}%{?_hardened_flags: %_hardened_flags} + +%setup_compile_flags \ + CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \ + CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \ + FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \ + %(if [ -n '%ldflags' ]; then echo 'LDFLAGS="$LDFLAGS%ldflags"; export LDFLAGS ;'; fi) + +%before_configure \ + %setup_compile_flags \ + CONFIGURE_TOP="${CONFIGURE_TOP:-.}"; \ + %{?!_disable_ld_as_needed:/usr/lib/rpm/mandriva/force-as-needed-for-shared-lib-in-libtool ;} \ + %{?!_disable_ld_no_undefined:/usr/lib/rpm/mandriva/drop-ld-no-undefined-for-shared-lib-modules-in-libtool ;} \ + %{__fix_libtool_ltmain_from_overlinking} ; \ + %{__fix_libtool_from_moving_options_after_libs} $CONFIGURE_TOP ; \ + %{__fix_dlsearch_path_in_libtool_for_multilib} $CONFIGURE_TOP %{_lib} + +# This is an improved version of %configure (from PLD team). +%configure \ + %before_configure ; \ + %{?!_disable_libtoolize:%{?__libtoolize_configure:%{__libtoolize_configure};}} \ + [ -f $CONFIGURE_TOP/configure.in -o -f $CONFIGURE_TOP/configure.ac ] && \ + CONFIGURE_XPATH="--x-includes=%{_prefix}/include --x-libraries=%{_prefix}/%{_lib}" \ + $CONFIGURE_TOP/configure %{_target_platform} \\\ + --program-prefix=%{?_program_prefix} \\\ + --prefix=%{_prefix} \\\ + --exec-prefix=%{_exec_prefix} \\\ + --bindir=%{_bindir} \\\ + --sbindir=%{_sbindir} \\\ + --sysconfdir=%{_sysconfdir} \\\ + --datadir=%{_datadir} \\\ + --includedir=%{_includedir} \\\ + --libdir=%{_libdir} \\\ + --libexecdir=%{_libexecdir} \\\ + --localstatedir=%{_localstatedir} \\\ + --sharedstatedir=%{_sharedstatedir} \\\ + --mandir=%{_mandir} \\\ + --infodir=%{_infodir} \\\ + $CONFIGURE_XPATH + +%configure2_5x \ + %before_configure ; \ + %{?_enable_libtoolize:%{?__libtoolize_configure:%{__libtoolize_configure};}} \ + [ -f $CONFIGURE_TOP/configure.in -o -f $CONFIGURE_TOP/configure.ac ] && \ + CONFIGURE_XPATH="--x-includes=%{_prefix}/include --x-libraries=%{_prefix}/%{_lib}" \ + $CONFIGURE_TOP/configure --build=%{_target_platform} \\\ + --prefix=%{_prefix} \\\ + --exec-prefix=%{_exec_prefix} \\\ + --bindir=%{_bindir} \\\ + --sbindir=%{_sbindir} \\\ + --sysconfdir=%{_sysconfdir} \\\ + --datadir=%{_datadir} \\\ + --includedir=%{_includedir} \\\ + --libdir=%{_libdir} \\\ + --libexecdir=%{_libexecdir} \\\ + --localstatedir=%{_localstatedir} \\\ + --sharedstatedir=%{_sharedstatedir} \\\ + --mandir=%{_mandir} \\\ + --infodir=%{_infodir} \\\ + $CONFIGURE_XPATH + + +%old_makeinstall \ + make \\\ + prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\ + exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\ + bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\ + sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\ + sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\ + datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\ + includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\ + libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\ + libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\ + localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\ + sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\ + mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\ + infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\ + install + + +%perl_convert_version() %(perl -Mversion -le ' + $x = "%{1}"; + $y = $x; + $x =~ s/[[:alpha:]]*$//; + $y =~ s/^$x//; + $x =~ s/\D*$//; + $v = version->new($x)->normal; + $v =~ s/^v//; + print "$v$y"; +') + +# kept for compatibility, but should not be used, especially the ugly perl_archlib! +%perl_sitearch %(eval "`perl -V:installsitearch`"; echo $installsitearch) +%perl_archlib %(eval "`perl -V:installarchlib`"; echo $installarchlib) + +#-------------------------------------------------------------------------------- +# Macro from conectiva + +# Shorthand for %{defined with_...} +# macros provided by rpm 4.4, but buggy :( +%_with() %{expand: %%{?_with_%1:1} %%{!?_with_%1: %%{?_without_%1:0} %%{!?_without_%1: %%{?with_%1:%%{with_%1}} %%{!?with_%1: %%{?without_%1:!%%{without_%1}} %%{!?without_%1: %%{?2:%%2} %%{!?2:1} } } } } } +%_without() !%{expand: %%{with %1 %{?2:%2}}} + +%_package_i18n(g:f:) \ +%%package -n %{?1:%{1}}%{?!1:%{name}}-i18n\ +Summary: Internationalization and locale data for %{?1:%{1}}%{?!1:%{name}}\ +License: %{license}\ +Group: %{?-g:%{-g*}}%{?!-g:%{group}}\ +\ +%%description -n %{?1:%{1}}%{?!1:%{name}}-i18n\ +Internationalization and locale data for %{?1:%{1}}%{?!1:%{name}}\ +\ +%%files -n %{?1:%{1}}%{?!1:%{name}}-i18n %{?-f:%{-f}}%{?!-f:-f %{?1:%{1}}%{?!1:%{name}}.lang}\ +%{nil} + + +#------------------------------------------------------------------------------ +# Ocaml macro +# + +%ocaml_sitelib %(if [ -x /usr/bin/ocamlc ]; then ocamlc -where;fi)/site-lib + +#------------------------------------------------------------------------------ +# Redefine RPM sections to allow jumping over them using "--without

". +# This an interesting alternative to --short-circuit. +# The following are mostly equivalent: +# % rpmbuild -bi --short-circuit foo.spec && rpmbuild -bb --short-circuit foo.spec +# % rpmbuild -bb --without build foo.spec + +%prep %%prep \ +[ %{_with prep} -eq 1 ] || exit 0 \ +[ %{_with build} -eq 1 ] || exit 0 \ +[ %{_with install} -eq 1 ] || exit 0 \ +%{nil} + +%build %%build \ +[ %{_with install} -eq 1 ] || exit 0 \ +[ %{_with build} -eq 1 ] || exit 0 \ +%{nil} + +%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package_and_restore}}}\ +%%install\ +[ %{_with install} -eq 1 ] || exit 0 \ +%{nil} + +%check %%check \ +[ %{_with check} -eq 1 ] || exit 0 \ +%{nil} + +%{load:/etc/rpm/macros.d/*.macros} diff --git a/rpm-5.4.9/macros/mandriva.in b/rpm-5.4.9/macros/mandriva.in new file mode 100644 index 0000000..87c9049 --- /dev/null +++ b/rpm-5.4.9/macros/mandriva.in @@ -0,0 +1,499 @@ +%distribution Mandriva Linux +%vendor Mandriva +%bugurl http://qa.mandriva.com +%disturl http://mandriva.org + +# This macro will disable the transaction lock on /var/lib/rpm/__db.*. +# This lock is of no use to us and will also result in errors when trying to +# install src.rpms as regular user. +%_rpmlock_path %{nil} + +%_upgrade_tag name +%_obsolete_tag name + +# Disable automatic dependencies on parent directory and symlinks for now +%_check_symlink_deps 0 +%_check_dirname_deps 0 + +# The directory where buildroots will be created. +%_buildrootdir %{_topdir}/BUILDROOT + +# Build root path, where %install installs the package during build. +%buildroot %{_buildrootdir}/%{name}-%{version}-%{release}%{?disttag:-%{disttag}%{?distepoch:%{distepoch}}}.%{_target_cpu}-buildroot + +# Path to top of build area. +%_topdir %(echo $HOME)/rpmbuild + +%_docdir_fmt %%{NAME} + +%_changelog_truncate 3 years ago + +# This will die as soon as remaining usage has been phased out... +%mkrel(c:) %{-c: 0.%{-c*}.}%{1}%{?subrel:.%subrel} +%manbo_mkrel() %mkrel +%multiarch() %{1} + +# This will enable the use of distepoch and disttag in stead of polluting +# %release with such. +%evr_tuple_select 1234 +%evr_tuple_order EVRD +%disttag %{!?distsuffix:mdv}%{?distsuffix} +%distepoch %(sed -e 's#.*release\\ \\(\\S*\\).*#\\1#' /etc/release) + +# Dynamic EVRD tags macro for use with versioned provides/requires in place of +# '%{version}-%{release}', ie. to automatically add distepoch or epoch if present +%EVRD %{?epoch:%{epoch}:}%{?version:%{version}}%{?release:-%{release}}%{?distepoch::%{distepoch}} + +%rename() \ +Obsoletes: %{1} < %{EVRD} \ +Provides: %{1} = %{EVRD} + + +%_default_patch_flags -s -U +%_default_patch_fuzz 0 + +%apply_patches %{lua:\ +f = io.open(rpm.expand("%{_specfile}"))\ +if f then\ + for l in f:lines() do\ + match,b,num = string.find(string.lower(l), "^%s*patch(%d+)%s*:.*$")\ + if match then print(rpm.expand("%patch"..num.." -p1 -b "..string.format(".%04d~",num).." \\\n")); end\ + end\ + f:close()\ +end\ +} + + +%make %{__make} %{_smp_mflags} +%makeinstall_std make DESTDIR=%{?buildroot:%{buildroot}} install + +# mdvbz#62322 +%__grep /bin/grep +%__gzip /bin/gzip +%__lua %{_bindir}/lua +%__rc %{_bindir}/rc +%__xar %{_bindir}/xar + +# mdvbz#61851 +%__tar_wildcards --wildcards + +%_loop_detection_loglevel 4 + + +%_sysconfdir /etc +%_defaultdocdir %{_datadir}/doc +%_localstatedir %{_var} +%_logdir %{_var}/log +%_libexecdir %{_libdir} + +# mdvbz#62741 +# standard systemd directories +%_systemdrootdir /lib/systemd +%_systemunitdir %{_systemdrootdir}/system +%_systemgeneratordir %{_systemdrootdir}/system-generators +%_systemshutdowndir %{_systemdrootdir}/system-shutdown + +%_systemddatadir %{_datadir}/systemd +%_userunitdir %{_systemddatadir}/user + +%_systemdlibexecdir %{_libexecdir}/systemd +%_usergeneratordir %{_systemdlibexecdir}/user-generators + +%_systemdconfdir %{_sysconfdir}/systemd + +# +# multiarch is used to deal with situations where headers that contain +# ie. architecture specific parts to solve file conflicts between +# packages of different archs in multilib environments. +# +# Note: more details at http://wiki.mandriva.com/en/Policies/Multiarch +%multiarch_platform multiarch-%{_arch}-%{_target_os} +%multiarch_bindir %{_bindir}/%{multiarch_platform} +%multiarch_includedir %{_includedir}/%{multiarch_platform} +%multiarch_binaries() %{_rpmhome}/mkmultiarch binaries %{1} +%multiarch_includes() %{_rpmhome}/mkmultiarch includes %{1} + +# Check for need of multiarch, terminate build if needed and not used. +# +# Note: The default value should be 0 for legacy compatibility. +# TODO: fix check script and implement support for using +#%_multiarch_required_terminate_build 1 + +# use XZ to compress binary packages: +%_binary_payload w5.xzdio + +%_enable_debug_packages 1 + + +# Default extension to use (for info files) +%_extension .xz + + +%__install_info /sbin/install-info + +%_install_info() if [[ -f %{_infodir}/%{1}%{_extension} ]]; then %{__install_info} %{_infodir}/%{1}%{_extension} --dir=%{_infodir}/dir; fi \ +%{nil} +# (nb: keep the "alone on its line ';'") +%_remove_install_info() if [ "$1" = "0" ]; then if [[ -f %{_infodir}/%{1}%{_extension} ]]; then %{__install_info} %{_infodir}/%{1}%{_extension} --dir=%{_infodir}/dir --remove ; fi; fi \ +%{nil} + + +# Macro: %{mklibname [ []] [-s] [-d]} +# - %{mklibname test} => lib64test, on a lib64 platform +# - %{mklibname test 1 -d} => libtest1-devel +# - %{mklibname test 1 -d 0 -s} => libtest1_0-static-devel +%mklibname(ds) %{_lib}%{1}%{?2:%{2}}%{?3:_%{3}}%{-s:-static}%{-d:-devel} + +%debugcflags %{?_enable_debug_packages:-Wa,--compress-debug-sections -gdwarf-4 -fvar-tracking-assignments -frecord-gcc-switches -Wstrict-aliasing=2} + +# common compilation flags + +%_fortify_cflags -Wp,-D_FORTIFY_SOURCE=2 + +# cf http://wiki.mandriva.com/en/Development/Packaging/Problems#format_not_a_string_literal_and_no_format_arguments +%Werror_cflags -Wformat -Werror=format-security + +%_ssp_cflags -fstack-protector --param=ssp-buffer-size=4%{?_serverbuild_flags: %_serverbuild_flags} +%__common_cflags -O2 %{debugcflags} -pipe %{Werror_cflags} %{?_fortify_cflags} +%__common_cflags_with_ssp %{__common_cflags} %{?_ssp_cflags} + +# Servers opt flags. +# Also set the env variables for backward compatibility (#32050). +%serverbuild %define _serverbuild_flags -fstack-protector-all \ +export CFLAGS="%optflags -fPIE"; export CXXFLAGS="%optflags -fPIE"; export RPM_OPT_FLAGS="%optflags -fPIE" \ +%{nil} + +# Hardened Servers opt flags. +%serverbuild_hardened %define _hardened_flags -Wl,-z,now -pie \ +%serverbuild \ +%{nil} + +#============================================================================== +# ---- GPG/PGP/PGP5 signature macros. +# Macro(s) to hold the arguments passed to GPG/PGP for package +# signing and verification. +# + +# We disable the gpg key automatic querying +%_hkp_keyserver_query %nil + + +# Verify digest/signature flags for various rpm modes: +# 0x30300 (_RPMVSF_NODIGESTS) --nohdrchk if set, don't check digest(s) +# 0xc0c00 (_RPMVSF_NOSIGNATURES) --nosignature if set, don't check signature(s) +# 0xf0000 (_RPMVSF_NOPAYLOAD) --nolegacy if set, check header+payload (if possible) +# 0x00f00 (_RPMVSF_NOHEADER) --nohdrchk if set, don't check rpmdb headers +%_vsflags_query 0xc0c00 + + +# Open all indices before doing chroot(2). +# +%_openall_before_chroot 1 + +%_repackage_all_erasures 0 + +# activate filetriggers (cf http://wiki.mandriva.com/en/Rpm_filetriggers) +%_filetriggers_dir /var/lib/rpm/filetriggers + + +%__gzip /bin/gzip + +%_sys_macros_dir %{_sysconfdir}/rpm/macros.d +%build_sysmacrospath() %{_sys_macros_dir}/%{?1:%{1}}%{?!1:%{name}}.macros + +# when %_with_git_repository is set, these macros modify the behaviour of "%prep" step: +%_after_setup %{?_with_git_repository:GIT_URL="%{?git_url}" GIT_REPOSITORY_CACHE=%{?git_repository_cache} @USRLIBRPM@/@RPMCANONVENDOR@/git-repository--after-tarball} +%_patch %{?_with_git_repository:PKG_NAME=%{name} @USRLIBRPM@/@RPMCANONVENDOR@/git-repository--apply-patch}%{?!_with_git_repository:%__patch -U} + +# used by "git-repository--after-tarball": +%git_repository_cache %_topdir/%{name}.git + + +# Various programs used in rpm scripts +%_update_desktop_database_bin %{_bindir}/update-desktop-database +%_update_mime_database_bin %{_bindir}/update-mime-database +%_update_icon_cache_bin %{_bindir}/gtk-update-icon-cache +%_gconftool_bin %{_bindir}/gconftool-2 +%_scrollkeeper_bin %{_bindir}/scrollkeeper-update + +%__service /sbin/service +%__chkconfig /sbin/chkconfig + +#============================================================================== +# ---- Required rpmrc macros. +# Macros that used to be initialized as a side effect of rpmrc parsing. +# These are the default values that can be overridden by other +# (e.g. per-platform, per-system, per-packager, per-package) macros. +# + +%debug_package_and_restore %{debug_package} \ +%package __restore__\ +Summary: %{summary}\ +Group: %{group}\ +%description __restore__ + +%_arch_tag_suffix (%_lib) +%arch_tagged() %{1}%{_arch_tag_suffix} %{?2:%{2} %{3}%{?!3:%{error:undefined 3rd argument in arch_tagged}}} + +# Games macros +%_gamesdir games +%_gamesbindir %{_prefix}/%{_gamesdir} +%_gamesdatadir %{_datadir}/%{_gamesdir} + +# Menu directories +%_menudir %{_prefix}/lib/menu +%_iconsdir %{_datadir}/icons +%_miconsdir %{_datadir}/icons/mini +%_liconsdir %{_datadir}/icons/large + +%_xfontdir %_datadir/fonts + +%_webconfdir %{_sysconfdir}/httpd/conf +%_webappconfdir %_webconfdir/webapps.d +# compatibility +%webappconfdir %_webappconfdir + +#============================================================================== +# ---- Build configuration macros. +# +# Package version macro. +# The type of package to produce, for compatibility with legacy +# versions of rpm. +# +# Script gets packaged file list on input. +# Returns list of multiarch files that are not marked as such, +# i.e. files in $RPM_BUILD_ROOT that have arch-dependent values +# +# Note: Disable (by commenting out) for legacy compatibility. +#%__check_multiarch_files @USRLIBRPM@/check-multiarch-files %{buildroot} + +# Use internal dependency generator rather than external helpers? +%_use_internal_dependency_generator 1 +# TODO: merge relevant changes into rpm version rather than using our own +%__perl_provides @USRLIBRPM@/@RPMCANONVENDOR@/perl.prov +%__perl_requires @USRLIBRPM@/@RPMCANONVENDOR@/perl.req +%__php_provides @USRLIBRPM@/@RPMCANONVENDOR@/php.prov +%__php_requires @USRLIBRPM@/@RPMCANONVENDOR@/php.req + +%__find_provides @USRLIBRPM@/@RPMCANONVENDOR@/filter.sh '%{?_provides_exceptions:%{_provides_exceptions}}%{!?_provides_exceptions: }' '%{?_exclude_files_from_autoprov:%{_exclude_files_from_autoprov}}%{!?_exclude_files_from_autoprov: }' '%{buildroot}' @USRLIBRPM@/@RPMCANONVENDOR@/find-provides +%__find_requires @USRLIBRPM@/@RPMCANONVENDOR@/filter.sh '%{?_requires_exceptions:%{_requires_exceptions}}%{!?_requires_exceptions: }' '%{?_exclude_files_from_autoreq:%{_exclude_files_from_autoreq}}%{!?_exclude_files_from_autoreq: }' '%{buildroot}' @USRLIBRPM@/@RPMCANONVENDOR@/find-requires %{?buildroot:%{buildroot}} %{?_target_cpu:%{_target_cpu}} + +# Update Menu +%_update_menus_bin %{_bindir}/update-menus + +# Update Window Managers session. +%_fndsession_bin %{_sbindir}/fndSession +%make_session %{nil} +%make_dm_session if [ -x %{_fndsession_bin} ]; then %{_fndsession_bin} || true ; fi \ +%{nil} + +# For rebuilding gcj-db +%_rebuildgcjdb_bin %{_bindir}/rebuild-gcj-db +%update_gcjdb if [ -x %{_rebuildgcjdb_bin} ]; then %{_rebuildgcjdb_bin} || true ; fi \ +%{nil} + +%clean_gcjdb if [ -x %{_rebuildgcjdb_bin} ]; then %{_rebuildgcjdb_bin} || true ; fi \ +%{nil} + +# Rebuild icon cache +%update_icon_cache() if [ -x %{_update_icon_cache_bin} ]; then \ +%{_update_icon_cache_bin} --force --quiet %{_iconsdir}/%{1} || true; fi \ +%{nil} + +%clean_icon_cache() if [ -x %{_update_icon_cache_bin} -a -r %{_iconsdir}/%{1}/index.theme ]; then \ +%{_update_icon_cache_bin} --force --quiet %{_iconsdir}/%{1} || true ; fi \ +%{nil} + +# GConf schemas: +# installation is handled by filetriggers +%post_install_gconf_schemas() %{nil} +# but uninstall still need to be done in %preun: +%preun_uninstall_gconf_schemas() if [ "$1" = "0" -a -x %{_gconftool_bin} ]; then \ +SCHEMAS="" \ +for SCHEMA in %{*} ; do \ + SCHEMAS="$SCHEMAS %{_sysconfdir}/gconf/schemas/$SCHEMA.schemas" \ +done \ +GCONF_CONFIG_SOURCE=`%{_gconftool_bin} --get-default-source` %{_gconftool_bin} --makefile-uninstall-rule $SCHEMAS > /dev/null || true ; fi \ +%{nil} + +# Mandriva Linux version +# - "9.1" => 910 +# - "10.2.2" => 1022 +# (user may copy the following line in specfile) +%mdkversion %(perl -pe '/(\\d+)\\.(\\d)\\.?(\\d)?/; $_="$1$2".($3||0)' /etc/mandriva-release) + +#============================================================================== +# ---- Build policy macros. +# +#--------------------------------------------------------------------- +# Expanded at end of %install scriptlet. +# + +%__os_install_post \ + %{?__spec_helper_post}%{?!__spec_helper_post:/usr/share/spec-helper/spec-helper} \ +%{nil} + +#============================================================================== +# ---- specfile macros. +# Macro(s) here can be used reliably for reproducible builds. +# (Note: Above is the goal, below are the macros under development) +# + +%__fix_libtool_ltmain_from_overlinking @USRLIBRPM@/@RPMCANONVENDOR@/fix-libtool-ltmain-from-overlinking +%__fix_libtool_from_moving_options_after_libs @USRLIBRPM@/@RPMCANONVENDOR@/fix-libtool-from-moving-options-after-libs +%__fix_dlsearch_path_in_libtool_for_multilib @USRLIBRPM@/@RPMCANONVENDOR@/fix-dlsearch-path-in-libtool-for-multilib + +%__cputoolize cputoolize + +%__libtoolize_configure %{?__libtoolize:(cd $CONFIGURE_TOP; [ ! -f configure.in -a ! -f configure.ac ] || %{__libtoolize} --copy --force)} + +%ldflags %{?!_disable_ld_as_needed: -Wl,--as-needed}%{?!_disable_ld_no_undefined: -Wl,--no-undefined}%{?!_disable_ld_relro: -Wl,-z,relro}%{?!_disable_ld_O1: -Wl,-O1}%{?!_disable_ld_build_id: -Wl,--build-id}%{?!_disable_ld_enable_new_dtags: -Wl,--enable-new-dtags}%{?_hardened_flags: %_hardened_flags} + +%setup_compile_flags \ + CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \ + CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \ + FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \ + %(if [ -n '%ldflags' ]; then echo 'LDFLAGS="$LDFLAGS%ldflags"; export LDFLAGS ;'; fi) + +%before_configure \ + %setup_compile_flags \ + CONFIGURE_TOP="${CONFIGURE_TOP:-.}"; \ + %{?!_disable_ld_as_needed:@USRLIBRPM@/@RPMCANONVENDOR@/force-as-needed-for-shared-lib-in-libtool ;} \ + %{?!_disable_ld_no_undefined:@USRLIBRPM@/@RPMCANONVENDOR@/drop-ld-no-undefined-for-shared-lib-modules-in-libtool ;} \ + %{__fix_libtool_ltmain_from_overlinking} ; \ + %{__fix_libtool_from_moving_options_after_libs} $CONFIGURE_TOP ; \ + %{__fix_dlsearch_path_in_libtool_for_multilib} $CONFIGURE_TOP %{_lib} + +# This is an improved version of %configure (from PLD team). +%configure \ + %before_configure ; \ + %{?!_disable_libtoolize:%{?__libtoolize_configure:%{__libtoolize_configure};}} \ + [ -f $CONFIGURE_TOP/configure.in -o -f $CONFIGURE_TOP/configure.ac ] && \ + CONFIGURE_XPATH="--x-includes=%{_prefix}/include --x-libraries=%{_prefix}/%{_lib}" \ + $CONFIGURE_TOP/configure %{_target_platform} \\\ + --program-prefix=%{?_program_prefix} \\\ + --prefix=%{_prefix} \\\ + --exec-prefix=%{_exec_prefix} \\\ + --bindir=%{_bindir} \\\ + --sbindir=%{_sbindir} \\\ + --sysconfdir=%{_sysconfdir} \\\ + --datadir=%{_datadir} \\\ + --includedir=%{_includedir} \\\ + --libdir=%{_libdir} \\\ + --libexecdir=%{_libexecdir} \\\ + --localstatedir=%{_localstatedir} \\\ + --sharedstatedir=%{_sharedstatedir} \\\ + --mandir=%{_mandir} \\\ + --infodir=%{_infodir} \\\ + $CONFIGURE_XPATH + +%configure2_5x \ + %before_configure ; \ + %{?_enable_libtoolize:%{?__libtoolize_configure:%{__libtoolize_configure};}} \ + [ -f $CONFIGURE_TOP/configure.in -o -f $CONFIGURE_TOP/configure.ac ] && \ + CONFIGURE_XPATH="--x-includes=%{_prefix}/include --x-libraries=%{_prefix}/%{_lib}" \ + $CONFIGURE_TOP/configure --build=%{_target_platform} \\\ + --prefix=%{_prefix} \\\ + --exec-prefix=%{_exec_prefix} \\\ + --bindir=%{_bindir} \\\ + --sbindir=%{_sbindir} \\\ + --sysconfdir=%{_sysconfdir} \\\ + --datadir=%{_datadir} \\\ + --includedir=%{_includedir} \\\ + --libdir=%{_libdir} \\\ + --libexecdir=%{_libexecdir} \\\ + --localstatedir=%{_localstatedir} \\\ + --sharedstatedir=%{_sharedstatedir} \\\ + --mandir=%{_mandir} \\\ + --infodir=%{_infodir} \\\ + $CONFIGURE_XPATH + + +%old_makeinstall \ + make \\\ + prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\ + exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\ + bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\ + sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\ + sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\ + datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\ + includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\ + libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\ + libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\ + localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\ + sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\ + mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\ + infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\ + install + + +%perl_convert_version() %(perl -Mversion -le ' + $x = "%{1}"; + $y = $x; + $x =~ s/[[:alpha:]]*$//; + $y =~ s/^$x//; + $x =~ s/\D*$//; + $v = version->new($x)->normal; + $v =~ s/^v//; + print "$v$y"; +') + +# kept for compatibility, but should not be used, especially the ugly perl_archlib! +%perl_sitearch %(eval "`perl -V:installsitearch`"; echo $installsitearch) +%perl_archlib %(eval "`perl -V:installarchlib`"; echo $installarchlib) + +#-------------------------------------------------------------------------------- +# Macro from conectiva + +# Shorthand for %{defined with_...} +# macros provided by rpm 4.4, but buggy :( +%_with() %{expand: %%{?_with_%1:1} %%{!?_with_%1: %%{?_without_%1:0} %%{!?_without_%1: %%{?with_%1:%%{with_%1}} %%{!?with_%1: %%{?without_%1:!%%{without_%1}} %%{!?without_%1: %%{?2:%%2} %%{!?2:1} } } } } } +%_without() !%{expand: %%{with %1 %{?2:%2}}} + +%_package_i18n(g:f:) \ +%%package -n %{?1:%{1}}%{?!1:%{name}}-i18n\ +Summary: Internationalization and locale data for %{?1:%{1}}%{?!1:%{name}}\ +License: %{license}\ +Group: %{?-g:%{-g*}}%{?!-g:%{group}}\ +\ +%%description -n %{?1:%{1}}%{?!1:%{name}}-i18n\ +Internationalization and locale data for %{?1:%{1}}%{?!1:%{name}}\ +\ +%%files -n %{?1:%{1}}%{?!1:%{name}}-i18n %{?-f:%{-f}}%{?!-f:-f %{?1:%{1}}%{?!1:%{name}}.lang}\ +%{nil} + + +#------------------------------------------------------------------------------ +# Ocaml macro +# + +%ocaml_sitelib %(if [ -x /usr/bin/ocamlc ]; then ocamlc -where;fi)/site-lib + +#------------------------------------------------------------------------------ +# Redefine RPM sections to allow jumping over them using "--without
". +# This an interesting alternative to --short-circuit. +# The following are mostly equivalent: +# % rpmbuild -bi --short-circuit foo.spec && rpmbuild -bb --short-circuit foo.spec +# % rpmbuild -bb --without build foo.spec + +%prep %%prep \ +[ %{_with prep} -eq 1 ] || exit 0 \ +[ %{_with build} -eq 1 ] || exit 0 \ +[ %{_with install} -eq 1 ] || exit 0 \ +%{nil} + +%build %%build \ +[ %{_with install} -eq 1 ] || exit 0 \ +[ %{_with build} -eq 1 ] || exit 0 \ +%{nil} + +%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package_and_restore}}}\ +%%install\ +[ %{_with install} -eq 1 ] || exit 0 \ +%{nil} + +%check %%check \ +[ %{_with check} -eq 1 ] || exit 0 \ +%{nil} + +%{load:/etc/rpm/macros.d/*.macros} diff --git a/rpm-5.4.9/macros/mandriva.in.orig b/rpm-5.4.9/macros/mandriva.in.orig new file mode 100644 index 0000000..3cb9da1 --- /dev/null +++ b/rpm-5.4.9/macros/mandriva.in.orig @@ -0,0 +1,499 @@ +%distribution Mandriva Linux +%vendor Mandriva +%bugurl http://qa.mandriva.com +%disturl http://mandriva.org + +# This macro will disable the transaction lock on /var/lib/rpm/__db.*. +# This lock is of no use to us and will also result in errors when trying to +# install src.rpms as regular user. +%_rpmlock_path %{nil} + +%_upgrade_tag name +%_obsolete_tag name + +# Disable automatic dependencies on parent directory and symlinks for now +%_check_symlink_deps 0 +%_check_dirname_deps 0 + +# The directory where buildroots will be created. +%_buildrootdir %{_topdir}/BUILDROOT + +# Build root path, where %install installs the package during build. +%buildroot %{_buildrootdir}/%{name}-%{version}-%{release}%{?disttag:-%{disttag}%{?distepoch:%{distepoch}}}.%{_target_cpu}-buildroot + +# Path to top of build area. +%_topdir %(echo $HOME)/rpmbuild + +%_docdir_fmt %%{NAME} + +%_changelog_truncate 3 years ago + +# This will die as soon as remaining usage has been phased out... +%mkrel(c:) %{-c: 0.%{-c*}.}%{1}%{?subrel:.%subrel} +%manbo_mkrel() %mkrel +%multiarch() %{1} + +# This will enable the use of distepoch and disttag in stead of polluting +# %release with such. +%evr_tuple_select 1234 +%evr_tuple_order EVRD +%disttag %{!?distsuffix:mdv}%{?distsuffix} +%distepoch %(sed -e 's#.*release\\ \\(\\S*\\).*#\\1#' /etc/release) + +# Dynamic EVRD tags macro for use with versioned provides/requires in place of +# '%{version}-%{release}', ie. to automatically add distepoch or epoch if present +%EVRD %{?epoch:%{epoch}:}%{?version:%{version}}%{?release:-%{release}}%{?distepoch::%{distepoch}} + +%rename() \ +Obsoletes: %{1} < %{EVRD} \ +Provides: %{1} = %{EVRD} + + +%_default_patch_flags -s -U +%_default_patch_fuzz 0 + +%apply_patches %{lua:\ +f = io.open(rpm.expand("%{_specfile}"))\ +if f then\ + for l in f:lines() do\ + match,b,num = string.find(string.lower(l), "^%s*patch(%d+)%s*:.*$")\ + if match then print(rpm.expand("%patch"..num.." -p1 -b "..string.format(".%04d~",num).." \\\n")); end\ + end\ + f:close()\ +end\ +} + + +%make %{__make} %{_smp_mflags} +%makeinstall_std make DESTDIR=%{?buildroot:%{buildroot}} install + +# mdvbz#62322 +%__grep /bin/grep +%__gzip /bin/gzip +%__lua %{_bindir}/lua +%__rc %{_bindir}/rc +%__xar %{_bindir}/xar + +# mdvbz#61851 +%__tar_wildcards --wildcards + +%_loop_detection_loglevel 4 + + +%_sysconfdir /etc +%_defaultdocdir %{_datadir}/doc +%_localstatedir %{_var} +%_logdir %{_var}/log +%_libexecdir %{_libdir} + +# mdvbz#62741 +# standard systemd directories +%_systemdrootdir /lib/systemd +%_systemunitdir %{_systemdrootdir}/system +%_systemgeneratordir %{_systemdrootdir}/system-generators +%_systemshutdowndir %{_systemdrootdir}/system-shutdown + +%_systemddatadir %{_datadir}/systemd +%_userunitdir %{_systemddatadir}/user + +%_systemdlibexecdir %{_libexecdir}/systemd +%_usergeneratordir %{_systemdlibexecdir}/user-generators + +%_systemdconfdir %{_sysconfdir}/systemd + +# +# multiarch is used to deal with situations where headers that contain +# ie. architecture specific parts to solve file conflicts between +# packages of different archs in multilib environments. +# +# Note: more details at http://wiki.mandriva.com/en/Policies/Multiarch +%multiarch_platform multiarch-%{_arch}-%{_target_os} +%multiarch_bindir %{_bindir}/%{multiarch_platform} +%multiarch_includedir %{_includedir}/%{multiarch_platform} +%multiarch_binaries() %{_rpmhome}/mkmultiarch binaries %{1} +%multiarch_includes() %{_rpmhome}/mkmultiarch includes %{1} + +# Check for need of multiarch, terminate build if needed and not used. +# +# Note: The default value should be 0 for legacy compatibility. +# TODO: fix check script and implement support for using +#%_multiarch_required_terminate_build 1 + +# use XZ to compress binary packages: +%_binary_payload w5.xzdio + +%_enable_debug_packages 1 + + +# Default extension to use (for info files) +%_extension .xz + + +%__install_info /sbin/install-info + +%_install_info() if [[ -f %{_infodir}/%{1}%{_extension} ]]; then %{__install_info} %{_infodir}/%{1}%{_extension} --dir=%{_infodir}/dir; fi \ +%{nil} +# (nb: keep the "alone on its line ';'") +%_remove_install_info() if [ "$1" = "0" ]; then if [[ -f %{_infodir}/%{1}%{_extension} ]]; then %{__install_info} %{_infodir}/%{1}%{_extension} --dir=%{_infodir}/dir --remove ; fi; fi \ +%{nil} + + +# Macro: %{mklibname [ []] [-s] [-d]} +# - %{mklibname test} => lib64test, on a lib64 platform +# - %{mklibname test 1 -d} => libtest1-devel +# - %{mklibname test 1 -d 0 -s} => libtest1_0-static-devel +%mklibname(ds) %{_lib}%{1}%{?2:%{2}}%{?3:_%{3}}%{-s:-static}%{-d:-devel} + +%debugcflags %{?_enable_debug_packages:-gdwarf-4 -fvar-tracking-assignments -frecord-gcc-switches -Wstrict-aliasing=2} + +# common compilation flags + +%_fortify_cflags -Wp,-D_FORTIFY_SOURCE=2 + +# cf http://wiki.mandriva.com/en/Development/Packaging/Problems#format_not_a_string_literal_and_no_format_arguments +%Werror_cflags -Wformat -Werror=format-security + +%_ssp_cflags -fstack-protector --param=ssp-buffer-size=4%{?_serverbuild_flags: %_serverbuild_flags} +%__common_cflags -O2 %{debugcflags} -pipe %{Werror_cflags} %{?_fortify_cflags} +%__common_cflags_with_ssp %{__common_cflags} %{?_ssp_cflags} + +# Servers opt flags. +# Also set the env variables for backward compatibility (#32050). +%serverbuild %define _serverbuild_flags -fstack-protector-all \ +export CFLAGS="%optflags -fPIE"; export CXXFLAGS="%optflags -fPIE"; export RPM_OPT_FLAGS="%optflags -fPIE" \ +%{nil} + +# Hardened Servers opt flags. +%serverbuild_hardened %define _hardened_flags -Wl,-z,now -pie \ +%serverbuild \ +%{nil} + +#============================================================================== +# ---- GPG/PGP/PGP5 signature macros. +# Macro(s) to hold the arguments passed to GPG/PGP for package +# signing and verification. +# + +# We disable the gpg key automatic querying +%_hkp_keyserver_query %nil + + +# Verify digest/signature flags for various rpm modes: +# 0x30300 (_RPMVSF_NODIGESTS) --nohdrchk if set, don't check digest(s) +# 0xc0c00 (_RPMVSF_NOSIGNATURES) --nosignature if set, don't check signature(s) +# 0xf0000 (_RPMVSF_NOPAYLOAD) --nolegacy if set, check header+payload (if possible) +# 0x00f00 (_RPMVSF_NOHEADER) --nohdrchk if set, don't check rpmdb headers +%_vsflags_query 0xc0c00 + + +# Open all indices before doing chroot(2). +# +%_openall_before_chroot 1 + +%_repackage_all_erasures 0 + +# activate filetriggers (cf http://wiki.mandriva.com/en/Rpm_filetriggers) +%_filetriggers_dir /var/lib/rpm/filetriggers + + +%__gzip /bin/gzip + +%_sys_macros_dir %{_sysconfdir}/rpm/macros.d +%build_sysmacrospath() %{_sys_macros_dir}/%{?1:%{1}}%{?!1:%{name}}.macros + +# when %_with_git_repository is set, these macros modify the behaviour of "%prep" step: +%_after_setup %{?_with_git_repository:GIT_URL="%{?git_url}" GIT_REPOSITORY_CACHE=%{?git_repository_cache} @USRLIBRPM@/@RPMCANONVENDOR@/git-repository--after-tarball} +%_patch %{?_with_git_repository:PKG_NAME=%{name} @USRLIBRPM@/@RPMCANONVENDOR@/git-repository--apply-patch}%{?!_with_git_repository:%__patch -U} + +# used by "git-repository--after-tarball": +%git_repository_cache %_topdir/%{name}.git + + +# Various programs used in rpm scripts +%_update_desktop_database_bin %{_bindir}/update-desktop-database +%_update_mime_database_bin %{_bindir}/update-mime-database +%_update_icon_cache_bin %{_bindir}/gtk-update-icon-cache +%_gconftool_bin %{_bindir}/gconftool-2 +%_scrollkeeper_bin %{_bindir}/scrollkeeper-update + +%__service /sbin/service +%__chkconfig /sbin/chkconfig + +#============================================================================== +# ---- Required rpmrc macros. +# Macros that used to be initialized as a side effect of rpmrc parsing. +# These are the default values that can be overridden by other +# (e.g. per-platform, per-system, per-packager, per-package) macros. +# + +%debug_package_and_restore %{debug_package} \ +%package __restore__\ +Summary: %{summary}\ +Group: %{group}\ +%description __restore__ + +%_arch_tag_suffix (%_lib) +%arch_tagged() %{1}%{_arch_tag_suffix} %{?2:%{2} %{3}%{?!3:%{error:undefined 3rd argument in arch_tagged}}} + +# Games macros +%_gamesdir games +%_gamesbindir %{_prefix}/%{_gamesdir} +%_gamesdatadir %{_datadir}/%{_gamesdir} + +# Menu directories +%_menudir %{_prefix}/lib/menu +%_iconsdir %{_datadir}/icons +%_miconsdir %{_datadir}/icons/mini +%_liconsdir %{_datadir}/icons/large + +%_xfontdir %_datadir/fonts + +%_webconfdir %{_sysconfdir}/httpd/conf +%_webappconfdir %_webconfdir/webapps.d +# compatibility +%webappconfdir %_webappconfdir + +#============================================================================== +# ---- Build configuration macros. +# +# Package version macro. +# The type of package to produce, for compatibility with legacy +# versions of rpm. +# +# Script gets packaged file list on input. +# Returns list of multiarch files that are not marked as such, +# i.e. files in $RPM_BUILD_ROOT that have arch-dependent values +# +# Note: Disable (by commenting out) for legacy compatibility. +#%__check_multiarch_files @USRLIBRPM@/check-multiarch-files %{buildroot} + +# Use internal dependency generator rather than external helpers? +%_use_internal_dependency_generator 1 +# TODO: merge relevant changes into rpm version rather than using our own +%__perl_provides @USRLIBRPM@/@RPMCANONVENDOR@/perl.prov +%__perl_requires @USRLIBRPM@/@RPMCANONVENDOR@/perl.req +%__php_provides @USRLIBRPM@/@RPMCANONVENDOR@/php.prov +%__php_requires @USRLIBRPM@/@RPMCANONVENDOR@/php.req + +%__find_provides @USRLIBRPM@/@RPMCANONVENDOR@/filter.sh '%{?_provides_exceptions:%{_provides_exceptions}}%{!?_provides_exceptions: }' '%{?_exclude_files_from_autoprov:%{_exclude_files_from_autoprov}}%{!?_exclude_files_from_autoprov: }' '%{buildroot}' @USRLIBRPM@/@RPMCANONVENDOR@/find-provides +%__find_requires @USRLIBRPM@/@RPMCANONVENDOR@/filter.sh '%{?_requires_exceptions:%{_requires_exceptions}}%{!?_requires_exceptions: }' '%{?_exclude_files_from_autoreq:%{_exclude_files_from_autoreq}}%{!?_exclude_files_from_autoreq: }' '%{buildroot}' @USRLIBRPM@/@RPMCANONVENDOR@/find-requires %{?buildroot:%{buildroot}} %{?_target_cpu:%{_target_cpu}} + +# Update Menu +%_update_menus_bin %{_bindir}/update-menus + +# Update Window Managers session. +%_fndsession_bin %{_sbindir}/fndSession +%make_session %{nil} +%make_dm_session if [ -x %{_fndsession_bin} ]; then %{_fndsession_bin} || true ; fi \ +%{nil} + +# For rebuilding gcj-db +%_rebuildgcjdb_bin %{_bindir}/rebuild-gcj-db +%update_gcjdb if [ -x %{_rebuildgcjdb_bin} ]; then %{_rebuildgcjdb_bin} || true ; fi \ +%{nil} + +%clean_gcjdb if [ -x %{_rebuildgcjdb_bin} ]; then %{_rebuildgcjdb_bin} || true ; fi \ +%{nil} + +# Rebuild icon cache +%update_icon_cache() if [ -x %{_update_icon_cache_bin} ]; then \ +%{_update_icon_cache_bin} --force --quiet %{_iconsdir}/%{1} || true; fi \ +%{nil} + +%clean_icon_cache() if [ -x %{_update_icon_cache_bin} -a -r %{_iconsdir}/%{1}/index.theme ]; then \ +%{_update_icon_cache_bin} --force --quiet %{_iconsdir}/%{1} || true ; fi \ +%{nil} + +# GConf schemas: +# installation is handled by filetriggers +%post_install_gconf_schemas() %{nil} +# but uninstall still need to be done in %preun: +%preun_uninstall_gconf_schemas() if [ "$1" = "0" -a -x %{_gconftool_bin} ]; then \ +SCHEMAS="" \ +for SCHEMA in %{*} ; do \ + SCHEMAS="$SCHEMAS %{_sysconfdir}/gconf/schemas/$SCHEMA.schemas" \ +done \ +GCONF_CONFIG_SOURCE=`%{_gconftool_bin} --get-default-source` %{_gconftool_bin} --makefile-uninstall-rule $SCHEMAS > /dev/null || true ; fi \ +%{nil} + +# Mandriva Linux version +# - "9.1" => 910 +# - "10.2.2" => 1022 +# (user may copy the following line in specfile) +%mdkversion %(perl -pe '/(\\d+)\\.(\\d)\\.?(\\d)?/; $_="$1$2".($3||0)' /etc/mandriva-release) + +#============================================================================== +# ---- Build policy macros. +# +#--------------------------------------------------------------------- +# Expanded at end of %install scriptlet. +# + +%__os_install_post \ + %{?__spec_helper_post}%{?!__spec_helper_post:/usr/share/spec-helper/spec-helper} \ +%{nil} + +#============================================================================== +# ---- specfile macros. +# Macro(s) here can be used reliably for reproducible builds. +# (Note: Above is the goal, below are the macros under development) +# + +%__fix_libtool_ltmain_from_overlinking @USRLIBRPM@/@RPMCANONVENDOR@/fix-libtool-ltmain-from-overlinking +%__fix_libtool_from_moving_options_after_libs @USRLIBRPM@/@RPMCANONVENDOR@/fix-libtool-from-moving-options-after-libs +%__fix_dlsearch_path_in_libtool_for_multilib @USRLIBRPM@/@RPMCANONVENDOR@/fix-dlsearch-path-in-libtool-for-multilib + +%__cputoolize cputoolize + +%__libtoolize_configure %{?__libtoolize:(cd $CONFIGURE_TOP; [ ! -f configure.in -a ! -f configure.ac ] || %{__libtoolize} --copy --force)} + +%ldflags %{?!_disable_ld_as_needed: -Wl,--as-needed}%{?!_disable_ld_no_undefined: -Wl,--no-undefined}%{?!_disable_ld_relro: -Wl,-z,relro}%{?!_disable_ld_O1: -Wl,-O1}%{?!_disable_ld_build_id: -Wl,--build-id}%{?!_disable_ld_enable_new_dtags: -Wl,--enable-new-dtags}%{?_hardened_flags: %_hardened_flags} + +%setup_compile_flags \ + CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \ + CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \ + FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \ + %(if [ -n '%ldflags' ]; then echo 'LDFLAGS="$LDFLAGS%ldflags"; export LDFLAGS ;'; fi) + +%before_configure \ + %setup_compile_flags \ + CONFIGURE_TOP="${CONFIGURE_TOP:-.}"; \ + %{?!_disable_ld_as_needed:@USRLIBRPM@/@RPMCANONVENDOR@/force-as-needed-for-shared-lib-in-libtool ;} \ + %{?!_disable_ld_no_undefined:@USRLIBRPM@/@RPMCANONVENDOR@/drop-ld-no-undefined-for-shared-lib-modules-in-libtool ;} \ + %{__fix_libtool_ltmain_from_overlinking} ; \ + %{__fix_libtool_from_moving_options_after_libs} $CONFIGURE_TOP ; \ + %{__fix_dlsearch_path_in_libtool_for_multilib} $CONFIGURE_TOP %{_lib} + +# This is an improved version of %configure (from PLD team). +%configure \ + %before_configure ; \ + %{?!_disable_libtoolize:%{?__libtoolize_configure:%{__libtoolize_configure};}} \ + [ -f $CONFIGURE_TOP/configure.in -o -f $CONFIGURE_TOP/configure.ac ] && \ + CONFIGURE_XPATH="--x-includes=%{_prefix}/include --x-libraries=%{_prefix}/%{_lib}" \ + $CONFIGURE_TOP/configure %{_target_platform} \\\ + --program-prefix=%{?_program_prefix} \\\ + --prefix=%{_prefix} \\\ + --exec-prefix=%{_exec_prefix} \\\ + --bindir=%{_bindir} \\\ + --sbindir=%{_sbindir} \\\ + --sysconfdir=%{_sysconfdir} \\\ + --datadir=%{_datadir} \\\ + --includedir=%{_includedir} \\\ + --libdir=%{_libdir} \\\ + --libexecdir=%{_libexecdir} \\\ + --localstatedir=%{_localstatedir} \\\ + --sharedstatedir=%{_sharedstatedir} \\\ + --mandir=%{_mandir} \\\ + --infodir=%{_infodir} \\\ + $CONFIGURE_XPATH + +%configure2_5x \ + %before_configure ; \ + %{?_enable_libtoolize:%{?__libtoolize_configure:%{__libtoolize_configure};}} \ + [ -f $CONFIGURE_TOP/configure.in -o -f $CONFIGURE_TOP/configure.ac ] && \ + CONFIGURE_XPATH="--x-includes=%{_prefix}/include --x-libraries=%{_prefix}/%{_lib}" \ + $CONFIGURE_TOP/configure --build=%{_target_platform} \\\ + --prefix=%{_prefix} \\\ + --exec-prefix=%{_exec_prefix} \\\ + --bindir=%{_bindir} \\\ + --sbindir=%{_sbindir} \\\ + --sysconfdir=%{_sysconfdir} \\\ + --datadir=%{_datadir} \\\ + --includedir=%{_includedir} \\\ + --libdir=%{_libdir} \\\ + --libexecdir=%{_libexecdir} \\\ + --localstatedir=%{_localstatedir} \\\ + --sharedstatedir=%{_sharedstatedir} \\\ + --mandir=%{_mandir} \\\ + --infodir=%{_infodir} \\\ + $CONFIGURE_XPATH + + +%old_makeinstall \ + make \\\ + prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\ + exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\ + bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\ + sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\ + sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\ + datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\ + includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\ + libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\ + libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\ + localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\ + sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\ + mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\ + infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\ + install + + +%perl_convert_version() %(perl -Mversion -le ' + $x = "%{1}"; + $y = $x; + $x =~ s/[[:alpha:]]*$//; + $y =~ s/^$x//; + $x =~ s/\D*$//; + $v = version->new($x)->normal; + $v =~ s/^v//; + print "$v$y"; +') + +# kept for compatibility, but should not be used, especially the ugly perl_archlib! +%perl_sitearch %(eval "`perl -V:installsitearch`"; echo $installsitearch) +%perl_archlib %(eval "`perl -V:installarchlib`"; echo $installarchlib) + +#-------------------------------------------------------------------------------- +# Macro from conectiva + +# Shorthand for %{defined with_...} +# macros provided by rpm 4.4, but buggy :( +%_with() %{expand: %%{?_with_%1:1} %%{!?_with_%1: %%{?_without_%1:0} %%{!?_without_%1: %%{?with_%1:%%{with_%1}} %%{!?with_%1: %%{?without_%1:!%%{without_%1}} %%{!?without_%1: %%{?2:%%2} %%{!?2:1} } } } } } +%_without() !%{expand: %%{with %1 %{?2:%2}}} + +%_package_i18n(g:f:) \ +%%package -n %{?1:%{1}}%{?!1:%{name}}-i18n\ +Summary: Internationalization and locale data for %{?1:%{1}}%{?!1:%{name}}\ +License: %{license}\ +Group: %{?-g:%{-g*}}%{?!-g:%{group}}\ +\ +%%description -n %{?1:%{1}}%{?!1:%{name}}-i18n\ +Internationalization and locale data for %{?1:%{1}}%{?!1:%{name}}\ +\ +%%files -n %{?1:%{1}}%{?!1:%{name}}-i18n %{?-f:%{-f}}%{?!-f:-f %{?1:%{1}}%{?!1:%{name}}.lang}\ +%{nil} + + +#------------------------------------------------------------------------------ +# Ocaml macro +# + +%ocaml_sitelib %(if [ -x /usr/bin/ocamlc ]; then ocamlc -where;fi)/site-lib + +#------------------------------------------------------------------------------ +# Redefine RPM sections to allow jumping over them using "--without
". +# This an interesting alternative to --short-circuit. +# The following are mostly equivalent: +# % rpmbuild -bi --short-circuit foo.spec && rpmbuild -bb --short-circuit foo.spec +# % rpmbuild -bb --without build foo.spec + +%prep %%prep \ +[ %{_with prep} -eq 1 ] || exit 0 \ +[ %{_with build} -eq 1 ] || exit 0 \ +[ %{_with install} -eq 1 ] || exit 0 \ +%{nil} + +%build %%build \ +[ %{_with install} -eq 1 ] || exit 0 \ +[ %{_with build} -eq 1 ] || exit 0 \ +%{nil} + +%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package_and_restore}}}\ +%%install\ +[ %{_with install} -eq 1 ] || exit 0 \ +%{nil} + +%check %%check \ +[ %{_with check} -eq 1 ] || exit 0 \ +%{nil} + +%{load:/etc/rpm/macros.d/*.macros} diff --git a/rpm-5.4.9/macros/mono b/rpm-5.4.9/macros/mono new file mode 100644 index 0000000..c84ae60 --- /dev/null +++ b/rpm-5.4.9/macros/mono @@ -0,0 +1,10 @@ +# Mono specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/mono} + +# Path to scripts to autogenerate mono package dependencies, +# +# Note: Used iff _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +%__mono_provides %{_rpmhome}/mono-find-provides +%__mono_requires %{_rpmhome}/mono-find-requires diff --git a/rpm-5.4.9/macros/mono.in b/rpm-5.4.9/macros/mono.in new file mode 100644 index 0000000..c84ae60 --- /dev/null +++ b/rpm-5.4.9/macros/mono.in @@ -0,0 +1,10 @@ +# Mono specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/mono} + +# Path to scripts to autogenerate mono package dependencies, +# +# Note: Used iff _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +%__mono_provides %{_rpmhome}/mono-find-provides +%__mono_requires %{_rpmhome}/mono-find-requires diff --git a/rpm-5.4.9/macros/perl b/rpm-5.4.9/macros/perl new file mode 100644 index 0000000..cf72605 --- /dev/null +++ b/rpm-5.4.9/macros/perl @@ -0,0 +1,45 @@ +# Perl specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/perl} +# + +%__perl /usr/bin/perl + +# Path to scripts to autogenerate perl package dependencies, +# +# Note: Used iff _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +#%__perl_provides %{_rpmhome}/perldeps.pl --provides +#%__perl_requires %{_rpmhome}/perldeps.pl --requires +%__perl_provides %{_rpmhome}/perl.prov +%__perl_requires %{_rpmhome}/perl.req + +# Useful macros for building *.rpm perl packages. +# (from Artur Frysiak ) +# +# For example, these can be used as (from ImageMagick.spec from PLD site) +# [...] +# BuildPrereq: perl +# [...] +# %package perl +# Summary: libraries and modules for access to ImageMagick from perl +# Group: Development/Languages/Perl +# Requires: %{name} = %{version} +# [...] +# %install +# rm -fr $RPM_BUILD_ROOT +# install -d $RPM_BUILD_ROOT/%{perl_sitearch} +# [...] +# %files perl +# %defattr(644,root,root,755) +# %{perl_sitearch}/Image +# %dir %{perl_sitearch}/auto/Image +# + +%perl_sitearch %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch) +%perl_sitelib %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib) +%perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch) +%perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib) +%perl_archlib %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib) +%perl_privlib %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib) +%perl_version %(eval "`%{__perl} -V:version`"; echo $version) diff --git a/rpm-5.4.9/macros/perl.in b/rpm-5.4.9/macros/perl.in new file mode 100644 index 0000000..ced5731 --- /dev/null +++ b/rpm-5.4.9/macros/perl.in @@ -0,0 +1,45 @@ +# Perl specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/perl} +# + +%__perl @__PERL@ + +# Path to scripts to autogenerate perl package dependencies, +# +# Note: Used iff _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +#%__perl_provides %{_rpmhome}/perldeps.pl --provides +#%__perl_requires %{_rpmhome}/perldeps.pl --requires +%__perl_provides %{_rpmhome}/perl.prov +%__perl_requires %{_rpmhome}/perl.req + +# Useful macros for building *.rpm perl packages. +# (from Artur Frysiak ) +# +# For example, these can be used as (from ImageMagick.spec from PLD site) +# [...] +# BuildPrereq: perl +# [...] +# %package perl +# Summary: libraries and modules for access to ImageMagick from perl +# Group: Development/Languages/Perl +# Requires: %{name} = %{version} +# [...] +# %install +# rm -fr $RPM_BUILD_ROOT +# install -d $RPM_BUILD_ROOT/%{perl_sitearch} +# [...] +# %files perl +# %defattr(644,root,root,755) +# %{perl_sitearch}/Image +# %dir %{perl_sitearch}/auto/Image +# + +%perl_sitearch %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch) +%perl_sitelib %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib) +%perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch) +%perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib) +%perl_archlib %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib) +%perl_privlib %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib) +%perl_version %(eval "`%{__perl} -V:version`"; echo $version) diff --git a/rpm-5.4.9/macros/php b/rpm-5.4.9/macros/php new file mode 100644 index 0000000..4cb50d1 --- /dev/null +++ b/rpm-5.4.9/macros/php @@ -0,0 +1,16 @@ +# PHP specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/php} + +%__php %{_bindir}/php + +# Path to scripts to autogenerate php package dependencies, +# +# Note: Used iff _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +#%__php_provides %{_rpmhome}/phpdeps.sh --provides +#%__php_requires %{_rpmhome}/phpdeps.sh --requires +#%__php_provides %{_rpmhome}/php.prov +#%__php_requires %{_rpmhome}/php.req + +%php_pear_dir %{_datadir}/pear diff --git a/rpm-5.4.9/macros/php.in b/rpm-5.4.9/macros/php.in new file mode 100644 index 0000000..ee1ff5f --- /dev/null +++ b/rpm-5.4.9/macros/php.in @@ -0,0 +1,16 @@ +# PHP specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/php} + +%__php @__PHP@ + +# Path to scripts to autogenerate php package dependencies, +# +# Note: Used iff _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +#%__php_provides %{_rpmhome}/phpdeps.sh --provides +#%__php_requires %{_rpmhome}/phpdeps.sh --requires +#%__php_provides %{_rpmhome}/php.prov +#%__php_requires %{_rpmhome}/php.req + +%php_pear_dir %{_datadir}/pear diff --git a/rpm-5.4.9/macros/pkgconfig b/rpm-5.4.9/macros/pkgconfig new file mode 100644 index 0000000..66e2636 --- /dev/null +++ b/rpm-5.4.9/macros/pkgconfig @@ -0,0 +1,11 @@ +# Pkgconfig specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/pkgconfig} +# + +# Path to scripts to autogenerate pkgconfig package dependencies, +# +# Note: Used iff _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +%__pkgconfig_provides %{_rpmhome}/pkgconfigdeps.sh --provides +%__pkgconfig_requires %{_rpmhome}/pkgconfigdeps.sh --requires diff --git a/rpm-5.4.9/macros/pkgconfig.in b/rpm-5.4.9/macros/pkgconfig.in new file mode 100644 index 0000000..66e2636 --- /dev/null +++ b/rpm-5.4.9/macros/pkgconfig.in @@ -0,0 +1,11 @@ +# Pkgconfig specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/pkgconfig} +# + +# Path to scripts to autogenerate pkgconfig package dependencies, +# +# Note: Used iff _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +%__pkgconfig_provides %{_rpmhome}/pkgconfigdeps.sh --provides +%__pkgconfig_requires %{_rpmhome}/pkgconfigdeps.sh --requires diff --git a/rpm-5.4.9/macros/python b/rpm-5.4.9/macros/python new file mode 100644 index 0000000..ff1c891 --- /dev/null +++ b/rpm-5.4.9/macros/python @@ -0,0 +1,48 @@ +# Python specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/python} + +%__python /usr/bin/python + +# Path to scripts to autogenerate python package dependencies, +# +# Note: Used if _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +%__python_provides %{_rpmhome}/pythoneggs.py --provides +%__python_requires %{_rpmhome}/pythoneggs.py --requires +# +%python_sitearch %(%{__python} -c "import os; from distutils.sysconfig import get_python_lib; lib=get_python_lib(1); print os.path.islink(lib) and os.path.abspath(os.path.join(os.path.dirname(lib),os.readlink(lib))) or lib") +%python_sitelib %(%{__python} -c "import os; from distutils.sysconfig import get_python_lib; lib=get_python_lib(); print os.path.islink(lib) and os.path.abspath(os.path.join(os.path.dirname(lib),os.readlink(lib))) or lib") +%python_version %(%{__python} -c "import sys; print(sys.version[0:3])") + +# python main version +%py_ver %(%{__python} -c "import sys; v=sys.version_info[:2]; print '%%d.%%d'%%v" 2>/dev/null || echo PYTHON-NOT-FOUND) +%py_prefix %(%{__python} -c "import sys; print sys.prefix" 2>/dev/null || echo PYTHON-NOT-FOUND) +%py_platlibdir %(%{__python} -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(standard_lib=1,plat_specific=1)' 2>/dev/null || echo PYTHON-LIBDIR-NOT-FOUND) +%py_purelibdir %(%{__python} -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(standard_lib=1,plat_specific=0)' 2>/dev/null || echo PYTHON-LIBDIR-NOT-FOUND) +# backward compatibility +%py_libdir %py_purelibdir + +%py_platsitedir %(%{__python} -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(plat_specific=1)' 2>/dev/null || echo PYTHON-LIBDIR-NOT-FOUND) +%py_puresitedir %(%{__python} -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib()' 2>/dev/null || echo PYTHON-LIBDIR-NOT-FOUND) +%py_sitedir %py_puresitedir + +%py_dyndir %{py_platlibdir}/lib-dynload + +%py_incdir %(%{__python} -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_inc()' 2>/dev/null || echo PYTHON-INCLUDEDIR-NOT-FOUND) + +%py_compile(O) \ +find %1 -name '*.pyc' -exec rm -f {} \\; \ +%{__python} -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %1 \ +%{-O: \ +find %1 -name '*.pyo' -exec rm -f {} \\; \ +%{__python} -O -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %1 \ +} + +# pure python modules compilation +%py_comp %{__python} -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('%{buildroot}'):])" + +%py_ocomp %{__python} -O -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('%{buildroot}'):])" + +%py_requires(d) \ +BuildRequires: %{__python} %{-d:python-devel} diff --git a/rpm-5.4.9/macros/python.in b/rpm-5.4.9/macros/python.in new file mode 100644 index 0000000..6c64669 --- /dev/null +++ b/rpm-5.4.9/macros/python.in @@ -0,0 +1,48 @@ +# Python specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/python} + +%__python @__PYTHON@ + +# Path to scripts to autogenerate python package dependencies, +# +# Note: Used if _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +%__python_provides %{_rpmhome}/pythoneggs.py --provides +%__python_requires %{_rpmhome}/pythoneggs.py --requires +# +%python_sitearch %(%{__python} -c "import os; from distutils.sysconfig import get_python_lib; lib=get_python_lib(1); print os.path.islink(lib) and os.path.abspath(os.path.join(os.path.dirname(lib),os.readlink(lib))) or lib") +%python_sitelib %(%{__python} -c "import os; from distutils.sysconfig import get_python_lib; lib=get_python_lib(); print os.path.islink(lib) and os.path.abspath(os.path.join(os.path.dirname(lib),os.readlink(lib))) or lib") +%python_version %(%{__python} -c "import sys; print(sys.version[0:3])") + +# python main version +%py_ver %(%{__python} -c "import sys; v=sys.version_info[:2]; print '%%d.%%d'%%v" 2>/dev/null || echo PYTHON-NOT-FOUND) +%py_prefix %(%{__python} -c "import sys; print sys.prefix" 2>/dev/null || echo PYTHON-NOT-FOUND) +%py_platlibdir %(%{__python} -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(standard_lib=1,plat_specific=1)' 2>/dev/null || echo PYTHON-LIBDIR-NOT-FOUND) +%py_purelibdir %(%{__python} -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(standard_lib=1,plat_specific=0)' 2>/dev/null || echo PYTHON-LIBDIR-NOT-FOUND) +# backward compatibility +%py_libdir %py_purelibdir + +%py_platsitedir %(%{__python} -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(plat_specific=1)' 2>/dev/null || echo PYTHON-LIBDIR-NOT-FOUND) +%py_puresitedir %(%{__python} -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib()' 2>/dev/null || echo PYTHON-LIBDIR-NOT-FOUND) +%py_sitedir %py_puresitedir + +%py_dyndir %{py_platlibdir}/lib-dynload + +%py_incdir %(%{__python} -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_inc()' 2>/dev/null || echo PYTHON-INCLUDEDIR-NOT-FOUND) + +%py_compile(O) \ +find %1 -name '*.pyc' -exec rm -f {} \\; \ +%{__python} -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %1 \ +%{-O: \ +find %1 -name '*.pyo' -exec rm -f {} \\; \ +%{__python} -O -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %1 \ +} + +# pure python modules compilation +%py_comp %{__python} -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('%{buildroot}'):])" + +%py_ocomp %{__python} -O -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('%{buildroot}'):])" + +%py_requires(d) \ +BuildRequires: %{__python} %{-d:python-devel} diff --git a/rpm-5.4.9/macros/ruby b/rpm-5.4.9/macros/ruby new file mode 100644 index 0000000..9e5d78b --- /dev/null +++ b/rpm-5.4.9/macros/ruby @@ -0,0 +1,40 @@ +# Ruby specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/ruby} + +%__ruby /usr/bin/ruby + +# Path to scripts to autogenerate php package dependencies, +# +# Note: Used if _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +%__ruby_provides %{_rpmhome}/rubygems.rb --provides +%__ruby_requires %{_rpmhome}/rubygems.rb --requires + +%ruby_version %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["ruby_version"]') + +%ruby_archdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["archdir"]') +%ruby_libdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["rubylibdir"]') +%ruby_sitedir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["sitedir"]') +%ruby_sitearchdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["sitearchdir"]') +%ruby_sitelibdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["sitelibdir"]') +%ruby_vendordir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["vendordir"]') +%ruby_vendorarchdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["vendorarchdir"]') +%ruby_vendorlibdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["vendorlibdir"]') +%ruby_gemdir %(%{__ruby} -rrbconfig -e 'include Config; print CONFIG["rubylibdir"].sub(CONFIG["ruby_version"], "gems/#{CONFIG["ruby_version"]}")') +%ruby_ridir %(%{__ruby} -rrbconfig -e 'include Config; print File.join(CONFIG["datadir"], "ri", CONFIG["ruby_version"])') + +%__gem_helper %{_usrlibrpm}/gem_helper.rb + +%gem_build(f:j:) \ + %__gem_helper build \\\ + %{-f:-f%{-f*}} \\\ + %{!-j:%{_smp_mflags}}%{-j:-j%{-j*}} + +%gem_install(i:n:C) \ + DESTDIR=${DESTDIR:-%{buildroot}} \\\ + %__gem_helper install \\\ + --env-shebang --rdoc --ri --force --ignore-dependencies \\\ + %{!-i:--install-dir %{buildroot}%{ruby_gemdir}}%{-i:--install-dir %{-i*}} \\\ + %{!-n:--bindir %{buildroot}%{_bindir}}%{-n:--bindir%{-n*}} \\\ + %{!-C:--fix-permissions} diff --git a/rpm-5.4.9/macros/ruby.in b/rpm-5.4.9/macros/ruby.in new file mode 100644 index 0000000..9a5f180 --- /dev/null +++ b/rpm-5.4.9/macros/ruby.in @@ -0,0 +1,40 @@ +# Ruby specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/ruby} + +%__ruby @__RUBY@ + +# Path to scripts to autogenerate php package dependencies, +# +# Note: Used if _use_internal_dependency_generator is non-zero. The +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. +%__ruby_provides %{_rpmhome}/rubygems.rb --provides +%__ruby_requires %{_rpmhome}/rubygems.rb --requires + +%ruby_version %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["ruby_version"]') + +%ruby_archdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["archdir"]') +%ruby_libdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["rubylibdir"]') +%ruby_sitedir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["sitedir"]') +%ruby_sitearchdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["sitearchdir"]') +%ruby_sitelibdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["sitelibdir"]') +%ruby_vendordir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["vendordir"]') +%ruby_vendorarchdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["vendorarchdir"]') +%ruby_vendorlibdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["vendorlibdir"]') +%ruby_gemdir %(%{__ruby} -rrbconfig -e 'include Config; print CONFIG["rubylibdir"].sub(CONFIG["ruby_version"], "gems/#{CONFIG["ruby_version"]}")') +%ruby_ridir %(%{__ruby} -rrbconfig -e 'include Config; print File.join(CONFIG["datadir"], "ri", CONFIG["ruby_version"])') + +%__gem_helper %{_usrlibrpm}/gem_helper.rb + +%gem_build(f:j:) \ + %__gem_helper build \\\ + %{-f:-f%{-f*}} \\\ + %{!-j:%{_smp_mflags}}%{-j:-j%{-j*}} + +%gem_install(i:n:C) \ + DESTDIR=${DESTDIR:-%{buildroot}} \\\ + %__gem_helper install \\\ + --env-shebang --rdoc --ri --force --ignore-dependencies \\\ + %{!-i:--install-dir %{buildroot}%{ruby_gemdir}}%{-i:--install-dir %{-i*}} \\\ + %{!-n:--bindir %{buildroot}%{_bindir}}%{-n:--bindir%{-n*}} \\\ + %{!-C:--fix-permissions} diff --git a/rpm-5.4.9/macros/selinux b/rpm-5.4.9/macros/selinux new file mode 100644 index 0000000..fb1ef81 --- /dev/null +++ b/rpm-5.4.9/macros/selinux @@ -0,0 +1,41 @@ +# SELinux specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/selinux} +# + +# Desired selinux policy tree +%__policy_tree %{expand:%%global __policy_tree %{lua:\ +t="targeted"\ +f = io.open("/etc/selinux/config")\ +if f then\ + for l in f:lines() do\ + if "SELINUXTYPE=" == string.sub(l,0,12) then t=string.sub(l,13); end\ + end\ + f:close()\ +end\ +print (t)\ +}}%{__policy_tree} + +# Path to selinux file context patterns. +%__file_context_path /etc/selinux/%{__policy_tree}/contexts/files/file_contexts + +# +# Path to selinux file context patterns used to add +# RPMTAG_FILECONTEXTS to packages when building. +# +# Undefined, missing or %{nil} will disable. +%_build_file_context_path %{nil} + +# +# Path to selinux file context patterns used to set +# (or override package content) file contexts when installing. +# +# Undefined, missing or %{nil} will use package content (if available). +%_install_file_context_path %{__file_context_path} + +# +# Path to selinux file context patterns used to verify +# file contexts on file system. +# +# Undefined, missing or %{nil} will use package content (if available). +%_verify_file_context_path %{__file_context_path} diff --git a/rpm-5.4.9/macros/selinux.in b/rpm-5.4.9/macros/selinux.in new file mode 100644 index 0000000..fb1ef81 --- /dev/null +++ b/rpm-5.4.9/macros/selinux.in @@ -0,0 +1,41 @@ +# SELinux specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/selinux} +# + +# Desired selinux policy tree +%__policy_tree %{expand:%%global __policy_tree %{lua:\ +t="targeted"\ +f = io.open("/etc/selinux/config")\ +if f then\ + for l in f:lines() do\ + if "SELINUXTYPE=" == string.sub(l,0,12) then t=string.sub(l,13); end\ + end\ + f:close()\ +end\ +print (t)\ +}}%{__policy_tree} + +# Path to selinux file context patterns. +%__file_context_path /etc/selinux/%{__policy_tree}/contexts/files/file_contexts + +# +# Path to selinux file context patterns used to add +# RPMTAG_FILECONTEXTS to packages when building. +# +# Undefined, missing or %{nil} will disable. +%_build_file_context_path %{nil} + +# +# Path to selinux file context patterns used to set +# (or override package content) file contexts when installing. +# +# Undefined, missing or %{nil} will use package content (if available). +%_install_file_context_path %{__file_context_path} + +# +# Path to selinux file context patterns used to verify +# file contexts on file system. +# +# Undefined, missing or %{nil} will use package content (if available). +%_verify_file_context_path %{__file_context_path} diff --git a/rpm-5.4.9/macros/suse b/rpm-5.4.9/macros/suse new file mode 100644 index 0000000..ffa30f6 --- /dev/null +++ b/rpm-5.4.9/macros/suse @@ -0,0 +1,378 @@ +%distribution mandriva Linux +%vendor novell +%bugurl http://bugzilla.novell.com +%disturl http://software.openmandriva.org +# +# Below is the rpm-suse_macros contained in rpm-4.9.0-122 (Build factory) +# _suse_install_post is defined in macros.brp in the brp-checks-suse +# rpm + + +# need to keep this around for a while +%suse_check %{nil} + +# directories +%_infodir %{_prefix}/share/info +%_mandir %{_prefix}/share/man +%_sysconfdir /etc +%_localstatedir /var +%_defaultdocdir %{_usr}/share/doc/packages + +# package build macros +%make_install make install DESTDIR=%{?buildroot} +%makeinstall make DESTDIR=%{?buildroot:%{buildroot}} install +%rb_arch %(echo %{_host_cpu}-linux | sed -e "s/i686/i586/" -e "s/armv5tel/armv4l/" -e "s/hppa2.0/hppa/") +%rb_ver %(/usr/bin/ruby -e 'puts VERSION.sub(/\\\.\\\d$/, "")') +%insserv_prereq insserv sed +%fillup_prereq fillup coreutils grep diffutils +%suseconfig_fonts_prereq perl aaa_base +%install_info_prereq info + +# _suse_os_install_post is defined in brp-checks-suse +%__os_install_post %{?_suse_os_install_post}%{!?_suse_os_install_post: \ + /usr/lib/rpm/brp-compress \ + /usr/lib/rpm/brp-symlink \ +%{nil}} + +# macro: %restart_on_update() +# Used to restart a service in postun section, if we are +# not running from YaST2 in instsys on update. +%restart_on_update() \ + test -n "$FIRST_ARG" || FIRST_ARG=$1 \ + if test "$FIRST_ARG" -ge 1 ; then \ + test -f /etc/sysconfig/services && . /etc/sysconfig/services \ + if test "$YAST_IS_RUNNING" != "instsys" -a "$DISABLE_RESTART_ON_UPDATE" != yes ; then \ + for service in %{?*} ; do \ + /etc/init.d/$service try-restart > /dev/null || : \ + done \ + fi \ + fi \ + %nil + +# macro: %stop_on_removal() +# Used to stop a service in preun section, if we are +# not running from YaST2 in instsys on removal of this package. +%stop_on_removal() \ + test -n "$FIRST_ARG" || FIRST_ARG=$1 \ + if test "$FIRST_ARG" = "0" ; then \ + test -f /etc/sysconfig/services && . /etc/sysconfig/services \ + if test "$YAST_IS_RUNNING" != "instsys" -a "$DISABLE_STOP_ON_REMOVAL" != yes ; then \ + for service in %{?*} ; do \ + /etc/init.d/$service stop > /dev/null \ + done \ + fi \ + fi \ + %nil +# macro: %configure_kernel_source +# +# +%configure_kernel_source() \ + if test -d /usr/src/linux ; then \ + pushd /usr/src/linux \ + test -f .config || cp arch/%_arch/defconfig.default .config \ + yes "" | make oldconfig \ + make dep \ + popd \ + fi \ + %nil + +%is_plus %(if test -f /.buildenv ; then source /.buildenv ; if [[ "$BUILD_BASENAME" == *+kde ]] ; then echo 1 ; else echo 0 ; fi ; else echo 0 ; fi) + +# deprecated, use %set_permissions instead +%run_permissions() \ + if test "$YAST_IS_RUNNING" != "instsys" ; then \ + if test -x /sbin/SuSEconfig -a -f /sbin/conf.d/SuSEconfig.permissions ; then \ + /sbin/SuSEconfig --module permissions \ + fi \ + fi \ + %nil + +%run_suseconfig(m:) \ + %{!-m:echo -e "\\nERROR: missing parameter for macro run_suseconfig\\n" ; exit 1 ; } \ + if test "$YAST_IS_RUNNING" != "instsys" ; then \ + if test -x /sbin/SuSEconfig -a -f /sbin/conf.d/SuSEconfig.%{-m*} ; then \ + /sbin/SuSEconfig --module %{-m*} \ + else \ + echo -e "\\nWARNING: SuSEconfig or requested SuSEconfig module not present!\\n" ; \ + fi \ + fi \ + %nil + +# macro: run_suseconfig_fonts +# call SuSEconfig modules necessary for font setup +# options: +# -c (the fonts are CJK fonts, also do setup which is only needed +# for CJK) +%run_suseconfig_fonts(c) \ + if test -z "$YAST_IS_RUNNING" ; then \ + if test -x /sbin/conf.d/SuSEconfig.fonts ; then \ + %run_suseconfig -m fonts \ + fi \ + %{-c:if test -x /sbin/conf.d/SuSEconfig.ghostscript-cjk ; then \ + %run_suseconfig -m ghostscript-cjk \ + fi} \ + fi \ + %nil + +%set_permissions(f:) \ + if [ -x /usr/bin/chkstat ]; then \ + /usr/bin/chkstat -n --set --system %{**} \ + fi \ + %nil + +%verify_permissions(e:f:) \ + /usr/bin/chkstat -n --warn --system %{**} 1>&2 \ + %nil + +# %{suse_update_config [-fcl] [dirs...]} +# -f: force, ignore timestamp +# -c: no config.guess,config.sub +# -l: no ltconfig,ltmain.sh +%suse_update_config(fcl) \ + AUTOMAKE_DIR=/usr/share/automake \ + [ -d $AUTOMAKE_DIR ] || AUTOMAKE_DIR=/usr/share/automake* \ + %{!-c:\ + [ -d $AUTOMAKE_DIR ] || { \ + echo 'Please, install automake.' \ + exit 1 \ + } \ + } \ + for d in . %{?*}; do \ + %{!-c:\ + for f in config.sub config.guess; do \ + if test -f $d/$f -a ! $d/$f -ef $AUTOMAKE_DIR/$f ; then \ + %{!-f:[ $d/$f -nt $AUTOMAKE_DIR/$f ] ||} cp -f $AUTOMAKE_DIR/$f $d/$f \ + fi \ + if test -d $d -a ! -f $d/depcomp -a -f $AUTOMAKE_DIR/depcomp ; then \ + cp -f $AUTOMAKE_DIR/depcomp $d/depcomp \ + echo "please add depcomp to sources for new automake!" \ + fi \ + if test -f $d/missing -a ! $d/missing -ef $AUTOMAKE_DIR/missing ; then \ + cp -f $AUTOMAKE_DIR/missing $d/missing \ + fi \ + done \ + } \ + %{!-l:\ + for f in ltconfig ltmain.sh; do \ + if test -f $d/$f; then \ + sed 's/linux-gnu\\([^*][^*]*\\)\\*/linux*\\1*/g; s/linux-gnu/linux/g; s,/lib\\\>,/%_lib,g; s,/%_lib\\([\$-]\\),/lib\\1,g' $d/$f > $d/$f-$$ && \ + mv -f $d/$f-$$ $d/$f \ + chmod +x $d/$f \ + fi \ + done \ + } \ + done \ + + +%suse_update_libdir() \ + if [ %_lib != lib ]; then \ + for file in %{?*} ; do \ + [ ! -e $file ] && echo "Error: $file does not exist!" && exit -1 \ + [ -e $file.nolib64 ] && echo "Error: $file.nolib64 already exists!" && exit -1 \ + cp $file $file.nolib64 \ + echo "patching $file" \ + sed -e "s,/lib\\\>,/%_lib,g" $file.nolib64 | sed -e "s,/%_lib/cpp,/lib/cpp,; s,/usr/%_lib/perl,/usr/lib/perl, ; s,/%_lib\\([\$-]\\),/lib\\1,g" > $file \ + rm -f $file.nolib64 \ + done; \ + fi ; \ + + +# macro: fillup_and_insserv +# do the fillup and insserv calls for postinstall +# options: +# -n (use first argument as name for fillup template filenames +# instead of package name) +# -f (skip fillup parts) +# -i (skip insserv parts) +# -y (default start-variable value to yes) +# Used only if X-UnitedLinux-Default-Enabled is not specified +# in the init script +# -Y (force_yes: always activate, discard setting before update) +# arguments: +# [if "-n" first argument as package name] +# Pairs of: +# main script name +# and +# name of (old) START variable (unless -s is given) +# +# template for variables into /etc/sysconfig/package: +# /var/adm/fillup-templates/sysconfig.package +%fillup_and_insserv(finpsyY) \ + %{-p:echo "-p option for fillup_and_insserv no longer supported (ever only used on SL8.0)"; exit 1;} \ + %{-s:echo "STARTVAR for fillup_and_insserv no longer supported (rc.config is gone since SL8.0)"; exit 1;} \ + test -n "$FIRST_ARG" || FIRST_ARG=$1 \ + %{-Y:FORCE_YES=1}%{!-Y:FORCE_YES=0} \ + set -- %{?*} \ + %{-n:PNAME=$1 ; shift }%{!-n:PNAME=%{name}} \ + INSSRV_ARRAY="" \ + while [ ${#*} -gt 0 ] ; do \ + SCRIPTNAME=$1 \ + shift \ + SV_B='^### BEGIN INIT INFO' \ + SV_E='^### END INIT INFO' \ + SV_KW=Default-Enabled \ + SV_VALUE=`sed -n -e "/$SV_B/,/$SV_E/{/^# [^[:space:]]*$SV_KW:[[:space:]]*\\([^[:space:]]*\\).*/s//\\1/p;}" < /etc/init.d/$SCRIPTNAME` \ + test "$FORCE_YES" = "1" && SV_VALUE="yes" \ + test -n "$SV_VALUE" || SV_VALUE=%{-y:"yes"}%{!-y:"no"} \ + INSSRV_ARRAY="$INSSRV_ARRAY $SCRIPTNAME $SV_VALUE" \ + done \ + %{!-f: %{do_real_fillup}} \ + %{!-i: %{add_start_if_needed $INSSRV_ARRAY } } \ + %nil + +# do_real_fillup: internal macro +# this part really calls fillup for the appropriate files +# +%do_real_fillup() \ + TEMPLATE_DIR=/var/adm/fillup-templates \ + SYSC_TEMPLATE=$TEMPLATE_DIR/sysconfig.$PNAME \ + SD_NAME="" \ + %{sysc_fillup} + +# add_start_if_needed: internally used by fillup_and_insserv +%add_start_if_needed() \ + set -- %{?*} \ + while [ ${#*} -gt 0 ] ; do \ + SCRIPTNAME=$1 \ + SV_VALUE=$2 \ + shift 2 \ + test -n "$SCRIPTNAME" -a -n "$SV_VALUE" || { echo "SCRIPTNAME or SV_VALUE unknown"; exit 1;} \ + if test "$FIRST_ARG" = "1" -a "$SV_VALUE" = "no" ; then \ + /sbin/insserv ${YAST_IS_RUNNING:+-f} -r /etc/init.d/$SCRIPTNAME \ + elif test "$FIRST_ARG" = "1" -o "$FORCE_YES" = "1" ; then \ + /sbin/insserv ${YAST_IS_RUNNING:+-f} /etc/init.d/$SCRIPTNAME \ + fi \ + done + +# macro: insserv_cleanup +%insserv_cleanup() \ + /sbin/insserv /etc/init.d + +# macro: fillup_only +# do the fillup for sysconfig files +# template naming convention: +# .../fillup-templates/sysconfig.$NAME1[-$NAME2] +# NAME1: the name of the sysconfig-file +# NAME2: if needed (if more packages fill the +# same sysconfig file) the package name +# options: +# -n set sysconfig name manually +# -a use package name as $NAME2 +# -s use second arg as package-name +# -d use a subdirectory of sysconfig +# (last arg as directory name) +%fillup_only(dans) \ + %{-n:PNAME=%{1}}%{!-n:PNAME=%{name}} \ + %{-s:SUBPNAME=-%{2}}%{!-s:SUBPNAME=%{-a:-%{name}}} \ + TEMPLATE_DIR=/var/adm/fillup-templates \ + SYSC_TEMPLATE=$TEMPLATE_DIR/sysconfig.$PNAME$SUBPNAME \ + SD_NAME="" \ + %{-d:%{-s:SD_NAME=%{3}/}%{!-s:SD_NAME=%{2}/}} \ + %{sysc_fillup} \ + %nil + +# internal only: sysc_fillup +%sysc_fillup() \ + if [ -x /bin/fillup ] ; then \ + if [ -f $SYSC_TEMPLATE ] ; then \ + echo "Updating /etc/sysconfig/$SD_NAME$PNAME..." \ + mkdir -p /etc/sysconfig/$SD_NAME \ + touch /etc/sysconfig/$SD_NAME$PNAME \ + /bin/fillup -q /etc/sysconfig/$SD_NAME$PNAME $SYSC_TEMPLATE \ + fi \ + else \ + echo "ERROR: fillup not found. This should not happen. Please compare" \ + echo "/etc/sysconfig/$PNAME and $TEMPLATE_DIR/sysconfig.$PNAME and" \ + echo "update by hand." \ + fi + +# macro: rename_sysconfig_variable +# as the name says, rename a variable in the file given with -f +%rename_sysconfig_variable(f:) \ + %{!-f:echo "missing argument for rename_sysconfig_variable"; exit 1; }%{-f:FILE=%{-f*}} \ + if [ -f $FILE ] ; then \ + sed -i -e "s/^%{1}=/%{2}=/" $FILE \ + fi + +# macro: remove_and_set +# remove variables from sysconfig.$NAME +# (both if existant) and set them in the environment +# for further handling in postinstall +# options: -n set package name +# -y default to yes if not found (otherwise no) +%remove_and_set(n:y) \ + %{-n:PNAME=%{-n*}}%{!-n:PNAME=%{name}} \ + DEF_VAL=%{-y:"yes"}%{!-y:"no"} \ + DEL_TEMPL=/var/adm/fillup-templates/$PNAME.del \ + rm -f $DEL_TEMPL \ + for var in %{?*} ; do \ + echo -e "#\\n$var=$DEF_VAL\\n" >> $DEL_TEMPL \ + done \ + if [ -f /etc/sysconfig/$PNAME ] ; then \ + /bin/fillup -q -t -r -i -d "=" /etc/sysconfig/$PNAME $DEL_TEMPL /etc/sysconfig/$PNAME.deleted.$$ \ + test -f /etc/sysconfig/$PNAME.new && mv /etc/sysconfig/$PNAME.new /etc/sysconfig/$PNAME \ + fi \ + for i in $DEL_TEMPL /etc/sysconfig/$PNAME.deleted.$$ ; do \ + if [ -f $i ] ; then \ + . $i \ + rm -f $i \ + fi \ + done + +%insserv_force_if_yast() \ + /sbin/insserv ${YAST_IS_RUNNING:+-f} %{?*} + +%run_ldconfig /sbin/ldconfig + +%install_info(:-:) \ + ALL_ARGS=(%{**}) \ + NUM_ARGS=${#ALL_ARGS[@]} \ + if test -x /sbin/install-info ; then \ + if test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \ + /sbin/install-info "${ALL_ARGS[@]}" \ + fi \ + fi ; + +%install_info_delete(:-:) \ + ALL_ARGS=(%{**}) \ + NUM_ARGS=${#ALL_ARGS[@]} \ + if test -x /sbin/install-info ; then \ + if ! test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \ + /sbin/install-info --quiet --delete "${ALL_ARGS[@]}" \ + fi ; \ + fi ; + +# find-supplements.ksyms parses this macro directly out of the spec file: +%supplements_kernel_module() \ + %{expand:%(if ! rpm -q kernel-syms > /dev/null; then echo "%fail Please add the kernel-syms package to BuildRequires"; fi)} + +%suse_version 1140 +%sles_version 0 +%ul_version 0 + +%do_profiling 1 +%cflags_profile_generate -fprofile-generate +%cflags_profile_feedback -fprofile-use + +%suse_install_update_message() \ + install -D -m 644 %1 %buildroot/var/adm/update-messages/%{name}-%{version}-%{release}-%(basename %1).txt \ +%nil + +%suse_install_update_script() \ + install -D -m 755 %1 %buildroot/var/adm/update-scripts/%{name}-%{version}-%{release}-%(basename %1).txt \ +%nil + +# Template for lang sub-package. +%lang_package(n:) \ +%package %{-n:-n %{-n*}-}lang \ +Summary: Languages for package %{name} \ +Group: System/Localization \ +Requires: %{-n:%{-n*}}%{!-n:%{name}} = %{version} \ +Provides: %{-n:%{-n*}}%{!-n:%{name}}-lang-all = %{version} \ +Supplements: packageand(bundle-lang-other:%{-n:%{-n*}}%{!-n:%{name}}) \ +BuildArch: noarch \ +%description %{-n:-n %{-n*}-}lang \ +Provides translations to the package %{name} + +# rpm5 prolog for loading the standard macro +%{load:/etc/rpm/macros.d/*.macros} diff --git a/rpm-5.4.9/macros/suse.in b/rpm-5.4.9/macros/suse.in new file mode 100644 index 0000000..869a180 --- /dev/null +++ b/rpm-5.4.9/macros/suse.in @@ -0,0 +1,378 @@ +%distribution @RPMCANONVENDOR@ Linux +%vendor novell +%bugurl http://bugzilla.novell.com +%disturl http://software.open@RPMCANONVENDOR@.org +# +# Below is the rpm-suse_macros contained in rpm-4.9.0-122 (Build factory) +# _suse_install_post is defined in macros.brp in the brp-checks-suse +# rpm + + +# need to keep this around for a while +%suse_check %{nil} + +# directories +%_infodir %{_prefix}/share/info +%_mandir %{_prefix}/share/man +%_sysconfdir /etc +%_localstatedir /var +%_defaultdocdir %{_usr}/share/doc/packages + +# package build macros +%make_install make install DESTDIR=%{?buildroot} +%makeinstall make DESTDIR=%{?buildroot:%{buildroot}} install +%rb_arch %(echo %{_host_cpu}-linux | sed -e "s/i686/i586/" -e "s/armv5tel/armv4l/" -e "s/hppa2.0/hppa/") +%rb_ver %(/usr/bin/ruby -e 'puts VERSION.sub(/\\\.\\\d$/, "")') +%insserv_prereq insserv sed +%fillup_prereq fillup coreutils grep diffutils +%suseconfig_fonts_prereq perl aaa_base +%install_info_prereq info + +# _suse_os_install_post is defined in brp-checks-suse +%__os_install_post %{?_suse_os_install_post}%{!?_suse_os_install_post: \ + /usr/lib/rpm/brp-compress \ + /usr/lib/rpm/brp-symlink \ +%{nil}} + +# macro: %restart_on_update() +# Used to restart a service in postun section, if we are +# not running from YaST2 in instsys on update. +%restart_on_update() \ + test -n "$FIRST_ARG" || FIRST_ARG=$1 \ + if test "$FIRST_ARG" -ge 1 ; then \ + test -f /etc/sysconfig/services && . /etc/sysconfig/services \ + if test "$YAST_IS_RUNNING" != "instsys" -a "$DISABLE_RESTART_ON_UPDATE" != yes ; then \ + for service in %{?*} ; do \ + /etc/init.d/$service try-restart > /dev/null || : \ + done \ + fi \ + fi \ + %nil + +# macro: %stop_on_removal() +# Used to stop a service in preun section, if we are +# not running from YaST2 in instsys on removal of this package. +%stop_on_removal() \ + test -n "$FIRST_ARG" || FIRST_ARG=$1 \ + if test "$FIRST_ARG" = "0" ; then \ + test -f /etc/sysconfig/services && . /etc/sysconfig/services \ + if test "$YAST_IS_RUNNING" != "instsys" -a "$DISABLE_STOP_ON_REMOVAL" != yes ; then \ + for service in %{?*} ; do \ + /etc/init.d/$service stop > /dev/null \ + done \ + fi \ + fi \ + %nil +# macro: %configure_kernel_source +# +# +%configure_kernel_source() \ + if test -d /usr/src/linux ; then \ + pushd /usr/src/linux \ + test -f .config || cp arch/%_arch/defconfig.default .config \ + yes "" | make oldconfig \ + make dep \ + popd \ + fi \ + %nil + +%is_plus %(if test -f /.buildenv ; then source /.buildenv ; if [[ "$BUILD_BASENAME" == *+kde ]] ; then echo 1 ; else echo 0 ; fi ; else echo 0 ; fi) + +# deprecated, use %set_permissions instead +%run_permissions() \ + if test "$YAST_IS_RUNNING" != "instsys" ; then \ + if test -x /sbin/SuSEconfig -a -f /sbin/conf.d/SuSEconfig.permissions ; then \ + /sbin/SuSEconfig --module permissions \ + fi \ + fi \ + %nil + +%run_suseconfig(m:) \ + %{!-m:echo -e "\\nERROR: missing parameter for macro run_suseconfig\\n" ; exit 1 ; } \ + if test "$YAST_IS_RUNNING" != "instsys" ; then \ + if test -x /sbin/SuSEconfig -a -f /sbin/conf.d/SuSEconfig.%{-m*} ; then \ + /sbin/SuSEconfig --module %{-m*} \ + else \ + echo -e "\\nWARNING: SuSEconfig or requested SuSEconfig module not present!\\n" ; \ + fi \ + fi \ + %nil + +# macro: run_suseconfig_fonts +# call SuSEconfig modules necessary for font setup +# options: +# -c (the fonts are CJK fonts, also do setup which is only needed +# for CJK) +%run_suseconfig_fonts(c) \ + if test -z "$YAST_IS_RUNNING" ; then \ + if test -x /sbin/conf.d/SuSEconfig.fonts ; then \ + %run_suseconfig -m fonts \ + fi \ + %{-c:if test -x /sbin/conf.d/SuSEconfig.ghostscript-cjk ; then \ + %run_suseconfig -m ghostscript-cjk \ + fi} \ + fi \ + %nil + +%set_permissions(f:) \ + if [ -x /usr/bin/chkstat ]; then \ + /usr/bin/chkstat -n --set --system %{**} \ + fi \ + %nil + +%verify_permissions(e:f:) \ + /usr/bin/chkstat -n --warn --system %{**} 1>&2 \ + %nil + +# %{suse_update_config [-fcl] [dirs...]} +# -f: force, ignore timestamp +# -c: no config.guess,config.sub +# -l: no ltconfig,ltmain.sh +%suse_update_config(fcl) \ + AUTOMAKE_DIR=/usr/share/automake \ + [ -d $AUTOMAKE_DIR ] || AUTOMAKE_DIR=/usr/share/automake* \ + %{!-c:\ + [ -d $AUTOMAKE_DIR ] || { \ + echo 'Please, install automake.' \ + exit 1 \ + } \ + } \ + for d in . %{?*}; do \ + %{!-c:\ + for f in config.sub config.guess; do \ + if test -f $d/$f -a ! $d/$f -ef $AUTOMAKE_DIR/$f ; then \ + %{!-f:[ $d/$f -nt $AUTOMAKE_DIR/$f ] ||} cp -f $AUTOMAKE_DIR/$f $d/$f \ + fi \ + if test -d $d -a ! -f $d/depcomp -a -f $AUTOMAKE_DIR/depcomp ; then \ + cp -f $AUTOMAKE_DIR/depcomp $d/depcomp \ + echo "please add depcomp to sources for new automake!" \ + fi \ + if test -f $d/missing -a ! $d/missing -ef $AUTOMAKE_DIR/missing ; then \ + cp -f $AUTOMAKE_DIR/missing $d/missing \ + fi \ + done \ + } \ + %{!-l:\ + for f in ltconfig ltmain.sh; do \ + if test -f $d/$f; then \ + sed 's/linux-gnu\\([^*][^*]*\\)\\*/linux*\\1*/g; s/linux-gnu/linux/g; s,/lib\\\>,/%_lib,g; s,/%_lib\\([\$-]\\),/lib\\1,g' $d/$f > $d/$f-$$ && \ + mv -f $d/$f-$$ $d/$f \ + chmod +x $d/$f \ + fi \ + done \ + } \ + done \ + + +%suse_update_libdir() \ + if [ %_lib != lib ]; then \ + for file in %{?*} ; do \ + [ ! -e $file ] && echo "Error: $file does not exist!" && exit -1 \ + [ -e $file.nolib64 ] && echo "Error: $file.nolib64 already exists!" && exit -1 \ + cp $file $file.nolib64 \ + echo "patching $file" \ + sed -e "s,/lib\\\>,/%_lib,g" $file.nolib64 | sed -e "s,/%_lib/cpp,/lib/cpp,; s,/usr/%_lib/perl,/usr/lib/perl, ; s,/%_lib\\([\$-]\\),/lib\\1,g" > $file \ + rm -f $file.nolib64 \ + done; \ + fi ; \ + + +# macro: fillup_and_insserv +# do the fillup and insserv calls for postinstall +# options: +# -n (use first argument as name for fillup template filenames +# instead of package name) +# -f (skip fillup parts) +# -i (skip insserv parts) +# -y (default start-variable value to yes) +# Used only if X-UnitedLinux-Default-Enabled is not specified +# in the init script +# -Y (force_yes: always activate, discard setting before update) +# arguments: +# [if "-n" first argument as package name] +# Pairs of: +# main script name +# and +# name of (old) START variable (unless -s is given) +# +# template for variables into /etc/sysconfig/package: +# /var/adm/fillup-templates/sysconfig.package +%fillup_and_insserv(finpsyY) \ + %{-p:echo "-p option for fillup_and_insserv no longer supported (ever only used on SL8.0)"; exit 1;} \ + %{-s:echo "STARTVAR for fillup_and_insserv no longer supported (rc.config is gone since SL8.0)"; exit 1;} \ + test -n "$FIRST_ARG" || FIRST_ARG=$1 \ + %{-Y:FORCE_YES=1}%{!-Y:FORCE_YES=0} \ + set -- %{?*} \ + %{-n:PNAME=$1 ; shift }%{!-n:PNAME=%{name}} \ + INSSRV_ARRAY="" \ + while [ ${#*} -gt 0 ] ; do \ + SCRIPTNAME=$1 \ + shift \ + SV_B='^### BEGIN INIT INFO' \ + SV_E='^### END INIT INFO' \ + SV_KW=Default-Enabled \ + SV_VALUE=`sed -n -e "/$SV_B/,/$SV_E/{/^# [^[:space:]]*$SV_KW:[[:space:]]*\\([^[:space:]]*\\).*/s//\\1/p;}" < /etc/init.d/$SCRIPTNAME` \ + test "$FORCE_YES" = "1" && SV_VALUE="yes" \ + test -n "$SV_VALUE" || SV_VALUE=%{-y:"yes"}%{!-y:"no"} \ + INSSRV_ARRAY="$INSSRV_ARRAY $SCRIPTNAME $SV_VALUE" \ + done \ + %{!-f: %{do_real_fillup}} \ + %{!-i: %{add_start_if_needed $INSSRV_ARRAY } } \ + %nil + +# do_real_fillup: internal macro +# this part really calls fillup for the appropriate files +# +%do_real_fillup() \ + TEMPLATE_DIR=/var/adm/fillup-templates \ + SYSC_TEMPLATE=$TEMPLATE_DIR/sysconfig.$PNAME \ + SD_NAME="" \ + %{sysc_fillup} + +# add_start_if_needed: internally used by fillup_and_insserv +%add_start_if_needed() \ + set -- %{?*} \ + while [ ${#*} -gt 0 ] ; do \ + SCRIPTNAME=$1 \ + SV_VALUE=$2 \ + shift 2 \ + test -n "$SCRIPTNAME" -a -n "$SV_VALUE" || { echo "SCRIPTNAME or SV_VALUE unknown"; exit 1;} \ + if test "$FIRST_ARG" = "1" -a "$SV_VALUE" = "no" ; then \ + /sbin/insserv ${YAST_IS_RUNNING:+-f} -r /etc/init.d/$SCRIPTNAME \ + elif test "$FIRST_ARG" = "1" -o "$FORCE_YES" = "1" ; then \ + /sbin/insserv ${YAST_IS_RUNNING:+-f} /etc/init.d/$SCRIPTNAME \ + fi \ + done + +# macro: insserv_cleanup +%insserv_cleanup() \ + /sbin/insserv /etc/init.d + +# macro: fillup_only +# do the fillup for sysconfig files +# template naming convention: +# .../fillup-templates/sysconfig.$NAME1[-$NAME2] +# NAME1: the name of the sysconfig-file +# NAME2: if needed (if more packages fill the +# same sysconfig file) the package name +# options: +# -n set sysconfig name manually +# -a use package name as $NAME2 +# -s use second arg as package-name +# -d use a subdirectory of sysconfig +# (last arg as directory name) +%fillup_only(dans) \ + %{-n:PNAME=%{1}}%{!-n:PNAME=%{name}} \ + %{-s:SUBPNAME=-%{2}}%{!-s:SUBPNAME=%{-a:-%{name}}} \ + TEMPLATE_DIR=/var/adm/fillup-templates \ + SYSC_TEMPLATE=$TEMPLATE_DIR/sysconfig.$PNAME$SUBPNAME \ + SD_NAME="" \ + %{-d:%{-s:SD_NAME=%{3}/}%{!-s:SD_NAME=%{2}/}} \ + %{sysc_fillup} \ + %nil + +# internal only: sysc_fillup +%sysc_fillup() \ + if [ -x /bin/fillup ] ; then \ + if [ -f $SYSC_TEMPLATE ] ; then \ + echo "Updating /etc/sysconfig/$SD_NAME$PNAME..." \ + mkdir -p /etc/sysconfig/$SD_NAME \ + touch /etc/sysconfig/$SD_NAME$PNAME \ + /bin/fillup -q /etc/sysconfig/$SD_NAME$PNAME $SYSC_TEMPLATE \ + fi \ + else \ + echo "ERROR: fillup not found. This should not happen. Please compare" \ + echo "/etc/sysconfig/$PNAME and $TEMPLATE_DIR/sysconfig.$PNAME and" \ + echo "update by hand." \ + fi + +# macro: rename_sysconfig_variable +# as the name says, rename a variable in the file given with -f +%rename_sysconfig_variable(f:) \ + %{!-f:echo "missing argument for rename_sysconfig_variable"; exit 1; }%{-f:FILE=%{-f*}} \ + if [ -f $FILE ] ; then \ + sed -i -e "s/^%{1}=/%{2}=/" $FILE \ + fi + +# macro: remove_and_set +# remove variables from sysconfig.$NAME +# (both if existant) and set them in the environment +# for further handling in postinstall +# options: -n set package name +# -y default to yes if not found (otherwise no) +%remove_and_set(n:y) \ + %{-n:PNAME=%{-n*}}%{!-n:PNAME=%{name}} \ + DEF_VAL=%{-y:"yes"}%{!-y:"no"} \ + DEL_TEMPL=/var/adm/fillup-templates/$PNAME.del \ + rm -f $DEL_TEMPL \ + for var in %{?*} ; do \ + echo -e "#\\n$var=$DEF_VAL\\n" >> $DEL_TEMPL \ + done \ + if [ -f /etc/sysconfig/$PNAME ] ; then \ + /bin/fillup -q -t -r -i -d "=" /etc/sysconfig/$PNAME $DEL_TEMPL /etc/sysconfig/$PNAME.deleted.$$ \ + test -f /etc/sysconfig/$PNAME.new && mv /etc/sysconfig/$PNAME.new /etc/sysconfig/$PNAME \ + fi \ + for i in $DEL_TEMPL /etc/sysconfig/$PNAME.deleted.$$ ; do \ + if [ -f $i ] ; then \ + . $i \ + rm -f $i \ + fi \ + done + +%insserv_force_if_yast() \ + /sbin/insserv ${YAST_IS_RUNNING:+-f} %{?*} + +%run_ldconfig /sbin/ldconfig + +%install_info(:-:) \ + ALL_ARGS=(%{**}) \ + NUM_ARGS=${#ALL_ARGS[@]} \ + if test -x /sbin/install-info ; then \ + if test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \ + /sbin/install-info "${ALL_ARGS[@]}" \ + fi \ + fi ; + +%install_info_delete(:-:) \ + ALL_ARGS=(%{**}) \ + NUM_ARGS=${#ALL_ARGS[@]} \ + if test -x /sbin/install-info ; then \ + if ! test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \ + /sbin/install-info --quiet --delete "${ALL_ARGS[@]}" \ + fi ; \ + fi ; + +# find-supplements.ksyms parses this macro directly out of the spec file: +%supplements_kernel_module() \ + %{expand:%(if ! rpm -q kernel-syms > /dev/null; then echo "%fail Please add the kernel-syms package to BuildRequires"; fi)} + +%suse_version 1140 +%sles_version 0 +%ul_version 0 + +%do_profiling 1 +%cflags_profile_generate -fprofile-generate +%cflags_profile_feedback -fprofile-use + +%suse_install_update_message() \ + install -D -m 644 %1 %buildroot/var/adm/update-messages/%{name}-%{version}-%{release}-%(basename %1).txt \ +%nil + +%suse_install_update_script() \ + install -D -m 755 %1 %buildroot/var/adm/update-scripts/%{name}-%{version}-%{release}-%(basename %1).txt \ +%nil + +# Template for lang sub-package. +%lang_package(n:) \ +%package %{-n:-n %{-n*}-}lang \ +Summary: Languages for package %{name} \ +Group: System/Localization \ +Requires: %{-n:%{-n*}}%{!-n:%{name}} = %{version} \ +Provides: %{-n:%{-n*}}%{!-n:%{name}}-lang-all = %{version} \ +Supplements: packageand(bundle-lang-other:%{-n:%{-n*}}%{!-n:%{name}}) \ +BuildArch: noarch \ +%description %{-n:-n %{-n*}-}lang \ +Provides translations to the package %{name} + +# rpm5 prolog for loading the standard macro +%{load:/etc/rpm/macros.d/*.macros} diff --git a/rpm-5.4.9/macros/tcl b/rpm-5.4.9/macros/tcl new file mode 100644 index 0000000..0bedf17 --- /dev/null +++ b/rpm-5.4.9/macros/tcl @@ -0,0 +1,9 @@ +# TCL specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/tcl} + +%__tclsh /usr/bin/tclsh + +%tcl_version %(echo 'puts $tcl_version' | %{__tclsh}) +%tcl_sitelib %{_datadir}/tcl%{tcl_version} +%tcl_sitearch %{_libdir}/tcl%{tcl_version} diff --git a/rpm-5.4.9/macros/tcl.in b/rpm-5.4.9/macros/tcl.in new file mode 100644 index 0000000..da8e81b --- /dev/null +++ b/rpm-5.4.9/macros/tcl.in @@ -0,0 +1,9 @@ +# TCL specific macro definitions. +# To make use of these macros insert the following line into your spec file: +# %{load:%{_usrlibrpm}/macros.d/tcl} + +%__tclsh @__TCLSH@ + +%tcl_version %(echo 'puts $tcl_version' | %{__tclsh}) +%tcl_sitelib %{_datadir}/tcl%{tcl_version} +%tcl_sitearch %{_libdir}/tcl%{tcl_version} diff --git a/rpm-5.4.9/misc/Makefile.am b/rpm-5.4.9/misc/Makefile.am new file mode 100644 index 0000000..beac6d1 --- /dev/null +++ b/rpm-5.4.9/misc/Makefile.am @@ -0,0 +1,90 @@ +# Makefile for misc library. + +AUTOMAKE_OPTIONS = 1.4 foreign + +AM_CPPFLAGS = \ + -I$(srcdir) \ + -I$(top_srcdir) + +EXTRA_DIST = \ + librpmmisc.vers alloca.c \ + asprintf.c basename.c err.c error.c \ + fakefork.c getcwd.c getdelim.c getline.c \ + getmntent.c getwd.c memcmp.c \ + mktime.c myrealloc.c putenv.c realpath.c \ + setenv.c setproctitle.c stpcpy.c stpncpy.c \ + strcspn.c strdup.c strerror.c \ + strftime.c strcspn.c strstr.c strtol.c \ + strtoul.c \ + tempname.h \ + mkdtemp.c + +noinst_HEADERS = \ + err.h error.h tempname.h + +usrlibdir = $(libdir) +usrlib_LTLIBRARIES = librpmmisc.la + +librpmmisc_la_SOURCES = librpmmisc.c +librpmmisc_la_LDFLAGS = -release $(LT_CURRENT).$(LT_REVISION) +if HAVE_LD_VERSION_SCRIPT +librpmmisc_la_LDFLAGS += -Wl,@LD_VERSION_SCRIPT_FLAG@,@top_srcdir@/misc/librpmmisc.vers +endif +librpmmisc_la_LDFLAGS += \ + @WITH_DB_LDFLAGS@ \ + @WITH_FILE_LDFLAGS@ \ + @WITH_BEECRYPT_LDFLAGS@ \ + @WITH_FICL_LDFLAGS@ \ + @WITH_GPSEE_LDFLAGS@ \ + @WITH_LIBGIT2_LDFLAGS@ \ + @WITH_LUA_LDFLAGS@ \ + @WITH_NEON_LDFLAGS@ \ + @WITH_PCRE_LDFLAGS@ \ + @WITH_POPT_LDFLAGS@ \ + @WITH_RC_LDFLAGS@ \ + @WITH_SYCK_LDFLAGS@ \ + @WITH_XAR_LDFLAGS@ \ + @WITH_XZ_LDFLAGS@ \ + @WITH_ZLIB_LDFLAGS@ +librpmmisc_la_LIBADD = \ + @ALLOCA@ \ + @WITH_DB_LIBS@ \ + @WITH_FICL_LIBS@ \ + @WITH_FILE_LIBS@ \ + @WITH_BEECRYPT_LIBS@ \ + @WITH_GPSEE_LIBS@ \ + @WITH_LIBGIT2_LIBS@ \ + @WITH_LUA_LIBS@ \ + @WITH_NEON_LIBS@ \ + @WITH_PCRE_LIBS@ \ + @WITH_POPT_LIBS@ \ + @WITH_RC_LIBS@ \ + @WITH_SYCK_LIBS@ \ + @WITH_XAR_LIBS@ \ + @WITH_XZ_LIBS@ \ + @WITH_ZLIB_LIBS@ +if ENABLE_BUILD_EXTLIBDEP +librpmmisc_la_LDFLAGS += $(LDFLAGS) +librpmmisc_la_LIBADD += $(LIBS) +endif +librpmmisc_la_DEPENDENCIES = \ + @ALLOCA@ +librpmmisc.la: $(librpmmisc_la_OBJECTS) $(librpmmisc_la_DEPENDENCIES) + $(librpmmisc_la_LINK) -rpath $(usrlibdir) $(librpmmisc_la_OBJECTS) $(librpmmisc_la_LIBADD) + +install-data-hook: +if !ENABLE_BUILD_LAFILES + -for l in $(usrlib_LTLIBRARIES); do \ + rm -f $(DESTDIR)$(usrlibdir)/$${l}; \ + done +endif +if WITH_PATH_VERSIONED + -for l in $(usrlib_LTLIBRARIES); do \ + base=`echo "$${l}" | sed -e 's;\.la$$;;'`; \ + if [ -f $(DESTDIR)$(usrlibdir)/$${base}.a ]; then \ + mv $(DESTDIR)$(usrlibdir)/$${base}.a \ + $(DESTDIR)$(usrlibdir)/$${base}-$(VERSION).a; \ + fi; \ + done +endif + diff --git a/rpm-5.4.9/misc/Makefile.in b/rpm-5.4.9/misc/Makefile.in new file mode 100644 index 0000000..3ddcabb --- /dev/null +++ b/rpm-5.4.9/misc/Makefile.in @@ -0,0 +1,949 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ + +# Makefile for misc library. + + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +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@ +target_triplet = @target@ +@HAVE_LD_VERSION_SCRIPT_TRUE@am__append_1 = -Wl,@LD_VERSION_SCRIPT_FLAG@,@top_srcdir@/misc/librpmmisc.vers +@ENABLE_BUILD_EXTLIBDEP_TRUE@am__append_2 = $(LDFLAGS) +@ENABLE_BUILD_EXTLIBDEP_TRUE@am__append_3 = $(LIBS) +subdir = misc +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in alloca.c +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(usrlibdir)" +LTLIBRARIES = $(usrlib_LTLIBRARIES) +am__DEPENDENCIES_1 = +@ENABLE_BUILD_EXTLIBDEP_TRUE@am__DEPENDENCIES_2 = \ +@ENABLE_BUILD_EXTLIBDEP_TRUE@ $(am__DEPENDENCIES_1) +am_librpmmisc_la_OBJECTS = librpmmisc.lo +librpmmisc_la_OBJECTS = $(am_librpmmisc_la_OBJECTS) +librpmmisc_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(librpmmisc_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(librpmmisc_la_SOURCES) +DIST_SOURCES = $(librpmmisc_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDROOTDIR_MACRO = @BUILDROOTDIR_MACRO@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBAPI = @DBAPI@ +DBLIBOBJS = @DBLIBOBJS@ +DBLIBSRCS = @DBLIBSRCS@ +DBPATH = @DBPATH@ +DBPATH_MACRO = @DBPATH_MACRO@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTRO_MACROS = @DISTRO_MACROS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIXPERMS = @FIXPERMS@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GPSEE_MODULES_PATH = @GPSEE_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_STATIC = @LDFLAGS_STATIC@ +LD_VERSION_SCRIPT_FLAG = @LD_VERSION_SCRIPT_FLAG@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOLIZE = @LIBTOOLIZE@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MACROFILES = @MACROFILES@ +MAGIC_MACRO = @MAGIC_MACRO@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR = @MKDIR@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NCPUS_COMMAND = @NCPUS_COMMAND@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENMP_CFLAGS = @OPENMP_CFLAGS@ +OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_INSTALLDIRS = @PERL_INSTALLDIRS@ +PERL_URPM_INSTALLDIRS = @PERL_URPM_INSTALLDIRS@ +PKGSRCDIR = @PKGSRCDIR@ +PKGSRCDIR_MACRO = @PKGSRCDIR_MACRO@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +ROOT_GROUP = @ROOT_GROUP@ +RPMCANONARCH = @RPMCANONARCH@ +RPMCANONCOLOR = @RPMCANONCOLOR@ +RPMCANONGNU = @RPMCANONGNU@ +RPMCANONOS = @RPMCANONOS@ +RPMCANONVENDOR = @RPMCANONVENDOR@ +RPMGID = @RPMGID@ +RPMGROUP = @RPMGROUP@ +RPMLUAFILES = @RPMLUAFILES@ +RPMPOPTFILES = @RPMPOPTFILES@ +RPMUID = @RPMUID@ +RPMUSER = @RPMUSER@ +RPM_TIMESTAMP = @RPM_TIMESTAMP@ +RPM_VENDOR = @RPM_VENDOR@ +RPM_VERSION = @RPM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFIGDIR = @SYSCONFIGDIR@ +USE_NLS = @USE_NLS@ +USRLIBRPM = @USRLIBRPM@ +VERSION = @VERSION@ +WITH_ACL = @WITH_ACL@ +WITH_APIDOCS = @WITH_APIDOCS@ +WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ +WITH_APR = @WITH_APR@ +WITH_ATERM = @WITH_ATERM@ +WITH_ATTR = @WITH_ATTR@ +WITH_AUGEAS = @WITH_AUGEAS@ +WITH_AUGEAS_AUGTOOL = @WITH_AUGEAS_AUGTOOL@ +WITH_BASH = @WITH_BASH@ +WITH_BASH_CPPFLAGS = @WITH_BASH_CPPFLAGS@ +WITH_BASH_LDFLAGS = @WITH_BASH_LDFLAGS@ +WITH_BASH_LIBS = @WITH_BASH_LIBS@ +WITH_BASH_SUBDIR = @WITH_BASH_SUBDIR@ +WITH_BEECRYPT = @WITH_BEECRYPT@ +WITH_BEECRYPT_CPPFLAGS = @WITH_BEECRYPT_CPPFLAGS@ +WITH_BEECRYPT_LDFLAGS = @WITH_BEECRYPT_LDFLAGS@ +WITH_BEECRYPT_LIBS = @WITH_BEECRYPT_LIBS@ +WITH_BEECRYPT_SUBDIR = @WITH_BEECRYPT_SUBDIR@ +WITH_BZIP2 = @WITH_BZIP2@ +WITH_CPUINFO = @WITH_CPUINFO@ +WITH_CUDF = @WITH_CUDF@ +WITH_CUDF_CUDFTOOL = @WITH_CUDF_CUDFTOOL@ +WITH_DB = @WITH_DB@ +WITH_DBSQL = @WITH_DBSQL@ +WITH_DBSQL_CPPFLAGS = @WITH_DBSQL_CPPFLAGS@ +WITH_DBSQL_LDFLAGS = @WITH_DBSQL_LDFLAGS@ +WITH_DBSQL_LIBS = @WITH_DBSQL_LIBS@ +WITH_DBSQL_SUBDIR = @WITH_DBSQL_SUBDIR@ +WITH_DB_CPPFLAGS = @WITH_DB_CPPFLAGS@ +WITH_DB_LDFLAGS = @WITH_DB_LDFLAGS@ +WITH_DB_LIBS = @WITH_DB_LIBS@ +WITH_DB_SUBDIR = @WITH_DB_SUBDIR@ +WITH_DMALLOC = @WITH_DMALLOC@ +WITH_EFENCE = @WITH_EFENCE@ +WITH_EXPAT = @WITH_EXPAT@ +WITH_FICL = @WITH_FICL@ +WITH_FICL_CPPFLAGS = @WITH_FICL_CPPFLAGS@ +WITH_FICL_LDFLAGS = @WITH_FICL_LDFLAGS@ +WITH_FICL_LIBS = @WITH_FICL_LIBS@ +WITH_FICL_SUBDIR = @WITH_FICL_SUBDIR@ +WITH_FILE = @WITH_FILE@ +WITH_FILE_CPPFLAGS = @WITH_FILE_CPPFLAGS@ +WITH_FILE_LDFLAGS = @WITH_FILE_LDFLAGS@ +WITH_FILE_LIBS = @WITH_FILE_LIBS@ +WITH_FILE_SUBDIR = @WITH_FILE_SUBDIR@ +WITH_GCRYPT = @WITH_GCRYPT@ +WITH_GNUTLS = @WITH_GNUTLS@ +WITH_GPSEE = @WITH_GPSEE@ +WITH_GPSEE_CPPFLAGS = @WITH_GPSEE_CPPFLAGS@ +WITH_GPSEE_LDFLAGS = @WITH_GPSEE_LDFLAGS@ +WITH_GPSEE_LIBS = @WITH_GPSEE_LIBS@ +WITH_GPSEE_SUBDIR = @WITH_GPSEE_SUBDIR@ +WITH_JS_SUBDIR = @WITH_JS_SUBDIR@ +WITH_KEYUTILS = @WITH_KEYUTILS@ +WITH_KEYUTILS_RPMKEY = @WITH_KEYUTILS_RPMKEY@ +WITH_LIBELF_DEBUGEDIT = @WITH_LIBELF_DEBUGEDIT@ +WITH_LIBGIT2 = @WITH_LIBGIT2@ +WITH_LIBGIT2_CPPFLAGS = @WITH_LIBGIT2_CPPFLAGS@ +WITH_LIBGIT2_LDFLAGS = @WITH_LIBGIT2_LDFLAGS@ +WITH_LIBGIT2_LIBS = @WITH_LIBGIT2_LIBS@ +WITH_LIBGIT2_SUBDIR = @WITH_LIBGIT2_SUBDIR@ +WITH_LIBTASN1 = @WITH_LIBTASN1@ +WITH_LUA = @WITH_LUA@ +WITH_LUA_CPPFLAGS = @WITH_LUA_CPPFLAGS@ +WITH_LUA_LDFLAGS = @WITH_LUA_LDFLAGS@ +WITH_LUA_LIBS = @WITH_LUA_LIBS@ +WITH_LUA_SUBDIR = @WITH_LUA_SUBDIR@ +WITH_LUA_SUBDIR_DEF = @WITH_LUA_SUBDIR_DEF@ +WITH_LUA_SUBDIR_LIB = @WITH_LUA_SUBDIR_LIB@ +WITH_MOZJS185 = @WITH_MOZJS185@ +WITH_MOZJS185_CPPFLAGS = @WITH_MOZJS185_CPPFLAGS@ +WITH_MOZJS185_LDFLAGS = @WITH_MOZJS185_LDFLAGS@ +WITH_MOZJS185_LIBS = @WITH_MOZJS185_LIBS@ +WITH_MOZJS185_SUBDIR = @WITH_MOZJS185_SUBDIR@ +WITH_NEON = @WITH_NEON@ +WITH_NEON_CPPFLAGS = @WITH_NEON_CPPFLAGS@ +WITH_NEON_LDFLAGS = @WITH_NEON_LDFLAGS@ +WITH_NEON_LIBS = @WITH_NEON_LIBS@ +WITH_NEON_SUBDIR = @WITH_NEON_SUBDIR@ +WITH_NIX = @WITH_NIX@ +WITH_NSS = @WITH_NSS@ +WITH_OPENSSL = @WITH_OPENSSL@ +WITH_PAKCHOIS = @WITH_PAKCHOIS@ +WITH_PATH_VERSIONED = @WITH_PATH_VERSIONED@ +WITH_PATH_VERSIONED_SUFFIX = @WITH_PATH_VERSIONED_SUFFIX@ +WITH_PCRE = @WITH_PCRE@ +WITH_PCRE_CPPFLAGS = @WITH_PCRE_CPPFLAGS@ +WITH_PCRE_LDFLAGS = @WITH_PCRE_LDFLAGS@ +WITH_PCRE_LIBS = @WITH_PCRE_LIBS@ +WITH_PCRE_SUBDIR = @WITH_PCRE_SUBDIR@ +WITH_PERLEMBED = @WITH_PERLEMBED@ +WITH_PERL_LIBS = @WITH_PERL_LIBS@ +WITH_PERL_SUBDIR = @WITH_PERL_SUBDIR@ +WITH_PERL_SUBPACKAGE = @WITH_PERL_SUBPACKAGE@ +WITH_PERL_URPM_LIBS = @WITH_PERL_URPM_LIBS@ +WITH_PERL_URPM_SUBDIR = @WITH_PERL_URPM_SUBDIR@ +WITH_PERL_URPM_SUBPACKAGE = @WITH_PERL_URPM_SUBPACKAGE@ +WITH_POPT = @WITH_POPT@ +WITH_POPT_CPPFLAGS = @WITH_POPT_CPPFLAGS@ +WITH_POPT_LDFLAGS = @WITH_POPT_LDFLAGS@ +WITH_POPT_LIBS = @WITH_POPT_LIBS@ +WITH_POPT_SUBDIR = @WITH_POPT_SUBDIR@ +WITH_PYTHONEMBED = @WITH_PYTHONEMBED@ +WITH_PYTHON_INCDIR = @WITH_PYTHON_INCDIR@ +WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ +WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ +WITH_RC = @WITH_RC@ +WITH_RC_CPPFLAGS = @WITH_RC_CPPFLAGS@ +WITH_RC_LDFLAGS = @WITH_RC_LDFLAGS@ +WITH_RC_LIBS = @WITH_RC_LIBS@ +WITH_RC_SUBDIR = @WITH_RC_SUBDIR@ +WITH_READLINE = @WITH_READLINE@ +WITH_RUBY = @WITH_RUBY@ +WITH_RUBY_CPPFLAGS = @WITH_RUBY_CPPFLAGS@ +WITH_RUBY_SUBDIR = @WITH_RUBY_SUBDIR@ +WITH_RUBY_VENDORARCHDIR = @WITH_RUBY_VENDORARCHDIR@ +WITH_SELINUX = @WITH_SELINUX@ +WITH_SEMANAGE = @WITH_SEMANAGE@ +WITH_SEMANAGE_SEMODULE = @WITH_SEMANAGE_SEMODULE@ +WITH_SEPOL = @WITH_SEPOL@ +WITH_SPIDERMONKEY_SUBDIR = @WITH_SPIDERMONKEY_SUBDIR@ +WITH_SQLITE = @WITH_SQLITE@ +WITH_SQLITE_CPPFLAGS = @WITH_SQLITE_CPPFLAGS@ +WITH_SQLITE_LDFLAGS = @WITH_SQLITE_LDFLAGS@ +WITH_SQLITE_LIBS = @WITH_SQLITE_LIBS@ +WITH_SQLITE_SUBDIR = @WITH_SQLITE_SUBDIR@ +WITH_SQUIRREL = @WITH_SQUIRREL@ +WITH_SUBVERSION = @WITH_SUBVERSION@ +WITH_SYCK = @WITH_SYCK@ +WITH_SYCK_CPPFLAGS = @WITH_SYCK_CPPFLAGS@ +WITH_SYCK_LDFLAGS = @WITH_SYCK_LDFLAGS@ +WITH_SYCK_LIBS = @WITH_SYCK_LIBS@ +WITH_SYCK_SUBDIR = @WITH_SYCK_SUBDIR@ +WITH_TCL = @WITH_TCL@ +WITH_TCL_SUBDIR = @WITH_TCL_SUBDIR@ +WITH_TOMCRYPT = @WITH_TOMCRYPT@ +WITH_TPM = @WITH_TPM@ +WITH_UNIXODBC = @WITH_UNIXODBC@ +WITH_UUID = @WITH_UUID@ +WITH_XAR = @WITH_XAR@ +WITH_XAR_CPPFLAGS = @WITH_XAR_CPPFLAGS@ +WITH_XAR_LDFLAGS = @WITH_XAR_LDFLAGS@ +WITH_XAR_LIBS = @WITH_XAR_LIBS@ +WITH_XAR_SUBDIR = @WITH_XAR_SUBDIR@ +WITH_XZ = @WITH_XZ@ +WITH_XZ_CPPFLAGS = @WITH_XZ_CPPFLAGS@ +WITH_XZ_LDFLAGS = @WITH_XZ_LDFLAGS@ +WITH_XZ_LIBS = @WITH_XZ_LIBS@ +WITH_XZ_SUBDIR = @WITH_XZ_SUBDIR@ +WITH_ZLIB = @WITH_ZLIB@ +WITH_ZLIB_CPPFLAGS = @WITH_ZLIB_CPPFLAGS@ +WITH_ZLIB_LDFLAGS = @WITH_ZLIB_LDFLAGS@ +WITH_ZLIB_LIBS = @WITH_ZLIB_LIBS@ +WITH_ZLIB_SUBDIR = @WITH_ZLIB_SUBDIR@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__BASH = @__BASH@ +__BZIP2 = @__BZIP2@ +__CAT = @__CAT@ +__CHATTR = @__CHATTR@ +__CHGRP = @__CHGRP@ +__CHGRP_RHF = @__CHGRP_RHF@ +__CHMOD = @__CHMOD@ +__CHOWN = @__CHOWN@ +__CHOWN_RHF = @__CHOWN_RHF@ +__CMAKE = @__CMAKE@ +__CPIO = @__CPIO@ +__CURL = @__CURL@ +__CVS = @__CVS@ +__DBSQL = @__DBSQL@ +__DB_ARCHIVE = @__DB_ARCHIVE@ +__DB_CHECKPOINT = @__DB_CHECKPOINT@ +__DB_DEADLOCK = @__DB_DEADLOCK@ +__DB_DUMP = @__DB_DUMP@ +__DB_HOTBACKUP = @__DB_HOTBACKUP@ +__DB_LOAD = @__DB_LOAD@ +__DB_LOG_VERIFY = @__DB_LOG_VERIFY@ +__DB_PRINTLOG = @__DB_PRINTLOG@ +__DB_RECOVER = @__DB_RECOVER@ +__DB_REPLICATE = @__DB_REPLICATE@ +__DB_SQL_CODEGEN = @__DB_SQL_CODEGEN@ +__DB_STAT = @__DB_STAT@ +__DB_TUNER = @__DB_TUNER@ +__DB_UPGRADE = @__DB_UPGRADE@ +__DB_VERIFY = @__DB_VERIFY@ +__DIFF = @__DIFF@ +__DITTO = @__DITTO@ +__DOXYGEN = @__DOXYGEN@ +__FILE = @__FILE@ +__GIT = @__GIT@ +__GPG = @__GPG@ +__GSR = @__GSR@ +__GST_INSPECT = @__GST_INSPECT@ +__GZIP = @__GZIP@ +__HG = @__HG@ +__ID = @__ID@ +__ID_U = @__ID_U@ +__INSTALL = @__INSTALL@ +__INSTALL_INFO = @__INSTALL_INFO@ +__LD = @__LD@ +__LDCONFIG = @__LDCONFIG@ +__LN = @__LN@ +__LRZIP = @__LRZIP@ +__LSATTR = @__LSATTR@ +__LZIP = @__LZIP@ +__LZMA = @__LZMA@ +__LZOP = @__LZOP@ +__MAKE = @__MAKE@ +__MKDIR = @__MKDIR@ +__MKDIR_P = @__MKDIR_P@ +__MODINFO = @__MODINFO@ +__MONGO = @__MONGO@ +__MV = @__MV@ +__NM = @__NM@ +__OBJCOPY = @__OBJCOPY@ +__OBJDUMP = @__OBJDUMP@ +__PATCH = @__PATCH@ +__PAX = @__PAX@ +__PERL = @__PERL@ +__PGP = @__PGP@ +__PHP = @__PHP@ +__PYTHON = @__PYTHON@ +__RM = @__RM@ +__RMDIR = @__RMDIR@ +__RSH = @__RSH@ +__RUBY = @__RUBY@ +__SED = @__SED@ +__SH = @__SH@ +__SQLITE3 = @__SQLITE3@ +__SSH = @__SSH@ +__STRIP = @__STRIP@ +__SVN = @__SVN@ +__TAR = @__TAR@ +__TCLSH = @__TCLSH@ +__UNZIP = @__UNZIP@ +__XZ = @__XZ@ +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_CXX = @ac_ct_CXX@ +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@ +autorelocate_dcolor = @autorelocate_dcolor@ +autorelocate_path = @autorelocate_path@ +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@ +exeext = @exeext@ +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@ +libext = @libext@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +objext = @objext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +shlibext = @shlibext@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +testdir = @testdir@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrprefix = @usrprefix@ +varprefix = @varprefix@ +AUTOMAKE_OPTIONS = 1.4 foreign +AM_CPPFLAGS = \ + -I$(srcdir) \ + -I$(top_srcdir) + +EXTRA_DIST = \ + librpmmisc.vers alloca.c \ + asprintf.c basename.c err.c error.c \ + fakefork.c getcwd.c getdelim.c getline.c \ + getmntent.c getwd.c memcmp.c \ + mktime.c myrealloc.c putenv.c realpath.c \ + setenv.c setproctitle.c stpcpy.c stpncpy.c \ + strcspn.c strdup.c strerror.c \ + strftime.c strcspn.c strstr.c strtol.c \ + strtoul.c \ + tempname.h \ + mkdtemp.c + +noinst_HEADERS = \ + err.h error.h tempname.h + +usrlibdir = $(libdir) +usrlib_LTLIBRARIES = librpmmisc.la +librpmmisc_la_SOURCES = librpmmisc.c +librpmmisc_la_LDFLAGS = -release $(LT_CURRENT).$(LT_REVISION) \ + $(am__append_1) @WITH_DB_LDFLAGS@ @WITH_FILE_LDFLAGS@ \ + @WITH_BEECRYPT_LDFLAGS@ @WITH_FICL_LDFLAGS@ \ + @WITH_GPSEE_LDFLAGS@ @WITH_LIBGIT2_LDFLAGS@ @WITH_LUA_LDFLAGS@ \ + @WITH_NEON_LDFLAGS@ @WITH_PCRE_LDFLAGS@ @WITH_POPT_LDFLAGS@ \ + @WITH_RC_LDFLAGS@ @WITH_SYCK_LDFLAGS@ @WITH_XAR_LDFLAGS@ \ + @WITH_XZ_LDFLAGS@ @WITH_ZLIB_LDFLAGS@ $(am__append_2) +librpmmisc_la_LIBADD = @ALLOCA@ @WITH_DB_LIBS@ @WITH_FICL_LIBS@ \ + @WITH_FILE_LIBS@ @WITH_BEECRYPT_LIBS@ @WITH_GPSEE_LIBS@ \ + @WITH_LIBGIT2_LIBS@ @WITH_LUA_LIBS@ @WITH_NEON_LIBS@ \ + @WITH_PCRE_LIBS@ @WITH_POPT_LIBS@ @WITH_RC_LIBS@ \ + @WITH_SYCK_LIBS@ @WITH_XAR_LIBS@ @WITH_XZ_LIBS@ \ + @WITH_ZLIB_LIBS@ $(am__append_3) +librpmmisc_la_DEPENDENCIES = \ + @ALLOCA@ + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 misc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign misc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-usrlibLTLIBRARIES: $(usrlib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(usrlib_LTLIBRARIES)'; test -n "$(usrlibdir)" || 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)$(usrlibdir)'"; \ + $(MKDIR_P) '$(DESTDIR)$(usrlibdir)' || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(usrlibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(usrlibdir)"; \ + } + +uninstall-usrlibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(usrlib_LTLIBRARIES)'; test -n "$(usrlibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(usrlibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(usrlibdir)/$$f"; \ + done + +clean-usrlibLTLIBRARIES: + -test -z "$(usrlib_LTLIBRARIES)" || rm -f $(usrlib_LTLIBRARIES) + @list='$(usrlib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/alloca.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librpmmisc.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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 +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(usrlibdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-usrlibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf $(DEPDIR) ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-usrlibLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf $(DEPDIR) ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-usrlibLTLIBRARIES + +.MAKE: install-am install-data-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-usrlibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-data-hook 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 \ + install-usrlibLTLIBRARIES installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-usrlibLTLIBRARIES + +librpmmisc.la: $(librpmmisc_la_OBJECTS) $(librpmmisc_la_DEPENDENCIES) + $(librpmmisc_la_LINK) -rpath $(usrlibdir) $(librpmmisc_la_OBJECTS) $(librpmmisc_la_LIBADD) + +install-data-hook: +@ENABLE_BUILD_LAFILES_FALSE@ -for l in $(usrlib_LTLIBRARIES); do \ +@ENABLE_BUILD_LAFILES_FALSE@ rm -f $(DESTDIR)$(usrlibdir)/$${l}; \ +@ENABLE_BUILD_LAFILES_FALSE@ done +@WITH_PATH_VERSIONED_TRUE@ -for l in $(usrlib_LTLIBRARIES); do \ +@WITH_PATH_VERSIONED_TRUE@ base=`echo "$${l}" | sed -e 's;\.la$$;;'`; \ +@WITH_PATH_VERSIONED_TRUE@ if [ -f $(DESTDIR)$(usrlibdir)/$${base}.a ]; then \ +@WITH_PATH_VERSIONED_TRUE@ mv $(DESTDIR)$(usrlibdir)/$${base}.a \ +@WITH_PATH_VERSIONED_TRUE@ $(DESTDIR)$(usrlibdir)/$${base}-$(VERSION).a; \ +@WITH_PATH_VERSIONED_TRUE@ fi; \ +@WITH_PATH_VERSIONED_TRUE@ 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/rpm-5.4.9/misc/alloca.c b/rpm-5.4.9/misc/alloca.c new file mode 100644 index 0000000..c1699c4 --- /dev/null +++ b/rpm-5.4.9/misc/alloca.c @@ -0,0 +1,504 @@ +/* alloca.c -- allocate automatically reclaimed memory + (Mostly) portable public-domain implementation -- D A Gwyn + + This implementation of the PWB library alloca function, + which is used to allocate space off the run-time stack so + that it is automatically reclaimed upon procedure exit, + was inspired by discussions with J. Q. Johnson of Cornell. + J.Otto Tennant contributed the Cray support. + + There are some preprocessor constants that can + be defined when compiling for your specific system, for + improved efficiency; however, the defaults should be okay. + + The general concept of this implementation is to keep + track of all alloca-allocated blocks, and reclaim any + that are found to be deeper in the stack than the current + invocation. This heuristic does not reclaim storage as + soon as it becomes invalid, but it will do so eventually. + + As a special case, alloca(0) reclaims storage without + allocating any. It is a good idea to use alloca(0) in + your main control loop, etc. to force garbage collection. */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +#ifdef emacs +#include "blockinput.h" +#endif + +/* If compiling with GCC 2, this file's not needed. */ +#if !defined (__GNUC__) || __GNUC__ < 2 + +/* If someone has defined alloca as a macro, + there must be some other way alloca is supposed to work. */ +#ifndef alloca + +#ifdef emacs +#ifdef static +/* actually, only want this if static is defined as "" + -- this is for usg, in which emacs must undefine static + in order to make unexec workable + */ +#ifndef STACK_DIRECTION +you +lose +-- must know STACK_DIRECTION at compile-time +#endif /* STACK_DIRECTION undefined */ +#endif /* static */ +#endif /* emacs */ + +/* If your stack is a linked list of frames, you have to + provide an "address metric" ADDRESS_FUNCTION macro. */ + +#if defined (CRAY) && defined (CRAY_STACKSEG_END) +long i00afunc (); +#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) +#else +#define ADDRESS_FUNCTION(arg) &(arg) +#endif + +#if __STDC__ +typedef void *pointer; +#else +typedef char *pointer; +#endif + +#ifndef NULL +#define NULL 0 +#endif + +/* Different portions of Emacs need to call different versions of + malloc. The Emacs executable needs alloca to call xmalloc, because + ordinary malloc isn't protected from input signals. On the other + hand, the utilities in lib-src need alloca to call malloc; some of + them are very simple, and don't have an xmalloc routine. + + Non-Emacs programs expect this to call xmalloc. + + Callers below should use malloc. */ + +#ifndef emacs +#define malloc xmalloc +#endif +extern pointer malloc (); + +/* Define STACK_DIRECTION if you know the direction of stack + growth for your system; otherwise it will be automatically + deduced at run-time. + + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ + +#ifndef STACK_DIRECTION +#define STACK_DIRECTION 0 /* Direction unknown. */ +#endif + +#if STACK_DIRECTION != 0 + +#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */ + +#else /* STACK_DIRECTION == 0; need run-time code. */ + +static int stack_dir; /* 1 or -1 once known. */ +#define STACK_DIR stack_dir + +static void +find_stack_direction () +{ + static char *addr = NULL; /* Address of first `dummy', once known. */ + auto char dummy; /* To get stack address. */ + + if (addr == NULL) + { /* Initial entry. */ + addr = ADDRESS_FUNCTION (dummy); + + find_stack_direction (); /* Recurse once. */ + } + else + { + /* Second entry. */ + if (ADDRESS_FUNCTION (dummy) > addr) + stack_dir = 1; /* Stack grew upward. */ + else + stack_dir = -1; /* Stack grew downward. */ + } +} + +#endif /* STACK_DIRECTION == 0 */ + +/* An "alloca header" is used to: + (a) chain together all alloca'ed blocks; + (b) keep track of stack depth. + + It is very important that sizeof(header) agree with malloc + alignment chunk size. The following default should work okay. */ + +#ifndef ALIGN_SIZE +#define ALIGN_SIZE sizeof(double) +#endif + +typedef union hdr +{ + char align[ALIGN_SIZE]; /* To force sizeof(header). */ + struct + { + union hdr *next; /* For chaining headers. */ + char *deep; /* For stack depth measure. */ + } h; +} header; + +static header *last_alloca_header = NULL; /* -> last alloca header. */ + +/* Return a pointer to at least SIZE bytes of storage, + which will be automatically reclaimed upon exit from + the procedure that called alloca. Originally, this space + was supposed to be taken from the current stack frame of the + caller, but that method cannot be made to work for some + implementations of C, for example under Gould's UTX/32. */ + +pointer +alloca (size) + unsigned size; +{ + auto char probe; /* Probes stack depth: */ + register char *depth = ADDRESS_FUNCTION (probe); + +#if STACK_DIRECTION == 0 + if (STACK_DIR == 0) /* Unknown growth direction. */ + find_stack_direction (); +#endif + + /* Reclaim garbage, defined as all alloca'd storage that + was allocated from deeper in the stack than currently. */ + + { + register header *hp; /* Traverses linked list. */ + +#ifdef emacs + BLOCK_INPUT; +#endif + + for (hp = last_alloca_header; hp != NULL;) + if ((STACK_DIR > 0 && hp->h.deep > depth) + || (STACK_DIR < 0 && hp->h.deep < depth)) + { + register header *np = hp->h.next; + + free ((pointer) hp); /* Collect garbage. */ + + hp = np; /* -> next header. */ + } + else + break; /* Rest are not deeper. */ + + last_alloca_header = hp; /* -> last valid storage. */ + +#ifdef emacs + UNBLOCK_INPUT; +#endif + } + + if (size == 0) + return NULL; /* No allocation required. */ + + /* Allocate combined header + user data storage. */ + + { + register pointer new = malloc (sizeof (header) + size); + /* Address of header. */ + + if (new == 0) + abort(); + + ((header *) new)->h.next = last_alloca_header; + ((header *) new)->h.deep = depth; + + last_alloca_header = (header *) new; + + /* User storage begins just after header. */ + + return (pointer) ((char *) new + sizeof (header)); + } +} + +#if defined (CRAY) && defined (CRAY_STACKSEG_END) + +#ifdef DEBUG_I00AFUNC +#include +#endif + +#ifndef CRAY_STACK +#define CRAY_STACK +#ifndef CRAY2 +/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ +struct stack_control_header + { + long shgrow:32; /* Number of times stack has grown. */ + long shaseg:32; /* Size of increments to stack. */ + long shhwm:32; /* High water mark of stack. */ + long shsize:32; /* Current size of stack (all segments). */ + }; + +/* The stack segment linkage control information occurs at + the high-address end of a stack segment. (The stack + grows from low addresses to high addresses.) The initial + part of the stack segment linkage control information is + 0200 (octal) words. This provides for register storage + for the routine which overflows the stack. */ + +struct stack_segment_linkage + { + long ss[0200]; /* 0200 overflow words. */ + long sssize:32; /* Number of words in this segment. */ + long ssbase:32; /* Offset to stack base. */ + long:32; + long sspseg:32; /* Offset to linkage control of previous + segment of stack. */ + long:32; + long sstcpt:32; /* Pointer to task common address block. */ + long sscsnm; /* Private control structure number for + microtasking. */ + long ssusr1; /* Reserved for user. */ + long ssusr2; /* Reserved for user. */ + long sstpid; /* Process ID for pid based multi-tasking. */ + long ssgvup; /* Pointer to multitasking thread giveup. */ + long sscray[7]; /* Reserved for Cray Research. */ + long ssa0; + long ssa1; + long ssa2; + long ssa3; + long ssa4; + long ssa5; + long ssa6; + long ssa7; + long sss0; + long sss1; + long sss2; + long sss3; + long sss4; + long sss5; + long sss6; + long sss7; + }; + +#else /* CRAY2 */ +/* The following structure defines the vector of words + returned by the STKSTAT library routine. */ +struct stk_stat + { + long now; /* Current total stack size. */ + long maxc; /* Amount of contiguous space which would + be required to satisfy the maximum + stack demand to date. */ + long high_water; /* Stack high-water mark. */ + long overflows; /* Number of stack overflow ($STKOFEN) calls. */ + long hits; /* Number of internal buffer hits. */ + long extends; /* Number of block extensions. */ + long stko_mallocs; /* Block allocations by $STKOFEN. */ + long underflows; /* Number of stack underflow calls ($STKRETN). */ + long stko_free; /* Number of deallocations by $STKRETN. */ + long stkm_free; /* Number of deallocations by $STKMRET. */ + long segments; /* Current number of stack segments. */ + long maxs; /* Maximum number of stack segments so far. */ + long pad_size; /* Stack pad size. */ + long current_address; /* Current stack segment address. */ + long current_size; /* Current stack segment size. This + number is actually corrupted by STKSTAT to + include the fifteen word trailer area. */ + long initial_address; /* Address of initial segment. */ + long initial_size; /* Size of initial segment. */ + }; + +/* The following structure describes the data structure which trails + any stack segment. I think that the description in 'asdef' is + out of date. I only describe the parts that I am sure about. */ + +struct stk_trailer + { + long this_address; /* Address of this block. */ + long this_size; /* Size of this block (does not include + this trailer). */ + long unknown2; + long unknown3; + long link; /* Address of trailer block of previous + segment. */ + long unknown5; + long unknown6; + long unknown7; + long unknown8; + long unknown9; + long unknown10; + long unknown11; + long unknown12; + long unknown13; + long unknown14; + }; + +#endif /* CRAY2 */ +#endif /* not CRAY_STACK */ + +#ifdef CRAY2 +/* Determine a "stack measure" for an arbitrary ADDRESS. + I doubt that "lint" will like this much. */ + +static long +i00afunc (long *address) +{ + struct stk_stat status; + struct stk_trailer *trailer; + long *block, size; + long result = 0; + + /* We want to iterate through all of the segments. The first + step is to get the stack status structure. We could do this + more quickly and more directly, perhaps, by referencing the + $LM00 common block, but I know that this works. */ + + STKSTAT (&status); + + /* Set up the iteration. */ + + trailer = (struct stk_trailer *) (status.current_address + + status.current_size + - 15); + + /* There must be at least one stack segment. Therefore it is + a fatal error if "trailer" is null. */ + + if (trailer == 0) + abort (); + + /* Discard segments that do not contain our argument address. */ + + while (trailer != 0) + { + block = (long *) trailer->this_address; + size = trailer->this_size; + if (block == 0 || size == 0) + abort (); + trailer = (struct stk_trailer *) trailer->link; + if ((block <= address) && (address < (block + size))) + break; + } + + /* Set the result to the offset in this segment and add the sizes + of all predecessor segments. */ + + result = address - block; + + if (trailer == 0) + { + return result; + } + + do + { + if (trailer->this_size <= 0) + abort (); + result += trailer->this_size; + trailer = (struct stk_trailer *) trailer->link; + } + while (trailer != 0); + + /* We are done. Note that if you present a bogus address (one + not in any segment), you will get a different number back, formed + from subtracting the address of the first block. This is probably + not what you want. */ + + return (result); +} + +#else /* not CRAY2 */ +/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. + Determine the number of the cell within the stack, + given the address of the cell. The purpose of this + routine is to linearize, in some sense, stack addresses + for alloca. */ + +static long +i00afunc (long address) +{ + long stkl = 0; + + long size, pseg, this_segment, stack; + long result = 0; + + struct stack_segment_linkage *ssptr; + + /* Register B67 contains the address of the end of the + current stack segment. If you (as a subprogram) store + your registers on the stack and find that you are past + the contents of B67, you have overflowed the segment. + + B67 also points to the stack segment linkage control + area, which is what we are really interested in. */ + + stkl = CRAY_STACKSEG_END (); + ssptr = (struct stack_segment_linkage *) stkl; + + /* If one subtracts 'size' from the end of the segment, + one has the address of the first word of the segment. + + If this is not the first segment, 'pseg' will be + nonzero. */ + + pseg = ssptr->sspseg; + size = ssptr->sssize; + + this_segment = stkl - size; + + /* It is possible that calling this routine itself caused + a stack overflow. Discard stack segments which do not + contain the target address. */ + + while (!(this_segment <= address && address <= stkl)) + { +#ifdef DEBUG_I00AFUNC + fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); +#endif + if (pseg == 0) + break; + stkl = stkl - pseg; + ssptr = (struct stack_segment_linkage *) stkl; + size = ssptr->sssize; + pseg = ssptr->sspseg; + this_segment = stkl - size; + } + + result = address - this_segment; + + /* If you subtract pseg from the current end of the stack, + you get the address of the previous stack segment's end. + This seems a little convoluted to me, but I'll bet you save + a cycle somewhere. */ + + while (pseg != 0) + { +#ifdef DEBUG_I00AFUNC + fprintf (stderr, "%011o %011o\n", pseg, size); +#endif + stkl = stkl - pseg; + ssptr = (struct stack_segment_linkage *) stkl; + size = ssptr->sssize; + pseg = ssptr->sspseg; + result += size; + } + return (result); +} + +#endif /* not CRAY2 */ +#endif /* CRAY */ + +#endif /* no alloca */ +#endif /* not GCC version 2 */ diff --git a/rpm-5.4.9/misc/asprintf.c b/rpm-5.4.9/misc/asprintf.c new file mode 100644 index 0000000..58e01f6 --- /dev/null +++ b/rpm-5.4.9/misc/asprintf.c @@ -0,0 +1,91 @@ +/*============================================================================== + * + * Copyright (C) 2005 Jason Evans . All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice(s), + * this list of conditions and the following disclaimer unmodified other than + * the allowable addition of one or more copyright notices. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice(s), this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) `AS IS' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *============================================================================== + * + * Emulate vasprintf() and asprintf(). + * + *============================================================================== + */ + +#include +#include +#include + +int vasprintf(char ** rResult, const char * aFormat, va_list aAp) +{ + int rVal; + char * result; + va_list ap; +#define XarAsprintfStartLen 16 + + result = (char *) malloc(XarAsprintfStartLen); + if (result == NULL) + { + rVal = -1; + goto RETURN; + } + + va_copy(ap, aAp); + rVal = vsnprintf(result, XarAsprintfStartLen, aFormat, ap); + va_end(ap); + + if (rVal == -1) + { + goto RETURN; + } + else if (rVal >= XarAsprintfStartLen) + { + free(result); + result = (char *) malloc(rVal + 1); + if (result == NULL) + { + rVal = -1; + goto RETURN; + } + + va_copy(ap, aAp); + rVal = vsnprintf(result, rVal + 1, aFormat, aAp); + va_end(ap); + } + + *rResult = result; + RETURN: +#undef XarAsprintfStartLen + return rVal; +} + +int asprintf(char ** rResult, const char * aFormat, ...) +{ + int rVal; + va_list ap; + + va_start(ap, aFormat); + rVal = vasprintf(rResult, aFormat, ap); + va_end(ap); + + return rVal; +} diff --git a/rpm-5.4.9/misc/basename.c b/rpm-5.4.9/misc/basename.c new file mode 100644 index 0000000..7fea76e --- /dev/null +++ b/rpm-5.4.9/misc/basename.c @@ -0,0 +1,13 @@ +#ifdef HAVE_CONFIG_H +# include +#endif +#ifdef HAVE_STRING_H +#include +#endif + +char * +basename(const char *file) +{ + char *fn = strrchr(file, '/'); + return fn ? fn+1 : (char *)file; +} diff --git a/rpm-5.4.9/misc/err.c b/rpm-5.4.9/misc/err.c new file mode 100644 index 0000000..fa23594 --- /dev/null +++ b/rpm-5.4.9/misc/err.c @@ -0,0 +1,112 @@ +/* err.c --- 4.4BSD utility functions for error messages. + Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C 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. + + The GNU C 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 the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include "system.h" + +#ifdef HAVE_LIBIO_H +#define flockfile(s) _IO_flockfile (s) +#define funlockfile(s) _IO_funlockfile (s) +#else +#define flockfile(s) +#define funlockfile(s) +#define putc_unlocked(c,fp) putc(c,fp); +#define fputs_unlocked(s,fp) fputs(s,fp); +#define __set_errno(error) errno = error +#define __ptr_t void * +#endif + +#include +#include + +#define VA(call) \ +{ \ + va_list ap; \ + va_start (ap, format); \ + call; \ + va_end (ap); \ +} + +void +vwarnx (const char *format, __gnuc_va_list ap) +{ + flockfile (stderr); + if (__progname) + fprintf (stderr, "%s: ", __progname); + if (format) + vfprintf (stderr, format, ap); + putc_unlocked ('\n', stderr); + funlockfile (stderr); +} + +void +vwarn (const char *format, __gnuc_va_list ap) +{ + int error = errno; + + flockfile (stderr); + if (__progname) + fprintf (stderr, "%s: ", __progname); + if (format) + { + vfprintf (stderr, format, ap); + fputs_unlocked (": ", stderr); + } + __set_errno (error); + fprintf (stderr, "%m\n"); + funlockfile (stderr); +} + + +void +warn (const char *format, ...) +{ + VA (vwarn (format, ap)) +} + +void +warnx (const char *format, ...) +{ + VA (vwarnx (format, ap)) +} + +void +verr (int status, const char *format, __gnuc_va_list ap) +{ + vwarn (format, ap); + exit (status); +} + +void +verrx (int status, const char *format, __gnuc_va_list ap) +{ + vwarnx (format, ap); + exit (status); +} + +void +err (int status, const char *format, ...) +{ + VA (verr (status, format, ap)) +} + +void +errx (int status, const char *format, ...) +{ + VA (verrx (status, format, ap)) +} diff --git a/rpm-5.4.9/misc/err.h b/rpm-5.4.9/misc/err.h new file mode 100644 index 0000000..6de02f5 --- /dev/null +++ b/rpm-5.4.9/misc/err.h @@ -0,0 +1,83 @@ +/* 4.4BSD utility functions for error messages. + Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C 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. + + The GNU C 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 the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _ERR_H +#define _ERR_H 1 + +#define __need___va_list +#include +#ifndef __ptr_t +#define __ptr_t void * +#endif +#ifndef __GNUC_VA_LIST +# define __gnuc_va_list __ptr_t +#endif + +#ifndef __attribute__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ +# define __attribute__(Spec) /* empty */ +# endif +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +# define __format__ format +# define __printf__ printf +# endif +#endif + +#if defined(__cplusplus) || (defined(__STDC__) && __STDC__) +# if !defined(__GLIBC__) || !defined(__P) +# undef __P +# define __P(protos) protos +# endif +#else +# undef __P +# define __P(protos) () +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Print "program: ", FORMAT, ": ", the standard error string for errno, + and a newline, on stderr. */ +extern void warn __P ((__const char *__format, ...)) + __attribute__ ((__format__ (__printf__, 1, 2))); +extern void vwarn __P ((__const char *__format, __gnuc_va_list)) + __attribute__ ((__format__ (__printf__, 1, 0))); + +/* Likewise, but without ": " and the standard error string. */ +extern void warnx __P ((__const char *__format, ...)) + __attribute__ ((__format__ (__printf__, 1, 2))); +extern void vwarnx __P ((__const char *__format, __gnuc_va_list)) + __attribute__ ((__format__ (__printf__, 1, 0))); + +/* Likewise, and then exit with STATUS. */ +extern void err __P ((int __status, __const char *__format, ...)) + __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3))); +extern void verr __P ((int __status, __const char *__format, __gnuc_va_list)) + __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))); +extern void errx __P ((int __status, __const char *__format, ...)) + __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3))); +extern void verrx __P ((int __status, __const char *, __gnuc_va_list)) + __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))); + +#ifdef __cplusplus +} +#endif + +#endif /* err.h */ diff --git a/rpm-5.4.9/misc/error.c b/rpm-5.4.9/misc/error.c new file mode 100644 index 0000000..98ea3a1 --- /dev/null +++ b/rpm-5.4.9/misc/error.c @@ -0,0 +1,252 @@ +/* Error handler for noninteractive utilities + Copyright (C) 1990,91,92,93,94,95,96,97,98 Free Software Foundation, Inc. + + This file is part of the GNU C Library. Its master source is NOT part of + the C library, however. The master source lives in /gd/gnu/lib. + + The GNU C 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. + + The GNU C 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 the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* Written by David MacKenzie . */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#if defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT) || _LIBC +# if __STDC__ +# include +# define VA_START(args, lastarg) va_start(args, lastarg) +# else +# include +# define VA_START(args, lastarg) va_start(args) +# endif +#else +# define va_alist a1, a2, a3, a4, a5, a6, a7, a8 +# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8; +#endif + +#if defined(STDC_HEADERS) || _LIBC +# include +# include +#else +void exit (); +#endif + +#include "error.h" + +#ifndef _ +# define _(String) String +#endif + +/* If NULL, error will flush stdout, then print on stderr the program + name, a colon and a space. Otherwise, error will call this + function without parameters instead. */ +void (*error_print_progname) ( +#if __STDC__ - 0 + void +#endif + ); + +/* This variable is incremented each time `error' is called. */ +unsigned int error_message_count; + +#ifdef _LIBC +/* In the GNU C library, there is a predefined variable for this. */ + +# define program_name program_invocation_name +# include + +/* In GNU libc we want do not want to use the common name `error' directly. + Instead make it a weak alias. */ +# define error __error +# define error_at_line __error_at_line + +# ifdef USE_IN_LIBIO +# include +# define fflush(s) _IO_fflush (s) +# endif + +#else /* not _LIBC */ + +/* The calling program should define program_name and set it to the + name of the executing program. */ +extern char *program_name; + +# ifdef HAVE_STRERROR_R +# define __strerror_r strerror_r +# else +# ifdef HAVE_STRERROR +# ifndef strerror /* On some systems, strerror is a macro */ +char *strerror (); +# endif +# else +static char * +private_strerror (errnum) + int errnum; +{ + extern char *sys_errlist[]; + extern int sys_nerr; + + if (errnum > 0 && errnum <= sys_nerr) + return _(sys_errlist[errnum]); + return _("Unknown system error"); +} +# define strerror private_strerror +# endif /* HAVE_STRERROR */ +# endif /* HAVE_STRERROR_R */ +#endif /* not _LIBC */ + +/* Print the program name and error message MESSAGE, which is a printf-style + format string with optional args. + If ERRNUM is nonzero, print its corresponding system error message. + Exit with status STATUS if it is nonzero. */ +/* VARARGS */ + +void +#if defined VA_START && __STDC__ +error (int status, int errnum, const char *message, ...) +#else +error (status, errnum, message, va_alist) + int status; + int errnum; + char *message; + va_dcl +#endif +{ +#ifdef VA_START + va_list args; +#endif + + if (error_print_progname) + (*error_print_progname) (); + else + { + fflush (stdout); + fprintf (stderr, "%s: ", program_name); + } + +#ifdef VA_START + VA_START (args, message); +# if defined(HAVE_VPRINTF) || _LIBC + vfprintf (stderr, message, args); +# else + _doprnt (message, args, stderr); +# endif + va_end (args); +#else + fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8); +#endif + + ++error_message_count; + if (errnum) + { +#if defined HAVE_STRERROR_R || defined _LIBC + char errbuf[1024]; + fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf)); +#else + fprintf (stderr, ": %s", strerror (errnum)); +#endif + } + putc ('\n', stderr); + fflush (stderr); + if (status) + exit (status); +} + +/* Sometimes we want to have at most one error per line. This + variable controls whether this mode is selected or not. */ +int error_one_per_line; + +void +#if defined VA_START && __STDC__ +error_at_line (int status, int errnum, const char *file_name, + unsigned int line_number, const char *message, ...) +#else +error_at_line (status, errnum, file_name, line_number, message, va_alist) + int status; + int errnum; + const char *file_name; + unsigned int line_number; + char *message; + va_dcl +#endif +{ +#ifdef VA_START + va_list args; +#endif + + if (error_one_per_line) + { + static const char *old_file_name; + static unsigned int old_line_number; + + if (old_line_number == line_number && + (file_name == old_file_name || !strcmp (old_file_name, file_name))) + /* Simply return and print nothing. */ + return; + + old_file_name = file_name; + old_line_number = line_number; + } + + if (error_print_progname) + (*error_print_progname) (); + else + { + fflush (stdout); + fprintf (stderr, "%s:", program_name); + } + + if (file_name != NULL) + fprintf (stderr, "%s:%d: ", file_name, line_number); + +#ifdef VA_START + VA_START (args, message); +# if defined(HAVE_VPRINTF) || _LIBC + vfprintf (stderr, message, args); +# else + _doprnt (message, args, stderr); +# endif + va_end (args); +#else + fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8); +#endif + + ++error_message_count; + if (errnum) + { +#if defined HAVE_STRERROR_R || defined _LIBC + char errbuf[1024]; + fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf)); +#else + fprintf (stderr, ": %s", strerror (errnum)); +#endif + } + putc ('\n', stderr); + fflush (stderr); + if (status) + exit (status); +} + +#ifdef _LIBC +/* Make the weak alias. */ +# undef error +# undef error_at_line +weak_alias (__error, error) +weak_alias (__error_at_line, error_at_line) +#endif diff --git a/rpm-5.4.9/misc/error.h b/rpm-5.4.9/misc/error.h new file mode 100644 index 0000000..0d3bcb7 --- /dev/null +++ b/rpm-5.4.9/misc/error.h @@ -0,0 +1,77 @@ +/* Declaration for error-reporting function + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + + This file is part of the GNU C Library. Its master source is NOT part of + the C library, however. The master source lives in /gd/gnu/lib. + + The GNU C 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. + + The GNU C 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 the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _ERROR_H +#define _ERROR_H 1 + +#ifndef __attribute__ +/* This feature is available in gcc versions 2.5 and later. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ +# define __attribute__(Spec) /* empty */ +# endif +/* The __-protected variants of `format' and `printf' attributes + are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +# define __format__ format +# define __printf__ printf +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (__STDC__) && __STDC__ + +/* Print a message with `fprintf (stderr, FORMAT, ...)'; + if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). + If STATUS is nonzero, terminate the program with `exit (STATUS)'. */ + +extern void error (int status, int errnum, const char *format, ...) + __attribute__ ((__format__ (__printf__, 3, 4))); + +extern void error_at_line (int status, int errnum, const char *fname, + unsigned int lineno, const char *format, ...) + __attribute__ ((__format__ (__printf__, 5, 6))); + +/* If NULL, error will flush stdout, then print on stderr the program + name, a colon and a space. Otherwise, error will call this + function without parameters instead. */ +extern void (*error_print_progname) (void); + +#else +void error (); +void error_at_line (); +extern void (*error_print_progname) (); +#endif + +/* This variable is incremented each time `error' is called. */ +extern unsigned int error_message_count; + +/* Sometimes we want to have at most one error per line. This + variable controls whether this mode is selected or not. */ +extern int error_one_per_line; + +#ifdef __cplusplus +} +#endif + +#endif /* error.h */ diff --git a/rpm-5.4.9/misc/fakefork.c b/rpm-5.4.9/misc/fakefork.c new file mode 100644 index 0000000..2089f28 --- /dev/null +++ b/rpm-5.4.9/misc/fakefork.c @@ -0,0 +1,8 @@ +/* This is really, really dumb. But AmigaOS gives us vfork(), but not + fork() and this should make things work despite their brokenness */ + +#include "system.h" + +int fork() { + return vfork(); +} diff --git a/rpm-5.4.9/misc/getcwd.c b/rpm-5.4.9/misc/getcwd.c new file mode 100644 index 0000000..60c1dd8 --- /dev/null +++ b/rpm-5.4.9/misc/getcwd.c @@ -0,0 +1,52 @@ +/* Emulate getcwd using getwd. + This function is in the public domain. */ + +/* +NAME + getcwd -- get absolute pathname for current working directory + +SYNOPSIS + char *getcwd (char pathname[len], len) + +DESCRIPTION + Copy the absolute pathname for the current working directory into + the supplied buffer and return a pointer to the buffer. If the + current directory's path doesn't fit in LEN characters, the result + is NULL and errno is set. + +BUGS + Emulated via the getwd() call, which is reasonable for most + systems that do not have getcwd(). + +*/ + +#ifndef NO_SYS_PARAM_H +#include +#endif +#include + +extern char *getwd (); +extern int errno; + +#ifndef MAXPATHLEN +#define MAXPATHLEN 1024 +#endif + +char * +getcwd (buf, len) + char *buf; + int len; +{ + char ourbuf[MAXPATHLEN]; + char *result; + + result = getwd (ourbuf); + if (result) { + if (strlen (ourbuf) >= len) { + errno = ERANGE; + return 0; + } + strcpy (buf, ourbuf); + } + return buf; +} diff --git a/rpm-5.4.9/misc/getdelim.c b/rpm-5.4.9/misc/getdelim.c new file mode 100644 index 0000000..096c310 --- /dev/null +++ b/rpm-5.4.9/misc/getdelim.c @@ -0,0 +1,133 @@ +/* getdelim.c --- Implementation of replacement getdelim function. + Copyright (C) 1994, 1996, 1997, 1998, 2001, 2003, 2005, 2006, 2007, + 2008, 2009 Free Software Foundation, Inc. + + 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, 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 Lesser 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. */ + +/* Ported from glibc by Simon Josefsson. */ + +#include + +#include + +#include +#include +#include +#include + +#ifndef SSIZE_MAX +# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) +#endif + +#if USE_UNLOCKED_IO +# include "unlocked-io.h" +# define getc_maybe_unlocked(fp) getc(fp) +#elif !HAVE_FLOCKFILE || !HAVE_FUNLOCKFILE || !HAVE_DECL_GETC_UNLOCKED +# undef flockfile +# undef funlockfile +# define flockfile(x) ((void) 0) +# define funlockfile(x) ((void) 0) +# define getc_maybe_unlocked(fp) getc(fp) +#else +# define getc_maybe_unlocked(fp) getc_unlocked(fp) +#endif + +/* Read up to (and including) a DELIMITER from FP into *LINEPTR (and + NUL-terminate it). *LINEPTR is a pointer returned from malloc (or + NULL), pointing to *N characters of space. It is realloc'ed as + necessary. Returns the number of characters read (not including + the null terminator), or -1 on error or EOF. */ + +ssize_t +getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp) +{ + ssize_t result; + size_t cur_len = 0; + + if (lineptr == NULL || n == NULL || fp == NULL) + { + errno = EINVAL; + return -1; + } + + flockfile (fp); + + if (*lineptr == NULL || *n == 0) + { + char *new_lineptr; + *n = 120; + new_lineptr = (char *) realloc (*lineptr, *n); + if (new_lineptr == NULL) + { + result = -1; + goto unlock_return; + } + *lineptr = new_lineptr; + } + + for (;;) + { + int i; + + i = getc_maybe_unlocked (fp); + if (i == EOF) + { + result = -1; + break; + } + + /* Make enough space for len+1 (for final NUL) bytes. */ + if (cur_len + 1 >= *n) + { + size_t needed_max = + SSIZE_MAX < SIZE_MAX ? (size_t) SSIZE_MAX + 1 : SIZE_MAX; + size_t needed = 2 * *n + 1; /* Be generous. */ + char *new_lineptr; + + if (needed_max < needed) + needed = needed_max; + if (cur_len + 1 >= needed) + { + result = -1; + errno = EOVERFLOW; + goto unlock_return; + } + + new_lineptr = (char *) realloc (*lineptr, needed); + if (new_lineptr == NULL) + { + result = -1; + goto unlock_return; + } + + *lineptr = new_lineptr; + *n = needed; + } + + (*lineptr)[cur_len] = i; + cur_len++; + + if (i == delimiter) + break; + } + (*lineptr)[cur_len] = '\0'; + result = cur_len ? cur_len : result; + + unlock_return: + funlockfile (fp); /* doesn't set errno */ + + return result; +} diff --git a/rpm-5.4.9/misc/getline.c b/rpm-5.4.9/misc/getline.c new file mode 100644 index 0000000..2be81c0 --- /dev/null +++ b/rpm-5.4.9/misc/getline.c @@ -0,0 +1,29 @@ +/* getline.c --- Implementation of replacement getline function. + Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1, 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 Lesser 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. */ + +/* Written by Simon Josefsson. */ + +#include + +#include + +ssize_t +getline (char **lineptr, size_t *n, FILE *stream) +{ + return getdelim (lineptr, n, '\n', stream); +} diff --git a/rpm-5.4.9/misc/getmntent.c b/rpm-5.4.9/misc/getmntent.c new file mode 100644 index 0000000..f2f73cb --- /dev/null +++ b/rpm-5.4.9/misc/getmntent.c @@ -0,0 +1,66 @@ +#include "system.h" + +#ifdef __aix__ +#define COMMENTCHAR '*' +#else +#define COMMENTCHAR '#' +#endif + +#if defined(HAVE_STRUCT_MNTTAB) +our_mntent * getmntent(FILE *filep) { + static struct mnttab entry; + static our_mntent item; + + if (!fread(&entry, sizeof(entry), 1, filep)) return NULL; + item.our_mntdir = entry.mt_filsys; + + return &item; +} +#else +our_mntent *getmntent(FILE *filep) { + static our_mntent item = { NULL }; + char buf[1024], * start; + char * chptr; + + if (item.our_mntdir) { + free(item.our_mntdir); + } + + while (fgets(buf, sizeof(buf) - 1, filep)) { + /* chop off \n */ + buf[strlen(buf) - 1] = '\0'; + + chptr = buf; + while (isspace(*chptr)) chptr++; + + if (*chptr == COMMENTCHAR) continue; + +# if __aix__ + /* aix uses a screwed up file format */ + if (*chptr == '/') { + start = chptr; + while (*chptr != ':') chptr++; + *chptr = '\0'; + item.mnt_dir = strdup(start); + return &item; + } +# else + while (!isspace(*chptr) && (*chptr)) chptr++; + if (!*chptr) return NULL; + + while (isspace(*chptr) && (*chptr)) chptr++; + if (!*chptr) return NULL; + start = chptr; + + while (!isspace(*chptr) && (*chptr)) chptr++; + *chptr = '\0'; + + item.our_mntdir = strdup(start); + return &item; +# endif + } + + return NULL; +} +#endif + diff --git a/rpm-5.4.9/misc/getwd.c b/rpm-5.4.9/misc/getwd.c new file mode 100644 index 0000000..a7a64b8 --- /dev/null +++ b/rpm-5.4.9/misc/getwd.c @@ -0,0 +1,29 @@ +/* getwd.c -- get current working directory pathname + Copyright (C) 1992 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. */ + +/* Some systems which include both getwd() and getcwd() have an implementation + of getwd() which is much faster than getcwd(). As a result, we use the + system's getwd() if it is available */ + +#include "system.h" + +/* Get the current working directory into PATHNAME */ + +char * +getwd (pathname) + char *pathname; +{ + char *getcwd(); + + return (getcwd(pathname, PATH_MAX)); +} diff --git a/rpm-5.4.9/misc/librpmmisc.c b/rpm-5.4.9/misc/librpmmisc.c new file mode 100644 index 0000000..85a34c4 --- /dev/null +++ b/rpm-5.4.9/misc/librpmmisc.c @@ -0,0 +1,78 @@ +/** + * \file misc/librpmmisc.c + */ + +#include "system.h" + +#if !defined(HAVE_BASENAME) +#include "basename.c" +#endif + +#if !defined(HAVE_GETCWD) +#include "getcwd.c" +#endif + +#if !defined(HAVE_GETWD) +#include "getwd.c" +#endif + +#if !defined(HAVE_PUTENV) +#include "putenv.c" +#endif + +#if defined(USE_GETMNTENT) +#include "getmntent.c" +#endif + +#if !defined(HAVE_REALPATH) +#include "realpath.c" +#endif + +#if !defined(HAVE_SETENV) +#include "setenv.c" +#endif + +/* XXX limit the fiddle up to linux for now. */ +#if !defined(HAVE_SETPROCTITLE) && defined(__linux__) +#include "setproctitle.c" +#endif + +#if !defined(HAVE_STPCPY) +#include "stpcpy.c" +#endif + +#if !defined(HAVE_STPNCPY) +#include "stpncpy.c" +#endif + +#if !defined(HAVE_STRCSPN) +#include "strcspn.c" +#endif + +#if !defined(HAVE_STRSPN) +#include "strdup.c" +#endif + +#if !defined(HAVE_STRERROR) +#include "error.c" +#endif + +#if !defined(HAVE_STRTOL) +#include "strtol.c" +#endif + +#if !defined(HAVE_STRTOUL) +#include "strtoul.c" +#endif + +#if !defined(HAVE_STRSPN) +#include "strspn.c" +#endif + +#if !defined(HAVE_STRSTR) +#include "strstr.c" +#endif + +#if !defined(HAVE_MKDTEMP) +#include "mkdtemp.c" +#endif diff --git a/rpm-5.4.9/misc/librpmmisc.vers b/rpm-5.4.9/misc/librpmmisc.vers new file mode 100644 index 0000000..5c05f61 --- /dev/null +++ b/rpm-5.4.9/misc/librpmmisc.vers @@ -0,0 +1,407 @@ +LIBRPMMISC_0 +{ + global: + db_create; + db_create_rpmdb; + db_env_create; + db_env_create_rpmdb; + db_env_set_func_open; + db_env_set_func_open_rpmdb; + db_env_set_func_fsync; + db_env_set_func_fsync_rpmdb; + db_sequence_create; + db_sequence_create_rpmdb; + db_strerror; + db_strerror_rpmdb; + __db_add_recovery; + __db_add_recovery_rpmdb; + ficlSystemCompileExtras; + ficlSystemCreate; + ficlSystemCreateVm; + ficlSystemDestroy; + ficlVmEvaluate; + finiproctitle; + initproctitle; + setproctitle; + gpsee_*; + JS_*; + js_*; + lua_call; + lua_close; + lua_concat; + lua_createtable; + lua_getfield; + lua_gettop; + lua_isnumber; + lua_isstring; + luaL_argerror; + luaL_checklstring; + luaL_error; + luaL_loadbuffer; + luaL_loadfile; + luaL_newstate; + lua_newthread; + luaL_openlib; + luaL_ref; + luaL_unref; + lua_newuserdata; + lua_next; + lua_objlen; + luaopen_base; + luaopen_crypto; + luaopen_debug; + luaopen_io; + luaopen_local; + luaopen_math; + luaopen_os; + luaopen_lxp; + luaopen_package; + luaopen_posix; + luaopen_rex_pcre; + luaopen_rex_posix; + luaopen_socket_core; + luaopen_string; + luaopen_table; + luaopen_uuid; + luaopen_wrs; + lua_pcall; + lua_pushboolean; + lua_pushcclosure; + lua_pushfstring; + lua_pushlightuserdata; + lua_pushlstring; + lua_pushnil; + lua_pushnumber; + lua_pushstring; + lua_pushvalue; + lua_rawget; + lua_rawgeti; + lua_rawset; + lua_rawseti; + lua_remove; + lua_settable; + lua_settop; + lua_toboolean; + lua_tolstring; + lua_tonumber; + lua_touserdata; + lua_type; + lua_xmove; + luaL_addlstring; + luaL_buffinit; + luaL_pushresult; + luaL_typerror; + lzma_alone_encoder; + lzma_auto_decoder; + lzma_code; + lzma_end; + lzma_easy_encoder; + lzma_lzma_preset; + lzma_preset_lzma; + lzma_memlimit_alloc; + lzma_memlimit_create; + lzma_memlimit_end; + lzma_memlimit_free; + LZMA_STREAM_INIT_VAR; + magic_buffer; + magic_close; + magic_error; + magic_file; + magic_load; + magic_open; + ne_add_request_header; + ne_begin_request; + ne_calloc; + ne_debug_init; + ne_delete; + ne_end_request; + ne_get_error; + ne_get_request_private; + ne_get_response_header; + ne_get_session; + ne_get_session_private; + ne_get_status; + ne_has_support; + ne_hook_create_request; + ne_hook_destroy_request; + ne_hook_destroy_session; + ne_hook_post_send; + ne_hook_pre_send; + ne_httpdate_parse; + ne_iaddr_print; + ne_lockstore_create; + ne_lockstore_destroy; + ne_lockstore_register; + ne_mkcol; + ne_move; + ne_options; + ne_path_compare; + ne_path_unescape; + ne_propfind_create; + ne_propfind_current_private; + ne_propfind_destroy; + ne_propfind_get_parser; + ne_propfind_named; + ne_propfind_set_private; + ne_propset_private; + ne_propset_status; + ne_propset_value; + ne_read_response_block; + ne_request_create; + ne_request_destroy; + ne_request_dispatch; + ne_session_create; + ne_session_destroy; + ne_session_proxy; + ne_set_connect_timeout; + ne_set_notifier; + ne_set_progress; + ne_set_read_timeout; + ne_set_request_private; + ne_set_session_flag; + ne_set_session_private; + ne_set_useragent; + ne_sock_exit; + ne_sock_init; + ne_ssl_set_verify; + ne_strdup; + ne_strndup; + ne_version_pre_http11; + ne_xml_mapid; + ne_xml_push_handler; + pcre_regcomp; + pcre_regerror; + pcre_regexec; + pcre_regfree; + pcre_compile; + pcre_compile2; + pcre_config; + pcre_dfa_exec; + pcre_exec; + pcre_free; + pcre_fullinfo; + pcre_maketables; + pcre_study; + pcre_version; + _poptArgMask; + _poptGroupMask; + poptAddAlias; + poptAddItem; + poptAliasOptions; + poptBadOption; + _poptBitsN; + _poptBitsM; + _poptBitsK; + poptBitsAdd; + poptBitsArgs; + poptBitsChk; + poptBitsClr; + poptBitsDel; + poptBitsIntersect; + poptBitsUnion; + poptConfigFileToString; + poptDupArgv; + poptFini; + poptFreeContext; + poptGetArg; + poptGetArgs; + poptGetContext; + poptGetInvocationName; + poptGetNextOpt; + poptGetOptArg; + poptHelpOptions; + poptHelpOptionsI18N; + poptInit; + poptParseArgvString; + poptPeekArg; + poptPrintHelp; + poptPrintUsage; + poptReadFile; + poptReadConfigFile; + poptReadConfigFiles; + poptReadDefaultConfig; + poptResetContext; + poptSaneFile; + poptSaveBits; + poptSaveInt; + poptSaveLong; + poptSaveLongLong; + poptSaveShort; + poptSaveString; + poptSetExecPath; + poptSetOtherOptionHelp; + poptStrerror; + poptStrippedArgv; + poptStuffArgs; + rc_main; + sqlite3_backup_finish; + sqlite3_backup_init; + sqlite3_backup_step; + sqlite3_bind_blob; + sqlite3_bind_int; + sqlite3_bind_text; + sqlite3_busy_handler; + sqlite3_busy_timeout; + sqlite3_close; + sqlite3_column_blob; + sqlite3_column_bytes; + sqlite3_column_count; + sqlite3_column_decltype; + sqlite3_column_double; + sqlite3_column_int; + sqlite3_column_int64; + sqlite3_column_name; + sqlite3_column_text; + sqlite3_column_type; + sqlite3_complete; + sqlite3_config; + sqlite3_create_function; + sqlite3_create_module_v2; + sqlite3_declare_vtab; + sqlite3_enable_load_extension; + sqlite3_errcode; + sqlite3_errmsg; + sqlite3_exec; + sqlite3_finalize; + sqlite3_free; + sqlite3_free_table; + sqlite3_get_table; + sqlite3_interrupt; + sqlite3_libversion; + sqlite3_load_extension; + sqlite3_mprintf; + sqlite3_open; + sqlite3_prepare; + sqlite3_prepare_v2; + sqlite3_reset; + sqlite3_result_double; + sqlite3_result_error; + sqlite3_result_int; + sqlite3_result_int64; + sqlite3_result_null; + sqlite3_result_text; + sqlite3_sleep; + sqlite3_snprintf; + sqlite3_sourceid; + sqlite3_sql; + sqlite3_step; + sqlite3_value_blob; + sqlite3_value_bytes; + sqlite3_value_double; + sqlite3_value_int; + sqlite3_value_int64; + sqlite3_value_text; + sqlite3_value_type; + st_foreach; + st_free_table; + syck_add_sym; + syck_emit; + syck_emit_end; + syck_emit_item; + syck_emit_map; + syck_emit_scalar; + syck_emit_seq; + syck_emitter_flush; + syck_emitter_handler; + syck_emitter_mark_node; + syck_free_emitter; + syck_free_parser; + syck_lookup_sym; + syck_map_read; + syck_new_emitter; + syck_new_parser; + syck_output_handler; + syck_parse; + syck_parser_error_handler; + syck_parser_handler; + syck_parser_implicit_typing; + syck_parser_str; + syck_parser_str_auto; + syck_parser_taguri_expansion; + syck_seq_read; + syck_strndup; + xar_add_frombuffer; + xar_close; + xar_extract_tobuffersz; + xar_file_first; + xar_file_next; + xar_get_path; + xar_iter_free; + xar_iter_new; + xar_open; + xar_opt_set; + b64crc; + b64decode; + b64encode; + b64encode_chars_per_line; + b64encode_eolstr; + dldp_pPair; + dlkp_pFree; + dlkp_pInit; + dsaparamMake; + dsasign; + dsavrfy; + i2osp; + md4Digest; + md4Reset; + md4Update; + md5Digest; + md5Reset; + md5Update; + mpadd; + mpbits; + mpbnrnd; + mpbsethex; + mpfprintln; + mplshift; + mpnfree; + mpnsetbin; + mpnsethex; + mpnzero; + mpsetw; + mpzero; + randomGeneratorContextFree; + randomGeneratorContextInit; + randomGeneratorDefault; + ripemd128Digest; + ripemd128Reset; + ripemd128Update; + ripemd160Digest; + ripemd160Reset; + ripemd160Update; + ripemd256Digest; + ripemd256Reset; + ripemd256Update; + ripemd320Digest; + ripemd320Reset; + ripemd320Update; + rsakpFree; + rsakpMake; + rsapricrt; + rsavrfy; + sha1Digest; + sha1Reset; + sha1Update; + sha224Digest; + sha224Reset; + sha224Update; + sha256Digest; + sha256Reset; + sha256Update; + sha384Digest; + sha384Reset; + sha384Update; + sha512Digest; + sha512Reset; + sha512Update; + hashFunctionContextDigest; + hashFunctionContextFree; + hashFunctionContextInit; + hashFunctionContextUpdateMC; + hashFunctionCount; + hashFunctionGet; + local: + file_*; + db_*; + *; +}; diff --git a/rpm-5.4.9/misc/memcmp.c b/rpm-5.4.9/misc/memcmp.c new file mode 100644 index 0000000..6096651 --- /dev/null +++ b/rpm-5.4.9/misc/memcmp.c @@ -0,0 +1,373 @@ +/* Copyright (C) 1991, 1993, 1995 Free Software Foundation, Inc. + Contributed by Torbjorn Granlund (tege@sics.se). + +NOTE: The canonical source of this file is maintained with the GNU C Library. +Bugs can be reported to bug-glibc@prep.ai.mit.edu. + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#undef __ptr_t +#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) +#define __ptr_t void * +#else /* Not C++ or ANSI C. */ +#undef const +#define const +#define __ptr_t char * +#endif /* C++ or ANSI C. */ + +#if defined (HAVE_STRING_H) || defined (_LIBC) +#include +#endif + +#ifdef _LIBC + +#include + +#else /* Not in the GNU C library. */ + +#include + +/* Type to use for aligned memory operations. + This should normally be the biggest type supported by a single load + and store. Must be an unsigned type. */ +#define op_t unsigned long int +#define OPSIZ (sizeof(op_t)) + +/* Threshold value for when to enter the unrolled loops. */ +#define OP_T_THRES 16 + +/* Type to use for unaligned operations. */ +typedef unsigned char byte; + +#ifndef WORDS_BIGENDIAN +#define MERGE(w0, sh_1, w1, sh_2) (((w0) >> (sh_1)) | ((w1) << (sh_2))) +#else +#define MERGE(w0, sh_1, w1, sh_2) (((w0) << (sh_1)) | ((w1) >> (sh_2))) +#endif + +#endif /* In the GNU C library. */ + +#ifdef WORDS_BIGENDIAN +#define CMP_LT_OR_GT(a, b) ((a) > (b) ? 1 : -1) +#else +#define CMP_LT_OR_GT(a, b) memcmp_bytes ((a), (b)) +#endif + +/* BE VERY CAREFUL IF YOU CHANGE THIS CODE! */ + +/* The strategy of this memcmp is: + + 1. Compare bytes until one of the block pointers is aligned. + + 2. Compare using memcmp_common_alignment or + memcmp_not_common_alignment, regarding the alignment of the other + block after the initial byte operations. The maximum number of + full words (of type op_t) are compared in this way. + + 3. Compare the few remaining bytes. */ + +#ifndef WORDS_BIGENDIAN +/* memcmp_bytes -- Compare A and B bytewise in the byte order of the machine. + A and B are known to be different. + This is needed only on little-endian machines. */ +#ifdef __GNUC__ +__inline +#endif +static int +memcmp_bytes (a, b) + op_t a, b; +{ + long int srcp1 = (long int) &a; + long int srcp2 = (long int) &b; + op_t a0, b0; + + do + { + a0 = ((byte *) srcp1)[0]; + b0 = ((byte *) srcp2)[0]; + srcp1 += 1; + srcp2 += 1; + } + while (a0 == b0); + return a0 - b0; +} +#endif + +/* memcmp_common_alignment -- Compare blocks at SRCP1 and SRCP2 with LEN `op_t' + objects (not LEN bytes!). Both SRCP1 and SRCP2 should be aligned for + memory operations on `op_t's. */ +#ifdef __GNUC__ +__inline +#endif +static int +memcmp_common_alignment (srcp1, srcp2, len) + long int srcp1; + long int srcp2; + size_t len; +{ + op_t a0, a1; + op_t b0, b1; + + switch (len % 4) + { + case 2: + a0 = ((op_t *) srcp1)[0]; + b0 = ((op_t *) srcp2)[0]; + srcp1 -= 2 * OPSIZ; + srcp2 -= 2 * OPSIZ; + len += 2; + goto do1; + case 3: + a1 = ((op_t *) srcp1)[0]; + b1 = ((op_t *) srcp2)[0]; + srcp1 -= OPSIZ; + srcp2 -= OPSIZ; + len += 1; + goto do2; + case 0: + if (OP_T_THRES <= 3 * OPSIZ && len == 0) + return 0; + a0 = ((op_t *) srcp1)[0]; + b0 = ((op_t *) srcp2)[0]; + goto do3; + case 1: + a1 = ((op_t *) srcp1)[0]; + b1 = ((op_t *) srcp2)[0]; + srcp1 += OPSIZ; + srcp2 += OPSIZ; + len -= 1; + if (OP_T_THRES <= 3 * OPSIZ && len == 0) + goto do0; + /* Fall through. */ + } + + do + { + a0 = ((op_t *) srcp1)[0]; + b0 = ((op_t *) srcp2)[0]; + if (a1 != b1) + return CMP_LT_OR_GT (a1, b1); + + do3: + a1 = ((op_t *) srcp1)[1]; + b1 = ((op_t *) srcp2)[1]; + if (a0 != b0) + return CMP_LT_OR_GT (a0, b0); + + do2: + a0 = ((op_t *) srcp1)[2]; + b0 = ((op_t *) srcp2)[2]; + if (a1 != b1) + return CMP_LT_OR_GT (a1, b1); + + do1: + a1 = ((op_t *) srcp1)[3]; + b1 = ((op_t *) srcp2)[3]; + if (a0 != b0) + return CMP_LT_OR_GT (a0, b0); + + srcp1 += 4 * OPSIZ; + srcp2 += 4 * OPSIZ; + len -= 4; + } + while (len != 0); + + /* This is the right position for do0. Please don't move + it into the loop. */ + do0: + if (a1 != b1) + return CMP_LT_OR_GT (a1, b1); + return 0; +} + +/* memcmp_not_common_alignment -- Compare blocks at SRCP1 and SRCP2 with LEN + `op_t' objects (not LEN bytes!). SRCP2 should be aligned for memory + operations on `op_t', but SRCP1 *should be unaligned*. */ +#ifdef __GNUC__ +__inline +#endif +static int +memcmp_not_common_alignment (srcp1, srcp2, len) + long int srcp1; + long int srcp2; + size_t len; +{ + op_t a0, a1, a2, a3; + op_t b0, b1, b2, b3; + op_t x; + int shl, shr; + + /* Calculate how to shift a word read at the memory operation + aligned srcp1 to make it aligned for comparison. */ + + shl = 8 * (srcp1 % OPSIZ); + shr = 8 * OPSIZ - shl; + + /* Make SRCP1 aligned by rounding it down to the beginning of the `op_t' + it points in the middle of. */ + srcp1 &= -OPSIZ; + + switch (len % 4) + { + case 2: + a1 = ((op_t *) srcp1)[0]; + a2 = ((op_t *) srcp1)[1]; + b2 = ((op_t *) srcp2)[0]; + srcp1 -= 1 * OPSIZ; + srcp2 -= 2 * OPSIZ; + len += 2; + goto do1; + case 3: + a0 = ((op_t *) srcp1)[0]; + a1 = ((op_t *) srcp1)[1]; + b1 = ((op_t *) srcp2)[0]; + srcp2 -= 1 * OPSIZ; + len += 1; + goto do2; + case 0: + if (OP_T_THRES <= 3 * OPSIZ && len == 0) + return 0; + a3 = ((op_t *) srcp1)[0]; + a0 = ((op_t *) srcp1)[1]; + b0 = ((op_t *) srcp2)[0]; + srcp1 += 1 * OPSIZ; + goto do3; + case 1: + a2 = ((op_t *) srcp1)[0]; + a3 = ((op_t *) srcp1)[1]; + b3 = ((op_t *) srcp2)[0]; + srcp1 += 2 * OPSIZ; + srcp2 += 1 * OPSIZ; + len -= 1; + if (OP_T_THRES <= 3 * OPSIZ && len == 0) + goto do0; + /* Fall through. */ + } + + do + { + a0 = ((op_t *) srcp1)[0]; + b0 = ((op_t *) srcp2)[0]; + x = MERGE(a2, shl, a3, shr); + if (x != b3) + return CMP_LT_OR_GT (x, b3); + + do3: + a1 = ((op_t *) srcp1)[1]; + b1 = ((op_t *) srcp2)[1]; + x = MERGE(a3, shl, a0, shr); + if (x != b0) + return CMP_LT_OR_GT (x, b0); + + do2: + a2 = ((op_t *) srcp1)[2]; + b2 = ((op_t *) srcp2)[2]; + x = MERGE(a0, shl, a1, shr); + if (x != b1) + return CMP_LT_OR_GT (x, b1); + + do1: + a3 = ((op_t *) srcp1)[3]; + b3 = ((op_t *) srcp2)[3]; + x = MERGE(a1, shl, a2, shr); + if (x != b2) + return CMP_LT_OR_GT (x, b2); + + srcp1 += 4 * OPSIZ; + srcp2 += 4 * OPSIZ; + len -= 4; + } + while (len != 0); + + /* This is the right position for do0. Please don't move + it into the loop. */ + do0: + x = MERGE(a2, shl, a3, shr); + if (x != b3) + return CMP_LT_OR_GT (x, b3); + return 0; +} + +int +memcmp (s1, s2, len) + const __ptr_t s1; + const __ptr_t s2; + size_t len; +{ + op_t a0; + op_t b0; + long int srcp1 = (long int) s1; + long int srcp2 = (long int) s2; + op_t res; + + if (len >= OP_T_THRES) + { + /* There are at least some bytes to compare. No need to test + for LEN == 0 in this alignment loop. */ + while (srcp2 % OPSIZ != 0) + { + a0 = ((byte *) srcp1)[0]; + b0 = ((byte *) srcp2)[0]; + srcp1 += 1; + srcp2 += 1; + res = a0 - b0; + if (res != 0) + return res; + len -= 1; + } + + /* SRCP2 is now aligned for memory operations on `op_t'. + SRCP1 alignment determines if we can do a simple, + aligned compare or need to shuffle bits. */ + + if (srcp1 % OPSIZ == 0) + res = memcmp_common_alignment (srcp1, srcp2, len / OPSIZ); + else + res = memcmp_not_common_alignment (srcp1, srcp2, len / OPSIZ); + if (res != 0) + return res; + + /* Number of bytes remaining in the interval [0..OPSIZ-1]. */ + srcp1 += len & -OPSIZ; + srcp2 += len & -OPSIZ; + len %= OPSIZ; + } + + /* There are just a few bytes to compare. Use byte memory operations. */ + while (len != 0) + { + a0 = ((byte *) srcp1)[0]; + b0 = ((byte *) srcp2)[0]; + srcp1 += 1; + srcp2 += 1; + res = a0 - b0; + if (res != 0) + return res; + len -= 1; + } + + return 0; +} + +#ifdef weak_alias +#undef bcmp +weak_alias (memcmp, bcmp) +#endif + + diff --git a/rpm-5.4.9/misc/mkdtemp.c b/rpm-5.4.9/misc/mkdtemp.c new file mode 100644 index 0000000..5cddd62 --- /dev/null +++ b/rpm-5.4.9/misc/mkdtemp.c @@ -0,0 +1,349 @@ +/* Copyright (C) 1999, 2001-2003, 2006-2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + 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 . */ + +/* Extracted from misc/mkdtemp.c. */ +#include "system.h" + + +/* tempname.c - generate the name of a temporary file. + + Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + 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 . */ + +/* Extracted from glibc sysdeps/posix/tempname.c. See also tmpdir.c. */ + +#if !_LIBC +# include +# include "tempname.h" +#endif + +#include +#include + +#include +#ifndef __set_errno +# define __set_errno(Val) errno = (Val) +#endif + +#include +#ifndef P_tmpdir +# define P_tmpdir "/tmp" +#endif +#ifndef TMP_MAX +# define TMP_MAX 238328 +#endif +#ifndef __GT_FILE +# define __GT_FILE 0 +# define __GT_BIGFILE 1 +# define __GT_DIR 2 +# define __GT_NOCREATE 3 +#endif + +#include +#include +#include + +#include +#include +#include +#include + +#include + +#if _LIBC +# define struct_stat64 struct stat64 +# define small_open __open +# define large_open __open64 +#else +# define struct_stat64 struct stat +# define small_open open +# define large_open open +# define __gen_tempname gen_tempname +# define __getpid getpid +# define __gettimeofday gettimeofday +# define __mkdir mkdir +# define __lxstat64(version, file, buf) lstat (file, buf) +# define __xstat64(version, file, buf) stat (file, buf) +#endif + +#if ! (HAVE___SECURE_GETENV || _LIBC) +# define __secure_getenv getenv +#endif + +#ifdef _LIBC +# include +# if HP_TIMING_AVAIL +# define RANDOM_BITS(Var) \ + if (__builtin_expect (value == UINT64_C (0), 0)) \ + { \ + /* If this is the first time this function is used initialize \ + the variable we accumulate the value in to some somewhat \ + random value. If we'd not do this programs at startup time \ + might have a reduced set of possible names, at least on slow \ + machines. */ \ + struct timeval tv; \ + __gettimeofday (&tv, NULL); \ + value = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec; \ + } \ + HP_TIMING_NOW (Var) +# endif +#endif + +/* Use the widest available unsigned type if uint64_t is not + available. The algorithm below extracts a number less than 62**6 + (approximately 2**35.725) from uint64_t, so ancient hosts where + uintmax_t is only 32 bits lose about 3.725 bits of randomness, + which is better than not having mkstemp at all. */ +#if !defined UINT64_MAX && !defined uint64_t +# define uint64_t uintmax_t +#endif + +#if _LIBC +/* Return nonzero if DIR is an existent directory. */ +static int +direxists (const char *dir) +{ + struct_stat64 buf; + return __xstat64 (_STAT_VER, dir, &buf) == 0 && S_ISDIR (buf.st_mode); +} + +/* Path search algorithm, for tmpnam, tmpfile, etc. If DIR is + non-null and exists, uses it; otherwise uses the first of $TMPDIR, + P_tmpdir, /tmp that exists. Copies into TMPL a template suitable + for use with mk[s]temp. Will fail (-1) if DIR is non-null and + doesn't exist, none of the searched dirs exists, or there's not + enough space in TMPL. */ +int +__path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx, + int try_tmpdir) +{ + const char *d; + size_t dlen, plen; + + if (!pfx || !pfx[0]) + { + pfx = "file"; + plen = 4; + } + else + { + plen = strlen (pfx); + if (plen > 5) + plen = 5; + } + + if (try_tmpdir) + { + d = __secure_getenv ("TMPDIR"); + if (d != NULL && direxists (d)) + dir = d; + else if (dir != NULL && direxists (dir)) + /* nothing */ ; + else + dir = NULL; + } + if (dir == NULL) + { + if (direxists (P_tmpdir)) + dir = P_tmpdir; + else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp")) + dir = "/tmp"; + else + { + __set_errno (ENOENT); + return -1; + } + } + + dlen = strlen (dir); + while (dlen > 1 && dir[dlen - 1] == '/') + dlen--; /* remove trailing slashes */ + + /* check we have room for "${dir}/${pfx}XXXXXX\0" */ + if (tmpl_len < dlen + 1 + plen + 6 + 1) + { + __set_errno (EINVAL); + return -1; + } + + sprintf (tmpl, "%.*s/%.*sXXXXXX", (int) dlen, dir, (int) plen, pfx); + return 0; +} +#endif /* _LIBC */ + +/* These are the characters used in temporary file names. */ +static const char letters[] = +"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + +/* Generate a temporary file name based on TMPL. TMPL must match the + rules for mk[s]temp (i.e. end in "XXXXXX"). The name constructed + does not exist at the time of the call to __gen_tempname. TMPL is + overwritten with the result. + + KIND may be one of: + __GT_NOCREATE: simply verify that the name does not exist + at the time of the call. + __GT_FILE: create the file using open(O_CREAT|O_EXCL) + and return a read-write fd. The file is mode 0600. + __GT_BIGFILE: same as __GT_FILE but use open64(). + __GT_DIR: create a directory, which will be mode 0700. + + We use a clever algorithm to get hard-to-predict names. */ +int +__gen_tempname (char *tmpl, int kind) +{ + int len; + char *XXXXXX; + static uint64_t value; + uint64_t random_time_bits; + unsigned int count; + int fd = -1; + int save_errno = errno; + struct_stat64 st; + + /* A lower bound on the number of temporary files to attempt to + generate. The maximum total number of temporary file names that + can exist for a given template is 62**6. It should never be + necessary to try all these combinations. Instead if a reasonable + number of names is tried (we define reasonable as 62**3) fail to + give the system administrator the chance to remove the problems. */ +#define ATTEMPTS_MIN (62 * 62 * 62) + + /* The number of times to attempt to generate a temporary file. To + conform to POSIX, this must be no smaller than TMP_MAX. */ +#if ATTEMPTS_MIN < TMP_MAX + unsigned int attempts = TMP_MAX; +#else + unsigned int attempts = ATTEMPTS_MIN; +#endif + + len = strlen (tmpl); + if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX")) + { + __set_errno (EINVAL); + return -1; + } + + /* This is where the Xs start. */ + XXXXXX = &tmpl[len - 6]; + + /* Get some more or less random data. */ +#ifdef RANDOM_BITS + RANDOM_BITS (random_time_bits); +#else + { + struct timeval tv; + __gettimeofday (&tv, NULL); + random_time_bits = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec; + } +#endif + value += random_time_bits ^ __getpid (); + + for (count = 0; count < attempts; value += 7777, ++count) + { + uint64_t v = value; + + /* Fill in the random bits. */ + XXXXXX[0] = letters[v % 62]; + v /= 62; + XXXXXX[1] = letters[v % 62]; + v /= 62; + XXXXXX[2] = letters[v % 62]; + v /= 62; + XXXXXX[3] = letters[v % 62]; + v /= 62; + XXXXXX[4] = letters[v % 62]; + v /= 62; + XXXXXX[5] = letters[v % 62]; + + switch (kind) + { + case __GT_FILE: + fd = small_open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); + break; + + case __GT_BIGFILE: + fd = large_open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); + break; + + case __GT_DIR: + fd = __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR); + break; + + case __GT_NOCREATE: + /* This case is backward from the other three. __gen_tempname + succeeds if __xstat fails because the name does not exist. + Note the continue to bypass the common logic at the bottom + of the loop. */ + if (__lxstat64 (_STAT_VER, tmpl, &st) < 0) + { + if (errno == ENOENT) + { + __set_errno (save_errno); + return 0; + } + else + /* Give up now. */ + return -1; + } + continue; + + default: + assert (! "invalid KIND in __gen_tempname"); + } + + if (fd >= 0) + { + __set_errno (save_errno); + return fd; + } + else if (errno != EEXIST) + return -1; + } + + /* We got out of the loop because we ran out of combinations to try. */ + __set_errno (EEXIST); + return -1; +} + + +/* Generate a unique temporary directory from TEMPLATE. + The last six characters of TEMPLATE must be "XXXXXX"; + they are replaced with a string that makes the filename unique. + The directory is created, mode 700, and its name is returned. + (This function comes from OpenBSD.) */ +char * +mkdtemp (char *template) +{ + if (gen_tempname (template, GT_DIR)) + return NULL; + else + return template; +} diff --git a/rpm-5.4.9/misc/mktime.c b/rpm-5.4.9/misc/mktime.c new file mode 100644 index 0000000..fc92c89 --- /dev/null +++ b/rpm-5.4.9/misc/mktime.c @@ -0,0 +1,408 @@ +/* Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. + Contributed by Paul Eggert (eggert@twinsun.com). + + NOTE: The canonical source of this file is maintained with the GNU C + Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Define this to have a standalone program to test this implementation of + mktime. */ +/* #define DEBUG 1 */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +/* Assume that leap seconds are possible, unless told otherwise. + If the host has a `zic' command with a `-L leapsecondfilename' option, + then it supports leap seconds; otherwise it probably doesn't. */ +#ifndef LEAP_SECONDS_POSSIBLE +#define LEAP_SECONDS_POSSIBLE 1 +#endif + +#include /* Some systems define `time_t' here. */ +#include + +#if __STDC__ || __GNU_LIBRARY__ || STDC_HEADERS +#include +#endif + +#if DEBUG +#include +#if __STDC__ || __GNU_LIBRARY__ || STDC_HEADERS +#include +#endif +/* Make it work even if the system's libc has its own mktime routine. */ +#define mktime my_mktime +#endif /* DEBUG */ + +#ifndef __P +#if defined (__GNUC__) || (defined (__STDC__) && __STDC__) +#define __P(args) args +#else +#define __P(args) () +#endif /* GCC. */ +#endif /* Not __P. */ + +#ifndef CHAR_BIT +#define CHAR_BIT 8 +#endif + +#ifndef INT_MIN +#define INT_MIN (~0 << (sizeof (int) * CHAR_BIT - 1)) +#endif +#ifndef INT_MAX +#define INT_MAX (~0 - INT_MIN) +#endif + +#ifndef TIME_T_MIN +#define TIME_T_MIN (0 < (time_t) -1 ? (time_t) 0 \ + : ~ (time_t) 0 << (sizeof (time_t) * CHAR_BIT - 1)) +#endif +#ifndef TIME_T_MAX +#define TIME_T_MAX (~ (time_t) 0 - TIME_T_MIN) +#endif + +#define TM_YEAR_BASE 1900 +#define EPOCH_YEAR 1970 + +#ifndef __isleap +/* Nonzero if YEAR is a leap year (every 4 years, + except every 100th isn't, and every 400th is). */ +#define __isleap(year) \ + ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) +#endif + +/* How many days come before each month (0-12). */ +static const unsigned short int __mon_yday[2][13] = + { + /* Normal years. */ + { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }, + /* Leap years. */ + { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } + }; + +static time_t ydhms_tm_diff __P ((int, int, int, int, int, const struct tm *)); +static time_t __mktime_internal __P ((struct tm *, + struct tm *(*) (const time_t *, struct tm *), + time_t *)); + + +#if ! defined(HAVE_LOCALTIME_R) && ! defined (localtime_r) +#ifdef _LIBC +#define localtime_r __localtime_r +#else +/* Approximate localtime_r as best we can in its absence. */ +#define localtime_r my_localtime_r +static struct tm *localtime_r __P ((const time_t *, struct tm *)); +static struct tm * +localtime_r (t, tp) + const time_t *t; + struct tm *tp; +{ + struct tm *l = localtime (t); + if (! l) + return 0; + *tp = *l; + return tp; +} +#endif /* ! _LIBC */ +#endif /* ! HAVE_LOCALTIME_R && ! defined (localtime_r) */ + + +/* Yield the difference between (YEAR-YDAY HOUR:MIN:SEC) and (*TP), + measured in seconds, ignoring leap seconds. + YEAR uses the same numbering as TM->tm_year. + All values are in range, except possibly YEAR. + If overflow occurs, yield the low order bits of the correct answer. */ +static time_t +ydhms_tm_diff (year, yday, hour, min, sec, tp) + int year, yday, hour, min, sec; + const struct tm *tp; +{ + time_t ay = year + (time_t) (TM_YEAR_BASE - 1); + time_t by = tp->tm_year + (time_t) (TM_YEAR_BASE - 1); + time_t intervening_leap_days = + (ay/4 - by/4) - (ay/100 - by/100) + (ay/400 - by/400); + time_t years = ay - by; + time_t days = (365 * years + intervening_leap_days + + (yday - tp->tm_yday)); + return (60 * (60 * (24 * days + (hour - tp->tm_hour)) + + (min - tp->tm_min)) + + (sec - tp->tm_sec)); +} + + +/* Convert *TP to a time_t value. */ +time_t +mktime (tp) + struct tm *tp; +{ + static time_t localtime_offset; + return __mktime_internal (tp, localtime_r, &localtime_offset); +} + +/* Convert *TP to a time_t value, inverting + the monotonic and mostly-unit-linear conversion function CONVERT. + Use *OFFSET to keep track of a guess at the offset of the result, + compared to what the result would be for UTC without leap seconds. + If *OFFSET's guess is correct, only one CONVERT call is needed. */ +static time_t +__mktime_internal (tp, convert, offset) + struct tm *tp; + struct tm *(*convert) __P ((const time_t *, struct tm *)); + time_t *offset; +{ + time_t t, dt, t0; + struct tm tm; + + /* The maximum number of probes (calls to CONVERT) should be enough + to handle any combinations of time zone rule changes, solar time, + and leap seconds. Posix.1 prohibits leap seconds, but some hosts + have them anyway. */ + int remaining_probes = 4; + + /* Time requested. Copy it in case CONVERT modifies *TP; this can + occur if TP is localtime's returned value and CONVERT is localtime. */ + int sec = tp->tm_sec; + int min = tp->tm_min; + int hour = tp->tm_hour; + int mday = tp->tm_mday; + int mon = tp->tm_mon; + int year_requested = tp->tm_year; + int isdst = tp->tm_isdst; + + /* Ensure that mon is in range, and set year accordingly. */ + int mon_remainder = mon % 12; + int negative_mon_remainder = mon_remainder < 0; + int mon_years = mon / 12 - negative_mon_remainder; + int year = year_requested + mon_years; + + /* The other values need not be in range: + the remaining code handles minor overflows correctly, + assuming int and time_t arithmetic wraps around. + Major overflows are caught at the end. */ + + /* Calculate day of year from year, month, and day of month. + The result need not be in range. */ + int yday = ((__mon_yday[__isleap (year + TM_YEAR_BASE)] + [mon_remainder + 12 * negative_mon_remainder]) + + mday - 1); + +#if LEAP_SECONDS_POSSIBLE + /* Handle out-of-range seconds specially, + since ydhms_tm_diff assumes every minute has 60 seconds. */ + int sec_requested = sec; + if (sec < 0) + sec = 0; + if (59 < sec) + sec = 59; +#endif + + /* Invert CONVERT by probing. First assume the same offset as last time. + Then repeatedly use the error to improve the guess. */ + + tm.tm_year = EPOCH_YEAR - TM_YEAR_BASE; + tm.tm_yday = tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + t0 = ydhms_tm_diff (year, yday, hour, min, sec, &tm); + + for (t = t0 + *offset; + (dt = ydhms_tm_diff (year, yday, hour, min, sec, (*convert) (&t, &tm))); + t += dt) + if (--remaining_probes == 0) + return -1; + + /* Check whether tm.tm_isdst has the requested value, if any. */ + if (0 <= isdst && 0 <= tm.tm_isdst) + { + int dst_diff = (isdst != 0) - (tm.tm_isdst != 0); + if (dst_diff) + { + /* Move two hours in the direction indicated by the disagreement, + probe some more, and switch to a new time if found. + The largest known fallback due to daylight savings is two hours: + once, in Newfoundland, 1988-10-30 02:00 -> 00:00. */ + time_t ot = t - 2 * 60 * 60 * dst_diff; + while (--remaining_probes != 0) + { + struct tm otm; + if (! (dt = ydhms_tm_diff (year, yday, hour, min, sec, + (*convert) (&ot, &otm)))) + { + t = ot; + tm = otm; + break; + } + if ((ot += dt) == t) + break; /* Avoid a redundant probe. */ + } + } + } + + *offset = t - t0; + +#if LEAP_SECONDS_POSSIBLE + if (sec_requested != tm.tm_sec) + { + /* Adjust time to reflect the tm_sec requested, not the normalized value. + Also, repair any damage from a false match due to a leap second. */ + t += sec_requested - sec + (sec == 0 && tm.tm_sec == 60); + (*convert) (&t, &tm); + } +#endif + + if (TIME_T_MAX / INT_MAX / 366 / 24 / 60 / 60 < 3) + { + /* time_t isn't large enough to rule out overflows in ydhms_tm_diff, + so check for major overflows. A gross check suffices, + since if t has overflowed, it is off by a multiple of + TIME_T_MAX - TIME_T_MIN + 1. So ignore any component of + the difference that is bounded by a small value. */ + + double dyear = (double) year_requested + mon_years - tm.tm_year; + double dday = 366 * dyear + mday; + double dsec = 60 * (60 * (24 * dday + hour) + min) + sec_requested; + + if (TIME_T_MAX / 3 - TIME_T_MIN / 3 < (dsec < 0 ? - dsec : dsec)) + return -1; + } + + *tp = tm; + return t; +} + +#ifdef weak_alias +weak_alias (mktime, timelocal) +#endif + +#if DEBUG + +static int +not_equal_tm (a, b) + struct tm *a; + struct tm *b; +{ + return ((a->tm_sec ^ b->tm_sec) + | (a->tm_min ^ b->tm_min) + | (a->tm_hour ^ b->tm_hour) + | (a->tm_mday ^ b->tm_mday) + | (a->tm_mon ^ b->tm_mon) + | (a->tm_year ^ b->tm_year) + | (a->tm_mday ^ b->tm_mday) + | (a->tm_yday ^ b->tm_yday) + | (a->tm_isdst ^ b->tm_isdst)); +} + +static void +print_tm (tp) + struct tm *tp; +{ + printf ("%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d", + tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday, + tp->tm_hour, tp->tm_min, tp->tm_sec, + tp->tm_yday, tp->tm_wday, tp->tm_isdst); +} + +static int +check_result (tk, tmk, tl, tml) + time_t tk; + struct tm tmk; + time_t tl; + struct tm tml; +{ + if (tk != tl || not_equal_tm (&tmk, &tml)) + { + printf ("mktime ("); + print_tm (&tmk); + printf (")\nyields ("); + print_tm (&tml); + printf (") == %ld, should be %ld\n", (long) tl, (long) tk); + return 1; + } + + return 0; +} + +int +main (argc, argv) + int argc; + char **argv; +{ + int status = 0; + struct tm tm, tmk, tml; + time_t tk, tl; + char trailer; + + if ((argc == 3 || argc == 4) + && (sscanf (argv[1], "%d-%d-%d%c", + &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer) + == 3) + && (sscanf (argv[2], "%d:%d:%d%c", + &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer) + == 3)) + { + tm.tm_year -= TM_YEAR_BASE; + tm.tm_mon--; + tm.tm_isdst = argc == 3 ? -1 : atoi (argv[3]); + tmk = tm; + tl = mktime (&tmk); + tml = *localtime (&tl); + printf ("mktime returns %ld == ", (long) tl); + print_tm (&tmk); + printf ("\n"); + status = check_result (tl, tmk, tl, tml); + } + else if (argc == 4 || (argc == 5 && strcmp (argv[4], "-") == 0)) + { + time_t from = atol (argv[1]); + time_t by = atol (argv[2]); + time_t to = atol (argv[3]); + + if (argc == 4) + for (tl = from; tl <= to; tl += by) + { + tml = *localtime (&tl); + tmk = tml; + tk = mktime (&tmk); + status |= check_result (tk, tmk, tl, tml); + } + else + for (tl = from; tl <= to; tl += by) + { + /* Null benchmark. */ + tml = *localtime (&tl); + tmk = tml; + tk = tl; + status |= check_result (tk, tmk, tl, tml); + } + } + else + printf ("Usage:\ +\t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n\ +\t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n\ +\t%s FROM BY TO - # Do not test those values (for benchmark).\n", + argv[0], argv[0], argv[0]); + + return status; +} + +#endif /* DEBUG */ + +/* +Local Variables: +compile-command: "gcc -DDEBUG=1 -Wall -O -g mktime.c -o mktime" +End: +*/ diff --git a/rpm-5.4.9/misc/myrealloc.c b/rpm-5.4.9/misc/myrealloc.c new file mode 100644 index 0000000..1b93c17 --- /dev/null +++ b/rpm-5.4.9/misc/myrealloc.c @@ -0,0 +1,8 @@ +#include "system.h" + +void *myrealloc(void *ptr, size_t size) { +if (ptr == NULL) + return malloc(size); + else + return realloc(ptr, size); +} diff --git a/rpm-5.4.9/misc/putenv.c b/rpm-5.4.9/misc/putenv.c new file mode 100644 index 0000000..c13e03c --- /dev/null +++ b/rpm-5.4.9/misc/putenv.c @@ -0,0 +1,113 @@ +/* Copyright (C) 1991, 1994 Free Software Foundation, Inc. + + +NOTE: The canonical source of this file is maintained with the GNU C Library. +Bugs can be reported to bug-glibc@prep.ai.mit.edu. + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include + +#ifdef HAVE_CONFIG_H +# include +#endif + +/* Define-away any (possibly conflicting) prototype of putenv. + Many systems omit the `const' attribute on the argument. */ +#define putenv _sys_putenv + +#if defined (__GNU_LIBRARY__) || defined (HAVE_STDLIB_H) +# include +#endif +#if defined (__GNU_LIBRARY__) || defined (HAVE_STRING_H) +# include +#endif +#if defined (__GNU_LIBRARY__) || defined (HAVE_UNISTD_H) +# include +#endif + +#undef putenv + +#if !defined (__GNU_LIBRARY__) && !defined (HAVE_STRCHR) +# define strchr index +#endif +#if !defined (__GNU_LIBRARY__) && !defined (HAVE_MEMCPY) +# define memcpy(d,s,n) bcopy ((s), (d), (n)) +#endif + +#if HAVE_GNU_LD +# define environ __environ +#elif defined (__APPLE__) +# include +# define environ (*_NSGetEnviron()) +#else +extern char **environ; +#endif + + +/* Put STRING, which is of the form "NAME=VALUE", in the environment. */ +int +putenv (string) + const char *string; +{ + const char *const name_end = strchr (string, '='); + register size_t size; + register char **ep; + + if (name_end == NULL) + { + /* Remove the variable from the environment. */ + size = strlen (string); + for (ep = environ; *ep != NULL; ++ep) + if (!strncmp (*ep, string, size) && (*ep)[size] == '=') + { + while (ep[1] != NULL) + { + ep[0] = ep[1]; + ++ep; + } + *ep = NULL; + return 0; + } + } + + size = 0; + for (ep = environ; *ep != NULL; ++ep) + if (!strncmp (*ep, string, name_end - string) && + (*ep)[name_end - string] == '=') + break; + else + ++size; + + if (*ep == NULL) + { + static char **last_environ = NULL; + char **new_environ = (char **) malloc ((size + 2) * sizeof (char *)); + if (new_environ == NULL) + return -1; + (void) memcpy ((void *) new_environ, (void *) environ, + size * sizeof (char *)); + new_environ[size] = (char *) string; + new_environ[size + 1] = NULL; + if (last_environ != NULL) + free ((void *) last_environ); + last_environ = new_environ; + environ = new_environ; + } + else + *ep = (char *) string; + + return 0; +} diff --git a/rpm-5.4.9/misc/realpath.c b/rpm-5.4.9/misc/realpath.c new file mode 100644 index 0000000..93cc830 --- /dev/null +++ b/rpm-5.4.9/misc/realpath.c @@ -0,0 +1,147 @@ +/* + * realpath.c -- canonicalize pathname by removing symlinks + * Copyright (C) 1993 Rick Sladkey + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library Public License for more details. + */ + +#include "system.h" + +#ifndef STDC_HEADERS +extern int errno; +#endif + +#ifndef PATH_MAX +#ifdef _POSIX_VERSION +#define PATH_MAX _POSIX_PATH_MAX +#else +#ifdef MAXPATHLEN +#define PATH_MAX MAXPATHLEN +#else +#define PATH_MAX 1024 +#endif +#endif +#endif + +#define MAX_READLINKS 32 + +#ifdef __STDC__ +char *realpath(const char *path, char resolved_path []) +#else +char *realpath(path, resolved_path) +const char *path; +char resolved_path []; +#endif +{ + char copy_path[PATH_MAX]; + char link_path[PATH_MAX]; + char *new_path = resolved_path; + char *max_path; + int readlinks = 0; + int n; + + /* Make a copy of the source path since we may need to modify it. */ + strcpy(copy_path, path); + path = copy_path; + max_path = copy_path + PATH_MAX - 2; + /* If it's a relative pathname use getwd for starters. */ + if (*path != '/') { +#ifdef HAVE_GETCWD + getcwd(new_path, PATH_MAX - 1); +#else + getwd(new_path); +#endif + new_path += strlen(new_path); + if (new_path[-1] != '/') + *new_path++ = '/'; + } + else { + *new_path++ = '/'; + path++; + } + /* Expand each slash-separated pathname component. */ + while (*path != '\0') { + /* Ignore stray "/". */ + if (*path == '/') { + path++; + continue; + } + if (*path == '.') { + /* Ignore ".". */ + if (path[1] == '\0' || path[1] == '/') { + path++; + continue; + } + if (path[1] == '.') { + if (path[2] == '\0' || path[2] == '/') { + path += 2; + /* Ignore ".." at root. */ + if (new_path == resolved_path + 1) + continue; + /* Handle ".." by backing up. */ + while ((--new_path)[-1] != '/') + ; + continue; + } + } + } + /* Safely copy the next pathname component. */ + while (*path != '\0' && *path != '/') { + if (path > max_path) { + errno = ENAMETOOLONG; + return NULL; + } + *new_path++ = *path++; + } +#ifdef S_IFLNK + /* Protect against infinite loops. */ + if (readlinks++ > MAX_READLINKS) { + errno = ELOOP; + return NULL; + } + /* See if latest pathname component is a symlink. */ + *new_path = '\0'; + n = readlink(resolved_path, link_path, PATH_MAX - 1); + if (n < 0) { + /* EINVAL means the file exists but isn't a symlink. */ + if (errno != EINVAL) + return NULL; + } + else { + /* Note: readlink doesn't add the null byte. */ + link_path[n] = '\0'; + if (*link_path == '/') + /* Start over for an absolute symlink. */ + new_path = resolved_path; + else + /* Otherwise back up over this component. */ + while (*(--new_path) != '/') + ; + /* Safe sex check. */ + if (strlen(path) + n >= PATH_MAX) { + errno = ENAMETOOLONG; + return NULL; + } + /* Insert symlink contents into path. */ + strcat(link_path, path); + strcpy(copy_path, link_path); + path = copy_path; + } +#endif /* S_IFLNK */ + *new_path++ = '/'; + } + /* Delete trailing slash but don't whomp a lone slash. */ + if (new_path != resolved_path + 1 && new_path[-1] == '/') + new_path--; + /* Make sure it's null terminated. */ + *new_path = '\0'; + return resolved_path; +} diff --git a/rpm-5.4.9/misc/setenv.c b/rpm-5.4.9/misc/setenv.c new file mode 100644 index 0000000..2d63eeb --- /dev/null +++ b/rpm-5.4.9/misc/setenv.c @@ -0,0 +1,317 @@ +/* Copyright (C) 1992, 95, 96, 97, 98, 99 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C 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. + + The GNU C 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 the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +# include "system.h" + +#include +#if !_LIBC +# if !defined errno && !defined HAVE_ERRNO_DECL +extern int errno; +# endif +# define __set_errno(ev) ((errno) = (ev)) +#endif + +#if _LIBC || defined(HAVE_STDLIB_H) +# include +#endif +#if _LIBC || defined(HAVE_STRING_H) +# include +#endif +#if _LIBC || defined(HAVE_UNISTD_H) +# include +#endif + +#if !_LIBC +# define __environ environ +# ifndef HAVE_ENVIRON_DECL +extern char **environ; +# endif +#endif + +#if _LIBC +/* This lock protects against simultaneous modifications of `environ'. */ +# include +__libc_lock_define_initialized (static, envlock) +# define LOCK __libc_lock_lock (envlock) +# define UNLOCK __libc_lock_unlock (envlock) +#else +# define LOCK +# define UNLOCK +#endif + +/* In the GNU C library we must keep the namespace clean. */ +#ifdef _LIBC +# define setenv __setenv +# define unsetenv __unsetenv +# define clearenv __clearenv +# define tfind __tfind +# define tsearch __tsearch +#endif + +/* In the GNU C library implementation we try to be more clever and + allow arbitrarily many changes of the environment given that the used + values are from a small set. Outside glibc this will eat up all + memory after a while. */ +#if defined _LIBC || (defined HAVE_SEARCH_H && defined HAVE_TSEARCH \ + && defined __GNUC__) +# define USE_TSEARCH 1 +# include + +/* This is a pointer to the root of the search tree with the known + values. */ +static void *known_values; + +# define KNOWN_VALUE(Str) \ + ({ \ + void *value = tfind (Str, &known_values, (__compar_fn_t) strcmp); \ + value != NULL ? *(char **) value : NULL; \ + }) +# define STORE_VALUE(Str) \ + tsearch (Str, &known_values, (__compar_fn_t) strcmp) + +#else +# undef USE_TSEARCH + +# define KNOWN_VALUE(Str) NULL +# define STORE_VALUE(Str) do { } while (0) + +#endif + + +/* If this variable is not a null pointer we allocated the current + environment. */ +static char **last_environ; + + +/* This function is used by `setenv' and `putenv'. The difference between + the two functions is that for the former must create a new string which + is then placed in the environment, while the argument of `putenv' + must be used directly. This is all complicated by the fact that we try + to reuse values once generated for a `setenv' call since we can never + free the strings. */ +static int +__add_to_environ (const char *name, const char *value, const char *combined, + int replace) +{ + register char **ep; + register size_t size; + const size_t namelen = strlen (name); + const size_t vallen = value != NULL ? strlen (value) + 1 : 0; + + LOCK; + + /* We have to get the pointer now that we have the lock and not earlier + since another thread might have created a new environment. */ + ep = __environ; + + size = 0; + if (ep != NULL) + { + for (; *ep != NULL; ++ep) + if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=') + break; + else + ++size; + } + + if (ep == NULL || *ep == NULL) + { + char **new_environ; +#ifdef USE_TSEARCH + char *new_value; +#endif + + /* We allocated this space; we can extend it. */ + new_environ = (char **) realloc (last_environ, + (size + 2) * sizeof (char *)); + if (new_environ == NULL) + { + UNLOCK; + return -1; + } + + /* If the whole entry is given add it. */ + if (combined != NULL) + /* We must not add the string to the search tree since it belongs + to the user. */ + new_environ[size] = (char *) combined; + else + { + /* See whether the value is already known. */ +#ifdef USE_TSEARCH + new_value = (char *) alloca (namelen + 1 + vallen); +# ifdef _LIBC + __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1), + value, vallen); +# else + memcpy (new_value, name, namelen); + new_value[namelen] = '='; + memcpy (&new_value[namelen + 1], value, vallen); +# endif + + new_environ[size] = KNOWN_VALUE (new_value); + if (new_environ[size] == NULL) +#endif + { + new_environ[size] = (char *) malloc (namelen + 1 + vallen); + if (new_environ[size] == NULL) + { + __set_errno (ENOMEM); + UNLOCK; + return -1; + } + +#ifdef USE_TSEARCH + memcpy (new_environ[size], new_value, namelen + 1 + vallen); +#else + memcpy (new_environ[size], name, namelen); + new_environ[size][namelen] = '='; + memcpy (&new_environ[size][namelen + 1], value, vallen); +#endif + /* And save the value now. We cannot do this when we remove + the string since then we cannot decide whether it is a + user string or not. */ + STORE_VALUE (new_environ[size]); + } + } + + if (__environ != last_environ) + memcpy ((char *) new_environ, (char *) __environ, + size * sizeof (char *)); + + new_environ[size + 1] = NULL; + + last_environ = __environ = new_environ; + } + else if (replace) + { + char *np; + + /* Use the user string if given. */ + if (combined != NULL) + np = (char *) combined; + else + { +#ifdef USE_TSEARCH + char *new_value = alloca (namelen + 1 + vallen); +# ifdef _LIBC + __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1), + value, vallen); +# else + memcpy (new_value, name, namelen); + new_value[namelen] = '='; + memcpy (&new_value[namelen + 1], value, vallen); +# endif + + np = KNOWN_VALUE (new_value); + if (np == NULL) +#endif + { + np = malloc (namelen + 1 + vallen); + if (np == NULL) + { + UNLOCK; + return -1; + } + +#ifdef USE_TSEARCH + memcpy (np, new_value, namelen + 1 + vallen); +#else + memcpy (np, name, namelen); + np[namelen] = '='; + memcpy (&np[namelen + 1], value, vallen); +#endif + /* And remember the value. */ + STORE_VALUE (np); + } + } + + *ep = np; + } + + UNLOCK; + + return 0; +} + +int +setenv (name, value, replace) + const char *name; + const char *value; + int replace; +{ + return __add_to_environ (name, value, NULL, replace); +} + +void +unsetenv (name) + const char *name; +{ + const size_t len = strlen (name); + char **ep; + + LOCK; + + ep = __environ; + while (*ep != NULL) + if (!strncmp (*ep, name, len) && (*ep)[len] == '=') + { + /* Found it. Remove this pointer by moving later ones back. */ + char **dp = ep; + + do + dp[0] = dp[1]; + while (*dp++); + /* Continue the loop in case NAME appears again. */ + } + else + ++ep; + + UNLOCK; +} + +/* The `clearenv' was planned to be added to POSIX.1 but probably + never made it. Nevertheless the POSIX.9 standard (POSIX bindings + for Fortran 77) requires this function. */ +int +clearenv (void) +{ + LOCK; + + if (__environ == last_environ && __environ != NULL) + { + /* We allocated this environment so we can free it. */ + free (__environ); + last_environ = NULL; + } + + /* Clear the environment pointer removes the whole environment. */ + __environ = NULL; + + UNLOCK; + + return 0; +} +#ifdef _LIBC +# undef setenv +# undef unsetenv +# undef clearenv +weak_alias (__setenv, setenv) +weak_alias (__unsetenv, unsetenv) +weak_alias (__clearenv, clearenv) +#endif diff --git a/rpm-5.4.9/misc/setproctitle.c b/rpm-5.4.9/misc/setproctitle.c new file mode 100644 index 0000000..b13bcb6 --- /dev/null +++ b/rpm-5.4.9/misc/setproctitle.c @@ -0,0 +1,193 @@ + +/* + Copyright (C) 2004-2006 Dmitry V. Levin + + The setproctitle library interface. + + 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 St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "system.h" +#include + +#ifdef HAVE_SYS_PRCTL_H +#include +#endif + +#if !defined(HAVE_SETPROCTITLE) + +static size_t title_buffer_size = 0; +static char *title_buffer = 0; +static char *title_progname; +static char *title_progname_full; + +int +setproctitle(const char *fmt, ...) +{ + if (!title_buffer || !title_buffer_size) + { + errno = ENOMEM; + return -1; + } + + memset(title_buffer, '\0', title_buffer_size); + + ssize_t written; + + if (fmt) + { + ssize_t written2; + va_list ap; + + written = + snprintf(title_buffer, title_buffer_size, "%s: ", + title_progname); + if (written < 0 || (size_t) written >= title_buffer_size) + return -1; + + va_start(ap, fmt); + written2 = + vsnprintf(title_buffer + written, + title_buffer_size - written, fmt, ap); + va_end(ap); + if (written2 < 0 + || (size_t) written2 >= title_buffer_size - written) + return -1; + } else + { + written = + snprintf(title_buffer, title_buffer_size, "%s", + title_progname); + if (written < 0 || (size_t) written >= title_buffer_size) + return -1; + } + + written = strlen(title_buffer); + memset(title_buffer + written, '\0', title_buffer_size - written); +#if defined(__linux__) + { char procname[16+1]; + const char * s; + if ((s = strchr(title_buffer, ' ')) != NULL) + s++; + else + s = title_buffer; + strncpy(procname, s, sizeof(procname)); + procname[sizeof(procname)-1] = '\0'; +#if !defined(PR_SET_NAME) +#define PR_SET_NAME 15 +#endif + (void)prctl(PR_SET_NAME, procname, 0UL, 0UL, 0UL); + } +#endif + + return 0; +} + +/* + * Rename to _init/_fini for automagic ELF weak symbol library symbol override. + * Note: __attribute__((constructor)) on _init function is + * called without arguments. + */ + +int +finiproctitle(void) +{ +/* XXX limit the fiddle up to linux for now. */ +#if defined(__linux__) + if (title_buffer != NULL) { + char ** envp; + for (envp = environ; *envp != NULL; envp++) { + free(*envp); + *envp = NULL; + } + free(environ); + environ = NULL; + free(title_progname_full); + title_progname_full = NULL; + } +#endif + return 0; +} + +int +initproctitle(int argc, char *argv[], char *envp[]) +{ + +/* XXX limit the fiddle up to linux for now. */ +#if defined(__linux__) + char *begin_of_buffer = 0, *end_of_buffer = 0; + int i; + + for (i = 0; i < argc; ++i) + { + if (!begin_of_buffer) + begin_of_buffer = argv[i]; + if (!end_of_buffer || end_of_buffer + 1 == argv[i]) + end_of_buffer = argv[i] + strlen(argv[i]); + } + + for (i = 0; envp[i]; ++i) + { + if (!begin_of_buffer) + begin_of_buffer = envp[i]; + if (!end_of_buffer || end_of_buffer + 1 == envp[i]) + end_of_buffer = envp[i] + strlen(envp[i]); + } + + if (!end_of_buffer) + return 0; + + char **new_environ = (char **) malloc((i + 1) * sizeof(envp[0])); + + if (!new_environ) + return 0; + + for (i = 0; envp[i]; ++i) + if (!(new_environ[i] = strdup(envp[i]))) + goto cleanup_enomem; + new_environ[i] = 0; + + if (program_invocation_name) + { + title_progname_full = strdup(program_invocation_name); + + if (!title_progname_full) + goto cleanup_enomem; + + char *p = strrchr(title_progname_full, '/'); + + if (p) + title_progname = p + 1; + else + title_progname = title_progname_full; + + program_invocation_name = title_progname_full; + program_invocation_short_name = title_progname; + } + + environ = new_environ; + title_buffer = begin_of_buffer; + title_buffer_size = end_of_buffer - begin_of_buffer; + + return 0; + + cleanup_enomem: + for (--i; i >= 0; --i) + free(new_environ[i]); + free(new_environ); +#endif /* defined(__linux__) */ + return 0; +} +#endif /* !defined(HAVE_SETPROCTITLE) */ diff --git a/rpm-5.4.9/misc/stpcpy.c b/rpm-5.4.9/misc/stpcpy.c new file mode 100644 index 0000000..0ad8863 --- /dev/null +++ b/rpm-5.4.9/misc/stpcpy.c @@ -0,0 +1,51 @@ +/* Copyright (C) 1992, 1995, 1997 Free Software Foundation, Inc. + + NOTE: The canonical source of this file is maintained with the GNU C Library. + Bugs can be reported to bug-glibc@prep.ai.mit.edu. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#undef __stpcpy +#undef stpcpy + +#ifndef weak_alias +# define __stpcpy stpcpy +#endif + +/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ +char * +__stpcpy (dest, src) + char *dest; + const char *src; +{ + register char *d = dest; + register const char *s = src; + + do + *d++ = *s; + while (*s++ != '\0'); + + return d - 1; +} +#ifdef weak_alias +weak_alias (__stpcpy, stpcpy) +#endif diff --git a/rpm-5.4.9/misc/stpncpy.c b/rpm-5.4.9/misc/stpncpy.c new file mode 100644 index 0000000..fcbdfe5 --- /dev/null +++ b/rpm-5.4.9/misc/stpncpy.c @@ -0,0 +1,101 @@ +/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc. + + NOTE: The canonical source of this file is maintained with the GNU C Library. + Bugs can be reported to bug-glibc@prep.ai.mit.edu. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +/* This is almost copied from strncpy.c, written by Torbjorn Granlund. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifdef _LIBC +# include +#else +# include +#endif + +#ifndef weak_alias +# define __stpncpy stpncpy +#endif + +/* Copy no more than N characters of SRC to DEST, returning the address of + the terminating '\0' in DEST, if any, or else DEST + N. */ +char * +__stpncpy (dest, src, n) + char *dest; + const char *src; + size_t n; +{ + char c; + char *s = dest; + + if (n >= 4) + { + size_t n4 = n >> 2; + + for (;;) + { + c = *src++; + *dest++ = c; + if (c == '\0') + break; + c = *src++; + *dest++ = c; + if (c == '\0') + break; + c = *src++; + *dest++ = c; + if (c == '\0') + break; + c = *src++; + *dest++ = c; + if (c == '\0') + break; + if (--n4 == 0) + goto last_chars; + } + n -= dest - s; + goto zero_fill; + } + + last_chars: + n &= 3; + if (n == 0) + return dest; + + for (;;) + { + c = *src++; + --n; + *dest++ = c; + if (c == '\0') + break; + if (n == 0) + return dest; + } + + zero_fill: + while (n-- > 0) + dest[n] = '\0'; + + return dest - 1; +} +#ifdef weak_alias +weak_alias (__stpncpy, stpncpy) +#endif diff --git a/rpm-5.4.9/misc/strcspn.c b/rpm-5.4.9/misc/strcspn.c new file mode 100644 index 0000000..58ec659 --- /dev/null +++ b/rpm-5.4.9/misc/strcspn.c @@ -0,0 +1,52 @@ +/* Copyright (C) 1991, 1994, 1996, 1997 Free Software Foundation, Inc. + + NOTE: The canonical source of this file is maintained with the GNU C Library. + Bugs can be reported to bug-glibc@prep.ai.mit.edu. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#if defined _LIBC || defined HAVE_STRING_H +# include +#else +# include +# ifndef strchr +# define strchr index +# endif +#endif + +#undef strcspn + +/* Return the length of the maximum initial segment of S + which contains no characters from REJECT. */ +size_t +strcspn (s, reject) + const char *s; + const char *reject; +{ + size_t count = 0; + + while (*s != '\0') + if (strchr (reject, *s++) == NULL) + ++count; + else + return count; + + return count; +} diff --git a/rpm-5.4.9/misc/strdup.c b/rpm-5.4.9/misc/strdup.c new file mode 100644 index 0000000..7b73a50 --- /dev/null +++ b/rpm-5.4.9/misc/strdup.c @@ -0,0 +1,43 @@ +/* strdup.c -- return a newly allocated copy of a string + Copyright (C) 1990 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifdef STDC_HEADERS +#include +#include +#else +char *malloc (); +char *strcpy (); +#endif + +/* Return a newly allocated copy of STR, + or 0 if out of memory. */ + +char * +strdup (str) + const char *str; +{ + char *newstr; + + newstr = (char *) malloc (strlen (str) + 1); + if (newstr) + strcpy (newstr, str); + return newstr; +} diff --git a/rpm-5.4.9/misc/strerror.c b/rpm-5.4.9/misc/strerror.c new file mode 100644 index 0000000..3928923 --- /dev/null +++ b/rpm-5.4.9/misc/strerror.c @@ -0,0 +1,21 @@ +#include "system.h" + +extern int sys_nerr; +extern char *sys_errlist[]; +static char buf[64]; + +char * +strerror(int errnum) +{ + if (errnum < 0 || errnum > sys_nerr) + { + static char fmt[] = "Unknown error %d"; + size_t len = (size_t) sprintf (buf, fmt, errnum); + if (len < (size_t) sizeof(fmt) - 2) + return NULL; + buf[len - 1] = '\0'; + return buf; + } + + return (char *) sys_errlist[errnum]; +} diff --git a/rpm-5.4.9/misc/strftime.c b/rpm-5.4.9/misc/strftime.c new file mode 100644 index 0000000..7996c7c --- /dev/null +++ b/rpm-5.4.9/misc/strftime.c @@ -0,0 +1,1054 @@ +/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc. + + NOTE: The canonical source of this file is maintained with the GNU C + Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifdef _LIBC +# define HAVE_LIMITS_H 1 +# define HAVE_MBLEN 1 +# define HAVE_MBRLEN 1 +# define HAVE_STRUCT_ERA_ENTRY 1 +# define HAVE_TM_GMTOFF 1 +# define HAVE_TM_ZONE 1 +# define HAVE_TZNAME 1 +# define HAVE_TZSET 1 +# define MULTIBYTE_IS_FORMAT_SAFE 1 +# define STDC_HEADERS 1 +# include +# include "../locale/localeinfo.h" +#endif + +#include +#include /* Some systems define `time_t' here. */ + +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else +# ifdef HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif +#ifdef HAVE_TZNAME +extern char *tzname[]; +#endif + +/* Do multibyte processing if multibytes are supported, unless + multibyte sequences are safe in formats. Multibyte sequences are + safe if they cannot contain byte sequences that look like format + conversion specifications. The GNU C Library uses UTF8 multibyte + encoding, which is safe for formats, but strftime.c can be used + with other C libraries that use unsafe encodings. */ +#define DO_MULTIBYTE (defined(HAVE_MBLEN) && ! defined(MULTIBYTE_IS_FORMAT_SAFE)) + +#if DO_MULTIBYTE +# ifdef HAVE_MBRLEN +# include +# else + /* Simulate mbrlen with mblen as best we can. */ +# define mbstate_t int +# define mbrlen(s, n, ps) mblen (s, n) +# define mbsinit(ps) (*(ps) == 0) +# endif + static const mbstate_t mbstate_zero; +#endif + +#if defined(HAVE_LIMITS_H) +# include +#endif + +#if STDC_HEADERS +# include +# include +# include +#else +# define memcpy(d, s, n) bcopy ((s), (d), (n)) +#endif + +#ifndef __P +# if defined (__GNUC__) || (defined (__STDC__) && __STDC__) +# define __P(args) args +# else +# define __P(args) () +# endif /* GCC. */ +#endif /* Not __P. */ + +#ifndef PTR +# ifdef __STDC__ +# define PTR void * +# else +# define PTR char * +# endif +#endif + +#ifndef CHAR_BIT +# define CHAR_BIT 8 +#endif + +#ifndef NULL +# define NULL 0 +#endif + +#define TYPE_SIGNED(t) ((t) -1 < 0) + +/* Bound on length of the string representing an integer value of type t. + Subtract one for the sign bit if t is signed; + 302 / 1000 is log10 (2) rounded up; + add one for integer division truncation; + add one more for a minus sign if t is signed. */ +#define INT_STRLEN_BOUND(t) \ + ((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 100 + 1 + TYPE_SIGNED (t)) + +#define TM_YEAR_BASE 1900 + +#ifndef __isleap +/* Nonzero if YEAR is a leap year (every 4 years, + except every 100th isn't, and every 400th is). */ +# define __isleap(year) \ + ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) +#endif + + +#ifdef _LIBC +# define gmtime_r __gmtime_r +# define localtime_r __localtime_r +extern int __tz_compute __P ((time_t timer, const struct tm *tm)); +# define tzname __tzname +# define tzset __tzset +#else +# if ! defined(HAVE_LOCALTIME_R) +# if ! defined(HAVE_TM_GMTOFF) +/* Approximate gmtime_r as best we can in its absence. */ +# define gmtime_r my_gmtime_r +static struct tm *gmtime_r __P ((const time_t *, struct tm *)); +static struct tm * +gmtime_r (t, tp) + const time_t *t; + struct tm *tp; +{ + struct tm *l = gmtime (t); + if (! l) + return 0; + *tp = *l; + return tp; +} +# endif /* ! HAVE_TM_GMTOFF */ + +/* Approximate localtime_r as best we can in its absence. */ +# define localtime_r my_localtime_r +static struct tm *localtime_r __P ((const time_t *, struct tm *)); +static struct tm * +localtime_r (t, tp) + const time_t *t; + struct tm *tp; +{ + struct tm *l = localtime (t); + if (! l) + return 0; + *tp = *l; + return tp; +} +# endif /* ! HAVE_LOCALTIME_R */ +#endif /* ! defined (_LIBC) */ + + +#if !defined (memset) && !defined (HAVE_MEMSET) && !defined (_LIBC) +/* Some systems lack the `memset' function and we don't want to + introduce additional dependencies. */ +static const char spaces[16] = " "; + +# define memset_space(P, Len) \ + do { \ + int _len = (Len); \ + \ + do \ + { \ + int _this = _len > 16 ? 16 : _len; \ + memcpy ((P), spaces, _this); \ + (P) += _this; \ + _len -= _this; \ + } \ + while (_len > 0); \ + } while (0) +#else +# define memset_space(P, Len) memset ((P), ' ', (Len)) +#endif + +#define add(n, f) \ + do \ + { \ + int _n = (n); \ + int _delta = width - _n; \ + int _incr = _n + (_delta > 0 ? _delta : 0); \ + if (i + _incr >= maxsize) \ + return 0; \ + if (p) \ + { \ + if (_delta > 0) \ + memset_space (p, _delta); \ + f; \ + p += _n; \ + } \ + i += _incr; \ + } while (0) + +#define cpy(n, s) \ + add ((n), \ + if (to_lowcase) \ + memcpy_lowcase (p, (s), _n); \ + else if (to_uppcase) \ + memcpy_uppcase (p, (s), _n); \ + else \ + memcpy ((PTR) p, (PTR) (s), _n)) + + + +#ifdef _LIBC +# define TOUPPER(Ch) toupper (Ch) +# define TOLOWER(Ch) tolower (Ch) +#else +# define TOUPPER(Ch) (islower (Ch) ? toupper (Ch) : (Ch)) +# define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) +#endif +/* We don't use `isdigit' here since the locale dependent + interpretation is not what we want here. We only need to accept + the arabic digits in the ASCII range. One day there is perhaps a + more reliable way to accept other sets of digits. */ +#define ISDIGIT(Ch) ((unsigned int) (Ch) - '0' <= 9) + +static char *memcpy_lowcase __P ((char *dest, const char *src, size_t len)); + +static char * +memcpy_lowcase (dest, src, len) + char *dest; + const char *src; + size_t len; +{ + while (len-- > 0) + dest[len] = TOLOWER (src[len]); + return dest; +} + +static char *memcpy_uppcase __P ((char *dest, const char *src, size_t len)); + +static char * +memcpy_uppcase (dest, src, len) + char *dest; + const char *src; + size_t len; +{ + while (len-- > 0) + dest[len] = TOUPPER (src[len]); + return dest; +} + +#if ! HAVE_TM_GMTOFF +/* Yield the difference between *A and *B, + measured in seconds, ignoring leap seconds. */ +static int tm_diff __P ((const struct tm *, const struct tm *)); +static int +tm_diff (a, b) + const struct tm *a; + const struct tm *b; +{ + /* Compute intervening leap days correctly even if year is negative. + Take care to avoid int overflow in leap day calculations, + but it's OK to assume that A and B are close to each other. */ + int a4 = (a->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (a->tm_year & 3); + int b4 = (b->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (b->tm_year & 3); + int a100 = a4 / 25 - (a4 % 25 < 0); + int b100 = b4 / 25 - (b4 % 25 < 0); + int a400 = a100 >> 2; + int b400 = b100 >> 2; + int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400); + int years = a->tm_year - b->tm_year; + int days = (365 * years + intervening_leap_days + + (a->tm_yday - b->tm_yday)); + return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour)) + + (a->tm_min - b->tm_min)) + + (a->tm_sec - b->tm_sec)); +} +#endif /* ! HAVE_TM_GMTOFF */ + + + +/* The number of days from the first day of the first ISO week of this + year to the year day YDAY with week day WDAY. ISO weeks start on + Monday; the first ISO week has the year's first Thursday. YDAY may + be as small as YDAY_MINIMUM. */ +#define ISO_WEEK_START_WDAY 1 /* Monday */ +#define ISO_WEEK1_WDAY 4 /* Thursday */ +#define YDAY_MINIMUM (-366) +static int iso_week_days __P ((int, int)); +#ifdef __GNUC__ +inline +#endif +static int +iso_week_days (yday, wday) + int yday; + int wday; +{ + /* Add enough to the first operand of % to make it nonnegative. */ + int big_enough_multiple_of_7 = (-YDAY_MINIMUM / 7 + 2) * 7; + return (yday + - (yday - wday + ISO_WEEK1_WDAY + big_enough_multiple_of_7) % 7 + + ISO_WEEK1_WDAY - ISO_WEEK_START_WDAY); +} + + +#ifndef _NL_CURRENT +static char const weekday_name[][10] = + { + "Sunday", "Monday", "Tuesday", "Wednesday", + "Thursday", "Friday", "Saturday" + }; +static char const month_name[][10] = + { + "January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", "December" + }; +#endif + + +#if !defined _LIBC && defined(HAVE_TZNAME) && defined(HAVE_TZSET) + /* Solaris 2.5 tzset sometimes modifies the storage returned by localtime. + Work around this bug by copying *tp before it might be munged. */ + size_t _strftime_copytm __P ((char *, size_t, const char *, + const struct tm *)); + size_t + strftime (s, maxsize, format, tp) + char *s; + size_t maxsize; + const char *format; + const struct tm *tp; + { + struct tm tmcopy; + tmcopy = *tp; + return _strftime_copytm (s, maxsize, format, &tmcopy); + } +# ifdef strftime +# undef strftime +# endif +# define strftime _strftime_copytm +#endif + + + +/* Write information from TP into S according to the format + string FORMAT, writing no more that MAXSIZE characters + (including the terminating '\0') and returning number of + characters written. If S is NULL, nothing will be written + anywhere, so to determine how many characters would be + written, use NULL for S and (size_t) UINT_MAX for MAXSIZE. */ +size_t +strftime (s, maxsize, format, tp) + char *s; + size_t maxsize; + const char *format; + const struct tm *tp; +{ + int hour12 = tp->tm_hour; +#ifdef _NL_CURRENT + const char *const a_wkday = _NL_CURRENT (LC_TIME, ABDAY_1 + tp->tm_wday); + const char *const f_wkday = _NL_CURRENT (LC_TIME, DAY_1 + tp->tm_wday); + const char *const a_month = _NL_CURRENT (LC_TIME, ABMON_1 + tp->tm_mon); + const char *const f_month = _NL_CURRENT (LC_TIME, MON_1 + tp->tm_mon); + const char *const ampm = _NL_CURRENT (LC_TIME, + hour12 > 11 ? PM_STR : AM_STR); + size_t aw_len = strlen (a_wkday); + size_t am_len = strlen (a_month); + size_t ap_len = strlen (ampm); +#else + const char *const f_wkday = weekday_name[tp->tm_wday]; + const char *const f_month = month_name[tp->tm_mon]; + const char *const a_wkday = f_wkday; + const char *const a_month = f_month; + const char *const ampm = "AMPM" + 2 * (hour12 > 11); + size_t aw_len = 3; + size_t am_len = 3; + size_t ap_len = 2; +#endif + size_t wkday_len = strlen (f_wkday); + size_t month_len = strlen (f_month); + const char *zone; + size_t zonelen; + size_t i = 0; + char *p = s; + const char *f; + + zone = NULL; +#if !defined _LIBC && defined(HAVE_TM_ZONE) + /* XXX We have some problems here. First, the string pointed to by + tm_zone is dynamically allocated while loading the zone data. But + when another zone is loaded since the information in TP were + computed this would be a stale pointer. + The second problem is the POSIX test suite which assumes setting + the environment variable TZ to a new value before calling strftime() + will influence the result (the %Z format) even if the information in + TP is computed with a totally different time zone. --drepper@gnu */ + zone = (const char *) tp->tm_zone; +#endif +#if defined(HAVE_TZNAME) + /* POSIX.1 8.1.1 requires that whenever strftime() is called, the + time zone names contained in the external variable `tzname' shall + be set as if the tzset() function had been called. */ +# if defined(HAVE_TZSET) + tzset (); +# endif + + if (!(zone && *zone) && tp->tm_isdst >= 0) + zone = tzname[tp->tm_isdst]; +#endif + if (! zone) + zone = ""; /* POSIX.2 requires the empty string here. */ + + zonelen = strlen (zone); + + if (hour12 > 12) + hour12 -= 12; + else + if (hour12 == 0) hour12 = 12; + + for (f = format; *f != '\0'; ++f) + { + int pad; /* Padding for number ('-', '_', or 0). */ + int modifier; /* Field modifier ('E', 'O', or 0). */ + int digits; /* Max digits for numeric format. */ + int number_value; /* Numeric value to be printed. */ + int negative_number; /* 1 if the number is negative. */ + const char *subfmt; + char *bufp; + char buf[1 + (sizeof (int) < sizeof (time_t) + ? INT_STRLEN_BOUND (time_t) + : INT_STRLEN_BOUND (int))]; + int width = -1; + int to_lowcase = 0; + int to_uppcase = 0; + +#if DO_MULTIBYTE + + switch (*f) + { + case '%': + break; + + case '\a': case '\b': case '\t': case '\n': + case '\v': case '\f': case '\r': + case ' ': case '!': case '"': case '#': case '&': case'\'': + case '(': case ')': case '*': case '+': case ',': case '-': + case '.': case '/': case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': case '8': case '9': + case ':': case ';': case '<': case '=': case '>': case '?': + case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': + case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': + case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': + case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': + case 'Y': case 'Z': case '[': case'\\': case ']': case '^': + case '_': case 'a': case 'b': case 'c': case 'd': case 'e': + case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': + case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': + case 'r': case 's': case 't': case 'u': case 'v': case 'w': + case 'x': case 'y': case 'z': case '{': case '|': case '}': + case '~': + /* The C Standard requires these 98 characters (plus '%') to + be in the basic execution character set. None of these + characters can start a multibyte sequence, so they need + not be analyzed further. */ + add (1, *p = *f); + continue; + + default: + /* Copy this multibyte sequence until we reach its end, find + an error, or come back to the initial shift state. */ + { + mbstate_t mbstate = mbstate_zero; + size_t len = 0; + + do + { + size_t bytes = mbrlen (f + len, (size_t) -1, &mbstate); + + if (bytes == 0) + break; + + if (bytes == (size_t) -2 || bytes == (size_t) -1) + { + len++; + break; + } + + len += bytes; + } + while (! mbsinit (&mbstate)); + + cpy (len, f); + continue; + } + } + +#else /* ! DO_MULTIBYTE */ + + /* Either multibyte encodings are not supported, or they are + safe for formats, so any non-'%' byte can be copied through. */ + if (*f != '%') + { + add (1, *p = *f); + continue; + } + +#endif /* ! DO_MULTIBYTE */ + + /* Check for flags that can modify a format. */ + pad = 0; + while (1) + { + switch (*++f) + { + /* This influences the number formats. */ + case '_': + case '-': + case '0': + pad = *f; + continue; + + /* This changes textual output. */ + case '^': + to_uppcase = 1; + continue; + + default: + break; + } + break; + } + + /* As a GNU extension we allow to specify the field width. */ + if (ISDIGIT (*f)) + { + width = 0; + do + { + width *= 10; + width += *f - '0'; + ++f; + } + while (ISDIGIT (*f)); + } + + /* Check for modifiers. */ + switch (*f) + { + case 'E': + case 'O': + modifier = *f++; + break; + + default: + modifier = 0; + break; + } + + /* Now do the specified format. */ + switch (*f) + { +#define DO_NUMBER(d, v) \ + digits = d; number_value = v; goto do_number +#define DO_NUMBER_SPACEPAD(d, v) \ + digits = d; number_value = v; goto do_number_spacepad + + case '%': + if (modifier != 0) + goto bad_format; + add (1, *p = *f); + break; + + case 'a': + if (modifier != 0) + goto bad_format; + cpy (aw_len, a_wkday); + break; + + case 'A': + if (modifier != 0) + goto bad_format; + cpy (wkday_len, f_wkday); + break; + + case 'b': + case 'h': /* POSIX.2 extension. */ + if (modifier != 0) + goto bad_format; + cpy (am_len, a_month); + break; + + case 'B': + if (modifier != 0) + goto bad_format; + cpy (month_len, f_month); + break; + + case 'c': + if (modifier == 'O') + goto bad_format; +#ifdef _NL_CURRENT + if (! (modifier == 'E' + && *(subfmt = _NL_CURRENT (LC_TIME, ERA_D_T_FMT)) != '\0')) + subfmt = _NL_CURRENT (LC_TIME, D_T_FMT); +#else + subfmt = "%a %b %e %H:%M:%S %Y"; +#endif + + subformat: + { + char *old_start = p; + size_t len = strftime (NULL, maxsize - i, subfmt, tp); + if (len == 0 && *subfmt) + return 0; + add (len, strftime (p, maxsize - i, subfmt, tp)); + + if (to_uppcase) + while (old_start < p) + { + *old_start = TOUPPER (*old_start); + ++old_start; + } + } + break; + + case 'C': /* POSIX.2 extension. */ + if (modifier == 'O') + goto bad_format; +#if defined(HAVE_STRUCT_ERA_ENTRY) + if (modifier == 'E') + { + struct era_entry *era = _nl_get_era_entry (tp); + if (era) + { + size_t len = strlen (era->name_fmt); + cpy (len, era->name_fmt); + break; + } + } +#endif + { + int year = tp->tm_year + TM_YEAR_BASE; + DO_NUMBER (1, year / 100 - (year % 100 < 0)); + } + + case 'x': + if (modifier == 'O') + goto bad_format; +#ifdef _NL_CURRENT + if (! (modifier == 'E' + && *(subfmt = _NL_CURRENT (LC_TIME, ERA_D_FMT)) != '\0')) + subfmt = _NL_CURRENT (LC_TIME, D_FMT); + goto subformat; +#endif + /* Fall through. */ + case 'D': /* POSIX.2 extension. */ + if (modifier != 0) + goto bad_format; + subfmt = "%m/%d/%y"; + goto subformat; + + case 'd': + if (modifier == 'E') + goto bad_format; + + DO_NUMBER (2, tp->tm_mday); + + case 'e': /* POSIX.2 extension. */ + if (modifier == 'E') + goto bad_format; + + DO_NUMBER_SPACEPAD (2, tp->tm_mday); + + /* All numeric formats set DIGITS and NUMBER_VALUE and then + jump to one of these two labels. */ + + do_number_spacepad: + /* Force `_' flag unless overwritten by `0' flag. */ + if (pad != '0') + pad = '_'; + + do_number: + /* Format the number according to the MODIFIER flag. */ + +#ifdef _NL_CURRENT + if (modifier == 'O' && 0 <= number_value) + { + /* Get the locale specific alternate representation of + the number NUMBER_VALUE. If none exist NULL is returned. */ + const char *cp = _nl_get_alt_digit (number_value); + + if (cp != NULL) + { + size_t digitlen = strlen (cp); + if (digitlen != 0) + { + cpy (digitlen, cp); + break; + } + } + } +#endif + { + unsigned int u = number_value; + + bufp = buf + sizeof (buf); + negative_number = number_value < 0; + + if (negative_number) + u = -u; + + do + *--bufp = u % 10 + '0'; + while ((u /= 10) != 0); + } + + do_number_sign_and_padding: + if (negative_number) + *--bufp = '-'; + + if (pad != '-') + { + int padding = digits - (buf + sizeof (buf) - bufp); + + if (pad == '_') + { + while (0 < padding--) + *--bufp = ' '; + } + else + { + bufp += negative_number; + while (0 < padding--) + *--bufp = '0'; + if (negative_number) + *--bufp = '-'; + } + } + + cpy (buf + sizeof (buf) - bufp, bufp); + break; + + + case 'H': + if (modifier == 'E') + goto bad_format; + + DO_NUMBER (2, tp->tm_hour); + + case 'I': + if (modifier == 'E') + goto bad_format; + + DO_NUMBER (2, hour12); + + case 'k': /* GNU extension. */ + if (modifier == 'E') + goto bad_format; + + DO_NUMBER_SPACEPAD (2, tp->tm_hour); + + case 'l': /* GNU extension. */ + if (modifier == 'E') + goto bad_format; + + DO_NUMBER_SPACEPAD (2, hour12); + + case 'j': + if (modifier == 'E') + goto bad_format; + + DO_NUMBER (3, 1 + tp->tm_yday); + + case 'M': + if (modifier == 'E') + goto bad_format; + + DO_NUMBER (2, tp->tm_min); + + case 'm': + if (modifier == 'E') + goto bad_format; + + DO_NUMBER (2, tp->tm_mon + 1); + + case 'n': /* POSIX.2 extension. */ + add (1, *p = '\n'); + break; + + case 'P': + to_lowcase = 1; + /* FALLTHROUGH */ + + case 'p': + cpy (ap_len, ampm); + break; + + case 'R': /* GNU extension. */ + subfmt = "%H:%M"; + goto subformat; + + case 'r': /* POSIX.2 extension. */ +#ifdef _NL_CURRENT + if (*(subfmt = _NL_CURRENT (LC_TIME, T_FMT_AMPM)) == '\0') +#endif + subfmt = "%I:%M:%S %p"; + goto subformat; + + case 'S': + if (modifier == 'E') + goto bad_format; + + DO_NUMBER (2, tp->tm_sec); + + case 's': /* GNU extension. */ + { + struct tm ltm; + time_t t; + + ltm = *tp; + t = mktime (<m); + + /* Generate string value for T using time_t arithmetic; + this works even if sizeof (long) < sizeof (time_t). */ + + bufp = buf + sizeof (buf); + negative_number = t < 0; + + do + { + int d = t % 10; + t /= 10; + + if (negative_number) + { + d = -d; + + /* Adjust if division truncates to minus infinity. */ + if (0 < -1 % 10 && d < 0) + { + t++; + d += 10; + } + } + + *--bufp = d + '0'; + } + while (t != 0); + + digits = 1; + goto do_number_sign_and_padding; + } + + case 'X': + if (modifier == 'O') + goto bad_format; +#ifdef _NL_CURRENT + if (! (modifier == 'E' + && *(subfmt = _NL_CURRENT (LC_TIME, ERA_T_FMT)) != '\0')) + subfmt = _NL_CURRENT (LC_TIME, T_FMT); + goto subformat; +#endif + /* Fall through. */ + case 'T': /* POSIX.2 extension. */ + subfmt = "%H:%M:%S"; + goto subformat; + + case 't': /* POSIX.2 extension. */ + add (1, *p = '\t'); + break; + + case 'u': /* POSIX.2 extension. */ + DO_NUMBER (1, (tp->tm_wday - 1 + 7) % 7 + 1); + + case 'U': + if (modifier == 'E') + goto bad_format; + + DO_NUMBER (2, (tp->tm_yday - tp->tm_wday + 7) / 7); + + case 'V': + case 'g': /* GNU extension. */ + case 'G': /* GNU extension. */ + if (modifier == 'E') + goto bad_format; + { + int year = tp->tm_year + TM_YEAR_BASE; + int days = iso_week_days (tp->tm_yday, tp->tm_wday); + + if (days < 0) + { + /* This ISO week belongs to the previous year. */ + year--; + days = iso_week_days (tp->tm_yday + (365 + __isleap (year)), + tp->tm_wday); + } + else + { + int d = iso_week_days (tp->tm_yday - (365 + __isleap (year)), + tp->tm_wday); + if (0 <= d) + { + /* This ISO week belongs to the next year. */ + year++; + days = d; + } + } + + switch (*f) + { + case 'g': + DO_NUMBER (2, (year % 100 + 100) % 100); + + case 'G': + DO_NUMBER (1, year); + + default: + DO_NUMBER (2, days / 7 + 1); + } + } + + case 'W': + if (modifier == 'E') + goto bad_format; + + DO_NUMBER (2, (tp->tm_yday - (tp->tm_wday - 1 + 7) % 7 + 7) / 7); + + case 'w': + if (modifier == 'E') + goto bad_format; + + DO_NUMBER (1, tp->tm_wday); + + case 'Y': +#if defined(HAVE_STRUCT_ERA_ENTRY) + if (modifier == 'E') + { + struct era_entry *era = _nl_get_era_entry (tp); + if (era) + { + subfmt = strchr (era->name_fmt, '\0') + 1; + goto subformat; + } + } +#endif + if (modifier == 'O') + goto bad_format; + else + DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE); + + case 'y': +#if defined(HAVE_STRUCT_ERA_ENTRY) + if (modifier == 'E') + { + struct era_entry *era = _nl_get_era_entry (tp); + if (era) + { + int delta = tp->tm_year - era->start_date[0]; + DO_NUMBER (1, (era->offset + + (era->direction == '-' ? -delta : delta))); + } + } +#endif + DO_NUMBER (2, (tp->tm_year % 100 + 100) % 100); + + case 'Z': + cpy (zonelen, zone); + break; + + case 'z': /* GNU extension. */ + if (tp->tm_isdst < 0) + break; + + { + int diff; +#if defined(HAVE_TM_GMTOFF) + diff = tp->tm_gmtoff; +#else + struct tm gtm; + struct tm ltm; + time_t lt; + + ltm = *tp; + lt = mktime (<m); + + if (lt == (time_t) -1) + { + /* mktime returns -1 for errors, but -1 is also a + valid time_t value. Check whether an error really + occurred. */ + struct tm tm; + localtime_r (<, &tm); + + if ((ltm.tm_sec ^ tm.tm_sec) + | (ltm.tm_min ^ tm.tm_min) + | (ltm.tm_hour ^ tm.tm_hour) + | (ltm.tm_mday ^ tm.tm_mday) + | (ltm.tm_mon ^ tm.tm_mon) + | (ltm.tm_year ^ tm.tm_year)) + break; + } + + if (! gmtime_r (<, >m)) + break; + + diff = tm_diff (<m, >m); +#endif + + if (diff < 0) + { + add (1, *p = '-'); + diff = -diff; + } + else + add (1, *p = '+'); + + diff /= 60; + DO_NUMBER (4, (diff / 60) * 100 + diff % 60); + } + + case '\0': /* GNU extension: % at end of format. */ + --f; + /* Fall through. */ + default: + /* Unknown format; output the format, including the '%', + since this is most likely the right thing to do if a + multibyte string has been misparsed. */ + bad_format: + { + int flen; + for (flen = 1; f[1 - flen] != '%'; flen++) + continue; + cpy (flen, &f[1 - flen]); + } + break; + } + } + + if (p) + *p = '\0'; + return i; +} diff --git a/rpm-5.4.9/misc/strstr.c b/rpm-5.4.9/misc/strstr.c new file mode 100644 index 0000000..cdee621 --- /dev/null +++ b/rpm-5.4.9/misc/strstr.c @@ -0,0 +1,116 @@ +/* Copyright (C) 1994 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* + * My personal strstr() implementation that beats most other algorithms. + * Until someone tells me otherwise, I assume that this is the + * fastest implementation of strstr() in C. + * I deliberately chose not to comment it. You should have at least + * as much fun trying to understand it, as I had to write it :-). + * + * Stephen R. van den Berg, berg@pool.informatik.rwth-aachen.de */ + +#include +#include + +typedef unsigned chartype; + +char * +strstr (phaystack, pneedle) + const char *phaystack; + const char *pneedle; +{ + register const unsigned char *haystack, *needle; + register chartype b, c; + + haystack = (const unsigned char *) phaystack; + needle = (const unsigned char *) pneedle; + + b = *needle; + if (b != '\0') + { + haystack--; /* possible ANSI violation */ + do + { + c = *++haystack; + if (c == '\0') + goto ret0; + } + while (c != b); + + c = *++needle; + if (c == '\0') + goto foundneedle; + ++needle; + goto jin; + + for (;;) + { + register chartype a; + register const unsigned char *rhaystack, *rneedle; + + do + { + a = *++haystack; + if (a == '\0') + goto ret0; + if (a == b) + break; + a = *++haystack; + if (a == '\0') + goto ret0; +shloop: } + while (a != b); + +jin: a = *++haystack; + if (a == '\0') + goto ret0; + + if (a != c) + goto shloop; + + rhaystack = haystack-- + 1; + rneedle = needle; + a = *rneedle; + + if (*rhaystack == a) + do + { + if (a == '\0') + goto foundneedle; + ++rhaystack; + a = *++needle; + if (*rhaystack != a) + break; + if (a == '\0') + goto foundneedle; + ++rhaystack; + a = *++needle; + } + while (*rhaystack == a); + + needle = rneedle; /* took the register-poor aproach */ + + if (a == '\0') + break; + } + } +foundneedle: + return (char*) haystack; +ret0: + return 0; +} diff --git a/rpm-5.4.9/misc/strtol.c b/rpm-5.4.9/misc/strtol.c new file mode 100644 index 0000000..633ed46 --- /dev/null +++ b/rpm-5.4.9/misc/strtol.c @@ -0,0 +1,296 @@ +/* Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc. + +This file is part of the GNU C Library. + +The GNU C 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. + +The GNU C 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 the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#ifdef _LIBC +# define USE_NUMBER_GROUPING +# define STDC_HEADERS +# define HAVE_LIMITS_H +#else +#include "system.h" +#endif + +#ifndef errno +extern int errno; +#endif + +#ifdef STDC_HEADERS +# include +# include +#else +# ifndef NULL +# define NULL 0 +# endif +#endif + +#ifdef USE_NUMBER_GROUPING +# include "../locale/localeinfo.h" +#endif + +/* Nonzero if we are defining `strtoul' or `strtouq', operating on + unsigned integers. */ +#ifndef UNSIGNED +# define UNSIGNED 0 +# define INT LONG int +#else +# define strtol strtoul +# define INT unsigned LONG int +#endif + +/* If QUAD is defined, we are defining `strtoq' or `strtouq', + operating on `long long int's. */ +#ifdef QUAD +# if UNSIGNED +# define strtoul strtouq +# else +# define strtol strtoq +# endif +# define LONG long long +# undef LONG_MIN +# define LONG_MIN LONG_LONG_MIN +# undef LONG_MAX +# define LONG_MAX LONG_LONG_MAX +# undef ULONG_MAX +# define ULONG_MAX ULONG_LONG_MAX +# if __GNUC__ == 2 && __GNUC_MINOR__ < 7 + /* Work around gcc bug with using this constant. */ + static const unsigned long long int maxquad = ULONG_LONG_MAX; +# undef ULONG_MAX +# define ULONG_MAX maxquad +# endif +#else +# define LONG long +#endif + +#ifdef __STDC__ +# define INTERNAL(x) INTERNAL1(x) +# define INTERNAL1(x) __##x##_internal +#else +# define INTERNAL(x) __/**/x/**/_internal +#endif + +#ifdef USE_NUMBER_GROUPING +/* This file defines a function to check for correct grouping. */ +# include "grouping.h" +#endif + + +/* Convert NPTR to an `unsigned long int' or `long int' in base BASE. + If BASE is 0 the base is determined by the presence of a leading + zero, indicating octal or a leading "0x" or "0X", indicating hexadecimal. + If BASE is < 2 or > 36, it is reset to 10. + If ENDPTR is not NULL, a pointer to the character after the last + one converted is stored in *ENDPTR. */ + +INT +INTERNAL (strtol) (nptr, endptr, base, group) + const char *nptr; + char **endptr; + int base; + int group; +{ + int negative; + register unsigned LONG int cutoff; + register unsigned int cutlim; + register unsigned LONG int i; + register const char *s; + register unsigned char c; + const char *save, *end; + int overflow; + +#ifdef USE_NUMBER_GROUPING + /* The thousands character of the current locale. */ + wchar_t thousands; + /* The numeric grouping specification of the current locale, + in the format described in . */ + const char *grouping; + + if (group) + { + grouping = _NL_CURRENT (LC_NUMERIC, GROUPING); + if (*grouping <= 0 || *grouping == CHAR_MAX) + grouping = NULL; + else + { + /* Figure out the thousands separator character. */ + if (mbtowc (&thousands, _NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP), + strlen (_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP))) <= 0) + thousands = (wchar_t) *_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP); + if (thousands == L'\0') + grouping = NULL; + } + } + else + grouping = NULL; +#endif + + if (base < 0 || base == 1 || base > 36) + base = 10; + + save = s = nptr; + + /* Skip white space. */ + while (isspace (*s)) + ++s; + if (*s == '\0') + goto noconv; + + /* Check for a sign. */ + if (*s == '-') + { + negative = 1; + ++s; + } + else if (*s == '+') + { + negative = 0; + ++s; + } + else + negative = 0; + + if (base == 16 && s[0] == '0' && toupper (s[1]) == 'X') + s += 2; + + /* If BASE is zero, figure it out ourselves. */ + if (base == 0) + if (*s == '0') + { + if (toupper (s[1]) == 'X') + { + s += 2; + base = 16; + } + else + base = 8; + } + else + base = 10; + + /* Save the pointer so we can check later if anything happened. */ + save = s; + +#ifdef USE_NUMBER_GROUPING + if (group) + { + /* Find the end of the digit string and check its grouping. */ + end = s; + for (c = *end; c != '\0'; c = *++end) + if (c != thousands && !isdigit (c) && + (!isalpha (c) || toupper (c) - 'A' + 10 >= base)) + break; + if (*s == thousands) + end = s; + else + end = correctly_grouped_prefix (s, end, thousands, grouping); + } + else +#endif + end = NULL; + + cutoff = ULONG_MAX / (unsigned LONG int) base; + cutlim = ULONG_MAX % (unsigned LONG int) base; + + overflow = 0; + i = 0; + for (c = *s; c != '\0'; c = *++s) + { + if (s == end) + break; + if (isdigit (c)) + c -= '0'; + else if (isalpha (c)) + c = toupper (c) - 'A' + 10; + else + break; + if (c >= base) + break; + /* Check for overflow. */ + if (i > cutoff || (i == cutoff && c > cutlim)) + overflow = 1; + else + { + i *= (unsigned LONG int) base; + i += c; + } + } + + /* Check if anything actually happened. */ + if (s == save) + goto noconv; + + /* Store in ENDPTR the address of one character + past the last character we converted. */ + if (endptr != NULL) + *endptr = (char *) s; + +#if !UNSIGNED + /* Check for a value that is within the range of + `unsigned LONG int', but outside the range of `LONG int'. */ + if (i > (negative ? + -(unsigned LONG int) LONG_MIN : (unsigned LONG int) LONG_MAX)) + overflow = 1; +#endif + + if (overflow) + { + errno = ERANGE; +#if UNSIGNED + return ULONG_MAX; +#else + return negative ? LONG_MIN : LONG_MAX; +#endif + } + + /* Return the result of the appropriate sign. */ + return (negative ? -i : i); + +noconv: + /* We must handle a special case here: the base is 0 or 16 and the + first two characters and '0' and 'x', but the rest are no + hexadecimal digits. This is no error case. We return 0 and + ENDPTR points to the `x`. */ + if (endptr != NULL) + if (save - nptr >= 2 && tolower (save[-1]) == 'x' && save[-2] == '0') + *endptr = (char *) &save[-1]; + else + /* There was no number to convert. */ + *endptr = (char *) nptr; + + return 0L; +} + +/* External user entry point. */ + +INT +#ifdef __strtol +__strtol +#else +strtol +#endif + (nptr, endptr, base) + const char *nptr; + char **endptr; + int base; +{ + return INTERNAL (strtol) (nptr, endptr, base, 0); +} + +#ifdef weak_symbol +weak_symbol (strtol) +#endif diff --git a/rpm-5.4.9/misc/strtoul.c b/rpm-5.4.9/misc/strtoul.c new file mode 100644 index 0000000..87ab3dc --- /dev/null +++ b/rpm-5.4.9/misc/strtoul.c @@ -0,0 +1,23 @@ +/* Copyright (C) 1991 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C 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. + +The GNU C 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 the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include "system.h" + +#define UNSIGNED 1 + +#include "strtol.c" diff --git a/rpm-5.4.9/misc/tempname.h b/rpm-5.4.9/misc/tempname.h new file mode 100644 index 0000000..928ffa2 --- /dev/null +++ b/rpm-5.4.9/misc/tempname.h @@ -0,0 +1,38 @@ +/* Create a temporary file or directory. + + Copyright (C) 2006 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 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 . */ + +/* header written by Eric Blake */ + +/* In gnulib, always prefer large files. GT_FILE maps to + __GT_BIGFILE, not __GT_FILE, for a reason. */ +#define GT_FILE 1 +#define GT_DIR 2 +#define GT_NOCREATE 3 + +/* Generate a temporary file name based on TMPL. TMPL must match the + rules for mk[s]temp (i.e. end in "XXXXXX"). The name constructed + does not exist at the time of the call to gen_tempname. TMPL is + overwritten with the result. + + KIND may be one of: + GT_NOCREATE: simply verify that the name does not exist + at the time of the call. + GT_FILE: create a large file using open(O_CREAT|O_EXCL) + and return a read-write fd. The file is mode 0600. + GT_DIR: create a directory, which will be mode 0700. + + We use a clever algorithm to get hard-to-predict names. */ diff --git a/rpm-5.4.9/missing b/rpm-5.4.9/missing new file mode 100755 index 0000000..86a8fc3 --- /dev/null +++ b/rpm-5.4.9/missing @@ -0,0 +1,331 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2012-01-06.13; # UTC + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. +# Originally 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 + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +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 + +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). This is about non-GNU programs, so use $1 not +# $program. +case $1 in + lex*|yacc*) + # Not GNU programs, they don't have --version. + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $program in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te*) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison*|yacc*) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG=\${$#} + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex*|flex*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG=\${$#} + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit $? + fi + ;; + + makeinfo*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/rpm-5.4.9/mkinstalldirs b/rpm-5.4.9/mkinstalldirs new file mode 100755 index 0000000..4191a45 --- /dev/null +++ b/rpm-5.4.9/mkinstalldirs @@ -0,0 +1,162 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy + +scriptversion=2009-04-28.21; # UTC + +# Original author: Noah Friedman +# Created: 1993-05-16 +# Public domain. +# +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' +IFS=" "" $nl" +errstatus=0 +dirmode= + +usage="\ +Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... + +Create each directory DIR (with mode MODE, if specified), including all +leading file name components. + +Report bugs to ." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" + exit $? + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --version) + echo "$0 $scriptversion" + exit $? + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and +# mkdir -p a/c at the same time, both will detect that a is missing, +# one will create a, then the other will try to create a and die with +# a "File exists" error. This is a problem when calling mkinstalldirs +# from a parallel make. We use --version in the probe to restrict +# ourselves to GNU mkdir, which is thread-safe. +case $dirmode in + '') + if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + test -d ./-p && rmdir ./-p + test -d ./--version && rmdir ./--version + fi + ;; + *) + if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && + test ! -d ./--version; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + else + # Clean up after NextStep and OpenStep mkdir. + for d in ./-m ./-p ./--version "./$dirmode"; + do + test -d $d && rmdir $d + done + fi + ;; +esac + +for file +do + case $file in + /*) pathcomp=/ ;; + *) pathcomp= ;; + esac + oIFS=$IFS + IFS=/ + set fnord $file + shift + IFS=$oIFS + + for d + do + test "x$d" = x && continue + + pathcomp=$pathcomp$d + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + 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 +# 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/rpm-5.4.9/perl/.cvsignore b/rpm-5.4.9/perl/.cvsignore new file mode 100644 index 0000000..9ed0d1a --- /dev/null +++ b/rpm-5.4.9/perl/.cvsignore @@ -0,0 +1,23 @@ +.made_mod +Makefile +Makefile.PL +Makefile.in +Makefile.perl +RPM-* +RPM.bs +RPM.c +RPM_Constant.c +RPM_Dependencies.c +RPM_Files.c +RPM_Header.c +RPM_PackageIterator.c +RPM_Problems.c +RPM_Spec.c +RPM_Transaction.c +RPM_Ts.c +blib +perl +pm_to_blib +MANIFEST +*.gcda +*.gcno diff --git a/rpm-5.4.9/perl/MANIFEST b/rpm-5.4.9/perl/MANIFEST new file mode 100644 index 0000000..aa2fb82 --- /dev/null +++ b/rpm-5.4.9/perl/MANIFEST @@ -0,0 +1,33 @@ +typemap +Makefile.PL.in +rpmxs.c +rpmxs.h +RPM.xs +RPM.pm +t/01.rpm.t +RPM/Constant.pm +RPM_Constant.xs +t/02.rpmconstant.t +RPM_Header.xs +RPM/Header.pm +t/03.header.t +RPM_Transaction.xs +RPM/Transaction.pm +t/04.transaction.t +RPM_PackageIterator.xs +RPM/PackageIterator.pm +t/05.packageiterator.t +RPM_Problems.xs +RPM/Problems.pm +t/06.problems.t +RPM_Files.xs +RPM/Files.pm +t/07.files.t +RPM_Dependencies.xs +RPM/Dependencies.pm +t/08.dependencies.t +RPM_Spec.xs +RPM/Spec.pm +t/09.spec.t +RPM/Sign.pm +t/10.sign.t diff --git a/rpm-5.4.9/perl/META.yml b/rpm-5.4.9/perl/META.yml new file mode 100644 index 0000000..cd82413 --- /dev/null +++ b/rpm-5.4.9/perl/META.yml @@ -0,0 +1,10 @@ +# http://module-build.sourceforge.net/META-spec.html +#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# +name: RPM +version: 0.66 +version_from: RPM.pm +installdirs: site +requires: + +distribution_type: module +generated_by: ExtUtils::MakeMaker version 6.17 diff --git a/rpm-5.4.9/perl/Makefile b/rpm-5.4.9/perl/Makefile new file mode 100644 index 0000000..457c952 --- /dev/null +++ b/rpm-5.4.9/perl/Makefile @@ -0,0 +1,783 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# perl/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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. + + + +# Makefile for rpm scripts. + + +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/rpm +pkgincludedir = $(includedir)/rpm +pkglibdir = $(libdir)/rpm +pkglibexecdir = $(libexecdir)/rpm +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 = x86_64-unknown-linux-gnu +host_triplet = x86_64-unknown-linux-gnu +target_triplet = x86_64-unknown-linux-gnu +subdir = perl +DIST_COMMON = README $(srcdir)/Makefile.PL.in $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = Makefile.PL +CONFIG_CLEAN_VPATH_FILES = +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 +DATA = $(noinst_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /home/mdawkins/wdj54/missing --run aclocal-1.11 +ALLOCA = +AMTAR = $${TAR-tar} +AR = ar +AS = /usr/bin/as +AUTOCONF = ${SHELL} /home/mdawkins/wdj54/missing --run autoconf +AUTOHEADER = ${SHELL} /home/mdawkins/wdj54/missing --run autoheader +AUTOMAKE = ${SHELL} /home/mdawkins/wdj54/missing --run automake-1.11 +AWK = gawk +BUILDROOTDIR_MACRO = %{_tmppath} +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -O2 -g -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC -DPIC -Wall -W -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -Wno-unused-parameter -Wformat-security -g3 -fno-delete-null-pointer-checks -D_FORTIFY_SOURCE=2 -fstack-protector -fexceptions -fexceptions -Wno-missing-field-initializers -D_GNU_SOURCE -D_REENTRANT +CPP = gcc -E +CPPFLAGS = -DRPM_OS_LINUX=030300 -I/usr/include/p11-kit-1 -I/usr/include/neon -I/usr/include/db53 -I/usr/include/libxml2 -I/usr/include/ossp-uuid -I/usr/include/ossp-uuid +CXX = g++ +CXXCPP = g++ -E +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -O2 -g -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 +CYGPATH_W = echo +DBAPI = 3 +DBLIBOBJS = db3.lo sqlite.lo +DBLIBSRCS = db3.c sqlite.c +DBPATH = /var/lib/rpm +DBPATH_MACRO = %{_var}/lib/rpm +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DISTRO_MACROS = +DLLTOOL = false +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = +FGREP = /bin/grep -F +FIXPERMS = a+rX,u+w,g-w,o-w +GETTEXT_MACRO_VERSION = 0.18 +GMSGFMT = /usr/bin/msgfmt +GMSGFMT_015 = /usr/bin/msgfmt +GPSEE_MODULES_PATH = +GREP = /bin/grep +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +INTLLIBS = +INTL_MACOSX_LIBS = +LD = /usr/bin/ld -m elf_x86_64 +LDFLAGS = -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -L/usr/lib64/ +LDFLAGS_STATIC = +LD_VERSION_SCRIPT_FLAG = --version-script +LIBICONV = -liconv +LIBINTL = +LIBOBJS = +LIBS = -lcpuinfo -lkeyutils -lacl -lattr -lsyck -luuid -lossp-uuid -lpcreposix -lpcre -ldl -lm -ltcl -ltcl8.6 -laugeas -lreadline -lsqlite3 -ldb-5.3 -lmagic -lneon -lgnutls -ltasn1 -lcrypto -lgcrypt -lbeecrypt -llzma -lbz2 -lz -lpopt -lpthread -lrt -lelf -lpopt -lz -lgcrypt -lgpg-error -lssl -lcrypto -ltasn1 -lgnutls -lneon -laugeas -lxml2 -lpcre -lcpuinfo +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIBTOOLIZE = libtoolize +LIPO = +LN_S = ln -s +LOCALEDIR = /usr/share/locale +LTLIBICONV = -liconv +LTLIBINTL = +LTLIBOBJS = +LT_AGE = 0 +LT_CURRENT = 5 +LT_REVISION = 4 +MACROFILES = /usr/lib/rpm/macros:/usr/lib/rpm/%{_target}/macros:/etc/rpm/macros.*:/etc/rpm/macros:/etc/rpm/%{_target}/macros:/usr/lib/rpm/platform/%{_target}/macros:/usr/lib/rpm/mandriva/platform/%{_target}/macros:/etc/rpm/macros.d/*.macros:/usr/lib/rpm/macros.d/mandriva:~/.rpmmacros +MAGIC_MACRO = /usr/share/misc/magic +MAINT = +MAKEINFO = ${SHELL} /home/mdawkins/wdj54/missing --run makeinfo +MANIFEST_TOOL = : +MKDIR = /bin/mkdir +MKDIR_P = /bin/mkdir -p +MSGFMT = /usr/bin/msgfmt +MSGFMT_015 = /usr/bin/msgfmt +MSGMERGE = /usr/bin/msgmerge +NCPUS_COMMAND = /usr/bin/getconf _NPROCESSORS_ONLN +NM = /usr/bin/nm -B +NMEDIT = +OBJDUMP = objdump +OBJEXT = o +OPENMP_CFLAGS = -fopenmp +OPENMP_CXXFLAGS = -fopenmp +OTOOL = +OTOOL64 = +PACKAGE = rpm +PACKAGE_BUGREPORT = rpm-devel@rpm5.org +PACKAGE_NAME = rpm +PACKAGE_STRING = rpm 5.4.9 +PACKAGE_TARNAME = rpm +PACKAGE_URL = +PACKAGE_VERSION = 5.4.9 +PATH_SEPARATOR = : +PERL = /usr/bin/perl +PERL_INSTALLDIRS = 'INSTALLDIRS' => 'vendor', +PERL_URPM_INSTALLDIRS = +PKGSRCDIR = /usr/src/rpm +PKGSRCDIR_MACRO = %{_usr}/src/rpm +POSUB = po +PYTHON = /usr/bin/python +PYTHON_EXEC_PREFIX = ${exec_prefix} +PYTHON_PREFIX = ${prefix} +PYTHON_VERSION = 2.7 +RANLIB = ranlib +ROOT_GROUP = root +RPMCANONARCH = x86_64 +RPMCANONCOLOR = 3 +RPMCANONGNU = -gnu +RPMCANONOS = linux +RPMCANONVENDOR = mandriva +RPMGID = 37 +RPMGROUP = rpm +RPMLUAFILES = /usr/lib/rpm/init.lua:/usr/lib/rpm/rpmlua:/usr/lib/rpm/%{_target}/rpmlua:/etc/rpm/rpmlua.*:/etc/rpm/rpmlua:/etc/rpm/%{_target}/rpmlua:~/.rpmlua +RPMPOPTFILES = /usr/lib/rpm/rpmpopt:/usr/lib/rpm/%{_target}/rpmpopt:/etc/rpm/rpmpopt.*:/etc/rpm/rpmpopt:/etc/rpm/%{_target}/rpmpopt:~/.rpmpopt +RPMUID = 37 +RPMUSER = rpm +RPM_TIMESTAMP = 2012,4,2,0,0 +RPM_VENDOR = 'R','P','M','5' +RPM_VERSION = 5,4,r,9,0,_ +SED = /bin/sed +SET_MAKE = +SHELL = /bin/sh +STRIP = strip +SYSCONFIGDIR = /etc/rpm +USE_NLS = yes +USRLIBRPM = /usr/lib/rpm +VERSION = 5.4.9 +WITH_ACL = yes +WITH_APIDOCS = 1 +WITH_APIDOCS_TARGET = apidocs +WITH_APR = no +WITH_ATERM = no +WITH_ATTR = yes +WITH_AUGEAS = yes +WITH_AUGEAS_AUGTOOL = augtool +WITH_BASH = no +WITH_BASH_CPPFLAGS = +WITH_BASH_LDFLAGS = +WITH_BASH_LIBS = +WITH_BASH_SUBDIR = +WITH_BEECRYPT = yes +WITH_BEECRYPT_CPPFLAGS = +WITH_BEECRYPT_LDFLAGS = +WITH_BEECRYPT_LIBS = +WITH_BEECRYPT_SUBDIR = +WITH_BZIP2 = yes +WITH_CPUINFO = yes +WITH_CUDF = no +WITH_CUDF_CUDFTOOL = +WITH_DB = yes +WITH_DBSQL = no +WITH_DBSQL_CPPFLAGS = +WITH_DBSQL_LDFLAGS = +WITH_DBSQL_LIBS = +WITH_DBSQL_SUBDIR = +WITH_DB_CPPFLAGS = +WITH_DB_LDFLAGS = +WITH_DB_LIBS = +WITH_DB_SUBDIR = +WITH_DMALLOC = no +WITH_EFENCE = no +WITH_EXPAT = no +WITH_FICL = no +WITH_FICL_CPPFLAGS = +WITH_FICL_LDFLAGS = +WITH_FICL_LIBS = +WITH_FICL_SUBDIR = +WITH_FILE = yes +WITH_FILE_CPPFLAGS = +WITH_FILE_LDFLAGS = +WITH_FILE_LIBS = +WITH_FILE_SUBDIR = +WITH_GCRYPT = yes +WITH_GNUTLS = yes +WITH_GPSEE = no +WITH_GPSEE_CPPFLAGS = +WITH_GPSEE_LDFLAGS = +WITH_GPSEE_LIBS = +WITH_GPSEE_SUBDIR = +WITH_JS_SUBDIR = +WITH_KEYUTILS = yes +WITH_KEYUTILS_RPMKEY = rpmkey +WITH_LIBELF_DEBUGEDIT = debugedit +WITH_LIBGIT2 = no +WITH_LIBGIT2_CPPFLAGS = +WITH_LIBGIT2_LDFLAGS = +WITH_LIBGIT2_LIBS = +WITH_LIBGIT2_SUBDIR = +WITH_LIBTASN1 = yes +WITH_LUA = yes +WITH_LUA_CPPFLAGS = -I$(top_srcdir)/$(WITH_LUA_SUBDIR)/local -I$(top_builddir)/$(WITH_LUA_SUBDIR)/local -I$(top_srcdir)/$(WITH_LUA_SUBDIR) -I$(top_builddir)/$(WITH_LUA_SUBDIR) +WITH_LUA_LDFLAGS = -L$(top_builddir)/$(WITH_LUA_SUBDIR) +WITH_LUA_LIBS = -llua +WITH_LUA_SUBDIR = lua +WITH_LUA_SUBDIR_DEF = -DLUA_USE_DLOPEN -DLUA_USE_POSIX -DREX_POSIX_INCLUDE="" -DLUA_USE_PCRE -DLUA_USE_UUID +WITH_LUA_SUBDIR_LIB = +WITH_MOZJS185 = no +WITH_MOZJS185_CPPFLAGS = +WITH_MOZJS185_LDFLAGS = +WITH_MOZJS185_LIBS = +WITH_MOZJS185_SUBDIR = +WITH_NEON = yes +WITH_NEON_CPPFLAGS = +WITH_NEON_LDFLAGS = +WITH_NEON_LIBS = +WITH_NEON_SUBDIR = +WITH_NIX = no +WITH_NSS = no +WITH_OPENSSL = yes +WITH_PAKCHOIS = no +WITH_PATH_VERSIONED = no +WITH_PATH_VERSIONED_SUFFIX = +WITH_PCRE = yes +WITH_PCRE_CPPFLAGS = +WITH_PCRE_LDFLAGS = +WITH_PCRE_LIBS = +WITH_PCRE_SUBDIR = +WITH_PERLEMBED = no +WITH_PERL_LIBS = -lpthread -lrt -lelf +WITH_PERL_SUBDIR = perl +WITH_PERL_SUBPACKAGE = 1 +WITH_PERL_URPM_LIBS = -lpthread -lrt -lelf +WITH_PERL_URPM_SUBDIR = +WITH_PERL_URPM_SUBPACKAGE = 0 +WITH_POPT = yes +WITH_POPT_CPPFLAGS = +WITH_POPT_LDFLAGS = +WITH_POPT_LIBS = +WITH_POPT_SUBDIR = +WITH_PYTHONEMBED = no +WITH_PYTHON_INCDIR = /usr/include/python2.7 +WITH_PYTHON_SUBDIR = python +WITH_PYTHON_SUBPACKAGE = 1 +WITH_RC = no +WITH_RC_CPPFLAGS = +WITH_RC_LDFLAGS = +WITH_RC_LIBS = +WITH_RC_SUBDIR = +WITH_READLINE = yes +WITH_RUBY = no +WITH_RUBY_CPPFLAGS = +WITH_RUBY_SUBDIR = +WITH_RUBY_VENDORARCHDIR = +WITH_SELINUX = no +WITH_SEMANAGE = no +WITH_SEMANAGE_SEMODULE = +WITH_SEPOL = no +WITH_SPIDERMONKEY_SUBDIR = +WITH_SQLITE = yes +WITH_SQLITE_CPPFLAGS = +WITH_SQLITE_LDFLAGS = +WITH_SQLITE_LIBS = +WITH_SQLITE_SUBDIR = +WITH_SQUIRREL = no +WITH_SUBVERSION = no +WITH_SYCK = yes +WITH_SYCK_CPPFLAGS = +WITH_SYCK_LDFLAGS = +WITH_SYCK_LIBS = +WITH_SYCK_SUBDIR = +WITH_TCL = yes +WITH_TCL_SUBDIR = +WITH_TOMCRYPT = no +WITH_TPM = no +WITH_UNIXODBC = no +WITH_UUID = yes +WITH_XAR = no +WITH_XAR_CPPFLAGS = +WITH_XAR_LDFLAGS = +WITH_XAR_LIBS = +WITH_XAR_SUBDIR = +WITH_XZ = yes +WITH_XZ_CPPFLAGS = +WITH_XZ_LDFLAGS = +WITH_XZ_LIBS = +WITH_XZ_SUBDIR = +WITH_ZLIB = yes +WITH_ZLIB_CPPFLAGS = +WITH_ZLIB_LDFLAGS = +WITH_ZLIB_LIBS = +WITH_ZLIB_SUBDIR = +XGETTEXT = /usr/bin/xgettext +XGETTEXT_015 = /usr/bin/xgettext +XGETTEXT_EXTRA_OPTIONS = +YACC = bison -y +YFLAGS = +__BASH = /bin/bash +__BZIP2 = /usr/bin/bzip2 +__CAT = /bin/cat +__CHATTR = /usr/bin/chattr +__CHGRP = /bin/chgrp +__CHGRP_RHF = %{__chgrp} -Rhf +__CHMOD = /bin/chmod +__CHOWN = /bin/chown +__CHOWN_RHF = %{__chown} -Rhf +__CMAKE = %{_bindir}/cmake +__CPIO = /bin/cpio +__CURL = /usr/bin/curl +__CVS = /usr/bin/cvs +__DBSQL = %{_bindir}/db53sql +__DB_ARCHIVE = /usr/bin/db53_archive +__DB_CHECKPOINT = /usr/bin/db53_checkpoint +__DB_DEADLOCK = /usr/bin/db53_deadlock +__DB_DUMP = /usr/bin/db53_dump +__DB_HOTBACKUP = /usr/bin/db53_hotbackup +__DB_LOAD = /usr/bin/db53_load +__DB_LOG_VERIFY = /usr/bin/db53_log_verify +__DB_PRINTLOG = /usr/bin/db53_printlog +__DB_RECOVER = /usr/bin/db53_recover +__DB_REPLICATE = /usr/bin/db53_replicate +__DB_SQL_CODEGEN = /usr/bin/db53_sql_codegen +__DB_STAT = /usr/bin/db53_stat +__DB_TUNER = /usr/bin/db53_tuner +__DB_UPGRADE = /usr/bin/db53_upgrade +__DB_VERIFY = /usr/bin/db53_verify +__DIFF = /usr/bin/diff +__DITTO = %{_bindir}/ditto +__DOXYGEN = /usr/bin/doxygen +__FILE = /usr/bin/file +__GIT = /usr/bin/git +__GPG = /usr/bin/gpg2 +__GSR = %{_bindir}/gsr +__GST_INSPECT = %{_bindir}/gst-inspect-0.10 +__GZIP = /bin/gzip +__HG = /usr/bin/hg +__ID = /bin/id +__ID_U = %{__id} -u +__INSTALL = /usr/bin/install +__INSTALL_INFO = /sbin/install-info +__LD = /usr/bin/ld +__LDCONFIG = /sbin/ldconfig +__LN = /bin/ln +__LRZIP = /usr/bin/lrzip +__LSATTR = /usr/bin/lsattr +__LZIP = /usr/bin/lzip +__LZMA = /usr/bin/lzma +__LZOP = /usr/bin/lzop +__MAKE = /usr/bin/make +__MKDIR = /bin/mkdir +__MKDIR_P = /bin/mkdir -p +__MODINFO = /sbin/modinfo +__MONGO = %{_bindir}/mongo +__MV = /bin/mv +__NM = /usr/bin/nm +__OBJCOPY = /usr/bin/objcopy +__OBJDUMP = /usr/bin/objdump +__PATCH = /usr/bin/patch +__PAX = %{_bindir}/pax +__PERL = /usr/bin/perl +__PGP = %{_bindir}/pgp +__PHP = %{_bindir}/php +__PYTHON = /usr/bin/python +__RM = /bin/rm +__RMDIR = /bin/rmdir +__RSH = %{_bindir}/rsh +__RUBY = /usr/bin/ruby +__SED = /bin/sed +__SH = /bin/sh +__SQLITE3 = %{_bindir}/sqlite3 +__SSH = /usr/bin/ssh +__STRIP = /usr/bin/strip +__SVN = /usr/bin/svn +__TAR = /bin/tar +__TCLSH = /usr/bin/tclsh +__UNZIP = /usr/bin/unzip +__XZ = /usr/bin/xz +abs_builddir = /home/mdawkins/wdj54/perl +abs_srcdir = /home/mdawkins/wdj54/perl +abs_top_builddir = /home/mdawkins/wdj54 +abs_top_srcdir = /home/mdawkins/wdj54 +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_CXX = g++ +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = tar --format=ustar -chf - "$$tardir" +am__untar = tar -xf - +autorelocate_dcolor = 0 +autorelocate_path = %{nil} +bindir = ${exec_prefix}/bin +build = x86_64-unknown-linux-gnu +build_alias = +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = unknown +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +exeext = +host = x86_64-unknown-linux-gnu +host_alias = +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = unknown +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /home/mdawkins/wdj54/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +libext = a +localedir = /usr/share/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +objext = o +oldincludedir = /usr/include +pdfdir = ${docdir} +pkgpyexecdir = ${pyexecdir}/${PACKAGE} +pkgpythondir = ${pythondir}/${PACKAGE} +prefix = /usr +program_transform_name = s,x,x, +psdir = ${docdir} +pyexecdir = ${pythondir} +pythondir = /usr/lib64/python2.7/site-packages +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +shlibext = so +srcdir = . +subdirs = +sysconfdir = ${prefix}/etc +target = x86_64-unknown-linux-gnu +target_alias = +target_cpu = x86_64 +target_os = linux +target_vendor = unknown +testdir = /home/mdawkins/wdj54/tests +top_build_prefix = ../ +top_builddir = .. +top_srcdir = .. +usrprefix = /usr +varprefix = /var +AUTOMAKE_OPTIONS = 1.4 foreign +EXTRA_DIST = \ + typemap \ + Makefile.PL.in \ + rpmxs.c rpmxs.h \ + RPM.xs RPM.pm t/01.rpm.t \ + RPM/Constant.pm RPM_Constant.xs t/02.rpmconstant.t \ + RPM_Header.xs RPM/Header.pm t/03.header.t \ + RPM_Transaction.xs RPM/Transaction.pm t/04.transaction.t \ + RPM_PackageIterator.xs RPM/PackageIterator.pm t/05.packageiterator.t \ + RPM_Problems.xs RPM/Problems.pm t/06.problems.t \ + RPM_Files.xs RPM/Files.pm t/07.files.t \ + RPM_Dependencies.xs RPM/Dependencies.pm t/08.dependencies.t \ + RPM_Spec.xs RPM/Spec.pm t/09.spec.t \ + RPM/Sign.pm t/10.sign.t + +noinst_DATA = .made_mod +CLEANFILES = *~ +LTLIBS = \ + /home/mdawkins/wdj54/rpmconstant/.libs \ + /home/mdawkins/wdj54/build/.libs \ + /home/mdawkins/wdj54/lib/.libs \ + /home/mdawkins/wdj54/rpmdb/.libs \ + /home/mdawkins/wdj54/rpmio/.libs \ + /home/mdawkins/wdj54/misc/.libs \ + /home/mdawkins/wdj54/popt/.libs + +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 perl/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign perl/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +Makefile.PL: $(top_builddir)/config.status $(srcdir)/Makefile.PL.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile $(DATA) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-local mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +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: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-am check-local clean clean-generic \ + clean-libtool clean-local 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 uninstall uninstall-am + + t/00.pod.coverage.t t/00.pod.t \ + t/gnupg/passphrase t/gnupg/pubring.gpg t/gnupg/random_seed \ + t/gnupg/secring.gpg t/gnupg/test-key.gpg t/gnupg/trustdb.gpg \ + hdlist-test.hdr test-rpm-1.0-1.noarch.rpm test-rpm-1.0-1.src.rpm \ + test-rpm.spec + +.made_mod: Makefile.perl $(EXTRA_DIST) MANIFEST + $(MAKE) -f Makefile.perl VPATH=$(VPATH) || \ + $(MAKE) -f Makefile.perl VPATH=$(VPATH) + +test: .made_mod + $(MAKE) -f Makefile.perl test + +MANIFEST: Makefile + echo -n > MANIFEST + for i in $(EXTRA_DIST); do \ + echo $$i >> MANIFEST; \ + done + +Makefile.perl: Makefile.PL + $(PERL) Makefile.PL MAKEFILE=$@ + +install-data-local: + $(MAKE) -f Makefile.perl PREFIX=$(prefix) install || \ + $(MAKE) -f Makefile.perl PREFIX=$(prefix) install + +.PHONY: test + +check-local: + -env LD_LIBRARY_PATH="`echo $(LTLIBS) | tr ' ' ':'`" $(MAKE) -f Makefile.perl test + +clean-local: + if [ -f Makefile.perl ]; then $(MAKE) -f Makefile.perl realclean; fi + rm -f Makefile.perl Makefile.perl.old + +# 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/rpm-5.4.9/perl/Makefile.PL b/rpm-5.4.9/perl/Makefile.PL new file mode 100644 index 0000000..1434d80 --- /dev/null +++ b/rpm-5.4.9/perl/Makefile.PL @@ -0,0 +1,78 @@ +package MY; # so that "SUPER" works right + +use ExtUtils::MakeMaker; +# See lib/ExtUtils/MakeMaker.pm for details of how to influence +# the contents of the Makefile that is written. + +my @libdir = qw(. build lib popt rpmdb rpmio misc rpmconstant); + +# use $ORIGIN relative paths to avoid LD_LIBRARY_PATH nonsense in tree +my @ldaddr = map { '-Wl,-rpath,\$$\ORIGIN/../../../../../' . $_ . '/.libs' } @libdir; +my @ldaddp = map { '-L../' . $_ . '/.libs' } @libdir; +my @ldadd = map { '-l' . $_ } qw(rpmmisc rpmio rpmbuild rpm popt rpmdb rpmconstant); + +my @cppflags = qw( + -I. + -I.. + -I../lib + -I../lib +); + +my @objects = qw( + rpmxs.o + RPM.o + RPM_Constant.o + RPM_Header.o + RPM_Transaction.o + RPM_PackageIterator.o + RPM_Problems.o + RPM_Spec.o + RPM_Files.o + RPM_Dependencies.o +); + +# teach MakeMaker some Mac OS X LDFLAGS: +my @LDFLAGS = qw(-Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -L/usr/lib64/ -lpthread -lrt -lelf $(CCCDLFLAGS) $(CCDLFLAGS) -L$(PERL_ARCHLIB)/CORE -lperl ); +my $uname = `uname`; chomp($uname); +foreach (@LDFLAGS) { + if ("$uname" eq "Darwin" && m/^(-arch|ppc|i386|ppc64|x86_64)$/) { + push (@ldflags, $&); + } elsif ("$uname" eq "Darwin" && m/-Wl,-search_paths_first/) { + push (@ldflags, $&); + } else { + push (@ldlibs, $_); + } +} + +# teach MakeMaker some VPATH $< manners: +sub c_o { + my $inherited = shift->SUPER::c_o(@_); + $inherited =~ s/(\.\w+\$\(OBJ_EXT\)\:\n\t.*?)\$\*\.\w+/$1\$\SUPER::xs_c(@_); + $inherited =~ s/(\.xs\.c\:\n\t.*?)\$\*\.\w+/$1\$\SUPER::xs_o(@_); + $inherited =~ s/(\.\w+\$\(OBJ_EXT\)\:\n\t.*?)\$\*\.\w+/$1\$\ 'RPM', + 'OBJECT' => join(' ', @objects), + 'VERSION' => '5.4.9', + 'MAKEFILE'=> 'Makefile.perl', + 'CCFLAGS' => join(' ', '-O2 -g -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC -DPIC -Wall -W -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -Wno-unused-parameter -Wformat-security -g3 -fno-delete-null-pointer-checks -D_FORTIFY_SOURCE=2 -fstack-protector -fexceptions -fexceptions -Wno-missing-field-initializers -D_GNU_SOURCE -D_REENTRANT ', '-Wno-unused-variable', '-Wno-missing-prototypes', '-Wno-implicit', '-Wno-strict-prototypes'), + 'dynamic_lib' => { + OTHERLDFLAGS => join(' ', @ldaddp, @ldadd, @ldlibs, @ldaddr) + }, + 'OPTIMIZE'=> '-g', + 'INC' => join(' ', @cppflags, map { '-I../'. $_ } @libdir) . ' -DRPM_OS_LINUX=030300 -I/usr/include/p11-kit-1 -I/usr/include/neon -I/usr/include/db53 -I/usr/include/libxml2 -I/usr/include/ossp-uuid -I/usr/include/ossp-uuid ', + 'INSTALLMAN1DIR' => '${prefix}/share/man/man1', + 'INSTALLMAN3DIR' => '${prefix}/share/man/man3', + 'INSTALLDIRS' => 'vendor', +); diff --git a/rpm-5.4.9/perl/Makefile.PL.in b/rpm-5.4.9/perl/Makefile.PL.in new file mode 100644 index 0000000..2d10ce2 --- /dev/null +++ b/rpm-5.4.9/perl/Makefile.PL.in @@ -0,0 +1,78 @@ +package MY; # so that "SUPER" works right + +use ExtUtils::MakeMaker; +# See lib/ExtUtils/MakeMaker.pm for details of how to influence +# the contents of the Makefile that is written. + +my @libdir = qw(. build lib popt rpmdb rpmio misc rpmconstant); + +# use $ORIGIN relative paths to avoid LD_LIBRARY_PATH nonsense in tree +my @ldaddr = map { '-Wl,-rpath,\$$\ORIGIN/../../../../../' . $_ . '/.libs' } @libdir; +my @ldaddp = map { '-L@top_builddir@/' . $_ . '/.libs' } @libdir; +my @ldadd = map { '-l' . $_ } qw(rpmmisc rpmio rpmbuild rpm popt rpmdb rpmconstant); + +my @cppflags = qw( + -I@srcdir@ + -I@top_srcdir@ + -I@top_srcdir@/lib + -I@top_builddir@/lib +); + +my @objects = qw( + rpmxs.o + RPM.o + RPM_Constant.o + RPM_Header.o + RPM_Transaction.o + RPM_PackageIterator.o + RPM_Problems.o + RPM_Spec.o + RPM_Files.o + RPM_Dependencies.o +); + +# teach MakeMaker some Mac OS X LDFLAGS: +my @LDFLAGS = qw(@LDFLAGS@ @WITH_PERL_LIBS@ $(CCCDLFLAGS) $(CCDLFLAGS) -L$(PERL_ARCHLIB)/CORE -lperl ); +my $uname = `uname`; chomp($uname); +foreach (@LDFLAGS) { + if ("$uname" eq "Darwin" && m/^(-arch|ppc|i386|ppc64|x86_64)$/) { + push (@ldflags, $&); + } elsif ("$uname" eq "Darwin" && m/-Wl,-search_paths_first/) { + push (@ldflags, $&); + } else { + push (@ldlibs, $_); + } +} + +# teach MakeMaker some VPATH $< manners: +sub c_o { + my $inherited = shift->SUPER::c_o(@_); + $inherited =~ s/(\.\w+\$\(OBJ_EXT\)\:\n\t.*?)\$\*\.\w+/$1\$\SUPER::xs_c(@_); + $inherited =~ s/(\.xs\.c\:\n\t.*?)\$\*\.\w+/$1\$\SUPER::xs_o(@_); + $inherited =~ s/(\.\w+\$\(OBJ_EXT\)\:\n\t.*?)\$\*\.\w+/$1\$\ 'RPM', + 'OBJECT' => join(' ', @objects), + 'VERSION' => '@VERSION@', + 'MAKEFILE'=> 'Makefile.perl', + 'CCFLAGS' => join(' ', '@CFLAGS@', '-Wno-unused-variable', '-Wno-missing-prototypes', '-Wno-implicit', '-Wno-strict-prototypes'), + 'dynamic_lib' => { + OTHERLDFLAGS => join(' ', @ldaddp, @ldadd, @ldlibs, @ldaddr) + }, + 'OPTIMIZE'=> '-g', + 'INC' => join(' ', @cppflags, map { '-I@top_srcdir@/'. $_ } @libdir) . ' @CPPFLAGS@', + 'INSTALLMAN1DIR' => '@mandir@/man1', + 'INSTALLMAN3DIR' => '@mandir@/man3', + @PERL_INSTALLDIRS@ +); diff --git a/rpm-5.4.9/perl/Makefile.am b/rpm-5.4.9/perl/Makefile.am new file mode 100644 index 0000000..9ae4bac --- /dev/null +++ b/rpm-5.4.9/perl/Makefile.am @@ -0,0 +1,66 @@ +# Makefile for rpm scripts. + +AUTOMAKE_OPTIONS = 1.4 foreign + +EXTRA_DIST = \ + typemap \ + Makefile.PL.in \ + rpmxs.c rpmxs.h \ + RPM.xs RPM.pm t/01.rpm.t \ + RPM/Constant.pm RPM_Constant.xs t/02.rpmconstant.t \ + RPM_Header.xs RPM/Header.pm t/03.header.t \ + RPM_Transaction.xs RPM/Transaction.pm t/04.transaction.t \ + RPM_PackageIterator.xs RPM/PackageIterator.pm t/05.packageiterator.t \ + RPM_Problems.xs RPM/Problems.pm t/06.problems.t \ + RPM_Files.xs RPM/Files.pm t/07.files.t \ + RPM_Dependencies.xs RPM/Dependencies.pm t/08.dependencies.t \ + RPM_Spec.xs RPM/Spec.pm t/09.spec.t \ + RPM/Sign.pm t/10.sign.t + t/00.pod.coverage.t t/00.pod.t \ + t/gnupg/passphrase t/gnupg/pubring.gpg t/gnupg/random_seed \ + t/gnupg/secring.gpg t/gnupg/test-key.gpg t/gnupg/trustdb.gpg \ + hdlist-test.hdr test-rpm-1.0-1.noarch.rpm test-rpm-1.0-1.src.rpm \ + test-rpm.spec + +noinst_DATA = .made_mod + +.made_mod: Makefile.perl $(EXTRA_DIST) MANIFEST + $(MAKE) -f Makefile.perl VPATH=$(VPATH) || \ + $(MAKE) -f Makefile.perl VPATH=$(VPATH) + +test: .made_mod + $(MAKE) -f Makefile.perl test + +MANIFEST: Makefile + echo -n > MANIFEST + for i in $(EXTRA_DIST); do \ + echo $$i >> MANIFEST; \ + done + +Makefile.perl: Makefile.PL + $(PERL) Makefile.PL MAKEFILE=$@ + +install-data-local: + $(MAKE) -f Makefile.perl PREFIX=$(prefix) install || \ + $(MAKE) -f Makefile.perl PREFIX=$(prefix) install + +CLEANFILES = *~ + +.PHONY: test + +LTLIBS = \ + @abs_top_builddir@/rpmconstant/.libs \ + @abs_top_builddir@/build/.libs \ + @abs_top_builddir@/lib/.libs \ + @abs_top_builddir@/rpmdb/.libs \ + @abs_top_builddir@/rpmio/.libs \ + @abs_top_builddir@/misc/.libs \ + @abs_top_builddir@/popt/.libs + +check-local: + -env LD_LIBRARY_PATH="`echo $(LTLIBS) | tr ' ' ':'`" $(MAKE) -f Makefile.perl test + +clean-local: + if [ -f Makefile.perl ]; then $(MAKE) -f Makefile.perl realclean; fi + rm -f Makefile.perl Makefile.perl.old + diff --git a/rpm-5.4.9/perl/Makefile.in b/rpm-5.4.9/perl/Makefile.in new file mode 100644 index 0000000..5626e71 --- /dev/null +++ b/rpm-5.4.9/perl/Makefile.in @@ -0,0 +1,783 @@ +# Makefile.in generated by automake 1.11.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ + +# Makefile for rpm scripts. + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +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@ +target_triplet = @target@ +subdir = perl +DIST_COMMON = README $(srcdir)/Makefile.PL.in $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = Makefile.PL +CONFIG_CLEAN_VPATH_FILES = +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 +DATA = $(noinst_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDROOTDIR_MACRO = @BUILDROOTDIR_MACRO@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBAPI = @DBAPI@ +DBLIBOBJS = @DBLIBOBJS@ +DBLIBSRCS = @DBLIBSRCS@ +DBPATH = @DBPATH@ +DBPATH_MACRO = @DBPATH_MACRO@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISTRO_MACROS = @DISTRO_MACROS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIXPERMS = @FIXPERMS@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GPSEE_MODULES_PATH = @GPSEE_MODULES_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_STATIC = @LDFLAGS_STATIC@ +LD_VERSION_SCRIPT_FLAG = @LD_VERSION_SCRIPT_FLAG@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOLIZE = @LIBTOOLIZE@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MACROFILES = @MACROFILES@ +MAGIC_MACRO = @MAGIC_MACRO@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR = @MKDIR@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NCPUS_COMMAND = @NCPUS_COMMAND@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENMP_CFLAGS = @OPENMP_CFLAGS@ +OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_INSTALLDIRS = @PERL_INSTALLDIRS@ +PERL_URPM_INSTALLDIRS = @PERL_URPM_INSTALLDIRS@ +PKGSRCDIR = @PKGSRCDIR@ +PKGSRCDIR_MACRO = @PKGSRCDIR_MACRO@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +ROOT_GROUP = @ROOT_GROUP@ +RPMCANONARCH = @RPMCANONARCH@ +RPMCANONCOLOR = @RPMCANONCOLOR@ +RPMCANONGNU = @RPMCANONGNU@ +RPMCANONOS = @RPMCANONOS@ +RPMCANONVENDOR = @RPMCANONVENDOR@ +RPMGID = @RPMGID@ +RPMGROUP = @RPMGROUP@ +RPMLUAFILES = @RPMLUAFILES@ +RPMPOPTFILES = @RPMPOPTFILES@ +RPMUID = @RPMUID@ +RPMUSER = @RPMUSER@ +RPM_TIMESTAMP = @RPM_TIMESTAMP@ +RPM_VENDOR = @RPM_VENDOR@ +RPM_VERSION = @RPM_VERSION@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFIGDIR = @SYSCONFIGDIR@ +USE_NLS = @USE_NLS@ +USRLIBRPM = @USRLIBRPM@ +VERSION = @VERSION@ +WITH_ACL = @WITH_ACL@ +WITH_APIDOCS = @WITH_APIDOCS@ +WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ +WITH_APR = @WITH_APR@ +WITH_ATERM = @WITH_ATERM@ +WITH_ATTR = @WITH_ATTR@ +WITH_AUGEAS = @WITH_AUGEAS@ +WITH_AUGEAS_AUGTOOL = @WITH_AUGEAS_AUGTOOL@ +WITH_BASH = @WITH_BASH@ +WITH_BASH_CPPFLAGS = @WITH_BASH_CPPFLAGS@ +WITH_BASH_LDFLAGS = @WITH_BASH_LDFLAGS@ +WITH_BASH_LIBS = @WITH_BASH_LIBS@ +WITH_BASH_SUBDIR = @WITH_BASH_SUBDIR@ +WITH_BEECRYPT = @WITH_BEECRYPT@ +WITH_BEECRYPT_CPPFLAGS = @WITH_BEECRYPT_CPPFLAGS@ +WITH_BEECRYPT_LDFLAGS = @WITH_BEECRYPT_LDFLAGS@ +WITH_BEECRYPT_LIBS = @WITH_BEECRYPT_LIBS@ +WITH_BEECRYPT_SUBDIR = @WITH_BEECRYPT_SUBDIR@ +WITH_BZIP2 = @WITH_BZIP2@ +WITH_CPUINFO = @WITH_CPUINFO@ +WITH_CUDF = @WITH_CUDF@ +WITH_CUDF_CUDFTOOL = @WITH_CUDF_CUDFTOOL@ +WITH_DB = @WITH_DB@ +WITH_DBSQL = @WITH_DBSQL@ +WITH_DBSQL_CPPFLAGS = @WITH_DBSQL_CPPFLAGS@ +WITH_DBSQL_LDFLAGS = @WITH_DBSQL_LDFLAGS@ +WITH_DBSQL_LIBS = @WITH_DBSQL_LIBS@ +WITH_DBSQL_SUBDIR = @WITH_DBSQL_SUBDIR@ +WITH_DB_CPPFLAGS = @WITH_DB_CPPFLAGS@ +WITH_DB_LDFLAGS = @WITH_DB_LDFLAGS@ +WITH_DB_LIBS = @WITH_DB_LIBS@ +WITH_DB_SUBDIR = @WITH_DB_SUBDIR@ +WITH_DMALLOC = @WITH_DMALLOC@ +WITH_EFENCE = @WITH_EFENCE@ +WITH_EXPAT = @WITH_EXPAT@ +WITH_FICL = @WITH_FICL@ +WITH_FICL_CPPFLAGS = @WITH_FICL_CPPFLAGS@ +WITH_FICL_LDFLAGS = @WITH_FICL_LDFLAGS@ +WITH_FICL_LIBS = @WITH_FICL_LIBS@ +WITH_FICL_SUBDIR = @WITH_FICL_SUBDIR@ +WITH_FILE = @WITH_FILE@ +WITH_FILE_CPPFLAGS = @WITH_FILE_CPPFLAGS@ +WITH_FILE_LDFLAGS = @WITH_FILE_LDFLAGS@ +WITH_FILE_LIBS = @WITH_FILE_LIBS@ +WITH_FILE_SUBDIR = @WITH_FILE_SUBDIR@ +WITH_GCRYPT = @WITH_GCRYPT@ +WITH_GNUTLS = @WITH_GNUTLS@ +WITH_GPSEE = @WITH_GPSEE@ +WITH_GPSEE_CPPFLAGS = @WITH_GPSEE_CPPFLAGS@ +WITH_GPSEE_LDFLAGS = @WITH_GPSEE_LDFLAGS@ +WITH_GPSEE_LIBS = @WITH_GPSEE_LIBS@ +WITH_GPSEE_SUBDIR = @WITH_GPSEE_SUBDIR@ +WITH_JS_SUBDIR = @WITH_JS_SUBDIR@ +WITH_KEYUTILS = @WITH_KEYUTILS@ +WITH_KEYUTILS_RPMKEY = @WITH_KEYUTILS_RPMKEY@ +WITH_LIBELF_DEBUGEDIT = @WITH_LIBELF_DEBUGEDIT@ +WITH_LIBGIT2 = @WITH_LIBGIT2@ +WITH_LIBGIT2_CPPFLAGS = @WITH_LIBGIT2_CPPFLAGS@ +WITH_LIBGIT2_LDFLAGS = @WITH_LIBGIT2_LDFLAGS@ +WITH_LIBGIT2_LIBS = @WITH_LIBGIT2_LIBS@ +WITH_LIBGIT2_SUBDIR = @WITH_LIBGIT2_SUBDIR@ +WITH_LIBTASN1 = @WITH_LIBTASN1@ +WITH_LUA = @WITH_LUA@ +WITH_LUA_CPPFLAGS = @WITH_LUA_CPPFLAGS@ +WITH_LUA_LDFLAGS = @WITH_LUA_LDFLAGS@ +WITH_LUA_LIBS = @WITH_LUA_LIBS@ +WITH_LUA_SUBDIR = @WITH_LUA_SUBDIR@ +WITH_LUA_SUBDIR_DEF = @WITH_LUA_SUBDIR_DEF@ +WITH_LUA_SUBDIR_LIB = @WITH_LUA_SUBDIR_LIB@ +WITH_MOZJS185 = @WITH_MOZJS185@ +WITH_MOZJS185_CPPFLAGS = @WITH_MOZJS185_CPPFLAGS@ +WITH_MOZJS185_LDFLAGS = @WITH_MOZJS185_LDFLAGS@ +WITH_MOZJS185_LIBS = @WITH_MOZJS185_LIBS@ +WITH_MOZJS185_SUBDIR = @WITH_MOZJS185_SUBDIR@ +WITH_NEON = @WITH_NEON@ +WITH_NEON_CPPFLAGS = @WITH_NEON_CPPFLAGS@ +WITH_NEON_LDFLAGS = @WITH_NEON_LDFLAGS@ +WITH_NEON_LIBS = @WITH_NEON_LIBS@ +WITH_NEON_SUBDIR = @WITH_NEON_SUBDIR@ +WITH_NIX = @WITH_NIX@ +WITH_NSS = @WITH_NSS@ +WITH_OPENSSL = @WITH_OPENSSL@ +WITH_PAKCHOIS = @WITH_PAKCHOIS@ +WITH_PATH_VERSIONED = @WITH_PATH_VERSIONED@ +WITH_PATH_VERSIONED_SUFFIX = @WITH_PATH_VERSIONED_SUFFIX@ +WITH_PCRE = @WITH_PCRE@ +WITH_PCRE_CPPFLAGS = @WITH_PCRE_CPPFLAGS@ +WITH_PCRE_LDFLAGS = @WITH_PCRE_LDFLAGS@ +WITH_PCRE_LIBS = @WITH_PCRE_LIBS@ +WITH_PCRE_SUBDIR = @WITH_PCRE_SUBDIR@ +WITH_PERLEMBED = @WITH_PERLEMBED@ +WITH_PERL_LIBS = @WITH_PERL_LIBS@ +WITH_PERL_SUBDIR = @WITH_PERL_SUBDIR@ +WITH_PERL_SUBPACKAGE = @WITH_PERL_SUBPACKAGE@ +WITH_PERL_URPM_LIBS = @WITH_PERL_URPM_LIBS@ +WITH_PERL_URPM_SUBDIR = @WITH_PERL_URPM_SUBDIR@ +WITH_PERL_URPM_SUBPACKAGE = @WITH_PERL_URPM_SUBPACKAGE@ +WITH_POPT = @WITH_POPT@ +WITH_POPT_CPPFLAGS = @WITH_POPT_CPPFLAGS@ +WITH_POPT_LDFLAGS = @WITH_POPT_LDFLAGS@ +WITH_POPT_LIBS = @WITH_POPT_LIBS@ +WITH_POPT_SUBDIR = @WITH_POPT_SUBDIR@ +WITH_PYTHONEMBED = @WITH_PYTHONEMBED@ +WITH_PYTHON_INCDIR = @WITH_PYTHON_INCDIR@ +WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ +WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ +WITH_RC = @WITH_RC@ +WITH_RC_CPPFLAGS = @WITH_RC_CPPFLAGS@ +WITH_RC_LDFLAGS = @WITH_RC_LDFLAGS@ +WITH_RC_LIBS = @WITH_RC_LIBS@ +WITH_RC_SUBDIR = @WITH_RC_SUBDIR@ +WITH_READLINE = @WITH_READLINE@ +WITH_RUBY = @WITH_RUBY@ +WITH_RUBY_CPPFLAGS = @WITH_RUBY_CPPFLAGS@ +WITH_RUBY_SUBDIR = @WITH_RUBY_SUBDIR@ +WITH_RUBY_VENDORARCHDIR = @WITH_RUBY_VENDORARCHDIR@ +WITH_SELINUX = @WITH_SELINUX@ +WITH_SEMANAGE = @WITH_SEMANAGE@ +WITH_SEMANAGE_SEMODULE = @WITH_SEMANAGE_SEMODULE@ +WITH_SEPOL = @WITH_SEPOL@ +WITH_SPIDERMONKEY_SUBDIR = @WITH_SPIDERMONKEY_SUBDIR@ +WITH_SQLITE = @WITH_SQLITE@ +WITH_SQLITE_CPPFLAGS = @WITH_SQLITE_CPPFLAGS@ +WITH_SQLITE_LDFLAGS = @WITH_SQLITE_LDFLAGS@ +WITH_SQLITE_LIBS = @WITH_SQLITE_LIBS@ +WITH_SQLITE_SUBDIR = @WITH_SQLITE_SUBDIR@ +WITH_SQUIRREL = @WITH_SQUIRREL@ +WITH_SUBVERSION = @WITH_SUBVERSION@ +WITH_SYCK = @WITH_SYCK@ +WITH_SYCK_CPPFLAGS = @WITH_SYCK_CPPFLAGS@ +WITH_SYCK_LDFLAGS = @WITH_SYCK_LDFLAGS@ +WITH_SYCK_LIBS = @WITH_SYCK_LIBS@ +WITH_SYCK_SUBDIR = @WITH_SYCK_SUBDIR@ +WITH_TCL = @WITH_TCL@ +WITH_TCL_SUBDIR = @WITH_TCL_SUBDIR@ +WITH_TOMCRYPT = @WITH_TOMCRYPT@ +WITH_TPM = @WITH_TPM@ +WITH_UNIXODBC = @WITH_UNIXODBC@ +WITH_UUID = @WITH_UUID@ +WITH_XAR = @WITH_XAR@ +WITH_XAR_CPPFLAGS = @WITH_XAR_CPPFLAGS@ +WITH_XAR_LDFLAGS = @WITH_XAR_LDFLAGS@ +WITH_XAR_LIBS = @WITH_XAR_LIBS@ +WITH_XAR_SUBDIR = @WITH_XAR_SUBDIR@ +WITH_XZ = @WITH_XZ@ +WITH_XZ_CPPFLAGS = @WITH_XZ_CPPFLAGS@ +WITH_XZ_LDFLAGS = @WITH_XZ_LDFLAGS@ +WITH_XZ_LIBS = @WITH_XZ_LIBS@ +WITH_XZ_SUBDIR = @WITH_XZ_SUBDIR@ +WITH_ZLIB = @WITH_ZLIB@ +WITH_ZLIB_CPPFLAGS = @WITH_ZLIB_CPPFLAGS@ +WITH_ZLIB_LDFLAGS = @WITH_ZLIB_LDFLAGS@ +WITH_ZLIB_LIBS = @WITH_ZLIB_LIBS@ +WITH_ZLIB_SUBDIR = @WITH_ZLIB_SUBDIR@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__BASH = @__BASH@ +__BZIP2 = @__BZIP2@ +__CAT = @__CAT@ +__CHATTR = @__CHATTR@ +__CHGRP = @__CHGRP@ +__CHGRP_RHF = @__CHGRP_RHF@ +__CHMOD = @__CHMOD@ +__CHOWN = @__CHOWN@ +__CHOWN_RHF = @__CHOWN_RHF@ +__CMAKE = @__CMAKE@ +__CPIO = @__CPIO@ +__CURL = @__CURL@ +__CVS = @__CVS@ +__DBSQL = @__DBSQL@ +__DB_ARCHIVE = @__DB_ARCHIVE@ +__DB_CHECKPOINT = @__DB_CHECKPOINT@ +__DB_DEADLOCK = @__DB_DEADLOCK@ +__DB_DUMP = @__DB_DUMP@ +__DB_HOTBACKUP = @__DB_HOTBACKUP@ +__DB_LOAD = @__DB_LOAD@ +__DB_LOG_VERIFY = @__DB_LOG_VERIFY@ +__DB_PRINTLOG = @__DB_PRINTLOG@ +__DB_RECOVER = @__DB_RECOVER@ +__DB_REPLICATE = @__DB_REPLICATE@ +__DB_SQL_CODEGEN = @__DB_SQL_CODEGEN@ +__DB_STAT = @__DB_STAT@ +__DB_TUNER = @__DB_TUNER@ +__DB_UPGRADE = @__DB_UPGRADE@ +__DB_VERIFY = @__DB_VERIFY@ +__DIFF = @__DIFF@ +__DITTO = @__DITTO@ +__DOXYGEN = @__DOXYGEN@ +__FILE = @__FILE@ +__GIT = @__GIT@ +__GPG = @__GPG@ +__GSR = @__GSR@ +__GST_INSPECT = @__GST_INSPECT@ +__GZIP = @__GZIP@ +__HG = @__HG@ +__ID = @__ID@ +__ID_U = @__ID_U@ +__INSTALL = @__INSTALL@ +__INSTALL_INFO = @__INSTALL_INFO@ +__LD = @__LD@ +__LDCONFIG = @__LDCONFIG@ +__LN = @__LN@ +__LRZIP = @__LRZIP@ +__LSATTR = @__LSATTR@ +__LZIP = @__LZIP@ +__LZMA = @__LZMA@ +__LZOP = @__LZOP@ +__MAKE = @__MAKE@ +__MKDIR = @__MKDIR@ +__MKDIR_P = @__MKDIR_P@ +__MODINFO = @__MODINFO@ +__MONGO = @__MONGO@ +__MV = @__MV@ +__NM = @__NM@ +__OBJCOPY = @__OBJCOPY@ +__OBJDUMP = @__OBJDUMP@ +__PATCH = @__PATCH@ +__PAX = @__PAX@ +__PERL = @__PERL@ +__PGP = @__PGP@ +__PHP = @__PHP@ +__PYTHON = @__PYTHON@ +__RM = @__RM@ +__RMDIR = @__RMDIR@ +__RSH = @__RSH@ +__RUBY = @__RUBY@ +__SED = @__SED@ +__SH = @__SH@ +__SQLITE3 = @__SQLITE3@ +__SSH = @__SSH@ +__STRIP = @__STRIP@ +__SVN = @__SVN@ +__TAR = @__TAR@ +__TCLSH = @__TCLSH@ +__UNZIP = @__UNZIP@ +__XZ = @__XZ@ +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_CXX = @ac_ct_CXX@ +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@ +autorelocate_dcolor = @autorelocate_dcolor@ +autorelocate_path = @autorelocate_path@ +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@ +exeext = @exeext@ +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@ +libext = @libext@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +objext = @objext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +shlibext = @shlibext@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +testdir = @testdir@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +usrprefix = @usrprefix@ +varprefix = @varprefix@ +AUTOMAKE_OPTIONS = 1.4 foreign +EXTRA_DIST = \ + typemap \ + Makefile.PL.in \ + rpmxs.c rpmxs.h \ + RPM.xs RPM.pm t/01.rpm.t \ + RPM/Constant.pm RPM_Constant.xs t/02.rpmconstant.t \ + RPM_Header.xs RPM/Header.pm t/03.header.t \ + RPM_Transaction.xs RPM/Transaction.pm t/04.transaction.t \ + RPM_PackageIterator.xs RPM/PackageIterator.pm t/05.packageiterator.t \ + RPM_Problems.xs RPM/Problems.pm t/06.problems.t \ + RPM_Files.xs RPM/Files.pm t/07.files.t \ + RPM_Dependencies.xs RPM/Dependencies.pm t/08.dependencies.t \ + RPM_Spec.xs RPM/Spec.pm t/09.spec.t \ + RPM/Sign.pm t/10.sign.t + +noinst_DATA = .made_mod +CLEANFILES = *~ +LTLIBS = \ + @abs_top_builddir@/rpmconstant/.libs \ + @abs_top_builddir@/build/.libs \ + @abs_top_builddir@/lib/.libs \ + @abs_top_builddir@/rpmdb/.libs \ + @abs_top_builddir@/rpmio/.libs \ + @abs_top_builddir@/misc/.libs \ + @abs_top_builddir@/popt/.libs + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 perl/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign perl/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +Makefile.PL: $(top_builddir)/config.status $(srcdir)/Makefile.PL.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile $(DATA) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-local mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +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: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-am check-local clean clean-generic \ + clean-libtool clean-local 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 uninstall uninstall-am + + t/00.pod.coverage.t t/00.pod.t \ + t/gnupg/passphrase t/gnupg/pubring.gpg t/gnupg/random_seed \ + t/gnupg/secring.gpg t/gnupg/test-key.gpg t/gnupg/trustdb.gpg \ + hdlist-test.hdr test-rpm-1.0-1.noarch.rpm test-rpm-1.0-1.src.rpm \ + test-rpm.spec + +.made_mod: Makefile.perl $(EXTRA_DIST) MANIFEST + $(MAKE) -f Makefile.perl VPATH=$(VPATH) || \ + $(MAKE) -f Makefile.perl VPATH=$(VPATH) + +test: .made_mod + $(MAKE) -f Makefile.perl test + +MANIFEST: Makefile + echo -n > MANIFEST + for i in $(EXTRA_DIST); do \ + echo $$i >> MANIFEST; \ + done + +Makefile.perl: Makefile.PL + $(PERL) Makefile.PL MAKEFILE=$@ + +install-data-local: + $(MAKE) -f Makefile.perl PREFIX=$(prefix) install || \ + $(MAKE) -f Makefile.perl PREFIX=$(prefix) install + +.PHONY: test + +check-local: + -env LD_LIBRARY_PATH="`echo $(LTLIBS) | tr ' ' ':'`" $(MAKE) -f Makefile.perl test + +clean-local: + if [ -f Makefile.perl ]; then $(MAKE) -f Makefile.perl realclean; fi + rm -f Makefile.perl Makefile.perl.old + +# 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/rpm-5.4.9/perl/README b/rpm-5.4.9/perl/README new file mode 100644 index 0000000..88ffa6e --- /dev/null +++ b/rpm-5.4.9/perl/README @@ -0,0 +1,35 @@ +RPM version 0.01 +================= + +The README is used to introduce the module and provide instructions on +how to install the module, any machine dependencies it may have (for +example C compilers and installed libraries) and any other information +that should be provided before the module is installed. + +A README file is required for CPAN modules since CPAN extracts the +README file from a module distribution so that people browsing the +archive can use it get an idea of the modules uses. It is usually a +good idea to provide version information here so that people can +decide whether fixes for the module are worth downloading. + +INSTALLATION + +To install this module type the following: + + perl Makefile.PL + make + make test + make install + +DEPENDENCIES + +This module requires these other modules and libraries: + + blah blah blah + +COPYRIGHT AND LICENCE + +Put the correct copyright and licence information here. + +Copyright (C) 2001 A. U. Thor blah blah blah + diff --git a/rpm-5.4.9/perl/RPM.pm b/rpm-5.4.9/perl/RPM.pm new file mode 100644 index 0000000..ecfc478 --- /dev/null +++ b/rpm-5.4.9/perl/RPM.pm @@ -0,0 +1,197 @@ +package RPM; + +use 5.00503; +use strict; +use DynaLoader; +use Exporter; +use Cwd qw/realpath/; +use File::Basename qw/basename dirname/; +use File::Spec (); + +use vars qw/@ISA @EXPORT/; +@ISA = qw/DynaLoader Exporter/; + +@EXPORT = qw( + rpmlog + setlogcallback + setlogfile + lastlogmsg + setverbosity + rpmvercmp + add_macro + delete_macro + load_macro_file + reset_macros + dump_macros + platformscore + installsrpm +); + +bootstrap RPM; + +1; + +__END__ +# Below is stub documentation for your module. You better edit it! + +=head1 NAME + +RPM - Perl bindings for the RPM Package Manager API + +=head1 SYNOPSIS + + use RPM; + +=head1 DESCRIPTION + +The RPM module provides an object-oriented interface to querying both +the installed RPM database as well as files on the filesystem. + +=head1 FUNCTIONS + +=head2 installsrpm($filename) + +Install a source rpm and return spec file path and its cookies. +Returns undef if install is impossible. + +see L->new() for more information about cookies. + +=head2 GENERICS FUNCTIONS + +=head3 rpmversion + +Return the rpm version which is also the module version: + + RPM::rpmversion(); # return 5.0.DEVEL currently ;) + +=head2 MACROS FUNCTIONS + +=head3 expand_macro($string) + +Return the string after macros expansion: + + expand_macro('%_dbpath'); # will return '/var/lib/rpm' on most system, + # depending of your config + expand_macro('%{?_dbpath:is set}'); # will return is set, normally... :) + +=head3 add_macro($string) + +Set or overide a macro, the format to use is the macro name (w/o %) follow +by its definition: + + add_macro('_anymacros anyvalue'); + print expand_macro('%_anymacros'); # show 'anyvalue' + +=head3 delete_macro($macro) + +Delete a macro definition: + + delete_macro('_anymacros'); + +=head3 dump_macros($handle) + +Dump macros all macros currently defined into $handle. If $handle is missing, +STDOUT is used. + +=head3 load_macro_file($file) + +Load a macro file. + +=head3 reset_macros + +Reset all macros to default config (aka from rpm configuration). + +=head2 PLATFORM FUNCTIONS + +=head3 setverbosity($verbosity) + +Set the global verbosity of rpmlib. + +=head3 rpmvercmp($verA, $verB) + +Compare two version (or release, not both) and return: + * -1 verA < verB + * 0 verA = verB + * 1 verA > verB + + rpmvercmp('1', '1.1'); # return 1 + # This works but will not give the expected result: + rpmvercmp('1-1', '1.1-2') # return -1 + +=head3 platformscore($platform) + +Return the score of platform according your rpm configuration, +0 if not compatible. + + # on x86_64 under Mandriva Linux: + platformscore("i586-mandriva-linux-gnu"); + # return 8 here + platformscore("ppc-mandriva-linux-gnu"); + # return 0 + +=head2 LOG AND VERBOSITY FUNCTIONS + +=head3 lastlogmsg + +Return the last message give by rpm. In array context return both +the erreur level and message: + + my $message = rpmlog(); + my ($code, $message) = rpmlog(); + +=head3 rpmlog($err_level, $message) + +Log a message using rpm API. + +=head3 setlogcallback + +DEPRECATED ? + +=head3 setlogfile + +DEPRECATED ? + + +=head1 TODO + +Make package installation and removal better (-;. + +Signature validation. + +=head2 resign +Resign a package. + +=head1 HISTORY + +=over 8 + +=item 0.5 + +Massive Rework: + +=item 0.01 + +Initial release + +=back + + +=head1 AUTHOR + +Olivier Thauvin Enanardon@rpm5.orgE + +Original author: + +Chip Turner Ecturner@redhat.comE + +=head1 SEE ALSO + +L. +L +L +L +L +L +L + +=cut diff --git a/rpm-5.4.9/perl/RPM.xs b/rpm-5.4.9/perl/RPM.xs new file mode 100644 index 0000000..d68cd0a --- /dev/null +++ b/rpm-5.4.9/perl/RPM.xs @@ -0,0 +1,241 @@ +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +#undef Fflush +#undef Mkdir +#undef Stat +#undef Fstat + +#include +#include +#include +#include + +#include "rpmio.h" +#include "rpmiotypes.h" +#include "rpmcb.h" +#include "rpmmacro.h" +#include "rpmtypes.h" +#include "rpmtag.h" +#include "rpmdb.h" +#include "rpmversion.h" +#include "rpmrc.h" +#include "rpmts.h" +#include "rpmte.h" +#include "rpmevr.h" +#include "rpmcli.h" +#include "misc.h" + +/* The perl callback placeholder for output err messages */ +SV * log_callback_function = NULL; + +/* This function is called by rpm if a callback + * is set for for the logging system. + * If the callback is set, rpm does not print any message, + * and let the callback to do it */ +static int logcallback(rpmlogRec rec, rpmlogCallbackData data) { + dSP; + if (log_callback_function) { + int logcode = rpmlogCode(); + PUSHMARK(SP); + XPUSHs(sv_2mortal(newSVpv("logcode", 0))); + XPUSHs(sv_2mortal(newSViv(logcode))); + XPUSHs(sv_2mortal(newSVpv("msg", 0))); + XPUSHs(sv_2mortal(newSVpv(rpmlogMessage(), 0))); + XPUSHs(sv_2mortal(newSVpv("priority", 0))); + XPUSHs(sv_2mortal(newSViv(RPMLOG_PRI(logcode)))); + PUTBACK; + call_sv(log_callback_function, G_DISCARD | G_SCALAR); + SPAGAIN; + return 0; + } + return RPMLOG_DEFAULT; +} + +MODULE = RPM PACKAGE = RPM + +PROTOTYPES: ENABLE + +#define crutch_stack_wrap(directive) do { \ + PUSHMARK(SP); \ + PUTBACK; \ + directive; \ + SPAGAIN; \ + PUTBACK; \ +} while(0) + +BOOT: + crutch_stack_wrap(boot_RPM__Constant(aTHX_ cv)); + crutch_stack_wrap(boot_RPM__Header(aTHX_ cv)); + crutch_stack_wrap(boot_RPM__Transaction(aTHX_ cv)); + crutch_stack_wrap(boot_RPM__PackageIterator(aTHX_ cv)); + crutch_stack_wrap(boot_RPM__Problems(aTHX_ cv)); + crutch_stack_wrap(boot_RPM__Files(aTHX_ cv)); + crutch_stack_wrap(boot_RPM__Dependencies(aTHX_ cv)); + crutch_stack_wrap(boot_RPM__Spec(aTHX_ cv)); + rpmReadConfigFiles(NULL, NULL); + +# +# Macro functions +# + +void +rpmversion() + PPCODE: + XPUSHs(sv_2mortal(newSVpv(RPMVERSION, 0))); + +void +add_macro(macro) + char * macro + CODE: + rpmDefineMacro(NULL, macro, 0); + +void +delete_macro(name) + char * name + CODE: + delMacro(NULL, name); + +void +expand_macro(string) + char * string + PREINIT: + char *ret = NULL; + PPCODE: + ret = rpmExpand(string, NULL); + XPUSHs(sv_2mortal(newSVpv(ret, 0))); + free(ret); + +int +load_macro_file(filename) + char * filename + CODE: + RETVAL= ! rpmLoadMacroFile(NULL, filename, 0); /* return False on error */ + OUTPUT: + RETVAL + +void +reset_macros() + PPCODE: + rpmFreeMacros(NULL); + +void +dump_macros(fp = stdout) + FILE *fp + CODE: + rpmDumpMacroTable(NULL, fp); + +# +# Scoring functions +# + +int +rpmvercmp(one, two) + char* one + char* two + +int +platformscore(platform) + const char * platform + CODE: + RETVAL=rpmPlatformScore(platform, NULL, 0); + OUTPUT: + RETVAL + + +# +# Verbosity & log functions +# + +void +setverbosity(svlevel) + SV * svlevel + CODE: + rpmSetVerbosity(sv2constant(svlevel, "rpmlog")); + +void +lastlogmsg() + PPCODE: + if (GIMME_V == G_ARRAY) + XPUSHs(sv_2mortal(newSViv(rpmlogCode()))); + XPUSHs(sv_2mortal(newSVpv(rpmlogMessage(), 0))); + +int +setlogfile(filename) + char * filename + PREINIT: + FILE * ofp = NULL; + FILE * fp = NULL; + CODE: + if (filename && *filename != 0) { + if ((fp = fopen(filename, "a+")) == NULL) { + XSprePUSH; PUSHi((IV)0); + XSRETURN(1); + } + } + if((ofp = rpmlogSetFile(fp)) != NULL) + fclose(ofp); + RETVAL=1; + OUTPUT: + RETVAL + +void +setlogcallback(function = NULL) + SV * function + CODE: + if (function == NULL || !SvOK(function)) { + if (log_callback_function) { + SvREFCNT_dec(log_callback_function); + log_callback_function = NULL; + } + rpmlogSetCallback(NULL, NULL); + } else if (SvTYPE(SvRV(function)) == SVt_PVCV) { + if (log_callback_function) { + SvREFCNT_dec(log_callback_function); + log_callback_function = NULL; + } + SvREFCNT_inc(function); + log_callback_function = newSVsv(function); + rpmlogSetCallback(logcallback, (rpmlogCallbackData) NULL); + } else + croak("First arg is not a code reference"); + +void +rpmlog(svcode, msg) + SV * svcode + char * msg + CODE: + rpmlog(sv2constant(svcode, "rpmlog"), "%s", msg); + +void +installsrpm(filename, sv_vsflags = NULL) + char * filename + SV * sv_vsflags + PREINIT: + rpmts ts = rpmtsCreate(); + rpmVSFlags vsflags = RPMVSF_DEFAULT; + PPCODE: + vsflags = sv2constant((sv_vsflags), "rpmvsflags"); + rpmtsSetVSFlags(ts, vsflags); + PUTBACK; + _installsrpms(ts, filename); + SPAGAIN; + (void)rpmtsFree(ts); + ts = NULL; + +int +resign(passphrase, rpmfile) + char * passphrase + char * rpmfile + CODE: + QVA_t qva = &rpmQVKArgs; + const char *file[] = { (const char*)rpmfile, NULL }; + + qva->qva_mode = RPMSIGN_ADD_SIGNATURE; + qva->passPhrase = passphrase; + + RETVAL = rpmcliSign(NULL, qva, file); + OUTPUT: + RETVAL + diff --git a/rpm-5.4.9/perl/RPM/Constant.pm b/rpm-5.4.9/perl/RPM/Constant.pm new file mode 100644 index 0000000..7870012 --- /dev/null +++ b/rpm-5.4.9/perl/RPM/Constant.pm @@ -0,0 +1,67 @@ +package RPM::Constant; + +use strict; +use Exporter; +use RPM; + +our @ISA = qw(Exporter); + +our @EXPORT = qw( + listallcontext + listcontext + getvalue +); + +=head1 NAME + +RPM::Constant + +=head1 DESCRIPTION + +RPM::Constant provide function to map internal C value use inside rpm +to textual value anybody can use in all RPM modules. + +=head1 SYNOPSIS + + use RPM::Constant; + + my $value = getvalue("anyflagset", "anyflags"); + if (defined($value)) { + print "Value: $value\n"; + } else { + print STDERR "cannot find anyflags in anyflagset\n"; + } + +=head1 FUNCTIONS + +=head2 listallcontext + +Return an array listing all existing context, aka flags type. + +=head2 listcontext(contextname) + +Return all textuals value handle in a context, undef if B does +not exists. + +=head2 getvalue(contextname, value) + +Return the internal C value for B textual value, undef B in +B cannot be found. + +=cut + +# currently everything is in the XS code + +1; + +__END__ + +=head1 AUTHOR + +Olivier Thauvin + +=head1 LICENSE + +This software is under GPL, refer to rpm license for details. + +=cut diff --git a/rpm-5.4.9/perl/RPM/Dependencies.pm b/rpm-5.4.9/perl/RPM/Dependencies.pm new file mode 100644 index 0000000..ea92484 --- /dev/null +++ b/rpm-5.4.9/perl/RPM/Dependencies.pm @@ -0,0 +1,113 @@ +package RPM::Dependencies; + +use strict; +use RPM; +use RPM::Header; + + +=head1 NAME + +RPM::Dependencies + +=head1 DESCRIPTION + +B is an iterator over a list of dependencies. +The object is designed to use only few memory. + +=head1 SYNOPSIS + + my $header = rpm2header('test-rpm-1.0-1.noarch.rpm'); + my $deps = RPM::Dependencies->new($header, "REQUIRENAME"); + while ($deps->next) { + print $deps->name . "\n"; + } + +=head1 FUNCTIONS + +=head2 new($header, $tag) + +Create a new B set from $header for $tag type dependencies. + +=head2 $ds->count + +Return the count of dependencies in set + +=head2 $ds->index + +Return the current internal index pointer + +=head2 $ds->set_index($idx) + +Set the internal index pointer to $idx + +=cut + +sub set_index() { + my ($self, $index) = @_; + $self->init; + foreach (0 .. $index) { + $self->next or return; + } + 1; +} + +=head2 $ds->init + +Initialize the structure for next() call + +=head2 $ds->next + +Point to next dependencies inside the set. Return the previous index. + +The function allways return "True", in the case previous index was 0, it return +"0E0" which is still 0 in an integer context. + +=head2 $ds->name + +Return the name of the dependency at current index. + +=head2 $ds->flags + +Return the dependency flags at current index. + +=head2 $ds->evr + +Return the evr part of dependency at current index if any. + +=head2 $ds->color + +Return the color of dependency at current index + +=head2 $ds->tag + +Return the tag type of the dependencies set. + +=head2 $tag->create($tag, $name, $flags, $evr) + +Create a new B object with one entry. + +=head2 $tag->add($name, $flags, $evr) + +Add a new entry into the dependency set. + +=head2 $ds->overlap($ds2) + +Return True if both dependency at both index currently match. + +=cut + +# currently everything is in the XS code + +1; + +__END__ + +=head1 AUTHOR + +Olivier Thauvin + +=head1 LICENSE + +This software is under GPL, refer to rpm license for details. + +=cut diff --git a/rpm-5.4.9/perl/RPM/Files.pm b/rpm-5.4.9/perl/RPM/Files.pm new file mode 100644 index 0000000..fb3a1d0 --- /dev/null +++ b/rpm-5.4.9/perl/RPM/Files.pm @@ -0,0 +1,125 @@ +package RPM::Files; + +use strict; +use RPM; +use RPM::Header; + +=head1 NAME + +RPM::Files + +=head1 DESCRIPTION + +A files set iterator. + +=head1 FUNCTIONS + +=head2 new($header) + +Create a new B iterator from $header. $header is a +L object. + +=head2 $files->count + +Return the count of files inside the iterator. + +=head2 $files->init + +Prepare the file iterator for first L call + +=head2 $files->next + +Jump to next entry and return current internal index. The function return +"OEO" instead 0, which is true. Return nothing when last entry is reached. + +=head2 $files->count_dir + +Return the number of parent directory. + +=head2 $files->init_dir + +Preprare iterator for next_dir first call + +=head2 $files->next_dir + +Jump to next entry and return current internal index. The function return +"OEO" instead 0, which is true. Return nothing when last entry is reached. + +=head2 $files->filename + +Return the current filename + +=head2 $files->basename + +Return the current basename + +=head2 $files->dirname + +Return the parent directory path of current file + +=head2 $files->fflags + +Return the rpm file flags fo current file + +=head2 $files->mode + +Return the (unix) mode of current file + +=head2 $files->digest + +Return the digest of the file and the id of used algorythm. + +=head2 $files->link + +If the current file is a symlink, return the target path. + +=head2 $files->user + +Return the owner of the file. + +=head2 $files->group + +Return the group owning the file. + +=head2 $files->inode + +Return the inode number of the file. + +=head2 $files->size + +Return the size of the current file. + +=head2 $files->dev + +Return de device ID where the file is located. + +=head2 $files->color + +Return de file color of the current file. + +=head2 $files->class + +Return the class of the current file, aka the mime type as given +by L. + +=head2 $files->mtime + +Return the modification time of the current file. + +=cut + +# currently everything is in the XS code + +1; + +__END__ + +=head1 AUTHOR + +Olivier Thauvin + +=head1 LICENSE + +This software is under GPL, refer to rpm license for details. + +=cut diff --git a/rpm-5.4.9/perl/RPM/Header.pm b/rpm-5.4.9/perl/RPM/Header.pm new file mode 100644 index 0000000..aaa5fb1 --- /dev/null +++ b/rpm-5.4.9/perl/RPM/Header.pm @@ -0,0 +1,229 @@ +package RPM::Header; + +use strict; +use Exporter; +use RPM; +use vars qw($AUTOLOAD); + +use overload '<=>' => \&_op_spaceship, + 'cmp' => \&_op_spaceship, + 'bool' => \&_op_bool; + +our @ISA = qw(Exporter); + +our @EXPORT = qw( + stream2header + rpm2header +); + +=head1 NAME + +RPM::Header + +=head1 DESCRIPTION + +A module to perform action on rpm b
. + +The header is a set of data containing information about a rpm archive. + +=head1 SINOPSYS + + use RPM::Header; + + my $header = rpm2header('any-1-1.noarch.rpm'); + print $header->header_sprintf('%{NAME}\n'); + # output "any" + carriage return + +=cut + +=head1 FUNCTIONS + +=head2 rpm2header(rpmfile, vsflags) + +Read a rpm archive and return a RPM::Header object on success, return undef +on error. + +B (optional) is either an integer value, either an arrayref +containing textual values. See L. + +=head2 stream2header(filehandle) + +Read all header store into a file from an open file handle. + +Two usage: + +=over 4 + +=item stream2header(filehandle) + +stream2header return an array b object. + +=item stream2header(filehandle, $callback) + +The function nothing, for each header read, $callback function is called +with 'RPM::Header' passed as argument. + +=back + +=cut + +=head1 RPM::Header FUNCTIONS + +In addition to the following methods, all tags have simple accessors; +$hdr->epoch() is equivalent to $hdr->tag('epoch'). + +The <=> and cmp operators can be used to compare versions of two packages. + +=cut + +# proxify calls to $header->tag() +sub AUTOLOAD { + my ($header) = @_; + + my $tag = $AUTOLOAD; + $tag =~ s/.*:://; + return $header->tag($tag); +} + +sub _op_bool { + my ($self) = @_; + return (defined($self) && ref($self) eq 'RPM::Header'); +} + +=head2 $hdr->listtag + +Return an array listing all tag set into the header. + +=head2 $hdr->hastag($tag) + +Return True is B<$tag> is set into the header. + +B<$tag> can be either the tagname, either the internal numeric value. + +=head2 $hdr->tagformat($format) + +Return a format string from header like rpm --qf. + +=head2 $hdr->tag($tag) + +Return tag content from the header, undef if tag is not set. + +B<$tag> can be either the tagname, either the internal numeric value. + +=head2 $hdr->tagtype($tag) + +Return the tag type from the header, undef if tag is not set. + +B<$tag> can be either the tagname, either the internal numeric value. + +=head2 $hdr->removetag($tag) + +Remove the tag from header. + +=head2 $hdr->addtag($tag, $tagtype, @value) + +Add a tag to the header. + +=head2 $hdr->compare($header) + +Compare two header. + +=head2 $hdr->is_source_package() + +Returns a true value if the package is a source package, false otherwise. + +=head2 $hdr->copy + +Return a B copy of the header. + +=head2 $hdr->hsize + +Return the size in byte of the header in it on disk rpresentation. + +=head2 $hdr->string + +Return a in memory string representation of $hdr + +=head2 $hdr->write($handle) + +Dump header into open file handle B<$handle>. + +=cut + +=head2 $hdr->changelog + +Returns a list of hash refs containing the change log data of the package. +The hash keys represent individual change log entries, and their keys are: +C